@kaitranntt/ccs 7.78.1 → 7.79.1-dev.1

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 (198) hide show
  1. package/dist/bin/ccsxp-runtime.d.ts +1 -0
  2. package/dist/bin/ccsxp-runtime.d.ts.map +1 -1
  3. package/dist/bin/ccsxp-runtime.js +2 -0
  4. package/dist/bin/ccsxp-runtime.js.map +1 -1
  5. package/dist/channels/official-channels-runtime.d.ts.map +1 -1
  6. package/dist/channels/official-channels-runtime.js +11 -0
  7. package/dist/channels/official-channels-runtime.js.map +1 -1
  8. package/dist/channels/official-channels-store.d.ts.map +1 -1
  9. package/dist/channels/official-channels-store.js +3 -4
  10. package/dist/channels/official-channels-store.js.map +1 -1
  11. package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
  12. package/dist/cliproxy/auth/oauth-handler.js +21 -0
  13. package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
  14. package/dist/cliproxy/auth/oauth-start-failure-guidance.d.ts +22 -0
  15. package/dist/cliproxy/auth/oauth-start-failure-guidance.d.ts.map +1 -0
  16. package/dist/cliproxy/auth/oauth-start-failure-guidance.js +82 -0
  17. package/dist/cliproxy/auth/oauth-start-failure-guidance.js.map +1 -0
  18. package/dist/cliproxy/executor/claude-launcher.d.ts.map +1 -1
  19. package/dist/cliproxy/executor/claude-launcher.js +22 -9
  20. package/dist/cliproxy/executor/claude-launcher.js.map +1 -1
  21. package/dist/cliproxy/executor/session-bridge.d.ts +16 -1
  22. package/dist/cliproxy/executor/session-bridge.d.ts.map +1 -1
  23. package/dist/cliproxy/executor/session-bridge.js +86 -54
  24. package/dist/cliproxy/executor/session-bridge.js.map +1 -1
  25. package/dist/commands/config-command-options.d.ts.map +1 -1
  26. package/dist/commands/config-command-options.js +4 -2
  27. package/dist/commands/config-command-options.js.map +1 -1
  28. package/dist/commands/config-command.js +1 -1
  29. package/dist/commands/config-command.js.map +1 -1
  30. package/dist/commands/config-dashboard-host.d.ts +1 -0
  31. package/dist/commands/config-dashboard-host.d.ts.map +1 -1
  32. package/dist/commands/config-dashboard-host.js +2 -1
  33. package/dist/commands/config-dashboard-host.js.map +1 -1
  34. package/dist/dispatcher/flows/settings-flow.d.ts.map +1 -1
  35. package/dist/dispatcher/flows/settings-flow.js +21 -10
  36. package/dist/dispatcher/flows/settings-flow.js.map +1 -1
  37. package/dist/dispatcher/profile-resolver.d.ts.map +1 -1
  38. package/dist/dispatcher/profile-resolver.js +14 -1
  39. package/dist/dispatcher/profile-resolver.js.map +1 -1
  40. package/dist/management/checks/profile-check.d.ts.map +1 -1
  41. package/dist/management/checks/profile-check.js +2 -3
  42. package/dist/management/checks/profile-check.js.map +1 -1
  43. package/dist/management/checks/symlink-check.d.ts.map +1 -1
  44. package/dist/management/checks/symlink-check.js +2 -3
  45. package/dist/management/checks/symlink-check.js.map +1 -1
  46. package/dist/management/checks/system-check.d.ts.map +1 -1
  47. package/dist/management/checks/system-check.js +1 -1
  48. package/dist/management/checks/system-check.js.map +1 -1
  49. package/dist/management/instance-directory.d.ts +4 -0
  50. package/dist/management/instance-directory.d.ts.map +1 -0
  51. package/dist/management/instance-directory.js +54 -0
  52. package/dist/management/instance-directory.js.map +1 -0
  53. package/dist/management/instance-manager.d.ts.map +1 -1
  54. package/dist/management/instance-manager.js +2 -10
  55. package/dist/management/instance-manager.js.map +1 -1
  56. package/dist/management/shared-manager.d.ts.map +1 -1
  57. package/dist/management/shared-manager.js +6 -16
  58. package/dist/management/shared-manager.js.map +1 -1
  59. package/dist/proxy/proxy-daemon-entry.js +46 -3
  60. package/dist/proxy/proxy-daemon-entry.js.map +1 -1
  61. package/dist/proxy/proxy-daemon-state.d.ts +2 -0
  62. package/dist/proxy/proxy-daemon-state.d.ts.map +1 -1
  63. package/dist/proxy/proxy-daemon-state.js +42 -4
  64. package/dist/proxy/proxy-daemon-state.js.map +1 -1
  65. package/dist/proxy/proxy-daemon.d.ts.map +1 -1
  66. package/dist/proxy/proxy-daemon.js +11 -6
  67. package/dist/proxy/proxy-daemon.js.map +1 -1
  68. package/dist/proxy/transformers/sse-stream-transformer.d.ts.map +1 -1
  69. package/dist/proxy/transformers/sse-stream-transformer.js +1 -0
  70. package/dist/proxy/transformers/sse-stream-transformer.js.map +1 -1
  71. package/dist/shared/toml-object.d.ts.map +1 -1
  72. package/dist/shared/toml-object.js +6 -2
  73. package/dist/shared/toml-object.js.map +1 -1
  74. package/dist/targets/codex-adapter.d.ts +1 -0
  75. package/dist/targets/codex-adapter.d.ts.map +1 -1
  76. package/dist/targets/codex-adapter.js +18 -1
  77. package/dist/targets/codex-adapter.js.map +1 -1
  78. package/dist/targets/codex-cliproxy-provider-config.d.ts +16 -0
  79. package/dist/targets/codex-cliproxy-provider-config.d.ts.map +1 -0
  80. package/dist/targets/codex-cliproxy-provider-config.js +156 -0
  81. package/dist/targets/codex-cliproxy-provider-config.js.map +1 -0
  82. package/dist/targets/target-runtime-compatibility.js +1 -1
  83. package/dist/targets/target-runtime-compatibility.js.map +1 -1
  84. package/dist/ui/assets/accounts-CQ7-Zx3_.js +1 -0
  85. package/dist/ui/assets/{alert-dialog-ClPYGzV3.js → alert-dialog-834N3Y7a.js} +1 -1
  86. package/dist/ui/assets/api-BJc1e2ju.js +4 -0
  87. package/dist/ui/assets/auth-section-FHhzv-t_.js +1 -0
  88. package/dist/ui/assets/backups-section-XgV36q98.js +1 -0
  89. package/dist/ui/assets/channels-BiUWmX53.js +1 -0
  90. package/dist/ui/assets/{charts-CeK2xCSo.js → charts-eIPy2oG6.js} +34 -34
  91. package/dist/ui/assets/{checkbox-CTpEjpTH.js → checkbox-Q5jqcuNs.js} +1 -1
  92. package/dist/ui/assets/claude-extension-Dg6ZOc-X.js +1 -0
  93. package/dist/ui/assets/cliproxy-DUGEhRI_.js +4 -0
  94. package/dist/ui/assets/{cliproxy-ai-providers-DoUPKyI5.js → cliproxy-ai-providers-DH1LvC9H.js} +1 -1
  95. package/dist/ui/assets/cliproxy-control-panel-DQcF0grk.js +1 -0
  96. package/dist/ui/assets/code-highlight-ClSMkeL5.js +1 -0
  97. package/dist/ui/assets/codex-B4aTo2gn.js +30 -0
  98. package/dist/ui/assets/{confirm-dialog-CYj_LLWN.js → confirm-dialog-ZIkkz4a-.js} +1 -1
  99. package/dist/ui/assets/copilot-BxTvmyiq.js +3 -0
  100. package/dist/ui/assets/cursor-DFNXCb2C.js +1 -0
  101. package/dist/ui/assets/droid-BtmVuSvi.js +2 -0
  102. package/dist/ui/assets/globalenv-section-ZUDnNjxP.js +1 -0
  103. package/dist/ui/assets/health-BQ5SLS-w.js +1 -0
  104. package/dist/ui/assets/index-2_GLcEv2.js +1 -0
  105. package/dist/ui/assets/index-BRwWpHe-.js +56 -0
  106. package/dist/ui/assets/index-BW69dNHf.js +1 -0
  107. package/dist/ui/assets/index-C6Qs2iuI.js +1 -0
  108. package/dist/ui/assets/index-DG9lONG_.js +1 -0
  109. package/dist/ui/assets/index-DKO-Gvdv.js +1 -0
  110. package/dist/ui/assets/index-YRmKZmzf.js +1 -0
  111. package/dist/ui/assets/index-nSsKQx8t.css +1 -0
  112. package/dist/ui/assets/logs-CiJ1hg6a.js +1 -0
  113. package/dist/ui/assets/{masked-input-eN6tFUjN.js → masked-input-CxbGLkmv.js} +1 -1
  114. package/dist/ui/assets/{proxy-status-widget-50UIM6S8.js → proxy-status-widget-BWr7WQY-.js} +1 -1
  115. package/dist/ui/assets/raw-json-settings-editor-panel-BRT6eyp6.js +1 -0
  116. package/dist/ui/assets/{searchable-select-JO0gngYE.js → searchable-select-zyPEV9KP.js} +1 -1
  117. package/dist/ui/assets/{separator-AoncAA6l.js → separator-BDmUKYTf.js} +1 -1
  118. package/dist/ui/assets/shared-CDiPdrLt.js +8 -0
  119. package/dist/ui/assets/{table-BM_YK49c.js → table-DB4ZK3nd.js} +1 -1
  120. package/dist/ui/assets/updates-IMCUh1DI.js +1 -0
  121. package/dist/ui/assets/{use-accounts-ELLatpzU.js → use-accounts-CyI5Ozs6.js} +1 -1
  122. package/dist/ui/index.html +3 -3
  123. package/dist/utils/browser/claude-tool-args.d.ts.map +1 -1
  124. package/dist/utils/browser/claude-tool-args.js +4 -0
  125. package/dist/utils/browser/claude-tool-args.js.map +1 -1
  126. package/dist/utils/claude-detector.d.ts.map +1 -1
  127. package/dist/utils/claude-detector.js +2 -1
  128. package/dist/utils/claude-detector.js.map +1 -1
  129. package/dist/utils/claude-subcommand-detector.d.ts +45 -0
  130. package/dist/utils/claude-subcommand-detector.d.ts.map +1 -0
  131. package/dist/utils/claude-subcommand-detector.js +179 -0
  132. package/dist/utils/claude-subcommand-detector.js.map +1 -0
  133. package/dist/utils/image-analysis/claude-tool-args.d.ts.map +1 -1
  134. package/dist/utils/image-analysis/claude-tool-args.js +4 -0
  135. package/dist/utils/image-analysis/claude-tool-args.js.map +1 -1
  136. package/dist/utils/shell-executor.d.ts +4 -2
  137. package/dist/utils/shell-executor.d.ts.map +1 -1
  138. package/dist/utils/shell-executor.js +59 -7
  139. package/dist/utils/shell-executor.js.map +1 -1
  140. package/dist/utils/websearch/claude-tool-args.d.ts.map +1 -1
  141. package/dist/utils/websearch/claude-tool-args.js +5 -0
  142. package/dist/utils/websearch/claude-tool-args.js.map +1 -1
  143. package/dist/web-server/health/profile-checks.d.ts.map +1 -1
  144. package/dist/web-server/health/profile-checks.js +2 -3
  145. package/dist/web-server/health/profile-checks.js.map +1 -1
  146. package/dist/web-server/health/symlink-checks.d.ts.map +1 -1
  147. package/dist/web-server/health/symlink-checks.js +2 -3
  148. package/dist/web-server/health/symlink-checks.js.map +1 -1
  149. package/dist/web-server/index.d.ts.map +1 -1
  150. package/dist/web-server/index.js +80 -20
  151. package/dist/web-server/index.js.map +1 -1
  152. package/dist/web-server/middleware/auth-middleware.d.ts +5 -0
  153. package/dist/web-server/middleware/auth-middleware.d.ts.map +1 -1
  154. package/dist/web-server/middleware/auth-middleware.js +73 -1
  155. package/dist/web-server/middleware/auth-middleware.js.map +1 -1
  156. package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
  157. package/dist/web-server/routes/cliproxy-auth-routes.js +30 -3
  158. package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
  159. package/dist/web-server/routes/codex-routes.d.ts.map +1 -1
  160. package/dist/web-server/routes/codex-routes.js +7 -0
  161. package/dist/web-server/routes/codex-routes.js.map +1 -1
  162. package/dist/web-server/routes/settings-routes.d.ts.map +1 -1
  163. package/dist/web-server/routes/settings-routes.js +92 -14
  164. package/dist/web-server/routes/settings-routes.js.map +1 -1
  165. package/dist/web-server/usage/aggregator.d.ts.map +1 -1
  166. package/dist/web-server/usage/aggregator.js +2 -5
  167. package/dist/web-server/usage/aggregator.js.map +1 -1
  168. package/lib/hooks/image-analyzer-transformer.cjs +49 -3
  169. package/lib/mcp/ccs-browser-server.cjs +153 -6
  170. package/package.json +1 -1
  171. package/scripts/verify-bundle.js +4 -1
  172. package/dist/ui/assets/accounts-CW9bbE4S.js +0 -1
  173. package/dist/ui/assets/api-BjpAFHdA.js +0 -4
  174. package/dist/ui/assets/auth-section-wl4-fzwD.js +0 -1
  175. package/dist/ui/assets/backups-section-CRfyOhtX.js +0 -1
  176. package/dist/ui/assets/channels-DH0HkSGX.js +0 -1
  177. package/dist/ui/assets/claude-extension-BQOBO5Au.js +0 -1
  178. package/dist/ui/assets/cliproxy-control-panel-CvjXdHw9.js +0 -1
  179. package/dist/ui/assets/cliproxy-qUbiZjec.js +0 -3
  180. package/dist/ui/assets/code-highlight-D4E79GKQ.js +0 -3
  181. package/dist/ui/assets/codex-BeeazJpw.js +0 -27
  182. package/dist/ui/assets/copilot-ZCJeM_Zk.js +0 -3
  183. package/dist/ui/assets/cursor-CtBjQ1_j.js +0 -1
  184. package/dist/ui/assets/droid-BLmzMBtN.js +0 -2
  185. package/dist/ui/assets/globalenv-section-0ENDeVbM.js +0 -1
  186. package/dist/ui/assets/health-BEnDHk-j.js +0 -1
  187. package/dist/ui/assets/index-B3xma6R0.js +0 -1
  188. package/dist/ui/assets/index-Bs28kNJN.js +0 -72
  189. package/dist/ui/assets/index-C04Kst21.js +0 -1
  190. package/dist/ui/assets/index-Cip18A41.js +0 -1
  191. package/dist/ui/assets/index-ClMz157R.js +0 -1
  192. package/dist/ui/assets/index-D2_yb3d2.css +0 -1
  193. package/dist/ui/assets/index-DrCrZ7r1.js +0 -1
  194. package/dist/ui/assets/index-O9Qq-UJq.js +0 -1
  195. package/dist/ui/assets/logs-DQxVdsHm.js +0 -1
  196. package/dist/ui/assets/raw-json-settings-editor-panel-DqKmVWL-.js +0 -1
  197. package/dist/ui/assets/shared-BTv96-3y.js +0 -8
  198. package/dist/ui/assets/updates-eo4H4NOg.js +0 -1
@@ -0,0 +1,56 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-2_GLcEv2.js","assets/radix-ui-nu4wz29m.js","assets/react-vendor-Bjx91N7w.js","assets/masked-input-CxbGLkmv.js","assets/icons-DzKUh8vG.js","assets/tanstack-bhJxV1h8.js","assets/notifications-B4_o8bcr.js","assets/utils-CzKF5WmX.js","assets/form-utils-CuHzLhJZ.js","assets/charts-eIPy2oG6.js","assets/index-DKO-Gvdv.js","assets/proxy-C4-M_9kB.js","assets/index-C6Qs2iuI.js","assets/channels-BiUWmX53.js","assets/globalenv-section-ZUDnNjxP.js","assets/index-DG9lONG_.js","assets/index-BW69dNHf.js","assets/default-ports-1QQSffYX.js","assets/proxy-status-widget-BWr7WQY-.js","assets/alert-dialog-834N3Y7a.js","assets/antigravity-responsibility-constants-Bvh4Ybz0.js","assets/auth-section-FHhzv-t_.js","assets/backups-section-XgV36q98.js","assets/index-YRmKZmzf.js","assets/api-BJc1e2ju.js","assets/confirm-dialog-ZIkkz4a-.js","assets/cliproxy-DUGEhRI_.js","assets/checkbox-Q5jqcuNs.js","assets/separator-BDmUKYTf.js","assets/searchable-select-zyPEV9KP.js","assets/cliproxy-ai-providers-DH1LvC9H.js","assets/cliproxy-control-panel-DQcF0grk.js","assets/copilot-BxTvmyiq.js","assets/cursor-DFNXCb2C.js","assets/claude-extension-Dg6ZOc-X.js","assets/codex-B4aTo2gn.js","assets/table-DB4ZK3nd.js","assets/raw-json-settings-editor-panel-BRT6eyp6.js","assets/droid-BtmVuSvi.js","assets/logs-CiJ1hg6a.js","assets/accounts-CQ7-Zx3_.js","assets/use-accounts-CyI5Ozs6.js","assets/health-BQ5SLS-w.js","assets/shared-CDiPdrLt.js","assets/updates-IMCUh1DI.js"])))=>i.map(i=>d[i]);
2
+ import{j as p,S as Gh,R as IA,C as BA,a as _A,T as HA,D as UA,P as zA,O as FA,b as NR,c as LR,d as RR,e as ER,f as jR,A as IR,g as BR,h as _R,i as HR,k as UR,l as zR,m as FR,n as qR,I as GR,o as qA,p as KR,q as GA,r as KA,s as VR,t as VA,V as WR,L as WA,u as QA,v as QR,w as YR,x as YA,y as $R,z as XR,B as $A,E as JR,F as ZR,G as XA,H as eE,J as JA,K as ZA,M as eO,N as tE,Q as nE,U as iE,W as oE,X as sE,Y as tO,Z as aE,_ as rE,$ as lE}from"./radix-ui-nu4wz29m.js";import{b as nO,d as cE,r as A,u as Kh,O as ey,N as iO,e as yb,L as uh,R as uE,h as oO,E as ge,B as dE,i as hE,j as Et}from"./react-vendor-Bjx91N7w.js";import{Q as fE,u as It,a as bt,b as ft,c as pE,d as mE}from"./tanstack-bhJxV1h8.js";import{t as fe,T as gE}from"./notifications-B4_o8bcr.js";import{L as hi,X as Gr,P as yE,C as Vh,H as bE,a as xE,K as ty,G as vE,Z as sO,F as aO,U as rO,b as CE,S as SE,c as lO,A as bc,d as cO,e as kE,f as uO,M as dO,E as Kc,g as Vc,B as wE,R as xc,W as AE,h as OE,i as PE,j as TE,k as $S,l as XS,m as Lr,n as bb,o as dh,p as hO,q as fO,r as DE,s as Wh,t as xb,u as pO,v as Rr,T as Qi,w as vc,x as Wc,y as JS,z as ME,D as mO,I as vb,J as NE,N as Qh,O as LE,Q as RE,V as EE,Y as jE,_ as Yh,$ as IE,a0 as BE,a1 as gO,a2 as _E,a3 as HE,a4 as UE,a5 as zE,a6 as FE,a7 as Cb,a8 as yO,a9 as ZS,aa as qE,ab as GE,ac as KE,ad as VE,ae as WE,af as QE,ag as ek,ah as YE,ai as Cd,aj as tk,ak as nk,al as $E}from"./icons-DzKUh8vG.js";import{t as XE,c as JE,a as $h,e as Ul,f as Yl,b as ZE,d as e2,g as t2,h as n2,i as i2,j as o2,k as s2,l as a2,m as r2,n as l2,o as c2,p as u2,q as d2,r as h2,s as f2,u as p2,v as m2,w as g2,x as y2,y as b2,z as x2,A as v2,B as C2,C as S2,D as k2,E as w2,F as A2,G as O2,H as P2,I as T2,J as D2}from"./utils-CzKF5WmX.js";import{o as ik,s as ok,p as M2,a as N2,$ as L2,b as bO,c as ls,d as R2,_ as E2,u as j2,e as sk}from"./form-utils-CuHzLhJZ.js";import{_ as I2,a as B2}from"./charts-eIPy2oG6.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const r of a.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(o){if(o.ep)return;o.ep=!0;const a=t(o);fetch(o.href,a)}})();var Ym={exports:{}},zl={},$m={exports:{}},Xm={};var ak;function _2(){return ak||(ak=1,(function(n){function e(B,Z){var se=B.length;B.push(Z);e:for(;0<se;){var Y=se-1>>>1,ae=B[Y];if(0<o(ae,Z))B[Y]=Z,B[se]=ae,se=Y;else break e}}function t(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var Z=B[0],se=B.pop();if(se!==Z){B[0]=se;e:for(var Y=0,ae=B.length,de=ae>>>1;Y<de;){var be=2*(Y+1)-1,te=B[be],le=be+1,xe=B[le];if(0>o(te,se))le<ae&&0>o(xe,te)?(B[Y]=xe,B[le]=se,Y=le):(B[Y]=te,B[be]=se,Y=be);else if(le<ae&&0>o(xe,se))B[Y]=xe,B[le]=se,Y=le;else break e}}return Z}function o(B,Z){var se=B.sortIndex-Z.sortIndex;return se!==0?se:B.id-Z.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;n.unstable_now=function(){return a.now()}}else{var r=Date,c=r.now();n.unstable_now=function(){return r.now()-c}}var d=[],f=[],m=1,g=null,x=3,v=!1,C=!1,k=!1,w=!1,P=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function D(B){for(var Z=t(f);Z!==null;){if(Z.callback===null)i(f);else if(Z.startTime<=B)i(f),Z.sortIndex=Z.expirationTime,e(d,Z);else break;Z=t(f)}}function L(B){if(k=!1,D(B),!C)if(t(d)!==null)C=!0,N||(N=!0,H());else{var Z=t(f);Z!==null&&oe(L,Z.startTime-B)}}var N=!1,j=-1,K=5,U=-1;function z(){return w?!0:!(n.unstable_now()-U<K)}function X(){if(w=!1,N){var B=n.unstable_now();U=B;var Z=!0;try{e:{C=!1,k&&(k=!1,T(j),j=-1),v=!0;var se=x;try{t:{for(D(B),g=t(d);g!==null&&!(g.expirationTime>B&&z());){var Y=g.callback;if(typeof Y=="function"){g.callback=null,x=g.priorityLevel;var ae=Y(g.expirationTime<=B);if(B=n.unstable_now(),typeof ae=="function"){g.callback=ae,D(B),Z=!0;break t}g===t(d)&&i(d),D(B)}else i(d);g=t(d)}if(g!==null)Z=!0;else{var de=t(f);de!==null&&oe(L,de.startTime-B),Z=!1}}break e}finally{g=null,x=se,v=!1}Z=void 0}}finally{Z?H():N=!1}}}var H;if(typeof M=="function")H=function(){M(X)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,ie=V.port2;V.port1.onmessage=X,H=function(){ie.postMessage(null)}}else H=function(){P(X,0)};function oe(B,Z){j=P(function(){B(n.unstable_now())},Z)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(B){B.callback=null},n.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<B?Math.floor(1e3/B):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(B){switch(x){case 1:case 2:case 3:var Z=3;break;default:Z=x}var se=x;x=Z;try{return B()}finally{x=se}},n.unstable_requestPaint=function(){w=!0},n.unstable_runWithPriority=function(B,Z){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var se=x;x=B;try{return Z()}finally{x=se}},n.unstable_scheduleCallback=function(B,Z,se){var Y=n.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?Y+se:Y):se=Y,B){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=se+ae,B={id:m++,callback:Z,priorityLevel:B,startTime:se,expirationTime:ae,sortIndex:-1},se>Y?(B.sortIndex=se,e(f,B),t(d)===null&&B===t(f)&&(k?(T(j),j=-1):k=!0,oe(L,se-Y))):(B.sortIndex=ae,e(d,B),C||v||(C=!0,N||(N=!0,H()))),B},n.unstable_shouldYield=z,n.unstable_wrapCallback=function(B){var Z=x;return function(){var se=x;x=Z;try{return B.apply(this,arguments)}finally{x=se}}}})(Xm)),Xm}var rk;function H2(){return rk||(rk=1,$m.exports=_2()),$m.exports}var lk;function U2(){if(lk)return zl;lk=1;var n=H2(),e=nO(),t=cE();function i(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var l=s,u=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(u=l.return),s=l.return;while(s)}return l.tag===3?u:null}function r(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function d(s){if(a(s)!==s)throw Error(i(188))}function f(s){var l=s.alternate;if(!l){if(l=a(s),l===null)throw Error(i(188));return l!==s?null:s}for(var u=s,h=l;;){var y=u.return;if(y===null)break;var b=y.alternate;if(b===null){if(h=y.return,h!==null){u=h;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===u)return d(y),s;if(b===h)return d(y),l;b=b.sibling}throw Error(i(188))}if(u.return!==h.return)u=y,h=b;else{for(var S=!1,O=y.child;O;){if(O===u){S=!0,u=y,h=b;break}if(O===h){S=!0,h=y,u=b;break}O=O.sibling}if(!S){for(O=b.child;O;){if(O===u){S=!0,u=b,h=y;break}if(O===h){S=!0,h=b,u=y;break}O=O.sibling}if(!S)throw Error(i(189))}}if(u.alternate!==h)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?s:l}function m(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=m(s),l!==null)return l;s=s.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),M=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function H(s){return s===null||typeof s!="object"?null:(s=X&&s[X]||s["@@iterator"],typeof s=="function"?s:null)}var V=Symbol.for("react.client.reference");function ie(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===V?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case k:return"Fragment";case P:return"Profiler";case w:return"StrictMode";case L:return"Suspense";case N:return"SuspenseList";case U:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case C:return"Portal";case M:return s.displayName||"Context";case T:return(s._context.displayName||"Context")+".Consumer";case D:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case j:return l=s.displayName||null,l!==null?l:ie(s.type)||"Memo";case K:l=s._payload,s=s._init;try{return ie(s(l))}catch{}}return null}var oe=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},Y=[],ae=-1;function de(s){return{current:s}}function be(s){0>ae||(s.current=Y[ae],Y[ae]=null,ae--)}function te(s,l){ae++,Y[ae]=s.current,s.current=l}var le=de(null),xe=de(null),Se=de(null),ye=de(null);function Te(s,l){switch(te(Se,l),te(xe,s),te(le,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?xS(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=xS(l),s=vS(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}be(le),te(le,s)}function Ie(){be(le),be(xe),be(Se)}function nt(s){s.memoizedState!==null&&te(ye,s);var l=le.current,u=vS(l,s.type);l!==u&&(te(xe,s),te(le,u))}function Ot(s){xe.current===s&&(be(le),be(xe)),ye.current===s&&(be(ye),Il._currentValue=se)}var De,Ye;function it(s){if(De===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);De=l&&l[1]||"",Ye=-1<u.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+De+s+Ye}var ln=!1;function Sn(s,l){if(!s||ln)return"";ln=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(Q){var W=Q}Reflect.construct(s,[],ne)}else{try{ne.call()}catch(Q){W=Q}s.call(ne.prototype)}}else{try{throw Error()}catch(Q){W=Q}(ne=s())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(Q){if(Q&&W&&typeof Q.stack=="string")return[Q.stack,W.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=h.DetermineComponentFrameRoot(),S=b[0],O=b[1];if(S&&O){var R=S.split(`
5
+ `),G=O.split(`
6
+ `);for(y=h=0;h<R.length&&!R[h].includes("DetermineComponentFrameRoot");)h++;for(;y<G.length&&!G[y].includes("DetermineComponentFrameRoot");)y++;if(h===R.length||y===G.length)for(h=R.length-1,y=G.length-1;1<=h&&0<=y&&R[h]!==G[y];)y--;for(;1<=h&&0<=y;h--,y--)if(R[h]!==G[y]){if(h!==1||y!==1)do if(h--,y--,0>y||R[h]!==G[y]){var $=`
7
+ `+R[h].replace(" at new "," at ");return s.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",s.displayName)),$}while(1<=h&&0<=y);break}}}finally{ln=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?it(u):""}function As(s,l){switch(s.tag){case 26:case 27:case 5:return it(s.type);case 16:return it("Lazy");case 13:return s.child!==l&&l!==null?it("Suspense Fallback"):it("Suspense");case 19:return it("SuspenseList");case 0:case 15:return Sn(s.type,!1);case 11:return Sn(s.type.render,!1);case 1:return Sn(s.type,!0);case 31:return it("Activity");default:return""}}function zt(s){try{var l="",u=null;do l+=As(s,u),u=s,s=s.return;while(s);return l}catch(h){return`
8
+ Error generating stack: `+h.message+`
9
+ `+h.stack}}var Bo=Object.prototype.hasOwnProperty,Os=n.unstable_scheduleCallback,mi=n.unstable_cancelCallback,ka=n.unstable_shouldYield,wa=n.unstable_requestPaint,Xt=n.unstable_now,$r=n.unstable_getCurrentPriorityLevel,ou=n.unstable_ImmediatePriority,su=n.unstable_UserBlockingPriority,Aa=n.unstable_NormalPriority,Rf=n.unstable_LowPriority,au=n.unstable_IdlePriority,Ef=n.log,jf=n.unstable_setDisableYieldValue,Ps=null,pn=null;function Pi(s){if(typeof Ef=="function"&&jf(s),pn&&typeof pn.setStrictMode=="function")try{pn.setStrictMode(Ps,s)}catch{}}var mn=Math.clz32?Math.clz32:Re,ru=Math.log,If=Math.LN2;function Re(s){return s>>>=0,s===0?32:31-(ru(s)/If|0)|0}var Ve=256,Me=262144,$e=4194304;function Kt(s){var l=s&42;if(l!==0)return l;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function _e(s,l,u){var h=s.pendingLanes;if(h===0)return 0;var y=0,b=s.suspendedLanes,S=s.pingedLanes;s=s.warmLanes;var O=h&134217727;return O!==0?(h=O&~b,h!==0?y=Kt(h):(S&=O,S!==0?y=Kt(S):u||(u=O&~s,u!==0&&(y=Kt(u))))):(O=h&~b,O!==0?y=Kt(O):S!==0?y=Kt(S):u||(u=h&~s,u!==0&&(y=Kt(u)))),y===0?0:l!==0&&l!==y&&(l&b)===0&&(b=y&-y,u=l&-l,b>=u||b===32&&(u&4194048)!==0)?l:y}function Ts(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function Bf(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lu(){var s=$e;return $e<<=1,($e&62914560)===0&&($e=4194304),s}function Ds(s){for(var l=[],u=0;31>u;u++)l.push(s);return l}function eo(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function xN(s,l,u,h,y,b){var S=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var O=s.entanglements,R=s.expirationTimes,G=s.hiddenUpdates;for(u=S&~u;0<u;){var $=31-mn(u),ne=1<<$;O[$]=0,R[$]=-1;var W=G[$];if(W!==null)for(G[$]=null,$=0;$<W.length;$++){var Q=W[$];Q!==null&&(Q.lane&=-536870913)}u&=~ne}h!==0&&tv(s,h,0),b!==0&&y===0&&s.tag!==0&&(s.suspendedLanes|=b&~(S&~l))}function tv(s,l,u){s.pendingLanes|=l,s.suspendedLanes&=~l;var h=31-mn(l);s.entangledLanes|=l,s.entanglements[h]=s.entanglements[h]|1073741824|u&261930}function nv(s,l){var u=s.entangledLanes|=l;for(s=s.entanglements;u;){var h=31-mn(u),y=1<<h;y&l|s[h]&l&&(s[h]|=l),u&=~y}}function iv(s,l){var u=l&-l;return u=(u&42)!==0?1:_f(u),(u&(s.suspendedLanes|l))!==0?0:u}function _f(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Hf(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function ov(){var s=Z.p;return s!==0?s:(s=window.event,s===void 0?32:qS(s.type))}function sv(s,l){var u=Z.p;try{return Z.p=s,l()}finally{Z.p=u}}var _o=Math.random().toString(36).slice(2),Jt="__reactFiber$"+_o,kn="__reactProps$"+_o,Oa="__reactContainer$"+_o,Uf="__reactEvents$"+_o,vN="__reactListeners$"+_o,CN="__reactHandles$"+_o,av="__reactResources$"+_o,Xr="__reactMarker$"+_o;function zf(s){delete s[Jt],delete s[kn],delete s[Uf],delete s[vN],delete s[CN]}function Pa(s){var l=s[Jt];if(l)return l;for(var u=s.parentNode;u;){if(l=u[Oa]||u[Jt]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(s=PS(s);s!==null;){if(u=s[Jt])return u;s=PS(s)}return l}s=u,u=s.parentNode}return null}function Ta(s){if(s=s[Jt]||s[Oa]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function Jr(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(i(33))}function Da(s){var l=s[av];return l||(l=s[av]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Vt(s){s[Xr]=!0}var rv=new Set,lv={};function Ms(s,l){Ma(s,l),Ma(s+"Capture",l)}function Ma(s,l){for(lv[s]=l,s=0;s<l.length;s++)rv.add(l[s])}var SN=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),cv={},uv={};function kN(s){return Bo.call(uv,s)?!0:Bo.call(cv,s)?!1:SN.test(s)?uv[s]=!0:(cv[s]=!0,!1)}function cu(s,l,u){if(kN(l))if(u===null)s.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,""+u)}}function uu(s,l,u){if(u===null)s.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,""+u)}}function to(s,l,u,h){if(h===null)s.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(l,u,""+h)}}function Xn(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function dv(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function wN(s,l,u){var h=Object.getOwnPropertyDescriptor(s.constructor.prototype,l);if(!s.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var y=h.get,b=h.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return y.call(this)},set:function(S){u=""+S,b.call(this,S)}}),Object.defineProperty(s,l,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(S){u=""+S},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function Ff(s){if(!s._valueTracker){var l=dv(s)?"checked":"value";s._valueTracker=wN(s,l,""+s[l])}}function hv(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var u=l.getValue(),h="";return s&&(h=dv(s)?s.checked?"true":"false":s.value),s=h,s!==u?(l.setValue(s),!0):!1}function du(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var AN=/[\n"\\]/g;function Jn(s){return s.replace(AN,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function qf(s,l,u,h,y,b,S,O){s.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?s.type=S:s.removeAttribute("type"),l!=null?S==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+Xn(l)):s.value!==""+Xn(l)&&(s.value=""+Xn(l)):S!=="submit"&&S!=="reset"||s.removeAttribute("value"),l!=null?Gf(s,S,Xn(l)):u!=null?Gf(s,S,Xn(u)):h!=null&&s.removeAttribute("value"),y==null&&b!=null&&(s.defaultChecked=!!b),y!=null&&(s.checked=y&&typeof y!="function"&&typeof y!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?s.name=""+Xn(O):s.removeAttribute("name")}function fv(s,l,u,h,y,b,S,O){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(s.type=b),l!=null||u!=null){if(!(b!=="submit"&&b!=="reset"||l!=null)){Ff(s);return}u=u!=null?""+Xn(u):"",l=l!=null?""+Xn(l):u,O||l===s.value||(s.value=l),s.defaultValue=l}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,s.checked=O?s.checked:!!h,s.defaultChecked=!!h,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(s.name=S),Ff(s)}function Gf(s,l,u){l==="number"&&du(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function Na(s,l,u,h){if(s=s.options,l){l={};for(var y=0;y<u.length;y++)l["$"+u[y]]=!0;for(u=0;u<s.length;u++)y=l.hasOwnProperty("$"+s[u].value),s[u].selected!==y&&(s[u].selected=y),y&&h&&(s[u].defaultSelected=!0)}else{for(u=""+Xn(u),l=null,y=0;y<s.length;y++){if(s[y].value===u){s[y].selected=!0,h&&(s[y].defaultSelected=!0);return}l!==null||s[y].disabled||(l=s[y])}l!==null&&(l.selected=!0)}}function pv(s,l,u){if(l!=null&&(l=""+Xn(l),l!==s.value&&(s.value=l),u==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=u!=null?""+Xn(u):""}function mv(s,l,u,h){if(l==null){if(h!=null){if(u!=null)throw Error(i(92));if(oe(h)){if(1<h.length)throw Error(i(93));h=h[0]}u=h}u==null&&(u=""),l=u}u=Xn(l),s.defaultValue=u,h=s.textContent,h===u&&h!==""&&h!==null&&(s.value=h),Ff(s)}function La(s,l){if(l){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=l;return}}s.textContent=l}var ON=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function gv(s,l,u){var h=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":h?s.setProperty(l,u):typeof u!="number"||u===0||ON.has(l)?l==="float"?s.cssFloat=u:s[l]=(""+u).trim():s[l]=u+"px"}function yv(s,l,u){if(l!=null&&typeof l!="object")throw Error(i(62));if(s=s.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?s.setProperty(h,""):h==="float"?s.cssFloat="":s[h]="");for(var y in l)h=l[y],l.hasOwnProperty(y)&&u[y]!==h&&gv(s,y,h)}else for(var b in l)l.hasOwnProperty(b)&&gv(s,b,l[b])}function Kf(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var PN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),TN=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function hu(s){return TN.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function no(){}var Vf=null;function Wf(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ra=null,Ea=null;function bv(s){var l=Ta(s);if(l&&(s=l.stateNode)){var u=s[kn]||null;e:switch(s=l.stateNode,l.type){case"input":if(qf(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Jn(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var h=u[l];if(h!==s&&h.form===s.form){var y=h[kn]||null;if(!y)throw Error(i(90));qf(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<u.length;l++)h=u[l],h.form===s.form&&hv(h)}break e;case"textarea":pv(s,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&Na(s,!!u.multiple,l,!1)}}}var Qf=!1;function xv(s,l,u){if(Qf)return s(l,u);Qf=!0;try{var h=s(l);return h}finally{if(Qf=!1,(Ra!==null||Ea!==null)&&(Zu(),Ra&&(l=Ra,s=Ea,Ea=Ra=null,bv(l),s)))for(l=0;l<s.length;l++)bv(s[l])}}function Zr(s,l){var u=s.stateNode;if(u===null)return null;var h=u[kn]||null;if(h===null)return null;u=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(s=s.type,h=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!h;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(i(231,l,typeof u));return u}var io=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yf=!1;if(io)try{var el={};Object.defineProperty(el,"passive",{get:function(){Yf=!0}}),window.addEventListener("test",el,el),window.removeEventListener("test",el,el)}catch{Yf=!1}var Ho=null,$f=null,fu=null;function vv(){if(fu)return fu;var s,l=$f,u=l.length,h,y="value"in Ho?Ho.value:Ho.textContent,b=y.length;for(s=0;s<u&&l[s]===y[s];s++);var S=u-s;for(h=1;h<=S&&l[u-h]===y[b-h];h++);return fu=y.slice(s,1<h?1-h:void 0)}function pu(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function mu(){return!0}function Cv(){return!1}function wn(s){function l(u,h,y,b,S){this._reactName=u,this._targetInst=y,this.type=h,this.nativeEvent=b,this.target=S,this.currentTarget=null;for(var O in s)s.hasOwnProperty(O)&&(u=s[O],this[O]=u?u(b):b[O]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?mu:Cv,this.isPropagationStopped=Cv,this}return g(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=mu)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=mu)},persist:function(){},isPersistent:mu}),l}var Ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gu=wn(Ns),tl=g({},Ns,{view:0,detail:0}),DN=wn(tl),Xf,Jf,nl,yu=g({},tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ep,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==nl&&(nl&&s.type==="mousemove"?(Xf=s.screenX-nl.screenX,Jf=s.screenY-nl.screenY):Jf=Xf=0,nl=s),Xf)},movementY:function(s){return"movementY"in s?s.movementY:Jf}}),Sv=wn(yu),MN=g({},yu,{dataTransfer:0}),NN=wn(MN),LN=g({},tl,{relatedTarget:0}),Zf=wn(LN),RN=g({},Ns,{animationName:0,elapsedTime:0,pseudoElement:0}),EN=wn(RN),jN=g({},Ns,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),IN=wn(jN),BN=g({},Ns,{data:0}),kv=wn(BN),_N={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},HN={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},UN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zN(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=UN[s])?!!l[s]:!1}function ep(){return zN}var FN=g({},tl,{key:function(s){if(s.key){var l=_N[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=pu(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?HN[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ep,charCode:function(s){return s.type==="keypress"?pu(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?pu(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),qN=wn(FN),GN=g({},yu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wv=wn(GN),KN=g({},tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ep}),VN=wn(KN),WN=g({},Ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),QN=wn(WN),YN=g({},yu,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),$N=wn(YN),XN=g({},Ns,{newState:0,oldState:0}),JN=wn(XN),ZN=[9,13,27,32],tp=io&&"CompositionEvent"in window,il=null;io&&"documentMode"in document&&(il=document.documentMode);var eL=io&&"TextEvent"in window&&!il,Av=io&&(!tp||il&&8<il&&11>=il),Ov=" ",Pv=!1;function Tv(s,l){switch(s){case"keyup":return ZN.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dv(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ja=!1;function tL(s,l){switch(s){case"compositionend":return Dv(l);case"keypress":return l.which!==32?null:(Pv=!0,Ov);case"textInput":return s=l.data,s===Ov&&Pv?null:s;default:return null}}function nL(s,l){if(ja)return s==="compositionend"||!tp&&Tv(s,l)?(s=vv(),fu=$f=Ho=null,ja=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Av&&l.locale!=="ko"?null:l.data;default:return null}}var iL={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Mv(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!iL[s.type]:l==="textarea"}function Nv(s,l,u,h){Ra?Ea?Ea.push(h):Ea=[h]:Ra=h,l=ad(l,"onChange"),0<l.length&&(u=new gu("onChange","change",null,u,h),s.push({event:u,listeners:l}))}var ol=null,sl=null;function oL(s){fS(s,0)}function bu(s){var l=Jr(s);if(hv(l))return s}function Lv(s,l){if(s==="change")return l}var Rv=!1;if(io){var np;if(io){var ip="oninput"in document;if(!ip){var Ev=document.createElement("div");Ev.setAttribute("oninput","return;"),ip=typeof Ev.oninput=="function"}np=ip}else np=!1;Rv=np&&(!document.documentMode||9<document.documentMode)}function jv(){ol&&(ol.detachEvent("onpropertychange",Iv),sl=ol=null)}function Iv(s){if(s.propertyName==="value"&&bu(sl)){var l=[];Nv(l,sl,s,Wf(s)),xv(oL,l)}}function sL(s,l,u){s==="focusin"?(jv(),ol=l,sl=u,ol.attachEvent("onpropertychange",Iv)):s==="focusout"&&jv()}function aL(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return bu(sl)}function rL(s,l){if(s==="click")return bu(l)}function lL(s,l){if(s==="input"||s==="change")return bu(l)}function cL(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var Bn=typeof Object.is=="function"?Object.is:cL;function al(s,l){if(Bn(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var u=Object.keys(s),h=Object.keys(l);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var y=u[h];if(!Bo.call(l,y)||!Bn(s[y],l[y]))return!1}return!0}function Bv(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function _v(s,l){var u=Bv(s);s=0;for(var h;u;){if(u.nodeType===3){if(h=s+u.textContent.length,s<=l&&h>=l)return{node:u,offset:l-s};s=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Bv(u)}}function Hv(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?Hv(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function Uv(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=du(s.document);l instanceof s.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)s=l.contentWindow;else break;l=du(s.document)}return l}function op(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var uL=io&&"documentMode"in document&&11>=document.documentMode,Ia=null,sp=null,rl=null,ap=!1;function zv(s,l,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;ap||Ia==null||Ia!==du(h)||(h=Ia,"selectionStart"in h&&op(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),rl&&al(rl,h)||(rl=h,h=ad(sp,"onSelect"),0<h.length&&(l=new gu("onSelect","select",null,l,u),s.push({event:l,listeners:h}),l.target=Ia)))}function Ls(s,l){var u={};return u[s.toLowerCase()]=l.toLowerCase(),u["Webkit"+s]="webkit"+l,u["Moz"+s]="moz"+l,u}var Ba={animationend:Ls("Animation","AnimationEnd"),animationiteration:Ls("Animation","AnimationIteration"),animationstart:Ls("Animation","AnimationStart"),transitionrun:Ls("Transition","TransitionRun"),transitionstart:Ls("Transition","TransitionStart"),transitioncancel:Ls("Transition","TransitionCancel"),transitionend:Ls("Transition","TransitionEnd")},rp={},Fv={};io&&(Fv=document.createElement("div").style,"AnimationEvent"in window||(delete Ba.animationend.animation,delete Ba.animationiteration.animation,delete Ba.animationstart.animation),"TransitionEvent"in window||delete Ba.transitionend.transition);function Rs(s){if(rp[s])return rp[s];if(!Ba[s])return s;var l=Ba[s],u;for(u in l)if(l.hasOwnProperty(u)&&u in Fv)return rp[s]=l[u];return s}var qv=Rs("animationend"),Gv=Rs("animationiteration"),Kv=Rs("animationstart"),dL=Rs("transitionrun"),hL=Rs("transitionstart"),fL=Rs("transitioncancel"),Vv=Rs("transitionend"),Wv=new Map,lp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");lp.push("scrollEnd");function gi(s,l){Wv.set(s,l),Ms(l,[s])}var xu=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Zn=[],_a=0,cp=0;function vu(){for(var s=_a,l=cp=_a=0;l<s;){var u=Zn[l];Zn[l++]=null;var h=Zn[l];Zn[l++]=null;var y=Zn[l];Zn[l++]=null;var b=Zn[l];if(Zn[l++]=null,h!==null&&y!==null){var S=h.pending;S===null?y.next=y:(y.next=S.next,S.next=y),h.pending=y}b!==0&&Qv(u,y,b)}}function Cu(s,l,u,h){Zn[_a++]=s,Zn[_a++]=l,Zn[_a++]=u,Zn[_a++]=h,cp|=h,s.lanes|=h,s=s.alternate,s!==null&&(s.lanes|=h)}function up(s,l,u,h){return Cu(s,l,u,h),Su(s)}function Es(s,l){return Cu(s,null,null,l),Su(s)}function Qv(s,l,u){s.lanes|=u;var h=s.alternate;h!==null&&(h.lanes|=u);for(var y=!1,b=s.return;b!==null;)b.childLanes|=u,h=b.alternate,h!==null&&(h.childLanes|=u),b.tag===22&&(s=b.stateNode,s===null||s._visibility&1||(y=!0)),s=b,b=b.return;return s.tag===3?(b=s.stateNode,y&&l!==null&&(y=31-mn(u),s=b.hiddenUpdates,h=s[y],h===null?s[y]=[l]:h.push(l),l.lane=u|536870912),b):null}function Su(s){if(50<Dl)throw Dl=0,xm=null,Error(i(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var Ha={};function pL(s,l,u,h){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _n(s,l,u,h){return new pL(s,l,u,h)}function dp(s){return s=s.prototype,!(!s||!s.isReactComponent)}function oo(s,l){var u=s.alternate;return u===null?(u=_n(s.tag,l,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=l,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,l=s.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function Yv(s,l){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=l,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,l=u.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function ku(s,l,u,h,y,b){var S=0;if(h=s,typeof s=="function")dp(s)&&(S=1);else if(typeof s=="string")S=xR(s,u,le.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case U:return s=_n(31,u,l,y),s.elementType=U,s.lanes=b,s;case k:return js(u.children,y,b,l);case w:S=8,y|=24;break;case P:return s=_n(12,u,l,y|2),s.elementType=P,s.lanes=b,s;case L:return s=_n(13,u,l,y),s.elementType=L,s.lanes=b,s;case N:return s=_n(19,u,l,y),s.elementType=N,s.lanes=b,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case M:S=10;break e;case T:S=9;break e;case D:S=11;break e;case j:S=14;break e;case K:S=16,h=null;break e}S=29,u=Error(i(130,s===null?"null":typeof s,"")),h=null}return l=_n(S,u,l,y),l.elementType=s,l.type=h,l.lanes=b,l}function js(s,l,u,h){return s=_n(7,s,h,l),s.lanes=u,s}function hp(s,l,u){return s=_n(6,s,null,l),s.lanes=u,s}function $v(s){var l=_n(18,null,null,0);return l.stateNode=s,l}function fp(s,l,u){return l=_n(4,s.children!==null?s.children:[],s.key,l),l.lanes=u,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var Xv=new WeakMap;function ei(s,l){if(typeof s=="object"&&s!==null){var u=Xv.get(s);return u!==void 0?u:(l={value:s,source:l,stack:zt(l)},Xv.set(s,l),l)}return{value:s,source:l,stack:zt(l)}}var Ua=[],za=0,wu=null,ll=0,ti=[],ni=0,Uo=null,Ti=1,Di="";function so(s,l){Ua[za++]=ll,Ua[za++]=wu,wu=s,ll=l}function Jv(s,l,u){ti[ni++]=Ti,ti[ni++]=Di,ti[ni++]=Uo,Uo=s;var h=Ti;s=Di;var y=32-mn(h)-1;h&=~(1<<y),u+=1;var b=32-mn(l)+y;if(30<b){var S=y-y%5;b=(h&(1<<S)-1).toString(32),h>>=S,y-=S,Ti=1<<32-mn(l)+y|u<<y|h,Di=b+s}else Ti=1<<b|u<<y|h,Di=s}function pp(s){s.return!==null&&(so(s,1),Jv(s,1,0))}function mp(s){for(;s===wu;)wu=Ua[--za],Ua[za]=null,ll=Ua[--za],Ua[za]=null;for(;s===Uo;)Uo=ti[--ni],ti[ni]=null,Di=ti[--ni],ti[ni]=null,Ti=ti[--ni],ti[ni]=null}function Zv(s,l){ti[ni++]=Ti,ti[ni++]=Di,ti[ni++]=Uo,Ti=l.id,Di=l.overflow,Uo=s}var Zt=null,vt=null,We=!1,zo=null,ii=!1,gp=Error(i(519));function Fo(s){var l=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw cl(ei(l,s)),gp}function e0(s){var l=s.stateNode,u=s.type,h=s.memoizedProps;switch(l[Jt]=s,l[kn]=h,u){case"dialog":Fe("cancel",l),Fe("close",l);break;case"iframe":case"object":case"embed":Fe("load",l);break;case"video":case"audio":for(u=0;u<Nl.length;u++)Fe(Nl[u],l);break;case"source":Fe("error",l);break;case"img":case"image":case"link":Fe("error",l),Fe("load",l);break;case"details":Fe("toggle",l);break;case"input":Fe("invalid",l),fv(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Fe("invalid",l);break;case"textarea":Fe("invalid",l),mv(l,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||h.suppressHydrationWarning===!0||yS(l.textContent,u)?(h.popover!=null&&(Fe("beforetoggle",l),Fe("toggle",l)),h.onScroll!=null&&Fe("scroll",l),h.onScrollEnd!=null&&Fe("scrollend",l),h.onClick!=null&&(l.onclick=no),l=!0):l=!1,l||Fo(s,!0)}function t0(s){for(Zt=s.return;Zt;)switch(Zt.tag){case 5:case 31:case 13:ii=!1;return;case 27:case 3:ii=!0;return;default:Zt=Zt.return}}function Fa(s){if(s!==Zt)return!1;if(!We)return t0(s),We=!0,!1;var l=s.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||Em(s.type,s.memoizedProps)),u=!u),u&&vt&&Fo(s),t0(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));vt=OS(s)}else if(l===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));vt=OS(s)}else l===27?(l=vt,ns(s.type)?(s=Hm,Hm=null,vt=s):vt=l):vt=Zt?si(s.stateNode.nextSibling):null;return!0}function Is(){vt=Zt=null,We=!1}function yp(){var s=zo;return s!==null&&(Tn===null?Tn=s:Tn.push.apply(Tn,s),zo=null),s}function cl(s){zo===null?zo=[s]:zo.push(s)}var bp=de(null),Bs=null,ao=null;function qo(s,l,u){te(bp,l._currentValue),l._currentValue=u}function ro(s){s._currentValue=bp.current,be(bp)}function xp(s,l,u){for(;s!==null;){var h=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),s===u)break;s=s.return}}function vp(s,l,u,h){var y=s.child;for(y!==null&&(y.return=s);y!==null;){var b=y.dependencies;if(b!==null){var S=y.child;b=b.firstContext;e:for(;b!==null;){var O=b;b=y;for(var R=0;R<l.length;R++)if(O.context===l[R]){b.lanes|=u,O=b.alternate,O!==null&&(O.lanes|=u),xp(b.return,u,s),h||(S=null);break e}b=O.next}}else if(y.tag===18){if(S=y.return,S===null)throw Error(i(341));S.lanes|=u,b=S.alternate,b!==null&&(b.lanes|=u),xp(S,u,s),S=null}else S=y.child;if(S!==null)S.return=y;else for(S=y;S!==null;){if(S===s){S=null;break}if(y=S.sibling,y!==null){y.return=S.return,S=y;break}S=S.return}y=S}}function qa(s,l,u,h){s=null;for(var y=l,b=!1;y!==null;){if(!b){if((y.flags&524288)!==0)b=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var S=y.alternate;if(S===null)throw Error(i(387));if(S=S.memoizedProps,S!==null){var O=y.type;Bn(y.pendingProps.value,S.value)||(s!==null?s.push(O):s=[O])}}else if(y===ye.current){if(S=y.alternate,S===null)throw Error(i(387));S.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(s!==null?s.push(Il):s=[Il])}y=y.return}s!==null&&vp(l,s,u,h),l.flags|=262144}function Au(s){for(s=s.firstContext;s!==null;){if(!Bn(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function _s(s){Bs=s,ao=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function en(s){return n0(Bs,s)}function Ou(s,l){return Bs===null&&_s(s),n0(s,l)}function n0(s,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},ao===null){if(s===null)throw Error(i(308));ao=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else ao=ao.next=l;return u}var mL=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(u,h){s.push(h)}};this.abort=function(){l.aborted=!0,s.forEach(function(u){return u()})}},gL=n.unstable_scheduleCallback,yL=n.unstable_NormalPriority,Bt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cp(){return{controller:new mL,data:new Map,refCount:0}}function ul(s){s.refCount--,s.refCount===0&&gL(yL,function(){s.controller.abort()})}var dl=null,Sp=0,Ga=0,Ka=null;function bL(s,l){if(dl===null){var u=dl=[];Sp=0,Ga=Am(),Ka={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Sp++,l.then(i0,i0),l}function i0(){if(--Sp===0&&dl!==null){Ka!==null&&(Ka.status="fulfilled");var s=dl;dl=null,Ga=0,Ka=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function xL(s,l){var u=[],h={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return s.then(function(){h.status="fulfilled",h.value=l;for(var y=0;y<u.length;y++)(0,u[y])(l)},function(y){for(h.status="rejected",h.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),h}var o0=B.S;B.S=function(s,l){zC=Xt(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&bL(s,l),o0!==null&&o0(s,l)};var Hs=de(null);function kp(){var s=Hs.current;return s!==null?s:pt.pooledCache}function Pu(s,l){l===null?te(Hs,Hs.current):te(Hs,l.pool)}function s0(){var s=kp();return s===null?null:{parent:Bt._currentValue,pool:s}}var Va=Error(i(460)),wp=Error(i(474)),Tu=Error(i(542)),Du={then:function(){}};function a0(s){return s=s.status,s==="fulfilled"||s==="rejected"}function r0(s,l,u){switch(u=s[u],u===void 0?s.push(l):u!==l&&(l.then(no,no),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,c0(s),s;default:if(typeof l.status=="string")l.then(no,no);else{if(s=pt,s!==null&&100<s.shellSuspendCounter)throw Error(i(482));s=l,s.status="pending",s.then(function(h){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=h}},function(h){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,c0(s),s}throw zs=l,Va}}function Us(s){try{var l=s._init;return l(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(zs=u,Va):u}}var zs=null;function l0(){if(zs===null)throw Error(i(459));var s=zs;return zs=null,s}function c0(s){if(s===Va||s===Tu)throw Error(i(483))}var Wa=null,hl=0;function Mu(s){var l=hl;return hl+=1,Wa===null&&(Wa=[]),r0(Wa,s,l)}function fl(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function Nu(s,l){throw l.$$typeof===x?Error(i(525)):(s=Object.prototype.toString.call(l),Error(i(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function u0(s){function l(_,I){if(s){var F=_.deletions;F===null?(_.deletions=[I],_.flags|=16):F.push(I)}}function u(_,I){if(!s)return null;for(;I!==null;)l(_,I),I=I.sibling;return null}function h(_){for(var I=new Map;_!==null;)_.key!==null?I.set(_.key,_):I.set(_.index,_),_=_.sibling;return I}function y(_,I){return _=oo(_,I),_.index=0,_.sibling=null,_}function b(_,I,F){return _.index=F,s?(F=_.alternate,F!==null?(F=F.index,F<I?(_.flags|=67108866,I):F):(_.flags|=67108866,I)):(_.flags|=1048576,I)}function S(_){return s&&_.alternate===null&&(_.flags|=67108866),_}function O(_,I,F,ee){return I===null||I.tag!==6?(I=hp(F,_.mode,ee),I.return=_,I):(I=y(I,F),I.return=_,I)}function R(_,I,F,ee){var Ae=F.type;return Ae===k?$(_,I,F.props.children,ee,F.key):I!==null&&(I.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===K&&Us(Ae)===I.type)?(I=y(I,F.props),fl(I,F),I.return=_,I):(I=ku(F.type,F.key,F.props,null,_.mode,ee),fl(I,F),I.return=_,I)}function G(_,I,F,ee){return I===null||I.tag!==4||I.stateNode.containerInfo!==F.containerInfo||I.stateNode.implementation!==F.implementation?(I=fp(F,_.mode,ee),I.return=_,I):(I=y(I,F.children||[]),I.return=_,I)}function $(_,I,F,ee,Ae){return I===null||I.tag!==7?(I=js(F,_.mode,ee,Ae),I.return=_,I):(I=y(I,F),I.return=_,I)}function ne(_,I,F){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=hp(""+I,_.mode,F),I.return=_,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case v:return F=ku(I.type,I.key,I.props,null,_.mode,F),fl(F,I),F.return=_,F;case C:return I=fp(I,_.mode,F),I.return=_,I;case K:return I=Us(I),ne(_,I,F)}if(oe(I)||H(I))return I=js(I,_.mode,F,null),I.return=_,I;if(typeof I.then=="function")return ne(_,Mu(I),F);if(I.$$typeof===M)return ne(_,Ou(_,I),F);Nu(_,I)}return null}function W(_,I,F,ee){var Ae=I!==null?I.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return Ae!==null?null:O(_,I,""+F,ee);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case v:return F.key===Ae?R(_,I,F,ee):null;case C:return F.key===Ae?G(_,I,F,ee):null;case K:return F=Us(F),W(_,I,F,ee)}if(oe(F)||H(F))return Ae!==null?null:$(_,I,F,ee,null);if(typeof F.then=="function")return W(_,I,Mu(F),ee);if(F.$$typeof===M)return W(_,I,Ou(_,F),ee);Nu(_,F)}return null}function Q(_,I,F,ee,Ae){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return _=_.get(F)||null,O(I,_,""+ee,Ae);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case v:return _=_.get(ee.key===null?F:ee.key)||null,R(I,_,ee,Ae);case C:return _=_.get(ee.key===null?F:ee.key)||null,G(I,_,ee,Ae);case K:return ee=Us(ee),Q(_,I,F,ee,Ae)}if(oe(ee)||H(ee))return _=_.get(F)||null,$(I,_,ee,Ae,null);if(typeof ee.then=="function")return Q(_,I,F,Mu(ee),Ae);if(ee.$$typeof===M)return Q(_,I,F,Ou(I,ee),Ae);Nu(I,ee)}return null}function ve(_,I,F,ee){for(var Ae=null,Ze=null,ke=I,je=I=0,Ke=null;ke!==null&&je<F.length;je++){ke.index>je?(Ke=ke,ke=null):Ke=ke.sibling;var et=W(_,ke,F[je],ee);if(et===null){ke===null&&(ke=Ke);break}s&&ke&&et.alternate===null&&l(_,ke),I=b(et,I,je),Ze===null?Ae=et:Ze.sibling=et,Ze=et,ke=Ke}if(je===F.length)return u(_,ke),We&&so(_,je),Ae;if(ke===null){for(;je<F.length;je++)ke=ne(_,F[je],ee),ke!==null&&(I=b(ke,I,je),Ze===null?Ae=ke:Ze.sibling=ke,Ze=ke);return We&&so(_,je),Ae}for(ke=h(ke);je<F.length;je++)Ke=Q(ke,_,je,F[je],ee),Ke!==null&&(s&&Ke.alternate!==null&&ke.delete(Ke.key===null?je:Ke.key),I=b(Ke,I,je),Ze===null?Ae=Ke:Ze.sibling=Ke,Ze=Ke);return s&&ke.forEach(function(rs){return l(_,rs)}),We&&so(_,je),Ae}function Pe(_,I,F,ee){if(F==null)throw Error(i(151));for(var Ae=null,Ze=null,ke=I,je=I=0,Ke=null,et=F.next();ke!==null&&!et.done;je++,et=F.next()){ke.index>je?(Ke=ke,ke=null):Ke=ke.sibling;var rs=W(_,ke,et.value,ee);if(rs===null){ke===null&&(ke=Ke);break}s&&ke&&rs.alternate===null&&l(_,ke),I=b(rs,I,je),Ze===null?Ae=rs:Ze.sibling=rs,Ze=rs,ke=Ke}if(et.done)return u(_,ke),We&&so(_,je),Ae;if(ke===null){for(;!et.done;je++,et=F.next())et=ne(_,et.value,ee),et!==null&&(I=b(et,I,je),Ze===null?Ae=et:Ze.sibling=et,Ze=et);return We&&so(_,je),Ae}for(ke=h(ke);!et.done;je++,et=F.next())et=Q(ke,_,je,et.value,ee),et!==null&&(s&&et.alternate!==null&&ke.delete(et.key===null?je:et.key),I=b(et,I,je),Ze===null?Ae=et:Ze.sibling=et,Ze=et);return s&&ke.forEach(function(MR){return l(_,MR)}),We&&so(_,je),Ae}function ut(_,I,F,ee){if(typeof F=="object"&&F!==null&&F.type===k&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case v:e:{for(var Ae=F.key;I!==null;){if(I.key===Ae){if(Ae=F.type,Ae===k){if(I.tag===7){u(_,I.sibling),ee=y(I,F.props.children),ee.return=_,_=ee;break e}}else if(I.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===K&&Us(Ae)===I.type){u(_,I.sibling),ee=y(I,F.props),fl(ee,F),ee.return=_,_=ee;break e}u(_,I);break}else l(_,I);I=I.sibling}F.type===k?(ee=js(F.props.children,_.mode,ee,F.key),ee.return=_,_=ee):(ee=ku(F.type,F.key,F.props,null,_.mode,ee),fl(ee,F),ee.return=_,_=ee)}return S(_);case C:e:{for(Ae=F.key;I!==null;){if(I.key===Ae)if(I.tag===4&&I.stateNode.containerInfo===F.containerInfo&&I.stateNode.implementation===F.implementation){u(_,I.sibling),ee=y(I,F.children||[]),ee.return=_,_=ee;break e}else{u(_,I);break}else l(_,I);I=I.sibling}ee=fp(F,_.mode,ee),ee.return=_,_=ee}return S(_);case K:return F=Us(F),ut(_,I,F,ee)}if(oe(F))return ve(_,I,F,ee);if(H(F)){if(Ae=H(F),typeof Ae!="function")throw Error(i(150));return F=Ae.call(F),Pe(_,I,F,ee)}if(typeof F.then=="function")return ut(_,I,Mu(F),ee);if(F.$$typeof===M)return ut(_,I,Ou(_,F),ee);Nu(_,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,I!==null&&I.tag===6?(u(_,I.sibling),ee=y(I,F),ee.return=_,_=ee):(u(_,I),ee=hp(F,_.mode,ee),ee.return=_,_=ee),S(_)):u(_,I)}return function(_,I,F,ee){try{hl=0;var Ae=ut(_,I,F,ee);return Wa=null,Ae}catch(ke){if(ke===Va||ke===Tu)throw ke;var Ze=_n(29,ke,null,_.mode);return Ze.lanes=ee,Ze.return=_,Ze}finally{}}}var Fs=u0(!0),d0=u0(!1),Go=!1;function Ap(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Op(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Ko(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Vo(s,l,u){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,(ot&2)!==0){var y=h.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),h.pending=l,l=Su(s),Qv(s,null,u),l}return Cu(s,h,l,u),Su(s)}function pl(s,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var h=l.lanes;h&=s.pendingLanes,u|=h,l.lanes=u,nv(s,u)}}function Pp(s,l){var u=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,b=null;if(u=u.firstBaseUpdate,u!==null){do{var S={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};b===null?y=b=S:b=b.next=S,u=u.next}while(u!==null);b===null?y=b=l:b=b.next=l}else y=b=l;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:h.shared,callbacks:h.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=l}var Tp=!1;function ml(){if(Tp){var s=Ka;if(s!==null)throw s}}function gl(s,l,u,h){Tp=!1;var y=s.updateQueue;Go=!1;var b=y.firstBaseUpdate,S=y.lastBaseUpdate,O=y.shared.pending;if(O!==null){y.shared.pending=null;var R=O,G=R.next;R.next=null,S===null?b=G:S.next=G,S=R;var $=s.alternate;$!==null&&($=$.updateQueue,O=$.lastBaseUpdate,O!==S&&(O===null?$.firstBaseUpdate=G:O.next=G,$.lastBaseUpdate=R))}if(b!==null){var ne=y.baseState;S=0,$=G=R=null,O=b;do{var W=O.lane&-536870913,Q=W!==O.lane;if(Q?(Ge&W)===W:(h&W)===W){W!==0&&W===Ga&&(Tp=!0),$!==null&&($=$.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var ve=s,Pe=O;W=l;var ut=u;switch(Pe.tag){case 1:if(ve=Pe.payload,typeof ve=="function"){ne=ve.call(ut,ne,W);break e}ne=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Pe.payload,W=typeof ve=="function"?ve.call(ut,ne,W):ve,W==null)break e;ne=g({},ne,W);break e;case 2:Go=!0}}W=O.callback,W!==null&&(s.flags|=64,Q&&(s.flags|=8192),Q=y.callbacks,Q===null?y.callbacks=[W]:Q.push(W))}else Q={lane:W,tag:O.tag,payload:O.payload,callback:O.callback,next:null},$===null?(G=$=Q,R=ne):$=$.next=Q,S|=W;if(O=O.next,O===null){if(O=y.shared.pending,O===null)break;Q=O,O=Q.next,Q.next=null,y.lastBaseUpdate=Q,y.shared.pending=null}}while(!0);$===null&&(R=ne),y.baseState=R,y.firstBaseUpdate=G,y.lastBaseUpdate=$,b===null&&(y.shared.lanes=0),Xo|=S,s.lanes=S,s.memoizedState=ne}}function h0(s,l){if(typeof s!="function")throw Error(i(191,s));s.call(l)}function f0(s,l){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)h0(u[s],l)}var Qa=de(null),Lu=de(0);function p0(s,l){s=yo,te(Lu,s),te(Qa,l),yo=s|l.baseLanes}function Dp(){te(Lu,yo),te(Qa,Qa.current)}function Mp(){yo=Lu.current,be(Qa),be(Lu)}var Hn=de(null),oi=null;function Wo(s){var l=s.alternate;te(Lt,Lt.current&1),te(Hn,s),oi===null&&(l===null||Qa.current!==null||l.memoizedState!==null)&&(oi=s)}function Np(s){te(Lt,Lt.current),te(Hn,s),oi===null&&(oi=s)}function m0(s){s.tag===22?(te(Lt,Lt.current),te(Hn,s),oi===null&&(oi=s)):Qo()}function Qo(){te(Lt,Lt.current),te(Hn,Hn.current)}function Un(s){be(Hn),oi===s&&(oi=null),be(Lt)}var Lt=de(0);function Ru(s){for(var l=s;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Bm(u)||_m(u)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var lo=0,Ee=null,lt=null,_t=null,Eu=!1,Ya=!1,qs=!1,ju=0,yl=0,$a=null,vL=0;function Pt(){throw Error(i(321))}function Lp(s,l){if(l===null)return!1;for(var u=0;u<l.length&&u<s.length;u++)if(!Bn(s[u],l[u]))return!1;return!0}function Rp(s,l,u,h,y,b){return lo=b,Ee=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,B.H=s===null||s.memoizedState===null?J0:Qp,qs=!1,b=u(h,y),qs=!1,Ya&&(b=y0(l,u,h,y)),g0(s),b}function g0(s){B.H=vl;var l=lt!==null&&lt.next!==null;if(lo=0,_t=lt=Ee=null,Eu=!1,yl=0,$a=null,l)throw Error(i(300));s===null||Ht||(s=s.dependencies,s!==null&&Au(s)&&(Ht=!0))}function y0(s,l,u,h){Ee=s;var y=0;do{if(Ya&&($a=null),yl=0,Ya=!1,25<=y)throw Error(i(301));if(y+=1,_t=lt=null,s.updateQueue!=null){var b=s.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}B.H=Z0,b=l(u,h)}while(Ya);return b}function CL(){var s=B.H,l=s.useState()[0];return l=typeof l.then=="function"?bl(l):l,s=s.useState()[0],(lt!==null?lt.memoizedState:null)!==s&&(Ee.flags|=1024),l}function Ep(){var s=ju!==0;return ju=0,s}function jp(s,l,u){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~u}function Ip(s){if(Eu){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}Eu=!1}lo=0,_t=lt=Ee=null,Ya=!1,yl=ju=0,$a=null}function gn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?Ee.memoizedState=_t=s:_t=_t.next=s,_t}function Rt(){if(lt===null){var s=Ee.alternate;s=s!==null?s.memoizedState:null}else s=lt.next;var l=_t===null?Ee.memoizedState:_t.next;if(l!==null)_t=l,lt=s;else{if(s===null)throw Ee.alternate===null?Error(i(467)):Error(i(310));lt=s,s={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},_t===null?Ee.memoizedState=_t=s:_t=_t.next=s}return _t}function Iu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bl(s){var l=yl;return yl+=1,$a===null&&($a=[]),s=r0($a,s,l),l=Ee,(_t===null?l.memoizedState:_t.next)===null&&(l=l.alternate,B.H=l===null||l.memoizedState===null?J0:Qp),s}function Bu(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return bl(s);if(s.$$typeof===M)return en(s)}throw Error(i(438,String(s)))}function Bp(s){var l=null,u=Ee.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var h=Ee.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=Iu(),Ee.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(s),h=0;h<s;h++)u[h]=z;return l.index++,u}function co(s,l){return typeof l=="function"?l(s):l}function _u(s){var l=Rt();return _p(l,lt,s)}function _p(s,l,u){var h=s.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=u;var y=s.baseQueue,b=h.pending;if(b!==null){if(y!==null){var S=y.next;y.next=b.next,b.next=S}l.baseQueue=y=b,h.pending=null}if(b=s.baseState,y===null)s.memoizedState=b;else{l=y.next;var O=S=null,R=null,G=l,$=!1;do{var ne=G.lane&-536870913;if(ne!==G.lane?(Ge&ne)===ne:(lo&ne)===ne){var W=G.revertLane;if(W===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ne===Ga&&($=!0);else if((lo&W)===W){G=G.next,W===Ga&&($=!0);continue}else ne={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},R===null?(O=R=ne,S=b):R=R.next=ne,Ee.lanes|=W,Xo|=W;ne=G.action,qs&&u(b,ne),b=G.hasEagerState?G.eagerState:u(b,ne)}else W={lane:ne,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},R===null?(O=R=W,S=b):R=R.next=W,Ee.lanes|=ne,Xo|=ne;G=G.next}while(G!==null&&G!==l);if(R===null?S=b:R.next=O,!Bn(b,s.memoizedState)&&(Ht=!0,$&&(u=Ka,u!==null)))throw u;s.memoizedState=b,s.baseState=S,s.baseQueue=R,h.lastRenderedState=b}return y===null&&(h.lanes=0),[s.memoizedState,h.dispatch]}function Hp(s){var l=Rt(),u=l.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=s;var h=u.dispatch,y=u.pending,b=l.memoizedState;if(y!==null){u.pending=null;var S=y=y.next;do b=s(b,S.action),S=S.next;while(S!==y);Bn(b,l.memoizedState)||(Ht=!0),l.memoizedState=b,l.baseQueue===null&&(l.baseState=b),u.lastRenderedState=b}return[b,h]}function b0(s,l,u){var h=Ee,y=Rt(),b=We;if(b){if(u===void 0)throw Error(i(407));u=u()}else u=l();var S=!Bn((lt||y).memoizedState,u);if(S&&(y.memoizedState=u,Ht=!0),y=y.queue,Fp(C0.bind(null,h,y,s),[s]),y.getSnapshot!==l||S||_t!==null&&_t.memoizedState.tag&1){if(h.flags|=2048,Xa(9,{destroy:void 0},v0.bind(null,h,y,u,l),null),pt===null)throw Error(i(349));b||(lo&127)!==0||x0(h,l,u)}return u}function x0(s,l,u){s.flags|=16384,s={getSnapshot:l,value:u},l=Ee.updateQueue,l===null?(l=Iu(),Ee.updateQueue=l,l.stores=[s]):(u=l.stores,u===null?l.stores=[s]:u.push(s))}function v0(s,l,u,h){l.value=u,l.getSnapshot=h,S0(l)&&k0(s)}function C0(s,l,u){return u(function(){S0(l)&&k0(s)})}function S0(s){var l=s.getSnapshot;s=s.value;try{var u=l();return!Bn(s,u)}catch{return!0}}function k0(s){var l=Es(s,2);l!==null&&Dn(l,s,2)}function Up(s){var l=gn();if(typeof s=="function"){var u=s;if(s=u(),qs){Pi(!0);try{u()}finally{Pi(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:co,lastRenderedState:s},l}function w0(s,l,u,h){return s.baseState=u,_p(s,lt,typeof h=="function"?h:co)}function SL(s,l,u,h,y){if(zu(s))throw Error(i(485));if(s=l.action,s!==null){var b={payload:y,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){b.listeners.push(S)}};B.T!==null?u(!0):b.isTransition=!1,h(b),u=l.pending,u===null?(b.next=l.pending=b,A0(l,b)):(b.next=u.next,l.pending=u.next=b)}}function A0(s,l){var u=l.action,h=l.payload,y=s.state;if(l.isTransition){var b=B.T,S={};B.T=S;try{var O=u(y,h),R=B.S;R!==null&&R(S,O),O0(s,l,O)}catch(G){zp(s,l,G)}finally{b!==null&&S.types!==null&&(b.types=S.types),B.T=b}}else try{b=u(y,h),O0(s,l,b)}catch(G){zp(s,l,G)}}function O0(s,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){P0(s,l,h)},function(h){return zp(s,l,h)}):P0(s,l,u)}function P0(s,l,u){l.status="fulfilled",l.value=u,T0(l),s.state=u,l=s.pending,l!==null&&(u=l.next,u===l?s.pending=null:(u=u.next,l.next=u,A0(s,u)))}function zp(s,l,u){var h=s.pending;if(s.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=u,T0(l),l=l.next;while(l!==h)}s.action=null}function T0(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function D0(s,l){return l}function M0(s,l){if(We){var u=pt.formState;if(u!==null){e:{var h=Ee;if(We){if(vt){t:{for(var y=vt,b=ii;y.nodeType!==8;){if(!b){y=null;break t}if(y=si(y.nextSibling),y===null){y=null;break t}}b=y.data,y=b==="F!"||b==="F"?y:null}if(y){vt=si(y.nextSibling),h=y.data==="F!";break e}}Fo(h)}h=!1}h&&(l=u[0])}}return u=gn(),u.memoizedState=u.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:D0,lastRenderedState:l},u.queue=h,u=Y0.bind(null,Ee,h),h.dispatch=u,h=Up(!1),b=Wp.bind(null,Ee,!1,h.queue),h=gn(),y={state:l,dispatch:null,action:s,pending:null},h.queue=y,u=SL.bind(null,Ee,y,b,u),y.dispatch=u,h.memoizedState=s,[l,u,!1]}function N0(s){var l=Rt();return L0(l,lt,s)}function L0(s,l,u){if(l=_p(s,l,D0)[0],s=_u(co)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=bl(l)}catch(S){throw S===Va?Tu:S}else h=l;l=Rt();var y=l.queue,b=y.dispatch;return u!==l.memoizedState&&(Ee.flags|=2048,Xa(9,{destroy:void 0},kL.bind(null,y,u),null)),[h,b,s]}function kL(s,l){s.action=l}function R0(s){var l=Rt(),u=lt;if(u!==null)return L0(l,u,s);Rt(),l=l.memoizedState,u=Rt();var h=u.queue.dispatch;return u.memoizedState=s,[l,h,!1]}function Xa(s,l,u,h){return s={tag:s,create:u,deps:h,inst:l,next:null},l=Ee.updateQueue,l===null&&(l=Iu(),Ee.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=s.next=s:(h=u.next,u.next=s,s.next=h,l.lastEffect=s),s}function E0(){return Rt().memoizedState}function Hu(s,l,u,h){var y=gn();Ee.flags|=s,y.memoizedState=Xa(1|l,{destroy:void 0},u,h===void 0?null:h)}function Uu(s,l,u,h){var y=Rt();h=h===void 0?null:h;var b=y.memoizedState.inst;lt!==null&&h!==null&&Lp(h,lt.memoizedState.deps)?y.memoizedState=Xa(l,b,u,h):(Ee.flags|=s,y.memoizedState=Xa(1|l,b,u,h))}function j0(s,l){Hu(8390656,8,s,l)}function Fp(s,l){Uu(2048,8,s,l)}function wL(s){Ee.flags|=4;var l=Ee.updateQueue;if(l===null)l=Iu(),Ee.updateQueue=l,l.events=[s];else{var u=l.events;u===null?l.events=[s]:u.push(s)}}function I0(s){var l=Rt().memoizedState;return wL({ref:l,nextImpl:s}),function(){if((ot&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}function B0(s,l){return Uu(4,2,s,l)}function _0(s,l){return Uu(4,4,s,l)}function H0(s,l){if(typeof l=="function"){s=s();var u=l(s);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function U0(s,l,u){u=u!=null?u.concat([s]):null,Uu(4,4,H0.bind(null,l,s),u)}function qp(){}function z0(s,l){var u=Rt();l=l===void 0?null:l;var h=u.memoizedState;return l!==null&&Lp(l,h[1])?h[0]:(u.memoizedState=[s,l],s)}function F0(s,l){var u=Rt();l=l===void 0?null:l;var h=u.memoizedState;if(l!==null&&Lp(l,h[1]))return h[0];if(h=s(),qs){Pi(!0);try{s()}finally{Pi(!1)}}return u.memoizedState=[h,l],h}function Gp(s,l,u){return u===void 0||(lo&1073741824)!==0&&(Ge&261930)===0?s.memoizedState=l:(s.memoizedState=u,s=qC(),Ee.lanes|=s,Xo|=s,u)}function q0(s,l,u,h){return Bn(u,l)?u:Qa.current!==null?(s=Gp(s,u,h),Bn(s,l)||(Ht=!0),s):(lo&42)===0||(lo&1073741824)!==0&&(Ge&261930)===0?(Ht=!0,s.memoizedState=u):(s=qC(),Ee.lanes|=s,Xo|=s,l)}function G0(s,l,u,h,y){var b=Z.p;Z.p=b!==0&&8>b?b:8;var S=B.T,O={};B.T=O,Wp(s,!1,l,u);try{var R=y(),G=B.S;if(G!==null&&G(O,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var $=xL(R,h);xl(s,l,$,qn(s))}else xl(s,l,h,qn(s))}catch(ne){xl(s,l,{then:function(){},status:"rejected",reason:ne},qn())}finally{Z.p=b,S!==null&&O.types!==null&&(S.types=O.types),B.T=S}}function AL(){}function Kp(s,l,u,h){if(s.tag!==5)throw Error(i(476));var y=K0(s).queue;G0(s,y,l,se,u===null?AL:function(){return V0(s),u(h)})}function K0(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:co,lastRenderedState:se},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:co,lastRenderedState:u},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function V0(s){var l=K0(s);l.next===null&&(l=s.alternate.memoizedState),xl(s,l.next.queue,{},qn())}function Vp(){return en(Il)}function W0(){return Rt().memoizedState}function Q0(){return Rt().memoizedState}function OL(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var u=qn();s=Ko(u);var h=Vo(l,s,u);h!==null&&(Dn(h,l,u),pl(h,l,u)),l={cache:Cp()},s.payload=l;return}l=l.return}}function PL(s,l,u){var h=qn();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},zu(s)?$0(l,u):(u=up(s,l,u,h),u!==null&&(Dn(u,s,h),X0(u,l,h)))}function Y0(s,l,u){var h=qn();xl(s,l,u,h)}function xl(s,l,u,h){var y={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(zu(s))$0(l,y);else{var b=s.alternate;if(s.lanes===0&&(b===null||b.lanes===0)&&(b=l.lastRenderedReducer,b!==null))try{var S=l.lastRenderedState,O=b(S,u);if(y.hasEagerState=!0,y.eagerState=O,Bn(O,S))return Cu(s,l,y,0),pt===null&&vu(),!1}catch{}finally{}if(u=up(s,l,y,h),u!==null)return Dn(u,s,h),X0(u,l,h),!0}return!1}function Wp(s,l,u,h){if(h={lane:2,revertLane:Am(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},zu(s)){if(l)throw Error(i(479))}else l=up(s,u,h,2),l!==null&&Dn(l,s,2)}function zu(s){var l=s.alternate;return s===Ee||l!==null&&l===Ee}function $0(s,l){Ya=Eu=!0;var u=s.pending;u===null?l.next=l:(l.next=u.next,u.next=l),s.pending=l}function X0(s,l,u){if((u&4194048)!==0){var h=l.lanes;h&=s.pendingLanes,u|=h,l.lanes=u,nv(s,u)}}var vl={readContext:en,use:Bu,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt};vl.useEffectEvent=Pt;var J0={readContext:en,use:Bu,useCallback:function(s,l){return gn().memoizedState=[s,l===void 0?null:l],s},useContext:en,useEffect:j0,useImperativeHandle:function(s,l,u){u=u!=null?u.concat([s]):null,Hu(4194308,4,H0.bind(null,l,s),u)},useLayoutEffect:function(s,l){return Hu(4194308,4,s,l)},useInsertionEffect:function(s,l){Hu(4,2,s,l)},useMemo:function(s,l){var u=gn();l=l===void 0?null:l;var h=s();if(qs){Pi(!0);try{s()}finally{Pi(!1)}}return u.memoizedState=[h,l],h},useReducer:function(s,l,u){var h=gn();if(u!==void 0){var y=u(l);if(qs){Pi(!0);try{u(l)}finally{Pi(!1)}}}else y=l;return h.memoizedState=h.baseState=y,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:y},h.queue=s,s=s.dispatch=PL.bind(null,Ee,s),[h.memoizedState,s]},useRef:function(s){var l=gn();return s={current:s},l.memoizedState=s},useState:function(s){s=Up(s);var l=s.queue,u=Y0.bind(null,Ee,l);return l.dispatch=u,[s.memoizedState,u]},useDebugValue:qp,useDeferredValue:function(s,l){var u=gn();return Gp(u,s,l)},useTransition:function(){var s=Up(!1);return s=G0.bind(null,Ee,s.queue,!0,!1),gn().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,u){var h=Ee,y=gn();if(We){if(u===void 0)throw Error(i(407));u=u()}else{if(u=l(),pt===null)throw Error(i(349));(Ge&127)!==0||x0(h,l,u)}y.memoizedState=u;var b={value:u,getSnapshot:l};return y.queue=b,j0(C0.bind(null,h,b,s),[s]),h.flags|=2048,Xa(9,{destroy:void 0},v0.bind(null,h,b,u,l),null),u},useId:function(){var s=gn(),l=pt.identifierPrefix;if(We){var u=Di,h=Ti;u=(h&~(1<<32-mn(h)-1)).toString(32)+u,l="_"+l+"R_"+u,u=ju++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=vL++,l="_"+l+"r_"+u.toString(32)+"_";return s.memoizedState=l},useHostTransitionStatus:Vp,useFormState:M0,useActionState:M0,useOptimistic:function(s){var l=gn();l.memoizedState=l.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=Wp.bind(null,Ee,!0,u),u.dispatch=l,[s,l]},useMemoCache:Bp,useCacheRefresh:function(){return gn().memoizedState=OL.bind(null,Ee)},useEffectEvent:function(s){var l=gn(),u={impl:s};return l.memoizedState=u,function(){if((ot&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},Qp={readContext:en,use:Bu,useCallback:z0,useContext:en,useEffect:Fp,useImperativeHandle:U0,useInsertionEffect:B0,useLayoutEffect:_0,useMemo:F0,useReducer:_u,useRef:E0,useState:function(){return _u(co)},useDebugValue:qp,useDeferredValue:function(s,l){var u=Rt();return q0(u,lt.memoizedState,s,l)},useTransition:function(){var s=_u(co)[0],l=Rt().memoizedState;return[typeof s=="boolean"?s:bl(s),l]},useSyncExternalStore:b0,useId:W0,useHostTransitionStatus:Vp,useFormState:N0,useActionState:N0,useOptimistic:function(s,l){var u=Rt();return w0(u,lt,s,l)},useMemoCache:Bp,useCacheRefresh:Q0};Qp.useEffectEvent=I0;var Z0={readContext:en,use:Bu,useCallback:z0,useContext:en,useEffect:Fp,useImperativeHandle:U0,useInsertionEffect:B0,useLayoutEffect:_0,useMemo:F0,useReducer:Hp,useRef:E0,useState:function(){return Hp(co)},useDebugValue:qp,useDeferredValue:function(s,l){var u=Rt();return lt===null?Gp(u,s,l):q0(u,lt.memoizedState,s,l)},useTransition:function(){var s=Hp(co)[0],l=Rt().memoizedState;return[typeof s=="boolean"?s:bl(s),l]},useSyncExternalStore:b0,useId:W0,useHostTransitionStatus:Vp,useFormState:R0,useActionState:R0,useOptimistic:function(s,l){var u=Rt();return lt!==null?w0(u,lt,s,l):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:Bp,useCacheRefresh:Q0};Z0.useEffectEvent=I0;function Yp(s,l,u,h){l=s.memoizedState,u=u(h,l),u=u==null?l:g({},l,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var $p={enqueueSetState:function(s,l,u){s=s._reactInternals;var h=qn(),y=Ko(h);y.payload=l,u!=null&&(y.callback=u),l=Vo(s,y,h),l!==null&&(Dn(l,s,h),pl(l,s,h))},enqueueReplaceState:function(s,l,u){s=s._reactInternals;var h=qn(),y=Ko(h);y.tag=1,y.payload=l,u!=null&&(y.callback=u),l=Vo(s,y,h),l!==null&&(Dn(l,s,h),pl(l,s,h))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var u=qn(),h=Ko(u);h.tag=2,l!=null&&(h.callback=l),l=Vo(s,h,u),l!==null&&(Dn(l,s,u),pl(l,s,u))}};function eC(s,l,u,h,y,b,S){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(h,b,S):l.prototype&&l.prototype.isPureReactComponent?!al(u,h)||!al(y,b):!0}function tC(s,l,u,h){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,h),l.state!==s&&$p.enqueueReplaceState(l,l.state,null)}function Gs(s,l){var u=l;if("ref"in l){u={};for(var h in l)h!=="ref"&&(u[h]=l[h])}if(s=s.defaultProps){u===l&&(u=g({},u));for(var y in s)u[y]===void 0&&(u[y]=s[y])}return u}function nC(s){xu(s)}function iC(s){console.error(s)}function oC(s){xu(s)}function Fu(s,l){try{var u=s.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function sC(s,l,u){try{var h=s.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Xp(s,l,u){return u=Ko(u),u.tag=3,u.payload={element:null},u.callback=function(){Fu(s,l)},u}function aC(s){return s=Ko(s),s.tag=3,s}function rC(s,l,u,h){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var b=h.value;s.payload=function(){return y(b)},s.callback=function(){sC(l,u,h)}}var S=u.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(s.callback=function(){sC(l,u,h),typeof y!="function"&&(Jo===null?Jo=new Set([this]):Jo.add(this));var O=h.stack;this.componentDidCatch(h.value,{componentStack:O!==null?O:""})})}function TL(s,l,u,h,y){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=u.alternate,l!==null&&qa(l,u,y,!0),u=Hn.current,u!==null){switch(u.tag){case 31:case 13:return oi===null?ed():u.alternate===null&&Tt===0&&(Tt=3),u.flags&=-257,u.flags|=65536,u.lanes=y,h===Du?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([h]):l.add(h),Sm(s,h,y)),!1;case 22:return u.flags|=65536,h===Du?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([h]):u.add(h)),Sm(s,h,y)),!1}throw Error(i(435,u.tag))}return Sm(s,h,y),ed(),!1}if(We)return l=Hn.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,h!==gp&&(s=Error(i(422),{cause:h}),cl(ei(s,u)))):(h!==gp&&(l=Error(i(423),{cause:h}),cl(ei(l,u))),s=s.current.alternate,s.flags|=65536,y&=-y,s.lanes|=y,h=ei(h,u),y=Xp(s.stateNode,h,y),Pp(s,y),Tt!==4&&(Tt=2)),!1;var b=Error(i(520),{cause:h});if(b=ei(b,u),Tl===null?Tl=[b]:Tl.push(b),Tt!==4&&(Tt=2),l===null)return!0;h=ei(h,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,s=y&-y,u.lanes|=s,s=Xp(u.stateNode,h,s),Pp(u,s),!1;case 1:if(l=u.type,b=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Jo===null||!Jo.has(b))))return u.flags|=65536,y&=-y,u.lanes|=y,y=aC(y),rC(y,s,u,h),Pp(u,y),!1}u=u.return}while(u!==null);return!1}var Jp=Error(i(461)),Ht=!1;function tn(s,l,u,h){l.child=s===null?d0(l,null,u,h):Fs(l,s.child,u,h)}function lC(s,l,u,h,y){u=u.render;var b=l.ref;if("ref"in h){var S={};for(var O in h)O!=="ref"&&(S[O]=h[O])}else S=h;return _s(l),h=Rp(s,l,u,S,b,y),O=Ep(),s!==null&&!Ht?(jp(s,l,y),uo(s,l,y)):(We&&O&&pp(l),l.flags|=1,tn(s,l,h,y),l.child)}function cC(s,l,u,h,y){if(s===null){var b=u.type;return typeof b=="function"&&!dp(b)&&b.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=b,uC(s,l,b,h,y)):(s=ku(u.type,null,h,l,l.mode,y),s.ref=l.ref,s.return=l,l.child=s)}if(b=s.child,!am(s,y)){var S=b.memoizedProps;if(u=u.compare,u=u!==null?u:al,u(S,h)&&s.ref===l.ref)return uo(s,l,y)}return l.flags|=1,s=oo(b,h),s.ref=l.ref,s.return=l,l.child=s}function uC(s,l,u,h,y){if(s!==null){var b=s.memoizedProps;if(al(b,h)&&s.ref===l.ref)if(Ht=!1,l.pendingProps=h=b,am(s,y))(s.flags&131072)!==0&&(Ht=!0);else return l.lanes=s.lanes,uo(s,l,y)}return Zp(s,l,u,h,y)}function dC(s,l,u,h){var y=h.children,b=s!==null?s.memoizedState:null;if(s===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((l.flags&128)!==0){if(b=b!==null?b.baseLanes|u:u,s!==null){for(h=l.child=s.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;h=y&~b}else h=0,l.child=null;return hC(s,l,b,u,h)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&Pu(l,b!==null?b.cachePool:null),b!==null?p0(l,b):Dp(),m0(l);else return h=l.lanes=536870912,hC(s,l,b!==null?b.baseLanes|u:u,u,h)}else b!==null?(Pu(l,b.cachePool),p0(l,b),Qo(),l.memoizedState=null):(s!==null&&Pu(l,null),Dp(),Qo());return tn(s,l,y,u),l.child}function Cl(s,l){return s!==null&&s.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function hC(s,l,u,h,y){var b=kp();return b=b===null?null:{parent:Bt._currentValue,pool:b},l.memoizedState={baseLanes:u,cachePool:b},s!==null&&Pu(l,null),Dp(),m0(l),s!==null&&qa(s,l,h,!0),l.childLanes=y,null}function qu(s,l){return l=Ku({mode:l.mode,children:l.children},s.mode),l.ref=s.ref,s.child=l,l.return=s,l}function fC(s,l,u){return Fs(l,s.child,null,u),s=qu(l,l.pendingProps),s.flags|=2,Un(l),l.memoizedState=null,s}function DL(s,l,u){var h=l.pendingProps,y=(l.flags&128)!==0;if(l.flags&=-129,s===null){if(We){if(h.mode==="hidden")return s=qu(l,h),l.lanes=536870912,Cl(null,s);if(Np(l),(s=vt)?(s=AS(s,ii),s=s!==null&&s.data==="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:Uo!==null?{id:Ti,overflow:Di}:null,retryLane:536870912,hydrationErrors:null},u=$v(s),u.return=l,l.child=u,Zt=l,vt=null)):s=null,s===null)throw Fo(l);return l.lanes=536870912,null}return qu(l,h)}var b=s.memoizedState;if(b!==null){var S=b.dehydrated;if(Np(l),y)if(l.flags&256)l.flags&=-257,l=fC(s,l,u);else if(l.memoizedState!==null)l.child=s.child,l.flags|=128,l=null;else throw Error(i(558));else if(Ht||qa(s,l,u,!1),y=(u&s.childLanes)!==0,Ht||y){if(h=pt,h!==null&&(S=iv(h,u),S!==0&&S!==b.retryLane))throw b.retryLane=S,Es(s,S),Dn(h,s,S),Jp;ed(),l=fC(s,l,u)}else s=b.treeContext,vt=si(S.nextSibling),Zt=l,We=!0,zo=null,ii=!1,s!==null&&Zv(l,s),l=qu(l,h),l.flags|=4096;return l}return s=oo(s.child,{mode:h.mode,children:h.children}),s.ref=l.ref,l.child=s,s.return=l,s}function Gu(s,l){var u=l.ref;if(u===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(s===null||s.ref!==u)&&(l.flags|=4194816)}}function Zp(s,l,u,h,y){return _s(l),u=Rp(s,l,u,h,void 0,y),h=Ep(),s!==null&&!Ht?(jp(s,l,y),uo(s,l,y)):(We&&h&&pp(l),l.flags|=1,tn(s,l,u,y),l.child)}function pC(s,l,u,h,y,b){return _s(l),l.updateQueue=null,u=y0(l,h,u,y),g0(s),h=Ep(),s!==null&&!Ht?(jp(s,l,b),uo(s,l,b)):(We&&h&&pp(l),l.flags|=1,tn(s,l,u,b),l.child)}function mC(s,l,u,h,y){if(_s(l),l.stateNode===null){var b=Ha,S=u.contextType;typeof S=="object"&&S!==null&&(b=en(S)),b=new u(h,b),l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=$p,l.stateNode=b,b._reactInternals=l,b=l.stateNode,b.props=h,b.state=l.memoizedState,b.refs={},Ap(l),S=u.contextType,b.context=typeof S=="object"&&S!==null?en(S):Ha,b.state=l.memoizedState,S=u.getDerivedStateFromProps,typeof S=="function"&&(Yp(l,u,S,h),b.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(S=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),S!==b.state&&$p.enqueueReplaceState(b,b.state,null),gl(l,h,b,y),ml(),b.state=l.memoizedState),typeof b.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(s===null){b=l.stateNode;var O=l.memoizedProps,R=Gs(u,O);b.props=R;var G=b.context,$=u.contextType;S=Ha,typeof $=="object"&&$!==null&&(S=en($));var ne=u.getDerivedStateFromProps;$=typeof ne=="function"||typeof b.getSnapshotBeforeUpdate=="function",O=l.pendingProps!==O,$||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(O||G!==S)&&tC(l,b,h,S),Go=!1;var W=l.memoizedState;b.state=W,gl(l,h,b,y),ml(),G=l.memoizedState,O||W!==G||Go?(typeof ne=="function"&&(Yp(l,u,ne,h),G=l.memoizedState),(R=Go||eC(l,u,R,h,W,G,S))?($||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(l.flags|=4194308)):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=G),b.props=h,b.state=G,b.context=S,h=R):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{b=l.stateNode,Op(s,l),S=l.memoizedProps,$=Gs(u,S),b.props=$,ne=l.pendingProps,W=b.context,G=u.contextType,R=Ha,typeof G=="object"&&G!==null&&(R=en(G)),O=u.getDerivedStateFromProps,(G=typeof O=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(S!==ne||W!==R)&&tC(l,b,h,R),Go=!1,W=l.memoizedState,b.state=W,gl(l,h,b,y),ml();var Q=l.memoizedState;S!==ne||W!==Q||Go||s!==null&&s.dependencies!==null&&Au(s.dependencies)?(typeof O=="function"&&(Yp(l,u,O,h),Q=l.memoizedState),($=Go||eC(l,u,$,h,W,Q,R)||s!==null&&s.dependencies!==null&&Au(s.dependencies))?(G||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(h,Q,R),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(h,Q,R)),typeof b.componentDidUpdate=="function"&&(l.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof b.componentDidUpdate!="function"||S===s.memoizedProps&&W===s.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||S===s.memoizedProps&&W===s.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=Q),b.props=h,b.state=Q,b.context=R,h=$):(typeof b.componentDidUpdate!="function"||S===s.memoizedProps&&W===s.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||S===s.memoizedProps&&W===s.memoizedState||(l.flags|=1024),h=!1)}return b=h,Gu(s,l),h=(l.flags&128)!==0,b||h?(b=l.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:b.render(),l.flags|=1,s!==null&&h?(l.child=Fs(l,s.child,null,y),l.child=Fs(l,null,u,y)):tn(s,l,u,y),l.memoizedState=b.state,s=l.child):s=uo(s,l,y),s}function gC(s,l,u,h){return Is(),l.flags|=256,tn(s,l,u,h),l.child}var em={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tm(s){return{baseLanes:s,cachePool:s0()}}function nm(s,l,u){return s=s!==null?s.childLanes&~u:0,l&&(s|=Fn),s}function yC(s,l,u){var h=l.pendingProps,y=!1,b=(l.flags&128)!==0,S;if((S=b)||(S=s!==null&&s.memoizedState===null?!1:(Lt.current&2)!==0),S&&(y=!0,l.flags&=-129),S=(l.flags&32)!==0,l.flags&=-33,s===null){if(We){if(y?Wo(l):Qo(),(s=vt)?(s=AS(s,ii),s=s!==null&&s.data!=="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:Uo!==null?{id:Ti,overflow:Di}:null,retryLane:536870912,hydrationErrors:null},u=$v(s),u.return=l,l.child=u,Zt=l,vt=null)):s=null,s===null)throw Fo(l);return _m(s)?l.lanes=32:l.lanes=536870912,null}var O=h.children;return h=h.fallback,y?(Qo(),y=l.mode,O=Ku({mode:"hidden",children:O},y),h=js(h,y,u,null),O.return=l,h.return=l,O.sibling=h,l.child=O,h=l.child,h.memoizedState=tm(u),h.childLanes=nm(s,S,u),l.memoizedState=em,Cl(null,h)):(Wo(l),im(l,O))}var R=s.memoizedState;if(R!==null&&(O=R.dehydrated,O!==null)){if(b)l.flags&256?(Wo(l),l.flags&=-257,l=om(s,l,u)):l.memoizedState!==null?(Qo(),l.child=s.child,l.flags|=128,l=null):(Qo(),O=h.fallback,y=l.mode,h=Ku({mode:"visible",children:h.children},y),O=js(O,y,u,null),O.flags|=2,h.return=l,O.return=l,h.sibling=O,l.child=h,Fs(l,s.child,null,u),h=l.child,h.memoizedState=tm(u),h.childLanes=nm(s,S,u),l.memoizedState=em,l=Cl(null,h));else if(Wo(l),_m(O)){if(S=O.nextSibling&&O.nextSibling.dataset,S)var G=S.dgst;S=G,h=Error(i(419)),h.stack="",h.digest=S,cl({value:h,source:null,stack:null}),l=om(s,l,u)}else if(Ht||qa(s,l,u,!1),S=(u&s.childLanes)!==0,Ht||S){if(S=pt,S!==null&&(h=iv(S,u),h!==0&&h!==R.retryLane))throw R.retryLane=h,Es(s,h),Dn(S,s,h),Jp;Bm(O)||ed(),l=om(s,l,u)}else Bm(O)?(l.flags|=192,l.child=s.child,l=null):(s=R.treeContext,vt=si(O.nextSibling),Zt=l,We=!0,zo=null,ii=!1,s!==null&&Zv(l,s),l=im(l,h.children),l.flags|=4096);return l}return y?(Qo(),O=h.fallback,y=l.mode,R=s.child,G=R.sibling,h=oo(R,{mode:"hidden",children:h.children}),h.subtreeFlags=R.subtreeFlags&65011712,G!==null?O=oo(G,O):(O=js(O,y,u,null),O.flags|=2),O.return=l,h.return=l,h.sibling=O,l.child=h,Cl(null,h),h=l.child,O=s.child.memoizedState,O===null?O=tm(u):(y=O.cachePool,y!==null?(R=Bt._currentValue,y=y.parent!==R?{parent:R,pool:R}:y):y=s0(),O={baseLanes:O.baseLanes|u,cachePool:y}),h.memoizedState=O,h.childLanes=nm(s,S,u),l.memoizedState=em,Cl(s.child,h)):(Wo(l),u=s.child,s=u.sibling,u=oo(u,{mode:"visible",children:h.children}),u.return=l,u.sibling=null,s!==null&&(S=l.deletions,S===null?(l.deletions=[s],l.flags|=16):S.push(s)),l.child=u,l.memoizedState=null,u)}function im(s,l){return l=Ku({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function Ku(s,l){return s=_n(22,s,null,l),s.lanes=0,s}function om(s,l,u){return Fs(l,s.child,null,u),s=im(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function bC(s,l,u){s.lanes|=l;var h=s.alternate;h!==null&&(h.lanes|=l),xp(s.return,l,u)}function sm(s,l,u,h,y,b){var S=s.memoizedState;S===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:y,treeForkCount:b}:(S.isBackwards=l,S.rendering=null,S.renderingStartTime=0,S.last=h,S.tail=u,S.tailMode=y,S.treeForkCount=b)}function xC(s,l,u){var h=l.pendingProps,y=h.revealOrder,b=h.tail;h=h.children;var S=Lt.current,O=(S&2)!==0;if(O?(S=S&1|2,l.flags|=128):S&=1,te(Lt,S),tn(s,l,h,u),h=We?ll:0,!O&&s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&bC(s,u,l);else if(s.tag===19)bC(s,u,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(y){case"forwards":for(u=l.child,y=null;u!==null;)s=u.alternate,s!==null&&Ru(s)===null&&(y=u),u=u.sibling;u=y,u===null?(y=l.child,l.child=null):(y=u.sibling,u.sibling=null),sm(l,!1,y,u,b,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=l.child,l.child=null;y!==null;){if(s=y.alternate,s!==null&&Ru(s)===null){l.child=y;break}s=y.sibling,y.sibling=u,u=y,y=s}sm(l,!0,u,null,b,h);break;case"together":sm(l,!1,null,null,void 0,h);break;default:l.memoizedState=null}return l.child}function uo(s,l,u){if(s!==null&&(l.dependencies=s.dependencies),Xo|=l.lanes,(u&l.childLanes)===0)if(s!==null){if(qa(s,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(i(153));if(l.child!==null){for(s=l.child,u=oo(s,s.pendingProps),l.child=u,u.return=l;s.sibling!==null;)s=s.sibling,u=u.sibling=oo(s,s.pendingProps),u.return=l;u.sibling=null}return l.child}function am(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&Au(s)))}function ML(s,l,u){switch(l.tag){case 3:Te(l,l.stateNode.containerInfo),qo(l,Bt,s.memoizedState.cache),Is();break;case 27:case 5:nt(l);break;case 4:Te(l,l.stateNode.containerInfo);break;case 10:qo(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Np(l),null;break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(Wo(l),l.flags|=128,null):(u&l.child.childLanes)!==0?yC(s,l,u):(Wo(l),s=uo(s,l,u),s!==null?s.sibling:null);Wo(l);break;case 19:var y=(s.flags&128)!==0;if(h=(u&l.childLanes)!==0,h||(qa(s,l,u,!1),h=(u&l.childLanes)!==0),y){if(h)return xC(s,l,u);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),te(Lt,Lt.current),h)break;return null;case 22:return l.lanes=0,dC(s,l,u,l.pendingProps);case 24:qo(l,Bt,s.memoizedState.cache)}return uo(s,l,u)}function vC(s,l,u){if(s!==null)if(s.memoizedProps!==l.pendingProps)Ht=!0;else{if(!am(s,u)&&(l.flags&128)===0)return Ht=!1,ML(s,l,u);Ht=(s.flags&131072)!==0}else Ht=!1,We&&(l.flags&1048576)!==0&&Jv(l,ll,l.index);switch(l.lanes=0,l.tag){case 16:e:{var h=l.pendingProps;if(s=Us(l.elementType),l.type=s,typeof s=="function")dp(s)?(h=Gs(s,h),l.tag=1,l=mC(null,l,s,h,u)):(l.tag=0,l=Zp(null,l,s,h,u));else{if(s!=null){var y=s.$$typeof;if(y===D){l.tag=11,l=lC(null,l,s,h,u);break e}else if(y===j){l.tag=14,l=cC(null,l,s,h,u);break e}}throw l=ie(s)||s,Error(i(306,l,""))}}return l;case 0:return Zp(s,l,l.type,l.pendingProps,u);case 1:return h=l.type,y=Gs(h,l.pendingProps),mC(s,l,h,y,u);case 3:e:{if(Te(l,l.stateNode.containerInfo),s===null)throw Error(i(387));h=l.pendingProps;var b=l.memoizedState;y=b.element,Op(s,l),gl(l,h,null,u);var S=l.memoizedState;if(h=S.cache,qo(l,Bt,h),h!==b.cache&&vp(l,[Bt],u,!0),ml(),h=S.element,b.isDehydrated)if(b={element:h,isDehydrated:!1,cache:S.cache},l.updateQueue.baseState=b,l.memoizedState=b,l.flags&256){l=gC(s,l,h,u);break e}else if(h!==y){y=ei(Error(i(424)),l),cl(y),l=gC(s,l,h,u);break e}else{switch(s=l.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(vt=si(s.firstChild),Zt=l,We=!0,zo=null,ii=!0,u=d0(l,null,h,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Is(),h===y){l=uo(s,l,u);break e}tn(s,l,h,u)}l=l.child}return l;case 26:return Gu(s,l),s===null?(u=NS(l.type,null,l.pendingProps,null))?l.memoizedState=u:We||(u=l.type,s=l.pendingProps,h=rd(Se.current).createElement(u),h[Jt]=l,h[kn]=s,nn(h,u,s),Vt(h),l.stateNode=h):l.memoizedState=NS(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return nt(l),s===null&&We&&(h=l.stateNode=TS(l.type,l.pendingProps,Se.current),Zt=l,ii=!0,y=vt,ns(l.type)?(Hm=y,vt=si(h.firstChild)):vt=y),tn(s,l,l.pendingProps.children,u),Gu(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&&We&&((y=h=vt)&&(h=aR(h,l.type,l.pendingProps,ii),h!==null?(l.stateNode=h,Zt=l,vt=si(h.firstChild),ii=!1,y=!0):y=!1),y||Fo(l)),nt(l),y=l.type,b=l.pendingProps,S=s!==null?s.memoizedProps:null,h=b.children,Em(y,b)?h=null:S!==null&&Em(y,S)&&(l.flags|=32),l.memoizedState!==null&&(y=Rp(s,l,CL,null,null,u),Il._currentValue=y),Gu(s,l),tn(s,l,h,u),l.child;case 6:return s===null&&We&&((s=u=vt)&&(u=rR(u,l.pendingProps,ii),u!==null?(l.stateNode=u,Zt=l,vt=null,s=!0):s=!1),s||Fo(l)),null;case 13:return yC(s,l,u);case 4:return Te(l,l.stateNode.containerInfo),h=l.pendingProps,s===null?l.child=Fs(l,null,h,u):tn(s,l,h,u),l.child;case 11:return lC(s,l,l.type,l.pendingProps,u);case 7:return tn(s,l,l.pendingProps,u),l.child;case 8:return tn(s,l,l.pendingProps.children,u),l.child;case 12:return tn(s,l,l.pendingProps.children,u),l.child;case 10:return h=l.pendingProps,qo(l,l.type,h.value),tn(s,l,h.children,u),l.child;case 9:return y=l.type._context,h=l.pendingProps.children,_s(l),y=en(y),h=h(y),l.flags|=1,tn(s,l,h,u),l.child;case 14:return cC(s,l,l.type,l.pendingProps,u);case 15:return uC(s,l,l.type,l.pendingProps,u);case 19:return xC(s,l,u);case 31:return DL(s,l,u);case 22:return dC(s,l,u,l.pendingProps);case 24:return _s(l),h=en(Bt),s===null?(y=kp(),y===null&&(y=pt,b=Cp(),y.pooledCache=b,b.refCount++,b!==null&&(y.pooledCacheLanes|=u),y=b),l.memoizedState={parent:h,cache:y},Ap(l),qo(l,Bt,y)):((s.lanes&u)!==0&&(Op(s,l),gl(l,null,null,u),ml()),y=s.memoizedState,b=l.memoizedState,y.parent!==h?(y={parent:h,cache:h},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),qo(l,Bt,h)):(h=b.cache,qo(l,Bt,h),h!==y.cache&&vp(l,[Bt],u,!0))),tn(s,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(i(156,l.tag))}function ho(s){s.flags|=4}function rm(s,l,u,h,y){if((l=(s.mode&32)!==0)&&(l=!1),l){if(s.flags|=16777216,(y&335544128)===y)if(s.stateNode.complete)s.flags|=8192;else if(WC())s.flags|=8192;else throw zs=Du,wp}else s.flags&=-16777217}function CC(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!IS(l))if(WC())s.flags|=8192;else throw zs=Du,wp}function Vu(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?lu():536870912,s.lanes|=l,tr|=l)}function Sl(s,l){if(!We)switch(s.tailMode){case"hidden":l=s.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:h.sibling=null}}function Ct(s){var l=s.alternate!==null&&s.alternate.child===s.child,u=0,h=0;if(l)for(var y=s.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=s,y=y.sibling;else for(y=s.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=s,y=y.sibling;return s.subtreeFlags|=h,s.childLanes=u,l}function NL(s,l,u){var h=l.pendingProps;switch(mp(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ct(l),null;case 1:return Ct(l),null;case 3:return u=l.stateNode,h=null,s!==null&&(h=s.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),ro(Bt),Ie(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(Fa(l)?ho(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,yp())),Ct(l),null;case 26:var y=l.type,b=l.memoizedState;return s===null?(ho(l),b!==null?(Ct(l),CC(l,b)):(Ct(l),rm(l,y,null,h,u))):b?b!==s.memoizedState?(ho(l),Ct(l),CC(l,b)):(Ct(l),l.flags&=-16777217):(s=s.memoizedProps,s!==h&&ho(l),Ct(l),rm(l,y,s,h,u)),null;case 27:if(Ot(l),u=Se.current,y=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==h&&ho(l);else{if(!h){if(l.stateNode===null)throw Error(i(166));return Ct(l),null}s=le.current,Fa(l)?e0(l):(s=TS(y,h,u),l.stateNode=s,ho(l))}return Ct(l),null;case 5:if(Ot(l),y=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==h&&ho(l);else{if(!h){if(l.stateNode===null)throw Error(i(166));return Ct(l),null}if(b=le.current,Fa(l))e0(l);else{var S=rd(Se.current);switch(b){case 1:b=S.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:b=S.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":b=S.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":b=S.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":b=S.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof h.is=="string"?S.createElement("select",{is:h.is}):S.createElement("select"),h.multiple?b.multiple=!0:h.size&&(b.size=h.size);break;default:b=typeof h.is=="string"?S.createElement(y,{is:h.is}):S.createElement(y)}}b[Jt]=l,b[kn]=h;e:for(S=l.child;S!==null;){if(S.tag===5||S.tag===6)b.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===l)break e;for(;S.sibling===null;){if(S.return===null||S.return===l)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}l.stateNode=b;e:switch(nn(b,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&ho(l)}}return Ct(l),rm(l,l.type,s===null?null:s.memoizedProps,l.pendingProps,u),null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==h&&ho(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(i(166));if(s=Se.current,Fa(l)){if(s=l.stateNode,u=l.memoizedProps,h=null,y=Zt,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}s[Jt]=l,s=!!(s.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||yS(s.nodeValue,u)),s||Fo(l,!0)}else s=rd(s).createTextNode(h),s[Jt]=l,l.stateNode=s}return Ct(l),null;case 31:if(u=l.memoizedState,s===null||s.memoizedState!==null){if(h=Fa(l),u!==null){if(s===null){if(!h)throw Error(i(318));if(s=l.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(557));s[Jt]=l}else Is(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Ct(l),s=!1}else u=yp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return l.flags&256?(Un(l),l):(Un(l),null);if((l.flags&128)!==0)throw Error(i(558))}return Ct(l),null;case 13:if(h=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(y=Fa(l),h!==null&&h.dehydrated!==null){if(s===null){if(!y)throw Error(i(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[Jt]=l}else Is(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Ct(l),y=!1}else y=yp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(Un(l),l):(Un(l),null)}return Un(l),(l.flags&128)!==0?(l.lanes=u,l):(u=h!==null,s=s!==null&&s.memoizedState!==null,u&&(h=l.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),b=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(b=h.memoizedState.cachePool.pool),b!==y&&(h.flags|=2048)),u!==s&&u&&(l.child.flags|=8192),Vu(l,l.updateQueue),Ct(l),null);case 4:return Ie(),s===null&&Dm(l.stateNode.containerInfo),Ct(l),null;case 10:return ro(l.type),Ct(l),null;case 19:if(be(Lt),h=l.memoizedState,h===null)return Ct(l),null;if(y=(l.flags&128)!==0,b=h.rendering,b===null)if(y)Sl(h,!1);else{if(Tt!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(b=Ru(s),b!==null){for(l.flags|=128,Sl(h,!1),s=b.updateQueue,l.updateQueue=s,Vu(l,s),l.subtreeFlags=0,s=u,u=l.child;u!==null;)Yv(u,s),u=u.sibling;return te(Lt,Lt.current&1|2),We&&so(l,h.treeForkCount),l.child}s=s.sibling}h.tail!==null&&Xt()>Xu&&(l.flags|=128,y=!0,Sl(h,!1),l.lanes=4194304)}else{if(!y)if(s=Ru(b),s!==null){if(l.flags|=128,y=!0,s=s.updateQueue,l.updateQueue=s,Vu(l,s),Sl(h,!0),h.tail===null&&h.tailMode==="hidden"&&!b.alternate&&!We)return Ct(l),null}else 2*Xt()-h.renderingStartTime>Xu&&u!==536870912&&(l.flags|=128,y=!0,Sl(h,!1),l.lanes=4194304);h.isBackwards?(b.sibling=l.child,l.child=b):(s=h.last,s!==null?s.sibling=b:l.child=b,h.last=b)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=Xt(),s.sibling=null,u=Lt.current,te(Lt,y?u&1|2:u&1),We&&so(l,h.treeForkCount),s):(Ct(l),null);case 22:case 23:return Un(l),Mp(),h=l.memoizedState!==null,s!==null?s.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(u&536870912)!==0&&(l.flags&128)===0&&(Ct(l),l.subtreeFlags&6&&(l.flags|=8192)):Ct(l),u=l.updateQueue,u!==null&&Vu(l,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==u&&(l.flags|=2048),s!==null&&be(Hs),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),ro(Bt),Ct(l),null;case 25:return null;case 30:return null}throw Error(i(156,l.tag))}function LL(s,l){switch(mp(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return ro(Bt),Ie(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return Ot(l),null;case 31:if(l.memoizedState!==null){if(Un(l),l.alternate===null)throw Error(i(340));Is()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 13:if(Un(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(i(340));Is()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return be(Lt),null;case 4:return Ie(),null;case 10:return ro(l.type),null;case 22:case 23:return Un(l),Mp(),s!==null&&be(Hs),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return ro(Bt),null;case 25:return null;default:return null}}function SC(s,l){switch(mp(l),l.tag){case 3:ro(Bt),Ie();break;case 26:case 27:case 5:Ot(l);break;case 4:Ie();break;case 31:l.memoizedState!==null&&Un(l);break;case 13:Un(l);break;case 19:be(Lt);break;case 10:ro(l.type);break;case 22:case 23:Un(l),Mp(),s!==null&&be(Hs);break;case 24:ro(Bt)}}function kl(s,l){try{var u=l.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&s)===s){h=void 0;var b=u.create,S=u.inst;h=b(),S.destroy=h}u=u.next}while(u!==y)}}catch(O){at(l,l.return,O)}}function Yo(s,l,u){try{var h=l.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var b=y.next;h=b;do{if((h.tag&s)===s){var S=h.inst,O=S.destroy;if(O!==void 0){S.destroy=void 0,y=l;var R=u,G=O;try{G()}catch($){at(y,R,$)}}}h=h.next}while(h!==b)}}catch($){at(l,l.return,$)}}function kC(s){var l=s.updateQueue;if(l!==null){var u=s.stateNode;try{f0(l,u)}catch(h){at(s,s.return,h)}}}function wC(s,l,u){u.props=Gs(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(h){at(s,l,h)}}function wl(s,l){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var h=s.stateNode;break;case 30:h=s.stateNode;break;default:h=s.stateNode}typeof u=="function"?s.refCleanup=u(h):u.current=h}}catch(y){at(s,l,y)}}function Mi(s,l){var u=s.ref,h=s.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){at(s,l,y)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){at(s,l,y)}else u.current=null}function AC(s){var l=s.type,u=s.memoizedProps,h=s.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(y){at(s,s.return,y)}}function lm(s,l,u){try{var h=s.stateNode;eR(h,s.type,u,l),h[kn]=l}catch(y){at(s,s.return,y)}}function OC(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ns(s.type)||s.tag===4}function cm(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||OC(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ns(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function um(s,l,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(s),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=no));else if(h!==4&&(h===27&&ns(s.type)&&(u=s.stateNode,l=null),s=s.child,s!==null))for(um(s,l,u),s=s.sibling;s!==null;)um(s,l,u),s=s.sibling}function Wu(s,l,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,l?u.insertBefore(s,l):u.appendChild(s);else if(h!==4&&(h===27&&ns(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(Wu(s,l,u),s=s.sibling;s!==null;)Wu(s,l,u),s=s.sibling}function PC(s){var l=s.stateNode,u=s.memoizedProps;try{for(var h=s.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);nn(l,h,u),l[Jt]=s,l[kn]=u}catch(b){at(s,s.return,b)}}var fo=!1,Ut=!1,dm=!1,TC=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function RL(s,l){if(s=s.containerInfo,Lm=pd,s=Uv(s),op(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var y=h.anchorOffset,b=h.focusNode;h=h.focusOffset;try{u.nodeType,b.nodeType}catch{u=null;break e}var S=0,O=-1,R=-1,G=0,$=0,ne=s,W=null;t:for(;;){for(var Q;ne!==u||y!==0&&ne.nodeType!==3||(O=S+y),ne!==b||h!==0&&ne.nodeType!==3||(R=S+h),ne.nodeType===3&&(S+=ne.nodeValue.length),(Q=ne.firstChild)!==null;)W=ne,ne=Q;for(;;){if(ne===s)break t;if(W===u&&++G===y&&(O=S),W===b&&++$===h&&(R=S),(Q=ne.nextSibling)!==null)break;ne=W,W=ne.parentNode}ne=Q}u=O===-1||R===-1?null:{start:O,end:R}}else u=null}u=u||{start:0,end:0}}else u=null;for(Rm={focusedElem:s,selectionRange:u},pd=!1,Wt=l;Wt!==null;)if(l=Wt,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,Wt=s;else for(;Wt!==null;){switch(l=Wt,b=l.alternate,s=l.flags,l.tag){case 0:if((s&4)!==0&&(s=l.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u<s.length;u++)y=s[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&b!==null){s=void 0,u=l,y=b.memoizedProps,b=b.memoizedState,h=u.stateNode;try{var ve=Gs(u.type,y);s=h.getSnapshotBeforeUpdate(ve,b),h.__reactInternalSnapshotBeforeUpdate=s}catch(Pe){at(u,u.return,Pe)}}break;case 3:if((s&1024)!==0){if(s=l.stateNode.containerInfo,u=s.nodeType,u===9)Im(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Im(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(i(163))}if(s=l.sibling,s!==null){s.return=l.return,Wt=s;break}Wt=l.return}}function DC(s,l,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:mo(s,u),h&4&&kl(5,u);break;case 1:if(mo(s,u),h&4)if(s=u.stateNode,l===null)try{s.componentDidMount()}catch(S){at(u,u.return,S)}else{var y=Gs(u.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(y,l,s.__reactInternalSnapshotBeforeUpdate)}catch(S){at(u,u.return,S)}}h&64&&kC(u),h&512&&wl(u,u.return);break;case 3:if(mo(s,u),h&64&&(s=u.updateQueue,s!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{f0(s,l)}catch(S){at(u,u.return,S)}}break;case 27:l===null&&h&4&&PC(u);case 26:case 5:mo(s,u),l===null&&h&4&&AC(u),h&512&&wl(u,u.return);break;case 12:mo(s,u);break;case 31:mo(s,u),h&4&&LC(s,u);break;case 13:mo(s,u),h&4&&RC(s,u),h&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=FL.bind(null,u),lR(s,u))));break;case 22:if(h=u.memoizedState!==null||fo,!h){l=l!==null&&l.memoizedState!==null||Ut,y=fo;var b=Ut;fo=h,(Ut=l)&&!b?go(s,u,(u.subtreeFlags&8772)!==0):mo(s,u),fo=y,Ut=b}break;case 30:break;default:mo(s,u)}}function MC(s){var l=s.alternate;l!==null&&(s.alternate=null,MC(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&zf(l)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var St=null,An=!1;function po(s,l,u){for(u=u.child;u!==null;)NC(s,l,u),u=u.sibling}function NC(s,l,u){if(pn&&typeof pn.onCommitFiberUnmount=="function")try{pn.onCommitFiberUnmount(Ps,u)}catch{}switch(u.tag){case 26:Ut||Mi(u,l),po(s,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Ut||Mi(u,l);var h=St,y=An;ns(u.type)&&(St=u.stateNode,An=!1),po(s,l,u),Rl(u.stateNode),St=h,An=y;break;case 5:Ut||Mi(u,l);case 6:if(h=St,y=An,St=null,po(s,l,u),St=h,An=y,St!==null)if(An)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(u.stateNode)}catch(b){at(u,l,b)}else try{St.removeChild(u.stateNode)}catch(b){at(u,l,b)}break;case 18:St!==null&&(An?(s=St,kS(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),cr(s)):kS(St,u.stateNode));break;case 4:h=St,y=An,St=u.stateNode.containerInfo,An=!0,po(s,l,u),St=h,An=y;break;case 0:case 11:case 14:case 15:Yo(2,u,l),Ut||Yo(4,u,l),po(s,l,u);break;case 1:Ut||(Mi(u,l),h=u.stateNode,typeof h.componentWillUnmount=="function"&&wC(u,l,h)),po(s,l,u);break;case 21:po(s,l,u);break;case 22:Ut=(h=Ut)||u.memoizedState!==null,po(s,l,u),Ut=h;break;default:po(s,l,u)}}function LC(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{cr(s)}catch(u){at(l,l.return,u)}}}function RC(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{cr(s)}catch(u){at(l,l.return,u)}}function EL(s){switch(s.tag){case 31:case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new TC),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new TC),l;default:throw Error(i(435,s.tag))}}function Qu(s,l){var u=EL(s);l.forEach(function(h){if(!u.has(h)){u.add(h);var y=qL.bind(null,s,h);h.then(y,y)}})}function On(s,l){var u=l.deletions;if(u!==null)for(var h=0;h<u.length;h++){var y=u[h],b=s,S=l,O=S;e:for(;O!==null;){switch(O.tag){case 27:if(ns(O.type)){St=O.stateNode,An=!1;break e}break;case 5:St=O.stateNode,An=!1;break e;case 3:case 4:St=O.stateNode.containerInfo,An=!0;break e}O=O.return}if(St===null)throw Error(i(160));NC(b,S,y),St=null,An=!1,b=y.alternate,b!==null&&(b.return=null),y.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)EC(l,s),l=l.sibling}var yi=null;function EC(s,l){var u=s.alternate,h=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:On(l,s),Pn(s),h&4&&(Yo(3,s,s.return),kl(3,s),Yo(5,s,s.return));break;case 1:On(l,s),Pn(s),h&512&&(Ut||u===null||Mi(u,u.return)),h&64&&fo&&(s=s.updateQueue,s!==null&&(h=s.callbacks,h!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var y=yi;if(On(l,s),Pn(s),h&512&&(Ut||u===null||Mi(u,u.return)),h&4){var b=u!==null?u.memoizedState:null;if(h=s.memoizedState,u===null)if(h===null)if(s.stateNode===null){e:{h=s.type,u=s.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":b=y.getElementsByTagName("title")[0],(!b||b[Xr]||b[Jt]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=y.createElement(h),y.head.insertBefore(b,y.querySelector("head > title"))),nn(b,h,u),b[Jt]=s,Vt(b),h=b;break e;case"link":var S=ES("link","href",y).get(h+(u.href||""));if(S){for(var O=0;O<S.length;O++)if(b=S[O],b.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&b.getAttribute("rel")===(u.rel==null?null:u.rel)&&b.getAttribute("title")===(u.title==null?null:u.title)&&b.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){S.splice(O,1);break t}}b=y.createElement(h),nn(b,h,u),y.head.appendChild(b);break;case"meta":if(S=ES("meta","content",y).get(h+(u.content||""))){for(O=0;O<S.length;O++)if(b=S[O],b.getAttribute("content")===(u.content==null?null:""+u.content)&&b.getAttribute("name")===(u.name==null?null:u.name)&&b.getAttribute("property")===(u.property==null?null:u.property)&&b.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&b.getAttribute("charset")===(u.charSet==null?null:u.charSet)){S.splice(O,1);break t}}b=y.createElement(h),nn(b,h,u),y.head.appendChild(b);break;default:throw Error(i(468,h))}b[Jt]=s,Vt(b),h=b}s.stateNode=h}else jS(y,s.type,s.stateNode);else s.stateNode=RS(y,h,s.memoizedProps);else b!==h?(b===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):b.count--,h===null?jS(y,s.type,s.stateNode):RS(y,h,s.memoizedProps)):h===null&&s.stateNode!==null&&lm(s,s.memoizedProps,u.memoizedProps)}break;case 27:On(l,s),Pn(s),h&512&&(Ut||u===null||Mi(u,u.return)),u!==null&&h&4&&lm(s,s.memoizedProps,u.memoizedProps);break;case 5:if(On(l,s),Pn(s),h&512&&(Ut||u===null||Mi(u,u.return)),s.flags&32){y=s.stateNode;try{La(y,"")}catch(ve){at(s,s.return,ve)}}h&4&&s.stateNode!=null&&(y=s.memoizedProps,lm(s,y,u!==null?u.memoizedProps:y)),h&1024&&(dm=!0);break;case 6:if(On(l,s),Pn(s),h&4){if(s.stateNode===null)throw Error(i(162));h=s.memoizedProps,u=s.stateNode;try{u.nodeValue=h}catch(ve){at(s,s.return,ve)}}break;case 3:if(ud=null,y=yi,yi=ld(l.containerInfo),On(l,s),yi=y,Pn(s),h&4&&u!==null&&u.memoizedState.isDehydrated)try{cr(l.containerInfo)}catch(ve){at(s,s.return,ve)}dm&&(dm=!1,jC(s));break;case 4:h=yi,yi=ld(s.stateNode.containerInfo),On(l,s),Pn(s),yi=h;break;case 12:On(l,s),Pn(s);break;case 31:On(l,s),Pn(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Qu(s,h)));break;case 13:On(l,s),Pn(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&($u=Xt()),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Qu(s,h)));break;case 22:y=s.memoizedState!==null;var R=u!==null&&u.memoizedState!==null,G=fo,$=Ut;if(fo=G||y,Ut=$||R,On(l,s),Ut=$,fo=G,Pn(s),h&8192)e:for(l=s.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(u===null||R||fo||Ut||Ks(s)),u=null,l=s;;){if(l.tag===5||l.tag===26){if(u===null){R=u=l;try{if(b=R.stateNode,y)S=b.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{O=R.stateNode;var ne=R.memoizedProps.style,W=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;O.style.display=W==null||typeof W=="boolean"?"":(""+W).trim()}}catch(ve){at(R,R.return,ve)}}}else if(l.tag===6){if(u===null){R=l;try{R.stateNode.nodeValue=y?"":R.memoizedProps}catch(ve){at(R,R.return,ve)}}}else if(l.tag===18){if(u===null){R=l;try{var Q=R.stateNode;y?wS(Q,!0):wS(R.stateNode,!1)}catch(ve){at(R,R.return,ve)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===s)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=s.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Qu(s,u))));break;case 19:On(l,s),Pn(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Qu(s,h)));break;case 30:break;case 21:break;default:On(l,s),Pn(s)}}function Pn(s){var l=s.flags;if(l&2){try{for(var u,h=s.return;h!==null;){if(OC(h)){u=h;break}h=h.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var y=u.stateNode,b=cm(s);Wu(s,b,y);break;case 5:var S=u.stateNode;u.flags&32&&(La(S,""),u.flags&=-33);var O=cm(s);Wu(s,O,S);break;case 3:case 4:var R=u.stateNode.containerInfo,G=cm(s);um(s,G,R);break;default:throw Error(i(161))}}catch($){at(s,s.return,$)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function jC(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;jC(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),s=s.sibling}}function mo(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)DC(s,l.alternate,l),l=l.sibling}function Ks(s){for(s=s.child;s!==null;){var l=s;switch(l.tag){case 0:case 11:case 14:case 15:Yo(4,l,l.return),Ks(l);break;case 1:Mi(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&wC(l,l.return,u),Ks(l);break;case 27:Rl(l.stateNode);case 26:case 5:Mi(l,l.return),Ks(l);break;case 22:l.memoizedState===null&&Ks(l);break;case 30:Ks(l);break;default:Ks(l)}s=s.sibling}}function go(s,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,y=s,b=l,S=b.flags;switch(b.tag){case 0:case 11:case 15:go(y,b,u),kl(4,b);break;case 1:if(go(y,b,u),h=b,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(G){at(h,h.return,G)}if(h=b,y=h.updateQueue,y!==null){var O=h.stateNode;try{var R=y.shared.hiddenCallbacks;if(R!==null)for(y.shared.hiddenCallbacks=null,y=0;y<R.length;y++)h0(R[y],O)}catch(G){at(h,h.return,G)}}u&&S&64&&kC(b),wl(b,b.return);break;case 27:PC(b);case 26:case 5:go(y,b,u),u&&h===null&&S&4&&AC(b),wl(b,b.return);break;case 12:go(y,b,u);break;case 31:go(y,b,u),u&&S&4&&LC(y,b);break;case 13:go(y,b,u),u&&S&4&&RC(y,b);break;case 22:b.memoizedState===null&&go(y,b,u),wl(b,b.return);break;case 30:break;default:go(y,b,u)}l=l.sibling}}function hm(s,l){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&ul(u))}function fm(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&ul(s))}function bi(s,l,u,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)IC(s,l,u,h),l=l.sibling}function IC(s,l,u,h){var y=l.flags;switch(l.tag){case 0:case 11:case 15:bi(s,l,u,h),y&2048&&kl(9,l);break;case 1:bi(s,l,u,h);break;case 3:bi(s,l,u,h),y&2048&&(s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&ul(s)));break;case 12:if(y&2048){bi(s,l,u,h),s=l.stateNode;try{var b=l.memoizedProps,S=b.id,O=b.onPostCommit;typeof O=="function"&&O(S,l.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(R){at(l,l.return,R)}}else bi(s,l,u,h);break;case 31:bi(s,l,u,h);break;case 13:bi(s,l,u,h);break;case 23:break;case 22:b=l.stateNode,S=l.alternate,l.memoizedState!==null?b._visibility&2?bi(s,l,u,h):Al(s,l):b._visibility&2?bi(s,l,u,h):(b._visibility|=2,Ja(s,l,u,h,(l.subtreeFlags&10256)!==0||!1)),y&2048&&hm(S,l);break;case 24:bi(s,l,u,h),y&2048&&fm(l.alternate,l);break;default:bi(s,l,u,h)}}function Ja(s,l,u,h,y){for(y=y&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var b=s,S=l,O=u,R=h,G=S.flags;switch(S.tag){case 0:case 11:case 15:Ja(b,S,O,R,y),kl(8,S);break;case 23:break;case 22:var $=S.stateNode;S.memoizedState!==null?$._visibility&2?Ja(b,S,O,R,y):Al(b,S):($._visibility|=2,Ja(b,S,O,R,y)),y&&G&2048&&hm(S.alternate,S);break;case 24:Ja(b,S,O,R,y),y&&G&2048&&fm(S.alternate,S);break;default:Ja(b,S,O,R,y)}l=l.sibling}}function Al(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=s,h=l,y=h.flags;switch(h.tag){case 22:Al(u,h),y&2048&&hm(h.alternate,h);break;case 24:Al(u,h),y&2048&&fm(h.alternate,h);break;default:Al(u,h)}l=l.sibling}}var Ol=8192;function Za(s,l,u){if(s.subtreeFlags&Ol)for(s=s.child;s!==null;)BC(s,l,u),s=s.sibling}function BC(s,l,u){switch(s.tag){case 26:Za(s,l,u),s.flags&Ol&&s.memoizedState!==null&&vR(u,yi,s.memoizedState,s.memoizedProps);break;case 5:Za(s,l,u);break;case 3:case 4:var h=yi;yi=ld(s.stateNode.containerInfo),Za(s,l,u),yi=h;break;case 22:s.memoizedState===null&&(h=s.alternate,h!==null&&h.memoizedState!==null?(h=Ol,Ol=16777216,Za(s,l,u),Ol=h):Za(s,l,u));break;default:Za(s,l,u)}}function _C(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function Pl(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Wt=h,UC(h,s)}_C(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)HC(s),s=s.sibling}function HC(s){switch(s.tag){case 0:case 11:case 15:Pl(s),s.flags&2048&&Yo(9,s,s.return);break;case 3:Pl(s);break;case 12:Pl(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,Yu(s)):Pl(s);break;default:Pl(s)}}function Yu(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Wt=h,UC(h,s)}_C(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:Yo(8,l,l.return),Yu(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,Yu(l));break;default:Yu(l)}s=s.sibling}}function UC(s,l){for(;Wt!==null;){var u=Wt;switch(u.tag){case 0:case 11:case 15:Yo(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:ul(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,Wt=h;else e:for(u=s;Wt!==null;){h=Wt;var y=h.sibling,b=h.return;if(MC(h),h===u){Wt=null;break e}if(y!==null){y.return=b,Wt=y;break e}Wt=b}}}var jL={getCacheForType:function(s){var l=en(Bt),u=l.data.get(s);return u===void 0&&(u=s(),l.data.set(s,u)),u},cacheSignal:function(){return en(Bt).controller.signal}},IL=typeof WeakMap=="function"?WeakMap:Map,ot=0,pt=null,ze=null,Ge=0,st=0,zn=null,$o=!1,er=!1,pm=!1,yo=0,Tt=0,Xo=0,Vs=0,mm=0,Fn=0,tr=0,Tl=null,Tn=null,gm=!1,$u=0,zC=0,Xu=1/0,Ju=null,Jo=null,Ft=0,Zo=null,nr=null,bo=0,ym=0,bm=null,FC=null,Dl=0,xm=null;function qn(){return(ot&2)!==0&&Ge!==0?Ge&-Ge:B.T!==null?Am():ov()}function qC(){if(Fn===0)if((Ge&536870912)===0||We){var s=Me;Me<<=1,(Me&3932160)===0&&(Me=262144),Fn=s}else Fn=536870912;return s=Hn.current,s!==null&&(s.flags|=32),Fn}function Dn(s,l,u){(s===pt&&(st===2||st===9)||s.cancelPendingCommit!==null)&&(ir(s,0),es(s,Ge,Fn,!1)),eo(s,u),((ot&2)===0||s!==pt)&&(s===pt&&((ot&2)===0&&(Vs|=u),Tt===4&&es(s,Ge,Fn,!1)),Ni(s))}function GC(s,l,u){if((ot&6)!==0)throw Error(i(327));var h=!u&&(l&127)===0&&(l&s.expiredLanes)===0||Ts(s,l),y=h?HL(s,l):Cm(s,l,!0),b=h;do{if(y===0){er&&!h&&es(s,l,0,!1);break}else{if(u=s.current.alternate,b&&!BL(u)){y=Cm(s,l,!1),b=!1;continue}if(y===2){if(b=l,s.errorRecoveryDisabledLanes&b)var S=0;else S=s.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){l=S;e:{var O=s;y=Tl;var R=O.current.memoizedState.isDehydrated;if(R&&(ir(O,S).flags|=256),S=Cm(O,S,!1),S!==2){if(pm&&!R){O.errorRecoveryDisabledLanes|=b,Vs|=b,y=4;break e}b=Tn,Tn=y,b!==null&&(Tn===null?Tn=b:Tn.push.apply(Tn,b))}y=S}if(b=!1,y!==2)continue}}if(y===1){ir(s,0),es(s,l,0,!0);break}e:{switch(h=s,b=y,b){case 0:case 1:throw Error(i(345));case 4:if((l&4194048)!==l)break;case 6:es(h,l,Fn,!$o);break e;case 2:Tn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((l&62914560)===l&&(y=$u+300-Xt(),10<y)){if(es(h,l,Fn,!$o),_e(h,0,!0)!==0)break e;bo=l,h.timeoutHandle=CS(KC.bind(null,h,u,Tn,Ju,gm,l,Fn,Vs,tr,$o,b,"Throttled",-0,0),y);break e}KC(h,u,Tn,Ju,gm,l,Fn,Vs,tr,$o,b,null,-0,0)}}break}while(!0);Ni(s)}function KC(s,l,u,h,y,b,S,O,R,G,$,ne,W,Q){if(s.timeoutHandle=-1,ne=l.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:no},BC(l,b,ne);var ve=(b&62914560)===b?$u-Xt():(b&4194048)===b?zC-Xt():0;if(ve=CR(ne,ve),ve!==null){bo=b,s.cancelPendingCommit=ve(ZC.bind(null,s,l,b,u,h,y,S,O,R,$,ne,null,W,Q)),es(s,b,S,!G);return}}ZC(s,l,b,u,h,y,S,O,R)}function BL(s){for(var l=s;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var y=u[h],b=y.getSnapshot;y=y.value;try{if(!Bn(b(),y))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function es(s,l,u,h){l&=~mm,l&=~Vs,s.suspendedLanes|=l,s.pingedLanes&=~l,h&&(s.warmLanes|=l),h=s.expirationTimes;for(var y=l;0<y;){var b=31-mn(y),S=1<<b;h[b]=-1,y&=~S}u!==0&&tv(s,u,l)}function Zu(){return(ot&6)===0?(Ml(0),!1):!0}function vm(){if(ze!==null){if(st===0)var s=ze.return;else s=ze,ao=Bs=null,Ip(s),Wa=null,hl=0,s=ze;for(;s!==null;)SC(s.alternate,s),s=s.return;ze=null}}function ir(s,l){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,iR(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),bo=0,vm(),pt=s,ze=u=oo(s.current,null),Ge=l,st=0,zn=null,$o=!1,er=Ts(s,l),pm=!1,tr=Fn=mm=Vs=Xo=Tt=0,Tn=Tl=null,gm=!1,(l&8)!==0&&(l|=l&32);var h=s.entangledLanes;if(h!==0)for(s=s.entanglements,h&=l;0<h;){var y=31-mn(h),b=1<<y;l|=s[y],h&=~b}return yo=l,vu(),u}function VC(s,l){Ee=null,B.H=vl,l===Va||l===Tu?(l=l0(),st=3):l===wp?(l=l0(),st=4):st=l===Jp?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,zn=l,ze===null&&(Tt=1,Fu(s,ei(l,s.current)))}function WC(){var s=Hn.current;return s===null?!0:(Ge&4194048)===Ge?oi===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?s===oi:!1}function QC(){var s=B.H;return B.H=vl,s===null?vl:s}function YC(){var s=B.A;return B.A=jL,s}function ed(){Tt=4,$o||(Ge&4194048)!==Ge&&Hn.current!==null||(er=!0),(Xo&134217727)===0&&(Vs&134217727)===0||pt===null||es(pt,Ge,Fn,!1)}function Cm(s,l,u){var h=ot;ot|=2;var y=QC(),b=YC();(pt!==s||Ge!==l)&&(Ju=null,ir(s,l)),l=!1;var S=Tt;e:do try{if(st!==0&&ze!==null){var O=ze,R=zn;switch(st){case 8:vm(),S=6;break e;case 3:case 2:case 9:case 6:Hn.current===null&&(l=!0);var G=st;if(st=0,zn=null,or(s,O,R,G),u&&er){S=0;break e}break;default:G=st,st=0,zn=null,or(s,O,R,G)}}_L(),S=Tt;break}catch($){VC(s,$)}while(!0);return l&&s.shellSuspendCounter++,ao=Bs=null,ot=h,B.H=y,B.A=b,ze===null&&(pt=null,Ge=0,vu()),S}function _L(){for(;ze!==null;)$C(ze)}function HL(s,l){var u=ot;ot|=2;var h=QC(),y=YC();pt!==s||Ge!==l?(Ju=null,Xu=Xt()+500,ir(s,l)):er=Ts(s,l);e:do try{if(st!==0&&ze!==null){l=ze;var b=zn;t:switch(st){case 1:st=0,zn=null,or(s,l,b,1);break;case 2:case 9:if(a0(b)){st=0,zn=null,XC(l);break}l=function(){st!==2&&st!==9||pt!==s||(st=7),Ni(s)},b.then(l,l);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:a0(b)?(st=0,zn=null,XC(l)):(st=0,zn=null,or(s,l,b,7));break;case 5:var S=null;switch(ze.tag){case 26:S=ze.memoizedState;case 5:case 27:var O=ze;if(S?IS(S):O.stateNode.complete){st=0,zn=null;var R=O.sibling;if(R!==null)ze=R;else{var G=O.return;G!==null?(ze=G,td(G)):ze=null}break t}}st=0,zn=null,or(s,l,b,5);break;case 6:st=0,zn=null,or(s,l,b,6);break;case 8:vm(),Tt=6;break e;default:throw Error(i(462))}}UL();break}catch($){VC(s,$)}while(!0);return ao=Bs=null,B.H=h,B.A=y,ot=u,ze!==null?0:(pt=null,Ge=0,vu(),Tt)}function UL(){for(;ze!==null&&!ka();)$C(ze)}function $C(s){var l=vC(s.alternate,s,yo);s.memoizedProps=s.pendingProps,l===null?td(s):ze=l}function XC(s){var l=s,u=l.alternate;switch(l.tag){case 15:case 0:l=pC(u,l,l.pendingProps,l.type,void 0,Ge);break;case 11:l=pC(u,l,l.pendingProps,l.type.render,l.ref,Ge);break;case 5:Ip(l);default:SC(u,l),l=ze=Yv(l,yo),l=vC(u,l,yo)}s.memoizedProps=s.pendingProps,l===null?td(s):ze=l}function or(s,l,u,h){ao=Bs=null,Ip(l),Wa=null,hl=0;var y=l.return;try{if(TL(s,y,l,u,Ge)){Tt=1,Fu(s,ei(u,s.current)),ze=null;return}}catch(b){if(y!==null)throw ze=y,b;Tt=1,Fu(s,ei(u,s.current)),ze=null;return}l.flags&32768?(We||h===1?s=!0:er||(Ge&536870912)!==0?s=!1:($o=s=!0,(h===2||h===9||h===3||h===6)&&(h=Hn.current,h!==null&&h.tag===13&&(h.flags|=16384))),JC(l,s)):td(l)}function td(s){var l=s;do{if((l.flags&32768)!==0){JC(l,$o);return}s=l.return;var u=NL(l.alternate,l,yo);if(u!==null){ze=u;return}if(l=l.sibling,l!==null){ze=l;return}ze=l=s}while(l!==null);Tt===0&&(Tt=5)}function JC(s,l){do{var u=LL(s.alternate,s);if(u!==null){u.flags&=32767,ze=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(s=s.sibling,s!==null)){ze=s;return}ze=s=u}while(s!==null);Tt=6,ze=null}function ZC(s,l,u,h,y,b,S,O,R){s.cancelPendingCommit=null;do nd();while(Ft!==0);if((ot&6)!==0)throw Error(i(327));if(l!==null){if(l===s.current)throw Error(i(177));if(b=l.lanes|l.childLanes,b|=cp,xN(s,u,b,S,O,R),s===pt&&(ze=pt=null,Ge=0),nr=l,Zo=s,bo=u,ym=b,bm=y,FC=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,GL(Aa,function(){return oS(),null})):(s.callbackNode=null,s.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=B.T,B.T=null,y=Z.p,Z.p=2,S=ot,ot|=4;try{RL(s,l,u)}finally{ot=S,Z.p=y,B.T=h}}Ft=1,eS(),tS(),nS()}}function eS(){if(Ft===1){Ft=0;var s=Zo,l=nr,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=B.T,B.T=null;var h=Z.p;Z.p=2;var y=ot;ot|=4;try{EC(l,s);var b=Rm,S=Uv(s.containerInfo),O=b.focusedElem,R=b.selectionRange;if(S!==O&&O&&O.ownerDocument&&Hv(O.ownerDocument.documentElement,O)){if(R!==null&&op(O)){var G=R.start,$=R.end;if($===void 0&&($=G),"selectionStart"in O)O.selectionStart=G,O.selectionEnd=Math.min($,O.value.length);else{var ne=O.ownerDocument||document,W=ne&&ne.defaultView||window;if(W.getSelection){var Q=W.getSelection(),ve=O.textContent.length,Pe=Math.min(R.start,ve),ut=R.end===void 0?Pe:Math.min(R.end,ve);!Q.extend&&Pe>ut&&(S=ut,ut=Pe,Pe=S);var _=_v(O,Pe),I=_v(O,ut);if(_&&I&&(Q.rangeCount!==1||Q.anchorNode!==_.node||Q.anchorOffset!==_.offset||Q.focusNode!==I.node||Q.focusOffset!==I.offset)){var F=ne.createRange();F.setStart(_.node,_.offset),Q.removeAllRanges(),Pe>ut?(Q.addRange(F),Q.extend(I.node,I.offset)):(F.setEnd(I.node,I.offset),Q.addRange(F))}}}}for(ne=[],Q=O;Q=Q.parentNode;)Q.nodeType===1&&ne.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<ne.length;O++){var ee=ne[O];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}pd=!!Lm,Rm=Lm=null}finally{ot=y,Z.p=h,B.T=u}}s.current=l,Ft=2}}function tS(){if(Ft===2){Ft=0;var s=Zo,l=nr,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=B.T,B.T=null;var h=Z.p;Z.p=2;var y=ot;ot|=4;try{DC(s,l.alternate,l)}finally{ot=y,Z.p=h,B.T=u}}Ft=3}}function nS(){if(Ft===4||Ft===3){Ft=0,wa();var s=Zo,l=nr,u=bo,h=FC;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Ft=5:(Ft=0,nr=Zo=null,iS(s,s.pendingLanes));var y=s.pendingLanes;if(y===0&&(Jo=null),Hf(u),l=l.stateNode,pn&&typeof pn.onCommitFiberRoot=="function")try{pn.onCommitFiberRoot(Ps,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=B.T,y=Z.p,Z.p=2,B.T=null;try{for(var b=s.onRecoverableError,S=0;S<h.length;S++){var O=h[S];b(O.value,{componentStack:O.stack})}}finally{B.T=l,Z.p=y}}(bo&3)!==0&&nd(),Ni(s),y=s.pendingLanes,(u&261930)!==0&&(y&42)!==0?s===xm?Dl++:(Dl=0,xm=s):Dl=0,Ml(0)}}function iS(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,ul(l)))}function nd(){return eS(),tS(),nS(),oS()}function oS(){if(Ft!==5)return!1;var s=Zo,l=ym;ym=0;var u=Hf(bo),h=B.T,y=Z.p;try{Z.p=32>u?32:u,B.T=null,u=bm,bm=null;var b=Zo,S=bo;if(Ft=0,nr=Zo=null,bo=0,(ot&6)!==0)throw Error(i(331));var O=ot;if(ot|=4,HC(b.current),IC(b,b.current,S,u),ot=O,Ml(0,!1),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot(Ps,b)}catch{}return!0}finally{Z.p=y,B.T=h,iS(s,l)}}function sS(s,l,u){l=ei(u,l),l=Xp(s.stateNode,l,2),s=Vo(s,l,2),s!==null&&(eo(s,2),Ni(s))}function at(s,l,u){if(s.tag===3)sS(s,s,u);else for(;l!==null;){if(l.tag===3){sS(l,s,u);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Jo===null||!Jo.has(h))){s=ei(u,s),u=aC(2),h=Vo(l,u,2),h!==null&&(rC(u,h,l,s),eo(h,2),Ni(h));break}}l=l.return}}function Sm(s,l,u){var h=s.pingCache;if(h===null){h=s.pingCache=new IL;var y=new Set;h.set(l,y)}else y=h.get(l),y===void 0&&(y=new Set,h.set(l,y));y.has(u)||(pm=!0,y.add(u),s=zL.bind(null,s,l,u),l.then(s,s))}function zL(s,l,u){var h=s.pingCache;h!==null&&h.delete(l),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,pt===s&&(Ge&u)===u&&(Tt===4||Tt===3&&(Ge&62914560)===Ge&&300>Xt()-$u?(ot&2)===0&&ir(s,0):mm|=u,tr===Ge&&(tr=0)),Ni(s)}function aS(s,l){l===0&&(l=lu()),s=Es(s,l),s!==null&&(eo(s,l),Ni(s))}function FL(s){var l=s.memoizedState,u=0;l!==null&&(u=l.retryLane),aS(s,u)}function qL(s,l){var u=0;switch(s.tag){case 31:case 13:var h=s.stateNode,y=s.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=s.stateNode;break;case 22:h=s.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(l),aS(s,u)}function GL(s,l){return Os(s,l)}var id=null,sr=null,km=!1,od=!1,wm=!1,ts=0;function Ni(s){s!==sr&&s.next===null&&(sr===null?id=sr=s:sr=sr.next=s),od=!0,km||(km=!0,VL())}function Ml(s,l){if(!wm&&od){wm=!0;do for(var u=!1,h=id;h!==null;){if(s!==0){var y=h.pendingLanes;if(y===0)var b=0;else{var S=h.suspendedLanes,O=h.pingedLanes;b=(1<<31-mn(42|s)+1)-1,b&=y&~(S&~O),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(u=!0,uS(h,b))}else b=Ge,b=_e(h,h===pt?b:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(b&3)===0||Ts(h,b)||(u=!0,uS(h,b));h=h.next}while(u);wm=!1}}function KL(){rS()}function rS(){od=km=!1;var s=0;ts!==0&&nR()&&(s=ts);for(var l=Xt(),u=null,h=id;h!==null;){var y=h.next,b=lS(h,l);b===0?(h.next=null,u===null?id=y:u.next=y,y===null&&(sr=u)):(u=h,(s!==0||(b&3)!==0)&&(od=!0)),h=y}Ft!==0&&Ft!==5||Ml(s),ts!==0&&(ts=0)}function lS(s,l){for(var u=s.suspendedLanes,h=s.pingedLanes,y=s.expirationTimes,b=s.pendingLanes&-62914561;0<b;){var S=31-mn(b),O=1<<S,R=y[S];R===-1?((O&u)===0||(O&h)!==0)&&(y[S]=Bf(O,l)):R<=l&&(s.expiredLanes|=O),b&=~O}if(l=pt,u=Ge,u=_e(s,s===l?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h=s.callbackNode,u===0||s===l&&(st===2||st===9)||s.cancelPendingCommit!==null)return h!==null&&h!==null&&mi(h),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||Ts(s,u)){if(l=u&-u,l===s.callbackPriority)return l;switch(h!==null&&mi(h),Hf(u)){case 2:case 8:u=su;break;case 32:u=Aa;break;case 268435456:u=au;break;default:u=Aa}return h=cS.bind(null,s),u=Os(u,h),s.callbackPriority=l,s.callbackNode=u,l}return h!==null&&h!==null&&mi(h),s.callbackPriority=2,s.callbackNode=null,2}function cS(s,l){if(Ft!==0&&Ft!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(nd()&&s.callbackNode!==u)return null;var h=Ge;return h=_e(s,s===pt?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h===0?null:(GC(s,h,l),lS(s,Xt()),s.callbackNode!=null&&s.callbackNode===u?cS.bind(null,s):null)}function uS(s,l){if(nd())return null;GC(s,l,!0)}function VL(){oR(function(){(ot&6)!==0?Os(ou,KL):rS()})}function Am(){if(ts===0){var s=Ga;s===0&&(s=Ve,Ve<<=1,(Ve&261888)===0&&(Ve=256)),ts=s}return ts}function dS(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:hu(""+s)}function hS(s,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,s.id&&u.setAttribute("form",s.id),l.parentNode.insertBefore(u,l),s=new FormData(s),u.parentNode.removeChild(u),s}function WL(s,l,u,h,y){if(l==="submit"&&u&&u.stateNode===y){var b=dS((y[kn]||null).action),S=h.submitter;S&&(l=(l=S[kn]||null)?dS(l.formAction):S.getAttribute("formAction"),l!==null&&(b=l,S=null));var O=new gu("action","action",null,h,y);s.push({event:O,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(ts!==0){var R=S?hS(y,S):new FormData(y);Kp(u,{pending:!0,data:R,method:y.method,action:b},null,R)}}else typeof b=="function"&&(O.preventDefault(),R=S?hS(y,S):new FormData(y),Kp(u,{pending:!0,data:R,method:y.method,action:b},b,R))},currentTarget:y}]})}}for(var Om=0;Om<lp.length;Om++){var Pm=lp[Om],QL=Pm.toLowerCase(),YL=Pm[0].toUpperCase()+Pm.slice(1);gi(QL,"on"+YL)}gi(qv,"onAnimationEnd"),gi(Gv,"onAnimationIteration"),gi(Kv,"onAnimationStart"),gi("dblclick","onDoubleClick"),gi("focusin","onFocus"),gi("focusout","onBlur"),gi(dL,"onTransitionRun"),gi(hL,"onTransitionStart"),gi(fL,"onTransitionCancel"),gi(Vv,"onTransitionEnd"),Ma("onMouseEnter",["mouseout","mouseover"]),Ma("onMouseLeave",["mouseout","mouseover"]),Ma("onPointerEnter",["pointerout","pointerover"]),Ma("onPointerLeave",["pointerout","pointerover"]),Ms("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ms("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ms("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ms("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ms("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ms("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),$L=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nl));function fS(s,l){l=(l&4)!==0;for(var u=0;u<s.length;u++){var h=s[u],y=h.event;h=h.listeners;e:{var b=void 0;if(l)for(var S=h.length-1;0<=S;S--){var O=h[S],R=O.instance,G=O.currentTarget;if(O=O.listener,R!==b&&y.isPropagationStopped())break e;b=O,y.currentTarget=G;try{b(y)}catch($){xu($)}y.currentTarget=null,b=R}else for(S=0;S<h.length;S++){if(O=h[S],R=O.instance,G=O.currentTarget,O=O.listener,R!==b&&y.isPropagationStopped())break e;b=O,y.currentTarget=G;try{b(y)}catch($){xu($)}y.currentTarget=null,b=R}}}}function Fe(s,l){var u=l[Uf];u===void 0&&(u=l[Uf]=new Set);var h=s+"__bubble";u.has(h)||(pS(l,s,2,!1),u.add(h))}function Tm(s,l,u){var h=0;l&&(h|=4),pS(u,s,h,l)}var sd="_reactListening"+Math.random().toString(36).slice(2);function Dm(s){if(!s[sd]){s[sd]=!0,rv.forEach(function(u){u!=="selectionchange"&&($L.has(u)||Tm(u,!1,s),Tm(u,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[sd]||(l[sd]=!0,Tm("selectionchange",!1,l))}}function pS(s,l,u,h){switch(qS(l)){case 2:var y=wR;break;case 8:y=AR;break;default:y=Gm}u=y.bind(null,l,u,s),y=void 0,!Yf||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),h?y!==void 0?s.addEventListener(l,u,{capture:!0,passive:y}):s.addEventListener(l,u,!0):y!==void 0?s.addEventListener(l,u,{passive:y}):s.addEventListener(l,u,!1)}function Mm(s,l,u,h,y){var b=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var S=h.tag;if(S===3||S===4){var O=h.stateNode.containerInfo;if(O===y)break;if(S===4)for(S=h.return;S!==null;){var R=S.tag;if((R===3||R===4)&&S.stateNode.containerInfo===y)return;S=S.return}for(;O!==null;){if(S=Pa(O),S===null)return;if(R=S.tag,R===5||R===6||R===26||R===27){h=b=S;continue e}O=O.parentNode}}h=h.return}xv(function(){var G=b,$=Wf(u),ne=[];e:{var W=Wv.get(s);if(W!==void 0){var Q=gu,ve=s;switch(s){case"keypress":if(pu(u)===0)break e;case"keydown":case"keyup":Q=qN;break;case"focusin":ve="focus",Q=Zf;break;case"focusout":ve="blur",Q=Zf;break;case"beforeblur":case"afterblur":Q=Zf;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=Sv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=NN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=VN;break;case qv:case Gv:case Kv:Q=EN;break;case Vv:Q=QN;break;case"scroll":case"scrollend":Q=DN;break;case"wheel":Q=$N;break;case"copy":case"cut":case"paste":Q=IN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=wv;break;case"toggle":case"beforetoggle":Q=JN}var Pe=(l&4)!==0,ut=!Pe&&(s==="scroll"||s==="scrollend"),_=Pe?W!==null?W+"Capture":null:W;Pe=[];for(var I=G,F;I!==null;){var ee=I;if(F=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||F===null||_===null||(ee=Zr(I,_),ee!=null&&Pe.push(Ll(I,ee,F))),ut)break;I=I.return}0<Pe.length&&(W=new Q(W,ve,null,u,$),ne.push({event:W,listeners:Pe}))}}if((l&7)===0){e:{if(W=s==="mouseover"||s==="pointerover",Q=s==="mouseout"||s==="pointerout",W&&u!==Vf&&(ve=u.relatedTarget||u.fromElement)&&(Pa(ve)||ve[Oa]))break e;if((Q||W)&&(W=$.window===$?$:(W=$.ownerDocument)?W.defaultView||W.parentWindow:window,Q?(ve=u.relatedTarget||u.toElement,Q=G,ve=ve?Pa(ve):null,ve!==null&&(ut=a(ve),Pe=ve.tag,ve!==ut||Pe!==5&&Pe!==27&&Pe!==6)&&(ve=null)):(Q=null,ve=G),Q!==ve)){if(Pe=Sv,ee="onMouseLeave",_="onMouseEnter",I="mouse",(s==="pointerout"||s==="pointerover")&&(Pe=wv,ee="onPointerLeave",_="onPointerEnter",I="pointer"),ut=Q==null?W:Jr(Q),F=ve==null?W:Jr(ve),W=new Pe(ee,I+"leave",Q,u,$),W.target=ut,W.relatedTarget=F,ee=null,Pa($)===G&&(Pe=new Pe(_,I+"enter",ve,u,$),Pe.target=F,Pe.relatedTarget=ut,ee=Pe),ut=ee,Q&&ve)t:{for(Pe=XL,_=Q,I=ve,F=0,ee=_;ee;ee=Pe(ee))F++;ee=0;for(var Ae=I;Ae;Ae=Pe(Ae))ee++;for(;0<F-ee;)_=Pe(_),F--;for(;0<ee-F;)I=Pe(I),ee--;for(;F--;){if(_===I||I!==null&&_===I.alternate){Pe=_;break t}_=Pe(_),I=Pe(I)}Pe=null}else Pe=null;Q!==null&&mS(ne,W,Q,Pe,!1),ve!==null&&ut!==null&&mS(ne,ut,ve,Pe,!0)}}e:{if(W=G?Jr(G):window,Q=W.nodeName&&W.nodeName.toLowerCase(),Q==="select"||Q==="input"&&W.type==="file")var Ze=Lv;else if(Mv(W))if(Rv)Ze=lL;else{Ze=aL;var ke=sL}else Q=W.nodeName,!Q||Q.toLowerCase()!=="input"||W.type!=="checkbox"&&W.type!=="radio"?G&&Kf(G.elementType)&&(Ze=Lv):Ze=rL;if(Ze&&(Ze=Ze(s,G))){Nv(ne,Ze,u,$);break e}ke&&ke(s,W,G),s==="focusout"&&G&&W.type==="number"&&G.memoizedProps.value!=null&&Gf(W,"number",W.value)}switch(ke=G?Jr(G):window,s){case"focusin":(Mv(ke)||ke.contentEditable==="true")&&(Ia=ke,sp=G,rl=null);break;case"focusout":rl=sp=Ia=null;break;case"mousedown":ap=!0;break;case"contextmenu":case"mouseup":case"dragend":ap=!1,zv(ne,u,$);break;case"selectionchange":if(uL)break;case"keydown":case"keyup":zv(ne,u,$)}var je;if(tp)e:{switch(s){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else ja?Tv(s,u)&&(Ke="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(Ke="onCompositionStart");Ke&&(Av&&u.locale!=="ko"&&(ja||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&ja&&(je=vv()):(Ho=$,$f="value"in Ho?Ho.value:Ho.textContent,ja=!0)),ke=ad(G,Ke),0<ke.length&&(Ke=new kv(Ke,s,null,u,$),ne.push({event:Ke,listeners:ke}),je?Ke.data=je:(je=Dv(u),je!==null&&(Ke.data=je)))),(je=eL?tL(s,u):nL(s,u))&&(Ke=ad(G,"onBeforeInput"),0<Ke.length&&(ke=new kv("onBeforeInput","beforeinput",null,u,$),ne.push({event:ke,listeners:Ke}),ke.data=je)),WL(ne,s,G,u,$)}fS(ne,l)})}function Ll(s,l,u){return{instance:s,listener:l,currentTarget:u}}function ad(s,l){for(var u=l+"Capture",h=[];s!==null;){var y=s,b=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||b===null||(y=Zr(s,u),y!=null&&h.unshift(Ll(s,y,b)),y=Zr(s,l),y!=null&&h.push(Ll(s,y,b))),s.tag===3)return h;s=s.return}return[]}function XL(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function mS(s,l,u,h,y){for(var b=l._reactName,S=[];u!==null&&u!==h;){var O=u,R=O.alternate,G=O.stateNode;if(O=O.tag,R!==null&&R===h)break;O!==5&&O!==26&&O!==27||G===null||(R=G,y?(G=Zr(u,b),G!=null&&S.unshift(Ll(u,G,R))):y||(G=Zr(u,b),G!=null&&S.push(Ll(u,G,R)))),u=u.return}S.length!==0&&s.push({event:l,listeners:S})}var JL=/\r\n?/g,ZL=/\u0000|\uFFFD/g;function gS(s){return(typeof s=="string"?s:""+s).replace(JL,`
10
+ `).replace(ZL,"")}function yS(s,l){return l=gS(l),gS(s)===l}function ct(s,l,u,h,y,b){switch(u){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||La(s,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&La(s,""+h);break;case"className":uu(s,"class",h);break;case"tabIndex":uu(s,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":uu(s,u,h);break;case"style":yv(s,h,b);break;case"data":if(l!=="object"){uu(s,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||u!=="href")){s.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=hu(""+h),s.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){s.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(u==="formAction"?(l!=="input"&&ct(s,l,"name",y.name,y,null),ct(s,l,"formEncType",y.formEncType,y,null),ct(s,l,"formMethod",y.formMethod,y,null),ct(s,l,"formTarget",y.formTarget,y,null)):(ct(s,l,"encType",y.encType,y,null),ct(s,l,"method",y.method,y,null),ct(s,l,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=hu(""+h),s.setAttribute(u,h);break;case"onClick":h!=null&&(s.onclick=no);break;case"onScroll":h!=null&&Fe("scroll",s);break;case"onScrollEnd":h!=null&&Fe("scrollend",s);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(i(60));s.innerHTML=u}}break;case"multiple":s.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":s.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){s.removeAttribute("xlink:href");break}u=hu(""+h),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""+h):s.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":h===!0?s.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,h):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?s.setAttribute(u,h):s.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?s.removeAttribute(u):s.setAttribute(u,h);break;case"popover":Fe("beforetoggle",s),Fe("toggle",s),cu(s,"popover",h);break;case"xlinkActuate":to(s,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":to(s,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":to(s,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":to(s,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":to(s,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":to(s,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":to(s,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":to(s,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":to(s,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":cu(s,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=PN.get(u)||u,cu(s,u,h))}}function Nm(s,l,u,h,y,b){switch(u){case"style":yv(s,h,b);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(i(60));s.innerHTML=u}}break;case"children":typeof h=="string"?La(s,h):(typeof h=="number"||typeof h=="bigint")&&La(s,""+h);break;case"onScroll":h!=null&&Fe("scroll",s);break;case"onScrollEnd":h!=null&&Fe("scrollend",s);break;case"onClick":h!=null&&(s.onclick=no);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lv.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),l=u.slice(2,y?u.length-7:void 0),b=s[kn]||null,b=b!=null?b[u]:null,typeof b=="function"&&s.removeEventListener(l,b,y),typeof h=="function")){typeof b!="function"&&b!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(l,h,y);break e}u in s?s[u]=h:h===!0?s.setAttribute(u,""):cu(s,u,h)}}}function nn(s,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",s),Fe("load",s);var h=!1,y=!1,b;for(b in u)if(u.hasOwnProperty(b)){var S=u[b];if(S!=null)switch(b){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:ct(s,l,b,S,u,null)}}y&&ct(s,l,"srcSet",u.srcSet,u,null),h&&ct(s,l,"src",u.src,u,null);return;case"input":Fe("invalid",s);var O=b=S=y=null,R=null,G=null;for(h in u)if(u.hasOwnProperty(h)){var $=u[h];if($!=null)switch(h){case"name":y=$;break;case"type":S=$;break;case"checked":R=$;break;case"defaultChecked":G=$;break;case"value":b=$;break;case"defaultValue":O=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(i(137,l));break;default:ct(s,l,h,$,u,null)}}fv(s,b,O,R,G,S,y,!1);return;case"select":Fe("invalid",s),h=S=b=null;for(y in u)if(u.hasOwnProperty(y)&&(O=u[y],O!=null))switch(y){case"value":b=O;break;case"defaultValue":S=O;break;case"multiple":h=O;default:ct(s,l,y,O,u,null)}l=b,u=S,s.multiple=!!h,l!=null?Na(s,!!h,l,!1):u!=null&&Na(s,!!h,u,!0);return;case"textarea":Fe("invalid",s),b=y=h=null;for(S in u)if(u.hasOwnProperty(S)&&(O=u[S],O!=null))switch(S){case"value":h=O;break;case"defaultValue":y=O;break;case"children":b=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(i(91));break;default:ct(s,l,S,O,u,null)}mv(s,h,y,b);return;case"option":for(R in u)if(u.hasOwnProperty(R)&&(h=u[R],h!=null))switch(R){case"selected":s.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:ct(s,l,R,h,u,null)}return;case"dialog":Fe("beforetoggle",s),Fe("toggle",s),Fe("cancel",s),Fe("close",s);break;case"iframe":case"object":Fe("load",s);break;case"video":case"audio":for(h=0;h<Nl.length;h++)Fe(Nl[h],s);break;case"image":Fe("error",s),Fe("load",s);break;case"details":Fe("toggle",s);break;case"embed":case"source":case"link":Fe("error",s),Fe("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(G in u)if(u.hasOwnProperty(G)&&(h=u[G],h!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:ct(s,l,G,h,u,null)}return;default:if(Kf(l)){for($ in u)u.hasOwnProperty($)&&(h=u[$],h!==void 0&&Nm(s,l,$,h,u,void 0));return}}for(O in u)u.hasOwnProperty(O)&&(h=u[O],h!=null&&ct(s,l,O,h,u,null))}function eR(s,l,u,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,b=null,S=null,O=null,R=null,G=null,$=null;for(Q in u){var ne=u[Q];if(u.hasOwnProperty(Q)&&ne!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":R=ne;default:h.hasOwnProperty(Q)||ct(s,l,Q,null,h,ne)}}for(var W in h){var Q=h[W];if(ne=u[W],h.hasOwnProperty(W)&&(Q!=null||ne!=null))switch(W){case"type":b=Q;break;case"name":y=Q;break;case"checked":G=Q;break;case"defaultChecked":$=Q;break;case"value":S=Q;break;case"defaultValue":O=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,l));break;default:Q!==ne&&ct(s,l,W,Q,h,ne)}}qf(s,S,O,R,G,$,b,y);return;case"select":Q=S=O=W=null;for(b in u)if(R=u[b],u.hasOwnProperty(b)&&R!=null)switch(b){case"value":break;case"multiple":Q=R;default:h.hasOwnProperty(b)||ct(s,l,b,null,h,R)}for(y in h)if(b=h[y],R=u[y],h.hasOwnProperty(y)&&(b!=null||R!=null))switch(y){case"value":W=b;break;case"defaultValue":O=b;break;case"multiple":S=b;default:b!==R&&ct(s,l,y,b,h,R)}l=O,u=S,h=Q,W!=null?Na(s,!!u,W,!1):!!h!=!!u&&(l!=null?Na(s,!!u,l,!0):Na(s,!!u,u?[]:"",!1));return;case"textarea":Q=W=null;for(O in u)if(y=u[O],u.hasOwnProperty(O)&&y!=null&&!h.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:ct(s,l,O,null,h,y)}for(S in h)if(y=h[S],b=u[S],h.hasOwnProperty(S)&&(y!=null||b!=null))switch(S){case"value":W=y;break;case"defaultValue":Q=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==b&&ct(s,l,S,y,h,b)}pv(s,W,Q);return;case"option":for(var ve in u)if(W=u[ve],u.hasOwnProperty(ve)&&W!=null&&!h.hasOwnProperty(ve))switch(ve){case"selected":s.selected=!1;break;default:ct(s,l,ve,null,h,W)}for(R in h)if(W=h[R],Q=u[R],h.hasOwnProperty(R)&&W!==Q&&(W!=null||Q!=null))switch(R){case"selected":s.selected=W&&typeof W!="function"&&typeof W!="symbol";break;default:ct(s,l,R,W,h,Q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Pe in u)W=u[Pe],u.hasOwnProperty(Pe)&&W!=null&&!h.hasOwnProperty(Pe)&&ct(s,l,Pe,null,h,W);for(G in h)if(W=h[G],Q=u[G],h.hasOwnProperty(G)&&W!==Q&&(W!=null||Q!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(i(137,l));break;default:ct(s,l,G,W,h,Q)}return;default:if(Kf(l)){for(var ut in u)W=u[ut],u.hasOwnProperty(ut)&&W!==void 0&&!h.hasOwnProperty(ut)&&Nm(s,l,ut,void 0,h,W);for($ in h)W=h[$],Q=u[$],!h.hasOwnProperty($)||W===Q||W===void 0&&Q===void 0||Nm(s,l,$,W,h,Q);return}}for(var _ in u)W=u[_],u.hasOwnProperty(_)&&W!=null&&!h.hasOwnProperty(_)&&ct(s,l,_,null,h,W);for(ne in h)W=h[ne],Q=u[ne],!h.hasOwnProperty(ne)||W===Q||W==null&&Q==null||ct(s,l,ne,W,h,Q)}function bS(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tR(){if(typeof performance.getEntriesByType=="function"){for(var s=0,l=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var y=u[h],b=y.transferSize,S=y.initiatorType,O=y.duration;if(b&&O&&bS(S)){for(S=0,O=y.responseEnd,h+=1;h<u.length;h++){var R=u[h],G=R.startTime;if(G>O)break;var $=R.transferSize,ne=R.initiatorType;$&&bS(ne)&&(R=R.responseEnd,S+=$*(R<O?1:(O-G)/(R-G)))}if(--h,l+=8*(b+S)/(y.duration/1e3),s++,10<s)break}}if(0<s)return l/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Lm=null,Rm=null;function rd(s){return s.nodeType===9?s:s.ownerDocument}function xS(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function vS(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function Em(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var jm=null;function nR(){var s=window.event;return s&&s.type==="popstate"?s===jm?!1:(jm=s,!0):(jm=null,!1)}var CS=typeof setTimeout=="function"?setTimeout:void 0,iR=typeof clearTimeout=="function"?clearTimeout:void 0,SS=typeof Promise=="function"?Promise:void 0,oR=typeof queueMicrotask=="function"?queueMicrotask:typeof SS<"u"?function(s){return SS.resolve(null).then(s).catch(sR)}:CS;function sR(s){setTimeout(function(){throw s})}function ns(s){return s==="head"}function kS(s,l){var u=l,h=0;do{var y=u.nextSibling;if(s.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(h===0){s.removeChild(y),cr(l);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Rl(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,Rl(u);for(var b=u.firstChild;b;){var S=b.nextSibling,O=b.nodeName;b[Xr]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&b.rel.toLowerCase()==="stylesheet"||u.removeChild(b),b=S}}else u==="body"&&Rl(s.ownerDocument.body);u=y}while(u);cr(l)}function wS(s,l){var u=s;s=0;do{var h=u.nextSibling;if(u.nodeType===1?l?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(l?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=h}while(u)}function Im(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Im(u),zf(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function aR(s,l,u,h){for(;s.nodeType===1;){var y=u;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(h){if(!s[Xr])switch(l){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(b=s.getAttribute("rel"),b==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(b!==y.rel||s.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||s.getAttribute("title")!==(y.title==null?null:y.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(b=s.getAttribute("src"),(b!==(y.src==null?null:y.src)||s.getAttribute("type")!==(y.type==null?null:y.type)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&b&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(l==="input"&&s.type==="hidden"){var b=y.name==null?null:""+y.name;if(y.type==="hidden"&&s.getAttribute("name")===b)return s}else return s;if(s=si(s.nextSibling),s===null)break}return null}function rR(s,l,u){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=si(s.nextSibling),s===null))return null;return s}function AS(s,l){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=si(s.nextSibling),s===null))return null;return s}function Bm(s){return s.data==="$?"||s.data==="$~"}function _m(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function lR(s,l){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=l;else if(s.data!=="$?"||u.readyState!=="loading")l();else{var h=function(){l(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),s._reactRetry=h}}function si(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return s}var Hm=null;function OS(s){s=s.nextSibling;for(var l=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(l===0)return si(s.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}s=s.nextSibling}return null}function PS(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(l===0)return s;l--}else u!=="/$"&&u!=="/&"||l++}s=s.previousSibling}return null}function TS(s,l,u){switch(l=rd(u),s){case"html":if(s=l.documentElement,!s)throw Error(i(452));return s;case"head":if(s=l.head,!s)throw Error(i(453));return s;case"body":if(s=l.body,!s)throw Error(i(454));return s;default:throw Error(i(451))}}function Rl(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);zf(s)}var ai=new Map,DS=new Set;function ld(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var xo=Z.d;Z.d={f:cR,r:uR,D:dR,C:hR,L:fR,m:pR,X:gR,S:mR,M:yR};function cR(){var s=xo.f(),l=Zu();return s||l}function uR(s){var l=Ta(s);l!==null&&l.tag===5&&l.type==="form"?V0(l):xo.r(s)}var ar=typeof document>"u"?null:document;function MS(s,l,u){var h=ar;if(h&&typeof l=="string"&&l){var y=Jn(l);y='link[rel="'+s+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),DS.has(y)||(DS.add(y),s={rel:s,crossOrigin:u,href:l},h.querySelector(y)===null&&(l=h.createElement("link"),nn(l,"link",s),Vt(l),h.head.appendChild(l)))}}function dR(s){xo.D(s),MS("dns-prefetch",s,null)}function hR(s,l){xo.C(s,l),MS("preconnect",s,l)}function fR(s,l,u){xo.L(s,l,u);var h=ar;if(h&&s&&l){var y='link[rel="preload"][as="'+Jn(l)+'"]';l==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Jn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Jn(u.imageSizes)+'"]')):y+='[href="'+Jn(s)+'"]';var b=y;switch(l){case"style":b=rr(s);break;case"script":b=lr(s)}ai.has(b)||(s=g({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:s,as:l},u),ai.set(b,s),h.querySelector(y)!==null||l==="style"&&h.querySelector(El(b))||l==="script"&&h.querySelector(jl(b))||(l=h.createElement("link"),nn(l,"link",s),Vt(l),h.head.appendChild(l)))}}function pR(s,l){xo.m(s,l);var u=ar;if(u&&s){var h=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+Jn(h)+'"][href="'+Jn(s)+'"]',b=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=lr(s)}if(!ai.has(b)&&(s=g({rel:"modulepreload",href:s},l),ai.set(b,s),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(jl(b)))return}h=u.createElement("link"),nn(h,"link",s),Vt(h),u.head.appendChild(h)}}}function mR(s,l,u){xo.S(s,l,u);var h=ar;if(h&&s){var y=Da(h).hoistableStyles,b=rr(s);l=l||"default";var S=y.get(b);if(!S){var O={loading:0,preload:null};if(S=h.querySelector(El(b)))O.loading=5;else{s=g({rel:"stylesheet",href:s,"data-precedence":l},u),(u=ai.get(b))&&Um(s,u);var R=S=h.createElement("link");Vt(R),nn(R,"link",s),R._p=new Promise(function(G,$){R.onload=G,R.onerror=$}),R.addEventListener("load",function(){O.loading|=1}),R.addEventListener("error",function(){O.loading|=2}),O.loading|=4,cd(S,l,h)}S={type:"stylesheet",instance:S,count:1,state:O},y.set(b,S)}}}function gR(s,l){xo.X(s,l);var u=ar;if(u&&s){var h=Da(u).hoistableScripts,y=lr(s),b=h.get(y);b||(b=u.querySelector(jl(y)),b||(s=g({src:s,async:!0},l),(l=ai.get(y))&&zm(s,l),b=u.createElement("script"),Vt(b),nn(b,"link",s),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function yR(s,l){xo.M(s,l);var u=ar;if(u&&s){var h=Da(u).hoistableScripts,y=lr(s),b=h.get(y);b||(b=u.querySelector(jl(y)),b||(s=g({src:s,async:!0,type:"module"},l),(l=ai.get(y))&&zm(s,l),b=u.createElement("script"),Vt(b),nn(b,"link",s),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function NS(s,l,u,h){var y=(y=Se.current)?ld(y):null;if(!y)throw Error(i(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=rr(u.href),u=Da(y).hoistableStyles,h=u.get(l),h||(h={type:"style",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=rr(u.href);var b=Da(y).hoistableStyles,S=b.get(s);if(S||(y=y.ownerDocument||y,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(s,S),(b=y.querySelector(El(s)))&&!b._p&&(S.instance=b,S.state.loading=5),ai.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},ai.set(s,u),b||bR(y,s,u,S.state))),l&&h===null)throw Error(i(528,""));return S}if(l&&h!==null)throw Error(i(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=lr(u),u=Da(y).hoistableScripts,h=u.get(l),h||(h={type:"script",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,s))}}function rr(s){return'href="'+Jn(s)+'"'}function El(s){return'link[rel="stylesheet"]['+s+"]"}function LS(s){return g({},s,{"data-precedence":s.precedence,precedence:null})}function bR(s,l,u,h){s.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=s.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),nn(l,"link",u),Vt(l),s.head.appendChild(l))}function lr(s){return'[src="'+Jn(s)+'"]'}function jl(s){return"script[async]"+s}function RS(s,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var h=s.querySelector('style[data-href~="'+Jn(u.href)+'"]');if(h)return l.instance=h,Vt(h),h;var y=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(s.ownerDocument||s).createElement("style"),Vt(h),nn(h,"style",y),cd(h,u.precedence,s),l.instance=h;case"stylesheet":y=rr(u.href);var b=s.querySelector(El(y));if(b)return l.state.loading|=4,l.instance=b,Vt(b),b;h=LS(u),(y=ai.get(y))&&Um(h,y),b=(s.ownerDocument||s).createElement("link"),Vt(b);var S=b;return S._p=new Promise(function(O,R){S.onload=O,S.onerror=R}),nn(b,"link",h),l.state.loading|=4,cd(b,u.precedence,s),l.instance=b;case"script":return b=lr(u.src),(y=s.querySelector(jl(b)))?(l.instance=y,Vt(y),y):(h=u,(y=ai.get(b))&&(h=g({},u),zm(h,y)),s=s.ownerDocument||s,y=s.createElement("script"),Vt(y),nn(y,"link",h),s.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(i(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,cd(h,u.precedence,s));return l.instance}function cd(s,l,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,b=y,S=0;S<h.length;S++){var O=h[S];if(O.dataset.precedence===l)b=O;else if(b!==y)break}b?b.parentNode.insertBefore(s,b.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(s,l.firstChild))}function Um(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function zm(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var ud=null;function ES(s,l,u){if(ud===null){var h=new Map,y=ud=new Map;y.set(u,h)}else y=ud,h=y.get(u),h||(h=new Map,y.set(u,h));if(h.has(s))return h;for(h.set(s,null),u=u.getElementsByTagName(s),y=0;y<u.length;y++){var b=u[y];if(!(b[Xr]||b[Jt]||s==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var S=b.getAttribute(l)||"";S=s+S;var O=h.get(S);O?O.push(b):h.set(S,[b])}}return h}function jS(s,l,u){s=s.ownerDocument||s,s.head.insertBefore(u,l==="title"?s.querySelector("head > title"):null)}function xR(s,l,u){if(u===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return s=l.disabled,typeof l.precedence=="string"&&s==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function IS(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function vR(s,l,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=rr(h.href),b=l.querySelector(El(y));if(b){l=b._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(s.count++,s=dd.bind(s),l.then(s,s)),u.state.loading|=4,u.instance=b,Vt(b);return}b=l.ownerDocument||l,h=LS(h),(y=ai.get(y))&&Um(h,y),b=b.createElement("link"),Vt(b);var S=b;S._p=new Promise(function(O,R){S.onload=O,S.onerror=R}),nn(b,"link",h),u.instance=b}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,l),(l=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=dd.bind(s),l.addEventListener("load",u),l.addEventListener("error",u))}}var Fm=0;function CR(s,l){return s.stylesheets&&s.count===0&&fd(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var h=setTimeout(function(){if(s.stylesheets&&fd(s,s.stylesheets),s.unsuspend){var b=s.unsuspend;s.unsuspend=null,b()}},6e4+l);0<s.imgBytes&&Fm===0&&(Fm=62500*tR());var y=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&fd(s,s.stylesheets),s.unsuspend)){var b=s.unsuspend;s.unsuspend=null,b()}},(s.imgBytes>Fm?50:800)+l);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function dd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fd(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var hd=null;function fd(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,hd=new Map,l.forEach(SR,s),hd=null,dd.call(s))}function SR(s,l){if(!(l.state.loading&4)){var u=hd.get(s);if(u)var h=u.get(null);else{u=new Map,hd.set(s,u);for(var y=s.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<y.length;b++){var S=y[b];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(u.set(S.dataset.precedence,S),h=S)}h&&u.set(null,h)}y=l.instance,S=y.getAttribute("data-precedence"),b=u.get(S)||h,b===h&&u.set(null,y),u.set(S,y),this.count++,h=dd.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),b?b.parentNode.insertBefore(y,b.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(y,s.firstChild)),l.state.loading|=4}}var Il={$$typeof:M,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function kR(s,l,u,h,y,b,S,O,R){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ds(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ds(0),this.hiddenUpdates=Ds(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=b,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function BS(s,l,u,h,y,b,S,O,R,G,$,ne){return s=new kR(s,l,u,S,R,G,$,ne,O),l=1,b===!0&&(l|=24),b=_n(3,null,null,l),s.current=b,b.stateNode=s,l=Cp(),l.refCount++,s.pooledCache=l,l.refCount++,b.memoizedState={element:h,isDehydrated:u,cache:l},Ap(b),s}function _S(s){return s?(s=Ha,s):Ha}function HS(s,l,u,h,y,b){y=_S(y),h.context===null?h.context=y:h.pendingContext=y,h=Ko(l),h.payload={element:u},b=b===void 0?null:b,b!==null&&(h.callback=b),u=Vo(s,h,l),u!==null&&(Dn(u,s,l),pl(u,s,l))}function US(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<l?u:l}}function qm(s,l){US(s,l),(s=s.alternate)&&US(s,l)}function zS(s){if(s.tag===13||s.tag===31){var l=Es(s,67108864);l!==null&&Dn(l,s,67108864),qm(s,67108864)}}function FS(s){if(s.tag===13||s.tag===31){var l=qn();l=_f(l);var u=Es(s,l);u!==null&&Dn(u,s,l),qm(s,l)}}var pd=!0;function wR(s,l,u,h){var y=B.T;B.T=null;var b=Z.p;try{Z.p=2,Gm(s,l,u,h)}finally{Z.p=b,B.T=y}}function AR(s,l,u,h){var y=B.T;B.T=null;var b=Z.p;try{Z.p=8,Gm(s,l,u,h)}finally{Z.p=b,B.T=y}}function Gm(s,l,u,h){if(pd){var y=Km(h);if(y===null)Mm(s,l,h,md,u),GS(s,h);else if(PR(y,s,l,u,h))h.stopPropagation();else if(GS(s,h),l&4&&-1<OR.indexOf(s)){for(;y!==null;){var b=Ta(y);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var S=Kt(b.pendingLanes);if(S!==0){var O=b;for(O.pendingLanes|=2,O.entangledLanes|=2;S;){var R=1<<31-mn(S);O.entanglements[1]|=R,S&=~R}Ni(b),(ot&6)===0&&(Xu=Xt()+500,Ml(0))}}break;case 31:case 13:O=Es(b,2),O!==null&&Dn(O,b,2),Zu(),qm(b,2)}if(b=Km(h),b===null&&Mm(s,l,h,md,u),b===y)break;y=b}y!==null&&h.stopPropagation()}else Mm(s,l,h,null,u)}}function Km(s){return s=Wf(s),Vm(s)}var md=null;function Vm(s){if(md=null,s=Pa(s),s!==null){var l=a(s);if(l===null)s=null;else{var u=l.tag;if(u===13){if(s=r(l),s!==null)return s;s=null}else if(u===31){if(s=c(l),s!==null)return s;s=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return md=s,null}function qS(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch($r()){case ou:return 2;case su:return 8;case Aa:case Rf:return 32;case au:return 268435456;default:return 32}default:return 32}}var Wm=!1,is=null,os=null,ss=null,Bl=new Map,_l=new Map,as=[],OR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function GS(s,l){switch(s){case"focusin":case"focusout":is=null;break;case"dragenter":case"dragleave":os=null;break;case"mouseover":case"mouseout":ss=null;break;case"pointerover":case"pointerout":Bl.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":_l.delete(l.pointerId)}}function Hl(s,l,u,h,y,b){return s===null||s.nativeEvent!==b?(s={blockedOn:l,domEventName:u,eventSystemFlags:h,nativeEvent:b,targetContainers:[y]},l!==null&&(l=Ta(l),l!==null&&zS(l)),s):(s.eventSystemFlags|=h,l=s.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),s)}function PR(s,l,u,h,y){switch(l){case"focusin":return is=Hl(is,s,l,u,h,y),!0;case"dragenter":return os=Hl(os,s,l,u,h,y),!0;case"mouseover":return ss=Hl(ss,s,l,u,h,y),!0;case"pointerover":var b=y.pointerId;return Bl.set(b,Hl(Bl.get(b)||null,s,l,u,h,y)),!0;case"gotpointercapture":return b=y.pointerId,_l.set(b,Hl(_l.get(b)||null,s,l,u,h,y)),!0}return!1}function KS(s){var l=Pa(s.target);if(l!==null){var u=a(l);if(u!==null){if(l=u.tag,l===13){if(l=r(u),l!==null){s.blockedOn=l,sv(s.priority,function(){FS(u)});return}}else if(l===31){if(l=c(u),l!==null){s.blockedOn=l,sv(s.priority,function(){FS(u)});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function gd(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var u=Km(s.nativeEvent);if(u===null){u=s.nativeEvent;var h=new u.constructor(u.type,u);Vf=h,u.target.dispatchEvent(h),Vf=null}else return l=Ta(u),l!==null&&zS(l),s.blockedOn=u,!1;l.shift()}return!0}function VS(s,l,u){gd(s)&&u.delete(l)}function TR(){Wm=!1,is!==null&&gd(is)&&(is=null),os!==null&&gd(os)&&(os=null),ss!==null&&gd(ss)&&(ss=null),Bl.forEach(VS),_l.forEach(VS)}function yd(s,l){s.blockedOn===l&&(s.blockedOn=null,Wm||(Wm=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,TR)))}var bd=null;function WS(s){bd!==s&&(bd=s,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){bd===s&&(bd=null);for(var l=0;l<s.length;l+=3){var u=s[l],h=s[l+1],y=s[l+2];if(typeof h!="function"){if(Vm(h||u)===null)continue;break}var b=Ta(u);b!==null&&(s.splice(l,3),l-=3,Kp(b,{pending:!0,data:y,method:u.method,action:h},h,y))}}))}function cr(s){function l(R){return yd(R,s)}is!==null&&yd(is,s),os!==null&&yd(os,s),ss!==null&&yd(ss,s),Bl.forEach(l),_l.forEach(l);for(var u=0;u<as.length;u++){var h=as[u];h.blockedOn===s&&(h.blockedOn=null)}for(;0<as.length&&(u=as[0],u.blockedOn===null);)KS(u),u.blockedOn===null&&as.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var y=u[h],b=u[h+1],S=y[kn]||null;if(typeof b=="function")S||WS(u);else if(S){var O=null;if(b&&b.hasAttribute("formAction")){if(y=b,S=b[kn]||null)O=S.formAction;else if(Vm(y)!==null)continue}else O=S.action;typeof O=="function"?u[h+1]=O:(u.splice(h,3),h-=3),WS(u)}}}function QS(){function s(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(S){return y=S})},focusReset:"manual",scroll:"manual"})}function l(){y!==null&&(y(),y=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,y=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),y!==null&&(y(),y=null)}}}function Qm(s){this._internalRoot=s}xd.prototype.render=Qm.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(i(409));var u=l.current,h=qn();HS(u,h,s,l,null,null)},xd.prototype.unmount=Qm.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;HS(s.current,2,null,s,null,null),Zu(),l[Oa]=null}};function xd(s){this._internalRoot=s}xd.prototype.unstable_scheduleHydration=function(s){if(s){var l=ov();s={blockedOn:null,target:s,priority:l};for(var u=0;u<as.length&&l!==0&&l<as[u].priority;u++);as.splice(u,0,s),u===0&&KS(s)}};var YS=e.version;if(YS!=="19.2.1")throw Error(i(527,YS,"19.2.1"));Z.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(i(188)):(s=Object.keys(s).join(","),Error(i(268,s)));return s=f(l),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var DR={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vd.isDisabled&&vd.supportsFiber)try{Ps=vd.inject(DR),pn=vd}catch{}}return zl.createRoot=function(s,l){if(!o(s))throw Error(i(299));var u=!1,h="",y=nC,b=iC,S=oC;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(S=l.onRecoverableError)),l=BS(s,1,!1,null,null,u,h,null,y,b,S,QS),s[Oa]=l.current,Dm(s),new Qm(l)},zl.hydrateRoot=function(s,l,u){if(!o(s))throw Error(i(299));var h=!1,y="",b=nC,S=iC,O=oC,R=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(b=u.onUncaughtError),u.onCaughtError!==void 0&&(S=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError),u.formState!==void 0&&(R=u.formState)),l=BS(s,1,!0,l,u??null,h,y,R,b,S,O,QS),l.context=_S(null),u=l.current,h=qn(),h=_f(h),y=Ko(h),y.callback=null,Vo(u,y,h),u=h,l.current.lanes=u,eo(l,u),Ni(l),s[Oa]=l.current,Dm(s),new xd(l)},zl.version="19.2.1",zl}var ck;function z2(){if(ck)return Ym.exports;ck=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Ym.exports=U2(),Ym.exports}var F2=z2();const q2="modulepreload",G2=function(n){return"/"+n},uk={},rt=function(e,t,i){let o=Promise.resolve();if(t&&t.length>0){let d=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),c=r?.nonce||r?.getAttribute("nonce");o=d(t.map(f=>{if(f=G2(f),f in uk)return;uk[f]=!0;const m=f.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const x=document.createElement("link");if(x.rel=m?"stylesheet":q2,m||(x.as="script"),x.crossOrigin="",x.href=f,c&&x.setAttribute("nonce",c),document.head.appendChild(x),m)return new Promise((v,C)=>{x.addEventListener("load",v),x.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(r){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=r,window.dispatchEvent(c),!c.defaultPrevented)throw r}return o.then(r=>{for(const c of r||[])c.status==="rejected"&&a(c.reason);return e().catch(a)})},K2=new fE({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1},mutations:{retry:!1}}}),Ne=n=>typeof n=="string",Fl=()=>{let n,e;const t=new Promise((i,o)=>{n=i,e=o});return t.resolve=n,t.reject=e,t},dk=n=>n==null?"":""+n,V2=(n,e,t)=>{n.forEach(i=>{e[i]&&(t[i]=e[i])})},W2=/###/g,hk=n=>n&&n.indexOf("###")>-1?n.replace(W2,"."):n,fk=n=>!n||Ne(n),oc=(n,e,t)=>{const i=Ne(e)?e.split("."):e;let o=0;for(;o<i.length-1;){if(fk(n))return{};const a=hk(i[o]);!n[a]&&t&&(n[a]=new t),Object.prototype.hasOwnProperty.call(n,a)?n=n[a]:n={},++o}return fk(n)?{}:{obj:n,k:hk(i[o])}},pk=(n,e,t)=>{const{obj:i,k:o}=oc(n,e,Object);if(i!==void 0||e.length===1){i[o]=t;return}let a=e[e.length-1],r=e.slice(0,e.length-1),c=oc(n,r,Object);for(;c.obj===void 0&&r.length;)a=`${r[r.length-1]}.${a}`,r=r.slice(0,r.length-1),c=oc(n,r,Object),c?.obj&&typeof c.obj[`${c.k}.${a}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${a}`]=t},Q2=(n,e,t,i)=>{const{obj:o,k:a}=oc(n,e,Object);o[a]=o[a]||[],o[a].push(t)},hh=(n,e)=>{const{obj:t,k:i}=oc(n,e);if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i]},Y2=(n,e,t)=>{const i=hh(n,t);return i!==void 0?i:hh(e,t)},xO=(n,e,t)=>{for(const i in e)i!=="__proto__"&&i!=="constructor"&&(i in n?Ne(n[i])||n[i]instanceof String||Ne(e[i])||e[i]instanceof String?t&&(n[i]=e[i]):xO(n[i],e[i],t):n[i]=e[i]);return n},Ws=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var $2={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const X2=n=>Ne(n)?n.replace(/[&<>"'\/]/g,e=>$2[e]):n;class J2{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}const Z2=[" ",",","?","!",";"],ej=new J2(20),tj=(n,e,t)=>{e=e||"",t=t||"";const i=Z2.filter(r=>e.indexOf(r)<0&&t.indexOf(r)<0);if(i.length===0)return!0;const o=ej.getRegExp(`(${i.map(r=>r==="?"?"\\?":r).join("|")})`);let a=!o.test(n);if(!a){const r=n.indexOf(t);r>0&&!o.test(n.substring(0,r))&&(a=!0)}return a},ny=(n,e,t=".")=>{if(!n)return;if(n[e])return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0;const i=e.split(t);let o=n;for(let a=0;a<i.length;){if(!o||typeof o!="object")return;let r,c="";for(let d=a;d<i.length;++d)if(d!==a&&(c+=t),c+=i[d],r=o[c],r!==void 0){if(["string","number","boolean"].indexOf(typeof r)>-1&&d<i.length-1)continue;a+=d-a+1;break}o=r}return o},Cc=n=>n?.replace("_","-"),nj={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,e){console?.[n]?.apply?.(console,e)}};class fh{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||nj,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,i,o){return o&&!this.debug?null:(Ne(e[0])&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new fh(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new fh(this.logger,e)}}var zi=new fh;class Xh{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const o=this.observers[i].get(t)||0;this.observers[i].set(t,o+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([o,a])=>{for(let r=0;r<a;r++)o(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,a])=>{for(let r=0;r<a;r++)o.apply(o,[e,...t])})}}class mk extends Xh{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,i,o={}){const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,r=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;e.indexOf(".")>-1?c=e.split("."):(c=[e,t],i&&(Array.isArray(i)?c.push(...i):Ne(i)&&a?c.push(...i.split(a)):c.push(i)));const d=hh(this.data,c);return!d&&!t&&!i&&e.indexOf(".")>-1&&(e=c[0],t=c[1],i=c.slice(2).join(".")),d||!r||!Ne(i)?d:ny(this.data?.[e]?.[t],i,a)}addResource(e,t,i,o,a={silent:!1}){const r=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=[e,t];i&&(c=c.concat(r?i.split(r):i)),e.indexOf(".")>-1&&(c=e.split("."),o=t,t=c[1]),this.addNamespaces(t),pk(this.data,c,o),a.silent||this.emit("added",e,t,i,o)}addResources(e,t,i,o={silent:!1}){for(const a in i)(Ne(i[a])||Array.isArray(i[a]))&&this.addResource(e,t,a,i[a],{silent:!0});o.silent||this.emit("added",e,t,i)}addResourceBundle(e,t,i,o,a,r={silent:!1,skipCopy:!1}){let c=[e,t];e.indexOf(".")>-1&&(c=e.split("."),o=i,i=t,t=c[1]),this.addNamespaces(t);let d=hh(this.data,c)||{};r.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?xO(d,i,a):d={...d,...i},pk(this.data,c,d),r.silent||this.emit("added",e,t,i)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(o=>t[o]&&Object.keys(t[o]).length>0)}toJSON(){return this.data}}var vO={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,e,t,i,o){return n.forEach(a=>{e=this.processors[a]?.process(e,t,i,o)??e}),e}};const CO=Symbol("i18next/PATH_KEY");function ij(){const n=[],e=Object.create(null);let t;return e.get=(i,o)=>(t?.revoke?.(),o===CO?n:(n.push(o),t=Proxy.revocable(i,e),t.proxy)),Proxy.revocable(Object.create(null),e).proxy}function iy(n,e){const{[CO]:t}=n(ij());return t.join(e?.keySeparator??".")}const gk={},Jm=n=>!Ne(n)&&typeof n!="boolean"&&typeof n!="number";class ph extends Xh{constructor(e,t={}){super(),V2(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=zi.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const i={...t};if(e==null)return!1;const o=this.resolve(e,i);if(o?.res===void 0)return!1;const a=Jm(o.res);return!(i.returnObjects===!1&&a)}extractFromKey(e,t){let i=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const o=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const r=i&&e.indexOf(i)>-1,c=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!tj(e,i,o);if(r&&!c){const d=e.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:e,namespaces:Ne(a)?[a]:a};const f=e.split(i);(i!==o||i===o&&this.options.ns.indexOf(f[0])>-1)&&(a=f.shift()),e=f.join(o)}return{key:e,namespaces:Ne(a)?[a]:a}}translate(e,t,i){let o=typeof t=="object"?{...t}:t;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),e==null)return"";typeof e=="function"&&(e=iy(e,{...this.options,...o})),Array.isArray(e)||(e=[String(e)]);const a=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,r=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:c,namespaces:d}=this.extractFromKey(e[e.length-1],o),f=d[d.length-1];let m=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;m===void 0&&(m=":");const g=o.lng||this.language,x=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g?.toLowerCase()==="cimode")return x?a?{res:`${f}${m}${c}`,usedKey:c,exactUsedKey:c,usedLng:g,usedNS:f,usedParams:this.getUsedParamsDetails(o)}:`${f}${m}${c}`:a?{res:c,usedKey:c,exactUsedKey:c,usedLng:g,usedNS:f,usedParams:this.getUsedParamsDetails(o)}:c;const v=this.resolve(e,o);let C=v?.res;const k=v?.usedKey||c,w=v?.exactUsedKey||c,P=["[object Number]","[object Function]","[object RegExp]"],T=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,M=!this.i18nFormat||this.i18nFormat.handleAsObject,D=o.count!==void 0&&!Ne(o.count),L=ph.hasDefaultValue(o),N=D?this.pluralResolver.getSuffix(g,o.count,o):"",j=o.ordinal&&D?this.pluralResolver.getSuffix(g,o.count,{ordinal:!1}):"",K=D&&!o.ordinal&&o.count===0,U=K&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${N}`]||o[`defaultValue${j}`]||o.defaultValue;let z=C;M&&!C&&L&&(z=U);const X=Jm(z),H=Object.prototype.toString.apply(z);if(M&&z&&X&&P.indexOf(H)<0&&!(Ne(T)&&Array.isArray(z))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const V=this.options.returnedObjectHandler?this.options.returnedObjectHandler(k,z,{...o,ns:d}):`key '${c} (${this.language})' returned an object instead of string.`;return a?(v.res=V,v.usedParams=this.getUsedParamsDetails(o),v):V}if(r){const V=Array.isArray(z),ie=V?[]:{},oe=V?w:k;for(const B in z)if(Object.prototype.hasOwnProperty.call(z,B)){const Z=`${oe}${r}${B}`;L&&!C?ie[B]=this.translate(Z,{...o,defaultValue:Jm(U)?U[B]:void 0,joinArrays:!1,ns:d}):ie[B]=this.translate(Z,{...o,joinArrays:!1,ns:d}),ie[B]===Z&&(ie[B]=z[B])}C=ie}}else if(M&&Ne(T)&&Array.isArray(C))C=C.join(T),C&&(C=this.extendTranslation(C,e,o,i));else{let V=!1,ie=!1;!this.isValidLookup(C)&&L&&(V=!0,C=U),this.isValidLookup(C)||(ie=!0,C=c);const B=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ie?void 0:C,Z=L&&U!==C&&this.options.updateMissing;if(ie||V||Z){if(this.logger.log(Z?"updateKey":"missingKey",g,f,c,Z?U:C),r){const de=this.resolve(c,{...o,keySeparator:!1});de&&de.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let se=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let de=0;de<Y.length;de++)se.push(Y[de]);else this.options.saveMissingTo==="all"?se=this.languageUtils.toResolveHierarchy(o.lng||this.language):se.push(o.lng||this.language);const ae=(de,be,te)=>{const le=L&&te!==C?te:B;this.options.missingKeyHandler?this.options.missingKeyHandler(de,f,be,le,Z,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(de,f,be,le,Z,o),this.emit("missingKey",de,f,be,C)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?se.forEach(de=>{const be=this.pluralResolver.getSuffixes(de,o);K&&o[`defaultValue${this.options.pluralSeparator}zero`]&&be.indexOf(`${this.options.pluralSeparator}zero`)<0&&be.push(`${this.options.pluralSeparator}zero`),be.forEach(te=>{ae([de],c+te,o[`defaultValue${te}`]||U)})}):ae(se,c,U))}C=this.extendTranslation(C,e,o,v,i),ie&&C===c&&this.options.appendNamespaceToMissingKey&&(C=`${f}${m}${c}`),(ie||V)&&this.options.parseMissingKeyHandler&&(C=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}${m}${c}`:c,V?C:void 0,o))}return a?(v.res=C,v.usedParams=this.getUsedParamsDetails(o),v):C}extendTranslation(e,t,i,o,a){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const d=Ne(e)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const g=e.match(this.interpolator.nestingRegexp);f=g&&g.length}let m=i.replace&&!Ne(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),e=this.interpolator.interpolate(e,m,i.lng||this.language||o.usedLng,i),d){const g=e.match(this.interpolator.nestingRegexp),x=g&&g.length;f<x&&(i.nest=!1)}!i.lng&&o&&o.res&&(i.lng=this.language||o.usedLng),i.nest!==!1&&(e=this.interpolator.nest(e,(...g)=>a?.[0]===g[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${t[0]}`),null):this.translate(...g,t),i)),i.interpolation&&this.interpolator.reset()}const r=i.postProcess||this.options.postProcess,c=Ne(r)?[r]:r;return e!=null&&c?.length&&i.applyPostProcessor!==!1&&(e=vO.handle(c,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e,t={}){let i,o,a,r,c;return Ne(e)&&(e=[e]),e.forEach(d=>{if(this.isValidLookup(i))return;const f=this.extractFromKey(d,t),m=f.key;o=m;let g=f.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const x=t.count!==void 0&&!Ne(t.count),v=x&&!t.ordinal&&t.count===0,C=t.context!==void 0&&(Ne(t.context)||typeof t.context=="number")&&t.context!=="",k=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);g.forEach(w=>{this.isValidLookup(i)||(c=w,!gk[`${k[0]}-${w}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(c)&&(gk[`${k[0]}-${w}`]=!0,this.logger.warn(`key "${o}" for languages "${k.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),k.forEach(P=>{if(this.isValidLookup(i))return;r=P;const T=[m];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(T,m,P,w,t);else{let D;x&&(D=this.pluralResolver.getSuffix(P,t.count,t));const L=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(x&&(t.ordinal&&D.indexOf(N)===0&&T.push(m+D.replace(N,this.options.pluralSeparator)),T.push(m+D),v&&T.push(m+L)),C){const j=`${m}${this.options.contextSeparator||"_"}${t.context}`;T.push(j),x&&(t.ordinal&&D.indexOf(N)===0&&T.push(j+D.replace(N,this.options.pluralSeparator)),T.push(j+D),v&&T.push(j+L))}}let M;for(;M=T.pop();)this.isValidLookup(i)||(a=M,i=this.getResource(P,w,M,t))}))})}),{res:i,usedKey:o,exactUsedKey:a,usedLng:r,usedNS:c}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,i,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,i,o):this.resourceStore.getResource(e,t,i,o)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&!Ne(e.replace);let o=i?e.replace:e;if(i&&typeof e.count<"u"&&(o.count=e.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!i){o={...o};for(const a of t)delete o[a]}return o}static hasDefaultValue(e){const t="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t===i.substring(0,t.length)&&e[i]!==void 0)return!0;return!1}}class yk{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=zi.create("languageUtils")}getScriptPartFromCode(e){if(e=Cc(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Cc(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Ne(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(i=>{if(t)return;const o=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(o))&&(t=o)}),!t&&this.options.supportedLngs&&e.forEach(i=>{if(t)return;const o=this.getScriptPartFromCode(i);if(this.isSupportedCode(o))return t=o;const a=this.getLanguagePartFromCode(i);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(r=>{if(r===a)return r;if(!(r.indexOf("-")<0&&a.indexOf("-")<0)&&(r.indexOf("-")>0&&a.indexOf("-")<0&&r.substring(0,r.indexOf("-"))===a||r.indexOf(a)===0&&a.length>1))return r})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),Ne(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e.default),i||[]}toResolveHierarchy(e,t){const i=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),o=[],a=r=>{r&&(this.isSupportedCode(r)?o.push(r):this.logger.warn(`rejecting language code not found in supportedLngs: ${r}`))};return Ne(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):Ne(e)&&a(this.formatLanguageCode(e)),i.forEach(r=>{o.indexOf(r)<0&&a(this.formatLanguageCode(r))}),o}}const bk={zero:0,one:1,two:2,few:3,many:4,other:5},xk={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class oj{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=zi.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const i=Cc(e==="dev"?"en":e),o=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:i,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let r;try{r=new Intl.PluralRules(i,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),xk;if(!e.match(/-|_/))return xk;const d=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(d,t)}return this.pluralRulesCache[a]=r,r}needsPlural(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,i={}){return this.getSuffixes(e,i).map(o=>`${t}${o}`)}getSuffixes(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?i.resolvedOptions().pluralCategories.sort((o,a)=>bk[o]-bk[a]).map(o=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(e,t,i={}){const o=this.getRule(e,i);return o?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,i))}}const vk=(n,e,t,i=".",o=!0)=>{let a=Y2(n,e,t);return!a&&o&&Ne(t)&&(a=ny(n,t,i),a===void 0&&(a=ny(e,t,i))),a},Zm=n=>n.replace(/\$/g,"$$$$");class Ck{constructor(e={}){this.logger=zi.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:i,useRawValueToEscape:o,prefix:a,prefixEscaped:r,suffix:c,suffixEscaped:d,formatSeparator:f,unescapeSuffix:m,unescapePrefix:g,nestingPrefix:x,nestingPrefixEscaped:v,nestingSuffix:C,nestingSuffixEscaped:k,nestingOptionsSeparator:w,maxReplaces:P,alwaysFormat:T}=e.interpolation;this.escape=t!==void 0?t:X2,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=a?Ws(a):r||"{{",this.suffix=c?Ws(c):d||"}}",this.formatSeparator=f||",",this.unescapePrefix=m?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=x?Ws(x):v||Ws("$t("),this.nestingSuffix=C?Ws(C):k||Ws(")"),this.nestingOptionsSeparator=w||",",this.maxReplaces=P||1e3,this.alwaysFormat=T!==void 0?T:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,i)=>t?.source===i?(t.lastIndex=0,t):new RegExp(i,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,i,o){let a,r,c;const d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=v=>{if(v.indexOf(this.formatSeparator)<0){const P=vk(t,d,v,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(P,void 0,i,{...o,...t,interpolationkey:v}):P}const C=v.split(this.formatSeparator),k=C.shift().trim(),w=C.join(this.formatSeparator).trim();return this.format(vk(t,d,k,this.options.keySeparator,this.options.ignoreJSONStructure),w,i,{...o,...t,interpolationkey:k})};this.resetRegExp();const m=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,g=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:v=>Zm(v)},{regex:this.regexp,safeValue:v=>this.escapeValue?Zm(this.escape(v)):Zm(v)}].forEach(v=>{for(c=0;a=v.regex.exec(e);){const C=a[1].trim();if(r=f(C),r===void 0)if(typeof m=="function"){const w=m(e,a,o);r=Ne(w)?w:""}else if(o&&Object.prototype.hasOwnProperty.call(o,C))r="";else if(g){r=a[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${e}`),r="";else!Ne(r)&&!this.useRawValueToEscape&&(r=dk(r));const k=v.safeValue(r);if(e=e.replace(a[0],k),g?(v.regex.lastIndex+=r.length,v.regex.lastIndex-=a[0].length):v.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),e}nest(e,t,i={}){let o,a,r;const c=(d,f)=>{const m=this.nestingOptionsSeparator;if(d.indexOf(m)<0)return d;const g=d.split(new RegExp(`${Ws(m)}[ ]*{`));let x=`{${g[1]}`;d=g[0],x=this.interpolate(x,r);const v=x.match(/'/g),C=x.match(/"/g);((v?.length??0)%2===0&&!C||(C?.length??0)%2!==0)&&(x=x.replace(/'/g,'"'));try{r=JSON.parse(x),f&&(r={...f,...r})}catch(k){return this.logger.warn(`failed parsing options string in nesting for key ${d}`,k),`${d}${m}${x}`}return r.defaultValue&&r.defaultValue.indexOf(this.prefix)>-1&&delete r.defaultValue,d};for(;o=this.nestingRegexp.exec(e);){let d=[];r={...i},r=r.replace&&!Ne(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.defaultValue;const f=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(f!==-1&&(d=o[1].slice(f).split(this.formatSeparator).map(m=>m.trim()).filter(Boolean),o[1]=o[1].slice(0,f)),a=t(c.call(this,o[1].trim(),r),r),a&&o[0]===e&&!Ne(a))return a;Ne(a)||(a=dk(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),a=""),d.length&&(a=d.reduce((m,g)=>this.format(m,g,i.lng,{...i,interpolationkey:o[1].trim()}),a.trim())),e=e.replace(o[0],a),this.regexp.lastIndex=0}return e}}const sj=n=>{let e=n.toLowerCase().trim();const t={};if(n.indexOf("(")>-1){const i=n.split("(");e=i[0].toLowerCase().trim();const o=i[1].substring(0,i[1].length-1);e==="currency"&&o.indexOf(":")<0?t.currency||(t.currency=o.trim()):e==="relativetime"&&o.indexOf(":")<0?t.range||(t.range=o.trim()):o.split(";").forEach(r=>{if(r){const[c,...d]=r.split(":"),f=d.join(":").trim().replace(/^'+|'+$/g,""),m=c.trim();t[m]||(t[m]=f),f==="false"&&(t[m]=!1),f==="true"&&(t[m]=!0),isNaN(f)||(t[m]=parseInt(f,10))}})}return{formatName:e,formatOptions:t}},Sk=n=>{const e={};return(t,i,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});const r=i+JSON.stringify(a);let c=e[r];return c||(c=n(Cc(i),o),e[r]=c),c(t)}},aj=n=>(e,t,i)=>n(Cc(t),i)(e);class rj{constructor(e={}){this.logger=zi.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const i=t.cacheInBuiltFormats?Sk:aj;this.formats={number:i((o,a)=>{const r=new Intl.NumberFormat(o,{...a});return c=>r.format(c)}),currency:i((o,a)=>{const r=new Intl.NumberFormat(o,{...a,style:"currency"});return c=>r.format(c)}),datetime:i((o,a)=>{const r=new Intl.DateTimeFormat(o,{...a});return c=>r.format(c)}),relativetime:i((o,a)=>{const r=new Intl.RelativeTimeFormat(o,{...a});return c=>r.format(c,a.range||"day")}),list:i((o,a)=>{const r=new Intl.ListFormat(o,{...a});return c=>r.format(c)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Sk(t)}format(e,t,i,o={}){const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(c=>c.indexOf(")")>-1)){const c=a.findIndex(d=>d.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,c)].join(this.formatSeparator)}return a.reduce((c,d)=>{const{formatName:f,formatOptions:m}=sj(d);if(this.formats[f]){let g=c;try{const x=o?.formatParams?.[o.interpolationkey]||{},v=x.locale||x.lng||o.locale||o.lng||i;g=this.formats[f](c,v,{...m,...o,...x})}catch(x){this.logger.warn(x)}return g}else this.logger.warn(`there was no format function for ${f}`);return c},e)}}const lj=(n,e)=>{n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)};class cj extends Xh{constructor(e,t,i,o={}){super(),this.backend=e,this.store=t,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=zi.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,o.backend,o)}queueLoad(e,t,i,o){const a={},r={},c={},d={};return e.forEach(f=>{let m=!0;t.forEach(g=>{const x=`${f}|${g}`;!i.reload&&this.store.hasResourceBundle(f,g)?this.state[x]=2:this.state[x]<0||(this.state[x]===1?r[x]===void 0&&(r[x]=!0):(this.state[x]=1,m=!1,r[x]===void 0&&(r[x]=!0),a[x]===void 0&&(a[x]=!0),d[g]===void 0&&(d[g]=!0)))}),m||(c[f]=!0)}),(Object.keys(a).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(r),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(d)}}loaded(e,t,i){const o=e.split("|"),a=o[0],r=o[1];t&&this.emit("failedLoading",a,r,t),!t&&i&&this.store.addResourceBundle(a,r,i,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&i&&(this.state[e]=0);const c={};this.queue.forEach(d=>{Q2(d.loaded,[a],r),lj(d,e),t&&d.errors.push(t),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(f=>{c[f]||(c[f]={});const m=d.loaded[f];m.length&&m.forEach(g=>{c[f][g]===void 0&&(c[f][g]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(d=>!d.done)}read(e,t,i,o=0,a=this.retryTimeout,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:i,tried:o,wait:a,callback:r});return}this.readingCalls++;const c=(f,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(f&&m&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,i,o+1,a*2,r)},a);return}r(f,m)},d=this.backend[i].bind(this.backend);if(d.length===2){try{const f=d(e,t);f&&typeof f.then=="function"?f.then(m=>c(null,m)).catch(c):c(null,f)}catch(f){c(f)}return}return d(e,t,c)}prepareLoading(e,t,i={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Ne(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Ne(t)&&(t=[t]);const a=this.queueLoad(e,t,i,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(r=>{this.loadOne(r)})}load(e,t,i){this.prepareLoading(e,t,{},i)}reload(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}loadOne(e,t=""){const i=e.split("|"),o=i[0],a=i[1];this.read(o,a,"read",void 0,void 0,(r,c)=>{r&&this.logger.warn(`${t}loading namespace ${a} for language ${o} failed`,r),!r&&c&&this.logger.log(`${t}loaded namespace ${a} for language ${o}`,c),this.loaded(e,r,c)})}saveMissing(e,t,i,o,a,r={},c=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${i}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend?.create){const d={...r,isUpdate:a},f=this.backend.create.bind(this.backend);if(f.length<6)try{let m;f.length===5?m=f(e,t,i,o,d):m=f(e,t,i,o),m&&typeof m.then=="function"?m.then(g=>c(null,g)).catch(c):c(null,m)}catch(m){c(m)}else f(e,t,i,o,c,d)}!e||!e[0]||this.store.addResource(e[0],t,i,o)}}}const eg=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let e={};if(typeof n[1]=="object"&&(e=n[1]),Ne(n[1])&&(e.defaultValue=n[1]),Ne(n[2])&&(e.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const t=n[3]||n[2];Object.keys(t).forEach(i=>{e[i]=t[i]})}return e},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),kk=n=>(Ne(n.ns)&&(n.ns=[n.ns]),Ne(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),Ne(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),Sd=()=>{},uj=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{typeof n[t]=="function"&&(n[t]=n[t].bind(n))})},SO="__i18next_supportNoticeShown",dj=()=>typeof globalThis<"u"&&!!globalThis[SO],hj=()=>{typeof globalThis<"u"&&(globalThis[SO]=!0)},fj=n=>!!(n?.modules?.backend?.name?.indexOf("Locize")>0||n?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||n?.options?.backend?.backends&&n.options.backend.backends.some(e=>e?.name?.indexOf("Locize")>0||e?.constructor?.name?.indexOf("Locize")>0)||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some(e=>e?.projectId));class sc extends Xh{constructor(e={},t){if(super(),this.options=kk(e),this.services={},this.logger=zi,this.modules={external:[]},uj(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(Ne(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const i=eg();this.options={...i,...this.options,...kk(e)},this.options.interpolation={...i.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!fj(this)&&!dj()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),hj());const o=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?zi.init(o(this.modules.logger),this.options):zi.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=rj;const m=new yk(this.options);this.store=new mk(this.options.resources,this.options);const g=this.services;g.logger=zi,g.resourceStore=this.store,g.languageUtils=m,g.pluralResolver=new oj(m,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),f&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(g.formatter=o(f),g.formatter.init&&g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new Ck(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new cj(o(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",(v,...C)=>{this.emit(v,...C)}),this.modules.languageDetector&&(g.languageDetector=o(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=o(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new ph(this.services,this.options),this.translator.on("*",(v,...C)=>{this.emit(v,...C)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Sd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=(...m)=>this.store[f](...m)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...m)=>(this.store[f](...m),this)});const c=Fl(),d=()=>{const f=(m,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(g),t(m,g)};if(this.languages&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initAsync?d():setTimeout(d,0),c}loadResources(e,t=Sd){let i=t;const o=Ne(e)?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const a=[],r=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(f=>{f!=="cimode"&&a.indexOf(f)<0&&a.push(f)})};o?r(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>r(d)),this.options.preload?.forEach?.(c=>r(c)),this.services.backendConnector.load(a,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(c)})}else i(null)}reloadResources(e,t,i){const o=Fl();return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),i||(i=Sd),this.services.backendConnector.reload(e,t,a=>{o.resolve(),i(a)}),o}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&vO.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const i=this.languages[t];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const i=Fl();this.emit("languageChanging",e);const o=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,d)=>{d?this.isLanguageChangingTo===e&&(o(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,i.resolve((...f)=>this.t(...f)),t&&t(c,(...f)=>this.t(...f))},r=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const d=Ne(c)?c:c&&c[0],f=this.store.hasLanguageSomeTranslations(d)?d:this.services.languageUtils.getBestMatchFromCodes(Ne(c)?[c]:c);f&&(this.language||o(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector?.cacheUserLanguage?.(f)),this.loadResources(f,m=>{a(m,f)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?r(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(e),i}getFixedT(e,t,i){const o=(a,r,...c)=>{let d;typeof r!="object"?d=this.options.overloadTranslationOptionHandler([a,r].concat(c)):d={...r},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs,d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||o.keyPrefix);const f=this.options.keySeparator||".";let m;return d.keyPrefix&&Array.isArray(a)?m=a.map(g=>(typeof g=="function"&&(g=iy(g,{...this.options,...r})),`${d.keyPrefix}${f}${g}`)):(typeof a=="function"&&(a=iy(a,{...this.options,...r})),m=d.keyPrefix?`${d.keyPrefix}${f}${a}`:a),this.t(m,d)};return Ne(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=i,o}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=t.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const r=(c,d)=>{const f=this.services.backendConnector.state[`${c}|${d}`];return f===-1||f===0||f===2};if(t.precheck){const c=t.precheck(this,r);if(c!==void 0)return c}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||r(i,e)&&(!o||r(a,e)))}loadNamespaces(e,t){const i=Fl();return this.options.ns?(Ne(e)&&(e=[e]),e.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{i.resolve(),t&&t(o)}),i):(t&&t(),Promise.resolve())}loadLanguages(e,t){const i=Fl();Ne(e)&&(e=[e]);const o=this.options.preload||[],a=e.filter(r=>o.indexOf(r)<0&&this.services.languageUtils.isSupportedCode(r));return a.length?(this.options.preload=o.concat(a),this.loadResources(r=>{i.resolve(),t&&t(r)}),i):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const o=new Intl.Locale(e);if(o&&o.getTextInfo){const a=o.getTextInfo();if(a&&a.direction)return a.direction}}catch{}const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services?.languageUtils||new yk(eg());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const i=new sc(e,t);return i.createInstance=sc.createInstance,i}cloneInstance(e={},t=Sd){const i=e.forkResourceStore;i&&delete e.forkResourceStore;const o={...this.options,...e,isClone:!0},a=new sc(o);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(c=>{a[c]=this[c]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},i){const c=Object.keys(this.store.data).reduce((d,f)=>(d[f]={...this.store.data[f]},d[f]=Object.keys(d[f]).reduce((m,g)=>(m[g]={...d[f][g]},m),d[f]),d),{});a.store=new mk(c,o),a.services.resourceStore=a.store}if(e.interpolation){const d={...eg().interpolation,...this.options.interpolation,...e.interpolation},f={...o,interpolation:d};a.services.interpolator=new Ck(f)}return a.translator=new ph(a.services,o),a.translator.on("*",(c,...d)=>{a.emit(c,...d)}),a.init(o,t),a.translator.options=o,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const re=sc.createInstance();re.createInstance;re.dir;re.init;re.loadResources;re.reloadResources;re.use;re.changeLanguage;re.getFixedT;re.t;re.exists;re.setDefaultNamespace;re.hasLoadedNamespace;re.loadNamespaces;re.loadLanguages;const pj=(n,e,t,i)=>{const o=[t,{code:e,...i||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(o,"warn","react-i18next::",!0);ha(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...o):console?.warn&&console.warn(...o)},wk={},kO=(n,e,t,i)=>{ha(t)&&wk[t]||(ha(t)&&(wk[t]=new Date),pj(n,e,t,i))},wO=(n,e)=>()=>{if(n.isInitialized)e();else{const t=()=>{setTimeout(()=>{n.off("initialized",t)},0),e()};n.on("initialized",t)}},oy=(n,e,t)=>{n.loadNamespaces(e,wO(n,t))},Ak=(n,e,t,i)=>{if(ha(t)&&(t=[t]),n.options.preload&&n.options.preload.indexOf(e)>-1)return oy(n,t,i);t.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(e,wO(n,i))},mj=(n,e,t={})=>!e.languages||!e.languages.length?(kO(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(n,{lng:t.lng,precheck:(i,o)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,n))return!1}}),ha=n=>typeof n=="string",gj=n=>typeof n=="object"&&n!==null,yj=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,bj={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},xj=n=>bj[n],vj=n=>n.replace(yj,xj);let sy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:vj,transDefaultProps:void 0};const Cj=(n={})=>{sy={...sy,...n}},Sj=()=>sy;let AO;const kj=n=>{AO=n},wj=()=>AO,Aj={type:"3rdParty",init(n){Cj(n.options.react),kj(n)}},Oj=A.createContext();class Pj{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var tg={exports:{}},ng={};var Ok;function Tj(){if(Ok)return ng;Ok=1;var n=nO();function e(g,x){return g===x&&(g!==0||1/g===1/x)||g!==g&&x!==x}var t=typeof Object.is=="function"?Object.is:e,i=n.useState,o=n.useEffect,a=n.useLayoutEffect,r=n.useDebugValue;function c(g,x){var v=x(),C=i({inst:{value:v,getSnapshot:x}}),k=C[0].inst,w=C[1];return a(function(){k.value=v,k.getSnapshot=x,d(k)&&w({inst:k})},[g,v,x]),o(function(){return d(k)&&w({inst:k}),g(function(){d(k)&&w({inst:k})})},[g]),r(v),v}function d(g){var x=g.getSnapshot;g=g.value;try{var v=x();return!t(g,v)}catch{return!0}}function f(g,x){return x()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return ng.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:m,ng}var Pk;function Dj(){return Pk||(Pk=1,tg.exports=Tj()),tg.exports}var Mj=Dj();const Nj=(n,e)=>ha(e)?e:gj(e)&&ha(e.defaultValue)?e.defaultValue:Array.isArray(n)?n[n.length-1]:n,Lj={t:Nj,ready:!1},Rj=()=>()=>{},Ce=(n,e={})=>{const{i18n:t}=e,{i18n:i,defaultNS:o}=A.useContext(Oj)||{},a=t||i||wj();a&&!a.reportNamespaces&&(a.reportNamespaces=new Pj),a||kO(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const r=A.useMemo(()=>({...Sj(),...a?.options?.react,...e}),[a,e]),{useSuspense:c,keyPrefix:d}=r,f=o||a?.options?.defaultNS,m=ha(f)?[f]:f||["translation"],g=A.useMemo(()=>m,m);a?.reportNamespaces?.addUsedNamespaces?.(g);const x=A.useRef(0),v=A.useCallback(U=>{if(!a)return Rj;const{bindI18n:z,bindI18nStore:X}=r,H=()=>{x.current+=1,U()};return z&&a.on(z,H),X&&a.store.on(X,H),()=>{z&&z.split(" ").forEach(V=>a.off(V,H)),X&&X.split(" ").forEach(V=>a.store.off(V,H))}},[a,r]),C=A.useRef(),k=A.useCallback(()=>{if(!a)return Lj;const U=!!(a.isInitialized||a.initializedStoreOnce)&&g.every(oe=>mj(oe,a,r)),z=e.lng||a.language,X=x.current,H=C.current;if(H&&H.ready===U&&H.lng===z&&H.keyPrefix===d&&H.revision===X)return H;const ie={t:a.getFixedT(z,r.nsMode==="fallback"?g:g[0],d),ready:U,lng:z,keyPrefix:d,revision:X};return C.current=ie,ie},[a,g,d,r,e.lng]),[w,P]=A.useState(0),{t:T,ready:M}=Mj.useSyncExternalStore(v,k,k);A.useEffect(()=>{if(a&&!M&&!c){const U=()=>P(z=>z+1);e.lng?Ak(a,e.lng,g,U):oy(a,g,U)}},[a,e.lng,g,M,c,w]);const D=a||{},L=A.useRef(null),N=A.useRef(),j=U=>{const z=Object.getOwnPropertyDescriptors(U);z.__original&&delete z.__original;const X=Object.create(Object.getPrototypeOf(U),z);if(!Object.prototype.hasOwnProperty.call(X,"__original"))try{Object.defineProperty(X,"__original",{value:U,writable:!1,enumerable:!1,configurable:!1})}catch{}return X},K=A.useMemo(()=>{const U=D,z=U?.language;let X=U;U&&(L.current&&L.current.__original===U?N.current!==z?(X=j(U),L.current=X,N.current=z):X=L.current:(X=j(U),L.current=X,N.current=z));const H=[T,X,M];return H.t=T,H.i18n=X,H.ready=M,H},[T,D,M,D.resolvedLanguage,D.language,D.languages]);if(a&&c&&!M)throw new Promise(U=>{const z=()=>U();e.lng?Ak(a,e.lng,g,z):oy(a,g,z)});return K},OO="ccs-ui-locale",Ej=["en","zh-CN","vi","ja"];function Qc(n){return n?n.toLowerCase().startsWith("ja")?"ja":n.toLowerCase().startsWith("zh")?"zh-CN":n.toLowerCase().startsWith("vi")?"vi":"en":"en"}function PO(){if(typeof window>"u")return null;try{const n=window.localStorage.getItem(OO);return n?Qc(n):null}catch{return null}}function jj(){const n=PO();return n||(typeof navigator<"u"?Qc(navigator.language):"en")}function Sb(n){const e=PO();return e||(typeof navigator<"u"?Qc(navigator.language):"en")}function Ij(n){const e=Qc(n);if(typeof window<"u")try{window.localStorage.setItem(OO,e)}catch{}return e}const Bj={en:{translation:{locale:{en:"English","zh-CN":"Simplified Chinese",vi:"Vietnamese",ja:"Japanese"},layout:{languageSwitcher:"Language"},nav:{general:"General",home:"Home",analytics:"Analytics",identityAccess:"Identity & Access",apiProfiles:"Profiles",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"Overview",controlPanel:"Control Panel",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",claudeExtension:"Claude Extension",accounts:"Accounts",allAccounts:"All Accounts",sharedData:"Shared Resources",compatibleClis:"Compatible",deprecated:"Deprecated",factoryDroid:"Factory Droid",system:"System",health:"Health",logs:"Logs",settings:"Settings",openrouterTooltip:"Featured: OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"Profiles",cliproxy:"CLIProxy",accounts:"Accounts",health:"Health",configurationRequired:"Configuration Required"},auth:{dashboardTitle:"CCS Dashboard",protectedAccessLabel:"Protected access",remoteGuardLabel:"Remote access guard",loading:"Checking dashboard access…",loginDescription:"Use the username and password configured for this CCS instance to access the dashboard.",username:"Username",password:"Password",usernamePlaceholder:"Enter username",passwordPlaceholder:"Enter password",signIn:"Sign In",signingIn:"Signing in...",loginFailed:"Login failed",lightMode:"Light",darkMode:"Dark",noDefaultCredentials:"No default credentials ship with CCS.",credentialsHint:"Credentials are created with `ccs config auth setup` on the CCS host. Docker deployments must run that command inside the container.",remoteSetupTitle:"Remote access needs auth setup",remoteSetupDescription:"This dashboard was opened from a non-local address, but dashboard auth is not enabled for this CCS instance yet.",incompleteSetupDescription:"Dashboard auth is turned on, but the setup is incomplete. Finish the configuration for this CCS instance before signing in.",safetyNoteRemote:"Remote management stays locked until the CCS host owner enables dashboard auth.",safetyNoteLocal:"If you are on the same machine, the localhost URL remains the simplest path in.",safetyNoteSession:"Successful sign-ins create an HTTP-only session that stays scoped to this dashboard host.",hostStepTitle:"On the CCS host",hostStepDescription:"Create or re-enable dashboard credentials, then reopen this page from the remote device.",dockerStepDescription:"Docker deployment? Run the setup inside the running container:",localStepTitle:"If this is your machine",localStepDescription:"Open the localhost URL printed by `ccs config` instead of the LAN or Tailscale address.",showPassword:"Show password",hidePassword:"Hide password"},commonToast:{apiKeyRequired:"API key is required",accountAddedPresetFailed:"Account added, but failed to apply default preset",settingsCopied:"Settings copied to clipboard",enterPresetName:"Please enter a preset name to save",codeCopied:"Code copied to clipboard",copyCodeFailed:"Failed to copy code",appliedModelAllTiers:"Applied model to all tiers",settingsSaved:"Settings saved",defaultTargetUpdated:"Default target updated",failedUpdateDefaultTarget:"Failed to update default target to {{target}}{{suffix}}",resourcesUpdated:"Shared resources updated"},profileDialog:{editTitle:"Edit Profile",createTitle:"Create API Profile",name:"Name",namePlaceholder:"my-api",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API Key",defaultModel:"Default Model (ANTHROPIC_MODEL)",defaultModelHint:"Leave blank to use: {{model}}",modelMappingTitle:"Model Mapping (Opus/Sonnet/Haiku)",modelMappingDesc:"Configure different model IDs for each tier. Useful for API proxies that route different model types to different backends.",opusModel:"Opus Model (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet Model (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku Model (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"Cancel",saving:"Saving...",update:"Update",create:"Create"},modelTierMapping:{title:"Model Tier Mapping",advanced:"Advanced",description:"Configure different models for Claude Code's opus/sonnet/haiku tiers.",autoSuggest:"Auto-suggest based on {{provider}}",opusPlaceholder:"e.g., anthropic/claude-opus-4",sonnetPlaceholder:"e.g., anthropic/claude-sonnet-4",haikuPlaceholder:"e.g., anthropic/claude-3.5-haiku",footer:"These set ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL."},envEditor:{sensitive:"sensitive",none:"No environment variables configured.",noneHint:"Add variables using the input below or edit the JSON directly.",addVariable:"Add Environment Variable",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"value"},setupVariant:{using:"Using:",variantNameRequired:"Runtime Variant Name *",variantNamePlaceholder:"e.g., my-gemini, g3, flash",invokeHintPrefix:"Run with this variant:",model:"Model",modelPlaceholder:"e.g., gemini-2.5-pro, claude-opus-4-6-thinking",choosePresetInstead:"Choose from presets instead",selectModel:"Select a model",customModelName:"Custom model name...",enterAnyModel:"Enter any model name supported by CLIProxy",defaultModel:"Default: {{model}}",providerDefault:"provider default",back:"Back",skip:"Skip",creating:"Creating...",createVariant:"Create Variant",skipHint:"Skip if account setup is enough and you do not need a separate runtime variant"},customPresetDialog:{title:"Custom Preset",presetNameOptional:"Preset Name (optional)",presetNamePlaceholder:"e.g., My Custom Config",codexTipPrefix:"Codex tip: suffixes",codexTipSuffix:"pin effort. Unsuffixed models use Thinking settings.",defaultModel:"Default Model",defaultModelDesc:"Used when no specific tier is requested",opusModel:"Opus (Most capable)",opusModelDesc:"For complex reasoning tasks",sonnetModel:"Sonnet (Balanced)",sonnetModelDesc:"Balance of speed and capability",haikuModel:"Haiku (Fast)",haikuModelDesc:"Quick responses for simple tasks",cancel:"Cancel",savePreset:"Save Preset",applyPreset:"Apply Preset",deletePreset:"Delete Preset"},componentModelSelector:{selectModel:"Select model",availableModelsCount:"Available Models ({{count}})",preview:"Preview"},searchableSelect:{searchModels:"Search models...",noResults:"No results found."},copilotSettings:{enableCopilot:"Enable Copilot",enableCopilotDesc:"Allow using GitHub Copilot subscription",basicSettings:"Basic Settings",accountType:"Account Type",accountTypeIndividual:"Individual",accountTypeBusiness:"Business",accountTypeEnterprise:"Enterprise",rateLimiting:"Rate Limiting",rateLimitSeconds:"Rate Limit (seconds)",noLimit:"No limit",waitOnRateLimit:"Wait on Rate Limit",waitOnRateLimitDesc:"Wait instead of error when limit hit",daemonSettings:"Daemon Settings",autoStartDaemon:"Auto-start Daemon",autoStartDaemonDesc:"Start copilot-api when using profile"},providerModelSelector:{selectModel:"Select model",noModelsForProvider:"No models available for this provider",broken:"BROKEN",deprecated:"DEPRECATED",paid:"PAID",freeTier:"Free Tier",paidTier:"Paid Tier",modelKnownIssues:"This model has known issues",viewIssueDetails:"View issue details",modelDeprecated:"This model is deprecated",recommended:"Recommended",allModelsCount:"All Models ({{count}})",noModelsAvailable:"No models available",shadowed:"Shadowed",prefixOnly:"Prefix only",current:"Current",currentValue:"Current value",preferredPinnedModel:"Preferred pinned model:",pinnedRouteStatus:"Pinned route status:",pinnedModelNotAdvertised:"Pinned model is not currently advertised by the proxy: {{model}}"},createAuthProfileDialog:{title:"Create New Account",description:"Auth profiles require Claude CLI login. Run the command below in your terminal. You can edit sync mode, group, and continuity depth later from the Accounts table.",profileName:"Profile Name",profileNamePlaceholder:"e.g., work, personal, client",invalidProfileName:"Name must start with a letter and contain only letters, numbers, dashes, or underscores.",enableSharedHistory:"Enable shared history sync with other ccs auth accounts",historySyncGroupOptional:"History Sync Group (optional)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"Leave empty to use the default shared group. Spaces are normalized to dashes.",deeperContinuity:"Advanced: deeper continuity mode",deeperContinuityHint:"Adds sync for session-env, file-history, shell-snapshots, and todos. Credentials stay isolated.",invalidContextGroup:"Group must start with a letter and use only letters, numbers, dashes, or underscores (max {{max}} chars).",command:"Command",commandFallback:"ccs auth create <name>",afterRunPrefix:"After running the command:",afterRunStep1:"Complete the Claude login in your browser",afterRunStep2:"Return here and refresh to see the new account",poolingHint:"Prefer pooled Claude OAuth routing instead? Use CLIProxy Claude pool from the Accounts page action button.",close:"Close",copied:"Copied!",copyCommand:"Copy Command"},accountRouteGuide:{title:"Recommended two-account route",description:"Use separate account profiles for token isolation. Turn on history sync only when both accounts should see the same local continuity.",status:{empty:"create accounts",isolated:"isolated ready",shared:"shared project context",deeper:"deeper sync ready",mixed:"mixed setup"},cards:{isolated:{title:"Tokens stay separate",desc:"Each ccs auth account owns its own Claude config, login, and credentials. Sync settings never copy tokens."},select:{title:"You choose the account",desc:"Run ccs work or ccs personal for explicit usage. Set Default only when plain ccs should follow one account."},settings:{title:"Settings follow root",desc:"Non-bare accounts link settings.json through CCS shared state to ~/.claude/settings.json. ccs auth show confirms it."},sync:{title:"History sync is opt-in",desc:"Both accounts need Shared mode and the same group. Deeper sync adds extra local continuity artifacts."}},commands:{isolated:"Isolated account usage",sync:"Optional shared history",syncDesc:'Use the same group, such as "{{group}}", on both accounts when you want them to share local history.'}},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"Other"},cliproxyOverviewComponents:{availableModels:"Available Models",noModelsAvailable:"No models available",startSessionHint:"Start a CLIProxy session to fetch available models",totalCount:"{{count}} total",availableThroughGroupedByProvider:"Models available through {{backendLabel}}, grouped by provider",moreCount:"+{{count}} more"},categorizedModelSelector:{selectModel:"Select a model",noModelsAvailable:"No models available",modelPlaceholder:"Model..."},openrouterQuickStart:{recommended:"Recommended",title:"Start with OpenRouter",description:"Access {{modelCountLabel}} models from OpenAI, Anthropic, Google, Meta and more - all through one API.",featureOneApi:"One API, all providers",profileSummaryCount:"{{count}} profile",profileSummaryCount_other:"{{count}} profiles",profileSummaryEmpty:"Premium quality + local control",summaryBadgeDefaultQuality:"Best quality by default",summaryBadgeLocalLane:"Local lane when task fit wins",summaryExistingTitle:"Choose a profile or add another lane",summaryEmptyTitle:"Choose your first profile lane",summaryExistingDescription:"You already have {{count}} profile in this workspace. Keep premium-quality providers for serious coding and add local runtimes when privacy, cost, or offline work matters.",summaryExistingDescription_other:"You already have {{count}} profiles in this workspace. Keep premium-quality providers for serious coding and add local runtimes when privacy, cost, or offline work matters.",summaryEmptyDescription:"Pick the lane that matches the work. Premium providers stay the default for reliable coding. Local runtimes are best for privacy, cheaper transforms, and experimentation.",qualityLanesTitle:"Best quality lanes",qualityLaneHighlightDefaultQuality:"Best default lane for high-stakes coding quality",alibabaLaneDescription:"Strong direct coding profile when you want a dedicated premium lane outside the OpenRouter catalog.",alibabaLaneHighlightQuality:"Good when you want premium quality with a dedicated endpoint",localRuntimesTitle:"Local runtimes",localOllamaTitle:"Ollama + Gemma 4",localOllamaLabel:"Ollama",localOllamaHighlight:"Best for private prompts, local cleanup, and cheap batch transforms",localLlamacppTitle:"llama.cpp",localLlamacppLabel:"llama.cpp",localLlamacppHighlight:"Best for custom GGUF setups and advanced self-hosted local workflows",localDetectedModels:"{{count}} local model detected",localDetectedModels_other:"{{count}} local models detected",localNoModelsDetected:"No local models detected yet",localWaitingServer:"Waiting for a local server and model list",localRuntimeCheckingBadge:"Checking",localRuntimeReadyBadge:"Ready",localRuntimeNeedsModelBadge:"Needs model",localRuntimeOfflineBadge:"Offline",localRuntimeCheckingDescription:"Checking the local runtime status before showing setup guidance.",localRuntimeReadyDescription:"Best for private prompts, offline workflows, and cheaper batch transforms.",localRuntimeNeedsModelDescription:"The runtime is up, but the recommended local model still needs to be pulled or loaded.",localRuntimeOfflineDescription:"Use this lane for privacy-sensitive work, cheap local transforms, and offline sessions.",localRuntimeCheckingFooter:"Checking the local runtime...",localRuntimeReadyFooter:"Endpoint ready at {{endpoint}}",localRuntimeMissingModelFooter:"Run `{{command}}` to finish local setup.",localRuntimeOfflineFooter:"Run `{{command}}` to bring the local endpoint online.",localRuntimeSetupAction:"Set up {{label}}",localRuntimeUseAction:"Use {{label}}",localRuntimeFinishAction:"Finish {{label}} setup",runtimeProviderBadge:"Runtime provider setup",runtimeProviderTitle:"Open AI Providers",runtimeProviderManagedDescription:"Use this when you need CLIProxy-managed connectors, provider secrets, and advanced routing controls.",runtimeProviderFeatureConnectors:"Gemini, Codex, Claude, Vertex, and OpenAI-compatible connectors",runtimeProviderFeatureSecrets:"Shared secrets stay outside individual API profiles",runtimeProviderFooter:"Best when multiple profiles should share one provider configuration.",createOpenRouterProfile:"Create OpenRouter Profile",getApiKeyAt:"Get your API key at",createCustomProfile:"Create Custom API Profile"},alibabaCodingPlanQuickStart:{recommended:"Recommended",title:"Try Alibaba Coding Plan",description:"Use Alibaba Cloud Coding Plan through an Anthropic-compatible endpoint for coding workloads.",featureEndpoint:"Anthropic-compatible endpoint",featureKeyFormat:"Dedicated sk-sp API keys",createAlibabaProfile:"Create Alibaba Coding Plan Profile",readGuideAt:"Read setup guide at"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Model Studio Coding Plan via Anthropic endpoint",add:"Add"},credentialHealth:{title:"Credential Health",ready:"Ready",noCredentialsConfigured:"No credentials configured. Use the login buttons above to authenticate.",neverUsed:"Never used",justNow:"Just now",unknown:"Unknown",daysAgo:"{{count}}d ago",hoursAgo:"{{count}}h ago",minutesAgo:"{{count}}m ago"},proxyStatusWidget:{justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",syncReady:"Sync Ready",noConfig:"No Config",remoteProxy:"Remote Proxy",active:"Active",trafficAutoRouted:"Traffic auto-routed to remote server",tooltipSync:"Sync profiles to CLIProxy",tooltipRestart:"Restart",tooltipStop:"Stop",tooltipClose:"Close",tooltipVersionSettings:"Version settings",versionManagement:"Version Management",selectVersionPlaceholder:"Select version to install...",stable:"(stable)",install:"Install",versionsAboveUnstable:"Versions above {{version}} have known issues",versionsKnownIssues:"Version {{version}} has known issues",lastChecked:"Last checked {{time}}",notRunning:"Not running",start:"Start",port:"Port {{port}}",sessionCount:"{{count}} session",sessionCount_other:"{{count}} sessions",installFaultyTitle:"Install Version With Known Issues?",installFaultyDesc:"You are about to install <strong>v{{version}}</strong>, which falls inside the known faulty range <strong>{{range}}</strong>.",installFaultyWarning:"This version has known bugs and may fail or leave the proxy in a bad state.",installUnstableTitle:"Install Unstable Version?",installUnstableDesc:"You are about to install <strong>v{{version}}</strong>, which is above the maximum stable version <strong>v{{maxStable}}</strong>.",installUnstableWarning:"This version has known stability issues and may cause unexpected behavior.",installUnstableConfirm:"Are you sure you want to proceed?",cancel:"Cancel",installAnyway:"Install Anyway",clickToDowngrade:"Click to downgrade",clickToUpdate:"Click to update"},syncStatusCard:{profileSync:"Profile Sync",ready:"Ready",noConfig:"No Config",syncsProfilesDesc:"Syncs API profiles to local CLIProxy config",runDoctorHint:"Run <code>ccs doctor --fix</code> to generate config.",details:"Details",syncNow:"Sync Now"},syncDialog:{title:"Sync Profiles to Local CLIProxy",description:"Sync your CCS API profiles to the local CLIProxy config.yaml.",noProfiles:"No profiles configured to sync.",createProfilesFirst:"Create API profiles first using the Profiles tab.",modelLabel:"Model:",ready:"Ready",profilesToSync_one:"{{count}} profile to sync",profilesToSync_other:"{{count}} profiles to sync",cancel:"Cancel",syncing:"Syncing...",synced:"Synced!",syncNow:"Sync Now"},errorLogs:{title:"Error Logs",failedRequests_one:"{{count}} failed request",failedRequests_other:"{{count}} failed requests",cliproxyDiagnostics:"CLIProxy Diagnostics",showingCount:"Showing 50 of {{total}} logs",selectLog:"Select a log to view details",failedLoadContent:"Failed to load log content",copyAbsolutePath:"Copy absolute path",copyRawContent:"Copy raw log content",tabOverview:"Overview",tabHeaders:"Headers",tabRequest:"Request",tabResponse:"Response",tabRaw:"Raw",modelLabel:"Model:",quotaResetsIn:"Quota resets in ",method:"Method",provider:"Provider",version:"Version",endpoint:"Endpoint",url:"URL",timestamp:"Timestamp",na:"N/A",noHeaders:"No headers available",noRequestBody:"No request body",noResponseBody:"No response body",rateLimitedMsg:"Rate Limited. Switch to a different account or wait for quota reset. Model {{model}} has exhausted quota.",rateLimitedMsgNoModel:"Rate Limited. Switch to a different account or wait for quota reset.",authFailedMsg:"Authentication failed. Re-authenticate via CLIProxy Settings or check API key.",notFoundMsg:"Endpoint not found. This endpoint may not exist on this provider.",serverErrorMsg:"Server error from upstream. Retry later or check provider status page.",timeoutMsg:"Request timed out. Check network connection or increase timeout settings.",unknown:"unknown"},editAccountContext:{title:"Edit History Sync",description:'Configure how "{{name}}" shares history and continuity with other ccs auth accounts.',syncMode:"Sync Mode",selectContextMode:"Select context mode",isolatedOption:"Isolated",sharedOption:"Shared",sharedModeHint:"Reuses workspace context across accounts in the same history group.",isolatedModeHint:"Keeps this account fully separate from other ccs auth accounts.",historySyncGroup:"History Sync Group",groupPlaceholder:"default",groupHint:"Normalized to lowercase (spaces become dashes). Allowed: letters, numbers, _ , - (max {{max}} chars).",invalidGroup:"Enter a valid group name that starts with a letter.",continuityDepth:"Continuity Depth",selectContinuityDepth:"Select continuity depth",standardOption:"Standard",deeperOption:"Deeper",deeperHint:"Syncs comprehensive session-env, file-history, shell-snapshots, and todos.",standardHint:"Standard mode syncs project workspace context only.",credentialsIsolated:"Credentials and .anthropic remain isolated per account in all modes.",implicationTitle:"What this means after save",isolatedImplication:"This account stays separate. Other accounts will not be able to resume its continuity state.",sameGroupRule:'Accounts must use the same group "{{group}}" before they can share continuity with each other.',noSameGroupPeer:"No other account currently shares this group.",sameGroupPeerCount_one:"{{count}} other account already shares this group.",sameGroupPeerCount_other:"{{count}} other accounts already share this group.",deeperReady_one:"{{count}} same-group account already uses deeper continuity. This is the strongest available handoff setup.",deeperReady_other:"{{count}} same-group accounts already use deeper continuity. This is the strongest available handoff setup.",deeperNeedsPeers:"Deeper continuity is enabled here, but another account in this group still needs deeper continuity for stronger cross-account resume expectations.",standardWarning:"Standard shared mode is good for project context only. Cross-account resume expectations are stronger when both accounts use deeper continuity.",resumeOriginalWarning:"If the old conversation matters, resume it from the original account before you change the setup.",cancel:"Cancel",save:"Save",saving:"Saving..."},historySyncLearningMap:{title:"How History Sync Works",description:"Isolated -> Shared -> Deeper. Cross-account resume needs the same group on both accounts.",learningMap:"Learning Map",isolated:"Isolated",shared:"Shared",deeper:"Deeper",cliproxyManaged_one:"{{count}} CLIProxy Claude pool account is managed in Action Center / CLIProxy page.",cliproxyManaged_other:"{{count}} CLIProxy Claude pool accounts are managed in Action Center / CLIProxy page.",showDetails:"Show details: groups, switching, and legacy policy",modeSwitch:"Mode Switch",modeSwitchDesc:"Use Sync on each account to move between isolated/shared and choose deeper continuity.",historySyncGroup:"History Sync Group",historySyncGroupDesc:"Same group is required before accounts can share continuity. Default fallback is default.",sameGroupRule:"Right now, accounts only share continuity when both are shared in the same group.",deeperRecommendation:'Group "{{group}}" is shared, but deeper continuity is still the safer choice if users expect cross-account resume.',partialGroup:'Group "{{group}}" is in good shape, but other accounts or groups still need the same-group or deeper setup.',readyGroup:'Group "{{group}}" already has deeper continuity on multiple accounts. This is the strongest available handoff setup.',legacyConfirmation_one:"{{count}} legacy account still needs explicit confirmation.",legacyConfirmation_other:"{{count}} legacy accounts still need explicit confirmation."},continuityReadiness:{title:"Cross-Account Resume Check",description:"Use this card to see what is missing before users switch accounts.",state:{single:"single account",isolated:"resume off","shared-alone":"shared but incomplete","shared-standard":"projects only",partial:"partially ready",ready:"stronger handoff ready"},metrics:{isolated:"Isolated",sharedPeers:"Shared With Peer",deeperReady:"Deeper Ready"},messages:{single:{title:"Only one auth account is configured.",description:"Cross-account handoff does not apply yet. Add another auth account before configuring shared continuity."},isolated:{title:"Cross-account resume is off right now.",description:"All visible accounts are isolated, so a session created in one account will stay with that account."},"shared-alone":{title:"Shared mode exists, but no group has a peer yet.",description_one:"{{count}} shared account is still waiting for another account in the same group.",description_other:"{{count}} shared accounts are still waiting for another account in the same group."},"shared-standard":{title:'Group "{{group}}" shares project context, but deeper continuity is not paired yet.',description:"Users may still expect more than project sharing. Enable deeper continuity on both accounts in this group for stronger handoff expectations."},partial:{title:"One group is ready, but the overall setup is still mixed.",description:"At least one group already uses deeper continuity, but other accounts are still isolated, alone in a shared group, or missing deeper continuity."},ready:{title:'Group "{{group}}" has the strongest available continuity setup.',description:"Multiple accounts in this group already use deeper continuity. Resume behavior still depends on what Claude stores upstream."}},stepsTitle:"What users should do next",steps:{syncBoth:"Open Sync on both accounts, not just the one you are switching into.",sameGroup:'Use the same History Sync Group on both accounts. "{{group}}" is the current recommended group.',enableDeeper:"If users expect cross-account resume instead of project-only sharing, turn on deeper continuity on both accounts.",resumeOriginal:"If the original conversation is important, resume it from the original account before changing continuity settings."},singleSteps:{addAccount:"Create a second ccs auth account before planning any cross-account handoff.",sameGroupLater:"When that second account exists, put both accounts in the same History Sync Group.",enableDeeperLater:"If users will expect cross-account resume instead of project-only sharing, enable deeper continuity on both accounts.",resumeOriginal:"If the original conversation is important, keep resuming it from the original account until the second account is ready."}},continuityOverview:{plainLaneTitle:"Plain ccs is using a different resume lane",plainLaneDescription:"Plain ccs currently resumes from {{lane}}, not this account lane. Recover the original lane first before changing sync settings.",setDefaultHint:"Use the Set Default action on the account you want plain ccs to follow in future sessions.",recommendBadge:"Recommend {{group}}",partialBadge:"Partial sync {{group}}",lane:{native:"native Claude (~/.claude)",accountDefault:"account {{name}}",accountInherited:"account {{name}} via continuity inheritance",profileDefault:"default profile {{name}} via native Claude lane"}},accountsTable:{name:"Name",type:"Type",defaultBadge:"default",created:"Created",lastUsed:"Last Used",historySync:"History Sync",sharedResources:"Resources",actions:"Actions",syncTitle:"Edit sync mode, group, and continuity depth",resourcesTitle:"Edit shared resource inheritance",confirmLegacyTitle:"Confirm this legacy account's current mode as explicit",sync:"Sync",confirm:"Confirm",active:"Active",setDefault:"Set Default",deleteAccount:"Delete account",cannotDeleteDefault:"Cannot delete default account",noAccounts:"No CCS auth accounts found. Use ccs auth create to add accounts.",resetToDefault:"Reset to CCS Default",deleteDialogTitle:"Delete Account",deleteDialogDesc:'Are you sure you want to delete the account "{{name}}"? This will remove the profile and all its session data. This action cannot be undone.',cancel:"Cancel",delete:"Delete",sharedGroupStandard:"shared ({{group}}, projects only)",sharedGroupDeeper:"shared ({{group}}, deeper continuity)",sharedGroupLegacy:"shared ({{group}}, projects only, legacy)",isolatedLegacy:"isolated (legacy default)",isolated:"isolated",resourcesShared:"shared",resourcesProfileLocal:"profile-local",noSameGroupPeer:"No same-group peer yet",sameGroupPeerCount_one:"{{count}} same-group peer",sameGroupPeerCount_other:"{{count}} same-group peers",legacyReview:"Review and confirm this inferred default.",noHandoff:"Cross-account resume stays in the original account.",badges:{shared:"Shared",deeper:"Deeper",legacy:"Legacy",isolated:"Isolated",profileLocal:"Local"}},addAccountDialog:{title:"Add {{displayName}} Account",descKiro:"Choose a Kiro auth method, then authenticate via browser or import from Kiro IDE.",descDeviceCode:"Click Authenticate. A verification code will appear for you to enter on the provider website.",descOauth:"Click Authenticate to get an OAuth URL. Open it in any browser to sign in.",powerUserEnabled:"Power user mode enabled",powerUserSkipped:"Settings > Proxy power user mode is skipping the AGY responsibility checklist and Gemini dashboard risk phrase. You accept full responsibility for OAuth/account risk.",powerUserLoadFailed:"Failed to load power user mode settings. Check Settings > Proxy and try again.",powerUserLoading:"Loading power user safety settings. Please wait a moment and retry.",powerUserUnavailableRetry:"Power user mode is unavailable. Complete the required provider safety step and retry.",authMethod:"Auth Method",selectKiroAuthMethod:"Select Kiro auth method",gitlabAuthMethod:"GitLab auth method",selectGitlabAuthMethod:"Select GitLab auth method",gitlabAuthOAuth:"Browser OAuth",gitlabAuthPat:"Personal Access Token",gitlabAuthHint:"Use Browser OAuth for gitlab.com, or PAT for self-hosted and admin-managed setups.",gitlabUrl:"GitLab URL",gitlabUrlPlaceholder:"https://gitlab.com",gitlabUrlHint:"Optional. Leave blank for gitlab.com, or set your self-hosted GitLab base URL.",gitlabPat:"Personal Access Token",gitlabPatPlaceholder:"glpat-...",gitlabPatHint:"Token must include at least",gitlabPatRequired:"GitLab Personal Access Token is required for PAT login.",nicknameRequired:"Nickname (required)",nicknameOptional:"Nickname (optional)",nicknamePlaceholder:"e.g., work, personal",nicknameRequiredHint:"Required for this provider. Use a unique friendly name (e.g., work, personal).",nicknameOptionalHint:"A friendly name to identify this account. Leave blank to use a safe generated identifier.",waitingForAuth:"Waiting for authentication...",deviceCodeHint:"A verification code dialog will appear shortly. Enter the code on the provider website.",browserHint:"Complete the authentication in your browser. This dialog closes automatically.",openUrlLabel:"Open this URL in any browser to sign in:",copied:"Copied",copy:"Copy",open:"Open",popupBlocked:"Popup blocked. Copy the URL above and open it manually in your browser.",redirectPasteLabel:"Redirect didn't work? Paste the callback URL:",callbackPlaceholder:"Paste the redirect URL here...",submitCallback:"Submit Callback",submitting:"Submitting...",preparingUrl:"Preparing sign-in URL...",cancel:"Cancel",importingToken:"Importing token from Kiro IDE...",authenticate:"Authenticate",importFromIde:"Import from IDE",importing:"Importing..."},flowViz:{backToProviders:"Back to providers",showDetails:"Show Details",hideDetails:"Hide Details",showPausedAccounts:"Show Paused ({{count}})",hidePausedAccounts:"Hide Paused ({{count}})",visibleTotalRequests:"Visible Requests",visibleAccounts:"Visible Accounts",excludingPausedAccounts:"Excluding {{count}} paused",resetLayout:"Reset layout",provider:"Provider",totalRequests:"Total Requests",accounts:"Accounts",connectionTimeline:"Connection Timeline",noRecentConnections:"No recent connections"},quickStats:{totalRequests:"Total Requests",successRate:"Success Rate",totalTokens:"Total Tokens",activeModels:"Active Models"},authMonitor:{accounts:"Accounts",accountsCount:"{{count}} accounts",success:"Success",failed:"Failed",successRate:"Success Rate"},accountCard:{resumeAccount:"Resume account",pauseAccount:"Pause account",quotaLoading:"Quota...",quota:"Quota",quotaUnavailable:"Quota limits unavailable",reauthNeeded:"Reauth needed",failureLabelReauth:"Reauth",failureLabelWorkspace:"Workspace",failureLabelNoAccess:"No Access",failureLabelRetry:"Retry",failureLabelReconnect:"Reconnect",failureLabelTemporary:"Temporary",failureLabelUnavailable:"Unavailable",failureHintReauth:"Refresh this account by running its auth flow again.",failureHintWorkspace:"Move this account back to an active workspace, then remove and re-add it.",failureHintNoAccess:"This account cannot access the provider quota endpoint.",failureHintRetry:"Wait a bit, then retry the quota request.",failureHintReconnect:"Remove the stale account and authenticate it again.",failureHintTemporary:"Retry later. This looks temporary.",removeAndReadd:"Remove and re-add account",autoRefreshFailed:"Auto-refresh failed"},antigravityChecklist:{title:"Antigravity OAuth Responsibility",subtitle:"Complete all 4 steps before you can authenticate.",mandatory:"Mandatory",completion:"Completion",stepsCount:"{{current}}/4 steps"},accountSafetyWarning:{title:"OAuth Account Safety Warning",subtitle:"Issue #509 · Gemini + AGY OAuth risk",firstLine:"Issue #509 documents suspension/ban reports tied to ccs agy and shared-account usage between ccs gemini and ccs agy.",secondLine:"Continue only if you accept full responsibility for OAuth and account-access risk.",issueLabel:"Read issue #509",proxySettingsLabel:"Gemini + AGY controls: Settings > Proxy"},cliproxyDialog:{name:"Name",provider:"Provider",account:"Account",accountOptional:"Account (optional)",model:"Model",modelOptional:"Model (optional)",defaultTarget:"Default Target",defaultTier:"Default Tier",tierConfig:"Tier Configuration",selectProvider:"Select provider...",useDefaultAccount:"Use default account",defaultSuffix:"(default)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"Cancel",create:"Create",creating:"Creating...",saveChanges:"Save Changes",saving:"Saving...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"Edit Composite Variant: {{name}}",editSingleTitle:"Edit Single Variant: {{name}}"},profileEditor:{profileInfo:"Profile Information",profileName:"Profile Name",filePath:"File Path",lastModified:"Last Modified",defaultTarget:"Default Target",quickUsage:"Quick Usage",runWithProfile:"Run with profile",runOnDroid:"Run on Droid",runOnDroidWithFlag:"Run on Droid (--target)",droidAliasExplicit:"Droid alias (explicit)",overrideToClaude:"Override to Claude",overrideToClaudeExplicit:"Override to Claude (explicit)",targetHintPreferredAlias:"Preferred explicit alias:",targetHintClaudeDefault:"Default command:",targetHintLegacyAlias:"Legacy shortcut still works:",targetHintOverride:"You can still override each run with",setAsDefault:"Set as default",provider:"Provider",custom:"Custom",providerChooserHint:"Start with a preset, then adjust the URL, API key, or model mapping as needed.",featuredProviders:"Featured Providers",scrollHint:"Scroll if your screen is narrow",customEndpoint:"Custom Endpoint",morePresets:"More Presets",customEndpointDescription:"Start from a blank Anthropic-compatible URL and configure everything manually."},settings:{sectionLoadFailed:"Failed to load section",unknownError:"Unknown error occurred",reloadPage:"Reload page",refresh:"Refresh",copy:"Copy",copied:"Copied",saved:"Saved",loading:"Loading...",configFileNotFound:"Config file not found"},settingsTabs:{browser:"Browser",web:"Web",image:"Image",channels:"Channels",env:"Env",think:"Think",proxy:"Proxy",auth:"Auth",backup:"Backup"},settingsAuth:{failedFetchTokens:"Failed to fetch auth tokens",failedSaveTokens:"Failed to save tokens",tokensUpdated:"Tokens updated. Restart CLIProxy to apply.",failedRegenerate:"Failed to regenerate secret",secretRegenerated:"New management secret generated. Restart CLIProxy to apply.",failedReset:"Failed to reset tokens",tokensReset:"Tokens reset to defaults. Restart CLIProxy to apply.",description:"Configure CLIProxy authentication tokens. Changes require CLIProxy restart.",apiKey:"API Key",custom:"Custom",apiKeyDesc:"Used by Claude Code to authenticate with CLIProxy",apiKeyPlaceholder:"API key",managementSecret:"Management Secret",managementSecretDesc:"Used by CCS dashboard to access CLIProxy management APIs",managementSecretPlaceholder:"Management secret",generateSecret:"Generate new secure secret",resetDefaults:"Reset to Defaults",resetDesc:"Resets both API key and management secret to their default values.",saving:"Saving...",save:"Save"},settingsGlobalEnv:{description:"Environment variables injected into all non-Claude subscription profiles (gemini, codex, agy, ghcp, etc.)",enabled:"Global Env enabled",disabled:"Global Env disabled",enabledDesc:"Env vars will be injected into third-party profiles",disabledDesc:"Env vars will not be injected",envVars:"Environment Variables",noneConfigured:"No environment variables configured",addNew:"Add New Variable",keyName:"KEY_NAME",value:"value",add:"Add",quickAdd:"Quick Add Common Variables",allConfigured:"All common variables are configured"},settingsBackups:{failedFetch:"Failed to fetch backups",failedRestore:"Failed to restore backup",restoreSuccess:"Backup restored successfully",title:"Settings Backups",description:"Restore previous versions of your settings.json file. Backups are created automatically when settings are modified.",none:"No backups available",noneHint:"Backups will appear here when you modify settings",latest:"Latest",restoring:"Restoring...",restore:"Restore",restoreConfirmTitle:"Restore Backup?",restoreConfirmPrefix:"This will replace your current settings with backup from",restoreConfirmSuffix:"This action cannot be undone.",cancel:"Cancel"},settingsWebsearch:{description:"CLI-based web search for third-party profiles (gemini, codex, agy, etc.)",enabled:"WebSearch enabled",disabled:"WebSearch disabled",checking:"Checking status...",providers:"Providers",noneConfigured:"No providers configured",noneConfiguredHint:"Install CLI tools to enable web search providers",checkProviders:"Check for providers",installed:"installed",notInstalled:"not installed",model:"Model:",howInstall:"How to install {{name}} CLI",installGlobally:"Install globally",requiresKey:"(requires xAI API key)",freeTier:"(FREE tier available)",viewDocs:"View documentation"},settingsProxy:{failedLoadAgyMode:"Failed to load power user mode",failedUpdateAgyMode:"Failed to update power user mode",failedVerifyAgyMode:"Failed to verify power user mode persistence",notPersistedAgyMode:"Power user mode was not persisted. Config may have been modified by another process.",agyModeEnabled:"Power user mode enabled.",agyModeDisabled:"Power user mode disabled.",typePhraseToContinue:'Type "{{value}}" to continue.',description:"Configure local or remote {{backend}} connection for proxy-based profiles",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"Instance Status",connectionMode:"Connection Mode",local:"Local",remote:"Remote",localDesc:"Run {{backend}} binary on this machine",remoteDesc:"Connect to a remote {{backend}} server",backendBinary:"Backend Binary",stopProxyToSwitch:"Stop the running proxy in Instance Status to switch backend.",default:"Default",plusDesc:"Optional track for extra providers. Still supported, but currently community-maintained instead of upstream-maintained.",originalDesc:"Default, always-available backend for the core provider track.",plusFallbackNotice:"The Plus provider track is not deprecated, but local CLIProxy still falls back to the original backend while the maintained fork path is being brought back.",variantsIncompatible:"Existing plus-extra variants ({{providers}}) will not run on the original backend. Keep them visible for reference, but switch to Plus before using them.",safety:"Safety",agyModeTitle:"Antigravity + Gemini Power User Mode",agyModeDesc:"Skip the AGY responsibility checklist and the Gemini dashboard typed acknowledgement.",agyWarning:"Use only if you fully understand the OAuth suspension/ban risk pattern (#509). CCS cannot assume responsibility for account loss.",finalConfirm:"Final confirmation required",finalConfirmDesc:"Enabling this will skip AGY safety checkpoints and the Gemini dashboard risk phrase gate. Review issue #509 and type the exact phrase to proceed.",step1:"Step 1",readIssue:"Read issue #509",step2:"Step 2",typePrefix:"Type",typeSuffix:"to enable.",typePhraseAria:"Type I ACCEPT RISK to enable Antigravity + Gemini power user mode",exactPhrase:"Exact phrase required.",enableAgyMode:"Enable Antigravity + Gemini Power User Mode",toggleAgyMode:"Toggle Antigravity + Gemini power user mode",fallbackSettings:"Fallback Settings",enableFallback:"Enable fallback to local",enableFallbackDesc:"Use local proxy if remote is unreachable",autoStartLocal:"Auto-start local proxy",autoStartLocalDesc:"Automatically start local proxy on fallback",advanced:"Advanced",debugMode:"Debug Mode",debugModeDesc:"Enable developer diagnostics in browser console",debugModeEnabled:"Debug mode enabled. Check browser console for detailed logs.",localProxy:"Local Proxy",port:"Port",autoStart:"Auto-start",localAutoStartDesc:"Start local proxy automatically when needed",remoteConfigTitle:"Remote Server Configuration",host:"Host",hostPlaceholder:"192.168.1.100 or proxy.example.com",defaultPort:"default: {{value}}",portPlaceholder:"Leave empty for {{value}}",protocol:"Protocol",http:"HTTP",https:"HTTPS",apiKeyOptional:"API Key (optional)",apiKeyPlaceholder:"For /v1/* API endpoints",apiKeyDesc:"Used for API requests to /v1/chat/completions",managementKeyOptional:"Management Key (optional)",managementKeyPlaceholder:"For /v0/management/* endpoints",managementKeyDesc:"Used for dashboard management APIs. Falls back to API Key if not set.",testing:"Testing...",testConnection:"Test Connection",connectedLatency:"Connected ({{value}}ms)",connectionFailed:"Connection failed",invalidPortOrEmpty:"Port must be an integer between 1 and 65535, or empty for default",invalidLocalPort:"Local port must be an integer between 1 and 65535",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"Configure extended thinking/reasoning for supported models.",supportedProviders:"Supported Providers",modeTitle:"Thinking Mode",modeAutoDesc:"Automatically set thinking based on model tier",modeOffDesc:"Disable extended thinking",modeManualDesc:"Set a persistent override level or use CLI flags per run",tierDefaults:"Tier Defaults",tierDefaultsDesc:"Default thinking level for each model tier when in auto mode.",persistentOverride:"Persistent Override",persistentOverrideDesc:"Applied to all sessions. CLI flags still take priority.",enterCustomBudget:"Enter custom budget",apply:"Apply",providerOverrides:"Provider Overrides ({{count}})",providerOverridesDesc:"Override tier defaults for specific providers. Add custom provider keys as needed.",addProviderPlaceholder:"Add provider key (e.g. qwen)",showWarnings:"Show Warnings",showWarningsDesc:"Display warnings when thinking values are clamped or adjusted",cliEnvOverride:"CLI & Env Override",supportLine1Prefix:"Thinking budget:",supportLine1Suffix:"(token-based)",supportLine2Prefix:"Reasoning effort:",supportLine2SuffixPrefix:"(suffix or ",supportLine2SuffixPostfix:": minimal/low/medium/high/xhigh)",supportLine3Prefix:"Codex suffixes pin effort (for example ",supportLine3Suffix:"); unsuffixed models use Thinking mode."},analytics:{title:"Analytics",noDailyUsage:"No usage data for today",noUsageData:"No usage data available",subtitle:"Track usage and insights",month:"Month",allTime:"All Time",updated:"Updated {{value}}"},analyticsSummary:{totalTokens:"Total Tokens",totalTokensSubtitle:"{{input}} in / {{output}} out",totalCost:"Total Cost",totalCostSubtitle:"${{value}}/day avg",cacheTokens:"Cache Tokens",cacheTokensSubtitle:"${{cost}} ({{percent}}% of cost)",inputCost:"Input Cost",outputCost:"Output Cost",tokensSubtitle:"{{value}} tokens"},apiProfiles:{title:"Profiles",sidebarTitle:"API Profiles",sidebarSubtitle:"Premium APIs, local runtimes, custom endpoints",new:"New",searchPlaceholder:"Search profiles...",loadingProfiles:"Loading profiles...",failedLoadTitle:"Failed to load profiles",failedLoadDesc:"Unable to fetch API profiles. Please try again.",retry:"Retry",noProfilesYet:"No API profiles yet",noProfilesDesc:"Create your first profile to connect to custom API endpoints",createProfile:"Create Profile",noProfileMatch:'No profiles match "{{query}}"',profileCount:"{{count}} profile",profileCount_other:"{{count}} profiles",configuredCount:"{{count}} configured",deleteProfileTitle:"Delete Profile",deleteProfileDesc:'Are you sure you want to delete "{{name}}"? This will remove the settings file and cannot be undone.',delete:"Delete",unsavedChangesTitle:"Unsaved Changes",unsavedChangesDesc:'You have unsaved changes in "{{current}}". Discard and switch to "{{next}}"?',discardSwitch:"Discard and Switch",noOrphansFound:"No orphan profile settings found",confirmRegisterOrphans:"Found {{total}} orphan profile setting file(s), with {{valid}} ready to register. Register them now?",registeredWithSkipped:" ({{count}} skipped)",registeredProfiles:"Registered {{count}} profile(s)",copyPrompt:'Copy "{{name}}" to which new profile name?',destinationEmpty:"Destination profile name cannot be empty",exportRedacted:"Export created with redacted token. Use include-secrets flow in CLI if needed.",exportDownloaded:"Profile export downloaded",importFailed:"Failed to import profile bundle",discoverOrphans:"Discover orphan profiles",importProfileBundle:"Import profile bundle"},accountsPage:{title:"Accounts",managePrefix:"Manage",manageSuffix:"accounts and pool onboarding from one panel.",mobileManageSuffix:"continuity per account.",primaryActions:"Primary Actions",createAccount:"Create Account",authClaudeInPool:"Authenticate Claude in Pool",openClaudePoolSettings:"Open Claude Pool Settings",openCliProxyClaudePool:"Open CLIProxy Claude Pool",migrationFollowup:"Migration Follow-up",legacyContextPending:"{{count}} account still needs first-time mode confirmation.",legacyContextPending_other:"{{count}} accounts still need first-time mode confirmation.",legacyContinuityPending:"{{count}} shared account remains on standard legacy continuity depth.",legacyContinuityPending_other:"{{count}} shared accounts remain on standard legacy continuity depth.",confirmingLegacy:"Confirming Legacy Policies...",confirmLegacy:"Confirm Legacy Policies ({{count}})",noLegacyFollowup:"No legacy follow-up pending.",continuityGuide:"Continuity Guide",expandWhenNeeded:"Expand only when needed.",sharedStandard:"Shared Standard",sharedStandardDesc:"Shared workspace only. Put both accounts in the same group before expecting any handoff.",sharedDeeper:"Shared Deeper",sharedDeeperPrefix:"Adds",sharedDeeperDesc:"Adds session-env, file-history, shell-snapshots, and todos. Recommended when users expect cross-account resume.",isolated:"Isolated",isolatedDesc:"No link. Conversations stay with the original account.",quickCommands:"Quick Commands",quickCommandsDesc:"Copy and run in terminal.",workspaceBadge:"ccs auth Workspace",historySyncBadge:"History & Resume Controls",resourcesBadge:"Shared Resources Controls",resourcesShared:"Shared",resourcesProfileLocal:"Profile Local",authAccounts:"Auth Accounts",tableScopePrefix:"This table is intentionally scoped to",tableScopeMiddle:"accounts. Use",tableScopeSuffix:"for mode/group/depth changes.",accountMatrix:"Account Matrix",sharedTotalDesc:"Shared total: {{count}}. Actions include Sync settings and legacy confirmation.",loadingAccounts:"Loading accounts..."},health:{justNow:"just now",secondsAgo:"{{count}}s ago",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",systemHealth:"System Health",build:"build {{version}}",lastScan:"Last scan:",autoRefresh:"Auto-refresh:",refresh:"Refresh",checks:"Checks",version:"Version",platform:"Platform",liveMonitoring:"Live monitoring active",copied:"Copied to clipboard",refreshing:"Refreshing health checks...",fix:"Fix",applyFix:"Apply Fix",healthLabel:"health"},updates:{actionRequired:"Action Required",done:"Done",all:"All",inboxTitle:"Updates Center",inboxSubtitle:"Focus on actions, then mark updates done or dismissed.",needsAction:"Needs Action",doneCount:"Done",searchPlaceholder:"Search actions or commands",noNotices:"No notices match this view.",noUpdates:"No updates available.",published:"Published {{date}}",markDone:"Mark done",dismiss:"Dismiss",reopen:"Reopen",doNext:"Do Next",impactedIntegrations:"Impacted Integrations",impactedDesc:"Related areas based on update scope and routing.",whyMatters:"Why It Matters",whyMattersDesc:"Short context only, no wall-of-text release notes.",open:"Open",progressNeedsAction:"Needs Action",progressInReview:"In Review",progressDone:"Done",progressDismissed:"Dismissed",statusNew:"New",statusStable:"Stable",statusPlanned:"Planned",dashboard:"Dashboard",cliUsage:"CLI Usage"},cliproxyPage:{connected:"Connected",notConnected:"Not connected",variant:"variant",parentNotConnected:"Parent not connected",viaProvider:"via {{provider}}",emptyTitle:"CCS Profile Manager",emptyDesc:"Manage OAuth authentication, account preferences, and model selection for CLIProxy providers. Configure how CCS routes requests to different AI backends.",emptyControlPanelPrefix:"For live usage stats and real-time monitoring, visit the",controlPanel:"Control Panel",quickSetup:"Quick Setup",addAccount:"Add Account",advancedVariant:"Advanced Variant",setupActionsHint:"Add accounts here. Create variants only when you need a separate runtime/profile.",accountManagement:"CCS-level account management",providers:"Providers",variants:"Variants",providerCount:"{{count}} provider",providerCount_other:"{{count}} providers",connectedCount:"{{count}} connected",variantDisplay:"{{name}} ({{provider}} variant)"},copilotPage:{title:"Copilot",subtitle:"Deprecated GitHub Copilot compatibility bridge",deprecatedBadge:"Deprecated",deprecationTitle:"Deprecated compatibility bridge",deprecationItem1:"GitHub usage-based Copilot billing begins June 1, 2026",deprecationItem2:"Existing local setups remain available for compatibility",deprecationItem3:"Prefer Codex or another active provider for new work",setup:"Setup",auth:"Auth",daemon:"Daemon",unofficialTitle:"Unofficial API - Use at Your Own Risk",unofficialItem1:"Reverse-engineered API - may break anytime",unofficialItem2:"Excessive use may trigger account restrictions",unofficialItem3:"No warranty, no responsibility from CCS",yes:"Yes",no:"No",installed:"Installed",missing:"Missing",integration:"Integration",enabled:"Enabled",disabled:"Disabled",github:"GitHub",connected:"Connected",notConnected:"Not Connected",authenticate:"Authenticate",authenticating:"Authenticating...",status:"Status",running:"Running",stopped:"Stopped",port:"Port",stopping:"Stopping...",stop:"Stop",starting:"Starting...",start:"Start",installing:"Installing...",installCopilotApi:"Install copilot-api",proxy:"Proxy",active:"Active",inactive:"Inactive"},cursorPage:{title:"Cursor",beta:"Beta",deprecated:"Deprecated",subtitle:"Deprecated local bridge for legacy Cursor setups",unofficialTitle:"Deprecated legacy bridge - prefer CLIProxy-backed Cursor",unofficialItem1:"Supported path: CLIProxy-backed Cursor auth and account management",unofficialItem2:"This reverse-engineered local bridge remains only for existing setups",unofficialItem3:"CCS provides no warranty for this legacy path",supportedPathTitle:"Supported path",supportedPathDesc:"Use CLIProxy-backed Cursor auth and account management for new setups. Keep the legacy bridge below only if you still rely on the old local daemon flow.",startCliproxyAuth:"Start CLIProxy Cursor Auth",openCliproxyCursor:"Open CLIProxy Cursor",integration:"Integration",authentication:"Authentication",daemon:"Daemon",enabled:"Enabled",disabled:"Disabled",expired:"Expired",connected:"Connected",notConnected:"Not connected",running:"Running",stopped:"Stopped",actions:"Legacy Actions",disableIntegration:"Disable Integration",enableIntegration:"Enable Integration",autoDetectAuth:"Legacy IDE Auto-detect",manualAuthImport:"Legacy Manual Import",stopDaemon:"Stop Daemon",startDaemon:"Start Daemon",port:"Port",configuration:"Cursor Configuration",lastModified:"Last modified:",neverSaved:"Never saved",saving:"Saving...",save:"Save",modelConfig:"Model Config",settings:"Settings",info:"Info",presets:"Presets",presetsDesc:"Apply pre-configured model mappings",modelMapping:"Model Mapping",modelMappingDesc:"Configure which models to use for each tier",defaultModel:"Default Model",defaultModelDesc:"Used when no specific tier is requested.",opusModel:"Opus (Most capable)",opusModelDesc:"Complex reasoning and highest quality responses.",sonnetModel:"Sonnet (Balanced)",sonnetModelDesc:"General coding and day-to-day chat workloads.",haikuModel:"Haiku (Fast)",haikuModelDesc:"Low-latency and lightweight request paths.",runtimeSettings:"Runtime Settings",autoStartDaemon:"Auto-start Daemon",autoStartDesc:"Start Cursor daemon automatically when integration is used.",ghostMode:"Ghost Mode",ghostModeDesc:"Request x-ghost-mode to reduce telemetry.",provider:"Provider",filePath:"File Path",availableModels:"Available Models",loadingModels:"Loading models...",noModels:"No model metadata available yet. Start daemon and refresh.",default:"Default",rawConfiguration:"Raw Configuration (JSON)",manualImportTitle:"Manual Cursor Auth Import",manualImportDesc:"Provide Cursor access token and machine ID if auto-detect is unavailable.",accessToken:"Access Token",accessTokenPlaceholder:"Paste Cursor access token",machineId:"Machine ID",machineIdPlaceholder:"32-char hex (UUID without hyphens)",cancel:"Cancel",import:"Import",selectModel:"Select model",useDefaultModel:"Use Default Model",availableModelCount:"Available Models ({{count}})",invalidPort:"Port must be an integer between 1 and 65535",defaultModelRequired:"Default model is required",savedConfig:"Cursor config and model mapping saved",failedSaveConfig:"Failed to save config",modelsLoadingWait:"Models are still loading. Please wait before applying a preset.",noModelsAvailable:"No models available yet. Start the daemon and refresh first.",appliedCodexPreset:"Applied GPT-5.3 Codex preset",appliedClaudePreset:"Applied Claude 4.6 preset",appliedGeminiPreset:"Applied Gemini 3 preset",integrationEnabled:"Cursor integration enabled",integrationDisabled:"Cursor integration disabled",failedUpdateIntegration:"Failed to update integration state",credentialsImported:"Cursor credentials imported",autoDetectFailed:"Auto-detect failed",manualRequired:"Token and machine ID are required",manualImportFailed:"Manual import failed",failedStartDaemon:"Failed to start daemon",daemonStarted:"Daemon started",daemonStartedWithPid:"Daemon started (PID: {{pid}})",failedStopDaemon:"Failed to stop daemon",daemonStopped:"Daemon stopped",rawLoading:"Raw settings are still loading. Please wait and try again.",invalidJson:"Invalid JSON",rawSaved:"Raw settings saved",rawChanged:"Raw settings changed externally. Refresh and retry.",failedSaveRaw:"Failed to save raw settings",savedAll:"Cursor configuration saved",liveProbe:"Live Probe",runLiveProbe:"Run Live Probe",rerunLiveProbe:"Re-run Live Probe",probing:"Running probe...",probeNotRun:"Probe not run yet",probeLocalReadinessHint:"Local readiness checks can pass while live runtime access still fails. Use the live probe to verify the full Cursor path.",probeStage:"Stage",probeHttpStatus:"HTTP Status",probeDuration:"Duration",probeModel:"Model",probeMessage:"Message",probeSucceeded:"Probe succeeded",probeFailed:"Probe failed",probeSaveFirst:"Save or discard Cursor changes before running the live probe",refreshStatus:"Refresh Cursor status",refreshConfiguration:"Refresh Cursor configuration"},droidPage:{loadingDiagnostics:"Loading Droid diagnostics...",failedDiagnostics:"Failed to load Droid diagnostics.",overview:"Overview",byok:"BYOK",docs:"Docs",runtimeInstall:"Runtime and Installation",status:"Status",detected:"Detected",notFound:"Not Found",detectionSource:"Detection source",binaryPath:"Binary path",installDirectory:"Install directory",version:"Version",overridePath:"Override (CCS_DROID_PATH)",configFiles:"Config Files",path:"Path",resolved:"Resolved",size:"Size",lastModified:"Last modified",parseWarning:"Parse warning: {{value}}",readWarning:"Read warning: {{value}}",warnings:"Warnings",byokSummary:"BYOK Summary",activeModelSelector:"Active model selector",customModels:"Custom models",ccsManaged:"CCS-managed",userManaged:"User-managed",malformedEntries:"Malformed entries",providers:"Providers",none:"none",customModelsTitle:"Custom Models",modelName:"Name / Model",provider:"Provider",baseUrl:"Base URL",noCustomModels:"No custom models",docsAlignedNotes:"Docs-Aligned Notes",factoryDocs:"Factory Docs",providerFactCheckDocs:"Provider Fact-Check Docs",providerValues:"Provider values: {{value}}",settingsHierarchy:"Settings hierarchy: {{value}}",settingsTitle:"Droid BYOK Settings",fixJsonBeforeQuickSettings:"Fix JSON syntax before using quick settings controls.",fixJsonBeforeReasoning:"Fix JSON syntax before updating BYOK reasoning settings.",unableUpdateReasoning:"Unable to update selected BYOK model reasoning setting.",fixJsonBeforeBudget:"Fix JSON syntax before updating thinking budget.",anthropicOnlyBudget:"Thinking budget is only available for Anthropic BYOK models.",invalidJson:"Invalid JSON: {{value}}",saved:"Droid settings saved",changedExternally:"Droid settings changed externally. Refresh and retry.",failedSave:"Failed to save Droid settings"},sharedPage:{commands:"Commands",skills:"Skills",agents:"Agents",plugins:"Plugins",settings:"Settings",title:"Shared Resources",subtitle:"Commands, skills, agents, plugins, and configuration shared across accounts",totalShared:"Total Resources",visible:"Visible",markdownDetail:"Markdown detail view",registryDetail:"Registry detail view",maskedSettingsDetail:"Masked settings view",filterPrefix:"Filter:",configurationRequired:"Configuration Required",countsUnavailable:"Counts unavailable",retryCounts:"Retry counts",filterPlaceholder:"Filter {{tab}} by name, description, or path",showing:"Showing {{visible}} of {{total}} {{tab}}",showingQuery:' for "{{query}}"',refreshing:" (refreshing...)",loadingShared:"Loading shared {{tab}}...",failedLoadShared:"Failed to load shared {{tab}}",retry:"Retry",noSharedFound:"No shared {{tab}} found. Run `ccs sync` or add items in your shared directory.",noPluginsFound:"No shared plugins are installed. Plugin registry files and cache folders are hidden until an actual plugin is present.",noMatch:'No {{tab}} match "{{query}}".',selectOne:"Select a {{tab}} to view full content.",pathLabel:"Path",resolvedSource:"Resolved Source",loadingMarkdown:"Loading markdown content...",loadingSettings:"Loading settings content...",failedLoadContent:"Failed to load content",retryContent:"Retry content",noMarkdown:"No markdown content available.",settingsTitle:"settings.json",settingsDescription:"This file contains shared settings that are linked across all shared-mode accounts.",settingsPath:"Shared Settings Path",settingsActive:"Active",settingsInactive:"Not Found",resourcePolicies:"Resource policies",resourcePoliciesDescription:"Accounts marked shared inherit this hub. Profile-local accounts keep separate commands, skills, agents, plugins, and settings.",sharedAccounts:"{{count}} shared",profileLocalAccounts:"{{count}} profile-local",moreProfileLocalAccounts:"+{{count}} more"},editAccountSharedResources:{title:"Edit Shared Resources",description:'Configure how "{{name}}" inherits commands, skills, and settings from the CCS shared directory.',resourceMode:"Resource Mode",selectResourceMode:"Select resource mode",sharedOption:"Shared",sharedHint:"Inherits commands, skills, and agents from the shared directory.",profileLocalOption:"Profile Local",profileLocalHint:"Uses isolated resources in the account's private directory.",implicationTitle:"What this means",sharedImplication:"This account will see all tools and configuration in the shared resource hub.",profileLocalImplication:"This account will not see shared tools. It stays fully isolated for security or testing.",cancel:"Cancel",save:"Save",saving:"Saving..."},heroSection:{title:"CCS Config",subtitle:"Claude Code Switch Dashboard"},hubFooter:{logs:"Logs",settings:"Settings",github:"GitHub",copyright:"© {{year}} kaitranntt"},themeToggle:{srLabel:"Toggle theme"},ccsLogo:{alt:"CCS Logo",text:"CCS Config"},claudekitBadge:{title:"Powered by ClaudeKit Framework",alt:"ClaudeKit",poweredBy:"Powered by",claudekit:"ClaudeKit"},codeEditor:{revealSensitive:"Reveal sensitive values",maskSensitive:"Mask sensitive values",valid:"Valid {{language}}",readOnly:"(Read-only)"},commandBuilder:{title:"Command Builder",searchPlaceholder:"Type or select a command...",copy:"Copy",run:"Run",cmdConfig:"Open configuration interface",cmdCreateProfile:"Create a new profile",cmdSwitchProfile:"Switch to a profile",cmdDoctor:"Check system health",cmdListProviders:"List available CLIProxy providers",cmdAddProvider:"Add CLIProxy provider"},confirmDialog:{confirm:"Confirm",cancel:"Cancel"},connectionIndicator:{connected:"Connected",connecting:"Connecting...",disconnected:"Disconnected",reconnecting:"Reconnecting..."},docsLink:{title:"View documentation"},githubLink:{title:"Report an issue on GitHub"},globalEnvIndicator:{injectedCount_one:"{{count}} global env var will be injected at runtime",injectedCount_other:"{{count}} global env vars will be injected at runtime",overriddenCount:"({{count}} overridden by profile)",skippedLabel:"Skipped (profile already defines):",configureInSettings:"Configure in Settings"},localhostDisclaimer:{remoteReadonlyAuthDisabledLong:"Remote dashboard access is read-only because dashboard auth is currently disabled for this CCS instance. Re-enable it on the CCS host. Docker deployments must do that inside the running container.",remoteReadonlyAuthDisabledShort:"Remote dashboard is read-only until dashboard auth is re-enabled for this CCS instance.",remoteReadonlySetupLong:"Remote dashboard access is read-only until you run ccs config auth setup for this CCS instance. Docker deployments must run it inside the container.",remoteReadonlySetupShort:"Remote dashboard is read-only until auth is configured for this CCS instance.",localLong:"This dashboard runs locally. All data stays on your machine.",localShort:"Local dashboard - data stays on your device.",dismiss:"Dismiss disclaimer"},privacyToggle:{modeOn:"Privacy mode ON - Click to show data",modeOff:"Privacy mode OFF - Click to hide data"},projectSelectionDialog:{title:"Select Google Cloud Project",description:"Choose which project to use for {{provider}} authentication.",autoSelectCountdown:"(Auto-selecting default in {{count}}s)",default:"Default",allProjects:"All Projects",allProjectsDescription:"Onboard all {{count}} listed projects",useDefault:"Use Default",selecting:"Selecting...",confirmSelection:"Confirm Selection",codeCopied:"Code copied",copyVerificationCode:"Copy verification code"},quickCommands:{title:"Quick Commands",startDefault:"Start Default",startDefaultDesc:"Launch Claude with default profile",glmProfile:"GLM Profile",glmProfileDesc:"Switch to GLM model",healthCheck:"Health Check",healthCheckDesc:"Run system diagnostics",delegateTask:"Delegate Task",delegateTaskDesc:"Delegate to GLM profile"},quotaTooltip:{loadingQuota:"Loading quota...",failedLoadQuota:"Failed to load quota",modelQuotas:"Model Quotas:",rateLimits:"Rate Limits:",plan:"Plan: {{plan}}",quotaSnapshots:"Quota Snapshots:",unlimited:"Unlimited",remaining:"{{remaining}}/{{entitlement}} remaining",tier:"Tier",tierId:"Tier ID",state:"State",credits:"Credits",modelQuotasLower:"Model quotas:",allBucketsReport:"All buckets report {{tokenType}}",requestsRemaining:"{{count}} requests remaining",inputTokensRemaining:"{{count}} input tokens remaining",outputTokensRemaining:"{{count}} output tokens remaining",amountRemaining:"{{count}} remaining",fiveHourLimit:"5h usage limit",weeklyLimit:"Weekly usage limit",weeklyOpus:"Weekly usage (Opus)",weeklySonnet:"Weekly usage (Sonnet)",weeklyOAuthApps:"Weekly usage (OAuth apps)",weeklyCowork:"Weekly usage (Cowork)",extraUsage:"Extra usage",premiumInteractions:"Premium Interactions",chat:"Chat",completions:"Completions",resets:"Resets {{time}}",fiveHourResets:"5h resets {{time}}",weeklyResets:"Weekly resets {{time}}"},utils:{codeReview5h:"Code review (5h)",codeReviewWeekly:"Code review (weekly)",codeReview:"Code review",codexAdditional5h:"{{name}} (5h)",codexAdditionalWeekly:"{{name}} (weekly)",codexAdditional:"{{name}}"},sponsorButton:{title:"Sponsor this project on GitHub",sponsor:"Sponsor"},valueMetrics:{apiCostSaved:"API Cost Saved",tokensSaved:"Tokens Saved",queriesFaster:"Queries Faster",errorsReduced:"Errors Reduced",vsLastMonth:"vs last month",throughCaching:"through caching",averageSpeedup:"average speedup",withRetryLogic:"with retry logic",performanceMetrics:"Performance Metrics",monthlySummary:"Monthly Summary",totalSaved:"Total Saved",tokensProcessed:"Tokens Processed",queriesHandled:"Queries Handled",uptime:"Uptime"},updatesSpotlight:{openUpdatesCenter:"Open Updates Center"},deviceCodeDialog:{authorize:"Authorize {{provider}}",enterCodeAtPage:"Enter the code below at the authorization page.",expiresIn:"(Expires in {{time}})",codeExpired:"(Code expired)",copied:"Copied!",copyCode:"Copy Code",waitingForAuth:"Waiting for authorization...",openVerificationPage:"Open verification page",openProviderPage:"Open {{provider}}",copyCodeAria:"Copy verification code",codeCopiedAria:"Code copied"},settingsDialog:{editProfile:"Edit Profile: {{name}}",description:"Configure environment variables and settings for this profile.",loadingSettings:"Loading settings...",envTab:"Environment",rawJsonTab:"Raw JSON",generalTab:"General",noEnvVars:"No environment variables configured.",noEnvVarsHint:"Add variables in your settings.json file.",loadingEditor:"Loading editor...",profileInfo:"Profile Information",profileInfoDesc:"Details about this configuration file.",path:"Path",lastModified:"Last Modified",cancel:"Cancel",saving:"Saving...",saveChanges:"Save Changes",conflictTitle:"File Modified Externally",conflictDesc:"This settings file was modified by another process. Overwrite with your changes or discard?",overwrite:"Overwrite",invalidJson:"Invalid JSON",failedSave:"Failed to save"},setupWizard:{title:"Advanced Variant Setup",stepProviderDesc:"Select a provider for the runtime variant",stepAuthDesc:"Authenticate with your provider",stepAccountDesc:"Select which account to use",stepVariantDesc:"Optional: create a custom runtime variant",stepSuccessDesc:"Setup complete!",authStep:{authenticateWith:"Authenticate with {{provider}} to add an account",authenticating:"Authenticating...",authenticateInBrowser:"Authenticate in Browser",completeOAuth:"Complete the OAuth flow in your browser...",orUseTerminal:"Or use terminal",runCommandHint:"Run this command in your terminal:",back:"Back",checking:"Checking...",refreshStatus:"Refresh Status"},accountStep:{selectAccount:"Select an account ({{count}})",defaultAccount:"Default account",or:"Or",addNewAccount:"Add new account",addNewAccountDesc:"Authenticate with a different account",back:"Back"},variantStep:{back:"Back",skip:"Skip"},successStep:{title:"Variant Created!",subtitle:"Your custom variant is ready to use",usage:"Usage:",done:"Done"}},accountSurfaceCard:{business:"Biz",free:"Free",personal:"Pers",variant:"Variant"},accountIdentity:{business:"Business",personal:"Personal",free:"Free",team:"Team",plus:"Plus",pro:"Pro",workspace:"Workspace {{id}}"},accountCardStats:{notUsedYet:"Not used yet"},accountQuotaPanel:{weekly:"Weekly",loadingQuota:"Loading quota..."},userMenu:{signedInAs:"Signed in as {{username}}"},authMonitorLive:{live:"LIVE",accountMonitor:"Account Monitor",updated:"Updated {{time}}",updatedNow:"Updated now",requestsLabel:"req",stats:"Stats",successRate:"Success Rate",missingProjectId:"Missing Project ID",noActivity:"no activity"},providerCard:{missingProjectIdAria:"Missing Project ID"},loginPage:{showPassword:"Show password",hidePassword:"Hide password"},cliproxyStatsOverview:{sessionStatistics:"Session Statistics",realTimeMetrics:"Real-time usage metrics from {{backend}}",offline:"Offline",running:"Running",noActiveSession:"No Active Session",noActiveSessionHint:"Start a CLIProxy session using ccs gemini, ccs codex, or ccs agy to view real-time statistics.",failedLoadStats:"Failed to Load Statistics",totalRequests:"Total Requests",successCount:"{{count}} success",successRate:"Success Rate",totalTokens:"Total Tokens",estimatedCost:"~${{cost}} estimated",modelsUsed:"Models Used",modelUsageDistribution:"Model Usage Distribution",requestCount:"{{count}} requests"},cliproxyTable:{name:"Name",provider:"Provider",model:"Model",account:"Account",status:"Status",default:"Default",actions:"Actions"},cliproxyTabs:{overview:"Overview",variants:"Variants",aiProviders:"AI Providers",controlPanel:"Control Panel"},cliproxyHeader:{ccsLevelAccountManagement:"CCS-level account management",cliproxyNotAvailable:"CLIProxy Not Available",cliproxyControlPanel:"CLIProxy Control Panel",noVariants:"No CLIProxy variants found.",addAccountToStart:"Add an account to get started"},routingGuidance:{roundRobin:"Round robin spreads usage.",fillFirst:"Fill first keeps backup accounts cold until they are needed.",routingStrategy:"Routing strategy",optionalRouting:"Optional routing",sessionAffinity:"Session affinity",sessionAffinityOn:"On",sessionAffinityOff:"Off",sessionAffinityEnabled:"Enabled",sessionAffinityDisabled:"Disabled",enableSessionAffinity:"Enable session affinity",disableSessionAffinity:"Disable session affinity",sessionAffinityUnavailable:"Session affinity unavailable",localOnly:"Local only",localOnlySetting:"Local-only setting",ttlBadge:"TTL {{ttl}}",sessionAffinityDescription:"Keep one conversation pinned to the same account when possible. CLIProxy prefers explicit session or thread identifiers when clients send them, then falls back to request metadata or the opening prompt history when it has to infer a stable key.",sessionRecognitionTitle:"Session recognition",sessionRecognitionDescription:"CCS does not promise one universal precedence order here. In practice, upstream backends prefer explicit session or thread IDs first, then fall back to metadata fields and finally a hash based on the opening prompt history."},extendedContext:{extendedContext:"Extended Context"},cliproxyConfig:{unsavedChanges:"Unsaved changes",original:"Original",modified:"Modified",reviewChanges:"Review Changes",loadingEditor:"Loading editor..."},providerEditor:{provider:"Provider",filePath:"File Path",lastModified:"Last Modified",defaultTarget:"Default Target",quickUsage:"Quick Usage",modelMapping:"Model Mapping",status:"Status",loadingSettings:"Loading settings...",loadingEditor:"Loading editor...",accounts:"Accounts",addAccount:"Add Account",noAccountsConnected:"No accounts connected",addAccountToStart:"Add an account to get started",gcpProjectIdReadonly:"GCP Project ID (read-only)",projectIdNA:"Project ID: N/A",missingProjectId:"Missing Project ID",missingProjectIdHint:"This may cause errors. Remove the account and re-add it to fetch the project ID.",useIncognito:"Use incognito",aliases:"Aliases",current:"Current",currentValue:"Current value",composite:"composite",defaultLabel:"default",requiredSetup:"Required setup",connectorName:"Connector Name",proxyUrl:"Proxy URL",proxyUrlSet:"Proxy URL set",excludedModels:"Excluded Models",headers:"Headers",secret:"Secret",prefix:"Prefix",modelMappings:"Model Mappings",baseUri:"Base URL",apiKeys:"API Keys",presets:"Apply pre-configured model mappings",createVariant:"Create CLIProxy Variant",agyDenylist:"Antigravity denylist: Claude Opus 4.5 and Claude Sonnet 4.5 are deprecated."},providerEditorAccountItem:{modelsUsed:"Models Used"},bulkActionBar:{applyPreset:"Apply preset"},modelConfigSection:{defaultModel:"Default Model"},rawEditorSection:{rawConfig:"Raw Configuration"},providerEditorHeader:{connectorName:"Connector Name"},aiProvidersFamilyRail:{current:"Current"},aiProvidersEntryCard:{apiKeys:"API Keys"},aiProvidersEntryDialog:{connectorName:"Connector Name",baseUri:"Base URL",proxyUrl:"Proxy URL",secret:"Secret",prefix:"Prefix",excludedModels:"Excluded Models",headers:"Headers",modelMappings:"Model Mappings",requiredSetup:"Required setup",optionalRouting:"Optional routing"},codex:{controlCenter:"Control Center",overview:"Overview",docs:"Docs",nativeCodexRuntime:"Native Codex Runtime",ccsCodexProvider:"Cliproxy shortcut / managed bridge",codexDocs:"Codex docs",howCodexWorks:"How Codex works in CCS",supportedFlows:"Supported flows",twoSupportedPaths:"Two supported paths:",nativeLabel:"Native:",nativeDesc:"Codex is a first-class, runtime-only target in CCS v1.",nativeConfigLabel:"Native config:",nativeConfigDesc:"ccs-codex and ccsx launch native Codex using your saved defaults.",transientOverridesLabel:"Transient overrides:",transientOverridesDesc:"ccsxp stays on native Codex and prepends the cliproxy provider override; ccs codex --target codex remains the explicit CCS-managed bridge.",cliproxyDefaultLabel:"CLIProxy default:",cliproxyDefaultDesc:'To make plain codex use CLIProxy, set model_provider = "cliproxy" and add the recipe below.',ccsBridge:"CCS Bridge",apiProfilesDefault:"API profiles continue to default to Claude or Droid.",runtimeInstall:"Runtime install",detected:"Detected",notFound:"Not found",detectionSource:"Detection source",binaryPath:"Binary path",installDirectory:"Install directory",versionLabel:"Version",nativeAliases:"Native aliases",ccsProviderShortcut:"Cliproxy shortcut",configOverrideSupport:"--config override support",available:"Available",missing:"Missing",cliproxyNativeCodex:"CLIProxy-backed native Codex",builtInLabel:"Built-in:",builtInCcsxpDesc:"Use ccsxp for native Codex with the cliproxy provider shortcut.",managedBridgeLabel:"Managed bridge:",managedBridgeDesc:"Use ccs codex --target codex when you want the stricter CCS-managed route explicitly.",nativeRecipeLabel:"Native:",nativeRecipeDesc:"Configure the recipe below to use CLIProxy directly with codex.",saveProviderNamedCliproxy:"Save a provider named cliproxy with the base URL and env key above.",inTopLevelSetDefault:"In Top-level settings, set Default provider to cliproxy.",exportCliproxyApiKey:"Export CLIPROXY_API_KEY in your shell before launching native Codex.",noConfigOverrides:"This Codex build can still use the plain native path, but ccsxp and the explicit CCS-managed Codex bridge stay unavailable until the detected Codex binary exposes --config overrides.",configFile:"Config file",path:"Path",resolved:"Resolved",size:"Size",lastModified:"Last modified",tomlWarning:"TOML warning",readWarning:"Read warning",currentUserLayerSummary:"Current user-layer summary",activeProfile:"Active profile",notSet:"Not set",providersCount:"providers: {{count}}",profilesCount:"profiles: {{count}}",enabledFeaturesCount:"enabled features: {{count}}",mcpServersCount:"mcp servers: {{count}}",userLayerKeysPresent:"User-layer keys present",recommendedSetupFlow:"Recommended setup flow",fastestPath:"Fastest path",officialChannels:"Official Channels",codexCli:"Codex CLI",openNativeCodex:"Open native Codex",runBuiltInCodex:"Run native Codex with the cliproxy shortcut",runBuiltInCodexExplicit:"Run the CCS-managed Codex bridge explicitly",openCodexDashboard:"Open Codex dashboard",nativeShortAlias:"Native short alias",ccsCodexShortcut:"Cliproxy shortcut",explicitProviderRoute:"Managed bridge route",status:"Status",profiles:"Profiles",createNewProfile:"Create new profile",createNewProvider:"Create new provider",createNewMcpServer:"Create new MCP server",defaultProvider:"Default provider",useDefault:"Use default",useGlobalProvider:"Use global provider",useProviderDefault:"Use provider default",quickFillWarning:"Quick-fill only. Review before saving.",thisFileUpstreamOwned:"This file is upstream-owned by Codex CLI.",notes:"Notes",approvalPolicy:"Approval policy",sandboxMode:"Sandbox mode",reasoningEffort:"Reasoning effort",useGlobalEffort:"Use global effort",reasoningEffortCapitalized:"Reasoning Effort",thinkingBudgetTokens:"Thinking Budget Tokens",modelContextWindow:"Model context window",autoCompactTokenLimit:"Auto-compact token limit",toolOutputTokenLimit:"Tool output token limit",webSearch:"Web search",personality:"Personality",model:"Model",rawOnly:"Raw only",trusted:"trusted",untrusted:"untrusted",noProjectTrustEntries:"No explicit project trust entries saved.",codexNativeRecipe:"Saved native Codex recipe",runtimeVsProvider:"Runtime vs provider",honorsSavedNativeConfig:"Honors saved native user config",usesTransientOverrides:"Uses transient overrides",unavailableNoConfig:"Unavailable (Codex build lacks --config support).",gptContextCap:"GPT-5.4 context cap",usageLimitCost:"Usage-limit cost above 272K",longContextOverride:"Long context override",counts2x:"Counts 2x",normalUsageWindow:"Normal usage window",useCodexDefault:"Use Codex default",stdio:"stdio",streamableHttp:"streamable-http",responses:"responses",defaultTargetCli:"Default Target CLI",executionChain:"Execution chain",targetPath:"Current target path",userConfig:"User config",configYaml:"config.yaml",flow:"Flow",docsTab:"Docs",yes:"Yes",no:"No",warningsTitle:"Warnings",features:"Features",featuresDesc:"Toggle the supported Codex feature flags CCS can safely manage.",configOnlyFlags:"Existing config-only flags",configOnlyFlagsDesc:"These feature keys already exist in your `config.toml`, so CCS can surface them without claiming full catalog coverage.",existing:"existing",nonBooleanForm:"Stored in a non-boolean form. Use raw TOML if you need to edit it.",discoveredFromFile:"Discovered from the current file instead of CCS's built-in catalog.",featureMultiAgentLabel:"Multi-agent",featureMultiAgentDesc:"Enable subagent collaboration tools.",featureUnifiedExecLabel:"Unified exec",featureUnifiedExecDesc:"Use the PTY-backed unified exec tool.",featureShellSnapshotLabel:"Shell snapshot",featureShellSnapshotDesc:"Reuse shell environment snapshots.",featureApplyPatchLabel:"Apply patch",featureApplyPatchDesc:"Enable freeform apply_patch edits.",featureJsReplLabel:"JS REPL",featureJsReplDesc:"Enable the Node-backed JavaScript REPL.",featureRuntimeMetricsLabel:"Runtime metrics",featureRuntimeMetricsDesc:"Collect Codex runtime metrics.",featurePreventIdleSleepLabel:"Prevent idle sleep",featurePreventIdleSleepDesc:"Keep the machine awake while active.",featureFastModeLabel:"Fast mode",featureFastModeDesc:"Allow the fast service tier path.",featureAppsLabel:"Apps",featureAppsDesc:"Enable ChatGPT Apps and connectors support.",featureSmartApprovalsLabel:"Smart approvals",featureSmartApprovalsDesc:"Route eligible approvals through the guardian flow."},droidSettings:{quickControls:"Quick Controls",reasoningControls:"Reasoning Controls",thinkingBudget:"Thinking Budget",anthropicOnly:"Anthropic models only",byokCustomModels:"BYOK Custom Models"},rawJsonSettingsEditor:{title:"Raw Settings Editor"},copilotConfigForm:{copilotConfiguration:"Copilot Configuration",deprecatedModels:"Deprecated Copilot models detected",failedLoadStatus:"Failed to load status",useWithClaudeCode:"Use your GitHub Copilot subscription with Claude Code",githubCopilotControls:"GitHub Copilot controls prompt/context limits upstream.",provider:"Provider",filePath:"File Path",status:"Status",enabled:"Enabled",disabled:"Disabled",loadingEditor:"Loading editor...",modelMapping:"Model Mapping",quickUsage:"Quick Usage",noPremiumUsage:"No premium usage count"},copilotPresets:{gpt5Codex:"GPT-5.3 Codex",claude46:"Claude 4.6",gemini3:"Gemini 3"},healthCard:{allSystemsNominal:"All Systems Nominal",machineChecks:"Machine checks"},analyticsCards:{cacheCost:"Cache Cost",hitRate:"Hit Rate",inputOutputRatio:"Input/Output Ratio",noCacheData:"No cache data available",noModelData:"No model data available",noSessionData:"No session data available",noTokenData:"No token data available",totalCost:"Total Cost",totalTokens:"Total Tokens",usageInsights:"Usage Insights"},dateRangeFilter:{pickADate:"Pick a date"},logsConfig:{level:"Lvl",message:"Message",source:"Source",time:"Time",proc:"Proc",open:"Open",run:"Run",refreshEntries:"Refresh Entries"},logsDetailPanel:{details:"Details"},logsFilters:{filters:"Filters"},logsOverviewCards:{overview:"Overview"},logsPageSkeleton:{loadingLogs:"Loading logs..."},monitoringErrorLogs:{logContent:"Log Content"},analyticsPages:{chartsGrid:"Charts",costByModel:"Cost by Model"},toasts:{profileCreated:"Profile created successfully",profileUpdated:"Profile updated successfully",profileDeleted:"Profile deleted successfully",orphanProfilesComplete:"Orphan profiles registration complete",profileCopied:"Profile copied successfully",profileImported:"Profile imported successfully",authRequired:"{{provider}} authorization required",authSuccess:"{{provider}} authentication successful!",authFailed:"{{provider}} authentication failed",deviceCodeExpired:"Device code expired. Please try again.",codeCopied:"Code copied to clipboard",failedCopy:"Failed to copy code",configSaved:"Configuration saved successfully",configSaveFailed:"Failed to save: {{error}}",invalidYaml:"Cannot save invalid YAML",configUpdatedExternally:"Configuration updated externally",settingsFileUpdated:"Settings file updated",accountsUpdated:"Accounts updated",noProfilesToSync:"No profiles to sync",syncFailed:"Sync failed: {{error}}",sessionAffinityUpdated:"Session affinity {{state}}.",providerAuthSuccess:"{{provider}} authentication successful",providerDeviceCodeInCallback:"Provider returned Device Code flow in callback mode",providerAuthTimeout:"Authentication timed out. Please try again.",providerAccountRegistrationFailed:"Authenticated account could not be registered",providerLostStatusEndpoint:"Lost contact with the auth status endpoint",providerUnknown:"Unknown provider: {{provider}}",providerStartOAuthFailed:"Failed to start OAuth",providerCallbackFailed:"Callback submission failed",providerSubmitCallbackFailed:"Failed to submit callback",loggingConfigSaved:"Logging configuration saved.",loggingConfigSaveFailed:"Failed to save logging configuration.",unifiedConfigUpdated:"Configuration updated successfully",migrationPreviewComplete:"Migration preview completed",migrationComplete:"Migration completed successfully",migrationFailed:"Migration failed",rollbackComplete:"Rollback completed successfully",rollbackFailed:"Rollback failed",defaultAccountSet:'Default account set to "{{name}}"',defaultAccountReset:"Default account reset to CCS",accountDeleted:'Account "{{name}}" deleted',contextUpdated:'Updated "{{name}}" context to {{summary}}',legacyConfirmError:'Account "{{name}}" needs explicit confirmation. Use Edit History Sync on this account.',legacyConfirmFailed:'Legacy account "{{name}}" failed confirmation: {{error}}',legacyConfirmSuccess_one:"{{count}} legacy account confirmed",legacyConfirmSuccess_other:"{{count}} legacy accounts confirmed",legacyConfirmPartial:"Confirmed {{updated}} legacy account(s), but {{failed}} update(s) failed. Refreshed account state.",legacyConfirmAllFailed:"Failed to confirm {{failed}} legacy account(s). Refreshed account state.",noLegacyAccounts:"No legacy accounts need confirmation",routingStrategySet:"Routing strategy set to {{strategy}}",variantCreated:"Variant created successfully",variantUpdated:"Variant updated successfully",variantDeleted:"Variant deleted successfully",defaultAccountUpdated:"Default account updated",accountRemoved:"Account removed",accountPaused:"Account paused",accountResumed:"Account resumed",accountAdded:"Account added for {{provider}}",kiroImported:"Imported Kiro account: {{name}}",kiroTokenImported:"Kiro token imported",modelUpdated:"Model updated",presetSaved:'Preset "{{name}}" saved',presetDeleted:"Preset deleted",cliproxyAlreadyRunning:"CLIProxy was already running",cliproxyStarted:"CLIProxy started successfully",cliproxyStartFailed:"Failed to start CLIProxy",cliproxyStopped:"CLIProxy stopped",cliproxyStopFailed:"Failed to stop CLIProxy",presetApplied:'Applied "{{name}}" preset',presetAppliedCustom:"Applied custom preset",settingsSavedWithAdjustments:"Settings saved with model adjustments",settingsSaved:"Settings saved",failedSaveSettings:"Failed to save settings",codexRefreshFailed:"Failed to refresh Codex snapshot. Raw edits were kept.",codexRefreshError:"Failed to refresh Codex snapshot.",codexFixToml:"Fix TOML before saving.",codexSaved:"Saved Codex config.toml.",codexChangedExternally:"config.toml changed externally. Refresh and retry.",codexSaveFailed:"Failed to save Codex config.toml.",codexUpdateFailed:"Failed to update Codex config.",noOrphanProfiles:"No orphan profile settings found",profilesRegistered:"Registered {{count}} profile(s){{skipped}}",destinationEmpty:"Destination profile name cannot be empty",profileExportDownloaded:"Profile export downloaded",profileImportFailed:"Failed to import profile bundle"},providerConfig:{defaultDeviceCodeInstruction:"Complete the authorization in your browser.",trackLabel:"Track",sectionCoreLabel:"Core / original backend",sectionCoreHint:"Default, always-available provider track",sectionPlusLabel:"Plus extras / community-maintained",sectionPlusHint:"Still supported, but separated from the default backend for now",plusTrackNote:"Requires the optional Plus backend while that track remains community-maintained."},profileEditorSections:{imageAnalysis:"Image Analysis",loadingImageSettings:"Loading image settings...",skipPermissionPrompts:"Skip permission prompts on launch",useNativeImageReading:"Use native image reading",skipTransformer:"Skip transformer",friendlyUi:"Friendly UI",info:"Info"},imageAnalysisStatus:{sectionTitle:"Image",openSettings:"Open Settings",useNativeImageReading:"Use native image reading",refreshingPreview:"Refreshing preview",savedStatus:"Saved status",livePreview:"Live preview",disabledGlobally:"Disabled globally",targetBypassesHook:"{{target}} bypasses the hook",nativeImageReading:"Native image reading",setupNeeded:"Setup needed",needsAuth:"Needs auth",needsProxy:"Needs proxy",nativeFallback:"Native fallback",transformerReady:"Transformer ready",badgeDisabled:"Disabled",badgeBypassed:"Bypassed",badgeNative:"Native",badgeSetup:"Setup",badgeAuth:"Auth",badgeProxy:"Proxy",badgeReady:"Ready",capabilityVerified:"Verified",capabilityUnknown:"Unknown",toggleSummaryNativeCapable:"{{model}} looks image-ready. CCS will bypass the transformer here.",toggleSummaryNativeModel:"CCS will prefer native reading for {{model}}.",toggleSummaryNativeDefault:"CCS will prefer native image reading for this profile.",toggleSummaryNativeFileAccess:"This profile currently stays on native file access.",toggleSummaryInactiveTarget:"Saved Claude-side image routing is inactive while {{target}} is selected.",toggleSummaryTransformerRoute:"Transformer route: {{backend}}{{modelSuffix}}.",noteDisabledGlobally:"Image is disabled globally in CCS settings.",noteTargetBypassesHook:"Current target {{target}} bypasses the Claude Read hook.",notePersistHook:"Persist the profile hook before transformer routing can run here.",targetLabel:{claude:"Claude Code",droid:"Factory Droid",codex:"Codex CLI"}},openrouterBadge:{new:"NEW",integration:"OpenRouter Integration"},openrouterBanner:{accessModels:"Access {{count}}+ models via OpenRouter",add:"Add"},openrouterModelPicker:{searchModels:"Search Models",newestModels:"Newest Models"},openrouterPromoCard:{title:"OpenRouter",description:"Access hundreds of models from one API endpoint."},profileCard:{profile:"Profile",openRouter:"OpenRouter profile",claudeCode:"Claude Code",claudeCodeDefault:"Claude Code (default)",factoryDroid:"Factory Droid",codexCli:"Codex CLI",ccsProfile:"CCS profile"},profileDeck:{profiles:"Profiles",failedToLoad:"Failed to load profiles: {{message}}",noProfiles:"No profiles configured. Create your first profile to get started."},profilesTable:{name:"Name",provider:"Provider",model:"Model",target:"Target",lastModified:"Last Modified",actions:"Actions",edit:"Edit"},profileCreateDialog:{createProfile:"Create Profile",appliedModelToTiers:'Applied "{{model}}" to all model tiers',profileCreated:'Profile "{{name}}" created',failedCreate:"Failed to create profile",chooseProviderHint:"Choose a provider preset or configure a custom API endpoint.",basicInformation:"Basic Information",modelConfiguration:"Model Configuration",usedInCli:"Used in CLI:",apiBaseUrl:"API Base URL",baseUrlPlaceholder:"https://api.example.com/v1",prefilledFromPreset:"Pre-filled from {{name}}. You can customize if needed.",optionalForPreset:"Optional for {{name}}. Leave blank to use native Anthropic auth.",endpointHint:"The endpoint that accepts OpenAI-compatible and Anthropic requests",optional:"(optional)",apiKeyOptionalPlaceholder:"Optional - only if auth is enabled",apiKeyPlaceholder:"sk-...",apiKeyOptionalHint:"Only needed if your local endpoint has authentication enabled",defaultTargetCli:"Default Target CLI",modelMapping:"Model Mapping",modelMappingDesc:"Map Claude Code tiers (Opus/Sonnet/Haiku) to models supported by your provider.",searchModelsPlaceholder:"Type to search (e.g., opus, sonnet, gpt-4o)...",noModelsFound:'No models found for "{{query}}"',loadingModels:"Loading models...",defaultModel:"Default Model",sonnetMapping:"Sonnet Mapping",opusMapping:"Opus Mapping",haikuMapping:"Haiku Mapping",sonnetMappingPlaceholder:"e.g. gpt-4o, claude-sonnet-4",opusMappingPlaceholder:"e.g. o1, claude-opus-4.5",haikuMappingPlaceholder:"e.g. gpt-4o-mini, claude-3.5-haiku",free:"Free"},profileDialogLegacy:{editProfile:"Edit Profile"},supportEntryCard:{actionRequired:"Action Required"},settingsPage:{title:"Settings",loading:"Loading...",failedLoad:"Failed to load settings.",tabs:{web:"Web",env:"Env",think:"Think",proxy:"Proxy",auth:"Auth",backup:"Backup",channels:"Channels",imageAnalysis:"Image"},websearchSection:{title:"Web Search",description:"CLI-based web search configuration."},thinkingSection:{title:"Thinking",description:"Configure extended thinking/reasoning for supported models.",directOverride:"Direct override",youType:"You type:",ccsAdds:"CCS adds:",executionChain:"Execution chain",primaryBackends:"Primary backends",legacyCliFallbacks:"Legacy CLI fallbacks",managedPayload:"Managed payload",sharedTargetMetadata:"Shared target metadata",ideTargetMetadata:"IDE target metadata",ideSettingsPath:"IDE settings path",ideHost:"IDE host",resolvedBinding:"Resolved binding",bindingName:"Binding name",inSync:"In sync",currentTargetPath:"Current target path",warnings:"Warnings",notes:"Notes",workspacePresets:"Workspace presets",draft:"Draft",advanced:"Advanced",recommended:"Recommended setup flow",configureModelFirst:"Configure a model first"},proxySection:{title:"Proxy",loadingImageSettings:"Loading image settings..."},channelsSection:{title:"Official Channels",description:"View and manage official release channels."},imageAnalysisSection:{title:"Image Analysis",description:"Configure image analysis settings.",loading:"Loading image settings..."},browserSection:{title:"Browser",description:"Primary setup surface for managed browser automation in CCS.",primaryTitle:"Settings > Browser is the primary browser setup surface.",primaryDescription:"Configure Claude Browser Attach and Codex Browser Tools here, then use the guidance below to launch or verify each lane.",readiness:"Readiness",nextStep:"Next step",technicalDetails:"Technical Details",diagnostics:"Diagnostics",evalMode:{label:"browser_eval access",options:{disabled:"Disabled",readonly:"Read-only",readwrite:"Read/write"}},actions:{saveClaude:"Save Claude settings",saveCodex:"Save Codex settings",testConnection:"Test connection",copyLaunchCommand:"Copy launch command"},messages:{statusRefreshed:"Browser status refreshed",launchCommandCopied:"Launch command copied"},claude:{title:"Claude Browser Attach",description:"Attach Claude-target launches to a managed Chrome session with remote debugging enabled.",enabledLabel:"Enable Claude Browser Attach",enabledDescription:"When enabled, CCS prepares the managed browser MCP runtime for Claude-target launches.",userDataDir:"Chrome user-data directory",userDataDirHint:"Use a dedicated Chrome profile directory so attach-mode state stays isolated from your daily browser.",devtoolsPort:"DevTools port",devtoolsPortHint:"Use the same port when you launch Chrome in attach mode.",devtoolsPortInvalid:"Enter a valid port between 1 and 65535.",effectivePath:"Effective attach path",recommendedPath:"Recommended path",managedRuntime:"Managed browser runtime",evalModeHint:"Controls browser_eval access for Claude Browser Attach. Read-only allows inspection; read/write also allows page-side mutations.",overrideMessage:"An environment override is currently active from {{source}}. This dashboard remains the source of truth once that override is removed.",launchGuidance:"Launch guidance",launchGuidanceHint:"Start Chrome with remote debugging enabled, then rerun Test connection if needed."},codex:{title:"Codex Browser Tools",description:"Controls the managed Playwright MCP override path for Codex-target launches.",enabledLabel:"Enable Codex Browser Tools",enabledDescription:"Keep this on to make the Browser page the first-class setup surface for Codex browser tooling.",serverName:"Managed server name",overrideSupport:"Config override support",overrideSupported:"Supported",overrideUnsupported:"Not supported",binary:"Detected Codex binary",notDetected:"Not detected",evalModeHint:"Stored for Browser settings parity. In Phase 1, browser_eval enforcement primarily applies to Claude Browser Attach."}}},codexPage:{title:"Codex",controlCenter:"Control Center",overview:"Overview",docs:"Docs",nativeRuntime:"Native Runtime",ccsProvider:"CCS Provider",setup:"Setup"},apiPage:{title:"API Profiles",subtitle:"Manage your API profiles and endpoints."},claudeExtensionPage:{title:"Claude Extension",subtitle:"Claude Extension integration settings.",claudeAuth:"Claude auth",status:"Status",targetMetadata:"IDE target metadata"},sharedPageV2:{title:"Shared",subtitle:"Shared data management."},homePageV2:{title:"Home",logsMoved:"Logs moved to a dedicated workspace",profiles:"Profiles",cliproxy:"CLIProxy",accounts:"Accounts",health:"Health"},analyticsPageV2:{title:"Analytics",subtitle:"Usage analytics and insights."},logsPageV2:{title:"Logs",subtitle:"View and manage system logs."},healthPageV2:{title:"Health",subtitle:"System health monitoring."},aiProvidersPage:{title:"AI Providers",subtitle:"Manage AI provider configurations.",unableToLoad:"Unable to load AI Providers"}}},"zh-CN":{translation:{locale:{en:"English","zh-CN":"简体中文",vi:"越南语",ja:"日语"},layout:{languageSwitcher:"语言"},nav:{general:"通用",home:"首页",analytics:"分析",identityAccess:"身份与访问",apiProfiles:"API 配置",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"概览",controlPanel:"控制面板",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",claudeExtension:"Claude Extension",accounts:"账号",allAccounts:"全部账号",sharedData:"共享数据",compatibleClis:"兼容",deprecated:"已弃用",factoryDroid:"Factory Droid",system:"系统",health:"健康",logs:"日志",settings:"设置",openrouterTooltip:"精选:OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"配置",cliproxy:"CLIProxy",accounts:"账号",health:"健康",configurationRequired:"需要配置"},auth:{dashboardTitle:"CCS 控制台",protectedAccessLabel:"受保护访问",remoteGuardLabel:"远程访问保护",loading:"正在检查控制台访问状态…",loginDescription:"使用主机上配置的用户名和密码访问控制台。",username:"用户名",password:"密码",usernamePlaceholder:"请输入用户名",passwordPlaceholder:"请输入密码",signIn:"登录",signingIn:"登录中...",loginFailed:"登录失败",lightMode:"浅色",darkMode:"深色",noDefaultCredentials:"CCS 不提供默认用户名或密码。",credentialsHint:"凭据需要在 CCS 主机上通过 `ccs config auth setup` 创建;Docker 部署必须在容器内运行该命令。",remoteSetupTitle:"远程访问需要完成认证设置",remoteSetupDescription:"当前通过非本机地址打开控制台,但此 CCS 实例尚未启用控制台认证。",incompleteSetupDescription:"控制台认证已开启,但设置尚未完成。请先为此 CCS 实例完成配置再登录。",safetyNoteRemote:"在 CCS 主机所有者启用控制台认证前,远程管理会保持锁定。",safetyNoteLocal:"如果你就在这台机器上,使用 localhost 地址始终是最直接的方式。",safetyNoteSession:"登录成功后会创建仅限此控制台主机的 HTTP-only 会话。",hostStepTitle:"在 CCS 主机上操作",hostStepDescription:"创建或重新启用控制台凭据,然后再从远程设备重新打开此页面。",dockerStepDescription:"如果是 Docker 部署,请在正在运行的容器内执行:",localStepTitle:"如果这就是你的机器",localStepDescription:"请使用 `ccs config` 输出的 localhost 地址,而不是局域网或 Tailscale 地址。",showPassword:"显示密码",hidePassword:"隐藏密码"},commonToast:{apiKeyRequired:"API key 为必填项",accountAddedPresetFailed:"账号已添加,但应用默认预设失败",settingsCopied:"设置已复制到剪贴板",enterPresetName:"请先输入预设名称再保存",codeCopied:"验证码已复制到剪贴板",copyCodeFailed:"复制验证码失败",appliedModelAllTiers:"已将模型应用到全部层级",settingsSaved:"设置已保存",defaultTargetUpdated:"默认目标已更新",failedUpdateDefaultTarget:"更新默认目标到 {{target}} 失败{{suffix}}"},profileDialog:{editTitle:"编辑配置",createTitle:"创建 API 配置",name:"名称",namePlaceholder:"my-api",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API Key",defaultModel:"默认模型(ANTHROPIC_MODEL)",defaultModelHint:"留空则使用:{{model}}",modelMappingTitle:"模型映射(Opus/Sonnet/Haiku)",modelMappingDesc:"为不同档位配置不同模型 ID,适合按模型类型路由到不同后端的 API 代理。",opusModel:"Opus 模型(ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet 模型(ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku 模型(ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"取消",saving:"保存中...",update:"更新",create:"创建"},modelTierMapping:{title:"模型档位映射",advanced:"高级",description:"为 Claude Code 的 opus/sonnet/haiku 档位配置不同模型。",autoSuggest:"基于 {{provider}} 自动建议",opusPlaceholder:"例如:anthropic/claude-opus-4",sonnetPlaceholder:"例如:anthropic/claude-sonnet-4",haikuPlaceholder:"例如:anthropic/claude-3.5-haiku",footer:"这些字段对应 ANTHROPIC_DEFAULT_OPUS_MODEL、ANTHROPIC_DEFAULT_SONNET_MODEL、ANTHROPIC_DEFAULT_HAIKU_MODEL。"},envEditor:{sensitive:"敏感",none:"尚未配置环境变量。",noneHint:"可在下方输入添加,或直接编辑 JSON。",addVariable:"添加环境变量",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"value"},setupVariant:{using:"当前使用:",variantNameRequired:"运行时变体名称 *",variantNamePlaceholder:"例如:my-gemini、g3、flash",invokeHintPrefix:"使用此变体运行:",model:"模型",modelPlaceholder:"例如:gemini-2.5-pro、claude-opus-4-6-thinking",choosePresetInstead:"改为从预设中选择",selectModel:"选择模型",customModelName:"自定义模型名称...",enterAnyModel:"可输入 CLIProxy 支持的任意模型名",defaultModel:"默认:{{model}}",providerDefault:"提供商默认值",back:"返回",skip:"跳过",creating:"创建中...",createVariant:"创建变体",skipHint:"如果账号设置已足够且不需要单独运行时变体,可以跳过"},customPresetDialog:{title:"自定义预设",presetNameOptional:"预设名称(可选)",presetNamePlaceholder:"例如:我的自定义配置",codexTipPrefix:"Codex 提示:后缀",codexTipSuffix:"会固定 effort。无后缀模型使用 Thinking 设置。",defaultModel:"默认模型",defaultModelDesc:"未指定档位时使用",opusModel:"Opus(最强)",opusModelDesc:"用于复杂推理任务",sonnetModel:"Sonnet(均衡)",sonnetModelDesc:"兼顾速度与能力",haikuModel:"Haiku(快速)",haikuModelDesc:"适合简单任务的快速响应",cancel:"取消",savePreset:"保存预设",applyPreset:"应用预设",deletePreset:"删除预设"},componentModelSelector:{selectModel:"选择模型",availableModelsCount:"可用模型({{count}})",preview:"预览"},searchableSelect:{searchModels:"搜索模型...",noResults:"未找到匹配结果。"},copilotSettings:{enableCopilot:"启用 Copilot",enableCopilotDesc:"允许使用 GitHub Copilot 订阅",basicSettings:"基础设置",accountType:"账户类型",accountTypeIndividual:"个人",accountTypeBusiness:"企业",accountTypeEnterprise:"组织",rateLimiting:"速率限制",rateLimitSeconds:"速率限制(秒)",noLimit:"不限制",waitOnRateLimit:"触发限速时等待",waitOnRateLimitDesc:"达到限制时等待而不是报错",daemonSettings:"守护进程设置",autoStartDaemon:"自动启动守护进程",autoStartDaemonDesc:"使用配置时自动启动 copilot-api"},providerModelSelector:{selectModel:"选择模型",noModelsForProvider:"该提供商暂无可用模型",broken:"故障",deprecated:"已弃用",paid:"付费",freeTier:"免费档",paidTier:"付费档",modelKnownIssues:"该模型存在已知问题",viewIssueDetails:"查看问题详情",modelDeprecated:"该模型已弃用",recommended:"推荐",allModelsCount:"全部模型({{count}})",noModelsAvailable:"暂无可用模型",shadowed:"已遮蔽",prefixOnly:"仅前缀",current:"当前",currentValue:"当前值",preferredPinnedModel:"偏好的固定模型:",pinnedRouteStatus:"固定路由状态:",pinnedModelNotAdvertised:"固定模型当前未被代理广播:{{model}}"},createAuthProfileDialog:{title:"创建新账号",description:"Auth 配置需要先完成 Claude CLI 登录。请在终端执行下方命令。稍后你仍可在 Accounts 表中编辑同步模式、分组与连续性深度。",profileName:"配置名称",profileNamePlaceholder:"例如:work、personal、client",invalidProfileName:"名称必须以字母开头,且只能包含字母、数字、短横线或下划线。",enableSharedHistory:"与其他 ccs auth 账号启用共享历史同步",historySyncGroupOptional:"历史同步分组(可选)",historySyncGroupPlaceholder:"default、sprint-a、client-x",historySyncGroupHint:"留空将使用默认共享分组。空格会自动规范为短横线。",deeperContinuity:"高级:更深连续性模式",deeperContinuityHint:"会同步 session-env、file-history、shell-snapshots 与 todos。凭据仍保持隔离。",invalidContextGroup:"分组必须以字母开头,且只能包含字母、数字、短横线或下划线(最多 {{max}} 个字符)。",command:"命令",commandFallback:"ccs auth create <name>",afterRunPrefix:"执行命令后:",afterRunStep1:"在浏览器中完成 Claude 登录",afterRunStep2:"返回此处并刷新,即可看到新账号",poolingHint:"如果更倾向于共享池化 Claude OAuth 路由,可在 Accounts 页面操作按钮中使用 CLIProxy Claude pool。",close:"关闭",copied:"已复制!",copyCommand:"复制命令"},accountRouteGuide:{title:"推荐的双账号路线",description:"使用独立 account profile 保持 token 隔离。只有当两个账号应该看到同一份本地连续性时,才开启历史同步。",status:{empty:"创建账号",isolated:"隔离已就绪",shared:"共享项目上下文",deeper:"更深同步已就绪",mixed:"混合设置"},cards:{isolated:{title:"Token 仍然隔离",desc:"每个 ccs auth 账号都有自己的 Claude 配置、登录和凭据。同步设置不会复制 token。"},select:{title:"你选择使用哪个账号",desc:"运行 ccs work 或 ccs personal 来明确选择账号。只有当普通 ccs 应跟随某个账号时才设置默认。"},settings:{title:"设置跟随根目录",desc:"非 bare 账号会通过 CCS shared state 将 settings.json 链接到 ~/.claude/settings.json。ccs auth show 会确认状态。"},sync:{title:"历史同步需要主动开启",desc:"两个账号都需要使用 Shared 模式和同一分组。更深同步会加入额外的本地连续性文件。"}},commands:{isolated:"隔离账号用法",sync:"可选共享历史",syncDesc:'当希望两个账号共享本地历史时,在两个账号上使用同一分组,例如 "{{group}}"。'}},cliproxyModelCategory:{google:"Google(Gemini)",openai:"OpenAI(GPT)",anthropic:"Anthropic(Claude)",antigravity:"Antigravity",other:"其他"},cliproxyOverviewComponents:{availableModels:"可用模型",noModelsAvailable:"暂无可用模型",startSessionHint:"启动 CLIProxy 会话后即可拉取可用模型",totalCount:"共 {{count}} 个",availableThroughGroupedByProvider:"通过 {{backendLabel}} 提供的模型,按提供商分组",moreCount:"另外 {{count}} 个"},categorizedModelSelector:{selectModel:"选择模型",noModelsAvailable:"暂无可用模型",modelPlaceholder:"模型..."},openrouterQuickStart:{recommended:"推荐",title:"从 OpenRouter 开始",description:"通过一个 API 即可访问来自 OpenAI、Anthropic、Google、Meta 等的 {{modelCountLabel}} 个模型。",featureOneApi:"一个 API,接入全部提供商",profileSummaryCount:"{{count}} 个配置",profileSummaryCount_other:"{{count}} 个配置",profileSummaryEmpty:"高级质量 + 本地控制",summaryBadgeDefaultQuality:"默认最佳质量",summaryBadgeLocalLane:"任务合适时使用本地通道",summaryExistingTitle:"选择一个配置,或添加新的通道",summaryEmptyTitle:"选择你的第一条配置通道",summaryExistingDescription:"此工作区中已存在 {{count}} 个配置。对于严肃编码工作请优先使用高质量提供商,而在隐私、成本或离线场景下再增加本地运行时。",summaryExistingDescription_other:"此工作区中已存在 {{count}} 个配置。对于严肃编码工作请优先使用高质量提供商,而在隐私、成本或离线场景下再增加本地运行时。",summaryEmptyDescription:"根据任务选择通道。高级提供商仍是可靠编码的默认选择;本地运行时更适合隐私、低成本转换和实验。",qualityLanesTitle:"高质量通道",qualityLaneHighlightDefaultQuality:"高风险编码任务的默认最佳通道",alibabaLaneDescription:"当你想要一个独立于 OpenRouter 目录之外的高级编码通道时,这是一个强力的直连配置。",alibabaLaneHighlightQuality:"适合需要独立端点的高级质量场景",localRuntimesTitle:"本地运行时",localOllamaTitle:"Ollama + Gemma 4",localOllamaLabel:"Ollama",localOllamaHighlight:"最适合隐私敏感提示、本地清理和低成本批处理转换",localLlamacppTitle:"llama.cpp",localLlamacppLabel:"llama.cpp",localLlamacppHighlight:"最适合自定义 GGUF 部署和高级自托管本地工作流",localDetectedModels:"已检测到 {{count}} 个本地模型",localDetectedModels_other:"已检测到 {{count}} 个本地模型",localNoModelsDetected:"尚未检测到本地模型",localWaitingServer:"正在等待本地服务和模型列表",localRuntimeCheckingBadge:"检测中",localRuntimeReadyBadge:"就绪",localRuntimeNeedsModelBadge:"缺少模型",localRuntimeOfflineBadge:"离线",localRuntimeCheckingDescription:"正在检查本地运行时状态,然后再显示设置引导。",localRuntimeReadyDescription:"最适合私有提示、离线工作流和更便宜的批量转换。",localRuntimeNeedsModelDescription:"运行时已启动,但推荐的本地模型仍需要拉取或加载。",localRuntimeOfflineDescription:"这个通道适合隐私敏感工作、低成本本地转换和离线会话。",localRuntimeCheckingFooter:"正在检查本地运行时...",localRuntimeReadyFooter:"端点已就绪:{{endpoint}}",localRuntimeMissingModelFooter:"运行 `{{command}}` 完成本地设置。",localRuntimeOfflineFooter:"运行 `{{command}}` 启动本地端点。",localRuntimeSetupAction:"设置 {{label}}",localRuntimeUseAction:"使用 {{label}}",localRuntimeFinishAction:"完成 {{label}} 设置",runtimeProviderBadge:"运行时提供商设置",runtimeProviderTitle:"打开 AI Providers",runtimeProviderManagedDescription:"当你需要 CLIProxy 管理的连接器、提供商密钥和高级路由控制时使用这里。",runtimeProviderFeatureConnectors:"Gemini、Codex、Claude、Vertex 以及 OpenAI 兼容连接器",runtimeProviderFeatureSecrets:"共享密钥与单个 API 配置分离存放",runtimeProviderFooter:"当多个配置需要共享同一提供商设置时最适合使用。",createOpenRouterProfile:"创建 OpenRouter 配置",getApiKeyAt:"在此获取 API Key:",createCustomProfile:"创建自定义 API 配置"},alibabaCodingPlanQuickStart:{recommended:"推荐",title:"试用阿里云 Coding Plan",description:"通过 Anthropic 兼容端点接入阿里云 Model Studio Coding Plan。",featureEndpoint:"Anthropic 兼容端点",featureKeyFormat:"专用 sk-sp API Key",createAlibabaProfile:"创建 Alibaba Coding Plan 配置",readGuideAt:"查看配置文档:"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"通过 Anthropic 端点接入 Model Studio Coding Plan",add:"添加"},credentialHealth:{title:"凭据健康状态",ready:"就绪",noCredentialsConfigured:"尚未配置凭据。请使用上方登录按钮完成认证。",neverUsed:"从未使用",justNow:"刚刚",unknown:"未知",daysAgo:"{{count}} 天前",hoursAgo:"{{count}} 小时前",minutesAgo:"{{count}} 分钟前"},proxyStatusWidget:{justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",syncReady:"同步就绪",noConfig:"未配置",remoteProxy:"远程代理",active:"已连接",trafficAutoRouted:"流量已自动转发到远程服务器",tooltipSync:"同步配置到 CLIProxy",tooltipRestart:"重启",tooltipStop:"停止",tooltipClose:"关闭",tooltipVersionSettings:"版本设置",versionManagement:"版本管理",selectVersionPlaceholder:"选择要安装的版本...",stable:"(稳定版)",install:"安装",versionsAboveUnstable:"高于 {{version}} 的版本存在已知问题",versionsKnownIssues:"版本 {{version}} 存在已知问题",lastChecked:"上次检查 {{time}}",notRunning:"未运行",start:"启动",port:"端口 {{port}}",sessionCount:"{{count}} 个会话",sessionCount_other:"{{count}} 个会话",installFaultyTitle:"安装存在已知问题的版本?",installFaultyDesc:"即将安装 <strong>v{{version}}</strong>,该版本位于已知故障范围 <strong>{{range}}</strong> 内。",installFaultyWarning:"该版本存在已知缺陷,可能安装失败或让代理处于异常状态。",installUnstableTitle:"安装非稳定版本?",installUnstableDesc:"即将安装 <strong>v{{version}}</strong>,该版本高于当前最大稳定版 <strong>v{{maxStable}}</strong>。",installUnstableWarning:"该版本存在已知稳定性问题,可能导致异常行为。",installUnstableConfirm:"确定要继续吗?",cancel:"取消",installAnyway:"仍要安装",clickToDowngrade:"点击降级",clickToUpdate:"点击更新"},syncStatusCard:{profileSync:"配置同步",ready:"就绪",noConfig:"未配置",syncsProfilesDesc:"将 API 配置同步到本地 CLIProxy 配置",runDoctorHint:"运行 <code>ccs doctor --fix</code> 生成配置。",details:"详情",syncNow:"立即同步"},syncDialog:{title:"同步配置到本地 CLIProxy",description:"将 CCS API 配置同步到本地 CLIProxy 的 config.yaml。",noProfiles:"没有可同步的配置。",createProfilesFirst:"请先在「配置」页创建 API 配置。",modelLabel:"模型:",ready:"就绪",profilesToSync_one:"{{count}} 个配置待同步",profilesToSync_other:"{{count}} 个配置待同步",cancel:"取消",syncing:"同步中...",synced:"已同步!",syncNow:"立即同步"},errorLogs:{title:"错误日志",failedRequests_one:"{{count}} 个失败请求",failedRequests_other:"{{count}} 个失败请求",cliproxyDiagnostics:"CLIProxy 诊断",showingCount:"显示 50 / {{total}} 条",selectLog:"选择一条日志查看详情",failedLoadContent:"加载日志内容失败",copyAbsolutePath:"复制绝对路径",copyRawContent:"复制原始日志",tabOverview:"概览",tabHeaders:"请求头",tabRequest:"请求体",tabResponse:"响应体",tabRaw:"原始",modelLabel:"模型:",quotaResetsIn:"配额重置于 ",method:"方法",provider:"提供商",version:"版本",endpoint:"端点",url:"URL",timestamp:"时间戳",na:"无",noHeaders:"无请求头",noRequestBody:"无请求体内容",noResponseBody:"无响应体内容",rateLimitedMsg:"触发限速。请切换账号或等待配额重置。模型 {{model}} 配额已用尽。",rateLimitedMsgNoModel:"触发限速。请切换账号或等待配额重置。",authFailedMsg:"认证失败。请通过 CLIProxy 设置重新认证或检查 API Key。",notFoundMsg:"端点未找到,该提供商可能不存在此端点。",serverErrorMsg:"上游服务器错误。请稍后重试或查看提供商状态页。",timeoutMsg:"请求超时。请检查网络或增大超时设置。",unknown:"未知"},editAccountContext:{title:"编辑历史同步",description:"配置「{{name}}」与其他 ccs auth 账号共享历史与连续性的方式。",syncMode:"同步模式",selectContextMode:"选择同步模式",isolatedOption:"隔离(不同步)",sharedOption:"共享(启用同步)",sharedModeHint:"共享模式会为同一历史同步分组内的账号复用工作区上下文。",isolatedModeHint:"隔离模式使该账号与其他 ccs auth 账号完全独立。",historySyncGroup:"历史同步分组",groupPlaceholder:"default",groupHint:"会规范为小写(空格变为短横线)。允许:字母、数字、_、-(最多 {{max}} 字符)。",invalidGroup:"请输入以字母开头的有效分组名。",continuityDepth:"连续性深度",selectContinuityDepth:"选择连续性深度",standardOption:"标准(仅项目)",deeperOption:"更深连续性(高级)",deeperHint:"高级模式还会同步 session-env、file-history、shell-snapshots 和 todos。",standardHint:"标准模式仅同步项目工作区上下文。",credentialsIsolated:"凭据与 .anthropic 在所有模式下均按账号隔离。",implicationTitle:"保存后会发生什么",isolatedImplication:"该账号会继续保持隔离,其他账号无法续接它的连续性状态。",sameGroupRule:"只有账号都使用同一个分组“{{group}}”时,才会彼此共享连续性。",noSameGroupPeer:"当前没有其他账号使用这个分组。",sameGroupPeerCount_one:"已有 {{count}} 个其他账号使用这个分组。",sameGroupPeerCount_other:"已有 {{count}} 个其他账号使用这个分组。",deeperReady_one:"已有 {{count}} 个同组账号启用更深连续性。这是当前最强的交接设置。",deeperReady_other:"已有 {{count}} 个同组账号启用更深连续性。这是当前最强的交接设置。",deeperNeedsPeers:"此账号已启用更深连续性,但同组中的其他账号也需要启用更深连续性,才能更好满足跨账号续接的预期。",standardWarning:"标准共享更适合项目上下文。如果用户期望跨账号续接,两个账号都应启用更深连续性。",resumeOriginalWarning:"如果旧会话很重要,请先在原账号中恢复它,再调整设置。",cancel:"取消",save:"保存",saving:"保存中..."},historySyncLearningMap:{title:"历史同步说明",description:"隔离 -> 共享 -> 更深。在每行使用「同步」进行所有更改。",learningMap:"说明",isolated:"隔离",shared:"共享",deeper:"更深",cliproxyManaged_one:"{{count}} 个 CLIProxy Claude 池账号在操作中心 / CLIProxy 页面管理。",cliproxyManaged_other:"{{count}} 个 CLIProxy Claude 池账号在操作中心 / CLIProxy 页面管理。",showDetails:"显示详情:分组、切换与旧策略",modeSwitch:"模式切换",modeSwitchDesc:"同步对话框可让用户在隔离/共享间切换并选择更深连续性。",historySyncGroup:"历史同步分组",historySyncGroupDesc:"同一分组即共享项目上下文。默认回退为 default。",sameGroupRule:"只有两个账号都设为共享且使用同一分组时,才会共享连续性。",deeperRecommendation:"分组“{{group}}”已开启共享,但如果用户期望跨账号续接,更推荐同时启用更深连续性。",partialGroup:"分组“{{group}}”已经配置得不错,但其他账号或分组仍需要补齐同组或更深连续性设置。",readyGroup:"分组“{{group}}”已有多个账号启用更深连续性。这是当前最强的交接设置。",legacyConfirmation_one:"{{count}} 个旧账号仍需要显式确认。",legacyConfirmation_other:"{{count}} 个旧账号仍需要显式确认。"},continuityReadiness:{title:"跨账号续接检查",description:"在切换账号前,用这张卡快速确认还缺什么。",state:{single:"单账号",isolated:"续接关闭","shared-alone":"已共享但未完成","shared-standard":"仅项目共享",partial:"部分就绪",ready:"强交接已就绪"},metrics:{isolated:"隔离账号",sharedPeers:"有同组伙伴",deeperReady:"更深已就绪"},messages:{single:{title:"目前只配置了一个 auth 账号。",description:"现在还不涉及跨账号交接。请先再添加一个 auth 账号,再配置共享连续性。"},isolated:{title:"当前还没有开启跨账号续接。",description:"当前可见账号都处于隔离模式,因此在一个账号中创建的会话仍会留在原账号。"},"shared-alone":{title:"已经开启共享,但还没有任何分组拥有同组伙伴。",description_one:"{{count}} 个共享账号仍在等待另一个账号加入同一分组。",description_other:"{{count}} 个共享账号仍在等待另一个账号加入同一分组。"},"shared-standard":{title:"分组“{{group}}”已共享项目上下文,但尚未形成更深连续性的配对。",description:"用户可能期望的不只是项目共享。如果希望更稳妥地支持跨账号续接,请让这个分组中的两个账号都启用更深连续性。"},partial:{title:"已有一个分组准备就绪,但整体配置仍是混合状态。",description:"至少有一个分组已经启用更深连续性,但其他账号仍可能处于隔离、单独共享分组,或尚未启用更深连续性。"},ready:{title:"分组“{{group}}”已经具备当前最强的连续性设置。",description:"这个分组中已有多个账号启用更深连续性。是否能够恢复仍取决于 Claude 上游实际保存了什么。"}},stepsTitle:"下一步建议",steps:{syncBoth:"请在两个账号上都打开“同步”,而不是只调整要切换进去的那个账号。",sameGroup:"两个账号都使用同一个历史同步分组。“{{group}}”是当前推荐的分组。",enableDeeper:"如果用户期望的是跨账号续接,而不是仅共享项目上下文,请在两个账号上都启用更深连续性。",resumeOriginal:"如果原来的会话很重要,请先在原账号中恢复它,再修改连续性设置。"},singleSteps:{addAccount:"先再创建一个 ccs auth 账号,然后再考虑跨账号交接。",sameGroupLater:"当第二个账号准备好后,再把两个账号放到同一个历史同步分组。",enableDeeperLater:"如果未来会期望跨账号续接而不是仅共享项目上下文,请在两个账号上都启用更深连续性。",resumeOriginal:"在第二个账号配置完成之前,重要会话仍应从原账号继续恢复。"}},continuityOverview:{plainLaneTitle:"普通 ccs 正在使用不同的续接通道",plainLaneDescription:"普通 ccs 当前会从 {{lane}} 续接,而不是这个账号通道。请先恢复原通道中的会话,再修改同步设置。",setDefaultHint:"如果希望以后普通 ccs 跟随某个账号,请使用该账号行上的“设为默认”。",recommendBadge:"建议 {{group}}",partialBadge:"部分同步 {{group}}",lane:{native:"原生 Claude(~/.claude)",accountDefault:"账号 {{name}}",accountInherited:"通过连续性继承使用账号 {{name}}",profileDefault:"默认配置 {{name}}(仍走原生 Claude 通道)"}},accountsTable:{name:"名称",type:"类型",defaultBadge:"默认",created:"创建时间",lastUsed:"最后使用",historySync:"历史同步",actions:"操作",syncTitle:"编辑同步模式、分组与连续性深度",confirmLegacyTitle:"确认此旧账号的当前模式为显式",sync:"同步",confirm:"确认",active:"当前",setDefault:"设为默认",deleteAccount:"删除账号",cannotDeleteDefault:"不能删除默认账号",noAccounts:"未找到 CCS auth 账号。请使用 ccs auth create 添加。",resetToDefault:"恢复为 CCS 默认",deleteDialogTitle:"删除账号",deleteDialogDesc:"确定要删除账号「{{name}}」吗?将移除该配置及其所有会话数据,且无法撤销。",cancel:"取消",delete:"删除",sharedGroupStandard:"共享({{group}},标准)",sharedGroupDeeper:"共享({{group}},更深)",sharedGroupLegacy:"共享({{group}},标准旧策略)",isolatedLegacy:"隔离(旧默认)",isolated:"隔离",noSameGroupPeer:"同组中还没有其他账号",sameGroupPeerCount_one:"{{count}} 个同组账号",sameGroupPeerCount_other:"{{count}} 个同组账号",legacyReview:"请检查并确认这个推断出的默认状态。",noHandoff:"跨账号续接仍会回到原账号。",badges:{shared:"共享",deeper:"更深",legacy:"旧策略",isolated:"隔离"}},addAccountDialog:{title:"添加 {{displayName}} 账号",descKiro:"选择 Kiro 认证方式,然后通过浏览器或从 Kiro IDE 导入完成认证。",descDeviceCode:"点击认证后,验证码将显示,请在提供商网站输入。",descOauth:"点击认证获取 OAuth URL,在任意浏览器中打开即可登录。",powerUserEnabled:"已启用高级用户模式",powerUserSkipped:"设置 > 代理 中的高级用户模式会跳过 AGY 责任确认清单和 Gemini Dashboard 的风险短语。OAuth / 账号风险需自行承担。",powerUserLoadFailed:"加载高级用户模式设置失败。请检查“设置 > 代理”后重试。",powerUserLoading:"正在加载高级用户安全设置。请稍候后重试。",powerUserUnavailableRetry:"高级用户模式不可用。请完成当前提供商要求的安全步骤后重试。",authMethod:"认证方式",selectKiroAuthMethod:"选择 Kiro 认证方式",gitlabAuthMethod:"GitLab 认证方式",selectGitlabAuthMethod:"选择 GitLab 认证方式",gitlabAuthOAuth:"浏览器 OAuth",gitlabAuthPat:"个人访问令牌",gitlabAuthHint:"gitlab.com 推荐使用浏览器 OAuth;自托管或管理员管理场景可使用 PAT。",gitlabUrl:"GitLab URL",gitlabUrlPlaceholder:"https://gitlab.com",gitlabUrlHint:"可选。留空表示 gitlab.com,或填写你的自托管 GitLab 基础 URL。",gitlabPat:"个人访问令牌",gitlabPatPlaceholder:"glpat-...",gitlabPatHint:"令牌至少需要包含",gitlabPatRequired:"PAT 登录需要提供 GitLab 个人访问令牌。",nicknameRequired:"昵称(必填)",nicknameOptional:"昵称(选填)",nicknamePlaceholder:"例如:工作、个人",nicknameRequiredHint:"该提供商必填。请使用唯一易记名称(如工作、个人)。",nicknameOptionalHint:"用于区分账号的友好名称。留空将自动生成安全标识。",waitingForAuth:"等待认证中...",deviceCodeHint:"验证码对话框即将出现,请在提供商网站输入验证码。",browserHint:"在浏览器中完成认证后,本对话框将自动关闭。",openUrlLabel:"在任意浏览器中打开此 URL 登录:",copied:"已复制",copy:"复制",open:"打开",popupBlocked:"弹窗被拦截。请复制上方 URL 在浏览器中手动打开。",redirectPasteLabel:"重定向未生效?请粘贴回调 URL:",callbackPlaceholder:"在此粘贴重定向 URL...",submitCallback:"提交回调",submitting:"提交中...",preparingUrl:"正在准备登录 URL...",cancel:"取消",importingToken:"正在从 Kiro IDE 导入令牌...",authenticate:"认证",importFromIde:"从 IDE 导入",importing:"导入中..."},flowViz:{backToProviders:"返回提供商",showDetails:"显示详情",hideDetails:"隐藏详情",showPausedAccounts:"显示已暂停 ({{count}})",hidePausedAccounts:"隐藏已暂停 ({{count}})",visibleTotalRequests:"可见请求数",visibleAccounts:"可见账号",excludingPausedAccounts:"已排除 {{count}} 个已暂停",resetLayout:"重置布局",provider:"提供商",totalRequests:"总请求数",accounts:"账号",connectionTimeline:"连接时间线",noRecentConnections:"暂无最近连接"},quickStats:{totalRequests:"总请求数",successRate:"成功率",totalTokens:"总 Token 数",activeModels:"活跃模型数"},authMonitor:{accounts:"账号",accountsCount:"{{count}} 个账号",success:"成功",failed:"失败",successRate:"成功率"},accountCard:{resumeAccount:"恢复账号",pauseAccount:"暂停账号",quotaLoading:"配额...",quota:"配额",quotaUnavailable:"配额限制不可用",reauthNeeded:"需要重新认证",failureLabelReauth:"重新认证",failureLabelWorkspace:"工作区",failureLabelNoAccess:"无权限",failureLabelRetry:"重试",failureLabelReconnect:"重新连接",failureLabelTemporary:"临时问题",failureLabelUnavailable:"不可用",failureHintReauth:"请重新运行该账号的认证流程以刷新访问权限。",failureHintWorkspace:"请将该账号移回可用的工作区,然后移除并重新添加。",failureHintNoAccess:"该账号无法访问提供商的配额接口。",failureHintRetry:"稍后再试一次。",failureHintReconnect:"请移除这个失效账号并重新认证。",failureHintTemporary:"这看起来是临时问题,请稍后重试。",removeAndReadd:"移除并重新添加账号",autoRefreshFailed:"自动刷新失败"},antigravityChecklist:{title:"Antigravity OAuth 责任须知",subtitle:"认证前请完成全部 4 步。",mandatory:"必读",completion:"完成度",stepsCount:"{{current}}/4 步"},accountSafetyWarning:{title:"OAuth 账号安全提示",subtitle:"Issue #509 · Gemini + AGY OAuth 风险",firstLine:"Issue #509 记录了与 ccs agy 及 ccs gemini 与 ccs agy 共享账号使用相关的封禁/停用报告。",secondLine:"仅在您愿意承担 OAuth 与账号访问风险的前提下继续。",issueLabel:"查看 issue #509",proxySettingsLabel:"Gemini + AGY 控制:设置 > 代理"},cliproxyDialog:{name:"名称",provider:"提供商",account:"账号",accountOptional:"账号(选填)",model:"模型",modelOptional:"模型(选填)",defaultTarget:"默认目标",defaultTier:"默认档位",tierConfig:"档位配置",selectProvider:"选择提供商...",useDefaultAccount:"使用默认账号",defaultSuffix:"(默认)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"取消",create:"创建",creating:"创建中...",saveChanges:"保存更改",saving:"保存中...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"编辑复合变体:{{name}}",editSingleTitle:"编辑单一样式:{{name}}"},profileEditor:{profileInfo:"配置信息",profileName:"配置名称",filePath:"文件路径",lastModified:"最后修改",defaultTarget:"默认目标",quickUsage:"快速使用",runWithProfile:"使用配置运行",runOnDroid:"在 Droid 上运行",runOnDroidWithFlag:"通过 --target 在 Droid 上运行",droidAliasExplicit:"Droid 别名(显式)",overrideToClaude:"切换为 Claude",overrideToClaudeExplicit:"切换为 Claude(显式)",targetHintPreferredAlias:"推荐显式别名:",targetHintClaudeDefault:"默认命令:",targetHintLegacyAlias:"旧快捷方式仍可用:",targetHintOverride:"你仍可在每次运行时用",setAsDefault:"设为默认",provider:"提供商",custom:"自定义",providerChooserHint:"先选择一个预设,之后仍可调整 URL、API key 和模型映射。",featuredProviders:"精选提供商",scrollHint:"屏幕较窄时可横向滚动",customEndpoint:"自定义端点",morePresets:"更多预设",customEndpointDescription:"从空白的 Anthropic 兼容 URL 开始,手动配置全部内容。"},settings:{sectionLoadFailed:"加载分区失败",unknownError:"发生未知错误",reloadPage:"重新加载页面",refresh:"刷新",copy:"复制",copied:"已复制",saved:"已保存",loading:"加载中...",configFileNotFound:"未找到配置文件"},settingsTabs:{browser:"浏览器",web:"网页",image:"图片",channels:"频道",env:"环境",think:"思考",proxy:"代理",auth:"认证",backup:"备份"},settingsAuth:{failedFetchTokens:"获取认证令牌失败",failedSaveTokens:"保存令牌失败",tokensUpdated:"令牌已更新,请重启 CLIProxy 生效。",failedRegenerate:"重新生成密钥失败",secretRegenerated:"新的管理密钥已生成,请重启 CLIProxy 生效。",failedReset:"重置令牌失败",tokensReset:"令牌已重置为默认值,请重启 CLIProxy 生效。",description:"配置 CLIProxy 认证令牌。修改后需要重启 CLIProxy。",apiKey:"API Key",custom:"自定义",apiKeyDesc:"Claude Code 通过该值向 CLIProxy 鉴权",apiKeyPlaceholder:"API key",managementSecret:"管理密钥",managementSecretDesc:"CCS Dashboard 使用该值访问 CLIProxy 管理接口",managementSecretPlaceholder:"管理密钥",generateSecret:"生成新的安全密钥",resetDefaults:"重置为默认值",resetDesc:"将 API key 和管理密钥都恢复为默认值。",saving:"保存中...",save:"保存"},settingsGlobalEnv:{description:"向所有非 Claude 订阅型配置注入环境变量(gemini、codex、agy、ghcp 等)",enabled:"全局环境变量已启用",disabled:"全局环境变量已禁用",enabledDesc:"环境变量将注入第三方配置",disabledDesc:"环境变量不会被注入",envVars:"环境变量",noneConfigured:"尚未配置环境变量",addNew:"新增变量",keyName:"KEY_NAME",value:"value",add:"添加",quickAdd:"快速添加常用变量",allConfigured:"常用变量已全部配置"},settingsBackups:{failedFetch:"获取备份失败",failedRestore:"恢复备份失败",restoreSuccess:"备份恢复成功",title:"设置备份",description:"恢复 settings.json 的历史版本。每次修改设置时会自动创建备份。",none:"暂无备份",noneHint:"修改设置后,备份会显示在这里",latest:"最新",restoring:"恢复中...",restore:"恢复",restoreConfirmTitle:"确认恢复备份?",restoreConfirmPrefix:"这将用以下备份替换当前设置:",restoreConfirmSuffix:"此操作不可撤销。",cancel:"取消"},settingsWebsearch:{description:"面向第三方配置(gemini、codex、agy 等)的 CLI 网页搜索",enabled:"WebSearch 已启用",disabled:"WebSearch 已禁用",checking:"正在检查状态...",providers:"提供商",noneConfigured:"未配置任何提供商",noneConfiguredHint:"请先安装 CLI 工具以启用网页搜索提供商",checkProviders:"检查可用提供商",installed:"已安装",notInstalled:"未安装",model:"模型:",howInstall:"如何安装 {{name}} CLI",installGlobally:"全局安装",requiresKey:"(需要 xAI API key)",freeTier:"(提供免费额度)",viewDocs:"查看文档"},settingsProxy:{failedLoadAgyMode:"加载高级模式失败",failedUpdateAgyMode:"更新高级模式失败",failedVerifyAgyMode:"校验高级模式持久化失败",notPersistedAgyMode:"高级模式未成功持久化,配置可能被其他进程修改。",agyModeEnabled:"高级模式已启用。",agyModeDisabled:"高级模式已关闭。",typePhraseToContinue:"请输入“{{value}}”后继续。",description:"为基于代理的配置设置本地或远程 {{backend}} 连接",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"实例状态",connectionMode:"连接模式",local:"本地",remote:"远程",localDesc:"在本机运行 {{backend}} 二进制",remoteDesc:"连接到远程 {{backend}} 服务器",backendBinary:"后端二进制",stopProxyToSwitch:"请先在实例状态中停止正在运行的代理,再切换后端。",default:"默认",plusDesc:"额外提供商的可选线路。仍受支持,但目前由社区维护而非上游维护。",originalDesc:"核心提供商线路的默认、始终可用后端。",plusFallbackNotice:"Plus 提供商线路并未弃用,但在受维护的 fork 恢复之前,本地 CLIProxy 仍会回退到原始后端。",variantsIncompatible:"现有 plus 扩展变体({{providers}})无法在原始后端上运行。可以保留作参考,但使用前请切换到 Plus。",safety:"安全",agyModeTitle:"Antigravity + Gemini 高级模式",agyModeDesc:"跳过 AGY 责任确认清单,以及 Gemini Dashboard 中输入风险短语的步骤。",agyWarning:"仅在你充分理解 OAuth 封禁风险模式(#509)后使用。CCS 不对账号损失承担责任。",finalConfirm:"需要最终确认",finalConfirmDesc:"启用后会跳过 Dashboard / CLI 中的 AGY 安全检查,以及 Gemini Dashboard 的风险短语确认。请先阅读 issue #509,并输入精确短语后继续。",step1:"步骤 1",readIssue:"阅读 issue #509",step2:"步骤 2",typePrefix:"输入",typeSuffix:"以启用。",typePhraseAria:"输入 I ACCEPT RISK 以启用 Antigravity + Gemini 高级模式",exactPhrase:"必须输入完全一致的短语。",enableAgyMode:"启用 Antigravity + Gemini 高级模式",toggleAgyMode:"切换 Antigravity + Gemini 高级模式",fallbackSettings:"回退设置",enableFallback:"启用本地回退",enableFallbackDesc:"远程不可达时使用本地代理",autoStartLocal:"自动启动本地代理",autoStartLocalDesc:"发生回退时自动启动本地代理",advanced:"高级",debugMode:"调试模式",debugModeDesc:"在浏览器控制台输出开发诊断信息",debugModeEnabled:"调试模式已开启,请在浏览器控制台查看详细日志。",localProxy:"本地代理",port:"端口",autoStart:"自动启动",localAutoStartDesc:"需要时自动启动本地代理",remoteConfigTitle:"远程服务器配置",host:"主机",hostPlaceholder:"192.168.1.100 或 proxy.example.com",defaultPort:"默认:{{value}}",portPlaceholder:"留空使用 {{value}}",protocol:"协议",http:"HTTP",https:"HTTPS",apiKeyOptional:"API Key(可选)",apiKeyPlaceholder:"用于 /v1/* API 接口",apiKeyDesc:"用于 /v1/chat/completions 接口请求",managementKeyOptional:"管理密钥(可选)",managementKeyPlaceholder:"用于 /v0/management/* 接口",managementKeyDesc:"用于 Dashboard 管理接口。未设置时回退使用 API Key。",testing:"测试中...",testConnection:"测试连接",connectedLatency:"已连接({{value}}ms)",connectionFailed:"连接失败",invalidPortOrEmpty:"端口必须是 1 到 65535 的整数,或留空使用默认值",invalidLocalPort:"本地端口必须是 1 到 65535 的整数",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"为支持的模型配置扩展思考/推理。",supportedProviders:"支持的提供商",modeTitle:"思考模式",modeAutoDesc:"根据模型档位自动设置思考级别",modeOffDesc:"关闭扩展思考",modeManualDesc:"设置持久覆盖级别,或按次使用 CLI 参数",tierDefaults:"档位默认值",tierDefaultsDesc:"自动模式下各模型档位的默认思考级别。",persistentOverride:"持久覆盖",persistentOverrideDesc:"应用到所有会话。CLI 参数仍具有更高优先级。",enterCustomBudget:"输入自定义预算",apply:"应用",providerOverrides:"提供商覆盖({{count}})",providerOverridesDesc:"为特定提供商覆盖档位默认值。可按需添加自定义提供商键。",addProviderPlaceholder:"添加提供商键(例如 qwen)",showWarnings:"显示告警",showWarningsDesc:"当思考值被限制或调整时显示告警",cliEnvOverride:"CLI 与环境变量覆盖",supportLine1Prefix:"思考预算:",supportLine1Suffix:"(基于 token)",supportLine2Prefix:"推理强度:",supportLine2SuffixPrefix:"(后缀或 ",supportLine2SuffixPostfix:":minimal/low/medium/high/xhigh)",supportLine3Prefix:"Codex 后缀会固定强度(例如 ",supportLine3Suffix:");无后缀模型使用 Thinking mode。"},analytics:{title:"分析",noDailyUsage:"今日无使用数据",noUsageData:"无可用使用数据",subtitle:"追踪使用情况与洞察",month:"本月",allTime:"全部时间",updated:"更新于 {{value}}"},analyticsSummary:{totalTokens:"总 Token",totalTokensSubtitle:"输入 {{input}} / 输出 {{output}}",totalCost:"总成本",totalCostSubtitle:"日均 ${{value}}",cacheTokens:"缓存 Token",cacheTokensSubtitle:"${{cost}}(占成本 {{percent}}%)",inputCost:"输入成本",outputCost:"输出成本",tokensSubtitle:"{{value}} 个 token"},apiProfiles:{title:"API 配置",sidebarTitle:"API 配置",sidebarSubtitle:"高级 API、本地运行时、自定义端点",new:"新建",searchPlaceholder:"搜索配置...",loadingProfiles:"正在加载配置...",failedLoadTitle:"加载配置失败",failedLoadDesc:"无法获取 API 配置,请稍后重试。",retry:"重试",noProfilesYet:"还没有 API 配置",noProfilesDesc:"创建你的第一个配置以连接自定义 API 端点",createProfile:"创建配置",noProfileMatch:"没有匹配“{{query}}”的配置",profileCount:"{{count}} 个配置",profileCount_other:"{{count}} 个配置",configuredCount:"{{count}} 个已配置",deleteProfileTitle:"删除配置",deleteProfileDesc:"确定要删除“{{name}}”吗?这会移除设置文件且无法恢复。",delete:"删除",unsavedChangesTitle:"未保存的更改",unsavedChangesDesc:"你在“{{current}}”中有未保存内容,是否丢弃并切换到“{{next}}”?",discardSwitch:"丢弃并切换",noOrphansFound:"未发现孤立配置",confirmRegisterOrphans:"发现 {{total}} 个孤立配置文件,其中 {{valid}} 个可直接注册。现在注册吗?",registeredWithSkipped:"(跳过 {{count}} 个)",registeredProfiles:"已注册 {{count}} 个配置",copyPrompt:"将“{{name}}”复制为哪个新配置名称?",destinationEmpty:"目标配置名称不能为空",exportRedacted:"导出内容中的令牌已脱敏。如需包含密钥,请改用 CLI 的 include-secrets 流程。",exportDownloaded:"配置导出已下载",importFailed:"导入配置包失败",discoverOrphans:"发现孤立配置",importProfileBundle:"导入配置包"},accountsPage:{title:"账号",managePrefix:"统一管理",manageSuffix:"账号与池化接入流程。",mobileManageSuffix:"的连续性配置。",primaryActions:"主要操作",createAccount:"创建账号",authClaudeInPool:"在 Pool 中认证 Claude",openClaudePoolSettings:"打开 Claude Pool 设置",openCliProxyClaudePool:"打开 CLIProxy Claude Pool",migrationFollowup:"迁移后续处理",legacyContextPending:"{{count}} 个账号仍需首次模式确认。",legacyContextPending_other:"{{count}} 个账号仍需首次模式确认。",legacyContinuityPending:"{{count}} 个共享账号仍处于标准旧版连续性深度。",legacyContinuityPending_other:"{{count}} 个共享账号仍处于标准旧版连续性深度。",confirmingLegacy:"正在确认旧版策略...",confirmLegacy:"确认旧版策略({{count}})",noLegacyFollowup:"暂无待处理的迁移后续项。",continuityGuide:"连续性指南",expandWhenNeeded:"按需展开查看。",sharedStandard:"共享标准",sharedStandardDesc:"仅同步项目工作区。适合大多数团队。",sharedDeeper:"共享更深",sharedDeeperDesc:"会额外同步 session-env、file-history、shell-snapshots 和 todos。适合需要跨账号续接的场景。",sharedDeeperPrefix:"额外包含",isolated:"隔离",isolatedDesc:"不建立链接。适合严格隔离场景。",quickCommands:"快捷命令",quickCommandsDesc:"复制后在终端运行。",workspaceBadge:"ccs auth 工作区",historySyncBadge:"历史同步控制",authAccounts:"认证账号",tableScopePrefix:"该表仅展示",tableScopeMiddle:"账号。模式/分组/深度调整请使用",tableScopeSuffix:"。",accountMatrix:"账号矩阵",sharedTotalDesc:"共享总数:{{count}}。可执行 Sync 设置和旧版确认操作。",loadingAccounts:"正在加载账号..."},health:{justNow:"刚刚",secondsAgo:"{{count}} 秒前",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",systemHealth:"系统健康",build:"构建 {{version}}",lastScan:"上次扫描:",autoRefresh:"自动刷新:",refresh:"刷新",checks:"检查项",version:"版本",platform:"平台",liveMonitoring:"实时监控已启用",copied:"已复制到剪贴板",refreshing:"正在刷新健康检查...",fix:"修复",applyFix:"应用修复",healthLabel:"健康"},updates:{actionRequired:"待处理",done:"已完成",all:"全部",inboxTitle:"更新中心",inboxSubtitle:"先处理操作,再将更新标记为完成或忽略。",needsAction:"需处理",doneCount:"已完成",searchPlaceholder:"搜索操作或命令",noNotices:"当前视图下没有通知。",noUpdates:"暂无更新。",published:"发布于 {{date}}",markDone:"标记完成",dismiss:"忽略",reopen:"重新打开",doNext:"下一步",impactedIntegrations:"受影响的集成",impactedDesc:"根据更新范围与路由匹配的相关区域。",whyMatters:"为什么重要",whyMattersDesc:"仅保留简要背景,不展示冗长发布说明。",open:"打开",progressNeedsAction:"需处理",progressInReview:"审阅中",progressDone:"已完成",progressDismissed:"已忽略",statusNew:"新",statusStable:"稳定",statusPlanned:"计划中",dashboard:"Dashboard",cliUsage:"CLI 用法"},cliproxyPage:{connected:"已连接",notConnected:"未连接",variant:"变体",parentNotConnected:"上游未连接",viaProvider:"通过 {{provider}}",emptyTitle:"CCS 配置管理",emptyDesc:"管理 CLIProxy 提供商的 OAuth 认证、账号偏好与模型选择,配置 CCS 的请求路由。",emptyControlPanelPrefix:"如需查看实时用量和监控,请前往",controlPanel:"控制面板",quickSetup:"快速设置",addAccount:"添加账号",advancedVariant:"高级变体",setupActionsHint:"在这里添加账号。只有需要单独运行时/配置档时才创建变体。",accountManagement:"CCS 级账号管理",providers:"提供商",variants:"变体",providerCount:"{{count}} 个提供商",providerCount_other:"{{count}} 个提供商",connectedCount:"{{count}} 个已连接",variantDisplay:"{{name}}({{provider}} 变体)"},copilotPage:{title:"Copilot",subtitle:"已弃用的 GitHub Copilot 兼容桥接",deprecatedBadge:"已弃用",deprecationTitle:"已弃用的兼容桥接",deprecationItem1:"GitHub Copilot 用量计费将于 2026 年 6 月 1 日开始",deprecationItem2:"现有本地配置仍可作为兼容路径继续使用",deprecationItem3:"新的配置请优先使用 Codex 或其他活跃提供商",setup:"安装",auth:"认证",daemon:"守护进程",unofficialTitle:"非官方 API - 风险自负",unofficialItem1:"逆向接口,可能随时失效",unofficialItem2:"过度使用可能触发账号限制",unofficialItem3:"CCS 不提供担保,也不承担责任",yes:"是",no:"否",installed:"已安装",missing:"缺失",integration:"集成",enabled:"已启用",disabled:"已禁用",github:"GitHub",connected:"已连接",notConnected:"未连接",authenticate:"去认证",authenticating:"认证中...",status:"状态",running:"运行中",stopped:"已停止",port:"端口",stopping:"停止中...",stop:"停止",starting:"启动中...",start:"启动",installing:"安装中...",installCopilotApi:"安装 copilot-api",proxy:"代理",active:"活跃",inactive:"未激活"},cursorPage:{title:"Cursor",beta:"Beta",deprecated:"已弃用",subtitle:"面向旧版 Cursor 使用场景的已弃用本地桥接",unofficialTitle:"旧版桥接已弃用,优先使用 CLIProxy 支持的 Cursor",unofficialItem1:"推荐路径:使用 CLIProxy 管理 Cursor 认证与账号",unofficialItem2:"这个逆向本地桥接仅为仍在使用旧流程的用户保留",unofficialItem3:"CCS 不为这个旧路径提供担保,也不承担责任",supportedPathTitle:"推荐路径",supportedPathDesc:"新的配置请使用 CLIProxy 支持的 Cursor 认证与账号管理。只有在你仍依赖旧的本地守护进程流程时,才继续使用下方旧版桥接。",startCliproxyAuth:"启动 CLIProxy Cursor 认证",openCliproxyCursor:"打开 CLIProxy Cursor",integration:"集成",authentication:"认证",daemon:"守护进程",enabled:"已启用",disabled:"已禁用",expired:"已过期",connected:"已连接",notConnected:"未连接",running:"运行中",stopped:"已停止",actions:"旧版操作",disableIntegration:"禁用集成",enableIntegration:"启用集成",autoDetectAuth:"旧版 IDE 自动检测",manualAuthImport:"旧版手动导入",stopDaemon:"停止守护进程",startDaemon:"启动守护进程",port:"端口",configuration:"Cursor 配置",lastModified:"最后修改:",neverSaved:"从未保存",saving:"保存中...",save:"保存",modelConfig:"模型配置",settings:"设置",info:"信息",presets:"预设",presetsDesc:"应用预设模型映射",modelMapping:"模型映射",modelMappingDesc:"为不同档位配置使用模型",defaultModel:"默认模型",defaultModelDesc:"未指定档位时使用。",opusModel:"Opus(最强)",opusModelDesc:"复杂推理与最高质量输出。",sonnetModel:"Sonnet(均衡)",sonnetModelDesc:"日常编码和通用对话。",haikuModel:"Haiku(快速)",haikuModelDesc:"低延迟与轻量请求。",runtimeSettings:"运行时设置",autoStartDaemon:"自动启动守护进程",autoStartDesc:"在使用集成时自动启动 Cursor 守护进程。",ghostMode:"Ghost 模式",ghostModeDesc:"请求时附带 x-ghost-mode 以减少遥测。",provider:"提供商",filePath:"文件路径",availableModels:"可用模型",loadingModels:"加载模型中...",noModels:"暂无模型元数据,请先启动守护进程后刷新。",default:"默认",rawConfiguration:"原始配置(JSON)",manualImportTitle:"手动导入 Cursor 认证",manualImportDesc:"若无法自动检测,请提供 Cursor access token 与 machine ID。",accessToken:"访问令牌",accessTokenPlaceholder:"粘贴 Cursor access token",machineId:"机器 ID",machineIdPlaceholder:"32 位十六进制(无连字符 UUID)",cancel:"取消",import:"导入",selectModel:"选择模型",useDefaultModel:"使用默认模型",availableModelCount:"可用模型({{count}})",invalidPort:"端口必须是 1 到 65535 之间的整数",defaultModelRequired:"默认模型必填",savedConfig:"Cursor 配置与模型映射已保存",failedSaveConfig:"保存配置失败",modelsLoadingWait:"模型仍在加载中,请稍后再应用预设。",noModelsAvailable:"暂无可用模型,请先启动守护进程并刷新。",appliedCodexPreset:"已应用 GPT-5.3 Codex 预设",appliedClaudePreset:"已应用 Claude 4.6 预设",appliedGeminiPreset:"已应用 Gemini 3 预设",integrationEnabled:"Cursor 集成已启用",integrationDisabled:"Cursor 集成已禁用",failedUpdateIntegration:"更新集成状态失败",credentialsImported:"Cursor 凭据已导入",autoDetectFailed:"自动检测失败",manualRequired:"Token 和 machine ID 为必填项",manualImportFailed:"手动导入失败",failedStartDaemon:"启动守护进程失败",daemonStarted:"守护进程已启动",daemonStartedWithPid:"守护进程已启动(PID: {{pid}})",failedStopDaemon:"停止守护进程失败",daemonStopped:"守护进程已停止",rawLoading:"原始设置仍在加载,请稍后重试。",invalidJson:"JSON 无效",rawSaved:"原始设置已保存",rawChanged:"原始设置已被外部修改,请刷新后重试。",failedSaveRaw:"保存原始设置失败",savedAll:"Cursor 配置已保存",liveProbe:"实时探测",runLiveProbe:"运行实时探测",rerunLiveProbe:"重新运行实时探测",probing:"正在运行探测...",probeNotRun:"尚未运行探测",probeLocalReadinessHint:"本地就绪检查可能通过,但实时运行链路仍可能失败。请使用实时探测验证完整的 Cursor 路径。",probeStage:"阶段",probeHttpStatus:"HTTP 状态",probeDuration:"耗时",probeModel:"模型",probeMessage:"消息",probeSucceeded:"探测成功",probeFailed:"探测失败",probeSaveFirst:"请先保存或放弃 Cursor 更改,再运行实时探测",refreshStatus:"刷新 Cursor 状态",refreshConfiguration:"刷新 Cursor 配置"},droidPage:{loadingDiagnostics:"加载 Droid 诊断中...",failedDiagnostics:"加载 Droid 诊断失败。",overview:"概览",byok:"BYOK",docs:"文档",runtimeInstall:"运行时与安装",status:"状态",detected:"已检测",notFound:"未找到",detectionSource:"检测来源",binaryPath:"二进制路径",installDirectory:"安装目录",version:"版本",overridePath:"覆盖路径(CCS_DROID_PATH)",configFiles:"配置文件",path:"路径",resolved:"解析结果",size:"大小",lastModified:"最后修改",parseWarning:"解析告警:{{value}}",readWarning:"读取告警:{{value}}",warnings:"告警",byokSummary:"BYOK 概览",activeModelSelector:"当前模型选择器",customModels:"自定义模型",ccsManaged:"CCS 管理",userManaged:"用户管理",malformedEntries:"异常条目",providers:"提供商",none:"无",customModelsTitle:"自定义模型",modelName:"名称 / 模型",provider:"提供商",baseUrl:"Base URL",noCustomModels:"没有自定义模型",docsAlignedNotes:"文档对齐说明",factoryDocs:"Factory 文档",providerFactCheckDocs:"Provider 校验文档",providerValues:"Provider 值:{{value}}",settingsHierarchy:"Settings 层级:{{value}}",settingsTitle:"Droid BYOK 设置",fixJsonBeforeQuickSettings:"请先修复 JSON 语法,再使用快速设置。",fixJsonBeforeReasoning:"请先修复 JSON 语法,再更新 BYOK 推理设置。",unableUpdateReasoning:"无法更新所选 BYOK 模型的推理设置。",fixJsonBeforeBudget:"请先修复 JSON 语法,再更新思考预算。",anthropicOnlyBudget:"思考预算仅适用于 Anthropic BYOK 模型。",invalidJson:"JSON 无效:{{value}}",saved:"Droid 设置已保存",changedExternally:"Droid 设置已被外部修改,请刷新后重试。",failedSave:"保存 Droid 设置失败"},sharedPage:{commands:"命令",skills:"技能",agents:"代理",plugins:"插件",settings:"设置",title:"共享资源",subtitle:"在账号之间共享的命令、技能、代理、插件和配置",totalShared:"共享总数",visible:"可见",markdownDetail:"Markdown 详情视图",registryDetail:"注册表详情视图",maskedSettingsDetail:"脱敏设置视图",filterPrefix:"筛选:",configurationRequired:"需要配置",countsUnavailable:"统计不可用",retryCounts:"重试统计",filterPlaceholder:"按名称、描述或路径筛选 {{tab}}",showing:"显示 {{visible}} / {{total}} 个{{tab}}",showingQuery:"(关键字“{{query}}”)",refreshing:"(刷新中...)",loadingShared:"正在加载共享{{tab}}...",failedLoadShared:"加载共享{{tab}}失败",retry:"重试",noSharedFound:"未找到共享{{tab}}。请运行 `ccs sync` 或在共享目录添加内容。",noPluginsFound:"未安装共享插件。真实插件存在前,插件注册表文件和缓存文件夹会保持隐藏。",noMatch:"没有匹配“{{query}}”的{{tab}}。",selectOne:"选择一个{{tab}}查看完整内容。",pathLabel:"路径",resolvedSource:"解析后来源",loadingMarkdown:"正在加载 Markdown 内容...",loadingSettings:"正在加载设置内容...",failedLoadContent:"加载内容失败",retryContent:"重试内容加载",noMarkdown:"暂无 Markdown 内容。",settingsTitle:"settings.json",settingsDescription:"此文件包含所有 shared 模式账号链接使用的共享设置。",settingsPath:"共享设置路径",settingsActive:"已启用",settingsInactive:"未找到",resourcePolicies:"资源策略",resourcePoliciesDescription:"标记为 shared 的账号继承此中心。profile-local 账号保留单独的命令、技能、代理、插件和设置。",sharedAccounts:"{{count}} 个 shared",profileLocalAccounts:"{{count}} 个 profile-local",moreProfileLocalAccounts:"+{{count}} 个更多"},heroSection:{title:"CCS Config",subtitle:"Claude Code Switch Dashboard"},hubFooter:{logs:"日志",settings:"设置",github:"GitHub",copyright:"© {{year}} kaitranntt"},themeToggle:{srLabel:"切换主题"},ccsLogo:{alt:"CCS Logo",text:"CCS Config"},claudekitBadge:{title:"Powered by ClaudeKit Framework",alt:"ClaudeKit",poweredBy:"Powered by",claudekit:"ClaudeKit"},codeEditor:{revealSensitive:"显示敏感值",maskSensitive:"隐藏敏感值",valid:"有效的 {{language}}",readOnly:"(只读)"},commandBuilder:{title:"命令构建器",searchPlaceholder:"输入或选择命令...",copy:"复制",run:"运行",cmdConfig:"打开配置界面",cmdCreateProfile:"创建新配置",cmdSwitchProfile:"切换到指定配置",cmdDoctor:"检查系统健康",cmdListProviders:"列出可用 CLIProxy 提供商",cmdAddProvider:"添加 CLIProxy 提供商"},confirmDialog:{confirm:"确认",cancel:"取消"},connectionIndicator:{connected:"已连接",connecting:"连接中...",disconnected:"已断开",reconnecting:"重新连接中..."},docsLink:{title:"查看文档"},githubLink:{title:"在 GitHub 上报告问题"},globalEnvIndicator:{injectedCount_one:"{{count}} 个全局环境变量将在运行时注入",injectedCount_other:"{{count}} 个全局环境变量将在运行时注入",overriddenCount:"({{count}} 个已被配置覆盖)",skippedLabel:"已跳过(配置中已定义):",configureInSettings:"在设置中配置"},localhostDisclaimer:{remoteReadonlyAuthDisabledLong:"远程控制台当前为只读,因为此 CCS 实例未启用控制台认证。请在 CCS 主机上重新启用;Docker 部署需要在运行中的容器内完成。",remoteReadonlyAuthDisabledShort:"远程控制台为只读,直到此 CCS 实例重新启用控制台认证。",remoteReadonlySetupLong:"远程控制台为只读,直到为此 CCS 实例运行 ccs config auth setup。Docker 部署必须在容器内运行该命令。",remoteReadonlySetupShort:"远程控制台为只读,直到为此 CCS 实例完成认证配置。",localLong:"本控制台在本地运行,所有数据保留在本机。",localShort:"本地控制台 - 数据保留在本机。",dismiss:"关闭提示"},privacyToggle:{modeOn:"隐私模式已开启 - 点击显示数据",modeOff:"隐私模式已关闭 - 点击隐藏数据"},projectSelectionDialog:{title:"选择 Google Cloud 项目",description:"选择用于 {{provider}} 认证的项目。",autoSelectCountdown:"({{count}} 秒后自动选择默认值)",default:"默认",allProjects:"全部项目",allProjectsDescription:"接入全部 {{count}} 个已列出的项目",useDefault:"使用默认值",selecting:"选择中...",confirmSelection:"确认选择",codeCopied:"验证码已复制",copyVerificationCode:"复制验证码"},quickCommands:{title:"快捷命令",startDefault:"启动默认",startDefaultDesc:"使用默认配置启动 Claude",glmProfile:"GLM 配置",glmProfileDesc:"切换到 GLM 模型",healthCheck:"健康检查",healthCheckDesc:"运行系统诊断",delegateTask:"委托任务",delegateTaskDesc:"委托到 GLM 配置"},quotaTooltip:{loadingQuota:"加载配额中...",failedLoadQuota:"加载配额失败",modelQuotas:"模型配额:",rateLimits:"速率限制:",plan:"计划:{{plan}}",quotaSnapshots:"配额快照:",unlimited:"无限制",remaining:"剩余 {{remaining}}/{{entitlement}}",tier:"档位",tierId:"档位 ID",state:"状态",credits:"额度",modelQuotasLower:"模型配额:",allBucketsReport:"所有桶报告 {{tokenType}}",requestsRemaining:"剩余 {{count}} 次请求",inputTokensRemaining:"剩余 {{count}} 个输入 token",outputTokensRemaining:"剩余 {{count}} 个输出 token",amountRemaining:"剩余 {{count}}",fiveHourLimit:"5 小时用量限制",weeklyLimit:"每周用量限制",weeklyOpus:"每周用量(Opus)",weeklySonnet:"每周用量(Sonnet)",weeklyOAuthApps:"每周用量(OAuth 应用)",weeklyCowork:"每周用量(Cowork)",extraUsage:"额外用量",premiumInteractions:"高级交互次数",chat:"对话",completions:"补全",resets:"重置于 {{time}}",fiveHourResets:"5 小时重置于 {{time}}",weeklyResets:"每周重置于 {{time}}"},utils:{codeReview5h:"代码审查(5 小时)",codeReviewWeekly:"代码审查(每周)",codeReview:"代码审查",codexAdditional5h:"{{name}}(5 小时)",codexAdditionalWeekly:"{{name}}(每周)",codexAdditional:"{{name}}"},sponsorButton:{title:"在 GitHub 上赞助此项目",sponsor:"赞助"},valueMetrics:{apiCostSaved:"API 成本节省",tokensSaved:"Token 节省",queriesFaster:"查询加速",errorsReduced:"错误减少",vsLastMonth:"对比上月",throughCaching:"通过缓存",averageSpeedup:"平均加速",withRetryLogic:"通过重试逻辑",performanceMetrics:"性能指标",monthlySummary:"月度概览",totalSaved:"总节省",tokensProcessed:"处理 Token 数",queriesHandled:"处理请求数",uptime:"正常运行时间"},updatesSpotlight:{openUpdatesCenter:"打开更新中心"},deviceCodeDialog:{authorize:"授权 {{provider}}",enterCodeAtPage:"在授权页面输入下方验证码。",expiresIn:"({{time}} 后过期)",codeExpired:"(验证码已过期)",copied:"已复制!",copyCode:"复制验证码",waitingForAuth:"等待授权中...",openVerificationPage:"打开验证页面",openProviderPage:"打开 {{provider}}",copyCodeAria:"复制验证码",codeCopiedAria:"验证码已复制"},settingsDialog:{editProfile:"编辑配置:{{name}}",description:"为此配置设置环境变量和其他设置。",loadingSettings:"加载设置中...",envTab:"环境变量",rawJsonTab:"原始 JSON",generalTab:"常规",noEnvVars:"尚未配置环境变量。",noEnvVarsHint:"在 settings.json 文件中添加变量。",loadingEditor:"加载编辑器中...",profileInfo:"配置信息",profileInfoDesc:"此配置文件的详细信息。",path:"路径",lastModified:"最后修改",cancel:"取消",saving:"保存中...",saveChanges:"保存更改",conflictTitle:"文件被外部修改",conflictDesc:"此设置文件已被其他进程修改。用你的更改覆盖还是丢弃?",overwrite:"覆盖",invalidJson:"JSON 无效",failedSave:"保存失败"},setupWizard:{title:"高级变体设置",stepProviderDesc:"为运行时变体选择提供商",stepAuthDesc:"完成提供商认证",stepAccountDesc:"选择要使用的账号",stepVariantDesc:"可选:创建自定义运行时变体",stepSuccessDesc:"设置完成!",authStep:{authenticateWith:"通过 {{provider}} 认证以添加账号",authenticating:"认证中...",authenticateInBrowser:"在浏览器中认证",completeOAuth:"在浏览器中完成 OAuth 流程...",orUseTerminal:"或使用终端",runCommandHint:"在终端中运行此命令:",back:"返回",checking:"检查中...",refreshStatus:"刷新状态"},accountStep:{selectAccount:"选择账号({{count}})",defaultAccount:"默认账号",or:"或",addNewAccount:"添加新账号",addNewAccountDesc:"使用其他账号认证",back:"返回"},variantStep:{back:"返回",skip:"跳过"},successStep:{title:"变体已创建!",subtitle:"你的自定义变体已准备就绪",usage:"用法:",done:"完成"}},accountSurfaceCard:{business:"企业",free:"免费",personal:"个人",variant:"变体"},accountIdentity:{business:"企业",personal:"个人",free:"免费",team:"团队",plus:"Plus",pro:"Pro",workspace:"工作区 {{id}}"},accountCardStats:{notUsedYet:"尚未使用"},accountQuotaPanel:{weekly:"每周",loadingQuota:"加载配额中..."},userMenu:{signedInAs:"已登录为 {{username}}"},authMonitorLive:{live:"实时",accountMonitor:"账号监控",updated:"更新于 {{time}}",updatedNow:"刚刚更新",requestsLabel:"请求",stats:"统计",successRate:"成功率",missingProjectId:"缺少项目 ID",noActivity:"无活动"},providerCard:{missingProjectIdAria:"缺少项目 ID"},loginPage:{showPassword:"显示密码",hidePassword:"隐藏密码"},cliproxyStatsOverview:{sessionStatistics:"会话统计",realTimeMetrics:"来自 {{backend}} 的实时使用指标",offline:"离线",running:"运行中",noActiveSession:"无活跃会话",noActiveSessionHint:"使用 ccs gemini、ccs codex 或 ccs agy 启动 CLIProxy 会话后即可查看实时统计。",failedLoadStats:"加载统计数据失败",totalRequests:"总请求数",successCount:"{{count}} 次成功",successRate:"成功率",totalTokens:"总 Token 数",estimatedCost:"预估 ${{cost}}",modelsUsed:"使用模型数",modelUsageDistribution:"模型使用分布",requestCount:"{{count}} 次请求"},cliproxyTable:{name:"名称",provider:"提供商",model:"模型",account:"账号",status:"状态",default:"默认",actions:"操作"},cliproxyTabs:{overview:"概览",variants:"变体",aiProviders:"AI 提供商",controlPanel:"控制面板"},cliproxyHeader:{ccsLevelAccountManagement:"CCS 级账号管理",cliproxyNotAvailable:"CLIProxy 不可用",cliproxyControlPanel:"CLIProxy 控制面板",noVariants:"未找到 CLIProxy 变体。",addAccountToStart:"添加账号以开始"},routingGuidance:{roundRobin:"轮询模式均匀分配用量。",fillFirst:"优先填满模式让备用账号保持冷启动直到需要时。",routingStrategy:"路由策略",optionalRouting:"可选路由",sessionAffinity:"会话粘性",sessionAffinityOn:"开启",sessionAffinityOff:"关闭",sessionAffinityEnabled:"已启用",sessionAffinityDisabled:"已禁用",enableSessionAffinity:"启用会话粘性",disableSessionAffinity:"禁用会话粘性",sessionAffinityUnavailable:"会话粘性不可用",localOnly:"仅本地",localOnlySetting:"仅限本地设置",ttlBadge:"TTL {{ttl}}",sessionAffinityDescription:"尽量将同一对话固定到同一个账号。CLIProxy 会优先使用客户端显式提供的会话或线程标识;如果没有,再回退到请求元数据或开场提示历史来推断稳定键。",sessionRecognitionTitle:"会话识别",sessionRecognitionDescription:"CCS 不承诺所有后端都使用同一优先级顺序。通常上游会优先使用显式会话或线程 ID,然后回退到元数据字段,最后再回退到基于开场提示历史的哈希。"},extendedContext:{extendedContext:"扩展上下文"},cliproxyConfig:{unsavedChanges:"未保存的更改",original:"原始值",modified:"已修改",reviewChanges:"查看更改",loadingEditor:"加载编辑器中..."},providerEditor:{provider:"提供商",filePath:"文件路径",lastModified:"最后修改",defaultTarget:"默认目标",quickUsage:"快速使用",modelMapping:"模型映射",status:"状态",loadingSettings:"加载设置中...",loadingEditor:"加载编辑器中...",accounts:"账号",addAccount:"添加账号",noAccountsConnected:"未连接账号",addAccountToStart:"添加账号以开始",gcpProjectIdReadonly:"GCP 项目 ID(只读)",projectIdNA:"项目 ID:无",missingProjectId:"缺少项目 ID",missingProjectIdHint:"可能导致错误。请移除该账号并重新添加以获取项目 ID。",useIncognito:"使用隐身模式",aliases:"别名",current:"当前",currentValue:"当前值",composite:"复合",defaultLabel:"默认",requiredSetup:"必要设置",connectorName:"连接器名称",proxyUrl:"代理 URL",proxyUrlSet:"代理 URL 已设置",excludedModels:"排除模型",headers:"请求头",secret:"密钥",prefix:"前缀",modelMappings:"模型映射",baseUri:"Base URL",apiKeys:"API Key",presets:"应用预设模型映射",createVariant:"创建 CLIProxy 变体",agyDenylist:"Antigravity 禁用列表:Claude Opus 4.5 和 Claude Sonnet 4.5 已弃用。"},providerEditorAccountItem:{modelsUsed:"使用模型数"},bulkActionBar:{applyPreset:"应用预设"},modelConfigSection:{defaultModel:"默认模型"},rawEditorSection:{rawConfig:"原始配置"},providerEditorHeader:{connectorName:"连接器名称"},aiProvidersFamilyRail:{current:"当前"},aiProvidersEntryCard:{apiKeys:"API Key"},aiProvidersEntryDialog:{connectorName:"连接器名称",baseUri:"Base URL",proxyUrl:"代理 URL",secret:"密钥",prefix:"前缀",excludedModels:"排除模型",headers:"请求头",modelMappings:"模型映射",requiredSetup:"必要设置",optionalRouting:"可选路由"},codex:{controlCenter:"控制中心",overview:"概览",docs:"文档",nativeCodexRuntime:"原生 Codex 运行时",ccsCodexProvider:"Cliproxy 快捷方式 / 托管桥接",codexDocs:"Codex 文档",supportedFlows:"支持的工作流",twoSupportedPaths:"两种支持路径:",nativeLabel:"原生:",nativeDesc:"Codex 是 CCS v1 的一等公民运行时目标。",ccsBridge:"CCS 桥接",apiProfilesDefault:"API 配置默认仍使用 Claude 或 Droid。",recommendedSetupFlow:"推荐设置流程",fastestPath:"最快路径",officialChannels:"官方渠道",codexCli:"Codex CLI",openNativeCodex:"打开原生 Codex",runBuiltInCodex:"通过 cliproxy 快捷方式运行原生 Codex",runBuiltInCodexExplicit:"显式运行 CCS 托管 Codex 桥接",openCodexDashboard:"打开 Codex Dashboard",status:"状态",profiles:"配置",createNewProfile:"创建新配置",createNewProvider:"创建新提供商",createNewMcpServer:"创建新 MCP 服务器",defaultProvider:"默认提供商",useDefault:"使用默认值",useGlobalProvider:"使用全局提供商",useProviderDefault:"使用提供商默认值",quickFillWarning:"快速填充内容仅供参考,保存前请仔细检查。",thisFileUpstreamOwned:"此文件由 Codex CLI 上游维护。",notes:"备注",approvalPolicy:"审批策略",sandboxMode:"沙盒模式",reasoningEffort:"推理强度",useGlobalEffort:"使用全局强度",reasoningEffortCapitalized:"推理强度",thinkingBudgetTokens:"思考预算 Token",modelContextWindow:"模型上下文窗口",autoCompactTokenLimit:"自动压缩 Token 上限",toolOutputTokenLimit:"工具输出 Token 上限",webSearch:"网页搜索",personality:"人格设定",model:"模型",rawOnly:"仅原始",trusted:"受信任",untrusted:"不受信任",noProjectTrustEntries:"没有已保存的项目信任条目。",codexNativeRecipe:"已保存原生 Codex 配方",gptContextCap:"GPT-5.4 上下文上限",usageLimitCost:"用量上限成本超过 272K",longContextOverride:"长上下文覆盖",counts2x:"计数 2 倍",normalUsageWindow:"常规使用窗口",useCodexDefault:"使用 Codex 默认值",stdio:"stdio",streamableHttp:"streamable-http",responses:"responses",defaultTargetCli:"默认目标 CLI",executionChain:"执行链",targetPath:"当前目标路径",userConfig:"用户配置",configYaml:"config.yaml",flow:"工作流",docsTab:"文档",features:"功能",featuresDesc:"切换 CCS 可安全管理的 Codex 功能开关。",configOnlyFlags:"仅配置文件中的现有开关",configOnlyFlagsDesc:"这些功能键已存在于你的 `config.toml` 中,因此 CCS 可以显示它们,而不必宣称自己覆盖了完整目录。",existing:"已存在",nonBooleanForm:"该值以非布尔形式保存。如果需要编辑,请使用原始 TOML。",discoveredFromFile:"这是从当前文件中发现的,而不是来自 CCS 内置目录。",featureMultiAgentLabel:"Multi-agent",featureMultiAgentDesc:"启用子代理协作工具。",featureUnifiedExecLabel:"Unified exec",featureUnifiedExecDesc:"使用基于 PTY 的统一 exec 工具。",featureShellSnapshotLabel:"Shell snapshot",featureShellSnapshotDesc:"复用 shell 环境快照。",featureApplyPatchLabel:"Apply patch",featureApplyPatchDesc:"启用自由格式 apply_patch 编辑。",featureJsReplLabel:"JS REPL",featureJsReplDesc:"启用基于 Node 的 JavaScript REPL。",featureRuntimeMetricsLabel:"Runtime metrics",featureRuntimeMetricsDesc:"收集 Codex 运行时指标。",featurePreventIdleSleepLabel:"Prevent idle sleep",featurePreventIdleSleepDesc:"保持机器在运行期间不休眠。",featureFastModeLabel:"Fast mode",featureFastModeDesc:"允许使用快速服务层路径。",featureAppsLabel:"Apps",featureAppsDesc:"启用 ChatGPT Apps 和连接器支持。",featureSmartApprovalsLabel:"Smart approvals",featureSmartApprovalsDesc:"将符合条件的审批交给 guardian 流程处理。",howCodexWorks:"Codex 在 CCS 中的工作方式",nativeConfigLabel:"原生配置:",nativeConfigDesc:"ccs-codex 和 ccsx 会使用你保存的默认值启动原生 Codex。",transientOverridesLabel:"临时覆盖:",transientOverridesDesc:"ccsxp 会保持原生 Codex,只额外加上 cliproxy provider 覆盖;ccs codex --target codex 仍然是显式的 CCS 托管桥接。",cliproxyDefaultLabel:"CLIProxy 默认:",cliproxyDefaultDesc:'如果你想让普通的 codex 走 CLIProxy,请设置 model_provider = "cliproxy",并加入下面的配方。',runtimeInstall:"运行时安装",detected:"已检测到",notFound:"未找到",detectionSource:"检测来源",binaryPath:"二进制路径",installDirectory:"安装目录",versionLabel:"版本",nativeAliases:"原生别名",ccsProviderShortcut:"Cliproxy 快捷方式",configOverrideSupport:"--config 覆盖支持",available:"可用",missing:"缺失",cliproxyNativeCodex:"由 CLIProxy 支持的原生 Codex",builtInLabel:"内置:",builtInCcsxpDesc:"使用 ccsxp 通过 cliproxy provider 快捷方式启动原生 Codex。",managedBridgeLabel:"托管桥接:",managedBridgeDesc:"如果你想显式走更严格的 CCS 托管路由,请使用 ccs codex --target codex。",nativeRecipeLabel:"原生:",nativeRecipeDesc:"按下面的配方配置,即可让 codex 直接走 CLIProxy。",saveProviderNamedCliproxy:"保存一个名为 cliproxy 的 provider,并填入上面的 base URL 与 env key。",inTopLevelSetDefault:"在顶层设置中,将 Default provider 设为 cliproxy。",exportCliproxyApiKey:"在启动原生 Codex 之前,在 shell 中导出 CLIPROXY_API_KEY。",noConfigOverrides:"这个 Codex 版本仍然可以走纯原生路径,但在检测到的二进制支持 --config 覆盖之前,ccsxp 和显式的 CCS 托管 Codex 桥接都不可用。",configFile:"配置文件",path:"路径",resolved:"已解析",size:"大小",lastModified:"最后修改",tomlWarning:"TOML 警告",readWarning:"读取警告",currentUserLayerSummary:"当前用户层摘要",activeProfile:"当前激活的配置",notSet:"未设置",providersCount:"providers: {{count}}",profilesCount:"profiles: {{count}}",enabledFeaturesCount:"enabled features: {{count}}",mcpServersCount:"mcp servers: {{count}}",userLayerKeysPresent:"已存在的用户层键",nativeShortAlias:"原生短别名",ccsCodexShortcut:"CCS Codex 快捷方式",explicitProviderRoute:"显式 provider 路径",runtimeVsProvider:"运行时与 provider 的区别",honorsSavedNativeConfig:"遵循已保存的原生用户配置",usesTransientOverrides:"使用临时覆盖",unavailableNoConfig:"不可用(当前 Codex 版本缺少 --config 支持)。",yes:"是",no:"否",warningsTitle:"警告"},droidSettings:{quickControls:"快捷控制",reasoningControls:"推理控制",thinkingBudget:"思考预算",anthropicOnly:"仅 Anthropic 模型",byokCustomModels:"BYOK 自定义模型"},rawJsonSettingsEditor:{title:"原始设置编辑器"},copilotConfigForm:{copilotConfiguration:"Copilot 配置",deprecatedModels:"检测到已弃用的 Copilot 模型",failedLoadStatus:"加载状态失败",useWithClaudeCode:"通过 Claude Code 使用你的 GitHub Copilot 订阅",githubCopilotControls:"GitHub Copilot 在上游控制提示词/上下文限制。",provider:"提供商",filePath:"文件路径",status:"状态",enabled:"已启用",disabled:"已禁用",loadingEditor:"加载编辑器中...",modelMapping:"模型映射",quickUsage:"快速使用",noPremiumUsage:"无高级用量"},copilotPresets:{gpt5Codex:"GPT-5.3 Codex",claude46:"Claude 4.6",gemini3:"Gemini 3"},healthCard:{allSystemsNominal:"所有系统正常",machineChecks:"机器检查"},analyticsCards:{cacheCost:"缓存成本",hitRate:"命中率",inputOutputRatio:"输入/输出比",noCacheData:"暂无缓存数据",noModelData:"暂无模型数据",noSessionData:"暂无会话数据",noTokenData:"暂无 Token 数据",totalCost:"总成本",totalTokens:"总 Token 数",usageInsights:"使用洞察"},dateRangeFilter:{pickADate:"选择日期"},logsConfig:{level:"级别",message:"消息",source:"来源",time:"时间",proc:"进程",open:"打开",run:"运行",refreshEntries:"刷新条目"},logsDetailPanel:{details:"详情"},logsFilters:{filters:"筛选"},logsOverviewCards:{overview:"概览"},logsPageSkeleton:{loadingLogs:"加载日志中..."},monitoringErrorLogs:{logContent:"日志内容"},analyticsPages:{chartsGrid:"图表",costByModel:"按模型成本"},toasts:{profileCreated:"配置创建成功",profileUpdated:"配置更新成功",profileDeleted:"配置删除成功",orphanProfilesComplete:"孤立配置注册完成",profileCopied:"配置复制成功",profileImported:"配置导入成功",authRequired:"{{provider}} 授权需要认证",authSuccess:"{{provider}} 认证成功!",authFailed:"{{provider}} 认证失败",deviceCodeExpired:"验证码已过期,请重试。",codeCopied:"验证码已复制到剪贴板",failedCopy:"复制验证码失败",configSaved:"配置保存成功",configSaveFailed:"保存失败:{{error}}",invalidYaml:"YAML 无效,无法保存",configUpdatedExternally:"配置已被外部更新",settingsFileUpdated:"设置文件已更新",accountsUpdated:"账号已更新",noProfilesToSync:"没有可同步的配置",syncFailed:"同步失败:{{error}}",sessionAffinityUpdated:"会话粘性已{{state}}。",providerAuthSuccess:"{{provider}} 认证成功",providerDeviceCodeInCallback:"提供商在回调模式中返回了设备码流程",providerAuthTimeout:"认证超时,请重试。",providerAccountRegistrationFailed:"已认证账号无法注册",providerLostStatusEndpoint:"与认证状态端点失去连接",providerUnknown:"未知提供商:{{provider}}",providerStartOAuthFailed:"启动 OAuth 失败",providerCallbackFailed:"回调提交失败",providerSubmitCallbackFailed:"提交回调失败",loggingConfigSaved:"日志配置已保存。",loggingConfigSaveFailed:"保存日志配置失败。",unifiedConfigUpdated:"配置更新成功",migrationPreviewComplete:"迁移预览完成",migrationComplete:"迁移成功",migrationFailed:"迁移失败",rollbackComplete:"回滚成功",rollbackFailed:"回滚失败",defaultAccountSet:"默认账号已设为「{{name}}」",defaultAccountReset:"默认账号已重置为 CCS",accountDeleted:"账号「{{name}}」已删除",contextUpdated:"已将「{{name}}」的上下文更新为 {{summary}}",legacyConfirmError:'账号「{{name}}」需要显式确认。请在该账号上使用"编辑历史同步"。',legacyConfirmFailed:"旧版账号「{{name}}」确认失败:{{error}}",legacyConfirmSuccess_one:"{{count}} 个旧版账号已确认",legacyConfirmSuccess_other:"{{count}} 个旧版账号已确认",legacyConfirmPartial:"已确认 {{updated}} 个旧版账号,但有 {{failed}} 个更新失败。账号状态已刷新。",legacyConfirmAllFailed:"确认 {{failed}} 个旧版账号失败。账号状态已刷新。",noLegacyAccounts:"没有需要确认的旧版账号",routingStrategySet:"路由策略已设为 {{strategy}}",variantCreated:"变体创建成功",variantUpdated:"变体更新成功",variantDeleted:"变体删除成功",defaultAccountUpdated:"默认账号已更新",accountRemoved:"账号已移除",accountPaused:"账号已暂停",accountResumed:"账号已恢复",accountAdded:"已为 {{provider}} 添加账号",kiroImported:"已导入 Kiro 账号:{{name}}",kiroTokenImported:"Kiro token 已导入",modelUpdated:"模型已更新",presetSaved:"预设「{{name}}」已保存",presetDeleted:"预设已删除",cliproxyAlreadyRunning:"CLIProxy 已在运行",cliproxyStarted:"CLIProxy 启动成功",cliproxyStartFailed:"CLIProxy 启动失败",cliproxyStopped:"CLIProxy 已停止",cliproxyStopFailed:"CLIProxy 停止失败",presetApplied:"已应用「{{name}}」预设",presetAppliedCustom:"已应用自定义预设",settingsSavedWithAdjustments:"设置已保存(含模型调整)",settingsSaved:"设置已保存",failedSaveSettings:"保存设置失败",codexRefreshFailed:"刷新 Codex 快照失败。原始编辑已保留。",codexRefreshError:"刷新 Codex 快照失败。",codexFixToml:"请先修复 TOML 再保存。",codexSaved:"已保存 Codex config.toml。",codexChangedExternally:"config.toml 已被外部修改,请刷新后重试。",codexSaveFailed:"保存 Codex config.toml 失败。",codexUpdateFailed:"更新 Codex 配置失败。",noOrphanProfiles:"未发现孤立配置",profilesRegistered:"已注册 {{count}} 个配置{{skipped}}",destinationEmpty:"目标配置名称不能为空",profileExportDownloaded:"配置导出已下载",profileImportFailed:"导入配置包失败"},providerConfig:{defaultDeviceCodeInstruction:"请在浏览器中完成授权。",trackLabel:"分组",sectionCoreLabel:"核心 / 原始后端",sectionCoreHint:"默认且始终可用的提供商线路",sectionPlusLabel:"Plus 扩展 / 社区维护",sectionPlusHint:"仍然受支持,但目前与默认后端分开显示",plusTrackNote:"需要可选的 Plus 后端;当前这条线路由社区维护。"},profileEditorSections:{imageAnalysis:"图片分析",loadingImageSettings:"加载图片设置中...",skipPermissionPrompts:"启动时跳过权限提示",useNativeImageReading:"使用原生图片读取",skipTransformer:"跳过转换器",friendlyUi:"友好界面",info:"信息"},imageAnalysisStatus:{sectionTitle:"图片",openSettings:"打开设置",useNativeImageReading:"使用原生图片读取",refreshingPreview:"刷新预览中",savedStatus:"已保存状态",livePreview:"实时预览",disabledGlobally:"全局已禁用",targetBypassesHook:"{{target}} 绕过了 hook",nativeImageReading:"原生图片读取",setupNeeded:"需要设置",needsAuth:"需要认证",needsProxy:"需要代理",nativeFallback:"原生回退",transformerReady:"转换器就绪",badgeDisabled:"已禁用",badgeBypassed:"已绕过",badgeNative:"原生",badgeSetup:"需设置",badgeAuth:"认证",badgeProxy:"代理",badgeReady:"就绪",capabilityVerified:"已验证",capabilityUnknown:"未知",toggleSummaryNativeCapable:"{{model}} 支持图片,CCS 将在此跳过转换器。",toggleSummaryNativeModel:"CCS 将对 {{model}} 优先使用原生读取。",toggleSummaryNativeDefault:"CCS 将对此配置优先使用原生图片读取。",toggleSummaryNativeFileAccess:"此配置当前仍使用原生文件访问。",toggleSummaryInactiveTarget:"当前选择 {{target}} 时,已保存的 Claude 端图片路由不生效。",toggleSummaryTransformerRoute:"转换器路由:{{backend}}{{modelSuffix}}。",noteDisabledGlobally:"图片功能在 CCS 设置中被全局禁用。",noteTargetBypassesHook:"当前目标 {{target}} 绕过了 Claude Read hook。",notePersistHook:"请先持久化配置 hook,然后才能在此使用转换器路由。",targetLabel:{claude:"Claude Code",droid:"Factory Droid",codex:"Codex CLI"}},openrouterBadge:{new:"新",integration:"OpenRouter 集成"},openrouterBanner:{accessModels:"通过 OpenRouter 访问 {{count}}+ 模型",add:"添加"},openrouterModelPicker:{searchModels:"搜索模型",newestModels:"最新模型"},openrouterPromoCard:{title:"OpenRouter",description:"通过一个 API 端点访问数百个模型。"},profileCard:{profile:"配置",openRouter:"OpenRouter 配置",claudeCode:"Claude Code",claudeCodeDefault:"Claude Code(默认)",factoryDroid:"Factory Droid",codexCli:"Codex CLI",ccsProfile:"CCS 配置"},profileDeck:{profiles:"配置",failedToLoad:"加载配置失败:{{message}}",noProfiles:"尚未配置。创建你的第一个配置以开始。"},profilesTable:{name:"名称",provider:"提供商",model:"模型",target:"目标",lastModified:"最后修改",actions:"操作",edit:"编辑"},profileCreateDialog:{createProfile:"创建配置",appliedModelToTiers:"已将「{{model}}」应用到所有模型档位",profileCreated:"配置「{{name}}」已创建",failedCreate:"创建配置失败",chooseProviderHint:"选择提供商预设,或配置自定义 API 端点。",basicInformation:"基本信息",modelConfiguration:"模型配置",usedInCli:"CLI 中使用:",apiBaseUrl:"API Base URL",baseUrlPlaceholder:"https://api.example.com/v1",prefilledFromPreset:"从 {{name}} 预填。可按需调整。",optionalForPreset:"{{name}} 的可选项。留空使用原生 Anthropic 认证。",endpointHint:"接受 OpenAI 兼容和 Anthropic 请求的端点",optional:"(可选)",apiKeyOptionalPlaceholder:"可选 - 仅在启用认证时需要",apiKeyPlaceholder:"sk-...",apiKeyOptionalHint:"仅在本地端点启用了认证时才需要",defaultTargetCli:"默认目标 CLI",modelMapping:"模型映射",modelMappingDesc:"将 Claude Code 档位(Opus/Sonnet/Haiku)映射到提供商支持的模型。",searchModelsPlaceholder:"输入搜索(例如:opus、sonnet、gpt-4o)...",noModelsFound:"未找到匹配「{{query}}」的模型",loadingModels:"加载模型中...",defaultModel:"默认模型",sonnetMapping:"Sonnet 映射",opusMapping:"Opus 映射",haikuMapping:"Haiku 映射",sonnetMappingPlaceholder:"例如:gpt-4o、claude-sonnet-4",opusMappingPlaceholder:"例如:o1、claude-opus-4.5",haikuMappingPlaceholder:"例如:gpt-4o-mini、claude-3.5-haiku",free:"免费"},profileDialogLegacy:{editProfile:"编辑配置"},supportEntryCard:{actionRequired:"待处理"},settingsPage:{title:"设置",loading:"加载中...",failedLoad:"加载设置失败。",tabs:{web:"网页",env:"环境",think:"思考",proxy:"代理",auth:"认证",backup:"备份",channels:"频道",imageAnalysis:"图片"},websearchSection:{title:"网页搜索",description:"CLI 网页搜索配置。"},thinkingSection:{title:"思考",description:"为支持的模型配置扩展思考/推理。",directOverride:"直接覆盖",youType:"你输入:",ccsAdds:"CCS 添加:",executionChain:"执行链",primaryBackends:"主要后端",legacyCliFallbacks:"旧版 CLI 回退",managedPayload:"托管载荷",sharedTargetMetadata:"共享目标元数据",ideTargetMetadata:"IDE 目标元数据",ideSettingsPath:"IDE 设置路径",ideHost:"IDE 主机",resolvedBinding:"已解析绑定",bindingName:"绑定名称",inSync:"已同步",currentTargetPath:"当前目标路径",warnings:"告警",notes:"备注",workspacePresets:"工作区预设",draft:"草稿",advanced:"高级",recommended:"推荐设置流程",configureModelFirst:"请先配置模型"},proxySection:{title:"代理",loadingImageSettings:"加载图片设置中..."},channelsSection:{title:"官方渠道",description:"查看和管理官方发布渠道。"},imageAnalysisSection:{title:"图片分析",description:"配置图片分析设置。",loading:"加载图片设置中..."},browserSection:{title:"浏览器",description:"CCS 中托管浏览器自动化的主设置入口。",primaryTitle:"Settings > Browser 是主要的浏览器设置界面。",primaryDescription:"在这里配置 Claude Browser Attach 和 Codex Browser Tools,然后按下方指引启动或验证每条路径。",readiness:"就绪状态",nextStep:"下一步",technicalDetails:"技术细节",diagnostics:"诊断信息",evalMode:{label:"browser_eval 权限",options:{disabled:"禁用",readonly:"只读",readwrite:"可读写"}},actions:{saveClaude:"保存 Claude 设置",saveCodex:"保存 Codex 设置",testConnection:"测试连接",copyLaunchCommand:"复制启动命令"},messages:{statusRefreshed:"浏览器状态已刷新",launchCommandCopied:"启动命令已复制"},claude:{title:"Claude Browser Attach",description:"将 Claude 目标会话附加到启用了远程调试的 Chrome 会话。",enabledLabel:"启用 Claude Browser Attach",enabledDescription:"启用后,CCS 会为 Claude 目标会话准备托管浏览器 MCP 运行时。",userDataDir:"Chrome 用户数据目录",userDataDirHint:"建议使用单独的 Chrome 配置目录,避免自动化状态污染日常浏览器。",devtoolsPort:"DevTools 端口",devtoolsPortHint:"必须与 Chrome attach 模式实际启动时使用的端口一致。",devtoolsPortInvalid:"请输入 1 到 65535 之间的有效端口。",effectivePath:"当前生效的 attach 路径",recommendedPath:"推荐路径",managedRuntime:"托管浏览器运行时",evalModeHint:"控制 Claude Browser Attach 中 browser_eval 的权限。只读仅允许读取,读写还允许页面侧修改。",overrideMessage:"当前存在来自 {{source}} 的环境变量覆盖。移除该覆盖后,Dashboard 配置将重新成为唯一来源。",launchGuidance:"启动指引",launchGuidanceHint:"使用远程调试启动 Chrome,如有需要再重新执行 Test connection。"},codex:{title:"Codex Browser Tools",description:"控制 Codex 目标会话中的托管 Playwright MCP 浏览器路径。",enabledLabel:"启用 Codex Browser Tools",enabledDescription:"保持开启可让 Browser 页面成为 Codex 浏览器工具的主设置入口。",serverName:"托管服务名称",overrideSupport:"配置覆盖支持",overrideSupported:"支持",overrideUnsupported:"不支持",binary:"检测到的 Codex 可执行文件",notDetected:"未检测到",evalModeHint:"为保持 Browser 设置页一致性而保存该配置。Phase 1 中,browser_eval 的实际限制主要作用于 Claude Browser Attach。"}}},codexPage:{title:"Codex",controlCenter:"控制中心",overview:"概览",docs:"文档",nativeRuntime:"原生运行时",ccsProvider:"CCS 提供商",setup:"安装"},apiPage:{title:"API 配置",subtitle:"管理你的 API 配置和端点。"},claudeExtensionPage:{title:"Claude Extension",subtitle:"Claude Extension 集成设置。",claudeAuth:"Claude 认证",status:"状态",targetMetadata:"IDE 目标元数据"},sharedPageV2:{title:"共享",subtitle:"共享数据管理。"},homePageV2:{title:"首页",logsMoved:"日志已移至专用工作区",profiles:"配置",cliproxy:"CLIProxy",accounts:"账号",health:"健康"},analyticsPageV2:{title:"分析",subtitle:"使用分析与洞察。"},logsPageV2:{title:"日志",subtitle:"查看和管理系统日志。"},healthPageV2:{title:"健康",subtitle:"系统健康监控。"},aiProvidersPage:{title:"AI 提供商",subtitle:"管理 AI 提供商配置。",unableToLoad:"无法加载 AI 提供商"}}},vi:{translation:{locale:{en:"Tiếng Anh","zh-CN":"Tiếng Trung giản thể",vi:"Tiếng Việt",ja:"Tiếng Nhật"},layout:{languageSwitcher:"Ngôn ngữ"},nav:{general:"Chung",home:"Trang chủ",analytics:"Phân tích",identityAccess:"Nhận dạng & Quyền truy cập",apiProfiles:"Hồ sơ API",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"Tổng quan",controlPanel:"Bảng điều khiển",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",claudeExtension:"Claude Extension",accounts:"Tài khoản",allAccounts:"Tất cả tài khoản",sharedData:"Dữ liệu dùng chung",compatibleClis:"Tương thích",deprecated:"Đã ngừng ưu tiên",factoryDroid:"Factory Droid",system:"Hệ thống",health:"Sức khỏe",settings:"Cài đặt",openrouterTooltip:"Nổi bật: OpenRouter + Alibaba Coding Plan + Ollama",logs:"Nhật ký"},home:{profiles:"Hồ sơ",cliproxy:"CLIProxy",accounts:"Tài khoản",health:"Sức khỏe",configurationRequired:"Cần cấu hình"},auth:{dashboardTitle:"Bảng điều khiển CCS",protectedAccessLabel:"Truy cập được bảo vệ",remoteGuardLabel:"Lớp bảo vệ truy cập từ xa",loading:"Đang kiểm tra quyền truy cập bảng điều khiển…",loginDescription:"Dùng tên người dùng và mật khẩu đã được cấu hình trên máy host để truy cập bảng điều khiển.",username:"Tên người dùng",password:"Mật khẩu",usernamePlaceholder:"Nhập tên người dùng",passwordPlaceholder:"Nhập mật khẩu",signIn:"Đăng nhập",signingIn:"Đang đăng nhập...",loginFailed:"Đăng nhập không thành công",lightMode:"Sáng",darkMode:"Tối",noDefaultCredentials:"CCS không có sẵn tài khoản hay mật khẩu mặc định.",credentialsHint:"Thông tin đăng nhập được tạo bằng `ccs config auth setup` trên máy CCS host. Với Docker, phải chạy lệnh đó bên trong container.",remoteSetupTitle:"Truy cập từ xa cần thiết lập xác thực",remoteSetupDescription:"Bảng điều khiển này đang được mở từ một địa chỉ không phải localhost, nhưng phiên bản CCS này chưa bật dashboard auth.",incompleteSetupDescription:"Dashboard auth đã được bật nhưng cấu hình vẫn chưa hoàn tất. Hãy hoàn thành cấu hình cho phiên bản CCS này trước khi đăng nhập.",safetyNoteRemote:"Quản trị từ xa sẽ tiếp tục bị khóa cho tới khi chủ máy CCS host bật dashboard auth.",safetyNoteLocal:"Nếu bạn đang ngồi ngay trên máy đó, đường localhost vẫn là cách đơn giản nhất để vào.",safetyNoteSession:"Sau khi đăng nhập thành công, phiên HTTP-only sẽ chỉ có hiệu lực trên đúng máy chủ dashboard này.",hostStepTitle:"Trên máy CCS host",hostStepDescription:"Tạo hoặc bật lại thông tin đăng nhập cho dashboard, rồi mở lại trang này từ thiết bị từ xa.",dockerStepDescription:"Nếu dùng Docker, hãy chạy lệnh này bên trong container đang chạy:",localStepTitle:"Nếu đây là máy của bạn",localStepDescription:"Hãy mở URL localhost mà `ccs config` in ra, thay vì địa chỉ LAN hoặc Tailscale.",showPassword:"Hiện mật khẩu",hidePassword:"Ẩn mật khẩu"},commonToast:{apiKeyRequired:"Cần có khóa API",accountAddedPresetFailed:"Đã thêm tài khoản nhưng không áp dụng được preset mặc định",settingsCopied:"Đã sao chép cài đặt vào bảng nhớ tạm",enterPresetName:"Vui lòng nhập tên preset để lưu",codeCopied:"Đã sao chép mã vào bảng nhớ tạm",copyCodeFailed:"Không sao chép được mã",appliedModelAllTiers:"Đã áp dụng mô hình cho tất cả các tier",settingsSaved:"Đã lưu cài đặt",defaultTargetUpdated:"Đã cập nhật mục tiêu mặc định",failedUpdateDefaultTarget:"Không cập nhật được mục tiêu mặc định thành {{target}}{{suffix}}"},profileDialog:{editTitle:"Chỉnh sửa hồ sơ",createTitle:"Tạo hồ sơ API",name:"Tên",namePlaceholder:"my-api",baseUrl:"URL cơ sở",baseUrlPlaceholder:"https://api.example.com",apiKey:"Khóa API",defaultModel:"Mô hình mặc định (ANTHROPIC_MODEL)",defaultModelHint:"Để trống để sử dụng: {{model}}",modelMappingTitle:"Ánh xạ mô hình (Opus/Sonnet/Haiku)",modelMappingDesc:"Cấu hình ID mô hình riêng cho từng tier. Hữu ích với API proxy định tuyến từng loại mô hình đến backend khác nhau.",opusModel:"Mô hình Opus (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Mô hình Sonnet (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Mô hình Haiku (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"Hủy bỏ",saving:"Đang lưu...",update:"Cập nhật",create:"Tạo"},modelTierMapping:{title:"Ánh xạ tầng mô hình",advanced:"Nâng cao",description:"Định cấu hình các mô hình khác nhau cho các cấp độ opus/sonnet/haiku của Claude Code.",autoSuggest:"Tự động đề xuất dựa trên {{provider}}",opusPlaceholder:"vd: anthropic/claude-opus-4",sonnetPlaceholder:"ví dụ: anthropic/claude-sonnet-4",haikuPlaceholder:"vd: anthropic/claude-3.5-haiku",footer:"Các biến này thiết lập ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL."},envEditor:{sensitive:"nhạy cảm",none:"Không có biến môi trường nào được cấu hình.",noneHint:"Thêm biến bằng ô nhập bên dưới hoặc chỉnh sửa trực tiếp JSON.",addVariable:"Thêm biến môi trường",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"giá trị"},setupVariant:{using:"Sử dụng:",variantNameRequired:"Tên biến thể runtime *",variantNamePlaceholder:"ví dụ: my-gemini, g3, flash",invokeHintPrefix:"Chạy bằng biến thể này:",model:"Mô hình",modelPlaceholder:"ví dụ: gemini-2.5-pro, claude-opus-4-5",choosePresetInstead:"Hoặc chọn từ preset có sẵn",selectModel:"Chọn mô hình",customModelName:"Tên mô hình tùy chỉnh...",enterAnyModel:"Nhập bất kỳ tên mô hình nào được CLIProxy hỗ trợ",defaultModel:"Mặc định: {{model}}",providerDefault:"mặc định theo nhà cung cấp",back:"Quay lại",skip:"Bỏ qua",creating:"Đang tạo...",createVariant:"Tạo biến thể",skipHint:"Bỏ qua nếu thiết lập tài khoản là đủ và không cần biến thể runtime riêng"},customPresetDialog:{title:"Preset tùy chỉnh",presetNameOptional:"Tên preset (tùy chọn)",presetNamePlaceholder:"ví dụ: Preset tùy chỉnh của tôi",codexTipPrefix:"Mẹo Codex: hậu tố",codexTipSuffix:"nỗ lực ghim. Các mô hình không có hậu tố sử dụng cài đặt Tư duy.",defaultModel:"Mô hình mặc định",defaultModelDesc:"Dùng khi không yêu cầu cấp mô hình cụ thể",opusModel:"Opus (Có khả năng nhất)",opusModelDesc:"Đối với các nhiệm vụ lý luận phức tạp",sonnetModel:"Sonnet (Cân bằng)",sonnetModelDesc:"Cân bằng giữa tốc độ và khả năng",haikuModel:"Haiku (Nhanh)",haikuModelDesc:"Phản hồi nhanh cho các tác vụ đơn giản",cancel:"Hủy bỏ",savePreset:"Lưu preset",applyPreset:"Áp dụng cài sẵn",deletePreset:"Xóa cài sẵn"},componentModelSelector:{selectModel:"Chọn mô hình",availableModelsCount:"Mô hình khả dụng ({{count}})",preview:"Xem trước"},searchableSelect:{searchModels:"Tìm mô hình...",noResults:"Không tìm thấy kết quả phù hợp."},copilotSettings:{enableCopilot:"Bật Copilot",enableCopilotDesc:"Cho phép sử dụng đăng ký GitHub Copilot",basicSettings:"Cài đặt cơ bản",accountType:"Loại tài khoản",accountTypeIndividual:"Cá nhân",accountTypeBusiness:"Business",accountTypeEnterprise:"Enterprise",rateLimiting:"Giới hạn tỷ lệ",rateLimitSeconds:"Giới hạn tốc độ (giây)",noLimit:"Không giới hạn",waitOnRateLimit:"Chờ giới hạn tỷ lệ",waitOnRateLimitDesc:"Chờ thay vì lỗi khi đạt đến giới hạn",daemonSettings:"Cài đặt Daemon",autoStartDaemon:"Daemon tự động khởi động",autoStartDaemonDesc:"Bắt đầu copilot-api khi sử dụng hồ sơ"},providerModelSelector:{selectModel:"Chọn mô hình",noModelsForProvider:"Không có mô hình nào cho nhà cung cấp này",broken:"BROKEN",deprecated:"DEPRECATED",paid:"PAID",freeTier:"Gói miễn phí",paidTier:"Gói trả phí",modelKnownIssues:"Mô hình này có vấn đề đã biết",viewIssueDetails:"Xem chi tiết vấn đề",modelDeprecated:"Mô hình này không được dùng nữa",recommended:"Đề xuất",allModelsCount:"Tất cả mô hình ({{count}})",noModelsAvailable:"Không có mô hình khả dụng",shadowed:"Bị che khuất",prefixOnly:"Chỉ tiền tố",current:"Hiện tại",currentValue:"Giá trị hiện tại",preferredPinnedModel:"Mô hình ghim ưu tiên:",pinnedRouteStatus:"Trạng thái tuyến ghim:",pinnedModelNotAdvertised:"Mô hình ghim hiện không được proxy quảng bá: {{model}}"},createAuthProfileDialog:{title:"Tạo tài khoản mới",description:"Hồ sơ xác thực yêu cầu đăng nhập Claude CLI. Chạy lệnh dưới đây trong terminal của bạn. Bạn có thể chỉnh sửa chế độ đồng bộ hóa, nhóm và độ liên tục sau này từ bảng Tài khoản.",profileName:"Tên hồ sơ",profileNamePlaceholder:"ví dụ: công việc, cá nhân, khách hàng",invalidProfileName:"Tên phải bắt đầu bằng một chữ cái và chỉ chứa các chữ cái, số, dấu gạch ngang hoặc dấu gạch dưới.",enableSharedHistory:"Bật đồng bộ hóa lịch sử chia sẻ với các tài khoản xác thực ccs khác",historySyncGroupOptional:"Nhóm đồng bộ hóa lịch sử (tùy chọn)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"Để trống để sử dụng nhóm chia sẻ mặc định. Dấu cách được chuẩn hóa thành dấu gạch ngang.",deeperContinuity:"Nâng cao: chế độ liên tục sâu hơn",deeperContinuityHint:"Thêm đồng bộ cho session-env, file-history, shell-snapshots và todos. Thông tin xác thực vẫn tách biệt.",invalidContextGroup:"Nhóm phải bắt đầu bằng một chữ cái và chỉ sử dụng các chữ cái, số, dấu gạch ngang hoặc dấu gạch dưới (tối đa {{max}} ký tự).",command:"Lệnh",commandFallback:"ccs auth create <name>",afterRunPrefix:"Sau khi chạy lệnh:",afterRunStep1:"Hoàn tất đăng nhập Claude trong trình duyệt của bạn",afterRunStep2:"Quay lại đây và làm mới để xem tài khoản mới",poolingHint:"Muốn dùng định tuyến Claude OAuth dạng pool? Dùng CLIProxy Claude pool từ nút hành động ở trang Tài khoản.",close:"Đóng",copied:"Đã sao chép!",copyCommand:"Sao chép lệnh"},accountRouteGuide:{title:"Lộ trình hai tài khoản khuyến nghị",description:"Dùng account profile riêng để giữ token tách biệt. Chỉ bật history sync khi cả hai tài khoản cần thấy cùng continuity cục bộ.",status:{empty:"tạo tài khoản",isolated:"đã sẵn sàng tách biệt",shared:"chia sẻ context project",deeper:"deeper sync sẵn sàng",mixed:"thiết lập hỗn hợp"},cards:{isolated:{title:"Token vẫn tách biệt",desc:"Mỗi tài khoản ccs auth có Claude config, login và credential riêng. Cài đặt sync không bao giờ copy token."},select:{title:"Bạn chọn tài khoản cần dùng",desc:"Chạy ccs work hoặc ccs personal để chọn rõ tài khoản. Chỉ đặt Default khi plain ccs nên đi theo một tài khoản."},settings:{title:"Settings đi theo root",desc:"Tài khoản không bare link settings.json qua CCS shared state tới ~/.claude/settings.json. ccs auth show sẽ xác nhận."},sync:{title:"History sync là tùy chọn",desc:"Cả hai tài khoản cần Shared mode và cùng group. Deeper sync thêm các artifact continuity cục bộ."}},commands:{isolated:"Dùng tài khoản tách biệt",sync:"Chia sẻ lịch sử tùy chọn",syncDesc:'Dùng cùng group, ví dụ "{{group}}", trên cả hai tài khoản khi muốn chia sẻ lịch sử cục bộ.'}},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"Khác"},cliproxyOverviewComponents:{availableModels:"Mô hình khả dụng",noModelsAvailable:"Không có mô hình khả dụng",startSessionHint:"Bắt đầu phiên CLIProxy để tải danh sách mô hình khả dụng",totalCount:"tổng cộng {{count}}",availableThroughGroupedByProvider:"Các mô hình khả dụng qua {{backendLabel}}, được nhóm theo nhà cung cấp",moreCount:"+{{count}} thêm"},categorizedModelSelector:{selectModel:"Chọn mô hình",noModelsAvailable:"Không có mô hình khả dụng",modelPlaceholder:"Mô hình..."},openrouterQuickStart:{recommended:"Đề xuất",title:"Bắt đầu với OpenRouter",description:"Truy cập các mô hình {{modelCountLabel}} từ OpenAI, Anthropic, Google, Meta, v.v. - tất cả đều thông qua một API.",featureOneApi:"Một API cho mọi nhà cung cấp",profileSummaryCount:"{{count}} hồ sơ",profileSummaryCount_other:"{{count}} hồ sơ",profileSummaryEmpty:"Chất lượng cao + kiểm soát cục bộ",summaryBadgeDefaultQuality:"Mặc định chất lượng tốt nhất",summaryBadgeLocalLane:"Dùng local khi đúng bài toán",summaryExistingTitle:"Chọn hồ sơ hoặc thêm một lane mới",summaryEmptyTitle:"Chọn lane hồ sơ đầu tiên của bạn",summaryExistingDescription:"Bạn đã có {{count}} hồ sơ trong workspace này. Hãy giữ các nhà cung cấp chất lượng cao cho công việc code nghiêm túc, và chỉ thêm runtime local khi cần quyền riêng tư, chi phí thấp hoặc làm việc offline.",summaryExistingDescription_other:"Bạn đã có {{count}} hồ sơ trong workspace này. Hãy giữ các nhà cung cấp chất lượng cao cho công việc code nghiêm túc, và chỉ thêm runtime local khi cần quyền riêng tư, chi phí thấp hoặc làm việc offline.",summaryEmptyDescription:"Chọn lane phù hợp với công việc. Nhà cung cấp premium vẫn là mặc định cho độ tin cậy khi code; runtime local phù hợp hơn cho quyền riêng tư, batch rẻ và thử nghiệm.",qualityLanesTitle:"Lane chất lượng cao",qualityLaneHighlightDefaultQuality:"Lane mặc định tốt nhất cho các tác vụ code quan trọng",alibabaLaneDescription:"Hồ sơ coding trực tiếp mạnh mẽ khi bạn muốn một lane premium riêng ngoài catalog OpenRouter.",alibabaLaneHighlightQuality:"Phù hợp khi bạn cần chất lượng premium với endpoint riêng",localRuntimesTitle:"Runtime local",localOllamaTitle:"Ollama + Gemma 4",localOllamaLabel:"Ollama",localOllamaHighlight:"Tốt nhất cho prompt riêng tư, dọn dẹp local và batch transform chi phí thấp",localLlamacppTitle:"llama.cpp",localLlamacppLabel:"llama.cpp",localLlamacppHighlight:"Tốt nhất cho thiết lập GGUF tùy biến và workflow local tự host nâng cao",localDetectedModels:"Đã phát hiện {{count}} mô hình local",localDetectedModels_other:"Đã phát hiện {{count}} mô hình local",localNoModelsDetected:"Chưa phát hiện mô hình local nào",localWaitingServer:"Đang chờ máy chủ local và danh sách mô hình",localRuntimeCheckingBadge:"Đang kiểm tra",localRuntimeReadyBadge:"Sẵn sàng",localRuntimeNeedsModelBadge:"Thiếu mô hình",localRuntimeOfflineBadge:"Ngoại tuyến",localRuntimeCheckingDescription:"Đang kiểm tra trạng thái runtime local trước khi hiển thị hướng dẫn thiết lập.",localRuntimeReadyDescription:"Phù hợp nhất cho prompt riêng tư, workflow offline và batch transform rẻ hơn.",localRuntimeNeedsModelDescription:"Runtime đã chạy, nhưng mô hình local được khuyến nghị vẫn cần được tải hoặc nạp.",localRuntimeOfflineDescription:"Lane này phù hợp cho công việc nhạy cảm về riêng tư, transform local giá rẻ và phiên offline.",localRuntimeCheckingFooter:"Đang kiểm tra runtime local...",localRuntimeReadyFooter:"Endpoint sẵn sàng tại {{endpoint}}",localRuntimeMissingModelFooter:"Chạy `{{command}}` để hoàn tất thiết lập local.",localRuntimeOfflineFooter:"Chạy `{{command}}` để đưa endpoint local lên.",localRuntimeSetupAction:"Thiết lập {{label}}",localRuntimeUseAction:"Dùng {{label}}",localRuntimeFinishAction:"Hoàn tất thiết lập {{label}}",runtimeProviderBadge:"Thiết lập nhà cung cấp runtime",runtimeProviderTitle:"Mở AI Providers",runtimeProviderManagedDescription:"Dùng mục này khi bạn cần connector do CLIProxy quản lý, secret nhà cung cấp và điều khiển routing nâng cao.",runtimeProviderFeatureConnectors:"Gemini, Codex, Claude, Vertex và các connector tương thích OpenAI",runtimeProviderFeatureSecrets:"Khóa dùng chung tách biệt khỏi từng API Profile",runtimeProviderFooter:"Phù hợp nhất khi nhiều hồ sơ cần dùng chung một cấu hình nhà cung cấp.",createOpenRouterProfile:"Tạo hồ sơ OpenRouter",getApiKeyAt:"Nhận khóa API của bạn tại",createCustomProfile:"Tạo hồ sơ API tùy chỉnh"},alibabaCodingPlanQuickStart:{recommended:"Đề xuất",title:"Dùng thử Alibaba Coding Plan",description:"Sử dụng Alibaba Cloud Coding Plan qua endpoint tương thích Anthropic cho tác vụ lập trình.",featureEndpoint:"Endpoint tương thích Anthropic",featureKeyFormat:"Khóa API sk-sp chuyên dụng",createAlibabaProfile:"Tạo hồ sơ Alibaba Coding Plan",readGuideAt:"Xem hướng dẫn tại"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Model Studio Coding Plan qua endpoint Anthropic",add:"Thêm"},credentialHealth:{title:"Tình trạng thông tin xác thực",ready:"Sẵn sàng",noCredentialsConfigured:"Không có thông tin xác thực nào được định cấu hình. Sử dụng các nút đăng nhập ở trên để xác thực.",neverUsed:"Chưa bao giờ sử dụng",justNow:"Vừa rồi",unknown:"Không xác định",daysAgo:"{{count}} ngày trước",hoursAgo:"{{count}} giờ trước",minutesAgo:"{{count}} phút trước"},proxyStatusWidget:{justNow:"vừa xong",minutesAgo:"{{count}} phút trước",hoursAgo:"{{count}} giờ trước",syncReady:"Sẵn sàng đồng bộ hóa",noConfig:"Không có cấu hình",remoteProxy:"Proxy từ xa",active:"Đang hoạt động",trafficAutoRouted:"Lưu lượng truy cập tự động được định tuyến đến máy chủ từ xa",tooltipSync:"Đồng bộ hóa hồ sơ với CLIProxy",tooltipRestart:"Khởi động lại",tooltipStop:"Dừng lại",tooltipClose:"Đóng",tooltipVersionSettings:"Cài đặt phiên bản",versionManagement:"Quản lý phiên bản",selectVersionPlaceholder:"Chọn phiên bản để cài đặt...",stable:"(ổn định)",install:"Cài đặt",versionsAboveUnstable:"Các phiên bản trên {{version}} có vấn đề đã biết",versionsKnownIssues:"Phiên bản {{version}} có vấn đề đã biết",lastChecked:"Đã kiểm tra lần cuối {{time}}",notRunning:"Không chạy",start:"Bắt đầu",port:"Cổng {{port}}",sessionCount:"{{count}} phiên",sessionCount_other:"{{count}} phiên",installFaultyTitle:"Cài đặt phiên bản có lỗi đã biết?",installFaultyDesc:"Bạn sắp cài đặt <strong>v{{version}}</strong>, phiên bản này nằm trong dải lỗi đã biết <strong>{{range}}</strong>.",installFaultyWarning:"Phiên bản này có lỗi đã biết và có thể cài đặt thất bại hoặc làm proxy ở trạng thái xấu.",installUnstableTitle:"Cài đặt phiên bản không ổn định?",installUnstableDesc:"Bạn sắp cài đặt <strong>v{{version}}</strong>, phiên bản này cao hơn phiên bản ổn định tối đa <strong>v{{maxStable}}</strong>.",installUnstableWarning:"Phiên bản này đã biết có vấn đề về độ ổn định và có thể gây ra hành vi không mong muốn.",installUnstableConfirm:"Bạn có chắc chắn muốn tiếp tục không?",cancel:"Hủy bỏ",installAnyway:"Vẫn cài đặt",clickToDowngrade:"Bấm để hạ cấp",clickToUpdate:"Bấm để cập nhật"},syncStatusCard:{profileSync:"Đồng bộ hồ sơ",ready:"Sẵn sàng",noConfig:"Không có cấu hình",syncsProfilesDesc:"Đồng bộ hóa cấu hình API với cấu hình CLIProxy cục bộ",runDoctorHint:"Chạy <code>ccs doctor --fix</code> để tạo cấu hình.",details:"Chi tiết",syncNow:"Đồng bộ ngay"},syncDialog:{title:"Đồng bộ hóa hồ sơ với CLIProxy cục bộ",description:"Đồng bộ hóa cấu hình API CCS của bạn với CLIProxy config.yaml cục bộ.",noProfiles:"Không có profile nào để đồng bộ.",createProfilesFirst:"Trước tiên hãy tạo hồ sơ API bằng tab Hồ sơ.",modelLabel:"Mô hình:",ready:"Sẵn sàng",profilesToSync_one:"{{count}} hồ sơ để đồng bộ hóa",profilesToSync_other:"{{count}} hồ sơ cần đồng bộ hóa",cancel:"Hủy bỏ",syncing:"Đang đồng bộ hóa...",synced:"Đã đồng bộ hóa!",syncNow:"Đồng bộ ngay"},errorLogs:{title:"Nhật ký lỗi",failedRequests_one:"{{count}} yêu cầu thất bại",failedRequests_other:"{{count}} yêu cầu thất bại",cliproxyDiagnostics:"Chẩn đoán CLIProxy",showingCount:"Hiển thị 50 trong số {{total}} nhật ký",selectLog:"Chọn nhật ký để xem chi tiết",failedLoadContent:"Không tải được nội dung nhật ký",copyAbsolutePath:"Sao chép đường dẫn tuyệt đối",copyRawContent:"Sao chép nội dung nhật ký thô",tabOverview:"Tổng quan",tabHeaders:"Tiêu đề",tabRequest:"Yêu cầu",tabResponse:"Phản hồi",tabRaw:"Raw",modelLabel:"Mô hình:",quotaResetsIn:"Quota sẽ được đặt lại sau",method:"Phương thức",provider:"Nhà cung cấp",version:"Phiên bản",endpoint:"Điểm cuối",url:"URL",timestamp:"Dấu thời gian",na:"không áp dụng",noHeaders:"Không có tiêu đề nào",noRequestBody:"Không có nội dung yêu cầu",noResponseBody:"Không có nội dung phản hồi",rateLimitedMsg:"Bị giới hạn tốc độ. Hãy chuyển sang tài khoản khác hoặc chờ reset hạn ngạch. Mô hình {{model}} đã hết quota.",rateLimitedMsgNoModel:"Bị giới hạn tốc độ. Hãy chuyển sang tài khoản khác hoặc chờ reset hạn ngạch.",authFailedMsg:"Xác thực không thành công. Xác thực lại thông qua Cài đặt CLIProxy hoặc kiểm tra khóa API.",notFoundMsg:"Không tìm thấy điểm cuối. Điểm cuối này có thể không tồn tại trên nhà cung cấp này.",serverErrorMsg:"Lỗi máy chủ từ upstream. Hãy thử lại sau hoặc kiểm tra trang trạng thái của nhà cung cấp.",timeoutMsg:"Yêu cầu hết thời gian chờ. Kiểm tra kết nối mạng hoặc tăng timeout.",unknown:"không rõ"},editAccountContext:{title:"Chỉnh sửa đồng bộ hóa lịch sử",description:'Định cấu hình cách "{{name}}" chia sẻ lịch sử và tính liên tục với các tài khoản xác thực ccs khác.',syncMode:"Chế độ đồng bộ",selectContextMode:"Chọn chế độ ngữ cảnh",isolatedOption:"tách biệt (không đồng bộ)",sharedOption:"chia sẻ (đã bật đồng bộ)",sharedModeHint:"Chế độ chia sẻ sử dụng lại ngữ cảnh không gian làm việc cho các tài khoản trong cùng một nhóm đồng bộ lịch sử.",isolatedModeHint:"Chế độ biệt lập giúp tài khoản này tách biệt hoàn toàn với các tài khoản xác thực ccs khác.",historySyncGroup:"Nhóm đồng bộ hóa lịch sử",groupPlaceholder:"mặc định",groupHint:"Chuẩn hóa thành chữ thường (dấu cách trở thành dấu gạch ngang). Được phép: chữ cái, số, _ , - (tối đa {{max}} ký tự).",invalidGroup:"Nhập tên nhóm hợp lệ bắt đầu bằng một chữ cái.",continuityDepth:"Độ sâu liên tục",selectContinuityDepth:"Chọn độ sâu liên tục",standardOption:"tiêu chuẩn (chỉ đồng bộ project)",deeperOption:"tính liên tục sâu hơn (nâng cao)",deeperHint:"Chế độ nâng cao cũng đồng bộ hóa phiên-env, lịch sử tệp, ảnh chụp nhanh shell và todos.",standardHint:"Chế độ tiêu chuẩn chỉ đồng bộ hóa bối cảnh không gian làm việc của dự án.",credentialsIsolated:"Thông tin xác thực và .anthropic vẫn được tách riêng cho mỗi tài khoản ở tất cả các chế độ.",implicationTitle:"Sau khi lưu sẽ như thế nào",isolatedImplication:"Tài khoản này sẽ tiếp tục tách biệt. Tài khoản khác sẽ không thể resume trạng thái continuity của nó.",sameGroupRule:'Các tài khoản phải dùng cùng nhóm "{{group}}" thì mới chia sẻ continuity cho nhau.',noSameGroupPeer:"Hiện chưa có tài khoản nào khác dùng nhóm này.",sameGroupPeerCount_one:"{{count}} tài khoản khác đã dùng nhóm này.",sameGroupPeerCount_other:"{{count}} tài khoản khác đã dùng nhóm này.",deeperReady_one:"{{count}} tài khoản cùng nhóm đã bật deeper continuity. Đây là thiết lập handoff mạnh nhất hiện có.",deeperReady_other:"{{count}} tài khoản cùng nhóm đã bật deeper continuity. Đây là thiết lập handoff mạnh nhất hiện có.",deeperNeedsPeers:"Tài khoản này đã bật deeper continuity, nhưng tài khoản khác trong cùng nhóm vẫn cần bật deeper continuity để hỗ trợ resume xuyên tài khoản tốt hơn.",standardWarning:"Chế độ shared tiêu chuẩn chỉ phù hợp cho ngữ cảnh project. Nếu người dùng mong resume xuyên tài khoản, cả hai tài khoản nên bật deeper continuity.",resumeOriginalWarning:"Nếu cuộc trò chuyện cũ quan trọng, hãy resume nó từ tài khoản gốc trước khi đổi cấu hình.",cancel:"Hủy bỏ",save:"Lưu",saving:"Đang lưu..."},historySyncLearningMap:{title:"Cách đồng bộ hóa lịch sử hoạt động",description:"Tách biệt -> Chia sẻ -> Sâu hơn. Dùng Sync trên từng dòng để áp dụng thay đổi.",learningMap:"Bản đồ học tập",isolated:"Tách biệt",shared:"Chia sẻ",deeper:"Sâu hơn",cliproxyManaged_one:"{{count}} Tài khoản nhóm CLIProxy Claude được quản lý trong trang Action Center / CLIProxy.",cliproxyManaged_other:"{{count}} Tài khoản CLIProxy Claude pool được quản lý trong trang Action Center / CLIProxy.",showDetails:"Hiển thị chi tiết: nhóm, chuyển đổi và chính sách kế thừa",modeSwitch:"Chuyển đổi chế độ",modeSwitchDesc:"Hộp thoại đồng bộ hóa cho phép người dùng di chuyển giữa cách ly/chia sẻ và chọn tính liên tục sâu hơn.",historySyncGroup:"Nhóm đồng bộ hóa lịch sử",historySyncGroupDesc:"Cùng một nhóm nghĩa là chia sẻ cùng bối cảnh project. Nếu để trống sẽ dùng nhóm mặc định.",sameGroupRule:"Hiện tại, các tài khoản chỉ chia sẻ continuity khi cả hai đều ở chế độ shared và dùng cùng một nhóm.",deeperRecommendation:'Nhóm "{{group}}" đã được chia sẻ, nhưng deeper continuity vẫn là lựa chọn an toàn hơn nếu người dùng mong resume xuyên tài khoản.',partialGroup:'Nhóm "{{group}}" đã ổn, nhưng các tài khoản hoặc nhóm khác vẫn cần hoàn thiện cấu hình cùng nhóm hoặc deeper continuity.',readyGroup:'Nhóm "{{group}}" đã có nhiều tài khoản bật deeper continuity. Đây là thiết lập handoff mạnh nhất hiện có.',legacyConfirmation_one:"{{count}} tài khoản cũ vẫn cần xác nhận rõ ràng.",legacyConfirmation_other:"{{count}} tài khoản cũ vẫn cần xác nhận rõ ràng."},continuityReadiness:{title:"Kiểm tra resume xuyên tài khoản",description:"Dùng thẻ này để biết còn thiếu gì trước khi người dùng chuyển tài khoản.",state:{single:"một tài khoản",isolated:"resume tắt","shared-alone":"đã shared nhưng chưa đủ","shared-standard":"chỉ project",partial:"mới sẵn sàng một phần",ready:"handoff mạnh đã sẵn sàng"},metrics:{isolated:"Tách biệt",sharedPeers:"Có bạn cùng nhóm",deeperReady:"Deeper sẵn sàng"},messages:{single:{title:"Hiện chỉ có một auth account.",description:"Cross-account handoff chưa áp dụng. Hãy thêm một auth account khác trước khi cấu hình shared continuity."},isolated:{title:"Hiện tại cross-account resume đang tắt.",description:"Tất cả tài khoản đang hiển thị đều ở chế độ isolated, nên phiên được tạo trong một tài khoản sẽ ở lại tài khoản đó."},"shared-alone":{title:"Đã có shared mode, nhưng chưa có nhóm nào có bạn cùng nhóm.",description_one:"{{count}} shared account vẫn đang chờ một tài khoản khác vào cùng nhóm.",description_other:"{{count}} shared accounts vẫn đang chờ một tài khoản khác vào cùng nhóm."},"shared-standard":{title:'Nhóm "{{group}}" đang chia sẻ ngữ cảnh project nhưng chưa ghép deeper continuity.',description:"Người dùng có thể mong nhiều hơn việc chia sẻ project. Hãy bật deeper continuity trên cả hai tài khoản trong nhóm này để có handoff mạnh hơn."},partial:{title:"Một nhóm đã sẵn sàng, nhưng cấu hình tổng thể vẫn còn lẫn lộn.",description:"Ít nhất một nhóm đã dùng deeper continuity, nhưng các tài khoản khác vẫn còn isolated, ở một mình trong nhóm shared, hoặc chưa bật deeper continuity."},ready:{title:'Nhóm "{{group}}" đã có thiết lập continuity mạnh nhất hiện có.',description:"Nhiều tài khoản trong nhóm này đã bật deeper continuity. Việc resume thực tế vẫn phụ thuộc vào dữ liệu mà Claude lưu ở upstream."}},stepsTitle:"Người dùng nên làm gì tiếp theo",steps:{syncBoth:"Mở Sync trên cả hai tài khoản, không chỉ tài khoản bạn sắp chuyển sang.",sameGroup:'Dùng cùng một History Sync Group trên cả hai tài khoản. "{{group}}" là nhóm được đề xuất hiện tại.',enableDeeper:"Nếu người dùng mong resume xuyên tài khoản thay vì chỉ chia sẻ project, hãy bật deeper continuity trên cả hai tài khoản.",resumeOriginal:"Nếu cuộc trò chuyện gốc quan trọng, hãy resume nó từ tài khoản gốc trước khi đổi cài đặt continuity."},singleSteps:{addAccount:"Hãy tạo thêm một ccs auth account thứ hai trước khi lên kế hoạch handoff xuyên tài khoản.",sameGroupLater:"Khi tài khoản thứ hai đã sẵn sàng, đặt cả hai vào cùng một History Sync Group.",enableDeeperLater:"Nếu sau này người dùng sẽ mong resume xuyên tài khoản, hãy bật deeper continuity trên cả hai tài khoản.",resumeOriginal:"Cho đến khi tài khoản thứ hai sẵn sàng, các cuộc trò chuyện quan trọng vẫn nên được resume từ tài khoản gốc."}},continuityOverview:{plainLaneTitle:"Plain ccs đang dùng một lane resume khác",plainLaneDescription:"Plain ccs hiện resume từ {{lane}}, không phải lane của tài khoản này. Hãy khôi phục lane gốc trước khi đổi cài đặt sync.",setDefaultHint:"Nếu muốn plain ccs theo một tài khoản trong các phiên sau, hãy dùng hành động Set Default trên dòng tài khoản đó.",recommendBadge:"Đề xuất {{group}}",partialBadge:"Đồng bộ một phần {{group}}",lane:{native:"Claude gốc (~/.claude)",accountDefault:"tài khoản {{name}}",accountInherited:"tài khoản {{name}} qua continuity inheritance",profileDefault:"profile mặc định {{name}} qua lane Claude gốc"}},accountsTable:{name:"Tên",type:"Kiểu",defaultBadge:"mặc định",created:"Ngày tạo",lastUsed:"Được sử dụng lần cuối",historySync:"Đồng bộ hóa lịch sử",actions:"Hành động",syncTitle:"Chỉnh sửa chế độ đồng bộ, nhóm và độ sâu liên tục",confirmLegacyTitle:"Xác nhận chế độ hiện tại của tài khoản cũ này là rõ ràng",sync:"Đồng bộ hóa",confirm:"Xác nhận",active:"Đang hoạt động",setDefault:"Đặt mặc định",deleteAccount:"Xóa tài khoản",cannotDeleteDefault:"Không thể xóa tài khoản mặc định",noAccounts:"Không tìm thấy tài khoản xác thực CCS nào. Sử dụng ccs auth create để thêm tài khoản.",resetToDefault:"Đặt lại về mặc định CCS",deleteDialogTitle:"Xóa tài khoản",deleteDialogDesc:'Bạn có chắc chắn muốn xóa tài khoản "{{name}}" không? Thao tác này sẽ xóa hồ sơ và tất cả dữ liệu phiên của nó. Không thể hoàn tác hành động này.',cancel:"Hủy bỏ",delete:"Xóa",sharedGroupStandard:"chia sẻ ({{group}}, tiêu chuẩn)",sharedGroupDeeper:"chia sẻ ({{group}}, sâu hơn)",sharedGroupLegacy:"chia sẻ ({{group}}, kế thừa tiêu chuẩn)",isolatedLegacy:"tách biệt (mặc định cũ)",isolated:"tách biệt",noSameGroupPeer:"Chưa có tài khoản cùng nhóm",sameGroupPeerCount_one:"{{count}} tài khoản cùng nhóm",sameGroupPeerCount_other:"{{count}} tài khoản cùng nhóm",legacyReview:"Hãy xem lại và xác nhận trạng thái suy ra này.",noHandoff:"Resume xuyên tài khoản vẫn sẽ quay về tài khoản gốc.",badges:{shared:"Chia sẻ",deeper:"Sâu hơn",legacy:"Kế thừa",isolated:"Tách biệt"}},addAccountDialog:{title:"Thêm tài khoản {{displayName}}",descKiro:"Chọn phương thức xác thực Kiro, sau đó xác thực qua trình duyệt hoặc nhập từ Kiro IDE.",descDeviceCode:"Nhấp vào Xác thực. Mã xác minh sẽ xuất hiện để bạn nhập vào trang web của nhà cung cấp.",descOauth:"Nhấp vào Xác thực để nhận URL OAuth. Mở nó trong bất kỳ trình duyệt nào để đăng nhập.",powerUserEnabled:"Đã bật chế độ power user",powerUserSkipped:"Chế độ power user trong Cài đặt > Proxy đang bỏ qua danh sách kiểm tra trách nhiệm AGY và bước nhập cụm từ rủi ro của Gemini trên dashboard. Bạn tự chịu hoàn toàn rủi ro OAuth/tài khoản.",powerUserLoadFailed:"Không thể tải cài đặt chế độ power user. Hãy kiểm tra Cài đặt > Proxy rồi thử lại.",powerUserLoading:"Đang tải cài đặt an toàn cho chế độ power user. Vui lòng đợi một chút rồi thử lại.",powerUserUnavailableRetry:"Chế độ power user hiện không khả dụng. Hãy hoàn tất bước an toàn bắt buộc của nhà cung cấp rồi thử lại.",authMethod:"Phương thức xác thực",selectKiroAuthMethod:"Chọn phương thức xác thực Kiro",gitlabAuthMethod:"Phương thức xác thực GitLab",selectGitlabAuthMethod:"Chọn phương thức xác thực GitLab",gitlabAuthOAuth:"OAuth trên trình duyệt",gitlabAuthPat:"Personal Access Token",gitlabAuthHint:"Dùng OAuth trên trình duyệt cho gitlab.com, hoặc PAT cho GitLab tự lưu trữ và môi trường do quản trị viên quản lý.",gitlabUrl:"GitLab URL",gitlabUrlPlaceholder:"https://gitlab.com",gitlabUrlHint:"Tùy chọn. Để trống cho gitlab.com, hoặc nhập URL GitLab tự lưu trữ của bạn.",gitlabPat:"Personal Access Token",gitlabPatPlaceholder:"glpat-...",gitlabPatHint:"Token phải có ít nhất các scope",gitlabPatRequired:"PAT login yêu cầu GitLab Personal Access Token.",nicknameRequired:"Biệt danh (bắt buộc)",nicknameOptional:"Biệt danh (tùy chọn)",nicknamePlaceholder:"ví dụ: công việc, cá nhân",nicknameRequiredHint:"Bắt buộc với nhà cung cấp này. Dùng tên thân thiện duy nhất (ví dụ: work, personal).",nicknameOptionalHint:"Tên thân thiện để nhận biết tài khoản này. Để trống để dùng mã nhận dạng an toàn do hệ thống tạo.",waitingForAuth:"Đang chờ xác thực...",deviceCodeHint:"Hộp thoại mã xác minh sẽ sớm xuất hiện. Nhập mã trên trang web của nhà cung cấp.",browserHint:"Hoàn tất xác thực trong trình duyệt của bạn. Hộp thoại này sẽ tự động đóng lại.",openUrlLabel:"Mở URL này trong bất kỳ trình duyệt nào để đăng nhập:",copied:"Đã sao chép",copy:"Sao chép",open:"Mở",popupBlocked:"Cửa sổ bật lên bị chặn. Sao chép URL ở trên và mở thủ công trong trình duyệt của bạn.",redirectPasteLabel:"Chuyển hướng không hoạt động? Dán URL gọi lại:",callbackPlaceholder:"Dán URL chuyển hướng vào đây...",submitCallback:"Gửi cuộc gọi lại",submitting:"Đang gửi...",preparingUrl:"Đang chuẩn bị URL đăng nhập...",cancel:"Hủy bỏ",importingToken:"Đang nhập token từ Kiro IDE...",authenticate:"Xác thực",importFromIde:"Nhập từ IDE",importing:"Đang nhập..."},flowViz:{backToProviders:"Quay lại nhà cung cấp",showDetails:"Hiển thị chi tiết",hideDetails:"Ẩn chi tiết",showPausedAccounts:"Hiện tạm dừng ({{count}})",hidePausedAccounts:"Ẩn tạm dừng ({{count}})",visibleTotalRequests:"Yêu cầu hiển thị",visibleAccounts:"Tài khoản hiển thị",excludingPausedAccounts:"Đang loại trừ {{count}} tài khoản tạm dừng",resetLayout:"Đặt lại bố cục",provider:"Nhà cung cấp",totalRequests:"Tổng số yêu cầu",accounts:"Tài khoản",connectionTimeline:"Dòng thời gian kết nối",noRecentConnections:"Không có kết nối gần đây"},quickStats:{totalRequests:"Tổng số yêu cầu",successRate:"Tỷ lệ thành công",totalTokens:"Tổng số token",activeModels:"Mô hình hoạt động"},authMonitor:{accounts:"Tài khoản",accountsCount:"{{count}} tài khoản",success:"Thành công",failed:"Thất bại",successRate:"Tỷ lệ thành công"},accountCard:{resumeAccount:"Tiếp tục tài khoản",pauseAccount:"Tạm dừng tài khoản",quotaLoading:"Hạn ngạch...",quota:"hạn ngạch",quotaUnavailable:"Thông tin quota chưa khả dụng",reauthNeeded:"Cần xác thực lại",failureLabelReauth:"Xác thực lại",failureLabelWorkspace:"Workspace",failureLabelNoAccess:"Không có quyền",failureLabelRetry:"Thử lại",failureLabelReconnect:"Kết nối lại",failureLabelTemporary:"Tạm thời",failureLabelUnavailable:"Chưa khả dụng",failureHintReauth:"Chạy lại luồng xác thực của tài khoản này để làm mới quyền truy cập.",failureHintWorkspace:"Chuyển tài khoản này về workspace còn hoạt động rồi xóa và thêm lại.",failureHintNoAccess:"Tài khoản này không thể truy cập endpoint quota của nhà cung cấp.",failureHintRetry:"Đợi một chút rồi thử lại yêu cầu quota.",failureHintReconnect:"Xóa tài khoản cũ rồi xác thực lại.",failureHintTemporary:"Có vẻ đây là lỗi tạm thời. Hãy thử lại sau.",removeAndReadd:"Xóa và thêm lại tài khoản",autoRefreshFailed:"Tự động làm mới không thành công"},antigravityChecklist:{title:"Trách nhiệm OAuth Antigravity",subtitle:"Hoàn thành tất cả 4 bước trước khi bạn có thể xác thực.",mandatory:"Bắt buộc",completion:"Hoàn thành",stepsCount:"{{current}}/4 bước"},accountSafetyWarning:{title:"Cảnh báo an toàn tài khoản OAuth",subtitle:"Vấn đề #509 · Rủi ro Gemini + AGY OAuth",firstLine:"Issue #509 ghi nhận các trường hợp bị đình chỉ/cấm liên quan đến ccs agy và việc dùng chung tài khoản giữa ccs gemini và ccs agy.",secondLine:"Chỉ tiếp tục nếu bạn chấp nhận hoàn toàn trách nhiệm về OAuth và rủi ro truy cập tài khoản.",issueLabel:"Đọc vấn đề #509",proxySettingsLabel:"Điều khiển Gemini + AGY: Cài đặt > Proxy"},cliproxyDialog:{name:"Tên",provider:"Nhà cung cấp",account:"Tài khoản",accountOptional:"Tài khoản (tùy chọn)",model:"Mô hình",modelOptional:"Mô hình (tùy chọn)",defaultTarget:"Mục tiêu mặc định",defaultTier:"Cấp mặc định",tierConfig:"Cấu hình cấp độ",selectProvider:"Chọn nhà cung cấp...",useDefaultAccount:"Sử dụng tài khoản mặc định",defaultSuffix:"(mặc định)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"Hủy bỏ",create:"Tạo",creating:"Đang tạo...",saveChanges:"Lưu thay đổi",saving:"Đang lưu...",placeholderName:"Gemini của tôi",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"Chỉnh sửa biến thể tổng hợp: {{name}}",editSingleTitle:"Chỉnh sửa biến thể: {{name}}"},profileEditor:{profileInfo:"Thông tin hồ sơ",profileName:"Tên hồ sơ",filePath:"Đường dẫn tệp",lastModified:"Sửa đổi lần cuối",defaultTarget:"Mục tiêu mặc định",quickUsage:"Sử dụng nhanh",runWithProfile:"Chạy với hồ sơ",runOnDroid:"Chạy trên Droid",runOnDroidWithFlag:"Chạy trên Droid (--target)",droidAliasExplicit:"Bí danh Droid (rõ ràng)",overrideToClaude:"Ghi đè lên Claude",overrideToClaudeExplicit:"Ghi đè lên Claude (rõ ràng)",targetHintPreferredAlias:"Bí danh rõ ràng nên dùng:",targetHintClaudeDefault:"Lệnh mặc định:",targetHintLegacyAlias:"Lối tắt cũ vẫn dùng được:",targetHintOverride:"Bạn vẫn có thể ghi đè mỗi lần chạy bằng",setAsDefault:"Đặt làm mặc định",provider:"Nhà cung cấp",custom:"Tùy chỉnh",providerChooserHint:"Bắt đầu với preset, sau đó bạn vẫn có thể chỉnh URL, API key và ánh xạ mô hình.",featuredProviders:"Nhà cung cấp nổi bật",scrollHint:"Có thể cuộn ngang trên màn hình hẹp",customEndpoint:"Endpoint tùy chỉnh",morePresets:"Thêm preset",customEndpointDescription:"Bắt đầu với URL tương thích Anthropic trống và tự cấu hình mọi thứ."},settings:{sectionLoadFailed:"Không tải được phần",unknownError:"Đã xảy ra lỗi không xác định",reloadPage:"Tải lại trang",refresh:"Làm mới",copy:"Sao chép",copied:"Đã sao chép",saved:"Đã lưu",loading:"Đang tải...",configFileNotFound:"Không tìm thấy tập tin cấu hình"},settingsTabs:{browser:"Trình duyệt",web:"Web",image:"Hình ảnh",channels:"Kênh",env:"Env",think:"Tư duy",proxy:"Proxy",auth:"Xác thực",backup:"Sao lưu"},settingsAuth:{failedFetchTokens:"Không thể tải token xác thực",failedSaveTokens:"Không thể lưu token",tokensUpdated:"Đã cập nhật token. Khởi động lại CLIProxy để áp dụng.",failedRegenerate:"Không thể tạo lại bí mật",secretRegenerated:"Bí mật quản lý mới được tạo. Khởi động lại CLIProxy để áp dụng.",failedReset:"Không thể đặt lại token",tokensReset:"Token đã được đặt lại về mặc định. Khởi động lại CLIProxy để áp dụng.",description:"Cấu hình token xác thực CLIProxy. Các thay đổi yêu cầu khởi động lại CLIProxy.",apiKey:"Khóa API",custom:"Tùy chỉnh",apiKeyDesc:"Được Claude Code dùng để xác thực qua CLIProxy",apiKeyPlaceholder:"Khóa API",managementSecret:"Bí mật quản lý",managementSecretDesc:"Được bảng điều khiển CCS sử dụng để truy cập API quản lý CLIProxy",managementSecretPlaceholder:"Bí mật quản lý",generateSecret:"Tạo bí mật an toàn mới",resetDefaults:"Đặt lại về mặc định",resetDesc:"Đặt lại cả khóa API và bí mật quản lý về giá trị mặc định.",saving:"Đang lưu...",save:"Lưu"},settingsGlobalEnv:{description:"Biến môi trường được áp dụng cho tất cả hồ sơ không dùng Claude subscription (gemini, codex, agy, ghcp, v.v.)",enabled:"Đã bật Env toàn cầu",disabled:"Env toàn cầu bị vô hiệu hóa",enabledDesc:"Biến Env sẽ được áp dụng cho các hồ sơ bên thứ ba",disabledDesc:"Biến Env sẽ không được áp dụng",envVars:"Biến môi trường",noneConfigured:"Không có biến môi trường nào được cấu hình",addNew:"Thêm biến mới",keyName:"KEY_NAME",value:"giá trị",add:"Thêm",quickAdd:"Thêm nhanh các biến phổ biến",allConfigured:"Tất cả biến phổ biến đã được cấu hình"},settingsBackups:{failedFetch:"Không tìm nạp được bản sao lưu",failedRestore:"Không thể khôi phục bản sao lưu",restoreSuccess:"Đã khôi phục bản sao lưu thành công",title:"Sao lưu cài đặt",description:"Khôi phục các phiên bản trước của tệp settings.json của bạn. Bản sao lưu được tạo tự động khi cài đặt được sửa đổi.",none:"Không có bản sao lưu nào",noneHint:"Bản sao lưu sẽ xuất hiện ở đây khi bạn sửa đổi cài đặt",latest:"Mới nhất",restoring:"Đang khôi phục...",restore:"Khôi phục",restoreConfirmTitle:"Khôi phục bản sao lưu?",restoreConfirmPrefix:"Điều này sẽ thay thế cài đặt hiện tại của bạn bằng bản sao lưu từ",restoreConfirmSuffix:"Không thể hoàn tác hành động này.",cancel:"Hủy bỏ"},settingsWebsearch:{description:"Tìm kiếm trên web dựa trên CLI cho hồ sơ của bên thứ ba (gemini, codex, agy, v.v.)",enabled:"Đã bật Tìm kiếm trên web",disabled:"Tìm kiếm trên web bị vô hiệu hóa",checking:"Đang kiểm tra trạng thái...",providers:"Nhà cung cấp",noneConfigured:"Không có nhà cung cấp nào được cấu hình",noneConfiguredHint:"Cài công cụ CLI để bật các nhà cung cấp WebSearch",checkProviders:"Kiểm tra các nhà cung cấp",installed:"đã cài đặt",notInstalled:"chưa được cài đặt",model:"Mô hình:",howInstall:"Cách cài đặt {{name}} CLI",installGlobally:"Cài đặt trên toàn cầu",requiresKey:"(cần khóa API xAI)",freeTier:"(Có sẵn cấp MIỄN PHÍ)",viewDocs:"Xem tài liệu"},settingsProxy:{failedLoadAgyMode:"Không thể tải chế độ power user",failedUpdateAgyMode:"Không thể cập nhật chế độ power user",failedVerifyAgyMode:"Không thể xác minh trạng thái lưu của chế độ power user",notPersistedAgyMode:"Chế độ power user chưa được lưu bền vững. Cấu hình có thể đã bị tiến trình khác sửa.",agyModeEnabled:"Đã bật chế độ power user.",agyModeDisabled:"Đã tắt chế độ power user.",typePhraseToContinue:'Nhập "{{value}}" để tiếp tục.',description:"Định cấu hình kết nối {{backend}} cục bộ hoặc từ xa cho cấu hình dựa trên proxy",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"Trạng thái phiên bản",connectionMode:"Chế độ kết nối",local:"Cục bộ",remote:"Từ xa",localDesc:"Chạy nhị phân {{backend}} trên máy này",remoteDesc:"Kết nối với máy chủ {{backend}} từ xa",backendBinary:"Tệp thực thi backend",stopProxyToSwitch:"Dừng proxy đang chạy trong Trạng thái phiên bản trước khi chuyển backend.",default:"Mặc định",plusDesc:"Nhánh tùy chọn cho các nhà cung cấp bổ sung. Vẫn được hỗ trợ nhưng hiện do cộng đồng duy trì thay vì upstream.",originalDesc:"Backend mặc định, luôn sẵn sàng cho nhóm nhà cung cấp cốt lõi.",plusFallbackNotice:"Nhánh nhà cung cấp Plus chưa bị khai tử, nhưng CLIProxy cục bộ vẫn quay về backend gốc cho tới khi đường dẫn fork được duy trì được bật lại.",variantsIncompatible:"Các biến thể plus-extra hiện có ({{providers}}) sẽ không chạy trên backend gốc. Có thể giữ lại để tham chiếu, nhưng hãy chuyển sang Plus trước khi dùng.",safety:"An toàn",agyModeTitle:"Chế độ power user Antigravity + Gemini",agyModeDesc:"Bỏ qua danh sách kiểm tra trách nhiệm AGY và bước nhập cụm từ xác nhận của Gemini trên dashboard.",agyWarning:"Chỉ bật nếu bạn hiểu rõ rủi ro bị đình chỉ/cấm OAuth (#509). CCS không chịu trách nhiệm khi mất tài khoản.",finalConfirm:"Xác nhận cuối cùng",finalConfirmDesc:"Việc bật tính năng này sẽ bỏ qua các điểm kiểm tra an toàn AGY và bước nhập cụm từ rủi ro của Gemini trên dashboard. Xem lại vấn đề #509 và nhập cụm từ chính xác để tiếp tục.",step1:"Bước 1",readIssue:"Đọc vấn đề #509",step2:"Bước 2",typePrefix:"Nhập",typeSuffix:"để kích hoạt.",typePhraseAria:"Nhập I ACCEPT RISK để bật chế độ power user Antigravity + Gemini",exactPhrase:"Phải nhập chính xác cụm từ.",enableAgyMode:"Bật chế độ power user Antigravity + Gemini",toggleAgyMode:"Chuyển đổi chế độ power user Antigravity + Gemini",fallbackSettings:"Cài đặt dự phòng",enableFallback:"Cho phép dự phòng về cục bộ",enableFallbackDesc:"Sử dụng proxy cục bộ nếu không thể truy cập được từ xa",autoStartLocal:"Tự động khởi động proxy cục bộ",autoStartLocalDesc:"Tự động khởi động proxy cục bộ khi dự phòng",advanced:"Nâng cao",debugMode:"Chế độ gỡ lỗi",debugModeDesc:"Bật chẩn đoán dành cho nhà phát triển trong bảng điều khiển trình duyệt",debugModeEnabled:"Đã bật chế độ gỡ lỗi. Kiểm tra bảng điều khiển trình duyệt để biết nhật ký chi tiết.",localProxy:"Proxy cục bộ",port:"Cổng",autoStart:"Tự động khởi động",localAutoStartDesc:"Tự động khởi động proxy cục bộ khi cần",remoteConfigTitle:"Cấu hình máy chủ từ xa",host:"Host",hostPlaceholder:"192.168.1.100 hoặc proxy.example.com",defaultPort:"mặc định {{value}}",portPlaceholder:"Để trống để dùng {{value}}",protocol:"Giao thức",http:"HTTP",https:"HTTPS",apiKeyOptional:"Khóa API (tùy chọn)",apiKeyPlaceholder:"Đối với điểm cuối API /v1/*",apiKeyDesc:"Dùng cho các yêu cầu API đến /v1/chat/completions",managementKeyOptional:"Khóa quản lý (tùy chọn)",managementKeyPlaceholder:"Đối với điểm cuối /v0/management/*",managementKeyDesc:"Dùng cho API quản lý dashboard. Nếu bỏ trống sẽ dùng Khóa API.",testing:"Đang thử nghiệm...",testConnection:"Kiểm tra kết nối",connectedLatency:"Đã kết nối ({{value}}ms)",connectionFailed:"Kết nối không thành công",invalidPortOrEmpty:"Cổng phải là số nguyên từ 1 đến 65535 hoặc để trống theo mặc định",invalidLocalPort:"Cổng cục bộ phải là số nguyên từ 1 đến 65535",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"Định cấu hình tư duy/lý luận mở rộng cho các mô hình được hỗ trợ.",supportedProviders:"Nhà cung cấp được hỗ trợ",modeTitle:"Chế độ Thinking",modeAutoDesc:"Tự động thiết lập tư duy dựa trên tầng mô hình",modeOffDesc:"Vô hiệu hóa suy nghĩ mở rộng",modeManualDesc:"Đặt mức ghi đè liên tục hoặc sử dụng cờ CLI mỗi lần chạy",tierDefaults:"Mặc định cấp độ",tierDefaultsDesc:"Mức độ tư duy mặc định cho từng tầng mô hình khi ở chế độ tự động.",persistentOverride:"Ghi đè liên tục",persistentOverrideDesc:"Áp dụng cho tất cả các buổi. Cờ CLI vẫn được ưu tiên.",enterCustomBudget:"Nhập ngân sách tùy chỉnh",apply:"Áp dụng",providerOverrides:"Ghi đè nhà cung cấp ({{count}})",providerOverridesDesc:"Ghi đè mặc định cấp độ cho các nhà cung cấp cụ thể. Thêm khóa nhà cung cấp tùy chỉnh nếu cần.",addProviderPlaceholder:"Thêm khóa nhà cung cấp (ví dụ: qwen)",showWarnings:"Hiển thị cảnh báo",showWarningsDesc:"Hiển thị cảnh báo khi các giá trị suy nghĩ bị hạn chế hoặc điều chỉnh",cliEnvOverride:"Ghi đè CLI & Env",supportLine1Prefix:"Ngân sách suy nghĩ:",supportLine1Suffix:"(dựa trên token)",supportLine2Prefix:"Nỗ lực lý luận:",supportLine2SuffixPrefix:"(hậu tố hoặc ",supportLine2SuffixPostfix:": minimal/low/medium/high/xhigh)",supportLine3Prefix:"Hậu tố Codex cố định mức effort (ví dụ ",supportLine3Suffix:"); model không hậu tố sẽ dùng chế độ Thinking."},analytics:{title:"Phân tích",noDailyUsage:"Không có dữ liệu sử dụng cho hôm nay",noUsageData:"Không có dữ liệu sử dụng",subtitle:"Theo dõi việc sử dụng và thông tin chi tiết",month:"Tháng",allTime:"Tất cả thời gian",updated:"Đã cập nhật {{value}}"},analyticsSummary:{totalTokens:"Tổng số token",totalTokensSubtitle:"{{input}} vào / {{output}} ra",totalCost:"Tổng chi phí",totalCostSubtitle:"trung bình ${{value}}/ngày",cacheTokens:"Token bộ đệm",cacheTokensSubtitle:"${{cost}} ({{percent}}% chi phí)",inputCost:"Chi phí đầu vào",outputCost:"Chi phí đầu ra",tokensSubtitle:"{{value}} token"},apiProfiles:{title:"Hồ sơ API",sidebarTitle:"Hồ sơ API",sidebarSubtitle:"API cao cấp, runtime cục bộ, endpoint tùy chỉnh",new:"Mới",searchPlaceholder:"Tìm kiếm hồ sơ...",loadingProfiles:"Đang tải hồ sơ...",failedLoadTitle:"Không tải được hồ sơ",failedLoadDesc:"Không thể tìm nạp hồ sơ API. Vui lòng thử lại.",retry:"Thử lại",noProfilesYet:"Chưa có hồ sơ API nào",noProfilesDesc:"Tạo hồ sơ đầu tiên của bạn để kết nối với các điểm cuối API tùy chỉnh",createProfile:"Tạo hồ sơ",noProfileMatch:'Không có hồ sơ nào khớp với "{{query}}"',profileCount:"{{count}} hồ sơ",profileCount_other:"{{count}} hồ sơ",configuredCount:"{{count}} đã cấu hình",deleteProfileTitle:"Xóa hồ sơ",deleteProfileDesc:'Bạn có chắc chắn muốn xóa "{{name}}" không? Thao tác này sẽ xóa tệp cài đặt và không thể hoàn tác.',delete:"Xóa",unsavedChangesTitle:"Những thay đổi chưa được lưu",unsavedChangesDesc:'Bạn có những thay đổi chưa được lưu trong "{{current}}". Hủy và chuyển sang "{{next}}"?',discardSwitch:"Loại bỏ và chuyển đổi",noOrphansFound:"Không tìm thấy cấu hình hồ sơ mồ côi",confirmRegisterOrphans:"Đã tìm thấy {{total}} tệp cấu hình hồ sơ mồ côi, trong đó {{valid}} tệp sẵn sàng đăng ký. Đăng ký ngay?",registeredWithSkipped:" (bỏ qua {{count}})",registeredProfiles:"Đã đăng ký {{count}} hồ sơ",copyPrompt:'Sao chép "{{name}}" sang tên hồ sơ mới nào?',destinationEmpty:"Tên hồ sơ đích không được để trống",exportRedacted:"Bản xuất đã được che token. Dùng luồng include-secrets trong CLI nếu cần.",exportDownloaded:"Đã tải xuống bản xuất hồ sơ",importFailed:"Không nhập được gói hồ sơ",discoverOrphans:"Phát hiện hồ sơ mồ côi",importProfileBundle:"Nhập gói hồ sơ"},accountsPage:{title:"Tài khoản",managePrefix:"Quản lý",manageSuffix:"tài khoản và nhóm đồng bộ từ một nơi.",mobileManageSuffix:"tính liên tục cho mỗi tài khoản.",primaryActions:"Hành động chính",createAccount:"Tạo tài khoản",authClaudeInPool:"Xác thực Claude trong Pool",openClaudePoolSettings:"Mở cài đặt Claude pool",openCliProxyClaudePool:"Mở CLIProxy Claude Pool",migrationFollowup:"Theo dõi sau di chuyển",legacyContextPending:"{{count}} tài khoản vẫn cần xác nhận chế độ lần đầu.",legacyContextPending_other:"{{count}} tài khoản vẫn cần xác nhận chế độ lần đầu.",legacyContinuityPending:"{{count}} tài khoản được chia sẻ vẫn ở mức độ liên tục kế thừa tiêu chuẩn.",legacyContinuityPending_other:"{{count}} tài khoản được chia sẻ vẫn ở mức độ liên tục kế thừa tiêu chuẩn.",confirmingLegacy:"Đang xác nhận chính sách kế thừa...",confirmLegacy:"Xác nhận chính sách kế thừa ({{count}})",noLegacyFollowup:"Không có hoạt động theo dõi kế thừa nào đang chờ xử lý.",continuityGuide:"Hướng dẫn liên tục",expandWhenNeeded:"Chỉ mở rộng khi cần thiết.",sharedStandard:"Tiêu chuẩn chung",sharedStandardDesc:"Chỉ đồng bộ hóa không gian làm việc của dự án. Mặc định tốt nhất cho hầu hết các đội.",sharedDeeper:"Chia sẻ sâu hơn",sharedDeeperDesc:"Đồng bộ thêm session-env, file-history, shell-snapshots và todos. Nên dùng khi người dùng mong resume xuyên tài khoản.",sharedDeeperPrefix:"Thêm",isolated:"Tách biệt",isolatedDesc:"Không có liên kết. Tốt nhất cho sự tách biệt nghiêm ngặt.",quickCommands:"Lệnh nhanh",quickCommandsDesc:"Sao chép và chạy trong terminal.",workspaceBadge:"Không gian làm việc `ccs auth`",historySyncBadge:"Kiểm soát đồng bộ hóa lịch sử",authAccounts:"Tài khoản xác thực",tableScopePrefix:"Bảng này được cố ý đặt trong phạm vi",tableScopeMiddle:"tài khoản. Sử dụng",tableScopeSuffix:"để thay đổi chế độ/nhóm/độ sâu.",accountMatrix:"Ma trận tài khoản",sharedTotalDesc:"Tổng số tài khoản chia sẻ: {{count}}. Bao gồm thao tác Sync và xác nhận kế thừa.",loadingAccounts:"Đang tải tài khoản..."},health:{justNow:"vừa xong",secondsAgo:"{{count}} giây trước",minutesAgo:"{{count}} phút trước",hoursAgo:"{{count}} giờ trước",systemHealth:"Tình trạng hệ thống",build:"bản dựng {{version}}",lastScan:"Lần quét cuối cùng:",autoRefresh:"Tự động làm mới:",refresh:"Làm mới",checks:"Kiểm tra",version:"Phiên bản",platform:"Nền tảng",liveMonitoring:"Giám sát trực tiếp đang hoạt động",copied:"Đã sao chép vào bảng nhớ tạm",refreshing:"Đang làm mới kiểm tra trạng thái...",fix:"Sửa chữa",applyFix:"Áp dụng bản sửa lỗi",healthLabel:"trạng thái"},updates:{actionRequired:"Hành động bắt buộc",done:"Xong",all:"Tất cả",inboxTitle:"Trung tâm cập nhật",inboxSubtitle:"Tập trung vào các hành động, sau đó đánh dấu các cập nhật đã hoàn tất hoặc bị loại bỏ.",needsAction:"Cần hành động",doneCount:"Xong",searchPlaceholder:"Tìm kiếm hành động hoặc lệnh",noNotices:"Không có thông báo nào khớp với chế độ xem này.",noUpdates:"Hiện không có bản cập nhật nào.",published:"Đã xuất bản {{date}}",markDone:"Đánh dấu hoàn tất",dismiss:"Ẩn",reopen:"Mở lại",doNext:"Làm tiếp theo",impactedIntegrations:"Tích hợp bị ảnh hưởng",impactedDesc:"Các khu vực liên quan dựa trên phạm vi cập nhật và định tuyến.",whyMatters:"Tại sao nó quan trọng",whyMattersDesc:"Chỉ ngữ cảnh ngắn, không có ghi chú phát hành trên tường văn bản.",open:"Mở",progressNeedsAction:"Cần hành động",progressInReview:"Đang xem xét",progressDone:"Xong",progressDismissed:"Bị loại bỏ",statusNew:"Mới",statusStable:"Ổn định",statusPlanned:"Đã lên kế hoạch",dashboard:"Trang tổng quan",cliUsage:"Cách sử dụng CLI"},cliproxyPage:{connected:"Đã kết nối",notConnected:"Chưa kết nối",variant:"Biến thể",parentNotConnected:"Profile gốc chưa kết nối",viaProvider:"qua {{provider}}",emptyTitle:"Trình quản lý hồ sơ CCS",emptyDesc:"Quản lý xác thực OAuth, tùy chọn tài khoản và chọn mô hình cho nhà cung cấp CLIProxy. Cấu hình cách CCS định tuyến yêu cầu đến các backend AI khác nhau.",emptyControlPanelPrefix:"Để biết số liệu thống kê sử dụng trực tiếp và theo dõi thời gian thực, hãy truy cập",controlPanel:"Bảng điều khiển",quickSetup:"Thiết lập nhanh",addAccount:"Thêm tài khoản",advancedVariant:"Biến thể nâng cao",setupActionsHint:"Thêm tài khoản tại đây. Chỉ tạo biến thể khi cần runtime/profile riêng.",accountManagement:"Quản lý tài khoản cấp CCS",providers:"Nhà cung cấp",variants:"Biến thể",providerCount:"{{count}} nhà cung cấp",providerCount_other:"{{count}} nhà cung cấp",connectedCount:"{{count}} đã kết nối",variantDisplay:"{{name}} (biến thể {{provider}})"},copilotPage:{title:"Copilot",subtitle:"Cầu nối tương thích GitHub Copilot đã ngừng ưu tiên",deprecatedBadge:"Đã ngừng ưu tiên",deprecationTitle:"Cầu nối tương thích đã ngừng ưu tiên",deprecationItem1:"GitHub Copilot bắt đầu tính phí theo mức dùng từ 2026-06-01",deprecationItem2:"Thiết lập cục bộ hiện có vẫn được giữ cho tương thích",deprecationItem3:"Thiết lập mới nên dùng Codex hoặc nhà cung cấp còn hoạt động",setup:"Cài đặt",auth:"Xác thực",daemon:"Daemon",unofficialTitle:"API không chính thức - Bạn phải tự chịu rủi ro khi sử dụng",unofficialItem1:"API được thiết kế ngược - có thể bị hỏng bất cứ lúc nào",unofficialItem2:"Việc sử dụng quá mức có thể gây ra hạn chế tài khoản",unofficialItem3:"Không bảo hành, không chịu trách nhiệm từ CCS",yes:"Có",no:"Không",installed:"Đã cài đặt",missing:"Thiếu",integration:"Tích hợp",enabled:"Đã bật",disabled:"Đã tắt",github:"GitHub",connected:"Đã kết nối",notConnected:"Chưa kết nối",authenticate:"Xác thực",authenticating:"Đang xác thực...",status:"Trạng thái",running:"Đang chạy",stopped:"Đã dừng",port:"Cổng",stopping:"Đang dừng...",stop:"Dừng lại",starting:"Đang bắt đầu...",start:"Bắt đầu",installing:"Đang cài đặt...",installCopilotApi:"Cài đặt copilot-api",proxy:"Proxy",active:"Đang hoạt động",inactive:"Không hoạt động"},cursorPage:{title:"Cursor",beta:"Beta",deprecated:"Đã ngừng ưu tiên",subtitle:"Cầu nối cục bộ đã bị ngừng ưu tiên cho các thiết lập Cursor cũ",unofficialTitle:"Cầu nối cũ đã bị ngừng ưu tiên - hãy dùng Cursor qua CLIProxy",unofficialItem1:"Đường dẫn được hỗ trợ: xác thực và quản lý tài khoản Cursor qua CLIProxy",unofficialItem2:"Cầu nối cục bộ reverse-engineered này chỉ còn dành cho các thiết lập cũ",unofficialItem3:"CCS không bảo hành và không chịu trách nhiệm cho đường dẫn cũ này",supportedPathTitle:"Đường dẫn được hỗ trợ",supportedPathDesc:"Hãy dùng xác thực và quản lý tài khoản Cursor qua CLIProxy cho các thiết lập mới. Chỉ giữ cầu nối cũ bên dưới nếu bạn vẫn phụ thuộc vào luồng daemon cục bộ trước đây.",startCliproxyAuth:"Bắt đầu xác thực Cursor qua CLIProxy",openCliproxyCursor:"Mở Cursor trong CLIProxy",integration:"Tích hợp",authentication:"Xác thực",daemon:"Daemon",enabled:"Đã bật",disabled:"Đã tắt",expired:"Hết hạn",connected:"Đã kết nối",notConnected:"Chưa kết nối",running:"Đang chạy",stopped:"Đã dừng",actions:"Hành động cũ",disableIntegration:"Vô hiệu hóa tích hợp",enableIntegration:"Kích hoạt tích hợp",autoDetectAuth:"Tự dò IDE cũ",manualAuthImport:"Nhập thủ công kiểu cũ",stopDaemon:"Dừng Daemon",startDaemon:"Khởi động Daemon",port:"Cổng",configuration:"Cấu hình Cursor",lastModified:"Sửa đổi lần cuối:",neverSaved:"Chưa bao giờ lưu",saving:"Đang lưu...",save:"Lưu",modelConfig:"Cấu hình mô hình",settings:"Cài đặt",info:"Thông tin",presets:"Cài đặt sẵn",presetsDesc:"Áp dụng ánh xạ mô hình được cấu hình sẵn",modelMapping:"Ánh xạ mô hình",modelMappingDesc:"Định cấu hình mô hình nào sẽ sử dụng cho từng tầng",defaultModel:"Mô hình mặc định",defaultModelDesc:"Dùng khi không chỉ định tier cụ thể.",opusModel:"Opus (Có khả năng nhất)",opusModelDesc:"Lý luận phức tạp và phản hồi chất lượng cao nhất.",sonnetModel:"Sonnet (Cân bằng)",sonnetModelDesc:"Khối lượng công việc mã hóa chung và trò chuyện hàng ngày.",haikuModel:"Haiku (Nhanh)",haikuModelDesc:"Đường dẫn yêu cầu nhẹ, độ trễ thấp.",runtimeSettings:"Cài đặt thời gian chạy",autoStartDaemon:"Daemon tự động khởi động",autoStartDesc:"Tự động khởi động daemon Cursor khi dùng tích hợp.",ghostMode:"Chế độ ma",ghostModeDesc:"Gửi x-ghost-mode để giảm telemetry.",provider:"Nhà cung cấp",filePath:"Đường dẫn tệp",availableModels:"Mô hình khả dụng",loadingModels:"Đang tải mô hình...",noModels:"Chưa có siêu dữ liệu mô hình nào. Bắt đầu daemon và làm mới.",default:"Mặc định",rawConfiguration:"Cấu hình thô (JSON)",manualImportTitle:"Nhập xác thực Cursor thủ công",manualImportDesc:"Cung cấp access token và machine ID của Cursor nếu không tự phát hiện được.",accessToken:"Access token",accessTokenPlaceholder:"Dán access token của Cursor",machineId:"ID máy",machineIdPlaceholder:"Hex 32 ký tự (UUID không có dấu gạch nối)",cancel:"Hủy bỏ",import:"Nhập",selectModel:"Chọn mô hình",useDefaultModel:"Sử dụng mô hình mặc định",availableModelCount:"Mô hình khả dụng ({{count}})",invalidPort:"Cổng phải là số nguyên từ 1 đến 65535",defaultModelRequired:"Mô hình mặc định là bắt buộc",savedConfig:"Đã lưu cấu hình Cursor và ánh xạ mô hình",failedSaveConfig:"Không lưu được cấu hình",modelsLoadingWait:"Mô hình vẫn đang tải. Vui lòng đợi trước khi áp dụng preset.",noModelsAvailable:"Chưa có mô hình nào. Hãy khởi động daemon rồi làm mới.",appliedCodexPreset:"Đã áp dụng preset Codex GPT-5.3",appliedClaudePreset:"Đã áp dụng preset Claude 4.6",appliedGeminiPreset:"Đã áp dụng preset Gemini 3",integrationEnabled:"Đã bật tích hợp Cursor",integrationDisabled:"Đã tắt tích hợp Cursor",failedUpdateIntegration:"Không cập nhật được trạng thái tích hợp",credentialsImported:"Đã nhập thông tin xác thực Cursor",autoDetectFailed:"Tự động phát hiện không thành công",manualRequired:"Cần token và machine ID",manualImportFailed:"Nhập thủ công không thành công",failedStartDaemon:"Không thể khởi động daemon",daemonStarted:"Đã khởi động daemon",daemonStartedWithPid:"Daemon đã khởi động (PID: {{pid}})",failedStopDaemon:"Không thể dừng daemon",daemonStopped:"Đã dừng daemon",rawLoading:"Cài đặt thô vẫn đang tải. Vui lòng đợi và thử lại.",invalidJson:"JSON không hợp lệ",rawSaved:"Đã lưu cài đặt thô",rawChanged:"Cài đặt thô đã thay đổi bên ngoài. Làm mới và thử lại.",failedSaveRaw:"Không lưu được cài đặt thô",savedAll:"Đã lưu cấu hình Cursor",liveProbe:"Kiểm tra trực tiếp",runLiveProbe:"Chạy kiểm tra trực tiếp",rerunLiveProbe:"Chạy lại kiểm tra trực tiếp",probing:"Đang kiểm tra...",probeNotRun:"Chưa chạy kiểm tra",probeLocalReadinessHint:"Các kiểm tra sẵn sàng cục bộ có thể đạt, nhưng luồng chạy thực tế vẫn có thể lỗi. Hãy dùng kiểm tra trực tiếp để xác minh toàn bộ đường đi của Cursor.",probeStage:"Giai đoạn",probeHttpStatus:"Trạng thái HTTP",probeDuration:"Thời lượng",probeModel:"Mô hình",probeMessage:"Thông điệp",probeSucceeded:"Kiểm tra thành công",probeFailed:"Kiểm tra thất bại",probeSaveFirst:"Hãy lưu hoặc bỏ các thay đổi Cursor trước khi chạy kiểm tra trực tiếp",refreshStatus:"Làm mới trạng thái Cursor",refreshConfiguration:"Làm mới cấu hình Cursor"},droidPage:{loadingDiagnostics:"Đang tải chẩn đoán Droid...",failedDiagnostics:"Không tải được chẩn đoán Droid.",overview:"Tổng quan",byok:"BYOK",docs:"Tài liệu",runtimeInstall:"Thời gian chạy và cài đặt",status:"Trạng thái",detected:"Đã phát hiện",notFound:"Không tìm thấy",detectionSource:"Nguồn phát hiện",binaryPath:"Đường dẫn nhị phân",installDirectory:"Thư mục cài đặt",version:"Phiên bản",overridePath:"Ghi đè (CCS_DROID_PATH)",configFiles:"Tệp cấu hình",path:"Đường dẫn",resolved:"Đã giải quyết",size:"Kích cỡ",lastModified:"Sửa đổi lần cuối",parseWarning:"Cảnh báo phân tích cú pháp: {{value}}",readWarning:"Đọc cảnh báo: {{value}}",warnings:"Cảnh báo",byokSummary:"Tóm tắt BYOK",activeModelSelector:"Bộ chọn mô hình hoạt động",customModels:"Mô hình tùy chỉnh",ccsManaged:"do CCS quản lý",userManaged:"Do người dùng quản lý",malformedEntries:"Mục nhập không đúng định dạng",providers:"Nhà cung cấp",none:"không có",customModelsTitle:"Mô hình tùy chỉnh",modelName:"Tên/model",provider:"Nhà cung cấp",baseUrl:"URL cơ sở",noCustomModels:"Không có mô hình tùy chỉnh",docsAlignedNotes:"Ghi chú được căn chỉnh trong Tài liệu",factoryDocs:"Tài liệu Factory",providerFactCheckDocs:"Tài liệu kiểm tra thực tế của nhà cung cấp",providerValues:"Giá trị của nhà cung cấp: {{value}}",settingsHierarchy:"Phân cấp cài đặt: {{value}}",settingsTitle:"Cài đặt BYOK của Droid",fixJsonBeforeQuickSettings:"Sửa cú pháp JSON trước khi sử dụng các điều khiển cài đặt nhanh.",fixJsonBeforeReasoning:"Sửa cú pháp JSON trước khi cập nhật cài đặt lý luận BYOK.",unableUpdateReasoning:"Không thể cập nhật cài đặt lý luận mô hình BYOK đã chọn.",fixJsonBeforeBudget:"Sửa cú pháp JSON trước khi cập nhật ngân sách tư duy.",anthropicOnlyBudget:"Ngân sách tư duy chỉ có sẵn cho các mô hình BYOK của Anthropic.",invalidJson:"JSON không hợp lệ: {{value}}",saved:"Đã lưu cài đặt Droid",changedExternally:"Cài đặt Droid đã thay đổi bên ngoài. Làm mới và thử lại.",failedSave:"Không lưu được cài đặt Droid"},sharedPage:{commands:"Lệnh",skills:"Kỹ năng",agents:"Agent",plugins:"Plugin",settings:"Cài đặt",title:"Tài nguyên dùng chung",subtitle:"Lệnh, kỹ năng, agent, plugin và cấu hình được chia sẻ giữa các tài khoản",totalShared:"Tổng số mục dùng chung",visible:"Hiển thị",markdownDetail:"Chế độ xem chi tiết Markdown",registryDetail:"Chế độ xem chi tiết registry",maskedSettingsDetail:"Chế độ xem cài đặt đã ẩn nhạy cảm",filterPrefix:"Lọc:",configurationRequired:"Cần cấu hình",countsUnavailable:"Không có số liệu",retryCounts:"Số lần thử lại",filterPlaceholder:"Lọc {{tab}} theo tên, mô tả hoặc đường dẫn",showing:"Đang hiển thị {{visible}} trong số {{total}} {{tab}}",showingQuery:'cho "{{query}}"',refreshing:"(đang làm mới...)",loadingShared:"Đang tải {{tab}} dùng chung...",failedLoadShared:"Không tải được danh sách {{tab}} dùng chung",retry:"Thử lại",noSharedFound:"Không tìm thấy {{tab}} dùng chung. Chạy `ccs sync` hoặc thêm mục trong thư mục dùng chung của bạn.",noPluginsFound:"Chưa cài plugin dùng chung. Tệp registry plugin và thư mục cache sẽ bị ẩn cho đến khi có plugin thật.",noMatch:'Không có {{tab}} khớp với "{{query}}".',selectOne:"Chọn {{tab}} để xem toàn bộ nội dung.",pathLabel:"Đường dẫn",resolvedSource:"Nguồn đã giải quyết",loadingMarkdown:"Đang tải nội dung Markdown...",loadingSettings:"Đang tải nội dung cài đặt...",failedLoadContent:"Không tải được nội dung",retryContent:"Thử lại nội dung",noMarkdown:"Không có nội dung Markdown khả dụng.",settingsTitle:"settings.json",settingsDescription:"Tệp này chứa cài đặt dùng chung được liên kết qua mọi tài khoản ở chế độ shared.",settingsPath:"Đường dẫn cài đặt dùng chung",settingsActive:"Đang hoạt động",settingsInactive:"Không tìm thấy",resourcePolicies:"Chính sách tài nguyên",resourcePoliciesDescription:"Tài khoản shared kế thừa hub này. Tài khoản profile-local giữ lệnh, kỹ năng, agent, plugin và cài đặt riêng.",sharedAccounts:"{{count}} shared",profileLocalAccounts:"{{count}} profile-local",moreProfileLocalAccounts:"+{{count}} khác"},heroSection:{title:"CCS Config",subtitle:"Bảng điều khiển Claude Code Switch"},hubFooter:{logs:"Nhật ký",settings:"Cài đặt",github:"GitHub",copyright:"© {{year}} kaitranntt"},themeToggle:{srLabel:"Chuyển đổi giao diện"},ccsLogo:{alt:"Logo CCS",text:"CCS Config"},claudekitBadge:{title:"Được vận hành bởi ClaudeKit Framework",alt:"ClaudeKit",poweredBy:"Được vận hành bởi",claudekit:"ClaudeKit"},codeEditor:{revealSensitive:"Hiện giá trị nhạy cảm",maskSensitive:"Ẩn giá trị nhạy cảm",valid:"{{language}} hợp lệ",readOnly:"(Chỉ đọc)"},commandBuilder:{title:"Trình tạo lệnh",searchPlaceholder:"Gõ hoặc chọn lệnh...",copy:"Sao chép",run:"Chạy",cmdConfig:"Mở giao diện cấu hình",cmdCreateProfile:"Tạo hồ sơ mới",cmdSwitchProfile:"Chuyển sang hồ sơ",cmdDoctor:"Kiểm tra sức khỏe hệ thống",cmdListProviders:"Liệt kê nhà cung cấp CLIProxy",cmdAddProvider:"Thêm nhà cung cấp CLIProxy"},confirmDialog:{confirm:"Xác nhận",cancel:"Hủy"},connectionIndicator:{connected:"Đã kết nối",connecting:"Đang kết nối...",disconnected:"Đã ngắt kết nối",reconnecting:"Đang kết nối lại..."},docsLink:{title:"Xem tài liệu"},githubLink:{title:"Báo cáo vấn đề trên GitHub"},globalEnvIndicator:{injectedCount_one:"{{count}} biến env toàn cục sẽ được áp dụng khi chạy",injectedCount_other:"{{count}} biến env toàn cục sẽ được áp dụng khi chạy",overriddenCount:"({{count}} bị ghi đè bởi hồ sơ)",skippedLabel:"Đã bỏ qua (hồ sơ đã định nghĩa):",configureInSettings:"Cấu hình trong Cài đặt"},localhostDisclaimer:{remoteReadonlyAuthDisabledLong:"Dashboard từ xa đang ở chế độ chỉ đọc vì dashboard auth đang bị tắt cho phiên bản CCS này. Hãy bật lại trên máy CCS host; với Docker, việc đó phải được thực hiện bên trong container đang chạy.",remoteReadonlyAuthDisabledShort:"Dashboard từ xa chỉ đọc cho đến khi dashboard auth được bật lại cho phiên bản CCS này.",remoteReadonlySetupLong:"Dashboard từ xa chỉ đọc cho đến khi bạn chạy ccs config auth setup cho phiên bản CCS này. Với Docker, hãy chạy lệnh đó bên trong container.",remoteReadonlySetupShort:"Dashboard từ xa chỉ đọc cho đến khi auth được cấu hình cho phiên bản CCS này.",localLong:"Dashboard này chạy cục bộ. Toàn bộ dữ liệu nằm trên máy của bạn.",localShort:"Dashboard cục bộ - dữ liệu nằm trên thiết bị của bạn.",dismiss:"Bỏ qua thông báo"},privacyToggle:{modeOn:"Chế độ riêng tư BẬT - Nhấp để hiện dữ liệu",modeOff:"Chế độ riêng tư TẮT - Nhấp để ẩn dữ liệu"},projectSelectionDialog:{title:"Chọn dự án Google Cloud",description:"Chọn dự án để dùng cho xác thực {{provider}}.",autoSelectCountdown:"(Tự động chọn mặc định sau {{count}}s)",default:"Mặc định",allProjects:"Tất cả dự án",allProjectsDescription:"Thêm tất cả {{count}} dự án đã liệt kê",useDefault:"Dùng mặc định",selecting:"Đang chọn...",confirmSelection:"Xác nhận lựa chọn",codeCopied:"Đã sao chép mã",copyVerificationCode:"Sao chép mã xác minh"},quickCommands:{title:"Lệnh nhanh",startDefault:"Khởi chạy mặc định",startDefaultDesc:"Chạy Claude với hồ sơ mặc định",glmProfile:"Hồ sơ GLM",glmProfileDesc:"Chuyển sang mô hình GLM",healthCheck:"Kiểm tra sức khỏe",healthCheckDesc:"Chạy chẩn đoán hệ thống",delegateTask:"Giao việc",delegateTaskDesc:"Giao việc cho hồ sơ GLM"},quotaTooltip:{loadingQuota:"Đang tải quota...",failedLoadQuota:"Không tải được quota",modelQuotas:"Hạn ngạch mô hình:",rateLimits:"Giới hạn tốc độ:",plan:"Gói: {{plan}}",quotaSnapshots:"Ảnh chụp hạn ngạch:",unlimited:"Không giới hạn",remaining:"Còn {{remaining}}/{{entitlement}}",tier:"Tier",tierId:"Tier ID",state:"Trạng thái",credits:"Credits",modelQuotasLower:"Hạn ngạch mô hình:",allBucketsReport:"Tất cả bucket báo cáo {{tokenType}}",requestsRemaining:"Còn {{count}} yêu cầu",inputTokensRemaining:"Còn {{count}} token đầu vào",outputTokensRemaining:"Còn {{count}} token đầu ra",amountRemaining:"Còn {{count}}",fiveHourLimit:"Giới hạn dùng 5 giờ",weeklyLimit:"Giới hạn dùng hàng tuần",weeklyOpus:"Dùng hàng tuần (Opus)",weeklySonnet:"Dùng hàng tuần (Sonnet)",weeklyOAuthApps:"Dùng hàng tuần (OAuth apps)",weeklyCowork:"Dùng hàng tuần (Cowork)",extraUsage:"Lượt dùng thêm",premiumInteractions:"Tương tác Premium",chat:"Chat",completions:"Hoàn thành",resets:"Reset lúc {{time}}",fiveHourResets:"Reset 5h lúc {{time}}",weeklyResets:"Reset hàng tuần lúc {{time}}"},utils:{codeReview5h:"Đánh giá mã (5h)",codeReviewWeekly:"Đánh giá mã (hàng tuần)",codeReview:"Đánh giá mã",codexAdditional5h:"{{name}} (5h)",codexAdditionalWeekly:"{{name}} (hàng tuần)",codexAdditional:"{{name}}"},sponsorButton:{title:"Tài trợ dự án này trên GitHub",sponsor:"Tài trợ"},valueMetrics:{apiCostSaved:"Chi phí API tiết kiệm",tokensSaved:"Token tiết kiệm",queriesFaster:"Truy vấn nhanh hơn",errorsReduced:"Lỗi giảm",vsLastMonth:"so với tháng trước",throughCaching:"thông qua cache",averageSpeedup:"tăng tốc trung bình",withRetryLogic:"với logic thử lại",performanceMetrics:"Chỉ số hiệu suất",monthlySummary:"Tổng kết hàng tháng",totalSaved:"Tổng tiết kiệm",tokensProcessed:"Token đã xử lý",queriesHandled:"Truy vấn đã xử lý",uptime:"Thời gian hoạt động"},updatesSpotlight:{openUpdatesCenter:"Mở Trung tâm cập nhật"},deviceCodeDialog:{authorize:"Xác thực {{provider}}",enterCodeAtPage:"Nhập mã bên dưới tại trang xác thực.",expiresIn:"(Hết hạn sau {{time}})",codeExpired:"(Mã đã hết hạn)",copied:"Đã sao chép!",copyCode:"Sao chép mã",waitingForAuth:"Đang chờ xác thực...",openVerificationPage:"Mở trang xác minh",openProviderPage:"Mở {{provider}}",copyCodeAria:"Sao chép mã xác minh",codeCopiedAria:"Đã sao chép mã"},settingsDialog:{editProfile:"Chỉnh sửa hồ sơ: {{name}}",description:"Cấu hình biến môi trường và cài đặt cho hồ sơ này.",loadingSettings:"Đang tải cài đặt...",envTab:"Môi trường",rawJsonTab:"JSON thô",generalTab:"Chung",noEnvVars:"Không có biến môi trường nào được cấu hình.",noEnvVarsHint:"Thêm biến trong tệp settings.json của bạn.",loadingEditor:"Đang tải trình soạn thảo...",profileInfo:"Thông tin hồ sơ",profileInfoDesc:"Chi tiết về tệp cấu hình này.",path:"Đường dẫn",lastModified:"Sửa đổi lần cuối",cancel:"Hủy",saving:"Đang lưu...",saveChanges:"Lưu thay đổi",conflictTitle:"Tệp đã bị thay đổi bên ngoài",conflictDesc:"Tệp cài đặt này đã bị thay đổi bởi một tiến trình khác. Ghi đè thay đổi của bạn hay hủy?",overwrite:"Ghi đè",invalidJson:"JSON không hợp lệ",failedSave:"Không lưu được"},setupWizard:{title:"Thiết lập biến thể nâng cao",stepProviderDesc:"Chọn nhà cung cấp cho biến thể runtime",stepAuthDesc:"Xác thực với nhà cung cấp",stepAccountDesc:"Chọn tài khoản để sử dụng",stepVariantDesc:"Tùy chọn: tạo biến thể runtime tùy chỉnh",stepSuccessDesc:"Thiết lập hoàn tất!",authStep:{authenticateWith:"Xác thực với {{provider}} để thêm tài khoản",authenticating:"Đang xác thực...",authenticateInBrowser:"Xác thực trong trình duyệt",completeOAuth:"Hoàn tất luồng OAuth trong trình duyệt...",orUseTerminal:"Hoặc dùng terminal",runCommandHint:"Chạy lệnh này trong terminal:",back:"Quay lại",checking:"Đang kiểm tra...",refreshStatus:"Làm mới trạng thái"},accountStep:{selectAccount:"Chọn tài khoản ({{count}})",defaultAccount:"Tài khoản mặc định",or:"Hoặc",addNewAccount:"Thêm tài khoản mới",addNewAccountDesc:"Xác thực với một tài khoản khác",back:"Quay lại"},variantStep:{back:"Quay lại",skip:"Bỏ qua"},successStep:{title:"Biến thể đã được tạo!",subtitle:"Biến thể tùy chỉnh đã sẵn sàng để sử dụng",usage:"Cách dùng:",done:"Xong"}},accountSurfaceCard:{business:"Biz",free:"Miễn phí",personal:"Cá nhân",variant:"Biến thể"},accountIdentity:{business:"Doanh nghiệp",personal:"Cá nhân",free:"Miễn phí",team:"Nhóm",plus:"Plus",pro:"Pro",workspace:"Không gian {{id}}"},accountCardStats:{notUsedYet:"Chưa sử dụng"},accountQuotaPanel:{weekly:"Hàng tuần",loadingQuota:"Đang tải quota..."},userMenu:{signedInAs:"Đăng nhập sebagai {{username}}"},authMonitorLive:{live:"TRỰC TIẾP",accountMonitor:"Theo dõi tài khoản",updated:"Cập nhật lúc {{time}}",updatedNow:"Vừa cập nhật",requestsLabel:"req",stats:"Thống kê",successRate:"Tỷ lệ thành công",missingProjectId:"Thiếu Project ID",noActivity:"không hoạt động"},providerCard:{missingProjectIdAria:"Thiếu Project ID"},loginPage:{showPassword:"Hiện mật khẩu",hidePassword:"Ẩn mật khẩu"},cliproxyStatsOverview:{sessionStatistics:"Thống kê phiên",realTimeMetrics:"Chỉ số thời gian thực từ {{backend}}",offline:"Ngoại tuyến",running:"Đang chạy",noActiveSession:"Không có phiên hoạt động",noActiveSessionHint:"Bắt đầu phiên CLIProxy bằng ccs gemini, ccs codex hoặc ccs agy để xem thống kê thời gian thực.",failedLoadStats:"Không tải được thống kê",totalRequests:"Tổng yêu cầu",successCount:"{{count}} thành công",successRate:"Tỷ lệ thành công",totalTokens:"Tổng token",estimatedCost:"~${{cost}} ước tính",modelsUsed:"Mô hình đã dùng",modelUsageDistribution:"Phân bố sử dụng mô hình",requestCount:"{{count}} yêu cầu"},cliproxyTable:{name:"Tên",provider:"Nhà cung cấp",model:"Mô hình",account:"Tài khoản",status:"Trạng thái",default:"Mặc định",actions:"Hành động"},cliproxyTabs:{overview:"Tổng quan",variants:"Biến thể",aiProviders:"AI Providers",controlPanel:"Bảng điều khiển"},cliproxyHeader:{ccsLevelAccountManagement:"Quản lý tài khoản cấp CCS",cliproxyNotAvailable:"CLIProxy không khả dụng",cliproxyControlPanel:"Bảng điều khiển CLIProxy",noVariants:"Không tìm thấy biến thể CLIProxy nào.",addAccountToStart:"Thêm tài khoản để bắt đầu"},routingGuidance:{roundRobin:"Round-robin phân bổ đều lượt dùng.",fillFirst:"Fill-first giữ tài khoản dự phòng cho đến khi cần thiết.",routingStrategy:"Chiến lược định tuyến",optionalRouting:"Định tuyến tùy chọn",sessionAffinity:"Ghim phiên",sessionAffinityOn:"Bật",sessionAffinityOff:"Tắt",sessionAffinityEnabled:"bật",sessionAffinityDisabled:"tắt",enableSessionAffinity:"Bật ghim phiên",disableSessionAffinity:"Tắt ghim phiên",sessionAffinityUnavailable:"Ghim phiên không khả dụng",localOnly:"Chỉ cục bộ",localOnlySetting:"Thiết lập chỉ cục bộ",ttlBadge:"TTL {{ttl}}",sessionAffinityDescription:"Giữ một cuộc hội thoại trên cùng một tài khoản khi có thể. CLIProxy ưu tiên mã phiên hoặc luồng mà client gửi rõ ràng; nếu không có, nó sẽ dùng metadata của request hoặc lịch sử prompt mở đầu để suy ra khóa ổn định.",sessionRecognitionTitle:"Nhận diện phiên",sessionRecognitionDescription:"CCS không cam kết một thứ tự ưu tiên chung cho mọi backend. Trên thực tế, backend upstream thường ưu tiên session hoặc thread id tường minh, rồi mới fallback sang metadata và cuối cùng là hàm băm của lịch sử prompt mở đầu."},extendedContext:{extendedContext:"Ngữ cảnh mở rộng"},cliproxyConfig:{unsavedChanges:"Thay đổi chưa lưu",original:"Gốc",modified:"Đã sửa đổi",reviewChanges:"Xem lại thay đổi",loadingEditor:"Đang tải trình soạn thảo..."},providerEditor:{provider:"Nhà cung cấp",filePath:"Đường dẫn tệp",lastModified:"Sửa đổi lần cuối",defaultTarget:"Mục tiêu mặc định",quickUsage:"Sử dụng nhanh",modelMapping:"Ánh xạ mô hình",status:"Trạng thái",loadingSettings:"Đang tải cài đặt...",loadingEditor:"Đang tải trình soạn thảo...",accounts:"Tài khoản",addAccount:"Thêm tài khoản",noAccountsConnected:"Chưa kết nối tài khoản nào",addAccountToStart:"Thêm tài khoản để bắt đầu",gcpProjectIdReadonly:"GCP Project ID (chỉ đọc)",projectIdNA:"Project ID: N/A",missingProjectId:"Thiếu Project ID",missingProjectIdHint:"Điều này có thể gây lỗi. Xóa tài khoản và thêm lại để lấy Project ID.",useIncognito:"Dùng ẩn danh",aliases:"Bí danh",current:"Hiện tại",currentValue:"Giá trị hiện tại",composite:"tổng hợp",defaultLabel:"mặc định",requiredSetup:"Cài đặt cần thiết",connectorName:"Tên connector",proxyUrl:"URL proxy",proxyUrlSet:"Đã đặt URL proxy",excludedModels:"Mô hình loại trừ",headers:"Headers",secret:"Secret",prefix:"Tiền tố",modelMappings:"Ánh xạ mô hình",baseUri:"URL cơ sở",apiKeys:"Khóa API",presets:"Áp dụng ánh xạ mô hình đã cấu hình sẵn",createVariant:"Tạo biến thể CLIProxy",agyDenylist:"Danh sách loại trừ Antigravity: Claude Opus 4.5 và Claude Sonnet 4.5 đã bị loại bỏ."},providerEditorAccountItem:{modelsUsed:"Mô hình đã dùng"},bulkActionBar:{applyPreset:"Áp dụng preset"},modelConfigSection:{defaultModel:"Mô hình mặc định"},rawEditorSection:{rawConfig:"Cấu hình thô"},providerEditorHeader:{connectorName:"Tên connector"},aiProvidersFamilyRail:{current:"Hiện tại"},aiProvidersEntryCard:{apiKeys:"Khóa API"},aiProvidersEntryDialog:{connectorName:"Tên connector",baseUri:"URL cơ sở",proxyUrl:"URL proxy",secret:"Secret",prefix:"Tiền tố",excludedModels:"Mô hình loại trừ",headers:"Headers",modelMappings:"Ánh xạ mô hình",requiredSetup:"Cài đặt cần thiết",optionalRouting:"Định tuyến tùy chọn"},codex:{controlCenter:"Trung tâm điều khiển",overview:"Tổng quan",docs:"Tài liệu",nativeCodexRuntime:"Codex Runtime gốc",ccsCodexProvider:"Lối tắt cliproxy / cầu nối được quản lý",codexDocs:"Tài liệu Codex",supportedFlows:"Các luồng được hỗ trợ",twoSupportedPaths:"Hai đường dẫn được hỗ trợ:",nativeLabel:"Gốc:",nativeDesc:"Codex là target runtime hạng nhất trong CCS v1.",ccsBridge:"CCS Bridge",apiProfilesDefault:"API profiles mặc định dùng Claude hoặc Droid.",recommendedSetupFlow:"Luồng thiết lập khuyến nghị",fastestPath:"Đường dẫn nhanh nhất",officialChannels:"Kênh chính thức",codexCli:"Codex CLI",openNativeCodex:"Mở Codex gốc",runBuiltInCodex:"Chạy Codex gốc với lối tắt cliproxy",runBuiltInCodexExplicit:"Chạy rõ ràng cầu nối Codex do CCS quản lý",openCodexDashboard:"Mở dashboard Codex",status:"Trạng thái",profiles:"Hồ sơ",createNewProfile:"Tạo hồ sơ mới",createNewProvider:"Tạo nhà cung cấp mới",createNewMcpServer:"Tạo MCP server mới",defaultProvider:"Nhà cung cấp mặc định",useDefault:"Dùng mặc định",useGlobalProvider:"Dùng nhà cung cấp toàn cục",useProviderDefault:"Dùng mặc định của nhà cung cấp",quickFillWarning:"Chỉ điền nhanh. Hãy xem lại trước khi lưu.",thisFileUpstreamOwned:"Tệp này thuộc sở hữu của Codex CLI upstream.",notes:"Ghi chú",approvalPolicy:"Chính sách phê duyệt",sandboxMode:"Chế độ sandbox",reasoningEffort:"Mức nỗ lực lý luận",useGlobalEffort:"Dùng mức toàn cục",reasoningEffortCapitalized:"Mức nỗ lực lý luận",thinkingBudgetTokens:"Token ngân sách tư duy",modelContextWindow:"Cửa sổ ngữ cảnh mô hình",autoCompactTokenLimit:"Giới hạn token tự động nén",toolOutputTokenLimit:"Giới hạn token đầu ra tool",webSearch:"Tìm kiếm web",personality:"Tính cách",model:"Mô hình",rawOnly:"Chỉ thô",trusted:"đã tin cậy",untrusted:"chưa tin cậy",noProjectTrustEntries:"Không có mục tin cậy dự án nào được lưu.",codexNativeRecipe:"Đã lưu công thức Codex gốc",gptContextCap:"Giới hạn ngữ cảnh GPT-5.4",usageLimitCost:"Chi phí vượt mức 272K",longContextOverride:"Ghi đè ngữ cảnh dài",counts2x:"Tính 2x",normalUsageWindow:"Cửa sổ sử dụng bình thường",useCodexDefault:"Dùng mặc định Codex",stdio:"stdio",streamableHttp:"streamable-http",responses:"phản hồi",defaultTargetCli:"CLI mục tiêu mặc định",executionChain:"Chuỗi thực thi",targetPath:"Đường dẫn mục tiêu hiện tại",userConfig:"Cấu hình người dùng",configYaml:"config.yaml",flow:"Luồng",docsTab:"Tài liệu",features:"Tính năng",featuresDesc:"Bật/tắt các cờ tính năng Codex mà CCS có thể quản lý an toàn.",configOnlyFlags:"Cờ chỉ có trong cấu hình",configOnlyFlagsDesc:"Các khóa này đã tồn tại trong `config.toml`, nên CCS có thể hiển thị chúng mà không cần tuyên bố bao phủ toàn bộ danh mục.",existing:"đã có",nonBooleanForm:"Giá trị đang được lưu ở dạng không phải boolean. Hãy dùng TOML thô nếu bạn muốn chỉnh sửa.",discoveredFromFile:"Được phát hiện từ tệp hiện tại thay vì từ danh mục tích hợp của CCS.",featureMultiAgentLabel:"Multi-agent",featureMultiAgentDesc:"Bật các công cụ cộng tác giữa subagent.",featureUnifiedExecLabel:"Unified exec",featureUnifiedExecDesc:"Dùng công cụ exec hợp nhất dựa trên PTY.",featureShellSnapshotLabel:"Shell snapshot",featureShellSnapshotDesc:"Tái sử dụng snapshot môi trường shell.",featureApplyPatchLabel:"Apply patch",featureApplyPatchDesc:"Bật chỉnh sửa apply_patch dạng tự do.",featureJsReplLabel:"JS REPL",featureJsReplDesc:"Bật JavaScript REPL dựa trên Node.",featureRuntimeMetricsLabel:"Runtime metrics",featureRuntimeMetricsDesc:"Thu thập chỉ số runtime của Codex.",featurePreventIdleSleepLabel:"Prevent idle sleep",featurePreventIdleSleepDesc:"Giữ máy không ngủ khi đang hoạt động.",featureFastModeLabel:"Fast mode",featureFastModeDesc:"Cho phép dùng đường dẫn fast service tier.",featureAppsLabel:"Apps",featureAppsDesc:"Bật hỗ trợ ChatGPT Apps và connectors.",featureSmartApprovalsLabel:"Smart approvals",featureSmartApprovalsDesc:"Đưa các phê duyệt phù hợp qua luồng guardian.",howCodexWorks:"Codex hoạt động trong CCS như thế nào",nativeConfigLabel:"Cấu hình gốc:",nativeConfigDesc:"ccs-codex và ccsx khởi chạy Codex gốc bằng các mặc định bạn đã lưu.",transientOverridesLabel:"Ghi đè tạm thời:",transientOverridesDesc:"ccsxp vẫn chạy Codex gốc và chỉ thêm ghi đè provider cliproxy; ccs codex --target codex vẫn là cầu nối CCS được quản lý rõ ràng.",cliproxyDefaultLabel:"Mặc định CLIProxy:",cliproxyDefaultDesc:'Để lệnh codex thông thường đi qua CLIProxy, hãy đặt model_provider = "cliproxy" và dùng công thức bên dưới.',runtimeInstall:"Cài đặt runtime",detected:"Đã phát hiện",notFound:"Không tìm thấy",detectionSource:"Nguồn phát hiện",binaryPath:"Đường dẫn binary",installDirectory:"Thư mục cài đặt",versionLabel:"Phiên bản",nativeAliases:"Bí danh gốc",ccsProviderShortcut:"Lối tắt cliproxy",configOverrideSupport:"Hỗ trợ ghi đè --config",available:"Có sẵn",missing:"Thiếu",cliproxyNativeCodex:"Codex gốc dùng CLIProxy",builtInLabel:"Tích hợp:",builtInCcsxpDesc:"Dùng ccsxp để chạy Codex gốc với lối tắt provider cliproxy.",managedBridgeLabel:"Cầu nối được quản lý:",managedBridgeDesc:"Dùng ccs codex --target codex khi bạn muốn tuyến CCS được quản lý chặt hơn một cách tường minh.",nativeRecipeLabel:"Gốc:",nativeRecipeDesc:"Cấu hình công thức bên dưới để dùng CLIProxy trực tiếp với codex.",saveProviderNamedCliproxy:"Lưu một provider tên cliproxy với base URL và env key ở trên.",inTopLevelSetDefault:"Trong Top-level settings, đặt Default provider là cliproxy.",exportCliproxyApiKey:"Xuất CLIPROXY_API_KEY trong shell trước khi chạy Codex gốc.",noConfigOverrides:"Bản Codex này vẫn có thể dùng đường gốc thuần, nhưng ccsxp và cầu nối Codex do CCS quản lý rõ ràng sẽ chưa dùng được cho đến khi binary hỗ trợ ghi đè --config.",configFile:"Tệp cấu hình",path:"Đường dẫn",resolved:"Đã phân giải",size:"Kích thước",lastModified:"Sửa đổi lần cuối",tomlWarning:"Cảnh báo TOML",readWarning:"Cảnh báo đọc",currentUserLayerSummary:"Tóm tắt lớp người dùng hiện tại",activeProfile:"Hồ sơ đang dùng",notSet:"Chưa đặt",providersCount:"providers: {{count}}",profilesCount:"profiles: {{count}}",enabledFeaturesCount:"enabled features: {{count}}",mcpServersCount:"mcp servers: {{count}}",userLayerKeysPresent:"Các khóa lớp người dùng hiện có",nativeShortAlias:"Bí danh gốc ngắn",ccsCodexShortcut:"Lối tắt CCS Codex",explicitProviderRoute:"Tuyến provider tường minh",runtimeVsProvider:"Runtime so với provider",honorsSavedNativeConfig:"Tuân theo cấu hình gốc đã lưu",usesTransientOverrides:"Dùng ghi đè tạm thời",unavailableNoConfig:"Không khả dụng (bản Codex này thiếu hỗ trợ --config).",yes:"Có",no:"Không",warningsTitle:"Cảnh báo"},droidSettings:{quickControls:"Điều khiển nhanh",reasoningControls:"Điều khiển lý luận",thinkingBudget:"Ngân sách tư duy",anthropicOnly:"Chỉ mô hình Anthropic",byokCustomModels:"Mô hình tùy chỉnh BYOK"},rawJsonSettingsEditor:{title:"Trình soạn thảo cài đặt thô"},copilotConfigForm:{copilotConfiguration:"Cấu hình Copilot",deprecatedModels:"Phát hiện mô hình Copilot đã lỗi thời",failedLoadStatus:"Không tải được trạng thái",useWithClaudeCode:"Dùng đăng ký GitHub Copilot với Claude Code",githubCopilotControls:"GitHub Copilot kiểm soát giới hạn prompt/ngữ cảnh ở upstream.",provider:"Nhà cung cấp",filePath:"Đường dẫn tệp",status:"Trạng thái",enabled:"Đã bật",disabled:"Đã tắt",loadingEditor:"Đang tải trình soạn thảo...",modelMapping:"Ánh xạ mô hình",quickUsage:"Sử dụng nhanh",noPremiumUsage:"Không có số liệu sử dụng premium"},copilotPresets:{gpt5Codex:"GPT-5.3 Codex",claude46:"Claude 4.6",gemini3:"Gemini 3"},healthCard:{allSystemsNominal:"Tất cả hệ thống hoạt động bình thường",machineChecks:"Kiểm tra máy"},analyticsCards:{cacheCost:"Chi phí cache",hitRate:"Tỷ lệ trúng",inputOutputRatio:"Tỷ lệ Đầu vào/Đầu ra",noCacheData:"Không có dữ liệu cache",noModelData:"Không có dữ liệu mô hình",noSessionData:"Không có dữ liệu phiên",noTokenData:"Không có dữ liệu token",totalCost:"Tổng chi phí",totalTokens:"Tổng token",usageInsights:"Phân tích sử dụng"},dateRangeFilter:{pickADate:"Chọn ngày"},logsConfig:{level:"Mức",message:"Thông điệp",source:"Nguồn",time:"Thời gian",proc:"Tiến trình",open:"Mở",run:"Chạy",refreshEntries:"Làm mới mục"},logsDetailPanel:{details:"Chi tiết"},logsFilters:{filters:"Bộ lọc"},logsOverviewCards:{overview:"Tổng quan"},logsPageSkeleton:{loadingLogs:"Đang tải nhật ký..."},monitoringErrorLogs:{logContent:"Nội dung nhật ký"},analyticsPages:{chartsGrid:"Biểu đồ",costByModel:"Chi phí theo mô hình"},toasts:{profileCreated:"Đã tạo hồ sơ thành công",profileUpdated:"Đã cập nhật hồ sơ thành công",profileDeleted:"Đã xóa hồ sơ thành công",orphanProfilesComplete:"Hoàn tất đăng ký hồ sơ mồ côi",profileCopied:"Đã sao chép hồ sơ thành công",profileImported:"Đã nhập hồ sơ thành công",authRequired:"Yêu cầu xác thực {{provider}}",authSuccess:"Xác thực {{provider}} thành công!",authFailed:"Xác thực {{provider}} thất bại",deviceCodeExpired:"Mã thiết bị đã hết hạn. Vui lòng thử lại.",codeCopied:"Đã sao chép mã vào bảng nhớ tạm",failedCopy:"Không sao chép được mã",configSaved:"Đã lưu cấu hình thành công",configSaveFailed:"Lưu thất bại: {{error}}",invalidYaml:"Không thể lưu YAML không hợp lệ",configUpdatedExternally:"Cấu hình đã được cập nhật bên ngoài",settingsFileUpdated:"Tệp cài đặt đã được cập nhật",accountsUpdated:"Tài khoản đã được cập nhật",noProfilesToSync:"Không có hồ sơ để đồng bộ",syncFailed:"Đồng bộ thất bại: {{error}}",sessionAffinityUpdated:"Ghim phiên đã {{state}}.",providerAuthSuccess:"Xác thực {{provider}} thành công",providerDeviceCodeInCallback:"Nhà cung cấp trả về Device Code flow trong chế độ callback",providerAuthTimeout:"Đã hết thời gian xác thực. Vui lòng thử lại.",providerAccountRegistrationFailed:"Không thể đăng ký tài khoản đã xác thực",providerLostStatusEndpoint:"Mất kết nối với điểm cuối trạng thái xác thực",providerUnknown:"Nhà cung cấp không xác định: {{provider}}",providerStartOAuthFailed:"Không thể bắt đầu OAuth",providerCallbackFailed:"Gửi callback thất bại",providerSubmitCallbackFailed:"Không thể gửi callback",loggingConfigSaved:"Đã lưu cấu hình ghi nhật ký.",loggingConfigSaveFailed:"Không lưu được cấu hình ghi nhật ký.",unifiedConfigUpdated:"Đã cập nhật cấu hình thành công",migrationPreviewComplete:"Xem trước di chuyển hoàn tất",migrationComplete:"Di chuyển hoàn tất thành công",migrationFailed:"Di chuyển thất bại",rollbackComplete:"Khôi phục hoàn tất thành công",rollbackFailed:"Khôi phục thất bại",defaultAccountSet:'Tài khoản mặc định đã đặt thành "{{name}}"',defaultAccountReset:"Tài khoản mặc định đã đặt lại về CCS",accountDeleted:'Đã xóa tài khoản "{{name}}"',contextUpdated:'Đã cập nhật ngữ cảnh "{{name}}" thành {{summary}}',legacyConfirmError:'Tài khoản "{{name}}" cần xác nhận rõ ràng. Dùng Chỉnh sửa Đồng bộ lịch sử trên tài khoản này.',legacyConfirmFailed:'Tài khoản cũ "{{name}}" xác nhận thất bại: {{error}}',legacyConfirmSuccess_one:"Đã xác nhận {{count}} tài khoản cũ",legacyConfirmSuccess_other:"Đã xác nhận {{count}} tài khoản cũ",legacyConfirmPartial:"Đã xác nhận {{updated}} tài khoản cũ, nhưng {{failed}} lần cập nhật thất bại. Trạng thái tài khoản đã được làm mới.",legacyConfirmAllFailed:"Không thể xác nhận {{failed}} tài khoản cũ. Trạng thái tài khoản đã được làm mới.",noLegacyAccounts:"Không có tài khoản cũ nào cần xác nhận",routingStrategySet:"Chiến lược định tuyến đã đặt thành {{strategy}}",variantCreated:"Đã tạo biến thể thành công",variantUpdated:"Đã cập nhật biến thể thành công",variantDeleted:"Đã xóa biến thể thành công",defaultAccountUpdated:"Đã cập nhật tài khoản mặc định",accountRemoved:"Đã xóa tài khoản",accountPaused:"Đã tạm dừng tài khoản",accountResumed:"Đã tiếp tục tài khoản",accountAdded:"Đã thêm tài khoản cho {{provider}}",kiroImported:"Đã nhập tài khoản Kiro: {{name}}",kiroTokenImported:"Đã nhập token Kiro",modelUpdated:"Đã cập nhật mô hình",presetSaved:'Đã lưu preset "{{name}}"',presetDeleted:"Đã xóa preset",cliproxyAlreadyRunning:"CLIProxy đã đang chạy",cliproxyStarted:"CLIProxy đã khởi động thành công",cliproxyStartFailed:"Không khởi động được CLIProxy",cliproxyStopped:"Đã dừng CLIProxy",cliproxyStopFailed:"Không dừng được CLIProxy",presetApplied:'Đã áp dụng preset "{{name}}"',presetAppliedCustom:"Đã áp dụng preset tùy chỉnh",settingsSavedWithAdjustments:"Cài đặt đã lưu với điều chỉnh mô hình",settingsSaved:"Đã lưu cài đặt",failedSaveSettings:"Không lưu được cài đặt",codexRefreshFailed:"Không làm mới được snapshot Codex. Các chỉnh sửa thô đã được giữ.",codexRefreshError:"Không làm mới được snapshot Codex.",codexFixToml:"Sửa TOML trước khi lưu.",codexSaved:"Đã lưu Codex config.toml.",codexChangedExternally:"config.toml đã thay đổi bên ngoài. Làm mới và thử lại.",codexSaveFailed:"Không lưu được Codex config.toml.",codexUpdateFailed:"Không cập nhật được cấu hình Codex.",noOrphanProfiles:"Không tìm thấy cài đặt hồ sơ mồ côi",profilesRegistered:"Đã đăng ký {{count}} hồ sơ{{skipped}}",destinationEmpty:"Tên hồ sơ đích không được để trống",profileExportDownloaded:"Đã tải xuống xuất hồ sơ",profileImportFailed:"Không nhập được gói hồ sơ"},providerConfig:{defaultDeviceCodeInstruction:"Hoàn tất việc cấp quyền trong trình duyệt của bạn.",trackLabel:"Nhóm",sectionCoreLabel:"Core / backend gốc",sectionCoreHint:"Nhóm nhà cung cấp mặc định, luôn sẵn sàng",sectionPlusLabel:"Plus extras / cộng đồng duy trì",sectionPlusHint:"Vẫn được hỗ trợ nhưng hiện được tách khỏi backend mặc định",plusTrackNote:"Cần backend Plus tùy chọn; hiện tại nhánh này do cộng đồng duy trì."},profileEditorSections:{imageAnalysis:"Phân tích hình ảnh",loadingImageSettings:"Đang tải cài đặt hình ảnh...",skipPermissionPrompts:"Bỏ qua nhắc quyền khi khởi chạy",useNativeImageReading:"Dùng đọc hình ảnh gốc",skipTransformer:"Bỏ qua transformer",friendlyUi:"Giao diện thân thiện",info:"Thông tin"},imageAnalysisStatus:{sectionTitle:"Hình ảnh",openSettings:"Mở Cài đặt",useNativeImageReading:"Dùng đọc hình ảnh gốc",refreshingPreview:"Đang làm mới xem trước",savedStatus:"Trạng thái đã lưu",livePreview:"Xem trước trực tiếp",disabledGlobally:"Đã tắt toàn cục",targetBypassesHook:"{{target}} bỏ qua hook",nativeImageReading:"Đọc hình ảnh gốc",setupNeeded:"Cần thiết lập",needsAuth:"Cần xác thực",needsProxy:"Cần proxy",nativeFallback:"Dự phòng gốc",transformerReady:"Transformer sẵn sàng",badgeDisabled:"Đã tắt",badgeBypassed:"Đã bỏ qua",badgeNative:"Gốc",badgeSetup:"Thiết lập",badgeAuth:"Xác thực",badgeProxy:"Proxy",badgeReady:"Sẵn sàng",capabilityVerified:"Đã xác minh",capabilityUnknown:"Không xác định",toggleSummaryNativeCapable:"{{model}} có vẻ hỗ trợ hình ảnh. CCS sẽ bỏ qua transformer ở đây.",toggleSummaryNativeModel:"CCS sẽ ưu tiên đọc gốc cho {{model}}.",toggleSummaryNativeDefault:"CCS sẽ ưu tiên đọc hình ảnh gốc cho hồ sơ này.",toggleSummaryNativeFileAccess:"Hồ sơ này hiện đang dùng truy cập tệp gốc.",toggleSummaryInactiveTarget:"Định tuyến hình ảnh phía Claude đã lưu không hoạt động khi {{target}} đang được chọn.",toggleSummaryTransformerRoute:"Tuyến transformer: {{backend}}{{modelSuffix}}.",noteDisabledGlobally:"Hình ảnh đã bị tắt toàn cục trong cài đặt CCS.",noteTargetBypassesHook:"Mục tiêu hiện tại {{target}} bỏ qua Claude Read hook.",notePersistHook:"Persist hook hồ sơ trước khi tuyến transformer có thể chạy ở đây.",targetLabel:{claude:"Claude Code",droid:"Factory Droid",codex:"Codex CLI"}},openrouterBadge:{new:"MỚI",integration:"Tích hợp OpenRouter"},openrouterBanner:{accessModels:"Truy cập {{count}}+ mô hình qua OpenRouter",add:"Thêm"},openrouterModelPicker:{searchModels:"Tìm kiếm mô hình",newestModels:"Mô hình mới nhất"},openrouterPromoCard:{title:"OpenRouter",description:"Truy cập hàng trăm mô hình qua một API endpoint."},profileCard:{profile:"Hồ sơ",openRouter:"Hồ sơ OpenRouter",claudeCode:"Claude Code",claudeCodeDefault:"Claude Code (mặc định)",factoryDroid:"Factory Droid",codexCli:"Codex CLI",ccsProfile:"Hồ sơ CCS"},profileDeck:{profiles:"Hồ sơ",failedToLoad:"Không tải được hồ sơ: {{message}}",noProfiles:"Chưa có hồ sơ nào. Tạo hồ sơ đầu tiên để bắt đầu."},profilesTable:{name:"Tên",provider:"Nhà cung cấp",model:"Mô hình",target:"Mục tiêu",lastModified:"Sửa đổi lần cuối",actions:"Hành động",edit:"Chỉnh sửa"},profileCreateDialog:{createProfile:"Tạo hồ sơ",appliedModelToTiers:'Đã áp dụng "{{model}}" cho tất cả tier mô hình',profileCreated:'Đã tạo hồ sơ "{{name}}"',failedCreate:"Không tạo được hồ sơ",chooseProviderHint:"Chọn preset nhà cung cấp hoặc cấu hình API endpoint tùy chỉnh.",basicInformation:"Thông tin cơ bản",modelConfiguration:"Cấu hình mô hình",usedInCli:"Dùng trong CLI:",apiBaseUrl:"URL cơ sở API",baseUrlPlaceholder:"https://api.example.com/v1",prefilledFromPreset:"Điền sẵn từ {{name}}. Bạn có thể tùy chỉnh nếu cần.",optionalForPreset:"Tùy chọn cho {{name}}. Để trống để dùng xác thực Anthropic gốc.",endpointHint:"Endpoint chấp nhận yêu cầu tương thích OpenAI và Anthropic",optional:"(tùy chọn)",apiKeyOptionalPlaceholder:"Tùy chọn - chỉ khi bật xác thực",apiKeyPlaceholder:"sk-...",apiKeyOptionalHint:"Chỉ cần khi endpoint cục bộ bật xác thực",defaultTargetCli:"CLI mục tiêu mặc định",modelMapping:"Ánh xạ mô hình",modelMappingDesc:"Ánh xạ các tier Claude Code (Opus/Sonnet/Haiku) sang mô hình được nhà cung cấp hỗ trợ.",searchModelsPlaceholder:"Gõ để tìm (vd: opus, sonnet, gpt-4o)...",noModelsFound:'Không tìm thấy mô hình cho "{{query}}"',loadingModels:"Đang tải mô hình...",defaultModel:"Mô hình mặc định",sonnetMapping:"Ánh xạ Sonnet",opusMapping:"Ánh xạ Opus",haikuMapping:"Ánh xạ Haiku",sonnetMappingPlaceholder:"vd: gpt-4o, claude-sonnet-4",opusMappingPlaceholder:"vd: o1, claude-opus-4.5",haikuMappingPlaceholder:"vd: gpt-4o-mini, claude-3.5-haiku",free:"Miễn phí"},profileDialogLegacy:{editProfile:"Chỉnh sửa hồ sơ"},supportEntryCard:{actionRequired:"Cần hành động"},settingsPage:{title:"Cài đặt",loading:"Đang tải...",failedLoad:"Không tải được cài đặt.",tabs:{web:"Web",env:"Env",think:"Tư duy",proxy:"Proxy",auth:"Xác thực",backup:"Sao lưu",channels:"Kênh",imageAnalysis:"Hình ảnh"},websearchSection:{title:"Tìm kiếm Web",description:"Cấu hình tìm kiếm web dựa trên CLI."},thinkingSection:{title:"Tư duy",description:"Cấu hình tư duy/lý luận mở rộng cho các mô hình được hỗ trợ.",directOverride:"Ghi đè trực tiếp",youType:"Bạn gõ:",ccsAdds:"CCS thêm:",executionChain:"Chuỗi thực thi",primaryBackends:"Backend chính",legacyCliFallbacks:"Fallback CLI cũ",managedPayload:"Payload được quản lý",sharedTargetMetadata:"Metadata mục tiêu dùng chung",ideTargetMetadata:"Metadata mục tiêu IDE",ideSettingsPath:"Đường dẫn cài đặt IDE",ideHost:"Host IDE",resolvedBinding:"Binding đã giải quyết",bindingName:"Tên binding",inSync:"Đồng bộ",currentTargetPath:"Đường dẫn mục tiêu hiện tại",warnings:"Cảnh báo",notes:"Ghi chú",workspacePresets:"Preset workspace",draft:"Bản nháp",advanced:"Nâng cao",recommended:"Luồng thiết lập khuyến nghị",configureModelFirst:"Cấu hình mô hình trước"},proxySection:{title:"Proxy",loadingImageSettings:"Đang tải cài đặt hình ảnh..."},channelsSection:{title:"Kênh chính thức",description:"Xem và quản lý các kênh phát hành chính thức."},imageAnalysisSection:{title:"Phân tích hình ảnh",description:"Cấu hình cài đặt phân tích hình ảnh.",loading:"Đang tải cài đặt hình ảnh..."},browserSection:{title:"Trình duyệt",description:"Bề mặt thiết lập chính cho tự động hóa trình duyệt được CCS quản lý.",primaryTitle:"Settings > Browser là nơi thiết lập trình duyệt chính.",primaryDescription:"Cấu hình Claude Browser Attach và Codex Browser Tools tại đây, rồi dùng hướng dẫn bên dưới để khởi chạy hoặc kiểm tra từng luồng.",readiness:"Trạng thái sẵn sàng",nextStep:"Bước tiếp theo",technicalDetails:"Chi tiết kỹ thuật",diagnostics:"Chẩn đoán",evalMode:{label:"Quyền browser_eval",options:{disabled:"Tắt",readonly:"Chỉ đọc",readwrite:"Đọc/ghi"}},actions:{saveClaude:"Lưu cấu hình Claude",saveCodex:"Lưu cấu hình Codex",testConnection:"Kiểm tra kết nối",copyLaunchCommand:"Sao chép lệnh khởi chạy"},messages:{statusRefreshed:"Đã làm mới trạng thái trình duyệt",launchCommandCopied:"Đã sao chép lệnh khởi chạy"},claude:{title:"Claude Browser Attach",description:"Gắn các phiên chạy Claude-target vào một phiên Chrome có bật remote debugging.",enabledLabel:"Bật Claude Browser Attach",enabledDescription:"Khi bật, CCS sẽ chuẩn bị runtime MCP trình duyệt được quản lý cho các phiên chạy Claude-target.",userDataDir:"Thư mục dữ liệu người dùng Chrome",userDataDirHint:"Nên dùng thư mục profile Chrome riêng để trạng thái attach được tách khỏi trình duyệt hằng ngày.",devtoolsPort:"Cổng DevTools",devtoolsPortHint:"Phải khớp với cổng thực tế dùng khi khởi chạy Chrome trong attach mode.",devtoolsPortInvalid:"Nhập cổng hợp lệ trong khoảng 1 đến 65535.",effectivePath:"Đường dẫn attach đang có hiệu lực",recommendedPath:"Đường dẫn khuyến nghị",managedRuntime:"Runtime trình duyệt được quản lý",evalModeHint:"Điều khiển quyền browser_eval cho Claude Browser Attach. Chỉ đọc cho phép quan sát; đọc/ghi cũng cho phép thay đổi phía trang.",overrideMessage:"Hiện có override môi trường từ {{source}}. Khi bỏ override này, Dashboard sẽ lại là nguồn cấu hình chính.",launchGuidance:"Hướng dẫn khởi chạy",launchGuidanceHint:"Khởi chạy Chrome với remote debugging, rồi chạy lại Test connection nếu cần."},codex:{title:"Codex Browser Tools",description:"Điều khiển đường dẫn trình duyệt Playwright MCP được quản lý cho các phiên chạy Codex-target.",enabledLabel:"Bật Codex Browser Tools",enabledDescription:"Giữ bật để trang Browser là nơi cấu hình chính cho công cụ trình duyệt của Codex.",serverName:"Tên dịch vụ được quản lý",overrideSupport:"Hỗ trợ config override",overrideSupported:"Được hỗ trợ",overrideUnsupported:"Không được hỗ trợ",binary:"Binary Codex được phát hiện",notDetected:"Không phát hiện",evalModeHint:"Được lưu để giữ tương thích giao diện Browser settings. Ở Phase 1, việc áp dụng hạn chế browser_eval chủ yếu diễn ra trên Claude Browser Attach."}}},codexPage:{title:"Codex",controlCenter:"Trung tâm điều khiển",overview:"Tổng quan",docs:"Tài liệu",nativeRuntime:"Runtime gốc",ccsProvider:"CCS Provider",setup:"Thiết lập"},apiPage:{title:"Hồ sơ API",subtitle:"Quản lý hồ sơ API và các endpoint."},claudeExtensionPage:{title:"Claude Extension",subtitle:"Cài đặt tích hợp Claude Extension.",claudeAuth:"Xác thực Claude",status:"Trạng thái",targetMetadata:"Metadata mục tiêu IDE"},sharedPageV2:{title:"Dùng chung",subtitle:"Quản lý dữ liệu dùng chung."},homePageV2:{title:"Trang chủ",logsMoved:"Nhật ký đã chuyển sang workspace riêng",profiles:"Hồ sơ",cliproxy:"CLIProxy",accounts:"Tài khoản",health:"Sức khỏe"},analyticsPageV2:{title:"Phân tích",subtitle:"Phân tích sử dụng và thông tin chi tiết."},logsPageV2:{title:"Nhật ký",subtitle:"Xem và quản lý nhật ký hệ thống."},healthPageV2:{title:"Sức khỏe",subtitle:"Giám sát sức khỏe hệ thống."},aiProvidersPage:{title:"AI Providers",subtitle:"Quản lý cấu hình AI providers.",unableToLoad:"Không thể tải AI Providers"}}},ja:{translation:{locale:{en:"英語","zh-CN":"簡体字中国語",vi:"ベトナム語",ja:"日本語"},layout:{languageSwitcher:"言語"},nav:{general:"全般",home:"ホーム",analytics:"分析",identityAccess:"認証とアクセス",apiProfiles:"API プロファイル",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"概要",controlPanel:"コントロールパネル",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",claudeExtension:"Claude Extension",accounts:"アカウント",allAccounts:"すべてのアカウント",sharedData:"共有データ",compatibleClis:"互換",deprecated:"非推奨",factoryDroid:"Factory Droid",system:"システム",health:"ヘルス",logs:"ログ",settings:"設定",openrouterTooltip:"注目: OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"プロファイル",cliproxy:"CLIProxy",accounts:"アカウント",health:"ヘルス",configurationRequired:"設定が必要"},auth:{dashboardTitle:"CCS Dashboard",protectedAccessLabel:"保護されたアクセス",remoteGuardLabel:"リモートアクセス保護",loading:"ダッシュボードのアクセス状態を確認しています…",loginDescription:"ホストで設定されたユーザー名とパスワードを使ってダッシュボードにアクセスしてください。",username:"ユーザー名",password:"パスワード",usernamePlaceholder:"ユーザー名を入力",passwordPlaceholder:"パスワードを入力",signIn:"サインイン",signingIn:"サインイン中...",loginFailed:"ログインに失敗しました",lightMode:"ライト",darkMode:"ダーク",noDefaultCredentials:"CCS にデフォルトの認証情報はありません。",credentialsHint:"認証情報は CCS ホスト上で `ccs config auth setup` を実行して作成します。Docker では、そのコマンドをコンテナ内で実行する必要があります。",remoteSetupTitle:"リモートアクセスには認証設定が必要です",remoteSetupDescription:"このダッシュボードはローカル以外のアドレスから開かれていますが、この CCS インスタンスではダッシュボード認証がまだ有効になっていません。",incompleteSetupDescription:"ダッシュボード認証は有効ですが、設定が未完了です。この CCS インスタンスの設定を完了してからサインインしてください。",safetyNoteRemote:"CCS ホスト管理者がダッシュボード認証を有効にするまで、リモート管理はロックされたままです。",safetyNoteLocal:"同じマシン上にいる場合は、localhost の URL を使うのが最も簡単です。",safetyNoteSession:"サインインに成功すると、このダッシュボードホストに限定された HTTP-only セッションが作成されます。",hostStepTitle:"CCS ホスト側で行うこと",hostStepDescription:"ダッシュボード認証情報を作成または再有効化してから、このページをリモート端末で開き直してください。",dockerStepDescription:"Docker の場合は、実行中のコンテナ内で次を実行してください:",localStepTitle:"もしこのマシンを使っているなら",localStepDescription:"`ccs config` が表示する localhost の URL を使い、LAN や Tailscale のアドレスは避けてください。",showPassword:"パスワードを表示",hidePassword:"パスワードを隠す"},commonToast:{apiKeyRequired:"API キーは必須です",accountAddedPresetFailed:"アカウントは追加されましたが、デフォルトプリセットの適用に失敗しました",settingsCopied:"設定をクリップボードにコピーしました",enterPresetName:"保存するプリセット名を入力してください",codeCopied:"コードをクリップボードにコピーしました",copyCodeFailed:"コードのコピーに失敗しました",appliedModelAllTiers:"すべてのティアにモデルを適用しました",settingsSaved:"設定を保存しました",defaultTargetUpdated:"デフォルトターゲットを更新しました",failedUpdateDefaultTarget:"デフォルトターゲットを {{target}}{{suffix}} に更新できませんでした"},profileDialog:{editTitle:"プロファイルを編集",createTitle:"API プロファイルを作成",name:"名前",namePlaceholder:"my-api",baseUrl:"ベース URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API キー",defaultModel:"デフォルトモデル (ANTHROPIC_MODEL)",defaultModelHint:"空欄の場合は {{model}} を使用",modelMappingTitle:"モデルマッピング (Opus/Sonnet/Haiku)",modelMappingDesc:"各ティアに異なるモデル ID を設定します。異なるモデル種別を別バックエンドへ振り分ける API プロキシで便利です。",opusModel:"Opus モデル (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet モデル (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku モデル (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"キャンセル",saving:"保存中...",update:"更新",create:"作成"},modelTierMapping:{title:"モデルティアマッピング",advanced:"詳細",description:"Claude Code の opus/sonnet/haiku ティアごとに別のモデルを設定します。",autoSuggest:"{{provider}} に基づいて自動提案",opusPlaceholder:"例: anthropic/claude-opus-4",sonnetPlaceholder:"例: anthropic/claude-sonnet-4",haikuPlaceholder:"例: anthropic/claude-3.5-haiku",footer:"これにより ANTHROPIC_DEFAULT_OPUS_MODEL、ANTHROPIC_DEFAULT_SONNET_MODEL、ANTHROPIC_DEFAULT_HAIKU_MODEL を設定します。"},envEditor:{sensitive:"機密",none:"環境変数は設定されていません。",noneHint:"下の入力から追加するか、JSON を直接編集してください。",addVariable:"環境変数を追加",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"値"},setupVariant:{using:"使用中:",variantNameRequired:"ランタイムバリアント名 *",variantNamePlaceholder:"例: my-gemini, g3, flash",invokeHintPrefix:"このバリアントで実行:",model:"モデル",modelPlaceholder:"例: gemini-2.5-pro, claude-opus-4-6-thinking",choosePresetInstead:"代わりにプリセットから選択",selectModel:"モデルを選択",customModelName:"カスタムモデル名...",enterAnyModel:"CLIProxy がサポートする任意のモデル名を入力",defaultModel:"デフォルト: {{model}}",providerDefault:"プロバイダーのデフォルト",back:"戻る",skip:"スキップ",creating:"作成中...",createVariant:"バリアントを作成",skipHint:"アカウント設定だけで十分で、別ランタイムバリアントが不要な場合はスキップできます"},customPresetDialog:{title:"カスタムプリセット",presetNameOptional:"プリセット名 (任意)",presetNamePlaceholder:"例: My Custom Config",codexTipPrefix:"Codex のヒント: サフィックス",codexTipSuffix:"で推論強度を固定できます。サフィックスなしのモデルは思考設定を使います。",defaultModel:"デフォルトモデル",defaultModelDesc:"特定のティア指定がない場合に使用",opusModel:"Opus (最上位)",opusModelDesc:"複雑な推論タスク向け",sonnetModel:"Sonnet (バランス)",sonnetModelDesc:"速度と性能のバランス",haikuModel:"Haiku (高速)",haikuModelDesc:"単純なタスクにすばやく応答",cancel:"キャンセル",savePreset:"プリセットを保存",applyPreset:"プリセットを適用",deletePreset:"プリセットを削除"},componentModelSelector:{selectModel:"モデルを選択",availableModelsCount:"利用可能なモデル ({{count}})",preview:"プレビュー"},searchableSelect:{searchModels:"モデルを検索...",noResults:"一致する結果がありません。"},copilotSettings:{enableCopilot:"Copilot を有効化",enableCopilotDesc:"GitHub Copilot サブスクリプションを利用できるようにします",basicSettings:"基本設定",accountType:"アカウント種別",accountTypeIndividual:"個人",accountTypeBusiness:"ビジネス",accountTypeEnterprise:"エンタープライズ",rateLimiting:"レート制限",rateLimitSeconds:"レート制限 (秒)",noLimit:"制限なし",waitOnRateLimit:"レート制限時に待機",waitOnRateLimitDesc:"制限到達時にエラーではなく待機します",daemonSettings:"デーモン設定",autoStartDaemon:"デーモンを自動起動",autoStartDaemonDesc:"プロファイル使用時に copilot-api を起動します"},providerModelSelector:{selectModel:"モデルを選択",noModelsForProvider:"このプロバイダーで利用可能なモデルはありません",broken:"問題あり",deprecated:"非推奨",paid:"有料",freeTier:"無料ティア",paidTier:"有料ティア",modelKnownIssues:"このモデルには既知の問題があります",viewIssueDetails:"問題の詳細を見る",modelDeprecated:"このモデルは非推奨です",recommended:"推奨",allModelsCount:"すべてのモデル ({{count}})",noModelsAvailable:"利用可能なモデルはありません",shadowed:"シャドウ済み",prefixOnly:"プレフィックスのみ",current:"現在",currentValue:"現在の値",preferredPinnedModel:"優先ピンモデル:",pinnedRouteStatus:"ピンルートの状態:",pinnedModelNotAdvertised:"ピンモデルは現在プロキシから通知されていません: {{model}}"},createAuthProfileDialog:{title:"新しいアカウントを作成",description:"認証プロファイルには Claude CLI へのログインが必要です。以下のコマンドをターミナルで実行してください。同期モード、グループ、継続性の深さは後でアカウント一覧から編集できます。",profileName:"プロファイル名",profileNamePlaceholder:"例: work, personal, client",invalidProfileName:"名前は英字で始め、英数字、ハイフン、アンダースコアのみ使用できます。",enableSharedHistory:"他の ccs 認証アカウントとの共有履歴同期を有効にする",historySyncGroupOptional:"履歴同期グループ (任意)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"空欄の場合はデフォルトの共有グループを使用します。スペースはハイフンに正規化されます。",deeperContinuity:"詳細: より深い継続性モード",deeperContinuityHint:"session-env、file-history、shell-snapshots、todos の同期も追加します。認証情報は分離されたままです。",invalidContextGroup:"グループは英字で始め、英数字、ハイフン、アンダースコアのみ使用できます (最大 {{max}} 文字)。",command:"コマンド",commandFallback:"ccs auth create <name>",afterRunPrefix:"コマンド実行後:",afterRunStep1:"ブラウザで Claude のログインを完了します",afterRunStep2:"ここに戻って更新し、新しいアカウントを確認します",poolingHint:"Claude OAuth のプールルーティングを使う場合は、アカウントページのアクションボタンから CLIProxy Claude Pool を利用してください。",close:"閉じる",copied:"コピーしました!",copyCommand:"コマンドをコピー"},accountRouteGuide:{title:"推奨される 2 アカウント構成",description:"トークンを分離するため、別々の account profile を使います。両方のアカウントで同じローカル継続性を見たい場合だけ履歴同期を有効にします。",status:{empty:"アカウントを作成",isolated:"分離準備済み",shared:"プロジェクト文脈を共有",deeper:"拡張同期準備済み",mixed:"混在設定"},cards:{isolated:{title:"トークンは分離されたまま",desc:"各 ccs auth アカウントは専用の Claude 設定、ログイン、認証情報を持ちます。同期設定でトークンはコピーされません。"},select:{title:"使うアカウントを選ぶ",desc:"ccs work または ccs personal を実行して明示的に選びます。通常の ccs を特定アカウントに合わせたい場合だけ既定を設定します。"},settings:{title:"設定はルートに追従",desc:"非 bare アカウントは CCS shared state 経由で settings.json を ~/.claude/settings.json にリンクします。ccs auth show で確認できます。"},sync:{title:"履歴同期は任意",desc:"両方のアカウントで共有モードと同じグループが必要です。拡張同期では追加のローカル継続性ファイルも共有します。"}},commands:{isolated:"分離アカウントの使用",sync:"任意の共有履歴",syncDesc:'ローカル履歴を共有したい場合は、両方のアカウントで "{{group}}" など同じグループを使ってください。'}},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"その他"},cliproxyOverviewComponents:{availableModels:"利用可能なモデル",noModelsAvailable:"利用可能なモデルはありません",startSessionHint:"利用可能なモデルを取得するには CLIProxy セッションを開始してください",totalCount:"合計 {{count}}",availableThroughGroupedByProvider:"{{backendLabel}} 経由で利用可能なモデルをプロバイダー別に表示",moreCount:"+{{count}} 件"},categorizedModelSelector:{selectModel:"モデルを選択",noModelsAvailable:"利用可能なモデルはありません",modelPlaceholder:"モデル..."},openrouterQuickStart:{recommended:"推奨",title:"OpenRouter から始める",description:"OpenAI、Anthropic、Google、Meta などの {{modelCountLabel}} モデルを、1 つの API で利用できます。",featureOneApi:"1 つの API で全プロバイダー",profileSummaryCount:"{{count}} 件のプロファイル",profileSummaryCount_other:"{{count}} 件のプロファイル",profileSummaryEmpty:"高品質 + ローカル制御",summaryBadgeDefaultQuality:"既定で最高品質",summaryBadgeLocalLane:"タスクに合うときだけ local を使う",summaryExistingTitle:"プロファイルを選ぶか、新しいレーンを追加",summaryEmptyTitle:"最初のプロファイルレーンを選択",summaryExistingDescription:"このワークスペースには既に {{count}} 件のプロファイルがあります。重要なコーディング作業には高品質プロバイダーを使い、プライバシー・コスト・オフライン要件があるときだけローカルランタイムを追加してください。",summaryExistingDescription_other:"このワークスペースには既に {{count}} 件のプロファイルがあります。重要なコーディング作業には高品質プロバイダーを使い、プライバシー・コスト・オフライン要件があるときだけローカルランタイムを追加してください。",summaryEmptyDescription:"作業に合うレーンを選んでください。Premium プロバイダーは信頼性の高いコーディング向けの既定値で、ローカルランタイムはプライバシー、低コスト変換、実験向けです。",qualityLanesTitle:"高品質レーン",qualityLaneHighlightDefaultQuality:"重要なコーディング作業向けの既定ベストレーン",alibabaLaneDescription:"OpenRouter カタログの外で、専用の premium コーディングレーンが欲しいときに強い直接接続プロファイルです。",alibabaLaneHighlightQuality:"専用エンドポイントで premium 品質が必要なときに最適",localRuntimesTitle:"ローカルランタイム",localOllamaTitle:"Ollama + Gemma 4",localOllamaLabel:"Ollama",localOllamaHighlight:"プライベートなプロンプト、ローカル整理、低コストの一括変換に最適",localLlamacppTitle:"llama.cpp",localLlamacppLabel:"llama.cpp",localLlamacppHighlight:"カスタム GGUF 構成や高度なセルフホスト型ローカルワークフローに最適",localDetectedModels:"{{count}} 件のローカルモデルを検出",localDetectedModels_other:"{{count}} 件のローカルモデルを検出",localNoModelsDetected:"ローカルモデルはまだ検出されていません",localWaitingServer:"ローカルサーバーとモデル一覧を待機中",localRuntimeCheckingBadge:"確認中",localRuntimeReadyBadge:"準備完了",localRuntimeNeedsModelBadge:"モデルが必要",localRuntimeOfflineBadge:"オフライン",localRuntimeCheckingDescription:"セットアップ案内を表示する前に、ローカルランタイムの状態を確認しています。",localRuntimeReadyDescription:"プライベートなプロンプト、オフライン作業、より安価な一括変換に適しています。",localRuntimeNeedsModelDescription:"ランタイムは起動していますが、推奨ローカルモデルの取得または読み込みがまだ必要です。",localRuntimeOfflineDescription:"このレーンは、プライバシー重視の作業、安価なローカル変換、オフラインセッションに向いています。",localRuntimeCheckingFooter:"ローカルランタイムを確認しています...",localRuntimeReadyFooter:"{{endpoint}} でエンドポイント準備完了",localRuntimeMissingModelFooter:"ローカルセットアップを完了するには `{{command}}` を実行してください。",localRuntimeOfflineFooter:"ローカルエンドポイントを起動するには `{{command}}` を実行してください。",localRuntimeSetupAction:"{{label}} をセットアップ",localRuntimeUseAction:"{{label}} を使う",localRuntimeFinishAction:"{{label}} のセットアップを完了",runtimeProviderBadge:"ランタイムプロバイダー設定",runtimeProviderTitle:"AI Providers を開く",runtimeProviderManagedDescription:"CLIProxy 管理のコネクタ、プロバイダーシークレット、高度なルーティング制御が必要なときに使います。",runtimeProviderFeatureConnectors:"Gemini、Codex、Claude、Vertex、OpenAI 互換コネクタ",runtimeProviderFeatureSecrets:"共有シークレットを個別の API プロファイルから切り離して管理",runtimeProviderFooter:"複数のプロファイルで 1 つのプロバイダー設定を共有したい場合に最適です。",createOpenRouterProfile:"OpenRouter プロファイルを作成",getApiKeyAt:"API キー取得:",createCustomProfile:"カスタム API プロファイルを作成"},alibabaCodingPlanQuickStart:{recommended:"推奨",title:"Alibaba Coding Plan を試す",description:"コーディング用途向けに、Anthropic 互換エンドポイント経由で Alibaba Cloud Coding Plan を利用します。",featureEndpoint:"Anthropic 互換エンドポイント",featureKeyFormat:"専用の sk-sp API キー",createAlibabaProfile:"Alibaba Coding Plan プロファイルを作成",readGuideAt:"セットアップガイド:"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Anthropic エンドポイント経由の Model Studio Coding Plan",add:"追加"},credentialHealth:{title:"認証情報の状態",ready:"準備完了",noCredentialsConfigured:"認証情報が未設定です。上のログインボタンから認証してください。",neverUsed:"未使用",justNow:"たった今",unknown:"不明",daysAgo:"{{count}}日前",hoursAgo:"{{count}}時間前",minutesAgo:"{{count}}分前"},proxyStatusWidget:{justNow:"たった今",minutesAgo:"{{count}}分前",hoursAgo:"{{count}}時間前",syncReady:"同期準備完了",noConfig:"設定なし",remoteProxy:"リモートプロキシ",active:"稼働中",trafficAutoRouted:"トラフィックは自動でリモートサーバーにルーティングされます",tooltipSync:"CLIProxy にプロファイルを同期",tooltipRestart:"再起動",tooltipStop:"停止",tooltipClose:"閉じる",tooltipVersionSettings:"バージョン設定",versionManagement:"バージョン管理",selectVersionPlaceholder:"インストールするバージョンを選択...",stable:"(安定版)",install:"インストール",versionsAboveUnstable:"{{version}} より新しいバージョンには既知の問題があります",versionsKnownIssues:"バージョン {{version}} には既知の問題があります",lastChecked:"最終確認: {{time}}",notRunning:"停止中",start:"起動",port:"ポート {{port}}",sessionCount:"{{count}} セッション",sessionCount_other:"{{count}} セッション",installFaultyTitle:"既知の問題があるバージョンをインストールしますか?",installFaultyDesc:"既知の不具合範囲 <strong>{{range}}</strong> に含まれる <strong>v{{version}}</strong> をインストールしようとしています。",installFaultyWarning:"このバージョンには既知のバグがあり、失敗したりプロキシが不安定になる可能性があります。",installUnstableTitle:"不安定なバージョンをインストールしますか?",installUnstableDesc:"最大安定版 <strong>v{{maxStable}}</strong> を上回る <strong>v{{version}}</strong> をインストールしようとしています。",installUnstableWarning:"このバージョンには安定性の問題があり、予期しない動作を引き起こす可能性があります。",installUnstableConfirm:"このまま続行しますか?",cancel:"キャンセル",installAnyway:"このままインストール",clickToDowngrade:"クリックしてダウングレード",clickToUpdate:"クリックして更新"},syncStatusCard:{profileSync:"プロファイル同期",ready:"準備完了",noConfig:"設定なし",syncsProfilesDesc:"API プロファイルをローカルの CLIProxy 設定に同期します",runDoctorHint:"設定を生成するには <code>ccs doctor --fix</code> を実行してください。",details:"詳細",syncNow:"今すぐ同期"},syncDialog:{title:"プロファイルをローカル CLIProxy に同期",description:"CCS の API プロファイルをローカルの CLIProxy config.yaml に同期します。",noProfiles:"同期するプロファイルがありません。",createProfilesFirst:"先にプロファイルタブで API プロファイルを作成してください。",modelLabel:"モデル:",ready:"準備完了",profilesToSync_one:"{{count}} 件のプロファイルを同期",profilesToSync_other:"{{count}} 件のプロファイルを同期",cancel:"キャンセル",syncing:"同期中...",synced:"同期完了",syncNow:"今すぐ同期"},errorLogs:{title:"エラーログ",failedRequests_one:"{{count}} 件の失敗したリクエスト",failedRequests_other:"{{count}} 件の失敗したリクエスト",cliproxyDiagnostics:"CLIProxy 診断",showingCount:"{{total}} 件中 50 件のログを表示",selectLog:"詳細を表示するログを選択してください",failedLoadContent:"ログ内容の読み込みに失敗しました",copyAbsolutePath:"絶対パスをコピー",copyRawContent:"生のログ内容をコピー",tabOverview:"概要",tabHeaders:"ヘッダー",tabRequest:"リクエスト",tabResponse:"レスポンス",tabRaw:"生データ",modelLabel:"モデル:",quotaResetsIn:"クォータのリセットまで ",method:"メソッド",provider:"プロバイダー",version:"バージョン",endpoint:"エンドポイント",url:"URL",timestamp:"タイムスタンプ",na:"該当なし",noHeaders:"利用可能なヘッダーはありません",noRequestBody:"リクエストボディなし",noResponseBody:"レスポンスボディなし",rateLimitedMsg:"レート制限です。別のアカウントに切り替えるか、クォータのリセットを待ってください。モデル {{model}} のクォータは上限に達しています。",rateLimitedMsgNoModel:"レート制限です。別のアカウントに切り替えるか、クォータのリセットを待ってください。",authFailedMsg:"認証に失敗しました。CLIProxy 設定で再認証するか、API キーを確認してください。",notFoundMsg:"エンドポイントが見つかりません。このプロバイダーには存在しない可能性があります。",serverErrorMsg:"上流サーバーでエラーが発生しました。後でもう一度試すか、プロバイダーのステータスページを確認してください。",timeoutMsg:"リクエストがタイムアウトしました。ネットワーク接続を確認するか、タイムアウト設定を延長してください。",unknown:"不明"},editAccountContext:{title:"履歴同期の設定",description:'"{{name}}" が他の CCS auth アカウントと履歴や継続性を共有する方法を設定します。',syncMode:"同期モード",selectContextMode:"コンテキストモードを選択",isolatedOption:"分離(同期なし)",sharedOption:"共有(同期あり)",sharedModeHint:"共有モードでは、同じ履歴同期グループ内のアカウントでワークスペースコンテキストを再利用します。",isolatedModeHint:"分離モードでは、このアカウントを他の CCS auth アカウントから完全に切り離します。",historySyncGroup:"履歴同期グループ",groupPlaceholder:"default",groupHint:"小文字に正規化されます(スペースはダッシュに変換)。使用可能: 英字、数字、_、-(最大 {{max}} 文字)。",invalidGroup:"英字で始まる有効なグループ名を入力してください。",continuityDepth:"継続性レベル",selectContinuityDepth:"継続性レベルを選択",standardOption:"標準(プロジェクトのみ)",deeperOption:"拡張継続性(上級者向け)",deeperHint:"上級モードでは、session-env、file-history、shell-snapshots、todos も同期します。",standardHint:"標準モードでは、プロジェクトのワークスペースコンテキストのみ同期します。",credentialsIsolated:"どのモードでも、認証情報と .anthropic はアカウントごとに分離されます。",implicationTitle:"保存後の挙動",isolatedImplication:"このアカウントは分離されたままです。他のアカウントからこの継続状態を再開できません。",sameGroupRule:"アカウント同士で継続性を共有するには、両方が同じグループ「{{group}}」を使う必要があります。",noSameGroupPeer:"現在このグループを使っている他のアカウントはありません。",sameGroupPeerCount_one:"このグループを使う他のアカウントが {{count}} 件あります。",sameGroupPeerCount_other:"このグループを使う他のアカウントが {{count}} 件あります。",deeperReady_one:"同じグループの {{count}} 件のアカウントがすでに拡張継続性を使っています。これは現状で最も強い引き継ぎ設定です。",deeperReady_other:"同じグループの {{count}} 件のアカウントがすでに拡張継続性を使っています。これは現状で最も強い引き継ぎ設定です。",deeperNeedsPeers:"このアカウントでは拡張継続性が有効ですが、同じグループの他アカウントでも拡張継続性を有効にしないと、アカウント間再開の期待には十分ではありません。",standardWarning:"標準共有はプロジェクト文脈向けです。アカウント間再開を期待するなら、両方のアカウントで拡張継続性を有効にしてください。",resumeOriginalWarning:"古い会話が重要なら、設定を変える前に元のアカウントで再開してください。",cancel:"キャンセル",save:"保存",saving:"保存中..."},historySyncLearningMap:{title:"履歴同期の仕組み",description:"分離 -> 共有 -> 拡張共有。変更は各行の「同期」から行います。",learningMap:"概要図",isolated:"分離",shared:"共有",deeper:"拡張共有",cliproxyManaged_one:"{{count}} 件の CLIProxy Claude Pool アカウントは、CLIProxy ページで管理します。",cliproxyManaged_other:"{{count}} 件の CLIProxy Claude Pool アカウントは、CLIProxy ページで管理します。",showDetails:"詳細を表示: グループ、切り替え、レガシーポリシー",modeSwitch:"モード切り替え",modeSwitchDesc:"「同期」ダイアログでは、分離/共有の切り替えと、より深い継続性の選択ができます。",historySyncGroup:"履歴同期グループ",historySyncGroupDesc:"同じグループのアカウントは、同じプロジェクトのコンテキストレーンを共有します。未設定時は default を使います。",sameGroupRule:"現在、継続性を共有できるのは、両方のアカウントが共有モードかつ同じグループを使っている場合だけです。",deeperRecommendation:"グループ「{{group}}」は共有されていますが、アカウント間再開を期待するなら拡張継続性も有効にする方が安全です。",partialGroup:"グループ「{{group}}」は良い状態ですが、他のアカウントやグループでは同グループ設定や拡張継続性がまだ不足しています。",readyGroup:"グループ「{{group}}」では複数アカウントで拡張継続性が有効です。これは現状で最も強い引き継ぎ設定です。",legacyConfirmation_one:"{{count}} 件のレガシーアカウントで明示的な確認がまだ必要です。",legacyConfirmation_other:"{{count}} 件のレガシーアカウントで明示的な確認がまだ必要です。"},continuityReadiness:{title:"アカウント間再開チェック",description:"アカウントを切り替える前に、何が不足しているかをこのカードで確認できます。",state:{single:"単一アカウント",isolated:"再開オフ","shared-alone":"共有だが未完成","shared-standard":"プロジェクトのみ",partial:"一部のみ準備完了",ready:"強い引き継ぎ準備完了"},metrics:{isolated:"分離",sharedPeers:"同グループあり",deeperReady:"拡張準備完了"},messages:{single:{title:"現在は auth アカウントが 1 つだけです。",description:"アカウント間の引き継ぎはまだ関係ありません。共有継続性を設定する前に、もう 1 つ auth アカウントを追加してください。"},isolated:{title:"現在、アカウント間再開はオフです。",description:"表示中のアカウントはすべて分離モードのため、あるアカウントで作成したセッションはそのアカウントに残ります。"},"shared-alone":{title:"共有モードはありますが、どのグループにも相手がいません。",description_one:"{{count}} 件の共有アカウントが、同じグループに入る別アカウントを待っています。",description_other:"{{count}} 件の共有アカウントが、同じグループに入る別アカウントを待っています。"},"shared-standard":{title:"グループ「{{group}}」はプロジェクト文脈を共有していますが、拡張継続性のペアがまだありません。",description:"ユーザーはプロジェクト共有以上を期待する可能性があります。より強い引き継ぎのため、このグループ内の両アカウントで拡張継続性を有効にしてください。"},partial:{title:"1 つのグループは準備できていますが、全体の設定はまだ混在しています。",description:"少なくとも 1 つのグループでは拡張継続性が使われていますが、他のアカウントはまだ分離状態、共有グループ内で単独、または拡張継続性が未設定です。"},ready:{title:"グループ「{{group}}」は現状で最も強い継続性設定になっています。",description:"このグループでは複数アカウントがすでに拡張継続性を使っています。実際に再開できるかどうかは、Claude が上流で何を保存しているかにも依存します。"}},stepsTitle:"次にユーザーがやるべきこと",steps:{syncBoth:"切り替え先のアカウントだけでなく、両方のアカウントで「同期」を開いてください。",sameGroup:"両方のアカウントで同じ履歴同期グループを使ってください。現在の推奨グループは「{{group}}」です。",enableDeeper:"プロジェクト共有だけでなくアカウント間再開を期待するなら、両方のアカウントで拡張継続性を有効にしてください。",resumeOriginal:"元の会話が重要なら、継続性設定を変える前に元のアカウントで再開してください。"},singleSteps:{addAccount:"アカウント間引き継ぎを考える前に、まず 2 つ目の ccs auth アカウントを作成してください。",sameGroupLater:"2 つ目のアカウントができたら、両方を同じ履歴同期グループに入れてください。",enableDeeperLater:"将来アカウント間再開を期待するなら、両方のアカウントで拡張継続性を有効にしてください。",resumeOriginal:"2 つ目のアカウントが整うまでは、重要な会話は元のアカウントから再開し続けてください。"}},continuityOverview:{plainLaneTitle:"通常の ccs は別の再開レーンを使っています",plainLaneDescription:"通常の ccs は現在 {{lane}} から再開しており、このアカウントのレーンではありません。同期設定を変える前に元のレーンを先に復旧してください。",setDefaultHint:"今後の通常の ccs を特定のアカウントに合わせたい場合は、その行の「既定に設定」を使ってください。",recommendBadge:"推奨 {{group}}",partialBadge:"部分同期 {{group}}",lane:{native:"ネイティブ Claude(~/.claude)",accountDefault:"アカウント {{name}}",accountInherited:"継続性継承によるアカウント {{name}}",profileDefault:"既定プロファイル {{name}}(ネイティブ Claude レーン)"}},accountsTable:{name:"名前",type:"種別",defaultBadge:"既定",created:"作成日",lastUsed:"最終使用",historySync:"履歴同期",actions:"操作",syncTitle:"同期モード、グループ、継続性レベルを編集",confirmLegacyTitle:"このレガシーアカウントの現在のモードを明示的に確定する",sync:"同期",confirm:"確定",active:"有効",setDefault:"既定に設定",deleteAccount:"アカウントを削除",cannotDeleteDefault:"既定のアカウントは削除できません",noAccounts:"CCS auth アカウントが見つかりません。追加するには ccs auth create を使ってください。",resetToDefault:"CCS の既定値に戻す",deleteDialogTitle:"アカウントを削除",deleteDialogDesc:'アカウント "{{name}}" を削除しますか? この操作でプロファイルと関連するすべてのセッションデータが削除されます。この操作は元に戻せません。',cancel:"キャンセル",delete:"削除",sharedGroupStandard:"共有({{group}}、標準)",sharedGroupDeeper:"共有({{group}}、拡張)",sharedGroupLegacy:"共有({{group}}、標準・レガシー)",isolatedLegacy:"分離(旧既定値)",isolated:"分離",noSameGroupPeer:"同じグループの相手がまだいません",sameGroupPeerCount_one:"{{count}} 件の同グループアカウント",sameGroupPeerCount_other:"{{count}} 件の同グループアカウント",legacyReview:"この推定された既定状態を確認して明示的に確定してください。",noHandoff:"アカウント間再開は元のアカウントに残ります。",badges:{shared:"共有",deeper:"拡張",legacy:"レガシー",isolated:"分離"}},addAccountDialog:{title:"{{displayName}} アカウントを追加",descKiro:"Kiro の認証方法を選び、ブラウザーで認証するか Kiro IDE からインポートしてください。",descDeviceCode:"認証をクリックすると、プロバイダーのサイトで入力する確認コードが表示されます。",descOauth:"認証をクリックすると OAuth URL を取得します。任意のブラウザーで開いてサインインしてください。",powerUserEnabled:"上級者モードが有効です",powerUserSkipped:"設定 > プロキシのパワーユーザーモードにより、AGY の責任確認チェックと Gemini ダッシュボードのリスク文言入力をスキップしています。OAuth / アカウントに関するリスクはすべて自己責任です。",powerUserLoadFailed:"パワーユーザーモード設定を読み込めませんでした。設定 > プロキシを確認してから再試行してください。",powerUserLoading:"パワーユーザーモードの安全設定を読み込み中です。少し待ってから再試行してください。",powerUserUnavailableRetry:"パワーユーザーモードは利用できません。必要なプロバイダーの安全確認を完了してから再試行してください。",authMethod:"認証方法",selectKiroAuthMethod:"Kiro の認証方法を選択",gitlabAuthMethod:"GitLab 認証方法",selectGitlabAuthMethod:"GitLab 認証方法を選択",gitlabAuthOAuth:"ブラウザー OAuth",gitlabAuthPat:"Personal Access Token",gitlabAuthHint:"gitlab.com ではブラウザー OAuth を使い、自前ホストや管理者運用環境では PAT を使ってください。",gitlabUrl:"GitLab URL",gitlabUrlPlaceholder:"https://gitlab.com",gitlabUrlHint:"任意です。gitlab.com を使う場合は空欄のままにし、自前ホストの場合はベース URL を指定してください。",gitlabPat:"Personal Access Token",gitlabPatPlaceholder:"glpat-...",gitlabPatHint:"トークンには少なくとも次のスコープが必要です:",gitlabPatRequired:"PAT ログインには GitLab Personal Access Token が必要です。",nicknameRequired:"ニックネーム(必須)",nicknameOptional:"ニックネーム(任意)",nicknamePlaceholder:"例: work, personal",nicknameRequiredHint:"このプロバイダーでは必須です。重複しないわかりやすい名前を付けてください(例: work, personal)。",nicknameOptionalHint:"このアカウントを識別しやすい名前です。空欄の場合は安全な識別子を自動生成します。",waitingForAuth:"認証を待機中...",deviceCodeHint:"確認コードのダイアログがまもなく表示されます。プロバイダーのサイトでコードを入力してください。",browserHint:"ブラウザーで認証を完了してください。このダイアログは自動で閉じます。",openUrlLabel:"サインインするには、この URL を任意のブラウザーで開いてください:",copied:"コピー済み",copy:"コピー",open:"開く",popupBlocked:"ポップアップがブロックされました。上の URL をコピーして、ブラウザーで手動で開いてください。",redirectPasteLabel:"リダイレクトが機能しない場合は、コールバック URL を貼り付けてください:",callbackPlaceholder:"リダイレクト URL をここに貼り付け...",submitCallback:"コールバックを送信",submitting:"送信中...",preparingUrl:"サインイン URL を準備中...",cancel:"キャンセル",importingToken:"Kiro IDE からトークンをインポート中...",authenticate:"認証",importFromIde:"IDE からインポート",importing:"インポート中..."},flowViz:{backToProviders:"プロバイダーに戻る",showDetails:"詳細を表示",hideDetails:"詳細を隠す",showPausedAccounts:"一時停止を表示 ({{count}})",hidePausedAccounts:"一時停止を非表示 ({{count}})",visibleTotalRequests:"表示中のリクエスト",visibleAccounts:"表示中のアカウント",excludingPausedAccounts:"一時停止 {{count}} 件を除外中",resetLayout:"レイアウトをリセット",provider:"プロバイダー",totalRequests:"総リクエスト数",accounts:"アカウント",connectionTimeline:"接続タイムライン",noRecentConnections:"最近の接続はありません"},quickStats:{totalRequests:"総リクエスト数",successRate:"成功率",totalTokens:"総トークン数",activeModels:"アクティブなモデル"},authMonitor:{accounts:"アカウント",accountsCount:"{{count}} アカウント",success:"成功",failed:"失敗",successRate:"成功率"},accountCard:{resumeAccount:"アカウントを再開",pauseAccount:"アカウントを一時停止",quotaLoading:"クォータ...",quota:"クォータ",quotaUnavailable:"クォータ上限を取得できません",reauthNeeded:"再認証が必要",failureLabelReauth:"再認証",failureLabelWorkspace:"ワークスペース",failureLabelNoAccess:"アクセス不可",failureLabelRetry:"再試行",failureLabelReconnect:"再接続",failureLabelTemporary:"一時的",failureLabelUnavailable:"利用不可",failureHintReauth:"このアカウントの認証フローをもう一度実行して更新してください。",failureHintWorkspace:"このアカウントをアクティブなワークスペースに戻してから、削除して再追加してください。",failureHintNoAccess:"このアカウントでは、プロバイダーのクォータエンドポイントにアクセスできません。",failureHintRetry:"しばらく待ってから、クォータリクエストを再試行してください。",failureHintReconnect:"古いアカウントを削除し、再度認証してください。",failureHintTemporary:"一時的な問題のようです。後でもう一度試してください。",removeAndReadd:"削除して再追加",autoRefreshFailed:"自動更新に失敗しました"},antigravityChecklist:{title:"Antigravity OAuth の責任確認",subtitle:"認証する前に 4 ステップすべて完了してください。",mandatory:"必須",completion:"完了状況",stepsCount:"{{current}}/4 ステップ"},accountSafetyWarning:{title:"OAuth アカウント安全性の警告",subtitle:"Issue #509 · Gemini + AGY OAuth リスク",firstLine:"Issue #509 では、CCS AGY と、CCS Gemini と CCS AGY 間での共有アカウント利用に関連する停止・BAN 報告がまとめられています。",secondLine:"OAuth とアカウントアクセスのリスクをすべて自己責任で負う場合のみ続行してください。",issueLabel:"Issue #509 を読む",proxySettingsLabel:"Gemini + AGY の設定: 設定 > プロキシ"},cliproxyDialog:{name:"名前",provider:"プロバイダー",account:"アカウント",accountOptional:"アカウント(任意)",model:"モデル",modelOptional:"モデル(任意)",defaultTarget:"デフォルトターゲット",defaultTier:"デフォルトティア",tierConfig:"ティア設定",selectProvider:"プロバイダーを選択...",useDefaultAccount:"デフォルトのアカウントを使用",defaultSuffix:"(デフォルト)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"キャンセル",create:"作成",creating:"作成中...",saveChanges:"変更を保存",saving:"保存中...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"複合バリアントを編集: {{name}}",editSingleTitle:"単一バリアントを編集: {{name}}"},profileEditor:{profileInfo:"プロファイル情報",profileName:"プロファイル名",filePath:"ファイルパス",lastModified:"最終更新",defaultTarget:"デフォルトターゲット",quickUsage:"クイック実行",runWithProfile:"このプロファイルで実行",runOnDroid:"Droid で実行",runOnDroidWithFlag:"--target で Droid 実行",droidAliasExplicit:"Droid エイリアス(明示)",overrideToClaude:"Claude に切り替え",overrideToClaudeExplicit:"Claude に切り替え(明示)",targetHintPreferredAlias:"推奨の明示エイリアス:",targetHintClaudeDefault:"デフォルトコマンド:",targetHintLegacyAlias:"従来ショートカットも利用可能:",targetHintOverride:"実行ごとに次でも上書きできます",setAsDefault:"デフォルトに設定",provider:"プロバイダー",custom:"カスタム",providerChooserHint:"まずプリセットを選び、その後で URL、API Key、モデルマッピングを調整できます。",featuredProviders:"注目のプロバイダー",scrollHint:"画面が狭い場合は横にスクロールできます",customEndpoint:"カスタムエンドポイント",morePresets:"その他のプリセット",customEndpointDescription:"空の Anthropic 互換 URL から始め、すべて手動で設定します。"},settings:{sectionLoadFailed:"セクションの読み込みに失敗しました",unknownError:"不明なエラーが発生しました",reloadPage:"ページを再読み込み",refresh:"更新",copy:"コピー",copied:"コピーしました",saved:"保存しました",loading:"読み込み中...",configFileNotFound:"設定ファイルが見つかりません"},settingsTabs:{browser:"ブラウザ",web:"Web検索",image:"画像",channels:"チャンネル",env:"環境変数",think:"思考",proxy:"プロキシ",auth:"認証",backup:"バックアップ"},settingsAuth:{failedFetchTokens:"認証トークンの取得に失敗しました",failedSaveTokens:"トークンの保存に失敗しました",tokensUpdated:"トークンを更新しました。反映するには CLIProxy を再起動してください。",failedRegenerate:"シークレットの再生成に失敗しました",secretRegenerated:"新しい Management Secret を生成しました。反映するには CLIProxy を再起動してください。",failedReset:"トークンのリセットに失敗しました",tokensReset:"トークンをデフォルトに戻しました。反映するには CLIProxy を再起動してください。",description:"CLIProxy の認証トークンを設定します。変更を反映するには CLIProxy の再起動が必要です。",apiKey:"API Key",custom:"カスタム",apiKeyDesc:"Claude Code が CLIProxy への認証に使用します",apiKeyPlaceholder:"API key",managementSecret:"Management Secret",managementSecretDesc:"CCS ダッシュボードが CLIProxy の管理 API にアクセスするために使用します",managementSecretPlaceholder:"Management secret",generateSecret:"新しい安全なシークレットを生成",resetDefaults:"デフォルトに戻す",resetDesc:"API Key と Management Secret の両方をデフォルト値に戻します。",saving:"保存中...",save:"保存"},settingsGlobalEnv:{description:"Claude 以外のサブスクリプション型プロファイル(gemini、codex、agy、ghcp など)に注入する環境変数",enabled:"グローバル環境変数を有効化",disabled:"グローバル環境変数を無効化",enabledDesc:"環境変数をサードパーティープロファイルに注入します",disabledDesc:"環境変数は注入されません",envVars:"環境変数",noneConfigured:"環境変数は未設定です",addNew:"変数を追加",keyName:"KEY_NAME",value:"値",add:"追加",quickAdd:"よく使う変数を追加",allConfigured:"主要な変数はすべて設定済みです"},settingsBackups:{failedFetch:"バックアップの取得に失敗しました",failedRestore:"バックアップの復元に失敗しました",restoreSuccess:"バックアップを復元しました",title:"設定バックアップ",description:"settings.json の以前のバージョンを復元します。設定を変更するとバックアップが自動作成されます。",none:"利用できるバックアップはありません",noneHint:"設定を変更すると、ここにバックアップが表示されます",latest:"最新",restoring:"復元中...",restore:"復元",restoreConfirmTitle:"バックアップを復元しますか?",restoreConfirmPrefix:"現在の設定を次のバックアップで置き換えます:",restoreConfirmSuffix:"この操作は元に戻せません。",cancel:"キャンセル"},settingsWebsearch:{description:"サードパーティープロファイル(gemini、codex、agy など)向けの CLI ベース Web 検索",enabled:"WebSearch を有効化",disabled:"WebSearch を無効化",checking:"状態を確認中...",providers:"プロバイダー",noneConfigured:"プロバイダーが設定されていません",noneConfiguredHint:"Web 検索プロバイダーを有効にするには CLI ツールをインストールしてください",checkProviders:"プロバイダーを確認",installed:"インストール済み",notInstalled:"未インストール",model:"モデル:",howInstall:"{{name}} CLI のインストール方法",installGlobally:"グローバルにインストール",requiresKey:"(xAI API Key が必要)",freeTier:"(無料枠あり)",viewDocs:"ドキュメントを見る"},settingsProxy:{failedLoadAgyMode:"パワーユーザーモードの読み込みに失敗しました",failedUpdateAgyMode:"パワーユーザーモードの更新に失敗しました",failedVerifyAgyMode:"パワーユーザーモードの永続化確認に失敗しました",notPersistedAgyMode:"パワーユーザーモードが保存されませんでした。別のプロセスが設定を変更した可能性があります。",agyModeEnabled:"パワーユーザーモードを有効にしました。",agyModeDisabled:"パワーユーザーモードを無効にしました。",typePhraseToContinue:"続行するには「{{value}}」と入力してください。",description:"プロキシベースのプロファイル用に、ローカルまたはリモートの {{backend}} 接続を設定します",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"インスタンス状態",connectionMode:"接続モード",local:"ローカル",remote:"リモート",localDesc:"このマシンで {{backend}} バイナリを実行します",remoteDesc:"リモートの {{backend}} サーバーに接続します",backendBinary:"バックエンドバイナリ",stopProxyToSwitch:"バックエンドを切り替える前に、インスタンス状態から実行中のプロキシを停止してください。",default:"デフォルト",plusDesc:"追加プロバイダー向けのオプショントラックです。引き続きサポートされていますが、現在は upstream ではなくコミュニティ保守です。",originalDesc:"コアプロバイダートラック向けの既定かつ常時利用可能な backend。",plusFallbackNotice:"Plus プロバイダートラックは廃止ではありませんが、保守中の fork が戻るまではローカル CLIProxy は引き続きオリジナル backend にフォールバックします。",variantsIncompatible:"既存の plus-extra バリアント({{providers}})はオリジナル backend では動作しません。参照用に残すことはできますが、使用前に Plus へ切り替えてください。",safety:"安全設定",agyModeTitle:"Antigravity + Gemini パワーユーザーモード",agyModeDesc:"アカウント追加画面の AGY 責任確認チェックと、Gemini ダッシュボードの入力確認をスキップします。",agyWarning:"OAuth の停止/BAN リスクパターン (#509) を十分理解している場合にのみ使用してください。CCS はアカウント喪失の責任を負いません。",finalConfirm:"最終確認",finalConfirmDesc:"有効にすると、ダッシュボード / CLI の AGY 安全チェックと Gemini ダッシュボードのリスク文言確認をスキップします。続行する前に issue #509 を確認し、正確なフレーズを入力してください。",step1:"ステップ 1",readIssue:"Issue #509 を読む",step2:"ステップ 2",typePrefix:"有効にするには",typeSuffix:"と入力してください。",typePhraseAria:"Antigravity + Gemini パワーユーザーモードを有効にするには I ACCEPT RISK と入力してください",exactPhrase:"完全一致で入力してください。",enableAgyMode:"Antigravity + Gemini パワーユーザーモードを有効にする",toggleAgyMode:"Antigravity + Gemini パワーユーザーモードを切り替え",fallbackSettings:"フォールバック設定",enableFallback:"ローカルへのフォールバックを有効化",enableFallbackDesc:"リモートに接続できない場合はローカルプロキシを使用します",autoStartLocal:"ローカルプロキシを自動起動",autoStartLocalDesc:"フォールバック時にローカルプロキシを自動で起動します",advanced:"詳細設定",debugMode:"デバッグモード",debugModeDesc:"ブラウザコンソールで開発者向け診断を有効にします",debugModeEnabled:"デバッグモードを有効にしました。詳細ログはブラウザコンソールを確認してください。",localProxy:"ローカルプロキシ",port:"ポート",autoStart:"自動起動",localAutoStartDesc:"必要になったらローカルプロキシを自動起動します",remoteConfigTitle:"リモートサーバー設定",host:"ホスト",hostPlaceholder:"192.168.1.100 または proxy.example.com",defaultPort:"デフォルト: {{value}}",portPlaceholder:"{{value}} を使う場合は空欄",protocol:"プロトコル",http:"HTTP",https:"HTTPS",apiKeyOptional:"API Key(任意)",apiKeyPlaceholder:"/v1/* API エンドポイント用",apiKeyDesc:"/v1/chat/completions への API リクエストで使用します",managementKeyOptional:"Management Key(任意)",managementKeyPlaceholder:"/v0/management/* エンドポイント用",managementKeyDesc:"ダッシュボードの管理 API で使用します。未設定の場合は API Key を使用します。",testing:"テスト中...",testConnection:"接続をテスト",connectedLatency:"接続済み({{value}}ms)",connectionFailed:"接続に失敗しました",invalidPortOrEmpty:"ポートは 1〜65535 の整数で入力するか、デフォルトを使う場合は空欄にしてください",invalidLocalPort:"ローカルポートは 1〜65535 の整数で指定してください",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"対応モデルの高度な思考 / 推論設定を行います。",supportedProviders:"対応プロバイダー",modeTitle:"思考モード",modeAutoDesc:"モデルのティアに応じて思考レベルを自動設定します",modeOffDesc:"高度な思考を無効化します",modeManualDesc:"永続的な上書きレベルを設定するか、実行ごとに CLI フラグを使います",tierDefaults:"ティア別デフォルト",tierDefaultsDesc:"自動モード時に各モデルティアへ適用する既定の思考レベルです。",persistentOverride:"永続オーバーライド",persistentOverrideDesc:"すべてのセッションに適用されます。CLI フラグが優先されます。",enterCustomBudget:"カスタム予算を入力",apply:"適用",providerOverrides:"プロバイダー別オーバーライド({{count}})",providerOverridesDesc:"特定のプロバイダーに対してティア別デフォルトを上書きします。必要に応じてカスタムのプロバイダーキーを追加してください。",addProviderPlaceholder:"プロバイダーキーを追加(例: qwen)",showWarnings:"警告を表示",showWarningsDesc:"思考値が制限または調整された場合に警告を表示します",cliEnvOverride:"CLI / 環境変数の上書き",supportLine1Prefix:"思考予算:",supportLine1Suffix:"(トークンベース)",supportLine2Prefix:"推論強度:",supportLine2SuffixPrefix:"(サフィックス、または ",supportLine2SuffixPostfix:": minimal/low/medium/high/xhigh)",supportLine3Prefix:"Codex のサフィックスは推論強度を固定します(例: ",supportLine3Suffix:")。サフィックスなしのモデルは思考モードを使います。"},analytics:{title:"分析",noDailyUsage:"本日の使用データはありません",noUsageData:"利用可能な使用データはありません",subtitle:"利用状況とインサイトを確認",month:"月",allTime:"全期間",updated:"最終更新: {{value}}"},analyticsSummary:{totalTokens:"総トークン数",totalTokensSubtitle:"入力 {{input}} / 出力 {{output}}",totalCost:"総コスト",totalCostSubtitle:"1日平均 ${{value}}",cacheTokens:"キャッシュトークン",cacheTokensSubtitle:"${{cost}}(コストの{{percent}}%)",inputCost:"入力コスト",outputCost:"出力コスト",tokensSubtitle:"{{value}} トークン"},apiProfiles:{title:"API プロファイル",sidebarTitle:"API プロファイル",sidebarSubtitle:"プレミアム API、ローカルランタイム、カスタムエンドポイント",new:"新規",searchPlaceholder:"プロファイルを検索...",loadingProfiles:"プロファイルを読み込み中...",failedLoadTitle:"プロファイルを読み込めませんでした",failedLoadDesc:"API プロファイルを取得できませんでした。もう一度お試しください。",retry:"再試行",noProfilesYet:"API プロファイルがまだありません",noProfilesDesc:"最初のプロファイルを作成して、カスタム API エンドポイントに接続します",createProfile:"プロファイルを作成",noProfileMatch:'"{{query}}" に一致するプロファイルはありません',profileCount:"{{count}} 件のプロファイル",profileCount_other:"{{count}} 件のプロファイル",configuredCount:"{{count}} 件設定済み",deleteProfileTitle:"プロファイルを削除",deleteProfileDesc:'"{{name}}" を削除しますか?設定ファイルも削除され、この操作は元に戻せません。',delete:"削除",unsavedChangesTitle:"未保存の変更",unsavedChangesDesc:'"{{current}}" に未保存の変更があります。破棄して "{{next}}" に切り替えますか?',discardSwitch:"破棄して切り替え",noOrphansFound:"孤立したプロファイル設定は見つかりませんでした",confirmRegisterOrphans:"{{total}} 件の孤立したプロファイル設定ファイルが見つかりました。うち {{valid}} 件は登録可能です。今すぐ登録しますか?",registeredWithSkipped:"({{count}} 件スキップ)",registeredProfiles:"{{count}} 件のプロファイルを登録しました",copyPrompt:"「{{name}}」をどの新しいプロファイル名にコピーしますか?",destinationEmpty:"コピー先のプロファイル名は空にできません",exportRedacted:"トークンをマスクした状態でエクスポートしました。必要なら CLI の include-secrets フローを使ってください。",exportDownloaded:"プロファイルのエクスポートをダウンロードしました",importFailed:"プロファイルバンドルをインポートできませんでした",discoverOrphans:"孤立プロファイルを検出",importProfileBundle:"プロファイルバンドルをインポート"},accountsPage:{title:"アカウント",managePrefix:"一つの画面で",manageSuffix:"のアカウント管理とプール導線をまとめて扱えます。",mobileManageSuffix:"の継続性設定をまとめて管理できます。",primaryActions:"主要アクション",createAccount:"アカウントを作成",authClaudeInPool:"Pool で Claude を認証",openClaudePoolSettings:"Claude Pool の設定を開く",openCliProxyClaudePool:"CLIProxy Claude Pool を開く",migrationFollowup:"移行フォローアップ",legacyContextPending:"{{count}} 件のアカウントで初回モード確認がまだ必要です。",legacyContextPending_other:"{{count}} 件のアカウントで初回モード確認がまだ必要です。",legacyContinuityPending:"{{count}} 件の共有アカウントが標準のレガシー継続深度のままです。",legacyContinuityPending_other:"{{count}} 件の共有アカウントが標準のレガシー継続深度のままです。",confirmingLegacy:"レガシーポリシーを確認中...",confirmLegacy:"レガシーポリシーを確認({{count}})",noLegacyFollowup:"保留中のレガシーフォローアップはありません。",continuityGuide:"継続性ガイド",expandWhenNeeded:"必要なときだけ展開。",sharedStandard:"共有標準",sharedStandardDesc:"プロジェクトワークスペースの同期のみ。ほとんどのチームに最適な既定値です。",sharedDeeper:"共有拡張",sharedDeeperDesc:"session-env、file-history、shell-snapshots、todos も同期します。アカウント間再開を期待するなら推奨です。",sharedDeeperPrefix:"追加で",isolated:"分離",isolatedDesc:"リンクなし。厳密な分離に最適です。",quickCommands:"クイックコマンド",quickCommandsDesc:"コピーしてターミナルで実行します。",workspaceBadge:"ccs auth ワークスペース",historySyncBadge:"履歴同期設定",authAccounts:"認証アカウント",tableScopePrefix:"この表では",tableScopeMiddle:"のアカウントのみを表示します。モード/グループ/継続性の変更は",tableScopeSuffix:"を使ってください。",accountMatrix:"アカウント一覧",sharedTotalDesc:"共有アカウント合計: {{count}}。ここから同期設定とレガシー確認を行えます。",loadingAccounts:"アカウントを読み込み中..."},health:{justNow:"たった今",secondsAgo:"{{count}}秒前",minutesAgo:"{{count}}分前",hoursAgo:"{{count}}時間前",systemHealth:"システムヘルス",build:"ビルド {{version}}",lastScan:"最終スキャン:",autoRefresh:"自動更新:",refresh:"更新",checks:"チェック",version:"バージョン",platform:"プラットフォーム",liveMonitoring:"ライブ監視中",copied:"クリップボードにコピーしました",refreshing:"ヘルスチェックを更新中...",fix:"修正",applyFix:"修正を適用",healthLabel:"ヘルス"},updates:{actionRequired:"対応が必要",done:"完了",all:"すべて",inboxTitle:"更新センター",inboxSubtitle:"対応を優先し、その後で完了または非表示にします。",needsAction:"要対応",doneCount:"完了",searchPlaceholder:"対応内容またはコマンドを検索",noNotices:"このビューに一致する通知はありません。",noUpdates:"利用可能な更新はありません。",published:"{{date}} 公開",markDone:"完了にする",dismiss:"非表示",reopen:"再表示",doNext:"次にやる",impactedIntegrations:"影響を受ける連携",impactedDesc:"更新範囲とルーティングに基づく関連領域です。",whyMatters:"重要な理由",whyMattersDesc:"長文のリリースノートではなく、要点だけを表示します。",open:"開く",progressNeedsAction:"要対応",progressInReview:"確認中",progressDone:"完了",progressDismissed:"非表示",statusNew:"新着",statusStable:"安定",statusPlanned:"予定",dashboard:"ダッシュボード",cliUsage:"CLI利用状況"},cliproxyPage:{connected:"接続済み",notConnected:"未接続",variant:"バリアント",parentNotConnected:"親が未接続",viaProvider:"{{provider}} 経由",emptyTitle:"CCS プロファイルマネージャー",emptyDesc:"CLIProxy プロバイダー向けの OAuth 認証、アカウント設定、モデル選択を管理します。CCS が各 AI バックエンドへのリクエストをどうルーティングするかを設定できます。",emptyControlPanelPrefix:"ライブ利用統計とリアルタイム監視は",controlPanel:"コントロールパネルで確認できます",quickSetup:"クイックセットアップ",addAccount:"アカウントを追加",advancedVariant:"高度なバリアント",setupActionsHint:"ここでアカウントを追加します。別ランタイム/プロファイルが必要な場合のみバリアントを作成します。",accountManagement:"CCSレベルのアカウント管理",providers:"プロバイダー",variants:"バリアント",providerCount:"{{count}} 件のプロバイダー",providerCount_other:"{{count}} 件のプロバイダー",connectedCount:"{{count}} 件接続済み",variantDisplay:"{{name}}({{provider}} バリアント)"},copilotPage:{title:"Copilot",subtitle:"非推奨の GitHub Copilot 互換ブリッジ",deprecatedBadge:"非推奨",deprecationTitle:"非推奨の互換ブリッジ",deprecationItem1:"GitHub Copilot の従量課金は 2026-06-01 に開始されます",deprecationItem2:"既存のローカル設定は互換用として引き続き利用できます",deprecationItem3:"新規設定では Codex または他の有効なプロバイダーを優先してください",setup:"セットアップ",auth:"認証",daemon:"デーモン",unofficialTitle:"非公式API: 自己責任で利用してください",unofficialItem1:"リバースエンジニアリングされたAPIのため、いつでも動かなくなる可能性があります",unofficialItem2:"過度な利用でアカウントに制限がかかる可能性があります",unofficialItem3:"CCSは保証も責任も負いません",yes:"はい",no:"いいえ",installed:"インストール済み",missing:"未インストール",integration:"連携",enabled:"有効",disabled:"無効",github:"GitHub",connected:"接続済み",notConnected:"未接続",authenticate:"認証する",authenticating:"認証中...",status:"ステータス",running:"稼働中",stopped:"停止",port:"ポート",stopping:"停止中...",stop:"停止",starting:"起動中...",start:"起動",installing:"インストール中...",installCopilotApi:"copilot-api をインストール",proxy:"プロキシ",active:"有効",inactive:"無効"},cursorPage:{title:"Cursor",beta:"ベータ",deprecated:"非推奨",subtitle:"旧 Cursor セットアップ向けの非推奨ローカルブリッジ",unofficialTitle:"レガシーブリッジは非推奨です。CLIProxy 管理の Cursor を優先してください",unofficialItem1:"推奨パス: CLIProxy で Cursor の認証とアカウント管理を行う",unofficialItem2:"このリバースエンジニアリングされたローカルブリッジは、既存セットアップ向けの互換用です",unofficialItem3:"このレガシーパスについて CCS は保証も責任も負いません",supportedPathTitle:"推奨パス",supportedPathDesc:"新しいセットアップでは、CLIProxy 管理の Cursor 認証とアカウント管理を使ってください。旧来のローカルデーモンに依存している場合のみ、下のレガシーブリッジを使い続けてください。",startCliproxyAuth:"CLIProxy で Cursor 認証を開始",openCliproxyCursor:"CLIProxy の Cursor を開く",integration:"連携",authentication:"認証",daemon:"デーモン",enabled:"有効",disabled:"無効",expired:"期限切れ",connected:"接続済み",notConnected:"未接続",running:"稼働中",stopped:"停止中",actions:"レガシー操作",disableIntegration:"連携を無効化",enableIntegration:"連携を有効化",autoDetectAuth:"旧 IDE から自動検出",manualAuthImport:"旧方式で手動インポート",stopDaemon:"デーモンを停止",startDaemon:"デーモンを起動",port:"ポート",configuration:"Cursor設定",lastModified:"最終更新:",neverSaved:"未保存",saving:"保存中...",save:"保存",modelConfig:"モデル設定",settings:"設定",info:"情報",presets:"プリセット",presetsDesc:"事前設定済みのモデルマッピングを適用します",modelMapping:"モデルマッピング",modelMappingDesc:"各ティアで使うモデルを設定します",defaultModel:"デフォルトモデル",defaultModelDesc:"特定のティア指定がない場合に使われます。",opusModel:"Opus(最高性能)",opusModelDesc:"複雑な推論と最高品質の応答向け。",sonnetModel:"Sonnet(バランス)",sonnetModelDesc:"一般的なコーディングや日常的なチャット向け。",haikuModel:"Haiku(高速)",haikuModelDesc:"低レイテンシで軽量なリクエスト向け。",runtimeSettings:"ランタイム設定",autoStartDaemon:"デーモンを自動起動",autoStartDesc:"連携使用時にCursorデーモンを自動で起動します。",ghostMode:"ゴーストモード",ghostModeDesc:"テレメトリ削減のため x-ghost-mode を要求します。",provider:"プロバイダー",filePath:"ファイルパス",availableModels:"利用可能なモデル",loadingModels:"モデルを読み込み中...",noModels:"モデルメタデータはまだありません。デーモンを起動して更新してください。",default:"デフォルト",rawConfiguration:"生の設定(JSON)",manualImportTitle:"Cursor 認証情報の手動インポート",manualImportDesc:"自動検出できない場合は、CursorのアクセストークンとマシンIDを入力してください。",accessToken:"アクセストークン",accessTokenPlaceholder:"Cursorのアクセストークンを貼り付け",machineId:"マシンID",machineIdPlaceholder:"32文字の16進数(ハイフンなしUUID)",cancel:"キャンセル",import:"インポート",selectModel:"モデルを選択",useDefaultModel:"デフォルトモデルを使用",availableModelCount:"利用可能なモデル({{count}})",invalidPort:"ポートは1から65535の整数で指定してください",defaultModelRequired:"デフォルトモデルは必須です",savedConfig:"Cursor設定とモデルマッピングを保存しました",failedSaveConfig:"設定の保存に失敗しました",modelsLoadingWait:"モデルの読み込み中です。プリセットの適用前にしばらくお待ちください。",noModelsAvailable:"まだ利用可能なモデルがありません。先にデーモンを起動して更新してください。",appliedCodexPreset:"GPT-5.3 Codexプリセットを適用しました",appliedClaudePreset:"Claude 4.6プリセットを適用しました",appliedGeminiPreset:"Gemini 3プリセットを適用しました",integrationEnabled:"Cursor連携を有効化しました",integrationDisabled:"Cursor連携を無効化しました",failedUpdateIntegration:"連携状態の更新に失敗しました",credentialsImported:"Cursor認証情報をインポートしました",autoDetectFailed:"自動検出に失敗しました",manualRequired:"トークンとマシンIDは必須です",manualImportFailed:"手動インポートに失敗しました",failedStartDaemon:"デーモンの起動に失敗しました",daemonStarted:"デーモンを起動しました",daemonStartedWithPid:"デーモンを起動しました(PID: {{pid}})",failedStopDaemon:"デーモンの停止に失敗しました",daemonStopped:"デーモンを停止しました",rawLoading:"生の設定をまだ読み込み中です。しばらく待ってから再試行してください。",invalidJson:"JSONが不正です",rawSaved:"生の設定を保存しました",rawChanged:"生の設定が外部で変更されました。更新して再試行してください。",failedSaveRaw:"生の設定の保存に失敗しました",savedAll:"Cursor設定を保存しました",liveProbe:"ライブプローブ",runLiveProbe:"ライブプローブを実行",rerunLiveProbe:"ライブプローブを再実行",probing:"プローブを実行中...",probeNotRun:"まだプローブを実行していません",probeLocalReadinessHint:"ローカルの準備チェックが通っても、実際のランタイム経路は失敗する場合があります。ライブプローブで Cursor の完全な経路を確認してください。",probeStage:"段階",probeHttpStatus:"HTTP ステータス",probeDuration:"所要時間",probeModel:"モデル",probeMessage:"メッセージ",probeSucceeded:"プローブ成功",probeFailed:"プローブ失敗",probeSaveFirst:"ライブプローブを実行する前に Cursor の変更を保存するか破棄してください",refreshStatus:"Cursor の状態を更新",refreshConfiguration:"Cursor の設定を更新"},droidPage:{loadingDiagnostics:"Droid診断を読み込み中...",failedDiagnostics:"Droid診断の読み込みに失敗しました。",overview:"概要",byok:"BYOK",docs:"ドキュメント",runtimeInstall:"ランタイムとインストール",status:"状態",detected:"検出済み",notFound:"未検出",detectionSource:"検出元",binaryPath:"バイナリパス",installDirectory:"インストール先",version:"バージョン",overridePath:"オーバーライド(CCS_DROID_PATH)",configFiles:"設定ファイル",path:"パス",resolved:"解決先",size:"サイズ",lastModified:"最終更新",parseWarning:"解析警告: {{value}}",readWarning:"読み取り警告: {{value}}",warnings:"警告",byokSummary:"BYOK概要",activeModelSelector:"現在のモデルセレクター",customModels:"カスタムモデル",ccsManaged:"CCS管理",userManaged:"ユーザー管理",malformedEntries:"不正なエントリ",providers:"プロバイダー",none:"なし",customModelsTitle:"カスタムモデル",modelName:"名前 / モデル",provider:"プロバイダー",baseUrl:"ベース URL",noCustomModels:"カスタムモデルはありません",docsAlignedNotes:"ドキュメント整合メモ",factoryDocs:"Factory Docs",providerFactCheckDocs:"プロバイダー検証ドキュメント",providerValues:"プロバイダー値: {{value}}",settingsHierarchy:"設定階層: {{value}}",settingsTitle:"Droid BYOK 設定",fixJsonBeforeQuickSettings:"クイック設定を使う前に JSON 構文を修正してください。",fixJsonBeforeReasoning:"BYOK 推論設定を更新する前に JSON 構文を修正してください。",unableUpdateReasoning:"選択した BYOK モデルの推論設定を更新できません。",fixJsonBeforeBudget:"思考予算を更新する前に JSON 構文を修正してください。",anthropicOnlyBudget:"思考予算は Anthropic の BYOK モデルでのみ利用できます。",invalidJson:"JSON が不正です: {{value}}",saved:"Droid 設定を保存しました",changedExternally:"Droid 設定が外部で変更されました。更新して再試行してください。",failedSave:"Droid 設定の保存に失敗しました"},sharedPage:{commands:"コマンド",skills:"スキル",agents:"エージェント",plugins:"プラグイン",settings:"設定",title:"共有リソース",subtitle:"アカウント間で共有されるコマンド、スキル、エージェント、プラグイン、設定",totalShared:"共有数",visible:"表示中",markdownDetail:"Markdown詳細ビュー",registryDetail:"レジストリ詳細ビュー",maskedSettingsDetail:"マスク済み設定ビュー",filterPrefix:"フィルター:",configurationRequired:"設定が必要です",countsUnavailable:"件数を取得できません",retryCounts:"件数を再取得",filterPlaceholder:"{{tab}}を名前、説明、パスで絞り込み",showing:"{{visible}} / {{total}} 件の{{tab}}を表示",showingQuery:"(「{{query}}」で絞り込み)",refreshing:"(更新中...)",loadingShared:"共有{{tab}}を読み込み中...",failedLoadShared:"共有{{tab}}の読み込みに失敗しました",retry:"再試行",noSharedFound:"共有{{tab}}が見つかりません。`ccs sync` を実行するか、共有ディレクトリに項目を追加してください。",noPluginsFound:"共有プラグインはインストールされていません。実際のプラグインが存在するまで、プラグインレジストリとキャッシュフォルダーは非表示になります。",noMatch:"{{tab}}で「{{query}}」に一致するものはありません。",selectOne:"内容を表示する{{tab}}を選択してください。",pathLabel:"パス",resolvedSource:"解決後ソース",loadingMarkdown:"Markdownコンテンツを読み込み中...",loadingSettings:"設定内容を読み込み中...",failedLoadContent:"コンテンツの読み込みに失敗しました",retryContent:"再読み込み",noMarkdown:"Markdownコンテンツはありません。",settingsTitle:"settings.json",settingsDescription:"このファイルには shared モードの全アカウントにリンクされる共有設定が含まれます。",settingsPath:"共有設定パス",settingsActive:"有効",settingsInactive:"未検出",resourcePolicies:"リソースポリシー",resourcePoliciesDescription:"shared のアカウントはこのハブを継承します。profile-local のアカウントはコマンド、スキル、エージェント、プラグイン、設定を分離します。",sharedAccounts:"{{count}} shared",profileLocalAccounts:"{{count}} profile-local",moreProfileLocalAccounts:"+{{count}} 件"},accountCardStats:{notUsedYet:"未使用"},accountQuotaPanel:{weekly:"週間",loadingQuota:"クォータを読み込み中..."},accountSurfaceCard:{business:"ビジネス",free:"無料",personal:"個人",variant:"バリアント"},accountIdentity:{business:"ビジネス",personal:"個人",free:"無料",team:"チーム",plus:"Plus",pro:"Pro",workspace:"ワークスペース {{id}}"},aiProvidersEntryCard:{apiKeys:"API Keys"},aiProvidersEntryDialog:{connectorName:"コネクタ名",baseUri:"ベース URL",proxyUrl:"プロキシ URL",secret:"シークレット",prefix:"プレフィックス",excludedModels:"除外モデル",headers:"ヘッダー",modelMappings:"モデルマッピング",requiredSetup:"必要なセットアップ",optionalRouting:"オプションのルーティング"},aiProvidersFamilyRail:{current:"現在"},aiProvidersPage:{title:"AI プロバイダー",subtitle:"AI プロバイダーの設定を管理します。",unableToLoad:"AI プロバイダーを読み込めませんでした"},analyticsCards:{cacheCost:"キャッシュコスト",hitRate:"ヒット率",inputOutputRatio:"入力/出力比",noCacheData:"キャッシュデータがありません",noModelData:"モデルデータがありません",noSessionData:"セッションデータがありません",noTokenData:"トークンデータがありません",totalCost:"合計コスト",totalTokens:"合計トークン",usageInsights:"利用インサイト"},analyticsPageV2:{title:"分析",subtitle:"利用分析とインサイト。"},analyticsPages:{chartsGrid:"チャート",costByModel:"モデル別コスト"},apiPage:{title:"API プロファイル",subtitle:"API プロファイルとエンドポイントを管理します。"},authMonitorLive:{live:"ライブ",accountMonitor:"アカウントモニター",updated:"{{time}} に更新",updatedNow:"たった今更新",requestsLabel:"件",stats:"統計",successRate:"成功率",missingProjectId:"プロジェクト ID がありません",noActivity:"アクティビティなし"},bulkActionBar:{applyPreset:"プリセットを適用"},ccsLogo:{alt:"CCS ロゴ",text:"CCS Config"},claudeExtensionPage:{title:"Claude Extension",subtitle:"Claude Extension の連携設定。",claudeAuth:"Claude 認証",status:"ステータス",targetMetadata:"IDE ターゲットメタデータ"},claudekitBadge:{title:"Powered by ClaudeKit Framework",alt:"ClaudeKit",poweredBy:"Powered by",claudekit:"ClaudeKit"},cliproxyConfig:{unsavedChanges:"未保存の変更",original:"変更前",modified:"変更後",reviewChanges:"変更を確認",loadingEditor:"エディターを読み込み中..."},cliproxyHeader:{ccsLevelAccountManagement:"CCS レベルのアカウント管理",cliproxyNotAvailable:"CLIProxy は利用できません",cliproxyControlPanel:"CLIProxy コントロールパネル",noVariants:"CLIProxy バリアントが見つかりません。",addAccountToStart:"アカウントを追加して開始"},cliproxyStatsOverview:{sessionStatistics:"セッション統計",realTimeMetrics:"{{backend}} からのリアルタイム利用指標",offline:"オフライン",running:"稼働中",noActiveSession:"アクティブなセッションなし",noActiveSessionHint:"リアルタイム統計を表示するには、ccs gemini、ccs codex、または ccs agy で CLIProxy セッションを開始してください。",failedLoadStats:"統計の読み込みに失敗しました",totalRequests:"総リクエスト数",successCount:"{{count}} 件成功",successRate:"成功率",totalTokens:"総トークン数",estimatedCost:"推定約 ${{cost}}",modelsUsed:"使用モデル",modelUsageDistribution:"モデル別利用分布",requestCount:"{{count}} リクエスト"},cliproxyTable:{name:"名前",provider:"プロバイダー",model:"モデル",account:"アカウント",status:"ステータス",default:"デフォルト",actions:"操作"},cliproxyTabs:{overview:"概要",variants:"バリアント",aiProviders:"AI プロバイダー",controlPanel:"コントロールパネル"},codeEditor:{revealSensitive:"機密値を表示",maskSensitive:"機密値を隠す",valid:"有効な {{language}}",readOnly:"(読み取り専用)"},codex:{controlCenter:"コントロールセンター",overview:"概要",docs:"ドキュメント",nativeCodexRuntime:"ネイティブ Codex ランタイム",ccsCodexProvider:"cliproxy ショートカット / 管理ブリッジ",codexDocs:"Codex ドキュメント",supportedFlows:"対応フロー",twoSupportedPaths:"2つのサポートパス:",nativeLabel:"ネイティブ:",nativeDesc:"Codex は CCS v1 でファーストクラスのランタイム専用ターゲットです。",ccsBridge:"CCS Bridge",apiProfilesDefault:"API プロファイルのデフォルトは引き続き Claude または Droid です。",recommendedSetupFlow:"推奨セットアップフロー",fastestPath:"最速パス",officialChannels:"公式チャンネル",codexCli:"Codex CLI",openNativeCodex:"ネイティブ Codex を開く",runBuiltInCodex:"cliproxy ショートカット付きでネイティブ Codex を実行",runBuiltInCodexExplicit:"CCS 管理 Codex ブリッジを明示的に実行",openCodexDashboard:"Codex ダッシュボードを開く",status:"ステータス",profiles:"プロファイル",createNewProfile:"新しいプロファイルを作成",createNewProvider:"新しいプロバイダーを作成",createNewMcpServer:"新しい MCP サーバーを作成",defaultProvider:"デフォルトプロバイダー",useDefault:"デフォルトを使用",useGlobalProvider:"グローバルプロバイダーを使用",useProviderDefault:"プロバイダーのデフォルトを使用",quickFillWarning:"クイック入力のみです。保存前に確認してください。",thisFileUpstreamOwned:"このファイルは Codex CLI の上流管理対象です。",notes:"メモ",approvalPolicy:"承認ポリシー",sandboxMode:"サンドボックスモード",reasoningEffort:"推論強度",useGlobalEffort:"グローバル設定を使用",reasoningEffortCapitalized:"推論強度",thinkingBudgetTokens:"思考予算トークン",modelContextWindow:"モデルコンテキストウィンドウ",autoCompactTokenLimit:"自動圧縮トークン上限",toolOutputTokenLimit:"ツール出力トークン上限",webSearch:"Web 検索",personality:"パーソナリティ",model:"モデル",rawOnly:"Raw のみ",trusted:"信頼済み",untrusted:"未信頼",noProjectTrustEntries:"明示的なプロジェクト信頼エントリはありません。",codexNativeRecipe:"ネイティブ Codex レシピを保存しました",gptContextCap:"GPT-5.4 コンテキスト上限",usageLimitCost:"272K 超過時の利用制限コスト",longContextOverride:"長文コンテキストオーバーライド",counts2x:"2倍カウント",normalUsageWindow:"通常利用ウィンドウ",useCodexDefault:"Codex のデフォルトを使用",stdio:"stdio",streamableHttp:"streamable-http",responses:"responses",defaultTargetCli:"デフォルトターゲット CLI",executionChain:"実行チェーン",targetPath:"現在のターゲットパス",userConfig:"ユーザー設定",configYaml:"config.yaml",flow:"フロー",docsTab:"ドキュメント",features:"機能",featuresDesc:"CCS が安全に管理できる Codex の機能フラグを切り替えます。",configOnlyFlags:"設定ファイル内のみの既存フラグ",configOnlyFlagsDesc:"これらのキーはすでに `config.toml` に存在するため、CCS は完全なカタログ対応を主張せずに表示できます。",existing:"既存",nonBooleanForm:"非 boolean 形式で保存されています。編集する場合は Raw TOML を使用してください。",discoveredFromFile:"CCS の内蔵カタログではなく現在のファイルから検出されました。",featureMultiAgentLabel:"Multi-agent",featureMultiAgentDesc:"subagent 連携ツールを有効にします。",featureUnifiedExecLabel:"Unified exec",featureUnifiedExecDesc:"PTY ベースの unified exec ツールを使用します。",featureShellSnapshotLabel:"Shell snapshot",featureShellSnapshotDesc:"shell 環境スナップショットを再利用します。",featureApplyPatchLabel:"Apply patch",featureApplyPatchDesc:"自由形式の apply_patch 編集を有効にします。",featureJsReplLabel:"JS REPL",featureJsReplDesc:"Node ベースの JavaScript REPL を有効にします。",featureRuntimeMetricsLabel:"Runtime metrics",featureRuntimeMetricsDesc:"Codex のランタイム指標を収集します。",featurePreventIdleSleepLabel:"Prevent idle sleep",featurePreventIdleSleepDesc:"動作中にマシンがスリープしないようにします。",featureFastModeLabel:"Fast mode",featureFastModeDesc:"高速サービス階層パスを許可します。",featureAppsLabel:"Apps",featureAppsDesc:"ChatGPT Apps と connector のサポートを有効にします。",featureSmartApprovalsLabel:"Smart approvals",featureSmartApprovalsDesc:"対象となる承認を guardian フローに回します。",howCodexWorks:"CCS での Codex の動作",nativeConfigLabel:"ネイティブ設定:",nativeConfigDesc:"ccs-codex と ccsx は保存済みデフォルトでネイティブ Codex を起動します。",transientOverridesLabel:"一時オーバーライド:",transientOverridesDesc:"ccsxp はネイティブ Codex のまま cliproxy プロバイダー上書きだけを追加し、ccs codex --target codex は明示的な CCS 管理ブリッジのままです。",cliproxyDefaultLabel:"CLIProxy デフォルト:",cliproxyDefaultDesc:'通常の codex を CLIProxy 経由にするには、model_provider = "cliproxy" を設定し、下のレシピを追加します。',runtimeInstall:"ランタイムのインストール",detected:"検出済み",notFound:"見つかりません",detectionSource:"検出元",binaryPath:"バイナリパス",installDirectory:"インストール先",versionLabel:"バージョン",nativeAliases:"ネイティブ別名",ccsProviderShortcut:"cliproxy ショートカット",configOverrideSupport:"--config オーバーライド対応",available:"利用可能",missing:"不足",cliproxyNativeCodex:"CLIProxy 経由のネイティブ Codex",builtInLabel:"内蔵:",builtInCcsxpDesc:"ccsxp を使うと、cliproxy プロバイダーショートカット付きでネイティブ Codex を起動します。",managedBridgeLabel:"管理ブリッジ:",managedBridgeDesc:"より厳格な CCS 管理ルートを明示的に使いたい場合は ccs codex --target codex を使います。",nativeRecipeLabel:"ネイティブ:",nativeRecipeDesc:"下のレシピを設定すると codex を直接 CLIProxy 経由で利用できます。",saveProviderNamedCliproxy:"上の base URL と env key を使って cliproxy という名前の provider を保存します。",inTopLevelSetDefault:"Top-level settings で Default provider を cliproxy に設定します。",exportCliproxyApiKey:"ネイティブ Codex を起動する前に shell で CLIPROXY_API_KEY を export してください。",noConfigOverrides:"この Codex ビルドでも純粋なネイティブパスは使えますが、検出された Codex バイナリが --config オーバーライドに対応するまで、ccsxp と明示的な CCS 管理 Codex ブリッジは利用できません。",configFile:"設定ファイル",path:"パス",resolved:"解決先",size:"サイズ",lastModified:"最終更新",tomlWarning:"TOML 警告",readWarning:"読み込み警告",currentUserLayerSummary:"現在のユーザーレイヤー概要",activeProfile:"アクティブプロファイル",notSet:"未設定",providersCount:"providers: {{count}}",profilesCount:"profiles: {{count}}",enabledFeaturesCount:"enabled features: {{count}}",mcpServersCount:"mcp servers: {{count}}",userLayerKeysPresent:"現在存在するユーザーレイヤーキー",nativeShortAlias:"ネイティブ短縮エイリアス",ccsCodexShortcut:"CCS Codex ショートカット",explicitProviderRoute:"明示的な provider ルート",runtimeVsProvider:"ランタイムと provider の違い",honorsSavedNativeConfig:"保存済みのネイティブ設定を尊重",usesTransientOverrides:"一時オーバーライドを使用",unavailableNoConfig:"利用不可(この Codex ビルドには --config サポートがありません)。",yes:"はい",no:"いいえ",warningsTitle:"警告"},codexPage:{title:"Codex",controlCenter:"コントロールセンター",overview:"概要",docs:"ドキュメント",nativeRuntime:"ネイティブランタイム",ccsProvider:"CCS プロバイダー",setup:"セットアップ"},commandBuilder:{title:"コマンドビルダー",searchPlaceholder:"コマンドを入力または選択...",copy:"コピー",run:"実行",cmdConfig:"設定画面を開く",cmdCreateProfile:"新しいプロファイルを作成",cmdSwitchProfile:"プロファイルを切り替え",cmdDoctor:"システムヘルスチェック",cmdListProviders:"利用可能な CLIProxy プロバイダーを一覧表示",cmdAddProvider:"CLIProxy プロバイダーを追加"},confirmDialog:{confirm:"確認",cancel:"キャンセル"},connectionIndicator:{connected:"接続済み",connecting:"接続中...",disconnected:"切断",reconnecting:"再接続中..."},copilotConfigForm:{copilotConfiguration:"Copilot 設定",deprecatedModels:"非推奨の Copilot モデルが検出されました",failedLoadStatus:"ステータスの読み込みに失敗しました",useWithClaudeCode:"GitHub Copilot サブスクリプションを Claude Code で利用する",githubCopilotControls:"GitHub Copilot はプロンプト/コンテキストの制限を上流で管理しています。",provider:"プロバイダー",filePath:"ファイルパス",status:"ステータス",enabled:"有効",disabled:"無効",loadingEditor:"エディターを読み込み中...",modelMapping:"モデルマッピング",quickUsage:"クイック実行",noPremiumUsage:"プレミアム利用回数なし"},copilotPresets:{gpt5Codex:"GPT-5.3 Codex",claude46:"Claude 4.6",gemini3:"Gemini 3"},dateRangeFilter:{pickADate:"日付を選択"},deviceCodeDialog:{authorize:"{{provider}} を認証",enterCodeAtPage:"認証ページで下のコードを入力してください。",expiresIn:"({{time}} 後に期限切れ)",codeExpired:"(コードの有効期限が切れました)",copied:"コピーしました!",copyCode:"コードをコピー",waitingForAuth:"認証を待機中...",openVerificationPage:"認証ページを開く",openProviderPage:"{{provider}} を開く",copyCodeAria:"確認コードをコピー",codeCopiedAria:"コードをコピーしました"},docsLink:{title:"ドキュメントを表示"},droidSettings:{quickControls:"クイックコントロール",reasoningControls:"推論コントロール",thinkingBudget:"思考予算",anthropicOnly:"Anthropic モデルのみ",byokCustomModels:"BYOK カスタムモデル"},extendedContext:{extendedContext:"拡張コンテキスト"},githubLink:{title:"GitHub で問題を報告"},globalEnvIndicator:{injectedCount_one:"{{count}} 件のグローバル環境変数が実行時に注入されます",injectedCount_other:"{{count}} 件のグローバル環境変数が実行時に注入されます",overriddenCount:"({{count}} 件はプロファイルで上書き)",skippedLabel:"スキップ(プロファイルで既に定義済み):",configureInSettings:"設定で構成"},healthCard:{allSystemsNominal:"すべてのシステムが正常です",machineChecks:"マシンチェック"},healthPageV2:{title:"ヘルス",subtitle:"システムヘルスの監視。"},heroSection:{title:"CCS Config",subtitle:"Claude Code Switch Dashboard"},homePageV2:{title:"ホーム",logsMoved:"ログは専用ワークスペースに移動しました",profiles:"プロファイル",cliproxy:"CLIProxy",accounts:"アカウント",health:"ヘルス"},hubFooter:{logs:"ログ",settings:"設定",github:"GitHub",copyright:"© {{year}} kaitranntt"},imageAnalysisStatus:{sectionTitle:"画像",openSettings:"設定を開く",useNativeImageReading:"ネイティブ画像読み取りを使用",refreshingPreview:"プレビューを更新中",savedStatus:"保存済みステータス",livePreview:"ライブプレビュー",disabledGlobally:"グローバルで無効",targetBypassesHook:"{{target}} はフックをバイパスします",nativeImageReading:"ネイティブ画像読み取り",setupNeeded:"セットアップが必要",needsAuth:"認証が必要",needsProxy:"プロキシが必要",nativeFallback:"ネイティブフォールバック",transformerReady:"トランスフォーマー準備完了",badgeDisabled:"無効",badgeBypassed:"バイパス中",badgeNative:"ネイティブ",badgeSetup:"セットアップ",badgeAuth:"認証",badgeProxy:"プロキシ",badgeReady:"準備完了",capabilityVerified:"検証済み",capabilityUnknown:"不明",toggleSummaryNativeCapable:"{{model}} は画像対応のようです。CCS はここではトランスフォーマーをバイパスします。",toggleSummaryNativeModel:"CCS は {{model}} でネイティブ読み取りを優先します。",toggleSummaryNativeDefault:"CCS はこのプロファイルでネイティブ画像読み取りを優先します。",toggleSummaryNativeFileAccess:"このプロファイルは現在ネイティブファイルアクセスのままです。",toggleSummaryInactiveTarget:"{{target}} が選択されている間は、保存済みの Claude 側画像ルーティングは無効です。",toggleSummaryTransformerRoute:"トランスフォーマールート: {{backend}}{{modelSuffix}}。",noteDisabledGlobally:"画像は CCS 設定でグローバルに無効になっています。",noteTargetBypassesHook:"現在のターゲット {{target}} は Claude Read フックをバイパスします。",notePersistHook:"トランスフォーマールーティングをここで有効にする前に、プロファイルフックを保存してください。",targetLabel:{claude:"Claude Code",droid:"Factory Droid",codex:"Codex CLI"}},localhostDisclaimer:{remoteReadonlyAuthDisabledLong:"この CCS インスタンスでダッシュボード認証が無効になっているため、リモートダッシュボードは読み取り専用です。CCS ホスト側で再度有効にしてください。Docker では、実行中のコンテナ内で行う必要があります。",remoteReadonlyAuthDisabledShort:"この CCS インスタンスでダッシュボード認証が再有効化されるまで、リモートダッシュボードは読み取り専用です。",remoteReadonlySetupLong:"この CCS インスタンスで ccs config auth setup を実行するまで、リモートダッシュボードは読み取り専用です。Docker では、そのコマンドをコンテナ内で実行してください。",remoteReadonlySetupShort:"この CCS インスタンスの認証が設定されるまで、リモートダッシュボードは読み取り専用です。",localLong:"このダッシュボードはローカルで動作しています。データはすべてお使いのマシンに残ります。",localShort:"ローカルダッシュボード - データはお使いのデバイスに保存されます。",dismiss:"免責事項を閉じる"},loginPage:{showPassword:"パスワードを表示",hidePassword:"パスワードを隠す"},logsConfig:{level:"レベル",message:"メッセージ",source:"ソース",time:"時刻",proc:"プロセス",open:"開く",run:"実行",refreshEntries:"エントリを更新"},logsDetailPanel:{details:"詳細"},logsFilters:{filters:"フィルター"},logsOverviewCards:{overview:"概要"},logsPageSkeleton:{loadingLogs:"ログを読み込み中..."},logsPageV2:{title:"ログ",subtitle:"システムログの表示と管理。"},modelConfigSection:{defaultModel:"デフォルトモデル"},monitoringErrorLogs:{logContent:"ログ内容"},openrouterBadge:{new:"NEW",integration:"OpenRouter 連携"},openrouterBanner:{accessModels:"OpenRouter で {{count}}+ のモデルにアクセス",add:"追加"},openrouterModelPicker:{searchModels:"モデルを検索",newestModels:"最新モデル"},openrouterPromoCard:{title:"OpenRouter",description:"1つの API エンドポイントで数百のモデルにアクセス。"},privacyToggle:{modeOn:"プライバシーモード ON - クリックしてデータを表示",modeOff:"プライバシーモード OFF - クリックしてデータを隠す"},profileCard:{profile:"プロファイル",openRouter:"OpenRouter プロファイル",claudeCode:"Claude Code",claudeCodeDefault:"Claude Code(デフォルト)",factoryDroid:"Factory Droid",codexCli:"Codex CLI",ccsProfile:"CCS プロファイル"},profileCreateDialog:{createProfile:"プロファイルを作成",appliedModelToTiers:"すべてのモデルティアに「{{model}}」を適用しました",profileCreated:"プロファイル「{{name}}」を作成しました",failedCreate:"プロファイルの作成に失敗しました",chooseProviderHint:"プロバイダーのプリセットを選ぶか、カスタム API エンドポイントを設定してください。",basicInformation:"基本情報",modelConfiguration:"モデル設定",usedInCli:"CLI での使用:",apiBaseUrl:"API ベース URL",baseUrlPlaceholder:"https://api.example.com/v1",prefilledFromPreset:"{{name}} から自動入力されています。必要に応じて変更できます。",optionalForPreset:"{{name}} では任意です。空欄の場合はネイティブの Anthropic 認証を使用します。",endpointHint:"OpenAI 互換および Anthropic リクエストを受け付けるエンドポイント",optional:"(任意)",apiKeyOptionalPlaceholder:"任意 - 認証が有効な場合のみ",apiKeyPlaceholder:"sk-...",apiKeyOptionalHint:"ローカルエンドポイントで認証が有効な場合のみ必要です",defaultTargetCli:"デフォルトターゲット CLI",modelMapping:"モデルマッピング",modelMappingDesc:"Claude Code のティア(Opus/Sonnet/Haiku)をプロバイダー対応モデルにマッピングします。",searchModelsPlaceholder:"検索(例: opus, sonnet, gpt-4o)...",noModelsFound:"「{{query}}」に一致するモデルが見つかりません",loadingModels:"モデルを読み込み中...",defaultModel:"デフォルトモデル",sonnetMapping:"Sonnet マッピング",opusMapping:"Opus マッピング",haikuMapping:"Haiku マッピング",sonnetMappingPlaceholder:"例: gpt-4o, claude-sonnet-4",opusMappingPlaceholder:"例: o1, claude-opus-4.5",haikuMappingPlaceholder:"例: gpt-4o-mini, claude-3.5-haiku",free:"無料"},profileDeck:{profiles:"プロファイル",failedToLoad:"プロファイルの読み込みに失敗しました: {{message}}",noProfiles:"プロファイルが設定されていません。最初のプロファイルを作成して始めましょう。"},profileDialogLegacy:{editProfile:"プロファイルを編集"},profileEditorSections:{imageAnalysis:"画像分析",loadingImageSettings:"画像設定を読み込み中...",skipPermissionPrompts:"起動時に権限プロンプトをスキップ",useNativeImageReading:"ネイティブ画像読み取りを使用",skipTransformer:"トランスフォーマーをスキップ",friendlyUi:"フレンドリー UI",info:"情報"},profilesTable:{name:"名前",provider:"プロバイダー",model:"モデル",target:"ターゲット",lastModified:"最終更新",actions:"操作",edit:"編集"},projectSelectionDialog:{title:"Google Cloud プロジェクトを選択",description:"{{provider}} の認証に使用するプロジェクトを選択してください。",autoSelectCountdown:"({{count}}秒後にデフォルトを自動選択)",default:"デフォルト",allProjects:"全プロジェクト",allProjectsDescription:"リスト内の {{count}} プロジェクトをすべてオンボード",useDefault:"デフォルトを使用",selecting:"選択中...",confirmSelection:"選択を確認",codeCopied:"コードをコピーしました",copyVerificationCode:"確認コードをコピー"},providerCard:{missingProjectIdAria:"プロジェクト ID がありません"},providerEditor:{provider:"プロバイダー",filePath:"ファイルパス",lastModified:"最終更新",defaultTarget:"デフォルトターゲット",quickUsage:"クイック実行",modelMapping:"モデルマッピング",status:"ステータス",loadingSettings:"設定を読み込み中...",loadingEditor:"エディターを読み込み中...",accounts:"アカウント",addAccount:"アカウントを追加",noAccountsConnected:"接続されたアカウントなし",addAccountToStart:"アカウントを追加して開始",gcpProjectIdReadonly:"GCP プロジェクト ID(読み取り専用)",projectIdNA:"プロジェクト ID: N/A",missingProjectId:"プロジェクト ID がありません",missingProjectIdHint:"エラーの原因になる可能性があります。アカウントを削除して再追加し、プロジェクト ID を取得してください。",useIncognito:"シークレットモードを使用",aliases:"エイリアス",current:"現在",currentValue:"現在の値",composite:"複合",defaultLabel:"デフォルト",requiredSetup:"必要なセットアップ",connectorName:"コネクタ名",proxyUrl:"プロキシ URL",proxyUrlSet:"プロキシ URL 設定済み",excludedModels:"除外モデル",headers:"ヘッダー",secret:"シークレット",prefix:"プレフィックス",modelMappings:"モデルマッピング",baseUri:"ベース URL",apiKeys:"API Keys",presets:"事前設定済みのモデルマッピングを適用",createVariant:"CLIProxy バリアントを作成",agyDenylist:"Antigravity ブロックリスト: Claude Opus 4.5 と Claude Sonnet 4.5 は非推奨です。"},providerEditorAccountItem:{modelsUsed:"使用モデル"},providerEditorHeader:{connectorName:"コネクタ名"},quickCommands:{title:"クイックコマンド",startDefault:"デフォルトで起動",startDefaultDesc:"デフォルトプロファイルで Claude を起動",glmProfile:"GLM プロファイル",glmProfileDesc:"GLM モデルに切り替え",healthCheck:"ヘルスチェック",healthCheckDesc:"システム診断を実行",delegateTask:"タスクを委譲",delegateTaskDesc:"GLM プロファイルに委譲"},quotaTooltip:{loadingQuota:"クォータを読み込み中...",failedLoadQuota:"クォータの読み込みに失敗しました",modelQuotas:"モデルクォータ:",rateLimits:"レート制限:",plan:"プラン: {{plan}}",quotaSnapshots:"クォータスナップショット:",unlimited:"無制限",remaining:"残り {{remaining}}/{{entitlement}}",tier:"ティア",tierId:"ティア ID",state:"状態",credits:"クレジット",modelQuotasLower:"モデルクォータ:",allBucketsReport:"全バケットが {{tokenType}} を報告",requestsRemaining:"残り {{count}} リクエスト",inputTokensRemaining:"残り {{count}} 入力トークン",outputTokensRemaining:"残り {{count}} 出力トークン",amountRemaining:"残り {{count}}",fiveHourLimit:"5時間利用制限",weeklyLimit:"週間利用制限",weeklyOpus:"週間利用(Opus)",weeklySonnet:"週間利用(Sonnet)",weeklyOAuthApps:"週間利用(OAuth アプリ)",weeklyCowork:"週間利用(Cowork)",extraUsage:"追加利用",premiumInteractions:"プレミアムインタラクション",chat:"チャット",completions:"補完",resets:"{{time}} にリセット",fiveHourResets:"5時間リセット {{time}}",weeklyResets:"週間リセット {{time}}"},utils:{codeReview5h:"コードレビュー(5時間)",codeReviewWeekly:"コードレビュー(週次)",codeReview:"コードレビュー",codexAdditional5h:"{{name}}(5時間)",codexAdditionalWeekly:"{{name}}(週次)",codexAdditional:"{{name}}"},rawEditorSection:{rawConfig:"Raw 設定"},rawJsonSettingsEditor:{title:"Raw 設定エディター"},routingGuidance:{roundRobin:"ラウンドロビンで利用を分散します。",fillFirst:"Fill first は、バックアップアカウントが必要になるまで待機させます。",routingStrategy:"ルーティング戦略",optionalRouting:"オプションのルーティング",sessionAffinity:"セッション固定",sessionAffinityOn:"オン",sessionAffinityOff:"オフ",sessionAffinityEnabled:"有効",sessionAffinityDisabled:"無効",enableSessionAffinity:"セッション固定を有効化",disableSessionAffinity:"セッション固定を無効化",sessionAffinityUnavailable:"セッション固定は利用できません",localOnly:"ローカルのみ",localOnlySetting:"ローカル専用設定",ttlBadge:"TTL {{ttl}}",sessionAffinityDescription:"可能な場合は 1 つの会話を同じアカウントに固定します。CLIProxy はクライアントが明示的に送るセッション ID やスレッド ID を優先し、それがない場合はリクエストのメタデータや冒頭プロンプト履歴から安定キーを推定します。",sessionRecognitionTitle:"セッション認識",sessionRecognitionDescription:"CCS はすべてのバックエンドで同一の優先順位を保証しません。一般に上流バックエンドは明示的なセッション / スレッド ID を優先し、その後にメタデータ、最後に冒頭プロンプト履歴のハッシュへフォールバックします。"},settingsDialog:{editProfile:"プロファイルを編集: {{name}}",description:"このプロファイルの環境変数と設定を構成します。",loadingSettings:"設定を読み込み中...",envTab:"環境変数",rawJsonTab:"Raw JSON",generalTab:"全般",noEnvVars:"環境変数は設定されていません。",noEnvVarsHint:"settings.json ファイルで変数を追加してください。",loadingEditor:"エディターを読み込み中...",profileInfo:"プロファイル情報",profileInfoDesc:"この設定ファイルの詳細情報。",path:"パス",lastModified:"最終更新",cancel:"キャンセル",saving:"保存中...",saveChanges:"変更を保存",conflictTitle:"ファイルが外部で変更されました",conflictDesc:"この設定ファイルは別のプロセスで変更されました。変更で上書きしますか?それとも破棄しますか?",overwrite:"上書き",invalidJson:"無効な JSON です",failedSave:"保存に失敗しました"},settingsPage:{title:"設定",loading:"読み込み中...",failedLoad:"設定の読み込みに失敗しました。",tabs:{web:"Web",env:"環境変数",think:"思考",proxy:"プロキシ",auth:"認証",backup:"バックアップ",channels:"チャンネル",imageAnalysis:"画像"},websearchSection:{title:"Web 検索",description:"CLI ベースの Web 検索設定。"},thinkingSection:{title:"思考",description:"対応モデルの高度な思考 / 推論設定。",directOverride:"直接上書き",youType:"入力:",ccsAdds:"CCS が追加:",executionChain:"実行チェーン",primaryBackends:"プライマリバックエンド",legacyCliFallbacks:"レガシー CLI フォールバック",managedPayload:"管理対象ペイロード",sharedTargetMetadata:"共有ターゲットメタデータ",ideTargetMetadata:"IDE ターゲットメタデータ",ideSettingsPath:"IDE 設定パス",ideHost:"IDE ホスト",resolvedBinding:"解決済みバインディング",bindingName:"バインディング名",inSync:"同期済み",currentTargetPath:"現在のターゲットパス",warnings:"警告",notes:"メモ",workspacePresets:"ワークスペースプリセット",draft:"下書き",advanced:"詳細設定",recommended:"推奨セットアップフロー",configureModelFirst:"先にモデルを設定してください"},proxySection:{title:"プロキシ",loadingImageSettings:"画像設定を読み込み中..."},channelsSection:{title:"公式チャンネル",description:"公式リリースチャンネルを表示・管理。"},imageAnalysisSection:{title:"画像分析",description:"画像分析の設定。",loading:"画像設定を読み込み中..."},browserSection:{title:"ブラウザ",description:"CCS が管理するブラウザ自動化の主要な設定画面です。",primaryTitle:"Settings > Browser がブラウザ設定の主入口です。",primaryDescription:"ここで Claude Browser Attach と Codex Browser Tools を設定し、各レーンの起動や確認は下の案内を使ってください。",readiness:"準備状況",nextStep:"次の手順",technicalDetails:"技術的な詳細",diagnostics:"診断情報",evalMode:{label:"browser_eval 権限",options:{disabled:"無効",readonly:"読み取り専用",readwrite:"読み書き可"}},actions:{saveClaude:"Claude 設定を保存",saveCodex:"Codex 設定を保存",testConnection:"接続を確認",copyLaunchCommand:"起動コマンドをコピー"},messages:{statusRefreshed:"ブラウザ状態を更新しました",launchCommandCopied:"起動コマンドをコピーしました"},claude:{title:"Claude Browser Attach",description:"リモートデバッグを有効にした Chrome セッションへ Claude-target の起動を接続します。",enabledLabel:"Claude Browser Attach を有効にする",enabledDescription:"有効にすると、CCS は Claude-target 起動向けに管理済みブラウザ MCP ランタイムを準備します。",userDataDir:"Chrome ユーザーデータディレクトリ",userDataDirHint:"日常利用のブラウザと状態を分離するため、専用の Chrome プロファイルディレクトリを使うことを推奨します。",devtoolsPort:"DevTools ポート",devtoolsPortHint:"Chrome を attach モードで起動したときに使う実際のポートと一致させてください。",devtoolsPortInvalid:"1 から 65535 の有効なポート番号を入力してください。",effectivePath:"現在有効な attach パス",recommendedPath:"推奨パス",managedRuntime:"管理済みブラウザランタイム",evalModeHint:"Claude Browser Attach における browser_eval の権限を制御します。読み取り専用は参照のみ、読み書き可はページ側の変更も許可します。",overrideMessage:"{{source}} から環境変数オーバーライドが有効です。これを外すと Dashboard の設定が再び主ソースになります。",launchGuidance:"起動ガイダンス",launchGuidanceHint:"リモートデバッグ付きで Chrome を起動し、必要なら Test connection を再実行してください。"},codex:{title:"Codex Browser Tools",description:"Codex-target 起動向けの管理済み Playwright MCP ブラウザパスを制御します。",enabledLabel:"Codex Browser Tools を有効にする",enabledDescription:"有効のままにすると、Browser ページが Codex ブラウザツールの主設定画面になります。",serverName:"管理対象サーバー名",overrideSupport:"config override 対応",overrideSupported:"対応",overrideUnsupported:"非対応",binary:"検出された Codex バイナリ",notDetected:"未検出",evalModeHint:"Browser 設定画面の整合性のために保存されます。Phase 1 では browser_eval の制御は主に Claude Browser Attach に適用されます。"}}},setupWizard:{title:"高度なバリアント設定",stepProviderDesc:"ランタイムバリアント用のプロバイダーを選択",stepAuthDesc:"プロバイダーで認証",stepAccountDesc:"使用するアカウントを選択",stepVariantDesc:"任意: カスタムランタイムバリアントを作成",stepSuccessDesc:"セットアップ完了!",authStep:{authenticateWith:"{{provider}} で認証してアカウントを追加",authenticating:"認証中...",authenticateInBrowser:"ブラウザーで認証",completeOAuth:"ブラウザーで OAuth フローを完了してください...",orUseTerminal:"またはターミナルを使用",runCommandHint:"ターミナルで次のコマンドを実行:",back:"戻る",checking:"確認中...",refreshStatus:"ステータスを更新"},accountStep:{selectAccount:"アカウントを選択({{count}})",defaultAccount:"デフォルトアカウント",or:"または",addNewAccount:"新しいアカウントを追加",addNewAccountDesc:"別のアカウントで認証",back:"戻る"},variantStep:{back:"戻る",skip:"スキップ"},successStep:{title:"バリアントを作成しました!",subtitle:"カスタムバリアントが使用可能です",usage:"使用方法:",done:"完了"}},sharedPageV2:{title:"共有",subtitle:"共有データ管理。"},sponsorButton:{title:"GitHub でこのプロジェクトをスポンサー",sponsor:"スポンサー"},supportEntryCard:{actionRequired:"対応が必要"},themeToggle:{srLabel:"テーマを切り替え"},toasts:{profileCreated:"プロファイルを作成しました",profileUpdated:"プロファイルを更新しました",profileDeleted:"プロファイルを削除しました",orphanProfilesComplete:"孤立プロファイルの登録が完了しました",profileCopied:"プロファイルをコピーしました",profileImported:"プロファイルをインポートしました",authRequired:"{{provider}} の認証が必要です",authSuccess:"{{provider}} の認証に成功しました!",authFailed:"{{provider}} の認証に失敗しました",deviceCodeExpired:"デバイスコードの有効期限が切れました。もう一度お試しください。",codeCopied:"コードをクリップボードにコピーしました",failedCopy:"コードのコピーに失敗しました",configSaved:"設定を保存しました",configSaveFailed:"保存に失敗しました: {{error}}",invalidYaml:"無効な YAML は保存できません",configUpdatedExternally:"設定が外部で更新されました",settingsFileUpdated:"設定ファイルが更新されました",accountsUpdated:"アカウントを更新しました",noProfilesToSync:"同期するプロファイルがありません",syncFailed:"同期に失敗しました: {{error}}",sessionAffinityUpdated:"セッション固定を{{state}}にしました。",providerAuthSuccess:"{{provider}} の認証に成功しました",providerDeviceCodeInCallback:"コールバックモードでプロバイダーがデバイスコードフローを返しました",providerAuthTimeout:"認証がタイムアウトしました。もう一度お試しください。",providerAccountRegistrationFailed:"認証済みアカウントを登録できませんでした",providerLostStatusEndpoint:"認証ステータスエンドポイントとの接続が失われました",providerUnknown:"不明なプロバイダーです: {{provider}}",providerStartOAuthFailed:"OAuth を開始できませんでした",providerCallbackFailed:"コールバック送信に失敗しました",providerSubmitCallbackFailed:"コールバックを送信できませんでした",loggingConfigSaved:"ログ設定を保存しました。",loggingConfigSaveFailed:"ログ設定の保存に失敗しました。",unifiedConfigUpdated:"設定を更新しました",migrationPreviewComplete:"移行プレビューが完了しました",migrationComplete:"移行が完了しました",migrationFailed:"移行に失敗しました",rollbackComplete:"ロールバックが完了しました",rollbackFailed:"ロールバックに失敗しました",defaultAccountSet:"デフォルトアカウントを「{{name}}」に設定しました",defaultAccountReset:"デフォルトアカウントを CCS に戻しました",accountDeleted:"アカウント「{{name}}」を削除しました",contextUpdated:"「{{name}}」のコンテキストを {{summary}} に更新しました",legacyConfirmError:"アカウント「{{name}}」は明示的な確認が必要です。このアカウントの「履歴同期を編集」を使用してください。",legacyConfirmFailed:"レガシーアカウント「{{name}}」の確認に失敗しました: {{error}}",legacyConfirmSuccess_one:"{{count}} 件のレガシーアカウントを確認しました",legacyConfirmSuccess_other:"{{count}} 件のレガシーアカウントを確認しました",legacyConfirmPartial:"{{updated}} 件のレガシーアカウントを確認しましたが、{{failed}} 件の更新に失敗しました。アカウント状態を再取得しました。",legacyConfirmAllFailed:"{{failed}} 件のレガシーアカウントの確認に失敗しました。アカウント状態を再取得しました。",noLegacyAccounts:"確認が必要なレガシーアカウントはありません",routingStrategySet:"ルーティング戦略を {{strategy}} に設定しました",variantCreated:"バリアントを作成しました",variantUpdated:"バリアントを更新しました",variantDeleted:"バリアントを削除しました",defaultAccountUpdated:"デフォルトアカウントを更新しました",accountRemoved:"アカウントを削除しました",accountPaused:"アカウントを一時停止しました",accountResumed:"アカウントを再開しました",accountAdded:"{{provider}} のアカウントを追加しました",kiroImported:"Kiro アカウントをインポートしました: {{name}}",kiroTokenImported:"Kiro トークンをインポートしました",modelUpdated:"モデルを更新しました",presetSaved:"プリセット「{{name}}」を保存しました",presetDeleted:"プリセットを削除しました",cliproxyAlreadyRunning:"CLIProxy はすでに稼働していました",cliproxyStarted:"CLIProxy を起動しました",cliproxyStartFailed:"CLIProxy の起動に失敗しました",cliproxyStopped:"CLIProxy を停止しました",cliproxyStopFailed:"CLIProxy の停止に失敗しました",presetApplied:"プリセット「{{name}}」を適用しました",presetAppliedCustom:"カスタムプリセットを適用しました",settingsSavedWithAdjustments:"設定を保存しました(モデル調整あり)",settingsSaved:"設定を保存しました",failedSaveSettings:"設定の保存に失敗しました",codexRefreshFailed:"Codex スナップショットの更新に失敗しました。Raw 編集は保持されました。",codexRefreshError:"Codex スナップショットの更新に失敗しました。",codexFixToml:"保存する前に TOML を修正してください。",codexSaved:"Codex config.toml を保存しました。",codexChangedExternally:"config.toml が外部で変更されました。更新して再試行してください。",codexSaveFailed:"Codex config.toml の保存に失敗しました。",codexUpdateFailed:"Codex 設定の更新に失敗しました。",noOrphanProfiles:"孤立プロファイル設定は見つかりませんでした",profilesRegistered:"{{count}} 件のプロファイルを登録しました{{skipped}}",destinationEmpty:"送信先プロファイル名は空にできません",profileExportDownloaded:"プロファイルエクスポートをダウンロードしました",profileImportFailed:"プロファイルバンドルのインポートに失敗しました"},providerConfig:{defaultDeviceCodeInstruction:"ブラウザーで認証を完了してください。",trackLabel:"トラック",sectionCoreLabel:"コア / オリジナル backend",sectionCoreHint:"既定で常に利用できるプロバイダートラック",sectionPlusLabel:"Plus 拡張 / コミュニティ保守",sectionPlusHint:"引き続きサポートされていますが、当面は既定の backend から分離されています",plusTrackNote:"このトラックはオプションの Plus backend が必要で、現在はコミュニティ保守です。"},updatesSpotlight:{openUpdatesCenter:"更新センターを開く"},userMenu:{signedInAs:"{{username}} としてサインイン中"},valueMetrics:{apiCostSaved:"API コスト削減",tokensSaved:"節約トークン",queriesFaster:"高速化されたクエリ",errorsReduced:"削減されたエラー",vsLastMonth:"前月比",throughCaching:"キャッシュによる",averageSpeedup:"平均高速化",withRetryLogic:"リトライロジックによる",performanceMetrics:"パフォーマンス指標",monthlySummary:"月間サマリー",totalSaved:"合計節約額",tokensProcessed:"処理トークン数",queriesHandled:"処理クエリ数",uptime:"稼働時間"}}}};re.isInitialized||re.use(Aj).init({resources:Bj,lng:jj(),fallbackLng:"en",interpolation:{escapeValue:!1}});const _j={theme:"system",setTheme:()=>null,isDark:!1},TO=A.createContext(_j);function Hj({children:n,defaultTheme:e="system",storageKey:t="vite-ui-theme"}){const[i,o]=A.useState(()=>localStorage.getItem(t)||e),[a,r]=A.useState(()=>typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches:!1);A.useEffect(()=>{const f=window.matchMedia("(prefers-color-scheme: dark)"),m=g=>{r(g.matches)};return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[]);const c=i==="dark"||i==="system"&&a;A.useEffect(()=>{const f=window.document.documentElement;f.classList.remove("light","dark"),f.classList.add(c?"dark":"light")},[c]);const d={theme:i,setTheme:f=>{localStorage.setItem(t,f),o(f)},isDark:c};return p.jsx(TO.Provider,{value:d,children:n})}const DO=A.createContext(null),Tk="ccs-privacy-mode";function Uj({children:n}){const[e,t]=A.useState(()=>typeof window<"u"?localStorage.getItem(Tk)==="true":!1);A.useEffect(()=>{localStorage.setItem(Tk,String(e))},[e]);const i=A.useCallback(()=>t(a=>!a),[]),o=A.useMemo(()=>({privacyMode:e,togglePrivacyMode:i}),[e,i]);return p.jsx(DO.Provider,{value:o,children:n})}function kb(){const n=A.useContext(DO);if(!n)throw new Error("usePrivacy must be used within a PrivacyProvider");return n}const MO="blur-[4px] select-none hover:blur-none transition-all duration-200",zj="/api/auth";async function wb(n,e){const t=await fetch(`${zj}${n}`,{headers:{"Content-Type":"application/json"},credentials:"include",...e});if(!t.ok){const i=await t.json().catch(()=>({error:"Unknown error"}));throw new Error(i.error||t.statusText)}return t.json()}function Fj(){return wb("/check")}function qj(n,e){return wb("/login",{method:"POST",body:JSON.stringify({username:n,password:e})})}function Gj(){return wb("/logout",{method:"POST"})}const NO=A.createContext(null);function Kj({children:n}){const[e,t]=A.useState(!1),[i,o]=A.useState(!1),[a,r]=A.useState(null),[c,d]=A.useState(!0),[f,m]=A.useState(!1),[g,x]=A.useState(!1),[v,C]=A.useState(!1),[k,w]=A.useState("login");A.useEffect(()=>{Fj().then(D=>{t(D.authRequired),o(D.authenticated),r(D.username),m(D.authEnabled),x(D.authConfigured),C(D.isLocalAccess),w(D.accessMode)}).catch(()=>{t(!0),o(!1),m(!0),x(!0),C(!1),w("login")}).finally(()=>d(!1))},[]);const P=A.useCallback(async(D,L)=>{const N=await qj(D,L);o(!0),r(N.username)},[]),T=A.useCallback(async()=>{await Gj(),o(!1),r(null)},[]),M=A.useMemo(()=>({authRequired:e,isAuthenticated:i,username:a,loading:c,authEnabled:f,authConfigured:g,isLocalAccess:v,accessMode:k,login:P,logout:T}),[e,i,a,c,f,g,v,k,P,T]);return p.jsx(NO.Provider,{value:M,children:n})}function Jh(){const n=A.useContext(NO);if(!n)throw new Error("useAuth must be used within an AuthProvider");return n}function Vj(){const{authRequired:n,isAuthenticated:e,loading:t}=Jh(),i=Kh();return t?p.jsx("div",{className:"flex h-screen items-center justify-center",children:p.jsx(hi,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):n?e?p.jsx(ey,{}):p.jsx(iO,{to:"/login",state:{from:i},replace:!0}):p.jsx(ey,{})}const ig=768;function Wj(){const[n,e]=A.useState(void 0);return A.useEffect(()=>{const t=window.matchMedia(`(max-width: ${ig-1}px)`),i=()=>{e(window.innerWidth<ig)};return t.addEventListener("change",i),e(window.innerWidth<ig),()=>t.removeEventListener("change",i)},[]),!!n}const LO=A.createContext(null);function Zh(){const n=A.useContext(LO);if(!n)throw new Error("useSidebar must be used within a SidebarProvider.");return n}function q(...n){return XE(JE(n))}function Sr(n){if(!Number.isFinite(n))return"0";const e=Math.max(0,Math.min(100,n));return`${Math.round(e)}`}const Dk=["#f94144","#f3722c","#f8961e","#f9844a","#f9c74f","#90be6d","#43aa8b","#4d908e","#577590","#277da1"],Ln={success:"#15803d",degraded:"#b45309",failed:"#b91c1c"};function H9(n){let e=2166136261;for(let t=0;t<n.length;t++)e^=n.charCodeAt(t),e=Math.imul(e,16777619);return Dk[(e>>>0)%Dk.length]}function ay(n){if(!n)return null;try{const e=new Date(n),t=new Date,i=e.getTime()-t.getTime();if(i<=0)return"soon";const o=Math.floor(i/(1e3*60*60));if(o>=24)return e.toLocaleDateString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"});const a=Math.floor(i%(1e3*60*60)/(1e3*60));return o>0?`in ${o}h ${a}m`:`in ${a}m`}catch{return null}}function Ab(n){return n.filter(e=>{const t=(e.displayName||e.name||"").toLowerCase();return t.includes("claude")||t.includes("gpt")})}function Qj(n){if(n.length===0)return null;const e=Ab(n);if(e.length===0)return 0;const t=e.map(i=>i.percentage).filter(i=>typeof i=="number"&&isFinite(i));return t.length===0?0:Math.min(...t)}function Yj(n){if(n.length===0)return null;const e=Ab(n);return e.length===0?null:e.reduce((t,i)=>i.resetTime?t?new Date(i.resetTime)<new Date(t)?i.resetTime:t:i.resetTime:t,null)}const $j=/claude-(?:opus|sonnet)-4(?:[.-])5(?:-thinking)?(?=(?:$|[^a-z0-9]))/i;function U9(n){return $j.test((n||"").trim())}const Xj=[{name:"claude-opus-4-6-thinking",displayName:"Claude Opus 4.6 (Thinking)"},{name:"claude-sonnet-4-6",displayName:"Claude Sonnet 4.6"},{name:"gpt-oss-120b",displayName:"GPT-OSS 120B (Medium)"}];function Jj(n){const e=n.toLowerCase();return e.includes("claude")||e.includes("gpt")?"primary":e.includes("gemini 3")||e.includes("gemini-3")?"gemini-3":e.includes("gemini 2")||e.includes("gemini-2")?"gemini-2":"other"}function Zj(n){if(n.length===0)return[];const e=Ab(n),t=[];if(e.length===0)for(const o of Xj)t.push({name:o.name,displayName:o.displayName,percentage:0,tier:"primary",exhausted:!0});for(const o of n){const a=o.displayName||o.name,r=Jj(a);t.push({name:o.name,displayName:a,percentage:o.percentage,tier:r,exhausted:r==="primary"&&o.percentage===0})}const i=["primary","gemini-3","gemini-2","other"];return t.sort((o,a)=>{const r=i.indexOf(o.tier)-i.indexOf(a.tier);return r!==0?r:o.displayName.localeCompare(a.displayName)})}function eI(n){const e=new Map;for(const t of n){const i=e.get(t.tier)||[];i.push(t),e.set(t.tier,i)}return e}function kr(n){if(typeof n=="object"&&n!==null){const e=n;return e.category==="additional"&&e.cadence?e.cadence==="weekly"?"additional-weekly":"additional-5h":e.category==="code-review"&&e.cadence?e.cadence==="weekly"?"code-review-weekly":"code-review-5h":e.category==="usage"&&e.cadence?e.cadence==="weekly"?"usage-weekly":"usage-5h":Mk(e.label)}return Mk(n)}function Mk(n){const e=(n||"").toLowerCase(),t=e.includes("code review")||e.includes("code_review"),i=e.includes("primary"),o=e.includes("secondary");return t?i?"code-review-5h":o?"code-review-weekly":"code-review":i?"usage-5h":o?"usage-weekly":"unknown"}function tI(n){const e=(n||"").trim();if(!e)return"";const t=e.replace(/^GPT-[\d.]+-Codex-/i,"");return t!==e&&t.length>0?`Codex ${t}`:e}function nI(n,e){if(kr(n)==="code-review-weekly")return"weekly";const i=n.resetAfterSeconds;if(typeof i!="number"||!isFinite(i)||i<=0)return null;const o=e.find(d=>kr(d)==="usage-5h"&&typeof d.resetAfterSeconds=="number"&&isFinite(d.resetAfterSeconds)&&d.resetAfterSeconds>0),a=e.find(d=>kr(d)==="usage-weekly"&&typeof d.resetAfterSeconds=="number"&&isFinite(d.resetAfterSeconds)&&d.resetAfterSeconds>0);if(!o||!a)return null;const r=Math.abs(i-o.resetAfterSeconds);return Math.abs(i-a.resetAfterSeconds)<=r?"weekly":"5h"}function iI(n,e=[]){const t=typeof n=="string"?n:n.label,i=typeof n=="string"?{label:t,resetAfterSeconds:null}:{label:t,resetAfterSeconds:n.resetAfterSeconds,category:n.category,cadence:n.cadence,featureLabel:n.featureLabel},o=e.length>0?e:[i];switch(kr(i)){case"usage-5h":return re.t("quotaTooltip.fiveHourLimit");case"usage-weekly":return re.t("quotaTooltip.weeklyLimit");case"code-review-5h":case"code-review-weekly":case"code-review":{const a=nI(i,o);return a==="5h"?re.t("utils.codeReview5h"):a==="weekly"?re.t("utils.codeReviewWeekly"):re.t("utils.codeReview")}case"additional-5h":case"additional-weekly":{const r=tI(i.featureLabel??"")||t,c=kr(i);return c==="additional-5h"?re.t("utils.codexAdditional5h",{name:r}):c==="additional-weekly"?re.t("utils.codexAdditionalWeekly",{name:r}):re.t("utils.codexAdditional",{name:r})}case"unknown":return t}}function ef(n){if(!n||n.length===0)return{fiveHourWindow:null,weeklyWindow:null,codeReviewWindows:[],additionalWindows:[],unknownWindows:[]};let e=null,t=null;const i=[],o=[],a=[],r=[];if(n.some(d=>!!d.category))for(const d of n)d.category==="usage"?(d.cadence==="5h"&&!e?e=d:d.cadence==="weekly"&&!t&&(t=d),r.push(d)):d.category==="code-review"?i.push(d):d.category==="additional"?o.push(d):(a.push(d),r.push(d));else for(const d of n)switch(kr(d.label)){case"usage-5h":e||(e=d),r.push(d);break;case"usage-weekly":t||(t=d),r.push(d);break;case"code-review-5h":case"code-review-weekly":case"code-review":i.push(d);break;case"additional-5h":case"additional-weekly":o.push(d);break;case"unknown":a.push(d),r.push(d);break}if((!e||!t)&&r.length>0){const d=r.filter(f=>typeof f.resetAfterSeconds=="number"&&f.resetAfterSeconds>=0).sort((f,m)=>(f.resetAfterSeconds||0)-(m.resetAfterSeconds||0));e||(e=d[0]||r[0]||null),t||(t=d.length>1?d[d.length-1]:r.find(f=>f!==e)||null)}return{fiveHourWindow:e,weeklyWindow:t,codeReviewWindows:i,additionalWindows:o,unknownWindows:a}}function oI(n){if(!n||n.length===0)return null;const{fiveHourWindow:e,weeklyWindow:t}=ef(n),i=[e,t].filter((r,c,d)=>!!r&&d.indexOf(r)===c),a=(i.length>0?i:n).map(r=>r.remainingPercent);return Math.min(...a)}function sI(n){if(!n||n.length===0)return null;const{fiveHourWindow:e,weeklyWindow:t}=ef(n),i=[e,t].filter((r,c,d)=>!!r&&d.indexOf(r)===c),a=(i.length>0?i:n).map(r=>r.resetAt).filter(r=>r!==null);return a.length===0?null:a.sort()[0]}function aI(n){if(!n.success)return null;const e=[n.coreUsage?.fiveHour,n.coreUsage?.weekly].filter(i=>!!i);if(e.length>0)return Math.min(...e.map(i=>i.remainingPercent));const t=n.windows.filter(i=>i.rateLimitType!=="overage");return t.length>0?Math.min(...t.map(i=>i.remainingPercent)):null}function rI(n){if(!n.success)return null;const e=[n.coreUsage?.fiveHour?.resetAt,n.coreUsage?.weekly?.resetAt].filter(i=>!!i);if(e.length>0)return e.sort()[0];const t=n.windows.filter(i=>i.rateLimitType!=="overage").map(i=>i.resetAt).filter(i=>i!==null);return t.length===0?null:t.sort()[0]}function lI(n){if(!n||n.length===0)return null;const e=n.map(t=>t.remainingPercent);return Math.min(...e)}function cI(n){if(!n||n.length===0)return null;const e=n.map(t=>t.resetTime).filter(t=>t!==null);return e.length===0?null:e.sort()[0]}function uI(n){if(!n)return null;const e=[n.premiumInteractions,n.chat,n.completions].filter(t=>t.reported!==!1).map(t=>t.unlimited?100:t.percentRemaining).filter(t=>typeof t=="number"&&isFinite(t));return e.length===0?null:Math.min(...e)}function Vi(n){return typeof n=="object"&&n!==null}function fa(n){return typeof n=="number"&&Number.isFinite(n)}function Ob(n){if(!Vi(n))return!1;const e=n.models;return typeof n.success=="boolean"&&Array.isArray(e)}function tf(n){if(!Vi(n))return!1;const e=n;return typeof e.success!="boolean"||!Array.isArray(e.windows)||!("planType"in e)?!1:e.windows.every(t=>Vi(t)&&typeof t.label=="string"&&fa(t.usedPercent)&&fa(t.remainingPercent))}function nf(n){if(!Vi(n))return!1;const e=n;return typeof e.success!="boolean"||!Array.isArray(e.windows)||"planType"in e?!1:e.windows.every(t=>Vi(t)&&typeof t.rateLimitType=="string"&&fa(t.remainingPercent)&&typeof t.status=="string")}function Pb(n){if(!Vi(n))return!1;const e=n;return typeof e.success!="boolean"||!Array.isArray(e.buckets)?!1:e.buckets.every(t=>Vi(t)&&typeof t.id=="string"&&fa(t.remainingFraction)&&fa(t.remainingPercent)&&Array.isArray(t.modelIds))}function Tb(n){if(!Vi(n))return!1;const e=n,t=e.snapshots;return typeof e.success!="boolean"||!Vi(t)?!1:["premiumInteractions","chat","completions"].every(o=>{const a=t[o];return Vi(a)&&fa(a.percentRemaining)&&fa(a.percentUsed)})}function dI(n){const e=[];return typeof n.httpStatus=="number"&&e.push(`HTTP ${n.httpStatus}`),typeof n.errorCode=="string"&&n.errorCode.trim()&&e.push(n.errorCode.trim()),e.length>0?e.join(" | "):null}function hI(n,e,t){const i=n.errorDetail?.trim()||null;if(!i)return null;const o=i.toLowerCase();return o===e.toLowerCase()||t&&o===t.toLowerCase()?null:i}function Db(n){if(!n||n.success)return null;const e=n.error?.trim()||"Quota information unavailable",t=n.actionHint?.trim()||null,i=n.errorCode?.trim().toLowerCase()||"",o=dI(n),a=hI(n,e,o),r=e.toLowerCase(),c="entitlement"in n?n.entitlement:void 0;return n.errorCode==="capacity_exhausted"||c?.capacityState==="capacity_exhausted"||r.includes("no capacity available")||r.includes("capacity exhausted")?{label:"Capacity",summary:e,actionHint:t||"Retry later or switch to another model. This is a temporary provider capacity issue.",technicalDetail:o,rawDetail:a,tone:"warning"}:n.needsReauth||i==="token_expired"||i==="reauth_required"||r.includes("token expired")||r.includes("re-authenticate")||r.includes("reauth")||r.includes("expired or invalid")?{label:re.t("accountCard.failureLabelReauth"),summary:e,actionHint:t||re.t("accountCard.failureHintReauth"),technicalDetail:o,rawDetail:a,tone:"warning"}:i==="deactivated_workspace"||n.httpStatus===402||r.includes("workspace deactivated")||r.includes("payment or workspace access required")?{label:re.t("accountCard.failureLabelWorkspace"),summary:e,actionHint:t||re.t("accountCard.failureHintWorkspace"),technicalDetail:o,rawDetail:a,tone:"warning"}:c?.accessState==="not_entitled"||n.isForbidden||n.httpStatus===403||i==="quota_api_forbidden"||r.includes("forbidden")?{label:re.t("accountCard.failureLabelNoAccess"),summary:e,actionHint:t||re.t("accountCard.failureHintNoAccess"),technicalDetail:o,rawDetail:a,tone:"muted"}:n.httpStatus===429||i==="rate_limited"||r.includes("rate limited")?{label:re.t("accountCard.failureLabelRetry"),summary:e,actionHint:t||re.t("accountCard.failureHintRetry"),technicalDetail:o,rawDetail:a,tone:"warning"}:i==="auth_file_missing"||i==="missing_account_id"||r.includes("auth file not found")||r.includes("missing chatgpt-account-id")?{label:re.t("accountCard.failureLabelReconnect"),summary:e,actionHint:t||re.t("accountCard.failureHintReconnect"),technicalDetail:o,rawDetail:a,tone:"muted"}:n.retryable||i==="network_timeout"||i==="network_error"||i==="provider_unavailable"||r.includes("timeout")||r.includes("network")||r.includes("fetch failed")||r.includes("service unavailable")?{label:re.t("accountCard.failureLabelTemporary"),summary:e,actionHint:t||re.t("accountCard.failureHintTemporary"),technicalDetail:o,rawDetail:a,tone:"warning"}:{label:re.t("accountCard.failureLabelUnavailable"),summary:e,actionHint:t,technicalDetail:o,rawDetail:a,tone:"muted"}}function RO(n,e){if(!e?.success)return null;switch(n.trim().toLowerCase()){case"agy":return Ob(e)?Qj(e.models):null;case"codex":return tf(e)?oI(e.windows):null;case"claude":case"anthropic":return nf(e)?aI(e):null;case"gemini":return Pb(e)?lI(e.buckets):null;case"ghcp":case"github-copilot":return Tb(e)?uI(e.snapshots):null;default:return null}}function EO(n,e){if(!e?.success)return null;switch(n.trim().toLowerCase()){case"agy":return Ob(e)?Yj(e.models):null;case"codex":return tf(e)?sI(e.windows):null;case"claude":case"anthropic":return nf(e)?rI(e):null;case"gemini":return Pb(e)?cI(e.buckets):null;case"ghcp":case"github-copilot":return Tb(e)?e.quotaResetDate:null;default:return null}}const Xd=$h("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-1 focus-visible:ring-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function gt({className:n,variant:e,size:t,asChild:i=!1,...o}){const a=i?Gh:"button";return p.jsx(a,{"data-slot":"button",className:q(Xd({variant:e,size:t,className:n})),...o})}function Ii({className:n,type:e,...t}){return p.jsx("input",{type:e,"data-slot":"input",className:q("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n),...t})}function fI({...n}){return p.jsx(IA,{"data-slot":"sheet",...n})}function pI({...n}){return p.jsx(zA,{"data-slot":"sheet-portal",...n})}function mI({className:n,...e}){return p.jsx(FA,{"data-slot":"sheet-overlay",className:q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...e})}function gI({className:n,children:e,side:t="right",...i}){return p.jsxs(pI,{children:[p.jsx(mI,{}),p.jsxs(BA,{"data-slot":"sheet-content",className:q("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",t==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",t==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",t==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",t==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",n),...i,children:[e,p.jsxs(_A,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[p.jsx(Gr,{className:"size-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function yI({className:n,...e}){return p.jsx("div",{"data-slot":"sheet-header",className:q("flex flex-col gap-1.5 p-4",n),...e})}function bI({className:n,...e}){return p.jsx(HA,{"data-slot":"sheet-title",className:q("text-foreground font-semibold",n),...e})}function xI({className:n,...e}){return p.jsx(UA,{"data-slot":"sheet-description",className:q("text-muted-foreground text-sm",n),...e})}function tt({className:n,...e}){return p.jsx("div",{"data-slot":"skeleton",className:q("relative overflow-hidden bg-muted/50 before:absolute before:inset-0 before:-translate-x-full","before:bg-gradient-to-r before:from-transparent before:via-muted/30 before:to-transparent","before:animate-[shimmer_2s_infinite_ease-out] rounded-md",n),...e})}function pa({delayDuration:n=0,...e}){return p.jsx(NR,{"data-slot":"tooltip-provider",delayDuration:n,...e})}function Do({...n}){return p.jsx(pa,{children:p.jsx(LR,{"data-slot":"tooltip",...n})})}function Mo({...n}){return p.jsx(RR,{"data-slot":"tooltip-trigger",...n})}function No({className:n,sideOffset:e=6,children:t,...i}){return p.jsx(ER,{children:p.jsxs(jR,{"data-slot":"tooltip-content",sideOffset:e,className:q("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit max-w-[calc(100vw-2rem)] origin-(--radix-tooltip-content-transform-origin) rounded-lg border border-border/70 bg-popover px-3 py-2 text-left text-xs leading-relaxed text-popover-foreground shadow-xl shadow-black/10",n),...i,children:[t,p.jsx(IR,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 fill-popover stroke-border stroke-[0.75px]"})]})})}const vI="sidebar_state",CI=3600*24*7,SI="16rem",kI="18rem",wI="3rem",AI="b";function OI({defaultOpen:n=!0,open:e,onOpenChange:t,className:i,style:o,children:a,...r}){const c=Wj(),[d,f]=A.useState(!1),[m,g]=A.useState(n),x=e??m,v=A.useCallback(P=>{const T=typeof P=="function"?P(x):P;t?t(T):g(T),document.cookie=`${vI}=${T}; path=/; max-age=${CI}`},[t,x]),C=A.useCallback(()=>c?f(P=>!P):v(P=>!P),[c,v,f]);A.useEffect(()=>{const P=T=>{T.key===AI&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),C())};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[C]);const k=x?"expanded":"collapsed",w=A.useMemo(()=>({state:k,open:x,setOpen:v,isMobile:c,openMobile:d,setOpenMobile:f,toggleSidebar:C}),[k,x,v,c,d,f,C]);return p.jsx(LO.Provider,{value:w,children:p.jsx(pa,{delayDuration:0,children:p.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":SI,"--sidebar-width-icon":wI,...o},className:q("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-svh min-h-0 w-full overflow-hidden",i),...r,children:a})})})}function PI({side:n="left",variant:e="sidebar",collapsible:t="offcanvas",className:i,children:o,...a}){const{isMobile:r,state:c,openMobile:d,setOpenMobile:f}=Zh();return t==="none"?p.jsx("div",{"data-slot":"sidebar",className:q("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",i),...a,children:o}):r?p.jsx(fI,{open:d,onOpenChange:f,...a,children:p.jsxs(gI,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":kI},side:n,children:[p.jsxs(yI,{className:"sr-only",children:[p.jsx(bI,{children:"Sidebar"}),p.jsx(xI,{children:"Displays the mobile sidebar."})]}),p.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):p.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":c,"data-collapsible":c==="collapsed"?t:"","data-variant":e,"data-side":n,"data-slot":"sidebar",children:[p.jsx("div",{"data-slot":"sidebar-gap",className:q("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),p.jsx("div",{"data-slot":"sidebar-container",className:q("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",n==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...a,children:p.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function TI({className:n,onClick:e,...t}){const{toggleSidebar:i}=Zh();return p.jsxs(gt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:q("size-7",n),onClick:o=>{e?.(o),i()},...t,children:[p.jsx(yE,{}),p.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function DI({className:n,...e}){return p.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:q("flex flex-col gap-2 p-2",n),...e})}function MI({className:n,...e}){return p.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:q("flex flex-col gap-2 p-2",n),...e})}function NI({className:n,...e}){return p.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:q("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),...e})}function LI({className:n,...e}){return p.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:q("relative flex w-full min-w-0 flex-col p-2",n),...e})}function RI({className:n,asChild:e=!1,...t}){const i=e?Gh:"div";return p.jsx(i,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:q("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",n),...t})}function EI({className:n,...e}){return p.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:q("w-full text-sm",n),...e})}function jI({className:n,...e}){return p.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:q("flex w-full min-w-0 flex-col gap-1 group-data-[collapsible=icon]:items-center",n),...e})}function II({className:n,...e}){return p.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:q("group/menu-item relative",n),...e})}const BI=$h("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 group-data-[collapsible=icon]:justify-center",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Nk({asChild:n=!1,isActive:e=!1,variant:t="default",size:i="default",tooltip:o,className:a,...r}){const c=n?Gh:"button",{isMobile:d,state:f}=Zh(),m=p.jsx(c,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":i,"data-active":e,className:q(BI({variant:t,size:i}),a),...r});return o?(typeof o=="string"&&(o={children:o}),p.jsxs(Do,{children:[p.jsx(Mo,{asChild:!0,children:m}),p.jsx(No,{side:"right",align:"center",hidden:f!=="collapsed"||d,...o})]})):m}function _I({className:n,...e}){return p.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:q("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",n),...e})}function HI({className:n,...e}){return p.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:q("group/menu-sub-item relative",n),...e})}function UI({asChild:n=!1,size:e="md",isActive:t=!1,className:i,...o}){const a=n?Gh:"a";return p.jsx(a,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":e,"data-active":t,className:q("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",i),...o})}const zI={sm:24,md:32,lg:48};function jO({size:n="md",className:e,showText:t=!0}){const{t:i}=Ce(),o=zI[n];return p.jsxs("div",{className:q("flex items-center gap-2",e),children:[p.jsx("img",{src:"/logo/ccs-logo-256.png",alt:i("ccsLogo.alt"),width:o,height:o,className:"rounded"}),t&&p.jsx("span",{className:"font-bold text-lg",children:i("ccsLogo.text")})]})}const kd="/api",IO="CONFLICT";class z9 extends Error{code=IO;constructor(e="Resource modified externally"){super(e),this.name="ApiConflictError"}}function F9(n){return n instanceof Error&&"code"in n&&n.code===IO}function $l(n){return n?/^https?:\/\//i.test(n)||n===kd||n.startsWith(`${kd}/`)?n:`${kd}${n.startsWith("/")?n:`/${n}`}`:kd}async function FI(n){const e=`Request failed (${n.status}${n.statusText?` ${n.statusText}`:""})`,t=await n.text();if(!t)return e;try{const i=JSON.parse(t);return i.error?.trim()?i.error:i.message?.trim()?i.message:e}catch{return t.trim()||e}}async function ce(n,e){const t=await fetch($l(n),{headers:{"Content-Type":"application/json"},...e});if(!t.ok)throw new Error(await FI(t));if(t.status===204)return;if((t.headers.get("content-type")?.toLowerCase()??"").includes("application/json"))return await t.json();const o=await t.text();if(o)try{return JSON.parse(o)}catch{return o}}const Ue={profiles:{list:()=>ce("/profiles"),getLocalRuntimeReadiness:()=>ce("/profiles/local-runtime-readiness"),create:n=>ce("/profiles",{method:"POST",body:JSON.stringify(n)}),update:(n,e)=>ce(`/profiles/${n}`,{method:"PUT",body:JSON.stringify(e)}),delete:n=>ce(`/profiles/${n}`,{method:"DELETE"}),discoverOrphans:()=>ce("/profiles/orphans"),registerOrphans:n=>ce("/profiles/orphans/register",{method:"POST",body:JSON.stringify(n)}),copy:(n,e)=>ce(`/profiles/${n}/copy`,{method:"POST",body:JSON.stringify(e)}),export:(n,e=!1)=>ce(`/profiles/${n}/export`,{method:"POST",body:JSON.stringify({includeSecrets:e})}),import:n=>ce("/profiles/import",{method:"POST",body:JSON.stringify(n)})},imageAnalysis:{get:()=>ce("/image-analysis"),update:n=>ce("/image-analysis",{method:"PUT",body:JSON.stringify(n)})},browser:{get:()=>ce("/browser"),getStatus:()=>ce("/browser/status"),update:n=>ce("/browser",{method:"PUT",body:JSON.stringify(n)})},logs:{getConfig:()=>ce("/logs/config"),updateConfig:n=>ce("/logs/config",{method:"PUT",body:JSON.stringify(n)}),getSources:()=>ce("/logs/sources"),getEntries:({source:n,level:e,search:t,limit:i}={})=>{const o=new URLSearchParams;n&&o.set("source",n),e&&o.set("level",e),t&&o.set("search",t),typeof i=="number"&&o.set("limit",String(i));const a=o.toString();return ce(`/logs/entries${a?`?${a}`:""}`)}},cliproxy:{list:()=>ce("/cliproxy"),getAuthStatus:()=>ce("/cliproxy/auth"),create:n=>ce("/cliproxy",{method:"POST",body:JSON.stringify(n)}),update:(n,e)=>ce(`/cliproxy/${n}`,{method:"PUT",body:JSON.stringify(e)}),delete:n=>ce(`/cliproxy/${n}`,{method:"DELETE"}),proxyStatus:()=>ce("/cliproxy/proxy-status"),proxyStart:()=>ce("/cliproxy/proxy-start",{method:"POST"}),proxyStop:()=>ce("/cliproxy/proxy-stop",{method:"POST"}),updateCheck:()=>ce("/cliproxy/update-check"),versions:()=>ce("/cliproxy/versions"),install:(n,e)=>ce("/cliproxy/install",{method:"POST",body:JSON.stringify({version:n,force:e})}),restart:()=>ce("/cliproxy/restart",{method:"POST"}),stats:()=>ce("/cliproxy/usage"),catalog:()=>ce("/cliproxy/catalog"),models:()=>ce("/cliproxy/models"),updateModel:(n,e)=>ce(`/cliproxy/models/${n}`,{method:"PUT",body:JSON.stringify({model:e})}),getRoutingStrategy:()=>ce("/cliproxy/routing/strategy"),updateRoutingStrategy:n=>ce("/cliproxy/routing/strategy",{method:"PUT",body:JSON.stringify({value:n})}),getSessionAffinity:()=>ce("/cliproxy/routing/session-affinity"),updateSessionAffinity:n=>ce("/cliproxy/routing/session-affinity",{method:"PUT",body:JSON.stringify(n)}),aiProviders:{list:()=>ce("/cliproxy/ai-providers"),create:(n,e)=>ce(`/cliproxy/ai-providers/${encodeURIComponent(n)}`,{method:"POST",body:JSON.stringify(e)}),update:(n,e,t)=>ce(`/cliproxy/ai-providers/${encodeURIComponent(n)}/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),delete:(n,e)=>ce(`/cliproxy/ai-providers/${encodeURIComponent(n)}/${encodeURIComponent(e)}`,{method:"DELETE"})},getConfigYaml:async()=>{const n=await fetch($l("/cliproxy/config.yaml"));if(!n.ok)throw new Error("Failed to load config");return n.text()},saveConfigYaml:async n=>{const e=await fetch($l("/cliproxy/config.yaml"),{method:"PUT",headers:{"Content-Type":"application/yaml"},body:n});if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to save config"}));throw new Error(t.error||"Failed to save config")}},getAuthFiles:()=>ce("/cliproxy/auth-files"),getAuthFile:async n=>{const e=await fetch($l(`/cliproxy/auth-files/download?name=${encodeURIComponent(n)}`));if(!e.ok)throw new Error("Failed to load auth file");return e.text()},accounts:{list:()=>ce("/cliproxy/auth/accounts"),listByProvider:n=>ce(`/cliproxy/auth/accounts/${n}`),setDefault:(n,e)=>ce(`/cliproxy/auth/accounts/${n}/default`,{method:"POST",body:JSON.stringify({accountId:e})}),remove:(n,e)=>ce(`/cliproxy/auth/accounts/${n}/${encodeURIComponent(e)}`,{method:"DELETE"}),pause:(n,e)=>ce(`/cliproxy/auth/accounts/${n}/${encodeURIComponent(e)}/pause`,{method:"POST"}),resume:(n,e)=>ce(`/cliproxy/auth/accounts/${n}/${encodeURIComponent(e)}/resume`,{method:"POST"}),solo:(n,e)=>ce("/accounts/solo",{method:"POST",body:JSON.stringify({provider:n,accountId:e})}),bulkPause:(n,e)=>ce("/accounts/bulk-pause",{method:"POST",body:JSON.stringify({provider:n,accountIds:e})}),bulkResume:(n,e)=>ce("/accounts/bulk-resume",{method:"POST",body:JSON.stringify({provider:n,accountIds:e})})},auth:{start:(n,e)=>ce(`/cliproxy/auth/${n}/start`,{method:"POST",body:JSON.stringify({nickname:e})}),cancel:n=>ce(`/cliproxy/auth/${n}/cancel`,{method:"POST"}),kiroImport:()=>ce("/cliproxy/auth/kiro/import",{method:"POST"})},errorLogs:{list:()=>ce("/cliproxy/error-logs"),getContent:async n=>{const e=await fetch($l(`/cliproxy/error-logs/${encodeURIComponent(n)}`));if(!e.ok)throw new Error("Failed to load error log");return e.text()}}},accounts:{list:()=>ce("/accounts"),setDefault:n=>ce("/accounts/default",{method:"POST",body:JSON.stringify({name:n})}),resetDefault:()=>ce("/accounts/reset-default",{method:"DELETE"}),delete:n=>ce(`/accounts/${n}`,{method:"DELETE"}),updateContext:(n,e)=>ce(`/accounts/${encodeURIComponent(n)}/context`,{method:"PUT",body:JSON.stringify(e)}),updateSharedResources:(n,e)=>ce(`/accounts/${encodeURIComponent(n)}/shared-resources`,{method:"PUT",body:JSON.stringify(e)})},config:{format:()=>ce("/config/format"),get:()=>ce("/config"),update:n=>ce("/config",{method:"PUT",body:JSON.stringify(n)}),migrate:(n=!1)=>ce(`/config/migrate?dryRun=${n}`,{method:"POST"}),rollback:n=>ce("/config/rollback",{method:"POST",body:JSON.stringify({backupPath:n})})},presets:{list:n=>ce(`/settings/${n}/presets`),create:(n,e)=>ce(`/settings/${n}/presets`,{method:"POST",body:JSON.stringify(e)}),delete:(n,e)=>ce(`/settings/${n}/presets/${encodeURIComponent(e)}`,{method:"DELETE"})},cliproxyServer:{get:()=>ce("/cliproxy-server"),update:n=>ce("/cliproxy-server",{method:"PUT",body:JSON.stringify(n)}),getBackend:()=>ce("/cliproxy-server/backend"),updateBackend:(n,e=!1)=>ce("/cliproxy-server/backend",{method:"PUT",body:JSON.stringify({backend:n,force:e})}),test:n=>ce("/cliproxy-server/test",{method:"POST",body:JSON.stringify(n)})},quota:{get:(n,e)=>ce(`/cliproxy/quota/${n}/${encodeURIComponent(e)}`),getCodex:n=>ce(`/cliproxy/quota/codex/${encodeURIComponent(n)}`),getClaude:n=>ce(`/cliproxy/quota/claude/${encodeURIComponent(n)}`),getGemini:n=>ce(`/cliproxy/quota/gemini/${encodeURIComponent(n)}`)}};function qI(n){n.invalidateQueries({queryKey:["cliproxy-catalog"]}),n.invalidateQueries({queryKey:["cliproxy-models"]}),n.invalidateQueries({queryKey:["cliproxy-session-affinity"]})}function jo(n){n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),qI(n)}function q9(){return It({queryKey:["cliproxy"],queryFn:()=>Ue.cliproxy.list()})}function GI(){return It({queryKey:["cliproxy-auth"],queryFn:()=>Ue.cliproxy.getAuthStatus()})}function G9(){return It({queryKey:["cliproxy-catalog"],queryFn:()=>Ue.cliproxy.catalog(),staleTime:3e4,retry:1})}function K9(){return It({queryKey:["cliproxy-routing"],queryFn:()=>Ue.cliproxy.getRoutingStrategy()})}function V9(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.cliproxy.updateRoutingStrategy(t),onSuccess:t=>{n.invalidateQueries({queryKey:["cliproxy-routing"]}),fe.success(t.message||e("toasts.routingStrategySet",{strategy:t.strategy}))},onError:t=>{fe.error(t.message)}})}function W9(){return It({queryKey:["cliproxy-session-affinity"],queryFn:()=>Ue.cliproxy.getSessionAffinity()})}function Q9(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.cliproxy.updateSessionAffinity(t),onSuccess:t=>{n.setQueryData(["cliproxy-session-affinity"],t),n.invalidateQueries({queryKey:["cliproxy-session-affinity"]});const i=t.enabled?e("routingGuidance.sessionAffinityEnabled"):e("routingGuidance.sessionAffinityDisabled");fe.success(t.message||e("toasts.sessionAffinityUpdated",{state:i.toLowerCase()}))},onError:t=>{fe.error(t.message)}})}function Y9(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.cliproxy.create(t),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy"]}),fe.success(e("toasts.variantCreated"))},onError:t=>{fe.error(t.message)}})}function $9(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.cliproxy.delete(t),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy"]}),fe.success(e("toasts.variantDeleted"))},onError:t=>{fe.error(t.message)}})}function X9(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({provider:t,accountId:i})=>Ue.cliproxy.accounts.setDefault(t,i),onSuccess:()=>{jo(n),fe.success(e("toasts.defaultAccountUpdated"))},onError:t=>{fe.error(t.message)}})}function J9(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({provider:t,accountId:i})=>Ue.cliproxy.accounts.remove(t,i),onSuccess:()=>{jo(n),fe.success(e("toasts.accountRemoved"))},onError:t=>{fe.error(t.message)}})}function KI(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({provider:t,accountId:i})=>Ue.cliproxy.accounts.pause(t,i),onSuccess:()=>{jo(n),n.invalidateQueries({queryKey:["cliproxy-stats"]}),fe.success(e("toasts.accountPaused"))},onError:t=>{fe.error(t.message)}})}function VI(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({provider:t,accountId:i})=>Ue.cliproxy.accounts.resume(t,i),onSuccess:()=>{jo(n),n.invalidateQueries({queryKey:["cliproxy-stats"]}),fe.success(e("toasts.accountResumed"))},onError:t=>{fe.error(t.message)}})}function Z9(){const n=bt();return ft({mutationFn:({provider:e,accountId:t})=>Ue.cliproxy.accounts.solo(e,t),onSuccess:e=>{jo(n),n.invalidateQueries({queryKey:["cliproxy-stats"]});const t=e.paused.length;fe.success(`Solo mode: paused ${t} other account${t!==1?"s":""}`)},onError:e=>{fe.error(e.message)}})}function WI(){const n=bt();return ft({mutationFn:({provider:e,accountIds:t})=>Ue.cliproxy.accounts.bulkPause(e,t),onSuccess:e=>{jo(n),n.invalidateQueries({queryKey:["cliproxy-stats"]}),fe.success(`Paused ${e.succeeded.length} account${e.succeeded.length!==1?"s":""}`),e.failed.length>0&&fe.warning(`${e.failed.length} account${e.failed.length!==1?"s":""} failed to pause`)},onError:e=>{fe.error(e.message)}})}function QI(){const n=bt();return ft({mutationFn:({provider:e,accountIds:t})=>Ue.cliproxy.accounts.bulkResume(e,t),onSuccess:e=>{jo(n),n.invalidateQueries({queryKey:["cliproxy-stats"]}),fe.success(`Resumed ${e.succeeded.length} account${e.succeeded.length!==1?"s":""}`),e.failed.length>0&&fe.warning(`${e.failed.length} account${e.failed.length!==1?"s":""} failed to resume`)},onError:e=>{fe.error(e.message)}})}function eW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({provider:t,nickname:i})=>Ue.cliproxy.auth.start(t,i),onSuccess:(t,i)=>{jo(n),fe.success(e("toasts.accountAdded",{provider:i.provider}))},onError:t=>{fe.error(t.message)}})}function tW(){return ft({mutationFn:n=>Ue.cliproxy.auth.cancel(n),onError:n=>{fe.error(n.message)}})}function nW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:()=>Ue.cliproxy.auth.kiroImport(),onSuccess:t=>{jo(n),t.account?fe.success(e("toasts.kiroImported",{name:t.account.email||t.account.id})):fe.success(e("toasts.kiroTokenImported"))},onError:t=>{fe.error(t.message)}})}function iW(){return It({queryKey:["cliproxy-models"],queryFn:()=>Ue.cliproxy.models()})}function oW(n){return It({queryKey:["presets",n],queryFn:()=>Ue.presets.list(n),enabled:!!n})}function sW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({profile:t,data:i})=>Ue.presets.create(t,i),onSuccess:(t,i)=>{n.invalidateQueries({queryKey:["presets",i.profile]}),fe.success(e("toasts.presetSaved",{name:i.data.name}))},onError:t=>{fe.error(t.message)}})}function aW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({profile:t,name:i})=>Ue.presets.delete(t,i),onSuccess:(t,i)=>{n.invalidateQueries({queryKey:["presets",i.profile]}),fe.success(e("toasts.presetDeleted"))},onError:t=>{fe.error(t.message)}})}function rW(){return It({queryKey:["proxy-status"],queryFn:()=>Ue.cliproxy.proxyStatus(),refetchInterval:3e4})}function lW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:()=>Ue.cliproxy.proxyStart(),onSuccess:t=>{n.invalidateQueries({queryKey:["proxy-status"]}),t.alreadyRunning?fe.info(e("toasts.cliproxyAlreadyRunning")):t.started?fe.success(e("toasts.cliproxyStarted")):fe.error(t.error||e("toasts.cliproxyStartFailed"))},onError:t=>{fe.error(t.message)}})}function cW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:()=>Ue.cliproxy.proxyStop(),onSuccess:t=>{n.invalidateQueries({queryKey:["proxy-status"]}),t.stopped?fe.success(`CLIProxy stopped${t.sessionCount?` (${t.sessionCount} session(s) disconnected)`:""}`):fe.error(t.error||e("toasts.cliproxyStopFailed"))},onError:t=>{fe.error(t.message)}})}function YI(){return It({queryKey:["cliproxy-update-check"],queryFn:()=>Ue.cliproxy.updateCheck(),staleTime:300*1e3,refetchInterval:300*1e3,refetchOnWindowFocus:!1,retry:!1})}function uW(){const n=bt();return ft({mutationKey:["update-backend"],mutationFn:({backend:e,force:t=!1})=>Ue.cliproxyServer.updateBackend(e,t),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-update-check"],refetchType:"all"}),n.invalidateQueries({queryKey:["cliproxy-versions"],refetchType:"all"}),n.invalidateQueries({queryKey:["cliproxy-server-config"],refetchType:"all"}),n.invalidateQueries({queryKey:["proxy-status"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),fe.success("Backend updated")},onError:e=>{e.message.includes("Proxy is running")?fe.error("Stop the proxy first to change backend"):fe.error(e.message)}})}function dW(){return It({queryKey:["cliproxy-versions"],queryFn:()=>Ue.cliproxy.versions(),staleTime:300*1e3,refetchOnWindowFocus:!1,retry:!1})}function hW(){const n=bt();return ft({mutationFn:({version:e,force:t})=>Ue.cliproxy.install(e,t),onSuccess:e=>{e.requiresConfirmation||(n.invalidateQueries({queryKey:["cliproxy-versions"]}),n.invalidateQueries({queryKey:["cliproxy-update-check"]}),n.invalidateQueries({queryKey:["proxy-status"]}),e.success?fe.success(e.message||`Installed v${e.version}`):fe.error(e.error||"Installation failed"))},onError:e=>{fe.error(e.message)}})}function fW(){const n=bt();return ft({mutationFn:()=>Ue.cliproxy.restart(),onSuccess:e=>{n.invalidateQueries({queryKey:["proxy-status"]}),e.success?fe.success(`Proxy restarted on port ${e.port}`):fe.error(e.error||"Restart failed")},onError:e=>{fe.error(e.message)}})}const $I=BR,XI=HR,JI=_R;function ZI(n){return[{title:n("nav.general"),items:[{path:"/",icon:bE,label:n("nav.home")},{path:"/analytics",icon:xE,label:n("nav.analytics")}]},{title:n("nav.identityAccess"),items:[{path:"/providers",icon:ty,label:n("nav.apiProfiles"),badge:{icons:["/icons/openrouter.svg","/assets/providers/alibabacloud-color.svg","/icons/ollama.svg"]}},{path:"/cliproxy",icon:sO,label:n("nav.cliproxyPlus"),isCollapsible:!0,children:[{path:"/cliproxy",label:n("nav.cliproxyOverview")},{path:"/cliproxy/ai-providers",icon:ty,label:"AI Providers"},{path:"/cliproxy/control-panel",icon:vE,label:n("nav.controlPanel")}]},{path:"/accounts",icon:rO,label:n("nav.accounts"),isCollapsible:!0,children:[{path:"/accounts",label:n("nav.allAccounts")},{path:"/shared",icon:aO,label:n("nav.sharedData")}]}]},{title:n("nav.compatibleClis"),items:[{path:"/claude-extension",icon:CE,label:n("nav.claudeExtension")},{path:"/codex",iconSrc:"/assets/sidebar/codex.svg",label:"Codex CLI"},{path:"/droid",icon:SE,label:n("nav.factoryDroid")}]},{title:n("nav.deprecated"),items:[{path:"/copilot",icon:lO,label:`${n("nav.githubCopilot")} (${n("nav.deprecated")})`},{path:"/legacy/cursor",iconSrc:"/assets/sidebar/cursor.svg",label:`${n("nav.cursorIde")} (Legacy)`}]},{title:n("nav.system"),items:[{path:"/health",icon:bc,label:n("nav.health")},{path:"/logs",icon:cO,label:n("nav.logs")},{path:"/settings",icon:kE,label:n("nav.settings")}]}]}function e5(){const{t:n}=Ce(),e=Kh(),t=yb(),{state:i}=Zh(),{data:o}=YI(),a=ZI(n),r=o?.backendLabel??"CLIProxy",c=x=>x.path==="/cliproxy"?r:x.label,d=x=>e.pathname===x,f=x=>x.some(v=>d(v.path)||e.pathname.startsWith(v.path+"/")),m=x=>x.path==="/accounts"?"/shared":x.path,g=x=>{if(x.iconSrc)return p.jsx("img",{src:x.iconSrc,alt:"",className:"w-4 h-4 object-contain"});if(x.icon){const v=x.icon;return p.jsx(v,{className:"w-4 h-4"})}return null};return p.jsxs(PI,{collapsible:"icon",children:[p.jsx(DI,{className:"h-12 flex items-center justify-center",children:p.jsx(jO,{size:"sm",showText:i==="expanded"})}),p.jsx(NI,{children:a.map((x,v)=>p.jsxs(LI,{children:[x.title&&p.jsx(RI,{children:x.title}),p.jsx(EI,{children:p.jsx(jI,{children:x.items.map(C=>p.jsx(II,{children:C.isCollapsible&&C.children?p.jsxs($I,{defaultOpen:f(C.children)||d(C.path),className:"group/collapsible",children:[p.jsx(XI,{asChild:!0,children:p.jsxs(Nk,{tooltip:c(C),isActive:f(C.children),onClick:()=>t(m(C)),children:[g(C),p.jsx("span",{className:"group-data-[collapsible=icon]:hidden",children:c(C)}),p.jsx(Vh,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 group-data-[collapsible=icon]:hidden"})]})}),p.jsx(JI,{children:p.jsx(_I,{children:C.children.map(k=>p.jsx(HI,{children:p.jsx(UI,{asChild:!0,isActive:d(k.path),children:p.jsx(uh,{to:k.path,children:p.jsx("span",{children:k.label})})})},k.path))})})]}):p.jsx(Nk,{asChild:!0,isActive:d(C.path),tooltip:c(C),children:p.jsxs(uh,{to:C.path,children:[g(C),p.jsx("span",{className:"group-data-[collapsible=icon]:hidden flex-1",children:c(C)}),C.badge&&p.jsxs(Do,{children:[p.jsx(Mo,{asChild:!0,children:p.jsxs("span",{className:q("group-data-[collapsible=icon]:hidden ml-auto flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded transition-colors",d(C.path)?"bg-white/92 border border-white/65 shadow-sm":"bg-accent/15 text-accent border border-accent/30 group-hover/menu-item:bg-sidebar-accent-foreground/20 group-hover/menu-item:text-sidebar-accent-foreground group-hover/menu-item:border-sidebar-accent-foreground/30"),children:[(C.badge.icons&&C.badge.icons.length>0?C.badge.icons:C.badge.icon?[C.badge.icon]:[]).map(k=>p.jsx("span",{className:q("inline-flex h-4 w-4 items-center justify-center rounded-[3px] border",d(C.path)?"bg-white border-black/10":"bg-background/80 border-border/40 group-hover/menu-item:bg-white/90"),children:p.jsx("img",{src:k,alt:"",className:"h-3 w-3 object-contain"})},k)),C.badge.text&&p.jsx("span",{className:"hidden sm:inline",children:C.badge.text})]})}),p.jsx(No,{side:"right",children:p.jsx("p",{children:n("nav.openrouterTooltip")})})]})]})})},C.path))})})]},x.title||v))}),p.jsx(MI,{className:"p-4 border-t flex items-center justify-center",children:p.jsx(TI,{})})]})}const Mb=()=>{const n=A.useContext(TO);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n};function t5(){const{theme:n,setTheme:e}=Mb(),{t}=Ce();return p.jsxs(gt,{variant:"ghost",size:"icon",onClick:()=>e(n==="dark"?"light":"dark"),children:[p.jsx(uO,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),p.jsx(dO,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),p.jsx("span",{className:"sr-only",children:t("themeToggle.srLabel")})]})}function n5(){const{privacyMode:n,togglePrivacyMode:e}=kb(),{t}=Ce();return p.jsxs(Do,{children:[p.jsx(Mo,{asChild:!0,children:p.jsx(gt,{variant:"ghost",size:"icon",onClick:e,className:q("h-8 w-8 transition-colors",n&&"text-amber-600 hover:text-amber-700 dark:text-amber-400"),children:n?p.jsx(Kc,{className:"h-4 w-4"}):p.jsx(Vc,{className:"h-4 w-4"})})}),p.jsx(No,{children:p.jsx("p",{children:t(n?"privacyToggle.modeOn":"privacyToggle.modeOff")})})]})}const i5="https://github.com/kaitranntt/ccs/issues";function o5(){const{t:n}=Ce();return p.jsx(gt,{variant:"ghost",size:"icon",asChild:!0,title:n("githubLink.title"),children:p.jsx("a",{href:i5,target:"_blank",rel:"noopener noreferrer",children:p.jsx(lO,{className:"w-4 h-4"})})})}const s5="https://docs.ccs.kaitran.ca";function a5(){const{t:n}=Ce();return p.jsx(gt,{variant:"ghost",size:"icon",asChild:!0,title:n("docsLink.title"),children:p.jsx("a",{href:s5,target:"_blank",rel:"noopener noreferrer",children:p.jsx(wE,{className:"w-4 h-4"})})})}function r5(){const{t:n}=Ce(),[e,t]=A.useState("disconnected"),[i,o]=A.useState(!1),a=A.useRef(null),r=bt(),c=A.useRef(0),d=5,f=A.useRef(null),m=A.useRef(()=>{}),g=A.useCallback(C=>{switch(C.type){case"connected":console.log("[WS] Server acknowledged connection");break;case"config-changed":r.invalidateQueries({queryKey:["profiles"]}),r.invalidateQueries({queryKey:["cliproxy"]}),fe.info(n("toasts.configUpdatedExternally"));break;case"settings-changed":r.invalidateQueries({queryKey:["profiles"]}),fe.info(n("toasts.settingsFileUpdated"));break;case"profiles-changed":r.invalidateQueries({queryKey:["accounts"]}),fe.info(n("toasts.accountsUpdated"));break;case"proxy-status-changed":r.invalidateQueries({queryKey:["proxy-status"]});break;case"pong":break;default:console.log(`[WS] Unknown message: ${C.type}`)}},[r,n]),x=A.useCallback(()=>{if(a.current?.readyState===WebSocket.OPEN)return;t("connecting");const C=window.location.protocol==="https:"?"wss:":"ws:",k=new WebSocket(`${C}//${window.location.host}/ws`);a.current=k,k.onopen=()=>{t("connected"),o(!1),c.current=0,console.log("[WS] Connected")},k.onmessage=w=>{try{const P=JSON.parse(w.data);g(P),window.dispatchEvent(new CustomEvent("ws-message",{detail:P}))}catch{console.log("[WS] Invalid message")}},k.onclose=()=>{if(t("disconnected"),a.current=null,c.current<d){o(!0);const w=Math.min(1e3*Math.pow(2,c.current),3e4);c.current++,console.log(`[WS] Reconnecting in ${w}ms (attempt ${c.current})`),f.current=setTimeout(()=>{m.current()},w)}else o(!1)},k.onerror=()=>{console.log("[WS] Connection error")}},[g]);m.current=x;const v=A.useCallback(()=>{c.current=d,o(!1),f.current&&(clearTimeout(f.current),f.current=null),a.current?.close()},[]);return A.useEffect(()=>(m.current(),()=>v()),[]),A.useEffect(()=>{const C=setInterval(()=>{a.current?.readyState===WebSocket.OPEN&&a.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>clearInterval(C)},[]),A.useMemo(()=>({status:e,isReconnecting:i,connect:x,disconnect:v}),[e,i,x,v])}function l5(){const{status:n,isReconnecting:e}=r5(),{t}=Ce(),o={connected:{icon:OE,color:"text-green-600",label:t("connectionIndicator.connected"),animate:!1},connecting:{icon:xc,color:"text-yellow-500",label:t("connectionIndicator.connecting"),animate:!0},disconnected:{icon:e?xc:AE,color:e?"text-amber-500":"text-red-500",label:t(e?"connectionIndicator.reconnecting":"connectionIndicator.disconnected"),animate:e}}[n],a=o.icon;return p.jsxs("div",{className:`flex items-center gap-1 text-sm ${o.color}`,children:[p.jsx(a,{className:`w-4 h-4 ${o.animate?"animate-spin":""}`}),p.jsx("span",{className:"hidden sm:inline",children:o.label})]})}function c5(){const[n,e]=A.useState(!1),{authEnabled:t,authConfigured:i,isLocalAccess:o,loading:a}=Jh(),{t:r}=Ce(),c=!o&&!t;if(n&&!c||a)return null;const d=c?"w-full border-t border-amber-200 bg-amber-50 px-4 py-2 text-amber-900 transition-colors duration-200 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-200":"w-full border-t border-yellow-200 bg-yellow-50 px-4 py-2 text-yellow-800 transition-colors duration-200 dark:border-yellow-800 dark:bg-yellow-900/20 dark:text-yellow-200",f=c?"text-amber-600 hover:bg-amber-100 hover:text-amber-800 dark:text-amber-400 dark:hover:bg-amber-800/30":"text-yellow-600 hover:bg-yellow-100 hover:text-yellow-800 dark:text-yellow-400 dark:hover:bg-yellow-800/30",m=c?p.jsx(p.Fragment,{children:i?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"hidden sm:inline",children:r("localhostDisclaimer.remoteReadonlyAuthDisabledLong")}),p.jsx("span",{className:"sm:hidden",children:r("localhostDisclaimer.remoteReadonlyAuthDisabledShort")})]}):p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"hidden sm:inline",children:r("localhostDisclaimer.remoteReadonlySetupLong")}),p.jsx("span",{className:"sm:hidden",children:r("localhostDisclaimer.remoteReadonlySetupShort")})]})}):p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"hidden sm:inline",children:r("localhostDisclaimer.localLong")}),p.jsx("span",{className:"sm:hidden",children:r("localhostDisclaimer.localShort")})]});return p.jsx("div",{className:d,children:p.jsxs("div",{className:"flex items-center justify-center gap-4",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[p.jsx(PE,{className:"w-4 h-4 flex-shrink-0"}),m]}),c?null:p.jsx("button",{onClick:()=>e(!0),className:`flex-shrink-0 rounded p-1 transition-colors ${f}`,"aria-label":r("localhostDisclaimer.dismiss"),children:p.jsx(Gr,{className:"w-4 h-4"})})]})})}const u5="https://claudekit.cc?ref=HMNKXOHN";function d5(){const{t:n}=Ce();return p.jsxs("a",{href:u5,target:"_blank",rel:"noopener noreferrer",className:q("group inline-flex items-center gap-2 px-3 py-1.5 rounded-lg","bg-accent/10 border-2 border-accent/40","hover:bg-accent hover:border-accent","transition-all duration-200 shadow-sm hover:shadow-md"),title:n("claudekitBadge.title"),children:[p.jsx("img",{src:"/logos/claudekit-logo.png",alt:n("claudekitBadge.alt"),className:"w-5 h-5"}),p.jsxs("span",{className:"flex items-baseline gap-1.5 whitespace-nowrap",children:[p.jsx("span",{className:q("text-[10px] font-medium uppercase tracking-wide","text-muted-foreground group-hover:text-accent-foreground/80","transition-colors"),children:n("claudekitBadge.poweredBy")}),p.jsx("span",{className:q("text-xs font-bold text-foreground","group-hover:text-accent-foreground","transition-colors"),children:n("claudekitBadge.claudekit")})]})]})}const h5="https://github.com/sponsors/kaitranntt";function f5(){const{t:n}=Ce();return p.jsxs("a",{href:h5,target:"_blank",rel:"noopener noreferrer",className:q("group inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg","bg-pink-500/10 border-2 border-pink-500/40","hover:bg-pink-400 hover:border-pink-400","transition-all duration-200 shadow-sm hover:shadow-md"),title:n("sponsorButton.title"),children:[p.jsx(TE,{className:q("w-4 h-4 text-pink-500","group-hover:text-white group-hover:fill-white","group-hover:animate-pulse","transition-colors")}),p.jsx("span",{className:q("text-xs font-bold text-pink-600 dark:text-pink-300","group-hover:text-white dark:group-hover:text-white","transition-colors"),children:n("sponsorButton.sponsor")})]})}function Nb({...n}){return p.jsx(IA,{"data-slot":"dialog",...n})}function p5({...n}){return p.jsx(zA,{"data-slot":"dialog-portal",...n})}function m5({className:n,...e}){return p.jsx(FA,{"data-slot":"dialog-overlay",className:q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...e})}function Lb({className:n,children:e,showCloseButton:t=!0,...i}){return p.jsxs(p5,{"data-slot":"dialog-portal",children:[p.jsx(m5,{}),p.jsxs(BA,{"data-slot":"dialog-content",className:q("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",n),...i,children:[e,t&&p.jsxs(_A,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[p.jsx(Gr,{}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Rb({className:n,...e}){return p.jsx("div",{"data-slot":"dialog-header",className:q("flex flex-col gap-2 text-center sm:text-left",n),...e})}function g5({className:n,...e}){return p.jsx("div",{"data-slot":"dialog-footer",className:q("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...e})}function Eb({className:n,...e}){return p.jsx(HA,{"data-slot":"dialog-title",className:q("text-lg leading-none font-semibold",n),...e})}function jb({className:n,...e}){return p.jsx(UA,{"data-slot":"dialog-description",className:q("text-muted-foreground text-sm",n),...e})}function y5({open:n,onClose:e,sessionId:t,provider:i,projects:o,defaultProjectId:a,supportsAll:r,onSelect:c,timeoutSeconds:d=30}){const[f,m]=A.useState(a),[g,x]=A.useState(!1),[v,C]=A.useState(d),{t:k}=Ce();A.useEffect(()=>{if(!n){C(d);return}const T=setInterval(()=>{C(M=>M<=1?(clearInterval(T),w(!0),0):M-1)},1e3);return()=>clearInterval(T)},[n,d]),A.useEffect(()=>{n&&(m(a),x(!1),C(d))},[n,a,d]);const w=async(T=!1)=>{if(!g){x(!0);try{await c(T?"":f),e()}catch(M){console.error("Failed to submit project selection:",M);try{await c("")}catch{}e()}}},P=i.charAt(0).toUpperCase()+i.slice(1);return p.jsx(Nb,{open:n,onOpenChange:T=>!T&&!g&&e(),children:p.jsxs(Lb,{className:"sm:max-w-lg",children:[p.jsxs(Rb,{children:[p.jsxs(Eb,{className:"flex items-center gap-2",children:[p.jsx(aO,{className:"w-5 h-5"}),k("projectSelectionDialog.title")]}),p.jsxs(jb,{children:[k("projectSelectionDialog.description",{provider:P}),v>0&&p.jsx("span",{className:"text-muted-foreground ml-1",children:k("projectSelectionDialog.autoSelectCountdown",{count:v})})]})]}),p.jsxs("div",{className:"space-y-4 py-4",children:[p.jsxs("div",{className:"space-y-2",children:[o.map(T=>p.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${f===T.id?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!g&&m(T.id),children:[f===T.id?p.jsx($S,{className:"w-5 h-5 text-primary"}):p.jsx(XS,{className:"w-5 h-5 text-muted-foreground"}),p.jsxs("div",{className:"flex-1",children:[p.jsx("div",{className:"font-medium",children:T.name}),p.jsx("div",{className:"text-sm text-muted-foreground font-mono",children:T.id})]}),T.id===a&&p.jsx("span",{className:"text-xs px-2 py-1 bg-secondary rounded",children:k("projectSelectionDialog.default")})]},T.id)),r&&p.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${f==="ALL"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!g&&m("ALL"),children:[f==="ALL"?p.jsx($S,{className:"w-5 h-5 text-primary"}):p.jsx(XS,{className:"w-5 h-5 text-muted-foreground"}),p.jsxs("div",{className:"flex-1",children:[p.jsx("div",{className:"font-medium",children:k("projectSelectionDialog.allProjects")}),p.jsx("div",{className:"text-sm text-muted-foreground",children:k("projectSelectionDialog.allProjectsDescription",{count:o.length})})]})]})]}),p.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[p.jsx(gt,{variant:"ghost",onClick:()=>w(!0),disabled:g,children:k("projectSelectionDialog.useDefault")}),p.jsx(gt,{onClick:()=>w(!1),disabled:g,children:g?p.jsxs(p.Fragment,{children:[p.jsx(hi,{className:"w-4 h-4 mr-2 animate-spin"}),k("projectSelectionDialog.selecting")]}):p.jsxs(p.Fragment,{children:[p.jsx(Lr,{className:"w-4 h-4 mr-2"}),k("projectSelectionDialog.confirmSelection")]})})]})]})]})})}const Er={gemini:{displayName:"Google Gemini",description:"Gemini Pro/Flash models",oauthFlow:"authorization_code",callbackPort:8085,callbackProviderName:"gemini",authUrlProviderName:"gemini-cli",refreshOwnership:"cliproxy",authFilePrefixes:["gemini-","google-"],tokenTypeValues:["gemini"],aliases:["gemini-cli"]},codex:{displayName:"OpenAI Codex",description:"GPT-4 and codex models",oauthFlow:"authorization_code",callbackPort:1455,callbackProviderName:"codex",authUrlProviderName:"codex",refreshOwnership:"cliproxy",authFilePrefixes:["codex-","openai-"],tokenTypeValues:["codex"],aliases:[]},agy:{displayName:"Antigravity",description:"Antigravity AI models",oauthFlow:"authorization_code",callbackPort:51121,callbackProviderName:"antigravity",authUrlProviderName:"antigravity",refreshOwnership:"cliproxy",authFilePrefixes:["antigravity-","agy-"],tokenTypeValues:["antigravity"],aliases:["antigravity"]},qwen:{displayName:"Alibaba Qwen",description:"Qwen Code models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"qwen",authUrlProviderName:"qwen",refreshOwnership:"cliproxy",authFilePrefixes:["qwen-"],tokenTypeValues:["qwen"],aliases:[]},iflow:{displayName:"iFlow",description:"iFlow AI models",oauthFlow:"authorization_code",callbackPort:11451,callbackProviderName:"iflow",authUrlProviderName:"iflow",refreshOwnership:"cliproxy",authFilePrefixes:["iflow-"],tokenTypeValues:["iflow"],aliases:[]},kiro:{displayName:"Kiro (AWS)",description:"AWS CodeWhisperer models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"kiro",authUrlProviderName:"kiro",refreshOwnership:"cliproxy",authFilePrefixes:["kiro-","aws-","codewhisperer-"],tokenTypeValues:["kiro","codewhisperer"],aliases:["codewhisperer"]},ghcp:{displayName:"GitHub Copilot (OAuth)",description:"Deprecated GitHub Copilot compatibility via OAuth",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"copilot",authUrlProviderName:"github",refreshOwnership:"cliproxy",authFilePrefixes:["github-copilot-","copilot-","gh-"],tokenTypeValues:["github-copilot","copilot"],aliases:["github-copilot","copilot"]},claude:{displayName:"Claude (Anthropic)",description:"Claude Opus/Sonnet models",oauthFlow:"authorization_code",callbackPort:54545,callbackProviderName:"anthropic",authUrlProviderName:"anthropic",refreshOwnership:"unsupported",authFilePrefixes:["claude-","anthropic-"],tokenTypeValues:["claude","anthropic"],aliases:["anthropic"]},kimi:{displayName:"Kimi (Moonshot)",description:"Moonshot AI K2/K2.5 models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"kimi",authUrlProviderName:"kimi",refreshOwnership:"cliproxy",authFilePrefixes:["kimi-"],tokenTypeValues:["kimi"],aliases:["moonshot"]},cursor:{displayName:"Cursor",description:"Cursor browser-authenticated provider",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"cursor",authUrlProviderName:"cursor",refreshOwnership:"cliproxy",authFilePrefixes:["cursor.","cursor-"],tokenTypeValues:["cursor"],aliases:[]},gitlab:{displayName:"GitLab Duo",description:"GitLab Duo with OAuth or PAT auth",oauthFlow:"authorization_code",callbackPort:17171,callbackProviderName:"gitlab",authUrlProviderName:"gitlab",refreshOwnership:"cliproxy",authFilePrefixes:["gitlab-"],tokenTypeValues:["gitlab"],aliases:["gitlab-duo"]},codebuddy:{displayName:"CodeBuddy (Tencent)",description:"Tencent CodeBuddy AI assistant",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"codebuddy",authUrlProviderName:"codebuddy",refreshOwnership:"cliproxy",authFilePrefixes:["codebuddy-"],tokenTypeValues:["codebuddy"],aliases:["tencent"]},kilo:{displayName:"Kilo AI",description:"Kilo AI coding assistant",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"kilo",authUrlProviderName:"kilo",refreshOwnership:"unsupported",authFilePrefixes:["kilo-"],tokenTypeValues:["kilo"],aliases:[]}},Ib=Object.freeze(Object.keys(Er)),b5=Object.freeze(["cursor"]),x5=new Set(b5),ry=Object.freeze(["agy","codex","claude","gemini","ghcp"]);new Set(ry);const v5=Object.freeze([...ry,...ry.flatMap(n=>Er[n].aliases),"all"].filter((n,e,t)=>t.indexOf(n)===e));v5.join(", ");new Set(Ib);function C5(n=Er){const e=new Map,t=Object.keys(n),i=(o,a)=>{const r=o.trim().toLowerCase();if(!r)return;const c=e.get(r);if(c&&c!==a)throw new Error(`Provider alias collision for "${r}": ${c} and ${a}`);e.set(r,a)};for(const o of t){i(o,o);for(const a of n[o].aliases)i(a,o)}return e}C5();function S5(n){return Ib.filter(e=>Er[e].oauthFlow===n)}function k5(n){return x5.has(n)}function w5(){return S5("device_code").filter(n=>!k5(n))}const A5=["kiro","ghcp","cursor","gitlab","codebuddy","kilo"],Yc=Ib,Bb=new Set(A5),O5=Object.freeze(Yc.filter(n=>!Bb.has(n))),P5=Object.freeze(Yc.filter(n=>Bb.has(n))),BO=Object.freeze([{id:"core",labelKey:"providerConfig.sectionCoreLabel",hintKey:"providerConfig.sectionCoreHint",providers:O5},{id:"plus-extra",labelKey:"providerConfig.sectionPlusLabel",hintKey:"providerConfig.sectionPlusHint",providers:P5}]);function Ca(n){return Yc.includes(n)}function fi(n){return typeof n=="string"?n.trim().toLowerCase():""}const T5=["openai","vertex"];function _O(n){return Ca(n)}function of(n){return _O(n)||T5.includes(n)}const HO=Object.freeze(Object.fromEntries(Yc.map(n=>[n,{displayName:Er[n].displayName,description:Er[n].description}]))),D5={gemini:"/assets/providers/gemini-color.svg",agy:"/assets/providers/agy.png",codex:"/assets/providers/codex-color.svg",qwen:"/assets/providers/qwen-color.svg",iflow:"/assets/providers/iflow.png",kiro:"/assets/providers/kiro.png",cursor:"/assets/sidebar/cursor.svg",gitlab:"/assets/providers/gitlab.svg",codebuddy:"/assets/providers/codebuddy.png",kilo:"/assets/providers/kilo.png",ghcp:"/assets/providers/copilot.svg",claude:"/assets/providers/claude.svg",kimi:"/assets/providers/kimi.svg",openai:"/assets/providers/openai.svg",vertex:"/assets/providers/vertex.svg"},Lk={textClass:"text-gray-600",letter:"?"},M5={gemini:{textClass:"text-blue-600",letter:"G"},claude:{textClass:"text-orange-600",letter:"C"},codex:{textClass:"text-emerald-600",letter:"X"},agy:{textClass:"text-violet-600",letter:"A"},qwen:{textClass:"text-cyan-600",letter:"Q"},iflow:{textClass:"text-indigo-600",letter:"i"},kiro:{textClass:"text-teal-600",letter:"K"},cursor:{textClass:"text-slate-900",letter:"C"},gitlab:{textClass:"text-orange-600",letter:"G"},codebuddy:{textClass:"text-blue-600",letter:"B"},kilo:{textClass:"text-rose-600",letter:"K"},ghcp:{textClass:"text-green-600",letter:"C"},kimi:{textClass:"text-orange-500",letter:"K"},openai:{textClass:"text-slate-900",letter:"O"},vertex:{textClass:"text-blue-600",letter:"V"}},N5=new Set(["kimi"]),L5=new Set(["codex"]);function pW(n){switch(n){case"gemini-api-key":return"gemini";case"codex-api-key":return"codex";case"claude-api-key":return"claude";case"vertex-api-key":return"vertex";case"openai-compatibility":return"openai"}}function mW(n){return n.split(`
11
+ `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{const t=e.indexOf("=");if(t===-1)return{name:e.trim(),alias:""};const i=e.slice(0,t).trim(),o=e.slice(t+1).trim();return o?{name:o,alias:i}:{name:i,alias:""}}).filter(e=>e.name.length>0||e.alias.length>0)}function gW(n){return n.split(`
12
+ `).map((e,t)=>({line:e.trim(),lineNumber:t+1})).filter(({line:e})=>e.length>0&&e.includes("=")).flatMap(({line:e,lineNumber:t})=>{const i=e.indexOf("="),o=e.slice(0,i).trim(),a=e.slice(i+1).trim();return o&&a?[]:[`Line ${t}: use requested=upstream or a plain model name.`]})}function yW(n){return(n||[]).map(e=>{const t=e.alias?.trim()||"",i=e.name?.trim()||"";return t?`${t}=${i}`:i}).join(`
13
+ `)}function bW(n){return n.alias.trim()||n.name.trim()}function UO(n){const e=fi(n);if(of(e))return D5[e]}function R5(n){const e=fi(n);return of(e)?M5[e]:{...Lk,letter:e[0]?.toUpperCase()||Lk.letter}}function E5(n){const e=fi(n);return of(e)&&N5.has(e)}function j5(n){const e=fi(n);return of(e)&&L5.has(e)}const _b={gemini:"#4285F4",agy:"#f3722c",codex:"#10a37f",openai:"#111827",vertex:"#4285F4",iflow:"#f94144",qwen:"#6236FF",kiro:"#4d908e",cursor:"#111827",gitlab:"#FC6D26",codebuddy:"#2563EB",kilo:"#E11D48",ghcp:"#43aa8b",claude:"#D97757",kimi:"#FF6B35"},I5={...Object.fromEntries(Yc.map(n=>[n,HO[n].displayName])),openai:"OpenAI",vertex:"Vertex AI"};function Hb(n){const e=fi(n);return e?I5[e]||re.t("toasts.providerUnknown",{provider:e}):re.t("toasts.providerUnknown",{provider:"unknown"})}function Rk(n){const e=fi(n);return Ca(e)&&Bb.has(e)}function xW(n){const e=fi(n);return Ca(e)&&BO.find(t=>t.providers.includes(e))||null}function vW(n){return n?n.tiers?Object.values(n.tiers).some(e=>Rk(e?.provider)):Rk(n.provider):!1}function CW(n,e){return BO.map(t=>({...t,items:n.filter(i=>{const o=fi(e(i));return Ca(o)&&t.providers.includes(o)})})).filter(t=>t.items.length>0)}function B5(n){const e=fi(n);return _O(e)?HO[e].description:""}const _5=[...w5()],H5=Object.freeze({ghcp:"GitHub Copilot",kiro:"Kiro (AWS)",qwen:"Qwen Code"}),U5=Object.freeze({ghcp:"Sign in with your GitHub account that has Copilot access.",qwen:"Sign in with your Qwen account to authorize access.",kiro:"Sign in with your selected Kiro auth provider to continue.",kimi:"Sign in with your Kimi account and finish the device authorization."});function SW(n){const e=fi(n);return Ca(e)&&_5.includes(e)}function Jd(n){const e=fi(n);return e?Ca(e)?H5[e]||Hb(e):re.t("toasts.providerUnknown",{provider:e}):re.t("toasts.providerUnknown",{provider:"unknown"})}function z5(n){const e=fi(n);return Ca(e)&&U5[e]||re.t("providerConfig.defaultDeviceCodeInstruction")}const F5=["authcode","device"],ly="authcode",kW="aws",Ek=[{id:"aws",label:"AWS Builder ID (Recommended)",description:"Device code flow for AWS organizations and Builder ID accounts.",flowType:"device_code",startEndpoint:"start"},{id:"aws-authcode",label:"AWS Builder ID (Auth Code)",description:"Authorization code flow via CLI binary.",flowType:"authorization_code",startEndpoint:"start"},{id:"google",label:"Google OAuth",description:"Social OAuth flow with callback URL support.",flowType:"authorization_code",startEndpoint:"start-url"},{id:"github",label:"GitHub OAuth",description:"Social OAuth flow via management API callback.",flowType:"authorization_code",startEndpoint:"start-url"},{id:"idc",label:"AWS Identity Center (IDC)",description:"Use your organization start URL with auth code or device flow.",flowType:"authorization_code",startEndpoint:"start"}];function q5(n){return F5.includes(n)}function G5(n){if(!n)return ly;const e=n.trim().toLowerCase();return q5(e)?e:ly}function wW(n){return Ek.find(t=>t.id===n)||Ek[0]}function AW(n,e=ly){return n==="aws"||n==="idc"&&G5(e)==="device"?"device_code":"authorization_code"}function OW(n){return n==="google"||n==="github"?"start-url":"start"}function PW(n){return n==="google"||n==="github"}function K5({open:n,onClose:e,sessionId:t,provider:i,userCode:o,verificationUrl:a,expiresAt:r}){const[c,d]=A.useState(!1),[f,m]=A.useState(null);A.useEffect(()=>{if(!n)return;let T=null;const M=()=>{const D=Math.max(0,Math.floor((r-Date.now())/1e3));m(D),D===0&&T&&(clearInterval(T),T=null)};return M(),T=setInterval(M,1e3),()=>{T&&clearInterval(T)}},[n,r]);const g=A.useCallback(async()=>{try{await navigator.clipboard.writeText(o),d(!0),fe.success(re.t("commonToast.codeCopied")),setTimeout(()=>d(!1),2e3)}catch{fe.error(re.t("commonToast.copyCodeFailed"))}},[o]),x=A.useCallback(()=>{window.open(a,"_blank","noopener,noreferrer")},[a]),v=Jd(i),C=z5(i),k=v==="Unknown provider"?re.t("deviceCodeDialog.openVerificationPage"):re.t("deviceCodeDialog.openProviderPage",{provider:v.split(" ")[0]}),w=T=>{const M=Math.floor(T/60),D=T%60;return`${M}:${D.toString().padStart(2,"0")}`},P=f===0;return p.jsx(Nb,{open:n,onOpenChange:T=>!T&&e(),children:p.jsxs(Lb,{className:"sm:max-w-md","data-session-id":t,children:[p.jsxs(Rb,{children:[p.jsxs(Eb,{className:"flex items-center gap-2",children:[p.jsx(bb,{className:"w-5 h-5"}),re.t("deviceCodeDialog.authorize",{provider:v})]}),p.jsxs(jb,{children:[re.t("deviceCodeDialog.enterCodeAtPage"),f!==null&&f>0&&p.jsx("span",{className:"text-muted-foreground ml-1",children:re.t("deviceCodeDialog.expiresIn",{time:w(f)})}),P&&p.jsx("span",{className:"text-destructive ml-1 font-medium",children:re.t("deviceCodeDialog.codeExpired")})]})]}),p.jsxs("div",{className:"space-y-6 py-4",children:[p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"bg-muted rounded-lg p-6 text-center",children:p.jsx("div",{className:"text-4xl font-mono font-bold tracking-[0.3em] text-foreground select-all",children:o})}),p.jsx(gt,{variant:"outline",size:"icon",className:"absolute top-2 right-2",onClick:g,"aria-label":c?re.t("deviceCodeDialog.codeCopiedAria"):re.t("deviceCodeDialog.copyCodeAria"),children:c?p.jsx(Lr,{className:"h-4 w-4 text-green-500"}):p.jsx(dh,{className:"h-4 w-4"})})]}),p.jsx("div",{className:"text-sm text-muted-foreground text-center",children:p.jsx("p",{children:C})}),p.jsxs("div",{className:"flex flex-col gap-3",children:[p.jsxs(gt,{onClick:x,className:"w-full",children:[p.jsx(hO,{className:"w-4 h-4 mr-2"}),k]}),p.jsx(gt,{variant:"outline",onClick:g,className:"w-full",children:c?p.jsxs(p.Fragment,{children:[p.jsx(Lr,{className:"w-4 h-4 mr-2 text-green-500"}),re.t("deviceCodeDialog.copied")]}):p.jsxs(p.Fragment,{children:[p.jsx(dh,{className:"w-4 h-4 mr-2"}),re.t("deviceCodeDialog.copyCode")]})})]}),p.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[p.jsx(hi,{className:"h-4 w-4 animate-spin"}),p.jsx("span",{children:re.t("deviceCodeDialog.waitingForAuth")})]})]})]})})}function V5({...n}){return p.jsx(UR,{"data-slot":"dropdown-menu",...n})}function W5({...n}){return p.jsx(zR,{"data-slot":"dropdown-menu-trigger",...n})}function Q5({className:n,sideOffset:e=4,...t}){return p.jsx(FR,{children:p.jsx(qR,{"data-slot":"dropdown-menu-content",sideOffset:e,className:q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md bg-white dark:bg-zinc-950",n),...t})})}function Y5({className:n,inset:e,variant:t="default",...i}){return p.jsx(GR,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":t,className:q("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-current relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...i})}function $5(){const{authRequired:n,isAuthenticated:e,username:t,logout:i}=Jh();if(!n||!e)return null;const o=async()=>{await i()};return p.jsxs(V5,{children:[p.jsx(W5,{asChild:!0,children:p.jsxs(gt,{variant:"ghost",size:"sm",className:"gap-2",children:[p.jsx(fO,{className:"h-4 w-4"}),p.jsx("span",{className:"hidden sm:inline",children:t})]})}),p.jsx(Q5,{align:"end",children:p.jsxs(Y5,{onClick:o,className:"gap-2 text-destructive",children:[p.jsx(DE,{className:"h-4 w-4"}),"Sign Out"]})})]})}const zO=$R,FO=XR,Ub=A.forwardRef(({className:n,children:e,...t},i)=>p.jsxs(qA,{ref:i,className:q("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...t,children:[e,p.jsx(KR,{asChild:!0,children:p.jsx(Wh,{className:"h-4 w-4 opacity-50"})})]}));Ub.displayName=qA.displayName;const qO=A.forwardRef(({className:n,...e},t)=>p.jsx(GA,{ref:t,className:q("flex cursor-default items-center justify-center py-1",n),...e,children:p.jsx(xb,{className:"h-4 w-4"})}));qO.displayName=GA.displayName;const GO=A.forwardRef(({className:n,...e},t)=>p.jsx(KA,{ref:t,className:q("flex cursor-default items-center justify-center py-1",n),...e,children:p.jsx(Wh,{className:"h-4 w-4"})}));GO.displayName=KA.displayName;const zb=A.forwardRef(({className:n,children:e,position:t="popper",...i},o)=>p.jsx(VR,{children:p.jsxs(VA,{ref:o,className:q("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:t,...i,children:[p.jsx(qO,{}),p.jsx(WR,{className:q("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),p.jsx(GO,{})]})}));zb.displayName=VA.displayName;const X5=A.forwardRef(({className:n,...e},t)=>p.jsx(WA,{ref:t,className:q("px-2 py-1.5 text-sm font-semibold",n),...e}));X5.displayName=WA.displayName;const ac=A.forwardRef(({className:n,children:e,...t},i)=>p.jsxs(QA,{ref:i,className:q("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...t,children:[p.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(QR,{children:p.jsx(Lr,{className:"h-4 w-4"})})}),p.jsx(YR,{children:e})]}));ac.displayName=QA.displayName;const J5=A.forwardRef(({className:n,...e},t)=>p.jsx(YA,{ref:t,className:q("-mx-1 my-1 h-px bg-muted",n),...e}));J5.displayName=YA.displayName;function Z5(){const{t:n,i18n:e}=Ce(),t=Qc(e.resolvedLanguage??e.language??"en"),i=o=>{const a=Ij(o);e.changeLanguage(a)};return p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(pO,{className:"h-4 w-4 text-muted-foreground"}),p.jsxs(zO,{value:t,onValueChange:i,children:[p.jsx(Ub,{className:"h-8 w-[150px]",children:p.jsx(FO,{placeholder:n("layout.languageSwitcher")})}),p.jsx(zb,{children:Ej.map(o=>p.jsx(ac,{value:o,children:n(`locale.${o}`)},o))})]})]})}function eB(){const[n,e]=A.useState({isOpen:!1,prompt:null});A.useEffect(()=>{const o=a=>{const r=a.detail;r.type==="projectSelectionRequired"?(console.log("[ProjectSelection] Received prompt:",r.sessionId),e({isOpen:!0,prompt:{sessionId:r.sessionId,provider:r.provider,projects:r.projects,defaultProjectId:r.defaultProjectId,supportsAll:r.supportsAll}})):r.type==="projectSelectionTimeout"?(console.log("[ProjectSelection] Timeout:",r.sessionId),e(c=>c.prompt?.sessionId===r.sessionId?{isOpen:!1,prompt:null}:c)):r.type==="projectSelectionSubmitted"&&(console.log("[ProjectSelection] Submitted:",r.sessionId),e(c=>c.prompt?.sessionId===r.sessionId?{isOpen:!1,prompt:null}:c))};return window.addEventListener("ws-message",o),()=>{window.removeEventListener("ws-message",o)}},[]);const t=A.useCallback(async o=>{if(!n.prompt)return;if(!(await fetch(`/api/cliproxy/auth/project-selection/${n.prompt.sessionId}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selectedId:o})})).ok)throw new Error("Failed to submit project selection")},[n.prompt]),i=A.useCallback(()=>{e({isOpen:!1,prompt:null})},[]);return A.useMemo(()=>({isOpen:n.isOpen,prompt:n.prompt,onSelect:t,onClose:i}),[n.isOpen,n.prompt,t,i])}function tB(n){return typeof n!="string"?"unknown":n.trim().toLowerCase()||"unknown"}function nB(){const{t:n}=Ce(),[e,t]=A.useState({isOpen:!1,prompt:null,error:null});A.useEffect(()=>{const r=c=>{const d=c.detail;if(d.type==="deviceCodeReceived"){console.log("[DeviceCode] Received prompt:",d.sessionId);const f=tB(d.provider),m=Jd(f);fe.info(n("toasts.authRequired",{provider:m})),t({isOpen:!0,prompt:{sessionId:d.sessionId,provider:f,userCode:d.userCode,verificationUrl:d.verificationUrl,expiresAt:d.expiresAt},error:null})}else d.type==="deviceCodeCompleted"?(console.log("[DeviceCode] Auth completed:",d.sessionId),t(f=>{if(f.prompt&&f.prompt.sessionId===d.sessionId){const m=Jd(f.prompt.provider);return fe.success(n("toasts.authSuccess",{provider:m})),{isOpen:!1,prompt:null,error:null}}return f})):d.type==="deviceCodeFailed"?(console.log("[DeviceCode] Auth failed:",d.sessionId,d.error),t(f=>{if(f.prompt&&f.prompt.sessionId===d.sessionId){const m=Jd(f.prompt.provider);return fe.error(n("toasts.authFailed",{provider:m})),{isOpen:!1,prompt:null,error:d.error}}return f})):d.type==="deviceCodeExpired"&&(console.log("[DeviceCode] Code expired:",d.sessionId),t(f=>f.prompt?.sessionId===d.sessionId?(fe.error(n("toasts.deviceCodeExpired")),{isOpen:!1,prompt:null,error:"Device code expired"}):f))};return window.addEventListener("ws-message",r),()=>{window.removeEventListener("ws-message",r)}},[n]);const i=A.useCallback(()=>{t({isOpen:!1,prompt:null,error:null})},[]),o=A.useCallback(()=>{e.prompt?.verificationUrl&&window.open(e.prompt.verificationUrl,"_blank","noopener,noreferrer")},[e.prompt]),a=A.useCallback(async()=>{if(e.prompt?.userCode)try{await navigator.clipboard.writeText(e.prompt.userCode),fe.success(n("toasts.codeCopied"))}catch{fe.error(n("toasts.failedCopy"))}},[e.prompt,n]);return A.useMemo(()=>({isOpen:e.isOpen,prompt:e.prompt,error:e.error,onClose:i,onOpenUrl:o,onCopyCode:a}),[e.isOpen,e.prompt,e.error,i,o,a])}const iB="ccs-dashboard:last-route";function oB(n,e="",t=""){try{localStorage.setItem(iB,`${n}${e}${t}`)}catch{}}function sB(){return p.jsxs("div",{className:"p-6 space-y-4",children:[p.jsx(tt,{className:"h-8 w-48"}),p.jsx(tt,{className:"h-64 w-full"})]})}function aB(){const n=Kh(),{isOpen:e,prompt:t,onSelect:i,onClose:o}=eB(),a=nB();return A.useEffect(()=>{oB(n.pathname,n.search,n.hash)},[n.pathname,n.search,n.hash]),p.jsxs(OI,{children:[p.jsx(e5,{}),p.jsxs("main",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-background",children:[p.jsxs("header",{className:"flex h-14 items-center justify-between px-6 border-b shrink-0 bg-background shadow-sm z-20",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(d5,{}),p.jsx(f5,{})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(l5,{}),p.jsx(Z5,{}),p.jsx(a5,{}),p.jsx(o5,{}),p.jsx(n5,{}),p.jsx(t5,{}),p.jsx($5,{})]})]}),p.jsx("div",{className:"flex-1 overflow-auto min-h-0",children:p.jsx(A.Suspense,{fallback:p.jsx(sB,{}),children:p.jsx(ey,{})})}),p.jsx(c5,{})]}),t&&p.jsx(y5,{open:e,onClose:o,sessionId:t.sessionId,provider:t.provider,projects:t.projects,defaultProjectId:t.defaultProjectId,supportsAll:t.supportsAll,onSelect:i}),a.prompt&&p.jsx(K5,{open:a.isOpen,onClose:a.onClose,sessionId:a.prompt.sessionId,provider:a.prompt.provider,userCode:a.prompt.userCode,verificationUrl:a.prompt.verificationUrl,expiresAt:a.prompt.expiresAt})]})}const rB=$h("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Qt({className:n,variant:e,...t}){return p.jsx("div",{className:q(rB({variant:e}),n),...t})}function lB({version:n}){const{t:e}=Ce();return p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsx(jO,{size:"lg",showText:!1}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("h1",{className:"text-2xl font-bold",children:e("heroSection.title")}),n&&p.jsxs(Qt,{variant:"outline",className:"font-mono text-xs",children:["v",n]})]}),p.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:e("heroSection.subtitle")})]})]})}const cB=100,jk=["#3b3c36","#568203","#8d4557","#da9100","#3c6c82","#c96907"];function uB(n){return jk[n%jk.length]}function cy(n){return n.replace(/@(gmail|yahoo|hotmail|outlook|icloud)\.com$/i,"")}function dB(n){const t=new Date().getTime()-n.getTime(),i=Math.floor(t/6e4);if(i<1)return"now";if(i<60)return`${i}m`;const o=Math.floor(i/60);return o<24?`${o}h`:`${Math.floor(o/24)}d`}function hB(n){const e=[],t=Date.now(),i=n.reduce((o,a)=>{const r=a.lastUsedAt?new Date(a.lastUsedAt).getTime():t;return Math.max(o,isNaN(r)?t:r)},t);return n.forEach(o=>{const a=new Date(i),r=(c,d)=>{for(let f=0;f<c;f++){const m=Math.floor(Math.random()*24*60*60*1e3*(f/(c||1))),g=new Date(a.getTime()-m),x=Math.floor((Math.random()-.5)*10*60*1e3);g.setTime(g.getTime()+x);const v=new Date;g>v&&g.setTime(v.getTime()),e.push({id:`${o.id}-${d}-${f}`,timestamp:g,accountEmail:o.email,status:d,latencyMs:d==="success"?50+Math.floor(Math.random()*150):200+Math.floor(Math.random()*4800)})}};r(o.successCount,"success"),r(o.failureCount,"failed")}),e.sort((o,a)=>a.timestamp.getTime()-o.timestamp.getTime())}function fB({containerRef:n,svgRef:e,accounts:t}){if(!n.current||!e.current)return[];const i=n.current,a=e.current.getBoundingClientRect(),r=i.querySelector("[data-provider-node]");if(!r)return[];const c=r.getBoundingClientRect(),d=[];return t.forEach((f,m)=>{const g=i.querySelector(`[data-account-index="${m}"]`);if(!g)return;const x=g.getBoundingClientRect(),v=g.getAttribute("data-zone")||"left";let C,k,w,P;switch(v){case"right":C=x.left-a.left,k=x.top+x.height/2-a.top,w=c.right-a.left,P=c.top+c.height/2-a.top;break;case"top":C=x.left+x.width/2-a.left,k=x.bottom-a.top,w=c.left+c.width/2-a.left,P=c.top-a.top;break;case"bottom":C=x.left+x.width/2-a.left,k=x.top-a.top,w=c.left+c.width/2-a.left,P=c.bottom-a.top;break;default:C=x.right-a.left,k=x.top+x.height/2-a.top,w=c.left-a.left,P=c.top+c.height/2-a.top}let T,M,D,L;v==="top"||v==="bottom"?(T=C,M=k+(P-k)*.5,D=w,L=P-(P-k)*.5):(T=C+(w-C)*.5,M=k,D=w-(w-C)*.5,L=P),d.push(`M ${C} ${k} C ${T} ${M}, ${D} ${L}, ${w} ${P}`)}),d}function pB(n){const e=n.length;if(e<=2)return{leftAccounts:n,rightAccounts:[],topAccounts:[],bottomAccounts:[]};if(e<=4){const i=Math.ceil(e/2);return{leftAccounts:n.slice(0,i),rightAccounts:n.slice(i),topAccounts:[],bottomAccounts:[]}}if(e<=8){const i=Math.ceil(e/3);return{leftAccounts:n.slice(0,i),rightAccounts:n.slice(i,i*2),topAccounts:n.slice(i*2),bottomAccounts:[]}}const t=Math.ceil(e/4);return{leftAccounts:n.slice(0,t),rightAccounts:n.slice(t,t*2),topAccounts:n.slice(t*2,t*3),bottomAccounts:n.slice(t*3)}}function mB(n){return n>=9?"w-64":n>=5?"w-60":n>=3?"w-56":"w-52"}function gB({storageKey:n,onDrag:e}){const[t,i]=A.useState(null),o=A.useRef(null),a=A.useRef(!1),r=A.useCallback(()=>{try{const C=localStorage.getItem(n);if(C)return JSON.parse(C)}catch{}return{}},[n]),[c,d]=A.useState(()=>r());A.useEffect(()=>{Object.keys(c).length>0&&localStorage.setItem(n,JSON.stringify(c))},[c,n]);const f=A.useCallback(()=>{d({}),localStorage.removeItem(n)},[n]),m=A.useCallback((C,k)=>{k.preventDefault(),k.stopPropagation(),k.target.setPointerCapture(k.pointerId);const w=c[C]||{x:0,y:0};o.current={x:k.clientX,y:k.clientY,offsetX:w.x,offsetY:w.y},a.current=!1,i(C)},[c]),g=A.useCallback(C=>{if(!t||!o.current)return;const k=o.current,w=C.clientX-k.x,P=C.clientY-k.y;(Math.abs(w)>3||Math.abs(P)>3)&&(a.current=!0),d(T=>({...T,[t]:{x:k.offsetX+w,y:k.offsetY+P}})),e&&requestAnimationFrame(e)},[t,e]),x=A.useCallback(()=>{i(null),o.current=null},[]);return{dragOffsets:c,draggingId:t,didDragRef:a,handlePointerDown:m,handlePointerMove:g,handlePointerUp:x,getOffset:C=>c[C]||{x:0,y:0},resetPositions:f,hasCustomPositions:Object.keys(c).length>0}}function yB(n){let e=0,t=0;return Object.values(n).forEach(i=>{e=Math.min(e,i.y),t=Math.max(t,i.y)}),{paddingTop:Math.max(0,-e),paddingBottom:Math.max(0,t),extraHeight:Math.max(0,Math.abs(e),Math.abs(t))*2}}function bB(n){const[e,t]=A.useState(new Set),i=A.useRef({});return A.useEffect(()=>{const o=new Set,a={};if(n.forEach(r=>{const c=r.successCount+r.failureCount;a[r.id]=c;const d=i.current[r.id];d!==void 0&&c>d&&o.add(r.id)}),i.current=a,o.size>0){t(o);const r=setTimeout(()=>t(new Set),2e3);return()=>clearTimeout(r)}},[n]),e}function xB({events:n,privacyMode:e}){const{t}=Ce();return n.length===0?p.jsx("div",{className:"h-full flex items-center justify-center rounded-xl bg-muted/20 dark:bg-zinc-900/40 border border-border/30 dark:border-white/[0.05]",children:p.jsx("div",{className:"text-xs text-muted-foreground font-mono",children:t("flowViz.noRecentConnections")})}):p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-3 px-2",children:[p.jsx(bc,{className:"w-3.5 h-3.5 text-muted-foreground"}),p.jsx("span",{className:"text-[10px] text-muted-foreground font-medium uppercase tracking-wider",children:t("flowViz.connectionTimeline")})]}),p.jsx("div",{className:q("flex-1 rounded-xl p-4 overflow-y-auto","bg-muted/20 dark:bg-zinc-900/40 backdrop-blur-sm","border border-border/30 dark:border-white/[0.05]"),children:p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-px bg-border/50 dark:bg-white/[0.08]"}),p.jsx("div",{className:"space-y-3",children:n.map(i=>{const o=i.status==="success"?Ln.success:i.status==="failed"?Ln.failed:Ln.degraded;return p.jsxs("div",{className:"relative flex items-start gap-3 pl-1",children:[p.jsx("div",{className:q("relative z-10 w-3.5 h-3.5 rounded-full flex-shrink-0 mt-0.5","ring-2 ring-background dark:ring-zinc-950"),style:{backgroundColor:o}}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("span",{className:q("text-[10px] font-mono text-foreground truncate",e&&MO),children:cy(i.accountEmail)}),p.jsx("span",{className:"text-[9px] text-muted-foreground font-mono flex-shrink-0",children:dB(i.timestamp)})]}),p.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[p.jsx("span",{className:"text-[9px] font-medium uppercase",style:{color:o},children:i.status}),i.latencyMs&&p.jsxs("span",{className:"text-[9px] text-muted-foreground font-mono",children:[i.latencyMs,"ms"]})]})]})]},i.id)})})]})})]})}const vB=new Set(["free"]),CB=new Set(["plus","pro"]),SB=new Set(["team"]);function Ik(n){return n.trim().replace(/^[^a-z0-9]+|[^a-z0-9]+$/gi,"").replace(/[^a-z0-9._-]+/gi,"-").replace(/-+/g,"-").toLowerCase()}function gr(n){const e=n.trim().toLowerCase();if(!e)return"";switch(e){case"team":return re.t("accountIdentity.team");case"free":return re.t("accountIdentity.free");case"plus":return re.t("accountIdentity.plus");case"pro":return re.t("accountIdentity.pro");default:return/^[a-f0-9]{8}$/i.test(e)?e:e.split(/[._-]+/).filter(Boolean).map(t=>t[0]?.toUpperCase()+t.slice(1)).join(" ")}}function KO(n){const e=n.split("#")[0]?.trim();return e&&e.includes("@")?e:null}function kB(n,e){if(!e)return null;const t=`${e}#`;return n.startsWith(t)?n.slice(t.length):null}function wB(n,e){if(!n||!e)return null;const i=(n.split(/[\\/]/).pop()??n).replace(/\.json$/i,"");if(!i.toLowerCase().startsWith("codex-"))return null;const o=i.indexOf("-"),a=o>0&&!i.slice(0,o).includes("@")?i.slice(o+1):i,r=a.toLowerCase().indexOf(e.toLowerCase());if(r===-1)return null;const c=Ik(a.slice(0,r)),d=Ik(a.slice(r+e.length)),f=[c,d].filter(Boolean);return f.length>0?f.join("-"):null}function AB(n){const e=n.find(i=>/^[a-f0-9]{8}$/i.test(i));if(e)return{detailLabel:re.t("accountIdentity.workspace",{id:e.toLowerCase()}),compactDetailLabel:e.toLowerCase()};const t=n.map(gr).filter(Boolean).join(" · ");return{detailLabel:t||null,compactDetailLabel:t||null}}function Bk(n){return n.map(gr).filter(Boolean).join(" · ")||null}function OB(n,e,t){const i=e?.trim()||KO(n)||void 0;return wB(t,i)??kB(n,i)}function Fb(n,e,t){const i=e?.trim()||KO(n)||n,o=OB(n,i,t);if(!o)return{email:i,audience:"unknown",audienceLabel:null,detailLabel:null,compactDetailLabel:null,inlineLabel:null};const a=o.split("-").filter(Boolean);if(a.length===0)return{email:i,audience:"unknown",audienceLabel:null,detailLabel:null,compactDetailLabel:null,inlineLabel:null};const r=a[a.length-1]?.toLowerCase();if(r&&SB.has(r)){const d=AB(a.slice(0,-1)),f=[re.t("accountIdentity.business"),d.detailLabel].filter(Boolean).join(" · ");return{email:i,audience:"business",audienceLabel:re.t("accountIdentity.business"),detailLabel:d.detailLabel,compactDetailLabel:d.compactDetailLabel,inlineLabel:f}}if(r&&vB.has(r)){const d=Bk(a.slice(0,-1)),f=[re.t("accountIdentity.free"),d].filter(Boolean).join(" · ");return{email:i,audience:"free",audienceLabel:re.t("accountIdentity.free"),detailLabel:d,compactDetailLabel:d,inlineLabel:f}}if(r&&CB.has(r)){const d=[gr(r),Bk(a.slice(0,-1))].filter(Boolean).join(" · "),f=[re.t("accountIdentity.personal"),d].filter(Boolean).join(" · ");return{email:i,audience:"personal",audienceLabel:re.t("accountIdentity.personal"),detailLabel:d||gr(r),compactDetailLabel:d||gr(r),inlineLabel:f}}const c=a.map(gr).filter(Boolean).join(" · ");return{email:i,audience:"unknown",audienceLabel:null,detailLabel:c||null,compactDetailLabel:c||null,inlineLabel:c||null}}function qb(n){return n.audience==="business"?{audience:"business",label:re.t("accountIdentity.business")}:n.audience==="free"?{audience:"free",label:re.t("accountIdentity.free")}:n.audience==="personal"?{audience:"personal",label:n.compactDetailLabel??n.detailLabel??re.t("accountIdentity.personal")}:{audience:"unknown",label:null}}function PB(n,e,t){const i=Fb(n,e,t);return i.inlineLabel?`${i.email} (${i.inlineLabel})`:i.email}const Qs="text-red-700 dark:text-red-400";function TB(n){if(!n)return null;const e=n.split(/[\s_-]+/g).map(t=>t.trim()).filter(t=>t.length>0).map(t=>t.charAt(0).toUpperCase()+t.slice(1));return e.length>0?e.join(" "):n}function DB(n){if(!n)return null;try{const e=new Date(n);return Number.isNaN(e.getTime())?null:e.toLocaleString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}catch{return null}}function MB(n,e,t){switch(n){case"five_hour":return t("quotaTooltip.fiveHourLimit");case"seven_day":return t("quotaTooltip.weeklyLimit");case"seven_day_opus":return t("quotaTooltip.weeklyOpus");case"seven_day_sonnet":return t("quotaTooltip.weeklySonnet");case"seven_day_oauth_apps":return t("quotaTooltip.weeklyOAuthApps");case"seven_day_cowork":return t("quotaTooltip.weeklyCowork");case"overage":return t("quotaTooltip.extraUsage");default:return e}}function _k(n){if(!n)return null;switch(n.trim().toLowerCase()){case"requests":return"Requests";case"input":return"Input tokens";case"output":return"Output tokens";default:return n.split(/[\s_-]+/g).map(e=>e.trim()).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}}function NB(n){switch(n){case"Gemini Flash Lite Series":return"Flash Lite";case"Gemini Flash Series":return"Flash";case"Gemini Pro Series":return"Pro";default:return n}}function LB(n){const e=Array.from(new Set((n||[]).filter(Boolean)));return e.length>0?e.join(", "):null}function RB(n,e,t){if(n==null)return null;const i=n.toLocaleString();switch(e?.trim().toLowerCase()){case"requests":return t("quotaTooltip.requestsRemaining",{count:i});case"input":return t("quotaTooltip.inputTokensRemaining",{count:i});case"output":return t("quotaTooltip.outputTokensRemaining",{count:i});default:return t("quotaTooltip.amountRemaining",{count:i})}}function Hk(n,e){if(!n)return null;const t=[];return n.rawTierLabel?t.push({label:e("quotaTooltip.tier"),value:n.rawTierLabel}):n.normalizedTier!=="unknown"&&t.push({label:e("quotaTooltip.tier"),value:n.normalizedTier}),n.rawTierId&&t.push({label:e("quotaTooltip.tierId"),value:n.rawTierId}),(n.accessState!=="entitled"||n.capacityState!=="available")&&t.push({label:e("quotaTooltip.state"),value:`${n.accessState.replaceAll("_"," ")} / ${n.capacityState.replaceAll("_"," ")}`}),t.length===0?null:t.map(i=>p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-muted-foreground",children:i.label}),p.jsx("span",{className:"font-mono",children:i.value})]},i.label))}function uy({quota:n,resetTime:e}){const{t}=Ce();if(!n)return p.jsx("p",{className:"text-xs text-muted-foreground",children:t("quotaTooltip.loadingQuota")});if(!n.success){const i=Db(n),o=i?.tone==="destructive"?"text-destructive":i?.tone==="warning"?"text-amber-700 dark:text-amber-300":"text-foreground";return p.jsxs("div",{className:"max-w-sm space-y-2 text-xs",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx("p",{className:q("font-semibold tracking-tight",o),children:i?.label||n.error||t("quotaTooltip.failedLoadQuota")}),p.jsx("p",{className:"leading-relaxed text-foreground/90",children:i?.summary||n.error})]}),i?.actionHint&&p.jsx("div",{className:"rounded-md border border-border/70 bg-muted/35 px-2.5 py-2 text-foreground/80",children:i.actionHint}),i?.technicalDetail&&p.jsx("div",{className:"rounded-md border border-border/60 bg-muted/25 px-2 py-1.5 font-mono text-[11px] text-foreground/75",children:i.technicalDetail}),i?.rawDetail&&p.jsx("pre",{className:"max-h-56 overflow-auto whitespace-pre-wrap break-words rounded-md border border-border/70 bg-muted/55 px-2.5 py-2 font-mono text-[11px] leading-relaxed text-foreground/85",children:i.rawDetail})]})}if(Ob(n)){const i=Zj(n.models||[]),o=eI(i),a=["primary","gemini-3","gemini-2","other"];return p.jsxs("div",{className:"text-xs space-y-1.5",children:[Hk(n.entitlement,t),p.jsx("p",{className:"font-medium",children:t("quotaTooltip.modelQuotas")}),a.map((r,c)=>{const d=o.get(r);if(!d||d.length===0)return null;const f=a.slice(0,c).every(m=>!o.get(m)?.length);return p.jsxs("div",{children:[!f&&p.jsx("div",{className:"my-1 border-t border-border/40"}),d.map(m=>p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:q("truncate",m.exhausted&&Qs),children:m.displayName}),p.jsxs("span",{className:q("font-mono",m.exhausted&&Qs),children:[m.percentage,"%"]})]},m.name))]},r)}),p.jsx(Zd,{resetTime:e})]})}if(tf(n)){const{fiveHourWindow:i,weeklyWindow:o,codeReviewWindows:a,additionalWindows:r,unknownWindows:c}=ef(n.windows),d=n.coreUsage?.fiveHour?.resetAt??i?.resetAt??null,f=n.coreUsage?.weekly?.resetAt??o?.resetAt??null,m=[i,o,...a,...r,...c].filter(g=>!!g).filter((g,x,v)=>v.findIndex(C=>C.label===g.label&&C.resetAt===g.resetAt)===x);return p.jsxs("div",{className:"text-xs space-y-1.5",children:[p.jsx("p",{className:"font-medium",children:t("quotaTooltip.rateLimits")}),n.planType&&p.jsx("p",{className:"text-muted-foreground",children:t("quotaTooltip.plan",{plan:n.planType})}),m.map((g,x)=>p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:q(g.remainingPercent<20&&Qs),children:iI(g,m)}),p.jsxs("span",{className:"font-mono",children:[g.remainingPercent,"%"]})]},`${g.label}-${g.resetAt??"no-reset"}-${x}`)),p.jsx(Uk,{fiveHourResetTime:d,weeklyResetTime:f,fallbackResetTime:e})]})}if(nf(n)){const i=[n.coreUsage?.fiveHour,n.coreUsage?.weekly].filter(d=>!!d).map(d=>({rateLimitType:d.rateLimitType,label:d.label,remainingPercent:d.remainingPercent,resetAt:d.resetAt,status:d.status})),o=n.windows.map(d=>({rateLimitType:d.rateLimitType,label:d.label,remainingPercent:d.remainingPercent,resetAt:d.resetAt,status:d.status})),a=[...i,...o].filter((d,f,m)=>m.findIndex(g=>g.rateLimitType===d.rateLimitType&&g.resetAt===d.resetAt&&g.status===d.status)===f),r=n.coreUsage?.fiveHour?.resetAt??n.windows.find(d=>d.rateLimitType==="five_hour")?.resetAt??null,c=n.coreUsage?.weekly?.resetAt??n.windows.find(d=>["seven_day","seven_day_opus","seven_day_sonnet","seven_day_oauth_apps","seven_day_cowork"].includes(d.rateLimitType))?.resetAt??null;return p.jsxs("div",{className:"text-xs space-y-1.5",children:[p.jsx("p",{className:"font-medium",children:t("quotaTooltip.rateLimits")}),a.map((d,f)=>p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:q(d.remainingPercent<20&&Qs),children:MB(d.rateLimitType,d.label,t)}),p.jsxs("span",{className:"font-mono",children:[d.remainingPercent,"%"]})]},`${d.rateLimitType}-${d.resetAt??"no-reset"}-${d.status}-${f}`)),p.jsx(Uk,{fiveHourResetTime:r,weeklyResetTime:c,fallbackResetTime:e})]})}if(Pb(n)){const i=n.buckets.some(c=>!!c.resetTime),o=!!n.entitlement?.rawTierLabel||n.entitlement?.normalizedTier!=="unknown",a=Array.from(new Set(n.buckets.map(c=>_k(c.tokenType)).filter(c=>!!c))),r=a.length===1?a[0]:null;return p.jsxs("div",{className:"text-xs space-y-1.5",children:[Hk(n.entitlement,t),!o&&n.tierLabel&&p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-muted-foreground",children:t("quotaTooltip.tier")}),p.jsx("span",{className:"font-mono",children:n.tierLabel})]}),n.creditBalance!==null&&n.creditBalance!==void 0&&p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-muted-foreground",children:t("quotaTooltip.credits")}),p.jsx("span",{className:"font-mono",children:n.creditBalance.toLocaleString()})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("p",{className:"font-medium",children:t("quotaTooltip.modelQuotasLower")}),r&&p.jsx("p",{className:"text-[11px] text-muted-foreground",children:t("quotaTooltip.allBucketsReport",{tokenType:r})})]}),n.buckets.map(c=>{const d=r?null:_k(c.tokenType),f=LB(c.modelIds),m=RB(c.remainingAmount,c.tokenType,t);return p.jsxs("div",{className:"space-y-0.5",children:[p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsxs("div",{className:"min-w-0 space-y-0.5",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:q(c.remainingPercent<20&&Qs),children:NB(c.label)}),d&&p.jsx("span",{className:"rounded border border-border/60 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-muted-foreground",children:d})]}),f&&p.jsx("div",{className:"break-words text-[11px] text-muted-foreground",children:f})]}),p.jsxs("span",{className:"shrink-0 font-mono",children:[c.remainingPercent,"%"]})]}),(m||c.resetTime)&&p.jsxs("div",{className:"flex justify-between gap-4 text-[11px] text-muted-foreground",children:[p.jsx("span",{children:m??""}),p.jsx("span",{children:DB(c.resetTime)??""})]})]},c.id)}),!i&&p.jsx(Zd,{resetTime:e})]})}if(Tb(n)){const i=[{label:t("quotaTooltip.premiumInteractions"),snapshot:n.snapshots.premiumInteractions},{label:t("quotaTooltip.chat"),snapshot:n.snapshots.chat},{label:t("quotaTooltip.completions"),snapshot:n.snapshots.completions}].filter(({snapshot:r})=>r.reported!==!1),o=n.quotaResetDate??e,a=TB(n.planType);return p.jsxs("div",{className:"text-xs space-y-1.5",children:[p.jsx("p",{className:"font-medium",children:t("quotaTooltip.quotaSnapshots")}),a&&p.jsx("p",{className:"text-muted-foreground",children:t("quotaTooltip.plan",{plan:a})}),i.map(({label:r,snapshot:c})=>{const d=c.percentRemaining<20;return p.jsxs("div",{className:"space-y-0.5",children:[p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:q(d&&Qs),children:r}),p.jsx("span",{className:q("font-mono",d&&Qs),children:c.unlimited?t("quotaTooltip.unlimited"):`${Sr(c.percentRemaining)}%`})]}),!c.unlimited&&p.jsx("div",{className:"text-[11px] text-muted-foreground",children:t("quotaTooltip.remaining",{remaining:c.remaining,entitlement:c.entitlement})})]},r)}),p.jsx(Zd,{resetTime:o})]})}return null}function Zd({resetTime:n}){const{t:e}=Ce();return n?p.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/60 pt-1",children:[p.jsx(Rr,{className:"h-3 w-3 text-sky-600 dark:text-sky-300"}),p.jsx("span",{className:"font-medium text-sky-600 dark:text-sky-300",children:e("quotaTooltip.resets",{time:ay(n)})})]}):null}function Uk({fiveHourResetTime:n,weeklyResetTime:e,fallbackResetTime:t}){const{t:i}=Ce(),o=!!n||!!e;return!o&&!t?null:p.jsxs("div",{className:"space-y-1 border-t border-border/60 pt-1",children:[n&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Rr,{className:"h-3 w-3 text-sky-600 dark:text-sky-300"}),p.jsx("span",{className:"font-medium text-sky-600 dark:text-sky-300",children:i("quotaTooltip.fiveHourResets",{time:ay(n)})})]}),e&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Rr,{className:"h-3 w-3 text-indigo-600 dark:text-indigo-300"}),p.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-300",children:i("quotaTooltip.weeklyResets",{time:ay(e)})})]}),!o&&t&&p.jsx(Zd,{resetTime:t})]})}const Xl=A.forwardRef(({className:n,value:e=0,max:t=100,indicatorClassName:i,...o},a)=>{const r=Math.min(Math.max(e/t*100,0),100);return p.jsx("div",{ref:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":e,className:q("relative h-2 w-full overflow-hidden rounded-full bg-secondary",n),...o,children:p.jsx("div",{className:q("h-full transition-all",i||"bg-primary"),style:{width:`${r}%`}})})});Xl.displayName="Progress";function og(n){const e=Math.max(0,Math.min(100,n));return e<=20?"bg-destructive":e<=50?"bg-yellow-500":"bg-green-500"}function zk(n){const e=Math.max(0,Math.min(100,n));return e<=20?"text-red-600 dark:text-red-400":e<=50?"text-amber-600 dark:text-amber-400":"text-emerald-600 dark:text-emerald-400"}function Fk(n){return Number(Sr(n))}function qk(n){if(!n)return"";try{const e=new Date(n),t=Date.now()-e.getTime();if(t<0)return"just now";const i=Math.floor(t/(1e3*60)),o=Math.floor(t/(1e3*60*60)),a=Math.floor(t/(1e3*60*60*24));return a>0?`${a}d ago`:o>0?`${o}h ago`:i>0?`${i}m ago`:"just now"}catch{return""}}function EB(n){if(!n)return!1;try{return Date.now()-new Date(n).getTime()<3600*1e3}catch{return!1}}function jB({provider:n,quota:e,quotaLoading:t,runtimeLastUsed:i,mode:o,className:a}){const{t:r}=Ce(),c=n.toLowerCase(),d=c==="codex",f=c==="claude"||c==="anthropic",m=RO(n,e),g=EO(n,e),x=m!==null?Sr(m):null,v=x!==null?Number(x):null,C=Db(e),k=C?.label==="Reauth"?bb:C?.tone==="warning"?Qi:vc,w=d&&e&&tf(e)?ef(e.windows):null,T=d?[{id:"five-hour",label:r("quotaTooltip.fiveHourLimit"),compactLabel:"5h",value:w?.fiveHourWindow?.remainingPercent??null},{id:"weekly",label:r("quotaTooltip.weeklyLimit"),compactLabel:"Week",value:w?.weeklyWindow?.remainingPercent??null}].filter(D=>D.value!==null):f&&e&&nf(e)?[{id:"five-hour",label:r("quotaTooltip.fiveHourLimit"),compactLabel:"5h",value:e.coreUsage?.fiveHour?.remainingPercent??e.windows.find(D=>D.rateLimitType==="five_hour")?.remainingPercent??null},{id:"weekly",label:r("quotaTooltip.weeklyLimit"),compactLabel:"Week",value:e.coreUsage?.weekly?.remainingPercent??e.windows.find(D=>["seven_day","seven_day_opus","seven_day_sonnet","seven_day_oauth_apps","seven_day_cowork"].includes(D.rateLimitType))?.remainingPercent??null}].filter(D=>D.value!==null):[];if(t)return p.jsxs("div",{className:q("flex items-center gap-1.5 text-xs text-muted-foreground",a),children:[p.jsx(hi,{className:"w-3 h-3 animate-spin"}),p.jsx("span",{children:r(o==="compact"?"accountCard.quotaLoading":"accountQuotaPanel.loadingQuota")})]});if(v!==null)return p.jsx("div",{className:q(o==="compact"?"px-0.5":"",a),children:p.jsx(pa,{children:p.jsxs(Do,{children:[p.jsx(Mo,{asChild:!0,children:o==="compact"?p.jsx("div",{className:"cursor-help",children:T.length>0?p.jsx("div",{className:"space-y-1",children:T.map(D=>p.jsxs("div",{className:"grid grid-cols-[2rem_minmax(0,1fr)_2rem] items-center gap-x-1 text-[7px]",children:[p.jsx("span",{className:"font-semibold uppercase leading-none text-muted-foreground/75",children:D.compactLabel}),p.jsx(Xl,{value:Fk(D.value),"aria-label":`${D.compactLabel} quota`,className:"h-1.5",indicatorClassName:og(D.value)}),p.jsxs("span",{className:q("text-right font-mono text-[10px] font-bold leading-none",zk(D.value)),children:[Sr(D.value),"%"]})]},D.id))}):p.jsxs("div",{className:"space-y-0.5",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:r("accountCard.quota")}),p.jsxs("span",{className:q("text-[10px] font-mono font-bold",v>50?"text-emerald-600 dark:text-emerald-400":v>20?"text-amber-500":"text-red-500"),children:[x,"%"]})]}),p.jsx(Xl,{value:v,"aria-label":"Quota",className:"h-1",indicatorClassName:v>50?"bg-emerald-500":v>20?"bg-amber-500":"bg-red-500"})]})}):p.jsxs("div",{className:"space-y-1.5 cursor-help",children:[p.jsx("div",{className:"flex items-center gap-1.5 text-xs",children:EB(i)?p.jsxs(p.Fragment,{children:[p.jsx(Wc,{className:"w-3 h-3 text-emerald-500"}),p.jsxs("span",{className:"text-emerald-600 dark:text-emerald-400",children:["Active ·"," ",qk(i)]})]}):i?p.jsxs(p.Fragment,{children:[p.jsx(Rr,{className:"w-3 h-3 text-muted-foreground"}),p.jsxs("span",{className:"text-muted-foreground",children:["Last used"," ",qk(i)]})]}):p.jsxs(p.Fragment,{children:[p.jsx(JS,{className:"w-3 h-3 text-muted-foreground"}),p.jsx("span",{className:"text-muted-foreground",children:r("accountCardStats.notUsedYet")})]})}),T.length>0?p.jsx("div",{className:"space-y-2",children:T.map(D=>p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2 text-[10px]",children:[p.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:D.label}),p.jsxs("span",{className:q("shrink-0 font-mono font-semibold",zk(D.value)),children:[Sr(D.value),"%"]})]}),p.jsx(Xl,{value:Fk(D.value),"aria-label":`${D.label} quota`,className:"h-2",indicatorClassName:og(D.value)})]},D.id))}):p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Xl,{value:Math.max(0,Math.min(100,v)),"aria-label":"Quota",className:"h-2 flex-1",indicatorClassName:og(v)}),p.jsxs("span",{className:"text-xs font-medium w-10 text-right",children:[x,"%"]})]})]})}),p.jsx(No,{side:o==="compact"?"top":"bottom",className:"sm:max-w-sm",children:p.jsx(uy,{quota:e,resetTime:g})})]})})});if(e?.success)return o==="compact"?p.jsx("div",{className:q("text-[8px] text-muted-foreground/60",a),children:r("accountCard.quotaUnavailable")}):p.jsx("div",{className:a,children:p.jsxs(Qt,{variant:"outline",className:"text-[10px] h-5 px-2 gap-1 border-muted-foreground/50 text-muted-foreground",children:[p.jsx(JS,{className:"w-3 h-3"}),r("accountCard.quotaUnavailable")]})});if(!C)return null;const M=C.tone==="warning"?"text-amber-600 dark:text-amber-400 border-amber-500/50":C.tone==="destructive"?"text-destructive border-destructive/50":"text-muted-foreground/70 border-muted-foreground/50";return p.jsx(pa,{children:p.jsxs(Do,{children:[p.jsx(Mo,{asChild:!0,children:o==="compact"?p.jsxs("div",{className:q("flex items-center gap-1 text-[8px]",M,a),children:[p.jsx(k,{className:"w-2.5 h-2.5"}),p.jsx("span",{children:C.label})]}):p.jsx("div",{className:a,children:p.jsxs(Qt,{variant:"outline",className:q("text-[10px] h-5 px-2 gap-1",M),children:[p.jsx(k,{className:"w-3 h-3"}),C.label]})})}),p.jsx(No,{side:o==="compact"?"top":"bottom",className:"sm:max-w-sm",children:p.jsx(uy,{quota:e,resetTime:g})})]})})}function sg(n){return n==="business"?"bg-sky-500/12 text-sky-700 dark:text-sky-300":n==="free"?"bg-slate-200/70 text-slate-700 dark:bg-slate-700/40 dark:text-slate-200":n==="personal"?"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300":"bg-muted text-muted-foreground"}function IB(n){return n==="ultra"?"bg-violet-500/15 text-violet-600 dark:bg-violet-500/25 dark:text-violet-300":"bg-yellow-500/15 text-yellow-700 dark:bg-yellow-500/20 dark:text-yellow-400"}function BB(n,e){return n==="business"?e("accountSurfaceCard.business"):n==="free"?e("accountSurfaceCard.free"):n==="personal"?e("accountSurfaceCard.personal"):"?"}function Gk(n){return n==="business"?"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:border-sky-400/30 dark:bg-sky-500/15 dark:text-sky-200":n==="free"?"border-slate-300/70 bg-slate-100/80 text-slate-700 dark:border-slate-500/40 dark:bg-slate-700/30 dark:text-slate-200":n==="personal"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:border-emerald-400/30 dark:bg-emerald-500/15 dark:text-emerald-200":"border-border/60 bg-muted/60 text-muted-foreground"}function _B(n,e){if(e&&"entitlement"in e){const t=e.entitlement?.normalizedTier;if(t&&t!=="unknown")return t}return n}function HB(n){return!n||!("planType"in n)||!n.planType?{audience:"unknown",label:null}:n.planType==="team"?{audience:"business",label:"Business"}:n.planType==="free"?{audience:"free",label:"Free"}:n.planType==="plus"?{audience:"personal",label:"Plus"}:n.planType==="pro"?{audience:"personal",label:"Pro"}:{audience:"unknown",label:null}}function UB(n,e){return e.label?e.label==="Business"||e.label==="Plus"||e.label==="Pro"?e:e.label==="Free"&&n.label&&n.label!=="Free"?n:e:n}function zB({mode:n,provider:e,accountId:t,email:i,displayEmail:o,tokenFile:a,tier:r,isDefault:c,paused:d,privacyMode:f,showQuota:m,quota:g,quotaLoading:x,runtimeLastUsed:v,beforeIdentity:C,headerEnd:k,compactMetaBadges:w,bodySlot:P,footerSlot:T,quotaInsetClassName:M,className:D}){const{t:L}=Ce(),N=Fb(t,i,a),j=o||N.email||t,K=e.toLowerCase(),U=_B(r,g),z=K==="codex"?UB(qb(N),HB(g)):null,X=(K==="agy"||K==="antigravity"||K==="gemini")&&U&&U!=="unknown"&&U!=="free",H=n==="compact",V=p.jsxs(p.Fragment,{children:[X&&p.jsx("span",{className:q("text-[8px] font-semibold px-1.5 py-0.5 rounded-md shrink-0",IB(U)),children:U}),K==="codex"?z?.label&&p.jsx("span",{title:z.label,className:q("text-[8px] font-semibold px-1.5 py-0.5 rounded-md border shrink-0",Gk(z.audience)),children:z.label}):N.audienceLabel&&p.jsx("span",{title:N.audienceLabel,className:q("text-[8px] font-semibold px-1.5 py-0.5 rounded-md shrink-0",sg(N.audience)),children:BB(N.audience,L)}),K!=="codex"&&N.compactDetailLabel&&p.jsx("span",{title:N.detailLabel??N.compactDetailLabel,className:q("text-[8px] font-semibold px-1.5 py-0.5 rounded-md border shrink-0",Gk(N.audience)),children:N.compactDetailLabel}),d&&p.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-md shrink-0 bg-amber-500/15 text-amber-700 dark:bg-amber-500/25 dark:text-amber-300",children:"Paused"})]});return p.jsxs("div",{className:q("flex flex-col gap-2",D),children:[p.jsxs("div",{className:"flex items-start justify-between gap-2",children:[p.jsxs("div",{className:q("flex min-w-0 flex-1",H?"gap-2":"gap-3"),children:[C,!H&&p.jsxs("div",{className:"relative shrink-0",children:[p.jsx("div",{className:q("flex items-center justify-center w-8 h-8 rounded-full",c?"bg-primary/10":"bg-muted"),children:p.jsx(fO,{className:"w-4 h-4"})}),X&&p.jsx("span",{className:q("absolute -bottom-0.5 -right-0.5 text-[7px] font-bold uppercase px-1 py-px rounded ring-1 ring-background",U==="ultra"?"bg-violet-500/20 text-violet-600 dark:bg-violet-500/30 dark:text-violet-300":"bg-yellow-500/20 text-yellow-700 dark:bg-yellow-500/25 dark:text-yellow-400"),children:U==="ultra"?"U":"P"})]}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:q("flex items-center min-w-0",H?"gap-1.5":"gap-2 flex-wrap"),children:[p.jsx("span",{title:j,className:q(H?"flex-1 min-w-0 text-xs font-semibold tracking-tight truncate leading-none":"font-medium text-sm truncate",f&&MO),children:j}),H&&(w??V),!H&&K==="codex"&&z?.label&&p.jsx(Qt,{variant:"outline",className:q("text-[10px] h-4 px-1.5 border-transparent",sg(z.audience)),children:z.label}),!H&&K!=="codex"&&N.audienceLabel&&p.jsx(Qt,{variant:"outline",className:q("text-[10px] h-4 px-1.5 border-transparent",sg(N.audience)),children:N.audienceLabel}),!H&&K!=="codex"&&N.detailLabel&&p.jsx(Qt,{variant:"outline",className:"text-[10px] h-4 px-1.5",children:N.detailLabel}),!H&&c&&p.jsxs(Qt,{variant:"secondary",className:"text-[10px] h-4 px-1.5 gap-0.5",children:[p.jsx(ME,{className:"w-2.5 h-2.5 fill-current"}),"Default"]}),!H&&d&&p.jsxs(Qt,{variant:"outline",className:"text-[10px] h-4 px-1.5 border-yellow-500 text-yellow-600",children:[p.jsx(mO,{className:"w-2 h-2 mr-0.5"}),"Paused"]})]}),P&&p.jsx("div",{className:"mt-1",children:P})]})]}),k&&p.jsx("div",{className:q("flex items-center shrink-0",H?"gap-0.5":"gap-1"),children:k})]}),T,m&&p.jsx(jB,{provider:e,quota:g,quotaLoading:x,runtimeLastUsed:v,mode:n,className:M})]})}async function FB(){const n=await fetch("/api/cliproxy/stats");if(!n.ok){const e=await n.json();throw new Error(e.message||"Failed to fetch stats")}return n.json()}async function qB(){const n=await fetch("/api/cliproxy/status");if(!n.ok)throw new Error("Failed to fetch status");return n.json()}function GB(){return It({queryKey:["cliproxy-status"],queryFn:qB,refetchInterval:1e4,retry:1})}function KB(n=!0){return It({queryKey:["cliproxy-stats"],queryFn:FB,enabled:n,refetchInterval:5e3,retry:1,staleTime:3e3})}async function VB(){const n=await fetch("/api/cliproxy/error-logs");if(!n.ok){const t=await n.json();throw new Error(t.message||"Failed to fetch error logs")}return(await n.json()).files??[]}async function WB(n){const e=await fetch(`/api/cliproxy/error-logs/${encodeURIComponent(n)}`);if(!e.ok)throw new Error("Failed to fetch error log content");return e.text()}function QB(n=!0){return It({queryKey:["cliproxy-error-logs"],queryFn:VB,enabled:n,refetchInterval:3e4,retry:1,staleTime:1e4})}function YB(n){return It({queryKey:["cliproxy-error-log-content",n],queryFn:()=>n?WB(n):Promise.resolve(""),enabled:!!n,staleTime:6e4})}const VO=["agy","codex","claude","gemini","ghcp"],$B={antigravity:"agy",anthropic:"claude","gemini-cli":"gemini",copilot:"ghcp","github-copilot":"ghcp"};function WO(n){const e=n.trim().toLowerCase();return e?VO.includes(e)?e:$B[e]??null:null}async function Kk(n,e){const t=await fetch(`/api/cliproxy/quota/${n}/${encodeURIComponent(e)}`);if(!t.ok){let i="Failed to fetch quota";try{i=(await t.json()).message||i}catch{}throw new Error(i)}return t.json()}async function XB(n){const e=await fetch(`/api/cliproxy/quota/codex/${encodeURIComponent(n)}`);if(!e.ok){let t="Failed to fetch Codex quota";try{t=(await e.json()).message||t}catch{}throw new Error(t)}return e.json()}async function JB(n){const e=await fetch(`/api/cliproxy/quota/claude/${encodeURIComponent(n)}`);if(!e.ok){let t="Failed to fetch Claude quota";try{t=(await e.json()).message||t}catch{}throw new Error(t)}return e.json()}async function ZB(n){const e=await fetch(`/api/cliproxy/quota/gemini/${encodeURIComponent(n)}`);if(!e.ok){let t="Failed to fetch Gemini quota";try{t=(await e.json()).message||t}catch{}throw new Error(t)}return e.json()}async function e3(n){const e=await fetch(`/api/cliproxy/quota/ghcp/${encodeURIComponent(n)}`);if(!e.ok){let t="Failed to fetch GitHub Copilot quota";try{t=(await e.json()).message||t}catch{}throw new Error(t)}return e.json()}function QO(n,e,t=!0){const i=WO(n);return{queryKey:["account-quota",i??n,e],queryFn:()=>t3(i??n,e),enabled:t&&!!i&&!!e,staleTime:6e4,refetchInterval:6e4,refetchOnWindowFocus:!1,refetchOnMount:!1,retry:1}}async function t3(n,e){const t=WO(n);if(!t)return Kk(n,e);switch(t){case"codex":return XB(e);case"claude":return JB(e);case"gemini":return ZB(e);case"ghcp":return e3(e);default:return Kk(n,e)}}function n3(n,e,t=!0){return It(QO(n,e,t))}function i3(n,e=!0){return pE({queries:n.map(t=>QO(t.provider,t.accountId,e))})}function o3({success:n,failure:e,showDetails:t}){const{t:i}=Ce(),o=n+e,a=o>0?n/o*100:100;return p.jsxs("div",{className:"mt-2 space-y-2",children:[p.jsxs("div",{className:"flex items-end justify-between px-0.5",children:[p.jsxs("div",{className:"flex flex-col",children:[p.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:i("authMonitorLive.successRate")}),p.jsxs("span",{className:q("text-sm font-mono font-bold leading-none mt-0.5",a===100?"text-emerald-600 dark:text-emerald-400":a>=90?"text-amber-500":"text-red-500"),children:[Math.round(a),"%"]})]}),p.jsxs("div",{className:"flex flex-col items-end",children:[p.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:"Volume"}),p.jsx("span",{className:"text-xs font-mono font-medium text-foreground/80 leading-none mt-0.5",children:o.toLocaleString()})]})]}),p.jsxs("div",{className:q("grid grid-cols-2 gap-2 overflow-hidden transition-all duration-300 ease-in-out",t?"max-h-20 opacity-100 mt-2":"max-h-0 opacity-0 mt-0"),children:[p.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 rounded-md bg-emerald-500/5 dark:bg-emerald-500/10 border border-emerald-500/10",children:[p.jsx(Wc,{className:"w-2.5 h-2.5 text-emerald-600 dark:text-emerald-400"}),p.jsx("span",{className:"text-[10px] font-mono font-bold text-emerald-600 dark:text-emerald-400",children:n})]}),p.jsxs("div",{className:q("flex items-center gap-1.5 px-1.5 py-1 rounded-md border",e>0?"bg-red-500/5 dark:bg-red-500/10 border-red-500/20":"bg-muted/10 border-transparent opacity-40"),children:[p.jsx(vb,{className:q("w-2.5 h-2.5",e>0?"text-red-500":"text-muted-foreground")}),p.jsx("span",{className:q("text-[10px] font-mono font-bold",e>0?"text-red-500":"text-muted-foreground"),children:e})]})]})]})}const s3=["antigravity","anthropic","gemini-cli","copilot","github-copilot"],a3={left:"border-l-2",right:"border-r-2",top:"border-t-2",bottom:"border-b-2"},r3={left:"top-1/2 -right-1.5 -translate-y-1/2",right:"top-1/2 -left-1.5 -translate-y-1/2",top:"left-1/2 -bottom-1.5 -translate-x-1/2",bottom:"left-1/2 -top-1.5 -translate-x-1/2"};function l3(n,e){switch(n){case"left":return{borderLeftColor:e};case"right":return{borderRightColor:e};case"top":return{borderTopColor:e};case"bottom":return{borderBottomColor:e}}}function c3(n){return n>50?"bg-emerald-500":n>20?"bg-amber-500":"bg-red-500"}function YO(n){if(!n||typeof n!="object"||!("planType"in n))return{audience:"unknown",label:null};const e=n.planType;return typeof e!="string"||e.trim().length===0?{audience:"unknown",label:null}:e==="team"?{audience:"business",label:"Business"}:e==="free"?{audience:"free",label:"Free"}:e==="plus"?{audience:"personal",label:"Plus"}:e==="pro"?{audience:"personal",label:"Pro"}:{audience:"unknown",label:null}}function $O(n,e){return e.label?e.label==="Business"||e.label==="Plus"||e.label==="Pro"?e:e.label==="Free"&&n.label&&n.label!=="Free"?n:e:n}function XO(n,e){return $O(qb({audience:n.audience,detailLabel:n.detailLabel??null,compactDetailLabel:n.compactDetailLabel??null}),YO(e)).label}function u3(n,e){return $O(qb({audience:n.audience,detailLabel:n.detailLabel??null,compactDetailLabel:n.compactDetailLabel??null}),YO(e)).audience}function JO(n,e){return XO(n,e)}function ZO(n){return n==="business"?"Business":n==="free"?"Free":n==="personal"?"Personal":null}function eP(n,e){return u3(n,e)}function Vk(n,e){return XO(n,e)||n.inlineLabel||null}function tP(n,e){const t=eP(n,e),i=JO(n,e);return t==="business"?"Biz":t==="free"?i??"Free":t==="personal"?i??"Pers":(i?.trim()||ZO(t))?.[0]?.toUpperCase()??"?"}function d3(n,e){const t=new Set(n.map(o=>o.audience));if(!n.some((o,a)=>!!(JO(o,e[a])||ZO(eP(o,e[a]))))&&n.length===2&&t.size===2&&t.has("business")&&t.has("personal"))return"B|P";if(n.length===1){const[o]=n;return tP(o,e[0])}return null}function h3({account:n,zone:e,originalIndex:t,isHovered:i,isDragging:o,offset:a,showDetails:r,privacyMode:c,onMouseEnter:d,onMouseLeave:f,onPointerDown:m,onPointerMove:g,onPointerUp:x,onPauseToggle:v,isPausingAccount:C}){const{t:k}=Ce(),w=a3[e],P=l3(e,n.color),T=r3[e],M=n.provider.toLowerCase(),D=VO.includes(M)||s3.includes(M),L=(n.variants?.length??0)>1,{data:N,isLoading:j}=n3(M,n.id,D&&!L),K=i3((n.variants??[]).map(oe=>({provider:n.provider,accountId:oe.id})),D&&L),U=L?n.variants??[]:[],z=U.map((oe,B)=>K[B]?.data),X=d3(U,z),H=L?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"inline-flex shrink-0 items-center overflow-hidden rounded-md border border-border/60 bg-muted/60 shadow-sm shadow-black/5 dark:bg-zinc-900/80",title:U.map((oe,B)=>Vk(oe,z[B])??k("accountSurfaceCard.variant")).join(" • "),children:X?p.jsx("span",{className:"inline-flex min-w-[2.2rem] items-center justify-center px-1.5 py-1 text-[9px] font-semibold leading-none text-foreground/80",children:X}):U.map((oe,B)=>p.jsx("span",{className:q("inline-flex min-w-[1.9rem] items-center justify-center px-1.5 py-1 text-[9px] font-semibold leading-none",B>0&&"border-l border-border/50",oe.audience==="business"?"bg-sky-500/12 text-sky-700 dark:bg-sky-500/20 dark:text-sky-300":oe.audience==="free"?"bg-slate-200/70 text-slate-700 dark:bg-slate-700/40 dark:text-slate-200":oe.audience==="personal"?"bg-emerald-500/12 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-300":"bg-muted text-muted-foreground"),children:tP(oe,z[B])},oe.id))}),n.paused&&p.jsx("span",{className:"text-[7px] font-bold uppercase tracking-wide px-1 py-px rounded shrink-0 bg-amber-500/15 text-amber-700 dark:bg-amber-500/25 dark:text-amber-300",children:"Paused"})]}):void 0,V=L&&D?(n.variants??[]).map((oe,B)=>{const Z=K[B],se=Z?.data,Y=RO(n.provider,se),ae=EO(n.provider,se),de=Y!==null?Sr(Y):null,be=de!==null?Number(de):null,te=Db(se),le=Vk(oe,se)??cy(oe.email);return p.jsxs(Do,{children:[p.jsx(Mo,{asChild:!0,children:p.jsxs("div",{className:"space-y-0.5 cursor-help",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2 text-[8px]",children:[p.jsx("span",{className:"text-muted-foreground/80 truncate",children:le}),p.jsx("span",{className:"font-mono text-foreground/80 shrink-0",children:Z?.isLoading?k("accountCard.quotaLoading"):be!==null?`${de}%`:te?.label||k("accountCard.quotaUnavailable")})]}),be!==null&&p.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full overflow-hidden",children:p.jsx("div",{className:q("h-full rounded-full transition-all",c3(be)),style:{width:`${be}%`}})})]})}),p.jsx(No,{side:"top",className:"sm:max-w-sm",children:p.jsx(uy,{quota:se,resetTime:ae})})]},oe.id)}):null,ie=p.jsxs(p.Fragment,{children:[v&&p.jsx(pa,{children:p.jsxs(Do,{children:[p.jsx(Mo,{asChild:!0,children:p.jsx(gt,{variant:"ghost",size:"icon",className:q("h-4 w-4 shrink-0 transition-all rounded-full",n.paused?"bg-amber-500/20 hover:bg-amber-500/30":"hover:bg-muted"),onClick:oe=>{oe.stopPropagation(),v(n.memberIds??[n.id],!n.paused)},disabled:C,children:C?p.jsx(hi,{className:"w-2.5 h-2.5 animate-spin"}):n.paused?p.jsx(NE,{className:"w-2.5 h-2.5 text-amber-600 dark:text-amber-400"}):p.jsx(mO,{className:"w-2.5 h-2.5 text-muted-foreground/50 hover:text-foreground"})})}),p.jsx(No,{side:"top",className:"text-xs",children:n.paused?k("accountCard.resumeAccount"):k("accountCard.pauseAccount")})]})}),p.jsx(Qh,{className:"w-4 h-4 text-muted-foreground/40 shrink-0"})]});return p.jsxs("div",{"data-account-index":t,"data-zone":e,onMouseEnter:d,onMouseLeave:f,onPointerDown:m,onPointerMove:g,onPointerUp:x,onPointerCancel:x,className:q("group/card relative rounded-lg p-3 w-44 cursor-grab transition-shadow duration-200","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border border-border/50 dark:border-white/[0.08]",w,"select-none touch-none",i&&"bg-muted/50 dark:bg-zinc-800/60",o&&"cursor-grabbing shadow-xl scale-105 z-50",n.paused&&"opacity-60"),style:{...P,transform:`translate(${a.x}px, ${a.y}px)${o?" scale(1.05)":""}`},children:[p.jsx(zB,{mode:"compact",provider:n.provider,accountId:n.id,email:n.email,displayEmail:cy(n.email),tokenFile:n.tokenFile,tier:n.tier,isDefault:n.isDefault,paused:n.paused,privacyMode:c,showQuota:D&&!L,quota:N,quotaLoading:j,runtimeLastUsed:n.lastUsedAt,headerEnd:ie,compactMetaBadges:H,footerSlot:p.jsxs(p.Fragment,{children:[p.jsx(o3,{success:n.successCount,failure:n.failureCount,showDetails:r}),V&&p.jsx("div",{className:"mt-2 px-0.5 space-y-1",children:V})]})}),p.jsx("div",{className:q("absolute w-3 h-3 rounded-full transform z-20 transition-colors border","bg-muted dark:bg-zinc-800 border-border dark:border-zinc-600",T,i&&"bg-foreground dark:bg-white border-transparent")})]})}function Gb({provider:n,className:e,size:t=18,withBackground:i=!1}){const o=n.toLowerCase(),a=UO(n),r=_b[o]||"#6b7280",c=i?Math.floor(t*.65):t,d=a?p.jsx("img",{src:a,alt:`${n} icon`,width:c,height:c,className:"shrink-0 object-contain"}):p.jsx("span",{className:"font-bold",style:{color:r,fontSize:c*.6},children:n.charAt(0).toUpperCase()});if(i)return p.jsx("div",{className:q("shrink-0 rounded-full bg-white border border-border flex items-center justify-center shadow-sm",e),style:{width:t,height:t},children:d});if(a)return p.jsx("img",{src:a,alt:`${n} icon`,width:t,height:t,className:q("shrink-0 rounded-sm object-contain",e)});const f=r;return p.jsx("div",{className:q("shrink-0 rounded-full flex items-center justify-center text-white font-bold",e),style:{width:t,height:t,backgroundColor:f,fontSize:t*.5},children:n.charAt(0).toUpperCase()})}function f3({providerData:n,providerColor:e,totalRequests:t,maxRequests:i,showVisibleMetrics:o=!1,hiddenPausedCount:a=0,isDragging:r,offset:c,hoveredAccount:d,hasRightAccounts:f,hasTopAccounts:m,hasBottomAccounts:g,onPointerDown:x,onPointerMove:v,onPointerUp:C}){const{t:k}=Ce(),{accounts:w}=n,P=Math.max(1,i*Math.max(1,w.length));return p.jsxs("div",{"data-provider-node":!0,onPointerDown:x,onPointerMove:v,onPointerUp:C,onPointerCancel:C,className:q("group relative w-full rounded-xl p-4 cursor-grab transition-shadow duration-200","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border-2 border-border/50 dark:border-white/[0.08]",!r&&"animate-subtle-float animate-border-glow","select-none touch-none",d!==null&&"scale-[1.02]",r&&"cursor-grabbing shadow-2xl scale-105 z-50"),style:{"--glow-color":`${e}60`,borderColor:d!==null?`${e}80`:void 0,transform:`translate(${c.x}px, ${c.y}px)${r?" scale(1.05)":""}`},children:[p.jsx(Qh,{className:"absolute top-2 right-2 w-4 h-4 text-muted-foreground/40"}),p.jsx("div",{className:"absolute inset-0 rounded-xl animate-glow-pulse pointer-events-none",style:{"--glow-color":`${e}30`}}),p.jsx("div",{className:"absolute top-1/2 -left-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:e,boxShadow:"0 0 0 4px var(--background)"}}),f&&p.jsx("div",{className:"absolute top-1/2 -right-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:e,boxShadow:"0 0 0 4px var(--background)"}}),m&&p.jsx("div",{className:"absolute left-1/2 -top-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:e,boxShadow:"0 0 0 4px var(--background)"}}),g&&p.jsx("div",{className:"absolute left-1/2 -bottom-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:e,boxShadow:"0 0 0 4px var(--background)"}}),p.jsxs("div",{className:"flex items-center gap-3 mb-4 relative z-10",children:[p.jsx("div",{className:"animate-icon-breathe",children:p.jsx(Gb,{provider:n.provider,size:36,withBackground:!0})}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:n.displayName}),p.jsx("p",{className:"text-[10px] text-muted-foreground font-medium uppercase",children:k("flowViz.provider")})]})]}),p.jsxs("div",{className:"space-y-2 relative z-10",children:[p.jsxs("div",{className:"flex justify-between items-center text-xs",children:[p.jsx("span",{className:"text-muted-foreground",children:k(o?"flowViz.visibleTotalRequests":"flowViz.totalRequests")}),p.jsx("span",{className:"text-foreground font-mono",children:t.toLocaleString()})]}),p.jsxs("div",{className:"flex justify-between items-center text-xs",children:[p.jsx("span",{className:"text-muted-foreground",children:k(o?"flowViz.visibleAccounts":"flowViz.accounts")}),p.jsx("span",{className:"text-foreground font-mono",children:w.length})]}),p.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full mt-2 overflow-hidden",children:p.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.min(100,t/P*100)}%`,backgroundColor:e}})}),o&&a>0&&p.jsx("div",{className:"text-[10px] text-muted-foreground",children:k("flowViz.excludingPausedAccounts",{count:a})})]})]})}function p3({paths:n,accounts:e,maxRequests:t,hoveredAccount:i,pulsingAccounts:o}){return p.jsxs(p.Fragment,{children:[p.jsx("defs",{children:p.jsxs("filter",{id:"flow-glow",x:"-20%",y:"-20%",width:"140%",height:"140%",filterUnits:"userSpaceOnUse",children:[p.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),p.jsx("feComposite",{in:"SourceGraphic",in2:"blur",operator:"over"})]})}),n.map((a,r)=>{const c=e[r];if(!c)return null;const d=c.successCount+c.failureCount,f=Math.max(2,d/t*10),m=i===r,g=i!==null&&i!==r,x=o.has(c.id),v=uB(r);return p.jsxs("g",{children:[p.jsx("path",{d:a,fill:"none",stroke:v,strokeWidth:f,strokeOpacity:m?.8:g?.15:.4,strokeLinecap:"round",filter:m?"url(#flow-glow)":void 0,className:"transition-all duration-300"}),x&&p.jsxs(p.Fragment,{children:[p.jsx("path",{d:a,fill:"none",stroke:c.color,strokeWidth:f*2,strokeLinecap:"round",filter:"url(#flow-glow)",className:"animate-request-pulse"}),p.jsx("circle",{r:6,fill:c.color,filter:"url(#flow-glow)",style:{offsetPath:`path('${a}')`,offsetDistance:"0%",animation:"travel-dot 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards"}})]})]},r)})]})}function m3({onBack:n,showDetails:e,onToggleDetails:t,showPausedAccounts:i,pausedAccountsCount:o,onTogglePausedAccounts:a,hasCustomPositions:r,onResetPositions:c}){const{t:d}=Ce();return p.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",children:[n?p.jsxs("button",{onClick:n,className:"group flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground transition-all duration-200 px-3 py-1.5 rounded-md hover:bg-muted/50 border border-transparent hover:border-border/50",children:[p.jsx(Vh,{className:"w-3.5 h-3.5 rotate-180 transition-transform group-hover:-translate-x-0.5"}),p.jsx("span",{children:d("flowViz.backToProviders")})]}):p.jsx("div",{}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("button",{onClick:t,className:q("flex items-center gap-1.5 text-xs font-medium transition-all duration-200 px-3 py-1.5 rounded-md border shadow-sm",e?"bg-primary text-primary-foreground border-primary hover:bg-primary/90":"bg-background text-muted-foreground hover:text-foreground border-border/60 hover:border-border hover:bg-muted/50"),children:[e?p.jsx(Kc,{className:"w-3.5 h-3.5"}):p.jsx(Vc,{className:"w-3.5 h-3.5"}),p.jsx("span",{children:d(e?"flowViz.hideDetails":"flowViz.showDetails")})]}),o>0&&p.jsxs("button",{onClick:a,className:q("flex items-center gap-1.5 text-xs font-medium transition-all duration-200 px-3 py-1.5 rounded-md border shadow-sm",i?"bg-background text-muted-foreground hover:text-foreground border-border/60 hover:border-border hover:bg-muted/50":"bg-amber-500/15 text-amber-700 border-amber-500/40 hover:bg-amber-500/20 dark:bg-amber-500/20 dark:text-amber-300 dark:border-amber-500/30"),children:[p.jsx(LE,{className:"w-3.5 h-3.5"}),p.jsx("span",{children:i?d("flowViz.hidePausedAccounts",{count:o}):d("flowViz.showPausedAccounts",{count:o})})]}),r&&p.jsxs("button",{onClick:c,className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground transition-all duration-200 px-3 py-1.5 rounded-md border border-border/60 hover:border-border bg-background hover:bg-muted/50 shadow-sm",children:[p.jsx(RE,{className:"w-3.5 h-3.5"}),p.jsx("span",{children:d("flowViz.resetLayout")})]})]})]})}const Wk="ccs-auth-monitor-show-paused";function g3({providerData:n,onBack:e,onPauseToggle:t,isPausingAccount:i}){const o=A.useRef(null),a=A.useRef(null),[r,c]=A.useState(null),[d,f]=A.useState(!1),[m,g]=A.useState(()=>{if(typeof window<"u"){const De=localStorage.getItem(Wk);return De!==null?De==="true":!0}return!0}),[x,v]=A.useState([]),{privacyMode:C}=kb(),{accounts:k}=n,w=A.useMemo(()=>k.filter(De=>De.paused).length,[k]),P=A.useMemo(()=>m?k:k.filter(De=>!De.paused),[k,m]),T=A.useMemo(()=>new Set(P.map(De=>De.id)),[P]),M=Math.max(...P.map(De=>De.successCount+De.failureCount),1),D=P.reduce((De,Ye)=>De+Ye.successCount+Ye.failureCount,0),L=A.useMemo(()=>({...n,accounts:P,totalRequests:D}),[n,P,D]),N=A.useCallback(()=>{const De=fB({containerRef:o,svgRef:a,accounts:P});v(De)},[P]),j=`ccs-flow-positions-${n.provider}`,{dragOffsets:K,draggingId:U,handlePointerDown:z,handlePointerMove:X,handlePointerUp:H,getOffset:V,resetPositions:ie,hasCustomPositions:oe}=gB({storageKey:j,onDrag:N}),B=A.useMemo(()=>Object.fromEntries(Object.entries(K).filter(([De])=>De==="provider"||T.has(De))),[K,T]),Z=yB(B),se=Object.keys(B).length>0,Y=bB(P),ae=A.useMemo(()=>hB(P).slice(0,cB),[P]);A.useEffect(()=>{const De=setTimeout(N,50);return window.addEventListener("resize",N),()=>{clearTimeout(De),window.removeEventListener("resize",N)}},[N]),A.useEffect(()=>{const De=setTimeout(N,10);return()=>clearTimeout(De)},[K,N]),A.useEffect(()=>{const De=Date.now(),Ye=350,it=()=>{N(),Date.now()-De<Ye&&requestAnimationFrame(it)};requestAnimationFrame(it)},[d,N]);const de=_b[n.provider.toLowerCase()]||"#6b7280",be=A.useMemo(()=>pB(P),[P]),{leftAccounts:te,rightAccounts:le,topAccounts:xe,bottomAccounts:Se}=be,ye=le.length>0,Te=xe.length>0,Ie=Se.length>0,nt=A.useMemo(()=>mB(P.length),[P.length]),Ot=(De,Ye)=>De.map(it=>{const ln=P.findIndex(Sn=>Sn.id===it.id);return p.jsx(h3,{account:it,zone:Ye,originalIndex:ln,isHovered:r===ln,isDragging:U===it.id,offset:V(it.id),showDetails:d,privacyMode:C,onMouseEnter:()=>c(ln),onMouseLeave:()=>c(null),onPointerDown:Sn=>z(it.id,Sn),onPointerMove:X,onPointerUp:H,onPauseToggle:t,isPausingAccount:i},it.id)});return p.jsxs("div",{className:"flex flex-col",ref:o,children:[p.jsx(m3,{onBack:e,showDetails:d,onToggleDetails:()=>f(!d),showPausedAccounts:m,pausedAccountsCount:w,onTogglePausedAccounts:()=>{c(null);const De=!m;g(De),typeof window<"u"&&localStorage.setItem(Wk,String(De))},hasCustomPositions:oe&&se,onResetPositions:ie}),p.jsxs("div",{className:"min-h-[320px] flex gap-4 px-4 py-6 self-stretch items-stretch transition-all duration-200",children:[p.jsxs("div",{className:"relative flex-1 flex flex-col items-stretch justify-center px-4",style:{paddingTop:`${24+Z.paddingTop}px`,paddingBottom:`${24+Z.paddingBottom}px`,minHeight:`${320+Z.extraHeight}px`},children:[p.jsx("svg",{ref:a,className:"absolute inset-0 w-full h-full pointer-events-none z-0 overflow-visible",children:p.jsx(p3,{paths:x,accounts:P,maxRequests:M,hoveredAccount:r,pulsingAccounts:Y})}),Te&&p.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mb-8",children:Ot(xe,"top")}),p.jsxs("div",{className:"flex items-center justify-between gap-8 flex-1",children:[p.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:Ot(te,"left")}),p.jsx("div",{className:q("z-10 flex items-center flex-shrink-0",nt),children:p.jsx(f3,{providerData:L,providerColor:de,totalRequests:D,maxRequests:M,showVisibleMetrics:!m&&w>0,hiddenPausedCount:m?0:w,isDragging:U==="provider",offset:V("provider"),hoveredAccount:r,hasRightAccounts:ye,hasTopAccounts:Te,hasBottomAccounts:Ie,onPointerDown:De=>z("provider",De),onPointerMove:X,onPointerUp:H})}),ye&&p.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:Ot(le,"right")})]}),Ie&&p.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mt-8",children:Ot(Se,"bottom")})]}),p.jsx("div",{className:"w-56 flex-shrink-0 self-stretch relative",children:p.jsx("div",{className:"absolute inset-0",children:p.jsx(xB,{events:ae,privacyMode:C})})})]})]})}function y3(n,e){return`${n.trim().toLowerCase()}:${e.trim()}`}function b3(n,e){const t=Array.from(new Set([e.id,e.email].filter(i=>!!i?.trim())));for(const i of t){const o=y3(e.provider,i),a=n?.accountStats?.[o]??n?.accountStats?.[i];if(a)return a}}const Qk={business:0,personal:1,free:2,unknown:3};function x3(n,e){return e?n?new Date(e).getTime()>new Date(n).getTime()?e:n:e:n}function v3(n,e){const t=Fb(n.id,n.email,n.tokenFile),i=b3(e,n);return{id:n.id,email:t.email||n.email||n.id,tokenFile:n.tokenFile,isDefault:n.isDefault,successCount:i?.successCount??0,failureCount:i?.failureCount??0,lastUsedAt:i?.lastUsedAt??n.lastUsedAt,paused:n.paused,tier:n.tier,audience:t.audience,audienceLabel:t.audienceLabel,detailLabel:t.detailLabel,compactDetailLabel:t.compactDetailLabel,inlineLabel:t.inlineLabel}}function C3(n){return[...n].sort((e,t)=>{const i=Qk[e.audience]-Qk[t.audience];if(i!==0)return i;const o=e.inlineLabel??e.audienceLabel??e.detailLabel??e.id,a=t.inlineLabel??t.audienceLabel??t.detailLabel??t.id;return o.localeCompare(a)})}function S3(n,e){const t=new Map,i=new Map;for(const o of n){const a=v3(o,e),c=o.provider.toLowerCase()==="codex"?`${o.provider}:${a.email}`:o.id;t.has(c)||t.set(c,[]),t.get(c)?.push(a),i.set(o.id,o)}return Array.from(t.entries()).map(([o,a])=>{if(a.length===1){const[f]=a,m=i.get(f.id);return{id:f.id,email:f.email,tokenFile:f.tokenFile,provider:m?.provider??"codex",isDefault:f.isDefault,successCount:f.successCount,failureCount:f.failureCount,lastUsedAt:f.lastUsedAt,paused:f.paused,tier:f.tier,projectId:m?.projectId}}const r=C3(a),c=r[0]?.email??o,d=i.get(r[0]?.id??"")?.provider??"codex";return{id:o,email:c,tokenFile:r[0]?.tokenFile??"",provider:d,isDefault:r.some(f=>f.isDefault),successCount:r.reduce((f,m)=>f+m.successCount,0),failureCount:r.reduce((f,m)=>f+m.failureCount,0),lastUsedAt:r.reduce((f,m)=>x3(f,m.lastUsedAt),void 0),paused:r.every(f=>!!f.paused),memberIds:r.map(f=>f.id),variants:r}})}function nP(n,e){const t=n+e;return t===0?100:Math.round(n/t*100)}const Yk=["#1e6091","#2d8a6e","#d4a012","#c92a2d","#c45a1a","#6b9c4d","#3d5a73","#cc7614","#3a7371","#7c5fc4"];function k3(){const{data:n,isLoading:e,error:t}=GI(),{data:i,isLoading:o,dataUpdatedAt:a}=KB(),[r,c]=A.useState("");A.useEffect(()=>{if(!a)return;const C=()=>{const w=Math.floor((Date.now()-a)/1e3);w<60?c(`${w}s ago`):c(`${Math.floor(w/60)}m ago`)};C();const k=setInterval(C,1e3);return()=>clearInterval(k)},[a]);const{accounts:d,totalSuccess:f,totalFailure:m,totalRequests:g,providerStats:x}=A.useMemo(()=>{if(!n?.authStatus)return{accounts:[],totalSuccess:0,totalFailure:0,totalRequests:0,providerStats:[]};const C=[],k=new Map;let w=0,P=0,T=0;n.authStatus.forEach(D=>{const L=D.provider;k.has(L)||k.set(L,{success:0,failure:0,accounts:[]});const N=k.get(L);if(!N)return;const j=(D.accounts??[]).map(K=>({...K,provider:K.provider||D.provider}));S3(j,i).forEach(K=>{w+=K.successCount,P+=K.failureCount,N.success+=K.successCount,N.failure+=K.failureCount;const U={id:K.id,email:K.email,tokenFile:K.tokenFile,provider:D.provider,displayName:D.displayName,isDefault:K.isDefault,successCount:K.successCount,failureCount:K.failureCount,lastUsedAt:K.lastUsedAt,color:Yk[T%Yk.length],projectId:K.projectId,paused:K.paused,tier:K.tier,memberIds:K.memberIds,variants:K.variants};C.push(U),N.accounts.push(U),T++})});const M=[];return k.forEach((D,L)=>{D.accounts.length!==0&&M.push({provider:L,displayName:Hb(L),totalRequests:D.success+D.failure,successCount:D.success,failureCount:D.failure,accountCount:D.accounts.length,accounts:D.accounts})}),M.sort((D,L)=>L.totalRequests-D.totalRequests),{accounts:C,totalSuccess:w,totalFailure:P,totalRequests:w+P,providerStats:M}},[n?.authStatus,i]),v=g>0?Math.round(f/g*100):100;return{accounts:d,totalSuccess:f,totalFailure:m,totalRequests:g,providerStats:x,overallSuccessRate:v,isLoading:e||o,error:t??null,timeSinceUpdate:r}}function w3(){return p.jsxs("div",{className:"relative flex items-center justify-center w-5 h-5",children:[p.jsx("div",{className:"absolute w-4 h-4 rounded-full animate-ping opacity-20",style:{backgroundColor:Ln.success}}),p.jsx("div",{className:"absolute w-3 h-3 rounded-full animate-pulse opacity-40",style:{backgroundColor:Ln.success}}),p.jsx("div",{className:"relative w-2 h-2 rounded-full z-10",style:{backgroundColor:Ln.success}})]})}function A3({success:n,failure:e}){const{t}=Ce();return n===0&&e===0?p.jsx("span",{className:"text-[9px] text-muted-foreground/50 font-mono",children:t("authMonitorLive.noActivity")}):p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("div",{className:"flex items-center gap-0.5",children:[p.jsx(Wc,{className:"w-3 h-3 text-emerald-700 dark:text-emerald-500"}),p.jsx("span",{className:"text-[10px] font-mono font-medium text-emerald-700 dark:text-emerald-500",children:n.toLocaleString()})]}),e>0&&p.jsxs("div",{className:"flex items-center gap-0.5",children:[p.jsx(vb,{className:"w-3 h-3 text-red-700 dark:text-red-500"}),p.jsx("span",{className:"text-[10px] font-mono font-medium text-red-700 dark:text-red-500",children:e.toLocaleString()})]})]})}function O3({stats:n,isHovered:e,privacyMode:t,onSelect:i,onMouseEnter:o,onMouseLeave:a}){const{t:r}=Ce(),c=nP(n.successCount,n.failureCount),d=_b[n.provider.toLowerCase()]||"#6b7280";return p.jsxs("button",{onClick:i,onMouseEnter:o,onMouseLeave:a,className:q("group relative rounded-xl p-4 text-left transition-all duration-300","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border border-border/50 dark:border-white/[0.08]","hover:border-opacity-50 hover:scale-[1.02] hover:shadow-lg",e&&"ring-1"),style:{borderColor:e?d:void 0,"--ring-color":d},children:[p.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[p.jsx(Gb,{provider:n.provider,size:36,withBackground:!0}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:n.displayName}),p.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[n.accountCount," account",n.accountCount!==1?"s":""]})]}),p.jsx(Vh,{className:q("w-4 h-4 ml-auto text-muted-foreground transition-all",e?"opacity-100 translate-x-0":"opacity-0 -translate-x-2")})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex justify-between items-center text-xs",children:[p.jsx("span",{className:"text-muted-foreground",children:r("authMonitorLive.stats")}),p.jsx(A3,{success:n.successCount,failure:n.failureCount})]}),p.jsxs("div",{className:"flex justify-between text-xs",children:[p.jsx("span",{className:"text-muted-foreground",children:r("authMonitorLive.successRate")}),p.jsxs("span",{className:"font-mono font-semibold",style:{color:c===100?Ln.success:c>=95?Ln.degraded:Ln.failed},children:[c,"%"]})]}),p.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full overflow-hidden",children:p.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${c}%`,backgroundColor:d}})})]}),p.jsxs("div",{className:"flex gap-1 mt-3 items-center",children:[n.accounts.slice(0,5).map(f=>{const m=n.provider==="agy"&&!f.projectId;return p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:q("w-2 h-2 rounded-full",f.paused&&"opacity-50"),style:{backgroundColor:f.color},title:t?"••••••":PB(f.id,f.email,f.tokenFile)}),m&&p.jsx(pa,{children:p.jsxs(Do,{children:[p.jsx(Mo,{asChild:!0,children:p.jsx(Qi,{className:"absolute -top-1 -right-1 w-2.5 h-2.5 text-amber-500","aria-label":r("providerCard.missingProjectIdAria")})}),p.jsx(No,{side:"top",className:"text-xs",children:"Missing Project ID - re-add account to fix"})]})})]},f.id)}),n.accounts.length>5&&p.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["+",n.accounts.length-5]})]})]})}function wd({icon:n,label:e,value:t,color:i}){return p.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-card/50 dark:bg-zinc-900/50 border border-border/50 dark:border-white/[0.06]",children:[p.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center",style:{backgroundColor:i?`${i}15`:"var(--muted)",color:i||"var(--muted-foreground)"},children:n}),p.jsxs("div",{children:[p.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:e}),p.jsx("div",{className:"text-lg font-semibold font-mono leading-tight",style:{color:i||"var(--foreground)"},children:t})]})]})}const ag="auth-monitor-selected-provider";function P3(){const{t:n}=Ce(),{accounts:e,totalSuccess:t,totalFailure:i,totalRequests:o,providerStats:a,overallSuccessRate:r,isLoading:c,error:d,timeSinceUpdate:f}=k3(),{privacyMode:m}=kb(),[g,x]=A.useState(()=>typeof window<"u"?localStorage.getItem(ag):null),v=H=>{x(H),H?localStorage.setItem(ag,H):localStorage.removeItem(ag)},C=A.useMemo(()=>g&&a.some(H=>H.provider===g)?g:null,[g,a]),[k,w]=A.useState(null),P=KI(),T=VI(),M=WI(),D=QI(),L=C?a.find(H=>H.provider===C):null,N=L?.accountCount??e.length,j=L?.successCount??t,K=L?.failureCount??i,U=L?.totalRequests??o,z=L?nP(L.successCount,L.failureCount):r,X=(H,V)=>{if(!C||P.isPending||T.isPending||M.isPending||D.isPending)return;if(H.length>1){V?M.mutate({provider:C,accountIds:H}):D.mutate({provider:C,accountIds:H});return}const[ie]=H;ie&&(V?P.mutate({provider:C,accountId:ie}):T.mutate({provider:C,accountId:ie}))};return c?p.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-[13px] bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[p.jsx(tt,{className:"h-4 w-32"}),p.jsx(tt,{className:"h-4 w-20"})]}),p.jsxs("div",{className:"p-4 space-y-4",children:[p.jsx("div",{className:"flex gap-3",children:[1,2,3,4].map(H=>p.jsx(tt,{className:"h-16 flex-1 rounded-lg"},H))}),p.jsx(tt,{className:"h-48 w-full rounded-lg"})]})]}):d||e.length===0?null:p.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-[13px] text-foreground bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border bg-gradient-to-r from-emerald-500/5 via-transparent to-transparent dark:from-emerald-500/10",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(w3,{}),p.jsx("span",{className:"text-xs font-semibold tracking-tight text-foreground",children:n("authMonitorLive.live")}),p.jsx("span",{className:"text-[10px] text-muted-foreground",children:n("authMonitorLive.accountMonitor")})]}),p.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-muted-foreground",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(EE,{className:"w-3 h-3 animate-pulse"}),p.jsx("span",{children:f?n("authMonitorLive.updated",{time:f}):n("authMonitorLive.updatedNow")})]}),p.jsx("span",{className:"text-muted-foreground/50",children:"|"}),p.jsx("span",{children:n("authMonitor.accountsCount",{count:N})}),p.jsxs("span",{className:"font-mono",children:[U.toLocaleString()," ",n("authMonitorLive.requestsLabel")]})]})]}),p.jsxs("div",{className:"grid grid-cols-4 gap-3 p-4 border-b border-border bg-muted/20 dark:bg-zinc-900/30",children:[p.jsx(wd,{icon:p.jsx(bc,{className:"w-4 h-4"}),label:n("authMonitor.accounts"),value:N,color:"var(--accent)"}),p.jsx(wd,{icon:p.jsx(Wc,{className:"w-4 h-4"}),label:n("authMonitor.success"),value:j.toLocaleString(),color:Ln.success}),p.jsx(wd,{icon:p.jsx(vb,{className:"w-4 h-4"}),label:n("authMonitor.failed"),value:K.toLocaleString(),color:K>0?Ln.failed:void 0}),p.jsx(wd,{icon:p.jsx(bc,{className:"w-4 h-4"}),label:n("authMonitor.successRate"),value:`${z}%`,color:z===100?Ln.success:z>=95?Ln.degraded:Ln.failed})]}),p.jsx("div",{className:"relative overflow-hidden",children:L?p.jsx(g3,{providerData:L,onBack:()=>v(null),onPauseToggle:X,isPausingAccount:P.isPending||T.isPending||M.isPending||D.isPending}):p.jsxs("div",{className:"p-6",children:[p.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-widest mb-4",children:"Request Distribution by Provider"}),p.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-4",children:a.map(H=>p.jsx(O3,{stats:H,isHovered:k===H.provider,privacyMode:m,onSelect:()=>v(H.provider),onMouseEnter:()=>w(H.provider),onMouseLeave:()=>w(null)},H.provider))})]})})]})}const sf=A.createContext(null);sf.displayName="PanelGroupContext";const Mt={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Kb=10,la=A.useLayoutEffect,$k=uE.useId,T3=typeof $k=="function"?$k:()=>null;let D3=0;function Vb(n=null){const e=T3(),t=A.useRef(n||e||null);return t.current===null&&(t.current=""+D3++),n??t.current}function iP({children:n,className:e="",collapsedSize:t,collapsible:i,defaultSize:o,forwardedRef:a,id:r,maxSize:c,minSize:d,onCollapse:f,onExpand:m,onResize:g,order:x,style:v,tagName:C="div",...k}){const w=A.useContext(sf);if(w===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:P,expandPanel:T,getPanelSize:M,getPanelStyle:D,groupId:L,isPanelCollapsed:N,reevaluatePanelConstraints:j,registerPanel:K,resizePanel:U,unregisterPanel:z}=w,X=Vb(r),H=A.useRef({callbacks:{onCollapse:f,onExpand:m,onResize:g},constraints:{collapsedSize:t,collapsible:i,defaultSize:o,maxSize:c,minSize:d},id:X,idIsFromProps:r!==void 0,order:x});A.useRef({didLogMissingDefaultSizeWarning:!1}),la(()=>{const{callbacks:ie,constraints:oe}=H.current,B={...oe};H.current.id=X,H.current.idIsFromProps=r!==void 0,H.current.order=x,ie.onCollapse=f,ie.onExpand=m,ie.onResize=g,oe.collapsedSize=t,oe.collapsible=i,oe.defaultSize=o,oe.maxSize=c,oe.minSize=d,(B.collapsedSize!==oe.collapsedSize||B.collapsible!==oe.collapsible||B.maxSize!==oe.maxSize||B.minSize!==oe.minSize)&&j(H.current,B)}),la(()=>{const ie=H.current;return K(ie),()=>{z(ie)}},[x,X,K,z]),A.useImperativeHandle(a,()=>({collapse:()=>{P(H.current)},expand:ie=>{T(H.current,ie)},getId(){return X},getSize(){return M(H.current)},isCollapsed(){return N(H.current)},isExpanded(){return!N(H.current)},resize:ie=>{U(H.current,ie)}}),[P,T,M,N,X,U]);const V=D(H.current,o);return A.createElement(C,{...k,children:n,className:e,id:X,style:{...V,...v},[Mt.groupId]:L,[Mt.panel]:"",[Mt.panelCollapsible]:i||void 0,[Mt.panelId]:X,[Mt.panelSize]:parseFloat(""+V.flexGrow).toFixed(1)})}const Sc=A.forwardRef((n,e)=>A.createElement(iP,{...n,forwardedRef:e}));iP.displayName="Panel";Sc.displayName="forwardRef(Panel)";let dy=null,eh=-1,ds=null;function M3(n,e,t){const i=(e&lP)!==0,o=(e&cP)!==0,a=(e&uP)!==0,r=(e&dP)!==0;if(e){if(i)return a?"se-resize":r?"ne-resize":"e-resize";if(o)return a?"sw-resize":r?"nw-resize":"w-resize";if(a)return"s-resize";if(r)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function N3(){ds!==null&&(document.head.removeChild(ds),dy=null,ds=null,eh=-1)}function rg(n,e,t){var i,o;const a=M3(n,e);if(dy!==a){if(dy=a,ds===null&&(ds=document.createElement("style"),document.head.appendChild(ds)),eh>=0){var r;(r=ds.sheet)===null||r===void 0||r.removeRule(eh)}eh=(i=(o=ds.sheet)===null||o===void 0?void 0:o.insertRule(`*{cursor: ${a} !important;}`))!==null&&i!==void 0?i:-1}}function oP(n){return n.type==="keydown"}function sP(n){return n.type.startsWith("pointer")}function aP(n){return n.type.startsWith("mouse")}function af(n){if(sP(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(aP(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function L3(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function R3(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function E3(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:Zk(n),b:Zk(e)};let i;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),i=n;Be(i,"Stacking order can only be calculated for elements with a common ancestor");const o={a:Jk(Xk(t.a)),b:Jk(Xk(t.b))};if(o.a===o.b){const a=i.childNodes,r={a:t.a.at(-1),b:t.b.at(-1)};let c=a.length;for(;c--;){const d=a[c];if(d===r.a)return 1;if(d===r.b)return-1}}return Math.sign(o.a-o.b)}const j3=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function I3(n){var e;const t=getComputedStyle((e=rP(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function B3(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||I3(n))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||j3.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Xk(n){let e=n.length;for(;e--;){const t=n[e];if(Be(t,"Missing node"),B3(t))return t}return null}function Jk(n){return n&&Number(getComputedStyle(n).zIndex)||0}function Zk(n){const e=[];for(;n;)e.push(n),n=rP(n);return e}function rP(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const lP=1,cP=2,uP=4,dP=8,_3=L3()==="coarse";let ki=[],wr=!1,hs=new Map,rf=new Map;const kc=new Set;function H3(n,e,t,i,o){var a;const{ownerDocument:r}=e,c={direction:t,element:e,hitAreaMargins:i,setResizeHandlerState:o},d=(a=hs.get(r))!==null&&a!==void 0?a:0;return hs.set(r,d+1),kc.add(c),mh(),function(){var m;rf.delete(n),kc.delete(c);const g=(m=hs.get(r))!==null&&m!==void 0?m:1;if(hs.set(r,g-1),mh(),g===1&&hs.delete(r),ki.includes(c)){const x=ki.indexOf(c);x>=0&&ki.splice(x,1),lf(),o("up",!0,null)}}}function U3(n){const{target:e}=n,{x:t,y:i}=af(n);wr=!0,Wb({target:e,x:t,y:i}),mh(),ki.length>0&&(gh("down",n),lf(),n.preventDefault(),hP(e)||n.stopImmediatePropagation())}function lg(n){const{x:e,y:t}=af(n);if(wr&&n.type!=="pointerleave"&&n.buttons===0&&(wr=!1,gh("up",n)),!wr){const{target:i}=n;Wb({target:i,x:e,y:t})}gh("move",n),lf(),ki.length>0&&n.preventDefault()}function cg(n){const{target:e}=n,{x:t,y:i}=af(n);rf.clear(),wr=!1,ki.length>0&&(n.preventDefault(),hP(e)||n.stopImmediatePropagation()),gh("up",n),Wb({target:e,x:t,y:i}),lf(),mh()}function hP(n){let e=n;for(;e;){if(e.hasAttribute(Mt.resizeHandle))return!0;e=e.parentElement}return!1}function Wb({target:n,x:e,y:t}){ki.splice(0);let i=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(i=n),kc.forEach(o=>{const{element:a,hitAreaMargins:r}=o,c=a.getBoundingClientRect(),{bottom:d,left:f,right:m,top:g}=c,x=_3?r.coarse:r.fine;if(e>=f-x&&e<=m+x&&t>=g-x&&t<=d+x){if(i!==null&&document.contains(i)&&a!==i&&!a.contains(i)&&!i.contains(a)&&E3(i,a)>0){let C=i,k=!1;for(;C&&!C.contains(a);){if(R3(C.getBoundingClientRect(),c)){k=!0;break}C=C.parentElement}if(k)return}ki.push(o)}})}function ug(n,e){rf.set(n,e)}function lf(){let n=!1,e=!1;ki.forEach(i=>{const{direction:o}=i;o==="horizontal"?n=!0:e=!0});let t=0;rf.forEach(i=>{t|=i}),n&&e?rg("intersection",t):n?rg("horizontal",t):e?rg("vertical",t):N3()}let dg;function mh(){var n;(n=dg)===null||n===void 0||n.abort(),dg=new AbortController;const e={capture:!0,signal:dg.signal};kc.size&&(wr?(ki.length>0&&hs.forEach((t,i)=>{const{body:o}=i;t>0&&(o.addEventListener("contextmenu",cg,e),o.addEventListener("pointerleave",lg,e),o.addEventListener("pointermove",lg,e))}),hs.forEach((t,i)=>{const{body:o}=i;o.addEventListener("pointerup",cg,e),o.addEventListener("pointercancel",cg,e)})):hs.forEach((t,i)=>{const{body:o}=i;t>0&&(o.addEventListener("pointerdown",U3,e),o.addEventListener("pointermove",lg,e))}))}function gh(n,e){kc.forEach(t=>{const{setResizeHandlerState:i}=t,o=ki.includes(t);i(n,o,e)})}function z3(){const[n,e]=A.useState(0);return A.useCallback(()=>e(t=>t+1),[])}function Be(n,e){if(!n)throw console.error(e),Error(e)}function ma(n,e,t=Kb){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function So(n,e,t=Kb){return ma(n,e,t)===0}function Vn(n,e,t){return ma(n,e,t)===0}function F3(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i<n.length;i++){const o=n[i],a=e[i];if(!Vn(o,a,t))return!1}return!0}function yr({panelConstraints:n,panelIndex:e,size:t}){const i=n[e];Be(i!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:o=0,collapsible:a,maxSize:r=100,minSize:c=0}=i;if(ma(t,c)<0)if(a){const d=(o+c)/2;ma(t,d)<0?t=o:t=c}else t=c;return t=Math.min(r,t),t=parseFloat(t.toFixed(Kb)),t}function Jl({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:i,prevLayout:o,trigger:a}){if(Vn(n,0))return e;const r=[...e],[c,d]=i;Be(c!=null,"Invalid first pivot index"),Be(d!=null,"Invalid second pivot index");let f=0;if(a==="keyboard"){{const g=n<0?d:c,x=t[g];Be(x,`Panel constraints not found for index ${g}`);const{collapsedSize:v=0,collapsible:C,minSize:k=0}=x;if(C){const w=e[g];if(Be(w!=null,`Previous layout not found for panel index ${g}`),Vn(w,v)){const P=k-w;ma(P,Math.abs(n))>0&&(n=n<0?0-P:P)}}}{const g=n<0?c:d,x=t[g];Be(x,`No panel constraints found for index ${g}`);const{collapsedSize:v=0,collapsible:C,minSize:k=0}=x;if(C){const w=e[g];if(Be(w!=null,`Previous layout not found for panel index ${g}`),Vn(w,k)){const P=w-v;ma(P,Math.abs(n))>0&&(n=n<0?0-P:P)}}}}{const g=n<0?1:-1;let x=n<0?d:c,v=0;for(;;){const k=e[x];Be(k!=null,`Previous layout not found for panel index ${x}`);const P=yr({panelConstraints:t,panelIndex:x,size:100})-k;if(v+=P,x+=g,x<0||x>=t.length)break}const C=Math.min(Math.abs(n),Math.abs(v));n=n<0?0-C:C}{let x=n<0?c:d;for(;x>=0&&x<t.length;){const v=Math.abs(n)-Math.abs(f),C=e[x];Be(C!=null,`Previous layout not found for panel index ${x}`);const k=C-v,w=yr({panelConstraints:t,panelIndex:x,size:k});if(!Vn(C,w)&&(f+=C-w,r[x]=w,f.toFixed(3).localeCompare(Math.abs(n).toFixed(3),void 0,{numeric:!0})>=0))break;n<0?x--:x++}}if(F3(o,r))return o;{const g=n<0?d:c,x=e[g];Be(x!=null,`Previous layout not found for panel index ${g}`);const v=x+f,C=yr({panelConstraints:t,panelIndex:g,size:v});if(r[g]=C,!Vn(C,v)){let k=v-C,P=n<0?d:c;for(;P>=0&&P<t.length;){const T=r[P];Be(T!=null,`Previous layout not found for panel index ${P}`);const M=T+k,D=yr({panelConstraints:t,panelIndex:P,size:M});if(Vn(T,D)||(k-=D-T,r[P]=D),Vn(k,0))break;n>0?P--:P++}}}const m=r.reduce((g,x)=>x+g,0);return Vn(m,100)?r:o}function q3({layout:n,panelsArray:e,pivotIndices:t}){let i=0,o=100,a=0,r=0;const c=t[0];Be(c!=null,"No pivot index found"),e.forEach((g,x)=>{const{constraints:v}=g,{maxSize:C=100,minSize:k=0}=v;x===c?(i=k,o=C):(a+=k,r+=C)});const d=Math.min(o,100-a),f=Math.max(i,100-r),m=n[c];return{valueMax:d,valueMin:f,valueNow:m}}function wc(n,e=document){return Array.from(e.querySelectorAll(`[${Mt.resizeHandleId}][data-panel-group-id="${n}"]`))}function fP(n,e,t=document){const o=wc(n,t).findIndex(a=>a.getAttribute(Mt.resizeHandleId)===e);return o??null}function pP(n,e,t){const i=fP(n,e,t);return i!=null?[i,i+1]:[-1,-1]}function G3(n){return n instanceof HTMLElement?!0:typeof n=="object"&&n!==null&&"tagName"in n&&"getAttribute"in n}function mP(n,e=document){if(G3(e)&&e.dataset.panelGroupId==n)return e;const t=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return t||null}function cf(n,e=document){const t=e.querySelector(`[${Mt.resizeHandleId}="${n}"]`);return t||null}function K3(n,e,t,i=document){var o,a,r,c;const d=cf(e,i),f=wc(n,i),m=d?f.indexOf(d):-1,g=(o=(a=t[m])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null,x=(r=(c=t[m+1])===null||c===void 0?void 0:c.id)!==null&&r!==void 0?r:null;return[g,x]}function V3({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:i,panelDataArray:o,panelGroupElement:a,setLayout:r}){A.useRef({didWarnAboutMissingResizeHandle:!1}),la(()=>{if(!a)return;const c=wc(t,a);for(let d=0;d<o.length-1;d++){const{valueMax:f,valueMin:m,valueNow:g}=q3({layout:i,panelsArray:o,pivotIndices:[d,d+1]}),x=c[d];if(x!=null){const v=o[d];Be(v,`No panel data found for index "${d}"`),x.setAttribute("aria-controls",v.id),x.setAttribute("aria-valuemax",""+Math.round(f)),x.setAttribute("aria-valuemin",""+Math.round(m)),x.setAttribute("aria-valuenow",g!=null?""+Math.round(g):"")}}return()=>{c.forEach((d,f)=>{d.removeAttribute("aria-controls"),d.removeAttribute("aria-valuemax"),d.removeAttribute("aria-valuemin"),d.removeAttribute("aria-valuenow")})}},[t,i,o,a]),A.useEffect(()=>{if(!a)return;const c=e.current;Be(c,"Eager values not found");const{panelDataArray:d}=c,f=mP(t,a);Be(f!=null,`No group found for id "${t}"`);const m=wc(t,a);Be(m,`No resize handles found for group id "${t}"`);const g=m.map(x=>{const v=x.getAttribute(Mt.resizeHandleId);Be(v,"Resize handle element has no handle id attribute");const[C,k]=K3(t,v,d,a);if(C==null||k==null)return()=>{};const w=P=>{if(!P.defaultPrevented)switch(P.key){case"Enter":{P.preventDefault();const T=d.findIndex(M=>M.id===C);if(T>=0){const M=d[T];Be(M,`No panel data found for index ${T}`);const D=i[T],{collapsedSize:L=0,collapsible:N,minSize:j=0}=M.constraints;if(D!=null&&N){const K=Jl({delta:Vn(D,L)?j-L:L-D,initialLayout:i,panelConstraints:d.map(U=>U.constraints),pivotIndices:pP(t,v,a),prevLayout:i,trigger:"keyboard"});i!==K&&r(K)}}break}}};return x.addEventListener("keydown",w),()=>{x.removeEventListener("keydown",w)}});return()=>{g.forEach(x=>x())}},[a,n,e,t,i,o,r])}function ew(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function gP(n,e){const t=n==="horizontal",{x:i,y:o}=af(e);return t?i:o}function W3(n,e,t,i,o){const a=t==="horizontal",r=cf(e,o);Be(r,`No resize handle element found for id "${e}"`);const c=r.getAttribute(Mt.groupId);Be(c,"Resize handle element has no group id attribute");let{initialCursorPosition:d}=i;const f=gP(t,n),m=mP(c,o);Be(m,`No group element found for id "${c}"`);const g=m.getBoundingClientRect(),x=a?g.width:g.height;return(f-d)/x*100}function Q3(n,e,t,i,o,a){if(oP(n)){const r=t==="horizontal";let c=0;n.shiftKey?c=100:o!=null?c=o:c=10;let d=0;switch(n.key){case"ArrowDown":d=r?0:c;break;case"ArrowLeft":d=r?-c:0;break;case"ArrowRight":d=r?c:0;break;case"ArrowUp":d=r?0:-c;break;case"End":d=100;break;case"Home":d=-100;break}return d}else return i==null?0:W3(n,e,t,i,a)}function Y3({panelDataArray:n}){const e=Array(n.length),t=n.map(a=>a.constraints);let i=0,o=100;for(let a=0;a<n.length;a++){const r=t[a];Be(r,`Panel constraints not found for index ${a}`);const{defaultSize:c}=r;c!=null&&(i++,e[a]=c,o-=c)}for(let a=0;a<n.length;a++){const r=t[a];Be(r,`Panel constraints not found for index ${a}`);const{defaultSize:c}=r;if(c!=null)continue;const d=n.length-i,f=o/d;i++,e[a]=f,o-=f}return e}function ur(n,e,t){e.forEach((i,o)=>{const a=n[o];Be(a,`Panel data not found for index ${o}`);const{callbacks:r,constraints:c,id:d}=a,{collapsedSize:f=0,collapsible:m}=c,g=t[d];if(g==null||i!==g){t[d]=i;const{onCollapse:x,onExpand:v,onResize:C}=r;C&&C(i,g),m&&(x||v)&&(v&&(g==null||So(g,f))&&!So(i,f)&&v(),x&&(g==null||!So(g,f))&&So(i,f)&&x())}})}function Ad(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function $3({defaultSize:n,dragState:e,layout:t,panelData:i,panelIndex:o,precision:a=3}){const r=t[o];let c;return r==null?c=n!=null?n.toFixed(a):"1":i.length===1?c="1":c=r.toFixed(a),{flexBasis:0,flexGrow:c,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function X3(n,e=10){let t=null;return(...o)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...o)},e)}}function tw(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function yP(n){return`react-resizable-panels:${n}`}function bP(n){return n.map(e=>{const{constraints:t,id:i,idIsFromProps:o,order:a}=e;return o?i:a?`${a}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function xP(n,e){try{const t=yP(n),i=e.getItem(t);if(i){const o=JSON.parse(i);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function J3(n,e,t){var i,o;const a=(i=xP(n,t))!==null&&i!==void 0?i:{},r=bP(e);return(o=a[r])!==null&&o!==void 0?o:null}function Z3(n,e,t,i,o){var a;const r=yP(n),c=bP(e),d=(a=xP(n,o))!==null&&a!==void 0?a:{};d[c]={expandToSizes:Object.fromEntries(t.entries()),layout:i};try{o.setItem(r,JSON.stringify(d))}catch(f){console.error(f)}}function nw({layout:n,panelConstraints:e}){const t=[...n],i=t.reduce((a,r)=>a+r,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(a=>`${a}%`).join(", ")}`);if(!Vn(i,100)&&t.length>0)for(let a=0;a<e.length;a++){const r=t[a];Be(r!=null,`No layout data found for index ${a}`);const c=100/i*r;t[a]=c}let o=0;for(let a=0;a<e.length;a++){const r=t[a];Be(r!=null,`No layout data found for index ${a}`);const c=yr({panelConstraints:e,panelIndex:a,size:r});r!=c&&(o+=r-c,t[a]=c)}if(!Vn(o,0))for(let a=0;a<e.length;a++){const r=t[a];Be(r!=null,`No layout data found for index ${a}`);const c=r+o,d=yr({panelConstraints:e,panelIndex:a,size:c});if(r!==d&&(o-=d-r,t[a]=d,Vn(o,0)))break}return t}const e4=100,Zl={getItem:n=>(tw(Zl),Zl.getItem(n)),setItem:(n,e)=>{tw(Zl),Zl.setItem(n,e)}},iw={};function vP({autoSaveId:n=null,children:e,className:t="",direction:i,forwardedRef:o,id:a=null,onLayout:r=null,keyboardResizeBy:c=null,storage:d=Zl,style:f,tagName:m="div",...g}){const x=Vb(a),v=A.useRef(null),[C,k]=A.useState(null),[w,P]=A.useState([]),T=z3(),M=A.useRef({}),D=A.useRef(new Map),L=A.useRef(0),N=A.useRef({autoSaveId:n,direction:i,dragState:C,id:x,keyboardResizeBy:c,onLayout:r,storage:d}),j=A.useRef({layout:w,panelDataArray:[],panelDataArrayChanged:!1});A.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),A.useImperativeHandle(o,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:te}=j.current;return te},setLayout:te=>{const{onLayout:le}=N.current,{layout:xe,panelDataArray:Se}=j.current,ye=nw({layout:te,panelConstraints:Se.map(Te=>Te.constraints)});ew(xe,ye)||(P(ye),j.current.layout=ye,le&&le(ye),ur(Se,ye,M.current))}}),[]),la(()=>{N.current.autoSaveId=n,N.current.direction=i,N.current.dragState=C,N.current.id=x,N.current.onLayout=r,N.current.storage=d}),V3({committedValuesRef:N,eagerValuesRef:j,groupId:x,layout:w,panelDataArray:j.current.panelDataArray,setLayout:P,panelGroupElement:v.current}),A.useEffect(()=>{const{panelDataArray:te}=j.current;if(n){if(w.length===0||w.length!==te.length)return;let le=iw[n];le==null&&(le=X3(Z3,e4),iw[n]=le);const xe=[...te],Se=new Map(D.current);le(n,xe,Se,w,d)}},[n,w,d]),A.useEffect(()=>{});const K=A.useCallback(te=>{const{onLayout:le}=N.current,{layout:xe,panelDataArray:Se}=j.current;if(te.constraints.collapsible){const ye=Se.map(Ot=>Ot.constraints),{collapsedSize:Te=0,panelSize:Ie,pivotIndices:nt}=Ys(Se,te,xe);if(Be(Ie!=null,`Panel size not found for panel "${te.id}"`),!So(Ie,Te)){D.current.set(te.id,Ie);const De=dr(Se,te)===Se.length-1?Ie-Te:Te-Ie,Ye=Jl({delta:De,initialLayout:xe,panelConstraints:ye,pivotIndices:nt,prevLayout:xe,trigger:"imperative-api"});Ad(xe,Ye)||(P(Ye),j.current.layout=Ye,le&&le(Ye),ur(Se,Ye,M.current))}}},[]),U=A.useCallback((te,le)=>{const{onLayout:xe}=N.current,{layout:Se,panelDataArray:ye}=j.current;if(te.constraints.collapsible){const Te=ye.map(it=>it.constraints),{collapsedSize:Ie=0,panelSize:nt=0,minSize:Ot=0,pivotIndices:De}=Ys(ye,te,Se),Ye=le??Ot;if(So(nt,Ie)){const it=D.current.get(te.id),ln=it!=null&&it>=Ye?it:Ye,As=dr(ye,te)===ye.length-1?nt-ln:ln-nt,zt=Jl({delta:As,initialLayout:Se,panelConstraints:Te,pivotIndices:De,prevLayout:Se,trigger:"imperative-api"});Ad(Se,zt)||(P(zt),j.current.layout=zt,xe&&xe(zt),ur(ye,zt,M.current))}}},[]),z=A.useCallback(te=>{const{layout:le,panelDataArray:xe}=j.current,{panelSize:Se}=Ys(xe,te,le);return Be(Se!=null,`Panel size not found for panel "${te.id}"`),Se},[]),X=A.useCallback((te,le)=>{const{panelDataArray:xe}=j.current,Se=dr(xe,te);return $3({defaultSize:le,dragState:C,layout:w,panelData:xe,panelIndex:Se})},[C,w]),H=A.useCallback(te=>{const{layout:le,panelDataArray:xe}=j.current,{collapsedSize:Se=0,collapsible:ye,panelSize:Te}=Ys(xe,te,le);return Be(Te!=null,`Panel size not found for panel "${te.id}"`),ye===!0&&So(Te,Se)},[]),V=A.useCallback(te=>{const{layout:le,panelDataArray:xe}=j.current,{collapsedSize:Se=0,collapsible:ye,panelSize:Te}=Ys(xe,te,le);return Be(Te!=null,`Panel size not found for panel "${te.id}"`),!ye||ma(Te,Se)>0},[]),ie=A.useCallback(te=>{const{panelDataArray:le}=j.current;le.push(te),le.sort((xe,Se)=>{const ye=xe.order,Te=Se.order;return ye==null&&Te==null?0:ye==null?-1:Te==null?1:ye-Te}),j.current.panelDataArrayChanged=!0,T()},[T]);la(()=>{if(j.current.panelDataArrayChanged){j.current.panelDataArrayChanged=!1;const{autoSaveId:te,onLayout:le,storage:xe}=N.current,{layout:Se,panelDataArray:ye}=j.current;let Te=null;if(te){const nt=J3(te,ye,xe);nt&&(D.current=new Map(Object.entries(nt.expandToSizes)),Te=nt.layout)}Te==null&&(Te=Y3({panelDataArray:ye}));const Ie=nw({layout:Te,panelConstraints:ye.map(nt=>nt.constraints)});ew(Se,Ie)||(P(Ie),j.current.layout=Ie,le&&le(Ie),ur(ye,Ie,M.current))}}),la(()=>{const te=j.current;return()=>{te.layout=[]}},[]);const oe=A.useCallback(te=>{let le=!1;const xe=v.current;return xe&&window.getComputedStyle(xe,null).getPropertyValue("direction")==="rtl"&&(le=!0),function(ye){ye.preventDefault();const Te=v.current;if(!Te)return()=>null;const{direction:Ie,dragState:nt,id:Ot,keyboardResizeBy:De,onLayout:Ye}=N.current,{layout:it,panelDataArray:ln}=j.current,{initialLayout:Sn}=nt??{},As=pP(Ot,te,Te);let zt=Q3(ye,te,Ie,nt,De,Te);const Bo=Ie==="horizontal";Bo&&le&&(zt=-zt);const Os=ln.map(wa=>wa.constraints),mi=Jl({delta:zt,initialLayout:Sn??it,panelConstraints:Os,pivotIndices:As,prevLayout:it,trigger:oP(ye)?"keyboard":"mouse-or-touch"}),ka=!Ad(it,mi);(sP(ye)||aP(ye))&&L.current!=zt&&(L.current=zt,!ka&&zt!==0?Bo?ug(te,zt<0?lP:cP):ug(te,zt<0?uP:dP):ug(te,0)),ka&&(P(mi),j.current.layout=mi,Ye&&Ye(mi),ur(ln,mi,M.current))}},[]),B=A.useCallback((te,le)=>{const{onLayout:xe}=N.current,{layout:Se,panelDataArray:ye}=j.current,Te=ye.map(it=>it.constraints),{panelSize:Ie,pivotIndices:nt}=Ys(ye,te,Se);Be(Ie!=null,`Panel size not found for panel "${te.id}"`);const De=dr(ye,te)===ye.length-1?Ie-le:le-Ie,Ye=Jl({delta:De,initialLayout:Se,panelConstraints:Te,pivotIndices:nt,prevLayout:Se,trigger:"imperative-api"});Ad(Se,Ye)||(P(Ye),j.current.layout=Ye,xe&&xe(Ye),ur(ye,Ye,M.current))},[]),Z=A.useCallback((te,le)=>{const{layout:xe,panelDataArray:Se}=j.current,{collapsedSize:ye=0,collapsible:Te}=le,{collapsedSize:Ie=0,collapsible:nt,maxSize:Ot=100,minSize:De=0}=te.constraints,{panelSize:Ye}=Ys(Se,te,xe);Ye!=null&&(Te&&nt&&So(Ye,ye)?So(ye,Ie)||B(te,Ie):Ye<De?B(te,De):Ye>Ot&&B(te,Ot))},[B]),se=A.useCallback((te,le)=>{const{direction:xe}=N.current,{layout:Se}=j.current;if(!v.current)return;const ye=cf(te,v.current);Be(ye,`Drag handle element not found for id "${te}"`);const Te=gP(xe,le);k({dragHandleId:te,dragHandleRect:ye.getBoundingClientRect(),initialCursorPosition:Te,initialLayout:Se})},[]),Y=A.useCallback(()=>{k(null)},[]),ae=A.useCallback(te=>{const{panelDataArray:le}=j.current,xe=dr(le,te);xe>=0&&(le.splice(xe,1),delete M.current[te.id],j.current.panelDataArrayChanged=!0,T())},[T]),de=A.useMemo(()=>({collapsePanel:K,direction:i,dragState:C,expandPanel:U,getPanelSize:z,getPanelStyle:X,groupId:x,isPanelCollapsed:H,isPanelExpanded:V,reevaluatePanelConstraints:Z,registerPanel:ie,registerResizeHandle:oe,resizePanel:B,startDragging:se,stopDragging:Y,unregisterPanel:ae,panelGroupElement:v.current}),[K,C,i,U,z,X,x,H,V,Z,ie,oe,B,se,Y,ae]),be={display:"flex",flexDirection:i==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return A.createElement(sf.Provider,{value:de},A.createElement(m,{...g,children:e,className:t,id:a,ref:v,style:{...be,...f},[Mt.group]:"",[Mt.groupDirection]:i,[Mt.groupId]:x}))}const Qb=A.forwardRef((n,e)=>A.createElement(vP,{...n,forwardedRef:e}));vP.displayName="PanelGroup";Qb.displayName="forwardRef(PanelGroup)";function dr(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function Ys(n,e,t){const i=dr(n,e),a=i===n.length-1?[i-1,i]:[i,i+1],r=t[i];return{...e.constraints,panelSize:r,pivotIndices:a}}function t4({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:i}){A.useEffect(()=>{if(n||t==null||i==null)return;const o=cf(e,i);if(o==null)return;const a=r=>{if(!r.defaultPrevented)switch(r.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{r.preventDefault(),t(r);break}case"F6":{r.preventDefault();const c=o.getAttribute(Mt.groupId);Be(c,`No group element found for id "${c}"`);const d=wc(c,i),f=fP(c,e,i);Be(f!==null,`No resize element found for id "${e}"`);const m=r.shiftKey?f>0?f-1:d.length-1:f+1<d.length?f+1:0;d[m].focus();break}}};return o.addEventListener("keydown",a),()=>{o.removeEventListener("keydown",a)}},[i,n,e,t])}function Yb({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:i,id:o,onBlur:a,onClick:r,onDragging:c,onFocus:d,onPointerDown:f,onPointerUp:m,style:g={},tabIndex:x=0,tagName:v="div",...C}){var k,w;const P=A.useRef(null),T=A.useRef({onClick:r,onDragging:c,onPointerDown:f,onPointerUp:m});A.useEffect(()=>{T.current.onClick=r,T.current.onDragging=c,T.current.onPointerDown=f,T.current.onPointerUp=m});const M=A.useContext(sf);if(M===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:L,registerResizeHandle:N,startDragging:j,stopDragging:K,panelGroupElement:U}=M,z=Vb(o),[X,H]=A.useState("inactive"),[V,ie]=A.useState(!1),[oe,B]=A.useState(null),Z=A.useRef({state:X});la(()=>{Z.current.state=X}),A.useEffect(()=>{if(t)B(null);else{const de=N(z);B(()=>de)}},[t,z,N]);const se=(k=i?.coarse)!==null&&k!==void 0?k:15,Y=(w=i?.fine)!==null&&w!==void 0?w:5;A.useEffect(()=>{if(t||oe==null)return;const de=P.current;Be(de,"Element ref not attached");let be=!1;return H3(z,de,D,{coarse:se,fine:Y},(le,xe,Se)=>{if(!xe){H("inactive");return}switch(le){case"down":{H("drag"),be=!1,Be(Se,'Expected event to be defined for "down" action'),j(z,Se);const{onDragging:ye,onPointerDown:Te}=T.current;ye?.(!0),Te?.();break}case"move":{const{state:ye}=Z.current;be=!0,ye!=="drag"&&H("hover"),Be(Se,'Expected event to be defined for "move" action'),oe(Se);break}case"up":{H("hover"),K();const{onClick:ye,onDragging:Te,onPointerUp:Ie}=T.current;Te?.(!1),Ie?.(),be||ye?.();break}}})},[se,D,t,Y,N,z,oe,j,K]),t4({disabled:t,handleId:z,resizeHandler:oe,panelGroupElement:U});const ae={touchAction:"none",userSelect:"none"};return A.createElement(v,{...C,children:n,className:e,id:o,onBlur:()=>{ie(!1),a?.()},onFocus:()=>{ie(!0),d?.()},ref:P,role:"separator",style:{...ae,...g},tabIndex:x,[Mt.groupDirection]:D,[Mt.groupId]:L,[Mt.resizeHandle]:"",[Mt.resizeHandleActive]:X==="drag"?"pointer":V?"keyboard":void 0,[Mt.resizeHandleEnabled]:!t,[Mt.resizeHandleId]:z,[Mt.resizeHandleState]:X})}Yb.displayName="PanelResizeHandle";const Kr=A.forwardRef(({className:n,children:e,...t},i)=>p.jsxs($A,{ref:i,className:q("relative overflow-hidden",n),...t,children:[p.jsx(JR,{className:"h-full w-full rounded-[inherit]",children:e}),p.jsx(CP,{}),p.jsx(ZR,{})]}));Kr.displayName=$A.displayName;const CP=A.forwardRef(({className:n,orientation:e="vertical",...t},i)=>p.jsx(XA,{ref:i,orientation:e,className:q("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",n),...t,children:p.jsx(eE,{className:"relative flex-1 rounded-full bg-border"})}));CP.displayName=XA.displayName;function n4(n){const e={provider:"unknown",endpoint:"unknown",timestamp:new Date,raw:n},t=n.match(/error-api-provider-([^-]+)-/);t&&(e.provider=t[1]);const i=n.match(/error-api-provider-[^-]+-(.+?)-\d{4}-\d{2}-\d{2}T/);i&&(e.endpoint=i[1].replace(/-/g,"/"));const o=n.match(/(\d{4}-\d{2}-\d{2}T\d{6})/);if(o){const a=o[1],r=`${a.slice(0,10)}T${a.slice(11,13)}:${a.slice(13,15)}:${a.slice(15,17)}`;e.timestamp=new Date(r)}return e}function i4(n){const e={version:"",url:"",method:"",timestamp:"",statusCode:0,statusText:"",requestHeaders:{},requestBody:"",responseHeaders:{},responseBody:"",provider:"",endpoint:"",isClientError:!1,isServerError:!1,errorType:"unknown",model:null,quotaResetDelay:null,quotaResetTimestamp:null},t=n.split(/^===\s*(.+?)\s*===$/m);let i="";for(let o=0;o<t.length;o++){const a=t[o].trim();if(a==="REQUEST INFO"){i="request_info";continue}else if(a==="HEADERS"){i="headers";continue}else if(a==="REQUEST BODY"){i="request_body";continue}else if(a==="API RESPONSE"){i="";continue}else if(a==="RESPONSE"){i="response";continue}switch(i){case"request_info":o4(a,e);break;case"headers":e.requestHeaders=s4(a);break;case"request_body":e.requestBody=a;break;case"response":a4(a,e);break}}return r4(e),e}function o4(n,e){const t=n.split(`
14
+ `);for(const i of t){const[o,...a]=i.split(":"),r=a.join(":").trim();switch(o?.trim()?.toLowerCase()){case"version":e.version=r;break;case"url":e.url=r;break;case"method":e.method=r;break;case"timestamp":e.timestamp=r;break}}}function s4(n){const e={},t=n.split(`
15
+ `);for(const i of t){const o=i.indexOf(":");if(o>0){const a=i.slice(0,o).trim(),r=i.slice(o+1).trim();a&&(e[a]=r)}}return e}function a4(n,e){const t=n.split(`
16
+ `);let i=!1;const o=[];for(const a of t){if(a.startsWith("Status:")){const c=a.replace("Status:","").trim().split(/\s+/);e.statusCode=parseInt(c[0],10)||0,e.statusText=c.slice(1).join(" ")||u4(e.statusCode);continue}if(a.trim()===""&&!i){i=!0;continue}if(i)o.push(a);else{const r=a.indexOf(":");if(r>0){const c=a.slice(0,r).trim(),d=a.slice(r+1).trim();c&&(e.responseHeaders[c]=d)}}}e.responseBody=o.join(`
17
+ `).trim()}function r4(n){const e=n.url.match(/\/api\/provider\/([^/]+)/);e&&(n.provider=e[1]);const t=n.url.match(/\/api\/provider\/[^/]+\/(.+?)(?:\?|$)/);t&&(n.endpoint=t[1]),n.isClientError=n.statusCode>=400&&n.statusCode<500,n.isServerError=n.statusCode>=500,n.statusCode===429?n.errorType="rate_limit":n.statusCode===401||n.statusCode===403?n.errorType="auth":n.statusCode===404?n.errorType="not_found":n.statusCode>=500?n.errorType="server":(n.statusCode===408||n.statusCode===504)&&(n.errorType="timeout"),l4(n),n.statusCode===429&&c4(n)}function l4(n){if(n.requestBody)try{const e=JSON.parse(n.requestBody);typeof e.model=="string"&&(n.model=e.model)}catch{}}function c4(n){if(n.responseBody)try{const e=JSON.parse(n.responseBody),t=hy(e);t!==null&&(n.quotaResetDelay=t);const i=fy(e);i&&(n.quotaResetTimestamp=i)}catch{}}function hy(n){if(typeof n!="object"||n===null)return null;const e=n;if("quotaResetDelay"in e){const t=e.quotaResetDelay;if(typeof t=="number")return t;if(typeof t=="string"){const i=t.match(/^(\d+)s?$/);if(i)return parseInt(i[1],10)}}if("error"in e&&typeof e.error=="object"){const t=hy(e.error);if(t!==null)return t}if("details"in e&&Array.isArray(e.details))for(const t of e.details){const i=hy(t);if(i!==null)return i}return null}function fy(n){if(typeof n!="object"||n===null)return null;const e=n;for(const t of["quotaResetTimeStamp","quotaResetTimestamp","resetTime","reset_time"])if(t in e&&typeof e[t]=="string")return e[t];if("error"in e&&typeof e.error=="object"){const t=fy(e.error);if(t)return t}if("details"in e&&Array.isArray(e.details))for(const t of e.details){const i=fy(t);if(i)return i}return null}function u4(n){return{400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",408:"Request Timeout",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"}[n]||""}function d4(n,e){const t=Sb(),i=Date.now(),o=n*1e3,a=i-o,r=Math.floor(a/1e3),c=Math.floor(r/60),d=Math.floor(c/60),f=Math.floor(d/24);if(r<60){const g=t==="zh-CN",x=t==="vi";return g?"刚刚":x?"vừa xong":"just now"}if(c<60){const g=t==="zh-CN",x=t==="vi";return g?`${c} 分钟前`:x?`${c} phút trước`:`${c}m ago`}if(d<24){const g=t==="zh-CN",x=t==="vi";return g?`${d} 小时前`:x?`${d} giờ trước`:`${d}h ago`}if(f<7){const g=t==="zh-CN",x=t==="vi";return g?`${f} 天前`:x?`${f} ngày trước`:`${f}d ago`}return new Date(o).toLocaleDateString(t,{month:"short",day:"numeric"})}function h4(n){return n>=500?"text-red-500":n===429?"text-orange-500":n>=400?"text-yellow-500":"text-gray-500"}function f4(n,e){const t=Sb();return t==="zh-CN"?{rate_limit:"限流",auth:"认证错误",not_found:"未找到",server:"服务错误",timeout:"超时",unknown:"错误"}[n]||"错误":t==="vi"?{rate_limit:"Quá giới hạn",auth:"Lỗi xác thực",not_found:"Không tìm thấy",server:"Lỗi máy chủ",timeout:"Hết thời gian chờ",unknown:"Lỗi"}[n]||"Lỗi":{rate_limit:"Rate Limited",auth:"Auth Error",not_found:"Not Found",server:"Server Error",timeout:"Timeout",unknown:"Error"}[n]||"Error"}function p4(n){if(n===null||n<=0)return null;if(n<60)return`${n}s`;if(n<3600)return`${Math.floor(n/60)}m`;const e=Math.floor(n/3600),t=Math.floor(n%3600/60);return t>0?`${e}h ${t}m`:`${e}h`}function m4(n,e){if(!n)return null;const t=Sb(),i=t==="zh-CN",o=t==="vi";try{const a=new Date(n),r=new Date,c=a.getTime()-r.getTime();if(c<=0)return i?"现在":o?"bây giờ":"now";const d=Math.floor(c/1e3);if(d<60)return i?`${d}秒`:o?`${d} giây`:`${d}s`;if(d<3600){const g=Math.floor(d/60);return i?`${g}分钟`:o?`${g} phút`:`${g}m`}const f=Math.floor(d/3600),m=Math.floor(d%3600/60);return i?m>0?`${f}小时 ${m}分钟`:`${f}小时`:o?m>0?`${f} giờ ${m} phút`:`${f} giờ`:m>0?`${f}h ${m}m`:`${f}h`}catch{return null}}function g4(n){return n?n===429?"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400":n>=500?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400":n>=400?"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400":"bg-gray-100 text-gray-600":"bg-gray-100 text-gray-600"}function y4(n){return n||""}function b4({name:n,size:e,modified:t,isSelected:i,onClick:o,statusCode:a,model:r}){const c=A.useMemo(()=>n4(n),[n]),d=A.useMemo(()=>y4(r),[r]);return p.jsxs("button",{onClick:o,className:q("w-full px-2.5 py-2 flex items-center gap-2 text-left transition-colors","hover:bg-muted/40 border-l-[3px]",i?"bg-muted/50 border-l-red-500":"border-l-transparent"),children:[p.jsx("span",{className:q("shrink-0 text-[10px] font-bold px-1.5 py-0.5 rounded min-w-[32px] text-center",g4(a)),children:a||"???"}),p.jsx(Gb,{provider:c.provider,size:18,withBackground:!0,className:"shrink-0"}),p.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[p.jsx("span",{className:"text-[11px] font-medium text-foreground truncate",children:c.endpoint||"unknown"}),d&&p.jsx("span",{className:"text-[10px] text-muted-foreground truncate",title:d,children:d}),p.jsxs("div",{className:"flex items-center gap-1 text-[9px] text-muted-foreground/60",children:[p.jsx(Rr,{className:"w-2.5 h-2.5"}),p.jsx("span",{children:d4(t)})]})]})]})}function ow({value:n,className:e,variant:t="outline",size:i="icon",label:o="Copy to clipboard"}){const[a,r]=A.useState(!1),c=()=>{navigator.clipboard.writeText(n),r(!0),setTimeout(()=>r(!1),2e3)};return p.jsx(pa,{children:p.jsxs(Do,{children:[p.jsx(Mo,{asChild:!0,children:p.jsxs(gt,{size:i,variant:t,className:q("relative z-10 text-muted-foreground hover:text-foreground",e),onClick:d=>{d.stopPropagation(),c()},children:[a?p.jsx(Lr,{className:"h-3.5 w-3.5 text-green-500"}):p.jsx(dh,{className:"h-3.5 w-3.5"}),p.jsx("span",{className:"sr-only",children:o})]})}),p.jsx(No,{children:p.jsx("p",{children:a?"Copied!":o})})]})})}function ql({active:n,onClick:e,children:t,icon:i}){return p.jsxs("button",{onClick:e,className:q("px-2.5 py-1.5 text-xs font-medium rounded transition-colors flex items-center gap-1.5",n?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[i&&p.jsx(i,{className:"w-3.5 h-3.5"}),t]})}function SP({code:n}){const e=h4(n);return p.jsx("span",{className:q("inline-flex items-center justify-center min-w-[36px] px-2 py-0.5 rounded text-xs font-bold","bg-current/10 border border-current/20",e),children:n})}function x4({parsed:n}){const{t:e}=Ce(),t=p4(n.quotaResetDelay)||m4(n.quotaResetTimestamp),i=e("errorLogs.na");return p.jsx(Kr,{className:"h-full",children:p.jsxs("div",{className:"p-4 space-y-4",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(SP,{code:n.statusCode}),p.jsx("span",{className:"text-sm font-medium",children:n.statusText}),p.jsx("span",{className:"text-xs text-muted-foreground px-2 py-0.5 rounded bg-muted/50",children:f4(n.errorType)})]}),n.model&&p.jsxs("div",{className:"flex items-center gap-2.5 p-3 rounded-lg bg-violet-500/10 border border-violet-500/20",children:[p.jsx(jE,{className:"w-4 h-4 text-violet-500 shrink-0"}),p.jsxs("div",{className:"text-sm",children:[p.jsx("span",{className:"text-muted-foreground",children:e("errorLogs.modelLabel")}),p.jsx("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:n.model})]})]}),n.errorType==="rate_limit"&&t&&p.jsxs("div",{className:"flex items-center gap-2.5 p-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[p.jsx(Rr,{className:"w-4 h-4 text-amber-500 shrink-0"}),p.jsxs("div",{className:"text-sm",children:[p.jsx("span",{className:"text-muted-foreground",children:e("errorLogs.quotaResetsIn")}),p.jsx("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:t})]})]}),p.jsxs("div",{className:"grid grid-cols-4 gap-3 text-xs",children:[p.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[p.jsx("div",{className:"text-muted-foreground mb-1",children:e("errorLogs.method")}),p.jsx("div",{className:"font-medium",children:n.method||i})]}),p.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[p.jsx("div",{className:"text-muted-foreground mb-1",children:e("errorLogs.provider")}),p.jsx("div",{className:"font-medium",children:n.provider||i})]}),p.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[p.jsx("div",{className:"text-muted-foreground mb-1",children:e("errorLogs.version")}),p.jsx("div",{className:"font-medium",children:n.version||i})]}),p.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[p.jsx("div",{className:"text-muted-foreground mb-1",children:e("errorLogs.endpoint")}),p.jsx("div",{className:"font-medium truncate",title:n.endpoint,children:n.endpoint||i})]})]}),p.jsxs("div",{className:"text-xs",children:[p.jsx("div",{className:"text-muted-foreground mb-1.5",children:e("errorLogs.url")}),p.jsx("div",{className:"font-mono p-2.5 rounded bg-muted/30 border border-border/50 break-all leading-relaxed",children:n.url||i})]}),p.jsxs("div",{className:"text-xs",children:[p.jsx("div",{className:"text-muted-foreground mb-1.5",children:e("errorLogs.timestamp")}),p.jsx("div",{className:"font-mono",children:n.timestamp||i})]}),n.errorType!=="unknown"&&p.jsxs("div",{className:q("flex items-start gap-3 p-3 rounded text-xs",n.errorType==="rate_limit"?"bg-amber-500/10 border border-amber-500/20":n.errorType==="auth"?"bg-red-500/10 border border-red-500/20":"bg-blue-500/10 border border-blue-500/20"),children:[n.errorType==="rate_limit"?p.jsx(Qi,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}):n.errorType==="auth"?p.jsx(Qi,{className:"w-4 h-4 mt-0.5 text-red-500 shrink-0"}):p.jsx(Yh,{className:"w-4 h-4 mt-0.5 text-blue-500 shrink-0"}),p.jsxs("div",{className:q("leading-relaxed",n.errorType==="rate_limit"?"text-amber-600 dark:text-amber-400":n.errorType==="auth"?"text-red-600 dark:text-red-400":"text-blue-600 dark:text-blue-400"),children:[n.errorType==="rate_limit"&&(n.model?e("errorLogs.rateLimitedMsg",{model:n.model}):e("errorLogs.rateLimitedMsgNoModel")),n.errorType==="auth"&&e("errorLogs.authFailedMsg"),n.errorType==="not_found"&&e("errorLogs.notFoundMsg"),n.errorType==="server"&&e("errorLogs.serverErrorMsg"),n.errorType==="timeout"&&e("errorLogs.timeoutMsg")]})]})]})})}function v4({headers:n}){const{t:e}=Ce(),t=Object.entries(n);return t.length===0?p.jsx("div",{className:"p-4 text-xs text-muted-foreground",children:e("errorLogs.noHeaders")}):p.jsx(Kr,{className:"h-full",children:p.jsx("div",{className:"p-4 space-y-1",children:t.map(([i,o])=>p.jsxs("div",{className:"flex gap-3 text-xs font-mono py-1.5 border-b border-border/30 last:border-0",children:[p.jsxs("span",{className:"text-muted-foreground shrink-0 min-w-[140px]",children:[i,":"]}),p.jsx("span",{className:"break-all",children:o})]},i))})})}function sw({content:n,label:e}){const{t}=Ce();if(!n||n.trim()===""){const a=e==="Request"?"errorLogs.noRequestBody":"errorLogs.noResponseBody";return p.jsx("div",{className:"p-4 text-xs text-muted-foreground",children:t(a)})}let i=n,o=!1;try{const a=JSON.parse(n);i=JSON.stringify(a,null,2),o=!0}catch{}return p.jsx(Kr,{className:"h-full",children:p.jsx("pre",{className:q("p-4 text-xs font-mono whitespace-pre-wrap break-all leading-relaxed",o?"text-emerald-700 dark:text-green-400":"text-zinc-700 dark:text-muted-foreground"),children:i})})}function C4({content:n}){return p.jsx(Kr,{className:"h-full",children:p.jsx("pre",{className:"p-4 text-xs font-mono text-zinc-700 dark:text-muted-foreground whitespace-pre-wrap break-all leading-relaxed",children:n})})}function S4({name:n,absolutePath:e}){const{t}=Ce(),[i,o]=A.useState("overview"),{data:a,isLoading:r,error:c}=YB(n),d=A.useMemo(()=>a?i4(a):null,[a]);return n?r?p.jsxs("div",{className:"flex-1 p-6 space-y-3",children:[p.jsx(tt,{className:"h-5 w-full"}),p.jsx(tt,{className:"h-5 w-3/4"}),p.jsx(tt,{className:"h-5 w-5/6"}),p.jsx(tt,{className:"h-5 w-2/3"})]}):c||!a||!d?p.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:p.jsx("p",{className:"text-sm",children:t("errorLogs.failedLoadContent")})}):p.jsxs("div",{className:"flex-1 flex flex-col min-w-0 h-full",children:[p.jsxs("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex items-center justify-between gap-3 shrink-0",children:[p.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[p.jsx(SP,{code:d.statusCode}),p.jsxs("span",{className:"text-xs font-semibold truncate text-foreground",children:[d.provider,"/",d.endpoint||"unknown"]}),n&&p.jsx(ow,{value:e||n,label:t("errorLogs.copyAbsolutePath"),size:"icon-sm",className:"ml-1 text-muted-foreground hover:text-foreground opacity-50 hover:opacity-100 transition-opacity"})]}),p.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a&&p.jsx(ow,{value:a,label:t("errorLogs.copyRawContent"),variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-foreground"}),p.jsx("span",{className:"text-[10px] text-muted-foreground font-mono bg-muted px-1.5 py-0.5 rounded border border-border/50",children:d.method})]})]}),p.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-1 bg-muted/10 shrink-0 overflow-x-auto",children:[p.jsx(ql,{active:i==="overview",onClick:()=>o("overview"),icon:Yh,children:t("errorLogs.tabOverview")}),p.jsx(ql,{active:i==="headers",onClick:()=>o("headers"),icon:BE,children:t("errorLogs.tabHeaders")}),p.jsx(ql,{active:i==="request",onClick:()=>o("request"),icon:gO,children:t("errorLogs.tabRequest")}),p.jsx(ql,{active:i==="response",onClick:()=>o("response"),icon:_E,children:t("errorLogs.tabResponse")}),p.jsx(ql,{active:i==="raw",onClick:()=>o("raw"),icon:HE,children:t("errorLogs.tabRaw")})]}),p.jsxs("div",{className:"flex-1 overflow-hidden bg-card/30",children:[i==="overview"&&p.jsx(x4,{parsed:d}),i==="headers"&&p.jsx(v4,{headers:d.requestHeaders}),i==="request"&&p.jsx(sw,{content:d.requestBody,label:t("errorLogs.tabRequest")}),i==="response"&&p.jsx(sw,{content:d.responseBody,label:t("errorLogs.tabResponse")}),i==="raw"&&p.jsx(C4,{content:a})]})]}):p.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:p.jsxs("div",{className:"text-center space-y-3",children:[p.jsx(IE,{className:"w-10 h-10 mx-auto opacity-40"}),p.jsx("p",{className:"text-sm",children:t("errorLogs.selectLog")})]})})}function k4(){const{t:n}=Ce(),{data:e,isLoading:t}=GB(),{data:i,isLoading:o,error:a}=QB(e?.running??!1),[r,c]=A.useState(500),[d,f]=A.useState(!1),m=A.useRef(null),g=A.useRef(null),x=()=>{g.current&&(clearInterval(g.current),g.current=null)};A.useEffect(()=>{if(!d)return;const D=N=>{const j=m.current;if(!j)return;const U=j.getBoundingClientRect().top+window.scrollY,z=N.pageY-U;c(Math.max(300,z));const H=window.innerHeight-N.clientY,V=15;x(),H<50?g.current=setInterval(()=>{window.scrollBy(0,V)},16):N.clientY<50&&(g.current=setInterval(()=>{window.scrollBy(0,-V)},16))},L=()=>{f(!1),x(),document.body.style.cursor="default",document.body.style.userSelect="auto"};return document.addEventListener("mousemove",D),document.addEventListener("mouseup",L),document.body.style.cursor="row-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",L),document.body.style.cursor="default",document.body.style.userSelect="auto",x()}},[d]);const v=D=>{D.preventDefault(),f(!0)},C=A.useMemo(()=>i?.[0]?.name??null,[i]),[k,w]=A.useState(null),P=k??C,T=A.useMemo(()=>!P||!i?void 0:i.find(L=>L.name===P)?.absolutePath,[P,i]);if(t||!e?.running)return null;if(o)return p.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-sm bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm h-[500px]",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[p.jsx(tt,{className:"h-4 w-32"}),p.jsx(tt,{className:"h-4 w-20"})]}),p.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(D=>p.jsx(tt,{className:"h-12 w-full rounded-lg"},D))})]});if(!i||i.length===0)return null;const M=i.length;return p.jsxs("div",{ref:m,className:"rounded-xl border border-border overflow-hidden font-mono text-sm text-foreground bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm flex flex-col shadow-sm transition-[height] duration-0 ease-linear relative group/container",style:{height:r},children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-gradient-to-r from-amber-500/10 via-transparent to-transparent dark:from-amber-500/15 shrink-0",children:[p.jsxs("div",{className:"flex items-center gap-2.5",children:[p.jsx(Qi,{className:"w-4 h-4 text-amber-500"}),p.jsx("span",{className:"text-sm font-semibold tracking-tight",children:n("errorLogs.title")}),p.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:n("errorLogs.failedRequests",{count:M})})]}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[p.jsx(UE,{className:"w-3.5 h-3.5"}),p.jsx("span",{children:n("errorLogs.cliproxyDiagnostics")})]})]}),p.jsx("div",{className:"flex-1 min-h-0",children:p.jsxs(Qb,{direction:"horizontal",children:[p.jsx(Sc,{defaultSize:30,minSize:20,maxSize:50,className:"flex flex-col min-w-0",children:p.jsxs(Kr,{className:"h-full",children:[p.jsx("div",{className:"divide-y divide-border/50",children:i.slice(0,50).map(D=>p.jsx(b4,{name:D.name,size:D.size,modified:D.modified,isSelected:P===D.name,onClick:()=>w(D.name),statusCode:D.statusCode,model:D.model},D.name))}),i.length>50&&p.jsx("div",{className:"px-3 py-3 text-center text-[10px] text-muted-foreground border-t border-border/50",children:n("errorLogs.showingCount",{total:i.length})})]})}),p.jsxs(Yb,{className:"w-[1px] bg-border hover:bg-primary/50 transition-colors flex items-center justify-center group relative z-10 w-2 -ml-1 flex items-center justify-center outline-none",children:[p.jsx("div",{className:"w-[1px] h-full bg-border group-hover:bg-primary/50 transition-colors"}),p.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-4 h-8 rounded-sm flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-muted border border-border",children:p.jsx(Qh,{className:"h-4 w-4 text-muted-foreground"})})]}),p.jsx(Sc,{className:"flex flex-col min-w-0 bg-background/50",children:p.jsx(S4,{name:P,absolutePath:T})})]})}),a?p.jsx("div",{className:"px-4 py-2 border-t border-border text-xs text-destructive bg-destructive/5 shrink-0",children:a.message}):p.jsx("div",{className:"h-2 bg-border/10 border-t border-border/30 hover:bg-primary/10 transition-colors cursor-row-resize flex items-center justify-center group/handle shrink-0",onMouseDown:v,children:p.jsx(zE,{className:"w-8 h-3 text-border group-hover:text-primary/50 transition-colors"})})]})}const w4=$h("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",warning:"border-yellow-200 bg-yellow-50 text-yellow-900 dark:border-yellow-900/50 dark:bg-yellow-900/20 dark:text-yellow-200 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-500",info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-900/50 dark:bg-blue-900/20 dark:text-blue-200 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-500",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-900/50 dark:bg-green-900/20 dark:text-green-200 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"}},defaultVariants:{variant:"default"}}),rc=A.forwardRef(({className:n,variant:e,...t},i)=>p.jsx("div",{ref:i,role:"alert",className:q(w4({variant:e}),n),...t}));rc.displayName="Alert";const yh=A.forwardRef(({className:n,...e},t)=>p.jsx("h5",{ref:t,className:q("mb-1 font-medium leading-none tracking-tight",n),...e}));yh.displayName="AlertTitle";const lc=A.forwardRef(({className:n,...e},t)=>p.jsx("div",{ref:t,className:q("text-sm [&_p]:leading-relaxed",n),...e}));lc.displayName="AlertDescription";function A4(){return It({queryKey:["overview"],queryFn:async()=>(await fetch("/api/overview")).json()})}function kP(n,e){return typeof n=="object"&&n!==null&&"error"in n&&typeof n.error=="string"?n.error:e}function wP(n){const e=n.trim();if(!e)return null;try{return JSON.parse(e)}catch{return null}}function O4(n){const e=n.trim().toLowerCase();return e.startsWith("<!doctype html")||e.startsWith("<html")}function P4(n){if(!n||typeof n!="object")return!1;const e=n;return!(typeof e.content!="string"||"contentPath"in e&&typeof e.contentPath!="string")}async function AP(n,e){const t=await n.text(),i=wP(t);if(!n.ok){const o=kP(i,e);throw new Error(o)}if(i===null)throw new Error(e);return i}function T4(){return It({queryKey:["shared","summary"],queryFn:async()=>{const n=await fetch("/api/shared/summary");return AP(n,"Failed to fetch shared summary")}})}function TW(n){return It({queryKey:["shared",n],enabled:n!=="settings",queryFn:async()=>{if(n==="settings")return{items:[]};const e=await fetch(`/api/shared/${n}`);return AP(e,`Failed to fetch shared ${n}`)}})}function DW(n,e){return It({queryKey:["shared",n,"content",e],enabled:typeof e=="string"&&e.length>0,queryFn:async()=>{if(!e)throw new Error("Missing shared item path");const t=new URLSearchParams({type:n,path:e}),i=await fetch(`/api/shared/content?${t.toString()}`),o=await i.text(),a=wP(o);if(!i.ok)throw new Error(kP(a,`Failed to fetch shared ${n} content`));if(P4(a))return{content:a.content,contentPath:typeof a.contentPath=="string"&&a.contentPath.length>0?a.contentPath:e};if(o.trim().length>0){if(O4(o))throw new Error("Shared content endpoint unavailable. Restart `ccs config` and try again.");return{content:o,contentPath:e}}throw new Error(`Failed to fetch shared ${n} content`)}})}const D4={ok:"success",warning:"warning",error:"error"},M4={default:{iconBg:"bg-muted",iconColor:"text-muted-foreground"},success:{iconBg:"bg-green-600/15",iconColor:"text-green-700 dark:text-green-500"},warning:{iconBg:"bg-amber-500/15",iconColor:"text-amber-700 dark:text-amber-400"},error:{iconBg:"bg-red-600/15",iconColor:"text-red-700 dark:text-red-500"},accent:{iconBg:"bg-accent/15",iconColor:"text-accent"}};function Od({title:n,value:e,icon:t,variant:i="default",onClick:o}){const a=M4[i];return p.jsxs("button",{onClick:o,className:q("flex items-center gap-3 px-4 py-2.5 rounded-lg border bg-card/50","transition-all hover:bg-card hover:shadow-sm hover:-translate-y-0.5","active:scale-[0.98]"),children:[p.jsx("div",{className:q("flex items-center justify-center w-9 h-9 rounded-md",a.iconBg),children:p.jsx(t,{className:q("w-4 h-4",a.iconColor)})}),p.jsxs("div",{className:"text-left",children:[p.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:n}),p.jsx("p",{className:q("text-lg font-bold font-mono leading-tight",a.iconColor),children:e})]})]})}function N4(){const{t:n}=Ce(),e=yb(),{data:t,isLoading:i}=A4(),{data:o,isLoading:a}=T4();if(i||a)return p.jsxs("div",{className:"p-6 space-y-6",children:[p.jsxs("div",{className:"rounded-xl border p-6 flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsx(tt,{className:"h-12 w-12 rounded-lg"}),p.jsxs("div",{children:[p.jsx(tt,{className:"h-7 w-[180px] mb-2"}),p.jsx(tt,{className:"h-4 w-[220px]"})]})]}),p.jsx("div",{className:"flex items-center gap-3",children:[1,2,3,4].map(c=>p.jsx(tt,{className:"h-14 w-28 rounded-lg"},c))})]}),p.jsxs("div",{className:"border rounded-xl overflow-hidden",children:[p.jsxs("div",{className:"px-4 py-2.5 border-b flex items-center justify-between",children:[p.jsx(tt,{className:"h-4 w-32"}),p.jsx(tt,{className:"h-4 w-20"})]}),p.jsx("div",{className:"px-4 py-3 border-b",children:p.jsx(tt,{className:"h-2 w-full rounded-full"})}),[1,2,3].map(c=>p.jsxs("div",{className:"px-4 py-2.5 flex items-center gap-3 border-b last:border-b-0",children:[p.jsx(tt,{className:"w-2.5 h-2.5 rounded-full"}),p.jsx(tt,{className:"h-4 flex-1"}),p.jsx(tt,{className:"h-1.5 w-24 rounded-full"}),p.jsx(tt,{className:"h-4 w-16"})]},c))]})]});const r=t?.health?D4[t.health.status]:void 0;return p.jsxs("div",{className:"p-6 space-y-6",children:[p.jsxs("div",{className:"relative overflow-hidden rounded-xl border bg-gradient-to-br from-background via-background to-muted/30",children:[p.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:p.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),p.jsxs("div",{className:"relative p-6 flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[p.jsx(lB,{version:t?.version}),p.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[p.jsx(Od,{title:n("home.profiles"),value:t?.profiles??0,icon:ty,variant:"accent",onClick:()=>e("/providers")}),p.jsx(Od,{title:n("home.cliproxy"),value:t?.cliproxy??0,icon:sO,variant:"accent",onClick:()=>e("/cliproxy")}),p.jsx(Od,{title:n("home.accounts"),value:t?.accounts??0,icon:rO,variant:"default",onClick:()=>e("/accounts")}),p.jsx(Od,{title:n("home.health"),value:t?.health?`${t.health.passed}/${t.health.total}`:"-",icon:bc,variant:r,onClick:()=>e("/health")})]})]})]}),o?.symlinkStatus&&!o.symlinkStatus.valid&&p.jsxs(rc,{variant:"warning",children:[p.jsx(Qi,{className:"h-4 w-4"}),p.jsx(yh,{children:n("home.configurationRequired")}),p.jsx(lc,{children:o.symlinkStatus.message})]}),p.jsx(P3,{}),p.jsx("div",{className:"rounded-xl border bg-card/70 p-5",children:p.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsx("div",{className:"rounded-xl bg-muted p-2.5",children:p.jsx(cO,{className:"h-5 w-5 text-muted-foreground"})}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("h2",{className:"text-lg font-semibold",children:n("homePageV2.logsMoved")}),p.jsx("p",{className:"max-w-2xl text-sm text-muted-foreground",children:"Use the unified logs page for source-level filtering, structured entry inspection, and retention policy edits without crowding the home dashboard."})]})]}),p.jsxs(gt,{variant:"outline",className:"gap-2",onClick:()=>e("/logs"),children:["Open logs",p.jsx(FE,{className:"h-4 w-4"})]})]})}),p.jsx(k4,{})]})}const OP=tE,$b=A.forwardRef(({className:n,...e},t)=>p.jsx(JA,{ref:t,className:q("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",n),...e}));$b.displayName=JA.displayName;const bh=A.forwardRef(({className:n,...e},t)=>p.jsx(ZA,{ref:t,className:q("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",n),...e}));bh.displayName=ZA.displayName;const py=A.forwardRef(({className:n,...e},t)=>p.jsx(eO,{ref:t,className:q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...e}));py.displayName=eO.displayName;function yn({className:n,...e}){return p.jsx(nE,{"data-slot":"label",className:q("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",n),...e})}const Xb="ccs:openrouter-models",L4=1440*60*1e3,PP="1";function my(n){const e=parseFloat(n);return isNaN(e)||e===0?0:e*1e6}function aw(n){const e=my(n);return e===0?re.t("openrouterUtils.priceFree"):e<.01?re.t("openrouterUtils.priceLessThanCent"):e<1?`$${e.toFixed(2)}`:`$${e.toFixed(e<10?2:0)}`}function R4(n){const e=aw(n.prompt),t=aw(n.completion);return e===re.t("openrouterUtils.priceFree")&&t===re.t("openrouterUtils.priceFree")?re.t("openrouterUtils.priceFree"):`${e}/${t}`}function E4(n){const e=n.id.toLowerCase();return e.startsWith("anthropic/")?"anthropic":e.startsWith("openai/")?"openai":e.startsWith("google/")?"google":e.startsWith("meta-llama/")||e.startsWith("meta/")?"meta":e.startsWith("mistralai/")?"mistral":e.includes(":free")||e.includes("qwen")||e.includes("deepseek")?"opensource":"other"}function j4(n){return{...n,category:E4(n),pricePerMillionPrompt:my(n.pricing.prompt),pricePerMillionCompletion:my(n.pricing.completion),isFree:n.pricing.prompt==="0"&&n.pricing.completion==="0",isExacto:n.id.includes(":exacto")}}function I4(n,e,t){const i=e.toLowerCase().trim();return n.filter(o=>t?.category&&o.category!==t.category||t?.freeOnly&&!o.isFree||t?.minContext&&o.context_length<t.minContext?!1:i?o.id.toLowerCase().includes(i)||o.name.toLowerCase().includes(i)||o.description?.toLowerCase().includes(i):!0)}function MW(n){return[...n].sort((e,t)=>{if(e.isFree&&!t.isFree)return-1;if(!e.isFree&&t.isFree)return 1;if(!e.isFree&&!t.isFree){if(e.isExacto&&!t.isExacto)return-1;if(!e.isExacto&&t.isExacto)return 1}return e.name.localeCompare(t.name)})}function B4(){try{const n=localStorage.getItem(Xb);if(!n)return null;const e=JSON.parse(n);return e.version!==PP||Date.now()-e.fetchedAt>L4?null:e.models}catch{return null}}function _4(n){try{localStorage.setItem(Xb,JSON.stringify({models:n,fetchedAt:Date.now(),version:PP}))}catch{}}function H4(){localStorage.removeItem(Xb)}function NW(n,e){const[t]=n.split("/");if(!t)return{};const i=e.filter(r=>r.id.startsWith(`${t}/`));if(i.length===0)return{};const o=[...i].sort((r,c)=>c.pricePerMillionPrompt-r.pricePerMillionPrompt),a=Math.ceil(o.length/3);return{opus:o[0]?.id,sonnet:o[Math.min(a,o.length-1)]?.id,haiku:o[o.length-1]?.id}}function U4(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}const LW={anthropic:"Anthropic (Claude)",openai:"OpenAI (GPT)",google:"Google (Gemini)",meta:"Meta (Llama)",mistral:"Mistral",opensource:"Open Source",other:"Other"},z4={anthropic:["anthropic/"],openai:["openai/"],google:["google/"],meta:["meta-llama/","meta/"],mistral:["mistralai/"],opensource:["deepseek/","qwen/","cohere/"],other:[]};function F4(n,e=2){const t=[],i=["anthropic","openai","google","meta","mistral","opensource"];for(const o of i){const a=z4[o];if(a.length===0)continue;const c=[...n.filter(d=>a.some(f=>d.id.toLowerCase().startsWith(f)))].sort((d,f)=>(f.created??0)-(d.created??0));t.push(...c.slice(0,e))}return t.sort((o,a)=>(a.created??0)-(o.created??0))}function q4(n){const t=Date.now()/1e3-n;return t<86400?re.t("openrouterUtils.ageToday"):t<172800?re.t("openrouterUtils.ageYesterday"):t<604800?re.t("openrouterUtils.ageDaysAgo",{count:Math.floor(t/86400)}):t<2592e3?re.t("openrouterUtils.ageWeeksAgo",{count:Math.floor(t/604800)}):t<31536e3?re.t("openrouterUtils.ageMonthsAgo",{count:Math.floor(t/2592e3)}):re.t("openrouterUtils.ageYearsAgo",{count:Math.floor(t/31536e3)})}const G4="https://openrouter.ai/api/v1/models",TP=["openrouter-models"],rw=1440*60*1e3;async function K4(){const n=await fetch(G4);if(!n.ok)throw new Error(`Failed to fetch OpenRouter models: ${n.status}`);const t=(await n.json()).data;return _4(t),t}function DP(){return It({queryKey:TP,queryFn:K4,staleTime:rw,gcTime:rw,initialData:()=>B4()??void 0,refetchOnWindowFocus:!1})}function V4(){const n=DP(),e=(n.data??[]).map(j4);return{...n,models:e}}function RW(){const n=bt();return()=>(H4(),n.invalidateQueries({queryKey:TP}))}function EW(){const{data:n,isLoading:e,isError:t}=DP();return{isReady:!!n&&n.length>0,isLoading:e,isError:t,modelCount:n?.length??0}}function Jb({profileEnv:n={}}){const{t:e}=Ce(),[t,i]=A.useState(null),[o,a]=A.useState(!0),[r,c]=A.useState(!1);A.useEffect(()=>{d()},[]);const d=async()=>{try{a(!0);const v=await fetch("/api/global-env");if(!v.ok)throw new Error("Failed to load");const C=await v.json();i(C)}catch{i(null)}finally{a(!1)}};if(o||!t?.enabled)return null;const f=t.env||{},m=Object.keys(f);if(m.length===0)return null;const g=m.filter(v=>!(v in n)),x=m.filter(v=>v in n);return p.jsxs("div",{className:"border-t bg-muted/20",children:[p.jsxs("button",{onClick:()=>c(!r),className:"w-full px-4 py-2 flex items-center gap-2 hover:bg-muted/30 transition-colors",children:[p.jsx(Yh,{className:"w-4 h-4 text-blue-500"}),p.jsxs("span",{className:"text-xs text-muted-foreground flex-1 text-left",children:[e("globalEnvIndicator.injectedCount",{count:g.length}),x.length>0&&p.jsx("span",{className:"text-amber-600 dark:text-amber-400 ml-1",children:e("globalEnvIndicator.overriddenCount",{count:x.length})})]}),r?p.jsx(xb,{className:"w-4 h-4 text-muted-foreground"}):p.jsx(Wh,{className:"w-4 h-4 text-muted-foreground"})]}),r&&p.jsxs("div",{className:"px-4 pb-3 space-y-2",children:[g.length>0&&p.jsx("div",{className:"space-y-1",children:g.map(v=>p.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono bg-green-500/10 text-green-700 dark:text-green-400 px-2 py-1 rounded",children:[p.jsx("span",{className:"text-green-500",children:"+"}),p.jsxs("span",{className:"truncate",children:[v,"=",f[v]]})]},v))}),x.length>0&&p.jsxs("div",{className:"space-y-1",children:[p.jsx("p",{className:"text-xs text-muted-foreground",children:e("globalEnvIndicator.skippedLabel")}),x.map(v=>p.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono bg-amber-500/10 text-amber-700 dark:text-amber-400 px-2 py-1 rounded",children:[p.jsx("span",{className:"text-amber-500",children:"~"}),p.jsx("span",{className:"truncate",children:v})]},v))]}),p.jsx("div",{className:"pt-2 border-t border-border/50",children:p.jsx(gt,{variant:"ghost",size:"sm",asChild:!0,className:"h-7 text-xs gap-1.5 -ml-2",children:p.jsxs(uh,{to:"/settings?tab=globalenv",children:[p.jsx(Cb,{className:"w-3.5 h-3.5"}),e("globalEnvIndicator.configureInSettings"),p.jsx(hO,{className:"w-3 h-3 opacity-50"})]})})})]})]})}function W4({className:n,...e}){return p.jsx(iE,{"data-slot":"switch",className:q("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",n),...e,children:p.jsx(oE,{"data-slot":"switch-thumb",className:q("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function Q4(n,e,t){return n(t==="refreshing"?"imageAnalysisStatus.refreshingPreview":t==="invalid"?"imageAnalysisStatus.savedStatus":e==="editor"?"imageAnalysisStatus.livePreview":"imageAnalysisStatus.savedStatus")}function Y4(n,e,t){return e.status==="disabled"?n("imageAnalysisStatus.disabledGlobally"):t!=="claude"?n("imageAnalysisStatus.targetBypassesHook",{target:n(`imageAnalysisStatus.targetLabel.${t}`)}):e.nativeReadPreference?n("imageAnalysisStatus.nativeImageReading"):e.status==="hook-missing"?n("imageAnalysisStatus.setupNeeded"):e.authReadiness==="missing"?n("imageAnalysisStatus.needsAuth"):e.proxyReadiness==="unavailable"?n("imageAnalysisStatus.needsProxy"):e.effectiveRuntimeMode==="native-read"?n("imageAnalysisStatus.nativeFallback"):n("imageAnalysisStatus.transformerReady")}function $4(n,e,t){return e.status==="disabled"?{label:n("imageAnalysisStatus.badgeDisabled"),className:"border-border/80 bg-background/85 text-muted-foreground"}:t!=="claude"?{label:n("imageAnalysisStatus.badgeBypassed"),className:"border-sky-500/25 bg-sky-500/10 text-sky-800 dark:text-sky-200"}:e.nativeReadPreference?{label:n("imageAnalysisStatus.badgeNative"),className:"border-emerald-500/25 bg-emerald-500/10 text-emerald-800 dark:text-emerald-200"}:e.status==="hook-missing"||e.authReadiness==="missing"?{label:e.status==="hook-missing"?n("imageAnalysisStatus.badgeSetup"):n("imageAnalysisStatus.badgeAuth"),className:"border-amber-500/25 bg-amber-500/10 text-amber-800 dark:text-amber-200"}:e.proxyReadiness==="unavailable"?{label:n("imageAnalysisStatus.badgeProxy"),className:"border-amber-500/25 bg-amber-500/10 text-amber-800 dark:text-amber-200"}:{label:n("imageAnalysisStatus.badgeReady"),className:"border-emerald-500/25 bg-emerald-500/10 text-emerald-800 dark:text-emerald-200"}}function X4(n,e,t){if(e.nativeReadPreference)return e.profileModel&&e.nativeImageCapable?n("imageAnalysisStatus.toggleSummaryNativeCapable",{model:e.profileModel}):e.profileModel?n("imageAnalysisStatus.toggleSummaryNativeModel",{model:e.profileModel}):n("imageAnalysisStatus.toggleSummaryNativeDefault");if(!e.backendDisplayName&&t==="claude")return n("imageAnalysisStatus.toggleSummaryNativeFileAccess");if(!e.backendDisplayName)return n("imageAnalysisStatus.toggleSummaryInactiveTarget",{target:n(`imageAnalysisStatus.targetLabel.${t}`)});const i=e.model?` · ${e.model}`:"";return n("imageAnalysisStatus.toggleSummaryTransformerRoute",{backend:e.backendDisplayName,modelSuffix:i})}function J4(n,e,t){return e.status==="disabled"?n("imageAnalysisStatus.noteDisabledGlobally"):t!=="claude"?n("imageAnalysisStatus.noteTargetBypassesHook",{target:n(`imageAnalysisStatus.targetLabel.${t}`)}):e.nativeReadPreference?e.nativeImageCapable===!0?null:e.nativeImageReason:e.status==="hook-missing"?n("imageAnalysisStatus.notePersistHook"):e.authReadiness==="missing"?e.authReason:e.proxyReadiness==="unavailable"?e.proxyReason:null}function Z4({status:n,target:e="claude",source:t="saved",previewState:i="saved",nativeReadPreferenceOverride:o,onToggleNativeRead:a}){const{t:r}=Ce();if(!n)return p.jsxs("div",{className:"rounded-2xl border bg-muted/20 px-4 py-3","aria-live":"polite",children:[p.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted"}),p.jsx("div",{className:"mt-2 h-3 w-52 animate-pulse rounded bg-muted"})]});const c=o??n.nativeReadPreference,d={...n,nativeReadPreference:c},f=$4(r,d,e),m=J4(r,d,e),g=n.nativeImageCapable?r("imageAnalysisStatus.capabilityVerified"):n.profileModel?r("imageAnalysisStatus.capabilityUnknown"):null;return p.jsxs("section",{className:"rounded-2xl border bg-background/95 px-4 py-3 shadow-sm",children:[p.jsxs("div",{className:"flex items-start justify-between gap-3",children:[p.jsx("div",{className:"min-w-0",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"inline-flex h-8 w-8 items-center justify-center rounded-xl border border-sky-500/20 bg-sky-500/10 text-sky-700 dark:text-sky-300",children:p.jsx(yO,{className:"h-4 w-4"})}),p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx("h3",{className:"text-sm font-semibold",children:r("imageAnalysisStatus.sectionTitle")}),p.jsx(Qt,{className:q("h-5 border px-1.5 text-[10px]",f.className),children:f.label})]}),p.jsxs("p",{className:"text-xs text-muted-foreground",children:[Q4(r,t,i)," ·"," ",Y4(r,d,e)]})]})]})}),p.jsx(gt,{size:"sm",variant:"outline",className:"h-8 shrink-0",asChild:!0,children:p.jsxs(uh,{to:"/settings?tab=image",children:[r("imageAnalysisStatus.openSettings"),p.jsx(gO,{className:"ml-1 h-3.5 w-3.5"})]})})]}),p.jsx("div",{className:"mt-3 rounded-xl border bg-muted/15 px-3 py-3",children:p.jsxs("div",{className:"flex items-start justify-between gap-3",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx("div",{className:"text-sm font-medium text-foreground",children:r("imageAnalysisStatus.useNativeImageReading")}),g&&p.jsx(Qt,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:g})]}),p.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:X4(r,d,e)})]}),p.jsx(W4,{checked:c,onCheckedChange:a,disabled:!a,"aria-label":r("imageAnalysisStatus.useNativeImageReading")})]})}),m&&p.jsx("div",{className:"mt-2 rounded-lg border border-border/70 bg-muted/20 px-3 py-2 text-xs leading-5 text-muted-foreground",children:m})]})}const e_=A.lazy(()=>rt(()=>Promise.resolve().then(()=>Mf),void 0).then(n=>({default:n.CodeEditor})));function jW({rawJsonContent:n,isRawJsonValid:e,rawJsonEdits:t,settings:i,profileTarget:o="claude",imageAnalysisStatus:a,imageAnalysisStatusSource:r="saved",imageAnalysisStatusPreviewState:c="saved",nativeReadPreferenceOverride:d,onToggleNativeRead:f,onChange:m,missingRequiredFields:g=[]}){const{t:x}=Ce(),v=g.length>0;return p.jsx(A.Suspense,{fallback:p.jsxs("div",{className:"flex items-center justify-center h-full",children:[p.jsx(hi,{className:"w-6 h-6 animate-spin text-muted-foreground"}),p.jsx("span",{className:"ml-2 text-muted-foreground",children:x("profileEditorSections.loadingEditor")})]}),children:p.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!e&&t!==null&&p.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[p.jsx(Gr,{className:"w-4 h-4"}),x("profileEditor.invalidJson")]}),e&&v&&p.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[p.jsx(Qi,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),p.jsxs("div",{children:[p.jsxs("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:[x("profileEditor.missingFields"),":"]})," ",p.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:g.join(", ")}),p.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:x("profileEditor.missingFieldsHint")})]})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-6 pb-4 pt-4",children:p.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:p.jsx(e_,{value:n,onChange:m,language:"json",minHeight:"100%",heightMode:"fill-parent"})})}),p.jsx("div",{className:"mx-6 mb-4",children:p.jsx(Z4,{status:a,target:o,source:r,previewState:c,nativeReadPreferenceOverride:d,onToggleNativeRead:f})}),p.jsx("div",{className:"mx-6 mb-4",children:p.jsx("div",{className:"border rounded-md overflow-hidden",children:p.jsx(Jb,{profileEnv:i?.env})})})]})})}function lw(n,e){try{var t=n()}catch(i){return e(i)}return t&&t.then?t.then(void 0,e):t}function t_(n,e){for(var t={};n.length;){var i=n[0],o=i.code,a=i.message,r=i.path.join(".");if(!t[r])if("unionErrors"in i){var c=i.unionErrors[0].errors[0];t[r]={message:c.message,type:c.code}}else t[r]={message:a,type:o};if("unionErrors"in i&&i.unionErrors.forEach(function(m){return m.errors.forEach(function(g){return n.push(g)})}),e){var d=t[r].types,f=d&&d[i.code];t[r]=bO(r,e,t,o,f?[].concat(f,i.message):i.message)}n.shift()}return t}function n_(n,e){for(var t={};n.length;){var i=n[0],o=i.code,a=i.message,r=i.path.join(".");if(!t[r])if(i.code==="invalid_union"&&i.errors.length>0){var c=i.errors[0][0];t[r]={message:c.message,type:c.code}}else t[r]={message:a,type:o};if(i.code==="invalid_union"&&i.errors.forEach(function(m){return m.forEach(function(g){return n.push(g)})}),e){var d=t[r].types,f=d&&d[i.code];t[r]=bO(r,e,t,o,f?[].concat(f,i.message):i.message)}n.shift()}return t}function i_(n,e,t){if(t===void 0&&(t={}),(function(i){return"_def"in i&&typeof i._def=="object"&&"typeName"in i._def})(n))return function(i,o,a){try{return Promise.resolve(lw(function(){return Promise.resolve(n[t.mode==="sync"?"parse":"parseAsync"](i,e)).then(function(r){return a.shouldUseNativeValidation&&ik({},a),{errors:{},values:t.raw?Object.assign({},i):r}})},function(r){if((function(c){return Array.isArray(c?.issues)})(r))return{values:{},errors:ok(t_(r.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw r}))}catch(r){return Promise.reject(r)}};if((function(i){return"_zod"in i&&typeof i._zod=="object"})(n))return function(i,o,a){try{return Promise.resolve(lw(function(){return Promise.resolve((t.mode==="sync"?M2:N2)(n,i,e)).then(function(r){return a.shouldUseNativeValidation&&ik({},a),{errors:{},values:t.raw?Object.assign({},i):r}})},function(r){if((function(c){return c instanceof L2})(r))return{values:{},errors:ok(n_(r.issues,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw r}))}catch(r){return Promise.reject(r)}};throw new Error("Invalid input: not a Zod schema")}const o_={sm:{container:"w-6 h-6",icon:"w-4 h-4",text:"text-xs"},md:{container:"w-8 h-8",icon:"w-5 h-5",text:"text-sm"},lg:{container:"w-12 h-12",icon:"w-8 h-8",text:"text-lg"}};function s_({provider:n,className:e,size:t="md"}){const i=R5(n),o=o_[t],a=UO(n),r=j5(n);return p.jsx("div",{className:q("flex items-center justify-center rounded-md",a&&!r&&(E5(n)?"bg-gray-900 p-1":"bg-white p-1"),o.container,e),children:a?p.jsx("img",{src:a,alt:`${n} logo`,className:q(r?o.container:o.icon,"object-contain")}):p.jsx("span",{className:q("font-semibold",i.textClass,o.text),children:i.letter})})}function IW(){return It({queryKey:["profiles"],queryFn:()=>Ue.profiles.list()})}function a_(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.profiles.create(t),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),fe.success(e("toasts.profileCreated"))},onError:t=>{fe.error(t.message)}})}function BW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.profiles.delete(t),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),fe.success(e("toasts.profileDeleted"))},onError:t=>{fe.error(t.message)}})}function _W(){return ft({mutationFn:()=>Ue.profiles.discoverOrphans()})}function HW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.profiles.registerOrphans(t),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),fe.success(e("toasts.orphanProfilesComplete"))}})}function UW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({name:t,data:i})=>Ue.profiles.copy(t,i),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),fe.success(e("toasts.profileCopied"))}})}function zW(){return ft({mutationFn:({name:n,includeSecrets:e})=>Ue.profiles.export(n,e??!1)})}function FW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.profiles.import(t),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),fe.success(e("toasts.profileImported"))}})}const r_="https://openrouter.ai/api/v1",MP=Object.freeze({glmt:"glm",kimi:"km",alibaba:"alibaba-coding-plan",acp:"alibaba-coding-plan",hf:"huggingface"}),NP=[{id:"openrouter",name:"OpenRouter",description:"349+ models from OpenAI, Anthropic, Google, Meta",baseUrl:r_,defaultProfileName:"openrouter",defaultModel:"anthropic/claude-opus-4.5",apiKeyPlaceholder:"sk-or-...",apiKeyHint:"Get your API key at openrouter.ai/keys",category:"recommended",requiresApiKey:!0,badge:"349+ models",featured:!0,icon:"/icons/openrouter.svg"},{id:"alibaba-coding-plan",name:"Alibaba Coding Plan",description:"Alibaba Cloud Coding Plan via Anthropic-compatible endpoint",baseUrl:"https://coding-intl.dashscope.aliyuncs.com/apps/anthropic",defaultProfileName:"albb",defaultModel:"qwen3-coder-plus",apiKeyPlaceholder:"sk-sp-...",apiKeyHint:"Get your Coding Plan key from Alibaba Cloud Model Studio",category:"recommended",requiresApiKey:!0,badge:"Coding Plan",featured:!0,icon:"/assets/providers/alibabacloud-color.svg"},{id:"ollama",name:"Ollama (Local)",description:"Local open-source models via Ollama (32K+ context)",baseUrl:"http://localhost:11434",defaultProfileName:"ollama",defaultModel:"qwen3-coder",apiKeyPlaceholder:"ollama",apiKeyHint:"Install Ollama from ollama.com - no API key needed for local",category:"recommended",requiresApiKey:!1,badge:"Local",featured:!0,icon:"/icons/ollama.svg"},{id:"llamacpp",name:"llama.cpp (Local)",description:"Local inference via llama.cpp (LLaMA models)",baseUrl:"http://127.0.0.1:8080",defaultProfileName:"llamacpp",defaultModel:"llama3-8b",apiKeyPlaceholder:"llamacpp",apiKeyHint:"Run llama.cpp server: ./server --host 0.0.0.0 --port 8080 -m model.gguf",category:"recommended",requiresApiKey:!1,badge:"Local",featured:!0,icon:"/assets/providers/llama-cpp.svg"},{id:"anthropic",name:"Anthropic (Direct API)",description:"Use your own Anthropic API key (sk-ant-...)",baseUrl:"",defaultProfileName:"anthropic",defaultModel:"claude-sonnet-4-5-20250929",apiKeyPlaceholder:"sk-ant-api03-...",apiKeyHint:"Get key at console.anthropic.com/settings/keys",category:"recommended",requiresApiKey:!0,badge:"Direct",featured:!0,icon:"/assets/providers/claude.svg"},{id:"huggingface",name:"Hugging Face",description:"Inference Providers router via OpenAI-compatible chat completions",baseUrl:"https://router.huggingface.co/v1",defaultProfileName:"hf",defaultModel:"openai/gpt-oss-120b:fastest",apiKeyPlaceholder:"hf_...",apiKeyHint:"Create a User Access Token at hf.co/settings/tokens",category:"alternative",requiresApiKey:!0,defaultTarget:"droid",badge:"Router"},{id:"glm",name:"GLM",description:"Direct Z.AI Anthropic-compatible API profile",baseUrl:"https://api.z.ai/api/anthropic",defaultProfileName:"glm",defaultModel:"glm-5",apiKeyPlaceholder:"ghp_...",apiKeyHint:"Get your API key from Z.AI",category:"alternative",requiresApiKey:!0,badge:"Z.AI",icon:"/icons/zai.svg"},{id:"km",name:"Kimi",description:"Moonshot AI - Fast reasoning model",baseUrl:"https://api.kimi.com/coding/",defaultProfileName:"km",defaultModel:"kimi-k2-thinking-turbo",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key from Moonshot AI",category:"alternative",requiresApiKey:!0,alwaysThinkingEnabled:!0,badge:"Reasoning",icon:"/icons/kimi.svg"},{id:"foundry",name:"Azure Foundry",description:"Claude via Microsoft Azure AI Foundry",baseUrl:"https://<your-resource>.services.ai.azure.com/api/anthropic",defaultProfileName:"foundry",defaultModel:"claude-sonnet-4-5",apiKeyPlaceholder:"YOUR_AZURE_API_KEY",apiKeyHint:"Create resource at ai.azure.com, get API key from Keys tab",category:"alternative",requiresApiKey:!0,badge:"Azure",icon:"/icons/azure.svg"},{id:"mm",name:"Minimax",description:"M2.1/M2.1-lightning/M2 - multilang coding (1M context)",baseUrl:"https://api.minimax.io/anthropic",defaultProfileName:"mm",defaultModel:"MiniMax-M2.1",apiKeyPlaceholder:"YOUR_MINIMAX_API_KEY_HERE",apiKeyHint:"Get your API key at platform.minimax.io",category:"alternative",requiresApiKey:!0,badge:"1M context",icon:"/icons/minimax.svg"},{id:"deepseek",name:"DeepSeek",description:"V3.2 and R1 reasoning model (128K context)",baseUrl:"https://api.deepseek.com/anthropic",defaultProfileName:"deepseek",defaultModel:"deepseek-chat",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key at platform.deepseek.com",category:"alternative",requiresApiKey:!0,badge:"Reasoning",icon:"/icons/deepseek.svg"},{id:"qwen",name:"Qwen",description:"Alibaba Cloud - Qwen3 models (256K-1M context, thinking support)",baseUrl:"https://dashscope-intl.aliyuncs.com/apps/anthropic",defaultProfileName:"qwen-api",defaultModel:"qwen3-coder-plus",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key from Alibaba Cloud Model Studio",category:"alternative",requiresApiKey:!0,badge:"Alibaba",icon:"/assets/providers/qwen-color.svg"},{id:"ollama-cloud",name:"Ollama Cloud",description:"Ollama cloud models via direct API (glm-5:cloud, minimax-m2.1:cloud)",baseUrl:"https://ollama.com",defaultProfileName:"ollama-cloud",defaultModel:"glm-5:cloud",apiKeyPlaceholder:"YOUR_OLLAMA_CLOUD_API_KEY",apiKeyHint:"Get your API key at ollama.com",category:"alternative",requiresApiKey:!0,badge:"Cloud",icon:"/icons/ollama.svg"},{id:"novita",name:"Novita AI",description:"Anthropic-compatible API for Claude Code and CCS profiles",baseUrl:"https://api.novita.ai/anthropic",defaultProfileName:"novita",defaultModel:"deepseek/deepseek-v3.2",apiKeyPlaceholder:"YOUR_NOVITA_API_KEY",apiKeyHint:"Get your API key at novita.ai",category:"alternative",requiresApiKey:!0,badge:"Anthropic-compatible",icon:"/icons/novita.svg"}];function LP(n){return{...n,extraEnv:n.extraEnv?{...n.extraEnv}:void 0}}function l_(n){const e=LP(n);return e.extraEnv&&Object.freeze(e.extraEnv),Object.freeze(e)}function c_(n,e){const t=new Set;for(const o of n){const a=o.id.trim().toLowerCase();if(o.id!==a)throw new Error(`Preset ID must be normalized: "${o.id}"`);if(t.has(o.id))throw new Error(`Duplicate preset ID detected: "${o.id}"`);t.add(o.id)}const i=new Set;for(const[o,a]of Object.entries(e)){const r=o.trim().toLowerCase();if(!r)throw new Error("Preset alias keys cannot be empty");if(o!==r)throw new Error(`Preset alias must be normalized: "${o}"`);if(i.has(r))throw new Error(`Duplicate normalized preset alias detected: "${o}"`);if(i.add(r),!t.has(a))throw new Error(`Preset alias "${o}" points to unknown target "${a}"`);if(t.has(r))throw new Error(`Preset alias "${o}" collides with canonical preset ID "${r}"`)}}c_(NP,MP);const u_=Object.freeze(NP.map(l_));function d_(){return u_.map(LP)}function h_(n){const e=n.trim().toLowerCase();return MP[e]||e}const f_=d_(),Zb=Object.freeze(f_.map(n=>({...n})));function p_(n,e){return e||(n?.requiresApiKey===!1?n.apiKeyPlaceholder||n.id:"")}function m_(n){return Zb.filter(e=>e.category===n)}function hg(n){const e=h_(n);return Zb.find(t=>t.id===e)}const g_=ls().refine(n=>n.trim().length===0||ls().url().safeParse(n).success,{message:"Invalid URL format"}),y_=R2({name:ls().min(1,"Name is required").regex(/^[a-zA-Z][a-zA-Z0-9._-]*$/,"Must start with letter, only letters/numbers/.-_"),baseUrl:g_,apiKey:ls(),model:ls().optional(),opusModel:ls().optional(),sonnetModel:ls().optional(),haikuModel:ls().optional(),target:E2(["claude","droid","codex"])}),b_=["/chat/completions","/v1/messages","/messages","/completions"],$s="custom",fg="openrouter",RP=new Set(["ollama","llamacpp"]),pg={name:"",baseUrl:"",apiKey:"",model:"",opusModel:"",sonnetModel:"",haikuModel:"",target:"claude"},EP=m_("recommended"),x_=EP.filter(n=>!RP.has(n.id)),v_=EP.filter(n=>RP.has(n.id)),C_=Zb.filter(n=>n.category!=="recommended");function qW({open:n,onOpenChange:e,onSuccess:t,initialMode:i="openrouter"}){const{t:o}=Ce(),a=a_(),[r,c]=A.useState("basic"),[d,f]=A.useState(null),[m,g]=A.useState(!1),[x,v]=A.useState(fg),[C,k]=A.useState(""),{models:w}=V4(),{register:P,handleSubmit:T,formState:{errors:M},control:D,reset:L,setValue:N}=j2({resolver:i_(y_),defaultValues:pg}),j=sk({control:D,name:"baseUrl"}),K=sk({control:D,name:"target"}),U=A.useCallback(Y=>{if(!Y){L(pg);return}L({...pg,name:Y.defaultProfileName,baseUrl:Y.baseUrl,model:Y.defaultModel,opusModel:Y.defaultModel,sonnetModel:Y.defaultModel,haikuModel:Y.defaultModel,target:Y.defaultTarget??"claude"})},[L]),z=A.useMemo(()=>x===$s?null:hg(x)??null,[x]),X=A.useMemo(()=>C.trim()?[...I4(w,C)].sort((ae,de)=>(de.created??0)-(ae.created??0)).slice(0,20):F4(w,2),[w,C]);A.useEffect(()=>{if(n)if(c("basic"),f(null),g(!1),k(""),i==="normal")v($s),U(null);else{const ae=hg(i==="openrouter"?fg:i);if(ae){v(ae.id),U(ae);return}v($s),U(null)}},[n,i,U,L]);const H=Y=>{const ae=hg(Y);if(ae){v(ae.id),U(ae);return}v($s),U(null)},V=Y=>{N("model",Y.id),N("opusModel",Y.id),N("sonnetModel",Y.id),N("haikuModel",Y.id),k(Y.name),fe.success(o("profileCreateDialog.appliedModelToTiers",{model:Y.name}),{duration:2e3})};A.useEffect(()=>{if(j&&x===$s){const ae=j.toLowerCase();for(const de of b_)if(ae.endsWith(de)){const be=j.replace(new RegExp(de+"$","i"),"");f(`URL ends with "${de}" - Claude appends this automatically. You likely want: ${be}`);return}}f(null)},[j,x]);const ie=async Y=>{if(z?.requiresApiKey!==!1&&!Y.apiKey){fe.error(re.t("commonToast.apiKeyRequired"));return}const ae={...Y,apiKey:p_(z,Y.apiKey)};try{await a.mutateAsync(ae),fe.success(o("profileCreateDialog.profileCreated",{name:ae.name})),t(ae.name),e(!1)}catch(de){fe.error(de.message||o("profileCreateDialog.failedCreate"))}},oe=!!M.name||!!M.baseUrl||!!M.apiKey,B=!!M.model||!!M.opusModel||!!M.sonnetModel||!!M.haikuModel,Z=a.isPending,se=z?.id===fg;return p.jsx(Nb,{open:n,onOpenChange:e,children:p.jsxs(Lb,{"data-testid":"profile-create-dialog",className:"h-[calc(100dvh-2rem)] max-h-[900px] gap-0 overflow-hidden p-0 sm:max-w-[700px] !flex !flex-col",children:[p.jsxs(Rb,{className:"shrink-0 border-b p-6 pb-4",children:[p.jsxs(Eb,{className:"flex items-center gap-2",children:[p.jsx(ZS,{className:"w-5 h-5 text-primary"}),o("profileCreateDialog.createProfile")]}),p.jsx(jb,{children:o("profileCreateDialog.chooseProviderHint")})]}),p.jsxs("form",{onSubmit:T(ie),className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[p.jsx("div",{"data-testid":"profile-create-provider-chooser",className:"max-h-[34dvh] shrink-0 space-y-3 overflow-y-auto overscroll-contain border-b bg-muted/10 px-6 py-3",children:p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"flex items-start justify-between gap-4",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx(yn,{className:"text-xs text-muted-foreground",children:o("profileEditor.provider")}),p.jsx("p",{className:"text-xs text-muted-foreground",children:o("profileEditor.providerChooserHint")})]}),p.jsx("span",{className:"pt-0.5 text-[11px] text-muted-foreground",children:o("profileEditor.scrollHint")})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(yn,{className:"text-xs font-medium uppercase tracking-[0.12em] text-foreground/70",children:o("profileEditor.featuredProviders")}),p.jsx("div",{className:"-mx-1 overflow-x-auto pb-1",children:p.jsxs("div",{className:"flex min-w-max items-stretch gap-2 px-1",children:[x_.map(Y=>p.jsx(mg,{preset:Y,isSelected:x===Y.id,onClick:()=>H(Y.id),density:"featured"},Y.id)),p.jsx("div",{className:"mx-1 hidden w-px rounded-full bg-border/70 sm:block"}),p.jsx(S_,{isSelected:x===$s,onClick:()=>H($s)})]})})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(yn,{className:"text-xs font-medium uppercase tracking-[0.12em] text-foreground/70",children:o("profileEditor.morePresets")}),p.jsx("div",{className:"-mx-1 overflow-x-auto pb-1",children:p.jsx("div",{className:"flex min-w-max items-stretch gap-2 px-1",children:C_.map(Y=>p.jsx(mg,{preset:Y,isSelected:x===Y.id,onClick:()=>H(Y.id),density:"compact"},Y.id))})})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(yn,{className:"text-xs font-medium uppercase tracking-[0.12em] text-foreground/70",children:o("openrouterQuickStart.localRuntimesTitle")}),p.jsx("div",{className:"flex flex-wrap gap-2",children:v_.map(Y=>p.jsx(mg,{preset:Y,isSelected:x===Y.id,onClick:()=>H(Y.id),density:"compact"},Y.id))})]})]})}),p.jsxs(OP,{value:r,onValueChange:c,className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[p.jsx("div",{className:"px-6 pt-4",children:p.jsxs($b,{className:"grid w-full grid-cols-2",children:[p.jsxs(bh,{value:"basic",className:"relative",children:[o("profileCreateDialog.basicInformation"),oe&&p.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]}),p.jsxs(bh,{value:"models",className:"relative",children:[o("profileCreateDialog.modelConfiguration"),B&&p.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]})]})}),p.jsxs("div",{"data-testid":"profile-create-tab-scroll",className:"flex-1 min-h-0 overflow-y-auto",children:[p.jsxs(py,{value:"basic",className:"p-6 space-y-4 mt-0",children:[p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs(yn,{htmlFor:"name",children:[o("profileDialog.name")," ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsx(Ii,{id:"name",...P("name"),placeholder:o("profileDialog.namePlaceholder"),className:"font-mono"}),M.name?p.jsx("p",{className:"text-xs text-destructive",children:M.name.message}):p.jsxs("p",{className:"text-xs text-muted-foreground",children:[o("profileCreateDialog.usedInCli")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:'ccs my-api "prompt"'})]})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(yn,{htmlFor:"baseUrl",children:o("profileCreateDialog.apiBaseUrl")}),p.jsx(Ii,{id:"baseUrl",...P("baseUrl"),placeholder:o("profileCreateDialog.baseUrlPlaceholder")}),M.baseUrl?p.jsx("p",{className:"text-xs text-destructive",children:M.baseUrl.message}):d?p.jsxs("div",{className:"flex items-start gap-2 text-xs text-yellow-600 bg-yellow-50 dark:bg-yellow-900/20 p-2 rounded",children:[p.jsx(Qi,{className:"w-4 h-4 shrink-0 mt-0.5"}),p.jsx("span",{children:d})]}):z?p.jsx("p",{className:"text-xs text-muted-foreground",children:z.baseUrl?o("profileCreateDialog.prefilledFromPreset",{name:z.name}):o("profileCreateDialog.optionalForPreset",{name:z.name})}):p.jsx("p",{className:"text-xs text-muted-foreground",children:o("profileCreateDialog.endpointHint")})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs(yn,{htmlFor:"apiKey",children:[o("profileDialog.apiKey")," ",z?.requiresApiKey!==!1&&p.jsx("span",{className:"text-destructive",children:"*"}),z?.requiresApiKey===!1&&p.jsx("span",{className:"text-muted-foreground text-xs font-normal",children:o("profileCreateDialog.optional")})]}),p.jsxs("div",{className:"relative",children:[p.jsx(Ii,{id:"apiKey",type:m?"text":"password",...P("apiKey"),placeholder:z?.requiresApiKey===!1?o("profileCreateDialog.apiKeyOptionalPlaceholder"):z?.apiKeyPlaceholder??o("profileCreateDialog.apiKeyPlaceholder"),className:"pr-10"}),p.jsx(gt,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-9 w-9 text-muted-foreground hover:text-foreground",onClick:()=>g(!m),tabIndex:-1,children:m?p.jsx(Kc,{className:"h-4 w-4"}):p.jsx(Vc,{className:"h-4 w-4"})})]}),M.apiKey?p.jsx("p",{className:"text-xs text-destructive",children:M.apiKey.message}):z?.requiresApiKey===!1?p.jsx("p",{className:"text-xs text-muted-foreground",children:o("profileCreateDialog.apiKeyOptionalHint")}):z?.apiKeyHint&&p.jsx("p",{className:"text-xs text-muted-foreground",children:z.apiKeyHint})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(yn,{htmlFor:"target",children:o("codex.defaultTargetCli")}),p.jsxs(zO,{value:K,onValueChange:Y=>N("target",Y),children:[p.jsx(Ub,{id:"target",children:p.jsx(FO,{})}),p.jsxs(zb,{children:[p.jsx(ac,{value:"claude",children:o("profileCard.claudeCodeDefault")}),p.jsx(ac,{value:"droid",children:o("profileCard.factoryDroid")}),p.jsx(ac,{value:"codex",children:o("profileCard.codexCli")})]})]}),p.jsxs("p",{className:"text-xs text-muted-foreground",children:[K==="droid"?p.jsxs(p.Fragment,{children:[o("profileEditor.targetHintPreferredAlias")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccs-droid"}),"."]}):K==="codex"?p.jsxs(p.Fragment,{children:[o("profileEditor.targetHintPreferredAlias")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccsx"}),"."]}):p.jsxs(p.Fragment,{children:[o("profileEditor.targetHintClaudeDefault")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccs"}),"."]}),K==="droid"?p.jsxs(p.Fragment,{children:[" ",o("profileEditor.targetHintLegacyAlias")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccsd"}),"."]}):K==="codex"?p.jsxs(p.Fragment,{children:[" ",o("profileEditor.targetHintLegacyAlias")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccs-codex"}),"."]}):null," ",o("profileEditor.targetHintOverride")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"--target"}),"."]})]})]}),p.jsxs(py,{value:"models",className:"p-6 mt-0 space-y-4",children:[p.jsxs("div",{className:"flex items-start gap-3 p-3 bg-blue-50 dark:bg-blue-950/20 text-blue-800 dark:text-blue-300 rounded-md text-sm border border-blue-100 dark:border-blue-900/30",children:[p.jsx(Yh,{className:"w-5 h-5 shrink-0 mt-0.5"}),p.jsxs("div",{children:[p.jsx("p",{className:"font-medium mb-1",children:o("profileCreateDialog.modelMapping")}),p.jsx("p",{className:"text-xs opacity-90",children:o("profileCreateDialog.modelMappingDesc")})]})]}),se&&p.jsxs("div",{className:"space-y-2",children:[p.jsx(yn,{children:o("openrouterModelPicker.searchModels")}),p.jsx(Ii,{value:C,onChange:Y=>k(Y.target.value),placeholder:o("profileCreateDialog.searchModelsPlaceholder"),onKeyDown:Y=>{Y.key==="Enter"&&X.length>0&&(Y.preventDefault(),V(X[0]))}}),p.jsx("div",{className:"border rounded-md max-h-48 overflow-y-auto",children:X.length===0?p.jsx("p",{className:"text-sm text-muted-foreground p-3 text-center",children:C?o("profileCreateDialog.noModelsFound",{query:C}):o("profileCreateDialog.loadingModels")}):p.jsxs("div",{className:"p-1",children:[!C&&p.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground",children:[p.jsx(qE,{className:"w-3 h-3 text-accent"}),p.jsx("span",{children:o("openrouterModelPicker.newestModels")})]}),X.map(Y=>p.jsx(k_,{model:Y,onClick:()=>V(Y),showAge:!C},Y.id))]})})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs(yn,{htmlFor:"model",children:[o("profileCreateDialog.defaultModel"),p.jsx(Qt,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"ANTHROPIC_MODEL"})]}),p.jsx(Ii,{id:"model",...P("model"),placeholder:z?.defaultModel??"claude-sonnet-4",className:"font-mono text-sm"})]}),p.jsxs("div",{className:"grid gap-3 pt-2 border-t",children:[p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs(yn,{htmlFor:"sonnetModel",className:"text-sm",children:[o("profileCreateDialog.sonnetMapping"),p.jsx(Qt,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_SONNET"})]}),p.jsx(Ii,{id:"sonnetModel",...P("sonnetModel"),placeholder:o("profileCreateDialog.sonnetMappingPlaceholder"),className:"font-mono text-sm h-9"})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs(yn,{htmlFor:"opusModel",className:"text-sm",children:[o("profileCreateDialog.opusMapping"),p.jsx(Qt,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_OPUS"})]}),p.jsx(Ii,{id:"opusModel",...P("opusModel"),placeholder:o("profileCreateDialog.opusMappingPlaceholder"),className:"font-mono text-sm h-9"})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs(yn,{htmlFor:"haikuModel",className:"text-sm",children:[o("profileCreateDialog.haikuMapping"),p.jsx(Qt,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_HAIKU"})]}),p.jsx(Ii,{id:"haikuModel",...P("haikuModel"),placeholder:o("profileCreateDialog.haikuMappingPlaceholder"),className:"font-mono text-sm h-9"})]})]})]})]})]}),p.jsxs(g5,{"data-testid":"profile-create-footer",className:"shrink-0 border-t bg-muted/10 p-6 pt-4",children:[p.jsx(gt,{type:"button",variant:"outline",onClick:()=>e(!1),children:o("profileDialog.cancel")}),p.jsx(gt,{type:"submit",disabled:Z,className:q(Z&&"opacity-80"),children:Z?p.jsxs(p.Fragment,{children:[p.jsx(hi,{className:"w-4 h-4 mr-2 animate-spin"}),o("cliproxyDialog.creating")]}):p.jsxs(p.Fragment,{children:[p.jsx(ZS,{className:"w-4 h-4 mr-2"}),o("profileCreateDialog.createProfile")]})})]})]})]})]})})}function mg({preset:n,isSelected:e,onClick:t,density:i="compact"}){const o=n.id==="anthropic",a=i==="featured";return p.jsxs("button",{type:"button",onClick:t,className:q("flex flex-none items-center gap-3 rounded-xl border px-3 py-2.5 text-left transition-all",a?"h-[68px] w-[236px]":"h-[64px] w-[168px]",e?"border-primary bg-primary/8 shadow-sm ring-1 ring-primary/10":"border-border/60 bg-background hover:border-primary/40 hover:bg-accent/20"),children:[p.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-border/60 bg-background",children:o?p.jsx(s_,{provider:"claude",size:"md",className:"rounded-lg"}):n.icon?p.jsx("img",{src:n.icon,alt:"",className:"h-5 w-5 object-contain"}):p.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-muted/70 text-xs font-semibold text-foreground/70",children:n.name.charAt(0)})}),p.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx("div",{className:"truncate text-[13px] font-semibold leading-tight tracking-[-0.01em]",children:n.name}),n.badge&&a&&p.jsx(Qt,{variant:"secondary",className:"inline-flex bg-muted px-1.5 py-0 text-[10px] text-muted-foreground",children:n.badge})]}),n.badge&&!a&&p.jsx(Qt,{variant:"secondary",className:"inline-flex w-fit bg-muted px-1.5 py-0 text-[10px] text-muted-foreground",children:n.badge})]})]})}function S_({isSelected:n,onClick:e}){const{t}=Ce();return p.jsxs("button",{type:"button",onClick:e,className:q("flex h-[68px] w-[236px] flex-none items-center gap-3 rounded-xl border border-dashed px-3 py-2.5 text-left transition-all",n?"border-primary bg-primary/8 shadow-sm ring-1 ring-primary/10":"border-muted-foreground/30 bg-background hover:border-primary/40 hover:bg-accent/20"),children:[p.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-dashed border-current/30 bg-muted/70",children:p.jsx(Cb,{className:"h-4 w-4 text-muted-foreground"})}),p.jsx("div",{className:"min-w-0 flex-1",children:p.jsx("div",{className:"text-sm font-semibold leading-tight",children:t("profileEditor.customEndpoint")})})]})}function k_({model:n,onClick:e,showAge:t}){const{t:i}=Ce();return p.jsxs("button",{type:"button",onClick:e,className:"group flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",children:[p.jsx("span",{className:"flex-1 truncate",children:n.name}),p.jsxs("span",{className:"text-muted-foreground group-hover:text-accent-foreground/80 ml-2 flex items-center gap-2 text-xs",children:[t&&n.created&&p.jsx(Qt,{variant:"outline",className:"text-[10px] text-accent group-hover:text-accent-foreground/80 group-hover:border-accent-foreground/30",children:q4(n.created)}),n.isFree?p.jsx(Qt,{variant:"secondary",className:"text-xs group-hover:bg-accent-foreground/20 group-hover:text-accent-foreground",children:i("profileCreateDialog.free")}):p.jsx("span",{children:R4(n.pricing)}),p.jsx("span",{children:U4(n.context_length)})]})]})}function w_({className:n,...e}){return p.jsx("div",{"data-slot":"card",className:q("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",n),...e})}function A_({className:n,...e}){return p.jsx("div",{"data-slot":"card-header",className:q("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",n),...e})}function O_({className:n,...e}){return p.jsx("div",{"data-slot":"card-title",className:q("leading-none font-semibold",n),...e})}function P_({className:n,...e}){return p.jsx("div",{"data-slot":"card-description",className:q("text-muted-foreground text-sm",n),...e})}function T_({className:n,...e}){return p.jsx("div",{"data-slot":"card-content",className:q("px-6",n),...e})}const ex="[1m]",tx=["ANTHROPIC_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL"],D_=new Set(tx);function GW(n){return n.toLowerCase().startsWith("gemini-")}function nx(n){return n.toLowerCase().endsWith(ex.toLowerCase())}function M_(n){return!n||nx(n)?n:`${n}${ex}`}function jP(n){return n&&(nx(n)?n.slice(0,-ex.length):n)}function KW(n){return D_.has(n)}function N_(n){return jP(n.trim()).replace(/\([^)]+\)$/,"")}function VW(n){return tx.some(e=>{const t=n[e];return typeof t=="string"&&nx(t)})}function WW(n,e,t={}){const i={...n};for(const o of tx){const a=i[o];if(typeof a!="string"||a.trim().length===0)continue;const r=N_(a),c=t.supportsExtendedContext?.(r,o)??!0;i[o]=e&&c?M_(a):jP(a)}return i}const L_=["agy","claude","gemini","codex","cursor","gitlab","codebuddy","qwen","kimi","iflow","kilo","kiro"],QW=L_.map(n=>({id:n,name:Hb(n),description:B5(n)})),R_=["provider","auth","variant","success"];function YW(n){return n==="account"?1:R_.indexOf(n)}const $W=aE,XW=lE,JW=rE,E_=A.forwardRef(({className:n,align:e="center",sideOffset:t=4,...i},o)=>p.jsx(sE,{children:p.jsx(tO,{ref:o,align:e,sideOffset:t,className:q("z-50 w-80 max-w-[calc(100vw-2rem)] rounded-lg border border-border/70 bg-popover p-4 text-popover-foreground shadow-xl shadow-black/10 outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...i})}));E_.displayName=tO.displayName;const j_=A.lazy(()=>rt(()=>Promise.resolve().then(()=>Mf),void 0).then(n=>({default:n.CodeEditor})));function ZW({rawJsonContent:n,isRawJsonValid:e,rawJsonEdits:t,onRawJsonChange:i,profileEnv:o,missingRequiredFields:a=[]}){const{t:r}=Ce(),c=a.length>0;return p.jsx(A.Suspense,{fallback:p.jsxs("div",{className:"flex items-center justify-center h-full",children:[p.jsx(hi,{className:"w-6 h-6 animate-spin text-muted-foreground"}),p.jsx("span",{className:"ml-2 text-muted-foreground",children:r("providerEditor.loadingEditor")})]}),children:p.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!e&&t!==null&&p.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[p.jsx(Gr,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),e&&c&&p.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[p.jsx(Qi,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),p.jsxs("div",{children:[p.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",p.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:a.join(", ")}),p.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Apply a preset from Model Config tab or add these fields manually. Without them, Claude Code will fail with 404 errors."})]})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-6 pb-4 pt-4",children:p.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:p.jsx(j_,{value:n,onChange:i,language:"json",minHeight:"100%",heightMode:"fill-parent"})})}),p.jsx("div",{className:"mx-6 mb-4",children:p.jsx("div",{className:"border rounded-md overflow-hidden",children:p.jsx(Jb,{profileEnv:o})})})]})})}let gy=[],IP=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?IP:gy).push(t=t+n[e])})();function I_(n){if(n<768)return!1;for(let e=0,t=gy.length;;){let i=e+t>>1;if(n<gy[i])t=i;else if(n>=IP[i])e=i+1;else return!0;if(e==t)return!1}}function cw(n){return n>=127462&&n<=127487}const uw=8205;function B_(n,e,t=!0,i=!0){return(t?BP:__)(n,e,i)}function BP(n,e,t){if(e==n.length)return e;e&&_P(n.charCodeAt(e))&&HP(n.charCodeAt(e-1))&&e--;let i=gg(n,e);for(e+=dw(i);e<n.length;){let o=gg(n,e);if(i==uw||o==uw||t&&I_(o))e+=dw(o),i=o;else if(cw(o)){let a=0,r=e-2;for(;r>=0&&cw(gg(n,r));)a++,r-=2;if(a%2==0)break;e+=2}else break}return e}function __(n,e,t){for(;e>0;){let i=BP(n,e-2,t);if(i<e)return i;e--}return 0}function gg(n,e){let t=n.charCodeAt(e);if(!HP(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return _P(i)?(t-55296<<10)+(i-56320)+65536:t}function _P(n){return n>=56320&&n<57344}function HP(n){return n>=55296&&n<56320}function dw(n){return n<65536?1:2}class Je{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=jr(this,e,t);let o=[];return this.decompose(0,e,o,2),i.length&&i.decompose(0,i.length,o,3),this.decompose(t,this.length,o,1),_i.from(o,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=jr(this,e,t);let i=[];return this.decompose(e,t,i,0),_i.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),o=new cc(this),a=new cc(e);for(let r=t,c=t;;){if(o.next(r),a.next(r),r=0,o.lineBreak!=a.lineBreak||o.done!=a.done||o.value!=a.value)return!1;if(c+=o.value.length,o.done||c>=i)return!0}}iter(e=1){return new cc(this,e)}iterRange(e,t=this.length){return new UP(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let o=this.line(e).from;i=this.iterRange(o,Math.max(o,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new zP(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Je.empty:e.length<=32?new jt(e):_i.from(jt.split(e,[]))}}class jt extends Je{constructor(e,t=H_(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,o){for(let a=0;;a++){let r=this.text[a],c=o+r.length;if((t?i:c)>=e)return new U_(o,c,i,r);o=c+1,i++}}decompose(e,t,i,o){let a=e<=0&&t>=this.length?this:new jt(hw(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(o&1){let r=i.pop(),c=th(a.text,r.text.slice(),0,a.length);if(c.length<=32)i.push(new jt(c,r.length+a.length));else{let d=c.length>>1;i.push(new jt(c.slice(0,d)),new jt(c.slice(d)))}}else i.push(a)}replace(e,t,i){if(!(i instanceof jt))return super.replace(e,t,i);[e,t]=jr(this,e,t);let o=th(this.text,th(i.text,hw(this.text,0,e)),t),a=this.length+i.length-(t-e);return o.length<=32?new jt(o,a):_i.from(jt.split(o,[]),a)}sliceString(e,t=this.length,i=`
18
+ `){[e,t]=jr(this,e,t);let o="";for(let a=0,r=0;a<=t&&r<this.text.length;r++){let c=this.text[r],d=a+c.length;a>e&&r&&(o+=i),e<d&&t>a&&(o+=c.slice(Math.max(0,e-a),t-a)),a=d+1}return o}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],o=-1;for(let a of e)i.push(a),o+=a.length+1,i.length==32&&(t.push(new jt(i,o)),i=[],o=-1);return o>-1&&t.push(new jt(i,o)),t}}class _i extends Je{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,o){for(let a=0;;a++){let r=this.children[a],c=o+r.length,d=i+r.lines-1;if((t?d:c)>=e)return r.lineInner(e,t,i,o);o=c+1,i=d+1}}decompose(e,t,i,o){for(let a=0,r=0;r<=t&&a<this.children.length;a++){let c=this.children[a],d=r+c.length;if(e<=d&&t>=r){let f=o&((r<=e?1:0)|(d>=t?2:0));r>=e&&d<=t&&!f?i.push(c):c.decompose(e-r,t-r,i,f)}r=d+1}}replace(e,t,i){if([e,t]=jr(this,e,t),i.lines<this.lines)for(let o=0,a=0;o<this.children.length;o++){let r=this.children[o],c=a+r.length;if(e>=a&&t<=c){let d=r.replace(e-a,t-a,i),f=this.lines-r.lines+d.lines;if(d.lines<f>>4&&d.lines>f>>6){let m=this.children.slice();return m[o]=d,new _i(m,this.length-(t-e)+i.length)}return super.replace(a,c,d)}a=c+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
19
+ `){[e,t]=jr(this,e,t);let o="";for(let a=0,r=0;a<this.children.length&&r<=t;a++){let c=this.children[a],d=r+c.length;r>e&&a&&(o+=i),e<d&&t>r&&(o+=c.sliceString(e-r,t-r,i)),r=d+1}return o}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof _i))return 0;let i=0,[o,a,r,c]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;o+=t,a+=t){if(o==r||a==c)return i;let d=this.children[o],f=e.children[a];if(d!=f)return i+d.scanIdentical(f,t);i+=d.length+1}}static from(e,t=e.reduce((i,o)=>i+o.length+1,-1)){let i=0;for(let v of e)i+=v.lines;if(i<32){let v=[];for(let C of e)C.flatten(v);return new jt(v,t)}let o=Math.max(32,i>>5),a=o<<1,r=o>>1,c=[],d=0,f=-1,m=[];function g(v){let C;if(v.lines>a&&v instanceof _i)for(let k of v.children)g(k);else v.lines>r&&(d>r||!d)?(x(),c.push(v)):v instanceof jt&&d&&(C=m[m.length-1])instanceof jt&&v.lines+C.lines<=32?(d+=v.lines,f+=v.length+1,m[m.length-1]=new jt(C.text.concat(v.text),C.length+1+v.length)):(d+v.lines>o&&x(),d+=v.lines,f+=v.length+1,m.push(v))}function x(){d!=0&&(c.push(m.length==1?m[0]:_i.from(m,f)),f=-1,d=m.length=0)}for(let v of e)g(v);return x(),c.length==1?c[0]:new _i(c,t)}}Je.empty=new jt([""],0);function H_(n){let e=-1;for(let t of n)e+=t.length+1;return e}function th(n,e,t=0,i=1e9){for(let o=0,a=0,r=!0;a<n.length&&o<=i;a++){let c=n[a],d=o+c.length;d>=t&&(d>i&&(c=c.slice(0,i-o)),o<t&&(c=c.slice(t-o)),r?(e[e.length-1]+=c,r=!1):e.push(c)),o=d+1}return e}function hw(n,e,t){return th(n,[""],e,t)}class cc{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof jt?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,o=this.nodes[i],a=this.offsets[i],r=a>>1,c=o instanceof jt?o.text.length:o.children.length;if(r==(t>0?c:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((a&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
20
+ `,this;e--}else if(o instanceof jt){let d=o.text[r+(t<0?-1:0)];if(this.offsets[i]+=t,d.length>Math.max(0,e))return this.value=e==0?d:t>0?d.slice(e):d.slice(0,d.length-e),this;e-=d.length}else{let d=o.children[r+(t<0?-1:0)];e>d.length?(e-=d.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(d),this.offsets.push(t>0?1:(d instanceof jt?d.text.length:d.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class UP{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new cc(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:o}=this.cursor.next(e);return this.pos+=(o.length+e)*t,this.value=o.length<=i?o:t<0?o.slice(o.length-i):o.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class zP{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:o}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=o,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Je.prototype[Symbol.iterator]=function(){return this.iter()},cc.prototype[Symbol.iterator]=UP.prototype[Symbol.iterator]=zP.prototype[Symbol.iterator]=function(){return this});class U_{constructor(e,t,i,o){this.from=e,this.to=t,this.number=i,this.text=o}get length(){return this.to-this.from}}function jr(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function $t(n,e,t=!0,i=!0){return B_(n,e,t,i)}function z_(n){return n>=56320&&n<57344}function F_(n){return n>=55296&&n<56320}function Mn(n,e){let t=n.charCodeAt(e);if(!F_(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return z_(i)?(t-55296<<10)+(i-56320)+65536:t}function ix(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Hi(n){return n<65536?1:2}const yy=/\r\n?|\n/;var xn=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(xn||(xn={}));class Wi{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,o=0;t<this.sections.length;){let a=this.sections[t++],r=this.sections[t++];r<0?(e(i,o,a),o+=a):o+=r,i+=a}}iterChangedRanges(e,t=!1){by(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],o=this.sections[t++];o<0?e.push(i,o):e.push(o,i)}return new Wi(e)}composeDesc(e){return this.empty?e:e.empty?this:FP(this,e)}mapDesc(e,t=!1){return e.empty?this:xy(this,e,t)}mapPos(e,t=-1,i=xn.Simple){let o=0,a=0;for(let r=0;r<this.sections.length;){let c=this.sections[r++],d=this.sections[r++],f=o+c;if(d<0){if(f>e)return a+(e-o);a+=c}else{if(i!=xn.Simple&&f>=e&&(i==xn.TrackDel&&o<e&&f>e||i==xn.TrackBefore&&o<e||i==xn.TrackAfter&&f>e))return null;if(f>e||f==e&&t<0&&!c)return e==o||t<0?a:a+d;a+=d}o=f}if(e>o)throw new RangeError(`Position ${e} is out of range for changeset of length ${o}`);return a}touchesRange(e,t=e){for(let i=0,o=0;i<this.sections.length&&o<=t;){let a=this.sections[i++],r=this.sections[i++],c=o+a;if(r>=0&&o<=t&&c>=e)return o<e&&c>t?"cover":!0;o=c}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],o=this.sections[t++];e+=(e?" ":"")+i+(o>=0?":"+o:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Wi(e)}static create(e){return new Wi(e)}}class qt extends Wi{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return by(this,(t,i,o,a,r)=>e=e.replace(o,o+(i-t),r),!1),e}mapDesc(e,t=!1){return xy(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let o=0,a=0;o<t.length;o+=2){let r=t[o],c=t[o+1];if(c>=0){t[o]=c,t[o+1]=r;let d=o>>1;for(;i.length<d;)i.push(Je.empty);i.push(r?e.slice(a,a+r):Je.empty)}a+=r}return new qt(t,i)}compose(e){return this.empty?e:e.empty?this:FP(this,e,!0)}map(e,t=!1){return e.empty?this:xy(this,e,t,!0)}iterChanges(e,t=!1){by(this,e,t)}get desc(){return Wi.create(this.sections)}filter(e){let t=[],i=[],o=[],a=new Ac(this);e:for(let r=0,c=0;;){let d=r==e.length?1e9:e[r++];for(;c<d||c==d&&a.len==0;){if(a.done)break e;let m=Math.min(a.len,d-c);un(o,m,-1);let g=a.ins==-1?-1:a.off==0?a.ins:0;un(t,m,g),g>0&&ps(i,t,a.text),a.forward(m),c+=m}let f=e[r++];for(;c<f;){if(a.done)break e;let m=Math.min(a.len,f-c);un(t,m,-1),un(o,m,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(m),c+=m}}return{changes:new qt(t,i),filtered:Wi.create(o)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],o=this.sections[t+1];o<0?e.push(i):o==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let o=[],a=[],r=0,c=null;function d(m=!1){if(!m&&!o.length)return;r<t&&un(o,t-r,-1);let g=new qt(o,a);c=c?c.compose(g.map(c)):g,o=[],a=[],r=0}function f(m){if(Array.isArray(m))for(let g of m)f(g);else if(m instanceof qt){if(m.length!=t)throw new RangeError(`Mismatched change set length (got ${m.length}, expected ${t})`);d(),c=c?c.compose(m.map(c)):m}else{let{from:g,to:x=g,insert:v}=m;if(g>x||g<0||x>t)throw new RangeError(`Invalid change range ${g} to ${x} (in doc of length ${t})`);let C=v?typeof v=="string"?Je.of(v.split(i||yy)):v:Je.empty,k=C.length;if(g==x&&k==0)return;g<r&&d(),g>r&&un(o,g-r,-1),un(o,x-g,k),ps(a,o,C),r=x}}return f(e),d(!c),c}static empty(e){return new qt(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let o=0;o<e.length;o++){let a=e[o];if(typeof a=="number")t.push(a,-1);else{if(!Array.isArray(a)||typeof a[0]!="number"||a.some((r,c)=>c&&typeof r!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(a.length==1)t.push(a[0],0);else{for(;i.length<o;)i.push(Je.empty);i[o]=Je.of(a.slice(1)),t.push(a[0],i[o].length)}}}return new qt(t,i)}static createSet(e,t){return new qt(e,t)}}function un(n,e,t,i=!1){if(e==0&&t<=0)return;let o=n.length-2;o>=0&&t<=0&&t==n[o+1]?n[o]+=e:o>=0&&e==0&&n[o]==0?n[o+1]+=t:i?(n[o]+=e,n[o+1]+=t):n.push(e,t)}function ps(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(Je.empty);n.push(t)}}function by(n,e,t){let i=n.inserted;for(let o=0,a=0,r=0;r<n.sections.length;){let c=n.sections[r++],d=n.sections[r++];if(d<0)o+=c,a+=c;else{let f=o,m=a,g=Je.empty;for(;f+=c,m+=d,d&&i&&(g=g.append(i[r-2>>1])),!(t||r==n.sections.length||n.sections[r+1]<0);)c=n.sections[r++],d=n.sections[r++];e(o,f,a,m,g),o=f,a=m}}}function xy(n,e,t,i=!1){let o=[],a=i?[]:null,r=new Ac(n),c=new Ac(e);for(let d=-1;;){if(r.done&&c.len||c.done&&r.len)throw new Error("Mismatched change set lengths");if(r.ins==-1&&c.ins==-1){let f=Math.min(r.len,c.len);un(o,f,-1),r.forward(f),c.forward(f)}else if(c.ins>=0&&(r.ins<0||d==r.i||r.off==0&&(c.len<r.len||c.len==r.len&&!t))){let f=c.len;for(un(o,c.ins,-1);f;){let m=Math.min(r.len,f);r.ins>=0&&d<r.i&&r.len<=m&&(un(o,0,r.ins),a&&ps(a,o,r.text),d=r.i),r.forward(m),f-=m}c.next()}else if(r.ins>=0){let f=0,m=r.len;for(;m;)if(c.ins==-1){let g=Math.min(m,c.len);f+=g,m-=g,c.forward(g)}else if(c.ins==0&&c.len<m)m-=c.len,c.next();else break;un(o,f,d<r.i?r.ins:0),a&&d<r.i&&ps(a,o,r.text),d=r.i,r.forward(r.len-m)}else{if(r.done&&c.done)return a?qt.createSet(o,a):Wi.create(o);throw new Error("Mismatched change set lengths")}}}function FP(n,e,t=!1){let i=[],o=t?[]:null,a=new Ac(n),r=new Ac(e);for(let c=!1;;){if(a.done&&r.done)return o?qt.createSet(i,o):Wi.create(i);if(a.ins==0)un(i,a.len,0,c),a.next();else if(r.len==0&&!r.done)un(i,0,r.ins,c),o&&ps(o,i,r.text),r.next();else{if(a.done||r.done)throw new Error("Mismatched change set lengths");{let d=Math.min(a.len2,r.len),f=i.length;if(a.ins==-1){let m=r.ins==-1?-1:r.off?0:r.ins;un(i,d,m,c),o&&m&&ps(o,i,r.text)}else r.ins==-1?(un(i,a.off?0:a.len,d,c),o&&ps(o,i,a.textBit(d))):(un(i,a.off?0:a.len,r.off?0:r.ins,c),o&&!r.off&&ps(o,i,r.text));c=(a.ins>d||r.ins>=0&&r.len>d)&&(c||i.length>f),a.forward2(d),r.forward(d)}}}}class Ac{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Je.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?Je.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class na{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,o;return this.empty?i=o=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),o=e.mapPos(this.to,-1)),i==this.from&&o==this.to?this:new na(i,o,this.flags)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return J.range(e,t,void 0,void 0,i);let o=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return J.range(this.anchor,o,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return J.range(e.anchor,e.head)}static create(e,t,i){return new na(e,t,i)}}class J{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:J.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new J([this.main],0)}addRange(e,t=!0){return J.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,J.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new J(e.ranges.map(t=>na.fromJSON(t)),e.main)}static single(e,t=e){return new J([J.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,o=0;o<e.length;o++){let a=e[o];if(a.empty?a.from<=i:a.from<i)return J.normalized(e.slice(),t);i=a.to}return new J(e,t)}static cursor(e,t=0,i,o){return na.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(o??16777215)<<6)}static range(e,t,i,o,a){let r=(i??16777215)<<6|(o==null?7:Math.min(6,o));return!a&&e!=t&&(a=t<e?1:-1),t<e?na.create(t,e,48|r):na.create(e,t,(a?a<0?8:16:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((o,a)=>o.from-a.from),t=e.indexOf(i);for(let o=1;o<e.length;o++){let a=e[o],r=e[o-1];if(a.empty?a.from<=r.to:a.from<r.to){let c=r.from,d=Math.max(a.to,r.to);o<=t&&t--,e.splice(--o,2,a.anchor>a.head?J.range(d,c):J.range(c,d))}}return new J(e,t)}}function qP(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let ox=0;class pe{constructor(e,t,i,o,a){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=o,this.id=ox++,this.default=e([]),this.extensions=typeof a=="function"?a(this):a}get reader(){return this}static define(e={}){return new pe(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:sx),!!e.static,e.enables)}of(e){return new nh([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new nh(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new nh(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function sx(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class nh{constructor(e,t,i,o){this.dependencies=e,this.facet=t,this.type=i,this.value=o,this.id=ox++}dynamicSlot(e){var t;let i=this.value,o=this.facet.compareInput,a=this.id,r=e[a]>>1,c=this.type==2,d=!1,f=!1,m=[];for(let g of this.dependencies)g=="doc"?d=!0:g=="selection"?f=!0:(((t=e[g.id])!==null&&t!==void 0?t:1)&1)==0&&m.push(e[g.id]);return{create(g){return g.values[r]=i(g),1},update(g,x){if(d&&x.docChanged||f&&(x.docChanged||x.selection)||vy(g,m)){let v=i(g);if(c?!fw(v,g.values[r],o):!o(v,g.values[r]))return g.values[r]=v,1}return 0},reconfigure:(g,x)=>{let v,C=x.config.address[a];if(C!=null){let k=vh(x,C);if(this.dependencies.every(w=>w instanceof pe?x.facet(w)===g.facet(w):w instanceof hn?x.field(w,!1)==g.field(w,!1):!0)||(c?fw(v=i(g),k,o):o(v=i(g),k)))return g.values[r]=k,0}else v=i(g);return g.values[r]=v,1}}}}function fw(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function vy(n,e){let t=!1;for(let i of e)uc(n,i)&1&&(t=!0);return t}function q_(n,e,t){let i=t.map(d=>n[d.id]),o=t.map(d=>d.type),a=i.filter(d=>!(d&1)),r=n[e.id]>>1;function c(d){let f=[];for(let m=0;m<i.length;m++){let g=vh(d,i[m]);if(o[m]==2)for(let x of g)f.push(x);else f.push(g)}return e.combine(f)}return{create(d){for(let f of i)uc(d,f);return d.values[r]=c(d),1},update(d,f){if(!vy(d,a))return 0;let m=c(d);return e.compare(m,d.values[r])?0:(d.values[r]=m,1)},reconfigure(d,f){let m=vy(d,i),g=f.config.facets[e.id],x=f.facet(e);if(g&&!m&&sx(t,g))return d.values[r]=x,0;let v=c(d);return e.compare(v,x)?(d.values[r]=x,0):(d.values[r]=v,1)}}}const Pd=pe.define({static:!0});class hn{constructor(e,t,i,o,a){this.id=e,this.createF=t,this.updateF=i,this.compareF=o,this.spec=a,this.provides=void 0}static define(e){let t=new hn(ox++,e.create,e.update,e.compare||((i,o)=>i===o),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Pd).find(i=>i.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,o)=>{let a=i.values[t],r=this.updateF(a,o);return this.compareF(a,r)?0:(i.values[t]=r,1)},reconfigure:(i,o)=>{let a=i.facet(Pd),r=o.facet(Pd),c;return(c=a.find(d=>d.field==this))&&c!=r.find(d=>d.field==this)?(i.values[t]=c.create(i),1):o.config.address[this.id]!=null?(i.values[t]=o.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,Pd.of({field:this,create:e})]}get extension(){return this}}const Zs={lowest:4,low:3,default:2,high:1,highest:0};function Gl(n){return e=>new GP(e,n)}const Sa={highest:Gl(Zs.highest),high:Gl(Zs.high),default:Gl(Zs.default),low:Gl(Zs.low),lowest:Gl(Zs.lowest)};class GP{constructor(e,t){this.inner=e,this.prec=t}}class uf{of(e){return new Cy(this,e)}reconfigure(e){return uf.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Cy{constructor(e,t){this.compartment=e,this.inner=t}}class xh{constructor(e,t,i,o,a,r){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=o,this.staticValues=a,this.facets=r,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let o=[],a=Object.create(null),r=new Map;for(let x of G_(e,t,r))x instanceof hn?o.push(x):(a[x.facet.id]||(a[x.facet.id]=[])).push(x);let c=Object.create(null),d=[],f=[];for(let x of o)c[x.id]=f.length<<1,f.push(v=>x.slot(v));let m=i?.config.facets;for(let x in a){let v=a[x],C=v[0].facet,k=m&&m[x]||[];if(v.every(w=>w.type==0))if(c[C.id]=d.length<<1|1,sx(k,v))d.push(i.facet(C));else{let w=C.combine(v.map(P=>P.value));d.push(i&&C.compare(w,i.facet(C))?i.facet(C):w)}else{for(let w of v)w.type==0?(c[w.id]=d.length<<1|1,d.push(w.value)):(c[w.id]=f.length<<1,f.push(P=>w.dynamicSlot(P)));c[C.id]=f.length<<1,f.push(w=>q_(w,C,v))}}let g=f.map(x=>x(c));return new xh(e,r,g,c,d,a)}}function G_(n,e,t){let i=[[],[],[],[],[]],o=new Map;function a(r,c){let d=o.get(r);if(d!=null){if(d<=c)return;let f=i[d].indexOf(r);f>-1&&i[d].splice(f,1),r instanceof Cy&&t.delete(r.compartment)}if(o.set(r,c),Array.isArray(r))for(let f of r)a(f,c);else if(r instanceof Cy){if(t.has(r.compartment))throw new RangeError("Duplicate use of compartment in extensions");let f=e.get(r.compartment)||r.inner;t.set(r.compartment,f),a(f,c)}else if(r instanceof GP)a(r.inner,r.prec);else if(r instanceof hn)i[c].push(r),r.provides&&a(r.provides,c);else if(r instanceof nh)i[c].push(r),r.facet.extensions&&a(r.facet.extensions,Zs.default);else{let f=r.extension;if(!f)throw new Error(`Unrecognized extension value in extension set (${r}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(f,c)}}return a(n,Zs.default),i.reduce((r,c)=>r.concat(c))}function uc(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let o=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|o}function vh(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const KP=pe.define(),Sy=pe.define({combine:n=>n.some(e=>e),static:!0}),VP=pe.define({combine:n=>n.length?n[0]:void 0,static:!0}),WP=pe.define(),QP=pe.define(),YP=pe.define(),$P=pe.define({combine:n=>n.length?n[0]:!1});class $i{constructor(e,t){this.type=e,this.value=t}static define(){return new K_}}class K_{of(e){return new $i(this,e)}}class V_{constructor(e){this.map=e}of(e){return new Le(this,e)}}class Le{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Le(this.type,t)}is(e){return this.type==e}static define(e={}){return new V_(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let o of e){let a=o.map(t);a&&i.push(a)}return i}}Le.reconfigure=Le.define();Le.appendConfig=Le.define();class Gt{constructor(e,t,i,o,a,r){this.startState=e,this.changes=t,this.selection=i,this.effects=o,this.annotations=a,this.scrollIntoView=r,this._doc=null,this._state=null,i&&qP(i,t.newLength),a.some(c=>c.type==Gt.time)||(this.annotations=a.concat(Gt.time.of(Date.now())))}static create(e,t,i,o,a,r){return new Gt(e,t,i,o,a,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Gt.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Gt.time=$i.define();Gt.userEvent=$i.define();Gt.addToHistory=$i.define();Gt.remote=$i.define();function W_(n,e){let t=[];for(let i=0,o=0;;){let a,r;if(i<n.length&&(o==e.length||e[o]>=n[i]))a=n[i++],r=n[i++];else if(o<e.length)a=e[o++],r=e[o++];else return t;!t.length||t[t.length-1]<a?t.push(a,r):t[t.length-1]<r&&(t[t.length-1]=r)}}function XP(n,e,t){var i;let o,a,r;return t?(o=e.changes,a=qt.empty(e.changes.length),r=n.changes.compose(e.changes)):(o=e.changes.map(n.changes),a=n.changes.mapDesc(e.changes,!0),r=n.changes.compose(o)),{changes:r,selection:e.selection?e.selection.map(a):(i=n.selection)===null||i===void 0?void 0:i.map(o),effects:Le.mapEffects(n.effects,o).concat(Le.mapEffects(e.effects,a)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function ky(n,e,t){let i=e.selection,o=Ar(e.annotations);return e.userEvent&&(o=o.concat(Gt.userEvent.of(e.userEvent))),{changes:e.changes instanceof qt?e.changes:qt.of(e.changes||[],t,n.facet(VP)),selection:i&&(i instanceof J?i:J.single(i.anchor,i.head)),effects:Ar(e.effects),annotations:o,scrollIntoView:!!e.scrollIntoView}}function JP(n,e,t){let i=ky(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let a=1;a<e.length;a++){e[a].filter===!1&&(t=!1);let r=!!e[a].sequential;i=XP(i,ky(n,e[a],r?i.changes.newLength:n.doc.length),r)}let o=Gt.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return Y_(t?Q_(o):o)}function Q_(n){let e=n.startState,t=!0;for(let o of e.facet(WP)){let a=o(n);if(a===!1){t=!1;break}Array.isArray(a)&&(t=t===!0?a:W_(t,a))}if(t!==!0){let o,a;if(t===!1)a=n.changes.invertedDesc,o=qt.empty(e.doc.length);else{let r=n.changes.filter(t);o=r.changes,a=r.filtered.mapDesc(r.changes).invertedDesc}n=Gt.create(e,o,n.selection&&n.selection.map(a),Le.mapEffects(n.effects,a),n.annotations,n.scrollIntoView)}let i=e.facet(QP);for(let o=i.length-1;o>=0;o--){let a=i[o](n);a instanceof Gt?n=a:Array.isArray(a)&&a.length==1&&a[0]instanceof Gt?n=a[0]:n=JP(e,Ar(a),!1)}return n}function Y_(n){let e=n.startState,t=e.facet(YP),i=n;for(let o=t.length-1;o>=0;o--){let a=t[o](n);a&&Object.keys(a).length&&(i=XP(i,ky(e,a,n.changes.newLength),!0))}return i==n?n:Gt.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const $_=[];function Ar(n){return n==null?$_:Array.isArray(n)?n:[n]}var kt=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(kt||(kt={}));const X_=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let wy;try{wy=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function J_(n){if(wy)return wy.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||X_.test(t)))return!0}return!1}function Z_(n){return e=>{if(!/\S/.test(e))return kt.Space;if(J_(e))return kt.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return kt.Word;return kt.Other}}class Qe{constructor(e,t,i,o,a,r){this.config=e,this.doc=t,this.selection=i,this.values=o,this.status=e.statusTemplate.slice(),this.computeSlot=a,r&&(r._state=this);for(let c=0;c<this.config.dynamicSlots.length;c++)uc(this,c<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return uc(this,i),vh(this,i)}update(...e){return JP(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:o}=t;for(let c of e.effects)c.is(uf.reconfigure)?(t&&(o=new Map,t.compartments.forEach((d,f)=>o.set(f,d)),t=null),o.set(c.value.compartment,c.value.extension)):c.is(Le.reconfigure)?(t=null,i=c.value):c.is(Le.appendConfig)&&(t=null,i=Ar(i).concat(c.value));let a;t?a=e.startState.values.slice():(t=xh.resolve(i,o,this),a=new Qe(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(d,f)=>f.reconfigure(d,this),null).values);let r=e.startState.facet(Sy)?e.newSelection:e.newSelection.asSingle();new Qe(t,e.newDoc,r,a,(c,d)=>d.update(c,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:J.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),o=this.changes(i.changes),a=[i.range],r=Ar(i.effects);for(let c=1;c<t.ranges.length;c++){let d=e(t.ranges[c]),f=this.changes(d.changes),m=f.map(o);for(let x=0;x<c;x++)a[x]=a[x].map(m);let g=o.mapDesc(f,!0);a.push(d.range.map(g)),o=o.compose(m),r=Le.mapEffects(r,m).concat(Le.mapEffects(Ar(d.effects),g))}return{changes:o,selection:J.create(a,t.mainIndex),effects:r}}changes(e=[]){return e instanceof qt?e:qt.of(e,this.doc.length,this.facet(Qe.lineSeparator))}toText(e){return Je.of(e.split(this.facet(Qe.lineSeparator)||yy))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(uc(this,t),vh(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let o=e[i];o instanceof hn&&this.config.address[o.id]!=null&&(t[i]=o.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let o=[];if(i){for(let a in i)if(Object.prototype.hasOwnProperty.call(e,a)){let r=i[a],c=e[a];o.push(r.init(d=>r.spec.fromJSON(c,d)))}}return Qe.create({doc:e.doc,selection:J.fromJSON(e.selection),extensions:t.extensions?o.concat([t.extensions]):o})}static create(e={}){let t=xh.resolve(e.extensions||[],new Map),i=e.doc instanceof Je?e.doc:Je.of((e.doc||"").split(t.staticFacet(Qe.lineSeparator)||yy)),o=e.selection?e.selection instanceof J?e.selection:J.single(e.selection.anchor,e.selection.head):J.single(0);return qP(o,i.length),t.staticFacet(Sy)||(o=o.asSingle()),new Qe(t,i,o,t.dynamicSlots.map(()=>null),(a,r)=>r.create(a),null)}get tabSize(){return this.facet(Qe.tabSize)}get lineBreak(){return this.facet(Qe.lineSeparator)||`
21
+ `}get readOnly(){return this.facet($P)}phrase(e,...t){for(let i of this.facet(Qe.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,o)=>{if(o=="$")return"$";let a=+(o||1);return!a||a>t.length?i:t[a-1]})),e}languageDataAt(e,t,i=-1){let o=[];for(let a of this.facet(KP))for(let r of a(this,t,i))Object.prototype.hasOwnProperty.call(r,e)&&o.push(r[e]);return o}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return Z_(t.length?t[0]:"")}wordAt(e){let{text:t,from:i,length:o}=this.doc.lineAt(e),a=this.charCategorizer(e),r=e-i,c=e-i;for(;r>0;){let d=$t(t,r,!1);if(a(t.slice(d,r))!=kt.Word)break;r=d}for(;c<o;){let d=$t(t,c);if(a(t.slice(c,d))!=kt.Word)break;c=d}return r==c?null:J.range(r+i,c+i)}}Qe.allowMultipleSelections=Sy;Qe.tabSize=pe.define({combine:n=>n.length?n[0]:4});Qe.lineSeparator=VP;Qe.readOnly=$P;Qe.phrases=pe.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(o=>n[o]==e[o])}});Qe.languageData=KP;Qe.changeFilter=WP;Qe.transactionFilter=QP;Qe.transactionExtender=YP;uf.reconfigure=Le.define();function Xi(n,e,t={}){let i={};for(let o of n)for(let a of Object.keys(o)){let r=o[a],c=i[a];if(c===void 0)i[a]=r;else if(!(c===r||r===void 0))if(Object.hasOwnProperty.call(t,a))i[a]=t[a](c,r);else throw new Error("Config merge conflict for field "+a)}for(let o in e)i[o]===void 0&&(i[o]=e[o]);return i}class ys{eq(e){return this==e}range(e,t=e){return Ay.create(e,t,this)}}ys.prototype.startSide=ys.prototype.endSide=0;ys.prototype.point=!1;ys.prototype.mapMode=xn.TrackDel;function ax(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let Ay=class ZP{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new ZP(e,t,i)}};function Oy(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class rx{constructor(e,t,i,o){this.from=e,this.to=t,this.value=i,this.maxPoint=o}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,o=0){let a=i?this.to:this.from;for(let r=o,c=a.length;;){if(r==c)return r;let d=r+c>>1,f=a[d]-e||(i?this.value[d].endSide:this.value[d].startSide)-t;if(d==r)return f>=0?r:c;f>=0?c=d:r=d+1}}between(e,t,i,o){for(let a=this.findIndex(t,-1e9,!0),r=this.findIndex(i,1e9,!1,a);a<r;a++)if(o(this.from[a]+e,this.to[a]+e,this.value[a])===!1)return!1}map(e,t){let i=[],o=[],a=[],r=-1,c=-1;for(let d=0;d<this.value.length;d++){let f=this.value[d],m=this.from[d]+e,g=this.to[d]+e,x,v;if(m==g){let C=t.mapPos(m,f.startSide,f.mapMode);if(C==null||(x=v=C,f.startSide!=f.endSide&&(v=t.mapPos(m,f.endSide),v<x)))continue}else if(x=t.mapPos(m,f.startSide),v=t.mapPos(g,f.endSide),x>v||x==v&&f.startSide>0&&f.endSide<=0)continue;(v-x||f.endSide-f.startSide)<0||(r<0&&(r=x),f.point&&(c=Math.max(c,v-x)),i.push(f),o.push(x-r),a.push(v-r))}return{mapped:i.length?new rx(o,a,i,c):null,pos:r}}}class qe{constructor(e,t,i,o){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=o}static create(e,t,i,o){return new qe(e,t,i,o)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:o=0,filterTo:a=this.length}=e,r=e.filter;if(t.length==0&&!r)return this;if(i&&(t=t.slice().sort(Oy)),this.isEmpty)return t.length?qe.of(t):this;let c=new eT(this,null,-1).goto(0),d=0,f=[],m=new Yi;for(;c.value||d<t.length;)if(d<t.length&&(c.from-t[d].from||c.startSide-t[d].value.startSide)>=0){let g=t[d++];m.addInner(g.from,g.to,g.value)||f.push(g)}else c.rangeIndex==1&&c.chunkIndex<this.chunk.length&&(d==t.length||this.chunkEnd(c.chunkIndex)<t[d].from)&&(!r||o>this.chunkEnd(c.chunkIndex)||a<this.chunkPos[c.chunkIndex])&&m.addChunk(this.chunkPos[c.chunkIndex],this.chunk[c.chunkIndex])?c.nextChunk():((!r||o>c.to||a<c.from||r(c.from,c.to,c.value))&&(m.addInner(c.from,c.to,c.value)||f.push(Ay.create(c.from,c.to,c.value))),c.next());return m.finishInner(this.nextLayer.isEmpty&&!f.length?qe.empty:this.nextLayer.update({add:f,filter:r,filterFrom:o,filterTo:a}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],o=-1;for(let r=0;r<this.chunk.length;r++){let c=this.chunkPos[r],d=this.chunk[r],f=e.touchesRange(c,c+d.length);if(f===!1)o=Math.max(o,d.maxPoint),t.push(d),i.push(e.mapPos(c));else if(f===!0){let{mapped:m,pos:g}=d.map(c,e);m&&(o=Math.max(o,m.maxPoint),t.push(m),i.push(g))}}let a=this.nextLayer.map(e);return t.length==0?a:new qe(i,t,a||qe.empty,o)}between(e,t,i){if(!this.isEmpty){for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],r=this.chunk[o];if(t>=a&&e<=a+r.length&&r.between(a,e-a,t-a,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Oc.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Oc.from(e).goto(t)}static compare(e,t,i,o,a=-1){let r=e.filter(g=>g.maxPoint>0||!g.isEmpty&&g.maxPoint>=a),c=t.filter(g=>g.maxPoint>0||!g.isEmpty&&g.maxPoint>=a),d=pw(r,c,i),f=new Kl(r,d,a),m=new Kl(c,d,a);i.iterGaps((g,x,v)=>mw(f,g,m,x,v,o)),i.empty&&i.length==0&&mw(f,0,m,0,0,o)}static eq(e,t,i=0,o){o==null&&(o=999999999);let a=e.filter(m=>!m.isEmpty&&t.indexOf(m)<0),r=t.filter(m=>!m.isEmpty&&e.indexOf(m)<0);if(a.length!=r.length)return!1;if(!a.length)return!0;let c=pw(a,r),d=new Kl(a,c,0).goto(i),f=new Kl(r,c,0).goto(i);for(;;){if(d.to!=f.to||!Py(d.active,f.active)||d.point&&(!f.point||!ax(d.point,f.point)))return!1;if(d.to>o)return!0;d.next(),f.next()}}static spans(e,t,i,o,a=-1){let r=new Kl(e,null,a).goto(t),c=t,d=r.openStart;for(;;){let f=Math.min(r.to,i);if(r.point){let m=r.activeForPoint(r.to),g=r.pointFrom<t?m.length+1:r.point.startSide<0?m.length:Math.min(m.length,d);o.point(c,f,r.point,m,g,r.pointRank),d=Math.min(r.openEnd(f),m.length)}else f>c&&(o.span(c,f,r.active,d),d=r.openEnd(f));if(r.to>i)return d+(r.point&&r.to>i?1:0);c=r.to,r.next()}}static of(e,t=!1){let i=new Yi;for(let o of e instanceof Ay?[e]:t?eH(e):e)i.add(o.from,o.to,o.value);return i.finish()}static join(e){if(!e.length)return qe.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let o=e[i];o!=qe.empty;o=o.nextLayer)t=new qe(o.chunkPos,o.chunk,t,Math.max(o.maxPoint,t.maxPoint));return t}}qe.empty=new qe([],[],null,-1);function eH(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let i=n[t];if(Oy(e,i)>0)return n.slice().sort(Oy);e=i}return n}qe.empty.nextLayer=qe.empty;class Yi{finishChunk(e){this.chunks.push(new rx(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new Yi)).add(e,t,i)}addInner(e,t,i){let o=e-this.lastTo||i.startSide-this.last.endSide;if(o<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return o<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(qe.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=qe.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function pw(n,e,t){let i=new Map;for(let a of n)for(let r=0;r<a.chunk.length;r++)a.chunk[r].maxPoint<=0&&i.set(a.chunk[r],a.chunkPos[r]);let o=new Set;for(let a of e)for(let r=0;r<a.chunk.length;r++){let c=i.get(a.chunk[r]);c!=null&&(t?t.mapPos(c):c)==a.chunkPos[r]&&!t?.touchesRange(c,c+a.chunk[r].length)&&o.add(a.chunk[r])}return o}class eT{constructor(e,t,i,o=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=o}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let o=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(o)||this.layer.chunkEnd(this.chunkIndex)<e||o.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let o=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<o)&&this.setRangeIndex(o)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Oc{constructor(e){this.heap=e}static from(e,t=null,i=-1){let o=[];for(let a=0;a<e.length;a++)for(let r=e[a];!r.isEmpty;r=r.nextLayer)r.maxPoint>=i&&o.push(new eT(r,t,i,a));return o.length==1?o[0]:new Oc(o)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)yg(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)yg(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),yg(this.heap,0)}}}function yg(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let o=n[i];if(i+1<n.length&&o.compare(n[i+1])>=0&&(o=n[i+1],i++),t.compare(o)<0)break;n[i]=t,n[e]=o,e=i}}class Kl{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Oc.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Td(this.active,e),Td(this.activeTo,e),Td(this.activeRank,e),this.minActive=gw(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:o,rank:a}=this.cursor;for(;t<this.activeRank.length&&(a-this.activeRank[t]||o-this.activeTo[t])>0;)t++;Dd(this.active,t,i),Dd(this.activeTo,t,o),Dd(this.activeRank,t,a),e&&Dd(e,t,this.cursor.from),this.minActive=gw(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let o=this.minActive;if(o>-1&&(this.activeTo[o]-this.cursor.from||this.active[o].endSide-this.cursor.startSide)<0){if(this.activeTo[o]>e){this.to=this.activeTo[o],this.endSide=this.active[o].endSide;break}this.removeActive(o),i&&Td(i,o)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let a=this.cursor.value;if(!a.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=a,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=a.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let o=i.length-1;o>=0&&i[o]<e;o--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function mw(n,e,t,i,o,a){n.goto(e),t.goto(i);let r=i+o,c=i,d=i-e,f=!!a.boundChange;for(let m=!1;;){let g=n.to+d-t.to,x=g||n.endSide-t.endSide,v=x<0?n.to+d:t.to,C=Math.min(v,r);if(n.point||t.point?(n.point&&t.point&&ax(n.point,t.point)&&Py(n.activeForPoint(n.to),t.activeForPoint(t.to))||a.comparePoint(c,C,n.point,t.point),m=!1):(m&&a.boundChange(c),C>c&&!Py(n.active,t.active)&&a.compareRange(c,C,n.active,t.active),f&&C<r&&(g||n.openEnd(v)!=t.openEnd(v))&&(m=!0)),v>r)break;c=v,x<=0&&n.next(),x>=0&&t.next()}}function Py(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!ax(n[t],e[t]))return!1;return!0}function Td(n,e){for(let t=e,i=n.length-1;t<i;t++)n[t]=n[t+1];n.pop()}function Dd(n,e,t){for(let i=n.length-1;i>=e;i--)n[i+1]=n[i];n[e]=t}function gw(n,e){let t=-1,i=1e9;for(let o=0;o<e.length;o++)(e[o]-i||n[o].endSide-n[t].endSide)<0&&(t=o,i=e[o]);return t}function Vr(n,e,t=n.length){let i=0;for(let o=0;o<t&&o<n.length;)n.charCodeAt(o)==9?(i+=e-i%e,o++):(i++,o=$t(n,o));return i}function Ty(n,e,t,i){for(let o=0,a=0;;){if(a>=e)return o;if(o==n.length)break;a+=n.charCodeAt(o)==9?t-a%t:1,o=$t(n,o)}return i===!0?-1:n.length}const Dy="ͼ",yw=typeof Symbol>"u"?"__"+Dy:Symbol.for(Dy),My=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),bw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class bs{constructor(e,t){this.rules=[];let{finish:i}=t||{};function o(r){return/^@/.test(r)?[r]:r.split(/,\s*/)}function a(r,c,d,f){let m=[],g=/^@(\w+)\b/.exec(r[0]),x=g&&g[1]=="keyframes";if(g&&c==null)return d.push(r[0]+";");for(let v in c){let C=c[v];if(/&/.test(v))a(v.split(/,\s*/).map(k=>r.map(w=>k.replace(/&/,w))).reduce((k,w)=>k.concat(w)),C,d);else if(C&&typeof C=="object"){if(!g)throw new RangeError("The value of a property ("+v+") should be a primitive value.");a(o(v),C,m,x)}else C!=null&&m.push(v.replace(/_.*/,"").replace(/[A-Z]/g,k=>"-"+k.toLowerCase())+": "+C+";")}(m.length||x)&&d.push((i&&!g&&!f?r.map(i):r).join(", ")+" {"+m.join(" ")+"}")}for(let r in e)a(o(r),e[r],this.rules)}getRules(){return this.rules.join(`
22
+ `)}static newName(){let e=bw[yw]||1;return bw[yw]=e+1,Dy+e.toString(36)}static mount(e,t,i){let o=e[My],a=i&&i.nonce;o?a&&o.setNonce(a):o=new tH(e,a),o.mount(Array.isArray(t)?t:[t],e)}}let xw=new Map;class tH{constructor(e,t){let i=e.ownerDocument||e,o=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&o.CSSStyleSheet){let a=xw.get(i);if(a)return e[My]=a;this.sheet=new o.CSSStyleSheet,xw.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[My]=this}mount(e,t){let i=this.sheet,o=0,a=0;for(let r=0;r<e.length;r++){let c=e[r],d=this.modules.indexOf(c);if(d<a&&d>-1&&(this.modules.splice(d,1),a--,d=-1),d==-1){if(this.modules.splice(a++,0,c),i)for(let f=0;f<c.rules.length;f++)i.insertRule(c.rules[f],o++)}else{for(;a<d;)o+=this.modules[a++].rules.length;o+=c.rules.length,a++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let r="";for(let d=0;d<this.modules.length;d++)r+=this.modules[d].getRules()+`
23
+ `;this.styleTag.textContent=r;let c=t.head||t;this.styleTag.parentNode!=c&&c.insertBefore(this.styleTag,c.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var xs={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Pc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nH=typeof navigator<"u"&&/Mac/.test(navigator.platform),iH=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var an=0;an<10;an++)xs[48+an]=xs[96+an]=String(an);for(var an=1;an<=24;an++)xs[an+111]="F"+an;for(var an=65;an<=90;an++)xs[an]=String.fromCharCode(an+32),Pc[an]=String.fromCharCode(an);for(var bg in xs)Pc.hasOwnProperty(bg)||(Pc[bg]=xs[bg]);function oH(n){var e=nH&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||iH&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Pc:xs)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function dt(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=t[i];typeof o=="string"?n.setAttribute(i,o):o!=null&&(n[i]=o)}e++}for(;e<arguments.length;e++)tT(n,arguments[e]);return n}function tT(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)tT(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}let bn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ny=typeof document<"u"?document:{documentElement:{style:{}}};const Ly=/Edge\/(\d+)/.exec(bn.userAgent),nT=/MSIE \d/.test(bn.userAgent),Ry=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(bn.userAgent),df=!!(nT||Ry||Ly),vw=!df&&/gecko\/(\d+)/i.test(bn.userAgent),xg=!df&&/Chrome\/(\d+)/.exec(bn.userAgent),Cw="webkitFontSmoothing"in Ny.documentElement.style,Ey=!df&&/Apple Computer/.test(bn.vendor),Sw=Ey&&(/Mobile\/\w+/.test(bn.userAgent)||bn.maxTouchPoints>2);var me={mac:Sw||/Mac/.test(bn.platform),windows:/Win/.test(bn.platform),linux:/Linux|X11/.test(bn.platform),ie:df,ie_version:nT?Ny.documentMode||6:Ry?+Ry[1]:Ly?+Ly[1]:0,gecko:vw,gecko_version:vw?+(/Firefox\/(\d+)/.exec(bn.userAgent)||[0,0])[1]:0,chrome:!!xg,chrome_version:xg?+xg[1]:0,ios:Sw,android:/Android\b/.test(bn.userAgent),webkit:Cw,webkit_version:Cw?+(/\bAppleWebKit\/(\d+)/.exec(bn.userAgent)||[0,0])[1]:0,safari:Ey,safari_version:Ey?+(/\bVersion\/(\d+(\.\d+)?)/.exec(bn.userAgent)||[0,0])[1]:0,tabSize:Ny.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function lx(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const Ch=Object.create(null);function cx(n,e,t){if(n==e)return!0;n||(n=Ch),e||(e=Ch);let i=Object.keys(n),o=Object.keys(e);if(i.length-0!=o.length-0)return!1;for(let a of i)if(a!=t&&(o.indexOf(a)==-1||n[a]!==e[a]))return!1;return!0}function sH(n,e){for(let t=n.attributes.length-1;t>=0;t--){let i=n.attributes[t].name;e[i]==null&&n.removeAttribute(i)}for(let t in e){let i=e[t];t=="style"?n.style.cssText=i:n.getAttribute(t)!=i&&n.setAttribute(t,i)}}function kw(n,e,t){let i=!1;if(e)for(let o in e)t&&o in t||(i=!0,o=="style"?n.style.cssText="":n.removeAttribute(o));if(t)for(let o in t)e&&e[o]==t[o]||(i=!0,o=="style"?n.style.cssText=t[o]:n.setAttribute(o,t[o]));return i}function aH(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let i=n.attributes[t];e[i.name]=i.value}return e}class Ji{eq(e){return!1}updateDOM(e,t,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var rn=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(rn||(rn={}));class Oe extends ys{constructor(e,t,i,o){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=o}get heightRelevant(){return!1}static mark(e){return new $c(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new ga(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,o;if(e.isBlockGap)i=-5e8,o=4e8;else{let{start:a,end:r}=iT(e,t);i=(a?t?-3e8:-1:5e8)-1,o=(r?t?2e8:1:-6e8)+1}return new ga(e,i,o,t,e.widget||null,!0)}static line(e){return new Xc(e)}static set(e,t=!1){return qe.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Oe.none=qe.empty;class $c extends Oe{constructor(e){let{start:t,end:i}=iT(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?lx(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Ch}eq(e){return this==e||e instanceof $c&&this.tagName==e.tagName&&cx(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}$c.prototype.point=!1;class Xc extends Oe{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Xc&&this.spec.class==e.spec.class&&cx(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Xc.prototype.mapMode=xn.TrackBefore;Xc.prototype.point=!0;class ga extends Oe{constructor(e,t,i,o,a,r){super(t,i,a,e),this.block=o,this.isReplace=r,this.mapMode=o?t<=0?xn.TrackBefore:xn.TrackAfter:xn.TrackDel}get type(){return this.startSide!=this.endSide?rn.WidgetRange:this.startSide<=0?rn.WidgetBefore:rn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof ga&&rH(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}ga.prototype.point=!0;function iT(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function rH(n,e){return n==e||!!(n&&e&&n.compare(e))}function Or(n,e,t,i=0){let o=t.length-1;o>=0&&t[o]+i>=n?t[o]=Math.max(t[o],e):t.push(n,e)}class Tc extends ys{constructor(e,t,i){super(),this.tagName=e,this.attributes=t,this.rank=i}eq(e){return e==this||e instanceof Tc&&this.tagName==e.tagName&&cx(this.attributes,e.attributes)}static create(e){return new Tc(e.tagName,e.attributes||Ch,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return qe.of(e,t)}}Tc.prototype.startSide=Tc.prototype.endSide=-1;function Dc(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function jy(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function dc(n,e){if(!e.anchorNode)return!1;try{return jy(n,e.anchorNode)}catch{return!1}}function hc(n){return n.nodeType==3?Nc(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function fc(n,e,t,i){return t?ww(n,e,t,i,-1)||ww(n,e,t,i,1):!1}function vs(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Sh(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function ww(n,e,t,i,o){for(;;){if(n==t&&e==i)return!0;if(e==(o<0?0:Lo(n))){if(n.nodeName=="DIV")return!1;let a=n.parentNode;if(!a||a.nodeType!=1)return!1;e=vs(n)+(o<0?0:1),n=a}else if(n.nodeType==1){if(n=n.childNodes[e+(o<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=o<0?Lo(n):0}else return!1}}function Lo(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Mc(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function lH(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function oT(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function cH(n,e,t,i,o,a,r,c){let d=n.ownerDocument,f=d.defaultView||window;for(let m=n,g=!1;m&&!g;)if(m.nodeType==1){let x,v=m==d.body,C=1,k=1;if(v)x=lH(f);else{if(/^(fixed|sticky)$/.test(getComputedStyle(m).position)&&(g=!0),m.scrollHeight<=m.clientHeight&&m.scrollWidth<=m.clientWidth){m=m.assignedSlot||m.parentNode;continue}let T=m.getBoundingClientRect();({scaleX:C,scaleY:k}=oT(m,T)),x={left:T.left,right:T.left+m.clientWidth*C,top:T.top,bottom:T.top+m.clientHeight*k}}let w=0,P=0;if(o=="nearest")e.top<x.top+r?(P=e.top-(x.top+r),t>0&&e.bottom>x.bottom+P&&(P=e.bottom-x.bottom+r)):e.bottom>x.bottom-r&&(P=e.bottom-x.bottom+r,t<0&&e.top-P<x.top&&(P=e.top-(x.top+r)));else{let T=e.bottom-e.top,M=x.bottom-x.top;P=(o=="center"&&T<=M?e.top+T/2-M/2:o=="start"||o=="center"&&t<0?e.top-r:e.bottom-M+r)-x.top}if(i=="nearest"?e.left<x.left+a?(w=e.left-(x.left+a),t>0&&e.right>x.right+w&&(w=e.right-x.right+a)):e.right>x.right-a&&(w=e.right-x.right+a,t<0&&e.left<x.left+w&&(w=e.left-(x.left+a))):w=(i=="center"?e.left+(e.right-e.left)/2-(x.right-x.left)/2:i=="start"==c?e.left-a:e.right-(x.right-x.left)+a)-x.left,w||P)if(v)f.scrollBy(w,P);else{let T=0,M=0;if(P){let D=m.scrollTop;m.scrollTop+=P/k,M=(m.scrollTop-D)*k}if(w){let D=m.scrollLeft;m.scrollLeft+=w/C,T=(m.scrollLeft-D)*C}e={left:e.left-T,top:e.top-M,right:e.right-T,bottom:e.bottom-M},T&&Math.abs(T-w)<1&&(i="nearest"),M&&Math.abs(M-P)<1&&(o="nearest")}if(v)break;(e.top<x.top||e.bottom>x.bottom||e.left<x.left||e.right>x.right)&&(e={left:Math.max(e.left,x.left),right:Math.min(e.right,x.right),top:Math.max(e.top,x.top),bottom:Math.min(e.bottom,x.bottom)}),m=m.assignedSlot||m.parentNode}else if(m.nodeType==11)m=m.host;else break}function sT(n,e=!0){let t=n.ownerDocument,i=null,o=null;for(let a=n.parentNode;a&&!(a==t.body||(!e||i)&&o);)if(a.nodeType==1)!o&&a.scrollHeight>a.clientHeight&&(o=a),e&&!i&&a.scrollWidth>a.clientWidth&&(i=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:i,y:o}}class uH{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?Lo(t):0),i,Math.min(e.focusOffset,i?Lo(i):0))}set(e,t,i,o){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=o}}let Js=null;me.safari&&me.safari_version>=26&&(Js=!1);function aT(n){if(n.setActive)return n.setActive();if(Js)return n.focus(Js);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Js==null?{get preventScroll(){return Js={preventScroll:!0},!0}}:void 0),!Js){Js=!1;for(let t=0;t<e.length;){let i=e[t++],o=e[t++],a=e[t++];i.scrollTop!=o&&(i.scrollTop=o),i.scrollLeft!=a&&(i.scrollLeft=a)}}}let Aw;function Nc(n,e,t=e){let i=Aw||(Aw=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function Pr(n,e,t,i){let o={key:e,code:e,keyCode:t,which:t,cancelable:!0};i&&({altKey:o.altKey,ctrlKey:o.ctrlKey,shiftKey:o.shiftKey,metaKey:o.metaKey}=i);let a=new KeyboardEvent("keydown",o);a.synthetic=!0,n.dispatchEvent(a);let r=new KeyboardEvent("keyup",o);return r.synthetic=!0,n.dispatchEvent(r),a.defaultPrevented||r.defaultPrevented}function dH(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function hH(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,Lo(t));;)if(i){if(t.nodeType!=1)return!1;let o=t.childNodes[i-1];o.contentEditable=="false"?i--:(t=o,i=Lo(t))}else{if(t==n)return!0;i=vs(t),t=t.parentNode}}function rT(n){return n instanceof Window?n.pageYOffset>Math.max(0,n.document.documentElement.scrollHeight-n.innerHeight-4):n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function lT(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable=="false")return null;t=t.childNodes[i-1],i=Lo(t)}else if(t.parentNode&&!Sh(t))i=vs(t),t=t.parentNode;else return null}}function cT(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i<t.nodeValue.length)return{node:t,offset:i};if(t.nodeType==1&&i<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[i],i=0}else if(t.parentNode&&!Sh(t))i=vs(t)+1,t=t.parentNode;else return null}}class Ci{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new Ci(e.parentNode,vs(e),t)}static after(e,t){return new Ci(e.parentNode,vs(e)+1,t)}}var yt=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(yt||(yt={}));const ya=yt.LTR,ux=yt.RTL;function uT(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const fH=uT("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),pH=uT("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Iy=Object.create(null),Li=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);Iy[e]=t,Iy[t]=-e}function dT(n){return n<=247?fH[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?pH[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const mH=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Fi{get dir(){return this.level%2?ux:ya}constructor(e,t,i){this.from=e,this.to=t,this.level=i}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,i,o){let a=-1;for(let r=0;r<e.length;r++){let c=e[r];if(c.from<=t&&c.to>=t){if(c.level==i)return r;(a<0||(o!=0?o<0?c.from<t:c.to>t:e[a].level>c.level))&&(a=r)}}if(a<0)throw new RangeError("Index out of range");return a}}function hT(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let i=n[t],o=e[t];if(i.from!=o.from||i.to!=o.to||i.direction!=o.direction||!hT(i.inner,o.inner))return!1}return!0}const mt=[];function gH(n,e,t,i,o){for(let a=0;a<=i.length;a++){let r=a?i[a-1].to:e,c=a<i.length?i[a].from:t,d=a?256:o;for(let f=r,m=d,g=d;f<c;f++){let x=dT(n.charCodeAt(f));x==512?x=m:x==8&&g==4&&(x=16),mt[f]=x==4?2:x,x&7&&(g=x),m=x}for(let f=r,m=d,g=d;f<c;f++){let x=mt[f];if(x==128)f<c-1&&m==mt[f+1]&&m&24?x=mt[f]=m:mt[f]=256;else if(x==64){let v=f+1;for(;v<c&&mt[v]==64;)v++;let C=f&&m==8||v<t&&mt[v]==8?g==1?1:8:256;for(let k=f;k<v;k++)mt[k]=C;f=v-1}else x==8&&g==1&&(mt[f]=1);m=x,x&7&&(g=x)}}}function yH(n,e,t,i,o){let a=o==1?2:1;for(let r=0,c=0,d=0;r<=i.length;r++){let f=r?i[r-1].to:e,m=r<i.length?i[r].from:t;for(let g=f,x,v,C;g<m;g++)if(v=Iy[x=n.charCodeAt(g)])if(v<0){for(let k=c-3;k>=0;k-=3)if(Li[k+1]==-v){let w=Li[k+2],P=w&2?o:w&4?w&1?a:o:0;P&&(mt[g]=mt[Li[k]]=P),c=k;break}}else{if(Li.length==189)break;Li[c++]=g,Li[c++]=x,Li[c++]=d}else if((C=mt[g])==2||C==1){let k=C==o;d=k?0:1;for(let w=c-3;w>=0;w-=3){let P=Li[w+2];if(P&2)break;if(k)Li[w+2]|=2;else{if(P&4)break;Li[w+2]|=4}}}}}function bH(n,e,t,i){for(let o=0,a=i;o<=t.length;o++){let r=o?t[o-1].to:n,c=o<t.length?t[o].from:e;for(let d=r;d<c;){let f=mt[d];if(f==256){let m=d+1;for(;;)if(m==c){if(o==t.length)break;m=t[o++].to,c=o<t.length?t[o].from:e}else if(mt[m]==256)m++;else break;let g=a==1,x=(m<e?mt[m]:i)==1,v=g==x?g?1:2:i;for(let C=m,k=o,w=k?t[k-1].to:n;C>d;)C==w&&(C=t[--k].from,w=k?t[k-1].to:n),mt[--C]=v;d=m}else a=f,d++}}}function By(n,e,t,i,o,a,r){let c=i%2?2:1;if(i%2==o%2)for(let d=e,f=0;d<t;){let m=!0,g=!1;if(f==a.length||d<a[f].from){let k=mt[d];k!=c&&(m=!1,g=k==16)}let x=!m&&c==1?[]:null,v=m?i:i+1,C=d;e:for(;;)if(f<a.length&&C==a[f].from){if(g)break e;let k=a[f];if(!m)for(let w=k.to,P=f+1;;){if(w==t)break e;if(P<a.length&&a[P].from==w)w=a[P++].to;else{if(mt[w]==c)break e;break}}if(f++,x)x.push(k);else{k.from>d&&r.push(new Fi(d,k.from,v));let w=k.direction==ya!=!(v%2);_y(n,w?i+1:i,o,k.inner,k.from,k.to,r),d=k.to}C=k.to}else{if(C==t||(m?mt[C]!=c:mt[C]==c))break;C++}x?By(n,d,C,i+1,o,x,r):d<C&&r.push(new Fi(d,C,v)),d=C}else for(let d=t,f=a.length;d>e;){let m=!0,g=!1;if(!f||d>a[f-1].to){let k=mt[d-1];k!=c&&(m=!1,g=k==16)}let x=!m&&c==1?[]:null,v=m?i:i+1,C=d;e:for(;;)if(f&&C==a[f-1].to){if(g)break e;let k=a[--f];if(!m)for(let w=k.from,P=f;;){if(w==e)break e;if(P&&a[P-1].to==w)w=a[--P].from;else{if(mt[w-1]==c)break e;break}}if(x)x.push(k);else{k.to<d&&r.push(new Fi(k.to,d,v));let w=k.direction==ya!=!(v%2);_y(n,w?i+1:i,o,k.inner,k.from,k.to,r),d=k.from}C=k.from}else{if(C==e||(m?mt[C-1]!=c:mt[C-1]==c))break;C--}x?By(n,C,d,i+1,o,x,r):C<d&&r.push(new Fi(C,d,v)),d=C}}function _y(n,e,t,i,o,a,r){let c=e%2?2:1;gH(n,o,a,i,c),yH(n,o,a,i,c),bH(o,a,i,c),By(n,o,a,e,t,i,r)}function xH(n,e,t){if(!n)return[new Fi(0,0,e==ux?1:0)];if(e==ya&&!t.length&&!mH.test(n))return fT(n.length);if(t.length)for(;n.length>mt.length;)mt[mt.length]=256;let i=[],o=e==ya?0:1;return _y(n,o,o,t,0,n.length,i),i}function fT(n){return[new Fi(0,n,0)]}let pT="";function vH(n,e,t,i,o){var a;let r=i.head-n.from,c=Fi.find(e,r,(a=i.bidiLevel)!==null&&a!==void 0?a:-1,i.assoc),d=e[c],f=d.side(o,t);if(r==f){let x=c+=o?1:-1;if(x<0||x>=e.length)return null;d=e[c=x],r=d.side(!o,t),f=d.side(o,t)}let m=$t(n.text,r,d.forward(o,t));(m<d.from||m>d.to)&&(m=f),pT=n.text.slice(Math.min(r,m),Math.max(r,m));let g=c==(o?e.length-1:0)?null:e[c+(o?1:-1)];return g&&m==f&&g.level+(o?0:1)<d.level?J.cursor(g.side(!o,t)+n.from,g.forward(o,t)?1:-1,g.level):J.cursor(m+n.from,d.forward(o,t)?-1:1,d.level)}function CH(n,e,t){for(let i=e;i<t;i++){let o=dT(n.charCodeAt(i));if(o==1)return ya;if(o==2||o==4)return ux}return ya}const mT=pe.define(),gT=pe.define(),yT=pe.define(),bT=pe.define(),Hy=pe.define(),xT=pe.define(),vT=pe.define(),dx=pe.define(),hx=pe.define(),CT=pe.define({combine:n=>n.some(e=>e)}),ST=pe.define({combine:n=>n.some(e=>e)}),kT=pe.define();class Tr{constructor(e,t,i,o,a,r=!1){this.range=e,this.y=t,this.x=i,this.yMargin=o,this.xMargin=a,this.isSnapshot=r}map(e){return e.empty?this:new Tr(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Tr(J.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Md=Le.define({map:(n,e)=>n.map(e)}),wT=Le.define();function En(n,e,t){let i=n.facet(bT);i.length?i[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const ko=pe.define({combine:n=>n.length?n[0]:!0});let SH=0;const br=pe.define({combine(n){return n.filter((e,t)=>{for(let i=0;i<t;i++)if(n[i].plugin==e.plugin)return!1;return!0})}});class At{constructor(e,t,i,o,a){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=o,this.baseExtensions=a(this),this.extension=this.baseExtensions.concat(br.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(br.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:i,eventObservers:o,provide:a,decorations:r}=t||{};return new At(SH++,e,i,o,c=>{let d=[];return r&&d.push(hf.of(f=>{let m=f.plugin(c);return m?r(m):Oe.none})),a&&d.push(a(c)),d})}static fromClass(e,t){return At.define((i,o)=>new e(i,o),t)}}class vg{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(En(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){En(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){En(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const AT=pe.define(),fx=pe.define(),hf=pe.define(),OT=pe.define(),px=pe.define(),Jc=pe.define(),PT=pe.define();function Ow(n,e){let t=n.state.facet(PT);if(!t.length)return t;let i=t.map(a=>a instanceof Function?a(n):a),o=[];return qe.spans(i,e.from,e.to,{point(){},span(a,r,c,d){let f=a-e.from,m=r-e.from,g=o;for(let x=c.length-1;x>=0;x--,d--){let v=c[x].spec.bidiIsolate,C;if(v==null&&(v=CH(e.text,f,m)),d>0&&g.length&&(C=g[g.length-1]).to==f&&C.direction==v)C.to=m,g=C.inner;else{let k={from:f,to:m,direction:v,inner:[]};g.push(k),g=k.inner}}}}),o}const TT=pe.define();function mx(n){let e=0,t=0,i=0,o=0;for(let a of n.state.facet(TT)){let r=a(n);r&&(r.left!=null&&(e=Math.max(e,r.left)),r.right!=null&&(t=Math.max(t,r.right)),r.top!=null&&(i=Math.max(i,r.top)),r.bottom!=null&&(o=Math.max(o,r.bottom)))}return{left:e,right:t,top:i,bottom:o}}const ec=pe.define();class ri{constructor(e,t,i,o){this.fromA=e,this.toA=t,this.fromB=i,this.toB=o}join(e){return new ri(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let o=e[t-1];if(!(o.fromA>i.toA)){if(o.toA<i.fromA)break;i=i.join(o),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(t.length==0)return e;let i=[];for(let o=0,a=0,r=0;;){let c=o<e.length?e[o].fromB:1e9,d=a<t.length?t[a]:1e9,f=Math.min(c,d);if(f==1e9)break;let m=f+r,g=f,x=m;for(;;)if(a<t.length&&t[a]<=g){let v=t[a+1];a+=2,g=Math.max(g,v);for(let C=o;C<e.length&&e[C].fromB<=g;C++)r=e[C].toA-e[C].toB;x=Math.max(x,v+r)}else if(o<e.length&&e[o].fromB<=g){let v=e[o++];g=Math.max(g,v.toB),x=Math.max(x,v.toA),r=v.toA-v.toB}else break;i.push(new ri(m,x,f,g))}return i}}class kh{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=qt.empty(this.startState.doc.length);for(let a of i)this.changes=this.changes.compose(a.changes);let o=[];this.changes.iterChangedRanges((a,r,c,d)=>o.push(new ri(a,r,c,d))),this.changedRanges=o}static create(e,t,i){return new kh(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const kH=[];class Nt{constructor(e,t,i=0){this.dom=e,this.length=t,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return kH}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&sH(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let i=t;for(let o of this.children){if(o==e)return i;i+=o.length+o.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let i=vs(this.dom),o=this.length?e>0:t>0;return new Ci(this.parent.dom,i+(o?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof pf)return e;return null}static get(e){return e.cmTile}}class ff extends Nt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,i=null,o,a=e?.node==t?e:null,r=0;for(let c of this.children){if(c.sync(e),r+=c.length+c.breakAfter,o=i?i.nextSibling:t.firstChild,a&&o!=c.dom&&(a.written=!0),c.dom.parentNode==t)for(;o&&o!=c.dom;)o=Pw(o);else t.insertBefore(c.dom,o);i=c.dom}for(o=i?i.nextSibling:t.firstChild,a&&o&&(a.written=!0);o;)o=Pw(o);this.length=r}}function Pw(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class pf extends ff{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=Nt.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,o=0,a=0;;)if(o==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&a++,o=t.pop()}else{let r=i.children[o++];if(r instanceof Po)t.push(o),i=r,o=0;else{let c=a+r.length,d=e(r,a);if(d!==void 0)return d;a=c+r.breakAfter}}}resolveBlock(e,t){let i,o=-1,a,r=-1;if(this.blockTiles((c,d)=>{let f=d+c.length;if(e>=d&&e<=f){if(c.isWidget()&&t>=-1&&t<=1){if(c.flags&32)return!0;c.flags&16&&(i=void 0)}(d<e||e==f&&(t<-1?c.length:c.covers(1)))&&(!i||!c.isWidget()&&i.isWidget())&&(i=c,o=e-d),(f>e||e==d&&(t>1?c.length:c.covers(-1)))&&(!a||!c.isWidget()&&a.isWidget())&&(a=c,r=e-d)}}),!i&&!a)throw new Error("No tile at position "+e);return i&&t<0||!a?{tile:i,offset:o}:{tile:a,offset:r}}}class Po extends ff{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let i=new Po(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class Ir extends ff{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let o=new Ir(t||document.createElement("div"),e);return(!t||!i)&&(o.flags|=4),o}get domAttrs(){return this.attrs}resolveInline(e,t,i){let o=null,a=-1,r=null,c=-1;function d(m,g){for(let x=0,v=0;x<m.children.length&&v<=g;x++){let C=m.children[x],k=v+C.length;k>=g&&(C.isComposite()?d(C,g-v):(!r||r.isHidden&&(t>0||i&&AH(r,C)))&&(k>g||C.flags&32)?(r=C,c=g-v):(v<g||C.flags&16&&!C.isHidden)&&(o=C,a=g-v)),v=k}}d(this,e);let f=(t<0?o:r)||o||r;return f?{tile:f,offset:f==o?a:c}:null}coordsIn(e,t){let i=this.resolveInline(e,t,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),t):wH(this)}domIn(e,t){let i=this.resolveInline(e,t);if(i){let{tile:o,offset:a}=i;if(this.dom.contains(o.dom))return o.isText()?new Ci(o.dom,Math.min(o.dom.nodeValue.length,a)):o.domPosFor(a,o.flags&16?1:o.flags&32?-1:t);let r=i.tile.parent,c=!1;for(let d of r.children){if(c)return new Ci(d.dom,0);d==i.tile&&(c=!0)}}return new Ci(this.dom,0)}}function wH(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=hc(e);return t[t.length-1]||null}function AH(n,e){let t=n.coordsIn(0,1),i=e.coordsIn(0,1);return t&&i&&i.top<t.bottom}class Rn extends ff{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let i=new Rn(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class ia extends Nt{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let i=this.dom.nodeValue.length;e>i&&(e=i);let o=e,a=e,r=0;e==0&&t<0||e==i&&t>=0?me.chrome||me.gecko||(e?(o--,r=1):a<i&&(a++,r=-1)):t<0?o--:a<i&&a++;let c=Nc(this.dom,o,a).getClientRects();if(!c.length)return null;let d=c[(r?r<0:t>=0)?0:c.length-1];return me.safari&&!r&&d.width==0&&(d=Array.prototype.find.call(c,f=>f.width)||d),r?Mc(d,r<0):d||null}static of(e,t){let i=new ia(t||document.createTextNode(e),e);return t||(i.flags|=2),i}}class ba extends Nt{constructor(e,t,i,o){super(e,t,o),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,i){let o=this.widget.coordsAt(this.dom,e,t);if(o)return o;if(i)return Mc(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let a=this.dom.getClientRects(),r=null;if(!a.length)return null;let c=this.flags&16?!0:this.flags&32?!1:e>0;for(let d=c?a.length-1:0;r=a[d],!(e>0?d==0:d==a.length-1||r.top<r.bottom);d+=c?-1:1);return Mc(r,!c)}}get overrideDOMText(){if(!this.length)return Je.empty;let{root:e}=this;if(!e)return Je.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,i,o,a){return a||(a=e.toDOM(t),e.editable||(a.contentEditable="false")),new ba(a,i,e,o)}}class wh extends Nt{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return Je.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class OH{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,i){let{tile:o,index:a,beforeBreak:r,parents:c}=this;for(;e||t>0;)if(o.isComposite())if(r){if(!e)break;i&&i.break(),e--,r=!1}else if(a==o.children.length){if(!e&&!c.length)break;i&&i.leave(o),r=!!o.breakAfter,{tile:o,index:a}=c.pop(),a++}else{let d=o.children[a],f=d.breakAfter;(t>0?d.length<=e:d.length<e)&&(!i||i.skip(d,0,d.length)!==!1||!d.isComposite)?(r=!!f,a++,e-=d.length):(c.push({tile:o,index:a}),o=d,a=0,i&&d.isComposite()&&i.enter(d))}else if(a==o.length)r=!!o.breakAfter,{tile:o,index:a}=c.pop(),a++;else if(e){let d=Math.min(e,o.length-a);i&&i.skip(o,a,a+d),e-=d,a+=d}else break;return this.tile=o,this.index=a,this.beforeBreak=r,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class PH{constructor(e,t,i,o){this.from=e,this.to=t,this.wrapper=i,this.rank=o}}class TH{constructor(e,t,i){this.cache=e,this.root=t,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,i,o){var a;this.flushBuffer();let r=this.ensureMarks(t,i),c=r.lastChild;if(c&&c.isText()&&!(c.flags&8)&&c.length+e.length<512){this.cache.reused.set(c,2);let d=r.children[r.children.length-1]=new ia(c.dom,c.text+e);d.parent=r}else r.append(o||ia.of(e,(a=this.cache.find(ia))===null||a===void 0?void 0:a.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let i=this.curLine;i.dom!=t.line.dom&&(i.setDOM(this.cache.reused.has(t.line)?Cg(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let o=i;for(let c=t.marks.length-1;c>=0;c--){let d=t.marks[c],f=o.lastChild;if(f instanceof Rn&&f.mark.eq(d.mark))f.dom!=d.dom&&f.setDOM(Cg(d.dom)),o=f;else{if(this.cache.reused.get(d)){let g=Nt.get(d.dom);g&&g.setDOM(Cg(d.dom))}let m=Rn.of(d.mark,d.dom);o.append(m),o=m}this.cache.reused.set(d,2)}let a=Nt.get(e.text);a&&this.cache.reused.set(a,2);let r=new ia(e.text,e.text.nodeValue);r.flags|=8,this.pos=e.range.toB,o.append(r)}addInlineWidget(e,t,i){let o=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);o||this.flushBuffer();let a=this.ensureMarks(t,i);!o&&!(e.flags&16)&&a.append(this.getBuffer(1)),a.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,i){this.flushBuffer(),this.ensureMarks(t,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var i;e||(e=DT);let o=Ir.start(e,t||((i=this.cache.find(Ir))===null||i===void 0?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=o)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var i;let o=this.curLine;for(let a=e.length-1;a>=0;a--){let r=e[a],c;if(t>0&&(c=o.lastChild)&&c instanceof Rn&&c.mark.eq(r))o=c,t--;else{let d=Rn.of(r,(i=this.cache.find(Rn,f=>f.mark.eq(r)))===null||i===void 0?void 0:i.dom);o.append(d),o=d,t=0}}return o}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Tw(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(me.ios&&Tw(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Sg,0,32)||new ba(Sg.toDOM(),0,Sg,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,i=new PH(e.from,e.to,e.value,t),o=this.wrappers.length;for(;o>0&&(this.wrappers[o-1].rank-i.rank||this.wrappers[o-1].to-i.to)<0;)o--;this.wrappers.splice(o,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let o=t.lastChild;if(i.from<this.pos&&o instanceof Po&&o.wrapper.eq(i.wrapper))t=o;else{let a=Po.of(i.wrapper,(e=this.cache.find(Po,r=>r.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);t.append(a),t=a}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),i=this.cache.find(wh,void 0,1);return i&&(i.flags=t),i||new wh(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class DH{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:o,lineBreak:a,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw new Error("Ran out of text content when drawing inline views");this.text=o;let c=this.textOff=Math.min(e,o.length);return a?null:o.slice(0,c)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}}const Ah=[ba,Ir,ia,Rn,wh,Po,pf];for(let n=0;n<Ah.length;n++)Ah[n].bucket=n;class MH{constructor(e){this.view=e,this.buckets=Ah.map(()=>[]),this.index=Ah.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,i=this.buckets[t];i.length<6?i.push(e):i[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,i=2){let o=e.bucket,a=this.buckets[o],r=this.index[o];for(let c=a.length-1;c>=0;c--){let d=(c+r)%a.length,f=a[d];if((!t||t(f))&&!this.reused.has(f))return a.splice(d,1),d<r&&this.index[o]--,this.reused.set(f,i),f}return null}findWidget(e,t,i){let o=this.buckets[0];if(o.length)for(let a=0,r=0;;a++){if(a==o.length){if(r)return null;r=1,a=0}let c=o[a];if(!this.reused.has(c)&&(r==0?c.widget.compare(e):c.widget.constructor==e.constructor&&e.updateDOM(c.dom,this.view,c.widget)))return o.splice(a,1),a<this.index[0]&&this.index[0]--,c.widget==e&&c.length==t&&(c.flags&497)==i?(this.reused.set(c,1),c):(this.reused.set(c,2),new ba(c.dom,t,e,c.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class NH{constructor(e,t,i,o,a){this.view=e,this.decorations=o,this.disallowBlockEffectsFor=a,this.openWidget=!1,this.openMarks=0,this.cache=new MH(e),this.text=new DH(e.state.doc),this.builder=new TH(this.cache,new pf(e,e.contentDOM),qe.iter(i)),this.cache.reused.set(t,2),this.old=new OH(t),this.reuseWalker={skip:(r,c,d)=>{if(this.cache.add(r),r.isComposite())return!1},enter:r=>this.cache.add(r),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let o=0,a=0,r=0;;){let c=r<e.length?e[r++]:null,d=c?c.fromA:this.old.root.length;if(d>o){let f=d-o;this.preserve(f,!r,!c),o=d,a+=f}if(!c)break;t&&c.fromA<=t.range.fromA&&c.toA>=t.range.toA?(this.forward(c.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(a,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,i),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,c.toA),this.emit(t.range.toB,c.toB)):(this.forward(c.fromA,c.toA),this.emit(a,c.toB)),a=c.toB,o=c.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,i){let o=EH(this.old),a=this.openMarks;this.old.advance(e,i?1:-1,{skip:(r,c,d)=>{if(r.isWidget())if(this.openWidget)this.builder.continueWidget(d-c);else{let f=d>0||c<r.length?ba.of(r.widget,this.view,d-c,r.flags&496,this.cache.maybeReuse(r)):this.cache.reuse(r);f.flags&256?(f.flags&=-2,this.builder.addBlockWidget(f)):(this.builder.ensureLine(null),this.builder.addInlineWidget(f,o,a),a=o.length)}else if(r.isText())this.builder.ensureLine(null),!c&&d==r.length&&!this.cache.reused.has(r)?this.builder.addText(r.text,o,a,this.cache.reuse(r)):(this.cache.add(r),this.builder.addText(r.text.slice(c,d),o,a)),a=o.length;else if(r.isLine())r.flags&=-2,this.cache.reused.set(r,1),this.builder.addLine(r);else if(r instanceof wh)this.cache.add(r);else if(r instanceof Rn)this.builder.ensureLine(null),this.builder.addMark(r,o,a),this.cache.reused.set(r,1),a=o.length;else return!1;this.openWidget=!1},enter:r=>{r.isLine()?this.builder.addLineStart(r.attrs,this.cache.maybeReuse(r)):(this.cache.add(r),r instanceof Rn&&o.unshift(r.mark)),this.openWidget=!1},leave:r=>{r.isLine()?o.length&&(o.length=a=0):r instanceof Rn&&(o.shift(),a=Math.min(a,o.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,o=this.builder,a=0,r=qe.spans(this.decorations,e,t,{point:(c,d,f,m,g,x)=>{if(f instanceof ga){if(this.disallowBlockEffectsFor[x]){if(f.block)throw new RangeError("Block decorations may not be specified via plugins");if(d>this.view.state.doc.lineAt(c).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(a=m.length,g>m.length)o.continueWidget(d-c);else{let v=f.widget||(f.block?Br.block:Br.inline),C=LH(f),k=this.cache.findWidget(v,d-c,C)||ba.of(v,this.view,d-c,C);f.block?(f.startSide>0&&o.addLineStartIfNotCovered(i),o.addBlockWidget(k)):(o.ensureLine(i),o.addInlineWidget(k,m,g))}i=null}else i=RH(i,f);d>c&&this.text.skip(d-c)},span:(c,d,f,m)=>{for(let g=c;g<d;){let x=this.text.next(Math.min(512,d-g));x==null?(o.addLineStartIfNotCovered(i),o.addBreak(),g++):(o.ensureLine(i),o.addText(x,f,g==c?m:f.length),g+=x.length),i=null}}});o.addLineStartIfNotCovered(i),this.openWidget=r>a,this.openMarks=r}forward(e,t,i=1){t-e<=10?this.old.advance(t-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let t=[],i=null;for(let o=e.parentNode;;o=o.parentNode){let a=Nt.get(o);if(o==this.view.contentDOM)break;a instanceof Rn?t.push(a):a?.isLine()?i=a:a instanceof Po||(o.nodeName=="DIV"&&!i&&o!=this.view.contentDOM?i=new Ir(o,DT):i||t.push(Rn.of(new $c({tagName:o.nodeName.toLowerCase(),attributes:aH(o)}),o)))}return{line:i,marks:t}}}function Tw(n,e){let t=i=>{for(let o of i.children)if((e?o.isText():o.length)||t(o))return!0;return!1};return t(n)}function LH(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}const DT={class:"cm-line"};function RH(n,e){let t=e.spec.attributes,i=e.spec.class;return!t&&!i||(n||(n={class:"cm-line"}),t&&lx(t,n),i&&(n.class+=" "+i)),n}function EH(n){let e=[];for(let t=n.parents.length;t>1;t--){let i=t==n.parents.length?n.tile:n.parents[t].tile;i instanceof Rn&&e.push(i.mark)}return e}function Cg(n){let e=Nt.get(n);return e&&e.setDOM(n.cloneNode()),n}class Br extends Ji{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Br.inline=new Br("span");Br.block=new Br("div");const Sg=new class extends Ji{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Dw{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Oe.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new pf(e,e.contentDOM),this.updateInner([new ri(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:m,toA:g})=>g<this.minWidthFrom||m>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let o=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?o=this.domChanged.newSel.head:!qH(e.changes,this.hasComposition)&&!e.selectionSet&&(o=e.state.selection.main.head));let a=o>-1?IH(this.view,e.changes,o):null;if(this.domChanged=null,this.hasComposition){let{from:m,to:g}=this.hasComposition;i=new ri(m,g,e.changes.mapPos(m,-1),e.changes.mapPos(g,1)).addToSet(i.slice())}this.hasComposition=a?{from:a.range.fromB,to:a.range.toB}:null,(me.ie||me.chrome)&&!a&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let r=this.decorations,c=this.blockWrappers;this.updateDeco();let d=HH(r,this.decorations,e.changes);d.length&&(i=ri.extendWithRanges(i,d));let f=zH(c,this.blockWrappers,e.changes);return f.length&&(i=ri.extendWithRanges(i,f)),a&&!i.some(m=>m.fromA<=a.range.fromA&&m.toA>=a.range.toA)&&(i=a.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,a),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(t||e.length){let r=this.tile,c=new NH(this.view,r,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&Nt.get(t.text)&&c.cache.reused.set(Nt.get(t.text),2),this.tile=c.run(e,t),Uy(r,c.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=me.chrome||me.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(a),a&&(a.written||i.selectionRange.focusNode!=a.node||!this.tile.dom.contains(a.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let o=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let a of this.tile.children)a.isWidget()&&a.widget instanceof kg&&o.push(a.dom);i.updateGaps(o)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let i of t.effects)i.is(wT)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,o=this.view.root.activeElement,a=o==i,r=!a&&!(this.view.state.facet(ko)||i.tabIndex>-1)&&dc(i,this.view.observer.selectionRange)&&!(o&&i.contains(o));if(!(a||t||r))return;let c=this.forceSelection;this.forceSelection=!1;let d=this.view.state.selection.main,f,m;if(d.empty?m=f=this.inlineDOMNearPos(d.anchor,d.assoc||1):(m=this.inlineDOMNearPos(d.head,d.head==d.from?1:-1),f=this.inlineDOMNearPos(d.anchor,d.anchor==d.from?1:-1)),me.gecko&&d.empty&&!this.hasComposition&&jH(f)){let x=document.createTextNode("");this.view.observer.ignore(()=>f.node.insertBefore(x,f.node.childNodes[f.offset]||null)),f=m=new Ci(x,0),c=!0}let g=this.view.observer.selectionRange;(c||!g.focusNode||(!fc(f.node,f.offset,g.anchorNode,g.anchorOffset)||!fc(m.node,m.offset,g.focusNode,g.focusOffset))&&!this.suppressWidgetCursorChange(g,d))&&(this.view.observer.ignore(()=>{me.android&&me.chrome&&i.contains(g.focusNode)&&FH(g.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let x=Dc(this.view.root);if(x)if(d.empty){if(me.gecko){let v=BH(f.node,f.offset);if(v&&v!=3){let C=(v==1?lT:cT)(f.node,f.offset);C&&(f=new Ci(C.node,C.offset))}}x.collapse(f.node,f.offset),d.bidiLevel!=null&&x.caretBidiLevel!==void 0&&(x.caretBidiLevel=d.bidiLevel)}else if(x.extend){x.collapse(f.node,f.offset);try{x.extend(m.node,m.offset)}catch{}}else{let v=document.createRange();d.anchor>d.head&&([f,m]=[m,f]),v.setEnd(m.node,m.offset),v.setStart(f.node,f.offset),x.removeAllRanges(),x.addRange(v)}r&&this.view.root.activeElement==i&&(i.blur(),o&&o.focus())}),this.view.observer.setSelectionRange(f,m)),this.impreciseAnchor=f.precise?null:new Ci(g.anchorNode,g.anchorOffset),this.impreciseHead=m.precise?null:new Ci(g.focusNode,g.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&fc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=Dc(e.root),{anchorNode:o,anchorOffset:a}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let r=this.lineAt(t.head,t.assoc);if(!r)return;let c=r.posAtStart;if(t.head==c||t.head==c+r.length)return;let d=this.coordsAt(t.head,-1),f=this.coordsAt(t.head,1);if(!d||!f||d.bottom>f.top)return;let m=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(m.node,m.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let g=e.observer.selectionRange;e.docView.posFromDOM(g.anchorNode,g.anchorOffset)!=t.from&&i.collapse(o,a)}posFromDOM(e,t){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let o=i.posAtStart;if(i.isComposite()){let a;if(e==i.dom)a=i.dom.childNodes[t];else{let r=Lo(e)==0?0:t==0?-1:1;for(;;){let c=e.parentNode;if(c==i.dom)break;r==0&&c.firstChild!=c.lastChild&&(e==c.firstChild?r=-1:r=1),e=c}r<0?a=e:a=e.nextSibling}if(a==i.dom.firstChild)return o;for(;a&&!Nt.get(a);)a=a.nextSibling;if(!a)return o+i.length;for(let r=0,c=o;;r++){let d=i.children[r];if(d.dom==a)return c;c+=d.length+d.breakAfter}}else return i.isText()?e==i.dom?o+t:o+(t?i.length:0):o}domAtPos(e,t){let{tile:i,offset:o}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(e,t):i.domIn(o,t)}inlineDOMNearPos(e,t){let i,o=-1,a=!1,r,c=-1,d=!1;return this.tile.blockTiles((f,m)=>{if(f.isWidget()){if(f.flags&32&&m>=e)return!0;f.flags&16&&(a=!0)}else{let g=m+f.length;if(m<=e&&(i=f,o=e-m,a=g<e),g>=e&&!r&&(r=f,c=e-m,d=m>e),m>e&&r)return!0}}),!i&&!r?this.domAtPos(e,t):(a&&r?i=null:d&&i&&(r=null),i&&t<0||!r?i.domIn(o,t):r.domIn(c,t))}coordsAt(e,t){let{tile:i,offset:o}=this.tile.resolveBlock(e,t);return i.isWidget()?i.widget instanceof kg?null:i.coordsInWidget(o,t,!0):i.coordsIn(o,t)}lineAt(e,t){let{tile:i}=this.tile.resolveBlock(e,t);return i.isLine()?i:null}coordsForChar(e){let{tile:t,offset:i}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function o(a,r){if(a.isComposite())for(let c of a.children){if(c.length>=r){let d=o(c,r);if(d)return d}if(r-=c.length,r<0)break}else if(a.isText()&&r<a.length){let c=$t(a.text,r);if(c==r)return null;let d=Nc(a.dom,r,c).getClientRects();for(let f=0;f<d.length;f++){let m=d[f];if(f==d.length-1||m.top<m.bottom&&m.left<m.right)return m}}return null}return o(t,i)}measureVisibleLineHeights(e){let t=[],{from:i,to:o}=e,a=this.view.contentDOM.clientWidth,r=a>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,c=-1,d=this.view.textDirection==yt.LTR,f=0,m=(g,x,v)=>{for(let C=0;C<g.children.length&&!(x>o);C++){let k=g.children[C],w=x+k.length,P=k.dom.getBoundingClientRect(),{height:T}=P;if(v&&!C&&(f+=P.top-v.top),k instanceof Po)w>i&&m(k,x,P);else if(x>=i&&(f>0&&t.push(-f),t.push(T+f),f=0,r)){let M=k.dom.lastChild,D=M?hc(M):[];if(D.length){let L=D[D.length-1],N=d?L.right-P.left:P.right-L.left;N>c&&(c=N,this.minWidth=a,this.minWidthFrom=x,this.minWidthTo=w)}}v&&C==g.children.length-1&&(f+=v.bottom-P.bottom),x=w+k.breakAfter}};return m(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?yt.RTL:yt.LTR}measureTextSize(){let e=this.tile.blockTiles(r=>{if(r.isLine()&&r.children.length&&r.length<=20){let c=0,d;for(let f of r.children){if(!f.isText()||/[^ -~]/.test(f.text))return;let m=hc(f.dom);if(m.length!=1)return;c+=m[0].width,d=m[0].height}if(c)return{lineHeight:r.dom.getBoundingClientRect().height,charWidth:c/r.length,textHeight:d}}});if(e)return e;let t=document.createElement("div"),i,o,a;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let r=hc(t.firstChild)[0];i=t.getBoundingClientRect().height,o=r&&r.width?r.width/27:7,a=r&&r.height?r.height:i,t.remove()}),{lineHeight:i,charWidth:o,textHeight:a}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,o=0;;o++){let a=o==t.viewports.length?null:t.viewports[o],r=a?a.from-1:this.view.state.doc.length;if(r>i){let c=(t.lineBlockAt(r).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(Oe.replace({widget:new kg(c),block:!0,inclusive:!0,isBlockGap:!0}).range(i,r))}if(!a)break;i=a.to+1}return Oe.set(e)}updateDeco(){let e=1,t=this.view.state.facet(hf).map(a=>(this.dynamicDecorationMap[e++]=typeof a=="function")?a(this.view):a),i=!1,o=this.view.state.facet(px).map((a,r)=>{let c=typeof a=="function";return c&&(i=!0),c?a(this.view):a});for(o.length&&(this.dynamicDecorationMap[e++]=i,t.push(qe.join(o))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(OT).map(a=>typeof a=="function"?a(this.view):a)}scrollIntoView(e){var t;if(e.isSnapshot){let m=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=m.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let m of this.view.state.facet(kT))try{if(m(this.view,e.range,e))return!0}catch(g){En(this.view.state,g,"scroll handler")}let{range:i}=e,o=this.coordsAt(i.head,(t=i.assoc)!==null&&t!==void 0?t:i.empty?0:i.head>i.anchor?-1:1),a;if(!o)return;!i.empty&&(a=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(o={left:Math.min(o.left,a.left),top:Math.min(o.top,a.top),right:Math.max(o.right,a.right),bottom:Math.max(o.bottom,a.bottom)});let r=mx(this.view),c={left:o.left-r.left,top:o.top-r.top,right:o.right+r.right,bottom:o.bottom+r.bottom},{offsetWidth:d,offsetHeight:f}=this.view.scrollDOM;if(cH(this.view.scrollDOM,c,i.head<i.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,d),-d),Math.max(Math.min(e.yMargin,f),-f),this.view.textDirection==yt.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(o.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||o.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let m=this.view.docView.lineAt(i.head,1);m&&m.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=i=>i.isWidget()||i.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Uy(this.tile)}}function Uy(n,e){let t=e?.get(n);if(t!=1){t==null&&n.destroy();for(let i of n.children)Uy(i,e)}}function jH(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function MT(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=lT(t.focusNode,t.focusOffset),o=cT(t.focusNode,t.focusOffset),a=i||o;if(o&&i&&o.node!=i.node){let c=Nt.get(o.node);if(!c||c.isText()&&c.text!=o.node.nodeValue)a=o;else if(n.docView.lastCompositionAfterCursor){let d=Nt.get(i.node);!d||d.isText()&&d.text!=i.node.nodeValue||(a=o)}}if(n.docView.lastCompositionAfterCursor=a!=i,!a)return null;let r=e-a.offset;return{from:r,to:r+a.node.nodeValue.length,node:a.node}}function IH(n,e,t){let i=MT(n,t);if(!i)return null;let{node:o,from:a,to:r}=i,c=o.nodeValue;if(/[\n\r]/.test(c)||n.state.doc.sliceString(i.from,i.to)!=c)return null;let d=e.invertedDesc;return{range:new ri(d.mapPos(a),d.mapPos(r),a,r),text:o}}function BH(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let _H=class{constructor(){this.changes=[]}compareRange(e,t){Or(e,t,this.changes)}comparePoint(e,t){Or(e,t,this.changes)}boundChange(e){Or(e,e,this.changes)}};function HH(n,e,t){let i=new _H;return qe.compare(n,e,t,i),i.changes}class UH{constructor(){this.changes=[]}compareRange(e,t){Or(e,t,this.changes)}comparePoint(){}boundChange(e){Or(e,e,this.changes)}}function zH(n,e,t){let i=new UH;return qe.compare(n,e,t,i),i.changes}function FH(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function qH(n,e){let t=!1;return e&&n.iterChangedRanges((i,o)=>{i<e.to&&o>e.from&&(t=!0)}),t}class kg extends Ji{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function GH(n,e,t=1){let i=n.charCategorizer(e),o=n.doc.lineAt(e),a=e-o.from;if(o.length==0)return J.cursor(e);a==0?t=1:a==o.length&&(t=-1);let r=a,c=a;t<0?r=$t(o.text,a,!1):c=$t(o.text,a);let d=i(o.text.slice(r,c));for(;r>0;){let f=$t(o.text,r,!1);if(i(o.text.slice(f,r))!=d)break;r=f}for(;c<o.length;){let f=$t(o.text,c);if(i(o.text.slice(c,f))!=d)break;c=f}return J.range(r+o.from,c+o.from)}function KH(n,e,t,i,o){let a=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let c=n.viewState.heightOracle.textHeight,d=Math.floor((o-t.top-(n.defaultLineHeight-c)*.5)/c);a+=d*n.viewState.heightOracle.lineLength}let r=n.state.sliceDoc(t.from,t.to);return t.from+Ty(r,a,n.state.tabSize)}function zy(n,e,t){let i=n.lineBlockAt(e);if(Array.isArray(i.type)){let o;for(let a of i.type){if(a.from>e)break;if(!(a.to<e)){if(a.from<e&&a.to>e)return a;(!o||a.type==rn.Text&&(o.type!=a.type||(t<0?a.from<e:a.to>e)))&&(o=a)}}return o||i}return i}function VH(n,e,t,i){let o=zy(n,e.head,e.assoc||-1),a=!i||o.type!=rn.Text||!(n.lineWrapping||o.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>o.from?e.head-1:e.head);if(a){let r=n.dom.getBoundingClientRect(),c=n.textDirectionAt(o.from),d=n.posAtCoords({x:t==(c==yt.LTR)?r.right-1:r.left+1,y:(a.top+a.bottom)/2});if(d!=null)return J.cursor(d,t?-1:1)}return J.cursor(t?o.to:o.from,t?-1:1)}function Mw(n,e,t,i){let o=n.state.doc.lineAt(e.head),a=n.bidiSpans(o),r=n.textDirectionAt(o.from);for(let c=e,d=null;;){let f=vH(o,a,r,c,t),m=pT;if(!f){if(o.number==(t?n.state.doc.lines:1))return c;m=`
24
+ `,o=n.state.doc.line(o.number+(t?1:-1)),a=n.bidiSpans(o),f=n.visualLineSide(o,!t)}if(d){if(!d(m))return c}else{if(!i)return f;d=i(m)}c=f}}function WH(n,e,t){let i=n.state.charCategorizer(e),o=i(t);return a=>{let r=i(a);return o==kt.Space&&(o=r),o==r}}function QH(n,e,t,i){let o=e.head,a=t?1:-1;if(o==(t?n.state.doc.length:0))return J.cursor(o,e.assoc);let r=e.goalColumn,c,d=n.contentDOM.getBoundingClientRect(),f=n.coordsAtPos(o,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),m=n.documentTop;if(f)r==null&&(r=f.left-d.left),c=a<0?f.top:f.bottom;else{let C=n.viewState.lineBlockAt(o);r==null&&(r=Math.min(d.right-d.left,n.defaultCharacterWidth*(o-C.from))),c=(a<0?C.top:C.bottom)+m}let g=d.left+r,x=n.viewState.heightOracle.textHeight>>1,v=i??x;for(let C=0;;C+=x){let k=c+(v+C)*a,w=Fy(n,{x:g,y:k},!1,a);if(t?k>d.bottom:k<d.top)return J.cursor(w.pos,w.assoc);let P=n.coordsAtPos(w.pos,w.assoc),T=P?(P.top+P.bottom)/2:0;if(!P||(t?T>c:T<c))return J.cursor(w.pos,w.assoc,void 0,r)}}function pc(n,e,t){for(;;){let i=0;for(let o of n)o.between(e-1,e+1,(a,r,c)=>{if(e>a&&e<r){let d=i||t||(e-a<r-e?-1:1);e=d<0?a:r,i=d}});if(!i)return e}}function NT(n,e){let t=null;for(let i=0;i<e.ranges.length;i++){let o=e.ranges[i],a=null;if(o.empty){let r=pc(n,o.from,0);r!=o.from&&(a=J.cursor(r,-1))}else{let r=pc(n,o.from,-1),c=pc(n,o.to,1);(r!=o.from||c!=o.to)&&(a=J.range(o.from==o.anchor?r:c,o.from==o.head?r:c))}a&&(t||(t=e.ranges.slice()),t[i]=a)}return t?J.create(t,e.mainIndex):e}function wg(n,e,t){let i=pc(n.state.facet(Jc).map(o=>o(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:J.cursor(i,i<t.from?1:-1)}class Ui{constructor(e,t){this.pos=e,this.assoc=t}}function Fy(n,e,t,i){let o=n.contentDOM.getBoundingClientRect(),a=o.top+n.viewState.paddingTop,{x:r,y:c}=e,d=c-a,f;for(;;){if(d<0)return new Ui(0,1);if(d>n.viewState.docHeight)return new Ui(n.state.doc.length,-1);if(f=n.elementAtHeight(d),i==null)break;if(f.type==rn.Text){if(i<0?f.to<n.viewport.from:f.from>n.viewport.to)break;let x=n.docView.coordsAt(i<0?f.from:f.to,i>0?-1:1);if(x&&(i<0?x.top<=d+a:x.bottom>=d+a))break}let g=n.viewState.heightOracle.textHeight/2;d=i>0?f.bottom+g:f.top-g}if(n.viewport.from>=f.to||n.viewport.to<=f.from){if(t)return null;if(f.type==rn.Text){let g=KH(n,o,f,r,c);return new Ui(g,g==f.from?1:-1)}}if(f.type!=rn.Text)return d<(f.top+f.bottom)/2?new Ui(f.from,1):new Ui(f.to,-1);let m=n.docView.lineAt(f.from,2);return(!m||m.length!=f.length)&&(m=n.docView.lineAt(f.from,-2)),new YH(n,r,c,n.textDirectionAt(f.from)).scanTile(m,f.from)}class YH{constructor(e,t,i,o){this.view=e,this.x=t,this.y=i,this.baseDir=o,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:i,spans:o}=this.bidiSpansAt(e);return o[Fi.find(o,e-i.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:i,spans:o}=this.bidiSpansAt(e);return o[Fi.find(o,e-i.from,-1,t)].dir}bidiIn(e,t){let{spans:i,line:o}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+o.from<t)}scan(e,t,i=!1){let o=0,a=e.length-1,r=new Set,c=this.bidiIn(e[0],e[a]),d,f,m=-1,g=1e9,x;e:for(;o<a;){let C=a-o,k=o+a>>1;t:if(r.has(k)){let P=o+Math.floor(Math.random()*C);for(let T=0;T<C;T++){if(!r.has(P)){k=P;break t}P++,P==a&&(P=o)}break e}r.add(k);let w=t(k);if(w)for(let P=0;P<w.length;P++){let T=w[P],M=0;if(!(T.width==0&&w.length>1)){if(T.bottom<this.y)(!d||d.bottom<T.bottom)&&(d=T),M=1;else if(T.top>this.y)(!f||f.top>T.top)&&(f=T),M=-1;else{let D=T.left>this.x?this.x-T.left:T.right<this.x?this.x-T.right:0,L=Math.abs(D);L<g&&(m=k,g=L,x=T),D&&(M=D<0==(this.baseDir==yt.LTR)?-1:1)}M==-1&&(!c||this.baseDirAt(e[k],1))?a=k:M==1&&(!c||this.baseDirAt(e[k+1],-1))&&(o=k+1)}}}if(!x){let C=d&&(!f||this.y-d.bottom<f.top-this.y)?d:f;return this.y=(C.top+C.bottom)/2,this.scan(e,t,!0)}if(g&&!i){let{top:C,bottom:k}=x;if(d&&d.bottom>(C+C+k)/3)return this.y=d.bottom-1,this.scan(e,t,!0);if(f&&f.top<(C+k+k)/3)return this.y=f.top+1,this.scan(e,t,!0)}let v=(c?this.dirAt(e[m],1):this.baseDir)==yt.LTR;return{i:m,after:this.x>(x.left+x.right)/2==v}}scanText(e,t){let i=[];for(let a=0;a<e.length;a=$t(e.text,a))i.push(t+a);i.push(t+e.length);let o=this.scan(i,a=>{let r=i[a]-t,c=i[a+1]-t;return Nc(e.dom,r,c).getClientRects()});return o.after?new Ui(i[o.i+1],-1):new Ui(i[o.i],1)}scanTile(e,t){if(!e.length)return new Ui(t,1);if(e.children.length==1){let c=e.children[0];if(c.isText())return this.scanText(c,t);if(c.isComposite())return this.scanTile(c,t)}let i=[t];for(let c=0,d=t;c<e.children.length;c++)i.push(d+=e.children[c].length);let o=this.scan(i,c=>{let d=e.children[c];return d.flags&48?null:(d.dom.nodeType==1?d.dom:Nc(d.dom,0,d.length)).getClientRects()}),a=e.children[o.i],r=i[o.i];return a.isText()?this.scanText(a,r):a.isComposite()?this.scanTile(a,r):o.after?new Ui(i[o.i+1],-1):new Ui(r,1)}}const hr="￿";class $H{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(Qe.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=hr}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let o=e;;){this.findPointBefore(i,o);let a=this.text.length;this.readNode(o);let r=Nt.get(o),c=o.nextSibling;if(c==t){r?.breakAfter&&!c&&i!=this.view.contentDOM&&this.lineBreak();break}let d=Nt.get(c);(r&&d?r.breakAfter:(r?r.breakAfter:Sh(o))||Sh(c)&&(o.nodeName!="BR"||r?.isWidget())&&this.text.length>a)&&!JH(c,t)&&this.lineBreak(),o=c}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,o=this.lineSeparator?null:/\r\n?|\n/g;;){let a=-1,r=1,c;if(this.lineSeparator?(a=t.indexOf(this.lineSeparator,i),r=this.lineSeparator.length):(c=o.exec(t))&&(a=c.index,r=c[0].length),this.append(t.slice(i,a<0?t.length:a)),a<0)break;if(this.lineBreak(),r>1)for(let d of this.points)d.node==e&&d.pos>this.text.length&&(d.pos-=r-1);i=a+r}}readNode(e){let t=Nt.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let o=i.iter();!o.next().done;)o.lineBreak?this.lineBreak():this.append(o.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(XH(e,i.node,i.offset)?t:0))}}function XH(n,e,t){for(;;){if(!e||t<Lo(e))return!1;if(e==n)return!0;t=vs(e)+1,e=e.parentNode}}function JH(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let i=Nt.get(n);if(!i?.isWidget())return!1;i&&(t||(t=[])).push(i)}if(t)for(let i of t){let o=i.overrideDOMText;if(o?.length)return!1}return!0}class Nw{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class ZH{constructor(e,t,i,o){this.typeOver=o,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:a,impreciseAnchor:r}=e.docView,c=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=LT(e.docView.tile,t,i,0))){let d=a||r?[]:tU(e),f=new $H(d,e);f.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=f.text,this.newSel=nU(d,this.bounds.from)}else{let d=e.observer.selectionRange,f=a&&a.node==d.focusNode&&a.offset==d.focusOffset||!jy(e.contentDOM,d.focusNode)?c.main.head:e.docView.posFromDOM(d.focusNode,d.focusOffset),m=r&&r.node==d.anchorNode&&r.offset==d.anchorOffset||!jy(e.contentDOM,d.anchorNode)?c.main.anchor:e.docView.posFromDOM(d.anchorNode,d.anchorOffset),g=e.viewport;if((me.ios||me.chrome)&&c.main.empty&&f!=m&&(g.from>0||g.to<e.state.doc.length)){let x=Math.min(f,m),v=Math.max(f,m),C=g.from-x,k=g.to-v;(C==0||C==1||x==0)&&(k==0||k==-1||v==e.state.doc.length)&&(f=0,m=e.state.doc.length)}if(e.inputState.composing>-1&&c.ranges.length>1)this.newSel=c.replaceRange(J.range(m,f));else if(e.lineWrapping&&m==f&&!(c.main.empty&&c.main.head==f)&&e.inputState.lastTouchTime>Date.now()-100){let x=e.coordsAtPos(f,-1),v=0;x&&(v=e.inputState.lastTouchY<=x.bottom?-1:1),this.newSel=J.create([J.cursor(f,v)])}else this.newSel=J.single(m,f)}}}function LT(n,e,t,i){if(n.isComposite()){let o=-1,a=-1,r=-1,c=-1;for(let d=0,f=i,m=i;d<n.children.length;d++){let g=n.children[d],x=f+g.length;if(f<e&&x>t)return LT(g,e,t,f);if(x>=e&&o==-1&&(o=d,a=f),f>t&&g.dom.parentNode==n.dom){r=d,c=m;break}m=x,f=x+g.breakAfter}return{from:a,to:c<0?i+n.length:c,startDOM:(o?n.children[o-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:r<n.children.length&&r>=0?n.children[r].dom:null}}else return n.isText()?{from:i,to:i+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function RT(n,e){let t,{newSel:i}=e,{state:o}=n,a=o.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:c,to:d}=e.bounds,f=a.from,m=null;(r===8||me.android&&e.text.length<d-c)&&(f=a.to,m="end");let g=o.doc.sliceString(c,d,hr),x,v;!a.empty&&a.from>=c&&a.to<=d&&(e.typeOver||g!=e.text)&&g.slice(0,a.from-c)==e.text.slice(0,a.from-c)&&g.slice(a.to-c)==e.text.slice(x=e.text.length-(g.length-(a.to-c)))?t={from:a.from,to:a.to,insert:Je.of(e.text.slice(a.from-c,x).split(hr))}:(v=ET(g,e.text,f-c,m))&&(me.chrome&&r==13&&v.toB==v.from+2&&e.text.slice(v.from,v.toB)==hr+hr&&v.toB--,t={from:c+v.from,to:c+v.toA,insert:Je.of(e.text.slice(v.from,v.toB).split(hr))})}else i&&(!n.hasFocus&&o.facet(ko)||Oh(i,a))&&(i=null);if(!t&&!i)return!1;if((me.mac||me.android)&&t&&t.from==t.to&&t.from==a.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=J.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:Je.of([t.insert.toString().replace("."," ")])}):o.doc.lineAt(a.from).to<a.to&&n.docView.lineHasWidget(a.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:a.from,to:a.to,insert:o.toText(n.inputState.insertingText)}:me.chrome&&t&&t.from==t.to&&t.from==a.head&&t.insert.toString()==`
25
+ `&&n.lineWrapping&&(i&&(i=J.single(i.main.anchor-1,i.main.head-1)),t={from:a.from,to:a.to,insert:Je.of([" "])}),t)return gx(n,t,i,r);if(i&&!Oh(i,a)){let c=!1,d="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(c=!0),d=n.inputState.lastSelectionOrigin,d=="select.pointer"&&(i=NT(o.facet(Jc).map(f=>f(n)),i))),n.dispatch({selection:i,scrollIntoView:c,userEvent:d}),!0}else return!1}function gx(n,e,t,i=-1){if(me.ios&&n.inputState.flushIOSKey(e))return!0;let o=n.state.selection.main;if(me.android&&(e.to==o.to&&(e.from==o.from||e.from==o.from-1&&n.state.sliceDoc(e.from,o.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Pr(n.contentDOM,"Enter",13)||(e.from==o.from-1&&e.to==o.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>o.head)&&Pr(n.contentDOM,"Backspace",8)||e.from==o.from&&e.to==o.to+1&&e.insert.length==0&&Pr(n.contentDOM,"Delete",46)))return!0;let a=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let r,c=()=>r||(r=eU(n,e,t));return n.state.facet(xT).some(d=>d(n,e.from,e.to,a,c))||n.dispatch(c()),!0}function eU(n,e,t){let i,o=n.state,a=o.selection.main,r=-1;if(e.from==e.to&&e.from<a.from||e.from>a.to){let d=e.from<a.from?-1:1,f=d<0?a.from:a.to,m=pc(o.facet(Jc).map(g=>g(n)),f,d);e.from==m&&(r=m)}if(r>-1)i={changes:e,selection:J.cursor(e.from+e.insert.length,-1)};else if(e.from>=a.from&&e.to<=a.to&&e.to-e.from>=(a.to-a.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let d=a.from<e.from?o.sliceDoc(a.from,e.from):"",f=a.to>e.to?o.sliceDoc(e.to,a.to):"";i=o.replaceSelection(n.state.toText(d+e.insert.sliceString(0,void 0,n.state.lineBreak)+f))}else{let d=o.changes(e),f=t&&t.main.to<=d.newLength?t.main:void 0;if(o.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=a.to+10&&e.to>=a.to-10){let m=n.state.sliceDoc(e.from,e.to),g,x=t&&MT(n,t.main.head);if(x){let C=e.insert.length-(e.to-e.from);g={from:x.from,to:x.to-C}}else g=n.state.doc.lineAt(a.head);let v=a.to-e.to;i=o.changeByRange(C=>{if(C.from==a.from&&C.to==a.to)return{changes:d,range:f||C.map(d)};let k=C.to-v,w=k-m.length;if(n.state.sliceDoc(w,k)!=m||k>=g.from&&w<=g.to)return{range:C};let P=o.changes({from:w,to:k,insert:e.insert}),T=C.to-a.to;return{changes:P,range:f?J.range(Math.max(0,f.anchor+T),Math.max(0,f.head+T)):C.map(P)}})}else i={changes:d,selection:f&&o.selection.replaceRange(f)}}let c="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,c+=".compose",n.inputState.compositionFirstChange&&(c+=".start",n.inputState.compositionFirstChange=!1)),o.update(i,{userEvent:c,scrollIntoView:!0})}function ET(n,e,t,i){let o=Math.min(n.length,e.length),a=0;for(;a<o&&n.charCodeAt(a)==e.charCodeAt(a);)a++;if(a==o&&n.length==e.length)return null;let r=n.length,c=e.length;for(;r>0&&c>0&&n.charCodeAt(r-1)==e.charCodeAt(c-1);)r--,c--;if(i=="end"){let d=Math.max(0,a-Math.min(r,c));t-=r+d-a}if(r<a&&n.length<e.length){let d=t<=a&&t>=r?a-t:0;a-=d,c=a+(c-r),r=a}else if(c<a){let d=t<=a&&t>=c?a-t:0;a-=d,r=a+(r-c),c=a}return{from:a,toA:r,toB:c}}function tU(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:o,focusOffset:a}=n.observer.selectionRange;return t&&(e.push(new Nw(t,i)),(o!=t||a!=i)&&e.push(new Nw(o,a))),e}function nU(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?J.single(t+e,i+e):null}function Oh(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}class iU{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,me.safari&&e.contentDOM.addEventListener("input",()=>null),me.gecko&&bU(e.contentDOM.ownerDocument)}handleEvent(e){!dU(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let o of i.observers)o(this.view,t);for(let o of i.handlers){if(t.defaultPrevented)break;if(o(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=oU(e),i=this.handlers,o=this.view.contentDOM;for(let a in t)if(a!="scroll"){let r=!t[a].handlers.length,c=i[a];c&&r!=!c.handlers.length&&(o.removeEventListener(a,this.handleEvent),c=null),c||o.addEventListener(a,this.handleEvent,{passive:r})}for(let a in i)a!="scroll"&&!t[a]&&o.removeEventListener(a,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&IT.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),me.android&&me.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return me.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=jT.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||sU.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Pr(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:me.safari&&!me.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Lw(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(o){En(t.state,o)}}}function oU(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let o=i.spec,a=o&&o.plugin.domEventHandlers,r=o&&o.plugin.domEventObservers;if(a)for(let c in a){let d=a[c];d&&t(c).handlers.push(Lw(i.value,d))}if(r)for(let c in r){let d=r[c];d&&t(c).observers.push(Lw(i.value,d))}}for(let i in wi)t(i).handlers.push(wi[i]);for(let i in In)t(i).observers.push(In[i]);return e}const jT=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],sU="dthko",IT=[16,17,18,20,91,92,224,225],Nd=6;function Ld(n){return Math.max(0,n)*.7+8}function aU(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class rU{constructor(e,t,i,o){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=o,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=sT(e.contentDOM),this.atoms=e.state.facet(Jc).map(r=>r(e));let a=e.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Qe.allowMultipleSelections)&&lU(e,t),this.dragging=uU(e,t)&&HT(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&aU(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,o=0,a=0,r=this.view.win.innerWidth,c=this.view.win.innerHeight;this.scrollParents.x&&({left:o,right:r}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:c}=this.scrollParents.y.getBoundingClientRect());let d=mx(this.view);e.clientX-d.left<=o+Nd?t=-Ld(o-e.clientX):e.clientX+d.right>=r-Nd&&(t=Ld(e.clientX-r)),e.clientY-d.top<=a+Nd?i=-Ld(a-e.clientY):e.clientY+d.bottom>=c-Nd&&(i=Ld(e.clientY-c)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,i=NT(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function lU(n,e){let t=n.state.facet(mT);return t.length?t[0](e):me.mac?e.metaKey:e.ctrlKey}function cU(n,e){let t=n.state.facet(gT);return t.length?t[0](e):me.mac?!e.altKey:!e.ctrlKey}function uU(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Dc(n.root);if(!i||i.rangeCount==0)return!0;let o=i.getRangeAt(0).getClientRects();for(let a=0;a<o.length;a++){let r=o[a];if(r.left<=e.clientX&&r.right>=e.clientX&&r.top<=e.clientY&&r.bottom>=e.clientY)return!0}return!1}function dU(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=Nt.get(t))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const wi=Object.create(null),In=Object.create(null),BT=me.ie&&me.ie_version<15||me.ios&&me.webkit_version<604;function hU(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),_T(n,t.value)},50)}function mf(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function _T(n,e){e=mf(n.state,dx,e);let{state:t}=n,i,o=1,a=t.toText(e),r=a.lines==t.selection.ranges.length;if(qy!=null&&t.selection.ranges.every(d=>d.empty)&&qy==a.toString()){let d=-1;i=t.changeByRange(f=>{let m=t.doc.lineAt(f.from);if(m.from==d)return{range:f};d=m.from;let g=t.toText((r?a.line(o++).text:e)+t.lineBreak);return{changes:{from:m.from,insert:g},range:J.cursor(f.from+g.length)}})}else r?i=t.changeByRange(d=>{let f=a.line(o++);return{changes:{from:d.from,to:d.to,insert:f.text},range:J.cursor(d.from+f.length)}}):i=t.replaceSelection(a);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}In.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};In.wheel=In.mousewheel=n=>{n.inputState.lastWheelEvent=Date.now()};wi.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);In.touchstart=(n,e)=>{let t=n.inputState,i=e.targetTouches[0];t.lastTouchTime=Date.now(),i&&(t.lastTouchX=i.clientX,t.lastTouchY=i.clientY),t.setSelectionOrigin("select.pointer")};In.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};wi.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(yT))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=pU(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new rU(n,e,t,i)),i&&n.observer.ignore(()=>{aT(n.contentDOM);let a=n.root.activeElement;a&&!a.contains(n.contentDOM)&&a.blur()});let o=n.inputState.mouseSelection;if(o)return o.start(e),o.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function Rw(n,e,t,i){if(i==1)return J.cursor(e,t);if(i==2)return GH(n.state,e,t);{let o=n.docView.lineAt(e,t),a=n.state.doc.lineAt(o?o.posAtEnd:e),r=o?o.posAtStart:a.from,c=o?o.posAtEnd:a.to;return c<n.state.doc.length&&c==a.to&&c++,J.range(r,c)}}const fU=me.ie&&me.ie_version<=11;let Ew=null,jw=0,Iw=0;function HT(n){if(!fU)return n.detail;let e=Ew,t=Iw;return Ew=n,Iw=Date.now(),jw=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(jw+1)%3:1}function pU(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=HT(e),o=n.state.selection;return{update(a){a.docChanged&&(t.pos=a.changes.mapPos(t.pos),o=o.map(a.changes))},get(a,r,c){let d=n.posAndSideAtCoords({x:a.clientX,y:a.clientY},!1),f,m=Rw(n,d.pos,d.assoc,i);if(t.pos!=d.pos&&!r){let g=Rw(n,t.pos,t.assoc,i),x=Math.min(g.from,m.from),v=Math.max(g.to,m.to);m=x<m.from?J.range(x,v,m.assoc):J.range(v,x,m.assoc)}return r?o.replaceRange(o.main.extend(m.from,m.to,m.assoc)):c&&i==1&&o.ranges.length>1&&(f=mU(o,d.pos))?f:c?o.addRange(m):J.create([m])}}}function mU(n,e){for(let t=0;t<n.ranges.length;t++){let{from:i,to:o}=n.ranges[t];if(i<=e&&o>=e)return J.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}wi.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let o=n.docView.tile.nearest(e.target);if(o&&o.isWidget()){let a=o.posAtStart,r=a+o.length;(a>=t.to||r<=t.from)&&(t=J.range(a,r))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",mf(n.state,hx,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};wi.dragend=n=>(n.inputState.draggedContent=null,!1);function Bw(n,e,t,i){if(t=mf(n.state,dx,t),!t)return;let o=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:a}=n.inputState,r=i&&a&&cU(n,e)?{from:a.from,to:a.to}:null,c={from:o,insert:t},d=n.state.changes(r?[r,c]:c);n.focus(),n.dispatch({changes:d,selection:{anchor:d.mapPos(o,-1),head:d.mapPos(o,1)},userEvent:r?"move.drop":"input.drop"}),n.inputState.draggedContent=null}wi.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),o=0,a=()=>{++o==t.length&&Bw(n,e,i.filter(r=>r!=null).join(n.state.lineBreak),!1)};for(let r=0;r<t.length;r++){let c=new FileReader;c.onerror=a,c.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(c.result)||(i[r]=c.result),a()},c.readAsText(t[r])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return Bw(n,e,i,!0),!0}return!1};wi.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=BT?null:e.clipboardData;return t?(_T(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(hU(n),!1)};function gU(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function yU(n){let e=[],t=[],i=!1;for(let o of n.selection.ranges)o.empty||(e.push(n.sliceDoc(o.from,o.to)),t.push(o));if(!e.length){let o=-1;for(let{from:a}of n.selection.ranges){let r=n.doc.lineAt(a);r.number>o&&(e.push(r.text),t.push({from:r.from,to:Math.min(n.doc.length,r.to+1)})),o=r.number}i=!0}return{text:mf(n,hx,e.join(n.lineBreak)),ranges:t,linewise:i}}let qy=null;wi.copy=wi.cut=(n,e)=>{if(!dc(n.contentDOM,n.observer.selectionRange))return!1;let{text:t,ranges:i,linewise:o}=yU(n.state);if(!t&&!o)return!1;qy=o?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let a=BT?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",t),!0):(gU(n,t),!1)};const UT=$i.define();function zT(n,e){let t=[];for(let i of n.facet(vT)){let o=i(n,e);o&&t.push(o)}return t.length?n.update({effects:t,annotations:UT.of(!0)}):null}function FT(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=zT(n.state,e);t?n.dispatch(t):n.update([])}},10)}In.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),FT(n)};In.blur=n=>{n.observer.clearSelectionRange(),FT(n)};In.compositionstart=In.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};In.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,me.chrome&&me.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};In.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};wi.beforeinput=(n,e)=>{var t,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let a=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),r=e.getTargetRanges();if(a&&r.length){let c=r[0],d=n.posAtDOM(c.startContainer,c.startOffset),f=n.posAtDOM(c.endContainer,c.endOffset);return gx(n,{from:d,to:f,insert:n.state.toText(a)},null),!0}}let o;if(me.chrome&&me.android&&(o=jT.find(a=>a.inputType==e.inputType))&&(n.observer.delayAndroidKey(o.key,o.keyCode),o.key=="Backspace"||o.key=="Delete")){let a=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>a+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return me.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),me.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>In.compositionend(n,e),20),!1};const _w=new Set;function bU(n){_w.has(n)||(_w.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const Hw=["pre-wrap","normal","pre-line","break-spaces"];let _r=!1;function Uw(){_r=!1}class xU{constructor(e){this.lineWrapping=e,this.doc=Je.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Hw.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let o=e[i];o<0?i++:this.heightSamples[Math.floor(o*10)]||(t=!0,this.heightSamples[Math.floor(o*10)]=!0)}return t}refresh(e,t,i,o,a,r){let c=Hw.indexOf(e)>-1,d=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=c;if(this.lineWrapping=c,this.lineHeight=t,this.charWidth=i,this.textHeight=o,this.lineLength=a,d){this.heightSamples={};for(let f=0;f<r.length;f++){let m=r[f];m<0?f++:this.heightSamples[Math.floor(m*10)]=!0}}return d}}class vU{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class vi{constructor(e,t,i,o,a){this.from=e,this.length=t,this.top=i,this.height=o,this._content=a}get type(){return typeof this._content=="number"?rn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof ga?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new vi(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var xt=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(xt||(xt={}));const ih=.001;class vn{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ih&&(_r=!0),this.height=e)}replace(e,t,i){return vn.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,o){let a=this,r=i.doc;for(let c=o.length-1;c>=0;c--){let{fromA:d,toA:f,fromB:m,toB:g}=o[c],x=a.lineAt(d,xt.ByPosNoHeight,i.setDoc(t),0,0),v=x.to>=f?x:a.lineAt(f,xt.ByPosNoHeight,i,0,0);for(g+=v.to-f,f=v.to;c>0&&x.from<=o[c-1].toA;)d=o[c-1].fromA,m=o[c-1].fromB,c--,d<x.from&&(x=a.lineAt(d,xt.ByPosNoHeight,i,0,0));m+=x.from-d,d=x.from;let C=yx.build(i.setDoc(r),e,m,g);a=Ph(a,a.replace(d,f,C))}return a.updateHeight(i,0)}static empty(){return new Wn(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,o=0,a=0;for(;;)if(t==i)if(o>a*2){let c=e[t-1];c.break?e.splice(--t,1,c.left,null,c.right):e.splice(--t,1,c.left,c.right),i+=1+c.break,o-=c.size}else if(a>o*2){let c=e[i];c.break?e.splice(i,1,c.left,null,c.right):e.splice(i,1,c.left,c.right),i+=2+c.break,a-=c.size}else break;else if(o<a){let c=e[t++];c&&(o+=c.size)}else{let c=e[--i];c&&(a+=c.size)}let r=0;return e[t-1]==null?(r=1,t--):e[t]==null&&(r=1,i++),new SU(vn.of(e.slice(0,t)),r,vn.of(e.slice(i)))}}function Ph(n,e){return n==e?n:(n.constructor!=e.constructor&&(_r=!0),e)}vn.prototype.size=1;const CU=Oe.replace({});class qT extends vn{constructor(e,t,i){super(e,t),this.deco=i,this.spaceAbove=0}mainBlock(e,t){return new vi(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,i,o){return this.spaceAbove&&e<i+this.spaceAbove?new vi(o,0,i,this.spaceAbove,CU):this.mainBlock(i,o)}lineAt(e,t,i,o,a){let r=this.mainBlock(o,a);return this.spaceAbove?this.blockAt(0,i,o,a).join(r):r}forEachLine(e,t,i,o,a,r){e<=a+this.length&&t>=a&&r(this.lineAt(0,xt.ByPos,i,o,a))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,i=!1,o){return o&&o.from<=t&&o.more&&this.setMeasuredHeight(o),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Wn extends qT{constructor(e,t,i){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,t){return new vi(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let o=i[0];return i.length==1&&(o instanceof Wn||o instanceof on&&o.flags&4)&&Math.abs(this.length-o.length)<10?(o instanceof on?o=new Wn(o.length,this.height,this.spaceAbove):o.height=this.height,this.outdated||(o.outdated=!1),o):vn.of(i)}updateHeight(e,t=0,i=!1,o){return o&&o.from<=t&&o.more?this.setMeasuredHeight(o):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class on extends vn{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,o=e.doc.lineAt(t+this.length).number,a=o-i+1,r,c=0;if(e.lineWrapping){let d=Math.min(this.height,e.lineHeight*a);r=d/a,this.length>a+1&&(c=(this.height-d)/(this.length-a-1))}else r=this.height/a;return{firstLine:i,lastLine:o,perLine:r,perChar:c}}blockAt(e,t,i,o){let{firstLine:a,lastLine:r,perLine:c,perChar:d}=this.heightMetrics(t,o);if(t.lineWrapping){let f=o+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),m=t.doc.lineAt(f),g=c+m.length*d,x=Math.max(i,e-g/2);return new vi(m.from,m.length,x,g,0)}else{let f=Math.max(0,Math.min(r-a,Math.floor((e-i)/c))),{from:m,length:g}=t.doc.line(a+f);return new vi(m,g,i+c*f,c,0)}}lineAt(e,t,i,o,a){if(t==xt.ByHeight)return this.blockAt(e,i,o,a);if(t==xt.ByPosNoHeight){let{from:v,to:C}=i.doc.lineAt(e);return new vi(v,C-v,0,0,0)}let{firstLine:r,perLine:c,perChar:d}=this.heightMetrics(i,a),f=i.doc.lineAt(e),m=c+f.length*d,g=f.number-r,x=o+c*g+d*(f.from-a-g);return new vi(f.from,f.length,Math.max(o,Math.min(x,o+this.height-m)),m,0)}forEachLine(e,t,i,o,a,r){e=Math.max(e,a),t=Math.min(t,a+this.length);let{firstLine:c,perLine:d,perChar:f}=this.heightMetrics(i,a);for(let m=e,g=o;m<=t;){let x=i.doc.lineAt(m);if(m==e){let C=x.number-c;g+=d*C+f*(e-a-C)}let v=d+f*x.length;r(new vi(x.from,x.length,g,v,0)),g+=v,m=x.to+1}}replace(e,t,i){let o=this.length-t;if(o>0){let a=i[i.length-1];a instanceof on?i[i.length-1]=new on(a.length+o):i.push(null,new on(o-1))}if(e>0){let a=i[0];a instanceof on?i[0]=new on(e+a.length):i.unshift(new on(e-1),null)}return vn.of(i)}decomposeLeft(e,t){t.push(new on(e-1),null)}decomposeRight(e,t){t.push(null,new on(this.length-e-1))}updateHeight(e,t=0,i=!1,o){let a=t+this.length;if(o&&o.from<=t+this.length&&o.more){let r=[],c=Math.max(t,o.from),d=-1;for(o.from>t&&r.push(new on(o.from-t-1).updateHeight(e,t));c<=a&&o.more;){let m=e.doc.lineAt(c).length;r.length&&r.push(null);let g=o.heights[o.index++],x=0;g<0&&(x=-g,g=o.heights[o.index++]),d==-1?d=g:Math.abs(g-d)>=ih&&(d=-2);let v=new Wn(m,g,x);v.outdated=!1,r.push(v),c+=m+1}c<=a&&r.push(null,new on(a-c).updateHeight(e,c));let f=vn.of(r);return(d<0||Math.abs(f.height-this.height)>=ih||Math.abs(d-this.heightMetrics(e,t).perLine)>=ih)&&(_r=!0),Ph(this,f)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class SU extends vn{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,o){let a=i+this.left.height;return e<a?this.left.blockAt(e,t,i,o):this.right.blockAt(e,t,a,o+this.left.length+this.break)}lineAt(e,t,i,o,a){let r=o+this.left.height,c=a+this.left.length+this.break,d=t==xt.ByHeight?e<r:e<c,f=d?this.left.lineAt(e,t,i,o,a):this.right.lineAt(e,t,i,r,c);if(this.break||(d?f.to<c:f.from>c))return f;let m=t==xt.ByPosNoHeight?xt.ByPosNoHeight:xt.ByPos;return d?f.join(this.right.lineAt(c,m,i,r,c)):this.left.lineAt(c,m,i,o,a).join(f)}forEachLine(e,t,i,o,a,r){let c=o+this.left.height,d=a+this.left.length+this.break;if(this.break)e<d&&this.left.forEachLine(e,t,i,o,a,r),t>=d&&this.right.forEachLine(e,t,i,c,d,r);else{let f=this.lineAt(d,xt.ByPos,i,o,a);e<f.from&&this.left.forEachLine(e,f.from-1,i,o,a,r),f.to>=e&&f.from<=t&&r(f),t>f.to&&this.right.forEachLine(f.to+1,t,i,c,d,r)}}replace(e,t,i){let o=this.left.length+this.break;if(t<o)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-o,t-o,i));let a=[];e>0&&this.decomposeLeft(e,a);let r=a.length;for(let c of i)a.push(c);if(e>0&&zw(a,r-1),t<this.length){let c=a.length;this.decomposeRight(t,a),zw(a,c)}return vn.of(a)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,o=i+this.break;if(e>=o)return this.right.decomposeRight(e-o,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<o&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?vn.of(this.break?[e,null,t]:[e,t]):(this.left=Ph(this.left,e),this.right=Ph(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,o){let{left:a,right:r}=this,c=t+a.length+this.break,d=null;return o&&o.from<=t+a.length&&o.more?d=a=a.updateHeight(e,t,i,o):a.updateHeight(e,t,i),o&&o.from<=c+r.length&&o.more?d=r=r.updateHeight(e,c,i,o):r.updateHeight(e,c,i),d?this.balanced(a,r):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function zw(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof on&&(i=n[e+1])instanceof on&&n.splice(e-1,3,new on(t.length+1+i.length))}const kU=5;class yx{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),o=this.nodes[this.nodes.length-1];o instanceof Wn?o.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Wn(i-this.pos,-1,0)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let o=i.widget?i.widget.estimatedHeight:0,a=i.widget?i.widget.lineBreaks:0;o<0&&(o=this.oracle.lineHeight);let r=t-e;i.block?this.addBlock(new qT(r,o,i)):(r||a||o>=kU)&&this.addLineDeco(o,a,r)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Wn(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new on(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Wn)return e;let t=new Wn(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let o=this.ensureLine();o.length+=i,o.collapsed+=i,o.widgetHeight=Math.max(o.widgetHeight,e),o.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Wn)&&!this.isCovered?this.nodes.push(new Wn(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let o of this.nodes)o instanceof Wn&&o.updateHeight(this.oracle,i),i+=o?o.length:1;return this.nodes}static build(e,t,i,o){let a=new yx(i,e);return qe.spans(t,i,o,a,0),a.finish(i)}}function wU(n,e,t){let i=new AU;return qe.compare(n,e,t,i,0),i.changes}class AU{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,o){(e<t||i&&i.heightRelevant||o&&o.heightRelevant)&&Or(e,t,this.changes,5)}}function OU(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,o=i.defaultView||window,a=Math.max(0,t.left),r=Math.min(o.innerWidth,t.right),c=Math.max(0,t.top),d=Math.min(o.innerHeight,t.bottom);for(let f=n.parentNode;f&&f!=i.body;)if(f.nodeType==1){let m=f,g=window.getComputedStyle(m);if((m.scrollHeight>m.clientHeight||m.scrollWidth>m.clientWidth)&&g.overflow!="visible"){let x=m.getBoundingClientRect();a=Math.max(a,x.left),r=Math.min(r,x.right),c=Math.max(c,x.top),d=Math.min(f==n.parentNode?o.innerHeight:d,x.bottom)}f=g.position=="absolute"||g.position=="fixed"?m.offsetParent:m.parentNode}else if(f.nodeType==11)f=f.host;else break;return{left:a-t.left,right:Math.max(a,r)-t.left,top:c-(t.top+e),bottom:Math.max(c,d)-(t.top+e)}}function PU(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function TU(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Ag{constructor(e,t,i,o){this.from=e,this.to=t,this.size=i,this.displaySize=o}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let o=e[i],a=t[i];if(o.from!=a.from||o.to!=a.to||o.size!=a.size)return!1}return!0}draw(e,t){return Oe.replace({widget:new DU(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class DU extends Ji{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Fw{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=qw,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=yt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=t.facet(fx).some(o=>typeof o!="function"&&o.class=="cm-lineWrapping");this.heightOracle=new xU(i),this.stateDeco=Gw(t),this.heightMap=vn.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle.setDoc(t.doc),[new ri(0,0,0,t.doc.length)]);for(let o=0;o<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());o++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Oe.set(this.lineGaps.map(o=>o.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let o=i?t.head:t.anchor;if(!e.some(({from:a,to:r})=>o>=a&&o<=r)){let{from:a,to:r}=this.lineBlockAt(o);e.push(new Rd(a,r))}}return this.viewports=e.sort((i,o)=>i.from-o.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?qw:new bx(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(tc(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=Gw(this.state);let o=e.changedRanges,a=ri.extendWithRanges(o,wU(i,this.stateDeco,e?e.changes:qt.empty(this.state.doc.length))),r=this.heightMap.height,c=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Uw(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=r||_r)&&(e.flags|=2),c?(this.scrollAnchorPos=e.changes.mapPos(c.from,-1),this.scrollAnchorHeight=c.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=r);let d=a.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<d.from||t.range.head>d.to)||!this.viewportIsAppropriate(d))&&(d=this.getViewport(0,t));let f=d.from!=this.viewport.from||d.to!=this.viewport.to;this.viewport=d,e.flags|=this.updateForViewport(),(f||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(ST)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,i=window.getComputedStyle(t),o=this.heightOracle,a=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?yt.RTL:yt.LTR;let r=this.heightOracle.mustRefreshForWrapping(a)||this.mustMeasureContent==="refresh",c=t.getBoundingClientRect(),d=r||this.mustMeasureContent||this.contentDOMHeight!=c.height;this.contentDOMHeight=c.height,this.mustMeasureContent=!1;let f=0,m=0;if(c.width&&c.height){let{scaleX:L,scaleY:N}=oT(t,c);(L>.005&&Math.abs(this.scaleX-L)>.005||N>.005&&Math.abs(this.scaleY-N)>.005)&&(this.scaleX=L,this.scaleY=N,f|=16,r=d=!0)}let g=(parseInt(i.paddingTop)||0)*this.scaleY,x=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=g||this.paddingBottom!=x)&&(this.paddingTop=g,this.paddingBottom=x,f|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(o.lineWrapping&&(d=!0),this.editorWidth=e.scrollDOM.clientWidth,f|=16);let v=sT(this.view.contentDOM,!1).y;v!=this.scrollParent&&(this.scrollParent=v,this.scrollAnchorHeight=-1,this.scrollOffset=0);let C=this.getScrollOffset();this.scrollOffset!=C&&(this.scrollAnchorHeight=-1,this.scrollOffset=C),this.scrolledToBottom=rT(this.scrollParent||e.win);let k=(this.printing?TU:OU)(t,this.paddingTop),w=k.top-this.pixelViewport.top,P=k.bottom-this.pixelViewport.bottom;this.pixelViewport=k;let T=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(T!=this.inView&&(this.inView=T,T&&(d=!0)),!this.inView&&!this.scrollTarget&&!PU(e.dom))return 0;let M=c.width;if((this.contentDOMWidth!=M||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=c.width,this.editorHeight=e.scrollDOM.clientHeight,f|=16),d){let L=e.docView.measureVisibleLineHeights(this.viewport);if(o.mustRefreshForHeights(L)&&(r=!0),r||o.lineWrapping&&Math.abs(M-this.contentDOMWidth)>o.charWidth){let{lineHeight:N,charWidth:j,textHeight:K}=e.docView.measureTextSize();r=N>0&&o.refresh(a,N,j,K,Math.max(5,M/j),L),r&&(e.docView.minWidth=0,f|=16)}w>0&&P>0?m=Math.max(w,P):w<0&&P<0&&(m=Math.min(w,P)),Uw();for(let N of this.viewports){let j=N.from==this.viewport.from?L:e.docView.measureVisibleLineHeights(N);this.heightMap=(r?vn.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle,[new ri(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(o,0,r,new vU(N.from,j))}_r&&(f|=2)}let D=!this.viewportIsAppropriate(this.viewport,m)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return D&&(f&2&&(f|=this.updateScaler()),this.viewport=this.getViewport(m,this.scrollTarget),f|=this.updateForViewport()),(f&2||D)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(r?[]:this.lineGaps,e)),f|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),f}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),o=this.heightMap,a=this.heightOracle,{visibleTop:r,visibleBottom:c}=this,d=new Rd(o.lineAt(r-i*1e3,xt.ByHeight,a,0,0).from,o.lineAt(c+(1-i)*1e3,xt.ByHeight,a,0,0).to);if(t){let{head:f}=t.range;if(f<d.from||f>d.to){let m=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),g=o.lineAt(f,xt.ByPos,a,0,0),x;t.y=="center"?x=(g.top+g.bottom)/2-m/2:t.y=="start"||t.y=="nearest"&&f<d.from?x=g.top:x=g.bottom-m,d=new Rd(o.lineAt(x-1e3/2,xt.ByHeight,a,0,0).from,o.lineAt(x+m+1e3/2,xt.ByHeight,a,0,0).to)}}return d}mapViewport(e,t){let i=t.mapPos(e.from,-1),o=t.mapPos(e.to,1);return new Rd(this.heightMap.lineAt(i,xt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(o,xt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:o}=this.heightMap.lineAt(e,xt.ByPos,this.heightOracle,0,0),{bottom:a}=this.heightMap.lineAt(t,xt.ByPos,this.heightOracle,0,0),{visibleTop:r,visibleBottom:c}=this;return(e==0||o<=r-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||a>=c+Math.max(10,Math.min(i,250)))&&o>r-2*1e3&&a<c+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let o of e)t.touchesRange(o.from,o.to)||i.push(new Ag(t.mapPos(o.from),t.mapPos(o.to),o.size,o.displaySize));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,o=i?1e4:2e3,a=o>>1,r=o<<1;if(this.defaultTextDirection!=yt.LTR&&!i)return[];let c=[],d=(m,g,x,v)=>{if(g-m<a)return;let C=this.state.selection.main,k=[C.from];C.empty||k.push(C.to);for(let P of k)if(P>m&&P<g){d(m,P-10,x,v),d(P+10,g,x,v);return}let w=NU(e,P=>P.from>=x.from&&P.to<=x.to&&Math.abs(P.from-m)<a&&Math.abs(P.to-g)<a&&!k.some(T=>P.from<T&&P.to>T));if(!w){if(g<x.to&&t&&i&&t.visibleRanges.some(M=>M.from<=g&&M.to>=g)){let M=t.moveToLineBoundary(J.cursor(g),!1,!0).head;M>m&&(g=M)}let P=this.gapSize(x,m,g,v),T=i||P<2e6?P:2e6;w=new Ag(m,g,P,T)}c.push(w)},f=m=>{if(m.length<r||m.type!=rn.Text)return;let g=MU(m.from,m.to,this.stateDeco);if(g.total<r)return;let x=this.scrollTarget?this.scrollTarget.range.head:null,v,C;if(i){let k=o/this.heightOracle.lineLength*this.heightOracle.lineHeight,w,P;if(x!=null){let T=jd(g,x),M=((this.visibleBottom-this.visibleTop)/2+k)/m.height;w=T-M,P=T+M}else w=(this.visibleTop-m.top-k)/m.height,P=(this.visibleBottom-m.top+k)/m.height;v=Ed(g,w),C=Ed(g,P)}else{let k=g.total*this.heightOracle.charWidth,w=o*this.heightOracle.charWidth,P=0;if(k>2e6)for(let N of e)N.from>=m.from&&N.from<m.to&&N.size!=N.displaySize&&N.from*this.heightOracle.charWidth+P<this.pixelViewport.left&&(P=N.size-N.displaySize);let T=this.pixelViewport.left+P,M=this.pixelViewport.right+P,D,L;if(x!=null){let N=jd(g,x),j=((M-T)/2+w)/k;D=N-j,L=N+j}else D=(T-w)/k,L=(M+w)/k;v=Ed(g,D),C=Ed(g,L)}v>m.from&&d(m.from,v,m,g),C<m.to&&d(C,m.to,m,g)};for(let m of this.viewportLines)Array.isArray(m.type)?m.type.forEach(f):f(m);return c}gapSize(e,t,i,o){let a=jd(o,i)-jd(o,t);return this.heightOracle.lineWrapping?e.height*a:o.total*this.heightOracle.charWidth*a}updateLineGaps(e){Ag.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Oe.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];qe.spans(t,this.viewport.from,this.viewport.to,{span(a,r){i.push({from:a,to:r})},point(){}},20);let o=0;if(i.length!=this.visibleRanges.length)o=12;else for(let a=0;a<i.length&&!(o&8);a++){let r=this.visibleRanges[a],c=i[a];(r.from!=c.from||r.to!=c.to)&&(o|=4,e&&e.mapPos(r.from,-1)==c.from&&e.mapPos(r.to,1)==c.to||(o|=8))}return this.visibleRanges=i,o}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||tc(this.heightMap.lineAt(e,xt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||tc(this.heightMap.lineAt(this.scaler.fromDOM(e),xt.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return tc(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Rd{constructor(e,t){this.from=e,this.to=t}}function MU(n,e,t){let i=[],o=n,a=0;return qe.spans(t,n,e,{span(){},point(r,c){r>o&&(i.push({from:o,to:r}),a+=r-o),o=c}},20),o<e&&(i.push({from:o,to:e}),a+=e-o),{total:a,ranges:i}}function Ed({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let o=0;;o++){let{from:a,to:r}=e[o],c=r-a;if(i<=c)return a+i;i-=c}}function jd(n,e){let t=0;for(let{from:i,to:o}of n.ranges){if(e<=o){t+=e-i;break}t+=o-i}return t/n.total}function NU(n,e){for(let t of n)if(e(t))return t}const qw={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function Gw(n){let e=n.facet(hf).filter(i=>typeof i!="function"),t=n.facet(px).filter(i=>typeof i!="function");return t.length&&e.push(qe.join(t)),e}class bx{constructor(e,t,i){let o=0,a=0,r=0;this.viewports=i.map(({from:c,to:d})=>{let f=t.lineAt(c,xt.ByPos,e,0,0).top,m=t.lineAt(d,xt.ByPos,e,0,0).bottom;return o+=m-f,{from:c,to:d,top:f,bottom:m,domTop:0,domBottom:0}}),this.scale=(7e6-o)/(t.height-o);for(let c of this.viewports)c.domTop=r+(c.top-a)*this.scale,r=c.domBottom=c.domTop+(c.bottom-c.top),a=c.bottom}toDOM(e){for(let t=0,i=0,o=0;;t++){let a=t<this.viewports.length?this.viewports[t]:null;if(!a||e<a.top)return o+(e-i)*this.scale;if(e<=a.bottom)return a.domTop+(e-a.top);i=a.bottom,o=a.domBottom}}fromDOM(e){for(let t=0,i=0,o=0;;t++){let a=t<this.viewports.length?this.viewports[t]:null;if(!a||e<a.domTop)return i+(e-o)/this.scale;if(e<=a.domBottom)return a.top+(e-a.domTop);i=a.bottom,o=a.domBottom}}eq(e){return e instanceof bx?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,i)=>t.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function tc(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new vi(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(o=>tc(o,e)):n._content)}const Id=pe.define({combine:n=>n.join(" ")}),Gy=pe.define({combine:n=>n.indexOf(!0)>-1}),Ky=bs.newName(),GT=bs.newName(),KT=bs.newName(),VT={"&light":"."+GT,"&dark":"."+KT};function Vy(n,e,t){return new bs(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,o=>{if(o=="&")return n;if(!t||!t[o])throw new RangeError(`Unsupported selector: ${o}`);return t[o]}):n+" "+i}})}const LU=Vy("."+Ky,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},VT),RU={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Og=me.ie&&me.ie_version<=11;class EU{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new uH,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(me.ie&&me.ie_version<=11||me.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&me.android&&e.constructor.EDIT_CONTEXT!==!1&&!(me.chrome&&me.chrome_version<126)&&(this.editContext=new IU(e),e.state.facet(ko)&&(e.contentDOM.editContext=this.editContext.editContext)),Og&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,o=this.selectionRange;if(i.state.facet(ko)?i.root.activeElement!=this.dom:!dc(this.dom,o))return;let a=o.anchorNode&&i.docView.tile.nearest(o.anchorNode);if(a&&a.isWidget()&&a.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(me.ie&&me.ie_version<=11||me.android&&me.chrome)&&!i.state.selection.main.empty&&o.focusNode&&fc(o.focusNode,o.focusOffset,o.anchorNode,o.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Dc(e.root);if(!t)return!1;let i=me.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&jU(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let o=dc(this.dom,i);return o&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&hH(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),o&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(i.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=t)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,RU),Og&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Og&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;if(!this.delayedAndroidKey){let o=()=>{let a=this.delayedAndroidKey;a&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=a.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&a.force&&Pr(this.dom,a.key,a.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(o)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,o=!1;for(let a of e){let r=this.readMutation(a);r&&(r.typeOver&&(o=!0),t==-1?{from:t,to:i}=r:(t=Math.min(r.from,t),i=Math.max(r.to,i)))}return{from:t,to:i,typeOver:o}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),o=this.selectionChanged&&dc(this.dom,this.selectionRange);if(e<0&&!o)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let a=new ZH(this.view,e,t,i);return this.view.docView.domChanged={newSel:a.newSel?a.newSel.main:null},a}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,o=RT(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!Oh(this.view.state.selection,t.newSel.main))&&this.view.update([]),o}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let i=Kw(t,e.previousSibling||e.target.previousSibling,-1),o=Kw(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:o?t.posBefore(o):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ko)!=e.state.facet(ko)&&(e.view.contentDOM.editContext=e.state.facet(ko)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let o of this.scrollTargets)o.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Kw(n,e,t){for(;e;){let i=Nt.get(e);if(i&&i.parent==n)return i;let o=e.parentNode;e=o!=n.dom?o:t>0?e.nextSibling:e.previousSibling}return null}function Vw(n,e){let t=e.startContainer,i=e.startOffset,o=e.endContainer,a=e.endOffset,r=n.docView.domAtPos(n.state.selection.main.anchor,1);return fc(r.node,r.offset,o,a)&&([t,i,o,a]=[o,a,t,i]),{anchorNode:t,anchorOffset:i,focusNode:o,focusOffset:a}}function jU(n,e){if(e.getComposedRanges){let o=e.getComposedRanges(n.root)[0];if(o)return Vw(n,o)}let t=null;function i(o){o.preventDefault(),o.stopImmediatePropagation(),t=o.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),t?Vw(n,t):null}class IU{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let o=e.state.selection.main,{anchor:a,head:r}=o,c=this.toEditorPos(i.updateRangeStart),d=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:c,drifted:!1});let f=d-c>i.text.length;c==this.from&&a<this.from?c=a:d==this.to&&a>this.to&&(d=a);let m=ET(e.state.sliceDoc(c,d),i.text,(f?o.from:o.to)-c,f?"end":null);if(!m){let x=J.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Oh(x,o)||e.dispatch({selection:x,userEvent:"select"});return}let g={from:m.from+c,to:m.toA+c,insert:Je.of(i.text.slice(m.from,m.toB).split(`
26
+ `))};if((me.mac||me.android)&&g.from==r-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(g={from:c,to:d,insert:Je.of([i.text.replace("."," ")])}),this.pendingContextChange=g,!e.state.readOnly){let x=this.to-this.from+(g.to-g.from+g.insert.length);gx(e,g,J.single(this.toEditorPos(i.selectionStart,x),this.toEditorPos(i.selectionEnd,x)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),g.from<g.to&&!g.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let o=[],a=null;for(let r=this.toEditorPos(i.rangeStart),c=this.toEditorPos(i.rangeEnd);r<c;r++){let d=e.coordsForChar(r);a=d&&new DOMRect(d.left,d.top,d.right-d.left,d.bottom-d.top)||a||new DOMRect,o.push(a)}t.updateCharacterBounds(i.rangeStart,o)},this.handlers.textformatupdate=i=>{let o=[];for(let a of i.getTextFormats()){let r=a.underlineStyle,c=a.underlineThickness;if(!/none/i.test(r)&&!/none/i.test(c)){let d=this.toEditorPos(a.rangeStart),f=this.toEditorPos(a.rangeEnd);if(d<f){let m=`text-decoration: underline ${/^[a-z]/.test(r)?r+" ":r=="Dashed"?"dashed ":r=="Squiggle"?"wavy ":""}${/thin/i.test(c)?1:2}px`;o.push(Oe.mark({attributes:{style:m}}).range(d,f))}}}e.dispatch({effects:wT.of(Oe.set(o))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let o=Dc(i.root);o&&o.rangeCount&&this.editContext.updateSelectionBounds(o.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,o=this.pendingContextChange;return e.changes.iterChanges((a,r,c,d,f)=>{if(i)return;let m=f.length-(r-a);if(o&&r>=o.to)if(o.from==a&&o.to==r&&o.insert.eq(f)){o=this.pendingContextChange=null,t+=m,this.to+=m;return}else o=null,this.revertPending(e.state);if(a+=t,r+=t,r<=this.from)this.from+=m,this.to+=m;else if(a<this.to){if(a<this.from||r>this.to||this.to-this.from+f.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(a),this.toContextPos(r),f.toString()),this.to+=m}t+=m}),o&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(o=>!o.isUserEvent("input.type")&&o.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),o=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=o)&&this.editContext.updateSelection(i,o)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class ue{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(o=>o.forEach(a=>i(a,this)))||(o=>this.update(o)),this.dispatch=this.dispatch.bind(this),this._root=e.root||dH(e.parent)||document,this.viewState=new Fw(this,e.state||Qe.create(e)),e.scrollTo&&e.scrollTo.is(Md)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(br).map(o=>new vg(o));for(let o of this.plugins)o.update(this);this.observer=new EU(this),this.inputState=new iU(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Dw(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Gt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,o,a=this.state;for(let x of e){if(x.startState!=a)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");a=x.state}if(this.destroyed){this.viewState.state=a;return}let r=this.hasFocus,c=0,d=null;e.some(x=>x.annotation(UT))?(this.inputState.notifiedFocused=r,c=1):r!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=r,d=zT(a,r),d||(c=1));let f=this.observer.delayedAndroidKey,m=null;if(f?(this.observer.clearDelayedAndroidKey(),m=this.observer.readChange(),(m&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(m=null)):this.observer.clear(),a.facet(Qe.phrases)!=this.state.facet(Qe.phrases))return this.setState(a);o=kh.create(this,a,e),o.flags|=c;let g=this.viewState.scrollTarget;try{this.updateState=2;for(let x of e){if(g&&(g=g.map(x.changes)),x.scrollIntoView){let{main:v}=x.state.selection,{x:C,y:k}=this.state.facet(ue.cursorScrollMargin);g=new Tr(v.empty?v:J.cursor(v.head,v.head>v.anchor?-1:1),"nearest","nearest",k,C)}for(let v of x.effects)v.is(Md)&&(g=v.value.clip(this.state))}this.viewState.update(o,g),this.bidiCache=Th.update(this.bidiCache,o.changes),o.empty||(this.updatePlugins(o),this.inputState.update(o)),t=this.docView.update(o),this.state.facet(ec)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(x=>x.isUserEvent("select.pointer")))}finally{this.updateState=0}if(o.startState.facet(Id)!=o.state.facet(Id)&&(this.viewState.mustMeasureContent=!0),(t||i||g||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!o.empty)for(let x of this.state.facet(Hy))try{x(o)}catch(v){En(this.state,v,"update listener")}(d||m)&&Promise.resolve().then(()=>{d&&this.state==d.startState&&this.dispatch(d),m&&!RT(this,m)&&f.force&&Pr(this.contentDOM,f.key,f.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Fw(this,e),this.plugins=e.facet(br).map(i=>new vg(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Dw(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(br),i=e.state.facet(br);if(t!=i){let o=[];for(let a of i){let r=t.indexOf(a);if(r<0)o.push(new vg(a));else{let c=this.plugins[r];c.mustUpdate=e,o.push(c)}}for(let a of this.plugins)a.mustUpdate!=e&&a.destroy(this);this.plugins=o,this.pluginMap.clear()}else for(let o of this.plugins)o.mustUpdate=e;for(let o=0;o<this.plugins.length;o++)this.plugins[o].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(i){En(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.viewState.scrollParent,o=this.viewState.getScrollOffset(),{scrollAnchorPos:a,scrollAnchorHeight:r}=this.viewState;Math.abs(o-this.viewState.scrollOffset)>1&&(r=-1),this.viewState.scrollAnchorHeight=-1;try{for(let c=0;;c++){if(r<0)if(rT(i||this.win))a=-1,r=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(o);a=v.from,r=v.top}this.updateState=1;let d=this.viewState.measure();if(!d&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(c>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let f=[];d&4||([this.measureRequests,f]=[f,this.measureRequests]);let m=f.map(v=>{try{return v.read(this)}catch(C){return En(this.state,C),Ww}}),g=kh.create(this,this.state,[]),x=!1;g.flags|=d,t?t.flags|=d:t=g,this.updateState=2,g.empty||(this.updatePlugins(g),this.inputState.update(g),this.updateAttrs(),x=this.docView.update(g),x&&this.docViewUpdate());for(let v=0;v<f.length;v++)if(m[v]!=Ww)try{let C=f[v];C.write&&C.write(m[v],this)}catch(C){En(this.state,C)}if(x&&this.docView.updateSelection(!0),!g.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,r=-1;continue}else{let C=((a<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(a).top)-r)/this.scaleY;if((C>1||C<-1)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){o=o+C,i?i.scrollTop+=C:this.win.scrollBy(0,C),r=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let c of this.state.facet(Hy))c(t)}get themeClasses(){return Ky+" "+(this.state.facet(Gy)?KT:GT)+" "+this.state.facet(Id)}updateAttrs(){let e=Qw(this,AT,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ko)?"true":"false",class:"cm-content",style:`${me.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Qw(this,fx,t);let i=this.observer.ignore(()=>{let o=kw(this.contentDOM,this.contentAttrs,t),a=kw(this.dom,this.editorAttrs,e);return o||a});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let o of i.effects)if(o.is(ue.announce)){t&&(this.announceDOM.textContent=""),t=!1;let a=this.announceDOM.appendChild(document.createElement("div"));a.textContent=o.value}}mountStyles(){this.styleModules=this.state.facet(ec);let e=this.state.facet(ue.cspNonce);bs.mount(this.root,this.styleModules.concat(LU).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return wg(this,e,Mw(this,e,t,i))}moveByGroup(e,t){return wg(this,e,Mw(this,e,t,i=>WH(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),o=this.textDirectionAt(e.from),a=i[t?i.length-1:0];return J.cursor(a.side(t,o)+e.from,a.forward(!t,o)?1:-1)}moveToLineBoundary(e,t,i=!0){return VH(this,e,t,i)}moveVertically(e,t,i){return wg(this,e,QH(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=Fy(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Fy(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let o=this.state.doc.lineAt(e),a=this.bidiSpans(o),r=a[Fi.find(a,e-o.from,-1,t)];return Mc(i,r.dir==yt.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(CT)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>BU)return fT(e.length);let t=this.textDirectionAt(e.from),i;for(let a of this.bidiCache)if(a.from==e.from&&a.dir==t&&(a.fresh||hT(a.isolates,i=Ow(this,e))))return a.order;i||(i=Ow(this,e));let o=xH(e.text,t,i);return this.bidiCache.push(new Th(e.from,e.to,t,i,!0,o)),o}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||me.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{aT(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var i,o,a,r;return Md.of(new Tr(typeof e=="number"?J.cursor(e):e,(i=t.y)!==null&&i!==void 0?i:"nearest",(o=t.x)!==null&&o!==void 0?o:"nearest",(a=t.yMargin)!==null&&a!==void 0?a:5,(r=t.xMargin)!==null&&r!==void 0?r:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Md.of(new Tr(J.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return At.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return At.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=bs.newName(),o=[Id.of(i),ec.of(Vy(`.${i}`,e))];return t&&t.dark&&o.push(Gy.of(!0)),o}static baseTheme(e){return Sa.lowest(ec.of(Vy("."+Ky,e,VT)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),o=i&&Nt.get(i)||Nt.get(e);return((t=o?.root)===null||t===void 0?void 0:t.view)||null}}ue.styleModule=ec;ue.inputHandler=xT;ue.clipboardInputFilter=dx;ue.clipboardOutputFilter=hx;ue.scrollHandler=kT;ue.focusChangeEffect=vT;ue.perLineTextDirection=CT;ue.exceptionSink=bT;ue.updateListener=Hy;ue.editable=ko;ue.mouseSelectionStyle=yT;ue.dragMovesSelection=gT;ue.clickAddsSelectionRange=mT;ue.decorations=hf;ue.blockWrappers=OT;ue.outerDecorations=px;ue.atomicRanges=Jc;ue.bidiIsolatedRanges=PT;ue.cursorScrollMargin=pe.define({combine:n=>{let e=5,t=5;for(let i of n)typeof i=="number"?e=t=i:{x:e,y:t}=i;return{x:e,y:t}}});ue.scrollMargins=TT;ue.darkTheme=Gy;ue.cspNonce=pe.define({combine:n=>n.length?n[0]:""});ue.contentAttributes=fx;ue.editorAttributes=AT;ue.lineWrapping=ue.contentAttributes.of({class:"cm-lineWrapping"});ue.announce=Le.define();const BU=4096,Ww={};class Th{constructor(e,t,i,o,a,r){this.from=e,this.to=t,this.dir=i,this.isolates=o,this.fresh=a,this.order=r}static update(e,t){if(t.empty&&!e.some(a=>a.fresh))return e;let i=[],o=e.length?e[e.length-1].dir:yt.LTR;for(let a=Math.max(0,e.length-10);a<e.length;a++){let r=e[a];r.dir==o&&!t.touchesRange(r.from,r.to)&&i.push(new Th(t.mapPos(r.from,1),t.mapPos(r.to,-1),r.dir,r.isolates,!1,r.order))}return i}}function Qw(n,e,t){for(let i=n.state.facet(e),o=i.length-1;o>=0;o--){let a=i[o],r=typeof a=="function"?a(n):a;r&&lx(r,t)}return t}const _U=me.mac?"mac":me.windows?"win":me.linux?"linux":"key";function HU(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let o,a,r,c;for(let d=0;d<t.length-1;++d){const f=t[d];if(/^(cmd|meta|m)$/i.test(f))c=!0;else if(/^a(lt)?$/i.test(f))o=!0;else if(/^(c|ctrl|control)$/i.test(f))a=!0;else if(/^s(hift)?$/i.test(f))r=!0;else if(/^mod$/i.test(f))e=="mac"?c=!0:a=!0;else throw new Error("Unrecognized modifier name: "+f)}return o&&(i="Alt-"+i),a&&(i="Ctrl-"+i),c&&(i="Meta-"+i),r&&(i="Shift-"+i),i}function Bd(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const UU=Sa.default(ue.domEventHandlers({keydown(n,e){return QT(WT(e.state),n,e,"editor")}})),gf=pe.define({enables:UU}),Yw=new WeakMap;function WT(n){let e=n.facet(gf),t=Yw.get(e);return t||Yw.set(e,t=qU(e.reduce((i,o)=>i.concat(o),[]))),t}function zU(n,e,t){return QT(WT(n.state),e,n,t)}let fs=null;const FU=4e3;function qU(n,e=_U){let t=Object.create(null),i=Object.create(null),o=(r,c)=>{let d=i[r];if(d==null)i[r]=c;else if(d!=c)throw new Error("Key binding "+r+" is used both as a regular binding and as a multi-stroke prefix")},a=(r,c,d,f,m)=>{var g,x;let v=t[r]||(t[r]=Object.create(null)),C=c.split(/ (?!$)/).map(P=>HU(P,e));for(let P=1;P<C.length;P++){let T=C.slice(0,P).join(" ");o(T,!0),v[T]||(v[T]={preventDefault:!0,stopPropagation:!1,run:[M=>{let D=fs={view:M,prefix:T,scope:r};return setTimeout(()=>{fs==D&&(fs=null)},FU),!0}]})}let k=C.join(" ");o(k,!1);let w=v[k]||(v[k]={preventDefault:!1,stopPropagation:!1,run:((x=(g=v._any)===null||g===void 0?void 0:g.run)===null||x===void 0?void 0:x.slice())||[]});d&&w.run.push(d),f&&(w.preventDefault=!0),m&&(w.stopPropagation=!0)};for(let r of n){let c=r.scope?r.scope.split(" "):["editor"];if(r.any)for(let f of c){let m=t[f]||(t[f]=Object.create(null));m._any||(m._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:g}=r;for(let x in m)m[x].run.push(v=>g(v,Wy))}let d=r[e]||r.key;if(d)for(let f of c)a(f,d,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(f,"Shift-"+d,r.shift,r.preventDefault,r.stopPropagation)}return t}let Wy=null;function QT(n,e,t,i){Wy=e;let o=oH(e),a=Mn(o,0),r=Hi(a)==o.length&&o!=" ",c="",d=!1,f=!1,m=!1;fs&&fs.view==t&&fs.scope==i&&(c=fs.prefix+" ",IT.indexOf(e.keyCode)<0&&(f=!0,fs=null));let g=new Set,x=w=>{if(w){for(let P of w.run)if(!g.has(P)&&(g.add(P),P(t)))return w.stopPropagation&&(m=!0),!0;w.preventDefault&&(w.stopPropagation&&(m=!0),f=!0)}return!1},v=n[i],C,k;return v&&(x(v[c+Bd(o,e,!r)])?d=!0:r&&(e.altKey||e.metaKey||e.ctrlKey)&&!(me.windows&&e.ctrlKey&&e.altKey)&&!(me.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(C=xs[e.keyCode])&&C!=o?(x(v[c+Bd(C,e,!0)])||e.shiftKey&&(k=Pc[e.keyCode])!=o&&k!=C&&x(v[c+Bd(k,e,!1)]))&&(d=!0):r&&e.shiftKey&&x(v[c+Bd(o,e,!0)])&&(d=!0),!d&&x(v._any)&&(d=!0)),f&&(d=!0),d&&m&&e.stopPropagation(),Wy=null,d}class ca{constructor(e,t,i,o,a){this.className=e,this.left=t,this.top=i,this.width=o,this.height=a}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let o=e.coordsAtPos(i.head,i.assoc||1);if(!o)return[];let a=YT(e);return[new ca(t,o.left-a.left,o.top-a.top,null,o.bottom-o.top)]}else return GU(e,t,i)}}function YT(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==yt.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function $w(n,e,t,i){let o=n.coordsAtPos(e,t*2);if(!o)return i;let a=n.dom.getBoundingClientRect(),r=(o.top+o.bottom)/2,c=n.posAtCoords({x:a.left+1,y:r}),d=n.posAtCoords({x:a.right-1,y:r});return c==null||d==null?i:{from:Math.max(i.from,Math.min(c,d)),to:Math.min(i.to,Math.max(c,d))}}function GU(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),o=Math.min(t.to,n.viewport.to),a=n.textDirection==yt.LTR,r=n.contentDOM,c=r.getBoundingClientRect(),d=YT(n),f=r.querySelector(".cm-line"),m=f&&window.getComputedStyle(f),g=c.left+(m?parseInt(m.paddingLeft)+Math.min(0,parseInt(m.textIndent)):0),x=c.right-(m?parseInt(m.paddingRight):0),v=zy(n,i,1),C=zy(n,o,-1),k=v.type==rn.Text?v:null,w=C.type==rn.Text?C:null;if(k&&(n.lineWrapping||v.widgetLineBreaks)&&(k=$w(n,i,1,k)),w&&(n.lineWrapping||C.widgetLineBreaks)&&(w=$w(n,o,-1,w)),k&&w&&k.from==w.from&&k.to==w.to)return T(M(t.from,t.to,k));{let L=k?M(t.from,null,k):D(v,!1),N=w?M(null,t.to,w):D(C,!0),j=[];return(k||v).to<(w||C).from-(k&&w?1:0)||v.widgetLineBreaks>1&&L.bottom+n.defaultLineHeight/2<N.top?j.push(P(g,L.bottom,x,N.top)):L.bottom<N.top&&n.elementAtHeight((L.bottom+N.top)/2).type==rn.Text&&(L.bottom=N.top=(L.bottom+N.top)/2),T(L).concat(j).concat(T(N))}function P(L,N,j,K){return new ca(e,L-d.left,N-d.top,Math.max(0,j-L),K-N)}function T({top:L,bottom:N,horizontal:j}){let K=[];for(let U=0;U<j.length;U+=2)K.push(P(j[U],L,j[U+1],N));return K}function M(L,N,j){let K=1e9,U=-1e9,z=[];function X(ie,oe,B,Z,se){let Y=n.coordsAtPos(ie,ie==j.to?-2:2),ae=n.coordsAtPos(B,B==j.from?2:-2);!Y||!ae||(K=Math.min(Y.top,ae.top,K),U=Math.max(Y.bottom,ae.bottom,U),se==yt.LTR?z.push(a&&oe?g:Y.left,a&&Z?x:ae.right):z.push(!a&&Z?g:ae.left,!a&&oe?x:Y.right))}let H=L??j.from,V=N??j.to;for(let ie of n.visibleRanges)if(ie.to>H&&ie.from<V)for(let oe=Math.max(ie.from,H),B=Math.min(ie.to,V);;){let Z=n.state.doc.lineAt(oe);for(let se of n.bidiSpans(Z)){let Y=se.from+Z.from,ae=se.to+Z.from;if(Y>=B)break;ae>oe&&X(Math.max(Y,oe),L==null&&Y<=H,Math.min(ae,B),N==null&&ae>=V,se.dir)}if(oe=Z.to+1,oe>=B)break}return z.length==0&&X(H,L==null,V,N==null,n.textDirection),{top:K,bottom:U,horizontal:z}}function D(L,N){let j=c.top+(N?L.top:L.bottom);return{top:j,bottom:j,horizontal:[]}}}function KU(n,e){return n.constructor==e.constructor&&n.eq(e)}class VU{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(oh)!=e.state.facet(oh)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(oh);for(;t<i.length&&i[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,i)=>!KU(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let o of e)o.update&&t&&o.constructor&&this.drawn[i].constructor&&o.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(o.draw(),t);for(;t;){let o=t.nextSibling;t.remove(),t=o}this.drawn=e,me.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const oh=pe.define();function $T(n){return[At.define(e=>new VU(e,n)),oh.of(n)]}const Hr=pe.define({combine(n){return Xi(n,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function WU(n={}){return[Hr.of(n),QU,YU,$U,ST.of(!0)]}function XT(n){return n.startState.facet(Hr)!=n.state.facet(Hr)}const QU=$T({above:!0,markers(n){let{state:e}=n,t=e.facet(Hr),i=[];for(let o of e.selection.ranges){let a=o==e.selection.main;if(o.empty||t.drawRangeCursor&&!(a&&me.ios&&t.iosSelectionHandles)){let r=a?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",c=o.empty?o:J.cursor(o.head,o.assoc);for(let d of ca.forRange(n,r,c))i.push(d)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=XT(n);return t&&Xw(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){Xw(e.state,n)},class:"cm-cursorLayer"});function Xw(n,e){e.style.animationDuration=n.facet(Hr).cursorBlinkRate+"ms"}const YU=$T({above:!1,markers(n){let e=[],{main:t,ranges:i}=n.state.selection;for(let o of i)if(!o.empty)for(let a of ca.forRange(n,"cm-selectionBackground",o))e.push(a);if(me.ios&&!t.empty&&n.state.facet(Hr).iosSelectionHandles){for(let o of ca.forRange(n,"cm-selectionHandle cm-selectionHandle-start",J.cursor(t.from,1)))e.push(o);for(let o of ca.forRange(n,"cm-selectionHandle cm-selectionHandle-end",J.cursor(t.to,1)))e.push(o)}return e},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||XT(n)},class:"cm-selectionLayer"}),$U=Sa.highest(ue.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),JT=Le.define({map(n,e){return n==null?null:e.mapPos(n)}}),nc=hn.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(JT)?i.value:t,n)}}),XU=At.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(nc);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(nc)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(nc),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(nc)!=n&&this.view.dispatch({effects:JT.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function JU(){return[nc,XU]}function Jw(n,e,t,i,o){e.lastIndex=0;for(let a=n.iterRange(t,i),r=t,c;!a.next().done;r+=a.value.length)if(!a.lineBreak)for(;c=e.exec(a.value);)o(r+c.index,c)}function ZU(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:o,to:a}of t)o=Math.max(n.state.doc.lineAt(o).from,o-e),a=Math.min(n.state.doc.lineAt(a).to,a+e),i.length&&i[i.length-1].to>=o?i[i.length-1].to=a:i.push({from:o,to:a});return i}class ez{constructor(e){const{regexp:t,decoration:i,decorate:o,boundary:a,maxLength:r=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,o)this.addMatch=(c,d,f,m)=>o(m,f,f+c[0].length,c,d);else if(typeof i=="function")this.addMatch=(c,d,f,m)=>{let g=i(c,d,f);g&&m(f,f+c[0].length,g)};else if(i)this.addMatch=(c,d,f,m)=>m(f,f+c[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=a,this.maxLength=r}createDeco(e){let t=new Yi,i=t.add.bind(t);for(let{from:o,to:a}of ZU(e,this.maxLength))Jw(e.state.doc,this.regexp,o,a,(r,c)=>this.addMatch(c,e,r,i));return t.finish()}updateDeco(e,t){let i=1e9,o=-1;return e.docChanged&&e.changes.iterChanges((a,r,c,d)=>{d>=e.view.viewport.from&&c<=e.view.viewport.to&&(i=Math.min(c,i),o=Math.max(d,o))}),e.viewportMoved||o-i>1e3?this.createDeco(e.view):o>-1?this.updateRange(e.view,t.map(e.changes),i,o):t}updateRange(e,t,i,o){for(let a of e.visibleRanges){let r=Math.max(a.from,i),c=Math.min(a.to,o);if(c>=r){let d=e.state.doc.lineAt(r),f=d.to<c?e.state.doc.lineAt(c):d,m=Math.max(a.from,d.from),g=Math.min(a.to,f.to);if(this.boundary){for(;r>d.from;r--)if(this.boundary.test(d.text[r-1-d.from])){m=r;break}for(;c<f.to;c++)if(this.boundary.test(f.text[c-f.from])){g=c;break}}let x=[],v,C=(k,w,P)=>x.push(P.range(k,w));if(d==f)for(this.regexp.lastIndex=m-d.from;(v=this.regexp.exec(d.text))&&v.index<g-d.from;)this.addMatch(v,e,v.index+d.from,C);else Jw(e.state.doc,this.regexp,m,g,(k,w)=>this.addMatch(w,e,k,C));t=t.update({filterFrom:m,filterTo:g,filter:(k,w)=>k<m||w>g,add:x})}}return t}}const Qy=/x/.unicode!=null?"gu":"g",tz=new RegExp(`[\0-\b
27
+ --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Qy),nz={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Pg=null;function iz(){var n;if(Pg==null&&typeof document<"u"&&document.body){let e=document.body.style;Pg=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Pg||!1}const sh=pe.define({combine(n){let e=Xi(n,{render:null,specialChars:tz,addSpecialChars:null});return(e.replaceTabs=!iz())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Qy)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Qy)),e}});function oz(n={}){return[sh.of(n),sz()]}let Zw=null;function sz(){return Zw||(Zw=At.fromClass(class{constructor(n){this.view=n,this.decorations=Oe.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(sh)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new ez({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:o}=t.state,a=Mn(e[0],0);if(a==9){let r=o.lineAt(i),c=t.state.tabSize,d=Vr(r.text,c,i-r.from);return Oe.replace({widget:new cz((c-d%c)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Oe.replace({widget:new lz(n,a)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(sh);n.startState.facet(sh)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const az="•";function rz(n){return n>=32?az:n==10?"␤":String.fromCharCode(9216+n)}class lz extends Ji{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=rz(this.code),i=e.state.phrase("Control character")+" "+(nz[this.code]||"0x"+this.code.toString(16)),o=this.options.render&&this.options.render(this.code,i,t);if(o)return o;let a=document.createElement("span");return a.textContent=t,a.title=i,a.setAttribute("aria-label",i),a.className="cm-specialChar",a}ignoreEvent(){return!1}}class cz extends Ji{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function uz(){return hz}const dz=Oe.line({class:"cm-activeLine"}),hz=At.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let o=n.lineBlockAt(i.head);o.from>e&&(t.push(dz.range(o.from)),e=o.from)}return Oe.set(t)}},{decorations:n=>n.decorations});class fz extends Ji{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?hc(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),o=Mc(t[0],i.direction!="rtl"),a=parseInt(i.lineHeight);return o.bottom-o.top>a*1.5?{left:o.left,right:o.right,top:o.top,bottom:o.top+a}:o}ignoreEvent(){return!1}}function pz(n){let e=At.fromClass(class{constructor(t){this.view=t,this.placeholder=n?Oe.set([Oe.widget({widget:new fz(n),side:1}).range(0)]):Oe.none}get decorations(){return this.view.state.doc.length?Oe.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,ue.contentAttributes.of({"aria-placeholder":n})]:e}const Yy=2e3;function mz(n,e,t){let i=Math.min(e.line,t.line),o=Math.max(e.line,t.line),a=[];if(e.off>Yy||t.off>Yy||e.col<0||t.col<0){let r=Math.min(e.off,t.off),c=Math.max(e.off,t.off);for(let d=i;d<=o;d++){let f=n.doc.line(d);f.length<=c&&a.push(J.range(f.from+r,f.to+c))}}else{let r=Math.min(e.col,t.col),c=Math.max(e.col,t.col);for(let d=i;d<=o;d++){let f=n.doc.line(d),m=Ty(f.text,r,n.tabSize,!0);if(m<0)a.push(J.cursor(f.to));else{let g=Ty(f.text,c,n.tabSize);a.push(J.range(f.from+m,f.from+g))}}}return a}function gz(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function e1(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),o=t-i.from,a=o>Yy?-1:o==i.length?gz(n,e.clientX):Vr(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:a,off:o}}function yz(n,e){let t=e1(n,e),i=n.state.selection;return t?{update(o){if(o.docChanged){let a=o.changes.mapPos(o.startState.doc.line(t.line).from),r=o.state.doc.lineAt(a);t={line:r.number,col:t.col,off:Math.min(t.off,r.length)},i=i.map(o.changes)}},get(o,a,r){let c=e1(n,o);if(!c)return i;let d=mz(n.state,t,c);return d.length?r?J.create(d.concat(i.ranges)):J.create(d):i}}:null}function bz(n){let e=(t=>t.altKey&&t.button==0);return ue.mouseSelectionStyle.of((t,i)=>e(i)?yz(t,i):null)}const xz={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},vz={style:"cursor: crosshair"};function Cz(n={}){let[e,t]=xz[n.key||"Alt"],i=At.fromClass(class{constructor(o){this.view=o,this.isDown=!1}set(o){this.isDown!=o&&(this.isDown=o,this.view.update([]))}},{eventObservers:{keydown(o){this.set(o.keyCode==e||t(o))},keyup(o){(o.keyCode==e||!t(o))&&this.set(!1)},mousemove(o){this.set(t(o))}}});return[i,ue.contentAttributes.of(o=>{var a;return!((a=o.plugin(i))===null||a===void 0)&&a.isDown?vz:null})]}const _d="-10000px";class ZT{constructor(e,t,i,o){this.facet=t,this.createTooltipView=i,this.removeTooltipView=o,this.input=e.state.facet(t),this.tooltips=this.input.filter(r=>r);let a=null;this.tooltipViews=this.tooltips.map(r=>a=i(r,a))}update(e,t){var i;let o=e.state.facet(this.facet),a=o.filter(d=>d);if(o===this.input){for(let d of this.tooltipViews)d.update&&d.update(e);return!1}let r=[],c=t?[]:null;for(let d=0;d<a.length;d++){let f=a[d],m=-1;if(f){for(let g=0;g<this.tooltips.length;g++){let x=this.tooltips[g];x&&x.create==f.create&&(m=g)}if(m<0)r[d]=this.createTooltipView(f,d?r[d-1]:null),c&&(c[d]=!!f.above);else{let g=r[d]=this.tooltipViews[m];c&&(c[d]=t[m]),g.update&&g.update(e)}}}for(let d of this.tooltipViews)r.indexOf(d)<0&&(this.removeTooltipView(d),(i=d.destroy)===null||i===void 0||i.call(d));return t&&(c.forEach((d,f)=>t[f]=d),t.length=c.length),this.input=o,this.tooltips=a,this.tooltipViews=r,!0}}function Sz(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Tg=pe.define({combine:n=>{var e,t,i;return{position:me.ios?"absolute":((e=n.find(o=>o.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(o=>o.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(o=>o.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Sz}}}),t1=new WeakMap,xx=At.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Tg);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new ZT(n,vx,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Tg);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let o of this.manager.tooltipViews)o.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let o of this.manager.tooltipViews)this.container.appendChild(o.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let o=document.createElement("div");o.className="cm-tooltip-arrow",t.dom.appendChild(o)}return t.dom.style.position=this.position,t.dom.style.top=_d,t.dom.style.left="0px",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:a}=this.manager.tooltipViews[0];if(me.safari){let r=a.getBoundingClientRect();t=Math.abs(r.top+1e4)>1||Math.abs(r.left)>1}else t=!!a.offsetParent&&a.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let a=this.parent.getBoundingClientRect();a.width&&a.height&&(n=a.width/this.parent.offsetWidth,e=a.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),o=mx(this.view);return{visible:{left:i.left+o.left,top:i.top+o.top,right:i.right-o.right,bottom:i.bottom-o.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((a,r)=>{let c=this.manager.tooltipViews[r];return c.getCoords?c.getCoords(a.pos):this.view.coordsAtPos(a.pos)}),size:this.manager.tooltipViews.map(({dom:a})=>a.getBoundingClientRect()),space:this.view.state.facet(Tg).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let c of this.manager.tooltipViews)c.dom.style.position="absolute"}let{visible:t,space:i,scaleX:o,scaleY:a}=n,r=[];for(let c=0;c<this.manager.tooltips.length;c++){let d=this.manager.tooltips[c],f=this.manager.tooltipViews[c],{dom:m}=f,g=n.pos[c],x=n.size[c];if(!g||d.clip!==!1&&(g.bottom<=Math.max(t.top,i.top)||g.top>=Math.min(t.bottom,i.bottom)||g.right<Math.max(t.left,i.left)-.1||g.left>Math.min(t.right,i.right)+.1)){m.style.top=_d;continue}let v=d.arrow?f.dom.querySelector(".cm-tooltip-arrow"):null,C=v?7:0,k=x.right-x.left,w=(e=t1.get(f))!==null&&e!==void 0?e:x.bottom-x.top,P=f.offset||wz,T=this.view.textDirection==yt.LTR,M=x.width>i.right-i.left?T?i.left:i.right-x.width:T?Math.max(i.left,Math.min(g.left-(v?14:0)+P.x,i.right-k)):Math.min(Math.max(i.left,g.left-k+(v?14:0)-P.x),i.right-k),D=this.above[c];!d.strictSide&&(D?g.top-w-C-P.y<i.top:g.bottom+w+C+P.y>i.bottom)&&D==i.bottom-g.bottom>g.top-i.top&&(D=this.above[c]=!D);let L=(D?g.top-i.top:i.bottom-g.bottom)-C;if(L<w&&f.resize!==!1){if(L<this.view.defaultLineHeight){m.style.top=_d;continue}t1.set(f,w),m.style.height=(w=L)/a+"px"}else m.style.height&&(m.style.height="");let N=D?g.top-w-C-P.y:g.bottom+C+P.y,j=M+k;if(f.overlap!==!0)for(let K of r)K.left<j&&K.right>M&&K.top<N+w&&K.bottom>N&&(N=D?K.top-w-2-C:K.bottom+C+2);if(this.position=="absolute"?(m.style.top=(N-n.parent.top)/a+"px",n1(m,(M-n.parent.left)/o)):(m.style.top=N/a+"px",n1(m,M/o)),v){let K=g.left+(T?P.x:-P.x)-(M+14-7);v.style.left=K/o+"px"}f.overlap!==!0&&r.push({left:M,top:N,right:j,bottom:N+w}),m.classList.toggle("cm-tooltip-above",D),m.classList.toggle("cm-tooltip-below",!D),f.positioned&&f.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=_d}},{eventObservers:{scroll(){this.maybeMeasure()}}});function n1(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const kz=ue.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),wz={x:0,y:0},vx=pe.define({enables:[xx,kz]}),Dh=pe.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class yf{static create(e){return new yf(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new ZT(e,Dh,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let o=i[e];if(o!==void 0){if(t===void 0)t=o;else if(t!==o)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const Az=vx.compute([Dh],n=>{let e=n.facet(Dh);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:yf.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),eD=pe.define();class Oz{constructor(e,t,i,o,a,r){this.view=e,this.source=t,this.field=i,this.locked=o,this.setHover=a,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,i=e.docView.tile.nearest(t.target);if(!i)return;let o,a=1;if(i.isWidget())o=i.posAtStart;else{if(o=e.posAtCoords(t),o==null)return;let r=e.coordsAtPos(o);if(!r||t.y<r.top||t.y>r.bottom||t.x<r.left-e.defaultCharacterWidth||t.x>r.right+e.defaultCharacterWidth)return;let c=e.bidiSpans(e.state.doc.lineAt(o)).find(f=>f.from<=o&&f.to>=o),d=c&&c.dir==yt.RTL?-1:1;a=t.x<r.left?-d:d}this.activateHover(e,o,a)}activateHover(e,t,i,o){let a=this.source(e,t,i),r=c=>{if(c&&!(Array.isArray(c)&&!c.length)){let d=Array.isArray(c)?c:[c];o&&this.locked.set(d,o),e.dispatch({effects:this.setHover.of(d)})}};if(a&&"then"in a){let c=this.pending={pos:t};a.then(d=>{this.pending==c&&(this.pending=null,r(d))},d=>En(e.state,d,"hover tooltip"))}else r(a)}get tooltip(){let e=this.view.plugin(xx),t=e?e.manager.tooltips.findIndex(i=>i.create==yf.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:o,tooltip:a}=this;if(o.length&&!this.locked.has(o)&&a&&!Pz(a.dom,e)||this.pending){let{pos:r}=o[0]||this.pending,c=(i=(t=o[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:r;(r==c?this.view.posAtCoords(this.lastMove)!=r:!Tz(this.view,r,c,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t);let{active:o}=this;o.length&&!this.locked.has(o)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Hd=4;function Pz(n,e){let{left:t,right:i,top:o,bottom:a}=n.getBoundingClientRect(),r;if(r=n.querySelector(".cm-tooltip-arrow")){let c=r.getBoundingClientRect();o=Math.min(c.top,o),a=Math.max(c.bottom,a)}return e.clientX>=t-Hd&&e.clientX<=i+Hd&&e.clientY>=o-Hd&&e.clientY<=a+Hd}function Tz(n,e,t,i,o,a){let r=n.scrollDOM.getBoundingClientRect(),c=n.documentTop+n.documentPadding.top+n.contentHeight;if(r.left>i||r.right<i||r.top>o||Math.min(r.bottom,c)<o)return!1;let d=n.posAtCoords({x:i,y:o},!1);return d>=e&&d<=t}function Dz(n,e={}){let t=Le.define(),i=new WeakMap,o=hn.define({create(){return[]},update(r,c){let d=i.get(r);if(r.length&&(e.hideOnChange&&(c.docChanged||c.selection)?r=[]:d&&d(c)?r=[]:e.hideOn&&(r=r.filter(f=>!e.hideOn(c,f)))),c.docChanged&&r.length){let f=[];for(let m of r){let g=c.changes.mapPos(m.pos,-1,xn.TrackDel);if(g!=null){let x=Object.assign(Object.create(null),m);x.pos=g,x.end!=null&&(x.end=c.changes.mapPos(x.end)),f.push(x)}}r=f}for(let f of c.effects)f.is(t)&&(r=f.value,d=void 0),(f.is(Nz)&&!f.value||f.value==o)&&(r=[]);return r.length&&d&&i.set(r,d),r},provide:r=>Dh.from(r)});const a=At.define(r=>new Oz(r,n,o,i,t,e.hoverTime||300));return{active:o,extension:[o,a,eD.of(a),Az]}}function Mz(n,e,t,i={}){var o;let a=n.state.facet(eD).map(r=>n.plugin(r)).filter(r=>!!r);if(i.tooltip&&i.tooltip.active){let r=a.find(c=>c.field==i.tooltip.active);r&&(a=[r])}for(let r of a)r.activateHover(n,e,t,(o=i.until)!==null&&o!==void 0?o:(()=>!1))}function tD(n,e){let t=n.plugin(xx);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const Nz=Le.define(),i1=pe.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Cx(n,e){let t=n.plugin(nD),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const nD=At.fromClass(class{constructor(n){this.input=n.state.facet(Lc),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(i1);this.top=new Ud(n,!0,e.topContainer),this.bottom=new Ud(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(i1);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Ud(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ud(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Lc);if(t!=this.input){let i=t.filter(d=>d),o=[],a=[],r=[],c=[];for(let d of i){let f=this.specs.indexOf(d),m;f<0?(m=d(n.view),c.push(m)):(m=this.panels[f],m.update&&m.update(n)),o.push(m),(m.top?a:r).push(m)}this.specs=i,this.panels=o,this.top.sync(a),this.bottom.sync(r);for(let d of c)d.dom.classList.add("cm-panel"),d.mount&&d.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>ue.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Ud{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=o1(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=o1(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function o1(n){let e=n.nextSibling;return n.remove(),e}const Lc=pe.define({enables:nD});function Lz(n,e){let t,i=new Promise(r=>t=r),o=r=>Rz(r,e,t);n.state.field(Dg,!1)?n.dispatch({effects:iD.of(o)}):n.dispatch({effects:Le.appendConfig.of(Dg.init(()=>[o]))});let a=oD.of(o);return{close:a,result:i.then(r=>((n.win.queueMicrotask||(d=>n.win.setTimeout(d,10)))(()=>{n.state.field(Dg).indexOf(o)>-1&&n.dispatch({effects:a})}),r))}}const Dg=hn.define({create(){return[]},update(n,e){for(let t of e.effects)t.is(iD)?n=[t.value].concat(n):t.is(oD)&&(n=n.filter(i=>i!=t.value));return n},provide:n=>Lc.computeN([n],e=>e.field(n))}),iD=Le.define(),oD=Le.define();function Rz(n,e,t){let i=e.content?e.content(n,()=>r(null)):null;if(!i){if(i=dt("form"),e.input){let c=dt("input",e.input);/^(text|password|number|email|tel|url)$/.test(c.type)&&c.classList.add("cm-textfield"),c.name||(c.name="input"),i.appendChild(dt("label",(e.label||"")+": ",c))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(dt("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let o=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let c=0;c<o.length;c++){let d=o[c];d.addEventListener("keydown",f=>{f.keyCode==27?(f.preventDefault(),r(null)):f.keyCode==13&&(f.preventDefault(),r(d))}),d.addEventListener("submit",f=>{f.preventDefault(),r(d)})}let a=dt("div",i,dt("button",{onclick:()=>r(null),"aria-label":n.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(a.className=e.class),a.classList.add("cm-dialog");function r(c){a.contains(a.ownerDocument.activeElement)&&n.focus(),t(c)}return{dom:a,top:e.top,mount:()=>{if(e.focus){let c;typeof e.focus=="string"?c=i.querySelector(e.focus):c=i.querySelector("input")||i.querySelector("button"),c&&"select"in c?c.select():c&&"focus"in c&&c.focus()}}}}class Ro extends ys{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ro.prototype.elementClass="";Ro.prototype.toDOM=void 0;Ro.prototype.mapMode=xn.TrackBefore;Ro.prototype.startSide=Ro.prototype.endSide=-1;Ro.prototype.point=!0;const ah=pe.define(),Ez=pe.define(),jz={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>qe.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},mc=pe.define();function Iz(n){return[sD(),mc.of({...jz,...n})]}const s1=pe.define({combine:n=>n.some(e=>e)});function sD(n){return[Bz]}const Bz=At.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(mc).map(e=>new r1(n,e)),this.fixed=!n.state.facet(s1);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(s1)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=qe.iter(this.view.state.facet(ah),this.view.viewport.from),i=[],o=this.gutters.map(a=>new _z(a,this.view.viewport,-this.view.documentPadding.top));for(let a of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(a.type)){let r=!0;for(let c of a.type)if(c.type==rn.Text&&r){$y(t,i,c.from);for(let d of o)d.line(this.view,c,i);r=!1}else if(c.widget)for(let d of o)d.widget(this.view,c)}else if(a.type==rn.Text){$y(t,i,a.from);for(let r of o)r.line(this.view,a,i)}else if(a.widget)for(let r of o)r.widget(this.view,a);for(let a of o)a.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(mc),t=n.state.facet(mc),i=n.docChanged||n.heightChanged||n.viewportChanged||!qe.eq(n.startState.facet(ah),n.state.facet(ah),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let o of this.gutters)o.update(n)&&(i=!0);else{i=!0;let o=[];for(let a of t){let r=e.indexOf(a);r<0?o.push(new r1(this.view,a)):(this.gutters[r].update(n),o.push(this.gutters[r]))}for(let a of this.gutters)a.dom.remove(),o.indexOf(a)<0&&a.destroy();for(let a of o)a.config.side=="after"?this.getDOMAfter().appendChild(a.dom):this.dom.appendChild(a.dom);this.gutters=o}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>ue.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,o=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==yt.LTR?{left:i,right:o}:{right:i,left:o}})});function a1(n){return Array.isArray(n)?n:[n]}function $y(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class _z{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=qe.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:o}=this,a=(t.top-this.height)/e.scaleY,r=t.height/e.scaleY;if(this.i==o.elements.length){let c=new aD(e,r,a,i);o.elements.push(c),o.dom.appendChild(c.dom)}else o.elements[this.i].update(e,r,a,i);this.height=t.bottom,this.i++}line(e,t,i){let o=[];$y(this.cursor,o,t.from),i.length&&(o=o.concat(i));let a=this.gutter.config.lineMarker(e,t,o);a&&o.unshift(a);let r=this.gutter;o.length==0&&!r.config.renderEmptyElements||this.addElement(e,t,o)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),o=i?[i]:null;for(let a of e.state.facet(Ez)){let r=a(e,t.widget,t);r&&(o||(o=[])).push(r)}o&&this.addElement(e,t,o)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class r1{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,o=>{let a=o.target,r;if(a!=this.dom&&this.dom.contains(a)){for(;a.parentNode!=this.dom;)a=a.parentNode;let d=a.getBoundingClientRect();r=(d.top+d.bottom)/2}else r=o.clientY;let c=e.lineBlockAtHeight(r-e.documentTop);t.domEventHandlers[i](e,c,o)&&o.preventDefault()});this.markers=a1(t.markers(e)),t.initialSpacer&&(this.spacer=new aD(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=a1(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let o=this.config.updateSpacer(this.spacer.markers[0],e);o!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[o])}let i=e.view.viewport;return!qe.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class aD{constructor(e,t,i,o){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,o)}update(e,t,i,o){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),Hz(this.markers,o)||this.setMarkers(e,o)}setMarkers(e,t){let i="cm-gutterElement",o=this.dom.firstChild;for(let a=0,r=0;;){let c=r,d=a<t.length?t[a++]:null,f=!1;if(d){let m=d.elementClass;m&&(i+=" "+m);for(let g=r;g<this.markers.length;g++)if(this.markers[g].compare(d)){c=g,f=!0;break}}else c=this.markers.length;for(;r<c;){let m=this.markers[r++];if(m.toDOM){m.destroy(o);let g=o.nextSibling;o.remove(),o=g}}if(!d)break;d.toDOM&&(f?o=o.nextSibling:this.dom.insertBefore(d.toDOM(e),o)),f&&r++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}function Hz(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const Uz=pe.define(),zz=pe.define(),xr=pe.define({combine(n){return Xi(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let o in t){let a=i[o],r=t[o];i[o]=a?(c,d,f)=>a(c,d,f)||r(c,d,f):r}return i}})}});class Mg extends Ro{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Ng(n,e){return n.state.facet(xr).formatNumber(e,n.state)}const Fz=mc.compute([xr],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Uz)},lineMarker(e,t,i){return i.some(o=>o.toDOM)?null:new Mg(Ng(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let o of e.state.facet(zz)){let a=o(e,t,i);if(a)return a}return null},lineMarkerChange:e=>e.startState.facet(xr)!=e.state.facet(xr),initialSpacer(e){return new Mg(Ng(e,l1(e.state.doc.lines)))},updateSpacer(e,t){let i=Ng(t.view,l1(t.view.state.doc.lines));return i==e.number?e:new Mg(i)},domEventHandlers:n.facet(xr).domEventHandlers,side:"before"}));function qz(n={}){return[xr.of(n),sD(),Fz]}function l1(n){let e=9;for(;e<n;)e=e*10+9;return e}const Gz=new class extends Ro{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Kz=ah.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let o=n.doc.lineAt(i.head).from;o>t&&(t=o,e.push(Gz.range(o)))}return qe.of(e)});function Vz(){return Kz}const rD=1024;let Wz=0;class Lg{constructor(e,t){this.from=e,this.to=t}}class He{constructor(e={}){this.id=Wz++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Cn.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}He.closedBy=new He({deserialize:n=>n.split(" ")});He.openedBy=new He({deserialize:n=>n.split(" ")});He.group=new He({deserialize:n=>n.split(" ")});He.isolate=new He({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});He.contextHash=new He({perNode:!0});He.lookAhead=new He({perNode:!0});He.mounted=new He({perNode:!0});class gc{constructor(e,t,i,o=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=o}static get(e){return e&&e.props&&e.props[He.mounted.id]}}const Qz=Object.create(null);class Cn{constructor(e,t,i,o=0){this.name=e,this.props=t,this.id=i,this.flags=o}static define(e){let t=e.props&&e.props.length?Object.create(null):Qz,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),o=new Cn(e.name||"",t,e.id,i);if(e.props){for(let a of e.props)if(Array.isArray(a)||(a=a(o)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[a[0].id]=a[1]}}return o}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(He.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let o of i.split(" "))t[o]=e[i];return i=>{for(let o=i.prop(He.group),a=-1;a<(o?o.length:0);a++){let r=t[a<0?i.name:o[a]];if(r)return r}}}}Cn.none=new Cn("",Object.create(null),0,8);class bf{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let o=null;for(let a of e){let r=a(i);if(r){o||(o=Object.assign({},i.props));let c=r[1],d=r[0];d.combine&&d.id in o&&(c=d.combine(o[d.id],c)),o[d.id]=c}}t.push(o?new Cn(i.name,o,i.id,i.flags):i)}return new bf(t)}}const zd=new WeakMap,c1=new WeakMap;var Dt;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(Dt||(Dt={}));class ht{constructor(e,t,i,o,a){if(this.type=e,this.children=t,this.positions=i,this.length=o,this.props=null,a&&a.length){this.props=Object.create(null);for(let[r,c]of a)this.props[typeof r=="number"?r:r.id]=c}}toString(){let e=gc.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let i of this.children){let o=i.toString();o&&(t&&(t+=","),t+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Jy(this.topNode,e)}cursorAt(e,t=0,i=0){let o=zd.get(this)||this.topNode,a=new Jy(o);return a.moveTo(e,t),zd.set(this,a._tree),a}get topNode(){return new di(this,0,0,null)}resolve(e,t=0){let i=Rc(zd.get(this)||this.topNode,e,t,!1);return zd.set(this,i),i}resolveInner(e,t=0){let i=Rc(c1.get(this)||this.topNode,e,t,!0);return c1.set(this,i),i}resolveStack(e,t=0){return Xz(this,e,t)}iterate(e){let{enter:t,leave:i,from:o=0,to:a=this.length}=e,r=e.mode||0,c=(r&Dt.IncludeAnonymous)>0;for(let d=this.cursor(r|Dt.IncludeAnonymous);;){let f=!1;if(d.from<=a&&d.to>=o&&(!c&&d.type.isAnonymous||t(d)!==!1)){if(d.firstChild())continue;f=!0}for(;f&&i&&(c||!d.type.isAnonymous)&&i(d),!d.nextSibling();){if(!d.parent())return;f=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:wx(Cn.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,o)=>new ht(this.type,t,i,o,this.propValues),e.makeTree||((t,i,o)=>new ht(Cn.none,t,i,o)))}static build(e){return Jz(e)}}ht.empty=new ht(Cn.none,[],[],0);class Sx{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Sx(this.buffer,this.index)}}class Cs{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return Cn.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],o=this.set.types[t],a=o.name;if(/\W/.test(a)&&!o.isError&&(a=JSON.stringify(a)),e+=4,i==e)return a;let r=[];for(;e<i;)r.push(this.childString(e)),e=this.buffer[e+3];return a+"("+r.join(",")+")"}findChild(e,t,i,o,a){let{buffer:r}=this,c=-1;for(let d=e;d!=t&&!(lD(a,o,r[d+1],r[d+2])&&(c=d,i>0));d=r[d+3]);return c}slice(e,t,i){let o=this.buffer,a=new Uint16Array(t-e),r=0;for(let c=e,d=0;c<t;){a[d++]=o[c++],a[d++]=o[c++]-i;let f=a[d++]=o[c++]-i;a[d++]=o[c++]-e,r=Math.max(r,f)}return new Cs(a,r,this.set)}}function lD(n,e,t,i){switch(n){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Rc(n,e,t,i){for(var o;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let r=!i&&n instanceof di&&n.index<0?null:n.parent;if(!r)return n;n=r}let a=i?0:Dt.IgnoreOverlays;if(i)for(let r=n,c=r.parent;c;r=c,c=r.parent)r instanceof di&&r.index<0&&((o=c.enter(e,t,a))===null||o===void 0?void 0:o.from)!=r.from&&(n=c);for(;;){let r=n.enter(e,t,a);if(!r)return n;n=r}}class cD{cursor(e=0){return new Jy(this,e)}getChild(e,t=null,i=null){let o=u1(this,e,t,i);return o.length?o[0]:null}getChildren(e,t=null,i=null){return u1(this,e,t,i)}resolve(e,t=0){return Rc(this,e,t,!1)}resolveInner(e,t=0){return Rc(this,e,t,!0)}matchContext(e){return Xy(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let o=t.lastChild;if(!o||o.to!=t.to)break;o.type.isError&&o.from==o.to?(i=t,t=o.prevSibling):t=o}return i}get node(){return this}get next(){return this.parent}}class di extends cD{constructor(e,t,i,o){super(),this._tree=e,this.from=t,this.index=i,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,o,a=0){for(let r=this;;){for(let{children:c,positions:d}=r._tree,f=t>0?c.length:-1;e!=f;e+=t){let m=c[e],g=d[e]+r.from,x;if(!(!(a&Dt.EnterBracketed&&m instanceof ht&&(x=gc.get(m))&&!x.overlay&&x.bracketed&&i>=g&&i<=g+m.length)&&!lD(o,i,g,g+m.length))){if(m instanceof Cs){if(a&Dt.ExcludeBuffers)continue;let v=m.findChild(0,m.buffer.length,t,i-g,o);if(v>-1)return new ms(new Yz(r,m,e,g),null,v)}else if(a&Dt.IncludeAnonymous||!m.type.isAnonymous||kx(m)){let v;if(!(a&Dt.IgnoreMounts)&&(v=gc.get(m))&&!v.overlay)return new di(v.tree,g,e,r);let C=new di(m,g,e,r);return a&Dt.IncludeAnonymous||!C.type.isAnonymous?C:C.nextChild(t<0?m.children.length-1:0,t,i,o,a)}}}if(a&Dt.IncludeAnonymous||!r.type.isAnonymous||(r.index>=0?e=r.index+t:e=t<0?-1:r._parent._tree.children.length,r=r._parent,!r))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let o;if(!(i&Dt.IgnoreOverlays)&&(o=gc.get(this._tree))&&o.overlay){let a=e-this.from,r=i&Dt.EnterBracketed&&o.bracketed;for(let{from:c,to:d}of o.overlay)if((t>0||r?c<=a:c<a)&&(t<0||r?d>=a:d>a))return new di(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function u1(n,e,t,i){let o=n.cursor(),a=[];if(!o.firstChild())return a;if(t!=null){for(let r=!1;!r;)if(r=o.type.is(t),!o.nextSibling())return a}for(;;){if(i!=null&&o.type.is(i))return a;if(o.type.is(e)&&a.push(o.node),!o.nextSibling())return i==null?a:[]}}function Xy(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Yz{constructor(e,t,i,o){this.parent=e,this.buffer=t,this.index=i,this.start=o}}class ms extends cD{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:o}=this.context,a=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.context.start,i);return a<0?null:new ms(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&Dt.ExcludeBuffers)return null;let{buffer:o}=this.context,a=o.findChild(this.index+4,o.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return a<0?null:new ms(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ms(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new ms(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,o=this.index+4,a=i.buffer[this.index+3];if(a>o){let r=i.buffer[this.index+1];e.push(i.slice(o,a,r)),t.push(0)}return new ht(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function uD(n){if(!n.length)return null;let e=0,t=n[0];for(let a=1;a<n.length;a++){let r=n[a];(r.from>t.from||r.to<t.to)&&(t=r,e=a)}let i=t instanceof di&&t.index<0?null:t.parent,o=n.slice();return i?o[e]=i:o.splice(e,1),new $z(o,t)}class $z{constructor(e,t){this.heads=e,this.node=t}get next(){return uD(this.heads)}}function Xz(n,e,t){let i=n.resolveInner(e,t),o=null;for(let a=i instanceof di?i:i.context.parent;a;a=a.parent)if(a.index<0){let r=a.parent;(o||(o=[i])).push(r.resolve(e,t)),a=r}else{let r=gc.get(a.tree);if(r&&r.overlay&&r.overlay[0].from<=e&&r.overlay[r.overlay.length-1].to>=e){let c=new di(r.tree,r.overlay[0].from+a.from,-1,a);(o||(o=[i])).push(Rc(c,e,t,!1))}}return o?uD(o):i}class Jy{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~Dt.EnterBracketed,e instanceof di)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:o}=this.buffer;return this.type=t||o.set.types[o.buffer[e]],this.from=i+o.buffer[e+1],this.to=i+o.buffer[e+2],!0}yield(e){return e?e instanceof di?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:o}=this.buffer,a=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.buffer.start,i);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&Dt.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Dt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Dt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let o=i<0?0:this.stack[i]+4;if(this.index!=o)return this.yieldBuf(t.findChild(o,this.index,-1,0,4))}else{let o=t.buffer[this.index+3];if(o<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(o)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:o}=this;if(o){if(e>0){if(this.index<o.buffer.buffer.length)return!1}else for(let a=0;a<this.index;a++)if(o.buffer.buffer[a+3]<this.index)return!1;({index:t,parent:i}=o)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let a=t+e,r=e<0?-1:i._tree.children.length;a!=r;a+=e){let c=i._tree.children[a];if(this.mode&Dt.IncludeAnonymous||c instanceof Cs||!c.type.isAnonymous||kx(c))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let o=this.index,a=this.stack.length;a>=0;){for(let r=e;r;r=r._parent)if(r.index==o){if(o==this.index)return r;t=r,i=a+1;break e}o=this.stack[--a]}for(let o=i;o<this.stack.length;o++)t=new ms(this.buffer,t,this.stack[o]);return this.bufferNode=new ms(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let o=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&t&&t(this),o=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,o=!0}}}matchContext(e){if(!this.buffer)return Xy(this.node.parent,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let o=e.length-1,a=this.stack.length-1;o>=0;a--){if(a<0)return Xy(this._tree,e,o);let r=i[t.buffer[this.stack[a]]];if(!r.isAnonymous){if(e[o]&&e[o]!=r.name)return!1;o--}}return!0}}function kx(n){return n.children.some(e=>e instanceof Cs||!e.type.isAnonymous||kx(e))}function Jz(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:o=rD,reused:a=[],minRepeatType:r=i.types.length}=n,c=Array.isArray(t)?new Sx(t,t.length):t,d=i.types,f=0,m=0;function g(L,N,j,K,U,z){let{id:X,start:H,end:V,size:ie}=c,oe=m,B=f;if(ie<0)if(c.next(),ie==-1){let de=a[X];j.push(de),K.push(H-L);return}else if(ie==-3){f=X;return}else if(ie==-4){m=X;return}else throw new RangeError(`Unrecognized record size: ${ie}`);let Z=d[X],se,Y,ae=H-L;if(V-H<=o&&(Y=w(c.pos-N,U))){let de=new Uint16Array(Y.size-Y.skip),be=c.pos-Y.size,te=de.length;for(;c.pos>be;)te=P(Y.start,de,te);se=new Cs(de,V-Y.start,i),ae=Y.start-L}else{let de=c.pos-ie;c.next();let be=[],te=[],le=X>=r?X:-1,xe=0,Se=V;for(;c.pos>de;)le>=0&&c.id==le&&c.size>=0?(c.end<=Se-o&&(C(be,te,H,xe,c.end,Se,le,oe,B),xe=be.length,Se=c.end),c.next()):z>2500?x(H,de,be,te):g(H,de,be,te,le,z+1);if(le>=0&&xe>0&&xe<be.length&&C(be,te,H,xe,H,Se,le,oe,B),be.reverse(),te.reverse(),le>-1&&xe>0){let ye=v(Z,B);se=wx(Z,be,te,0,be.length,0,V-H,ye,ye)}else se=k(Z,be,te,V-H,oe-V,B)}j.push(se),K.push(ae)}function x(L,N,j,K){let U=[],z=0,X=-1;for(;c.pos>N;){let{id:H,start:V,end:ie,size:oe}=c;if(oe>4)c.next();else{if(X>-1&&V<X)break;X<0&&(X=ie-o),U.push(H,V,ie),z++,c.next()}}if(z){let H=new Uint16Array(z*4),V=U[U.length-2];for(let ie=U.length-3,oe=0;ie>=0;ie-=3)H[oe++]=U[ie],H[oe++]=U[ie+1]-V,H[oe++]=U[ie+2]-V,H[oe++]=oe;j.push(new Cs(H,U[2]-V,i)),K.push(V-L)}}function v(L,N){return(j,K,U)=>{let z=0,X=j.length-1,H,V;if(X>=0&&(H=j[X])instanceof ht){if(!X&&H.type==L&&H.length==U)return H;(V=H.prop(He.lookAhead))&&(z=K[X]+H.length+V)}return k(L,j,K,U,z,N)}}function C(L,N,j,K,U,z,X,H,V){let ie=[],oe=[];for(;L.length>K;)ie.push(L.pop()),oe.push(N.pop()+j-U);L.push(k(i.types[X],ie,oe,z-U,H-z,V)),N.push(U-j)}function k(L,N,j,K,U,z,X){if(z){let H=[He.contextHash,z];X=X?[H].concat(X):[H]}if(U>25){let H=[He.lookAhead,U];X=X?[H].concat(X):[H]}return new ht(L,N,j,K,X)}function w(L,N){let j=c.fork(),K=0,U=0,z=0,X=j.end-o,H={size:0,start:0,skip:0};e:for(let V=j.pos-L;j.pos>V;){let ie=j.size;if(j.id==N&&ie>=0){H.size=K,H.start=U,H.skip=z,z+=4,K+=4,j.next();continue}let oe=j.pos-ie;if(ie<0||oe<V||j.start<X)break;let B=j.id>=r?4:0,Z=j.start;for(j.next();j.pos>oe;){if(j.size<0)if(j.size==-3||j.size==-4)B+=4;else break e;else j.id>=r&&(B+=4);j.next()}U=Z,K+=ie,z+=B}return(N<0||K==L)&&(H.size=K,H.start=U,H.skip=z),H.size>4?H:void 0}function P(L,N,j){let{id:K,start:U,end:z,size:X}=c;if(c.next(),X>=0&&K<r){let H=j;if(X>4){let V=c.pos-(X-4);for(;c.pos>V;)j=P(L,N,j)}N[--j]=H,N[--j]=z-L,N[--j]=U-L,N[--j]=K}else X==-3?f=K:X==-4&&(m=K);return j}let T=[],M=[];for(;c.pos>0;)g(n.start||0,n.bufferStart||0,T,M,-1,0);let D=(e=n.length)!==null&&e!==void 0?e:T.length?M[0]+T[0].length:0;return new ht(d[n.topID],T.reverse(),M.reverse(),D)}const d1=new WeakMap;function rh(n,e){if(!n.isAnonymous||e instanceof Cs||e.type!=n)return 1;let t=d1.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof ht)){t=1;break}t+=rh(n,i)}d1.set(e,t)}return t}function wx(n,e,t,i,o,a,r,c,d){let f=0;for(let C=i;C<o;C++)f+=rh(n,e[C]);let m=Math.ceil(f*1.5/8),g=[],x=[];function v(C,k,w,P,T){for(let M=w;M<P;){let D=M,L=k[M],N=rh(n,C[M]);for(M++;M<P;M++){let j=rh(n,C[M]);if(N+j>=m)break;N+=j}if(M==D+1){if(N>m){let j=C[D];v(j.children,j.positions,0,j.children.length,k[D]+T);continue}g.push(C[D])}else{let j=k[M-1]+C[M-1].length-L;g.push(wx(n,C,k,D,M,L,j,null,d))}x.push(L+T-a)}}return v(e,t,i,o,0),(c||d)(g,x,r)}class ua{constructor(e,t,i,o,a=!1,r=!1){this.from=e,this.to=t,this.tree=i,this.offset=o,this.open=(a?1:0)|(r?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let o=[new ua(0,e.length,e,0,!1,i)];for(let a of t)a.to>e.length&&o.push(a);return o}static applyChanges(e,t,i=128){if(!t.length)return e;let o=[],a=1,r=e.length?e[0]:null;for(let c=0,d=0,f=0;;c++){let m=c<t.length?t[c]:null,g=m?m.fromA:1e9;if(g-d>=i)for(;r&&r.from<g;){let x=r;if(d>=x.from||g<=x.to||f){let v=Math.max(x.from,d)-f,C=Math.min(x.to,g)-f;x=v>=C?null:new ua(v,C,x.tree,x.offset+f,c>0,!!m)}if(x&&o.push(x),r.to>g)break;r=a<e.length?e[a++]:null}if(!m)break;d=m.toA,f=m.toA-m.toB}return o}}class Ax{startParse(e,t,i){return typeof e=="string"&&(e=new Zz(e)),i=i?i.length?i.map(o=>new Lg(o.from,o.to)):[new Lg(0,0)]:[new Lg(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let o=this.startParse(e,t,i);for(;;){let a=o.advance();if(a)return a}}}class Zz{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new He({perNode:!0});let eF=0,vo=class Zy{constructor(e,t,i,o){this.name=e,this.set=t,this.base=i,this.modified=o,this.id=eF++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof Zy&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let o=new Zy(i,[],null,[]);if(o.set.push(o),t)for(let a of t.set)o.set.push(a);return o}static defineModifier(e){let t=new Mh(e);return i=>i.modified.indexOf(t)>-1?i:Mh.get(i.base||i,i.modified.concat(t).sort((o,a)=>o.id-a.id))}},tF=0;class Mh{constructor(e){this.name=e,this.instances=[],this.id=tF++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(c=>c.base==e&&nF(t,c.modified));if(i)return i;let o=[],a=new vo(e.name,o,e,t);for(let c of t)c.instances.push(a);let r=iF(t);for(let c of e.set)if(!c.modified.length)for(let d of r)o.push(Mh.get(c,d));return a}}function nF(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function iF(n){let e=[[]];for(let t=0;t<n.length;t++)for(let i=0,o=e.length;i<o;i++)e.push(e[i].concat(n[t]));return e.sort((t,i)=>i.length-t.length)}function Ox(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let o of t.split(" "))if(o){let a=[],r=2,c=o;for(let g=0;;){if(c=="..."&&g>0&&g+3==o.length){r=1;break}let x=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c);if(!x)throw new RangeError("Invalid path: "+o);if(a.push(x[0]=="*"?"":x[0][0]=='"'?JSON.parse(x[0]):x[0]),g+=x[0].length,g==o.length)break;let v=o[g++];if(g==o.length&&v=="!"){r=0;break}if(v!="/")throw new RangeError("Invalid path: "+o);c=o.slice(g)}let d=a.length-1,f=a[d];if(!f)throw new RangeError("Invalid path: "+o);let m=new Ec(i,r,d>0?a.slice(0,d):null);e[f]=m.sort(e[f])}}return dD.add(e)}const dD=new He({combine(n,e){let t,i,o;for(;n||e;){if(!n||e&&n.depth>=e.depth?(o=e,e=e.next):(o=n,n=n.next),t&&t.mode==o.mode&&!o.context&&!t.context)continue;let a=new Ec(o.tags,o.mode,o.context);t?t.next=a:i=a,t=a}return i}});class Ec{constructor(e,t,i,o){this.tags=e,this.mode=t,this.context=i,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Ec.empty=new Ec([],2,null);function hD(n,e){let t=Object.create(null);for(let a of n)if(!Array.isArray(a.tag))t[a.tag.id]=a.class;else for(let r of a.tag)t[r.id]=a.class;let{scope:i,all:o=null}=e||{};return{style:a=>{let r=o;for(let c of a)for(let d of c.set){let f=t[d.id];if(f){r=r?r+" "+f:f;break}}return r},scope:i}}function oF(n,e){let t=null;for(let i of n){let o=i.style(e);o&&(t=t?t+" "+o:o)}return t}function sF(n,e,t,i=0,o=n.length){let a=new aF(i,Array.isArray(e)?e:[e],t);a.highlightRange(n.cursor(),i,o,"",a.highlighters),a.flush(o)}class aF{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,o,a){let{type:r,from:c,to:d}=e;if(c>=i||d<=t)return;r.isTop&&(a=this.highlighters.filter(v=>!v.scope||v.scope(r)));let f=o,m=rF(e)||Ec.empty,g=oF(a,m.tags);if(g&&(f&&(f+=" "),f+=g,m.mode==1&&(o+=(o?" ":"")+g)),this.startSpan(Math.max(t,c),f),m.opaque)return;let x=e.tree&&e.tree.prop(He.mounted);if(x&&x.overlay){let v=e.node.enter(x.overlay[0].from+c,1),C=this.highlighters.filter(w=>!w.scope||w.scope(x.tree.type)),k=e.firstChild();for(let w=0,P=c;;w++){let T=w<x.overlay.length?x.overlay[w]:null,M=T?T.from+c:d,D=Math.max(t,P),L=Math.min(i,M);if(D<L&&k)for(;e.from<L&&(this.highlightRange(e,D,L,o,a),this.startSpan(Math.min(L,e.to),f),!(e.to>=M||!e.nextSibling())););if(!T||M>i)break;P=T.to+c,P>t&&(this.highlightRange(v.cursor(),Math.max(t,T.from+c),Math.min(i,P),"",C),this.startSpan(Math.min(i,P),f))}k&&e.parent()}else if(e.firstChild()){x&&(o="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,o,a),this.startSpan(Math.min(i,e.to),f)}while(e.nextSibling());e.parent()}}}function rF(n){let e=n.type.prop(dD);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const he=vo.define,Fd=he(),cs=he(),h1=he(cs),f1=he(cs),us=he(),qd=he(us),Rg=he(us),ji=he(),Xs=he(ji),Ri=he(),Ei=he(),eb=he(),Vl=he(eb),Gd=he(),E={comment:Fd,lineComment:he(Fd),blockComment:he(Fd),docComment:he(Fd),name:cs,variableName:he(cs),typeName:h1,tagName:he(h1),propertyName:f1,attributeName:he(f1),className:he(cs),labelName:he(cs),namespace:he(cs),macroName:he(cs),literal:us,string:qd,docString:he(qd),character:he(qd),attributeValue:he(qd),number:Rg,integer:he(Rg),float:he(Rg),bool:he(us),regexp:he(us),escape:he(us),color:he(us),url:he(us),keyword:Ri,self:he(Ri),null:he(Ri),atom:he(Ri),unit:he(Ri),modifier:he(Ri),operatorKeyword:he(Ri),controlKeyword:he(Ri),definitionKeyword:he(Ri),moduleKeyword:he(Ri),operator:Ei,derefOperator:he(Ei),arithmeticOperator:he(Ei),logicOperator:he(Ei),bitwiseOperator:he(Ei),compareOperator:he(Ei),updateOperator:he(Ei),definitionOperator:he(Ei),typeOperator:he(Ei),controlOperator:he(Ei),punctuation:eb,separator:he(eb),bracket:Vl,angleBracket:he(Vl),squareBracket:he(Vl),paren:he(Vl),brace:he(Vl),content:ji,heading:Xs,heading1:he(Xs),heading2:he(Xs),heading3:he(Xs),heading4:he(Xs),heading5:he(Xs),heading6:he(Xs),contentSeparator:he(ji),list:he(ji),quote:he(ji),emphasis:he(ji),strong:he(ji),link:he(ji),monospace:he(ji),strikethrough:he(ji),inserted:he(),deleted:he(),changed:he(),invalid:he(),meta:Gd,documentMeta:he(Gd),annotation:he(Gd),processingInstruction:he(Gd),definition:vo.defineModifier("definition"),constant:vo.defineModifier("constant"),function:vo.defineModifier("function"),standard:vo.defineModifier("standard"),local:vo.defineModifier("local"),special:vo.defineModifier("special")};for(let n in E){let e=E[n];e instanceof vo&&(e.name=n)}hD([{tag:E.link,class:"tok-link"},{tag:E.heading,class:"tok-heading"},{tag:E.emphasis,class:"tok-emphasis"},{tag:E.strong,class:"tok-strong"},{tag:E.keyword,class:"tok-keyword"},{tag:E.atom,class:"tok-atom"},{tag:E.bool,class:"tok-bool"},{tag:E.url,class:"tok-url"},{tag:E.labelName,class:"tok-labelName"},{tag:E.inserted,class:"tok-inserted"},{tag:E.deleted,class:"tok-deleted"},{tag:E.literal,class:"tok-literal"},{tag:E.string,class:"tok-string"},{tag:E.number,class:"tok-number"},{tag:[E.regexp,E.escape,E.special(E.string)],class:"tok-string2"},{tag:E.variableName,class:"tok-variableName"},{tag:E.local(E.variableName),class:"tok-variableName tok-local"},{tag:E.definition(E.variableName),class:"tok-variableName tok-definition"},{tag:E.special(E.variableName),class:"tok-variableName2"},{tag:E.definition(E.propertyName),class:"tok-propertyName tok-definition"},{tag:E.typeName,class:"tok-typeName"},{tag:E.namespace,class:"tok-namespace"},{tag:E.className,class:"tok-className"},{tag:E.macroName,class:"tok-macroName"},{tag:E.propertyName,class:"tok-propertyName"},{tag:E.operator,class:"tok-operator"},{tag:E.comment,class:"tok-comment"},{tag:E.meta,class:"tok-meta"},{tag:E.invalid,class:"tok-invalid"},{tag:E.punctuation,class:"tok-punctuation"}]);var Eg;const oa=new He;function fD(n){return pe.define({combine:n?e=>e.concat(n):void 0})}const lF=new He;class li{constructor(e,t,i=[],o=""){this.data=e,this.name=o,Qe.prototype.hasOwnProperty("tree")||Object.defineProperty(Qe.prototype,"tree",{get(){return dn(this)}}),this.parser=t,this.extension=[Ss.of(this),Qe.languageData.of((a,r,c)=>{let d=p1(a,r,c),f=d.type.prop(oa);if(!f)return[];let m=a.facet(f),g=d.type.prop(lF);if(g){let x=d.resolve(r-d.from,c);for(let v of g)if(v.test(x,a)){let C=a.facet(v.facet);return v.type=="replace"?C:C.concat(m)}}return m})].concat(i)}isActiveAt(e,t,i=-1){return p1(e,t,i).type.prop(oa)==this.data}findRegions(e){let t=e.facet(Ss);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],o=(a,r)=>{if(a.prop(oa)==this.data){i.push({from:r,to:r+a.length});return}let c=a.prop(He.mounted);if(c){if(c.tree.prop(oa)==this.data){if(c.overlay)for(let d of c.overlay)i.push({from:d.from+r,to:d.to+r});else i.push({from:r,to:r+a.length});return}else if(c.overlay){let d=i.length;if(o(c.tree,c.overlay[0].from+r),i.length>d)return}}for(let d=0;d<a.children.length;d++){let f=a.children[d];f instanceof ht&&o(f,a.positions[d]+r)}};return o(dn(e),0),i}get allowsNesting(){return!0}}li.setState=Le.define();function p1(n,e,t){let i=n.facet(Ss),o=dn(n).topNode;if(!i||i.allowsNesting)for(let a=o;a;a=a.enter(e,t,Dt.ExcludeBuffers|Dt.EnterBracketed))a.type.isTop&&(o=a);return o}class jc extends li{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=fD(e.languageData);return new jc(t,e.parser.configure({props:[oa.add(i=>i.isTop?t:void 0)]}),e.name)}configure(e,t){return new jc(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function dn(n){let e=n.field(li.state,!1);return e?e.tree:ht.empty}class cF{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Wl=null;class Ur{constructor(e,t,i=[],o,a,r,c,d){this.parser=e,this.state=t,this.fragments=i,this.tree=o,this.treeLen=a,this.viewport=r,this.skipped=c,this.scheduleOn=d,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Ur(e,t,[],ht.empty,0,i,[],null)}startParse(){return this.parser.startParse(new cF(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=ht.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let o=Date.now()+e;e=()=>Date.now()>o}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let o=this.parse.advance();if(o)if(this.fragments=this.withoutTempSkipped(ua.addTree(o,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=o,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(ua.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Wl;Wl=this;try{return e()}finally{Wl=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=m1(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:o,treeLen:a,viewport:r,skipped:c}=this;if(this.takeTree(),!e.empty){let d=[];if(e.iterChangedRanges((f,m,g,x)=>d.push({fromA:f,toA:m,fromB:g,toB:x})),i=ua.applyChanges(i,d),o=ht.empty,a=0,r={from:e.mapPos(r.from,-1),to:e.mapPos(r.to,1)},this.skipped.length){c=[];for(let f of this.skipped){let m=e.mapPos(f.from,1),g=e.mapPos(f.to,-1);m<g&&c.push({from:m,to:g})}}}return new Ur(this.parser,t,i,o,a,r,c,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:o,to:a}=this.skipped[i];o<e.to&&a>e.from&&(this.fragments=m1(this.fragments,o,a),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ax{createParse(t,i,o){let a=o[0].from,r=o[o.length-1].to;return{parsedPos:a,advance(){let d=Wl;if(d){for(let f of o)d.tempSkipped.push(f);e&&(d.scheduleOn=d.scheduleOn?Promise.all([d.scheduleOn,e]):e)}return this.parsedPos=r,new ht(Cn.none,[],[],r-a)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Wl}}function m1(n,e,t){return ua.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class zr{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new zr(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Ur.create(e.facet(Ss).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new zr(i)}}li.state=hn.define({create:zr.init,update(n,e){for(let t of e.effects)if(t.is(li.setState))return t.value;return e.startState.facet(Ss)!=e.state.facet(Ss)?zr.init(e.state):n.apply(e)}});let pD=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(pD=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const jg=typeof navigator<"u"&&(!((Eg=navigator.scheduling)===null||Eg===void 0)&&Eg.isInputPending)?()=>navigator.scheduling.isInputPending():null,uF=At.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(li.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(li.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=pD(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:o}}=this.view,a=i.field(li.state);if(a.tree==a.context.tree&&a.context.isDone(o+1e5))return;let r=Date.now()+Math.min(this.chunkBudget,100,e&&!jg?Math.max(25,e.timeRemaining()-5):1e9),c=a.context.treeLen<o&&i.doc.length>o+1e3,d=a.context.work(()=>jg&&jg()||Date.now()>r,o+(c?0:1e5));this.chunkBudget-=Date.now()-t,(d||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:li.setState.of(new zr(a.context))})),this.chunkBudget>0&&!(d&&!c)&&this.scheduleWork(),this.checkAsyncSchedule(a.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>En(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ss=pe.define({combine(n){return n.length?n[0]:null},enables:n=>[li.state,uF,ue.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class mD{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const dF=pe.define(),xf=pe.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function xa(n){let e=n.facet(xf);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Ic(n,e){let t="",i=n.tabSize,o=n.facet(xf)[0];if(o==" "){for(;e>=i;)t+=" ",e-=i;o=" "}for(let a=0;a<e;a++)t+=o;return t}function Px(n,e){n instanceof Qe&&(n=new vf(n));for(let i of n.state.facet(dF)){let o=i(n,e);if(o!==void 0)return o}let t=dn(n.state);return t.length>=e?hF(n,t,e):null}class vf{constructor(e,t={}){this.state=e,this.options=t,this.unit=xa(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:o,simulateDoubleBreak:a}=this.options;return o!=null&&o>=i.from&&o<=i.to?a&&o==e?{text:"",from:e}:(t<0?o<e:o<=e)?{text:i.text.slice(o-i.from),from:o}:{text:i.text.slice(0,o-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:o}=this.lineAt(e,t);return i.slice(e-o,Math.min(i.length,e+100-o))}column(e,t=1){let{text:i,from:o}=this.lineAt(e,t),a=this.countColumn(i,e-o),r=this.options.overrideIndentation?this.options.overrideIndentation(o):-1;return r>-1&&(a+=r-this.countColumn(i,i.search(/\S|$/))),a}countColumn(e,t=e.length){return Vr(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:o}=this.lineAt(e,t),a=this.options.overrideIndentation;if(a){let r=a(o);if(r>-1)return r}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Cf=new He;function hF(n,e,t){let i=e.resolveStack(t),o=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(o!=i.node){let a=[];for(let r=o;r&&!(r.from<i.node.from||r.to>i.node.to||r.from==i.node.from&&r.type==i.node.type);r=r.parent)a.push(r);for(let r=a.length-1;r>=0;r--)i={node:a[r],next:i}}return gD(i,n,t)}function gD(n,e,t){for(let i=n;i;i=i.next){let o=pF(i.node);if(o)return o(Tx.create(e,t,i))}return 0}function fF(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function pF(n){let e=n.type.prop(Cf);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(He.closedBy))){let o=n.lastChild,a=o&&i.indexOf(o.name)>-1;return r=>yD(r,!0,1,void 0,a&&!fF(r)?o.from:void 0)}return n.parent==null?mF:null}function mF(){return 0}class Tx extends vf{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new Tx(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(gF(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return gD(this.context.next,this.base,this.pos)}}function gF(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function yF(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let o=n.options.simulateBreak,a=n.state.doc.lineAt(t.from),r=o==null||o<=a.from?a.to:Math.min(a.to,o);for(let c=t.to;;){let d=e.childAfter(c);if(!d||d==i)return null;if(!d.type.isSkipped){if(d.from>=r)return null;let f=/^ */.exec(a.text.slice(t.to-a.from))[0].length;return{from:t.from,to:t.to+f}}c=d.to}}function g1({closing:n,align:e=!0,units:t=1}){return i=>yD(i,e,t,n)}function yD(n,e,t,i,o){let a=n.textAfter,r=a.match(/^\s*/)[0].length,c=i&&a.slice(r,r+i.length)==i||o==n.pos+r,d=e?yF(n):null;return d?c?n.column(d.from):n.column(d.to):n.baseIndent+(c?0:n.unit*t)}function y1({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const bF=200;function xF(){return Qe.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,o=t.lineAt(i);if(i>o.from+bF)return n;let a=t.sliceString(o.from,i);if(!e.some(f=>f.test(a)))return n;let{state:r}=n,c=-1,d=[];for(let{head:f}of r.selection.ranges){let m=r.doc.lineAt(f);if(m.from==c)continue;c=m.from;let g=Px(r,m.from);if(g==null)continue;let x=/^\s*/.exec(m.text)[0],v=Ic(r,g);x!=v&&d.push({from:m.from,to:m.from+x.length,insert:v})}return d.length?[n,{changes:d,sequential:!0}]:n})}const vF=pe.define(),Dx=new He;function bD(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function CF(n,e,t){let i=dn(n);if(i.length<t)return null;let o=i.resolveStack(t,1),a=null;for(let r=o;r;r=r.next){let c=r.node;if(c.to<=t||c.from>t)continue;if(a&&c.from<e)break;let d=c.type.prop(Dx);if(d&&(c.to<i.length-50||i.length==n.doc.length||!SF(c))){let f=d(c,n);f&&f.from<=t&&f.from>=e&&f.to>t&&(a=f)}}return a}function SF(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Nh(n,e,t){for(let i of n.facet(vF)){let o=i(n,e,t);if(o)return o}return CF(n,e,t)}function xD(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const Sf=Le.define({map:xD}),Zc=Le.define({map:xD});function vD(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const va=hn.define({create(){return Oe.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,i)=>n=b1(n,t,i)),n=n.map(e.changes);for(let t of e.effects)if(t.is(Sf)&&!kF(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(kD),o=i?Oe.replace({widget:new MF(i(e.state,t.value))}):x1;n=n.update({add:[o.range(t.value.from,t.value.to)]})}else t.is(Zc)&&(n=n.update({filter:(i,o)=>t.value.from!=i||t.value.to!=o,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(n=b1(n,e.selection.main.head)),n},provide:n=>ue.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,o)=>{t.push(i,o)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let i=n[t++],o=n[t++];if(typeof i!="number"||typeof o!="number")throw new RangeError("Invalid JSON for fold state");e.push(x1.range(i,o))}return Oe.set(e,!0)}});function b1(n,e,t=e){let i=!1;return n.between(e,t,(o,a)=>{o<t&&a>e&&(i=!0)}),i?n.update({filterFrom:e,filterTo:t,filter:(o,a)=>o>=t||a<=e}):n}function Lh(n,e,t){var i;let o=null;return(i=n.field(va,!1))===null||i===void 0||i.between(e,t,(a,r)=>{(!o||o.from>a)&&(o={from:a,to:r})}),o}function kF(n,e,t){let i=!1;return n.between(e,e,(o,a)=>{o==e&&a==t&&(i=!0)}),i}function CD(n,e){return n.field(va,!1)?e:e.concat(Le.appendConfig.of(wD()))}const wF=n=>{for(let e of vD(n)){let t=Nh(n.state,e.from,e.to);if(t)return n.dispatch({effects:CD(n.state,[Sf.of(t),SD(n,t)])}),!0}return!1},AF=n=>{if(!n.state.field(va,!1))return!1;let e=[];for(let t of vD(n)){let i=Lh(n.state,t.from,t.to);i&&e.push(Zc.of(i),SD(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function SD(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,o=n.state.doc.lineAt(e.to).number;return ue.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${o}.`)}const OF=n=>{let{state:e}=n,t=[];for(let i=0;i<e.doc.length;){let o=n.lineBlockAt(i),a=Nh(e,o.from,o.to);a&&t.push(Sf.of(a)),i=(a?n.lineBlockAt(a.to):o).to+1}return t.length&&n.dispatch({effects:CD(n.state,t)}),!!t.length},PF=n=>{let e=n.state.field(va,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,o)=>{t.push(Zc.of({from:i,to:o}))}),n.dispatch({effects:t}),!0},TF=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:wF},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:AF},{key:"Ctrl-Alt-[",run:OF},{key:"Ctrl-Alt-]",run:PF}],DF={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},kD=pe.define({combine(n){return Xi(n,DF)}});function wD(n){return[va,RF]}function AD(n,e){let{state:t}=n,i=t.facet(kD),o=r=>{let c=n.lineBlockAt(n.posAtDOM(r.target)),d=Lh(n.state,c.from,c.to);d&&n.dispatch({effects:Zc.of(d)}),r.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,o,e);let a=document.createElement("span");return a.textContent=i.placeholderText,a.setAttribute("aria-label",t.phrase("folded code")),a.title=t.phrase("unfold"),a.className="cm-foldPlaceholder",a.onclick=o,a}const x1=Oe.replace({widget:new class extends Ji{toDOM(n){return AD(n,null)}}});class MF extends Ji{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return AD(e,this.value)}}const NF={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Ig extends Ro{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function LF(n={}){let e={...NF,...n},t=new Ig(e,!0),i=new Ig(e,!1),o=At.fromClass(class{constructor(r){this.from=r.viewport.from,this.markers=this.buildMarkers(r)}update(r){(r.docChanged||r.viewportChanged||r.startState.facet(Ss)!=r.state.facet(Ss)||r.startState.field(va,!1)!=r.state.field(va,!1)||dn(r.startState)!=dn(r.state)||e.foldingChanged(r))&&(this.markers=this.buildMarkers(r.view))}buildMarkers(r){let c=new Yi;for(let d of r.viewportLineBlocks){let f=Lh(r.state,d.from,d.to)?i:Nh(r.state,d.from,d.to)?t:null;f&&c.add(d.from,d.from,f)}return c.finish()}}),{domEventHandlers:a}=e;return[o,Iz({class:"cm-foldGutter",markers(r){var c;return((c=r.plugin(o))===null||c===void 0?void 0:c.markers)||qe.empty},initialSpacer(){return new Ig(e,!1)},domEventHandlers:{...a,click:(r,c,d)=>{if(a.click&&a.click(r,c,d))return!0;let f=Lh(r.state,c.from,c.to);if(f)return r.dispatch({effects:Zc.of(f)}),!0;let m=Nh(r.state,c.from,c.to);return m?(r.dispatch({effects:Sf.of(m)}),!0):!1}}}),wD()]}const RF=ue.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Wr{constructor(e,t){this.specs=e;let i;function o(c){let d=bs.newName();return(i||(i=Object.create(null)))["."+d]=c,d}const a=typeof t.all=="string"?t.all:t.all?o(t.all):void 0,r=t.scope;this.scope=r instanceof li?c=>c.prop(oa)==r.data:r?c=>c==r:void 0,this.style=hD(e.map(c=>({tag:c.tag,class:c.class||o(Object.assign({},c,{tag:null}))})),{all:a}).style,this.module=i?new bs(i):null,this.themeType=t.themeType}static define(e,t){return new Wr(e,t||{})}}const tb=pe.define(),OD=pe.define({combine(n){return n.length?[n[0]]:null}});function Bg(n){let e=n.facet(tb);return e.length?e:n.facet(OD)}function Mx(n,e){let t=[jF],i;return n instanceof Wr&&(n.module&&t.push(ue.styleModule.of(n.module)),i=n.themeType),e?.fallback?t.push(OD.of(n)):i?t.push(tb.computeN([ue.darkTheme],o=>o.facet(ue.darkTheme)==(i=="dark")?[n]:[])):t.push(tb.of(n)),t}class EF{constructor(e){this.markCache=Object.create(null),this.tree=dn(e.state),this.decorations=this.buildDeco(e,Bg(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=dn(e.state),i=Bg(e.state),o=i!=Bg(e.startState),{viewport:a}=e.view,r=e.changes.mapPos(this.decoratedTo,1);t.length<a.to&&!o&&t.type==this.tree.type&&r>=a.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=r):(t!=this.tree||e.viewportChanged||o)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=a.to)}buildDeco(e,t){if(!t||!this.tree.length)return Oe.none;let i=new Yi;for(let{from:o,to:a}of e.visibleRanges)sF(this.tree,t,(r,c,d)=>{i.add(r,c,this.markCache[d]||(this.markCache[d]=Oe.mark({class:d})))},o,a);return i.finish()}}const jF=Sa.high(At.fromClass(EF,{decorations:n=>n.decorations})),IF=Wr.define([{tag:E.meta,color:"#404740"},{tag:E.link,textDecoration:"underline"},{tag:E.heading,textDecoration:"underline",fontWeight:"bold"},{tag:E.emphasis,fontStyle:"italic"},{tag:E.strong,fontWeight:"bold"},{tag:E.strikethrough,textDecoration:"line-through"},{tag:E.keyword,color:"#708"},{tag:[E.atom,E.bool,E.url,E.contentSeparator,E.labelName],color:"#219"},{tag:[E.literal,E.inserted],color:"#164"},{tag:[E.string,E.deleted],color:"#a11"},{tag:[E.regexp,E.escape,E.special(E.string)],color:"#e40"},{tag:E.definition(E.variableName),color:"#00f"},{tag:E.local(E.variableName),color:"#30a"},{tag:[E.typeName,E.namespace],color:"#085"},{tag:E.className,color:"#167"},{tag:[E.special(E.variableName),E.macroName],color:"#256"},{tag:E.definition(E.propertyName),color:"#00c"},{tag:E.comment,color:"#940"},{tag:E.invalid,color:"#f00"}]),BF=ue.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),PD=1e4,TD="()[]{}",DD=pe.define({combine(n){return Xi(n,{afterCursor:!0,brackets:TD,maxScanDistance:PD,renderMatch:UF})}}),_F=Oe.mark({class:"cm-matchingBracket"}),HF=Oe.mark({class:"cm-nonmatchingBracket"});function UF(n){let e=[],t=n.matched?_F:HF;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function v1(n){let e=[],t=n.facet(DD);for(let i of n.selection.ranges){if(!i.empty)continue;let o=qi(n,i.head,-1,t)||i.head>0&&qi(n,i.head-1,1,t)||t.afterCursor&&(qi(n,i.head,1,t)||i.head<n.doc.length&&qi(n,i.head+1,-1,t));o&&(e=e.concat(t.renderMatch(o,n)))}return Oe.set(e,!0)}const zF=At.fromClass(class{constructor(n){this.paused=!1,this.decorations=v1(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=v1(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),FF=[zF,BF];function qF(n={}){return[DD.of(n),FF]}const GF=new He;function nb(n,e,t){let i=n.prop(e<0?He.openedBy:He.closedBy);if(i)return i;if(n.name.length==1){let o=t.indexOf(n.name);if(o>-1&&o%2==(e<0?1:0))return[t[o+e]]}return null}function ib(n){let e=n.type.prop(GF);return e?e(n.node):n}function qi(n,e,t,i={}){let o=i.maxScanDistance||PD,a=i.brackets||TD,r=dn(n),c=r.resolveInner(e,t);for(let d=c;d;d=d.parent){let f=nb(d.type,t,a);if(f&&d.from<d.to){let m=ib(d);if(m&&(t>0?e>=m.from&&e<m.to:e>m.from&&e<=m.to))return KF(n,e,t,d,m,f,a)}}return VF(n,e,t,r,c.type,o,a)}function KF(n,e,t,i,o,a,r){let c=i.parent,d={from:o.from,to:o.to},f=0,m=c?.cursor();if(m&&(t<0?m.childBefore(i.from):m.childAfter(i.to)))do if(t<0?m.to<=i.from:m.from>=i.to){if(f==0&&a.indexOf(m.type.name)>-1&&m.from<m.to){let g=ib(m);return{start:d,end:g?{from:g.from,to:g.to}:void 0,matched:!0}}else if(nb(m.type,t,r))f++;else if(nb(m.type,-t,r)){if(f==0){let g=ib(m);return{start:d,end:g&&g.from<g.to?{from:g.from,to:g.to}:void 0,matched:!1}}f--}}while(t<0?m.prevSibling():m.nextSibling());return{start:d,matched:!1}}function VF(n,e,t,i,o,a,r){if(t<0?!e:e==n.doc.length)return null;let c=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),d=r.indexOf(c);if(d<0||d%2==0!=t>0)return null;let f={from:t<0?e-1:e,to:t>0?e+1:e},m=n.doc.iterRange(e,t>0?n.doc.length:0),g=0;for(let x=0;!m.next().done&&x<=a;){let v=m.value;t<0&&(x+=v.length);let C=e+x*t;for(let k=t>0?0:v.length-1,w=t>0?v.length:-1;k!=w;k+=t){let P=r.indexOf(v[k]);if(!(P<0||i.resolveInner(C+k,1).type!=o))if(P%2==0==t>0)g++;else{if(g==1)return{start:f,end:{from:C+k,to:C+k+1},matched:P>>1==d>>1};g--}}t>0&&(x+=v.length)}return m.done?{start:f,matched:!1}:null}function C1(n,e,t,i=0,o=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let a=o;for(let r=i;r<e;r++)n.charCodeAt(r)==9?a+=t-a%t:a++;return a}class MD{constructor(e,t,i,o){this.string=e,this.tabSize=t,this.indentUnit=i,this.overrideIndent=o,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e instanceof RegExp?e.test(t):e(t)),i)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=C1(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:C1(this.string,null,this.tabSize)}match(e,t,i){if(typeof e=="string"){let o=r=>i?r.toLowerCase():r,a=this.string.substr(this.pos,e.length);return o(a)==o(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}}current(){return this.string.slice(this.start,this.pos)}}function WF(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||QF,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||Rx,mergeTokens:n.mergeTokens!==!1}}function QF(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const S1=new WeakMap;class Nx extends li{constructor(e){let t=fD(e.languageData),i=WF(e),o,a=new class extends Ax{createParse(r,c,d){return new $F(o,r,c,d)}};super(t,a,[],e.name),this.topNode=ZF(t,this),o=this,this.streamParser=i,this.stateAfter=new He({perNode:!0}),this.tokenTable=e.tokenTable?new ED(i.tokenTable):JF}static define(e){return new Nx(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=S1.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let o=Lx(this,e.node.tree,e.node.from,e.node.from,t??e.pos),a,r;if(o?(r=o.state,a=o.pos+1):(r=this.streamParser.startState(e.unit),a=e.node.from),e.pos-a>1e4)return null;for(;a<e.pos;){let d=e.state.doc.lineAt(a),f=Math.min(e.pos,d.to);if(d.length){let m=i?i(d.from):-1,g=new MD(d.text,e.state.tabSize,e.unit,m<0?void 0:m);for(;g.pos<f-d.from;)LD(this.streamParser.token,g,r)}else this.streamParser.blankLine(r,e.unit);if(f==e.pos)break;a=d.to+1}let c=e.lineAt(e.pos);return i&&t==null&&S1.set(e.state,c.from),this.streamParser.indent(r,/^\s*(.*)/.exec(c.text)[1],e)}get allowsNesting(){return!1}}function Lx(n,e,t,i,o){let a=t>=i&&t+e.length<=o&&e.prop(n.stateAfter);if(a)return{state:n.streamParser.copyState(a),pos:t+e.length};for(let r=e.children.length-1;r>=0;r--){let c=e.children[r],d=t+e.positions[r],f=c instanceof ht&&d<o&&Lx(n,c,d,i,o);if(f)return f}return null}function ND(n,e,t,i,o){if(o&&t<=0&&i>=e.length)return e;!o&&t==0&&e.type==n.topNode&&(o=!0);for(let a=e.children.length-1;a>=0;a--){let r=e.positions[a],c=e.children[a],d;if(r<i&&c instanceof ht){if(!(d=ND(n,c,t-r,i-r,o)))break;return o?new ht(e.type,e.children.slice(0,a).concat(d),e.positions.slice(0,a+1),r+d.length):d}}return null}function YF(n,e,t,i,o){for(let a of e){let r=a.from+(a.openStart?25:0),c=a.to-(a.openEnd?25:0),d=r<=t&&c>t&&Lx(n,a.tree,0-a.offset,t,c),f;if(d&&d.pos<=i&&(f=ND(n,a.tree,t+a.offset,d.pos+a.offset,!1)))return{state:d.state,tree:f}}return{state:n.streamParser.startState(o?xa(o):4),tree:ht.empty}}let $F=class{constructor(e,t,i,o){this.lang=e,this.input=t,this.fragments=i,this.ranges=o,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=o[o.length-1].to;let a=Ur.get(),r=o[0].from,{state:c,tree:d}=YF(e,i,r,this.to,a?.state);this.state=c,this.parsedPos=this.chunkStart=r+d.length;for(let f=0;f<d.children.length;f++)this.chunks.push(d.children[f]),this.chunkPos.push(d.positions[f]);a&&this.parsedPos<a.viewport.from-1e5&&o.some(f=>f.from<=a.viewport.from&&f.to>=a.viewport.from)&&(this.state=this.lang.streamParser.startState(xa(a.state)),a.skipUntilInView(this.parsedPos,a.viewport.from),this.parsedPos=a.viewport.from),this.moveRangeIndex()}advance(){let e=Ur.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos<i;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
28
+ `&&(t="");else{let i=t.indexOf(`
29
+ `);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let o=this.rangeIndex;;){let a=this.ranges[o].to;if(a>=i||(t=t.slice(0,a-(i-t.length)),o++,o==this.ranges.length))break;let r=this.ranges[o].from,c=this.lineAfter(r);t+=c,i=r+c.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let o=this.ranges[this.rangeIndex].to,a=e+t;if(i>0?o>a:o>=a)break;let r=this.ranges[++this.rangeIndex].from;t+=r-o}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,o){let a=4;if(this.ranges.length>1){o=this.skipGapsTo(t,o,1),t+=o;let c=this.chunk.length;o=this.skipGapsTo(i,o,-1),i+=o,a+=this.chunk.length-c}let r=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&a==4&&r>=0&&this.chunk[r]==e&&this.chunk[r+2]==t?this.chunk[r+2]=i:this.chunk.push(e,t,i,a),o}parseLine(e){let{line:t,end:i}=this.nextLine(),o=0,{streamParser:a}=this.lang,r=new MD(t,e?e.state.tabSize:4,e?xa(e.state):2);if(r.eol())a.blankLine(this.state,r.indentUnit);else for(;!r.eol();){let c=LD(a.token,r,this.state);if(c&&(o=this.emitToken(this.lang.tokenTable.resolve(c),this.parsedPos+r.start,this.parsedPos+r.pos,o)),r.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=ht.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:XF,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new ht(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new ht(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function LD(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let o=n(e,t);if(e.pos>e.start)return o}throw new Error("Stream parser failed to advance stream.")}const Rx=Object.create(null),Bc=[Cn.none],XF=new bf(Bc),k1=[],w1=Object.create(null),RD=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])RD[n]=jD(Rx,e);class ED{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),RD)}resolve(e){return e?this.table[e]||(this.table[e]=jD(this.extra,e)):0}}const JF=new ED(Rx);function _g(n,e){k1.indexOf(n)>-1||(k1.push(n),console.warn(e))}function jD(n,e){let t=[];for(let c of e.split(" ")){let d=[];for(let f of c.split(".")){let m=n[f]||E[f];m?typeof m=="function"?d.length?d=d.map(m):_g(f,`Modifier ${f} used at start of tag`):d.length?_g(f,`Tag ${f} used as modifier`):d=Array.isArray(m)?m:[m]:_g(f,`Unknown highlighting tag ${f}`)}for(let f of d)t.push(f)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),o=i+" "+t.map(c=>c.id),a=w1[o];if(a)return a.id;let r=w1[o]=Cn.define({id:Bc.length,name:i,props:[Ox({[i]:t})]});return Bc.push(r),r.id}function ZF(n,e){let t=Cn.define({id:Bc.length,name:"Document",props:[oa.add(()=>n),Cf.add(()=>i=>e.getIndent(i))],top:!0});return Bc.push(t),t}yt.RTL,yt.LTR;const e6=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=jx(n.state,t.from);return i.line?t6(n):i.block?i6(n):!1};function Ex(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let o=n(e,t);return o?(i(t.update(o)),!0):!1}}const t6=Ex(a6,0),n6=Ex(ID,0),i6=Ex((n,e)=>ID(n,e,s6(e)),0);function jx(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Ql=50;function o6(n,{open:e,close:t},i,o){let a=n.sliceDoc(i-Ql,i),r=n.sliceDoc(o,o+Ql),c=/\s*$/.exec(a)[0].length,d=/^\s*/.exec(r)[0].length,f=a.length-c;if(a.slice(f-e.length,f)==e&&r.slice(d,d+t.length)==t)return{open:{pos:i-c,margin:c&&1},close:{pos:o+d,margin:d&&1}};let m,g;o-i<=2*Ql?m=g=n.sliceDoc(i,o):(m=n.sliceDoc(i,i+Ql),g=n.sliceDoc(o-Ql,o));let x=/^\s*/.exec(m)[0].length,v=/\s*$/.exec(g)[0].length,C=g.length-v-t.length;return m.slice(x,x+e.length)==e&&g.slice(C,C+t.length)==t?{open:{pos:i+x+e.length,margin:/\s/.test(m.charAt(x+e.length))?1:0},close:{pos:o-v-t.length,margin:/\s/.test(g.charAt(C-1))?1:0}}:null}function s6(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),o=t.to<=i.to?i:n.doc.lineAt(t.to);o.from>i.from&&o.from==t.to&&(o=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let a=e.length-1;a>=0&&e[a].to>i.from?e[a].to=o.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:o.to})}return e}function ID(n,e,t=e.selection.ranges){let i=t.map(a=>jx(e,a.from).block);if(!i.every(a=>a))return null;let o=t.map((a,r)=>o6(e,i[r],a.from,a.to));if(n!=2&&!o.every(a=>a))return{changes:e.changes(t.map((a,r)=>o[r]?[]:[{from:a.from,insert:i[r].open+" "},{from:a.to,insert:" "+i[r].close}]))};if(n!=1&&o.some(a=>a)){let a=[];for(let r=0,c;r<o.length;r++)if(c=o[r]){let d=i[r],{open:f,close:m}=c;a.push({from:f.pos-d.open.length,to:f.pos+f.margin},{from:m.pos-m.margin,to:m.pos+d.close.length})}return{changes:a}}return null}function a6(n,e,t=e.selection.ranges){let i=[],o=-1;e:for(let{from:a,to:r}of t){let c=i.length,d=1e9,f;for(let m=a;m<=r;){let g=e.doc.lineAt(m);if(f==null&&(f=jx(e,g.from).line,!f))continue e;if(g.from>o&&(a==r||r>g.from)){o=g.from;let x=/^\s*/.exec(g.text)[0].length,v=x==g.length,C=g.text.slice(x,x+f.length)==f?x:-1;x<g.text.length&&x<d&&(d=x),i.push({line:g,comment:C,token:f,indent:x,empty:v,single:!1})}m=g.to+1}if(d<1e9)for(let m=c;m<i.length;m++)i[m].indent<i[m].line.text.length&&(i[m].indent=d);i.length==c+1&&(i[c].single=!0)}if(n!=2&&i.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:c,token:d,indent:f,empty:m,single:g}of i)(g||!m)&&a.push({from:c.from+f,insert:d+" "});let r=e.changes(a);return{changes:r,selection:e.selection.map(r,1)}}else if(n!=1&&i.some(a=>a.comment>=0)){let a=[];for(let{line:r,comment:c,token:d}of i)if(c>=0){let f=r.from+c,m=f+d.length;r.text[m-r.from]==" "&&m++,a.push({from:f,to:m})}return{changes:a}}return null}const ob=$i.define(),r6=$i.define(),l6=pe.define(),BD=pe.define({combine(n){return Xi(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,o)=>e(i,o)||t(i,o)})}}),_D=hn.define({create(){return Gi.empty},update(n,e){let t=e.state.facet(BD),i=e.annotation(ob);if(i){let d=jn.fromTransaction(e,i.selection),f=i.side,m=f==0?n.undone:n.done;return d?m=Rh(m,m.length,t.minDepth,d):m=zD(m,e.startState.selection),new Gi(f==0?i.rest:m,f==0?m:i.rest)}let o=e.annotation(r6);if((o=="full"||o=="before")&&(n=n.isolate()),e.annotation(Gt.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let a=jn.fromTransaction(e),r=e.annotation(Gt.time),c=e.annotation(Gt.userEvent);return a?n=n.addChanges(a,r,c,t,e):e.selection&&(n=n.addSelection(e.startState.selection,r,c,t.newGroupDelay)),(o=="full"||o=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Gi(n.done.map(jn.fromJSON),n.undone.map(jn.fromJSON))}});function c6(n={}){return[_D,BD.of(n),ue.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?HD:e.inputType=="historyRedo"?sb:null;return i?(e.preventDefault(),i(t)):!1}})]}function kf(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let o=t.field(_D,!1);if(!o)return!1;let a=o.pop(n,t,e);return a?(i(a),!0):!1}}const HD=kf(0,!1),sb=kf(1,!1),u6=kf(0,!0),d6=kf(1,!0);class jn{constructor(e,t,i,o,a){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=o,this.selectionsAfter=a}setSelAfter(e){return new jn(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(o=>o.toJSON())}}static fromJSON(e){return new jn(e.changes&&qt.fromJSON(e.changes),[],e.mapped&&Wi.fromJSON(e.mapped),e.startSelection&&J.fromJSON(e.startSelection),e.selectionsAfter.map(J.fromJSON))}static fromTransaction(e,t){let i=ci;for(let o of e.startState.facet(l6)){let a=o(e);a.length&&(i=i.concat(a))}return!i.length&&e.changes.empty?null:new jn(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,ci)}static selection(e){return new jn(void 0,ci,void 0,void 0,e)}}function Rh(n,e,t,i){let o=e+1>t+20?e-t-1:0,a=n.slice(o,e);return a.push(i),a}function h6(n,e){let t=[],i=!1;return n.iterChangedRanges((o,a)=>t.push(o,a)),e.iterChangedRanges((o,a,r,c)=>{for(let d=0;d<t.length;){let f=t[d++],m=t[d++];c>=f&&r<=m&&(i=!0)}}),i}function f6(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function UD(n,e){return n.length?e.length?n.concat(e):n:e}const ci=[],p6=200;function zD(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-p6));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Rh(n,n.length-1,1e9,t.setSelAfter(i)))}else return[jn.selection([e])]}function m6(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Hg(n,e){if(!n.length)return n;let t=n.length,i=ci;for(;t;){let o=g6(n[t-1],e,i);if(o.changes&&!o.changes.empty||o.effects.length){let a=n.slice(0,t);return a[t-1]=o,a}else e=o.mapped,t--,i=o.selectionsAfter}return i.length?[jn.selection(i)]:ci}function g6(n,e,t){let i=UD(n.selectionsAfter.length?n.selectionsAfter.map(c=>c.map(e)):ci,t);if(!n.changes)return jn.selection(i);let o=n.changes.map(e),a=e.mapDesc(n.changes,!0),r=n.mapped?n.mapped.composeDesc(a):a;return new jn(o,Le.mapEffects(n.effects,e),r,n.startSelection.map(a),i)}const y6=/^(input\.type|delete)($|\.)/;class Gi{constructor(e,t,i=0,o=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=o}isolate(){return this.prevTime?new Gi(this.done,this.undone):this}addChanges(e,t,i,o,a){let r=this.done,c=r[r.length-1];return c&&c.changes&&!c.changes.empty&&e.changes&&(!i||y6.test(i))&&(!c.selectionsAfter.length&&t-this.prevTime<o.newGroupDelay&&o.joinToEvent(a,h6(c.changes,e.changes))||i=="input.type.compose")?r=Rh(r,r.length-1,o.minDepth,new jn(e.changes.compose(c.changes),UD(Le.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,ci)):r=Rh(r,r.length,o.minDepth,e),new Gi(r,ci,t,i)}addSelection(e,t,i,o){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:ci;return a.length>0&&t-this.prevTime<o&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&f6(a[a.length-1],e)?this:new Gi(zD(this.done,e),this.undone,t,i)}addMapping(e){return new Gi(Hg(this.done,e),Hg(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let o=e==0?this.done:this.undone;if(o.length==0)return null;let a=o[o.length-1],r=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):t.selection);if(i&&a.selectionsAfter.length)return t.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:ob.of({side:e,rest:m6(o),selection:r}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let c=o.length==1?ci:o.slice(0,o.length-1);return a.mapped&&(c=Hg(c,a.mapped)),t.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:ob.of({side:e,rest:c,selection:r}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Gi.empty=new Gi(ci,ci);const b6=[{key:"Mod-z",run:HD,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:sb,preventDefault:!0},{linux:"Ctrl-Shift-z",run:sb,preventDefault:!0},{key:"Mod-u",run:u6,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:d6,preventDefault:!0}];function Qr(n,e){return J.create(n.ranges.map(e),n.mainIndex)}function Ai(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Oi({state:n,dispatch:e},t){let i=Qr(n.selection,t);return i.eq(n.selection,!0)?!1:(e(Ai(n,i)),!0)}function wf(n,e){return J.cursor(e?n.to:n.from)}function FD(n,e){return Oi(n,t=>t.empty?n.moveByChar(t,e):wf(t,e))}function fn(n){return n.textDirectionAt(n.state.selection.main.head)==yt.LTR}const qD=n=>FD(n,!fn(n)),GD=n=>FD(n,fn(n));function KD(n,e){return Oi(n,t=>t.empty?n.moveByGroup(t,e):wf(t,e))}const x6=n=>KD(n,!fn(n)),v6=n=>KD(n,fn(n));function C6(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Af(n,e,t){let i=dn(n).resolveInner(e.head),o=t?He.closedBy:He.openedBy;for(let d=e.head;;){let f=t?i.childAfter(d):i.childBefore(d);if(!f)break;C6(n,f,o)?i=f:d=t?f.to:f.from}let a=i.type.prop(o),r,c;return a&&(r=t?qi(n,i.from,1):qi(n,i.to,-1))&&r.matched?c=t?r.end.to:r.end.from:c=t?i.to:i.from,J.cursor(c,t?-1:1)}const S6=n=>Oi(n,e=>Af(n.state,e,!fn(n))),k6=n=>Oi(n,e=>Af(n.state,e,fn(n)));function VD(n,e){return Oi(n,t=>{if(!t.empty)return wf(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const WD=n=>VD(n,!1),QD=n=>VD(n,!0);function YD(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,i=0,o;if(e){for(let a of n.state.facet(ue.scrollMargins)){let r=a(n);r?.top&&(t=Math.max(r?.top,t)),r?.bottom&&(i=Math.max(r?.bottom,i))}o=n.scrollDOM.clientHeight-t-i}else o=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:i,selfScroll:e,height:Math.max(n.defaultLineHeight,o-5)}}function $D(n,e){let t=YD(n),{state:i}=n,o=Qr(i.selection,r=>r.empty?n.moveVertically(r,e,t.height):wf(r,e));if(o.eq(i.selection))return!1;let a;if(t.selfScroll){let r=n.coordsAtPos(i.selection.main.head),c=n.scrollDOM.getBoundingClientRect(),d=c.top+t.marginTop,f=c.bottom-t.marginBottom;r&&r.top>d&&r.bottom<f&&(a=ue.scrollIntoView(o.main.head,{y:"start",yMargin:r.top-d}))}return n.dispatch(Ai(i,o),{effects:a}),!0}const A1=n=>$D(n,!1),ab=n=>$D(n,!0);function ws(n,e,t){let i=n.lineBlockAt(e.head),o=n.moveToLineBoundary(e,t);if(o.head==e.head&&o.head!=(t?i.to:i.from)&&(o=n.moveToLineBoundary(e,t,!1)),!t&&o.head==i.from&&i.length){let a=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;a&&e.head!=i.from+a&&(o=J.cursor(i.from+a))}return o}const w6=n=>Oi(n,e=>ws(n,e,!0)),A6=n=>Oi(n,e=>ws(n,e,!1)),O6=n=>Oi(n,e=>ws(n,e,!fn(n))),P6=n=>Oi(n,e=>ws(n,e,fn(n))),T6=n=>Oi(n,e=>J.cursor(n.lineBlockAt(e.head).from,1)),D6=n=>Oi(n,e=>J.cursor(n.lineBlockAt(e.head).to,-1));function M6(n,e,t){let i=!1,o=Qr(n.selection,a=>{let r=qi(n,a.head,-1)||qi(n,a.head,1)||a.head>0&&qi(n,a.head-1,1)||a.head<n.doc.length&&qi(n,a.head+1,-1);if(!r||!r.end)return a;i=!0;let c=r.start.from==a.head?r.end.to:r.end.from;return J.cursor(c)});return i?(e(Ai(n,o)),!0):!1}const N6=({state:n,dispatch:e})=>M6(n,e);function pi(n,e){let t=Qr(n.state.selection,i=>{let o=e(i);return J.range(i.anchor,o.head,o.goalColumn,o.bidiLevel||void 0,o.assoc)});return t.eq(n.state.selection)?!1:(n.dispatch(Ai(n.state,t)),!0)}function XD(n,e){return pi(n,t=>n.moveByChar(t,e))}const JD=n=>XD(n,!fn(n)),ZD=n=>XD(n,fn(n));function eM(n,e){return pi(n,t=>n.moveByGroup(t,e))}const L6=n=>eM(n,!fn(n)),R6=n=>eM(n,fn(n)),E6=n=>pi(n,e=>Af(n.state,e,!fn(n))),j6=n=>pi(n,e=>Af(n.state,e,fn(n)));function tM(n,e){return pi(n,t=>n.moveVertically(t,e))}const nM=n=>tM(n,!1),iM=n=>tM(n,!0);function oM(n,e){return pi(n,t=>n.moveVertically(t,e,YD(n).height))}const O1=n=>oM(n,!1),P1=n=>oM(n,!0),I6=n=>pi(n,e=>ws(n,e,!0)),B6=n=>pi(n,e=>ws(n,e,!1)),_6=n=>pi(n,e=>ws(n,e,!fn(n))),H6=n=>pi(n,e=>ws(n,e,fn(n))),U6=n=>pi(n,e=>J.cursor(n.lineBlockAt(e.head).from)),z6=n=>pi(n,e=>J.cursor(n.lineBlockAt(e.head).to)),T1=({state:n,dispatch:e})=>(e(Ai(n,{anchor:0})),!0),D1=({state:n,dispatch:e})=>(e(Ai(n,{anchor:n.doc.length})),!0),M1=({state:n,dispatch:e})=>(e(Ai(n,{anchor:n.selection.main.anchor,head:0})),!0),N1=({state:n,dispatch:e})=>(e(Ai(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),F6=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),q6=({state:n,dispatch:e})=>{let t=Of(n).map(({from:i,to:o})=>J.range(i,Math.min(o+1,n.doc.length)));return e(n.update({selection:J.create(t),userEvent:"select"})),!0},G6=({state:n,dispatch:e})=>{let t=Qr(n.selection,i=>{let o=dn(n),a=o.resolveStack(i.from,1);if(i.empty){let r=o.resolveStack(i.from,-1);r.node.from>=a.node.from&&r.node.to<=a.node.to&&(a=r)}for(let r=a;r;r=r.next){let{node:c}=r;if((c.from<i.from&&c.to>=i.to||c.to>i.to&&c.from<=i.from)&&r.next)return J.range(c.to,c.from)}return i});return t.eq(n.selection)?!1:(e(Ai(n,t)),!0)};function sM(n,e){let{state:t}=n,i=t.selection,o=t.selection.ranges.slice();for(let a of t.selection.ranges){let r=t.doc.lineAt(a.head);if(e?r.to<n.state.doc.length:r.from>0)for(let c=a;;){let d=n.moveVertically(c,e);if(d.head<r.from||d.head>r.to){o.some(f=>f.head==d.head)||o.push(d);break}else{if(d.head==c.head)break;c=d}}}return o.length==i.ranges.length?!1:(n.dispatch(Ai(t,J.create(o,o.length-1))),!0)}const K6=n=>sM(n,!1),V6=n=>sM(n,!0),W6=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=J.create([t.main]):t.main.empty||(i=J.create([J.cursor(t.main.head)])),i?(e(Ai(n,i)),!0):!1};function eu(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,o=i.changeByRange(a=>{let{from:r,to:c}=a;if(r==c){let d=e(a);d<r?(t="delete.backward",d=Kd(n,d,!1)):d>r&&(t="delete.forward",d=Kd(n,d,!0)),r=Math.min(r,d),c=Math.max(c,d)}else r=Kd(n,r,!1),c=Kd(n,c,!0);return r==c?{range:a}:{changes:{from:r,to:c},range:J.cursor(r,r<a.head?-1:1)}});return o.changes.empty?!1:(n.dispatch(i.update(o,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?ue.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Kd(n,e,t){if(n instanceof ue)for(let i of n.state.facet(ue.atomicRanges).map(o=>o(n)))i.between(e,e,(o,a)=>{o<e&&a>e&&(e=t?a:o)});return e}const aM=(n,e,t)=>eu(n,i=>{let o=i.from,{state:a}=n,r=a.doc.lineAt(o),c,d;if(t&&!e&&o>r.from&&o<r.from+200&&!/[^ \t]/.test(c=r.text.slice(0,o-r.from))){if(c[c.length-1]==" ")return o-1;let f=Vr(c,a.tabSize),m=f%xa(a)||xa(a);for(let g=0;g<m&&c[c.length-1-g]==" ";g++)o--;d=o}else d=$t(r.text,o-r.from,e,e)+r.from,d==o&&r.number!=(e?a.doc.lines:1)?d+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(r.text.slice(d-r.from,o-r.from))&&(d=$t(r.text,d-r.from,!1,!1)+r.from);return d}),rb=n=>aM(n,!1,!0),rM=n=>aM(n,!0,!1),lM=(n,e)=>eu(n,t=>{let i=t.head,{state:o}=n,a=o.doc.lineAt(i),r=o.charCategorizer(i);for(let c=null;;){if(i==(e?a.to:a.from)){i==t.head&&a.number!=(e?o.doc.lines:1)&&(i+=e?1:-1);break}let d=$t(a.text,i-a.from,e)+a.from,f=a.text.slice(Math.min(i,d)-a.from,Math.max(i,d)-a.from),m=r(f);if(c!=null&&m!=c)break;(f!=" "||i!=t.head)&&(c=m),i=d}return i}),cM=n=>lM(n,!1),Q6=n=>lM(n,!0),Y6=n=>eu(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),$6=n=>eu(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),X6=n=>eu(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),J6=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Je.of(["",""])},range:J.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},Z6=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let o=i.from,a=n.doc.lineAt(o),r=o==a.from?o-1:$t(a.text,o-a.from,!1)+a.from,c=o==a.to?o+1:$t(a.text,o-a.from,!0)+a.from;return{changes:{from:r,to:c,insert:n.doc.slice(o,c).append(n.doc.slice(r,o))},range:J.cursor(c)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Of(n){let e=[],t=-1;for(let i of n.selection.ranges){let o=n.doc.lineAt(i.from),a=n.doc.lineAt(i.to);if(!i.empty&&i.to==a.from&&(a=n.doc.lineAt(i.to-1)),t>=o.number){let r=e[e.length-1];r.to=a.to,r.ranges.push(i)}else e.push({from:o.from,to:a.to,ranges:[i]});t=a.number+1}return e}function uM(n,e,t){if(n.readOnly)return!1;let i=[],o=[];for(let a of Of(n)){if(t?a.to==n.doc.length:a.from==0)continue;let r=n.doc.lineAt(t?a.to+1:a.from-1),c=r.length+1;if(t){i.push({from:a.to,to:r.to},{from:a.from,insert:r.text+n.lineBreak});for(let d of a.ranges)o.push(J.range(Math.min(n.doc.length,d.anchor+c),Math.min(n.doc.length,d.head+c)))}else{i.push({from:r.from,to:a.from},{from:a.to,insert:n.lineBreak+r.text});for(let d of a.ranges)o.push(J.range(d.anchor-c,d.head-c))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:J.create(o,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const eq=({state:n,dispatch:e})=>uM(n,e,!1),tq=({state:n,dispatch:e})=>uM(n,e,!0);function dM(n,e,t){if(n.readOnly)return!1;let i=[];for(let a of Of(n))t?i.push({from:a.from,insert:n.doc.slice(a.from,a.to)+n.lineBreak}):i.push({from:a.to,insert:n.lineBreak+n.doc.slice(a.from,a.to)});let o=n.changes(i);return e(n.update({changes:o,selection:n.selection.map(o,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const nq=({state:n,dispatch:e})=>dM(n,e,!1),iq=({state:n,dispatch:e})=>dM(n,e,!0),oq=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Of(e).map(({from:o,to:a})=>(o>0?o--:a<e.doc.length&&a++,{from:o,to:a}))),i=Qr(e.selection,o=>{let a;if(n.lineWrapping){let r=n.lineBlockAt(o.head),c=n.coordsAtPos(o.head,o.assoc||1);c&&(a=r.bottom+n.documentTop-c.bottom+n.defaultLineHeight/2)}return n.moveVertically(o,!0,a)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function sq(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=dn(n).resolveInner(e),i=t.childBefore(e),o=t.childAfter(e),a;return i&&o&&i.to<=e&&o.from>=e&&(a=i.type.prop(He.closedBy))&&a.indexOf(o.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(o.from).from&&!/\S/.test(n.sliceDoc(i.to,o.from))?{from:i.to,to:o.from}:null}const L1=hM(!1),aq=hM(!0);function hM(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(o=>{let{from:a,to:r}=o,c=e.doc.lineAt(a),d=!n&&a==r&&sq(e,a);n&&(a=r=(r<=c.to?c:e.doc.lineAt(r)).to);let f=new vf(e,{simulateBreak:a,simulateDoubleBreak:!!d}),m=Px(f,a);for(m==null&&(m=Vr(/^\s*/.exec(e.doc.lineAt(a).text)[0],e.tabSize));r<c.to&&/\s/.test(c.text[r-c.from]);)r++;d?{from:a,to:r}=d:a>c.from&&a<c.from+100&&!/\S/.test(c.text.slice(0,a))&&(a=c.from);let g=["",Ic(e,m)];return d&&g.push(Ic(e,f.lineIndent(c.from,-1))),{changes:{from:a,to:r,insert:Je.of(g)},range:J.cursor(a+1+g[1].length)}});return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ix(n,e){let t=-1;return n.changeByRange(i=>{let o=[];for(let r=i.from;r<=i.to;){let c=n.doc.lineAt(r);c.number>t&&(i.empty||i.to>c.from)&&(e(c,o,i),t=c.number),r=c.to+1}let a=n.changes(o);return{changes:o,range:J.range(a.mapPos(i.anchor,1),a.mapPos(i.head,1))}})}const rq=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new vf(n,{overrideIndentation:a=>{let r=t[a];return r??-1}}),o=Ix(n,(a,r,c)=>{let d=Px(i,a.from);if(d==null)return;/\S/.test(a.text)||(d=0);let f=/^\s*/.exec(a.text)[0],m=Ic(n,d);(f!=m||c.from<a.from+f.length)&&(t[a.from]=d,r.push({from:a.from,to:a.from+f.length,insert:m}))});return o.changes.empty||e(n.update(o,{userEvent:"indent"})),!0},fM=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Ix(n,(t,i)=>{i.push({from:t.from,insert:n.facet(xf)})}),{userEvent:"input.indent"})),!0),pM=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Ix(n,(t,i)=>{let o=/^\s*/.exec(t.text)[0];if(!o)return;let a=Vr(o,n.tabSize),r=0,c=Ic(n,Math.max(0,a-xa(n)));for(;r<o.length&&r<c.length&&o.charCodeAt(r)==c.charCodeAt(r);)r++;i.push({from:t.from+r,to:t.from+o.length,insert:c.slice(r)})}),{userEvent:"delete.dedent"})),!0),lq=n=>(n.setTabFocusMode(),!0),cq=[{key:"Ctrl-b",run:qD,shift:JD,preventDefault:!0},{key:"Ctrl-f",run:GD,shift:ZD},{key:"Ctrl-p",run:WD,shift:nM},{key:"Ctrl-n",run:QD,shift:iM},{key:"Ctrl-a",run:T6,shift:U6},{key:"Ctrl-e",run:D6,shift:z6},{key:"Ctrl-d",run:rM},{key:"Ctrl-h",run:rb},{key:"Ctrl-k",run:Y6},{key:"Ctrl-Alt-h",run:cM},{key:"Ctrl-o",run:J6},{key:"Ctrl-t",run:Z6},{key:"Ctrl-v",run:ab}],uq=[{key:"ArrowLeft",run:qD,shift:JD,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:x6,shift:L6,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:O6,shift:_6,preventDefault:!0},{key:"ArrowRight",run:GD,shift:ZD,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:v6,shift:R6,preventDefault:!0},{mac:"Cmd-ArrowRight",run:P6,shift:H6,preventDefault:!0},{key:"ArrowUp",run:WD,shift:nM,preventDefault:!0},{mac:"Cmd-ArrowUp",run:T1,shift:M1},{mac:"Ctrl-ArrowUp",run:A1,shift:O1},{key:"ArrowDown",run:QD,shift:iM,preventDefault:!0},{mac:"Cmd-ArrowDown",run:D1,shift:N1},{mac:"Ctrl-ArrowDown",run:ab,shift:P1},{key:"PageUp",run:A1,shift:O1},{key:"PageDown",run:ab,shift:P1},{key:"Home",run:A6,shift:B6,preventDefault:!0},{key:"Mod-Home",run:T1,shift:M1},{key:"End",run:w6,shift:I6,preventDefault:!0},{key:"Mod-End",run:D1,shift:N1},{key:"Enter",run:L1,shift:L1},{key:"Mod-a",run:F6},{key:"Backspace",run:rb,shift:rb,preventDefault:!0},{key:"Delete",run:rM,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:cM,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Q6,preventDefault:!0},{mac:"Mod-Backspace",run:$6,preventDefault:!0},{mac:"Mod-Delete",run:X6,preventDefault:!0}].concat(cq.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),dq=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:S6,shift:E6},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:k6,shift:j6},{key:"Alt-ArrowUp",run:eq},{key:"Shift-Alt-ArrowUp",run:nq},{key:"Alt-ArrowDown",run:tq},{key:"Shift-Alt-ArrowDown",run:iq},{key:"Mod-Alt-ArrowUp",run:K6},{key:"Mod-Alt-ArrowDown",run:V6},{key:"Escape",run:W6},{key:"Mod-Enter",run:aq},{key:"Alt-l",mac:"Ctrl-l",run:q6},{key:"Mod-i",run:G6,preventDefault:!0},{key:"Mod-[",run:pM},{key:"Mod-]",run:fM},{key:"Mod-Alt-\\",run:rq},{key:"Shift-Mod-k",run:oq},{key:"Shift-Mod-\\",run:N6},{key:"Mod-/",run:e6},{key:"Alt-A",run:n6},{key:"Ctrl-m",mac:"Shift-Alt-m",run:lq}].concat(uq),hq={key:"Tab",run:fM,shift:pM},R1=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class Fr{constructor(e,t,i=0,o=e.length,a,r){this.test=r,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,o),this.bufferStart=i,this.normalize=a?c=>a(R1(c)):R1,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Mn(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ix(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Hi(e);let o=this.normalize(t);if(o.length)for(let a=0,r=i,c=!0;;a++){let d=o.charCodeAt(a),f=this.match(d,r,c,this.bufferPos+this.bufferStart,a==o.length-1);if(f)return this.value=f,this;if(a==o.length-1)break;c&&a<t.length&&t.charCodeAt(a)==d?r++:c=!1}}}match(e,t,i,o,a){let r=null;for(let c=0;c<this.matches.length;){let d=this.matches[c],f=!1;this.query.charCodeAt(d.index)==e&&(d.index==this.query.length-1?r={from:d.from,to:o,precise:a&&d.precise}:(d.index++,f=!0)),f?c++:this.matches.splice(c,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:o,precise:i&&a}:this.matches.push({from:t,index:1,precise:i})),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}typeof Symbol<"u"&&(Fr.prototype[Symbol.iterator]=function(){return this});const mM={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Bx="gm"+(/x/.unicode==null?"":"u");class gM{constructor(e,t,i,o=0,a=e.length){if(this.text=e,this.to=a,this.curLine="",this.done=!1,this.value=mM,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new yM(e,t,i,o,a);this.re=new RegExp(t,Bx+(i?.ignoreCase?"i":"")),this.test=i?.test,this.iter=e.iter();let r=e.lineAt(o);this.curLineStart=r.from,this.matchPos=Eh(e,o),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,o=i+t[0].length;if(this.matchPos=Eh(this.text,o+(i==o?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<o||i>this.value.to)&&(!this.test||this.test(i,o,t)))return this.value={from:i,to:o,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const Ug=new WeakMap;class Dr{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,i){let o=Ug.get(e);if(!o||o.from>=i||o.to<=t){let c=new Dr(t,e.sliceString(t,i));return Ug.set(e,c),c}if(o.from==t&&o.to==i)return o;let{text:a,from:r}=o;return r>t&&(a=e.sliceString(t,r)+a,r=t),o.to<i&&(a+=e.sliceString(o.to,i)),Ug.set(e,new Dr(r,a)),new Dr(t,a.slice(t-r,i-r))}}class yM{constructor(e,t,i,o,a){this.text=e,this.to=a,this.done=!1,this.value=mM,this.matchPos=Eh(e,o),this.re=new RegExp(t,Bx+(i?.ignoreCase?"i":"")),this.test=i?.test,this.flat=Dr.get(e,o,this.chunkEnd(o+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,o=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,o,t)))return this.value={from:i,to:o,precise:!0,match:t},this.matchPos=Eh(this.text,o+(i==o?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Dr.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(gM.prototype[Symbol.iterator]=yM.prototype[Symbol.iterator]=function(){return this});function fq(n){try{return new RegExp(n,Bx),!0}catch{return!1}}function Eh(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e<t.to&&(i=t.text.charCodeAt(e-t.from))>=56320&&i<57344;)e++;return e}const pq=n=>{let{state:e}=n,t=String(e.doc.lineAt(n.state.selection.main.head).number),{close:i,result:o}=Lz(n,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return o.then(a=>{let r=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!r){n.dispatch({effects:i});return}let c=e.doc.lineAt(e.selection.main.head),[,d,f,m,g]=r,x=m?+m.slice(1):0,v=f?+f:c.number;if(f&&g){let w=v/100;d&&(w=w*(d=="-"?-1:1)+c.number/e.doc.lines),v=Math.round(e.doc.lines*w)}else f&&d&&(v=v*(d=="-"?-1:1)+c.number);let C=e.doc.line(Math.max(1,Math.min(e.doc.lines,v))),k=J.cursor(C.from+Math.max(0,Math.min(x,C.length)));n.dispatch({effects:[i,ue.scrollIntoView(k.from,{y:"center"})],selection:k})}),!0},mq={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},gq=pe.define({combine(n){return Xi(n,mq,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function yq(n){return[Sq,Cq]}const bq=Oe.mark({class:"cm-selectionMatch"}),xq=Oe.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function E1(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=kt.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=kt.Word)}function vq(n,e,t,i){return n(e.sliceDoc(t,t+1))==kt.Word&&n(e.sliceDoc(i-1,i))==kt.Word}const Cq=At.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(gq),{state:t}=n,i=t.selection;if(i.ranges.length>1)return Oe.none;let o=i.main,a,r=null;if(o.empty){if(!e.highlightWordAroundCursor)return Oe.none;let d=t.wordAt(o.head);if(!d)return Oe.none;r=t.charCategorizer(o.head),a=t.sliceDoc(d.from,d.to)}else{let d=o.to-o.from;if(d<e.minSelectionLength||d>200)return Oe.none;if(e.wholeWords){if(a=t.sliceDoc(o.from,o.to),r=t.charCategorizer(o.head),!(E1(r,t,o.from,o.to)&&vq(r,t,o.from,o.to)))return Oe.none}else if(a=t.sliceDoc(o.from,o.to),!a)return Oe.none}let c=[];for(let d of n.visibleRanges){let f=new Fr(t.doc,a,d.from,d.to);for(;!f.next().done;){let{from:m,to:g}=f.value;if((!r||E1(r,t,m,g))&&(o.empty&&m<=o.from&&g>=o.to?c.push(xq.range(m,g)):(m>=o.to||g<=o.from)&&c.push(bq.range(m,g)),c.length>e.maxMatches))return Oe.none}}return Oe.set(c)}},{decorations:n=>n.decorations}),Sq=ue.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),kq=({state:n,dispatch:e})=>{let{selection:t}=n,i=J.create(t.ranges.map(o=>n.wordAt(o.head)||J.cursor(o.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function wq(n,e){let{main:t,ranges:i}=n.selection,o=n.wordAt(t.head),a=o&&o.from==t.from&&o.to==t.to;for(let r=!1,c=new Fr(n.doc,e,i[i.length-1].to);;)if(c.next(),c.done){if(r)return null;c=new Fr(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),r=!0}else{if(r&&i.some(d=>d.from==c.value.from))continue;if(a){let d=n.wordAt(c.value.from);if(!d||d.from!=c.value.from||d.to!=c.value.to)continue}return c.value}}const Aq=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(a=>a.from===a.to))return kq({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(a=>n.sliceDoc(a.from,a.to)!=i))return!1;let o=wq(n,i);return o?(e(n.update({selection:n.selection.addRange(J.range(o.from,o.to),!1),effects:ue.scrollIntoView(o.to)})),!0):!1},Yr=pe.define({combine(n){return Xi(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Hq(e),scrollToMatch:e=>ue.scrollIntoView(e)})}});class bM{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||fq(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?`
30
+ `:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Nq(this):new Tq(this)}getCursor(e,t=0,i){let o=e.doc?e:Qe.create({doc:e});return i==null&&(i=o.doc.length),this.regexp?pr(this,o,t,i):fr(this,o,t,i)}}class xM{constructor(e){this.spec=e}}function Oq(n,e,t){return(i,o,a,r)=>{if(t&&!t(i,o,a,r))return!1;let c=i>=r&&o<=r+a.length?a.slice(i-r,o-r):e.doc.sliceString(i,o);return n(c,e,i,o)}}function fr(n,e,t,i){let o;return n.wholeWord&&(o=Pq(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(o=Oq(n.test,e,o)),new Fr(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:a=>a.toLowerCase(),o)}function Pq(n,e){return(t,i,o,a)=>((a>t||a+o.length<i)&&(a=Math.max(0,t-2),o=n.sliceString(a,Math.min(n.length,i+2))),(e(jh(o,t-a))!=kt.Word||e(Ih(o,t-a))!=kt.Word)&&(e(Ih(o,i-a))!=kt.Word||e(jh(o,i-a))!=kt.Word))}class Tq extends xM{constructor(e){super(e)}nextMatch(e,t,i){let o=fr(this.spec,e,i,e.doc.length).nextOverlapping();if(o.done){let a=Math.min(e.doc.length,t+this.spec.unquoted.length);o=fr(this.spec,e,0,a).nextOverlapping()}return o.done||o.value.from==t&&o.value.to==i?null:o.value}prevMatchInRange(e,t,i){for(let o=i;;){let a=Math.max(t,o-1e4-this.spec.unquoted.length),r=fr(this.spec,e,a,o),c=null;for(;!r.nextOverlapping().done;)c=r.value;if(c)return c;if(a==t)return null;o-=1e4}}prevMatch(e,t,i){let o=this.prevMatchInRange(e,0,t);return o||(o=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),o&&(o.from!=t||o.to!=i)?o:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=fr(this.spec,e,0,e.doc.length),o=[];for(;!i.next().done;){if(o.length>=t)return null;o.push(i.value)}return o}highlight(e,t,i,o){let a=fr(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!a.next().done;)o(a.value.from,a.value.to)}}function Dq(n,e,t){return(i,o,a)=>(!t||t(i,o,a))&&n(a[0],e,i,o)}function pr(n,e,t,i){let o;return n.wholeWord&&(o=Mq(e.charCategorizer(e.selection.main.head))),n.test&&(o=Dq(n.test,e,o)),new gM(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:o},t,i)}function jh(n,e){return n.slice($t(n,e,!1),e)}function Ih(n,e){return n.slice(e,$t(n,e))}function Mq(n){return(e,t,i)=>!i[0].length||(n(jh(i.input,i.index))!=kt.Word||n(Ih(i.input,i.index))!=kt.Word)&&(n(Ih(i.input,i.index+i[0].length))!=kt.Word||n(jh(i.input,i.index+i[0].length))!=kt.Word)}class Nq extends xM{nextMatch(e,t,i){let o=pr(this.spec,e,i,e.doc.length).next();return o.done&&(o=pr(this.spec,e,0,t).next()),o.done?null:o.value}prevMatchInRange(e,t,i){for(let o=1;;o++){let a=Math.max(t,i-o*1e4),r=pr(this.spec,e,a,i),c=null;for(;!r.next().done;)c=r.value;if(c&&(a==t||c.from>a+10))return c;if(a==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let o=i.length;o>0;o--){let a=+i.slice(0,o);if(a>0&&a<e.match.length)return e.match[a]+i.slice(o)}return t})}matchAll(e,t){let i=pr(this.spec,e,0,e.doc.length),o=[];for(;!i.next().done;){if(o.length>=t)return null;o.push(i.value)}return o}highlight(e,t,i,o){let a=pr(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!a.next().done;)o(a.value.from,a.value.to)}}const _c=Le.define(),_x=Le.define(),gs=hn.define({create(n){return new zg(lb(n).create(),null)},update(n,e){for(let t of e.effects)t.is(_c)?n=new zg(t.value.create(),n.panel):t.is(_x)&&(n=new zg(n.query,t.value?Hx:null));return n},provide:n=>Lc.from(n,e=>e.panel)});class zg{constructor(e,t){this.query=e,this.panel=t}}const Lq=Oe.mark({class:"cm-searchMatch"}),Rq=Oe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Eq=At.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(gs))}update(n){let e=n.state.field(gs);(e!=n.startState.field(gs)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Oe.none;let{view:t}=this,i=new Yi;for(let o=0,a=t.visibleRanges,r=a.length;o<r;o++){let{from:c,to:d}=a[o];for(;o<r-1&&d>a[o+1].from-500;)d=a[++o].to;n.highlight(t.state,c,d,(f,m)=>{let g=t.state.selection.ranges.some(x=>x.from==f&&x.to==m);i.add(f,m,g?Rq:Lq)})}return i.finish()}},{decorations:n=>n.decorations});function tu(n){return e=>{let t=e.state.field(gs,!1);return t&&t.query.spec.valid?n(e,t):SM(e)}}const Bh=tu((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let o=J.single(i.from,i.to),a=n.state.facet(Yr);return n.dispatch({selection:o,effects:[Ux(n,i),a.scrollToMatch(o.main,n)],userEvent:"select.search"}),CM(n),!0}),_h=tu((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,o=e.prevMatch(t,i,i);if(!o)return!1;let a=J.single(o.from,o.to),r=n.state.facet(Yr);return n.dispatch({selection:a,effects:[Ux(n,o),r.scrollToMatch(a.main,n)],userEvent:"select.search"}),CM(n),!0}),jq=tu((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:J.create(t.map(i=>J.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Iq=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:o}=t.main,a=[],r=0;for(let c=new Fr(n.doc,n.sliceDoc(i,o));!c.next().done;){if(a.length>1e3)return!1;c.value.from==i&&(r=a.length),a.push(J.range(c.value.from,c.value.to))}return e(n.update({selection:J.create(a,r),userEvent:"select.search.matches"})),!0},j1=tu((n,{query:e})=>{let{state:t}=n,{from:i,to:o}=t.selection.main;if(t.readOnly)return!1;let a=e.nextMatch(t,i,i);if(!a)return!1;let r=a,c=[],d,f,m=[];r.precise?r.from==i&&r.to==o&&(f=t.toText(e.getReplacement(r)),c.push({from:r.from,to:r.to,insert:f}),m.push(ue.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))):r=e.nextMatch(t,r.from,r.to);let g=n.state.changes(c);return r&&(d=J.single(r.from,r.to).map(g),m.push(Ux(n,r)),m.push(t.facet(Yr).scrollToMatch(d.main,n))),n.dispatch({changes:g,selection:d,effects:m,userEvent:"input.replace"}),!0}),Bq=tu((n,{query:e})=>{if(n.state.readOnly)return!1;let t=[];for(let o of e.matchAll(n.state,1e9)){let{from:a,to:r,precise:c}=o;c&&t.push({from:a,to:r,insert:e.getReplacement(o)})}if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:ue.announce.of(i),userEvent:"input.replace.all"}),!0});function Hx(n){return n.state.facet(Yr).createPanel(n)}function lb(n,e){var t,i,o,a,r;let c=n.selection.main,d=c.empty||c.to>c.from+100?"":n.sliceDoc(c.from,c.to);if(e&&!d)return e;let f=n.facet(Yr);return new bM({search:((t=e?.literal)!==null&&t!==void 0?t:f.literal)?d:d.replace(/\n/g,"\\n"),caseSensitive:(i=e?.caseSensitive)!==null&&i!==void 0?i:f.caseSensitive,literal:(o=e?.literal)!==null&&o!==void 0?o:f.literal,regexp:(a=e?.regexp)!==null&&a!==void 0?a:f.regexp,wholeWord:(r=e?.wholeWord)!==null&&r!==void 0?r:f.wholeWord})}function vM(n){let e=Cx(n,Hx);return e&&e.dom.querySelector("[main-field]")}function CM(n){let e=vM(n);e&&e==n.root.activeElement&&e.select()}const SM=n=>{let e=n.state.field(gs,!1);if(e&&e.panel){let t=vM(n);if(t&&t!=n.root.activeElement){let i=lb(n.state,e.query.spec);i.valid&&n.dispatch({effects:_c.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[_x.of(!0),e?_c.of(lb(n.state,e.query.spec)):Le.appendConfig.of(zq)]});return!0},kM=n=>{let e=n.state.field(gs,!1);if(!e||!e.panel)return!1;let t=Cx(n,Hx);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:_x.of(!1)}),!0},_q=[{key:"Mod-f",run:SM,scope:"editor search-panel"},{key:"F3",run:Bh,shift:_h,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Bh,shift:_h,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:kM,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Iq},{key:"Mod-Alt-g",run:pq},{key:"Mod-d",run:Aq,preventDefault:!0}];class Hq{constructor(e){this.view=e;let t=this.query=e.state.field(gs).query.spec;this.commit=this.commit.bind(this),this.searchField=dt("input",{value:t.search,placeholder:Gn(e,"Find"),"aria-label":Gn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=dt("input",{value:t.replace,placeholder:Gn(e,"Replace"),"aria-label":Gn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=dt("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=dt("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=dt("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(o,a,r){return dt("button",{class:"cm-button",name:o,onclick:a,type:"button"},r)}this.dom=dt("div",{onkeydown:o=>this.keydown(o),class:"cm-search"},[this.searchField,i("next",()=>Bh(e),[Gn(e,"next")]),i("prev",()=>_h(e),[Gn(e,"previous")]),i("select",()=>jq(e),[Gn(e,"all")]),dt("label",null,[this.caseField,Gn(e,"match case")]),dt("label",null,[this.reField,Gn(e,"regexp")]),dt("label",null,[this.wordField,Gn(e,"by word")]),...e.state.readOnly?[]:[dt("br"),this.replaceField,i("replace",()=>j1(e),[Gn(e,"replace")]),i("replaceAll",()=>Bq(e),[Gn(e,"replace all")])],dt("button",{name:"close",onclick:()=>kM(e),"aria-label":Gn(e,"close"),type:"button"},["×"])])}commit(){let e=new bM({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:_c.of(e)}))}keydown(e){zU(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?_h:Bh)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),j1(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(_c)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Yr).top}}function Gn(n,e){return n.state.phrase(e)}const Vd=30,Wd=/[\s\.,:;?!]/;function Ux(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),o=n.state.doc.lineAt(t).to,a=Math.max(i.from,e-Vd),r=Math.min(o,t+Vd),c=n.state.sliceDoc(a,r);if(a!=i.from){for(let d=0;d<Vd;d++)if(!Wd.test(c[d+1])&&Wd.test(c[d])){c=c.slice(d);break}}if(r!=o){for(let d=c.length-1;d>c.length-Vd;d--)if(!Wd.test(c[d-1])&&Wd.test(c[d])){c=c.slice(0,d);break}}return ue.announce.of(`${n.state.phrase("current match")}. ${c} ${n.state.phrase("on line")} ${i.number}.`)}const Uq=ue.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),zq=[gs,Sa.low(Eq),Uq];class wM{constructor(e,t,i,o){this.state=e,this.pos=t,this.explicit=i,this.view=o,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=dn(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),o=t.text.slice(i-t.from,this.pos-t.from),a=o.search(AM(e,!1));return a<0?null:{from:i+a,to:this.pos,text:o.slice(a)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function I1(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Fq(n){let e=Object.create(null),t=Object.create(null);for(let{label:o}of n){e[o[0]]=!0;for(let a=1;a<o.length;a++)t[o[a]]=!0}let i=I1(e)+I1(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function qq(n){let e=n.map(o=>typeof o=="string"?{label:o}:o),[t,i]=e.every(o=>/^\w+$/.test(o.label))?[/\w*$/,/\w+$/]:Fq(e);return o=>{let a=o.matchBefore(i);return a||o.explicit?{from:a?a.from:o.pos,options:e,validFor:t}:null}}let B1=class{constructor(e,t,i,o){this.completion=e,this.source=t,this.match=i,this.score=o}};function da(n){return n.selection.main.from}function AM(n,e){var t;let{source:i}=n,o=e&&i[0]!="^",a=i[i.length-1]!="$";return!o&&!a?n:new RegExp(`${o?"^":""}(?:${i})${a?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const OM=$i.define();function Gq(n,e,t,i){let{main:o}=n.selection,a=t-o.from,r=i-o.from;return{...n.changeByRange(c=>{if(c!=o&&t!=i&&n.sliceDoc(c.from+a,c.from+r)!=n.sliceDoc(t,i))return{range:c};let d=n.toText(e);return{changes:{from:c.from+a,to:i==o.from?c.to:c.from+r,insert:d},range:J.cursor(c.from+a+d.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const _1=new WeakMap;function Kq(n){if(!Array.isArray(n))return n;let e=_1.get(n);return e||_1.set(n,e=qq(n)),e}const Hh=Le.define(),Hc=Le.define();class Vq{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let i=Mn(e,t),o=Hi(i);this.chars.push(i);let a=e.slice(t,t+o),r=a.toUpperCase();this.folded.push(Mn(r==a?a.toLowerCase():r,0)),t+=o}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:i,any:o,precise:a,byWord:r}=this;if(t.length==1){let T=Mn(e,0),M=Hi(T),D=M==e.length?0:-100;if(T!=t[0])if(T==i[0])D+=-200;else return null;return this.ret(D,[0,M])}let c=e.indexOf(this.pattern);if(c==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let d=t.length,f=0;if(c<0){for(let T=0,M=Math.min(e.length,200);T<M&&f<d;){let D=Mn(e,T);(D==t[f]||D==i[f])&&(o[f++]=T),T+=Hi(D)}if(f<d)return null}let m=0,g=0,x=!1,v=0,C=-1,k=-1,w=/[a-z]/.test(e),P=!0;for(let T=0,M=Math.min(e.length,200),D=0;T<M&&g<d;){let L=Mn(e,T);c<0&&(m<d&&L==t[m]&&(a[m++]=T),v<d&&(L==t[v]||L==i[v]?(v==0&&(C=T),k=T+1,v++):v=0));let N,j=L<255?L>=48&&L<=57||L>=97&&L<=122?2:L>=65&&L<=90?1:0:(N=ix(L))!=N.toLowerCase()?1:N!=N.toUpperCase()?2:0;(!T||j==1&&w||D==0&&j!=0)&&(t[g]==L||i[g]==L&&(x=!0)?r[g++]=T:r.length&&(P=!1)),D=j,T+=Hi(L)}return g==d&&r[0]==0&&P?this.result(-100+(x?-200:0),r,e):v==d&&C==0?this.ret(-200-e.length+(k==e.length?0:-100),[0,k]):c>-1?this.ret(-700-e.length,[c,c+this.pattern.length]):v==d?this.ret(-900-e.length,[C,k]):g==d?this.result(-100+(x?-200:0)+-700+(P?0:-1100),r,e):t.length==2?null:this.result((o[0]?-700:0)+-200+-1100,o,e)}result(e,t,i){let o=[],a=0;for(let r of t){let c=r+(this.astral?Hi(Mn(i,r)):1);a&&o[a-1]==r?o[a-1]=c:(o[a++]=r,o[a++]=c)}return this.ret(e-i.length,o)}}class Wq{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),i=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return i==null?null:(this.matched=[0,t.length],this.score=i+(e.length==this.pattern.length?0:-100),this)}}const Yt=pe.define({combine(n){return Xi(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Qq,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>H1(e(i),t(i)),optionClass:(e,t)=>i=>H1(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function H1(n,e){return n?e?n+" "+e:n:e}function Qq(n,e,t,i,o,a){let r=n.textDirection==yt.RTL,c=r,d=!1,f="top",m,g,x=e.left-o.left,v=o.right-e.right,C=i.right-i.left,k=i.bottom-i.top;if(c&&x<Math.min(C,v)?c=!1:!c&&v<Math.min(C,x)&&(c=!0),C<=(c?x:v))m=Math.max(o.top,Math.min(t.top,o.bottom-k))-e.top,g=Math.min(400,c?x:v);else{d=!0,g=Math.min(400,(r?e.right:o.right-e.left)-30);let T=o.bottom-e.bottom;T>=k||T>e.top?m=t.bottom-e.top:(f="bottom",m=e.bottom-t.top)}let w=(e.bottom-e.top)/a.offsetHeight,P=(e.right-e.left)/a.offsetWidth;return{style:`${f}: ${m/w}px; max-width: ${g/P}px`,class:"cm-completionInfo-"+(d?r?"left-narrow":"right-narrow":c?"left":"right")}}const zx=Le.define();function Yq(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(o=>"cm-completionIcon-"+o)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,o,a){let r=document.createElement("span");r.className="cm-completionLabel";let c=t.displayLabel||t.label,d=0;for(let f=0;f<a.length;){let m=a[f++],g=a[f++];m>d&&r.appendChild(document.createTextNode(c.slice(d,m)));let x=r.appendChild(document.createElement("span"));x.appendChild(document.createTextNode(c.slice(m,g))),x.className="cm-completionMatchedText",d=g}return d<c.length&&r.appendChild(document.createTextNode(c.slice(d))),r},position:50},{render(t){if(!t.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=t.detail,i},position:80}),e.sort((t,i)=>t.position-i.position).map(t=>t.render)}function Fg(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let o=Math.floor(e/t);return{from:o*t,to:(o+1)*t}}let i=Math.ceil((n-e)/t);return{from:n-i*t,to:n-(i-1)*t}}class $q{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:d=>this.placeInfo(d),key:this},this.space=null,this.currentClass="";let o=e.state.field(t),{options:a,selected:r}=o.open,c=e.state.facet(Yt);this.optionContent=Yq(c),this.optionClass=c.optionClass,this.tooltipClass=c.tooltipClass,this.range=Fg(a.length,r,c.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",d=>{let{options:f}=e.state.field(t).open;for(let m=d.target,g;m&&m!=this.dom;m=m.parentNode)if(m.nodeName=="LI"&&(g=/-(\d+)$/.exec(m.id))&&+g[1]<f.length){this.applyCompletion(e,f[+g[1]]),d.preventDefault();return}if(d.target==this.list){let m=this.list.classList.contains("cm-completionListIncompleteTop")&&d.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&d.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;m!=null&&(e.dispatch({effects:zx.of(m)}),d.preventDefault())}}),this.dom.addEventListener("focusout",d=>{let f=e.state.field(this.stateField,!1);f&&f.tooltip&&e.state.facet(Yt).closeOnBlur&&d.relatedTarget!=e.contentDOM&&e.dispatch({effects:Hc.of(null)})}),this.showOptions(a,o.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),o=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=o){let{options:a,selected:r,disabled:c}=i.open;(!o.open||o.open.options!=a)&&(this.range=Fg(a.length,r,e.state.facet(Yt).maxRenderedOptions),this.showOptions(a,i.id)),this.updateSel(),c!=((t=o.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!c)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Fg(t.options.length,t.selected,this.view.state.facet(Yt).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:o}=t.options[t.selected],{info:a}=o;if(!a)return;let r=typeof a=="string"?document.createTextNode(a):a(o);if(!r)return;"then"in r?r.then(c=>{c&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(c,o)}).catch(c=>En(this.view.state,c,"completion info")):(this.addInfoPane(r,o),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:o,destroy:a}=e;i.appendChild(o),this.infoDestroy=a||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,o=this.range.from;i;i=i.nextSibling,o++)i.nodeName!="LI"||!i.id?o--:o==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return t&&Jq(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),o=e.getBoundingClientRect(),a=this.space;if(!a){let r=this.dom.ownerDocument.documentElement;a={left:0,top:0,right:r.clientWidth,bottom:r.clientHeight}}return o.top>Math.min(a.bottom,t.bottom)-10||o.bottom<Math.max(a.top,t.top)+10?null:this.view.state.facet(Yt).positionInfo(this.view,t,o,i,a,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,i){const o=document.createElement("ul");o.id=t,o.setAttribute("role","listbox"),o.setAttribute("aria-expanded","true"),o.setAttribute("aria-label",this.view.state.phrase("Completions")),o.addEventListener("mousedown",r=>{r.target==o&&r.preventDefault()});let a=null;for(let r=i.from;r<i.to;r++){let{completion:c,match:d}=e[r],{section:f}=c;if(f){let x=typeof f=="string"?f:f.name;if(x!=a&&(r>i.from||i.from==0))if(a=x,typeof f!="string"&&f.header)o.appendChild(f.header(f));else{let v=o.appendChild(document.createElement("completion-section"));v.textContent=x}}const m=o.appendChild(document.createElement("li"));m.id=t+"-"+r,m.setAttribute("role","option");let g=this.optionClass(c);g&&(m.className=g);for(let x of this.optionContent){let v=x(c,this.view.state,this.view,d);v&&m.appendChild(v)}}return i.from&&o.classList.add("cm-completionListIncompleteTop"),i.to<e.length&&o.classList.add("cm-completionListIncompleteBottom"),o}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Xq(n,e){return t=>new $q(t,n,e)}function Jq(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),o=t.height/n.offsetHeight;i.top<t.top?n.scrollTop-=(t.top-i.top)/o:i.bottom>t.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/o)}function U1(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function Zq(n,e){let t=[],i=null,o=null,a=m=>{t.push(m);let{section:g}=m.completion;if(g){i||(i=[]);let x=typeof g=="string"?g:g.name;i.some(v=>v.name==x)||i.push(typeof g=="string"?{name:x}:g)}},r=e.facet(Yt);for(let m of n)if(m.hasResult()){let g=m.result.getMatch;if(m.result.filter===!1)for(let x of m.result.options)a(new B1(x,m.source,g?g(x):[],1e9-t.length));else{let x=e.sliceDoc(m.from,m.to),v,C=r.filterStrict?new Wq(x):new Vq(x);for(let k of m.result.options)if(v=C.match(k.label)){let w=k.displayLabel?g?g(k,v.matched):[]:v.matched,P=v.score+(k.boost||0);if(a(new B1(k,m.source,w,P)),typeof k.section=="object"&&k.section.rank==="dynamic"){let{name:T}=k.section;o||(o=Object.create(null)),o[T]=Math.max(P,o[T]||-1e9)}}}}if(i){let m=Object.create(null),g=0,x=(v,C)=>(v.rank==="dynamic"&&C.rank==="dynamic"?o[C.name]-o[v.name]:0)||(typeof v.rank=="number"?v.rank:1e9)-(typeof C.rank=="number"?C.rank:1e9)||(v.name<C.name?-1:1);for(let v of i.sort(x))g-=1e5,m[v.name]=g;for(let v of t){let{section:C}=v.completion;C&&(v.score+=m[typeof C=="string"?C:C.name])}}let c=[],d=null,f=r.compareCompletions;for(let m of t.sort((g,x)=>x.score-g.score||f(g.completion,x.completion))){let g=m.completion;!d||d.label!=g.label||d.detail!=g.detail||d.type!=null&&g.type!=null&&d.type!=g.type||d.apply!=g.apply||d.boost!=g.boost?c.push(m):U1(m.completion)>U1(d)&&(c[c.length-1]=m),d=m.completion}return c}class vr{constructor(e,t,i,o,a,r){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=o,this.selected=a,this.disabled=r}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new vr(this.options,z1(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,o,a,r){if(o&&!r&&e.some(f=>f.isPending))return o.setDisabled();let c=Zq(e,t);if(!c.length)return o&&e.some(f=>f.isPending)?o.setDisabled():null;let d=t.facet(Yt).selectOnOpen?0:-1;if(o&&o.selected!=d&&o.selected!=-1){let f=o.options[o.selected].completion;for(let m=0;m<c.length;m++)if(c[m].completion==f){d=m;break}}return new vr(c,z1(i,d),{pos:e.reduce((f,m)=>m.hasResult()?Math.min(f,m.from):f,1e8),create:s8,above:a.aboveCursor},o?o.timestamp:Date.now(),d,!1)}map(e){return new vr(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new vr(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Uh{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Uh(i8,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Yt),a=(i.override||t.languageDataAt("autocomplete",da(t)).map(Kq)).map(d=>(this.active.find(m=>m.source==d)||new ui(d,this.active.some(m=>m.state!=0)?1:0)).update(e,i));a.length==this.active.length&&a.every((d,f)=>d==this.active[f])&&(a=this.active);let r=this.open,c=e.effects.some(d=>d.is(Fx));r&&e.docChanged&&(r=r.map(e.changes)),e.selection||a.some(d=>d.hasResult()&&e.changes.touchesRange(d.from,d.to))||!e8(a,this.active)||c?r=vr.build(a,t,this.id,r,i,c):r&&r.disabled&&!a.some(d=>d.isPending)&&(r=null),!r&&a.every(d=>!d.isPending)&&a.some(d=>d.hasResult())&&(a=a.map(d=>d.hasResult()?new ui(d.source,0):d));for(let d of e.effects)d.is(zx)&&(r=r&&r.setSelected(d.value,this.id));return a==this.active&&r==this.open?this:new Uh(a,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?t8:n8}}function e8(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;i<e.length&&!e[i].hasResult();)i++;let o=t==n.length,a=i==e.length;if(o||a)return o==a;if(n[t++].result!=e[i++].result)return!1}}const t8={"aria-autocomplete":"list"},n8={};function z1(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const i8=[];function PM(n,e){if(n.isUserEvent("input.complete")){let i=n.annotation(OM);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class ui{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=PM(e,t),o=this;(i&8||i&16&&this.touches(e))&&(o=new ui(o.source,0)),i&4&&o.state==0&&(o=new ui(this.source,1)),o=o.updateFor(e,i);for(let a of e.effects)if(a.is(Hh))o=new ui(o.source,1,a.value);else if(a.is(Hc))o=new ui(o.source,0);else if(a.is(Fx))for(let r of a.value)r.source==o.source&&(o=r);return o}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(da(e.state))}}class Mr extends ui{constructor(e,t,i,o,a,r){super(e,3,t),this.limit=i,this.result=o,this.from=a,this.to=r}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let o=this.result;o.map&&!e.changes.empty&&(o=o.map(o,e.changes));let a=e.changes.mapPos(this.from),r=e.changes.mapPos(this.to,1),c=da(e.state);if(c>r||!o||t&2&&(da(e.startState)==this.from||c<this.limit))return new ui(this.source,t&4?1:0);let d=e.changes.mapPos(this.limit);return o8(o.validFor,e.state,a,r)?new Mr(this.source,this.explicit,d,o,a,r):o.update&&(o=o.update(o,a,r,new wM(e.state,c,!1)))?new Mr(this.source,this.explicit,d,o,o.from,(i=o.to)!==null&&i!==void 0?i:da(e.state)):new ui(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Mr(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new ui(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function o8(n,e,t,i){if(!n)return!1;let o=e.sliceDoc(t,i);return typeof n=="function"?n(o,t,i,e):AM(n,!0).test(o)}const Fx=Le.define({map(n,e){return n.map(t=>t.map(e))}}),Nn=hn.define({create(){return Uh.start()},update(n,e){return n.update(e)},provide:n=>[vx.from(n,e=>e.tooltip),ue.contentAttributes.from(n,e=>e.attrs)]});function qx(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Nn).active.find(o=>o.source==e.source);return i instanceof Mr?(typeof t=="string"?n.dispatch({...Gq(n.state,t,i.from,i.to),annotations:OM.of(e.completion)}):t(n,e.completion,i.from,i.to),!0):!1}const s8=Xq(Nn,qx);function Qd(n,e="option"){return t=>{let i=t.state.field(Nn,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<t.state.facet(Yt).interactionDelay)return!1;let o=1,a;e=="page"&&(a=tD(t,i.open.tooltip))&&(o=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector("li").offsetHeight)-1));let{length:r}=i.open.options,c=i.open.selected>-1?i.open.selected+o*(n?1:-1):n?0:r-1;return c<0?c=e=="page"?0:r-1:c>=r&&(c=e=="page"?r-1:0),t.dispatch({effects:zx.of(c)}),!0}}const a8=n=>{let e=n.state.field(Nn,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(Yt).interactionDelay?!1:qx(n,e.open.options[e.open.selected])},qg=n=>n.state.field(Nn,!1)?(n.dispatch({effects:Hh.of(!0)}),!0):!1,r8=n=>{let e=n.state.field(Nn,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Hc.of(null)}),!0)};class l8{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const c8=50,u8=1e3,d8=At.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(Nn).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(Nn),t=n.state.facet(Yt);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Nn)==e)return;let i=n.transactions.some(a=>{let r=PM(a,t);return r&8||(a.selection||a.docChanged)&&!(r&3)});for(let a=0;a<this.running.length;a++){let r=this.running[a];if(i||r.context.abortOnDocChange&&n.docChanged||r.updates.length+n.transactions.length>c8&&Date.now()-r.time>u8){for(let c of r.context.abortListeners)try{c()}catch(d){En(this.view.state,d)}r.context.abortListeners=null,this.running.splice(a--,1)}else r.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(a=>a.effects.some(r=>r.is(Hh)))&&(this.pendingStart=!0);let o=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(a=>a.isPending&&!this.running.some(r=>r.active.source==a.source))?setTimeout(()=>this.startUpdate(),o):-1,this.composing!=0)for(let a of n.transactions)a.isUserEvent("input.type")?this.composing=2:this.composing==2&&a.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Nn);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Yt).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=da(e),i=new wM(e,t,n.explicit,this.view),o=new l8(n,i);this.running.push(o),Promise.resolve(n.source(i)).then(a=>{o.context.aborted||(o.done=a||null,this.scheduleAccept())},a=>{this.view.dispatch({effects:Hc.of(null)}),En(this.view.state,a)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Yt).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Yt),i=this.view.state.field(Nn);for(let o=0;o<this.running.length;o++){let a=this.running[o];if(a.done===void 0)continue;if(this.running.splice(o--,1),a.done){let c=da(a.updates.length?a.updates[0].startState:this.view.state),d=Math.min(c,a.done.from+(a.active.explicit?0:1)),f=new Mr(a.active.source,a.active.explicit,d,a.done,a.done.from,(n=a.done.to)!==null&&n!==void 0?n:c);for(let m of a.updates)f=f.update(m,t);if(f.hasResult()){e.push(f);continue}}let r=i.active.find(c=>c.source==a.active.source);if(r&&r.isPending)if(a.done==null){let c=new ui(a.active.source,0);for(let d of a.updates)c=c.update(d,t);c.isPending||e.push(c)}else this.startQuery(r)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:Fx.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Nn,!1);if(e&&e.tooltip&&this.view.state.facet(Yt).closeOnBlur){let t=e.open&&tD(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Hc.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Hh.of(!1)}),20),this.composing=0}}}),h8=typeof navigator=="object"&&/Win/.test(navigator.platform),f8=Sa.highest(ue.domEventHandlers({keydown(n,e){let t=e.state.field(Nn,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(h8&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],o=t.active.find(r=>r.source==i.source),a=i.completion.commitCharacters||o.result.commitCharacters;return a&&a.indexOf(n.key)>-1&&qx(e,i),!1}})),p8=ue.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Uc={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},sa=Le.define({map(n,e){let t=e.mapPos(n,-1,xn.TrackAfter);return t??void 0}}),Gx=new class extends ys{};Gx.startSide=1;Gx.endSide=-1;const TM=hn.define({create(){return qe.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}for(let t of e.effects)t.is(sa)&&(n=n.update({add:[Gx.range(t.value,t.value+1)]}));return n}});function m8(){return[y8,TM]}const Gg="()[]{}<>«»»«[]{}";function DM(n){for(let e=0;e<Gg.length;e+=2)if(Gg.charCodeAt(e)==n)return Gg.charAt(e+1);return ix(n<128?n:n+1)}function MM(n,e){return n.languageDataAt("closeBrackets",e)[0]||Uc}const g8=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),y8=ue.inputHandler.of((n,e,t,i)=>{if((g8?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let o=n.state.selection.main;if(i.length>2||i.length==2&&Hi(Mn(i,0))==1||e!=o.from||t!=o.to)return!1;let a=v8(n.state,i);return a?(n.dispatch(a),!0):!1}),b8=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=MM(n,n.selection.main.head).brackets||Uc.brackets,o=null,a=n.changeByRange(r=>{if(r.empty){let c=C8(n.doc,r.head);for(let d of i)if(d==c&&Pf(n.doc,r.head)==DM(Mn(d,0)))return{changes:{from:r.head-d.length,to:r.head+d.length},range:J.cursor(r.head-d.length)}}return{range:o=r}});return o||e(n.update(a,{scrollIntoView:!0,userEvent:"delete.backward"})),!o},x8=[{key:"Backspace",run:b8}];function v8(n,e){let t=MM(n,n.selection.main.head),i=t.brackets||Uc.brackets;for(let o of i){let a=DM(Mn(o,0));if(e==o)return a==o?w8(n,o,i.indexOf(o+o+o)>-1,t):S8(n,o,a,t.before||Uc.before);if(e==a&&NM(n,n.selection.main.from))return k8(n,o,a)}return null}function NM(n,e){let t=!1;return n.field(TM).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Pf(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Hi(Mn(t,0)))}function C8(n,e){let t=n.sliceString(e-2,e);return Hi(Mn(t,0))==t.length?t:t.slice(1)}function S8(n,e,t,i){let o=null,a=n.changeByRange(r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:t,from:r.to}],effects:sa.of(r.to+e.length),range:J.range(r.anchor+e.length,r.head+e.length)};let c=Pf(n.doc,r.head);return!c||/\s/.test(c)||i.indexOf(c)>-1?{changes:{insert:e+t,from:r.head},effects:sa.of(r.head+e.length),range:J.cursor(r.head+e.length)}:{range:o=r}});return o?null:n.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function k8(n,e,t){let i=null,o=n.changeByRange(a=>a.empty&&Pf(n.doc,a.head)==t?{changes:{from:a.head,to:a.head+t.length,insert:t},range:J.cursor(a.head+t.length)}:i={range:a});return i?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function w8(n,e,t,i){let o=i.stringPrefixes||Uc.stringPrefixes,a=null,r=n.changeByRange(c=>{if(!c.empty)return{changes:[{insert:e,from:c.from},{insert:e,from:c.to}],effects:sa.of(c.to+e.length),range:J.range(c.anchor+e.length,c.head+e.length)};let d=c.head,f=Pf(n.doc,d),m;if(f==e){if(F1(n,d))return{changes:{insert:e+e,from:d},effects:sa.of(d+e.length),range:J.cursor(d+e.length)};if(NM(n,d)){let x=t&&n.sliceDoc(d,d+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:d,to:d+x.length,insert:x},range:J.cursor(d+x.length)}}}else{if(t&&n.sliceDoc(d-2*e.length,d)==e+e&&(m=q1(n,d-2*e.length,o))>-1&&F1(n,m))return{changes:{insert:e+e+e+e,from:d},effects:sa.of(d+e.length),range:J.cursor(d+e.length)};if(n.charCategorizer(d)(f)!=kt.Word&&q1(n,d,o)>-1&&!A8(n,d,e,o))return{changes:{insert:e+e,from:d},effects:sa.of(d+e.length),range:J.cursor(d+e.length)}}return{range:a=c}});return a?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function F1(n,e){let t=dn(n).resolveInner(e+1);return t.parent&&t.from==e}function A8(n,e,t,i){let o=dn(n).resolveInner(e,-1),a=i.reduce((r,c)=>Math.max(r,c.length),0);for(let r=0;r<5;r++){let c=n.sliceDoc(o.from,Math.min(o.to,o.from+t.length+a)),d=c.indexOf(t);if(!d||d>-1&&i.indexOf(c.slice(0,d))>-1){let m=o.firstChild;for(;m&&m.from==o.from&&m.to-m.from>t.length+d;){if(n.sliceDoc(m.to-t.length,m.to)==t)return!1;m=m.firstChild}return!0}let f=o.to==e&&o.parent;if(!f)break;o=f}return!1}function q1(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=kt.Word)return e;for(let o of t){let a=e-o.length;if(n.sliceDoc(a,e)==o&&i(n.sliceDoc(a-1,a))!=kt.Word)return a}return-1}function O8(n={}){return[f8,Nn,Yt.of(n),d8,P8,p8]}const LM=[{key:"Ctrl-Space",run:qg},{mac:"Alt-`",run:qg},{mac:"Alt-i",run:qg},{key:"Escape",run:r8},{key:"ArrowDown",run:Qd(!0)},{key:"ArrowUp",run:Qd(!1)},{key:"PageDown",run:Qd(!0,"page")},{key:"PageUp",run:Qd(!1,"page")},{key:"Enter",run:a8}],P8=Sa.highest(gf.computeN([Yt],n=>n.facet(Yt).defaultKeymap?[LM]:[]));class G1{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class ea{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let o=i.facet(zc).markerFilter;o&&(e=o(e,i));let a=e.slice().sort((v,C)=>v.from-C.from||v.to-C.to),r=new Yi,c=[],d=0,f=i.doc.iter(),m=0,g=i.doc.length;for(let v=0;;){let C=v==a.length?null:a[v];if(!C&&!c.length)break;let k,w;if(c.length)k=d,w=c.reduce((M,D)=>Math.min(M,D.to),C&&C.from>k?C.from:1e8);else{if(k=C.from,k>g)break;w=C.to,c.push(C),v++}for(;v<a.length;){let M=a[v];if(M.from==k&&(M.to>M.from||M.to==k))c.push(M),v++,w=Math.min(M.to,w);else{w=Math.min(M.from,w);break}}w=Math.min(w,g);let P=!1;if(c.some(M=>M.from==k&&(M.to==w||w==g))&&(P=k==w,!P&&w-k<10)){let M=k-(m+f.value.length);M>0&&(f.next(M),m=k);for(let D=k;;){if(D>=w){P=!0;break}if(!f.lineBreak&&m+f.value.length>D)break;D=m+f.value.length,m+=f.value.length,f.next()}}let T=U8(c);if(P)r.add(k,k,Oe.widget({widget:new I8(T),diagnostics:c.slice()}));else{let M=c.reduce((D,L)=>L.markClass?D+" "+L.markClass:D,"");r.add(k,w,Oe.mark({class:"cm-lintRange cm-lintRange-"+T+M,diagnostics:c.slice(),inclusiveEnd:c.some(D=>D.to>w)}))}if(d=w,d==g)break;for(let M=0;M<c.length;M++)c[M].to<=d&&c.splice(M--,1)}let x=r.finish();return new ea(x,t,ks(x))}}function ks(n,e=null,t=0){let i=null;return n.between(t,1e9,(o,a,{spec:r})=>{if(!(e&&r.diagnostics.indexOf(e)<0))if(!i)i=new G1(o,a,e||r.diagnostics[0]);else{if(r.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new G1(i.from,a,i.diagnostic)}}),i}function T8(n,e){let t=e.pos,i=e.end||t,o=n.state.facet(zc).hideOn(n,t,i);if(o!=null)return o;let a=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(r=>r.is(RM))||n.changes.touchesRange(a.from,Math.max(a.to,i)))}function D8(n,e){return n.field(Yn,!1)?e:e.concat(Le.appendConfig.of(z8))}const RM=Le.define(),Kx=Le.define(),EM=Le.define(),Yn=hn.define({create(){return new ea(Oe.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),i=null,o=n.panel;if(n.selected){let a=e.changes.mapPos(n.selected.from,1);i=ks(t,n.selected.diagnostic,a)||ks(t,null,a)}!t.size&&o&&e.state.facet(zc).autoPanel&&(o=null),n=new ea(t,o,i)}for(let t of e.effects)if(t.is(RM)){let i=e.state.facet(zc).autoPanel?t.value.length?Fc.open:null:n.panel;n=ea.init(t.value,i,e.state)}else t.is(Kx)?n=new ea(n.diagnostics,t.value?Fc.open:null,n.selected):t.is(EM)&&(n=new ea(n.diagnostics,n.panel,t.value));return n},provide:n=>[Lc.from(n,e=>e.panel),ue.decorations.from(n,e=>e.diagnostics)]}),M8=Oe.mark({class:"cm-lintRange cm-lintRange-active"});function N8(n,e,t){let{diagnostics:i}=n.state.field(Yn),o,a=-1,r=-1;i.between(e-(t<0?1:0),e+(t>0?1:0),(d,f,{spec:m})=>{if(e>=d&&e<=f&&(d==f||(e>d||t>0)&&(e<f||t<0)))return o=m.diagnostics,a=d,r=f,!1});let c=n.state.facet(zc).tooltipFilter;return o&&c&&(o=c(o,n.state)),o?{pos:a,end:r,above:n.state.doc.lineAt(a).to<r,create(){return{dom:L8(n,o)}}}:null}function L8(n,e){return dt("ul",{class:"cm-tooltip-lint"},e.map(t=>IM(n,t,!1)))}const R8=n=>{let e=n.state.field(Yn,!1);(!e||!e.panel)&&n.dispatch({effects:D8(n.state,[Kx.of(!0)])});let t=Cx(n,Fc.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},K1=n=>{let e=n.state.field(Yn,!1);return!e||!e.panel?!1:(n.dispatch({effects:Kx.of(!1)}),!0)},E8=n=>{let e=n.state.field(Yn,!1);if(!e)return!1;let t=n.state.selection.main,i=ks(e.diagnostics,null,t.to+1);return!i&&(i=ks(e.diagnostics,null,0),!i||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),Mz(n,i.from,1,{tooltip:BM,until:o=>o.docChanged||o.newSelection.main.head<i.from||o.newSelection.main.head>i.to}),!0)},j8=[{key:"Mod-Shift-m",run:R8,preventDefault:!0},{key:"F8",run:E8}],zc=pe.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...Xi(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:V1,tooltipFilter:V1,needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t,hideOn:(e,t)=>e?t?(i,o,a)=>e(i,o,a)||t(i,o,a):e:t,autoPanel:(e,t)=>e||t})}}});function V1(n,e){return n?e?(t,i)=>e(n(t,i),i):n:e}function jM(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;i<t.length;i++){let o=t[i];if(/[a-zA-Z]/.test(o)&&!e.some(a=>a.toLowerCase()==o.toLowerCase())){e.push(o);continue e}}e.push("")}return e}function IM(n,e,t){var i;let o=t?jM(e.actions):[];return dt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},dt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((a,r)=>{let c=!1,d=v=>{if(v.preventDefault(),c)return;c=!0;let C=ks(n.state.field(Yn).diagnostics,e);C&&a.apply(n,C.from,C.to)},{name:f}=a,m=o[r]?f.indexOf(o[r]):-1,g=m<0?f:[f.slice(0,m),dt("u",f.slice(m,m+1)),f.slice(m+1)],x=a.markClass?" "+a.markClass:"";return dt("button",{type:"button",class:"cm-diagnosticAction"+x,onclick:d,onmousedown:d,"aria-label":` Action: ${f}${m<0?"":` (access key "${o[r]})"`}.`},g)}),e.source&&dt("div",{class:"cm-diagnosticSource"},e.source))}class I8 extends Ji{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return dt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class W1{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=IM(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Fc{constructor(e){this.view=e,this.items=[];let t=o=>{if(!(o.ctrlKey||o.altKey||o.metaKey)){if(o.keyCode==27)K1(this.view),this.view.focus();else if(o.keyCode==38||o.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(o.keyCode==40||o.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(o.keyCode==36)this.moveSelection(0);else if(o.keyCode==35)this.moveSelection(this.items.length-1);else if(o.keyCode==13)this.view.focus();else if(o.keyCode>=65&&o.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:a}=this.items[this.selectedIndex],r=jM(a.actions);for(let c=0;c<r.length;c++)if(r[c].toUpperCase().charCodeAt(0)==o.keyCode){let d=ks(this.view.state.field(Yn).diagnostics,a);d&&a.actions[c].apply(e,d.from,d.to)}}else return;o.preventDefault()}},i=o=>{for(let a=0;a<this.items.length;a++)this.items[a].dom.contains(o.target)&&this.moveSelection(a)};this.list=dt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:i}),this.dom=dt("div",{class:"cm-panel-lint"},this.list,dt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>K1(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Yn).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Yn),i=0,o=!1,a=null,r=new Set;for(e.between(0,this.view.state.doc.length,(c,d,{spec:f})=>{for(let m of f.diagnostics){if(r.has(m))continue;r.add(m);let g=-1,x;for(let v=i;v<this.items.length;v++)if(this.items[v].diagnostic==m){g=v;break}g<0?(x=new W1(this.view,m),this.items.splice(i,0,x),o=!0):(x=this.items[g],g>i&&(this.items.splice(i,g-i),o=!0)),t&&x.diagnostic==t.diagnostic?x.dom.hasAttribute("aria-selected")||(x.dom.setAttribute("aria-selected","true"),a=x):x.dom.hasAttribute("aria-selected")&&x.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)o=!0,this.items.pop();this.items.length==0&&(this.items.push(new W1(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),o=!0),a?(this.list.setAttribute("aria-activedescendant",a.id),this.view.requestMeasure({key:this,read:()=>({sel:a.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:c,panel:d})=>{let f=d.height/this.list.offsetHeight;c.top<d.top?this.list.scrollTop-=(d.top-c.top)/f:c.bottom>d.bottom&&(this.list.scrollTop+=(c.bottom-d.bottom)/f)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Yn),i=ks(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:EM.of(i)})}static open(e){return new Fc(e)}}function B8(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function Yd(n){return B8(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const _8=ue.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Yd("#f11")},".cm-lintRange-warning":{backgroundImage:Yd("orange")},".cm-lintRange-info":{backgroundImage:Yd("#999")},".cm-lintRange-hint":{backgroundImage:Yd("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function H8(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function U8(n){let e="hint",t=1;for(let i of n){let o=H8(i.severity);o>t&&(t=o,e=i.severity)}return e}const BM=Dz(N8,{hideOn:T8}),z8=[Yn,ue.decorations.compute([Yn],n=>{let{selected:e,panel:t}=n.field(Yn);return!e||!t||e.from==e.to?Oe.none:Oe.set([M8.range(e.from,e.to)])}),BM,_8];var Q1=function(e){e===void 0&&(e={});var{crosshairCursor:t=!1}=e,i=[];e.closeBracketsKeymap!==!1&&(i=i.concat(x8)),e.defaultKeymap!==!1&&(i=i.concat(dq)),e.searchKeymap!==!1&&(i=i.concat(_q)),e.historyKeymap!==!1&&(i=i.concat(b6)),e.foldKeymap!==!1&&(i=i.concat(TF)),e.completionKeymap!==!1&&(i=i.concat(LM)),e.lintKeymap!==!1&&(i=i.concat(j8));var o=[];return e.lineNumbers!==!1&&o.push(qz()),e.highlightActiveLineGutter!==!1&&o.push(Vz()),e.highlightSpecialChars!==!1&&o.push(oz()),e.history!==!1&&o.push(c6()),e.foldGutter!==!1&&o.push(LF()),e.drawSelection!==!1&&o.push(WU()),e.dropCursor!==!1&&o.push(JU()),e.allowMultipleSelections!==!1&&o.push(Qe.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&o.push(xF()),e.syntaxHighlighting!==!1&&o.push(Mx(IF,{fallback:!0})),e.bracketMatching!==!1&&o.push(qF()),e.closeBrackets!==!1&&o.push(m8()),e.autocompletion!==!1&&o.push(O8()),e.rectangularSelection!==!1&&o.push(bz()),t!==!1&&o.push(Cz()),e.highlightActiveLine!==!1&&o.push(uz()),e.highlightSelectionMatches!==!1&&o.push(yq()),e.tabSize&&typeof e.tabSize=="number"&&o.push(xf.of(" ".repeat(e.tabSize))),o.concat([gf.of(i.flat())]).filter(Boolean)};const F8="#e5c07b",Y1="#e06c75",q8="#56b6c2",G8="#ffffff",lh="#abb2bf",cb="#7d8799",K8="#61afef",V8="#98c379",$1="#d19a66",W8="#c678dd",Q8="#21252b",X1="#2c313a",J1="#282c34",Kg="#353a42",Y8="#3E4451",Z1="#528bff",$8=ue.theme({"&":{color:lh,backgroundColor:J1},".cm-content":{caretColor:Z1},".cm-cursor, .cm-dropCursor":{borderLeftColor:Z1},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Y8},".cm-panels":{backgroundColor:Q8,color:lh},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:J1,color:cb,border:"none"},".cm-activeLineGutter":{backgroundColor:X1},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Kg},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Kg,borderBottomColor:Kg},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:X1,color:lh}}},{dark:!0}),X8=Wr.define([{tag:E.keyword,color:W8},{tag:[E.name,E.deleted,E.character,E.propertyName,E.macroName],color:Y1},{tag:[E.function(E.variableName),E.labelName],color:K8},{tag:[E.color,E.constant(E.name),E.standard(E.name)],color:$1},{tag:[E.definition(E.name),E.separator],color:lh},{tag:[E.typeName,E.className,E.number,E.changed,E.annotation,E.modifier,E.self,E.namespace],color:F8},{tag:[E.operator,E.operatorKeyword,E.url,E.escape,E.regexp,E.link,E.special(E.string)],color:q8},{tag:[E.meta,E.comment],color:cb},{tag:E.strong,fontWeight:"bold"},{tag:E.emphasis,fontStyle:"italic"},{tag:E.strikethrough,textDecoration:"line-through"},{tag:E.link,color:cb,textDecoration:"underline"},{tag:E.heading,fontWeight:"bold",color:Y1},{tag:[E.atom,E.bool,E.special(E.variableName)],color:$1},{tag:[E.processingInstruction,E.string,E.inserted],color:V8},{tag:E.invalid,color:G8}]),J8=[$8,Mx(X8)];var Z8=ue.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),eG=function(e){e===void 0&&(e={});var{indentWithTab:t=!0,editable:i=!0,readOnly:o=!1,theme:a="light",placeholder:r="",basicSetup:c=!0}=e,d=[];switch(t&&d.unshift(gf.of([hq])),c&&(typeof c=="boolean"?d.unshift(Q1()):d.unshift(Q1(c))),r&&d.unshift(pz(r)),a){case"light":d.push(Z8);break;case"dark":d.push(J8);break;case"none":break;default:d.push(a);break}return i===!1&&d.push(ue.editable.of(!1)),o&&d.push(Qe.readOnly.of(!0)),[...d]},tG=n=>({line:n.state.doc.lineAt(n.state.selection.main.from),lineCount:n.state.doc.lines,lineBreak:n.state.lineBreak,length:n.state.doc.length,readOnly:n.state.readOnly,tabSize:n.state.tabSize,selection:n.state.selection,selectionAsSingle:n.state.selection.asSingle().main,ranges:n.state.selection.ranges,selectionCode:n.state.sliceDoc(n.state.selection.main.from,n.state.selection.main.to),selections:n.state.selection.ranges.map(e=>n.state.sliceDoc(e.from,e.to)),selectedText:n.state.selection.ranges.some(e=>!e.empty)});class nG{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(t=>{try{t()}catch(i){console.error("TimeoutLatch callback error:",i)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class eA{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Vg=null,iG=()=>typeof window>"u"?new eA:(Vg||(Vg=new eA),Vg),tA=$i.define(),oG=200,sG=[];function aG(n){var{value:e,selection:t,onChange:i,onStatistics:o,onCreateEditor:a,onUpdate:r,extensions:c=sG,autoFocus:d,theme:f="light",height:m=null,minHeight:g=null,maxHeight:x=null,width:v=null,minWidth:C=null,maxWidth:k=null,placeholder:w="",editable:P=!0,readOnly:T=!1,indentWithTab:M=!0,basicSetup:D=!0,root:L,initialState:N}=n,[j,K]=A.useState(),[U,z]=A.useState(),[X,H]=A.useState(),V=A.useState(()=>({current:null}))[0],ie=A.useState(()=>({current:null}))[0],oe=ue.theme({"&":{height:m,minHeight:g,maxHeight:x,width:v,minWidth:C,maxWidth:k},"& .cm-scroller":{height:"100% !important"}}),B=ue.updateListener.of(Y=>{if(Y.docChanged&&typeof i=="function"&&!Y.transactions.some(be=>be.annotation(tA))){V.current?V.current.reset():(V.current=new nG(()=>{if(ie.current){var be=ie.current;ie.current=null,be()}V.current=null},oG),iG().add(V.current));var ae=Y.state.doc,de=ae.toString();i(de,Y)}o&&o(tG(Y))}),Z=eG({theme:f,editable:P,readOnly:T,placeholder:w,indentWithTab:M,basicSetup:D}),se=[B,oe,...Z];return r&&typeof r=="function"&&se.push(ue.updateListener.of(r)),se=se.concat(c),A.useLayoutEffect(()=>{if(j&&!X){var Y={doc:e,selection:t,extensions:se},ae=N?Qe.fromJSON(N.json,Y,N.fields):Qe.create(Y);if(H(ae),!U){var de=new ue({state:ae,parent:j,root:L});z(de),a&&a(de,ae)}}return()=>{U&&(H(void 0),z(void 0))}},[j,X]),A.useEffect(()=>{n.container&&K(n.container)},[n.container]),A.useEffect(()=>()=>{U&&(U.destroy(),z(void 0)),V.current&&(V.current.cancel(),V.current=null)},[U]),A.useEffect(()=>{d&&U&&U.focus()},[d,U]),A.useEffect(()=>{U&&U.dispatch({effects:Le.reconfigure.of(se)})},[f,c,m,g,x,v,C,k,w,P,T,M,D,i,r]),A.useEffect(()=>{if(e!==void 0){var Y=U?U.state.doc.toString():"";if(U&&e!==Y){var ae=V.current&&!V.current.isDone,de=()=>{U&&e!==U.state.doc.toString()&&U.dispatch({changes:{from:0,to:U.state.doc.toString().length,insert:e||""},annotations:[tA.of(!0)]})};ae?ie.current=de:de()}}},[e,U]),{state:X,setState:H,view:U,setView:z,container:j,setContainer:K}}var rG=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],_M=A.forwardRef((n,e)=>{var{className:t,value:i="",selection:o,extensions:a=[],onChange:r,onStatistics:c,onCreateEditor:d,onUpdate:f,autoFocus:m,theme:g="light",height:x,minHeight:v,maxHeight:C,width:k,minWidth:w,maxWidth:P,basicSetup:T,placeholder:M,indentWithTab:D,editable:L,readOnly:N,root:j,initialState:K}=n,U=I2(n,rG),z=A.useRef(null),{state:X,view:H,container:V,setContainer:ie}=aG({root:j,value:i,autoFocus:m,theme:g,height:x,minHeight:v,maxHeight:C,width:k,minWidth:w,maxWidth:P,basicSetup:T,placeholder:M,indentWithTab:D,editable:L,readOnly:N,selection:o,onChange:r,onStatistics:c,onCreateEditor:d,onUpdate:f,extensions:a,initialState:K});A.useImperativeHandle(e,()=>({editor:z.current,state:X,view:H}),[z,V,X,H]);var oe=A.useCallback(Z=>{z.current=Z,ie(Z)},[ie]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var B=typeof g=="string"?"cm-theme-"+g:"cm-theme";return p.jsx("div",B2({ref:oe,className:""+B+(t?" "+t:"")},U))});_M.displayName="CodeMirror";var nA={};class zh{constructor(e,t,i,o,a,r,c,d,f,m=0,g){this.p=e,this.stack=t,this.state=i,this.reducePos=o,this.pos=a,this.score=r,this.buffer=c,this.bufferBase=d,this.curContext=f,this.lookAhead=m,this.parent=g}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let o=e.parser.context;return new zh(e,[],t,i,i,0,[],0,o?new iA(o,o.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,o=e&65535,{parser:a}=this.p,r=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),c=a.dynamicPrecedence(o);if(c&&(this.score+=c),i==0){o<a.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(a.getGoto(this.state,o,!0),this.reducePos),o<a.minRepeatTerm&&this.storeNode(o,this.reducePos,this.reducePos,r?8:4,!0),this.reduceContext(o,this.reducePos);return}let d=this.stack.length-(i-1)*3-(e&262144?6:0),f=d?this.stack[d-2]:this.p.ranges[0].from;o<a.minRepeatTerm&&f==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let m=this.reducePos-f;m>=2e3&&!(!((t=this.p.parser.nodeSet.types[o])===null||t===void 0)&&t.isAnonymous)&&(f==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=m):this.p.lastBigReductionSize<m&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=f,this.p.lastBigReductionSize=m));let g=d?this.stack[d-1]:0,x=this.bufferBase+this.buffer.length-g;if(o<a.minRepeatTerm||e&131072){let v=a.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(o,f,v,x+4,!0)}if(e&262144)this.state=this.stack[d];else{let v=this.stack[d-3];this.state=a.getGoto(v,o,!0)}for(;this.stack.length>d;)this.stack.pop();this.reduceContext(o,f)}storeNode(e,t,i,o=4,a=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let r=this.buffer.length;if(r>0&&this.buffer[r-4]==0&&this.buffer[r-1]>-1){if(t==i)return;if(this.buffer[r-2]>=t){this.buffer[r-2]=i;return}}}if(!a||this.pos==i)this.buffer.push(e,t,i,o);else{let r=this.buffer.length;if(r>0&&(this.buffer[r-4]!=0||this.buffer[r-1]<0)){let c=!1;for(let d=r;d>0&&this.buffer[d-2]>i;d-=4)if(this.buffer[d-1]>=0){c=!0;break}if(c)for(;r>0&&this.buffer[r-2]>i;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,o>4&&(o-=4)}this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=i,this.buffer[r+3]=o}}shift(e,t,i,o){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let a=e,{parser:r}=this.p;this.pos=o;let c=r.stateFlag(a,1);!c&&(o>i||t<=r.maxNode)&&(this.reducePos=o),this.pushState(a,c?i:Math.min(i,this.reducePos)),this.shiftContext(t,i),t<=r.maxNode&&this.buffer.push(t,i,o,4)}else this.pos=o,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,o,4)}apply(e,t,i,o){e&65536?this.reduce(e):this.shift(e,t,i,o)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let o=this.pos;this.reducePos=this.pos=o+e.length,this.pushState(t,o),this.buffer.push(i,o,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),o=e.bufferBase+t;for(;e&&o==e.bufferBase;)e=e.parent;return new zh(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,o,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new lG(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if((i&65536)==0)return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let o=[];for(let a=0,r;a<t.length;a+=2)(r=t[a+1])!=this.state&&this.p.parser.hasAction(r,e)&&o.push(t[a],r);if(this.stack.length<120)for(let a=0;o.length<8&&a<t.length;a+=2){let r=t[a+1];o.some((c,d)=>d&1&&c==r)||o.push(t[a],r)}t=o}let i=[];for(let o=0;o<t.length&&i.length<4;o+=2){let a=t[o+1];if(a==this.state)continue;let r=this.split();r.pushState(a,this.pos),r.storeNode(0,r.pos,r.pos,4,!0),r.shiftContext(t[o],this.pos),r.reducePos=this.pos,r.score-=200,i.push(r)}return i}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let i=t>>19,o=t&65535,a=this.stack.length-i*3;if(a<0||e.getGoto(this.stack[a],o,!1)<0){let r=this.findForcedReduction();if(r==null)return!1;t=r}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(o,a)=>{if(!t.includes(o))return t.push(o),e.allActions(o,r=>{if(!(r&393216))if(r&65536){let c=(r>>19)-a;if(c>1){let d=r&65535,f=this.stack.length-c*3;if(f>=0&&e.getGoto(this.stack[f],d,!1)>=0)return c<<19|65536|d}}else{let c=i(r,a+1);if(c!=null)return c}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new iA(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class iA{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class lG{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let o=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=o}}class Fh{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Fh(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Fh(this.stack,this.pos,this.index)}}function $d(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,o=0;i<n.length;){let a=0;for(;;){let r=n.charCodeAt(i++),c=!1;if(r==126){a=65535;break}r>=92&&r--,r>=34&&r--;let d=r-32;if(d>=46&&(d-=46,c=!0),a+=d,c)break;a*=46}t?t[o++]=a:t=new e(a)}return t}class ch{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const oA=new ch;class cG{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=oA,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,o=this.rangeIndex,a=this.pos+e;for(;a<i.from;){if(!o)return null;let r=this.ranges[--o];a-=i.from-r.to,i=r}for(;t<0?a>i.to:a>=i.to;){if(o==this.ranges.length-1)return null;let r=this.ranges[++o];a+=r.from-i.to,i=r}return a}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,o;if(t>=0&&t<this.chunk.length)i=this.pos+e,o=this.chunk.charCodeAt(t);else{let a=this.resolveOffset(e,1);if(a==null)return-1;if(i=a,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)o=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let r=this.rangeIndex,c=this.range;for(;c.to<=i;)c=this.ranges[++r];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>c.to&&(this.chunk2=this.chunk2.slice(0,c.to-i)),o=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),o}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=oA,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let o of this.ranges){if(o.from>=t)break;o.to>e&&(i+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}return i}}class Nr{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;uG(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}Nr.prototype.contextual=Nr.prototype.fallback=Nr.prototype.extend=!1;Nr.prototype.fallback=Nr.prototype.extend=!1;class Tf{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function uG(n,e,t,i,o,a){let r=0,c=1<<i,{dialect:d}=t.p.parser;e:for(;(c&n[r])!=0;){let f=n[r+1];for(let v=r+3;v<f;v+=2)if((n[v+1]&c)>0){let C=n[v];if(d.allows(C)&&(e.token.value==-1||e.token.value==C||dG(C,e.token.value,o,a))){e.acceptToken(C);break}}let m=e.next,g=0,x=n[r+2];if(e.next<0&&x>g&&n[f+x*3-3]==65535){r=n[f+x*3-1];continue e}for(;g<x;){let v=g+x>>1,C=f+v+(v<<1),k=n[C],w=n[C+1]||65536;if(m<k)x=v;else if(m>=w)g=v+1;else{r=n[C+2],e.advance();continue e}}break}}function sA(n,e,t){for(let i=e,o;(o=n[i])!=65535;i++)if(o==t)return i-e;return-1}function dG(n,e,t,i){let o=sA(t,i,e);return o<0||sA(t,i,n)<o}const Kn=typeof process<"u"&&nA&&/\bparse\b/.test(nA.LOG);let Wg=null;function aA(n,e,t){let i=n.cursor(Dt.IncludeAnonymous);for(i.moveTo(e);;)if(!(t<0?i.childBefore(e):i.childAfter(e)))for(;;){if((t<0?i.to<e:i.from>e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class hG{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?aA(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?aA(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let i=this.trees[t],o=this.index[t];if(o==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let a=i.children[o],r=this.start[t]+i.positions[o];if(r>e)return this.nextStart=r,null;if(a instanceof ht){if(r==e){if(r<this.safeFrom)return null;let c=r+a.length;if(c<=this.safeTo){let d=a.prop(He.lookAhead);if(!d||c+d<this.fragment.to)return a}}this.index[t]++,r+a.length>=Math.max(this.safeFrom,e)&&(this.trees.push(a),this.start.push(r),this.index.push(0))}else this.index[t]++,this.nextStart=r+a.length}}}class fG{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new ch)}getActions(e){let t=0,i=null,{parser:o}=e.p,{tokenizers:a}=o,r=o.stateSlot(e.state,3),c=e.curContext?e.curContext.hash:0,d=0;for(let f=0;f<a.length;f++){if((1<<f&r)==0)continue;let m=a[f],g=this.tokens[f];if(!(i&&!m.fallback)&&((m.contextual||g.start!=e.pos||g.mask!=r||g.context!=c)&&(this.updateCachedToken(g,m,e),g.mask=r,g.context=c),g.lookAhead>g.end+25&&(d=Math.max(g.lookAhead,d)),g.value!=0)){let x=t;if(g.extended>-1&&(t=this.addActions(e,g.extended,g.end,t)),t=this.addActions(e,g.value,g.end,t),!m.extend&&(i=g,t>x))break}}for(;this.actions.length>t;)this.actions.pop();return d&&e.setLookAhead(d),!i&&e.pos==this.stream.end&&(i=new ch,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new ch,{pos:i,p:o}=e;return t.start=i,t.end=Math.min(i+1,o.stream.end),t.value=i==o.stream.end?o.parser.eofTerm:0,t}updateCachedToken(e,t,i){let o=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(o,e),i),e.value>-1){let{parser:a}=i.p;for(let r=0;r<a.specialized.length;r++)if(a.specialized[r]==e.value){let c=a.specializers[r](this.stream.read(e.start,e.end),i);if(c>=0&&i.p.parser.dialect.allows(c>>1)){(c&1)==0?e.value=c>>1:e.extended=c>>1;break}}}else e.value=0,e.end=this.stream.clipPos(o+1)}putAction(e,t,i,o){for(let a=0;a<o;a+=3)if(this.actions[a]==e)return o;return this.actions[o++]=e,this.actions[o++]=t,this.actions[o++]=i,o}addActions(e,t,i,o){let{state:a}=e,{parser:r}=e.p,{data:c}=r;for(let d=0;d<2;d++)for(let f=r.stateSlot(a,d?2:1);;f+=3){if(c[f]==65535)if(c[f+1]==1)f=Co(c,f+2);else{o==0&&c[f+1]==2&&(o=this.putAction(Co(c,f+2),t,i,o));break}c[f]==t&&(o=this.putAction(Co(c,f+1),t,i,o))}return o}}class pG{constructor(e,t,i,o){this.parser=e,this.input=t,this.ranges=o,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new cG(t,o),this.tokens=new fG(e,this.stream),this.topTerm=e.top[1];let{from:a}=o[0];this.stacks=[zh.start(this,e.top[0],a)],this.fragments=i.length&&this.stream.end-a>e.bufferLength*4?new hG(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],o,a;if(this.bigReductionCount>300&&e.length==1){let[r]=e;for(;r.forceReduce()&&r.stack.length&&r.stack[r.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;r<e.length;r++){let c=e[r];for(;;){if(this.tokens.mainToken=null,c.pos>t)i.push(c);else{if(this.advanceStack(c,i,e))continue;{o||(o=[],a=[]),o.push(c);let d=this.tokens.getMainToken(c);a.push(d.value,d.end)}}break}}if(!i.length){let r=o&&yG(o);if(r)return Kn&&console.log("Finish with "+this.stackID(r)),this.stackToTree(r);if(this.parser.strict)throw Kn&&o&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&o){let r=this.stoppedAt!=null&&o[0].pos>this.stoppedAt?o[0]:this.runRecovery(o,a,i);if(r)return Kn&&console.log("Force-finish "+this.stackID(r)),this.stackToTree(r.forceAll())}if(this.recovering){let r=this.recovering==1?1:this.recovering*3;if(i.length>r)for(i.sort((c,d)=>d.score-c.score);i.length>r;)i.pop();i.some(c=>c.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let r=0;r<i.length-1;r++){let c=i[r];for(let d=r+1;d<i.length;d++){let f=i[d];if(c.sameState(f)||c.buffer.length>500&&f.buffer.length>500)if((c.score-f.score||c.buffer.length-f.buffer.length)>0)i.splice(d--,1);else{i.splice(r--,1);continue e}}}i.length>12&&(i.sort((r,c)=>c.score-r.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let r=1;r<i.length;r++)i[r].pos<this.minStackPos&&(this.minStackPos=i[r].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,i){let o=e.pos,{parser:a}=this,r=Kn?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&o>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let f=e.curContext&&e.curContext.tracker.strict,m=f?e.curContext.hash:0;for(let g=this.fragments.nodeAt(o);g;){let x=this.parser.nodeSet.types[g.type.id]==g.type?a.getGoto(e.state,g.type.id):-1;if(x>-1&&g.length&&(!f||(g.prop(He.contextHash)||0)==m))return e.useNode(g,x),Kn&&console.log(r+this.stackID(e)+` (via reuse of ${a.getName(g.type.id)})`),!0;if(!(g instanceof ht)||g.children.length==0||g.positions[0]>0)break;let v=g.children[0];if(v instanceof ht&&g.positions[0]==0)g=v;else break}}let c=a.stateSlot(e.state,4);if(c>0)return e.reduce(c),Kn&&console.log(r+this.stackID(e)+` (via always-reduce ${a.getName(c&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let d=this.tokens.getActions(e);for(let f=0;f<d.length;){let m=d[f++],g=d[f++],x=d[f++],v=f==d.length||!i,C=v?e:e.split(),k=this.tokens.mainToken;if(C.apply(m,g,k?k.start:C.pos,x),Kn&&console.log(r+this.stackID(C)+` (via ${(m&65536)==0?"shift":`reduce of ${a.getName(m&65535)}`} for ${a.getName(g)} @ ${o}${C==e?"":", split"})`),v)return!0;C.pos>o?t.push(C):i.push(C)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return rA(e,t),!0}}runRecovery(e,t,i){let o=null,a=!1;for(let r=0;r<e.length;r++){let c=e[r],d=t[r<<1],f=t[(r<<1)+1],m=Kn?this.stackID(c)+" -> ":"";if(c.deadEnd&&(a||(a=!0,c.restart(),Kn&&console.log(m+this.stackID(c)+" (restarted)"),this.advanceFully(c,i))))continue;let g=c.split(),x=m;for(let v=0;v<10&&g.forceReduce()&&(Kn&&console.log(x+this.stackID(g)+" (via force-reduce)"),!this.advanceFully(g,i));v++)Kn&&(x=this.stackID(g)+" -> ");for(let v of c.recoverByInsert(d))Kn&&console.log(m+this.stackID(v)+" (via recover-insert)"),this.advanceFully(v,i);this.stream.end>c.pos?(f==c.pos&&(f++,d=0),c.recoverByDelete(d,f),Kn&&console.log(m+this.stackID(c)+` (via recover-delete ${this.parser.getName(d)})`),rA(c,i)):(!o||o.score<g.score)&&(o=g)}return o}stackToTree(e){return e.close(),ht.build({buffer:Fh.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Wg||(Wg=new WeakMap)).get(e);return t||Wg.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function rA(n,e){for(let t=0;t<e.length;t++){let i=e[t];if(i.pos==n.pos&&i.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class mG{constructor(e,t,i){this.source=e,this.flags=t,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}}const Qg=n=>n;class gG{constructor(e){this.start=e.start,this.shift=e.shift||Qg,this.reduce=e.reduce||Qg,this.reuse=e.reuse||Qg,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class qc extends Ax{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let c=0;c<e.repeatNodeCount;c++)t.push("");let i=Object.keys(e.topRules).map(c=>e.topRules[c][1]),o=[];for(let c=0;c<t.length;c++)o.push([]);function a(c,d,f){o[c].push([d,d.deserialize(String(f))])}if(e.nodeProps)for(let c of e.nodeProps){let d=c[0];typeof d=="string"&&(d=He[d]);for(let f=1;f<c.length;){let m=c[f++];if(m>=0)a(m,d,c[f++]);else{let g=c[f+-m];for(let x=-m;x>0;x--)a(c[f++],d,g);f++}}}this.nodeSet=new bf(t.map((c,d)=>Cn.define({name:d>=this.minRepeatTerm?void 0:c,id:d,props:o[d],top:i.indexOf(d)>-1,error:d==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(d)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=rD;let r=$d(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let c=0;c<this.specializerSpecs.length;c++)this.specialized[c]=this.specializerSpecs[c].term;this.specializers=this.specializerSpecs.map(lA),this.states=$d(e.states,Uint32Array),this.data=$d(e.stateData),this.goto=$d(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(c=>typeof c=="number"?new Nr(r,c):c),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let o=new pG(this,e,t,i);for(let a of this.wrappers)o=a(o,e,t,i);return o}getGoto(e,t,i=!1){let o=this.goto;if(t>=o[0])return-1;for(let a=o[t+1];;){let r=o[a++],c=r&1,d=o[a++];if(c&&i)return d;for(let f=a+(r>>1);a<f;a++)if(o[a]==e)return d;if(c)return-1}}hasAction(e,t){let i=this.data;for(let o=0;o<2;o++)for(let a=this.stateSlot(e,o?2:1),r;;a+=3){if((r=i[a])==65535)if(i[a+1]==1)r=i[a=Co(i,a+2)];else{if(i[a+1]==2)return Co(i,a+2);break}if(r==t||r==0)return Co(i,a+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),o=i?t(i):void 0;for(let a=this.stateSlot(e,1);o==null;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=Co(this.data,a+2);else break;o=t(Co(this.data,a+1))}return o}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Co(this.data,i+2);else break;if((this.data[i+2]&1)==0){let o=this.data[i+1];t.some((a,r)=>r&1&&a==o)||t.push(this.data[i],o)}}return t}configure(e){let t=Object.assign(Object.create(qc.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let o=e.tokenizers.find(a=>a.from==i);return o?o.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,o)=>{let a=e.specializers.find(c=>c.from==i.external);if(!a)return i;let r=Object.assign(Object.assign({},i),{external:a.to});return t.specializers[o]=lA(r),r})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let a of e.split(" ")){let r=t.indexOf(a);r>=0&&(i[r]=!0)}let o=null;for(let a=0;a<t.length;a++)if(!i[a])for(let r=this.dialects[t[a]],c;(c=this.data[r++])!=65535;)(o||(o=new Uint8Array(this.maxTerm+1)))[c]=1;return new mG(e,i,o)}static deserialize(e){return new qc(e)}}function Co(n,e){return n[e]|n[e+1]<<16}function yG(n){let e=null;for(let t of n){let i=t.p.stoppedAt;(t.pos==t.p.stream.end||i!=null&&t.pos>i)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function lA(n){if(n.external){let e=n.extend?1:0;return(t,i)=>n.external(t,i)<<1|e}return n.get}const bG=Ox({String:E.string,Number:E.number,"True False":E.bool,PropertyName:E.propertyName,Null:E.null,", :":E.separator,"[ ]":E.squareBracket,"{ }":E.brace}),xG=qc.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[bG],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),vG=jc.define({name:"json",parser:xG.configure({props:[Cf.add({Object:y1({except:/^\s*\}/}),Array:y1({except:/^\s*\]/})}),Dx.add({"Object Array":bD})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function CG(){return new mD(vG)}const mr=63,cA=64,SG=1,kG=2,HM=3,wG=4,UM=5,AG=6,OG=7,zM=65,PG=66,TG=8,DG=9,MG=10,NG=11,LG=12,FM=13,RG=19,EG=20,jG=29,IG=33,BG=34,_G=47,HG=0,Vx=1,ub=2,Gc=3,db=4;class ta{constructor(e,t,i){this.parent=e,this.depth=t,this.type=i,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+i}}ta.top=new ta(null,-1,HG);function yc(n,e){for(let t=0,i=e-n.pos-1;;i--,t++){let o=n.peek(i);if(Eo(o)||o==-1)return t}}function hb(n){return n==32||n==9}function Eo(n){return n==10||n==13}function qM(n){return hb(n)||Eo(n)}function aa(n){return n<0||qM(n)}const UG=new gG({start:ta.top,reduce(n,e){return n.type==Gc&&(e==EG||e==BG)?n.parent:n},shift(n,e,t,i){if(e==HM)return new ta(n,yc(i,i.pos),Vx);if(e==zM||e==UM)return new ta(n,yc(i,i.pos),ub);if(e==mr)return n.parent;if(e==RG||e==IG)return new ta(n,0,Gc);if(e==FM&&n.type==db)return n.parent;if(e==_G){let o=/[1-9]/.exec(i.read(i.pos,t.pos));if(o)return new ta(n,n.depth+ +o[0],db)}return n},hash(n){return n.hash}});function qr(n,e,t=0){return n.peek(t)==e&&n.peek(t+1)==e&&n.peek(t+2)==e&&aa(n.peek(t+3))}const zG=new Tf((n,e)=>{if(n.next==-1&&e.canShift(cA))return n.acceptToken(cA);let t=n.peek(-1);if((Eo(t)||t<0)&&e.context.type!=Gc){if(qr(n,45))if(e.canShift(mr))n.acceptToken(mr);else return n.acceptToken(SG,3);if(qr(n,46))if(e.canShift(mr))n.acceptToken(mr);else return n.acceptToken(kG,3);let i=0;for(;n.next==32;)i++,n.advance();(i<e.context.depth||i==e.context.depth&&e.context.type==Vx&&(n.next!=45||!aa(n.peek(1))))&&n.next!=-1&&!Eo(n.next)&&n.next!=35&&n.acceptToken(mr,-i)}},{contextual:!0}),FG=new Tf((n,e)=>{if(e.context.type==Gc){n.next==63&&(n.advance(),aa(n.next)&&n.acceptToken(OG));return}if(n.next==45)n.advance(),aa(n.next)&&n.acceptToken(e.context.type==Vx&&e.context.depth==yc(n,n.pos-1)?wG:HM);else if(n.next==63)n.advance(),aa(n.next)&&n.acceptToken(e.context.type==ub&&e.context.depth==yc(n,n.pos-1)?AG:UM);else{let t=n.pos;for(;;)if(hb(n.next)){if(n.pos==t)return;n.advance()}else if(n.next==33)GM(n);else if(n.next==38)fb(n);else if(n.next==42){fb(n);break}else if(n.next==39||n.next==34){if(Wx(n,!0))break;return}else if(n.next==91||n.next==123){if(!GG(n))return;break}else{KM(n,!0,!1,0);break}for(;hb(n.next);)n.advance();if(n.next==58){if(n.pos==t&&e.canShift(jG))return;let i=n.peek(1);aa(i)&&n.acceptTokenTo(e.context.type==ub&&e.context.depth==yc(n,t)?PG:zM,t)}}},{contextual:!0});function qG(n){return n>32&&n<127&&n!=34&&n!=37&&n!=44&&n!=60&&n!=62&&n!=92&&n!=94&&n!=96&&n!=123&&n!=124&&n!=125}function uA(n){return n>=48&&n<=57||n>=97&&n<=102||n>=65&&n<=70}function dA(n,e){return n.next==37?(n.advance(),uA(n.next)&&n.advance(),uA(n.next)&&n.advance(),!0):qG(n.next)||e&&n.next==44?(n.advance(),!0):!1}function GM(n){if(n.advance(),n.next==60){for(n.advance();;)if(!dA(n,!0)){n.next==62&&n.advance();break}}else for(;dA(n,!1););}function fb(n){for(n.advance();!aa(n.next)&&qh(n.next)!="f";)n.advance()}function Wx(n,e){let t=n.next,i=!1,o=n.pos;for(n.advance();;){let a=n.next;if(a<0)break;if(n.advance(),a==t)if(a==39)if(n.next==39)n.advance();else break;else break;else if(a==92&&t==34)n.next>=0&&n.advance();else if(Eo(a)){if(e)return!1;i=!0}else if(e&&n.pos>=o+1024)return!1}return!i}function GG(n){for(let e=[],t=n.pos+1024;;)if(n.next==91||n.next==123)e.push(n.next),n.advance();else if(n.next==39||n.next==34){if(!Wx(n,!0))return!1}else if(n.next==93||n.next==125){if(e[e.length-1]!=n.next-2)return!1;if(e.pop(),n.advance(),!e.length)return!0}else{if(n.next<0||n.pos>t||Eo(n.next))return!1;n.advance()}}const KG="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function qh(n){return n<33?"u":n>125?"s":KG[n-33]}function Yg(n,e){let t=qh(n);return t!="u"&&!(e&&t=="f")}function KM(n,e,t,i){if(qh(n.next)=="s"||(n.next==63||n.next==58||n.next==45)&&Yg(n.peek(1),t))n.advance();else return!1;let o=n.pos;for(;;){let a=n.next,r=0,c=i+1;for(;qM(a);){if(Eo(a)){if(e)return!1;c=0}else c++;a=n.peek(++r)}if(!(a>=0&&(a==58?Yg(n.peek(r+1),t):a==35?n.peek(r-1)!=32:Yg(a,t)))||!t&&c<=i||c==0&&!t&&(qr(n,45,r)||qr(n,46,r)))break;if(e&&qh(a)=="f")return!1;for(let f=r;f>=0;f--)n.advance();if(e&&n.pos>o+1024)return!1}return!0}const VG=new Tf((n,e)=>{if(n.next==33)GM(n),n.acceptToken(LG);else if(n.next==38||n.next==42){let t=n.next==38?MG:NG;fb(n),n.acceptToken(t)}else n.next==39||n.next==34?(Wx(n,!1),n.acceptToken(DG)):KM(n,!1,e.context.type==Gc,e.context.depth)&&n.acceptToken(TG)}),WG=new Tf((n,e)=>{let t=e.context.type==db?e.context.depth:-1,i=n.pos;e:for(;;){let o=0,a=n.next;for(;a==32;)a=n.peek(++o);if(!o&&(qr(n,45,o)||qr(n,46,o))||!Eo(a)&&(t<0&&(t=Math.max(e.context.depth+1,o)),o<t))break;for(;;){if(n.next<0)break e;let r=Eo(n.next);if(n.advance(),r)continue e;i=n.pos}}n.acceptTokenTo(FM,i)}),QG=Ox({DirectiveName:E.keyword,DirectiveContent:E.attributeValue,"DirectiveEnd DocEnd":E.meta,QuotedLiteral:E.string,BlockLiteralHeader:E.special(E.string),BlockLiteralContent:E.content,Literal:E.content,"Key/Literal Key/QuotedLiteral":E.definition(E.propertyName),"Anchor Alias":E.labelName,Tag:E.typeName,Comment:E.lineComment,": , -":E.separator,"?":E.punctuation,"[ ]":E.squareBracket,"{ }":E.brace}),YG=qc.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:UG,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[QG],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[zG,FG,VG,WG,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),$G=jc.define({name:"yaml",parser:YG.configure({props:[Cf.add({Stream:n=>{for(let e=n.node.resolve(n.pos,-1);e&&e.to>=n.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return n.baseIndentFor(e);if(e.name=="BlockLiteral")return n.baseIndentFor(e)+n.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return n.column(e.firstChild.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let t=n.column(e.from,1);if(t==n.lineIndent(e.from,1))return t;if(e.to>n.pos)return null}}return null},FlowMapping:g1({closing:"}"}),FlowSequence:g1({closing:"]"})}),Dx.add({"FlowMapping FlowSequence":bD,"Item Pair BlockLiteral":(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function XG(){return new mD($G)}const JG={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(n,e){let t;if(!e.inString&&(t=n.match(/^('''|"""|'|")/))&&(e.stringType=t[0],e.inString=!0),n.sol()&&!e.inString&&e.inArray===0&&(e.lhs=!0),e.inString){for(;e.inString;)if(n.match(e.stringType))e.inString=!1;else if(n.peek()==="\\")n.next(),n.next();else{if(n.eol())break;n.match(/^.[^\\\"\']*/)}return e.lhs?"property":"string"}else{if(e.inArray&&n.peek()==="]")return n.next(),e.inArray--,"bracket";if(e.lhs&&n.peek()==="["&&n.skipTo("]"))return n.next(),n.peek()==="]"&&n.next(),"atom";if(n.peek()==="#")return n.skipToEnd(),"comment";if(n.eatSpace())return null;if(e.lhs&&n.eatWhile(function(i){return i!="="&&i!=" "}))return"property";if(e.lhs&&n.peek()==="=")return n.next(),e.lhs=!1,null;if(!e.lhs&&n.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!e.lhs&&(n.match("true")||n.match("false")))return"atom";if(!e.lhs&&n.peek()==="[")return e.inArray++,n.next(),"bracket";if(!e.lhs&&n.match(/^\-?\d+(?:\.\d+)?/))return"number";n.eatSpace()||n.next()}return null},languageData:{commentTokens:{line:"#"}}};var VM=n=>{var{theme:e,settings:t={},styles:i=[]}=n,o={".cm-gutters":{}},a={};t.background&&(a.backgroundColor=t.background),t.backgroundImage&&(a.backgroundImage=t.backgroundImage),t.foreground&&(a.color=t.foreground),t.fontSize&&(a.fontSize=t.fontSize),(t.background||t.foreground)&&(o["&"]=a),t.fontFamily&&(o["&.cm-editor .cm-scroller"]={fontFamily:t.fontFamily}),t.gutterBackground&&(o[".cm-gutters"].backgroundColor=t.gutterBackground),t.gutterForeground&&(o[".cm-gutters"].color=t.gutterForeground),t.gutterBorder&&(o[".cm-gutters"].borderRightColor=t.gutterBorder),t.caret&&(o[".cm-content"]={caretColor:t.caret},o[".cm-cursor, .cm-dropCursor"]={borderLeftColor:t.caret});var r={};t.gutterActiveForeground&&(r.color=t.gutterActiveForeground),t.lineHighlight&&(o[".cm-activeLine"]={backgroundColor:t.lineHighlight},r.backgroundColor=t.lineHighlight),o[".cm-activeLineGutter"]=r,t.selection&&(o["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:t.selection+" !important"}),t.selectionMatch&&(o["& .cm-selectionMatch"]={backgroundColor:t.selectionMatch});var c=ue.theme(o,{dark:e==="dark"}),d=Wr.define(i),f=[c,Mx(d)];return f};function ZG(n,e){let t=n.slice(0,e).split(/\r\n|\n|\r/g);return[t.length,t.pop().length+1]}function eK(n,e,t){let i=n.split(/\r\n|\n|\r/g),o="",a=(Math.log10(e+1)|0)+1;for(let r=e-1;r<=e+1;r++){let c=i[r-1];c&&(o+=r.toString().padEnd(a," "),o+=": ",o+=c,o+=`
31
+ `,r===e&&(o+=" ".repeat(a+t+2),o+=`^
32
+ `))}return o}class Xe extends Error{line;column;codeblock;constructor(e,t){const[i,o]=ZG(t.toml,t.ptr),a=eK(t.toml,i,o);super(`Invalid TOML document: ${e}
33
+
34
+ ${a}`,t),this.line=i,this.column=o,this.codeblock=a}}function tK(n,e){let t=0;for(;n[e-++t]==="\\";);return--t&&t%2}function pb(n,e=0,t=n.length){let i=n.indexOf(`
35
+ `,e);return n[i-1]==="\r"&&i--,i<=t?i:-1}function Df(n,e){for(let t=e;t<n.length;t++){let i=n[t];if(i===`
36
+ `)return t;if(i==="\r"&&n[t+1]===`
37
+ `)return t+1;if(i<" "&&i!==" "||i==="")throw new Xe("control characters are not allowed in comments",{toml:n,ptr:e})}return n.length}function To(n,e,t,i){let o;for(;;){for(;(o=n[e])===" "||o===" "||!t&&(o===`
38
+ `||o==="\r"&&n[e+1]===`
39
+ `);)e++;if(i||o!=="#")break;e=Df(n,e)}return e}function nK(n,e,t,i,o=!1){if(!i)return e=pb(n,e),e<0?n.length:e;for(let a=e;a<n.length;a++){let r=n[a];if(r==="#")a=pb(n,a);else{if(r===t)return a+1;if(r===i||o&&(r===`
40
+ `||r==="\r"&&n[a+1]===`
41
+ `))return a}}throw new Xe("cannot find end of structure",{toml:n,ptr:e})}function WM(n,e){let t=n[e],i=t===n[e+1]&&n[e+1]===n[e+2]?n.slice(e,e+3):t;e+=i.length-1;do e=n.indexOf(i,++e);while(e>-1&&t!=="'"&&tK(n,e));return e>-1&&(e+=i.length,i.length>1&&(n[e]===t&&e++,n[e]===t&&e++)),e}let iK=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class Cr extends Date{#t=!1;#n=!1;#e=null;constructor(e){let t=!0,i=!0,o="Z";if(typeof e=="string"){let a=e.match(iK);a?(a[1]||(t=!1,e=`0000-01-01T${e}`),i=!!a[2],i&&e[10]===" "&&(e=e.replace(" ","T")),a[2]&&+a[2]>23?e="":(o=a[3]||null,e=e.toUpperCase(),!o&&i&&(e+="Z"))):e=""}super(e),isNaN(this.getTime())||(this.#t=t,this.#n=i,this.#e=o)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#e===null)return e.slice(0,-1);if(this.#e==="Z")return e;let t=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return t=this.#e[0]==="-"?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(e,t="Z"){let i=new Cr(e);return i.#e=t,i}static wrapAsLocalDateTime(e){let t=new Cr(e);return t.#e=null,t}static wrapAsLocalDate(e){let t=new Cr(e);return t.#n=!1,t.#e=null,t}static wrapAsLocalTime(e){let t=new Cr(e);return t.#t=!1,t.#e=null,t}}let oK=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,sK=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,aK=/^[+-]?0[0-9_]/,rK=/^[0-9a-f]{2,8}$/i,hA={b:"\b",t:" ",n:`
42
+ `,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function QM(n,e=0,t=n.length){let i=n[e]==="'",o=n[e++]===n[e]&&n[e]===n[e+1];o&&(t-=2,n[e+=2]==="\r"&&e++,n[e]===`
43
+ `&&e++);let a=0,r,c="",d=e;for(;e<t-1;){let f=n[e++];if(f===`
44
+ `||f==="\r"&&n[e]===`
45
+ `){if(!o)throw new Xe("newlines are not allowed in strings",{toml:n,ptr:e-1})}else if(f<" "&&f!==" "||f==="")throw new Xe("control characters are not allowed in strings",{toml:n,ptr:e-1});if(r){if(r=!1,f==="x"||f==="u"||f==="U"){let m=n.slice(e,e+=f==="x"?2:f==="u"?4:8);if(!rK.test(m))throw new Xe("invalid unicode escape",{toml:n,ptr:a});try{c+=String.fromCodePoint(parseInt(m,16))}catch{throw new Xe("invalid unicode escape",{toml:n,ptr:a})}}else if(o&&(f===`
46
+ `||f===" "||f===" "||f==="\r")){if(e=To(n,e-1,!0),n[e]!==`
47
+ `&&n[e]!=="\r")throw new Xe("invalid escape: only line-ending whitespace may be escaped",{toml:n,ptr:a});e=To(n,e)}else if(f in hA)c+=hA[f];else throw new Xe("unrecognized escape sequence",{toml:n,ptr:a});d=e}else!i&&f==="\\"&&(a=e-1,r=!0,c+=n.slice(d,a))}return c+n.slice(d,t-1)}function lK(n,e,t,i){if(n==="true")return!0;if(n==="false")return!1;if(n==="-inf")return-1/0;if(n==="inf"||n==="+inf")return 1/0;if(n==="nan"||n==="+nan"||n==="-nan")return NaN;if(n==="-0")return i?0n:0;let o=oK.test(n);if(o||sK.test(n)){if(aK.test(n))throw new Xe("leading zeroes are not allowed",{toml:e,ptr:t});n=n.replace(/_/g,"");let r=+n;if(isNaN(r))throw new Xe("invalid number",{toml:e,ptr:t});if(o){if((o=!Number.isSafeInteger(r))&&!i)throw new Xe("integer value cannot be represented losslessly",{toml:e,ptr:t});(o||i===!0)&&(r=BigInt(n))}return r}const a=new Cr(n);if(!a.isValid())throw new Xe("invalid value",{toml:e,ptr:t});return a}function cK(n,e,t){let i=n.slice(e,t),o=i.indexOf("#");return o>-1&&(Df(n,o),i=i.slice(0,o)),[i.trimEnd(),o]}function Qx(n,e,t,i,o){if(i===0)throw new Xe("document contains excessively nested structures. aborting.",{toml:n,ptr:e});let a=n[e];if(a==="["||a==="{"){let[d,f]=a==="["?hK(n,e,i,o):dK(n,e,i,o);if(t){if(f=To(n,f),n[f]===",")f++;else if(n[f]!==t)throw new Xe("expected comma or end of structure",{toml:n,ptr:f})}return[d,f]}let r;if(a==='"'||a==="'"){r=WM(n,e);let d=QM(n,e,r);if(t){if(r=To(n,r),n[r]&&n[r]!==","&&n[r]!==t&&n[r]!==`
48
+ `&&n[r]!=="\r")throw new Xe("unexpected character encountered",{toml:n,ptr:r});r+=+(n[r]===",")}return[d,r]}r=nK(n,e,",",t);let c=cK(n,e,r-+(n[r-1]===","));if(!c[0])throw new Xe("incomplete key-value declaration: no value specified",{toml:n,ptr:e});return t&&c[1]>-1&&(r=To(n,e+c[1]),r+=+(n[r]===",")),[lK(c[0],n,e,o),r]}let uK=/^[a-zA-Z0-9-_]+[ \t]*$/;function mb(n,e,t="="){let i=e-1,o=[],a=n.indexOf(t,e);if(a<0)throw new Xe("incomplete key-value: cannot find end of key",{toml:n,ptr:e});do{let r=n[e=++i];if(r!==" "&&r!==" ")if(r==='"'||r==="'"){if(r===n[e+1]&&r===n[e+2])throw new Xe("multiline strings are not allowed in keys",{toml:n,ptr:e});let c=WM(n,e);if(c<0)throw new Xe("unfinished string encountered",{toml:n,ptr:e});i=n.indexOf(".",c);let d=n.slice(c,i<0||i>a?a:i),f=pb(d);if(f>-1)throw new Xe("newlines are not allowed in keys",{toml:n,ptr:e+i+f});if(d.trimStart())throw new Xe("found extra tokens after the string part",{toml:n,ptr:c});if(a<c&&(a=n.indexOf(t,c),a<0))throw new Xe("incomplete key-value: cannot find end of key",{toml:n,ptr:e});o.push(QM(n,e,c))}else{i=n.indexOf(".",e);let c=n.slice(e,i<0||i>a?a:i);if(!uK.test(c))throw new Xe("only letter, numbers, dashes and underscores are allowed in keys",{toml:n,ptr:e});o.push(c.trimEnd())}}while(i+1&&i<a);return[o,To(n,a+1,!0,!0)]}function dK(n,e,t,i){let o={},a=new Set,r;for(e++;(r=n[e++])!=="}"&&r;){if(r===",")throw new Xe("expected value, found comma",{toml:n,ptr:e-1});if(r==="#")e=Df(n,e);else if(r!==" "&&r!==" "&&r!==`
49
+ `&&r!=="\r"){let c,d=o,f=!1,[m,g]=mb(n,e-1);for(let C=0;C<m.length;C++){if(C&&(d=f?d[c]:d[c]={}),c=m[C],(f=Object.hasOwn(d,c))&&(typeof d[c]!="object"||a.has(d[c])))throw new Xe("trying to redefine an already defined value",{toml:n,ptr:e});!f&&c==="__proto__"&&Object.defineProperty(d,c,{enumerable:!0,configurable:!0,writable:!0})}if(f)throw new Xe("trying to redefine an already defined value",{toml:n,ptr:e});let[x,v]=Qx(n,g,"}",t-1,i);a.add(x),d[c]=x,e=v}}if(!r)throw new Xe("unfinished table encountered",{toml:n,ptr:e});return[o,e]}function hK(n,e,t,i){let o=[],a;for(e++;(a=n[e++])!=="]"&&a;){if(a===",")throw new Xe("expected value, found comma",{toml:n,ptr:e-1});if(a==="#")e=Df(n,e);else if(a!==" "&&a!==" "&&a!==`
50
+ `&&a!=="\r"){let r=Qx(n,e-1,"]",t-1,i);o.push(r[0]),e=r[1]}}if(!a)throw new Xe("unfinished array encountered",{toml:n,ptr:e});return[o,e]}function fA(n,e,t,i){let o=e,a=t,r,c=!1,d;for(let f=0;f<n.length;f++){if(f){if(o=c?o[r]:o[r]={},a=(d=a[r]).c,i===0&&(d.t===1||d.t===2))return null;if(d.t===2){let m=o.length-1;o=o[m],a=a[m].c}}if(r=n[f],(c=Object.hasOwn(o,r))&&a[r]?.t===0&&a[r]?.d)return null;c||(r==="__proto__"&&(Object.defineProperty(o,r,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,r,{enumerable:!0,configurable:!0,writable:!0})),a[r]={t:f<n.length-1&&i===2?3:i,d:!1,i:0,c:{}})}if(d=a[r],d.t!==i&&!(i===1&&d.t===3)||(i===2&&(d.d||(d.d=!0,o[r]=[]),o[r].push(o={}),d.c[d.i++]=d={t:1,d:!1,i:0,c:{}}),d.d))return null;if(d.d=!0,i===1)o=c?o[r]:o[r]={};else if(i===0&&c)return null;return[r,o,d.c]}function fK(n,{maxDepth:e=1e3,integersAsBigInt:t}={}){let i={},o={},a=i,r=o;for(let c=To(n,0);c<n.length;){if(n[c]==="["){let d=n[++c]==="[",f=mb(n,c+=+d,"]");if(d){if(n[f[1]-1]!=="]")throw new Xe("expected end of table declaration",{toml:n,ptr:f[1]-1});f[1]++}let m=fA(f[0],i,o,d?2:1);if(!m)throw new Xe("trying to redefine an already defined table or value",{toml:n,ptr:c});r=m[2],a=m[1],c=f[1]}else{let d=mb(n,c),f=fA(d[0],a,r,0);if(!f)throw new Xe("trying to redefine an already defined table or value",{toml:n,ptr:c});let m=Qx(n,d[1],void 0,e,t);f[1][f[0]]=m[0],c=m[1]}if(c=To(n,c,!0),n[c]&&n[c]!==`
51
+ `&&n[c]!=="\r")throw new Xe("each key-value declaration must be followed by an end-of-line",{toml:n,ptr:c});c=To(n,c)}return i}const pK=[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/_SECRET$/,/_SECRET_KEY$/,/^API_KEY$/,/^AUTH_TOKEN$/,/^SECRET$/,/_PASSWORD$/,/^PASSWORD$/,/_CREDENTIAL$/,/_PRIVATE_KEY$/];function pA(n){return pK.some(e=>e.test(n))}function mK(n){if(!n.trim())return{valid:!0};try{return JSON.parse(n),{valid:!0}}catch(e){const t=e.message,i=t.match(/position (\d+)/);if(i){const o=parseInt(i[1],10),a=n.substring(0,o).split(`
52
+ `);return{valid:!1,error:t,line:a.length}}return{valid:!1,error:t}}}function gK(n){if(!n.trim())return{valid:!0};try{return fK(n),{valid:!0}}catch(e){const t=e.message,i=t.match(/line\s+(\d+)/i);return{valid:!1,error:t,line:i?Number.parseInt(i[1],10):void 0}}}const yK={yaml:/^(\s*)("(?:[^"\\]|\\.)*"|'[^']*'|[A-Za-z0-9_.-]+)\s*:\s*/gm,toml:/^(\s*)("(?:[^"\\]|\\.)*"|'[^']*'|[A-Za-z0-9_.-]+)\s*=\s*/gm};function bK(n){return n.length>=2&&n[0]==='"'&&n[n.length-1]==='"'?n.slice(1,-1).replace(/\\(.)/g,"$1"):n.length>=2&&n[0]==="'"&&n[n.length-1]==="'"?n.slice(1,-1):n}function Yx(n,e,t){let i=e+1;if(t==="'"){const o=n.indexOf("'",i);return o>=0?o+1:n.length}for(;i<n.length;){const o=n[i];if(o==="\\"){i+=2;continue}if(o==='"')return i+1;i++}return n.length}function xK(n,e){const t=n[e];if(t!=='"'&&t!=="'")return e+1;if(n.slice(e,e+3)===t+t+t){const i=t+t+t,o=n.indexOf(i,e+3);return o>=0?o+3:n.length}return Yx(n,e,t)}function mA(n,e,t,i){const o=n.length;if(e>=o)return e;const a=n.sliceString(e,Math.min(e+3,o));if(t==="toml"){if(a==='"""'||a==="'''"){const r=a,d=n.sliceString(e+3,o).indexOf(r);return d>=0?e+3+d+3:o}if(a[0]==="["){const r=n.toString();let c=0,d=e;for(;d<o;){const f=r[d];if(f==='"'||f==="'"){d=xK(r,d);continue}if(f==="#"){const m=r.indexOf(`
53
+ `,d);d=m>=0?m+1:o;continue}if(f==="[")c++;else if(f==="]"&&(c--,c===0))return d+1;d++}return o}return n.lineAt(e).to}if(t==="yaml"){if(a[0]==="|"||a[0]===">"){let r=n.lineAt(e),c=r.to;for(;r.number<n.lines;){const d=n.line(r.number+1);if(d.text.replace(/\s+$/,"")===""){c=d.to,r=d;continue}if(d.text.search(/\S/)<=i)break;c=d.to,r=d}return c}return n.lineAt(e).to}if(a[0]==="["||a[0]==="{"){const r=a[0],c=r==="["?"]":"}",d=n.toString();let f=0,m=e;for(;m<o;){const g=d[m];if(g==='"'){m=Yx(d,m,'"');continue}if(g===r)f++;else if(g===c&&(f--,f===0))return m+1;m++}return o}return n.lineAt(e).to}function vK(n){const e=[];let t=0,i=null;for(;t<n.length;){const o=n[t];if(o===" "||o===" "||o===`
54
+ `||o==="\r"){t++;continue}if(o==='"'){const a=t,r=Yx(n,t,'"');let c=r;for(;c<n.length&&(n[c]===" "||n[c]===" "||n[c]===`
55
+ `||n[c]==="\r");)c++;if((i==="{"||i===","||i===null)&&n[c]===":"){const m=n.slice(a+1,r-1).replace(/\\(.)/g,"$1");let g=c+1;for(;g<n.length&&(n[g]===" "||n[g]===" "||n[g]===`
56
+ `||n[g]==="\r");)g++;e.push({valueStart:g,key:m}),i='"',t=c+1;continue}i='"',t=r;continue}i=o,t++}return e}function gA(n,e){const t=new Yi,i=n.state.doc,o=i.toString();if(e==="json"){for(const{valueStart:c,key:d}of vK(o)){if(!pA(d)||c>=i.length)continue;const f=mA(i,c,"json",0),m=i.sliceString(c,f).replace(/\s+$/,"").length;m!==0&&t.add(c,c+m,Oe.mark({class:"cm-sensitive-mask"}))}return t.finish()}const a=new RegExp(yK[e].source,"gm");let r;for(;(r=a.exec(o))!==null;){const c=bK(r[2]),d=r[1].length;if(!pA(c))continue;const f=r.index+r[0].length;if(f>=i.length)continue;const m=mA(i,f,e,d),g=i.sliceString(f,m).replace(/\s+$/,"").length;g!==0&&t.add(f,f+g,Oe.mark({class:"cm-sensitive-mask"}))}return t.finish()}function CK(n){return At.fromClass(class{decorations;constructor(e){this.decorations=gA(e,n)}update(e){e.docChanged&&(this.decorations=gA(e.view,n))}},{decorations:e=>e.decorations})}const SK=VM({theme:"light",settings:{background:"transparent",foreground:"#393A34",caret:"#393A34",selection:"rgba(57, 58, 52, 0.18)",selectionMatch:"rgba(57, 58, 52, 0.12)",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"#999988"},styles:[{tag:[E.comment,E.lineComment,E.blockComment],color:"#999988",fontStyle:"italic"},{tag:[E.string,E.special(E.string),E.regexp],color:"#e3116c"},{tag:[E.number,E.bool,E.null,E.atom,E.variableName,E.propertyName,E.url],color:"#36acaa"},{tag:[E.keyword,E.attributeName,E.modifier,E.operatorKeyword],color:"#00a4db"},{tag:[E.function(E.variableName),E.labelName],color:"#6f42c1"},{tag:[E.tagName,E.heading],color:"#00009f",fontWeight:"bold"},{tag:[E.deleted,E.invalid],color:"#d73a49"},{tag:[E.punctuation,E.operator,E.bracket,E.brace,E.separator],color:"#393A34"}]}),kK=VM({theme:"dark",settings:{background:"transparent",foreground:"#d6deeb",caret:"#80a4c2",selection:"rgba(29, 59, 83, 0.99)",selectionMatch:"rgba(35, 77, 112, 0.6)",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"#4b6479"},styles:[{tag:[E.comment,E.lineComment,E.blockComment],color:"#637777",fontStyle:"italic"},{tag:[E.string,E.special(E.string),E.url],color:"rgb(173, 219, 103)"},{tag:E.number,color:"rgb(247, 140, 108)"},{tag:[E.bool,E.null,E.atom],color:"rgb(255, 88, 116)"},{tag:[E.keyword,E.modifier,E.operatorKeyword],color:"rgb(127, 219, 202)"},{tag:[E.propertyName,E.attributeName],color:"rgb(128, 203, 196)"},{tag:[E.variableName,E.labelName],color:"rgb(214, 222, 235)"},{tag:E.function(E.variableName),color:"rgb(130, 170, 255)"},{tag:[E.tagName,E.heading],color:"rgb(127, 219, 202)"},{tag:[E.bracket,E.punctuation,E.operator,E.brace,E.separator],color:"rgb(199, 146, 234)"},{tag:[E.className,E.special(E.string)],color:"rgb(255, 203, 139)"},{tag:[E.deleted,E.invalid],color:"rgba(239, 83, 80, 0.56)"}]}),wK=ue.baseTheme({".cm-sensitive-mask":{filter:"blur(3px)",opacity:"0.7",transition:"filter 200ms ease, opacity 200ms ease"},".cm-sensitive-revealed .cm-sensitive-mask":{filter:"none",opacity:"1"}});function YM({value:n,onChange:e,language:t="json",readonly:i=!1,exactText:o=!1,className:a,minHeight:r="300px",heightMode:c="content"}){const{isDark:d}=Mb(),{t:f}=Ce(),[m,g]=A.useState(!1),[x,v]=A.useState(!0),C=c==="fill-parent",k=A.useMemo(()=>t==="json"?mK(n):t==="toml"?gK(n):{valid:!0},[n,t]),w=A.useMemo(()=>[t==="json"?CG():t==="yaml"?XG():Nx.define(JG),ue.lineWrapping,wK,CK(t),ue.theme({"&":{fontSize:"0.875rem",backgroundColor:"transparent"},"&.cm-focused":{outline:"none"},".cm-content":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",padding:"12px 0",caretColor:"currentColor"},".cm-line":{padding:"0 12px",lineHeight:"1.625"},".cm-scroller":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",lineHeight:"1.625"},".cm-gutters":{display:"none"}})],[t]);return p.jsxs("div",{className:q("flex min-h-0 flex-col",C&&"h-full",a),style:C?{height:r==="auto"?void 0:r}:void 0,"data-slot":"code-editor-root",children:[p.jsxs("div",{className:q("relative rounded-md border overflow-hidden bg-muted/30",C&&"flex min-h-0 flex-1 flex-col",m&&"ring-2 ring-ring ring-offset-2 ring-offset-background",i&&"opacity-70",!k.valid&&"border-destructive"),"data-slot":"code-editor-surface",children:[p.jsx("div",{className:q(C?"scrollbar-editor min-h-0 flex-1 overflow-hidden":void 0),"data-slot":C?"code-editor-viewport":void 0,children:p.jsx(_M,{value:n,onChange:i?void 0:e,readOnly:i,editable:!i,theme:d?kK:SK,extensions:w,height:C?"100%":void 0,minHeight:C?void 0:r,basicSetup:{lineNumbers:!1,foldGutter:!1,highlightActiveLine:!1,highlightActiveLineGutter:!1,autocompletion:!1,searchKeymap:!0},onFocus:()=>g(!0),onBlur:()=>g(!1),className:q("cm-editor-root",!x&&"cm-sensitive-revealed",C&&"h-full"),"data-slot":"code-editor-codemirror"})}),p.jsx("div",{className:"absolute top-2 right-2 z-20 opacity-50 hover:opacity-100 transition-opacity",children:p.jsx(gt,{variant:"ghost",size:"icon",className:"h-6 w-6 bg-background/50 hover:bg-background border shadow-sm rounded-full",onClick:()=>v(!x),title:f(x?"codeEditor.revealSensitive":"codeEditor.maskSensitive"),children:x?p.jsx(Vc,{className:"h-3 w-3"}):p.jsx(Kc,{className:"h-3 w-3"})})})]}),p.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs",children:[k.valid?p.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[p.jsx(Wc,{className:"w-3 h-3 text-green-500"}),f("codeEditor.valid",{language:t.toUpperCase()})]}):p.jsxs("span",{className:"flex items-center gap-1 text-destructive",children:[p.jsx(vc,{className:"w-3 h-3"}),k.error,k.line&&` (line ${k.line})`]}),i&&p.jsx("span",{className:"ml-auto text-muted-foreground",children:f("codeEditor.readOnly")})]})]})}const Mf=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:YM},Symbol.toStringTag,{value:"Module"})),AK={browserConfig:null,browserStatus:null,browserLoading:!0,browserStatusLoading:!0,browserSaving:!1,browserError:null,browserSuccess:!1,webSearchConfig:null,webSearchStatus:null,webSearchLoading:!0,webSearchStatusLoading:!0,webSearchSaving:!1,webSearchError:null,webSearchSuccess:!1,globalEnvConfig:null,globalEnvLoading:!0,globalEnvSaving:!1,globalEnvError:null,globalEnvSuccess:!1,proxyConfig:null,proxyLoading:!0,proxySaving:!1,proxyError:null,proxySuccess:!1,proxyTestResult:null,proxyTesting:!1,rawConfig:null,rawConfigLoading:!1};function OK(n,e){switch(e.type){case"SET_BROWSER_CONFIG":return{...n,browserConfig:e.payload};case"SET_BROWSER_STATUS":return{...n,browserStatus:e.payload};case"SET_BROWSER_LOADING":return{...n,browserLoading:e.payload};case"SET_BROWSER_STATUS_LOADING":return{...n,browserStatusLoading:e.payload};case"SET_BROWSER_SAVING":return{...n,browserSaving:e.payload};case"SET_BROWSER_ERROR":return{...n,browserError:e.payload};case"SET_BROWSER_SUCCESS":return{...n,browserSuccess:e.payload};case"SET_WEBSEARCH_CONFIG":return{...n,webSearchConfig:e.payload};case"SET_WEBSEARCH_STATUS":return{...n,webSearchStatus:e.payload};case"SET_WEBSEARCH_LOADING":return{...n,webSearchLoading:e.payload};case"SET_WEBSEARCH_STATUS_LOADING":return{...n,webSearchStatusLoading:e.payload};case"SET_WEBSEARCH_SAVING":return{...n,webSearchSaving:e.payload};case"SET_WEBSEARCH_ERROR":return{...n,webSearchError:e.payload};case"SET_WEBSEARCH_SUCCESS":return{...n,webSearchSuccess:e.payload};case"SET_GLOBALENV_CONFIG":return{...n,globalEnvConfig:e.payload};case"SET_GLOBALENV_LOADING":return{...n,globalEnvLoading:e.payload};case"SET_GLOBALENV_SAVING":return{...n,globalEnvSaving:e.payload};case"SET_GLOBALENV_ERROR":return{...n,globalEnvError:e.payload};case"SET_GLOBALENV_SUCCESS":return{...n,globalEnvSuccess:e.payload};case"SET_PROXY_CONFIG":return{...n,proxyConfig:e.payload};case"SET_PROXY_LOADING":return{...n,proxyLoading:e.payload};case"SET_PROXY_SAVING":return{...n,proxySaving:e.payload};case"SET_PROXY_ERROR":return{...n,proxyError:e.payload};case"SET_PROXY_SUCCESS":return{...n,proxySuccess:e.payload};case"SET_PROXY_TEST_RESULT":return{...n,proxyTestResult:e.payload};case"SET_PROXY_TESTING":return{...n,proxyTesting:e.payload};case"SET_RAW_CONFIG":return{...n,rawConfig:e.payload};case"SET_RAW_CONFIG_LOADING":return{...n,rawConfigLoading:e.payload};default:return n}}const $M=A.createContext(null);function PK({children:n}){const[e,t]=A.useReducer(OK,AK);return p.jsx($M.Provider,{value:{state:e,dispatch:t},children:n})}function XM(){const n=A.useContext($M);if(!n)throw new Error("useSettingsContext must be used within a SettingsProvider");return n}function TK(){const{dispatch:n}=XM(),e=A.useCallback(V=>n({type:"SET_BROWSER_CONFIG",payload:V}),[n]),t=A.useCallback(V=>n({type:"SET_BROWSER_STATUS",payload:V}),[n]),i=A.useCallback(V=>n({type:"SET_BROWSER_LOADING",payload:V}),[n]),o=A.useCallback(V=>n({type:"SET_BROWSER_STATUS_LOADING",payload:V}),[n]),a=A.useCallback(V=>n({type:"SET_BROWSER_SAVING",payload:V}),[n]),r=A.useCallback(V=>n({type:"SET_BROWSER_ERROR",payload:V}),[n]),c=A.useCallback(V=>n({type:"SET_BROWSER_SUCCESS",payload:V}),[n]),d=A.useCallback(V=>n({type:"SET_WEBSEARCH_CONFIG",payload:V}),[n]),f=A.useCallback(V=>n({type:"SET_WEBSEARCH_STATUS",payload:V}),[n]),m=A.useCallback(V=>n({type:"SET_WEBSEARCH_LOADING",payload:V}),[n]),g=A.useCallback(V=>n({type:"SET_WEBSEARCH_STATUS_LOADING",payload:V}),[n]),x=A.useCallback(V=>n({type:"SET_WEBSEARCH_SAVING",payload:V}),[n]),v=A.useCallback(V=>n({type:"SET_WEBSEARCH_ERROR",payload:V}),[n]),C=A.useCallback(V=>n({type:"SET_WEBSEARCH_SUCCESS",payload:V}),[n]),k=A.useCallback(V=>n({type:"SET_GLOBALENV_CONFIG",payload:V}),[n]),w=A.useCallback(V=>n({type:"SET_GLOBALENV_LOADING",payload:V}),[n]),P=A.useCallback(V=>n({type:"SET_GLOBALENV_SAVING",payload:V}),[n]),T=A.useCallback(V=>n({type:"SET_GLOBALENV_ERROR",payload:V}),[n]),M=A.useCallback(V=>n({type:"SET_GLOBALENV_SUCCESS",payload:V}),[n]),D=A.useCallback(V=>n({type:"SET_PROXY_CONFIG",payload:V}),[n]),L=A.useCallback(V=>n({type:"SET_PROXY_LOADING",payload:V}),[n]),N=A.useCallback(V=>n({type:"SET_PROXY_SAVING",payload:V}),[n]),j=A.useCallback(V=>n({type:"SET_PROXY_ERROR",payload:V}),[n]),K=A.useCallback(V=>n({type:"SET_PROXY_SUCCESS",payload:V}),[n]),U=A.useCallback(V=>n({type:"SET_PROXY_TEST_RESULT",payload:V}),[n]),z=A.useCallback(V=>n({type:"SET_PROXY_TESTING",payload:V}),[n]),X=A.useCallback(V=>n({type:"SET_RAW_CONFIG",payload:V}),[n]),H=A.useCallback(V=>n({type:"SET_RAW_CONFIG_LOADING",payload:V}),[n]);return A.useMemo(()=>({setBrowserConfig:e,setBrowserStatus:t,setBrowserLoading:i,setBrowserStatusLoading:o,setBrowserSaving:a,setBrowserError:r,setBrowserSuccess:c,setWebSearchConfig:d,setWebSearchStatus:f,setWebSearchLoading:m,setWebSearchStatusLoading:g,setWebSearchSaving:x,setWebSearchError:v,setWebSearchSuccess:C,setGlobalEnvConfig:k,setGlobalEnvLoading:w,setGlobalEnvSaving:P,setGlobalEnvError:T,setGlobalEnvSuccess:M,setProxyConfig:D,setProxyLoading:L,setProxySaving:N,setProxyError:j,setProxySuccess:K,setProxyTestResult:U,setProxyTesting:z,setRawConfig:X,setRawConfigLoading:H}),[e,t,i,o,a,r,c,d,f,m,g,x,v,C,k,w,P,T,M,D,L,N,j,K,U,z,X,H])}function DK(){const[n,e]=oO(),t=n.get("tab")?.toLowerCase(),i=t==="imageanalysis"||t==="image"?"image":t==="channels"?"channels":t==="globalenv"?"globalenv":t==="proxy"?"proxy":t==="auth"?"auth":t==="thinking"?"thinking":t==="backups"?"backups":"websearch",o=A.useCallback(a=>{e({tab:a},{replace:!0})},[e]);return{activeTab:i,setActiveTab:o}}function MK(){const{state:n}=XM(),e=TK(),[t,i]=A.useState(!1),o=A.useCallback(async()=>{try{e.setRawConfigLoading(!0);const r=await fetch("/api/config/raw");if(!r.ok){e.setRawConfig(null);return}const c=await r.text();e.setRawConfig(c)}catch{e.setRawConfig(null)}finally{e.setRawConfigLoading(!1)}},[e]),a=A.useCallback(async()=>{if(n.rawConfig)try{await navigator.clipboard.writeText(n.rawConfig),i(!0),setTimeout(()=>i(!1),2e3)}catch{}},[n.rawConfig]);return{rawConfig:n.rawConfig,loading:n.rawConfigLoading,copied:t,fetchRawConfig:o,copyToClipboard:a}}function yA({activeTab:n,onTabChange:e}){const{t}=Ce(),i=[{value:"browser",label:t("settingsTabs.browser"),icon:GE},{value:"websearch",label:t("settingsTabs.web"),icon:pO},{value:"image",label:t("settingsTabs.image"),icon:yO},{value:"channels",label:t("settingsTabs.channels"),icon:KE},{value:"globalenv",label:t("settingsTabs.env"),icon:Cb},{value:"thinking",label:t("settingsTabs.think"),icon:VE},{value:"proxy",label:t("settingsTabs.proxy"),icon:WE},{value:"auth",label:t("settingsTabs.auth"),icon:bb},{value:"backups",label:t("settingsTabs.backup"),icon:QE}];return p.jsx(OP,{value:n,onValueChange:o=>e(o),children:p.jsx($b,{className:"grid w-full grid-cols-9",children:i.map(({value:o,label:a,icon:r})=>p.jsxs(bh,{value:o,className:"gap-1.5 px-2 text-xs",children:[p.jsx(r,{className:"h-3.5 w-3.5 shrink-0"}),p.jsx("span",{className:"truncate",children:a})]},o))})})}function bA(){return p.jsxs("div",{className:"flex-1 p-5 space-y-6",children:[p.jsx(tt,{className:"h-4 w-2/3"}),p.jsx("div",{className:"p-4 rounded-lg border",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(tt,{className:"h-5 w-32"}),p.jsx(tt,{className:"h-4 w-48"})]}),p.jsx(tt,{className:"h-6 w-10 rounded-full"})]})}),p.jsxs("div",{className:"space-y-3",children:[p.jsx(tt,{className:"h-5 w-24"}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(tt,{className:"h-20 w-full rounded-lg"}),p.jsx(tt,{className:"h-20 w-full rounded-lg"}),p.jsx(tt,{className:"h-20 w-full rounded-lg"})]})]})]})}function JM(n,e=3,t=1e3){return n().catch(i=>{if(e<=0)throw i;return new Promise(o=>setTimeout(o,t)).then(()=>JM(n,e-1,t*2))})}function Io(n){return A.lazy(()=>JM(n))}const xA=Io(()=>rt(()=>import("./index-2_GLcEv2.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),vA=Io(()=>rt(()=>import("./index-DKO-Gvdv.js"),__vite__mapDeps([10,1,2,11,4,5,6,7,8,9]))),CA=Io(()=>rt(()=>import("./index-C6Qs2iuI.js"),__vite__mapDeps([12,1,2,4,5,6,7,8,9]))),SA=Io(()=>rt(()=>import("./channels-BiUWmX53.js"),__vite__mapDeps([13,1,2,4,5,6,7,8,9]))),kA=Io(()=>rt(()=>import("./globalenv-section-ZUDnNjxP.js"),__vite__mapDeps([14,1,2,4,5,6,7,8,9]))),wA=Io(()=>rt(()=>import("./index-DG9lONG_.js"),__vite__mapDeps([15,1,2,4,5,6,7,8,9]))),AA=Io(()=>rt(()=>import("./index-BW69dNHf.js"),__vite__mapDeps([16,1,2,17,4,18,19,5,6,20,7,8,9]))),OA=Io(()=>rt(()=>import("./auth-section-FHhzv-t_.js"),__vite__mapDeps([21,1,2,4,5,6,7,8,9]))),PA=Io(()=>rt(()=>import("./backups-section-XgV36q98.js"),__vite__mapDeps([22,1,2,19,4,5,6,7,8,9])));class TA extends A.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){return this.state.hasError?p.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:p.jsxs("div",{className:"text-center p-6 max-w-md",children:[p.jsx(vc,{className:"w-12 h-12 mx-auto mb-4 text-destructive"}),p.jsx("p",{className:"font-medium text-foreground mb-2",children:re.t("settings.sectionLoadFailed")}),p.jsx("p",{className:"text-sm mb-4",children:this.state.error?.message||re.t("settings.unknownError")}),p.jsxs(gt,{variant:"outline",onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2",children:[p.jsx(xc,{className:"w-4 h-4"}),re.t("settings.reloadPage")]})]})}):this.props.children}}function NK(n){switch(n?.toLowerCase()){case"browser":return"browser";case"imageanalysis":case"image":return"image";case"channels":return"channels";case"globalenv":return"globalenv";case"proxy":return"proxy";case"auth":return"auth";case"thinking":return"thinking";case"backups":return"backups";default:return"websearch"}}function LK(){const{t:n}=Ce(),{setActiveTab:e}=DK(),[t]=oO(),i=NK(t.get("tab")),{rawConfig:o,loading:a,copied:r,fetchRawConfig:c,copyToClipboard:d}=MK();A.useEffect(()=>{c()},[c]);const f=m=>{A.startTransition(()=>{e(m)})};return p.jsxs("div",{className:"h-full min-h-0",children:[p.jsxs("div",{className:"md:hidden h-full flex flex-col",children:[p.jsx("div",{className:"border-b bg-background p-4",children:p.jsx(yA,{activeTab:i,onTabChange:f})}),p.jsx(TA,{children:p.jsxs(A.Suspense,{fallback:p.jsx(bA,{}),children:[i==="browser"&&p.jsx(vA,{}),i==="websearch"&&p.jsx(xA,{}),i==="image"&&p.jsx(CA,{}),i==="channels"&&p.jsx(SA,{}),i==="globalenv"&&p.jsx(kA,{}),i==="thinking"&&p.jsx(wA,{}),i==="proxy"&&p.jsx(AA,{}),i==="auth"&&p.jsx(OA,{}),i==="backups"&&p.jsx(PA,{})]})})]}),p.jsxs(Qb,{direction:"horizontal",className:"h-full hidden md:flex",children:[p.jsx(Sc,{defaultSize:46,minSize:36,maxSize:62,children:p.jsxs("div",{className:"h-full border-r flex flex-col bg-muted/30 relative",children:[p.jsx("div",{className:"p-5 border-b bg-background",children:p.jsx(yA,{activeTab:i,onTabChange:f})}),p.jsx(TA,{children:p.jsxs(A.Suspense,{fallback:p.jsx(bA,{}),children:[i==="browser"&&p.jsx(vA,{}),i==="websearch"&&p.jsx(xA,{}),i==="image"&&p.jsx(CA,{}),i==="channels"&&p.jsx(SA,{}),i==="globalenv"&&p.jsx(kA,{}),i==="thinking"&&p.jsx(wA,{}),i==="proxy"&&p.jsx(AA,{}),i==="auth"&&p.jsx(OA,{}),i==="backups"&&p.jsx(PA,{})]})})]})}),p.jsx(Yb,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:p.jsx(Qh,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),p.jsx(Sc,{defaultSize:54,minSize:35,children:p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(ek,{className:"w-5 h-5 text-primary"}),p.jsxs("div",{children:[p.jsx("h2",{className:"font-semibold",children:"config.yaml"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"~/.ccs/config.yaml"})]})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(gt,{variant:"outline",size:"sm",onClick:d,disabled:!o,children:r?p.jsxs(p.Fragment,{children:[p.jsx(Lr,{className:"w-4 h-4 mr-1"}),n("settings.copied")]}):p.jsxs(p.Fragment,{children:[p.jsx(dh,{className:"w-4 h-4 mr-1"}),n("settings.copy")]})}),p.jsx(gt,{variant:"outline",size:"sm",onClick:c,disabled:a,children:p.jsx(xc,{className:`w-4 h-4 ${a?"animate-spin":""}`})})]})]}),p.jsx("div",{className:"flex-1 overflow-auto",children:o?p.jsx(YM,{value:o,onChange:()=>{},language:"yaml",readonly:!0,minHeight:"auto",className:"min-h-full"}):a?p.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[p.jsx(xc,{className:"w-5 h-5 animate-spin mr-2"}),n("settings.loading")]}):p.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:p.jsxs("div",{className:"text-center",children:[p.jsx(ek,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),p.jsx("p",{children:n("settings.configFileNotFound")}),p.jsx("code",{className:"text-sm bg-muted px-2 py-1 rounded mt-2 inline-block",children:"ccs migrate"})]})})})]})})]})]})}function RK(){return p.jsx(PK,{children:p.jsx(LK,{})})}const EK=Object.freeze(Object.defineProperty({__proto__:null,SettingsPage:RK},Symbol.toStringTag,{value:"Module"}));function jK(n,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:n,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const IK={},ic={};function ra(n,e){try{const i=(IK[n]||=new Intl.DateTimeFormat("en-US",{timeZone:n,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return i in ic?ic[i]:DA(i,i.split(":"))}catch{if(n in ic)return ic[n];const t=n?.match(BK);return t?DA(n,t.slice(1)):NaN}}const BK=/([+-]\d\d):?(\d\d)?/;function DA(n,e){const t=+(e[0]||0),i=+(e[1]||0),o=+(e[2]||0)/60;return ic[n]=t*60+i>0?t*60+i+o:t*60-i-o}class Ki extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(ra(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),ZM(this),gb(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Ki(...t,e):new Ki(Date.now(),e)}withTimeZone(e){return new Ki(+this,e)}getTimezoneOffset(){const e=-ra(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),gb(this),+this}[Symbol.for("constructDateFrom")](e){return new Ki(+new Date(e),this.timeZone)}}const MA=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(n=>{if(!MA.test(n))return;const e=n.replace(MA,"$1UTC");Ki.prototype[e]&&(n.startsWith("get")?Ki.prototype[n]=function(){return this.internal[e]()}:(Ki.prototype[n]=function(){return Date.prototype[e].apply(this.internal,arguments),_K(this),+this},Ki.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),gb(this),+this}))});function gb(n){n.internal.setTime(+n),n.internal.setUTCSeconds(n.internal.getUTCSeconds()-Math.round(-ra(n.timeZone,n)*60))}function _K(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),ZM(n)}function ZM(n){const e=ra(n.timeZone,n),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+n);i.setUTCHours(i.getUTCHours()-1);const o=-new Date(+n).getTimezoneOffset(),a=-new Date(+i).getTimezoneOffset(),r=o-a,c=Date.prototype.getHours.apply(n)!==n.internal.getUTCHours();r&&c&&n.internal.setUTCMinutes(n.internal.getUTCMinutes()+r);const d=o-t;d&&Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+d);const f=new Date(+n);f.setUTCSeconds(0);const m=o>0?f.getSeconds():(f.getSeconds()-60)%60,g=Math.round(-(ra(n.timeZone,n)*60))%60;(g||m)&&(n.internal.setUTCSeconds(n.internal.getUTCSeconds()+g),Date.prototype.setUTCSeconds.call(n,Date.prototype.getUTCSeconds.call(n)+g+m));const x=ra(n.timeZone,n),v=x>0?Math.floor(x):Math.ceil(x),k=-new Date(+n).getTimezoneOffset()-v,w=v!==t,P=k-d;if(w&&P){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+P);const T=ra(n.timeZone,n),M=T>0?Math.floor(T):Math.ceil(T),D=v-M;D&&(n.internal.setUTCMinutes(n.internal.getUTCMinutes()+D),Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+D))}}class wo extends Ki{static tz(e,...t){return t.length?new wo(...t,e):new wo(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),o=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,o]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${i} ${t} ${o}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,o]=this.tzComponents();return`${e} GMT${t}${i}${o} (${jK(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),o=String(Math.abs(e)%60).padStart(2,"0");return[t,i,o]}withTimeZone(e){return new wo(+this,e)}[Symbol.for("constructDateFrom")](e){return new wo(+new Date(e),this.timeZone)}}const NA=5,HK=4;function UK(n,e){const t=e.startOfMonth(n),i=t.getDay()>0?t.getDay():7,o=e.addDays(n,-i+1),a=e.addDays(o,NA*7-1);return e.getMonth(n)===e.getMonth(a)?NA:HK}function eN(n,e){const t=e.startOfMonth(n),i=t.getDay();return i===1?t:i===0?e.addDays(t,-6):e.addDays(t,-1*(i-1))}function zK(n,e){const t=eN(n,e),i=UK(n,e);return e.addDays(t,i*7-1)}const tN={...Ul,labels:{labelDayButton:(n,e,t,i)=>{let o;i&&typeof i.format=="function"?o=i.format.bind(i):o=(r,c)=>Yl(r,c,{locale:Ul,...t});let a=o(n,"PPPP");return e.today&&(a=`Today, ${a}`),e.selected&&(a=`${a}, selected`),a},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:n=>`Week ${n}`,labelYearDropdown:"Choose the Year",labelGrid:(n,e,t)=>{let i;return t&&typeof t.format=="function"?i=t.format.bind(t):i=(o,a)=>Yl(o,a,{locale:Ul,...e}),i(n,"LLLL yyyy")},labelGridcell:(n,e,t,i)=>{let o;i&&typeof i.format=="function"?o=i.format.bind(i):o=(r,c)=>Yl(r,c,{locale:Ul,...t});let a=o(n,"PPPP");return e?.today&&(a=`Today, ${a}`),a},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(n,e,t)=>{let i;return t&&typeof t.format=="function"?i=t.format.bind(t):i=(o,a)=>Yl(o,a,{locale:Ul,...e}),i(n,"cccc")}}};class $n{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?wo.tz(this.options.timeZone):new this.Date,this.newDate=(i,o,a)=>this.overrides?.newDate?this.overrides.newDate(i,o,a):this.options.timeZone?new wo(i,o,a,this.options.timeZone):new Date(i,o,a),this.addDays=(i,o)=>this.overrides?.addDays?this.overrides.addDays(i,o):ZE(i,o),this.addMonths=(i,o)=>this.overrides?.addMonths?this.overrides.addMonths(i,o):e2(i,o),this.addWeeks=(i,o)=>this.overrides?.addWeeks?this.overrides.addWeeks(i,o):t2(i,o),this.addYears=(i,o)=>this.overrides?.addYears?this.overrides.addYears(i,o):n2(i,o),this.differenceInCalendarDays=(i,o)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(i,o):i2(i,o),this.differenceInCalendarMonths=(i,o)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(i,o):o2(i,o),this.eachMonthOfInterval=i=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(i):s2(i),this.eachYearOfInterval=i=>{const o=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(i):a2(i),a=new Set(o.map(c=>this.getYear(c)));if(a.size===o.length)return o;const r=[];return a.forEach(c=>{r.push(new Date(c,0,1))}),r},this.endOfBroadcastWeek=i=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(i):zK(i,this),this.endOfISOWeek=i=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(i):r2(i),this.endOfMonth=i=>this.overrides?.endOfMonth?this.overrides.endOfMonth(i):l2(i),this.endOfWeek=(i,o)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(i,o):c2(i,this.options),this.endOfYear=i=>this.overrides?.endOfYear?this.overrides.endOfYear(i):u2(i),this.format=(i,o,a)=>{const r=this.overrides?.format?this.overrides.format(i,o,this.options):Yl(i,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(r):r},this.getISOWeek=i=>this.overrides?.getISOWeek?this.overrides.getISOWeek(i):d2(i),this.getMonth=(i,o)=>this.overrides?.getMonth?this.overrides.getMonth(i,this.options):h2(i,this.options),this.getYear=(i,o)=>this.overrides?.getYear?this.overrides.getYear(i,this.options):f2(i,this.options),this.getWeek=(i,o)=>this.overrides?.getWeek?this.overrides.getWeek(i,this.options):p2(i,this.options),this.isAfter=(i,o)=>this.overrides?.isAfter?this.overrides.isAfter(i,o):m2(i,o),this.isBefore=(i,o)=>this.overrides?.isBefore?this.overrides.isBefore(i,o):g2(i,o),this.isDate=i=>this.overrides?.isDate?this.overrides.isDate(i):y2(i),this.isSameDay=(i,o)=>this.overrides?.isSameDay?this.overrides.isSameDay(i,o):b2(i,o),this.isSameMonth=(i,o)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(i,o):x2(i,o),this.isSameYear=(i,o)=>this.overrides?.isSameYear?this.overrides.isSameYear(i,o):v2(i,o),this.max=i=>this.overrides?.max?this.overrides.max(i):C2(i),this.min=i=>this.overrides?.min?this.overrides.min(i):S2(i),this.setMonth=(i,o)=>this.overrides?.setMonth?this.overrides.setMonth(i,o):k2(i,o),this.setYear=(i,o)=>this.overrides?.setYear?this.overrides.setYear(i,o):w2(i,o),this.startOfBroadcastWeek=(i,o)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(i,this):eN(i,this),this.startOfDay=i=>this.overrides?.startOfDay?this.overrides.startOfDay(i):A2(i),this.startOfISOWeek=i=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(i):O2(i),this.startOfMonth=i=>this.overrides?.startOfMonth?this.overrides.startOfMonth(i):P2(i),this.startOfWeek=(i,o)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(i,this.options):T2(i,this.options),this.startOfYear=i=>this.overrides?.startOfYear?this.overrides.startOfYear(i):D2(i),this.options={locale:tN,...e},this.overrides=t}getDigitMap(){const{numerals:e="latn"}=this.options,t=new Intl.NumberFormat("en-US",{numberingSystem:e}),i={};for(let o=0;o<10;o++)i[o.toString()]=t.format(o);return i}replaceDigits(e){const t=this.getDigitMap();return e.replace(/\d/g,i=>t[i]||i)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&$n.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:t,timeZone:i,numerals:o}=this.options,a=t?.code;if(a&&$n.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:"long",year:"numeric",timeZone:i,numberingSystem:o}).format(e)}catch{}const r=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,r)}}$n.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Zi=new $n;class nN{constructor(e,t,i=Zi){this.date=e,this.displayMonth=t,this.outside=!!(t&&!i.isSameMonth(e,t)),this.dateLib=i,this.isoDate=i.format(e,"yyyy-MM-dd"),this.displayMonthId=i.format(t,"yyyy-MM"),this.dateMonthId=i.format(e,"yyyy-MM")}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class FK{constructor(e,t){this.date=e,this.weeks=t}}class qK{constructor(e,t){this.days=t,this.weekNumber=e}}function GK(n){return ge.createElement("button",{...n})}function KK(n){return ge.createElement("span",{...n})}function VK(n){const{size:e=24,orientation:t="left",className:i}=n;return ge.createElement("svg",{className:i,width:e,height:e,viewBox:"0 0 24 24"},t==="up"&&ge.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),t==="down"&&ge.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),t==="left"&&ge.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),t==="right"&&ge.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function WK(n){const{day:e,modifiers:t,...i}=n;return ge.createElement("td",{...i})}function QK(n){const{day:e,modifiers:t,...i}=n,o=ge.useRef(null);return ge.useEffect(()=>{t.focused&&o.current?.focus()},[t.focused]),ge.createElement("button",{ref:o,...i})}var we;(function(n){n.Root="root",n.Chevron="chevron",n.Day="day",n.DayButton="day_button",n.CaptionLabel="caption_label",n.Dropdowns="dropdowns",n.Dropdown="dropdown",n.DropdownRoot="dropdown_root",n.Footer="footer",n.MonthGrid="month_grid",n.MonthCaption="month_caption",n.MonthsDropdown="months_dropdown",n.Month="month",n.Months="months",n.Nav="nav",n.NextMonthButton="button_next",n.PreviousMonthButton="button_previous",n.Week="week",n.Weeks="weeks",n.Weekday="weekday",n.Weekdays="weekdays",n.WeekNumber="week_number",n.WeekNumberHeader="week_number_header",n.YearsDropdown="years_dropdown"})(we||(we={}));var wt;(function(n){n.disabled="disabled",n.hidden="hidden",n.outside="outside",n.focused="focused",n.today="today"})(wt||(wt={}));var Si;(function(n){n.range_end="range_end",n.range_middle="range_middle",n.range_start="range_start",n.selected="selected"})(Si||(Si={}));var Qn;(function(n){n.weeks_before_enter="weeks_before_enter",n.weeks_before_exit="weeks_before_exit",n.weeks_after_enter="weeks_after_enter",n.weeks_after_exit="weeks_after_exit",n.caption_after_enter="caption_after_enter",n.caption_after_exit="caption_after_exit",n.caption_before_enter="caption_before_enter",n.caption_before_exit="caption_before_exit"})(Qn||(Qn={}));function YK(n){const{options:e,className:t,components:i,classNames:o,...a}=n,r=[o[we.Dropdown],t].join(" "),c=e?.find(({value:d})=>d===a.value);return ge.createElement("span",{"data-disabled":a.disabled,className:o[we.DropdownRoot]},ge.createElement(i.Select,{className:r,...a},e?.map(({value:d,label:f,disabled:m})=>ge.createElement(i.Option,{key:d,value:d,disabled:m},f))),ge.createElement("span",{className:o[we.CaptionLabel],"aria-hidden":!0},c?.label,ge.createElement(i.Chevron,{orientation:"down",size:18,className:o[we.Chevron]})))}function $K(n){return ge.createElement("div",{...n})}function XK(n){return ge.createElement("div",{...n})}function JK(n){const{calendarMonth:e,displayIndex:t,...i}=n;return ge.createElement("div",{...i},n.children)}function ZK(n){const{calendarMonth:e,displayIndex:t,...i}=n;return ge.createElement("div",{...i})}function eV(n){return ge.createElement("table",{...n})}function tV(n){return ge.createElement("div",{...n})}const iN=A.createContext(void 0);function nu(){const n=A.useContext(iN);if(n===void 0)throw new Error("useDayPicker() must be used within a custom component.");return n}function nV(n){const{components:e}=nu();return ge.createElement(e.Dropdown,{...n})}function iV(n){const{onPreviousClick:e,onNextClick:t,previousMonth:i,nextMonth:o,...a}=n,{components:r,classNames:c,labels:{labelPrevious:d,labelNext:f}}=nu(),m=A.useCallback(x=>{o&&t?.(x)},[o,t]),g=A.useCallback(x=>{i&&e?.(x)},[i,e]);return ge.createElement("nav",{...a},ge.createElement(r.PreviousMonthButton,{type:"button",className:c[we.PreviousMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":d(i),onClick:g},ge.createElement(r.Chevron,{disabled:i?void 0:!0,className:c[we.Chevron],orientation:"left"})),ge.createElement(r.NextMonthButton,{type:"button",className:c[we.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":f(o),onClick:m},ge.createElement(r.Chevron,{disabled:o?void 0:!0,orientation:"right",className:c[we.Chevron]})))}function oV(n){const{components:e}=nu();return ge.createElement(e.Button,{...n})}function sV(n){return ge.createElement("option",{...n})}function aV(n){const{components:e}=nu();return ge.createElement(e.Button,{...n})}function rV(n){const{rootRef:e,...t}=n;return ge.createElement("div",{...t,ref:e})}function lV(n){return ge.createElement("select",{...n})}function cV(n){const{week:e,...t}=n;return ge.createElement("tr",{...t})}function uV(n){return ge.createElement("th",{...n})}function dV(n){return ge.createElement("thead",{"aria-hidden":!0},ge.createElement("tr",{...n}))}function hV(n){const{week:e,...t}=n;return ge.createElement("th",{...t})}function fV(n){return ge.createElement("th",{...n})}function pV(n){return ge.createElement("tbody",{...n})}function mV(n){const{components:e}=nu();return ge.createElement(e.Dropdown,{...n})}const gV=Object.freeze(Object.defineProperty({__proto__:null,Button:GK,CaptionLabel:KK,Chevron:VK,Day:WK,DayButton:QK,Dropdown:YK,DropdownNav:$K,Footer:XK,Month:JK,MonthCaption:ZK,MonthGrid:eV,Months:tV,MonthsDropdown:nV,Nav:iV,NextMonthButton:oV,Option:sV,PreviousMonthButton:aV,Root:rV,Select:lV,Week:cV,WeekNumber:hV,WeekNumberHeader:fV,Weekday:uV,Weekdays:dV,Weeks:pV,YearsDropdown:mV},Symbol.toStringTag,{value:"Module"}));function Ao(n,e,t=!1,i=Zi){let{from:o,to:a}=n;const{differenceInCalendarDays:r,isSameDay:c}=i;return o&&a?(r(a,o)<0&&([o,a]=[a,o]),r(e,o)>=(t?1:0)&&r(a,e)>=(t?1:0)):!t&&a?c(a,e):!t&&o?c(o,e):!1}function $x(n){return!!(n&&typeof n=="object"&&"before"in n&&"after"in n)}function Nf(n){return!!(n&&typeof n=="object"&&"from"in n)}function Xx(n){return!!(n&&typeof n=="object"&&"after"in n)}function Jx(n){return!!(n&&typeof n=="object"&&"before"in n)}function oN(n){return!!(n&&typeof n=="object"&&"dayOfWeek"in n)}function sN(n,e){return Array.isArray(n)&&n.every(e.isDate)}function Oo(n,e,t=Zi){const i=Array.isArray(e)?e:[e],{isSameDay:o,differenceInCalendarDays:a,isAfter:r}=t;return i.some(c=>{if(typeof c=="boolean")return c;if(t.isDate(c))return o(n,c);if(sN(c,t))return c.some(d=>o(n,d));if(Nf(c))return Ao(c,n,!1,t);if(oN(c))return Array.isArray(c.dayOfWeek)?c.dayOfWeek.includes(n.getDay()):c.dayOfWeek===n.getDay();if($x(c)){const d=a(c.before,n),f=a(c.after,n),m=d>0,g=f<0;return r(c.before,c.after)?g&&m:m||g}return Xx(c)?a(n,c.after)>0:Jx(c)?a(c.before,n)>0:typeof c=="function"?c(n):!1})}function yV(n,e,t,i,o){const{disabled:a,hidden:r,modifiers:c,showOutsideDays:d,broadcastCalendar:f,today:m=o.today()}=e,{isSameDay:g,isSameMonth:x,startOfMonth:v,isBefore:C,endOfMonth:k,isAfter:w}=o,P=t&&v(t),T=i&&k(i),M={[wt.focused]:[],[wt.outside]:[],[wt.disabled]:[],[wt.hidden]:[],[wt.today]:[]},D={};for(const L of n){const{date:N,displayMonth:j}=L,K=!!(j&&!x(N,j)),U=!!(P&&C(N,P)),z=!!(T&&w(N,T)),X=!!(a&&Oo(N,a,o)),H=!!(r&&Oo(N,r,o))||U||z||!f&&!d&&K||f&&d===!1&&K,V=g(N,m);K&&M.outside.push(L),X&&M.disabled.push(L),H&&M.hidden.push(L),V&&M.today.push(L),c&&Object.keys(c).forEach(ie=>{const oe=c?.[ie];oe&&Oo(N,oe,o)&&(D[ie]?D[ie].push(L):D[ie]=[L])})}return L=>{const N={[wt.focused]:!1,[wt.disabled]:!1,[wt.hidden]:!1,[wt.outside]:!1,[wt.today]:!1},j={};for(const K in M){const U=M[K];N[K]=U.some(z=>z===L)}for(const K in D)j[K]=D[K].some(U=>U===L);return{...N,...j}}}function bV(n,e,t={}){return Object.entries(n).filter(([,o])=>o===!0).reduce((o,[a])=>(t[a]?o.push(t[a]):e[wt[a]]?o.push(e[wt[a]]):e[Si[a]]&&o.push(e[Si[a]]),o),[e[we.Day]])}function xV(n){return{...gV,...n}}function vV(n){const e={"data-mode":n.mode??void 0,"data-required":"required"in n?n.required:void 0,"data-multiple-months":n.numberOfMonths&&n.numberOfMonths>1||void 0,"data-week-numbers":n.showWeekNumber||void 0,"data-broadcast-calendar":n.broadcastCalendar||void 0,"data-nav-layout":n.navLayout||void 0};return Object.entries(n).forEach(([t,i])=>{t.startsWith("data-")&&(e[t]=i)}),e}function CV(){const n={};for(const e in we)n[we[e]]=`rdp-${we[e]}`;for(const e in wt)n[wt[e]]=`rdp-${wt[e]}`;for(const e in Si)n[Si[e]]=`rdp-${Si[e]}`;for(const e in Qn)n[Qn[e]]=`rdp-${Qn[e]}`;return n}function aN(n,e,t){return(t??new $n(e)).formatMonthYear(n)}const SV=aN;function kV(n,e,t){return(t??new $n(e)).format(n,"d")}function wV(n,e=Zi){return e.format(n,"LLLL")}function AV(n,e,t){return(t??new $n(e)).format(n,"cccccc")}function OV(n,e=Zi){return n<10?e.formatNumber(`0${n.toLocaleString()}`):e.formatNumber(`${n.toLocaleString()}`)}function PV(){return""}function rN(n,e=Zi){return e.format(n,"yyyy")}const TV=rN,DV=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:aN,formatDay:kV,formatMonthCaption:SV,formatMonthDropdown:wV,formatWeekNumber:OV,formatWeekNumberHeader:PV,formatWeekdayName:AV,formatYearCaption:TV,formatYearDropdown:rN},Symbol.toStringTag,{value:"Module"}));function MV(n){return n?.formatMonthCaption&&!n.formatCaption&&(n.formatCaption=n.formatMonthCaption),n?.formatYearCaption&&!n.formatYearDropdown&&(n.formatYearDropdown=n.formatYearCaption),{...DV,...n}}function Zx(n,e,t,i){let o=(i??new $n(t)).format(n,"PPPP");return e.today&&(o=`Today, ${o}`),e.selected&&(o=`${o}, selected`),o}const NV=Zx;function ev(n,e,t){return(t??new $n(e)).formatMonthYear(n)}const LV=ev;function lN(n,e,t,i){let o=(i??new $n(t)).format(n,"PPPP");return e?.today&&(o=`Today, ${o}`),o}function cN(n){return"Choose the Month"}function uN(){return""}const RV="Go to the Next Month";function dN(n,e){return RV}function hN(n){return"Go to the Previous Month"}function fN(n,e,t){return(t??new $n(e)).format(n,"cccc")}function pN(n,e){return`Week ${n}`}function mN(n){return"Week Number"}function gN(n){return"Choose the Year"}const EV=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:LV,labelDay:NV,labelDayButton:Zx,labelGrid:ev,labelGridcell:lN,labelMonthDropdown:cN,labelNav:uN,labelNext:dN,labelPrevious:hN,labelWeekNumber:pN,labelWeekNumberHeader:mN,labelWeekday:fN,labelYearDropdown:gN},Symbol.toStringTag,{value:"Module"})),xi=(n,e,t)=>e||(t?typeof t=="function"?t:(...i)=>t:n);function jV(n,e){const t=e.locale?.labels??{};return{...EV,...n??{},labelDayButton:xi(Zx,n?.labelDayButton,t.labelDayButton),labelMonthDropdown:xi(cN,n?.labelMonthDropdown,t.labelMonthDropdown),labelNext:xi(dN,n?.labelNext,t.labelNext),labelPrevious:xi(hN,n?.labelPrevious,t.labelPrevious),labelWeekNumber:xi(pN,n?.labelWeekNumber,t.labelWeekNumber),labelYearDropdown:xi(gN,n?.labelYearDropdown,t.labelYearDropdown),labelGrid:xi(ev,n?.labelGrid,t.labelGrid),labelGridcell:xi(lN,n?.labelGridcell,t.labelGridcell),labelNav:xi(uN,n?.labelNav,t.labelNav),labelWeekNumberHeader:xi(mN,n?.labelWeekNumberHeader,t.labelWeekNumberHeader),labelWeekday:xi(fN,n?.labelWeekday,t.labelWeekday)}}function IV(n,e,t,i,o){const{startOfMonth:a,startOfYear:r,endOfYear:c,eachMonthOfInterval:d,getMonth:f}=o;return d({start:r(n),end:c(n)}).map(x=>{const v=i.formatMonthDropdown(x,o),C=f(x),k=e&&x<a(e)||t&&x>a(t)||!1;return{value:C,label:v,disabled:k}})}function BV(n,e={},t={}){let i={...e?.[we.Day]};return Object.entries(n).filter(([,o])=>o===!0).forEach(([o])=>{i={...i,...t?.[o]}}),i}function _V(n,e,t,i){const o=i??n.today(),a=t?n.startOfBroadcastWeek(o,n):e?n.startOfISOWeek(o):n.startOfWeek(o),r=[];for(let c=0;c<7;c++){const d=n.addDays(a,c);r.push(d)}return r}function HV(n,e,t,i,o=!1){if(!n||!e)return;const{startOfYear:a,endOfYear:r,eachYearOfInterval:c,getYear:d}=i,f=a(n),m=r(e),g=c({start:f,end:m});return o&&g.reverse(),g.map(x=>{const v=t.formatYearDropdown(x,i);return{value:d(x),label:v,disabled:!1}})}const iu=n=>n instanceof HTMLElement?n:null,$g=n=>[...n.querySelectorAll("[data-animated-month]")??[]],UV=n=>iu(n.querySelector("[data-animated-month]")),Xg=n=>iu(n.querySelector("[data-animated-caption]")),Jg=n=>iu(n.querySelector("[data-animated-weeks]")),zV=n=>iu(n.querySelector("[data-animated-nav]")),FV=n=>iu(n.querySelector("[data-animated-weekdays]"));function qV(n,e,{classNames:t,months:i,focused:o,dateLib:a}){const r=A.useRef(null),c=A.useRef(i),d=A.useRef(!1);A.useLayoutEffect(()=>{const f=c.current;if(c.current=i,!e||!n.current||!(n.current instanceof HTMLElement)||i.length===0||f.length===0||i.length!==f.length)return;const m=a.isSameMonth(i[0].date,f[0].date),g=a.isAfter(i[0].date,f[0].date),x=g?t[Qn.caption_after_enter]:t[Qn.caption_before_enter],v=g?t[Qn.weeks_after_enter]:t[Qn.weeks_before_enter],C=r.current,k=n.current.cloneNode(!0);if(k instanceof HTMLElement?($g(k).forEach(M=>{if(!(M instanceof HTMLElement))return;const D=UV(M);D&&M.contains(D)&&M.removeChild(D);const L=Xg(M);L&&L.classList.remove(x);const N=Jg(M);N&&N.classList.remove(v)}),r.current=k):r.current=null,d.current||m||o)return;const w=C instanceof HTMLElement?$g(C):[],P=$g(n.current);if(P?.every(T=>T instanceof HTMLElement)&&w&&w.every(T=>T instanceof HTMLElement)){d.current=!0,n.current.style.isolation="isolate";const T=zV(n.current);T&&(T.style.zIndex="1"),P.forEach((M,D)=>{const L=w[D];if(!L)return;M.style.position="relative",M.style.overflow="hidden";const N=Xg(M);N&&N.classList.add(x);const j=Jg(M);j&&j.classList.add(v);const K=()=>{d.current=!1,n.current&&(n.current.style.isolation=""),T&&(T.style.zIndex=""),N&&N.classList.remove(x),j&&j.classList.remove(v),M.style.position="",M.style.overflow="",M.contains(L)&&M.removeChild(L)};L.style.pointerEvents="none",L.style.position="absolute",L.style.overflow="hidden",L.setAttribute("aria-hidden","true");const U=FV(L);U&&(U.style.opacity="0");const z=Xg(L);z&&(z.classList.add(g?t[Qn.caption_before_exit]:t[Qn.caption_after_exit]),z.addEventListener("animationend",K));const X=Jg(L);X&&X.classList.add(g?t[Qn.weeks_before_exit]:t[Qn.weeks_after_exit]),M.insertBefore(L,M.firstChild)})}})}function GV(n,e,t,i){const o=n[0],a=n[n.length-1],{ISOWeek:r,fixedWeeks:c,broadcastCalendar:d}=t??{},{addDays:f,differenceInCalendarDays:m,differenceInCalendarMonths:g,endOfBroadcastWeek:x,endOfISOWeek:v,endOfMonth:C,endOfWeek:k,isAfter:w,startOfBroadcastWeek:P,startOfISOWeek:T,startOfWeek:M}=i,D=d?P(o,i):r?T(o):M(o),L=d?x(a):r?v(C(a)):k(C(a)),N=e&&(d?x(e):r?v(e):k(e)),j=N&&w(L,N)?N:L,K=m(j,D),U=g(a,o)+1,z=[];for(let V=0;V<=K;V++){const ie=f(D,V);z.push(ie)}const H=(d?35:42)*U;if(c&&z.length<H){const V=H-z.length;for(let ie=0;ie<V;ie++){const oe=f(z[z.length-1],1);z.push(oe)}}return z}function KV(n){const e=[];return n.reduce((t,i)=>{const o=i.weeks.reduce((a,r)=>a.concat(r.days.slice()),e.slice());return t.concat(o.slice())},e.slice())}function VV(n,e,t,i){const{numberOfMonths:o=1}=t,a=[];for(let r=0;r<o;r++){const c=i.addMonths(n,r);if(e&&c>e)break;a.push(c)}return a}function LA(n,e,t,i){const{month:o,defaultMonth:a,today:r=i.today(),numberOfMonths:c=1}=n;let d=o||a||r;const{differenceInCalendarMonths:f,addMonths:m,startOfMonth:g}=i;if(t&&f(t,d)<c-1){const x=-1*(c-1);d=m(t,x)}return e&&f(d,e)<0&&(d=e),g(d)}function WV(n,e,t,i){const{addDays:o,endOfBroadcastWeek:a,endOfISOWeek:r,endOfMonth:c,endOfWeek:d,getISOWeek:f,getWeek:m,startOfBroadcastWeek:g,startOfISOWeek:x,startOfWeek:v}=i,C=n.reduce((k,w)=>{const P=t.broadcastCalendar?g(w,i):t.ISOWeek?x(w):v(w),T=t.broadcastCalendar?a(w):t.ISOWeek?r(c(w)):d(c(w)),M=e.filter(j=>j>=P&&j<=T),D=t.broadcastCalendar?35:42;if(t.fixedWeeks&&M.length<D){const j=e.filter(K=>{const U=D-M.length;return K>T&&K<=o(T,U)});M.push(...j)}const L=M.reduce((j,K)=>{const U=t.ISOWeek?f(K):m(K),z=j.find(H=>H.weekNumber===U),X=new nN(K,w,i);return z?z.days.push(X):j.push(new qK(U,[X])),j},[]),N=new FK(w,L);return k.push(N),k},[]);return t.reverseMonths?C.reverse():C}function QV(n,e){let{startMonth:t,endMonth:i}=n;const{startOfYear:o,startOfDay:a,startOfMonth:r,endOfMonth:c,addYears:d,endOfYear:f,newDate:m,today:g}=e,{fromYear:x,toYear:v,fromMonth:C,toMonth:k}=n;!t&&C&&(t=C),!t&&x&&(t=e.newDate(x,0,1)),!i&&k&&(i=k),!i&&v&&(i=m(v,11,31));const w=n.captionLayout==="dropdown"||n.captionLayout==="dropdown-years";return t?t=r(t):x?t=m(x,0,1):!t&&w&&(t=o(d(n.today??g(),-100))),i?i=c(i):v?i=m(v,11,31):!i&&w&&(i=f(n.today??g())),[t&&a(t),i&&a(i)]}function YV(n,e,t,i){if(t.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a=1}=t,{startOfMonth:r,addMonths:c,differenceInCalendarMonths:d}=i,f=o?a:1,m=r(n);if(!e)return c(m,f);if(!(d(e,n)<a))return c(m,f)}function $V(n,e,t,i){if(t.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a}=t,{startOfMonth:r,addMonths:c,differenceInCalendarMonths:d}=i,f=o?a??1:1,m=r(n);if(!e)return c(m,-f);if(!(d(m,e)<=0))return c(m,-f)}function XV(n){const e=[];return n.reduce((t,i)=>t.concat(i.weeks.slice()),e.slice())}function Lf(n,e){const[t,i]=A.useState(n);return[e===void 0?t:e,i]}function JV(n,e){const[t,i]=QV(n,e),{startOfMonth:o,endOfMonth:a}=e,r=LA(n,t,i,e),[c,d]=Lf(r,n.month?r:void 0);A.useEffect(()=>{const D=LA(n,t,i,e);d(D)},[n.timeZone]);const{months:f,weeks:m,days:g,previousMonth:x,nextMonth:v}=A.useMemo(()=>{const D=VV(c,i,{numberOfMonths:n.numberOfMonths},e),L=GV(D,n.endMonth?a(n.endMonth):void 0,{ISOWeek:n.ISOWeek,fixedWeeks:n.fixedWeeks,broadcastCalendar:n.broadcastCalendar},e),N=WV(D,L,{broadcastCalendar:n.broadcastCalendar,fixedWeeks:n.fixedWeeks,ISOWeek:n.ISOWeek,reverseMonths:n.reverseMonths},e),j=XV(N),K=KV(N),U=$V(c,t,n,e),z=YV(c,i,n,e);return{months:N,weeks:j,days:K,previousMonth:U,nextMonth:z}},[e,c.getTime(),i?.getTime(),t?.getTime(),n.disableNavigation,n.broadcastCalendar,n.endMonth?.getTime(),n.fixedWeeks,n.ISOWeek,n.numberOfMonths,n.pagedNavigation,n.reverseMonths]),{disableNavigation:C,onMonthChange:k}=n,w=D=>m.some(L=>L.days.some(N=>N.isEqualTo(D))),P=D=>{if(C)return;let L=o(D);t&&L<o(t)&&(L=o(t)),i&&L>o(i)&&(L=o(i)),d(L),k?.(L)};return{months:f,weeks:m,days:g,navStart:t,navEnd:i,previousMonth:x,nextMonth:v,goToMonth:P,goToDay:D=>{w(D)||P(D.date)}}}var Bi;(function(n){n[n.Today=0]="Today",n[n.Selected=1]="Selected",n[n.LastFocused=2]="LastFocused",n[n.FocusedModifier=3]="FocusedModifier"})(Bi||(Bi={}));function RA(n){return!n[wt.disabled]&&!n[wt.hidden]&&!n[wt.outside]}function ZV(n,e,t,i){let o,a=-1;for(const r of n){const c=e(r);RA(c)&&(c[wt.focused]&&a<Bi.FocusedModifier?(o=r,a=Bi.FocusedModifier):i?.isEqualTo(r)&&a<Bi.LastFocused?(o=r,a=Bi.LastFocused):t(r.date)&&a<Bi.Selected?(o=r,a=Bi.Selected):c[wt.today]&&a<Bi.Today&&(o=r,a=Bi.Today))}return o||(o=n.find(r=>RA(e(r)))),o}function e9(n,e,t,i,o,a,r){const{ISOWeek:c,broadcastCalendar:d}=a,{addDays:f,addMonths:m,addWeeks:g,addYears:x,endOfBroadcastWeek:v,endOfISOWeek:C,endOfWeek:k,max:w,min:P,startOfBroadcastWeek:T,startOfISOWeek:M,startOfWeek:D}=r;let N={day:f,week:g,month:m,year:x,startOfWeek:j=>d?T(j,r):c?M(j):D(j),endOfWeek:j=>d?v(j):c?C(j):k(j)}[n](t,e==="after"?1:-1);return e==="before"&&i?N=w([i,N]):e==="after"&&o&&(N=P([o,N])),N}function yN(n,e,t,i,o,a,r,c=0){if(c>365)return;const d=e9(n,e,t.date,i,o,a,r),f=!!(a.disabled&&Oo(d,a.disabled,r)),m=!!(a.hidden&&Oo(d,a.hidden,r)),g=d,x=new nN(d,g,r);return!f&&!m?x:yN(n,e,x,i,o,a,r,c+1)}function t9(n,e,t,i,o){const{autoFocus:a}=n,[r,c]=A.useState(),d=ZV(e.days,t,i||(()=>!1),r),[f,m]=A.useState(a?d:void 0);return{isFocusTarget:k=>!!d?.isEqualTo(k),setFocused:m,focused:f,blur:()=>{c(f),m(void 0)},moveFocus:(k,w)=>{if(!f)return;const P=yN(k,w,f,e.navStart,e.navEnd,n,o);P&&(n.disableNavigation&&!e.days.some(M=>M.isEqualTo(P))||(e.goToDay(P),m(P)))}}}function n9(n,e){const{selected:t,required:i,onSelect:o}=n,[a,r]=Lf(t,o?t:void 0),c=o?t:a,{isSameDay:d}=e,f=v=>c?.some(C=>d(C,v))??!1,{min:m,max:g}=n;return{selected:c,select:(v,C,k)=>{let w=[...c??[]];if(f(v)){if(c?.length===m||i&&c?.length===1)return;w=c?.filter(P=>!d(P,v))}else c?.length===g?w=[v]:w=[...w,v];return o||r(w),o?.(w,v,C,k),w},isSelected:f}}function i9(n,e,t=0,i=0,o=!1,a=Zi){const{from:r,to:c}=e||{},{isSameDay:d,isAfter:f,isBefore:m}=a;let g;if(!r&&!c)g={from:n,to:t>0?void 0:n};else if(r&&!c)d(r,n)?t===0?g={from:r,to:n}:o?g={from:r,to:void 0}:g=void 0:m(n,r)?g={from:n,to:r}:g={from:r,to:n};else if(r&&c)if(d(r,n)&&d(c,n))o?g={from:r,to:c}:g=void 0;else if(d(r,n))g={from:r,to:t>0?void 0:n};else if(d(c,n))g={from:n,to:t>0?void 0:n};else if(m(n,r))g={from:n,to:c};else if(f(n,r))g={from:r,to:n};else if(f(n,c))g={from:r,to:n};else throw new Error("Invalid range");if(g?.from&&g?.to){const x=a.differenceInCalendarDays(g.to,g.from);i>0&&x>i?g={from:n,to:void 0}:t>1&&x<t&&(g={from:n,to:void 0})}return g}function o9(n,e,t=Zi){const i=Array.isArray(e)?e:[e];let o=n.from;const a=t.differenceInCalendarDays(n.to,n.from),r=Math.min(a,6);for(let c=0;c<=r;c++){if(i.includes(o.getDay()))return!0;o=t.addDays(o,1)}return!1}function EA(n,e,t=Zi){return Ao(n,e.from,!1,t)||Ao(n,e.to,!1,t)||Ao(e,n.from,!1,t)||Ao(e,n.to,!1,t)}function s9(n,e,t=Zi){const i=Array.isArray(e)?e:[e];if(i.filter(c=>typeof c!="function").some(c=>typeof c=="boolean"?c:t.isDate(c)?Ao(n,c,!1,t):sN(c,t)?c.some(d=>Ao(n,d,!1,t)):Nf(c)?c.from&&c.to?EA(n,{from:c.from,to:c.to},t):!1:oN(c)?o9(n,c.dayOfWeek,t):$x(c)?t.isAfter(c.before,c.after)?EA(n,{from:t.addDays(c.after,1),to:t.addDays(c.before,-1)},t):Oo(n.from,c,t)||Oo(n.to,c,t):Xx(c)||Jx(c)?Oo(n.from,c,t)||Oo(n.to,c,t):!1))return!0;const r=i.filter(c=>typeof c=="function");if(r.length){let c=n.from;const d=t.differenceInCalendarDays(n.to,n.from);for(let f=0;f<=d;f++){if(r.some(m=>m(c)))return!0;c=t.addDays(c,1)}}return!1}function a9(n,e){const{disabled:t,excludeDisabled:i,selected:o,required:a,onSelect:r}=n,[c,d]=Lf(o,r?o:void 0),f=r?o:c;return{selected:f,select:(x,v,C)=>{const{min:k,max:w}=n,P=x?i9(x,f,k,w,a,e):void 0;return i&&t&&P?.from&&P.to&&s9({from:P.from,to:P.to},t,e)&&(P.from=x,P.to=void 0),r||d(P),r?.(P,x,v,C),P},isSelected:x=>f&&Ao(f,x,!1,e)}}function r9(n,e){const{selected:t,required:i,onSelect:o}=n,[a,r]=Lf(t,o?t:void 0),c=o?t:a,{isSameDay:d}=e;return{selected:c,select:(g,x,v)=>{let C=g;return!i&&c&&c&&d(g,c)&&(C=void 0),o||r(C),o?.(C,g,x,v),C},isSelected:g=>c?d(c,g):!1}}function l9(n,e){const t=r9(n,e),i=n9(n,e),o=a9(n,e);switch(n.mode){case"single":return t;case"multiple":return i;case"range":return o;default:return}}function sn(n,e){return n instanceof wo&&n.timeZone===e?n:new wo(n,e)}function jA(n,e){return typeof n=="boolean"||typeof n=="function"?n:n instanceof Date?sn(n,e):Array.isArray(n)?n.map(t=>t instanceof Date?sn(t,e):t):Nf(n)?{...n,from:n.from?sn(n.from,e):n.from,to:n.to?sn(n.to,e):n.to}:$x(n)?{before:sn(n.before,e),after:sn(n.after,e)}:Xx(n)?{after:sn(n.after,e)}:Jx(n)?{before:sn(n.before,e)}:n}function Zg(n,e){return n&&(Array.isArray(n)?n.map(t=>jA(t,e)):jA(n,e))}function c9(n){let e=n;const t=e.timeZone;if(t&&(e={...n,timeZone:t},e.today&&(e.today=sn(e.today,t)),e.month&&(e.month=sn(e.month,t)),e.defaultMonth&&(e.defaultMonth=sn(e.defaultMonth,t)),e.startMonth&&(e.startMonth=sn(e.startMonth,t)),e.endMonth&&(e.endMonth=sn(e.endMonth,t)),e.mode==="single"&&e.selected?e.selected=sn(e.selected,t):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(Re=>sn(Re,t)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?sn(e.selected.from,t):e.selected.from,to:e.selected.to?sn(e.selected.to,t):e.selected.to}),e.disabled!==void 0&&(e.disabled=Zg(e.disabled,t)),e.hidden!==void 0&&(e.hidden=Zg(e.hidden,t)),e.modifiers)){const Re={};Object.keys(e.modifiers).forEach(Ve=>{Re[Ve]=Zg(e.modifiers?.[Ve],t)}),e.modifiers=Re}const{components:i,formatters:o,labels:a,dateLib:r,locale:c,classNames:d}=A.useMemo(()=>{const Re={...tN,...e.locale},Ve=new $n({locale:Re,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib);return{dateLib:Ve,components:xV(e.components),formatters:MV(e.formatters),labels:jV(e.labels,Ve.options),locale:Re,classNames:{...CV(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.components,e.formatters,e.labels,e.classNames]);e.today||(e={...e,today:r.today()});const{captionLayout:f,mode:m,navLayout:g,numberOfMonths:x=1,onDayBlur:v,onDayClick:C,onDayFocus:k,onDayKeyDown:w,onDayMouseEnter:P,onDayMouseLeave:T,onNextClick:M,onPrevClick:D,showWeekNumber:L,styles:N}=e,{formatCaption:j,formatDay:K,formatMonthDropdown:U,formatWeekNumber:z,formatWeekNumberHeader:X,formatWeekdayName:H,formatYearDropdown:V}=o,ie=JV(e,r),{days:oe,months:B,navStart:Z,navEnd:se,previousMonth:Y,nextMonth:ae,goToMonth:de}=ie,be=yV(oe,e,Z,se,r),{isSelected:te,select:le,selected:xe}=l9(e,r)??{},{blur:Se,focused:ye,isFocusTarget:Te,moveFocus:Ie,setFocused:nt}=t9(e,ie,be,te??(()=>!1),r),{labelDayButton:Ot,labelGridcell:De,labelGrid:Ye,labelMonthDropdown:it,labelNav:ln,labelPrevious:Sn,labelNext:As,labelWeekday:zt,labelWeekNumber:Bo,labelWeekNumberHeader:Os,labelYearDropdown:mi}=a,ka=A.useMemo(()=>_V(r,e.ISOWeek,e.broadcastCalendar,e.today),[r,e.ISOWeek,e.broadcastCalendar,e.today]),wa=m!==void 0||C!==void 0,Xt=A.useCallback(()=>{Y&&(de(Y),D?.(Y))},[Y,de,D]),$r=A.useCallback(()=>{ae&&(de(ae),M?.(ae))},[de,ae,M]),ou=A.useCallback((Re,Ve)=>Me=>{Me.preventDefault(),Me.stopPropagation(),nt(Re),!Ve.disabled&&(le?.(Re.date,Ve,Me),C?.(Re.date,Ve,Me))},[le,C,nt]),su=A.useCallback((Re,Ve)=>Me=>{nt(Re),k?.(Re.date,Ve,Me)},[k,nt]),Aa=A.useCallback((Re,Ve)=>Me=>{Se(),v?.(Re.date,Ve,Me)},[Se,v]),Rf=A.useCallback((Re,Ve)=>Me=>{const $e={ArrowLeft:[Me.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[Me.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[Me.shiftKey?"year":"week","after"],ArrowUp:[Me.shiftKey?"year":"week","before"],PageUp:[Me.shiftKey?"year":"month","before"],PageDown:[Me.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if($e[Me.key]){Me.preventDefault(),Me.stopPropagation();const[Kt,_e]=$e[Me.key];Ie(Kt,_e)}w?.(Re.date,Ve,Me)},[Ie,w,e.dir]),au=A.useCallback((Re,Ve)=>Me=>{P?.(Re.date,Ve,Me)},[P]),Ef=A.useCallback((Re,Ve)=>Me=>{T?.(Re.date,Ve,Me)},[T]),jf=A.useCallback(Re=>Ve=>{const Me=Number(Ve.target.value),$e=r.setMonth(r.startOfMonth(Re),Me);de($e)},[r,de]),Ps=A.useCallback(Re=>Ve=>{const Me=Number(Ve.target.value),$e=r.setYear(r.startOfMonth(Re),Me);de($e)},[r,de]),{className:pn,style:Pi}=A.useMemo(()=>({className:[d[we.Root],e.className].filter(Boolean).join(" "),style:{...N?.[we.Root],...e.style}}),[d,e.className,e.style,N]),mn=vV(e),ru=A.useRef(null);qV(ru,!!e.animate,{classNames:d,months:B,focused:ye,dateLib:r});const If={dayPickerProps:e,selected:xe,select:le,isSelected:te,months:B,nextMonth:ae,previousMonth:Y,goToMonth:de,getModifiers:be,components:i,classNames:d,styles:N,labels:a,formatters:o};return ge.createElement(iN.Provider,{value:If},ge.createElement(i.Root,{rootRef:e.animate?ru:void 0,className:pn,style:Pi,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],...mn},ge.createElement(i.Months,{className:d[we.Months],style:N?.[we.Months]},!e.hideNavigation&&!g&&ge.createElement(i.Nav,{"data-animated-nav":e.animate?"true":void 0,className:d[we.Nav],style:N?.[we.Nav],"aria-label":ln(),onPreviousClick:Xt,onNextClick:$r,previousMonth:Y,nextMonth:ae}),B.map((Re,Ve)=>ge.createElement(i.Month,{"data-animated-month":e.animate?"true":void 0,className:d[we.Month],style:N?.[we.Month],key:Ve,displayIndex:Ve,calendarMonth:Re},g==="around"&&!e.hideNavigation&&Ve===0&&ge.createElement(i.PreviousMonthButton,{type:"button",className:d[we.PreviousMonthButton],tabIndex:Y?void 0:-1,"aria-disabled":Y?void 0:!0,"aria-label":Sn(Y),onClick:Xt,"data-animated-button":e.animate?"true":void 0},ge.createElement(i.Chevron,{disabled:Y?void 0:!0,className:d[we.Chevron],orientation:e.dir==="rtl"?"right":"left"})),ge.createElement(i.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:d[we.MonthCaption],style:N?.[we.MonthCaption],calendarMonth:Re,displayIndex:Ve},f?.startsWith("dropdown")?ge.createElement(i.DropdownNav,{className:d[we.Dropdowns],style:N?.[we.Dropdowns]},(()=>{const Me=f==="dropdown"||f==="dropdown-months"?ge.createElement(i.MonthsDropdown,{key:"month",className:d[we.MonthsDropdown],"aria-label":it(),classNames:d,components:i,disabled:!!e.disableNavigation,onChange:jf(Re.date),options:IV(Re.date,Z,se,o,r),style:N?.[we.Dropdown],value:r.getMonth(Re.date)}):ge.createElement("span",{key:"month"},U(Re.date,r)),$e=f==="dropdown"||f==="dropdown-years"?ge.createElement(i.YearsDropdown,{key:"year",className:d[we.YearsDropdown],"aria-label":mi(r.options),classNames:d,components:i,disabled:!!e.disableNavigation,onChange:Ps(Re.date),options:HV(Z,se,o,r,!!e.reverseYears),style:N?.[we.Dropdown],value:r.getYear(Re.date)}):ge.createElement("span",{key:"year"},V(Re.date,r));return r.getMonthYearOrder()==="year-first"?[$e,Me]:[Me,$e]})(),ge.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},j(Re.date,r.options,r))):ge.createElement(i.CaptionLabel,{className:d[we.CaptionLabel],role:"status","aria-live":"polite"},j(Re.date,r.options,r))),g==="around"&&!e.hideNavigation&&Ve===x-1&&ge.createElement(i.NextMonthButton,{type:"button",className:d[we.NextMonthButton],tabIndex:ae?void 0:-1,"aria-disabled":ae?void 0:!0,"aria-label":As(ae),onClick:$r,"data-animated-button":e.animate?"true":void 0},ge.createElement(i.Chevron,{disabled:ae?void 0:!0,className:d[we.Chevron],orientation:e.dir==="rtl"?"left":"right"})),Ve===x-1&&g==="after"&&!e.hideNavigation&&ge.createElement(i.Nav,{"data-animated-nav":e.animate?"true":void 0,className:d[we.Nav],style:N?.[we.Nav],"aria-label":ln(),onPreviousClick:Xt,onNextClick:$r,previousMonth:Y,nextMonth:ae}),ge.createElement(i.MonthGrid,{role:"grid","aria-multiselectable":m==="multiple"||m==="range","aria-label":Ye(Re.date,r.options,r)||void 0,className:d[we.MonthGrid],style:N?.[we.MonthGrid]},!e.hideWeekdays&&ge.createElement(i.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:d[we.Weekdays],style:N?.[we.Weekdays]},L&&ge.createElement(i.WeekNumberHeader,{"aria-label":Os(r.options),className:d[we.WeekNumberHeader],style:N?.[we.WeekNumberHeader],scope:"col"},X()),ka.map(Me=>ge.createElement(i.Weekday,{"aria-label":zt(Me,r.options,r),className:d[we.Weekday],key:String(Me),style:N?.[we.Weekday],scope:"col"},H(Me,r.options,r)))),ge.createElement(i.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:d[we.Weeks],style:N?.[we.Weeks]},Re.weeks.map(Me=>ge.createElement(i.Week,{className:d[we.Week],key:Me.weekNumber,style:N?.[we.Week],week:Me},L&&ge.createElement(i.WeekNumber,{week:Me,style:N?.[we.WeekNumber],"aria-label":Bo(Me.weekNumber,{locale:c}),className:d[we.WeekNumber],scope:"row",role:"rowheader"},z(Me.weekNumber,r)),Me.days.map($e=>{const{date:Kt}=$e,_e=be($e);if(_e[wt.focused]=!_e.hidden&&!!ye?.isEqualTo($e),_e[Si.selected]=te?.(Kt)||_e.selected,Nf(xe)){const{from:Ds,to:eo}=xe;_e[Si.range_start]=!!(Ds&&eo&&r.isSameDay(Kt,Ds)),_e[Si.range_end]=!!(Ds&&eo&&r.isSameDay(Kt,eo)),_e[Si.range_middle]=Ao(xe,Kt,!0,r)}const Ts=BV(_e,N,e.modifiersStyles),Bf=bV(_e,d,e.modifiersClassNames),lu=!wa&&!_e.hidden?De(Kt,_e,r.options,r):void 0;return ge.createElement(i.Day,{key:`${$e.isoDate}_${$e.displayMonthId}`,day:$e,modifiers:_e,className:Bf.join(" "),style:Ts,role:"gridcell","aria-selected":_e.selected||void 0,"aria-label":lu,"data-day":$e.isoDate,"data-month":$e.outside?$e.dateMonthId:void 0,"data-selected":_e.selected||void 0,"data-disabled":_e.disabled||void 0,"data-hidden":_e.hidden||void 0,"data-outside":$e.outside||void 0,"data-focused":_e.focused||void 0,"data-today":_e.today||void 0},!_e.hidden&&wa?ge.createElement(i.DayButton,{className:d[we.DayButton],style:N?.[we.DayButton],type:"button",day:$e,modifiers:_e,disabled:!_e.focused&&_e.disabled||void 0,"aria-disabled":_e.focused&&_e.disabled||void 0,tabIndex:Te($e)?0:-1,"aria-label":Ot(Kt,_e,r.options,r),onClick:ou($e,_e),onBlur:Aa($e,_e),onFocus:su($e,_e),onKeyDown:Rf($e,_e),onMouseEnter:au($e,_e),onMouseLeave:Ef($e,_e)},K(Kt,r.options,r)):!_e.hidden&&K($e.date,r.options,r))})))))))),e.footer&&ge.createElement(i.Footer,{className:d[we.Footer],style:N?.[we.Footer],role:"status","aria-live":"polite"},e.footer)))}function u9({className:n,classNames:e,showOutsideDays:t=!0,...i}){return p.jsx(c9,{showOutsideDays:t,className:q("p-2",n),classNames:{root:"relative",months:"flex flex-col sm:flex-row gap-2 sm:gap-4",month:"flex flex-col gap-2",month_caption:"flex justify-center pt-1 relative items-center h-8",caption_label:"text-sm font-medium",nav:"absolute inset-x-0 top-2 flex items-center justify-between px-1 z-10",button_previous:q(Xd({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),button_next:q(Xd({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),month_grid:"w-full border-collapse",weekdays:"flex w-full",weekday:"text-muted-foreground w-8 font-normal text-xs text-center",weeks:"flex flex-col",week:"flex w-full",day:q("relative h-8 w-8 p-0 text-center text-xs font-normal focus-within:relative focus-within:z-20","hover:bg-accent hover:text-accent-foreground rounded-full select-none"),day_button:q(Xd({variant:"ghost"}),"h-8 w-8 p-0 font-normal rounded-full text-xs","aria-selected:opacity-100"),range_start:q("aria-selected:bg-primary aria-selected:text-primary-foreground","aria-selected:rounded-l-full aria-selected:rounded-r-none","aria-selected:hover:bg-primary aria-selected:hover:text-primary-foreground"),range_end:q("aria-selected:bg-primary aria-selected:text-primary-foreground","aria-selected:rounded-r-full aria-selected:rounded-l-none","aria-selected:hover:bg-primary aria-selected:hover:text-primary-foreground"),range_middle:q("aria-selected:bg-accent aria-selected:text-accent-foreground","aria-selected:rounded-none"),selected:q("bg-primary text-primary-foreground rounded-full","hover:bg-primary hover:text-primary-foreground","focus:bg-primary focus:text-primary-foreground"),today:"bg-accent text-accent-foreground rounded-full",outside:"text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",disabled:"text-muted-foreground opacity-50",hidden:"invisible",...e},components:{Chevron:({orientation:o,className:a,...r})=>{const c=o==="left"?YE:o==="right"?Vh:o==="up"?xb:Wh;return p.jsx(c,{className:q("h-4 w-4",a),...r})}},...i})}u9.displayName="Calendar";const d9=A.lazy(()=>rt(()=>Promise.resolve().then(()=>Mf),void 0).then(n=>({default:n.CodeEditor})));function oQ({rawJsonContent:n,isRawJsonValid:e,rawJsonEdits:t,rawSettingsEnv:i,onChange:o,missingRequiredFields:a=[]}){const{t:r}=Ce(),c=a.length>0;return p.jsx(A.Suspense,{fallback:p.jsxs("div",{className:"flex items-center justify-center h-full",children:[p.jsx(hi,{className:"w-6 h-6 animate-spin text-muted-foreground"}),p.jsx("span",{className:"ml-2 text-muted-foreground",children:r("providerEditor.loadingEditor")})]}),children:p.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!e&&t!==null&&p.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[p.jsx(Gr,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),e&&c&&p.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[p.jsx(Qi,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),p.jsxs("div",{children:[p.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",p.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:a.join(", ")}),p.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"These fields will use default values at runtime."})]})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-6 pb-4 pt-4",children:p.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:p.jsx(d9,{value:n,onChange:o,language:"json",minHeight:"100%",heightMode:"fill-parent"})})}),p.jsx("div",{className:"mx-6 mb-4",children:p.jsx("div",{className:"border rounded-md overflow-hidden",children:p.jsx(Jb,{profileEnv:i})})})]})})}A.lazy(()=>rt(()=>Promise.resolve().then(()=>Mf),void 0).then(n=>({default:n.CodeEditor})));function h9(){const{t:n}=Ce(),{isDark:e,setTheme:t}=Mb(),[i,o]=A.useState(""),[a,r]=A.useState(""),[c,d]=A.useState(!1),[f,m]=A.useState(null),[g,x]=A.useState(!1),{login:v,authRequired:C,isAuthenticated:k,loading:w,accessMode:P,authEnabled:T}=Jh(),M=yb(),D=Kh(),L=P==="setup",N=n(L?"auth.remoteGuardLabel":"auth.protectedAccessLabel"),j=n(L?T?"auth.incompleteSetupDescription":"auth.remoteSetupDescription":"auth.loginDescription"),K=D.state?.from?.pathname||"/";if(A.useEffect(()=>{w||(k||!C)&&M(K,{replace:!0})},[k,C,w,M,K]),w)return p.jsx("div",{className:"flex min-h-[100dvh] items-center justify-center bg-background px-4",children:p.jsxs("div",{className:"flex items-center gap-3 rounded-full border border-border/80 bg-card/90 px-5 py-3 text-sm text-muted-foreground shadow-sm",children:[p.jsx(hi,{className:"h-4 w-4 animate-spin"}),n("auth.loading")]})});if(k||!C)return null;const U=async z=>{z.preventDefault(),m(null),x(!0);try{await v(i,a),M(K,{replace:!0})}catch(X){m(X instanceof Error?X.message:n("auth.loginFailed"))}finally{x(!1)}};return p.jsxs("div",{className:"relative min-h-[100dvh] overflow-hidden bg-background",children:[p.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top_left,rgba(167,85,52,0.16),transparent_42%),radial-gradient(circle_at_bottom_right,rgba(39,39,42,0.12),transparent_48%)]"}),p.jsx("div",{className:"absolute inset-0 opacity-[0.18] [background-image:linear-gradient(rgba(127,117,107,0.14)_1px,transparent_1px),linear-gradient(90deg,rgba(127,117,107,0.14)_1px,transparent_1px)] [background-size:24px_24px]"}),p.jsx("div",{className:"relative mx-auto flex min-h-[100dvh] max-w-6xl items-center px-4 py-8 sm:px-6",children:p.jsxs("div",{className:"grid w-full items-stretch gap-6 lg:grid-cols-[minmax(0,1.05fr)_minmax(360px,430px)]",children:[p.jsxs("section",{className:"flex flex-col justify-between rounded-[28px] border border-border/70 bg-card/85 p-6 shadow-[0_24px_80px_-48px_rgba(68,48,34,0.55)] backdrop-blur sm:p-8",children:[p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[p.jsxs("span",{className:"inline-flex w-fit items-center gap-2 rounded-full border border-border/70 bg-background/75 px-3 py-1 text-xs font-semibold uppercase tracking-[0.24em] text-muted-foreground",children:[p.jsx(Cd,{className:"h-3.5 w-3.5 text-accent"}),N]}),p.jsxs("div",{className:"inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/75 p-1 shadow-sm backdrop-blur",children:[p.jsxs(gt,{type:"button",variant:"ghost",size:"sm",className:q("rounded-full px-3 text-xs font-semibold",!e&&"bg-card text-foreground shadow-sm"),"aria-pressed":!e,onClick:()=>t("light"),children:[p.jsx(uO,{className:"h-3.5 w-3.5"}),n("auth.lightMode")]}),p.jsxs(gt,{type:"button",variant:"ghost",size:"sm",className:q("rounded-full px-3 text-xs font-semibold",e&&"bg-card text-foreground shadow-sm"),"aria-pressed":e,onClick:()=>t("dark"),children:[p.jsx(dO,{className:"h-3.5 w-3.5"}),n("auth.darkMode")]})]})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsx("h1",{className:"max-w-xl text-4xl font-semibold tracking-[-0.04em] text-balance text-foreground sm:text-5xl",children:n(L?"auth.remoteSetupTitle":"auth.dashboardTitle")}),p.jsx("p",{className:"max-w-2xl text-base leading-7 text-muted-foreground sm:text-lg",children:j})]})]}),p.jsxs("div",{className:"mt-8 grid gap-3 text-sm text-muted-foreground sm:grid-cols-3",children:[p.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/70 p-4",children:[p.jsx(tk,{className:"mb-3 h-4 w-4 text-accent"}),p.jsx("p",{children:n("auth.safetyNoteRemote")})]}),p.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/70 p-4",children:[p.jsx(nk,{className:"mb-3 h-4 w-4 text-accent"}),p.jsx("p",{children:n("auth.safetyNoteLocal")})]}),p.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/70 p-4",children:[p.jsx(Cd,{className:"mb-3 h-4 w-4 text-accent"}),p.jsx("p",{children:n("auth.safetyNoteSession")})]})]})]}),p.jsxs(w_,{className:"justify-center rounded-[28px] border-border/70 bg-card/95 py-0 shadow-[0_24px_90px_-54px_rgba(34,24,16,0.62)]",children:[p.jsxs(A_,{className:"space-y-3 border-b border-border/70 px-6 py-6",children:[p.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl border border-accent/20 bg-accent/10",children:L?p.jsx(tk,{className:"h-5 w-5 text-accent"}):p.jsx(nk,{className:"h-5 w-5 text-accent"})}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(O_,{className:"text-2xl tracking-[-0.03em]",children:n(L?"auth.remoteSetupTitle":"auth.dashboardTitle")}),p.jsx(P_,{className:"text-sm leading-6 text-muted-foreground",children:L?j:n("auth.credentialsHint")})]})]}),p.jsx(T_,{className:"space-y-5 px-6 py-6",children:L?p.jsxs(p.Fragment,{children:[p.jsxs(rc,{variant:"warning",className:"rounded-2xl border-yellow-300/70 bg-yellow-50/80",children:[p.jsx(vc,{className:"h-4 w-4"}),p.jsx(yh,{children:n("auth.noDefaultCredentials")}),p.jsx(lc,{children:n("auth.credentialsHint")})]}),p.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[p.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/75 p-4",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[p.jsx($E,{className:"h-4 w-4 text-accent"}),n("auth.hostStepTitle")]}),p.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:n("auth.hostStepDescription")}),p.jsx("code",{className:"mt-4 block rounded-xl border border-border/70 bg-muted/60 px-3 py-2 font-mono text-[13px] text-foreground",children:"ccs config auth setup"}),p.jsx("p",{className:"mt-3 text-xs leading-5 text-muted-foreground",children:n("auth.dockerStepDescription")}),p.jsx("code",{className:"mt-2 block rounded-xl border border-border/70 bg-muted/60 px-3 py-2 font-mono text-[13px] text-foreground",children:"docker exec -it ccs-cliproxy ccs config auth setup"})]}),p.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/75 p-4",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[p.jsx(Cd,{className:"h-4 w-4 text-accent"}),n("auth.localStepTitle")]}),p.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:n("auth.localStepDescription")})]})]})]}):p.jsxs("form",{onSubmit:U,className:"space-y-4",children:[f&&p.jsxs(rc,{variant:"destructive",className:"rounded-2xl",children:[p.jsx(vc,{className:"h-4 w-4"}),p.jsx(lc,{children:f})]}),p.jsxs(rc,{variant:"info",className:"rounded-2xl border-blue-200/80 bg-blue-50/80",children:[p.jsx(Cd,{className:"h-4 w-4"}),p.jsx(yh,{children:n("auth.noDefaultCredentials")}),p.jsx(lc,{children:n("auth.credentialsHint")})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(yn,{htmlFor:"username",className:"text-sm font-semibold",children:n("auth.username")}),p.jsx(Ii,{id:"username",type:"text",value:i,onChange:z=>o(z.target.value),placeholder:n("auth.usernamePlaceholder"),autoComplete:"username",className:"h-12 rounded-2xl border-border/80 bg-background/85 px-4 text-base md:text-base",disabled:g,required:!0})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(yn,{htmlFor:"password",className:"text-sm font-semibold",children:n("auth.password")}),p.jsxs("div",{className:"relative",children:[p.jsx(Ii,{id:"password",type:c?"text":"password",value:a,onChange:z=>r(z.target.value),placeholder:n("auth.passwordPlaceholder"),autoComplete:"current-password",className:"h-12 rounded-2xl border-border/80 bg-background/85 px-4 pr-14 text-base md:text-base",disabled:g,required:!0}),p.jsx(gt,{type:"button",variant:"ghost",size:"sm",className:"absolute inset-y-1 right-1 h-auto rounded-xl px-3 text-muted-foreground hover:text-foreground","aria-label":n(c?"auth.hidePassword":"auth.showPassword"),"aria-pressed":c,onClick:()=>d(z=>!z),disabled:g,children:c?p.jsx(Kc,{className:"h-4 w-4"}):p.jsx(Vc,{className:"h-4 w-4"})})]})]}),p.jsx(gt,{type:"submit",className:"h-12 w-full rounded-2xl text-sm font-semibold",disabled:g,children:g?p.jsxs(p.Fragment,{children:[p.jsx(hi,{className:"mr-2 h-4 w-4 animate-spin"}),n("auth.signingIn")]}):n("auth.signIn")})]})})]})]})})]})}const f9=A.lazy(()=>rt(()=>import("./index-YRmKZmzf.js"),__vite__mapDeps([23,1,2,4,5,7,9,6,8])).then(n=>({default:n.AnalyticsPage}))),p9=A.lazy(()=>rt(()=>import("./api-BJc1e2ju.js"),__vite__mapDeps([24,1,2,5,25,19,6,4,3,7,8,9])).then(n=>({default:n.ApiPage}))),m9=A.lazy(()=>rt(()=>import("./cliproxy-DUGEhRI_.js"),__vite__mapDeps([26,1,2,5,17,6,4,20,27,25,19,28,29,18,7,8,9])).then(n=>({default:n.CliproxyPage}))),g9=A.lazy(()=>rt(()=>import("./cliproxy-ai-providers-DH1LvC9H.js"),__vite__mapDeps([30,1,2,18,19,5,6,4,25,7,8,9])).then(n=>({default:n.CliproxyAiProvidersPage}))),y9=A.lazy(()=>rt(()=>import("./cliproxy-control-panel-DQcF0grk.js"),__vite__mapDeps([31,1,2,5,17,4,6,7,8,9])).then(n=>({default:n.CliproxyControlPanelPage}))),b9=A.lazy(()=>rt(()=>import("./copilot-BxTvmyiq.js"),__vite__mapDeps([32,1,2,5,25,19,4,28,29,6,7,8,9])).then(n=>({default:n.CopilotPage}))),x9=A.lazy(()=>rt(()=>import("./cursor-DFNXCb2C.js"),__vite__mapDeps([33,1,2,6,5,17,28,29,4,7,8,9])).then(n=>({default:n.CursorPage}))),v9=A.lazy(()=>rt(()=>import("./claude-extension-Dg6ZOc-X.js"),__vite__mapDeps([34,1,2,5,6,4,7,8,9])).then(n=>({default:n.ClaudeExtensionPage}))),C9=A.lazy(()=>rt(()=>import("./codex-B4aTo2gn.js"),__vite__mapDeps([35,1,2,6,4,28,5,36,37,7,8,9])).then(n=>({default:n.CodexPage}))),S9=A.lazy(()=>rt(()=>import("./droid-BtmVuSvi.js"),__vite__mapDeps([38,1,2,6,5,37,4,28,7,8,9])).then(n=>({default:n.DroidPage}))),k9=A.lazy(()=>rt(()=>import("./logs-CiJ1hg6a.js"),__vite__mapDeps([39,1,2,4,5,6,7,8,9])).then(n=>({default:n.LogsPage}))),w9=A.lazy(()=>rt(()=>import("./accounts-CQ7-Zx3_.js"),__vite__mapDeps([40,1,2,5,36,19,41,6,4,27,7,8,9])).then(n=>({default:n.AccountsPage}))),A9=A.lazy(()=>rt(()=>Promise.resolve().then(()=>EK),void 0).then(n=>({default:n.SettingsPage}))),O9=A.lazy(()=>rt(()=>import("./health-BQ5SLS-w.js"),__vite__mapDeps([42,1,2,5,6,4,11,7,8,9])).then(n=>({default:n.HealthPage}))),P9=A.lazy(()=>rt(()=>import("./shared-CDiPdrLt.js"),__vite__mapDeps([43,1,2,41,5,6,4,7,8,9])).then(n=>({default:n.SharedPage}))),T9=A.lazy(()=>rt(()=>import("./updates-IMCUh1DI.js"),__vite__mapDeps([44,1,2,4,5,6,7,8,9])).then(n=>({default:n.UpdatesPage}))),D9=null;function cn(){return p.jsx("div",{className:"flex h-64 items-center justify-center",children:p.jsx(hi,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}function M9(){return p.jsx(mE,{client:K2,children:p.jsx(Hj,{defaultTheme:"system",storageKey:"vite-ui-theme",children:p.jsx(Uj,{children:p.jsx(Kj,{children:p.jsxs(dE,{children:[p.jsxs(hE,{children:[p.jsx(Et,{path:"/login",element:p.jsx(h9,{})}),p.jsx(Et,{element:p.jsx(Vj,{}),children:p.jsxs(Et,{element:p.jsx(aB,{}),children:[p.jsx(Et,{path:"/",element:p.jsx(N4,{})}),p.jsx(Et,{path:"/analytics",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(f9,{})})}),p.jsx(Et,{path:"/updates",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(T9,{})})}),p.jsx(Et,{path:"/providers",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(p9,{})})}),p.jsx(Et,{path:"/cliproxy",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(m9,{})})}),p.jsx(Et,{path:"/cliproxy/ai-providers",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(g9,{})})}),p.jsx(Et,{path:"/cliproxy/control-panel",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(y9,{})})}),p.jsx(Et,{path:"/copilot",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(b9,{})})}),p.jsx(Et,{path:"/cursor",element:p.jsx(iO,{to:"/cliproxy?provider=cursor",replace:!0})}),p.jsx(Et,{path:"/legacy/cursor",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(x9,{})})}),p.jsx(Et,{path:"/claude-extension",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(v9,{})})}),p.jsx(Et,{path:"/codex",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(C9,{})})}),p.jsx(Et,{path:"/droid",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(S9,{})})}),p.jsx(Et,{path:"/accounts",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(w9,{})})}),p.jsx(Et,{path:"/settings",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(A9,{})})}),p.jsx(Et,{path:"/health",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(O9,{})})}),p.jsx(Et,{path:"/logs",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(k9,{})})}),p.jsx(Et,{path:"/shared",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(P9,{})})}),D9]})})]}),p.jsx(gE,{position:"top-right"})]})})})})})}const bN=document.getElementById("root");if(!bN)throw new Error("Root element not found. Failed to mount React application.");F2.createRoot(bN).render(p.jsx(A.StrictMode,{children:p.jsx(M9,{})}));export{IW as $,I4 as A,Qt as B,w_ as C,F4 as D,MW as E,LW as F,R4 as G,U4 as H,Ii as I,q4 as J,NW as K,yn as L,$I as M,XI as N,JI as O,MO as P,OP as Q,$b as R,tt as S,Do as T,bh as U,py as V,re as W,jW as X,Ue as Y,EW as Z,P_ as _,Ce as a,J9 as a$,BW as a0,_W as a1,HW as a2,UW as a3,zW as a4,FW as a5,DP as a6,qW as a7,N_ as a8,Fb as a9,VW as aA,WW as aB,KW as aC,g5 as aD,xW as aE,Rk as aF,s_ as aG,GW as aH,W4 as aI,jP as aJ,n3 as aK,b3 as aL,pa as aM,V5 as aN,W5 as aO,Q5 as aP,Y5 as aQ,zB as aR,VO as aS,iW as aT,oW as aU,sW as aV,aW,ZW as aX,q9 as aY,YI as aZ,X9 as a_,qb as aa,U9 as ab,GI as ac,G9 as ad,Y9 as ae,eW as af,tW as ag,Nb as ah,Lb as ai,Rb as aj,Eb as ak,jb as al,QW as am,R_ as an,YW as ao,Ca as ap,SW as aq,Xl as ar,kW as as,ly as at,nW as au,wW as av,AW as aw,PW as ax,Ek as ay,OW as az,T_ as b,KI as b0,VI as b1,Z9 as b2,WI as b3,QI as b4,$9 as b5,Hb as b6,CW as b7,pW as b8,gW as b9,MK as bA,uW as bB,rW as bC,O5 as bD,P5 as bE,vW as bF,kO as bG,wj as bH,Sj as bI,iy as bJ,ha as bK,pj as bL,gj as bM,vj as bN,Oj as bO,dW as bP,K9 as bQ,V9 as bR,W9 as bS,Q9 as bT,lW as bU,cW as bV,fW as bW,hW as bX,Xd as bY,yW as ba,mW as bb,YM as bc,Jb as bd,bW as be,$l as bf,z9 as bg,F9 as bh,rc as bi,yh as bj,lc as bk,oQ as bl,Qb as bm,Sc as bn,Yb as bo,k4 as bp,fI as bq,gI as br,yI as bs,bI as bt,xI as bu,T4 as bv,TW as bw,DW as bx,XM as by,TK as bz,q as c,gt as d,$W as e,XW as f,E_ as g,u9 as h,H9 as i,A_ as j,O_ as k,GB as l,KB as m,Kr as n,JW as o,Mo as p,No as q,zO as r,Ub as s,FO as t,kb as u,zb as v,ac as w,ow as x,V4 as y,RW as z};