maxsimcli 4.6.0 → 4.7.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 (234) hide show
  1. package/dist/assets/CHANGELOG.md +39 -0
  2. package/dist/cli.cjs +470 -961
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/{core-RRjCSt0G.cjs → core-D5zUr9cb.cjs} +4 -3
  5. package/dist/core-D5zUr9cb.cjs.map +1 -0
  6. package/dist/install.cjs +3 -195
  7. package/dist/install.cjs.map +1 -1
  8. package/dist/mcp-server.cjs +2853 -217
  9. package/dist/mcp-server.cjs.map +1 -1
  10. package/dist/{skills-MYlMkYNt.cjs → skills-CjFWZIGM.cjs} +6 -6
  11. package/dist/{skills-MYlMkYNt.cjs.map → skills-CjFWZIGM.cjs.map} +1 -1
  12. package/package.json +1 -7
  13. package/dist/.tsbuildinfo +0 -1
  14. package/dist/assets/dashboard/client/assets/index-C199D4Eb.css +0 -32
  15. package/dist/assets/dashboard/client/assets/index-nAXJLp0_.js +0 -233
  16. package/dist/assets/dashboard/client/index.html +0 -19
  17. package/dist/assets/dashboard/server.js +0 -78813
  18. package/dist/backend/index.d.ts +0 -4
  19. package/dist/backend/index.d.ts.map +0 -1
  20. package/dist/backend/index.js +0 -12
  21. package/dist/backend/index.js.map +0 -1
  22. package/dist/backend/lifecycle.d.ts +0 -13
  23. package/dist/backend/lifecycle.d.ts.map +0 -1
  24. package/dist/backend/lifecycle.js +0 -168
  25. package/dist/backend/lifecycle.js.map +0 -1
  26. package/dist/backend/server.d.ts +0 -13
  27. package/dist/backend/server.d.ts.map +0 -1
  28. package/dist/backend/server.js +0 -1013
  29. package/dist/backend/server.js.map +0 -1
  30. package/dist/backend/terminal.d.ts +0 -49
  31. package/dist/backend/terminal.d.ts.map +0 -1
  32. package/dist/backend/terminal.js +0 -209
  33. package/dist/backend/terminal.js.map +0 -1
  34. package/dist/backend/types.d.ts +0 -77
  35. package/dist/backend/types.d.ts.map +0 -1
  36. package/dist/backend/types.js +0 -6
  37. package/dist/backend/types.js.map +0 -1
  38. package/dist/backend-server.cjs +0 -80672
  39. package/dist/backend-server.cjs.map +0 -1
  40. package/dist/backend-server.d.cts +0 -2
  41. package/dist/backend-server.d.ts +0 -11
  42. package/dist/backend-server.d.ts.map +0 -1
  43. package/dist/backend-server.js +0 -43
  44. package/dist/backend-server.js.map +0 -1
  45. package/dist/cli.d.cts +0 -2
  46. package/dist/cli.d.ts +0 -7
  47. package/dist/cli.d.ts.map +0 -1
  48. package/dist/cli.js +0 -510
  49. package/dist/cli.js.map +0 -1
  50. package/dist/core/artefakte.d.ts +0 -12
  51. package/dist/core/artefakte.d.ts.map +0 -1
  52. package/dist/core/artefakte.js +0 -152
  53. package/dist/core/artefakte.js.map +0 -1
  54. package/dist/core/commands.d.ts +0 -26
  55. package/dist/core/commands.d.ts.map +0 -1
  56. package/dist/core/commands.js +0 -550
  57. package/dist/core/commands.js.map +0 -1
  58. package/dist/core/config.d.ts +0 -10
  59. package/dist/core/config.d.ts.map +0 -1
  60. package/dist/core/config.js +0 -143
  61. package/dist/core/config.js.map +0 -1
  62. package/dist/core/context-loader.d.ts +0 -21
  63. package/dist/core/context-loader.d.ts.map +0 -1
  64. package/dist/core/context-loader.js +0 -212
  65. package/dist/core/context-loader.js.map +0 -1
  66. package/dist/core/core.d.ts +0 -91
  67. package/dist/core/core.d.ts.map +0 -1
  68. package/dist/core/core.js +0 -823
  69. package/dist/core/core.js.map +0 -1
  70. package/dist/core/dashboard-launcher.d.ts +0 -56
  71. package/dist/core/dashboard-launcher.d.ts.map +0 -1
  72. package/dist/core/dashboard-launcher.js +0 -246
  73. package/dist/core/dashboard-launcher.js.map +0 -1
  74. package/dist/core/drift.d.ts +0 -37
  75. package/dist/core/drift.d.ts.map +0 -1
  76. package/dist/core/drift.js +0 -213
  77. package/dist/core/drift.js.map +0 -1
  78. package/dist/core/frontmatter.d.ts +0 -33
  79. package/dist/core/frontmatter.d.ts.map +0 -1
  80. package/dist/core/frontmatter.js +0 -193
  81. package/dist/core/frontmatter.js.map +0 -1
  82. package/dist/core/index.d.ts +0 -28
  83. package/dist/core/index.d.ts.map +0 -1
  84. package/dist/core/index.js +0 -189
  85. package/dist/core/index.js.map +0 -1
  86. package/dist/core/init.d.ts +0 -287
  87. package/dist/core/init.d.ts.map +0 -1
  88. package/dist/core/init.js +0 -816
  89. package/dist/core/init.js.map +0 -1
  90. package/dist/core/milestone.d.ts +0 -9
  91. package/dist/core/milestone.d.ts.map +0 -1
  92. package/dist/core/milestone.js +0 -230
  93. package/dist/core/milestone.js.map +0 -1
  94. package/dist/core/phase.d.ts +0 -53
  95. package/dist/core/phase.d.ts.map +0 -1
  96. package/dist/core/phase.js +0 -891
  97. package/dist/core/phase.js.map +0 -1
  98. package/dist/core/roadmap.d.ts +0 -10
  99. package/dist/core/roadmap.d.ts.map +0 -1
  100. package/dist/core/roadmap.js +0 -165
  101. package/dist/core/roadmap.js.map +0 -1
  102. package/dist/core/skills.d.ts +0 -20
  103. package/dist/core/skills.d.ts.map +0 -1
  104. package/dist/core/skills.js +0 -144
  105. package/dist/core/skills.js.map +0 -1
  106. package/dist/core/start.d.ts +0 -15
  107. package/dist/core/start.d.ts.map +0 -1
  108. package/dist/core/start.js +0 -80
  109. package/dist/core/start.js.map +0 -1
  110. package/dist/core/state.d.ts +0 -32
  111. package/dist/core/state.d.ts.map +0 -1
  112. package/dist/core/state.js +0 -582
  113. package/dist/core/state.js.map +0 -1
  114. package/dist/core/template.d.ts +0 -30
  115. package/dist/core/template.d.ts.map +0 -1
  116. package/dist/core/template.js +0 -223
  117. package/dist/core/template.js.map +0 -1
  118. package/dist/core/types.d.ts +0 -519
  119. package/dist/core/types.d.ts.map +0 -1
  120. package/dist/core/types.js +0 -60
  121. package/dist/core/types.js.map +0 -1
  122. package/dist/core/verify.d.ts +0 -128
  123. package/dist/core/verify.d.ts.map +0 -1
  124. package/dist/core/verify.js +0 -754
  125. package/dist/core/verify.js.map +0 -1
  126. package/dist/core-RRjCSt0G.cjs.map +0 -1
  127. package/dist/esm-iIOBzmdz.cjs +0 -1561
  128. package/dist/esm-iIOBzmdz.cjs.map +0 -1
  129. package/dist/hooks/index.d.ts +0 -11
  130. package/dist/hooks/index.d.ts.map +0 -1
  131. package/dist/hooks/index.js +0 -18
  132. package/dist/hooks/index.js.map +0 -1
  133. package/dist/hooks/maxsim-check-update.d.ts +0 -17
  134. package/dist/hooks/maxsim-check-update.d.ts.map +0 -1
  135. package/dist/hooks/maxsim-check-update.js +0 -101
  136. package/dist/hooks/maxsim-check-update.js.map +0 -1
  137. package/dist/hooks/maxsim-context-monitor.d.ts +0 -21
  138. package/dist/hooks/maxsim-context-monitor.d.ts.map +0 -1
  139. package/dist/hooks/maxsim-context-monitor.js +0 -131
  140. package/dist/hooks/maxsim-context-monitor.js.map +0 -1
  141. package/dist/hooks/maxsim-statusline.d.ts +0 -19
  142. package/dist/hooks/maxsim-statusline.d.ts.map +0 -1
  143. package/dist/hooks/maxsim-statusline.js +0 -146
  144. package/dist/hooks/maxsim-statusline.js.map +0 -1
  145. package/dist/hooks/shared.d.ts +0 -11
  146. package/dist/hooks/shared.d.ts.map +0 -1
  147. package/dist/hooks/shared.js +0 -29
  148. package/dist/hooks/shared.js.map +0 -1
  149. package/dist/index.d.ts +0 -2
  150. package/dist/index.d.ts.map +0 -1
  151. package/dist/index.js +0 -3
  152. package/dist/index.js.map +0 -1
  153. package/dist/install/adapters.d.ts +0 -6
  154. package/dist/install/adapters.d.ts.map +0 -1
  155. package/dist/install/adapters.js +0 -65
  156. package/dist/install/adapters.js.map +0 -1
  157. package/dist/install/copy.d.ts +0 -6
  158. package/dist/install/copy.d.ts.map +0 -1
  159. package/dist/install/copy.js +0 -71
  160. package/dist/install/copy.js.map +0 -1
  161. package/dist/install/dashboard.d.ts +0 -16
  162. package/dist/install/dashboard.d.ts.map +0 -1
  163. package/dist/install/dashboard.js +0 -273
  164. package/dist/install/dashboard.js.map +0 -1
  165. package/dist/install/hooks.d.ts +0 -31
  166. package/dist/install/hooks.d.ts.map +0 -1
  167. package/dist/install/hooks.js +0 -260
  168. package/dist/install/hooks.js.map +0 -1
  169. package/dist/install/index.d.ts +0 -2
  170. package/dist/install/index.d.ts.map +0 -1
  171. package/dist/install/index.js +0 -534
  172. package/dist/install/index.js.map +0 -1
  173. package/dist/install/manifest.d.ts +0 -23
  174. package/dist/install/manifest.d.ts.map +0 -1
  175. package/dist/install/manifest.js +0 -133
  176. package/dist/install/manifest.js.map +0 -1
  177. package/dist/install/patches.d.ts +0 -10
  178. package/dist/install/patches.d.ts.map +0 -1
  179. package/dist/install/patches.js +0 -124
  180. package/dist/install/patches.js.map +0 -1
  181. package/dist/install/shared.d.ts +0 -56
  182. package/dist/install/shared.d.ts.map +0 -1
  183. package/dist/install/shared.js +0 -181
  184. package/dist/install/shared.js.map +0 -1
  185. package/dist/install/uninstall.d.ts +0 -5
  186. package/dist/install/uninstall.d.ts.map +0 -1
  187. package/dist/install/uninstall.js +0 -222
  188. package/dist/install/uninstall.js.map +0 -1
  189. package/dist/install/utils.d.ts +0 -27
  190. package/dist/install/utils.d.ts.map +0 -1
  191. package/dist/install/utils.js +0 -99
  192. package/dist/install/utils.js.map +0 -1
  193. package/dist/install.d.cts +0 -2
  194. package/dist/lifecycle-DxCru7rk.cjs +0 -136
  195. package/dist/lifecycle-DxCru7rk.cjs.map +0 -1
  196. package/dist/mcp/config-tools.d.ts +0 -13
  197. package/dist/mcp/config-tools.d.ts.map +0 -1
  198. package/dist/mcp/config-tools.js +0 -66
  199. package/dist/mcp/config-tools.js.map +0 -1
  200. package/dist/mcp/context-tools.d.ts +0 -13
  201. package/dist/mcp/context-tools.d.ts.map +0 -1
  202. package/dist/mcp/context-tools.js +0 -176
  203. package/dist/mcp/context-tools.js.map +0 -1
  204. package/dist/mcp/index.d.ts +0 -11
  205. package/dist/mcp/index.d.ts.map +0 -1
  206. package/dist/mcp/index.js +0 -26
  207. package/dist/mcp/index.js.map +0 -1
  208. package/dist/mcp/phase-tools.d.ts +0 -13
  209. package/dist/mcp/phase-tools.d.ts.map +0 -1
  210. package/dist/mcp/phase-tools.js +0 -177
  211. package/dist/mcp/phase-tools.js.map +0 -1
  212. package/dist/mcp/roadmap-tools.d.ts +0 -13
  213. package/dist/mcp/roadmap-tools.d.ts.map +0 -1
  214. package/dist/mcp/roadmap-tools.js +0 -79
  215. package/dist/mcp/roadmap-tools.js.map +0 -1
  216. package/dist/mcp/state-tools.d.ts +0 -13
  217. package/dist/mcp/state-tools.d.ts.map +0 -1
  218. package/dist/mcp/state-tools.js +0 -185
  219. package/dist/mcp/state-tools.js.map +0 -1
  220. package/dist/mcp/todo-tools.d.ts +0 -13
  221. package/dist/mcp/todo-tools.d.ts.map +0 -1
  222. package/dist/mcp/todo-tools.js +0 -143
  223. package/dist/mcp/todo-tools.js.map +0 -1
  224. package/dist/mcp/utils.d.ts +0 -27
  225. package/dist/mcp/utils.d.ts.map +0 -1
  226. package/dist/mcp/utils.js +0 -82
  227. package/dist/mcp/utils.js.map +0 -1
  228. package/dist/mcp-server.d.cts +0 -2
  229. package/dist/mcp-server.d.ts +0 -12
  230. package/dist/mcp-server.d.ts.map +0 -1
  231. package/dist/mcp-server.js +0 -31
  232. package/dist/mcp-server.js.map +0 -1
  233. package/dist/server-By0TN-nC.cjs +0 -2995
  234. package/dist/server-By0TN-nC.cjs.map +0 -1
@@ -1,233 +0,0 @@
1
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function i(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(s){if(s.ep)return;s.ep=!0;const r=i(s);fetch(s.href,r)}})();function qx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yv={exports:{}},xu={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var K5;function zj(){if(K5)return xu;K5=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function i(n,s,r){var o=null;if(r!==void 0&&(o=""+r),s.key!==void 0&&(o=""+s.key),"key"in s){r={};for(var l in s)l!=="key"&&(r[l]=s[l])}else r=s;return s=r.ref,{$$typeof:t,type:n,key:o,ref:s!==void 0?s:null,props:r}}return xu.Fragment=e,xu.jsx=i,xu.jsxs=i,xu}var J5;function jj(){return J5||(J5=1,Yv.exports=zj()),Yv.exports}var x=jj(),Hv={exports:{}},Ie={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var eT;function Ij(){if(eT)return Ie;eT=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function O(V){return V===null||typeof V!="object"?null:(V=g&&V[g]||V["@@iterator"],typeof V=="function"?V:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,S={};function w(V,J,L){this.props=V,this.context=J,this.refs=S,this.updater=L||_}w.prototype.isReactComponent={},w.prototype.setState=function(V,J){if(typeof V!="object"&&typeof V!="function"&&V!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,V,J,"setState")},w.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function T(){}T.prototype=w.prototype;function k(V,J,L){this.props=V,this.context=J,this.refs=S,this.updater=L||_}var A=k.prototype=new T;A.constructor=k,b(A,w.prototype),A.isPureReactComponent=!0;var R=Array.isArray;function E(){}var $={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function q(V,J,L){var ue=L.ref;return{$$typeof:t,type:V,key:J,ref:ue!==void 0?ue:null,props:L}}function G(V,J){return q(V.type,J,V.props)}function U(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function Q(V){var J={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(L){return J[L]})}var D=/\/+/g;function z(V,J){return typeof V=="object"&&V!==null&&V.key!=null?Q(""+V.key):J.toString(36)}function j(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(E,E):(V.status="pending",V.then(function(J){V.status==="pending"&&(V.status="fulfilled",V.value=J)},function(J){V.status==="pending"&&(V.status="rejected",V.reason=J)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function B(V,J,L,ue,he){var fe=typeof V;(fe==="undefined"||fe==="boolean")&&(V=null);var Oe=!1;if(V===null)Oe=!0;else switch(fe){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(V.$$typeof){case t:case e:Oe=!0;break;case d:return Oe=V._init,B(Oe(V._payload),J,L,ue,he)}}if(Oe)return he=he(V),Oe=ue===""?"."+z(V,0):ue,R(he)?(L="",Oe!=null&&(L=Oe.replace(D,"$&/")+"/"),B(he,J,L,"",function(nt){return nt})):he!=null&&(U(he)&&(he=G(he,L+(he.key==null||V&&V.key===he.key?"":(""+he.key).replace(D,"$&/")+"/")+Oe)),J.push(he)),1;Oe=0;var Ce=ue===""?".":ue+":";if(R(V))for(var ye=0;ye<V.length;ye++)ue=V[ye],fe=Ce+z(ue,ye),Oe+=B(ue,J,L,fe,he);else if(ye=O(V),typeof ye=="function")for(V=ye.call(V),ye=0;!(ue=V.next()).done;)ue=ue.value,fe=Ce+z(ue,ye++),Oe+=B(ue,J,L,fe,he);else if(fe==="object"){if(typeof V.then=="function")return B(j(V),J,L,ue,he);throw J=String(V),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function Z(V,J,L){if(V==null)return V;var ue=[],he=0;return B(V,ue,"","",function(fe){return J.call(L,fe,he++)}),ue}function H(V){if(V._status===-1){var J=V._result;J=J(),J.then(function(L){(V._status===0||V._status===-1)&&(V._status=1,V._result=L)},function(L){(V._status===0||V._status===-1)&&(V._status=2,V._result=L)}),V._status===-1&&(V._status=0,V._result=J)}if(V._status===1)return V._result.default;throw V._result}var F=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var J=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent(J))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",V);return}console.error(V)},M={map:Z,forEach:function(V,J,L){Z(V,function(){J.apply(this,arguments)},L)},count:function(V){var J=0;return Z(V,function(){J++}),J},toArray:function(V){return Z(V,function(J){return J})||[]},only:function(V){if(!U(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return Ie.Activity=p,Ie.Children=M,Ie.Component=w,Ie.Fragment=i,Ie.Profiler=s,Ie.PureComponent=k,Ie.StrictMode=n,Ie.Suspense=c,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(V){return $.H.useMemoCache(V)}},Ie.cache=function(V){return function(){return V.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(V,J,L){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var ue=b({},V.props),he=V.key;if(J!=null)for(fe in J.key!==void 0&&(he=""+J.key),J)!N.call(J,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&J.ref===void 0||(ue[fe]=J[fe]);var fe=arguments.length-2;if(fe===1)ue.children=L;else if(1<fe){for(var Oe=Array(fe),Ce=0;Ce<fe;Ce++)Oe[Ce]=arguments[Ce+2];ue.children=Oe}return q(V.type,he,ue)},Ie.createContext=function(V){return V={$$typeof:o,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:r,_context:V},V},Ie.createElement=function(V,J,L){var ue,he={},fe=null;if(J!=null)for(ue in J.key!==void 0&&(fe=""+J.key),J)N.call(J,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(he[ue]=J[ue]);var Oe=arguments.length-2;if(Oe===1)he.children=L;else if(1<Oe){for(var Ce=Array(Oe),ye=0;ye<Oe;ye++)Ce[ye]=arguments[ye+2];he.children=Ce}if(V&&V.defaultProps)for(ue in Oe=V.defaultProps,Oe)he[ue]===void 0&&(he[ue]=Oe[ue]);return q(V,fe,he)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(V){return{$$typeof:l,render:V}},Ie.isValidElement=U,Ie.lazy=function(V){return{$$typeof:d,_payload:{_status:-1,_result:V},_init:H}},Ie.memo=function(V,J){return{$$typeof:u,type:V,compare:J===void 0?null:J}},Ie.startTransition=function(V){var J=$.T,L={};$.T=L;try{var ue=V(),he=$.S;he!==null&&he(L,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(E,F)}catch(fe){F(fe)}finally{J!==null&&L.types!==null&&(J.types=L.types),$.T=J}},Ie.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Ie.use=function(V){return $.H.use(V)},Ie.useActionState=function(V,J,L){return $.H.useActionState(V,J,L)},Ie.useCallback=function(V,J){return $.H.useCallback(V,J)},Ie.useContext=function(V){return $.H.useContext(V)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(V,J){return $.H.useDeferredValue(V,J)},Ie.useEffect=function(V,J){return $.H.useEffect(V,J)},Ie.useEffectEvent=function(V){return $.H.useEffectEvent(V)},Ie.useId=function(){return $.H.useId()},Ie.useImperativeHandle=function(V,J,L){return $.H.useImperativeHandle(V,J,L)},Ie.useInsertionEffect=function(V,J){return $.H.useInsertionEffect(V,J)},Ie.useLayoutEffect=function(V,J){return $.H.useLayoutEffect(V,J)},Ie.useMemo=function(V,J){return $.H.useMemo(V,J)},Ie.useOptimistic=function(V,J){return $.H.useOptimistic(V,J)},Ie.useReducer=function(V,J,L){return $.H.useReducer(V,J,L)},Ie.useRef=function(V){return $.H.useRef(V)},Ie.useState=function(V){return $.H.useState(V)},Ie.useSyncExternalStore=function(V,J,L){return $.H.useSyncExternalStore(V,J,L)},Ie.useTransition=function(){return $.H.useTransition()},Ie.version="19.2.4",Ie}var tT;function Wx(){return tT||(tT=1,Hv.exports=Ij()),Hv.exports}var I=Wx(),Fv={exports:{}},Su={},Gv={exports:{}},Kv={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var iT;function Vj(){return iT||(iT=1,(function(t){function e(B,Z){var H=B.length;B.push(Z);e:for(;0<H;){var F=H-1>>>1,M=B[F];if(0<s(M,Z))B[F]=Z,B[H]=M,H=F;else break e}}function i(B){return B.length===0?null:B[0]}function n(B){if(B.length===0)return null;var Z=B[0],H=B.pop();if(H!==Z){B[0]=H;e:for(var F=0,M=B.length,V=M>>>1;F<V;){var J=2*(F+1)-1,L=B[J],ue=J+1,he=B[ue];if(0>s(L,H))ue<M&&0>s(he,L)?(B[F]=he,B[ue]=H,F=ue):(B[F]=L,B[J]=H,F=J);else if(ue<M&&0>s(he,H))B[F]=he,B[ue]=H,F=ue;else break e}}return Z}function s(B,Z){var H=B.sortIndex-Z.sortIndex;return H!==0?H:B.id-Z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;t.unstable_now=function(){return r.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,p=null,g=3,O=!1,_=!1,b=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function A(B){for(var Z=i(u);Z!==null;){if(Z.callback===null)n(u);else if(Z.startTime<=B)n(u),Z.sortIndex=Z.expirationTime,e(c,Z);else break;Z=i(u)}}function R(B){if(b=!1,A(B),!_)if(i(c)!==null)_=!0,E||(E=!0,Q());else{var Z=i(u);Z!==null&&j(R,Z.startTime-B)}}var E=!1,$=-1,N=5,q=-1;function G(){return S?!0:!(t.unstable_now()-q<N)}function U(){if(S=!1,E){var B=t.unstable_now();q=B;var Z=!0;try{e:{_=!1,b&&(b=!1,T($),$=-1),O=!0;var H=g;try{t:{for(A(B),p=i(c);p!==null&&!(p.expirationTime>B&&G());){var F=p.callback;if(typeof F=="function"){p.callback=null,g=p.priorityLevel;var M=F(p.expirationTime<=B);if(B=t.unstable_now(),typeof M=="function"){p.callback=M,A(B),Z=!0;break t}p===i(c)&&n(c),A(B)}else n(c);p=i(c)}if(p!==null)Z=!0;else{var V=i(u);V!==null&&j(R,V.startTime-B),Z=!1}}break e}finally{p=null,g=H,O=!1}Z=void 0}}finally{Z?Q():E=!1}}}var Q;if(typeof k=="function")Q=function(){k(U)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,z=D.port2;D.port1.onmessage=U,Q=function(){z.postMessage(null)}}else Q=function(){w(U,0)};function j(B,Z){$=w(function(){B(t.unstable_now())},Z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.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"):N=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(B){switch(g){case 1:case 2:case 3:var Z=3;break;default:Z=g}var H=g;g=Z;try{return B()}finally{g=H}},t.unstable_requestPaint=function(){S=!0},t.unstable_runWithPriority=function(B,Z){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var H=g;g=B;try{return Z()}finally{g=H}},t.unstable_scheduleCallback=function(B,Z,H){var F=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?F+H:F):H=F,B){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=H+M,B={id:d++,callback:Z,priorityLevel:B,startTime:H,expirationTime:M,sortIndex:-1},H>F?(B.sortIndex=H,e(u,B),i(c)===null&&B===i(u)&&(b?(T($),$=-1):b=!0,j(R,H-F))):(B.sortIndex=M,e(c,B),_||O||(_=!0,E||(E=!0,Q()))),B},t.unstable_shouldYield=G,t.unstable_wrapCallback=function(B){var Z=g;return function(){var H=g;g=Z;try{return B.apply(this,arguments)}finally{g=H}}}})(Kv)),Kv}var nT;function Xj(){return nT||(nT=1,Gv.exports=Vj()),Gv.exports}var Jv={exports:{}},Ji={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var sT;function Zj(){if(sT)return Ji;sT=1;var t=Wx();function e(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var n={d:{f:i,r:function(){throw Error(e(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal");function r(c,u,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:c,containerInfo:u,implementation:d}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Ji.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Ji.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(e(299));return r(c,u,null,d)},Ji.flushSync=function(c){var u=o.T,d=n.p;try{if(o.T=null,n.p=2,c)return c()}finally{o.T=u,n.p=d,n.d.f()}},Ji.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,n.d.C(c,u))},Ji.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},Ji.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,p=l(d,u.crossOrigin),g=typeof u.integrity=="string"?u.integrity:void 0,O=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?n.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:O}):d==="script"&&n.d.X(c,{crossOrigin:p,integrity:g,fetchPriority:O,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Ji.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=l(u.as,u.crossOrigin);n.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&n.d.M(c)},Ji.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,p=l(d,u.crossOrigin);n.d.L(c,d,{crossOrigin:p,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Ji.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=l(u.as,u.crossOrigin);n.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else n.d.m(c)},Ji.requestFormReset=function(c){n.d.r(c)},Ji.unstable_batchedUpdates=function(c,u){return c(u)},Ji.useFormState=function(c,u,d){return o.H.useFormState(c,u,d)},Ji.useFormStatus=function(){return o.H.useHostTransitionStatus()},Ji.version="19.2.4",Ji}var rT;function qj(){if(rT)return Jv.exports;rT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Jv.exports=Zj(),Jv.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var oT;function Wj(){if(oT)return Su;oT=1;var t=Xj(),e=Wx(),i=qj();function n(a){var h="https://react.dev/errors/"+a;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)h+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+a+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function r(a){var h=a,f=a;if(a.alternate)for(;h.return;)h=h.return;else{a=h;do h=a,(h.flags&4098)!==0&&(f=h.return),a=h.return;while(a)}return h.tag===3?f:null}function o(a){if(a.tag===13){var h=a.memoizedState;if(h===null&&(a=a.alternate,a!==null&&(h=a.memoizedState)),h!==null)return h.dehydrated}return null}function l(a){if(a.tag===31){var h=a.memoizedState;if(h===null&&(a=a.alternate,a!==null&&(h=a.memoizedState)),h!==null)return h.dehydrated}return null}function c(a){if(r(a)!==a)throw Error(n(188))}function u(a){var h=a.alternate;if(!h){if(h=r(a),h===null)throw Error(n(188));return h!==a?null:a}for(var f=a,m=h;;){var v=f.return;if(v===null)break;var y=v.alternate;if(y===null){if(m=v.return,m!==null){f=m;continue}break}if(v.child===y.child){for(y=v.child;y;){if(y===f)return c(v),a;if(y===m)return c(v),h;y=y.sibling}throw Error(n(188))}if(f.return!==m.return)f=v,m=y;else{for(var C=!1,P=v.child;P;){if(P===f){C=!0,f=v,m=y;break}if(P===m){C=!0,m=v,f=y;break}P=P.sibling}if(!C){for(P=y.child;P;){if(P===f){C=!0,f=y,m=v;break}if(P===m){C=!0,m=y,f=v;break}P=P.sibling}if(!C)throw Error(n(189))}}if(f.alternate!==m)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?a:h}function d(a){var h=a.tag;if(h===5||h===26||h===27||h===6)return a;for(a=a.child;a!==null;){if(h=d(a),h!==null)return h;a=a.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),k=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function Q(a){return a===null||typeof a!="object"?null:(a=U&&a[U]||a["@@iterator"],typeof a=="function"?a:null)}var D=Symbol.for("react.client.reference");function z(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===D?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case b:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case R:return"Suspense";case E:return"SuspenseList";case q:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case _:return"Portal";case k:return a.displayName||"Context";case T:return(a._context.displayName||"Context")+".Consumer";case A:var h=a.render;return a=a.displayName,a||(a=h.displayName||h.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case $:return h=a.displayName||null,h!==null?h:z(a.type)||"Memo";case N:h=a._payload,a=a._init;try{return z(a(h))}catch{}}return null}var j=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},F=[],M=-1;function V(a){return{current:a}}function J(a){0>M||(a.current=F[M],F[M]=null,M--)}function L(a,h){M++,F[M]=a.current,a.current=h}var ue=V(null),he=V(null),fe=V(null),Oe=V(null);function Ce(a,h){switch(L(fe,h),L(he,a),L(ue,null),h.nodeType){case 9:case 11:a=(a=h.documentElement)&&(a=a.namespaceURI)?b5(a):0;break;default:if(a=h.tagName,h=h.namespaceURI)h=b5(h),a=x5(h,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}J(ue),L(ue,a)}function ye(){J(ue),J(he),J(fe)}function nt(a){a.memoizedState!==null&&L(Oe,a);var h=ue.current,f=x5(h,a.type);h!==f&&(L(he,a),L(ue,f))}function Qt(a){he.current===a&&(J(ue),J(he)),Oe.current===a&&(J(Oe),vu._currentValue=H)}var Yt,ei;function Le(a){if(Yt===void 0)try{throw Error()}catch(f){var h=f.stack.trim().match(/\n( *(at )?)/);Yt=h&&h[1]||"",ei=-1<f.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Yt+a+ei}var as=!1;function To(a,h){if(!a||as)return"";as=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(h){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(ne){var ie=ne}Reflect.construct(a,[],le)}else{try{le.call()}catch(ne){ie=ne}a.call(le.prototype)}}else{try{throw Error()}catch(ne){ie=ne}(le=a())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(ne){if(ne&&ie&&typeof ne.stack=="string")return[ne.stack,ie.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=m.DetermineComponentFrameRoot(),C=y[0],P=y[1];if(C&&P){var W=C.split(`
44
- `),te=P.split(`
45
- `);for(v=m=0;m<W.length&&!W[m].includes("DetermineComponentFrameRoot");)m++;for(;v<te.length&&!te[v].includes("DetermineComponentFrameRoot");)v++;if(m===W.length||v===te.length)for(m=W.length-1,v=te.length-1;1<=m&&0<=v&&W[m]!==te[v];)v--;for(;1<=m&&0<=v;m--,v--)if(W[m]!==te[v]){if(m!==1||v!==1)do if(m--,v--,0>v||W[m]!==te[v]){var se=`
46
- `+W[m].replace(" at new "," at ");return a.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",a.displayName)),se}while(1<=m&&0<=v);break}}}finally{as=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?Le(f):""}function Ao(a,h){switch(a.tag){case 26:case 27:case 5:return Le(a.type);case 16:return Le("Lazy");case 13:return a.child!==h&&h!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return To(a.type,!1);case 11:return To(a.type.render,!1);case 1:return To(a.type,!0);case 31:return Le("Activity");default:return""}}function Da(a){try{var h="",f=null;do h+=Ao(a,f),f=a,a=a.return;while(a);return h}catch(m){return`
47
- Error generating stack: `+m.message+`
48
- `+m.stack}}var Br=Object.prototype.hasOwnProperty,Eo=t.unstable_scheduleCallback,Mh=t.unstable_cancelCallback,QO=t.unstable_shouldYield,LO=t.unstable_requestPaint,cn=t.unstable_now,DO=t.unstable_getCurrentPriorityLevel,oe=t.unstable_ImmediatePriority,ge=t.unstable_UserBlockingPriority,De=t.unstable_NormalPriority,Ye=t.unstable_LowPriority,ht=t.unstable_IdlePriority,In=t.log,$r=t.unstable_setDisableYieldValue,hn=null,fi=null;function xn(a){if(typeof In=="function"&&$r(a),fi&&typeof fi.setStrictMode=="function")try{fi.setStrictMode(hn,a)}catch{}}var _t=Math.clz32?Math.clz32:Cz,Mo=Math.log,Bs=Math.LN2;function Cz(a){return a>>>=0,a===0?32:31-(Mo(a)/Bs|0)|0}var Td=256,Ad=262144,Ed=4194304;function Ba(a){var h=a&42;if(h!==0)return h;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Md(a,h,f){var m=a.pendingLanes;if(m===0)return 0;var v=0,y=a.suspendedLanes,C=a.pingedLanes;a=a.warmLanes;var P=m&134217727;return P!==0?(m=P&~y,m!==0?v=Ba(m):(C&=P,C!==0?v=Ba(C):f||(f=P&~a,f!==0&&(v=Ba(f))))):(P=m&~y,P!==0?v=Ba(P):C!==0?v=Ba(C):f||(f=m&~a,f!==0&&(v=Ba(f)))),v===0?0:h!==0&&h!==v&&(h&y)===0&&(y=v&-v,f=h&-h,y>=f||y===32&&(f&4194048)!==0)?h:v}function Ph(a,h){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&h)===0}function kz(a,h){switch(a){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 iC(){var a=Ed;return Ed<<=1,(Ed&62914560)===0&&(Ed=4194304),a}function BO(a){for(var h=[],f=0;31>f;f++)h.push(a);return h}function Rh(a,h){a.pendingLanes|=h,h!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Tz(a,h,f,m,v,y){var C=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var P=a.entanglements,W=a.expirationTimes,te=a.hiddenUpdates;for(f=C&~f;0<f;){var se=31-_t(f),le=1<<se;P[se]=0,W[se]=-1;var ie=te[se];if(ie!==null)for(te[se]=null,se=0;se<ie.length;se++){var ne=ie[se];ne!==null&&(ne.lane&=-536870913)}f&=~le}m!==0&&nC(a,m,0),y!==0&&v===0&&a.tag!==0&&(a.suspendedLanes|=y&~(C&~h))}function nC(a,h,f){a.pendingLanes|=h,a.suspendedLanes&=~h;var m=31-_t(h);a.entangledLanes|=h,a.entanglements[m]=a.entanglements[m]|1073741824|f&261930}function sC(a,h){var f=a.entangledLanes|=h;for(a=a.entanglements;f;){var m=31-_t(f),v=1<<m;v&h|a[m]&h&&(a[m]|=h),f&=~v}}function rC(a,h){var f=h&-h;return f=(f&42)!==0?1:$O(f),(f&(a.suspendedLanes|h))!==0?0:f}function $O(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function NO(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function oC(){var a=Z.p;return a!==0?a:(a=window.event,a===void 0?32:q5(a.type))}function aC(a,h){var f=Z.p;try{return Z.p=a,h()}finally{Z.p=f}}var Po=Math.random().toString(36).slice(2),Ni="__reactFiber$"+Po,Sn="__reactProps$"+Po,zl="__reactContainer$"+Po,zO="__reactEvents$"+Po,Az="__reactListeners$"+Po,Ez="__reactHandles$"+Po,lC="__reactResources$"+Po,Qh="__reactMarker$"+Po;function jO(a){delete a[Ni],delete a[Sn],delete a[zO],delete a[Az],delete a[Ez]}function jl(a){var h=a[Ni];if(h)return h;for(var f=a.parentNode;f;){if(h=f[zl]||f[Ni]){if(f=h.alternate,h.child!==null||f!==null&&f.child!==null)for(a=E5(a);a!==null;){if(f=a[Ni])return f;a=E5(a)}return h}a=f,f=a.parentNode}return null}function Il(a){if(a=a[Ni]||a[zl]){var h=a.tag;if(h===5||h===6||h===13||h===31||h===26||h===27||h===3)return a}return null}function Lh(a){var h=a.tag;if(h===5||h===26||h===27||h===6)return a.stateNode;throw Error(n(33))}function Vl(a){var h=a[lC];return h||(h=a[lC]={hoistableStyles:new Map,hoistableScripts:new Map}),h}function bi(a){a[Qh]=!0}var cC=new Set,hC={};function $a(a,h){Xl(a,h),Xl(a+"Capture",h)}function Xl(a,h){for(hC[a]=h,a=0;a<h.length;a++)cC.add(h[a])}var Mz=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]*$"),uC={},fC={};function Pz(a){return Br.call(fC,a)?!0:Br.call(uC,a)?!1:Mz.test(a)?fC[a]=!0:(uC[a]=!0,!1)}function Pd(a,h,f){if(Pz(h))if(f===null)a.removeAttribute(h);else{switch(typeof f){case"undefined":case"function":case"symbol":a.removeAttribute(h);return;case"boolean":var m=h.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(h);return}}a.setAttribute(h,""+f)}}function Rd(a,h,f){if(f===null)a.removeAttribute(h);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(h);return}a.setAttribute(h,""+f)}}function Nr(a,h,f,m){if(m===null)a.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(f);return}a.setAttributeNS(h,f,""+m)}}function ls(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function dC(a){var h=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function Rz(a,h,f){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,h);if(!a.hasOwnProperty(h)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var v=m.get,y=m.set;return Object.defineProperty(a,h,{configurable:!0,get:function(){return v.call(this)},set:function(C){f=""+C,y.call(this,C)}}),Object.defineProperty(a,h,{enumerable:m.enumerable}),{getValue:function(){return f},setValue:function(C){f=""+C},stopTracking:function(){a._valueTracker=null,delete a[h]}}}}function IO(a){if(!a._valueTracker){var h=dC(a)?"checked":"value";a._valueTracker=Rz(a,h,""+a[h])}}function pC(a){if(!a)return!1;var h=a._valueTracker;if(!h)return!0;var f=h.getValue(),m="";return a&&(m=dC(a)?a.checked?"true":"false":a.value),a=m,a!==f?(h.setValue(a),!0):!1}function Qd(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Qz=/[\n"\\]/g;function cs(a){return a.replace(Qz,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function VO(a,h,f,m,v,y,C,P){a.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?a.type=C:a.removeAttribute("type"),h!=null?C==="number"?(h===0&&a.value===""||a.value!=h)&&(a.value=""+ls(h)):a.value!==""+ls(h)&&(a.value=""+ls(h)):C!=="submit"&&C!=="reset"||a.removeAttribute("value"),h!=null?XO(a,C,ls(h)):f!=null?XO(a,C,ls(f)):m!=null&&a.removeAttribute("value"),v==null&&y!=null&&(a.defaultChecked=!!y),v!=null&&(a.checked=v&&typeof v!="function"&&typeof v!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?a.name=""+ls(P):a.removeAttribute("name")}function mC(a,h,f,m,v,y,C,P){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(a.type=y),h!=null||f!=null){if(!(y!=="submit"&&y!=="reset"||h!=null)){IO(a);return}f=f!=null?""+ls(f):"",h=h!=null?""+ls(h):f,P||h===a.value||(a.value=h),a.defaultValue=h}m=m??v,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=P?a.checked:!!m,a.defaultChecked=!!m,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(a.name=C),IO(a)}function XO(a,h,f){h==="number"&&Qd(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function Zl(a,h,f,m){if(a=a.options,h){h={};for(var v=0;v<f.length;v++)h["$"+f[v]]=!0;for(f=0;f<a.length;f++)v=h.hasOwnProperty("$"+a[f].value),a[f].selected!==v&&(a[f].selected=v),v&&m&&(a[f].defaultSelected=!0)}else{for(f=""+ls(f),h=null,v=0;v<a.length;v++){if(a[v].value===f){a[v].selected=!0,m&&(a[v].defaultSelected=!0);return}h!==null||a[v].disabled||(h=a[v])}h!==null&&(h.selected=!0)}}function gC(a,h,f){if(h!=null&&(h=""+ls(h),h!==a.value&&(a.value=h),f==null)){a.defaultValue!==h&&(a.defaultValue=h);return}a.defaultValue=f!=null?""+ls(f):""}function OC(a,h,f,m){if(h==null){if(m!=null){if(f!=null)throw Error(n(92));if(j(m)){if(1<m.length)throw Error(n(93));m=m[0]}f=m}f==null&&(f=""),h=f}f=ls(h),a.defaultValue=f,m=a.textContent,m===f&&m!==""&&m!==null&&(a.value=m),IO(a)}function ql(a,h){if(h){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=h;return}}a.textContent=h}var Lz=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 vC(a,h,f){var m=h.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?m?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="":m?a.setProperty(h,f):typeof f!="number"||f===0||Lz.has(h)?h==="float"?a.cssFloat=f:a[h]=(""+f).trim():a[h]=f+"px"}function _C(a,h,f){if(h!=null&&typeof h!="object")throw Error(n(62));if(a=a.style,f!=null){for(var m in f)!f.hasOwnProperty(m)||h!=null&&h.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var v in h)m=h[v],h.hasOwnProperty(v)&&f[v]!==m&&vC(a,v,m)}else for(var y in h)h.hasOwnProperty(y)&&vC(a,y,h[y])}function ZO(a){if(a.indexOf("-")===-1)return!1;switch(a){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 Dz=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"]]),Bz=/^[\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 Ld(a){return Bz.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function zr(){}var qO=null;function WO(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Wl=null,Ul=null;function yC(a){var h=Il(a);if(h&&(a=h.stateNode)){var f=a[Sn]||null;e:switch(a=h.stateNode,h.type){case"input":if(VO(a,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),h=f.name,f.type==="radio"&&h!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+cs(""+h)+'"][type="radio"]'),h=0;h<f.length;h++){var m=f[h];if(m!==a&&m.form===a.form){var v=m[Sn]||null;if(!v)throw Error(n(90));VO(m,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(h=0;h<f.length;h++)m=f[h],m.form===a.form&&pC(m)}break e;case"textarea":gC(a,f.value,f.defaultValue);break e;case"select":h=f.value,h!=null&&Zl(a,!!f.multiple,h,!1)}}}var UO=!1;function bC(a,h,f){if(UO)return a(h,f);UO=!0;try{var m=a(h);return m}finally{if(UO=!1,(Wl!==null||Ul!==null)&&(bp(),Wl&&(h=Wl,a=Ul,Ul=Wl=null,yC(h),a)))for(h=0;h<a.length;h++)yC(a[h])}}function Dh(a,h){var f=a.stateNode;if(f===null)return null;var m=f[Sn]||null;if(m===null)return null;f=m[h];e:switch(h){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(n(231,h,typeof f));return f}var jr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),YO=!1;if(jr)try{var Bh={};Object.defineProperty(Bh,"passive",{get:function(){YO=!0}}),window.addEventListener("test",Bh,Bh),window.removeEventListener("test",Bh,Bh)}catch{YO=!1}var Ro=null,HO=null,Dd=null;function xC(){if(Dd)return Dd;var a,h=HO,f=h.length,m,v="value"in Ro?Ro.value:Ro.textContent,y=v.length;for(a=0;a<f&&h[a]===v[a];a++);var C=f-a;for(m=1;m<=C&&h[f-m]===v[y-m];m++);return Dd=v.slice(a,1<m?1-m:void 0)}function Bd(a){var h=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&h===13&&(a=13)):a=h,a===10&&(a=13),32<=a||a===13?a:0}function $d(){return!0}function SC(){return!1}function wn(a){function h(f,m,v,y,C){this._reactName=f,this._targetInst=v,this.type=m,this.nativeEvent=y,this.target=C,this.currentTarget=null;for(var P in a)a.hasOwnProperty(P)&&(f=a[P],this[P]=f?f(y):y[P]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?$d:SC,this.isPropagationStopped=SC,this}return p(h.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=$d)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=$d)},persist:function(){},isPersistent:$d}),h}var Na={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nd=wn(Na),$h=p({},Na,{view:0,detail:0}),$z=wn($h),FO,GO,Nh,zd=p({},$h,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:JO,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Nh&&(Nh&&a.type==="mousemove"?(FO=a.screenX-Nh.screenX,GO=a.screenY-Nh.screenY):GO=FO=0,Nh=a),FO)},movementY:function(a){return"movementY"in a?a.movementY:GO}}),wC=wn(zd),Nz=p({},zd,{dataTransfer:0}),zz=wn(Nz),jz=p({},$h,{relatedTarget:0}),KO=wn(jz),Iz=p({},Na,{animationName:0,elapsedTime:0,pseudoElement:0}),Vz=wn(Iz),Xz=p({},Na,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Zz=wn(Xz),qz=p({},Na,{data:0}),CC=wn(qz),Wz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Uz={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"},Yz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hz(a){var h=this.nativeEvent;return h.getModifierState?h.getModifierState(a):(a=Yz[a])?!!h[a]:!1}function JO(){return Hz}var Fz=p({},$h,{key:function(a){if(a.key){var h=Wz[a.key]||a.key;if(h!=="Unidentified")return h}return a.type==="keypress"?(a=Bd(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Uz[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:JO,charCode:function(a){return a.type==="keypress"?Bd(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Bd(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Gz=wn(Fz),Kz=p({},zd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kC=wn(Kz),Jz=p({},$h,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:JO}),e8=wn(Jz),t8=p({},Na,{propertyName:0,elapsedTime:0,pseudoElement:0}),i8=wn(t8),n8=p({},zd,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),s8=wn(n8),r8=p({},Na,{newState:0,oldState:0}),o8=wn(r8),a8=[9,13,27,32],e0=jr&&"CompositionEvent"in window,zh=null;jr&&"documentMode"in document&&(zh=document.documentMode);var l8=jr&&"TextEvent"in window&&!zh,TC=jr&&(!e0||zh&&8<zh&&11>=zh),AC=" ",EC=!1;function MC(a,h){switch(a){case"keyup":return a8.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function PC(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Yl=!1;function c8(a,h){switch(a){case"compositionend":return PC(h);case"keypress":return h.which!==32?null:(EC=!0,AC);case"textInput":return a=h.data,a===AC&&EC?null:a;default:return null}}function h8(a,h){if(Yl)return a==="compositionend"||!e0&&MC(a,h)?(a=xC(),Dd=HO=Ro=null,Yl=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1<h.char.length)return h.char;if(h.which)return String.fromCharCode(h.which)}return null;case"compositionend":return TC&&h.locale!=="ko"?null:h.data;default:return null}}var u8={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 RC(a){var h=a&&a.nodeName&&a.nodeName.toLowerCase();return h==="input"?!!u8[a.type]:h==="textarea"}function QC(a,h,f,m){Wl?Ul?Ul.push(m):Ul=[m]:Wl=m,h=Ap(h,"onChange"),0<h.length&&(f=new Nd("onChange","change",null,f,m),a.push({event:f,listeners:h}))}var jh=null,Ih=null;function f8(a){m5(a,0)}function jd(a){var h=Lh(a);if(pC(h))return a}function LC(a,h){if(a==="change")return h}var DC=!1;if(jr){var t0;if(jr){var i0="oninput"in document;if(!i0){var BC=document.createElement("div");BC.setAttribute("oninput","return;"),i0=typeof BC.oninput=="function"}t0=i0}else t0=!1;DC=t0&&(!document.documentMode||9<document.documentMode)}function $C(){jh&&(jh.detachEvent("onpropertychange",NC),Ih=jh=null)}function NC(a){if(a.propertyName==="value"&&jd(Ih)){var h=[];QC(h,Ih,a,WO(a)),bC(f8,h)}}function d8(a,h,f){a==="focusin"?($C(),jh=h,Ih=f,jh.attachEvent("onpropertychange",NC)):a==="focusout"&&$C()}function p8(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return jd(Ih)}function m8(a,h){if(a==="click")return jd(h)}function g8(a,h){if(a==="input"||a==="change")return jd(h)}function O8(a,h){return a===h&&(a!==0||1/a===1/h)||a!==a&&h!==h}var Vn=typeof Object.is=="function"?Object.is:O8;function Vh(a,h){if(Vn(a,h))return!0;if(typeof a!="object"||a===null||typeof h!="object"||h===null)return!1;var f=Object.keys(a),m=Object.keys(h);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var v=f[m];if(!Br.call(h,v)||!Vn(a[v],h[v]))return!1}return!0}function zC(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function jC(a,h){var f=zC(a);a=0;for(var m;f;){if(f.nodeType===3){if(m=a+f.textContent.length,a<=h&&m>=h)return{node:f,offset:h-a};a=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=zC(f)}}function IC(a,h){return a&&h?a===h?!0:a&&a.nodeType===3?!1:h&&h.nodeType===3?IC(a,h.parentNode):"contains"in a?a.contains(h):a.compareDocumentPosition?!!(a.compareDocumentPosition(h)&16):!1:!1}function VC(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var h=Qd(a.document);h instanceof a.HTMLIFrameElement;){try{var f=typeof h.contentWindow.location.href=="string"}catch{f=!1}if(f)a=h.contentWindow;else break;h=Qd(a.document)}return h}function n0(a){var h=a&&a.nodeName&&a.nodeName.toLowerCase();return h&&(h==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||h==="textarea"||a.contentEditable==="true")}var v8=jr&&"documentMode"in document&&11>=document.documentMode,Hl=null,s0=null,Xh=null,r0=!1;function XC(a,h,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;r0||Hl==null||Hl!==Qd(m)||(m=Hl,"selectionStart"in m&&n0(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Xh&&Vh(Xh,m)||(Xh=m,m=Ap(s0,"onSelect"),0<m.length&&(h=new Nd("onSelect","select",null,h,f),a.push({event:h,listeners:m}),h.target=Hl)))}function za(a,h){var f={};return f[a.toLowerCase()]=h.toLowerCase(),f["Webkit"+a]="webkit"+h,f["Moz"+a]="moz"+h,f}var Fl={animationend:za("Animation","AnimationEnd"),animationiteration:za("Animation","AnimationIteration"),animationstart:za("Animation","AnimationStart"),transitionrun:za("Transition","TransitionRun"),transitionstart:za("Transition","TransitionStart"),transitioncancel:za("Transition","TransitionCancel"),transitionend:za("Transition","TransitionEnd")},o0={},ZC={};jr&&(ZC=document.createElement("div").style,"AnimationEvent"in window||(delete Fl.animationend.animation,delete Fl.animationiteration.animation,delete Fl.animationstart.animation),"TransitionEvent"in window||delete Fl.transitionend.transition);function ja(a){if(o0[a])return o0[a];if(!Fl[a])return a;var h=Fl[a],f;for(f in h)if(h.hasOwnProperty(f)&&f in ZC)return o0[a]=h[f];return a}var qC=ja("animationend"),WC=ja("animationiteration"),UC=ja("animationstart"),_8=ja("transitionrun"),y8=ja("transitionstart"),b8=ja("transitioncancel"),YC=ja("transitionend"),HC=new Map,a0="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(" ");a0.push("scrollEnd");function $s(a,h){HC.set(a,h),$a(h,[a])}var Id=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var h=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(h))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},hs=[],Gl=0,l0=0;function Vd(){for(var a=Gl,h=l0=Gl=0;h<a;){var f=hs[h];hs[h++]=null;var m=hs[h];hs[h++]=null;var v=hs[h];hs[h++]=null;var y=hs[h];if(hs[h++]=null,m!==null&&v!==null){var C=m.pending;C===null?v.next=v:(v.next=C.next,C.next=v),m.pending=v}y!==0&&FC(f,v,y)}}function Xd(a,h,f,m){hs[Gl++]=a,hs[Gl++]=h,hs[Gl++]=f,hs[Gl++]=m,l0|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function c0(a,h,f,m){return Xd(a,h,f,m),Zd(a)}function Ia(a,h){return Xd(a,null,null,h),Zd(a)}function FC(a,h,f){a.lanes|=f;var m=a.alternate;m!==null&&(m.lanes|=f);for(var v=!1,y=a.return;y!==null;)y.childLanes|=f,m=y.alternate,m!==null&&(m.childLanes|=f),y.tag===22&&(a=y.stateNode,a===null||a._visibility&1||(v=!0)),a=y,y=y.return;return a.tag===3?(y=a.stateNode,v&&h!==null&&(v=31-_t(f),a=y.hiddenUpdates,m=a[v],m===null?a[v]=[h]:m.push(h),h.lane=f|536870912),y):null}function Zd(a){if(50<uu)throw uu=0,vv=null,Error(n(185));for(var h=a.return;h!==null;)a=h,h=a.return;return a.tag===3?a.stateNode:null}var Kl={};function x8(a,h,f,m){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(a,h,f,m){return new x8(a,h,f,m)}function h0(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Ir(a,h){var f=a.alternate;return f===null?(f=Xn(a.tag,h,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=h,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&65011712,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,h=a.dependencies,f.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f.refCleanup=a.refCleanup,f}function GC(a,h){a.flags&=65011714;var f=a.alternate;return f===null?(a.childLanes=0,a.lanes=h,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=f.childLanes,a.lanes=f.lanes,a.child=f.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=f.memoizedProps,a.memoizedState=f.memoizedState,a.updateQueue=f.updateQueue,a.type=f.type,h=f.dependencies,a.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext}),a}function qd(a,h,f,m,v,y){var C=0;if(m=a,typeof a=="function")h0(a)&&(C=1);else if(typeof a=="string")C=Tj(a,f,ue.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case q:return a=Xn(31,f,h,v),a.elementType=q,a.lanes=y,a;case b:return Va(f.children,v,y,h);case S:C=8,v|=24;break;case w:return a=Xn(12,f,h,v|2),a.elementType=w,a.lanes=y,a;case R:return a=Xn(13,f,h,v),a.elementType=R,a.lanes=y,a;case E:return a=Xn(19,f,h,v),a.elementType=E,a.lanes=y,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case k:C=10;break e;case T:C=9;break e;case A:C=11;break e;case $:C=14;break e;case N:C=16,m=null;break e}C=29,f=Error(n(130,a===null?"null":typeof a,"")),m=null}return h=Xn(C,f,h,v),h.elementType=a,h.type=m,h.lanes=y,h}function Va(a,h,f,m){return a=Xn(7,a,m,h),a.lanes=f,a}function u0(a,h,f){return a=Xn(6,a,null,h),a.lanes=f,a}function KC(a){var h=Xn(18,null,null,0);return h.stateNode=a,h}function f0(a,h,f){return h=Xn(4,a.children!==null?a.children:[],a.key,h),h.lanes=f,h.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},h}var JC=new WeakMap;function us(a,h){if(typeof a=="object"&&a!==null){var f=JC.get(a);return f!==void 0?f:(h={value:a,source:h,stack:Da(h)},JC.set(a,h),h)}return{value:a,source:h,stack:Da(h)}}var Jl=[],ec=0,Wd=null,Zh=0,fs=[],ds=0,Qo=null,er=1,tr="";function Vr(a,h){Jl[ec++]=Zh,Jl[ec++]=Wd,Wd=a,Zh=h}function ek(a,h,f){fs[ds++]=er,fs[ds++]=tr,fs[ds++]=Qo,Qo=a;var m=er;a=tr;var v=32-_t(m)-1;m&=~(1<<v),f+=1;var y=32-_t(h)+v;if(30<y){var C=v-v%5;y=(m&(1<<C)-1).toString(32),m>>=C,v-=C,er=1<<32-_t(h)+v|f<<v|m,tr=y+a}else er=1<<y|f<<v|m,tr=a}function d0(a){a.return!==null&&(Vr(a,1),ek(a,1,0))}function p0(a){for(;a===Wd;)Wd=Jl[--ec],Jl[ec]=null,Zh=Jl[--ec],Jl[ec]=null;for(;a===Qo;)Qo=fs[--ds],fs[ds]=null,tr=fs[--ds],fs[ds]=null,er=fs[--ds],fs[ds]=null}function tk(a,h){fs[ds++]=er,fs[ds++]=tr,fs[ds++]=Qo,er=h.id,tr=h.overflow,Qo=a}var zi=null,At=null,tt=!1,Lo=null,ps=!1,m0=Error(n(519));function Do(a){var h=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qh(us(h,a)),m0}function ik(a){var h=a.stateNode,f=a.type,m=a.memoizedProps;switch(h[Ni]=a,h[Sn]=m,f){case"dialog":Fe("cancel",h),Fe("close",h);break;case"iframe":case"object":case"embed":Fe("load",h);break;case"video":case"audio":for(f=0;f<du.length;f++)Fe(du[f],h);break;case"source":Fe("error",h);break;case"img":case"image":case"link":Fe("error",h),Fe("load",h);break;case"details":Fe("toggle",h);break;case"input":Fe("invalid",h),mC(h,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Fe("invalid",h);break;case"textarea":Fe("invalid",h),OC(h,m.value,m.defaultValue,m.children)}f=m.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||h.textContent===""+f||m.suppressHydrationWarning===!0||_5(h.textContent,f)?(m.popover!=null&&(Fe("beforetoggle",h),Fe("toggle",h)),m.onScroll!=null&&Fe("scroll",h),m.onScrollEnd!=null&&Fe("scrollend",h),m.onClick!=null&&(h.onclick=zr),h=!0):h=!1,h||Do(a,!0)}function nk(a){for(zi=a.return;zi;)switch(zi.tag){case 5:case 31:case 13:ps=!1;return;case 27:case 3:ps=!0;return;default:zi=zi.return}}function tc(a){if(a!==zi)return!1;if(!tt)return nk(a),tt=!0,!1;var h=a.tag,f;if((f=h!==3&&h!==27)&&((f=h===5)&&(f=a.type,f=!(f!=="form"&&f!=="button")||Qv(a.type,a.memoizedProps)),f=!f),f&&At&&Do(a),nk(a),h===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));At=A5(a)}else if(h===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));At=A5(a)}else h===27?(h=At,Ho(a.type)?(a=Nv,Nv=null,At=a):At=h):At=zi?gs(a.stateNode.nextSibling):null;return!0}function Xa(){At=zi=null,tt=!1}function g0(){var a=Lo;return a!==null&&(An===null?An=a:An.push.apply(An,a),Lo=null),a}function qh(a){Lo===null?Lo=[a]:Lo.push(a)}var O0=V(null),Za=null,Xr=null;function Bo(a,h,f){L(O0,h._currentValue),h._currentValue=f}function Zr(a){a._currentValue=O0.current,J(O0)}function v0(a,h,f){for(;a!==null;){var m=a.alternate;if((a.childLanes&h)!==h?(a.childLanes|=h,m!==null&&(m.childLanes|=h)):m!==null&&(m.childLanes&h)!==h&&(m.childLanes|=h),a===f)break;a=a.return}}function _0(a,h,f,m){var v=a.child;for(v!==null&&(v.return=a);v!==null;){var y=v.dependencies;if(y!==null){var C=v.child;y=y.firstContext;e:for(;y!==null;){var P=y;y=v;for(var W=0;W<h.length;W++)if(P.context===h[W]){y.lanes|=f,P=y.alternate,P!==null&&(P.lanes|=f),v0(y.return,f,a),m||(C=null);break e}y=P.next}}else if(v.tag===18){if(C=v.return,C===null)throw Error(n(341));C.lanes|=f,y=C.alternate,y!==null&&(y.lanes|=f),v0(C,f,a),C=null}else C=v.child;if(C!==null)C.return=v;else for(C=v;C!==null;){if(C===a){C=null;break}if(v=C.sibling,v!==null){v.return=C.return,C=v;break}C=C.return}v=C}}function ic(a,h,f,m){a=null;for(var v=h,y=!1;v!==null;){if(!y){if((v.flags&524288)!==0)y=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var C=v.alternate;if(C===null)throw Error(n(387));if(C=C.memoizedProps,C!==null){var P=v.type;Vn(v.pendingProps.value,C.value)||(a!==null?a.push(P):a=[P])}}else if(v===Oe.current){if(C=v.alternate,C===null)throw Error(n(387));C.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(a!==null?a.push(vu):a=[vu])}v=v.return}a!==null&&_0(h,a,f,m),h.flags|=262144}function Ud(a){for(a=a.firstContext;a!==null;){if(!Vn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function qa(a){Za=a,Xr=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function ji(a){return sk(Za,a)}function Yd(a,h){return Za===null&&qa(a),sk(a,h)}function sk(a,h){var f=h._currentValue;if(h={context:h,memoizedValue:f,next:null},Xr===null){if(a===null)throw Error(n(308));Xr=h,a.dependencies={lanes:0,firstContext:h},a.flags|=524288}else Xr=Xr.next=h;return f}var S8=typeof AbortController<"u"?AbortController:function(){var a=[],h=this.signal={aborted:!1,addEventListener:function(f,m){a.push(m)}};this.abort=function(){h.aborted=!0,a.forEach(function(f){return f()})}},w8=t.unstable_scheduleCallback,C8=t.unstable_NormalPriority,ti={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function y0(){return{controller:new S8,data:new Map,refCount:0}}function Wh(a){a.refCount--,a.refCount===0&&w8(C8,function(){a.controller.abort()})}var Uh=null,b0=0,nc=0,sc=null;function k8(a,h){if(Uh===null){var f=Uh=[];b0=0,nc=wv(),sc={status:"pending",value:void 0,then:function(m){f.push(m)}}}return b0++,h.then(rk,rk),h}function rk(){if(--b0===0&&Uh!==null){sc!==null&&(sc.status="fulfilled");var a=Uh;Uh=null,nc=0,sc=null;for(var h=0;h<a.length;h++)(0,a[h])()}}function T8(a,h){var f=[],m={status:"pending",value:null,reason:null,then:function(v){f.push(v)}};return a.then(function(){m.status="fulfilled",m.value=h;for(var v=0;v<f.length;v++)(0,f[v])(h)},function(v){for(m.status="rejected",m.reason=v,v=0;v<f.length;v++)(0,f[v])(void 0)}),m}var ok=B.S;B.S=function(a,h){X2=cn(),typeof h=="object"&&h!==null&&typeof h.then=="function"&&k8(a,h),ok!==null&&ok(a,h)};var Wa=V(null);function x0(){var a=Wa.current;return a!==null?a:yt.pooledCache}function Hd(a,h){h===null?L(Wa,Wa.current):L(Wa,h.pool)}function ak(){var a=x0();return a===null?null:{parent:ti._currentValue,pool:a}}var rc=Error(n(460)),S0=Error(n(474)),Fd=Error(n(542)),Gd={then:function(){}};function lk(a){return a=a.status,a==="fulfilled"||a==="rejected"}function ck(a,h,f){switch(f=a[f],f===void 0?a.push(h):f!==h&&(h.then(zr,zr),h=f),h.status){case"fulfilled":return h.value;case"rejected":throw a=h.reason,uk(a),a;default:if(typeof h.status=="string")h.then(zr,zr);else{if(a=yt,a!==null&&100<a.shellSuspendCounter)throw Error(n(482));a=h,a.status="pending",a.then(function(m){if(h.status==="pending"){var v=h;v.status="fulfilled",v.value=m}},function(m){if(h.status==="pending"){var v=h;v.status="rejected",v.reason=m}})}switch(h.status){case"fulfilled":return h.value;case"rejected":throw a=h.reason,uk(a),a}throw Ya=h,rc}}function Ua(a){try{var h=a._init;return h(a._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(Ya=f,rc):f}}var Ya=null;function hk(){if(Ya===null)throw Error(n(459));var a=Ya;return Ya=null,a}function uk(a){if(a===rc||a===Fd)throw Error(n(483))}var oc=null,Yh=0;function Kd(a){var h=Yh;return Yh+=1,oc===null&&(oc=[]),ck(oc,a,h)}function Hh(a,h){h=h.props.ref,a.ref=h!==void 0?h:null}function Jd(a,h){throw h.$$typeof===g?Error(n(525)):(a=Object.prototype.toString.call(h),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":a)))}function fk(a){function h(K,Y){if(a){var ee=K.deletions;ee===null?(K.deletions=[Y],K.flags|=16):ee.push(Y)}}function f(K,Y){if(!a)return null;for(;Y!==null;)h(K,Y),Y=Y.sibling;return null}function m(K){for(var Y=new Map;K!==null;)K.key!==null?Y.set(K.key,K):Y.set(K.index,K),K=K.sibling;return Y}function v(K,Y){return K=Ir(K,Y),K.index=0,K.sibling=null,K}function y(K,Y,ee){return K.index=ee,a?(ee=K.alternate,ee!==null?(ee=ee.index,ee<Y?(K.flags|=67108866,Y):ee):(K.flags|=67108866,Y)):(K.flags|=1048576,Y)}function C(K){return a&&K.alternate===null&&(K.flags|=67108866),K}function P(K,Y,ee,ae){return Y===null||Y.tag!==6?(Y=u0(ee,K.mode,ae),Y.return=K,Y):(Y=v(Y,ee),Y.return=K,Y)}function W(K,Y,ee,ae){var Re=ee.type;return Re===b?se(K,Y,ee.props.children,ae,ee.key):Y!==null&&(Y.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===N&&Ua(Re)===Y.type)?(Y=v(Y,ee.props),Hh(Y,ee),Y.return=K,Y):(Y=qd(ee.type,ee.key,ee.props,null,K.mode,ae),Hh(Y,ee),Y.return=K,Y)}function te(K,Y,ee,ae){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==ee.containerInfo||Y.stateNode.implementation!==ee.implementation?(Y=f0(ee,K.mode,ae),Y.return=K,Y):(Y=v(Y,ee.children||[]),Y.return=K,Y)}function se(K,Y,ee,ae,Re){return Y===null||Y.tag!==7?(Y=Va(ee,K.mode,ae,Re),Y.return=K,Y):(Y=v(Y,ee),Y.return=K,Y)}function le(K,Y,ee){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=u0(""+Y,K.mode,ee),Y.return=K,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case O:return ee=qd(Y.type,Y.key,Y.props,null,K.mode,ee),Hh(ee,Y),ee.return=K,ee;case _:return Y=f0(Y,K.mode,ee),Y.return=K,Y;case N:return Y=Ua(Y),le(K,Y,ee)}if(j(Y)||Q(Y))return Y=Va(Y,K.mode,ee,null),Y.return=K,Y;if(typeof Y.then=="function")return le(K,Kd(Y),ee);if(Y.$$typeof===k)return le(K,Yd(K,Y),ee);Jd(K,Y)}return null}function ie(K,Y,ee,ae){var Re=Y!==null?Y.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Re!==null?null:P(K,Y,""+ee,ae);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case O:return ee.key===Re?W(K,Y,ee,ae):null;case _:return ee.key===Re?te(K,Y,ee,ae):null;case N:return ee=Ua(ee),ie(K,Y,ee,ae)}if(j(ee)||Q(ee))return Re!==null?null:se(K,Y,ee,ae,null);if(typeof ee.then=="function")return ie(K,Y,Kd(ee),ae);if(ee.$$typeof===k)return ie(K,Y,Yd(K,ee),ae);Jd(K,ee)}return null}function ne(K,Y,ee,ae,Re){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return K=K.get(ee)||null,P(Y,K,""+ae,Re);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case O:return K=K.get(ae.key===null?ee:ae.key)||null,W(Y,K,ae,Re);case _:return K=K.get(ae.key===null?ee:ae.key)||null,te(Y,K,ae,Re);case N:return ae=Ua(ae),ne(K,Y,ee,ae,Re)}if(j(ae)||Q(ae))return K=K.get(ee)||null,se(Y,K,ae,Re,null);if(typeof ae.then=="function")return ne(K,Y,ee,Kd(ae),Re);if(ae.$$typeof===k)return ne(K,Y,ee,Yd(Y,ae),Re);Jd(Y,ae)}return null}function we(K,Y,ee,ae){for(var Re=null,st=null,Ee=Y,Xe=Y=0,Je=null;Ee!==null&&Xe<ee.length;Xe++){Ee.index>Xe?(Je=Ee,Ee=null):Je=Ee.sibling;var rt=ie(K,Ee,ee[Xe],ae);if(rt===null){Ee===null&&(Ee=Je);break}a&&Ee&&rt.alternate===null&&h(K,Ee),Y=y(rt,Y,Xe),st===null?Re=rt:st.sibling=rt,st=rt,Ee=Je}if(Xe===ee.length)return f(K,Ee),tt&&Vr(K,Xe),Re;if(Ee===null){for(;Xe<ee.length;Xe++)Ee=le(K,ee[Xe],ae),Ee!==null&&(Y=y(Ee,Y,Xe),st===null?Re=Ee:st.sibling=Ee,st=Ee);return tt&&Vr(K,Xe),Re}for(Ee=m(Ee);Xe<ee.length;Xe++)Je=ne(Ee,K,Xe,ee[Xe],ae),Je!==null&&(a&&Je.alternate!==null&&Ee.delete(Je.key===null?Xe:Je.key),Y=y(Je,Y,Xe),st===null?Re=Je:st.sibling=Je,st=Je);return a&&Ee.forEach(function(ea){return h(K,ea)}),tt&&Vr(K,Xe),Re}function Qe(K,Y,ee,ae){if(ee==null)throw Error(n(151));for(var Re=null,st=null,Ee=Y,Xe=Y=0,Je=null,rt=ee.next();Ee!==null&&!rt.done;Xe++,rt=ee.next()){Ee.index>Xe?(Je=Ee,Ee=null):Je=Ee.sibling;var ea=ie(K,Ee,rt.value,ae);if(ea===null){Ee===null&&(Ee=Je);break}a&&Ee&&ea.alternate===null&&h(K,Ee),Y=y(ea,Y,Xe),st===null?Re=ea:st.sibling=ea,st=ea,Ee=Je}if(rt.done)return f(K,Ee),tt&&Vr(K,Xe),Re;if(Ee===null){for(;!rt.done;Xe++,rt=ee.next())rt=le(K,rt.value,ae),rt!==null&&(Y=y(rt,Y,Xe),st===null?Re=rt:st.sibling=rt,st=rt);return tt&&Vr(K,Xe),Re}for(Ee=m(Ee);!rt.done;Xe++,rt=ee.next())rt=ne(Ee,K,Xe,rt.value,ae),rt!==null&&(a&&rt.alternate!==null&&Ee.delete(rt.key===null?Xe:rt.key),Y=y(rt,Y,Xe),st===null?Re=rt:st.sibling=rt,st=rt);return a&&Ee.forEach(function(Nj){return h(K,Nj)}),tt&&Vr(K,Xe),Re}function gt(K,Y,ee,ae){if(typeof ee=="object"&&ee!==null&&ee.type===b&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case O:e:{for(var Re=ee.key;Y!==null;){if(Y.key===Re){if(Re=ee.type,Re===b){if(Y.tag===7){f(K,Y.sibling),ae=v(Y,ee.props.children),ae.return=K,K=ae;break e}}else if(Y.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===N&&Ua(Re)===Y.type){f(K,Y.sibling),ae=v(Y,ee.props),Hh(ae,ee),ae.return=K,K=ae;break e}f(K,Y);break}else h(K,Y);Y=Y.sibling}ee.type===b?(ae=Va(ee.props.children,K.mode,ae,ee.key),ae.return=K,K=ae):(ae=qd(ee.type,ee.key,ee.props,null,K.mode,ae),Hh(ae,ee),ae.return=K,K=ae)}return C(K);case _:e:{for(Re=ee.key;Y!==null;){if(Y.key===Re)if(Y.tag===4&&Y.stateNode.containerInfo===ee.containerInfo&&Y.stateNode.implementation===ee.implementation){f(K,Y.sibling),ae=v(Y,ee.children||[]),ae.return=K,K=ae;break e}else{f(K,Y);break}else h(K,Y);Y=Y.sibling}ae=f0(ee,K.mode,ae),ae.return=K,K=ae}return C(K);case N:return ee=Ua(ee),gt(K,Y,ee,ae)}if(j(ee))return we(K,Y,ee,ae);if(Q(ee)){if(Re=Q(ee),typeof Re!="function")throw Error(n(150));return ee=Re.call(ee),Qe(K,Y,ee,ae)}if(typeof ee.then=="function")return gt(K,Y,Kd(ee),ae);if(ee.$$typeof===k)return gt(K,Y,Yd(K,ee),ae);Jd(K,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,Y!==null&&Y.tag===6?(f(K,Y.sibling),ae=v(Y,ee),ae.return=K,K=ae):(f(K,Y),ae=u0(ee,K.mode,ae),ae.return=K,K=ae),C(K)):f(K,Y)}return function(K,Y,ee,ae){try{Yh=0;var Re=gt(K,Y,ee,ae);return oc=null,Re}catch(Ee){if(Ee===rc||Ee===Fd)throw Ee;var st=Xn(29,Ee,null,K.mode);return st.lanes=ae,st.return=K,st}finally{}}}var Ha=fk(!0),dk=fk(!1),$o=!1;function w0(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function C0(a,h){a=a.updateQueue,h.updateQueue===a&&(h.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function No(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function zo(a,h,f){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(ot&2)!==0){var v=m.pending;return v===null?h.next=h:(h.next=v.next,v.next=h),m.pending=h,h=Zd(a),FC(a,null,f),h}return Xd(a,m,h,f),Zd(a)}function Fh(a,h,f){if(h=h.updateQueue,h!==null&&(h=h.shared,(f&4194048)!==0)){var m=h.lanes;m&=a.pendingLanes,f|=m,h.lanes=f,sC(a,f)}}function k0(a,h){var f=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var v=null,y=null;if(f=f.firstBaseUpdate,f!==null){do{var C={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};y===null?v=y=C:y=y.next=C,f=f.next}while(f!==null);y===null?v=y=h:y=y.next=h}else v=y=h;f={baseState:m.baseState,firstBaseUpdate:v,lastBaseUpdate:y,shared:m.shared,callbacks:m.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=h:a.next=h,f.lastBaseUpdate=h}var T0=!1;function Gh(){if(T0){var a=sc;if(a!==null)throw a}}function Kh(a,h,f,m){T0=!1;var v=a.updateQueue;$o=!1;var y=v.firstBaseUpdate,C=v.lastBaseUpdate,P=v.shared.pending;if(P!==null){v.shared.pending=null;var W=P,te=W.next;W.next=null,C===null?y=te:C.next=te,C=W;var se=a.alternate;se!==null&&(se=se.updateQueue,P=se.lastBaseUpdate,P!==C&&(P===null?se.firstBaseUpdate=te:P.next=te,se.lastBaseUpdate=W))}if(y!==null){var le=v.baseState;C=0,se=te=W=null,P=y;do{var ie=P.lane&-536870913,ne=ie!==P.lane;if(ne?(Ke&ie)===ie:(m&ie)===ie){ie!==0&&ie===nc&&(T0=!0),se!==null&&(se=se.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var we=a,Qe=P;ie=h;var gt=f;switch(Qe.tag){case 1:if(we=Qe.payload,typeof we=="function"){le=we.call(gt,le,ie);break e}le=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Qe.payload,ie=typeof we=="function"?we.call(gt,le,ie):we,ie==null)break e;le=p({},le,ie);break e;case 2:$o=!0}}ie=P.callback,ie!==null&&(a.flags|=64,ne&&(a.flags|=8192),ne=v.callbacks,ne===null?v.callbacks=[ie]:ne.push(ie))}else ne={lane:ie,tag:P.tag,payload:P.payload,callback:P.callback,next:null},se===null?(te=se=ne,W=le):se=se.next=ne,C|=ie;if(P=P.next,P===null){if(P=v.shared.pending,P===null)break;ne=P,P=ne.next,ne.next=null,v.lastBaseUpdate=ne,v.shared.pending=null}}while(!0);se===null&&(W=le),v.baseState=W,v.firstBaseUpdate=te,v.lastBaseUpdate=se,y===null&&(v.shared.lanes=0),Zo|=C,a.lanes=C,a.memoizedState=le}}function pk(a,h){if(typeof a!="function")throw Error(n(191,a));a.call(h)}function mk(a,h){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;a<f.length;a++)pk(f[a],h)}var ac=V(null),ep=V(0);function gk(a,h){a=Jr,L(ep,a),L(ac,h),Jr=a|h.baseLanes}function A0(){L(ep,Jr),L(ac,ac.current)}function E0(){Jr=ep.current,J(ac),J(ep)}var Zn=V(null),ms=null;function jo(a){var h=a.alternate;L(Ht,Ht.current&1),L(Zn,a),ms===null&&(h===null||ac.current!==null||h.memoizedState!==null)&&(ms=a)}function M0(a){L(Ht,Ht.current),L(Zn,a),ms===null&&(ms=a)}function Ok(a){a.tag===22?(L(Ht,Ht.current),L(Zn,a),ms===null&&(ms=a)):Io()}function Io(){L(Ht,Ht.current),L(Zn,Zn.current)}function qn(a){J(Zn),ms===a&&(ms=null),J(Ht)}var Ht=V(0);function tp(a){for(var h=a;h!==null;){if(h.tag===13){var f=h.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||Bv(f)||$v(f)))return h}else if(h.tag===19&&(h.memoizedProps.revealOrder==="forwards"||h.memoizedProps.revealOrder==="backwards"||h.memoizedProps.revealOrder==="unstable_legacy-backwards"||h.memoizedProps.revealOrder==="together")){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===a)break;for(;h.sibling===null;){if(h.return===null||h.return===a)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var qr=0,Ve=null,pt=null,ii=null,ip=!1,lc=!1,Fa=!1,np=0,Jh=0,cc=null,A8=0;function jt(){throw Error(n(321))}function P0(a,h){if(h===null)return!1;for(var f=0;f<h.length&&f<a.length;f++)if(!Vn(a[f],h[f]))return!1;return!0}function R0(a,h,f,m,v,y){return qr=y,Ve=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,B.H=a===null||a.memoizedState===null?e2:U0,Fa=!1,y=f(m,v),Fa=!1,lc&&(y=_k(h,f,m,v)),vk(a),y}function vk(a){B.H=iu;var h=pt!==null&&pt.next!==null;if(qr=0,ii=pt=Ve=null,ip=!1,Jh=0,cc=null,h)throw Error(n(300));a===null||ni||(a=a.dependencies,a!==null&&Ud(a)&&(ni=!0))}function _k(a,h,f,m){Ve=a;var v=0;do{if(lc&&(cc=null),Jh=0,lc=!1,25<=v)throw Error(n(301));if(v+=1,ii=pt=null,a.updateQueue!=null){var y=a.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}B.H=t2,y=h(f,m)}while(lc);return y}function E8(){var a=B.H,h=a.useState()[0];return h=typeof h.then=="function"?eu(h):h,a=a.useState()[0],(pt!==null?pt.memoizedState:null)!==a&&(Ve.flags|=1024),h}function Q0(){var a=np!==0;return np=0,a}function L0(a,h,f){h.updateQueue=a.updateQueue,h.flags&=-2053,a.lanes&=~f}function D0(a){if(ip){for(a=a.memoizedState;a!==null;){var h=a.queue;h!==null&&(h.pending=null),a=a.next}ip=!1}qr=0,ii=pt=Ve=null,lc=!1,Jh=np=0,cc=null}function un(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ii===null?Ve.memoizedState=ii=a:ii=ii.next=a,ii}function Ft(){if(pt===null){var a=Ve.alternate;a=a!==null?a.memoizedState:null}else a=pt.next;var h=ii===null?Ve.memoizedState:ii.next;if(h!==null)ii=h,pt=a;else{if(a===null)throw Ve.alternate===null?Error(n(467)):Error(n(310));pt=a,a={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},ii===null?Ve.memoizedState=ii=a:ii=ii.next=a}return ii}function sp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function eu(a){var h=Jh;return Jh+=1,cc===null&&(cc=[]),a=ck(cc,a,h),h=Ve,(ii===null?h.memoizedState:ii.next)===null&&(h=h.alternate,B.H=h===null||h.memoizedState===null?e2:U0),a}function rp(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return eu(a);if(a.$$typeof===k)return ji(a)}throw Error(n(438,String(a)))}function B0(a){var h=null,f=Ve.updateQueue;if(f!==null&&(h=f.memoCache),h==null){var m=Ve.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(h={data:m.data.map(function(v){return v.slice()}),index:0})))}if(h==null&&(h={data:[],index:0}),f===null&&(f=sp(),Ve.updateQueue=f),f.memoCache=h,f=h.data[h.index],f===void 0)for(f=h.data[h.index]=Array(a),m=0;m<a;m++)f[m]=G;return h.index++,f}function Wr(a,h){return typeof h=="function"?h(a):h}function op(a){var h=Ft();return $0(h,pt,a)}function $0(a,h,f){var m=a.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=f;var v=a.baseQueue,y=m.pending;if(y!==null){if(v!==null){var C=v.next;v.next=y.next,y.next=C}h.baseQueue=v=y,m.pending=null}if(y=a.baseState,v===null)a.memoizedState=y;else{h=v.next;var P=C=null,W=null,te=h,se=!1;do{var le=te.lane&-536870913;if(le!==te.lane?(Ke&le)===le:(qr&le)===le){var ie=te.revertLane;if(ie===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),le===nc&&(se=!0);else if((qr&ie)===ie){te=te.next,ie===nc&&(se=!0);continue}else le={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},W===null?(P=W=le,C=y):W=W.next=le,Ve.lanes|=ie,Zo|=ie;le=te.action,Fa&&f(y,le),y=te.hasEagerState?te.eagerState:f(y,le)}else ie={lane:le,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},W===null?(P=W=ie,C=y):W=W.next=ie,Ve.lanes|=le,Zo|=le;te=te.next}while(te!==null&&te!==h);if(W===null?C=y:W.next=P,!Vn(y,a.memoizedState)&&(ni=!0,se&&(f=sc,f!==null)))throw f;a.memoizedState=y,a.baseState=C,a.baseQueue=W,m.lastRenderedState=y}return v===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function N0(a){var h=Ft(),f=h.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var m=f.dispatch,v=f.pending,y=h.memoizedState;if(v!==null){f.pending=null;var C=v=v.next;do y=a(y,C.action),C=C.next;while(C!==v);Vn(y,h.memoizedState)||(ni=!0),h.memoizedState=y,h.baseQueue===null&&(h.baseState=y),f.lastRenderedState=y}return[y,m]}function yk(a,h,f){var m=Ve,v=Ft(),y=tt;if(y){if(f===void 0)throw Error(n(407));f=f()}else f=h();var C=!Vn((pt||v).memoizedState,f);if(C&&(v.memoizedState=f,ni=!0),v=v.queue,I0(Sk.bind(null,m,v,a),[a]),v.getSnapshot!==h||C||ii!==null&&ii.memoizedState.tag&1){if(m.flags|=2048,hc(9,{destroy:void 0},xk.bind(null,m,v,f,h),null),yt===null)throw Error(n(349));y||(qr&127)!==0||bk(m,h,f)}return f}function bk(a,h,f){a.flags|=16384,a={getSnapshot:h,value:f},h=Ve.updateQueue,h===null?(h=sp(),Ve.updateQueue=h,h.stores=[a]):(f=h.stores,f===null?h.stores=[a]:f.push(a))}function xk(a,h,f,m){h.value=f,h.getSnapshot=m,wk(h)&&Ck(a)}function Sk(a,h,f){return f(function(){wk(h)&&Ck(a)})}function wk(a){var h=a.getSnapshot;a=a.value;try{var f=h();return!Vn(a,f)}catch{return!0}}function Ck(a){var h=Ia(a,2);h!==null&&En(h,a,2)}function z0(a){var h=un();if(typeof a=="function"){var f=a;if(a=f(),Fa){xn(!0);try{f()}finally{xn(!1)}}}return h.memoizedState=h.baseState=a,h.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:a},h}function kk(a,h,f,m){return a.baseState=f,$0(a,pt,typeof m=="function"?m:Wr)}function M8(a,h,f,m,v){if(cp(a))throw Error(n(485));if(a=h.action,a!==null){var y={payload:v,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){y.listeners.push(C)}};B.T!==null?f(!0):y.isTransition=!1,m(y),f=h.pending,f===null?(y.next=h.pending=y,Tk(h,y)):(y.next=f.next,h.pending=f.next=y)}}function Tk(a,h){var f=h.action,m=h.payload,v=a.state;if(h.isTransition){var y=B.T,C={};B.T=C;try{var P=f(v,m),W=B.S;W!==null&&W(C,P),Ak(a,h,P)}catch(te){j0(a,h,te)}finally{y!==null&&C.types!==null&&(y.types=C.types),B.T=y}}else try{y=f(v,m),Ak(a,h,y)}catch(te){j0(a,h,te)}}function Ak(a,h,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(m){Ek(a,h,m)},function(m){return j0(a,h,m)}):Ek(a,h,f)}function Ek(a,h,f){h.status="fulfilled",h.value=f,Mk(h),a.state=f,h=a.pending,h!==null&&(f=h.next,f===h?a.pending=null:(f=f.next,h.next=f,Tk(a,f)))}function j0(a,h,f){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do h.status="rejected",h.reason=f,Mk(h),h=h.next;while(h!==m)}a.action=null}function Mk(a){a=a.listeners;for(var h=0;h<a.length;h++)(0,a[h])()}function Pk(a,h){return h}function Rk(a,h){if(tt){var f=yt.formState;if(f!==null){e:{var m=Ve;if(tt){if(At){t:{for(var v=At,y=ps;v.nodeType!==8;){if(!y){v=null;break t}if(v=gs(v.nextSibling),v===null){v=null;break t}}y=v.data,v=y==="F!"||y==="F"?v:null}if(v){At=gs(v.nextSibling),m=v.data==="F!";break e}}Do(m)}m=!1}m&&(h=f[0])}}return f=un(),f.memoizedState=f.baseState=h,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pk,lastRenderedState:h},f.queue=m,f=Gk.bind(null,Ve,m),m.dispatch=f,m=z0(!1),y=W0.bind(null,Ve,!1,m.queue),m=un(),v={state:h,dispatch:null,action:a,pending:null},m.queue=v,f=M8.bind(null,Ve,v,y,f),v.dispatch=f,m.memoizedState=a,[h,f,!1]}function Qk(a){var h=Ft();return Lk(h,pt,a)}function Lk(a,h,f){if(h=$0(a,h,Pk)[0],a=op(Wr)[0],typeof h=="object"&&h!==null&&typeof h.then=="function")try{var m=eu(h)}catch(C){throw C===rc?Fd:C}else m=h;h=Ft();var v=h.queue,y=v.dispatch;return f!==h.memoizedState&&(Ve.flags|=2048,hc(9,{destroy:void 0},P8.bind(null,v,f),null)),[m,y,a]}function P8(a,h){a.action=h}function Dk(a){var h=Ft(),f=pt;if(f!==null)return Lk(h,f,a);Ft(),h=h.memoizedState,f=Ft();var m=f.queue.dispatch;return f.memoizedState=a,[h,m,!1]}function hc(a,h,f,m){return a={tag:a,create:f,deps:m,inst:h,next:null},h=Ve.updateQueue,h===null&&(h=sp(),Ve.updateQueue=h),f=h.lastEffect,f===null?h.lastEffect=a.next=a:(m=f.next,f.next=a,a.next=m,h.lastEffect=a),a}function Bk(){return Ft().memoizedState}function ap(a,h,f,m){var v=un();Ve.flags|=a,v.memoizedState=hc(1|h,{destroy:void 0},f,m===void 0?null:m)}function lp(a,h,f,m){var v=Ft();m=m===void 0?null:m;var y=v.memoizedState.inst;pt!==null&&m!==null&&P0(m,pt.memoizedState.deps)?v.memoizedState=hc(h,y,f,m):(Ve.flags|=a,v.memoizedState=hc(1|h,y,f,m))}function $k(a,h){ap(8390656,8,a,h)}function I0(a,h){lp(2048,8,a,h)}function R8(a){Ve.flags|=4;var h=Ve.updateQueue;if(h===null)h=sp(),Ve.updateQueue=h,h.events=[a];else{var f=h.events;f===null?h.events=[a]:f.push(a)}}function Nk(a){var h=Ft().memoizedState;return R8({ref:h,nextImpl:a}),function(){if((ot&2)!==0)throw Error(n(440));return h.impl.apply(void 0,arguments)}}function zk(a,h){return lp(4,2,a,h)}function jk(a,h){return lp(4,4,a,h)}function Ik(a,h){if(typeof h=="function"){a=a();var f=h(a);return function(){typeof f=="function"?f():h(null)}}if(h!=null)return a=a(),h.current=a,function(){h.current=null}}function Vk(a,h,f){f=f!=null?f.concat([a]):null,lp(4,4,Ik.bind(null,h,a),f)}function V0(){}function Xk(a,h){var f=Ft();h=h===void 0?null:h;var m=f.memoizedState;return h!==null&&P0(h,m[1])?m[0]:(f.memoizedState=[a,h],a)}function Zk(a,h){var f=Ft();h=h===void 0?null:h;var m=f.memoizedState;if(h!==null&&P0(h,m[1]))return m[0];if(m=a(),Fa){xn(!0);try{a()}finally{xn(!1)}}return f.memoizedState=[m,h],m}function X0(a,h,f){return f===void 0||(qr&1073741824)!==0&&(Ke&261930)===0?a.memoizedState=h:(a.memoizedState=f,a=q2(),Ve.lanes|=a,Zo|=a,f)}function qk(a,h,f,m){return Vn(f,h)?f:ac.current!==null?(a=X0(a,f,m),Vn(a,h)||(ni=!0),a):(qr&42)===0||(qr&1073741824)!==0&&(Ke&261930)===0?(ni=!0,a.memoizedState=f):(a=q2(),Ve.lanes|=a,Zo|=a,h)}function Wk(a,h,f,m,v){var y=Z.p;Z.p=y!==0&&8>y?y:8;var C=B.T,P={};B.T=P,W0(a,!1,h,f);try{var W=v(),te=B.S;if(te!==null&&te(P,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var se=T8(W,m);tu(a,h,se,Yn(a))}else tu(a,h,m,Yn(a))}catch(le){tu(a,h,{then:function(){},status:"rejected",reason:le},Yn())}finally{Z.p=y,C!==null&&P.types!==null&&(C.types=P.types),B.T=C}}function Q8(){}function Z0(a,h,f,m){if(a.tag!==5)throw Error(n(476));var v=Uk(a).queue;Wk(a,v,h,H,f===null?Q8:function(){return Yk(a),f(m)})}function Uk(a){var h=a.memoizedState;if(h!==null)return h;h={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:H},next:null};var f={};return h.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:f},next:null},a.memoizedState=h,a=a.alternate,a!==null&&(a.memoizedState=h),h}function Yk(a){var h=Uk(a);h.next===null&&(h=a.alternate.memoizedState),tu(a,h.next.queue,{},Yn())}function q0(){return ji(vu)}function Hk(){return Ft().memoizedState}function Fk(){return Ft().memoizedState}function L8(a){for(var h=a.return;h!==null;){switch(h.tag){case 24:case 3:var f=Yn();a=No(f);var m=zo(h,a,f);m!==null&&(En(m,h,f),Fh(m,h,f)),h={cache:y0()},a.payload=h;return}h=h.return}}function D8(a,h,f){var m=Yn();f={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},cp(a)?Kk(h,f):(f=c0(a,h,f,m),f!==null&&(En(f,a,m),Jk(f,h,m)))}function Gk(a,h,f){var m=Yn();tu(a,h,f,m)}function tu(a,h,f,m){var v={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(cp(a))Kk(h,v);else{var y=a.alternate;if(a.lanes===0&&(y===null||y.lanes===0)&&(y=h.lastRenderedReducer,y!==null))try{var C=h.lastRenderedState,P=y(C,f);if(v.hasEagerState=!0,v.eagerState=P,Vn(P,C))return Xd(a,h,v,0),yt===null&&Vd(),!1}catch{}finally{}if(f=c0(a,h,v,m),f!==null)return En(f,a,m),Jk(f,h,m),!0}return!1}function W0(a,h,f,m){if(m={lane:2,revertLane:wv(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},cp(a)){if(h)throw Error(n(479))}else h=c0(a,f,m,2),h!==null&&En(h,a,2)}function cp(a){var h=a.alternate;return a===Ve||h!==null&&h===Ve}function Kk(a,h){lc=ip=!0;var f=a.pending;f===null?h.next=h:(h.next=f.next,f.next=h),a.pending=h}function Jk(a,h,f){if((f&4194048)!==0){var m=h.lanes;m&=a.pendingLanes,f|=m,h.lanes=f,sC(a,f)}}var iu={readContext:ji,use:rp,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};iu.useEffectEvent=jt;var e2={readContext:ji,use:rp,useCallback:function(a,h){return un().memoizedState=[a,h===void 0?null:h],a},useContext:ji,useEffect:$k,useImperativeHandle:function(a,h,f){f=f!=null?f.concat([a]):null,ap(4194308,4,Ik.bind(null,h,a),f)},useLayoutEffect:function(a,h){return ap(4194308,4,a,h)},useInsertionEffect:function(a,h){ap(4,2,a,h)},useMemo:function(a,h){var f=un();h=h===void 0?null:h;var m=a();if(Fa){xn(!0);try{a()}finally{xn(!1)}}return f.memoizedState=[m,h],m},useReducer:function(a,h,f){var m=un();if(f!==void 0){var v=f(h);if(Fa){xn(!0);try{f(h)}finally{xn(!1)}}}else v=h;return m.memoizedState=m.baseState=v,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:v},m.queue=a,a=a.dispatch=D8.bind(null,Ve,a),[m.memoizedState,a]},useRef:function(a){var h=un();return a={current:a},h.memoizedState=a},useState:function(a){a=z0(a);var h=a.queue,f=Gk.bind(null,Ve,h);return h.dispatch=f,[a.memoizedState,f]},useDebugValue:V0,useDeferredValue:function(a,h){var f=un();return X0(f,a,h)},useTransition:function(){var a=z0(!1);return a=Wk.bind(null,Ve,a.queue,!0,!1),un().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,h,f){var m=Ve,v=un();if(tt){if(f===void 0)throw Error(n(407));f=f()}else{if(f=h(),yt===null)throw Error(n(349));(Ke&127)!==0||bk(m,h,f)}v.memoizedState=f;var y={value:f,getSnapshot:h};return v.queue=y,$k(Sk.bind(null,m,y,a),[a]),m.flags|=2048,hc(9,{destroy:void 0},xk.bind(null,m,y,f,h),null),f},useId:function(){var a=un(),h=yt.identifierPrefix;if(tt){var f=tr,m=er;f=(m&~(1<<32-_t(m)-1)).toString(32)+f,h="_"+h+"R_"+f,f=np++,0<f&&(h+="H"+f.toString(32)),h+="_"}else f=A8++,h="_"+h+"r_"+f.toString(32)+"_";return a.memoizedState=h},useHostTransitionStatus:q0,useFormState:Rk,useActionState:Rk,useOptimistic:function(a){var h=un();h.memoizedState=h.baseState=a;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return h.queue=f,h=W0.bind(null,Ve,!0,f),f.dispatch=h,[a,h]},useMemoCache:B0,useCacheRefresh:function(){return un().memoizedState=L8.bind(null,Ve)},useEffectEvent:function(a){var h=un(),f={impl:a};return h.memoizedState=f,function(){if((ot&2)!==0)throw Error(n(440));return f.impl.apply(void 0,arguments)}}},U0={readContext:ji,use:rp,useCallback:Xk,useContext:ji,useEffect:I0,useImperativeHandle:Vk,useInsertionEffect:zk,useLayoutEffect:jk,useMemo:Zk,useReducer:op,useRef:Bk,useState:function(){return op(Wr)},useDebugValue:V0,useDeferredValue:function(a,h){var f=Ft();return qk(f,pt.memoizedState,a,h)},useTransition:function(){var a=op(Wr)[0],h=Ft().memoizedState;return[typeof a=="boolean"?a:eu(a),h]},useSyncExternalStore:yk,useId:Hk,useHostTransitionStatus:q0,useFormState:Qk,useActionState:Qk,useOptimistic:function(a,h){var f=Ft();return kk(f,pt,a,h)},useMemoCache:B0,useCacheRefresh:Fk};U0.useEffectEvent=Nk;var t2={readContext:ji,use:rp,useCallback:Xk,useContext:ji,useEffect:I0,useImperativeHandle:Vk,useInsertionEffect:zk,useLayoutEffect:jk,useMemo:Zk,useReducer:N0,useRef:Bk,useState:function(){return N0(Wr)},useDebugValue:V0,useDeferredValue:function(a,h){var f=Ft();return pt===null?X0(f,a,h):qk(f,pt.memoizedState,a,h)},useTransition:function(){var a=N0(Wr)[0],h=Ft().memoizedState;return[typeof a=="boolean"?a:eu(a),h]},useSyncExternalStore:yk,useId:Hk,useHostTransitionStatus:q0,useFormState:Dk,useActionState:Dk,useOptimistic:function(a,h){var f=Ft();return pt!==null?kk(f,pt,a,h):(f.baseState=a,[a,f.queue.dispatch])},useMemoCache:B0,useCacheRefresh:Fk};t2.useEffectEvent=Nk;function Y0(a,h,f,m){h=a.memoizedState,f=f(m,h),f=f==null?h:p({},h,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var H0={enqueueSetState:function(a,h,f){a=a._reactInternals;var m=Yn(),v=No(m);v.payload=h,f!=null&&(v.callback=f),h=zo(a,v,m),h!==null&&(En(h,a,m),Fh(h,a,m))},enqueueReplaceState:function(a,h,f){a=a._reactInternals;var m=Yn(),v=No(m);v.tag=1,v.payload=h,f!=null&&(v.callback=f),h=zo(a,v,m),h!==null&&(En(h,a,m),Fh(h,a,m))},enqueueForceUpdate:function(a,h){a=a._reactInternals;var f=Yn(),m=No(f);m.tag=2,h!=null&&(m.callback=h),h=zo(a,m,f),h!==null&&(En(h,a,f),Fh(h,a,f))}};function i2(a,h,f,m,v,y,C){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,y,C):h.prototype&&h.prototype.isPureReactComponent?!Vh(f,m)||!Vh(v,y):!0}function n2(a,h,f,m){a=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(f,m),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(f,m),h.state!==a&&H0.enqueueReplaceState(h,h.state,null)}function Ga(a,h){var f=h;if("ref"in h){f={};for(var m in h)m!=="ref"&&(f[m]=h[m])}if(a=a.defaultProps){f===h&&(f=p({},f));for(var v in a)f[v]===void 0&&(f[v]=a[v])}return f}function s2(a){Id(a)}function r2(a){console.error(a)}function o2(a){Id(a)}function hp(a,h){try{var f=a.onUncaughtError;f(h.value,{componentStack:h.stack})}catch(m){setTimeout(function(){throw m})}}function a2(a,h,f){try{var m=a.onCaughtError;m(f.value,{componentStack:f.stack,errorBoundary:h.tag===1?h.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function F0(a,h,f){return f=No(f),f.tag=3,f.payload={element:null},f.callback=function(){hp(a,h)},f}function l2(a){return a=No(a),a.tag=3,a}function c2(a,h,f,m){var v=f.type.getDerivedStateFromError;if(typeof v=="function"){var y=m.value;a.payload=function(){return v(y)},a.callback=function(){a2(h,f,m)}}var C=f.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(a.callback=function(){a2(h,f,m),typeof v!="function"&&(qo===null?qo=new Set([this]):qo.add(this));var P=m.stack;this.componentDidCatch(m.value,{componentStack:P!==null?P:""})})}function B8(a,h,f,m,v){if(f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(h=f.alternate,h!==null&&ic(h,f,v,!0),f=Zn.current,f!==null){switch(f.tag){case 31:case 13:return ms===null?xp():f.alternate===null&&It===0&&(It=3),f.flags&=-257,f.flags|=65536,f.lanes=v,m===Gd?f.flags|=16384:(h=f.updateQueue,h===null?f.updateQueue=new Set([m]):h.add(m),bv(a,m,v)),!1;case 22:return f.flags|=65536,m===Gd?f.flags|=16384:(h=f.updateQueue,h===null?(h={transitions:null,markerInstances:null,retryQueue:new Set([m])},f.updateQueue=h):(f=h.retryQueue,f===null?h.retryQueue=new Set([m]):f.add(m)),bv(a,m,v)),!1}throw Error(n(435,f.tag))}return bv(a,m,v),xp(),!1}if(tt)return h=Zn.current,h!==null?((h.flags&65536)===0&&(h.flags|=256),h.flags|=65536,h.lanes=v,m!==m0&&(a=Error(n(422),{cause:m}),qh(us(a,f)))):(m!==m0&&(h=Error(n(423),{cause:m}),qh(us(h,f))),a=a.current.alternate,a.flags|=65536,v&=-v,a.lanes|=v,m=us(m,f),v=F0(a.stateNode,m,v),k0(a,v),It!==4&&(It=2)),!1;var y=Error(n(520),{cause:m});if(y=us(y,f),hu===null?hu=[y]:hu.push(y),It!==4&&(It=2),h===null)return!0;m=us(m,f),f=h;do{switch(f.tag){case 3:return f.flags|=65536,a=v&-v,f.lanes|=a,a=F0(f.stateNode,m,a),k0(f,a),!1;case 1:if(h=f.type,y=f.stateNode,(f.flags&128)===0&&(typeof h.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(qo===null||!qo.has(y))))return f.flags|=65536,v&=-v,f.lanes|=v,v=l2(v),c2(v,a,f,m),k0(f,v),!1}f=f.return}while(f!==null);return!1}var G0=Error(n(461)),ni=!1;function Ii(a,h,f,m){h.child=a===null?dk(h,null,f,m):Ha(h,a.child,f,m)}function h2(a,h,f,m,v){f=f.render;var y=h.ref;if("ref"in m){var C={};for(var P in m)P!=="ref"&&(C[P]=m[P])}else C=m;return qa(h),m=R0(a,h,f,C,y,v),P=Q0(),a!==null&&!ni?(L0(a,h,v),Ur(a,h,v)):(tt&&P&&d0(h),h.flags|=1,Ii(a,h,m,v),h.child)}function u2(a,h,f,m,v){if(a===null){var y=f.type;return typeof y=="function"&&!h0(y)&&y.defaultProps===void 0&&f.compare===null?(h.tag=15,h.type=y,f2(a,h,y,m,v)):(a=qd(f.type,null,m,h,h.mode,v),a.ref=h.ref,a.return=h,h.child=a)}if(y=a.child,!rv(a,v)){var C=y.memoizedProps;if(f=f.compare,f=f!==null?f:Vh,f(C,m)&&a.ref===h.ref)return Ur(a,h,v)}return h.flags|=1,a=Ir(y,m),a.ref=h.ref,a.return=h,h.child=a}function f2(a,h,f,m,v){if(a!==null){var y=a.memoizedProps;if(Vh(y,m)&&a.ref===h.ref)if(ni=!1,h.pendingProps=m=y,rv(a,v))(a.flags&131072)!==0&&(ni=!0);else return h.lanes=a.lanes,Ur(a,h,v)}return K0(a,h,f,m,v)}function d2(a,h,f,m){var v=m.children,y=a!==null?a.memoizedState:null;if(a===null&&h.stateNode===null&&(h.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((h.flags&128)!==0){if(y=y!==null?y.baseLanes|f:f,a!==null){for(m=h.child=a.child,v=0;m!==null;)v=v|m.lanes|m.childLanes,m=m.sibling;m=v&~y}else m=0,h.child=null;return p2(a,h,y,f,m)}if((f&536870912)!==0)h.memoizedState={baseLanes:0,cachePool:null},a!==null&&Hd(h,y!==null?y.cachePool:null),y!==null?gk(h,y):A0(),Ok(h);else return m=h.lanes=536870912,p2(a,h,y!==null?y.baseLanes|f:f,f,m)}else y!==null?(Hd(h,y.cachePool),gk(h,y),Io(),h.memoizedState=null):(a!==null&&Hd(h,null),A0(),Io());return Ii(a,h,v,f),h.child}function nu(a,h){return a!==null&&a.tag===22||h.stateNode!==null||(h.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.sibling}function p2(a,h,f,m,v){var y=x0();return y=y===null?null:{parent:ti._currentValue,pool:y},h.memoizedState={baseLanes:f,cachePool:y},a!==null&&Hd(h,null),A0(),Ok(h),a!==null&&ic(a,h,m,!0),h.childLanes=v,null}function up(a,h){return h=dp({mode:h.mode,children:h.children},a.mode),h.ref=a.ref,a.child=h,h.return=a,h}function m2(a,h,f){return Ha(h,a.child,null,f),a=up(h,h.pendingProps),a.flags|=2,qn(h),h.memoizedState=null,a}function $8(a,h,f){var m=h.pendingProps,v=(h.flags&128)!==0;if(h.flags&=-129,a===null){if(tt){if(m.mode==="hidden")return a=up(h,m),h.lanes=536870912,nu(null,a);if(M0(h),(a=At)?(a=T5(a,ps),a=a!==null&&a.data==="&"?a:null,a!==null&&(h.memoizedState={dehydrated:a,treeContext:Qo!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},f=KC(a),f.return=h,h.child=f,zi=h,At=null)):a=null,a===null)throw Do(h);return h.lanes=536870912,null}return up(h,m)}var y=a.memoizedState;if(y!==null){var C=y.dehydrated;if(M0(h),v)if(h.flags&256)h.flags&=-257,h=m2(a,h,f);else if(h.memoizedState!==null)h.child=a.child,h.flags|=128,h=null;else throw Error(n(558));else if(ni||ic(a,h,f,!1),v=(f&a.childLanes)!==0,ni||v){if(m=yt,m!==null&&(C=rC(m,f),C!==0&&C!==y.retryLane))throw y.retryLane=C,Ia(a,C),En(m,a,C),G0;xp(),h=m2(a,h,f)}else a=y.treeContext,At=gs(C.nextSibling),zi=h,tt=!0,Lo=null,ps=!1,a!==null&&tk(h,a),h=up(h,m),h.flags|=4096;return h}return a=Ir(a.child,{mode:m.mode,children:m.children}),a.ref=h.ref,h.child=a,a.return=h,a}function fp(a,h){var f=h.ref;if(f===null)a!==null&&a.ref!==null&&(h.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(n(284));(a===null||a.ref!==f)&&(h.flags|=4194816)}}function K0(a,h,f,m,v){return qa(h),f=R0(a,h,f,m,void 0,v),m=Q0(),a!==null&&!ni?(L0(a,h,v),Ur(a,h,v)):(tt&&m&&d0(h),h.flags|=1,Ii(a,h,f,v),h.child)}function g2(a,h,f,m,v,y){return qa(h),h.updateQueue=null,f=_k(h,m,f,v),vk(a),m=Q0(),a!==null&&!ni?(L0(a,h,y),Ur(a,h,y)):(tt&&m&&d0(h),h.flags|=1,Ii(a,h,f,y),h.child)}function O2(a,h,f,m,v){if(qa(h),h.stateNode===null){var y=Kl,C=f.contextType;typeof C=="object"&&C!==null&&(y=ji(C)),y=new f(m,y),h.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=H0,h.stateNode=y,y._reactInternals=h,y=h.stateNode,y.props=m,y.state=h.memoizedState,y.refs={},w0(h),C=f.contextType,y.context=typeof C=="object"&&C!==null?ji(C):Kl,y.state=h.memoizedState,C=f.getDerivedStateFromProps,typeof C=="function"&&(Y0(h,f,C,m),y.state=h.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(C=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),C!==y.state&&H0.enqueueReplaceState(y,y.state,null),Kh(h,m,y,v),Gh(),y.state=h.memoizedState),typeof y.componentDidMount=="function"&&(h.flags|=4194308),m=!0}else if(a===null){y=h.stateNode;var P=h.memoizedProps,W=Ga(f,P);y.props=W;var te=y.context,se=f.contextType;C=Kl,typeof se=="object"&&se!==null&&(C=ji(se));var le=f.getDerivedStateFromProps;se=typeof le=="function"||typeof y.getSnapshotBeforeUpdate=="function",P=h.pendingProps!==P,se||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(P||te!==C)&&n2(h,y,m,C),$o=!1;var ie=h.memoizedState;y.state=ie,Kh(h,m,y,v),Gh(),te=h.memoizedState,P||ie!==te||$o?(typeof le=="function"&&(Y0(h,f,le,m),te=h.memoizedState),(W=$o||i2(h,f,W,m,ie,te,C))?(se||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(h.flags|=4194308)):(typeof y.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=m,h.memoizedState=te),y.props=m,y.state=te,y.context=C,m=W):(typeof y.componentDidMount=="function"&&(h.flags|=4194308),m=!1)}else{y=h.stateNode,C0(a,h),C=h.memoizedProps,se=Ga(f,C),y.props=se,le=h.pendingProps,ie=y.context,te=f.contextType,W=Kl,typeof te=="object"&&te!==null&&(W=ji(te)),P=f.getDerivedStateFromProps,(te=typeof P=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(C!==le||ie!==W)&&n2(h,y,m,W),$o=!1,ie=h.memoizedState,y.state=ie,Kh(h,m,y,v),Gh();var ne=h.memoizedState;C!==le||ie!==ne||$o||a!==null&&a.dependencies!==null&&Ud(a.dependencies)?(typeof P=="function"&&(Y0(h,f,P,m),ne=h.memoizedState),(se=$o||i2(h,f,se,m,ie,ne,W)||a!==null&&a.dependencies!==null&&Ud(a.dependencies))?(te||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(m,ne,W),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(m,ne,W)),typeof y.componentDidUpdate=="function"&&(h.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof y.componentDidUpdate!="function"||C===a.memoizedProps&&ie===a.memoizedState||(h.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||C===a.memoizedProps&&ie===a.memoizedState||(h.flags|=1024),h.memoizedProps=m,h.memoizedState=ne),y.props=m,y.state=ne,y.context=W,m=se):(typeof y.componentDidUpdate!="function"||C===a.memoizedProps&&ie===a.memoizedState||(h.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||C===a.memoizedProps&&ie===a.memoizedState||(h.flags|=1024),m=!1)}return y=m,fp(a,h),m=(h.flags&128)!==0,y||m?(y=h.stateNode,f=m&&typeof f.getDerivedStateFromError!="function"?null:y.render(),h.flags|=1,a!==null&&m?(h.child=Ha(h,a.child,null,v),h.child=Ha(h,null,f,v)):Ii(a,h,f,v),h.memoizedState=y.state,a=h.child):a=Ur(a,h,v),a}function v2(a,h,f,m){return Xa(),h.flags|=256,Ii(a,h,f,m),h.child}var J0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ev(a){return{baseLanes:a,cachePool:ak()}}function tv(a,h,f){return a=a!==null?a.childLanes&~f:0,h&&(a|=Un),a}function _2(a,h,f){var m=h.pendingProps,v=!1,y=(h.flags&128)!==0,C;if((C=y)||(C=a!==null&&a.memoizedState===null?!1:(Ht.current&2)!==0),C&&(v=!0,h.flags&=-129),C=(h.flags&32)!==0,h.flags&=-33,a===null){if(tt){if(v?jo(h):Io(),(a=At)?(a=T5(a,ps),a=a!==null&&a.data!=="&"?a:null,a!==null&&(h.memoizedState={dehydrated:a,treeContext:Qo!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},f=KC(a),f.return=h,h.child=f,zi=h,At=null)):a=null,a===null)throw Do(h);return $v(a)?h.lanes=32:h.lanes=536870912,null}var P=m.children;return m=m.fallback,v?(Io(),v=h.mode,P=dp({mode:"hidden",children:P},v),m=Va(m,v,f,null),P.return=h,m.return=h,P.sibling=m,h.child=P,m=h.child,m.memoizedState=ev(f),m.childLanes=tv(a,C,f),h.memoizedState=J0,nu(null,m)):(jo(h),iv(h,P))}var W=a.memoizedState;if(W!==null&&(P=W.dehydrated,P!==null)){if(y)h.flags&256?(jo(h),h.flags&=-257,h=nv(a,h,f)):h.memoizedState!==null?(Io(),h.child=a.child,h.flags|=128,h=null):(Io(),P=m.fallback,v=h.mode,m=dp({mode:"visible",children:m.children},v),P=Va(P,v,f,null),P.flags|=2,m.return=h,P.return=h,m.sibling=P,h.child=m,Ha(h,a.child,null,f),m=h.child,m.memoizedState=ev(f),m.childLanes=tv(a,C,f),h.memoizedState=J0,h=nu(null,m));else if(jo(h),$v(P)){if(C=P.nextSibling&&P.nextSibling.dataset,C)var te=C.dgst;C=te,m=Error(n(419)),m.stack="",m.digest=C,qh({value:m,source:null,stack:null}),h=nv(a,h,f)}else if(ni||ic(a,h,f,!1),C=(f&a.childLanes)!==0,ni||C){if(C=yt,C!==null&&(m=rC(C,f),m!==0&&m!==W.retryLane))throw W.retryLane=m,Ia(a,m),En(C,a,m),G0;Bv(P)||xp(),h=nv(a,h,f)}else Bv(P)?(h.flags|=192,h.child=a.child,h=null):(a=W.treeContext,At=gs(P.nextSibling),zi=h,tt=!0,Lo=null,ps=!1,a!==null&&tk(h,a),h=iv(h,m.children),h.flags|=4096);return h}return v?(Io(),P=m.fallback,v=h.mode,W=a.child,te=W.sibling,m=Ir(W,{mode:"hidden",children:m.children}),m.subtreeFlags=W.subtreeFlags&65011712,te!==null?P=Ir(te,P):(P=Va(P,v,f,null),P.flags|=2),P.return=h,m.return=h,m.sibling=P,h.child=m,nu(null,m),m=h.child,P=a.child.memoizedState,P===null?P=ev(f):(v=P.cachePool,v!==null?(W=ti._currentValue,v=v.parent!==W?{parent:W,pool:W}:v):v=ak(),P={baseLanes:P.baseLanes|f,cachePool:v}),m.memoizedState=P,m.childLanes=tv(a,C,f),h.memoizedState=J0,nu(a.child,m)):(jo(h),f=a.child,a=f.sibling,f=Ir(f,{mode:"visible",children:m.children}),f.return=h,f.sibling=null,a!==null&&(C=h.deletions,C===null?(h.deletions=[a],h.flags|=16):C.push(a)),h.child=f,h.memoizedState=null,f)}function iv(a,h){return h=dp({mode:"visible",children:h},a.mode),h.return=a,a.child=h}function dp(a,h){return a=Xn(22,a,null,h),a.lanes=0,a}function nv(a,h,f){return Ha(h,a.child,null,f),a=iv(h,h.pendingProps.children),a.flags|=2,h.memoizedState=null,a}function y2(a,h,f){a.lanes|=h;var m=a.alternate;m!==null&&(m.lanes|=h),v0(a.return,h,f)}function sv(a,h,f,m,v,y){var C=a.memoizedState;C===null?a.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:v,treeForkCount:y}:(C.isBackwards=h,C.rendering=null,C.renderingStartTime=0,C.last=m,C.tail=f,C.tailMode=v,C.treeForkCount=y)}function b2(a,h,f){var m=h.pendingProps,v=m.revealOrder,y=m.tail;m=m.children;var C=Ht.current,P=(C&2)!==0;if(P?(C=C&1|2,h.flags|=128):C&=1,L(Ht,C),Ii(a,h,m,f),m=tt?Zh:0,!P&&a!==null&&(a.flags&128)!==0)e:for(a=h.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&y2(a,f,h);else if(a.tag===19)y2(a,f,h);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===h)break e;for(;a.sibling===null;){if(a.return===null||a.return===h)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(v){case"forwards":for(f=h.child,v=null;f!==null;)a=f.alternate,a!==null&&tp(a)===null&&(v=f),f=f.sibling;f=v,f===null?(v=h.child,h.child=null):(v=f.sibling,f.sibling=null),sv(h,!1,v,f,y,m);break;case"backwards":case"unstable_legacy-backwards":for(f=null,v=h.child,h.child=null;v!==null;){if(a=v.alternate,a!==null&&tp(a)===null){h.child=v;break}a=v.sibling,v.sibling=f,f=v,v=a}sv(h,!0,f,null,y,m);break;case"together":sv(h,!1,null,null,void 0,m);break;default:h.memoizedState=null}return h.child}function Ur(a,h,f){if(a!==null&&(h.dependencies=a.dependencies),Zo|=h.lanes,(f&h.childLanes)===0)if(a!==null){if(ic(a,h,f,!1),(f&h.childLanes)===0)return null}else return null;if(a!==null&&h.child!==a.child)throw Error(n(153));if(h.child!==null){for(a=h.child,f=Ir(a,a.pendingProps),h.child=f,f.return=h;a.sibling!==null;)a=a.sibling,f=f.sibling=Ir(a,a.pendingProps),f.return=h;f.sibling=null}return h.child}function rv(a,h){return(a.lanes&h)!==0?!0:(a=a.dependencies,!!(a!==null&&Ud(a)))}function N8(a,h,f){switch(h.tag){case 3:Ce(h,h.stateNode.containerInfo),Bo(h,ti,a.memoizedState.cache),Xa();break;case 27:case 5:nt(h);break;case 4:Ce(h,h.stateNode.containerInfo);break;case 10:Bo(h,h.type,h.memoizedProps.value);break;case 31:if(h.memoizedState!==null)return h.flags|=128,M0(h),null;break;case 13:var m=h.memoizedState;if(m!==null)return m.dehydrated!==null?(jo(h),h.flags|=128,null):(f&h.child.childLanes)!==0?_2(a,h,f):(jo(h),a=Ur(a,h,f),a!==null?a.sibling:null);jo(h);break;case 19:var v=(a.flags&128)!==0;if(m=(f&h.childLanes)!==0,m||(ic(a,h,f,!1),m=(f&h.childLanes)!==0),v){if(m)return b2(a,h,f);h.flags|=128}if(v=h.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),L(Ht,Ht.current),m)break;return null;case 22:return h.lanes=0,d2(a,h,f,h.pendingProps);case 24:Bo(h,ti,a.memoizedState.cache)}return Ur(a,h,f)}function x2(a,h,f){if(a!==null)if(a.memoizedProps!==h.pendingProps)ni=!0;else{if(!rv(a,f)&&(h.flags&128)===0)return ni=!1,N8(a,h,f);ni=(a.flags&131072)!==0}else ni=!1,tt&&(h.flags&1048576)!==0&&ek(h,Zh,h.index);switch(h.lanes=0,h.tag){case 16:e:{var m=h.pendingProps;if(a=Ua(h.elementType),h.type=a,typeof a=="function")h0(a)?(m=Ga(a,m),h.tag=1,h=O2(null,h,a,m,f)):(h.tag=0,h=K0(null,h,a,m,f));else{if(a!=null){var v=a.$$typeof;if(v===A){h.tag=11,h=h2(null,h,a,m,f);break e}else if(v===$){h.tag=14,h=u2(null,h,a,m,f);break e}}throw h=z(a)||a,Error(n(306,h,""))}}return h;case 0:return K0(a,h,h.type,h.pendingProps,f);case 1:return m=h.type,v=Ga(m,h.pendingProps),O2(a,h,m,v,f);case 3:e:{if(Ce(h,h.stateNode.containerInfo),a===null)throw Error(n(387));m=h.pendingProps;var y=h.memoizedState;v=y.element,C0(a,h),Kh(h,m,null,f);var C=h.memoizedState;if(m=C.cache,Bo(h,ti,m),m!==y.cache&&_0(h,[ti],f,!0),Gh(),m=C.element,y.isDehydrated)if(y={element:m,isDehydrated:!1,cache:C.cache},h.updateQueue.baseState=y,h.memoizedState=y,h.flags&256){h=v2(a,h,m,f);break e}else if(m!==v){v=us(Error(n(424)),h),qh(v),h=v2(a,h,m,f);break e}else{switch(a=h.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(At=gs(a.firstChild),zi=h,tt=!0,Lo=null,ps=!0,f=dk(h,null,m,f),h.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(Xa(),m===v){h=Ur(a,h,f);break e}Ii(a,h,m,f)}h=h.child}return h;case 26:return fp(a,h),a===null?(f=Q5(h.type,null,h.pendingProps,null))?h.memoizedState=f:tt||(f=h.type,a=h.pendingProps,m=Ep(fe.current).createElement(f),m[Ni]=h,m[Sn]=a,Vi(m,f,a),bi(m),h.stateNode=m):h.memoizedState=Q5(h.type,a.memoizedProps,h.pendingProps,a.memoizedState),null;case 27:return nt(h),a===null&&tt&&(m=h.stateNode=M5(h.type,h.pendingProps,fe.current),zi=h,ps=!0,v=At,Ho(h.type)?(Nv=v,At=gs(m.firstChild)):At=v),Ii(a,h,h.pendingProps.children,f),fp(a,h),a===null&&(h.flags|=4194304),h.child;case 5:return a===null&&tt&&((v=m=At)&&(m=pj(m,h.type,h.pendingProps,ps),m!==null?(h.stateNode=m,zi=h,At=gs(m.firstChild),ps=!1,v=!0):v=!1),v||Do(h)),nt(h),v=h.type,y=h.pendingProps,C=a!==null?a.memoizedProps:null,m=y.children,Qv(v,y)?m=null:C!==null&&Qv(v,C)&&(h.flags|=32),h.memoizedState!==null&&(v=R0(a,h,E8,null,null,f),vu._currentValue=v),fp(a,h),Ii(a,h,m,f),h.child;case 6:return a===null&&tt&&((a=f=At)&&(f=mj(f,h.pendingProps,ps),f!==null?(h.stateNode=f,zi=h,At=null,a=!0):a=!1),a||Do(h)),null;case 13:return _2(a,h,f);case 4:return Ce(h,h.stateNode.containerInfo),m=h.pendingProps,a===null?h.child=Ha(h,null,m,f):Ii(a,h,m,f),h.child;case 11:return h2(a,h,h.type,h.pendingProps,f);case 7:return Ii(a,h,h.pendingProps,f),h.child;case 8:return Ii(a,h,h.pendingProps.children,f),h.child;case 12:return Ii(a,h,h.pendingProps.children,f),h.child;case 10:return m=h.pendingProps,Bo(h,h.type,m.value),Ii(a,h,m.children,f),h.child;case 9:return v=h.type._context,m=h.pendingProps.children,qa(h),v=ji(v),m=m(v),h.flags|=1,Ii(a,h,m,f),h.child;case 14:return u2(a,h,h.type,h.pendingProps,f);case 15:return f2(a,h,h.type,h.pendingProps,f);case 19:return b2(a,h,f);case 31:return $8(a,h,f);case 22:return d2(a,h,f,h.pendingProps);case 24:return qa(h),m=ji(ti),a===null?(v=x0(),v===null&&(v=yt,y=y0(),v.pooledCache=y,y.refCount++,y!==null&&(v.pooledCacheLanes|=f),v=y),h.memoizedState={parent:m,cache:v},w0(h),Bo(h,ti,v)):((a.lanes&f)!==0&&(C0(a,h),Kh(h,null,null,f),Gh()),v=a.memoizedState,y=h.memoizedState,v.parent!==m?(v={parent:m,cache:m},h.memoizedState=v,h.lanes===0&&(h.memoizedState=h.updateQueue.baseState=v),Bo(h,ti,m)):(m=y.cache,Bo(h,ti,m),m!==v.cache&&_0(h,[ti],f,!0))),Ii(a,h,h.pendingProps.children,f),h.child;case 29:throw h.pendingProps}throw Error(n(156,h.tag))}function Yr(a){a.flags|=4}function ov(a,h,f,m,v){if((h=(a.mode&32)!==0)&&(h=!1),h){if(a.flags|=16777216,(v&335544128)===v)if(a.stateNode.complete)a.flags|=8192;else if(H2())a.flags|=8192;else throw Ya=Gd,S0}else a.flags&=-16777217}function S2(a,h){if(h.type!=="stylesheet"||(h.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!N5(h))if(H2())a.flags|=8192;else throw Ya=Gd,S0}function pp(a,h){h!==null&&(a.flags|=4),a.flags&16384&&(h=a.tag!==22?iC():536870912,a.lanes|=h,pc|=h)}function su(a,h){if(!tt)switch(a.tailMode){case"hidden":h=a.tail;for(var f=null;h!==null;)h.alternate!==null&&(f=h),h=h.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?h||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function Et(a){var h=a.alternate!==null&&a.alternate.child===a.child,f=0,m=0;if(h)for(var v=a.child;v!==null;)f|=v.lanes|v.childLanes,m|=v.subtreeFlags&65011712,m|=v.flags&65011712,v.return=a,v=v.sibling;else for(v=a.child;v!==null;)f|=v.lanes|v.childLanes,m|=v.subtreeFlags,m|=v.flags,v.return=a,v=v.sibling;return a.subtreeFlags|=m,a.childLanes=f,h}function z8(a,h,f){var m=h.pendingProps;switch(p0(h),h.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(h),null;case 1:return Et(h),null;case 3:return f=h.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),h.memoizedState.cache!==m&&(h.flags|=2048),Zr(ti),ye(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(a===null||a.child===null)&&(tc(h)?Yr(h):a===null||a.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,g0())),Et(h),null;case 26:var v=h.type,y=h.memoizedState;return a===null?(Yr(h),y!==null?(Et(h),S2(h,y)):(Et(h),ov(h,v,null,m,f))):y?y!==a.memoizedState?(Yr(h),Et(h),S2(h,y)):(Et(h),h.flags&=-16777217):(a=a.memoizedProps,a!==m&&Yr(h),Et(h),ov(h,v,a,m,f)),null;case 27:if(Qt(h),f=fe.current,v=h.type,a!==null&&h.stateNode!=null)a.memoizedProps!==m&&Yr(h);else{if(!m){if(h.stateNode===null)throw Error(n(166));return Et(h),null}a=ue.current,tc(h)?ik(h):(a=M5(v,m,f),h.stateNode=a,Yr(h))}return Et(h),null;case 5:if(Qt(h),v=h.type,a!==null&&h.stateNode!=null)a.memoizedProps!==m&&Yr(h);else{if(!m){if(h.stateNode===null)throw Error(n(166));return Et(h),null}if(y=ue.current,tc(h))ik(h);else{var C=Ep(fe.current);switch(y){case 1:y=C.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:y=C.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":y=C.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":y=C.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":y=C.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof m.is=="string"?C.createElement("select",{is:m.is}):C.createElement("select"),m.multiple?y.multiple=!0:m.size&&(y.size=m.size);break;default:y=typeof m.is=="string"?C.createElement(v,{is:m.is}):C.createElement(v)}}y[Ni]=h,y[Sn]=m;e:for(C=h.child;C!==null;){if(C.tag===5||C.tag===6)y.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===h)break e;for(;C.sibling===null;){if(C.return===null||C.return===h)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}h.stateNode=y;e:switch(Vi(y,v,m),v){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Yr(h)}}return Et(h),ov(h,h.type,a===null?null:a.memoizedProps,h.pendingProps,f),null;case 6:if(a&&h.stateNode!=null)a.memoizedProps!==m&&Yr(h);else{if(typeof m!="string"&&h.stateNode===null)throw Error(n(166));if(a=fe.current,tc(h)){if(a=h.stateNode,f=h.memoizedProps,m=null,v=zi,v!==null)switch(v.tag){case 27:case 5:m=v.memoizedProps}a[Ni]=h,a=!!(a.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||_5(a.nodeValue,f)),a||Do(h,!0)}else a=Ep(a).createTextNode(m),a[Ni]=h,h.stateNode=a}return Et(h),null;case 31:if(f=h.memoizedState,a===null||a.memoizedState!==null){if(m=tc(h),f!==null){if(a===null){if(!m)throw Error(n(318));if(a=h.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(557));a[Ni]=h}else Xa(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Et(h),a=!1}else f=g0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return h.flags&256?(qn(h),h):(qn(h),null);if((h.flags&128)!==0)throw Error(n(558))}return Et(h),null;case 13:if(m=h.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(v=tc(h),m!==null&&m.dehydrated!==null){if(a===null){if(!v)throw Error(n(318));if(v=h.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(n(317));v[Ni]=h}else Xa(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Et(h),v=!1}else v=g0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=v),v=!0;if(!v)return h.flags&256?(qn(h),h):(qn(h),null)}return qn(h),(h.flags&128)!==0?(h.lanes=f,h):(f=m!==null,a=a!==null&&a.memoizedState!==null,f&&(m=h.child,v=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(v=m.alternate.memoizedState.cachePool.pool),y=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(y=m.memoizedState.cachePool.pool),y!==v&&(m.flags|=2048)),f!==a&&f&&(h.child.flags|=8192),pp(h,h.updateQueue),Et(h),null);case 4:return ye(),a===null&&Av(h.stateNode.containerInfo),Et(h),null;case 10:return Zr(h.type),Et(h),null;case 19:if(J(Ht),m=h.memoizedState,m===null)return Et(h),null;if(v=(h.flags&128)!==0,y=m.rendering,y===null)if(v)su(m,!1);else{if(It!==0||a!==null&&(a.flags&128)!==0)for(a=h.child;a!==null;){if(y=tp(a),y!==null){for(h.flags|=128,su(m,!1),a=y.updateQueue,h.updateQueue=a,pp(h,a),h.subtreeFlags=0,a=f,f=h.child;f!==null;)GC(f,a),f=f.sibling;return L(Ht,Ht.current&1|2),tt&&Vr(h,m.treeForkCount),h.child}a=a.sibling}m.tail!==null&&cn()>_p&&(h.flags|=128,v=!0,su(m,!1),h.lanes=4194304)}else{if(!v)if(a=tp(y),a!==null){if(h.flags|=128,v=!0,a=a.updateQueue,h.updateQueue=a,pp(h,a),su(m,!0),m.tail===null&&m.tailMode==="hidden"&&!y.alternate&&!tt)return Et(h),null}else 2*cn()-m.renderingStartTime>_p&&f!==536870912&&(h.flags|=128,v=!0,su(m,!1),h.lanes=4194304);m.isBackwards?(y.sibling=h.child,h.child=y):(a=m.last,a!==null?a.sibling=y:h.child=y,m.last=y)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=cn(),a.sibling=null,f=Ht.current,L(Ht,v?f&1|2:f&1),tt&&Vr(h,m.treeForkCount),a):(Et(h),null);case 22:case 23:return qn(h),E0(),m=h.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(h.flags|=8192):m&&(h.flags|=8192),m?(f&536870912)!==0&&(h.flags&128)===0&&(Et(h),h.subtreeFlags&6&&(h.flags|=8192)):Et(h),f=h.updateQueue,f!==null&&pp(h,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),m=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(m=h.memoizedState.cachePool.pool),m!==f&&(h.flags|=2048),a!==null&&J(Wa),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),h.memoizedState.cache!==f&&(h.flags|=2048),Zr(ti),Et(h),null;case 25:return null;case 30:return null}throw Error(n(156,h.tag))}function j8(a,h){switch(p0(h),h.tag){case 1:return a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 3:return Zr(ti),ye(),a=h.flags,(a&65536)!==0&&(a&128)===0?(h.flags=a&-65537|128,h):null;case 26:case 27:case 5:return Qt(h),null;case 31:if(h.memoizedState!==null){if(qn(h),h.alternate===null)throw Error(n(340));Xa()}return a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 13:if(qn(h),a=h.memoizedState,a!==null&&a.dehydrated!==null){if(h.alternate===null)throw Error(n(340));Xa()}return a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 19:return J(Ht),null;case 4:return ye(),null;case 10:return Zr(h.type),null;case 22:case 23:return qn(h),E0(),a!==null&&J(Wa),a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 24:return Zr(ti),null;case 25:return null;default:return null}}function w2(a,h){switch(p0(h),h.tag){case 3:Zr(ti),ye();break;case 26:case 27:case 5:Qt(h);break;case 4:ye();break;case 31:h.memoizedState!==null&&qn(h);break;case 13:qn(h);break;case 19:J(Ht);break;case 10:Zr(h.type);break;case 22:case 23:qn(h),E0(),a!==null&&J(Wa);break;case 24:Zr(ti)}}function ru(a,h){try{var f=h.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var v=m.next;f=v;do{if((f.tag&a)===a){m=void 0;var y=f.create,C=f.inst;m=y(),C.destroy=m}f=f.next}while(f!==v)}}catch(P){dt(h,h.return,P)}}function Vo(a,h,f){try{var m=h.updateQueue,v=m!==null?m.lastEffect:null;if(v!==null){var y=v.next;m=y;do{if((m.tag&a)===a){var C=m.inst,P=C.destroy;if(P!==void 0){C.destroy=void 0,v=h;var W=f,te=P;try{te()}catch(se){dt(v,W,se)}}}m=m.next}while(m!==y)}}catch(se){dt(h,h.return,se)}}function C2(a){var h=a.updateQueue;if(h!==null){var f=a.stateNode;try{mk(h,f)}catch(m){dt(a,a.return,m)}}}function k2(a,h,f){f.props=Ga(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(m){dt(a,h,m)}}function ou(a,h){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof f=="function"?a.refCleanup=f(m):f.current=m}}catch(v){dt(a,h,v)}}function ir(a,h){var f=a.ref,m=a.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(v){dt(a,h,v)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(v){dt(a,h,v)}else f.current=null}function T2(a){var h=a.type,f=a.memoizedProps,m=a.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(v){dt(a,a.return,v)}}function av(a,h,f){try{var m=a.stateNode;lj(m,a.type,f,h),m[Sn]=h}catch(v){dt(a,a.return,v)}}function A2(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ho(a.type)||a.tag===4}function lv(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||A2(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Ho(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function cv(a,h,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,h?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,h):(h=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,h.appendChild(a),f=f._reactRootContainer,f!=null||h.onclick!==null||(h.onclick=zr));else if(m!==4&&(m===27&&Ho(a.type)&&(f=a.stateNode,h=null),a=a.child,a!==null))for(cv(a,h,f),a=a.sibling;a!==null;)cv(a,h,f),a=a.sibling}function mp(a,h,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,h?f.insertBefore(a,h):f.appendChild(a);else if(m!==4&&(m===27&&Ho(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(mp(a,h,f),a=a.sibling;a!==null;)mp(a,h,f),a=a.sibling}function E2(a){var h=a.stateNode,f=a.memoizedProps;try{for(var m=a.type,v=h.attributes;v.length;)h.removeAttributeNode(v[0]);Vi(h,m,f),h[Ni]=a,h[Sn]=f}catch(y){dt(a,a.return,y)}}var Hr=!1,si=!1,hv=!1,M2=typeof WeakSet=="function"?WeakSet:Set,xi=null;function I8(a,h){if(a=a.containerInfo,Pv=Bp,a=VC(a),n0(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var v=m.anchorOffset,y=m.focusNode;m=m.focusOffset;try{f.nodeType,y.nodeType}catch{f=null;break e}var C=0,P=-1,W=-1,te=0,se=0,le=a,ie=null;t:for(;;){for(var ne;le!==f||v!==0&&le.nodeType!==3||(P=C+v),le!==y||m!==0&&le.nodeType!==3||(W=C+m),le.nodeType===3&&(C+=le.nodeValue.length),(ne=le.firstChild)!==null;)ie=le,le=ne;for(;;){if(le===a)break t;if(ie===f&&++te===v&&(P=C),ie===y&&++se===m&&(W=C),(ne=le.nextSibling)!==null)break;le=ie,ie=le.parentNode}le=ne}f=P===-1||W===-1?null:{start:P,end:W}}else f=null}f=f||{start:0,end:0}}else f=null;for(Rv={focusedElem:a,selectionRange:f},Bp=!1,xi=h;xi!==null;)if(h=xi,a=h.child,(h.subtreeFlags&1028)!==0&&a!==null)a.return=h,xi=a;else for(;xi!==null;){switch(h=xi,y=h.alternate,a=h.flags,h.tag){case 0:if((a&4)!==0&&(a=h.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f<a.length;f++)v=a[f],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&y!==null){a=void 0,f=h,v=y.memoizedProps,y=y.memoizedState,m=f.stateNode;try{var we=Ga(f.type,v);a=m.getSnapshotBeforeUpdate(we,y),m.__reactInternalSnapshotBeforeUpdate=a}catch(Qe){dt(f,f.return,Qe)}}break;case 3:if((a&1024)!==0){if(a=h.stateNode.containerInfo,f=a.nodeType,f===9)Dv(a);else if(f===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Dv(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(n(163))}if(a=h.sibling,a!==null){a.return=h.return,xi=a;break}xi=h.return}}function P2(a,h,f){var m=f.flags;switch(f.tag){case 0:case 11:case 15:Gr(a,f),m&4&&ru(5,f);break;case 1:if(Gr(a,f),m&4)if(a=f.stateNode,h===null)try{a.componentDidMount()}catch(C){dt(f,f.return,C)}else{var v=Ga(f.type,h.memoizedProps);h=h.memoizedState;try{a.componentDidUpdate(v,h,a.__reactInternalSnapshotBeforeUpdate)}catch(C){dt(f,f.return,C)}}m&64&&C2(f),m&512&&ou(f,f.return);break;case 3:if(Gr(a,f),m&64&&(a=f.updateQueue,a!==null)){if(h=null,f.child!==null)switch(f.child.tag){case 27:case 5:h=f.child.stateNode;break;case 1:h=f.child.stateNode}try{mk(a,h)}catch(C){dt(f,f.return,C)}}break;case 27:h===null&&m&4&&E2(f);case 26:case 5:Gr(a,f),h===null&&m&4&&T2(f),m&512&&ou(f,f.return);break;case 12:Gr(a,f);break;case 31:Gr(a,f),m&4&&L2(a,f);break;case 13:Gr(a,f),m&4&&D2(a,f),m&64&&(a=f.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(f=F8.bind(null,f),gj(a,f))));break;case 22:if(m=f.memoizedState!==null||Hr,!m){h=h!==null&&h.memoizedState!==null||si,v=Hr;var y=si;Hr=m,(si=h)&&!y?Kr(a,f,(f.subtreeFlags&8772)!==0):Gr(a,f),Hr=v,si=y}break;case 30:break;default:Gr(a,f)}}function R2(a){var h=a.alternate;h!==null&&(a.alternate=null,R2(h)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(h=a.stateNode,h!==null&&jO(h)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Lt=null,Cn=!1;function Fr(a,h,f){for(f=f.child;f!==null;)Q2(a,h,f),f=f.sibling}function Q2(a,h,f){if(fi&&typeof fi.onCommitFiberUnmount=="function")try{fi.onCommitFiberUnmount(hn,f)}catch{}switch(f.tag){case 26:si||ir(f,h),Fr(a,h,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:si||ir(f,h);var m=Lt,v=Cn;Ho(f.type)&&(Lt=f.stateNode,Cn=!1),Fr(a,h,f),mu(f.stateNode),Lt=m,Cn=v;break;case 5:si||ir(f,h);case 6:if(m=Lt,v=Cn,Lt=null,Fr(a,h,f),Lt=m,Cn=v,Lt!==null)if(Cn)try{(Lt.nodeType===9?Lt.body:Lt.nodeName==="HTML"?Lt.ownerDocument.body:Lt).removeChild(f.stateNode)}catch(y){dt(f,h,y)}else try{Lt.removeChild(f.stateNode)}catch(y){dt(f,h,y)}break;case 18:Lt!==null&&(Cn?(a=Lt,C5(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,f.stateNode),xc(a)):C5(Lt,f.stateNode));break;case 4:m=Lt,v=Cn,Lt=f.stateNode.containerInfo,Cn=!0,Fr(a,h,f),Lt=m,Cn=v;break;case 0:case 11:case 14:case 15:Vo(2,f,h),si||Vo(4,f,h),Fr(a,h,f);break;case 1:si||(ir(f,h),m=f.stateNode,typeof m.componentWillUnmount=="function"&&k2(f,h,m)),Fr(a,h,f);break;case 21:Fr(a,h,f);break;case 22:si=(m=si)||f.memoizedState!==null,Fr(a,h,f),si=m;break;default:Fr(a,h,f)}}function L2(a,h){if(h.memoizedState===null&&(a=h.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{xc(a)}catch(f){dt(h,h.return,f)}}}function D2(a,h){if(h.memoizedState===null&&(a=h.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{xc(a)}catch(f){dt(h,h.return,f)}}function V8(a){switch(a.tag){case 31:case 13:case 19:var h=a.stateNode;return h===null&&(h=a.stateNode=new M2),h;case 22:return a=a.stateNode,h=a._retryCache,h===null&&(h=a._retryCache=new M2),h;default:throw Error(n(435,a.tag))}}function gp(a,h){var f=V8(a);h.forEach(function(m){if(!f.has(m)){f.add(m);var v=G8.bind(null,a,m);m.then(v,v)}})}function kn(a,h){var f=h.deletions;if(f!==null)for(var m=0;m<f.length;m++){var v=f[m],y=a,C=h,P=C;e:for(;P!==null;){switch(P.tag){case 27:if(Ho(P.type)){Lt=P.stateNode,Cn=!1;break e}break;case 5:Lt=P.stateNode,Cn=!1;break e;case 3:case 4:Lt=P.stateNode.containerInfo,Cn=!0;break e}P=P.return}if(Lt===null)throw Error(n(160));Q2(y,C,v),Lt=null,Cn=!1,y=v.alternate,y!==null&&(y.return=null),v.return=null}if(h.subtreeFlags&13886)for(h=h.child;h!==null;)B2(h,a),h=h.sibling}var Ns=null;function B2(a,h){var f=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:kn(h,a),Tn(a),m&4&&(Vo(3,a,a.return),ru(3,a),Vo(5,a,a.return));break;case 1:kn(h,a),Tn(a),m&512&&(si||f===null||ir(f,f.return)),m&64&&Hr&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(f=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=f===null?m:f.concat(m))));break;case 26:var v=Ns;if(kn(h,a),Tn(a),m&512&&(si||f===null||ir(f,f.return)),m&4){var y=f!==null?f.memoizedState:null;if(m=a.memoizedState,f===null)if(m===null)if(a.stateNode===null){e:{m=a.type,f=a.memoizedProps,v=v.ownerDocument||v;t:switch(m){case"title":y=v.getElementsByTagName("title")[0],(!y||y[Qh]||y[Ni]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=v.createElement(m),v.head.insertBefore(y,v.querySelector("head > title"))),Vi(y,m,f),y[Ni]=a,bi(y),m=y;break e;case"link":var C=B5("link","href",v).get(m+(f.href||""));if(C){for(var P=0;P<C.length;P++)if(y=C[P],y.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&y.getAttribute("rel")===(f.rel==null?null:f.rel)&&y.getAttribute("title")===(f.title==null?null:f.title)&&y.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){C.splice(P,1);break t}}y=v.createElement(m),Vi(y,m,f),v.head.appendChild(y);break;case"meta":if(C=B5("meta","content",v).get(m+(f.content||""))){for(P=0;P<C.length;P++)if(y=C[P],y.getAttribute("content")===(f.content==null?null:""+f.content)&&y.getAttribute("name")===(f.name==null?null:f.name)&&y.getAttribute("property")===(f.property==null?null:f.property)&&y.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&y.getAttribute("charset")===(f.charSet==null?null:f.charSet)){C.splice(P,1);break t}}y=v.createElement(m),Vi(y,m,f),v.head.appendChild(y);break;default:throw Error(n(468,m))}y[Ni]=a,bi(y),m=y}a.stateNode=m}else $5(v,a.type,a.stateNode);else a.stateNode=D5(v,m,a.memoizedProps);else y!==m?(y===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):y.count--,m===null?$5(v,a.type,a.stateNode):D5(v,m,a.memoizedProps)):m===null&&a.stateNode!==null&&av(a,a.memoizedProps,f.memoizedProps)}break;case 27:kn(h,a),Tn(a),m&512&&(si||f===null||ir(f,f.return)),f!==null&&m&4&&av(a,a.memoizedProps,f.memoizedProps);break;case 5:if(kn(h,a),Tn(a),m&512&&(si||f===null||ir(f,f.return)),a.flags&32){v=a.stateNode;try{ql(v,"")}catch(we){dt(a,a.return,we)}}m&4&&a.stateNode!=null&&(v=a.memoizedProps,av(a,v,f!==null?f.memoizedProps:v)),m&1024&&(hv=!0);break;case 6:if(kn(h,a),Tn(a),m&4){if(a.stateNode===null)throw Error(n(162));m=a.memoizedProps,f=a.stateNode;try{f.nodeValue=m}catch(we){dt(a,a.return,we)}}break;case 3:if(Rp=null,v=Ns,Ns=Mp(h.containerInfo),kn(h,a),Ns=v,Tn(a),m&4&&f!==null&&f.memoizedState.isDehydrated)try{xc(h.containerInfo)}catch(we){dt(a,a.return,we)}hv&&(hv=!1,$2(a));break;case 4:m=Ns,Ns=Mp(a.stateNode.containerInfo),kn(h,a),Tn(a),Ns=m;break;case 12:kn(h,a),Tn(a);break;case 31:kn(h,a),Tn(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,gp(a,m)));break;case 13:kn(h,a),Tn(a),a.child.flags&8192&&a.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(vp=cn()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,gp(a,m)));break;case 22:v=a.memoizedState!==null;var W=f!==null&&f.memoizedState!==null,te=Hr,se=si;if(Hr=te||v,si=se||W,kn(h,a),si=se,Hr=te,Tn(a),m&8192)e:for(h=a.stateNode,h._visibility=v?h._visibility&-2:h._visibility|1,v&&(f===null||W||Hr||si||Ka(a)),f=null,h=a;;){if(h.tag===5||h.tag===26){if(f===null){W=f=h;try{if(y=W.stateNode,v)C=y.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{P=W.stateNode;var le=W.memoizedProps.style,ie=le!=null&&le.hasOwnProperty("display")?le.display:null;P.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(we){dt(W,W.return,we)}}}else if(h.tag===6){if(f===null){W=h;try{W.stateNode.nodeValue=v?"":W.memoizedProps}catch(we){dt(W,W.return,we)}}}else if(h.tag===18){if(f===null){W=h;try{var ne=W.stateNode;v?k5(ne,!0):k5(W.stateNode,!1)}catch(we){dt(W,W.return,we)}}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===a)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===a)break e;for(;h.sibling===null;){if(h.return===null||h.return===a)break e;f===h&&(f=null),h=h.return}f===h&&(f=null),h.sibling.return=h.return,h=h.sibling}m&4&&(m=a.updateQueue,m!==null&&(f=m.retryQueue,f!==null&&(m.retryQueue=null,gp(a,f))));break;case 19:kn(h,a),Tn(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,gp(a,m)));break;case 30:break;case 21:break;default:kn(h,a),Tn(a)}}function Tn(a){var h=a.flags;if(h&2){try{for(var f,m=a.return;m!==null;){if(A2(m)){f=m;break}m=m.return}if(f==null)throw Error(n(160));switch(f.tag){case 27:var v=f.stateNode,y=lv(a);mp(a,y,v);break;case 5:var C=f.stateNode;f.flags&32&&(ql(C,""),f.flags&=-33);var P=lv(a);mp(a,P,C);break;case 3:case 4:var W=f.stateNode.containerInfo,te=lv(a);cv(a,te,W);break;default:throw Error(n(161))}}catch(se){dt(a,a.return,se)}a.flags&=-3}h&4096&&(a.flags&=-4097)}function $2(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var h=a;$2(h),h.tag===5&&h.flags&1024&&h.stateNode.reset(),a=a.sibling}}function Gr(a,h){if(h.subtreeFlags&8772)for(h=h.child;h!==null;)P2(a,h.alternate,h),h=h.sibling}function Ka(a){for(a=a.child;a!==null;){var h=a;switch(h.tag){case 0:case 11:case 14:case 15:Vo(4,h,h.return),Ka(h);break;case 1:ir(h,h.return);var f=h.stateNode;typeof f.componentWillUnmount=="function"&&k2(h,h.return,f),Ka(h);break;case 27:mu(h.stateNode);case 26:case 5:ir(h,h.return),Ka(h);break;case 22:h.memoizedState===null&&Ka(h);break;case 30:Ka(h);break;default:Ka(h)}a=a.sibling}}function Kr(a,h,f){for(f=f&&(h.subtreeFlags&8772)!==0,h=h.child;h!==null;){var m=h.alternate,v=a,y=h,C=y.flags;switch(y.tag){case 0:case 11:case 15:Kr(v,y,f),ru(4,y);break;case 1:if(Kr(v,y,f),m=y,v=m.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(te){dt(m,m.return,te)}if(m=y,v=m.updateQueue,v!==null){var P=m.stateNode;try{var W=v.shared.hiddenCallbacks;if(W!==null)for(v.shared.hiddenCallbacks=null,v=0;v<W.length;v++)pk(W[v],P)}catch(te){dt(m,m.return,te)}}f&&C&64&&C2(y),ou(y,y.return);break;case 27:E2(y);case 26:case 5:Kr(v,y,f),f&&m===null&&C&4&&T2(y),ou(y,y.return);break;case 12:Kr(v,y,f);break;case 31:Kr(v,y,f),f&&C&4&&L2(v,y);break;case 13:Kr(v,y,f),f&&C&4&&D2(v,y);break;case 22:y.memoizedState===null&&Kr(v,y,f),ou(y,y.return);break;case 30:break;default:Kr(v,y,f)}h=h.sibling}}function uv(a,h){var f=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),a=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(a=h.memoizedState.cachePool.pool),a!==f&&(a!=null&&a.refCount++,f!=null&&Wh(f))}function fv(a,h){a=null,h.alternate!==null&&(a=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==a&&(h.refCount++,a!=null&&Wh(a))}function zs(a,h,f,m){if(h.subtreeFlags&10256)for(h=h.child;h!==null;)N2(a,h,f,m),h=h.sibling}function N2(a,h,f,m){var v=h.flags;switch(h.tag){case 0:case 11:case 15:zs(a,h,f,m),v&2048&&ru(9,h);break;case 1:zs(a,h,f,m);break;case 3:zs(a,h,f,m),v&2048&&(a=null,h.alternate!==null&&(a=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==a&&(h.refCount++,a!=null&&Wh(a)));break;case 12:if(v&2048){zs(a,h,f,m),a=h.stateNode;try{var y=h.memoizedProps,C=y.id,P=y.onPostCommit;typeof P=="function"&&P(C,h.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(W){dt(h,h.return,W)}}else zs(a,h,f,m);break;case 31:zs(a,h,f,m);break;case 13:zs(a,h,f,m);break;case 23:break;case 22:y=h.stateNode,C=h.alternate,h.memoizedState!==null?y._visibility&2?zs(a,h,f,m):au(a,h):y._visibility&2?zs(a,h,f,m):(y._visibility|=2,uc(a,h,f,m,(h.subtreeFlags&10256)!==0||!1)),v&2048&&uv(C,h);break;case 24:zs(a,h,f,m),v&2048&&fv(h.alternate,h);break;default:zs(a,h,f,m)}}function uc(a,h,f,m,v){for(v=v&&((h.subtreeFlags&10256)!==0||!1),h=h.child;h!==null;){var y=a,C=h,P=f,W=m,te=C.flags;switch(C.tag){case 0:case 11:case 15:uc(y,C,P,W,v),ru(8,C);break;case 23:break;case 22:var se=C.stateNode;C.memoizedState!==null?se._visibility&2?uc(y,C,P,W,v):au(y,C):(se._visibility|=2,uc(y,C,P,W,v)),v&&te&2048&&uv(C.alternate,C);break;case 24:uc(y,C,P,W,v),v&&te&2048&&fv(C.alternate,C);break;default:uc(y,C,P,W,v)}h=h.sibling}}function au(a,h){if(h.subtreeFlags&10256)for(h=h.child;h!==null;){var f=a,m=h,v=m.flags;switch(m.tag){case 22:au(f,m),v&2048&&uv(m.alternate,m);break;case 24:au(f,m),v&2048&&fv(m.alternate,m);break;default:au(f,m)}h=h.sibling}}var lu=8192;function fc(a,h,f){if(a.subtreeFlags&lu)for(a=a.child;a!==null;)z2(a,h,f),a=a.sibling}function z2(a,h,f){switch(a.tag){case 26:fc(a,h,f),a.flags&lu&&a.memoizedState!==null&&Aj(f,Ns,a.memoizedState,a.memoizedProps);break;case 5:fc(a,h,f);break;case 3:case 4:var m=Ns;Ns=Mp(a.stateNode.containerInfo),fc(a,h,f),Ns=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=lu,lu=16777216,fc(a,h,f),lu=m):fc(a,h,f));break;default:fc(a,h,f)}}function j2(a){var h=a.alternate;if(h!==null&&(a=h.child,a!==null)){h.child=null;do h=a.sibling,a.sibling=null,a=h;while(a!==null)}}function cu(a){var h=a.deletions;if((a.flags&16)!==0){if(h!==null)for(var f=0;f<h.length;f++){var m=h[f];xi=m,V2(m,a)}j2(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)I2(a),a=a.sibling}function I2(a){switch(a.tag){case 0:case 11:case 15:cu(a),a.flags&2048&&Vo(9,a,a.return);break;case 3:cu(a);break;case 12:cu(a);break;case 22:var h=a.stateNode;a.memoizedState!==null&&h._visibility&2&&(a.return===null||a.return.tag!==13)?(h._visibility&=-3,Op(a)):cu(a);break;default:cu(a)}}function Op(a){var h=a.deletions;if((a.flags&16)!==0){if(h!==null)for(var f=0;f<h.length;f++){var m=h[f];xi=m,V2(m,a)}j2(a)}for(a=a.child;a!==null;){switch(h=a,h.tag){case 0:case 11:case 15:Vo(8,h,h.return),Op(h);break;case 22:f=h.stateNode,f._visibility&2&&(f._visibility&=-3,Op(h));break;default:Op(h)}a=a.sibling}}function V2(a,h){for(;xi!==null;){var f=xi;switch(f.tag){case 0:case 11:case 15:Vo(8,f,h);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var m=f.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Wh(f.memoizedState.cache)}if(m=f.child,m!==null)m.return=f,xi=m;else e:for(f=a;xi!==null;){m=xi;var v=m.sibling,y=m.return;if(R2(m),m===f){xi=null;break e}if(v!==null){v.return=y,xi=v;break e}xi=y}}}var X8={getCacheForType:function(a){var h=ji(ti),f=h.data.get(a);return f===void 0&&(f=a(),h.data.set(a,f)),f},cacheSignal:function(){return ji(ti).controller.signal}},Z8=typeof WeakMap=="function"?WeakMap:Map,ot=0,yt=null,He=null,Ke=0,ft=0,Wn=null,Xo=!1,dc=!1,dv=!1,Jr=0,It=0,Zo=0,Ja=0,pv=0,Un=0,pc=0,hu=null,An=null,mv=!1,vp=0,X2=0,_p=1/0,yp=null,qo=null,di=0,Wo=null,mc=null,eo=0,gv=0,Ov=null,Z2=null,uu=0,vv=null;function Yn(){return(ot&2)!==0&&Ke!==0?Ke&-Ke:B.T!==null?wv():oC()}function q2(){if(Un===0)if((Ke&536870912)===0||tt){var a=Ad;Ad<<=1,(Ad&3932160)===0&&(Ad=262144),Un=a}else Un=536870912;return a=Zn.current,a!==null&&(a.flags|=32),Un}function En(a,h,f){(a===yt&&(ft===2||ft===9)||a.cancelPendingCommit!==null)&&(gc(a,0),Uo(a,Ke,Un,!1)),Rh(a,f),((ot&2)===0||a!==yt)&&(a===yt&&((ot&2)===0&&(Ja|=f),It===4&&Uo(a,Ke,Un,!1)),nr(a))}function W2(a,h,f){if((ot&6)!==0)throw Error(n(327));var m=!f&&(h&127)===0&&(h&a.expiredLanes)===0||Ph(a,h),v=m?U8(a,h):yv(a,h,!0),y=m;do{if(v===0){dc&&!m&&Uo(a,h,0,!1);break}else{if(f=a.current.alternate,y&&!q8(f)){v=yv(a,h,!1),y=!1;continue}if(v===2){if(y=h,a.errorRecoveryDisabledLanes&y)var C=0;else C=a.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){h=C;e:{var P=a;v=hu;var W=P.current.memoizedState.isDehydrated;if(W&&(gc(P,C).flags|=256),C=yv(P,C,!1),C!==2){if(dv&&!W){P.errorRecoveryDisabledLanes|=y,Ja|=y,v=4;break e}y=An,An=v,y!==null&&(An===null?An=y:An.push.apply(An,y))}v=C}if(y=!1,v!==2)continue}}if(v===1){gc(a,0),Uo(a,h,0,!0);break}e:{switch(m=a,y=v,y){case 0:case 1:throw Error(n(345));case 4:if((h&4194048)!==h)break;case 6:Uo(m,h,Un,!Xo);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(n(329))}if((h&62914560)===h&&(v=vp+300-cn(),10<v)){if(Uo(m,h,Un,!Xo),Md(m,0,!0)!==0)break e;eo=h,m.timeoutHandle=S5(U2.bind(null,m,f,An,yp,mv,h,Un,Ja,pc,Xo,y,"Throttled",-0,0),v);break e}U2(m,f,An,yp,mv,h,Un,Ja,pc,Xo,y,null,-0,0)}}break}while(!0);nr(a)}function U2(a,h,f,m,v,y,C,P,W,te,se,le,ie,ne){if(a.timeoutHandle=-1,le=h.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zr},z2(h,y,le);var we=(y&62914560)===y?vp-cn():(y&4194048)===y?X2-cn():0;if(we=Ej(le,we),we!==null){eo=y,a.cancelPendingCommit=we(t5.bind(null,a,h,y,f,m,v,C,P,W,se,le,null,ie,ne)),Uo(a,y,C,!te);return}}t5(a,h,y,f,m,v,C,P,W)}function q8(a){for(var h=a;;){var f=h.tag;if((f===0||f===11||f===15)&&h.flags&16384&&(f=h.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var m=0;m<f.length;m++){var v=f[m],y=v.getSnapshot;v=v.value;try{if(!Vn(y(),v))return!1}catch{return!1}}if(f=h.child,h.subtreeFlags&16384&&f!==null)f.return=h,h=f;else{if(h===a)break;for(;h.sibling===null;){if(h.return===null||h.return===a)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function Uo(a,h,f,m){h&=~pv,h&=~Ja,a.suspendedLanes|=h,a.pingedLanes&=~h,m&&(a.warmLanes|=h),m=a.expirationTimes;for(var v=h;0<v;){var y=31-_t(v),C=1<<y;m[y]=-1,v&=~C}f!==0&&nC(a,f,h)}function bp(){return(ot&6)===0?(fu(0),!1):!0}function _v(){if(He!==null){if(ft===0)var a=He.return;else a=He,Xr=Za=null,D0(a),oc=null,Yh=0,a=He;for(;a!==null;)w2(a.alternate,a),a=a.return;He=null}}function gc(a,h){var f=a.timeoutHandle;f!==-1&&(a.timeoutHandle=-1,uj(f)),f=a.cancelPendingCommit,f!==null&&(a.cancelPendingCommit=null,f()),eo=0,_v(),yt=a,He=f=Ir(a.current,null),Ke=h,ft=0,Wn=null,Xo=!1,dc=Ph(a,h),dv=!1,pc=Un=pv=Ja=Zo=It=0,An=hu=null,mv=!1,(h&8)!==0&&(h|=h&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=h;0<m;){var v=31-_t(m),y=1<<v;h|=a[v],m&=~y}return Jr=h,Vd(),f}function Y2(a,h){Ve=null,B.H=iu,h===rc||h===Fd?(h=hk(),ft=3):h===S0?(h=hk(),ft=4):ft=h===G0?8:h!==null&&typeof h=="object"&&typeof h.then=="function"?6:1,Wn=h,He===null&&(It=1,hp(a,us(h,a.current)))}function H2(){var a=Zn.current;return a===null?!0:(Ke&4194048)===Ke?ms===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?a===ms:!1}function F2(){var a=B.H;return B.H=iu,a===null?iu:a}function G2(){var a=B.A;return B.A=X8,a}function xp(){It=4,Xo||(Ke&4194048)!==Ke&&Zn.current!==null||(dc=!0),(Zo&134217727)===0&&(Ja&134217727)===0||yt===null||Uo(yt,Ke,Un,!1)}function yv(a,h,f){var m=ot;ot|=2;var v=F2(),y=G2();(yt!==a||Ke!==h)&&(yp=null,gc(a,h)),h=!1;var C=It;e:do try{if(ft!==0&&He!==null){var P=He,W=Wn;switch(ft){case 8:_v(),C=6;break e;case 3:case 2:case 9:case 6:Zn.current===null&&(h=!0);var te=ft;if(ft=0,Wn=null,Oc(a,P,W,te),f&&dc){C=0;break e}break;default:te=ft,ft=0,Wn=null,Oc(a,P,W,te)}}W8(),C=It;break}catch(se){Y2(a,se)}while(!0);return h&&a.shellSuspendCounter++,Xr=Za=null,ot=m,B.H=v,B.A=y,He===null&&(yt=null,Ke=0,Vd()),C}function W8(){for(;He!==null;)K2(He)}function U8(a,h){var f=ot;ot|=2;var m=F2(),v=G2();yt!==a||Ke!==h?(yp=null,_p=cn()+500,gc(a,h)):dc=Ph(a,h);e:do try{if(ft!==0&&He!==null){h=He;var y=Wn;t:switch(ft){case 1:ft=0,Wn=null,Oc(a,h,y,1);break;case 2:case 9:if(lk(y)){ft=0,Wn=null,J2(h);break}h=function(){ft!==2&&ft!==9||yt!==a||(ft=7),nr(a)},y.then(h,h);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:lk(y)?(ft=0,Wn=null,J2(h)):(ft=0,Wn=null,Oc(a,h,y,7));break;case 5:var C=null;switch(He.tag){case 26:C=He.memoizedState;case 5:case 27:var P=He;if(C?N5(C):P.stateNode.complete){ft=0,Wn=null;var W=P.sibling;if(W!==null)He=W;else{var te=P.return;te!==null?(He=te,Sp(te)):He=null}break t}}ft=0,Wn=null,Oc(a,h,y,5);break;case 6:ft=0,Wn=null,Oc(a,h,y,6);break;case 8:_v(),It=6;break e;default:throw Error(n(462))}}Y8();break}catch(se){Y2(a,se)}while(!0);return Xr=Za=null,B.H=m,B.A=v,ot=f,He!==null?0:(yt=null,Ke=0,Vd(),It)}function Y8(){for(;He!==null&&!QO();)K2(He)}function K2(a){var h=x2(a.alternate,a,Jr);a.memoizedProps=a.pendingProps,h===null?Sp(a):He=h}function J2(a){var h=a,f=h.alternate;switch(h.tag){case 15:case 0:h=g2(f,h,h.pendingProps,h.type,void 0,Ke);break;case 11:h=g2(f,h,h.pendingProps,h.type.render,h.ref,Ke);break;case 5:D0(h);default:w2(f,h),h=He=GC(h,Jr),h=x2(f,h,Jr)}a.memoizedProps=a.pendingProps,h===null?Sp(a):He=h}function Oc(a,h,f,m){Xr=Za=null,D0(h),oc=null,Yh=0;var v=h.return;try{if(B8(a,v,h,f,Ke)){It=1,hp(a,us(f,a.current)),He=null;return}}catch(y){if(v!==null)throw He=v,y;It=1,hp(a,us(f,a.current)),He=null;return}h.flags&32768?(tt||m===1?a=!0:dc||(Ke&536870912)!==0?a=!1:(Xo=a=!0,(m===2||m===9||m===3||m===6)&&(m=Zn.current,m!==null&&m.tag===13&&(m.flags|=16384))),e5(h,a)):Sp(h)}function Sp(a){var h=a;do{if((h.flags&32768)!==0){e5(h,Xo);return}a=h.return;var f=z8(h.alternate,h,Jr);if(f!==null){He=f;return}if(h=h.sibling,h!==null){He=h;return}He=h=a}while(h!==null);It===0&&(It=5)}function e5(a,h){do{var f=j8(a.alternate,a);if(f!==null){f.flags&=32767,He=f;return}if(f=a.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!h&&(a=a.sibling,a!==null)){He=a;return}He=a=f}while(a!==null);It=6,He=null}function t5(a,h,f,m,v,y,C,P,W){a.cancelPendingCommit=null;do wp();while(di!==0);if((ot&6)!==0)throw Error(n(327));if(h!==null){if(h===a.current)throw Error(n(177));if(y=h.lanes|h.childLanes,y|=l0,Tz(a,f,y,C,P,W),a===yt&&(He=yt=null,Ke=0),mc=h,Wo=a,eo=f,gv=y,Ov=v,Z2=m,(h.subtreeFlags&10256)!==0||(h.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,K8(De,function(){return o5(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(h.flags&13878)!==0,(h.subtreeFlags&13878)!==0||m){m=B.T,B.T=null,v=Z.p,Z.p=2,C=ot,ot|=4;try{I8(a,h,f)}finally{ot=C,Z.p=v,B.T=m}}di=1,i5(),n5(),s5()}}function i5(){if(di===1){di=0;var a=Wo,h=mc,f=(h.flags&13878)!==0;if((h.subtreeFlags&13878)!==0||f){f=B.T,B.T=null;var m=Z.p;Z.p=2;var v=ot;ot|=4;try{B2(h,a);var y=Rv,C=VC(a.containerInfo),P=y.focusedElem,W=y.selectionRange;if(C!==P&&P&&P.ownerDocument&&IC(P.ownerDocument.documentElement,P)){if(W!==null&&n0(P)){var te=W.start,se=W.end;if(se===void 0&&(se=te),"selectionStart"in P)P.selectionStart=te,P.selectionEnd=Math.min(se,P.value.length);else{var le=P.ownerDocument||document,ie=le&&le.defaultView||window;if(ie.getSelection){var ne=ie.getSelection(),we=P.textContent.length,Qe=Math.min(W.start,we),gt=W.end===void 0?Qe:Math.min(W.end,we);!ne.extend&&Qe>gt&&(C=gt,gt=Qe,Qe=C);var K=jC(P,Qe),Y=jC(P,gt);if(K&&Y&&(ne.rangeCount!==1||ne.anchorNode!==K.node||ne.anchorOffset!==K.offset||ne.focusNode!==Y.node||ne.focusOffset!==Y.offset)){var ee=le.createRange();ee.setStart(K.node,K.offset),ne.removeAllRanges(),Qe>gt?(ne.addRange(ee),ne.extend(Y.node,Y.offset)):(ee.setEnd(Y.node,Y.offset),ne.addRange(ee))}}}}for(le=[],ne=P;ne=ne.parentNode;)ne.nodeType===1&&le.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<le.length;P++){var ae=le[P];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Bp=!!Pv,Rv=Pv=null}finally{ot=v,Z.p=m,B.T=f}}a.current=h,di=2}}function n5(){if(di===2){di=0;var a=Wo,h=mc,f=(h.flags&8772)!==0;if((h.subtreeFlags&8772)!==0||f){f=B.T,B.T=null;var m=Z.p;Z.p=2;var v=ot;ot|=4;try{P2(a,h.alternate,h)}finally{ot=v,Z.p=m,B.T=f}}di=3}}function s5(){if(di===4||di===3){di=0,LO();var a=Wo,h=mc,f=eo,m=Z2;(h.subtreeFlags&10256)!==0||(h.flags&10256)!==0?di=5:(di=0,mc=Wo=null,r5(a,a.pendingLanes));var v=a.pendingLanes;if(v===0&&(qo=null),NO(f),h=h.stateNode,fi&&typeof fi.onCommitFiberRoot=="function")try{fi.onCommitFiberRoot(hn,h,void 0,(h.current.flags&128)===128)}catch{}if(m!==null){h=B.T,v=Z.p,Z.p=2,B.T=null;try{for(var y=a.onRecoverableError,C=0;C<m.length;C++){var P=m[C];y(P.value,{componentStack:P.stack})}}finally{B.T=h,Z.p=v}}(eo&3)!==0&&wp(),nr(a),v=a.pendingLanes,(f&261930)!==0&&(v&42)!==0?a===vv?uu++:(uu=0,vv=a):uu=0,fu(0)}}function r5(a,h){(a.pooledCacheLanes&=h)===0&&(h=a.pooledCache,h!=null&&(a.pooledCache=null,Wh(h)))}function wp(){return i5(),n5(),s5(),o5()}function o5(){if(di!==5)return!1;var a=Wo,h=gv;gv=0;var f=NO(eo),m=B.T,v=Z.p;try{Z.p=32>f?32:f,B.T=null,f=Ov,Ov=null;var y=Wo,C=eo;if(di=0,mc=Wo=null,eo=0,(ot&6)!==0)throw Error(n(331));var P=ot;if(ot|=4,I2(y.current),N2(y,y.current,C,f),ot=P,fu(0,!1),fi&&typeof fi.onPostCommitFiberRoot=="function")try{fi.onPostCommitFiberRoot(hn,y)}catch{}return!0}finally{Z.p=v,B.T=m,r5(a,h)}}function a5(a,h,f){h=us(f,h),h=F0(a.stateNode,h,2),a=zo(a,h,2),a!==null&&(Rh(a,2),nr(a))}function dt(a,h,f){if(a.tag===3)a5(a,a,f);else for(;h!==null;){if(h.tag===3){a5(h,a,f);break}else if(h.tag===1){var m=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(qo===null||!qo.has(m))){a=us(f,a),f=l2(2),m=zo(h,f,2),m!==null&&(c2(f,m,h,a),Rh(m,2),nr(m));break}}h=h.return}}function bv(a,h,f){var m=a.pingCache;if(m===null){m=a.pingCache=new Z8;var v=new Set;m.set(h,v)}else v=m.get(h),v===void 0&&(v=new Set,m.set(h,v));v.has(f)||(dv=!0,v.add(f),a=H8.bind(null,a,h,f),h.then(a,a))}function H8(a,h,f){var m=a.pingCache;m!==null&&m.delete(h),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,yt===a&&(Ke&f)===f&&(It===4||It===3&&(Ke&62914560)===Ke&&300>cn()-vp?(ot&2)===0&&gc(a,0):pv|=f,pc===Ke&&(pc=0)),nr(a)}function l5(a,h){h===0&&(h=iC()),a=Ia(a,h),a!==null&&(Rh(a,h),nr(a))}function F8(a){var h=a.memoizedState,f=0;h!==null&&(f=h.retryLane),l5(a,f)}function G8(a,h){var f=0;switch(a.tag){case 31:case 13:var m=a.stateNode,v=a.memoizedState;v!==null&&(f=v.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(n(314))}m!==null&&m.delete(h),l5(a,f)}function K8(a,h){return Eo(a,h)}var Cp=null,vc=null,xv=!1,kp=!1,Sv=!1,Yo=0;function nr(a){a!==vc&&a.next===null&&(vc===null?Cp=vc=a:vc=vc.next=a),kp=!0,xv||(xv=!0,ej())}function fu(a,h){if(!Sv&&kp){Sv=!0;do for(var f=!1,m=Cp;m!==null;){if(a!==0){var v=m.pendingLanes;if(v===0)var y=0;else{var C=m.suspendedLanes,P=m.pingedLanes;y=(1<<31-_t(42|a)+1)-1,y&=v&~(C&~P),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(f=!0,f5(m,y))}else y=Ke,y=Md(m,m===yt?y:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(y&3)===0||Ph(m,y)||(f=!0,f5(m,y));m=m.next}while(f);Sv=!1}}function J8(){c5()}function c5(){kp=xv=!1;var a=0;Yo!==0&&hj()&&(a=Yo);for(var h=cn(),f=null,m=Cp;m!==null;){var v=m.next,y=h5(m,h);y===0?(m.next=null,f===null?Cp=v:f.next=v,v===null&&(vc=f)):(f=m,(a!==0||(y&3)!==0)&&(kp=!0)),m=v}di!==0&&di!==5||fu(a),Yo!==0&&(Yo=0)}function h5(a,h){for(var f=a.suspendedLanes,m=a.pingedLanes,v=a.expirationTimes,y=a.pendingLanes&-62914561;0<y;){var C=31-_t(y),P=1<<C,W=v[C];W===-1?((P&f)===0||(P&m)!==0)&&(v[C]=kz(P,h)):W<=h&&(a.expiredLanes|=P),y&=~P}if(h=yt,f=Ke,f=Md(a,a===h?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,f===0||a===h&&(ft===2||ft===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Mh(m),a.callbackNode=null,a.callbackPriority=0;if((f&3)===0||Ph(a,f)){if(h=f&-f,h===a.callbackPriority)return h;switch(m!==null&&Mh(m),NO(f)){case 2:case 8:f=ge;break;case 32:f=De;break;case 268435456:f=ht;break;default:f=De}return m=u5.bind(null,a),f=Eo(f,m),a.callbackPriority=h,a.callbackNode=f,h}return m!==null&&m!==null&&Mh(m),a.callbackPriority=2,a.callbackNode=null,2}function u5(a,h){if(di!==0&&di!==5)return a.callbackNode=null,a.callbackPriority=0,null;var f=a.callbackNode;if(wp()&&a.callbackNode!==f)return null;var m=Ke;return m=Md(a,a===yt?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(W2(a,m,h),h5(a,cn()),a.callbackNode!=null&&a.callbackNode===f?u5.bind(null,a):null)}function f5(a,h){if(wp())return null;W2(a,h,!0)}function ej(){fj(function(){(ot&6)!==0?Eo(oe,J8):c5()})}function wv(){if(Yo===0){var a=nc;a===0&&(a=Td,Td<<=1,(Td&261888)===0&&(Td=256)),Yo=a}return Yo}function d5(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Ld(""+a)}function p5(a,h){var f=h.ownerDocument.createElement("input");return f.name=h.name,f.value=h.value,a.id&&f.setAttribute("form",a.id),h.parentNode.insertBefore(f,h),a=new FormData(a),f.parentNode.removeChild(f),a}function tj(a,h,f,m,v){if(h==="submit"&&f&&f.stateNode===v){var y=d5((v[Sn]||null).action),C=m.submitter;C&&(h=(h=C[Sn]||null)?d5(h.formAction):C.getAttribute("formAction"),h!==null&&(y=h,C=null));var P=new Nd("action","action",null,m,v);a.push({event:P,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Yo!==0){var W=C?p5(v,C):new FormData(v);Z0(f,{pending:!0,data:W,method:v.method,action:y},null,W)}}else typeof y=="function"&&(P.preventDefault(),W=C?p5(v,C):new FormData(v),Z0(f,{pending:!0,data:W,method:v.method,action:y},y,W))},currentTarget:v}]})}}for(var Cv=0;Cv<a0.length;Cv++){var kv=a0[Cv],ij=kv.toLowerCase(),nj=kv[0].toUpperCase()+kv.slice(1);$s(ij,"on"+nj)}$s(qC,"onAnimationEnd"),$s(WC,"onAnimationIteration"),$s(UC,"onAnimationStart"),$s("dblclick","onDoubleClick"),$s("focusin","onFocus"),$s("focusout","onBlur"),$s(_8,"onTransitionRun"),$s(y8,"onTransitionStart"),$s(b8,"onTransitionCancel"),$s(YC,"onTransitionEnd"),Xl("onMouseEnter",["mouseout","mouseover"]),Xl("onMouseLeave",["mouseout","mouseover"]),Xl("onPointerEnter",["pointerout","pointerover"]),Xl("onPointerLeave",["pointerout","pointerover"]),$a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$a("onBeforeInput",["compositionend","keypress","textInput","paste"]),$a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var du="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(" "),sj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(du));function m5(a,h){h=(h&4)!==0;for(var f=0;f<a.length;f++){var m=a[f],v=m.event;m=m.listeners;e:{var y=void 0;if(h)for(var C=m.length-1;0<=C;C--){var P=m[C],W=P.instance,te=P.currentTarget;if(P=P.listener,W!==y&&v.isPropagationStopped())break e;y=P,v.currentTarget=te;try{y(v)}catch(se){Id(se)}v.currentTarget=null,y=W}else for(C=0;C<m.length;C++){if(P=m[C],W=P.instance,te=P.currentTarget,P=P.listener,W!==y&&v.isPropagationStopped())break e;y=P,v.currentTarget=te;try{y(v)}catch(se){Id(se)}v.currentTarget=null,y=W}}}}function Fe(a,h){var f=h[zO];f===void 0&&(f=h[zO]=new Set);var m=a+"__bubble";f.has(m)||(g5(h,a,2,!1),f.add(m))}function Tv(a,h,f){var m=0;h&&(m|=4),g5(f,a,m,h)}var Tp="_reactListening"+Math.random().toString(36).slice(2);function Av(a){if(!a[Tp]){a[Tp]=!0,cC.forEach(function(f){f!=="selectionchange"&&(sj.has(f)||Tv(f,!1,a),Tv(f,!0,a))});var h=a.nodeType===9?a:a.ownerDocument;h===null||h[Tp]||(h[Tp]=!0,Tv("selectionchange",!1,h))}}function g5(a,h,f,m){switch(q5(h)){case 2:var v=Rj;break;case 8:v=Qj;break;default:v=Xv}f=v.bind(null,h,f,a),v=void 0,!YO||h!=="touchstart"&&h!=="touchmove"&&h!=="wheel"||(v=!0),m?v!==void 0?a.addEventListener(h,f,{capture:!0,passive:v}):a.addEventListener(h,f,!0):v!==void 0?a.addEventListener(h,f,{passive:v}):a.addEventListener(h,f,!1)}function Ev(a,h,f,m,v){var y=m;if((h&1)===0&&(h&2)===0&&m!==null)e:for(;;){if(m===null)return;var C=m.tag;if(C===3||C===4){var P=m.stateNode.containerInfo;if(P===v)break;if(C===4)for(C=m.return;C!==null;){var W=C.tag;if((W===3||W===4)&&C.stateNode.containerInfo===v)return;C=C.return}for(;P!==null;){if(C=jl(P),C===null)return;if(W=C.tag,W===5||W===6||W===26||W===27){m=y=C;continue e}P=P.parentNode}}m=m.return}bC(function(){var te=y,se=WO(f),le=[];e:{var ie=HC.get(a);if(ie!==void 0){var ne=Nd,we=a;switch(a){case"keypress":if(Bd(f)===0)break e;case"keydown":case"keyup":ne=Gz;break;case"focusin":we="focus",ne=KO;break;case"focusout":we="blur",ne=KO;break;case"beforeblur":case"afterblur":ne=KO;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=wC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=zz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=e8;break;case qC:case WC:case UC:ne=Vz;break;case YC:ne=i8;break;case"scroll":case"scrollend":ne=$z;break;case"wheel":ne=s8;break;case"copy":case"cut":case"paste":ne=Zz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=kC;break;case"toggle":case"beforetoggle":ne=o8}var Qe=(h&4)!==0,gt=!Qe&&(a==="scroll"||a==="scrollend"),K=Qe?ie!==null?ie+"Capture":null:ie;Qe=[];for(var Y=te,ee;Y!==null;){var ae=Y;if(ee=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||ee===null||K===null||(ae=Dh(Y,K),ae!=null&&Qe.push(pu(Y,ae,ee))),gt)break;Y=Y.return}0<Qe.length&&(ie=new ne(ie,we,null,f,se),le.push({event:ie,listeners:Qe}))}}if((h&7)===0){e:{if(ie=a==="mouseover"||a==="pointerover",ne=a==="mouseout"||a==="pointerout",ie&&f!==qO&&(we=f.relatedTarget||f.fromElement)&&(jl(we)||we[zl]))break e;if((ne||ie)&&(ie=se.window===se?se:(ie=se.ownerDocument)?ie.defaultView||ie.parentWindow:window,ne?(we=f.relatedTarget||f.toElement,ne=te,we=we?jl(we):null,we!==null&&(gt=r(we),Qe=we.tag,we!==gt||Qe!==5&&Qe!==27&&Qe!==6)&&(we=null)):(ne=null,we=te),ne!==we)){if(Qe=wC,ae="onMouseLeave",K="onMouseEnter",Y="mouse",(a==="pointerout"||a==="pointerover")&&(Qe=kC,ae="onPointerLeave",K="onPointerEnter",Y="pointer"),gt=ne==null?ie:Lh(ne),ee=we==null?ie:Lh(we),ie=new Qe(ae,Y+"leave",ne,f,se),ie.target=gt,ie.relatedTarget=ee,ae=null,jl(se)===te&&(Qe=new Qe(K,Y+"enter",we,f,se),Qe.target=ee,Qe.relatedTarget=gt,ae=Qe),gt=ae,ne&&we)t:{for(Qe=rj,K=ne,Y=we,ee=0,ae=K;ae;ae=Qe(ae))ee++;ae=0;for(var Re=Y;Re;Re=Qe(Re))ae++;for(;0<ee-ae;)K=Qe(K),ee--;for(;0<ae-ee;)Y=Qe(Y),ae--;for(;ee--;){if(K===Y||Y!==null&&K===Y.alternate){Qe=K;break t}K=Qe(K),Y=Qe(Y)}Qe=null}else Qe=null;ne!==null&&O5(le,ie,ne,Qe,!1),we!==null&&gt!==null&&O5(le,gt,we,Qe,!0)}}e:{if(ie=te?Lh(te):window,ne=ie.nodeName&&ie.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ie.type==="file")var st=LC;else if(RC(ie))if(DC)st=g8;else{st=p8;var Ee=d8}else ne=ie.nodeName,!ne||ne.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?te&&ZO(te.elementType)&&(st=LC):st=m8;if(st&&(st=st(a,te))){QC(le,st,f,se);break e}Ee&&Ee(a,ie,te),a==="focusout"&&te&&ie.type==="number"&&te.memoizedProps.value!=null&&XO(ie,"number",ie.value)}switch(Ee=te?Lh(te):window,a){case"focusin":(RC(Ee)||Ee.contentEditable==="true")&&(Hl=Ee,s0=te,Xh=null);break;case"focusout":Xh=s0=Hl=null;break;case"mousedown":r0=!0;break;case"contextmenu":case"mouseup":case"dragend":r0=!1,XC(le,f,se);break;case"selectionchange":if(v8)break;case"keydown":case"keyup":XC(le,f,se)}var Xe;if(e0)e:{switch(a){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else Yl?MC(a,f)&&(Je="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(Je="onCompositionStart");Je&&(TC&&f.locale!=="ko"&&(Yl||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&Yl&&(Xe=xC()):(Ro=se,HO="value"in Ro?Ro.value:Ro.textContent,Yl=!0)),Ee=Ap(te,Je),0<Ee.length&&(Je=new CC(Je,a,null,f,se),le.push({event:Je,listeners:Ee}),Xe?Je.data=Xe:(Xe=PC(f),Xe!==null&&(Je.data=Xe)))),(Xe=l8?c8(a,f):h8(a,f))&&(Je=Ap(te,"onBeforeInput"),0<Je.length&&(Ee=new CC("onBeforeInput","beforeinput",null,f,se),le.push({event:Ee,listeners:Je}),Ee.data=Xe)),tj(le,a,te,f,se)}m5(le,h)})}function pu(a,h,f){return{instance:a,listener:h,currentTarget:f}}function Ap(a,h){for(var f=h+"Capture",m=[];a!==null;){var v=a,y=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||y===null||(v=Dh(a,f),v!=null&&m.unshift(pu(a,v,y)),v=Dh(a,h),v!=null&&m.push(pu(a,v,y))),a.tag===3)return m;a=a.return}return[]}function rj(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function O5(a,h,f,m,v){for(var y=h._reactName,C=[];f!==null&&f!==m;){var P=f,W=P.alternate,te=P.stateNode;if(P=P.tag,W!==null&&W===m)break;P!==5&&P!==26&&P!==27||te===null||(W=te,v?(te=Dh(f,y),te!=null&&C.unshift(pu(f,te,W))):v||(te=Dh(f,y),te!=null&&C.push(pu(f,te,W)))),f=f.return}C.length!==0&&a.push({event:h,listeners:C})}var oj=/\r\n?/g,aj=/\u0000|\uFFFD/g;function v5(a){return(typeof a=="string"?a:""+a).replace(oj,`
49
- `).replace(aj,"")}function _5(a,h){return h=v5(h),v5(a)===h}function mt(a,h,f,m,v,y){switch(f){case"children":typeof m=="string"?h==="body"||h==="textarea"&&m===""||ql(a,m):(typeof m=="number"||typeof m=="bigint")&&h!=="body"&&ql(a,""+m);break;case"className":Rd(a,"class",m);break;case"tabIndex":Rd(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Rd(a,f,m);break;case"style":_C(a,m,y);break;case"data":if(h!=="object"){Rd(a,"data",m);break}case"src":case"href":if(m===""&&(h!=="a"||f!=="href")){a.removeAttribute(f);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Ld(""+m),a.setAttribute(f,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(f,"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 y=="function"&&(f==="formAction"?(h!=="input"&&mt(a,h,"name",v.name,v,null),mt(a,h,"formEncType",v.formEncType,v,null),mt(a,h,"formMethod",v.formMethod,v,null),mt(a,h,"formTarget",v.formTarget,v,null)):(mt(a,h,"encType",v.encType,v,null),mt(a,h,"method",v.method,v,null),mt(a,h,"target",v.target,v,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Ld(""+m),a.setAttribute(f,m);break;case"onClick":m!=null&&(a.onclick=zr);break;case"onScroll":m!=null&&Fe("scroll",a);break;case"onScrollEnd":m!=null&&Fe("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(n(61));if(f=m.__html,f!=null){if(v.children!=null)throw Error(n(60));a.innerHTML=f}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}f=Ld(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""+m):a.removeAttribute(f);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":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""):a.removeAttribute(f);break;case"capture":case"download":m===!0?a.setAttribute(f,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,m):a.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(f,m):a.removeAttribute(f);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(f):a.setAttribute(f,m);break;case"popover":Fe("beforetoggle",a),Fe("toggle",a),Pd(a,"popover",m);break;case"xlinkActuate":Nr(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Nr(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Nr(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Nr(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Nr(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Nr(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Nr(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Nr(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Nr(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Pd(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=Dz.get(f)||f,Pd(a,f,m))}}function Mv(a,h,f,m,v,y){switch(f){case"style":_C(a,m,y);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(n(61));if(f=m.__html,f!=null){if(v.children!=null)throw Error(n(60));a.innerHTML=f}}break;case"children":typeof m=="string"?ql(a,m):(typeof m=="number"||typeof m=="bigint")&&ql(a,""+m);break;case"onScroll":m!=null&&Fe("scroll",a);break;case"onScrollEnd":m!=null&&Fe("scrollend",a);break;case"onClick":m!=null&&(a.onclick=zr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hC.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(v=f.endsWith("Capture"),h=f.slice(2,v?f.length-7:void 0),y=a[Sn]||null,y=y!=null?y[f]:null,typeof y=="function"&&a.removeEventListener(h,y,v),typeof m=="function")){typeof y!="function"&&y!==null&&(f in a?a[f]=null:a.hasAttribute(f)&&a.removeAttribute(f)),a.addEventListener(h,m,v);break e}f in a?a[f]=m:m===!0?a.setAttribute(f,""):Pd(a,f,m)}}}function Vi(a,h,f){switch(h){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",a),Fe("load",a);var m=!1,v=!1,y;for(y in f)if(f.hasOwnProperty(y)){var C=f[y];if(C!=null)switch(y){case"src":m=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,h));default:mt(a,h,y,C,f,null)}}v&&mt(a,h,"srcSet",f.srcSet,f,null),m&&mt(a,h,"src",f.src,f,null);return;case"input":Fe("invalid",a);var P=y=C=v=null,W=null,te=null;for(m in f)if(f.hasOwnProperty(m)){var se=f[m];if(se!=null)switch(m){case"name":v=se;break;case"type":C=se;break;case"checked":W=se;break;case"defaultChecked":te=se;break;case"value":y=se;break;case"defaultValue":P=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(n(137,h));break;default:mt(a,h,m,se,f,null)}}mC(a,y,P,W,te,C,v,!1);return;case"select":Fe("invalid",a),m=C=y=null;for(v in f)if(f.hasOwnProperty(v)&&(P=f[v],P!=null))switch(v){case"value":y=P;break;case"defaultValue":C=P;break;case"multiple":m=P;default:mt(a,h,v,P,f,null)}h=y,f=C,a.multiple=!!m,h!=null?Zl(a,!!m,h,!1):f!=null&&Zl(a,!!m,f,!0);return;case"textarea":Fe("invalid",a),y=v=m=null;for(C in f)if(f.hasOwnProperty(C)&&(P=f[C],P!=null))switch(C){case"value":m=P;break;case"defaultValue":v=P;break;case"children":y=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(n(91));break;default:mt(a,h,C,P,f,null)}OC(a,m,v,y);return;case"option":for(W in f)if(f.hasOwnProperty(W)&&(m=f[W],m!=null))switch(W){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:mt(a,h,W,m,f,null)}return;case"dialog":Fe("beforetoggle",a),Fe("toggle",a),Fe("cancel",a),Fe("close",a);break;case"iframe":case"object":Fe("load",a);break;case"video":case"audio":for(m=0;m<du.length;m++)Fe(du[m],a);break;case"image":Fe("error",a),Fe("load",a);break;case"details":Fe("toggle",a);break;case"embed":case"source":case"link":Fe("error",a),Fe("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in f)if(f.hasOwnProperty(te)&&(m=f[te],m!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,h));default:mt(a,h,te,m,f,null)}return;default:if(ZO(h)){for(se in f)f.hasOwnProperty(se)&&(m=f[se],m!==void 0&&Mv(a,h,se,m,f,void 0));return}}for(P in f)f.hasOwnProperty(P)&&(m=f[P],m!=null&&mt(a,h,P,m,f,null))}function lj(a,h,f,m){switch(h){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,y=null,C=null,P=null,W=null,te=null,se=null;for(ne in f){var le=f[ne];if(f.hasOwnProperty(ne)&&le!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":W=le;default:m.hasOwnProperty(ne)||mt(a,h,ne,null,m,le)}}for(var ie in m){var ne=m[ie];if(le=f[ie],m.hasOwnProperty(ie)&&(ne!=null||le!=null))switch(ie){case"type":y=ne;break;case"name":v=ne;break;case"checked":te=ne;break;case"defaultChecked":se=ne;break;case"value":C=ne;break;case"defaultValue":P=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(n(137,h));break;default:ne!==le&&mt(a,h,ie,ne,m,le)}}VO(a,C,P,W,te,se,y,v);return;case"select":ne=C=P=ie=null;for(y in f)if(W=f[y],f.hasOwnProperty(y)&&W!=null)switch(y){case"value":break;case"multiple":ne=W;default:m.hasOwnProperty(y)||mt(a,h,y,null,m,W)}for(v in m)if(y=m[v],W=f[v],m.hasOwnProperty(v)&&(y!=null||W!=null))switch(v){case"value":ie=y;break;case"defaultValue":P=y;break;case"multiple":C=y;default:y!==W&&mt(a,h,v,y,m,W)}h=P,f=C,m=ne,ie!=null?Zl(a,!!f,ie,!1):!!m!=!!f&&(h!=null?Zl(a,!!f,h,!0):Zl(a,!!f,f?[]:"",!1));return;case"textarea":ne=ie=null;for(P in f)if(v=f[P],f.hasOwnProperty(P)&&v!=null&&!m.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:mt(a,h,P,null,m,v)}for(C in m)if(v=m[C],y=f[C],m.hasOwnProperty(C)&&(v!=null||y!=null))switch(C){case"value":ie=v;break;case"defaultValue":ne=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(n(91));break;default:v!==y&&mt(a,h,C,v,m,y)}gC(a,ie,ne);return;case"option":for(var we in f)if(ie=f[we],f.hasOwnProperty(we)&&ie!=null&&!m.hasOwnProperty(we))switch(we){case"selected":a.selected=!1;break;default:mt(a,h,we,null,m,ie)}for(W in m)if(ie=m[W],ne=f[W],m.hasOwnProperty(W)&&ie!==ne&&(ie!=null||ne!=null))switch(W){case"selected":a.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:mt(a,h,W,ie,m,ne)}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 Qe in f)ie=f[Qe],f.hasOwnProperty(Qe)&&ie!=null&&!m.hasOwnProperty(Qe)&&mt(a,h,Qe,null,m,ie);for(te in m)if(ie=m[te],ne=f[te],m.hasOwnProperty(te)&&ie!==ne&&(ie!=null||ne!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(n(137,h));break;default:mt(a,h,te,ie,m,ne)}return;default:if(ZO(h)){for(var gt in f)ie=f[gt],f.hasOwnProperty(gt)&&ie!==void 0&&!m.hasOwnProperty(gt)&&Mv(a,h,gt,void 0,m,ie);for(se in m)ie=m[se],ne=f[se],!m.hasOwnProperty(se)||ie===ne||ie===void 0&&ne===void 0||Mv(a,h,se,ie,m,ne);return}}for(var K in f)ie=f[K],f.hasOwnProperty(K)&&ie!=null&&!m.hasOwnProperty(K)&&mt(a,h,K,null,m,ie);for(le in m)ie=m[le],ne=f[le],!m.hasOwnProperty(le)||ie===ne||ie==null&&ne==null||mt(a,h,le,ie,m,ne)}function y5(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function cj(){if(typeof performance.getEntriesByType=="function"){for(var a=0,h=0,f=performance.getEntriesByType("resource"),m=0;m<f.length;m++){var v=f[m],y=v.transferSize,C=v.initiatorType,P=v.duration;if(y&&P&&y5(C)){for(C=0,P=v.responseEnd,m+=1;m<f.length;m++){var W=f[m],te=W.startTime;if(te>P)break;var se=W.transferSize,le=W.initiatorType;se&&y5(le)&&(W=W.responseEnd,C+=se*(W<P?1:(P-te)/(W-te)))}if(--m,h+=8*(y+C)/(v.duration/1e3),a++,10<a)break}}if(0<a)return h/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Pv=null,Rv=null;function Ep(a){return a.nodeType===9?a:a.ownerDocument}function b5(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function x5(a,h){if(a===0)switch(h){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&h==="foreignObject"?0:a}function Qv(a,h){return a==="textarea"||a==="noscript"||typeof h.children=="string"||typeof h.children=="number"||typeof h.children=="bigint"||typeof h.dangerouslySetInnerHTML=="object"&&h.dangerouslySetInnerHTML!==null&&h.dangerouslySetInnerHTML.__html!=null}var Lv=null;function hj(){var a=window.event;return a&&a.type==="popstate"?a===Lv?!1:(Lv=a,!0):(Lv=null,!1)}var S5=typeof setTimeout=="function"?setTimeout:void 0,uj=typeof clearTimeout=="function"?clearTimeout:void 0,w5=typeof Promise=="function"?Promise:void 0,fj=typeof queueMicrotask=="function"?queueMicrotask:typeof w5<"u"?function(a){return w5.resolve(null).then(a).catch(dj)}:S5;function dj(a){setTimeout(function(){throw a})}function Ho(a){return a==="head"}function C5(a,h){var f=h,m=0;do{var v=f.nextSibling;if(a.removeChild(f),v&&v.nodeType===8)if(f=v.data,f==="/$"||f==="/&"){if(m===0){a.removeChild(v),xc(h);return}m--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")m++;else if(f==="html")mu(a.ownerDocument.documentElement);else if(f==="head"){f=a.ownerDocument.head,mu(f);for(var y=f.firstChild;y;){var C=y.nextSibling,P=y.nodeName;y[Qh]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&y.rel.toLowerCase()==="stylesheet"||f.removeChild(y),y=C}}else f==="body"&&mu(a.ownerDocument.body);f=v}while(f);xc(h)}function k5(a,h){var f=a;a=0;do{var m=f.nextSibling;if(f.nodeType===1?h?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(h?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),m&&m.nodeType===8)if(f=m.data,f==="/$"){if(a===0)break;a--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||a++;f=m}while(f)}function Dv(a){var h=a.firstChild;for(h&&h.nodeType===10&&(h=h.nextSibling);h;){var f=h;switch(h=h.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":Dv(f),jO(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}a.removeChild(f)}}function pj(a,h,f,m){for(;a.nodeType===1;){var v=f;if(a.nodeName.toLowerCase()!==h.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Qh])switch(h){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(y=a.getAttribute("rel"),y==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(y!==v.rel||a.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||a.getAttribute("title")!==(v.title==null?null:v.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(y=a.getAttribute("src"),(y!==(v.src==null?null:v.src)||a.getAttribute("type")!==(v.type==null?null:v.type)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&y&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(h==="input"&&a.type==="hidden"){var y=v.name==null?null:""+v.name;if(v.type==="hidden"&&a.getAttribute("name")===y)return a}else return a;if(a=gs(a.nextSibling),a===null)break}return null}function mj(a,h,f){if(h==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!f||(a=gs(a.nextSibling),a===null))return null;return a}function T5(a,h){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!h||(a=gs(a.nextSibling),a===null))return null;return a}function Bv(a){return a.data==="$?"||a.data==="$~"}function $v(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function gj(a,h){var f=a.ownerDocument;if(a.data==="$~")a._reactRetry=h;else if(a.data!=="$?"||f.readyState!=="loading")h();else{var m=function(){h(),f.removeEventListener("DOMContentLoaded",m)};f.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function gs(a){for(;a!=null;a=a.nextSibling){var h=a.nodeType;if(h===1||h===3)break;if(h===8){if(h=a.data,h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"||h==="F!"||h==="F")break;if(h==="/$"||h==="/&")return null}}return a}var Nv=null;function A5(a){a=a.nextSibling;for(var h=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"||f==="/&"){if(h===0)return gs(a.nextSibling);h--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||h++}a=a.nextSibling}return null}function E5(a){a=a.previousSibling;for(var h=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(h===0)return a;h--}else f!=="/$"&&f!=="/&"||h++}a=a.previousSibling}return null}function M5(a,h,f){switch(h=Ep(f),a){case"html":if(a=h.documentElement,!a)throw Error(n(452));return a;case"head":if(a=h.head,!a)throw Error(n(453));return a;case"body":if(a=h.body,!a)throw Error(n(454));return a;default:throw Error(n(451))}}function mu(a){for(var h=a.attributes;h.length;)a.removeAttributeNode(h[0]);jO(a)}var Os=new Map,P5=new Set;function Mp(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var to=Z.d;Z.d={f:Oj,r:vj,D:_j,C:yj,L:bj,m:xj,X:wj,S:Sj,M:Cj};function Oj(){var a=to.f(),h=bp();return a||h}function vj(a){var h=Il(a);h!==null&&h.tag===5&&h.type==="form"?Yk(h):to.r(a)}var _c=typeof document>"u"?null:document;function R5(a,h,f){var m=_c;if(m&&typeof h=="string"&&h){var v=cs(h);v='link[rel="'+a+'"][href="'+v+'"]',typeof f=="string"&&(v+='[crossorigin="'+f+'"]'),P5.has(v)||(P5.add(v),a={rel:a,crossOrigin:f,href:h},m.querySelector(v)===null&&(h=m.createElement("link"),Vi(h,"link",a),bi(h),m.head.appendChild(h)))}}function _j(a){to.D(a),R5("dns-prefetch",a,null)}function yj(a,h){to.C(a,h),R5("preconnect",a,h)}function bj(a,h,f){to.L(a,h,f);var m=_c;if(m&&a&&h){var v='link[rel="preload"][as="'+cs(h)+'"]';h==="image"&&f&&f.imageSrcSet?(v+='[imagesrcset="'+cs(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(v+='[imagesizes="'+cs(f.imageSizes)+'"]')):v+='[href="'+cs(a)+'"]';var y=v;switch(h){case"style":y=yc(a);break;case"script":y=bc(a)}Os.has(y)||(a=p({rel:"preload",href:h==="image"&&f&&f.imageSrcSet?void 0:a,as:h},f),Os.set(y,a),m.querySelector(v)!==null||h==="style"&&m.querySelector(gu(y))||h==="script"&&m.querySelector(Ou(y))||(h=m.createElement("link"),Vi(h,"link",a),bi(h),m.head.appendChild(h)))}}function xj(a,h){to.m(a,h);var f=_c;if(f&&a){var m=h&&typeof h.as=="string"?h.as:"script",v='link[rel="modulepreload"][as="'+cs(m)+'"][href="'+cs(a)+'"]',y=v;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=bc(a)}if(!Os.has(y)&&(a=p({rel:"modulepreload",href:a},h),Os.set(y,a),f.querySelector(v)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Ou(y)))return}m=f.createElement("link"),Vi(m,"link",a),bi(m),f.head.appendChild(m)}}}function Sj(a,h,f){to.S(a,h,f);var m=_c;if(m&&a){var v=Vl(m).hoistableStyles,y=yc(a);h=h||"default";var C=v.get(y);if(!C){var P={loading:0,preload:null};if(C=m.querySelector(gu(y)))P.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":h},f),(f=Os.get(y))&&zv(a,f);var W=C=m.createElement("link");bi(W),Vi(W,"link",a),W._p=new Promise(function(te,se){W.onload=te,W.onerror=se}),W.addEventListener("load",function(){P.loading|=1}),W.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Pp(C,h,m)}C={type:"stylesheet",instance:C,count:1,state:P},v.set(y,C)}}}function wj(a,h){to.X(a,h);var f=_c;if(f&&a){var m=Vl(f).hoistableScripts,v=bc(a),y=m.get(v);y||(y=f.querySelector(Ou(v)),y||(a=p({src:a,async:!0},h),(h=Os.get(v))&&jv(a,h),y=f.createElement("script"),bi(y),Vi(y,"link",a),f.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},m.set(v,y))}}function Cj(a,h){to.M(a,h);var f=_c;if(f&&a){var m=Vl(f).hoistableScripts,v=bc(a),y=m.get(v);y||(y=f.querySelector(Ou(v)),y||(a=p({src:a,async:!0,type:"module"},h),(h=Os.get(v))&&jv(a,h),y=f.createElement("script"),bi(y),Vi(y,"link",a),f.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},m.set(v,y))}}function Q5(a,h,f,m){var v=(v=fe.current)?Mp(v):null;if(!v)throw Error(n(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(h=yc(f.href),f=Vl(v).hoistableStyles,m=f.get(h),m||(m={type:"style",instance:null,count:0,state:null},f.set(h,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=yc(f.href);var y=Vl(v).hoistableStyles,C=y.get(a);if(C||(v=v.ownerDocument||v,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(a,C),(y=v.querySelector(gu(a)))&&!y._p&&(C.instance=y,C.state.loading=5),Os.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Os.set(a,f),y||kj(v,a,f,C.state))),h&&m===null)throw Error(n(528,""));return C}if(h&&m!==null)throw Error(n(529,""));return null;case"script":return h=f.async,f=f.src,typeof f=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=bc(f),f=Vl(v).hoistableScripts,m=f.get(h),m||(m={type:"script",instance:null,count:0,state:null},f.set(h,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,a))}}function yc(a){return'href="'+cs(a)+'"'}function gu(a){return'link[rel="stylesheet"]['+a+"]"}function L5(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function kj(a,h,f,m){a.querySelector('link[rel="preload"][as="style"]['+h+"]")?m.loading=1:(h=a.createElement("link"),m.preload=h,h.addEventListener("load",function(){return m.loading|=1}),h.addEventListener("error",function(){return m.loading|=2}),Vi(h,"link",f),bi(h),a.head.appendChild(h))}function bc(a){return'[src="'+cs(a)+'"]'}function Ou(a){return"script[async]"+a}function D5(a,h,f){if(h.count++,h.instance===null)switch(h.type){case"style":var m=a.querySelector('style[data-href~="'+cs(f.href)+'"]');if(m)return h.instance=m,bi(m),m;var v=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),bi(m),Vi(m,"style",v),Pp(m,f.precedence,a),h.instance=m;case"stylesheet":v=yc(f.href);var y=a.querySelector(gu(v));if(y)return h.state.loading|=4,h.instance=y,bi(y),y;m=L5(f),(v=Os.get(v))&&zv(m,v),y=(a.ownerDocument||a).createElement("link"),bi(y);var C=y;return C._p=new Promise(function(P,W){C.onload=P,C.onerror=W}),Vi(y,"link",m),h.state.loading|=4,Pp(y,f.precedence,a),h.instance=y;case"script":return y=bc(f.src),(v=a.querySelector(Ou(y)))?(h.instance=v,bi(v),v):(m=f,(v=Os.get(y))&&(m=p({},f),jv(m,v)),a=a.ownerDocument||a,v=a.createElement("script"),bi(v),Vi(v,"link",m),a.head.appendChild(v),h.instance=v);case"void":return null;default:throw Error(n(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(m=h.instance,h.state.loading|=4,Pp(m,f.precedence,a));return h.instance}function Pp(a,h,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=m.length?m[m.length-1]:null,y=v,C=0;C<m.length;C++){var P=m[C];if(P.dataset.precedence===h)y=P;else if(y!==v)break}y?y.parentNode.insertBefore(a,y.nextSibling):(h=f.nodeType===9?f.head:f,h.insertBefore(a,h.firstChild))}function zv(a,h){a.crossOrigin==null&&(a.crossOrigin=h.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=h.referrerPolicy),a.title==null&&(a.title=h.title)}function jv(a,h){a.crossOrigin==null&&(a.crossOrigin=h.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=h.referrerPolicy),a.integrity==null&&(a.integrity=h.integrity)}var Rp=null;function B5(a,h,f){if(Rp===null){var m=new Map,v=Rp=new Map;v.set(f,m)}else v=Rp,m=v.get(f),m||(m=new Map,v.set(f,m));if(m.has(a))return m;for(m.set(a,null),f=f.getElementsByTagName(a),v=0;v<f.length;v++){var y=f[v];if(!(y[Qh]||y[Ni]||a==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var C=y.getAttribute(h)||"";C=a+C;var P=m.get(C);P?P.push(y):m.set(C,[y])}}return m}function $5(a,h,f){a=a.ownerDocument||a,a.head.insertBefore(f,h==="title"?a.querySelector("head > title"):null)}function Tj(a,h,f){if(f===1||h.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return a=h.disabled,typeof h.precedence=="string"&&a==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function N5(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function Aj(a,h,f,m){if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var v=yc(m.href),y=h.querySelector(gu(v));if(y){h=y._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(a.count++,a=Qp.bind(a),h.then(a,a)),f.state.loading|=4,f.instance=y,bi(y);return}y=h.ownerDocument||h,m=L5(m),(v=Os.get(v))&&zv(m,v),y=y.createElement("link"),bi(y);var C=y;C._p=new Promise(function(P,W){C.onload=P,C.onerror=W}),Vi(y,"link",m),f.instance=y}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,h),(h=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=Qp.bind(a),h.addEventListener("load",f),h.addEventListener("error",f))}}var Iv=0;function Ej(a,h){return a.stylesheets&&a.count===0&&Dp(a,a.stylesheets),0<a.count||0<a.imgCount?function(f){var m=setTimeout(function(){if(a.stylesheets&&Dp(a,a.stylesheets),a.unsuspend){var y=a.unsuspend;a.unsuspend=null,y()}},6e4+h);0<a.imgBytes&&Iv===0&&(Iv=62500*cj());var v=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Dp(a,a.stylesheets),a.unsuspend)){var y=a.unsuspend;a.unsuspend=null,y()}},(a.imgBytes>Iv?50:800)+h);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(v)}}:null}function Qp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dp(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Lp=null;function Dp(a,h){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Lp=new Map,h.forEach(Mj,a),Lp=null,Qp.call(a))}function Mj(a,h){if(!(h.state.loading&4)){var f=Lp.get(a);if(f)var m=f.get(null);else{f=new Map,Lp.set(a,f);for(var v=a.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<v.length;y++){var C=v[y];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(f.set(C.dataset.precedence,C),m=C)}m&&f.set(null,m)}v=h.instance,C=v.getAttribute("data-precedence"),y=f.get(C)||m,y===m&&f.set(null,v),f.set(C,v),this.count++,m=Qp.bind(this),v.addEventListener("load",m),v.addEventListener("error",m),y?y.parentNode.insertBefore(v,y.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(v,a.firstChild)),h.state.loading|=4}}var vu={$$typeof:k,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function Pj(a,h,f,m,v,y,C,P,W){this.tag=1,this.containerInfo=a,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=BO(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=BO(0),this.hiddenUpdates=BO(null),this.identifierPrefix=m,this.onUncaughtError=v,this.onCaughtError=y,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function z5(a,h,f,m,v,y,C,P,W,te,se,le){return a=new Pj(a,h,f,C,W,te,se,le,P),h=1,y===!0&&(h|=24),y=Xn(3,null,null,h),a.current=y,y.stateNode=a,h=y0(),h.refCount++,a.pooledCache=h,h.refCount++,y.memoizedState={element:m,isDehydrated:f,cache:h},w0(y),a}function j5(a){return a?(a=Kl,a):Kl}function I5(a,h,f,m,v,y){v=j5(v),m.context===null?m.context=v:m.pendingContext=v,m=No(h),m.payload={element:f},y=y===void 0?null:y,y!==null&&(m.callback=y),f=zo(a,m,h),f!==null&&(En(f,a,h),Fh(f,a,h))}function V5(a,h){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<h?f:h}}function Vv(a,h){V5(a,h),(a=a.alternate)&&V5(a,h)}function X5(a){if(a.tag===13||a.tag===31){var h=Ia(a,67108864);h!==null&&En(h,a,67108864),Vv(a,67108864)}}function Z5(a){if(a.tag===13||a.tag===31){var h=Yn();h=$O(h);var f=Ia(a,h);f!==null&&En(f,a,h),Vv(a,h)}}var Bp=!0;function Rj(a,h,f,m){var v=B.T;B.T=null;var y=Z.p;try{Z.p=2,Xv(a,h,f,m)}finally{Z.p=y,B.T=v}}function Qj(a,h,f,m){var v=B.T;B.T=null;var y=Z.p;try{Z.p=8,Xv(a,h,f,m)}finally{Z.p=y,B.T=v}}function Xv(a,h,f,m){if(Bp){var v=Zv(m);if(v===null)Ev(a,h,m,$p,f),W5(a,m);else if(Dj(v,a,h,f,m))m.stopPropagation();else if(W5(a,m),h&4&&-1<Lj.indexOf(a)){for(;v!==null;){var y=Il(v);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var C=Ba(y.pendingLanes);if(C!==0){var P=y;for(P.pendingLanes|=2,P.entangledLanes|=2;C;){var W=1<<31-_t(C);P.entanglements[1]|=W,C&=~W}nr(y),(ot&6)===0&&(_p=cn()+500,fu(0))}}break;case 31:case 13:P=Ia(y,2),P!==null&&En(P,y,2),bp(),Vv(y,2)}if(y=Zv(m),y===null&&Ev(a,h,m,$p,f),y===v)break;v=y}v!==null&&m.stopPropagation()}else Ev(a,h,m,null,f)}}function Zv(a){return a=WO(a),qv(a)}var $p=null;function qv(a){if($p=null,a=jl(a),a!==null){var h=r(a);if(h===null)a=null;else{var f=h.tag;if(f===13){if(a=o(h),a!==null)return a;a=null}else if(f===31){if(a=l(h),a!==null)return a;a=null}else if(f===3){if(h.stateNode.current.memoizedState.isDehydrated)return h.tag===3?h.stateNode.containerInfo:null;a=null}else h!==a&&(a=null)}}return $p=a,null}function q5(a){switch(a){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(DO()){case oe:return 2;case ge:return 8;case De:case Ye:return 32;case ht:return 268435456;default:return 32}default:return 32}}var Wv=!1,Fo=null,Go=null,Ko=null,_u=new Map,yu=new Map,Jo=[],Lj="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 W5(a,h){switch(a){case"focusin":case"focusout":Fo=null;break;case"dragenter":case"dragleave":Go=null;break;case"mouseover":case"mouseout":Ko=null;break;case"pointerover":case"pointerout":_u.delete(h.pointerId);break;case"gotpointercapture":case"lostpointercapture":yu.delete(h.pointerId)}}function bu(a,h,f,m,v,y){return a===null||a.nativeEvent!==y?(a={blockedOn:h,domEventName:f,eventSystemFlags:m,nativeEvent:y,targetContainers:[v]},h!==null&&(h=Il(h),h!==null&&X5(h)),a):(a.eventSystemFlags|=m,h=a.targetContainers,v!==null&&h.indexOf(v)===-1&&h.push(v),a)}function Dj(a,h,f,m,v){switch(h){case"focusin":return Fo=bu(Fo,a,h,f,m,v),!0;case"dragenter":return Go=bu(Go,a,h,f,m,v),!0;case"mouseover":return Ko=bu(Ko,a,h,f,m,v),!0;case"pointerover":var y=v.pointerId;return _u.set(y,bu(_u.get(y)||null,a,h,f,m,v)),!0;case"gotpointercapture":return y=v.pointerId,yu.set(y,bu(yu.get(y)||null,a,h,f,m,v)),!0}return!1}function U5(a){var h=jl(a.target);if(h!==null){var f=r(h);if(f!==null){if(h=f.tag,h===13){if(h=o(f),h!==null){a.blockedOn=h,aC(a.priority,function(){Z5(f)});return}}else if(h===31){if(h=l(f),h!==null){a.blockedOn=h,aC(a.priority,function(){Z5(f)});return}}else if(h===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Np(a){if(a.blockedOn!==null)return!1;for(var h=a.targetContainers;0<h.length;){var f=Zv(a.nativeEvent);if(f===null){f=a.nativeEvent;var m=new f.constructor(f.type,f);qO=m,f.target.dispatchEvent(m),qO=null}else return h=Il(f),h!==null&&X5(h),a.blockedOn=f,!1;h.shift()}return!0}function Y5(a,h,f){Np(a)&&f.delete(h)}function Bj(){Wv=!1,Fo!==null&&Np(Fo)&&(Fo=null),Go!==null&&Np(Go)&&(Go=null),Ko!==null&&Np(Ko)&&(Ko=null),_u.forEach(Y5),yu.forEach(Y5)}function zp(a,h){a.blockedOn===h&&(a.blockedOn=null,Wv||(Wv=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bj)))}var jp=null;function H5(a){jp!==a&&(jp=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===a&&(jp=null);for(var h=0;h<a.length;h+=3){var f=a[h],m=a[h+1],v=a[h+2];if(typeof m!="function"){if(qv(m||f)===null)continue;break}var y=Il(f);y!==null&&(a.splice(h,3),h-=3,Z0(y,{pending:!0,data:v,method:f.method,action:m},m,v))}}))}function xc(a){function h(W){return zp(W,a)}Fo!==null&&zp(Fo,a),Go!==null&&zp(Go,a),Ko!==null&&zp(Ko,a),_u.forEach(h),yu.forEach(h);for(var f=0;f<Jo.length;f++){var m=Jo[f];m.blockedOn===a&&(m.blockedOn=null)}for(;0<Jo.length&&(f=Jo[0],f.blockedOn===null);)U5(f),f.blockedOn===null&&Jo.shift();if(f=(a.ownerDocument||a).$$reactFormReplay,f!=null)for(m=0;m<f.length;m+=3){var v=f[m],y=f[m+1],C=v[Sn]||null;if(typeof y=="function")C||H5(f);else if(C){var P=null;if(y&&y.hasAttribute("formAction")){if(v=y,C=y[Sn]||null)P=C.formAction;else if(qv(v)!==null)continue}else P=C.action;typeof P=="function"?f[m+1]=P:(f.splice(m,3),m-=3),H5(f)}}}function F5(){function a(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(C){return v=C})},focusReset:"manual",scroll:"manual"})}function h(){v!==null&&(v(),v=null),m||setTimeout(f,20)}function f(){if(!m&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,v=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",h),navigation.addEventListener("navigateerror",h),setTimeout(f,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",h),navigation.removeEventListener("navigateerror",h),v!==null&&(v(),v=null)}}}function Uv(a){this._internalRoot=a}Ip.prototype.render=Uv.prototype.render=function(a){var h=this._internalRoot;if(h===null)throw Error(n(409));var f=h.current,m=Yn();I5(f,m,a,h,null,null)},Ip.prototype.unmount=Uv.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var h=a.containerInfo;I5(a.current,2,null,a,null,null),bp(),h[zl]=null}};function Ip(a){this._internalRoot=a}Ip.prototype.unstable_scheduleHydration=function(a){if(a){var h=oC();a={blockedOn:null,target:a,priority:h};for(var f=0;f<Jo.length&&h!==0&&h<Jo[f].priority;f++);Jo.splice(f,0,a),f===0&&U5(a)}};var G5=e.version;if(G5!=="19.2.4")throw Error(n(527,G5,"19.2.4"));Z.findDOMNode=function(a){var h=a._reactInternals;if(h===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=u(h),a=a!==null?d(a):null,a=a===null?null:a.stateNode,a};var $j={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{hn=Vp.inject($j),fi=Vp}catch{}}return Su.createRoot=function(a,h){if(!s(a))throw Error(n(299));var f=!1,m="",v=s2,y=r2,C=o2;return h!=null&&(h.unstable_strictMode===!0&&(f=!0),h.identifierPrefix!==void 0&&(m=h.identifierPrefix),h.onUncaughtError!==void 0&&(v=h.onUncaughtError),h.onCaughtError!==void 0&&(y=h.onCaughtError),h.onRecoverableError!==void 0&&(C=h.onRecoverableError)),h=z5(a,1,!1,null,null,f,m,null,v,y,C,F5),a[zl]=h.current,Av(a),new Uv(h)},Su.hydrateRoot=function(a,h,f){if(!s(a))throw Error(n(299));var m=!1,v="",y=s2,C=r2,P=o2,W=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(v=f.identifierPrefix),f.onUncaughtError!==void 0&&(y=f.onUncaughtError),f.onCaughtError!==void 0&&(C=f.onCaughtError),f.onRecoverableError!==void 0&&(P=f.onRecoverableError),f.formState!==void 0&&(W=f.formState)),h=z5(a,1,!0,h,f??null,m,v,W,y,C,P,F5),h.context=j5(null),f=h.current,m=Yn(),m=$O(m),v=No(m),v.callback=null,zo(f,v,m),f=m,h.current.lanes=f,Rh(h,f),nr(h),a[zl]=h.current,Av(a),new Ip(h)},Su.version="19.2.4",Su}var aT;function Uj(){if(aT)return Fv.exports;aT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Fv.exports=Wj(),Fv.exports}var Yj=Uj();const iL=I.createContext({connected:!1,lastChange:0,lifecycleEvent:null,pendingQuestionCount:0,onQuestionReceivedRef:{current:null}}),lT=2e3,Hj=3e4,Fj=1.5;function Gj({children:t}){const[e,i]=I.useState(!1),[n,s]=I.useState(0),[r,o]=I.useState(null),[l,c]=I.useState(0),u=I.useRef(null),d=I.useRef(null),p=I.useRef(lT),g=I.useRef(null);return I.useEffect(()=>{function O(){const b=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws`,S=new WebSocket(b);u.current=S,S.onopen=()=>{i(!0),p.current=lT},S.onclose=()=>{i(!1),u.current=null;const w=p.current;p.current=Math.min(w*Fj,Hj),d.current=setTimeout(O,w)},S.onmessage=w=>{var T,k;try{const A=JSON.parse(w.data);switch(A.type){case"file-changes":typeof A.timestamp=="number"&&s(A.timestamp);break;case"question-received":{const R=A.question,E={id:R.id,header:"Question",question:R.question,multiSelect:!1,options:(R.options||[]).map($=>({id:$.value,label:$.label,description:$.description||""}))};(T=g.current)==null||T.call(g,[E]),c(A.queueLength??0);break}case"questions-queued":{const R=(A.questions||[]).map(E=>({id:E.id,header:"Question",question:E.question,multiSelect:!1,options:(E.options||[]).map($=>({id:$.value,label:$.label,description:$.description||""}))}));(k=g.current)==null||k.call(g,R),c(A.count??0);break}case"answer-given":c(A.remainingQueue??0);break;case"lifecycle":o(A.event);break}}catch{}},S.onerror=()=>{console.warn("[ws-provider] WebSocket error occurred")}}return O(),()=>{d.current!==null&&(clearTimeout(d.current),d.current=null),u.current&&(u.current.onclose=null,u.current.close(),u.current=null)}},[]),x.jsx(iL.Provider,{value:{connected:e,lastChange:n,lifecycleEvent:r,pendingQuestionCount:l,onQuestionReceivedRef:g},children:t})}function Rr(){return I.useContext(iL)}function Kj(t,e){switch(e.type){case"SET_TAB":return{...t,activeTab:e.tab,expandedCardId:null};case"SET_EXPANDED":return{...t,expandedCardId:e.cardId};case"SET_INPUT":return{...t,inputValues:{...t.inputValues,[e.cardId]:e.value}};case"RESET":return{activeTab:"plan",expandedCardId:null,inputValues:{}};default:return t}}const Jj={activeTab:"plan",expandedCardId:null,inputValues:{}},nL=I.createContext(null);function e7({children:t}){const[e,i]=I.useReducer(Kj,Jj),n=I.useCallback(l=>i({type:"SET_TAB",tab:l}),[]),s=I.useCallback(l=>i({type:"SET_EXPANDED",cardId:l}),[]),r=I.useCallback((l,c)=>i({type:"SET_INPUT",cardId:l,value:c}),[]),o=I.useCallback(()=>i({type:"RESET"}),[]);return x.jsx(nL.Provider,{value:{...e,setTab:n,setExpanded:s,setInput:r,reset:o},children:t})}function rO(){const t=I.useContext(nL);if(!t)throw new Error("useSimpleMode must be used within SimpleModeProvider");return t}const sL={phase:"idle",questions:[],currentQuestion:null,answeredQuestions:[],answerCount:0};function t7(t,e){switch(e.type){case"START_DISCUSSION":return{...t,phase:"loading"};case"QUESTIONS_RECEIVED":{const[i,...n]=e.questions;return{...t,phase:i?"active":t.phase,currentQuestion:i??null,questions:[...t.questions,...n]}}case"SUBMIT_ANSWER":return{...t,phase:"submitting",answeredQuestions:[...t.answeredQuestions,e.answer],answerCount:t.answerCount+1};case"ANSWER_ACCEPTED":{const[i,...n]=t.questions;return{...t,phase:i?"active":"loading",currentQuestion:i??null,questions:n}}case"SUBMIT_FAILED":return{...t,phase:"active",answeredQuestions:t.answeredQuestions.slice(0,-1),answerCount:Math.max(0,t.answerCount-1)};case"ASK_MORE":return{...t,phase:"loading"};case"DONE_EXECUTE":return{...t,phase:"complete",currentQuestion:null,questions:[]};case"RESET":return sL;default:return t}}const rL=I.createContext(null);function i7({children:t}){const[e,i]=I.useReducer(t7,sL),n=I.useRef(null),s=I.useRef(null),r=I.useCallback(()=>{i({type:"START_DISCUSSION"})},[]),o=I.useCallback(p=>{i({type:"QUESTIONS_RECEIVED",questions:p})},[]),l=I.useCallback(async p=>{i({type:"SUBMIT_ANSWER",answer:p});const g=p.freeText.trim()?p.freeText:p.selectedLabels.join(", ");try{const O=await fetch("/api/mcp-answer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({questionId:p.questionId,answer:g})});if(!O.ok){console.error("[discussion] Answer rejected by server:",O.status),i({type:"SUBMIT_FAILED"});return}}catch(O){console.error("[discussion] Failed to submit answer:",O),i({type:"SUBMIT_FAILED"});return}i({type:"ANSWER_ACCEPTED"})},[]),c=I.useCallback(()=>{i({type:"ASK_MORE"})},[]),u=I.useCallback(()=>{var p;i({type:"DONE_EXECUTE"}),(p=s.current)==null||p.call(s)},[]),d=I.useCallback(()=>{i({type:"RESET"})},[]);return x.jsx(rL.Provider,{value:{...e,startDiscussion:r,receiveQuestions:o,submitAnswer:l,askMore:c,doneExecute:u,resetDiscussion:d,onQuestionReceived:n,onExecutionQueued:s},children:t})}function Ux(){const t=I.useContext(rL);if(!t)throw new Error("useDiscussion must be used within DiscussionProvider");return t}function So(){const{lastChange:t}=Rr(),[e,i]=I.useState(null),[n,s]=I.useState(null),[r,o]=I.useState(null),[l,c]=I.useState(!0),[u,d]=I.useState(null),p=I.useCallback(async()=>{try{d(null);const[g,O,_]=await Promise.all([fetch("/api/roadmap"),fetch("/api/state"),fetch("/api/todos")]);if(!g.ok&&g.status!==404)throw new Error(`Roadmap fetch failed: ${g.status}`);if(!O.ok&&O.status!==404)throw new Error(`State fetch failed: ${O.status}`);if(!_.ok)throw new Error(`Todos fetch failed: ${_.status}`);const b=g.ok?await g.json():null,S=O.ok?await O.json():null,w=_.ok?await _.json():{pending:[],completed:[]};i(b),s(S),o(w)}catch(g){const O=g instanceof Error?g.message:"Failed to fetch dashboard data";d(O),console.error("[use-dashboard-data]",O)}finally{c(!1)}},[]);return I.useEffect(()=>{p()},[p]),I.useEffect(()=>{t>0&&p()},[t,p]),{roadmap:e,state:n,todos:r,loading:l,error:u}}const Yx=I.createContext({});function Hx(t){const e=I.useRef(null);return e.current===null&&(e.current=t()),e.current}const oL=typeof window<"u",aL=oL?I.useLayoutEffect:I.useEffect,oO=I.createContext(null);function Fx(t,e){t.indexOf(e)===-1&&t.push(e)}function cg(t,e){const i=t.indexOf(e);i>-1&&t.splice(i,1)}const Ar=(t,e,i)=>i>e?e:i<t?t:i;let Gx=()=>{};const vo={},lL=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function cL(t){return typeof t=="object"&&t!==null}const hL=t=>/^0[^.\s]+$/u.test(t);function uL(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ps=t=>t,n7=(t,e)=>i=>e(t(i)),od=(...t)=>t.reduce(n7),Cf=(t,e,i)=>{const n=e-t;return n===0?1:(i-t)/n};class Kx{constructor(){this.subscriptions=[]}add(e){return Fx(this.subscriptions,e),()=>cg(this.subscriptions,e)}notify(e,i,n){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,i,n);else for(let r=0;r<s;r++){const o=this.subscriptions[r];o&&o(e,i,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ws=t=>t*1e3,Cs=t=>t/1e3;function fL(t,e){return e?t*(1e3/e):0}const dL=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t,s7=1e-7,r7=12;function o7(t,e,i,n,s){let r,o,l=0;do o=e+(i-e)/2,r=dL(o,n,s)-t,r>0?i=o:e=o;while(Math.abs(r)>s7&&++l<r7);return o}function ad(t,e,i,n){if(t===e&&i===n)return Ps;const s=r=>o7(r,0,1,t,i);return r=>r===0||r===1?r:dL(s(r),e,n)}const pL=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,mL=t=>e=>1-t(1-e),gL=ad(.33,1.53,.69,.99),Jx=mL(gL),OL=pL(Jx),vL=t=>(t*=2)<1?.5*Jx(t):.5*(2-Math.pow(2,-10*(t-1))),eS=t=>1-Math.sin(Math.acos(t)),_L=mL(eS),yL=pL(eS),a7=ad(.42,0,1,1),l7=ad(0,0,.58,1),bL=ad(.42,0,.58,1),c7=t=>Array.isArray(t)&&typeof t[0]!="number",xL=t=>Array.isArray(t)&&typeof t[0]=="number",h7={linear:Ps,easeIn:a7,easeInOut:bL,easeOut:l7,circIn:eS,circInOut:yL,circOut:_L,backIn:Jx,backInOut:OL,backOut:gL,anticipate:vL},u7=t=>typeof t=="string",cT=t=>{if(xL(t)){Gx(t.length===4);const[e,i,n,s]=t;return ad(e,i,n,s)}else if(u7(t))return h7[t];return t},Xp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function f7(t,e){let i=new Set,n=new Set,s=!1,r=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(u.schedule(d),t()),d(l)}const u={schedule:(d,p=!1,g=!1)=>{const _=g&&s?i:n;return p&&o.add(d),_.has(d)||_.add(d),d},cancel:d=>{n.delete(d),o.delete(d)},process:d=>{if(l=d,s){r=!0;return}s=!0,[i,n]=[n,i],i.forEach(c),i.clear(),s=!1,r&&(r=!1,u.process(d))}};return u}const d7=40;function SL(t,e){let i=!1,n=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>i=!0,o=Xp.reduce((k,A)=>(k[A]=f7(r),k),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:p,preRender:g,render:O,postRender:_}=o,b=()=>{const k=vo.useManualTiming?s.timestamp:performance.now();i=!1,vo.useManualTiming||(s.delta=n?1e3/60:Math.max(Math.min(k-s.timestamp,d7),1)),s.timestamp=k,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),d.process(s),p.process(s),g.process(s),O.process(s),_.process(s),s.isProcessing=!1,i&&e&&(n=!1,t(b))},S=()=>{i=!0,n=!0,s.isProcessing||t(b)};return{schedule:Xp.reduce((k,A)=>{const R=o[A];return k[A]=(E,$=!1,N=!1)=>(i||S(),R.schedule(E,$,N)),k},{}),cancel:k=>{for(let A=0;A<Xp.length;A++)o[Xp[A]].cancel(k)},state:s,steps:o}}const{schedule:Tt,cancel:Sa,state:qi,steps:e_}=SL(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ps,!0);let Lm;function p7(){Lm=void 0}const On={now:()=>(Lm===void 0&&On.set(qi.isProcessing||vo.useManualTiming?qi.timestamp:performance.now()),Lm),set:t=>{Lm=t,queueMicrotask(p7)}},wL=t=>e=>typeof e=="string"&&e.startsWith(t),CL=wL("--"),m7=wL("var(--"),tS=t=>m7(t)?g7.test(t.split("/*")[0].trim()):!1,g7=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function hT(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const gh={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},kf={...gh,transform:t=>Ar(0,1,t)},Zp={...gh,default:1},lf=t=>Math.round(t*1e5)/1e5,iS=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function O7(t){return t==null}const v7=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,nS=(t,e)=>i=>!!(typeof i=="string"&&v7.test(i)&&i.startsWith(t)||e&&!O7(i)&&Object.prototype.hasOwnProperty.call(i,e)),kL=(t,e,i)=>n=>{if(typeof n!="string")return n;const[s,r,o,l]=n.match(iS);return{[t]:parseFloat(s),[e]:parseFloat(r),[i]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},_7=t=>Ar(0,255,t),t_={...gh,transform:t=>Math.round(_7(t))},pl={test:nS("rgb","red"),parse:kL("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:n=1})=>"rgba("+t_.transform(t)+", "+t_.transform(e)+", "+t_.transform(i)+", "+lf(kf.transform(n))+")"};function y7(t){let e="",i="",n="",s="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),n=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),n=t.substring(3,4),s=t.substring(4,5),e+=e,i+=i,n+=n,s+=s),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:s?parseInt(s,16)/255:1}}const O1={test:nS("#"),parse:y7,transform:pl.transform},ld=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ha=ld("deg"),wr=ld("%"),Te=ld("px"),b7=ld("vh"),x7=ld("vw"),uT={...wr,parse:t=>wr.parse(t)/100,transform:t=>wr.transform(t*100)},Lc={test:nS("hsl","hue"),parse:kL("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:n=1})=>"hsla("+Math.round(t)+", "+wr.transform(lf(e))+", "+wr.transform(lf(i))+", "+lf(kf.transform(n))+")"},ai={test:t=>pl.test(t)||O1.test(t)||Lc.test(t),parse:t=>pl.test(t)?pl.parse(t):Lc.test(t)?Lc.parse(t):O1.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?pl.transform(t):Lc.transform(t),getAnimatableNone:t=>{const e=ai.parse(t);return e.alpha=0,ai.transform(e)}},S7=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function w7(t){var e,i;return isNaN(t)&&typeof t=="string"&&(((e=t.match(iS))==null?void 0:e.length)||0)+(((i=t.match(S7))==null?void 0:i.length)||0)>0}const TL="number",AL="color",C7="var",k7="var(",fT="${}",T7=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Tf(t){const e=t.toString(),i=[],n={color:[],number:[],var:[]},s=[];let r=0;const l=e.replace(T7,c=>(ai.test(c)?(n.color.push(r),s.push(AL),i.push(ai.parse(c))):c.startsWith(k7)?(n.var.push(r),s.push(C7),i.push(c)):(n.number.push(r),s.push(TL),i.push(parseFloat(c))),++r,fT)).split(fT);return{values:i,split:l,indexes:n,types:s}}function EL(t){return Tf(t).values}function ML(t){const{split:e,types:i}=Tf(t),n=e.length;return s=>{let r="";for(let o=0;o<n;o++)if(r+=e[o],s[o]!==void 0){const l=i[o];l===TL?r+=lf(s[o]):l===AL?r+=ai.transform(s[o]):r+=s[o]}return r}}const A7=t=>typeof t=="number"?0:ai.test(t)?ai.getAnimatableNone(t):t;function E7(t){const e=EL(t);return ML(t)(e.map(A7))}const Us={test:w7,parse:EL,createTransformer:ML,getAnimatableNone:E7};function i_(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+(e-t)*6*i:i<1/2?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function M7({hue:t,saturation:e,lightness:i,alpha:n}){t/=360,e/=100,i/=100;let s=0,r=0,o=0;if(!e)s=r=o=i;else{const l=i<.5?i*(1+e):i+e-i*e,c=2*i-l;s=i_(c,l,t+1/3),r=i_(c,l,t),o=i_(c,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:n}}function hg(t,e){return i=>i>0?e:t}const zt=(t,e,i)=>t+(e-t)*i,n_=(t,e,i)=>{const n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},P7=[O1,pl,Lc],R7=t=>P7.find(e=>e.test(t));function dT(t){const e=R7(t);if(!e)return!1;let i=e.parse(t);return e===Lc&&(i=M7(i)),i}const pT=(t,e)=>{const i=dT(t),n=dT(e);if(!i||!n)return hg(t,e);const s={...i};return r=>(s.red=n_(i.red,n.red,r),s.green=n_(i.green,n.green,r),s.blue=n_(i.blue,n.blue,r),s.alpha=zt(i.alpha,n.alpha,r),pl.transform(s))},v1=new Set(["none","hidden"]);function Q7(t,e){return v1.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}function L7(t,e){return i=>zt(t,e,i)}function sS(t){return typeof t=="number"?L7:typeof t=="string"?tS(t)?hg:ai.test(t)?pT:$7:Array.isArray(t)?PL:typeof t=="object"?ai.test(t)?pT:D7:hg}function PL(t,e){const i=[...t],n=i.length,s=t.map((r,o)=>sS(r)(r,e[o]));return r=>{for(let o=0;o<n;o++)i[o]=s[o](r);return i}}function D7(t,e){const i={...t,...e},n={};for(const s in i)t[s]!==void 0&&e[s]!==void 0&&(n[s]=sS(t[s])(t[s],e[s]));return s=>{for(const r in n)i[r]=n[r](s);return i}}function B7(t,e){const i=[],n={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][n[r]],l=t.values[o]??0;i[s]=l,n[r]++}return i}const $7=(t,e)=>{const i=Us.createTransformer(e),n=Tf(t),s=Tf(e);return n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length?v1.has(t)&&!s.values.length||v1.has(e)&&!n.values.length?Q7(t,e):od(PL(B7(n,s),s.values),i):hg(t,e)};function RL(t,e,i){return typeof t=="number"&&typeof e=="number"&&typeof i=="number"?zt(t,e,i):sS(t)(t,e)}const N7=t=>{const e=({timestamp:i})=>t(i);return{start:(i=!0)=>Tt.update(e,i),stop:()=>Sa(e),now:()=>qi.isProcessing?qi.timestamp:On.now()}},QL=(t,e,i=10)=>{let n="";const s=Math.max(Math.round(e/i),2);for(let r=0;r<s;r++)n+=Math.round(t(r/(s-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},ug=2e4;function rS(t){let e=0;const i=50;let n=t.next(e);for(;!n.done&&e<ug;)e+=i,n=t.next(e);return e>=ug?1/0:e}function z7(t,e=100,i){const n=i({...t,keyframes:[0,e]}),s=Math.min(rS(n),ug);return{type:"keyframes",ease:r=>n.next(s*r).value/e,duration:Cs(s)}}const j7=5;function LL(t,e,i){const n=Math.max(e-j7,0);return fL(i-t(n),e-n)}const Xt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},s_=.001;function I7({duration:t=Xt.duration,bounce:e=Xt.bounce,velocity:i=Xt.velocity,mass:n=Xt.mass}){let s,r,o=1-e;o=Ar(Xt.minDamping,Xt.maxDamping,o),t=Ar(Xt.minDuration,Xt.maxDuration,Cs(t)),o<1?(s=u=>{const d=u*o,p=d*t,g=d-i,O=_1(u,o),_=Math.exp(-p);return s_-g/O*_},r=u=>{const p=u*o*t,g=p*i+i,O=Math.pow(o,2)*Math.pow(u,2)*t,_=Math.exp(-p),b=_1(Math.pow(u,2),o);return(-s(u)+s_>0?-1:1)*((g-O)*_)/b}):(s=u=>{const d=Math.exp(-u*t),p=(u-i)*t+1;return-s_+d*p},r=u=>{const d=Math.exp(-u*t),p=(i-u)*(t*t);return d*p});const l=5/t,c=X7(s,r,l);if(t=Ws(t),isNaN(c))return{stiffness:Xt.stiffness,damping:Xt.damping,duration:t};{const u=Math.pow(c,2)*n;return{stiffness:u,damping:o*2*Math.sqrt(n*u),duration:t}}}const V7=12;function X7(t,e,i){let n=i;for(let s=1;s<V7;s++)n=n-t(n)/e(n);return n}function _1(t,e){return t*Math.sqrt(1-e*e)}const Z7=["duration","bounce"],q7=["stiffness","damping","mass"];function mT(t,e){return e.some(i=>t[i]!==void 0)}function W7(t){let e={velocity:Xt.velocity,stiffness:Xt.stiffness,damping:Xt.damping,mass:Xt.mass,isResolvedFromDuration:!1,...t};if(!mT(t,q7)&&mT(t,Z7))if(e.velocity=0,t.visualDuration){const i=t.visualDuration,n=2*Math.PI/(i*1.2),s=n*n,r=2*Ar(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Xt.mass,stiffness:s,damping:r}}else{const i=I7({...t,velocity:0});e={...e,...i,mass:Xt.mass},e.isResolvedFromDuration=!0}return e}function fg(t=Xt.visualDuration,e=Xt.bounce){const i=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:s}=i;const r=i.keyframes[0],o=i.keyframes[i.keyframes.length-1],l={done:!1,value:r},{stiffness:c,damping:u,mass:d,duration:p,velocity:g,isResolvedFromDuration:O}=W7({...i,velocity:-Cs(i.velocity||0)}),_=g||0,b=u/(2*Math.sqrt(c*d)),S=o-r,w=Cs(Math.sqrt(c/d)),T=Math.abs(S)<5;n||(n=T?Xt.restSpeed.granular:Xt.restSpeed.default),s||(s=T?Xt.restDelta.granular:Xt.restDelta.default);let k;if(b<1){const R=_1(w,b);k=E=>{const $=Math.exp(-b*w*E);return o-$*((_+b*w*S)/R*Math.sin(R*E)+S*Math.cos(R*E))}}else if(b===1)k=R=>o-Math.exp(-w*R)*(S+(_+w*S)*R);else{const R=w*Math.sqrt(b*b-1);k=E=>{const $=Math.exp(-b*w*E),N=Math.min(R*E,300);return o-$*((_+b*w*S)*Math.sinh(N)+R*S*Math.cosh(N))/R}}const A={calculatedDuration:O&&p||null,next:R=>{const E=k(R);if(O)l.done=R>=p;else{let $=R===0?_:0;b<1&&($=R===0?Ws(_):LL(k,R,E));const N=Math.abs($)<=n,q=Math.abs(o-E)<=s;l.done=N&&q}return l.value=l.done?o:E,l},toString:()=>{const R=Math.min(rS(A),ug),E=QL($=>A.next(R*$).value,R,30);return R+"ms "+E},toTransition:()=>{}};return A}fg.applyToOptions=t=>{const e=z7(t,100,fg);return t.ease=e.ease,t.duration=Ws(e.duration),t.type="keyframes",t};function y1({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const p=t[0],g={done:!1,value:p},O=N=>l!==void 0&&N<l||c!==void 0&&N>c,_=N=>l===void 0?c:c===void 0||Math.abs(l-N)<Math.abs(c-N)?l:c;let b=i*e;const S=p+b,w=o===void 0?S:o(S);w!==S&&(b=w-p);const T=N=>-b*Math.exp(-N/n),k=N=>w+T(N),A=N=>{const q=T(N),G=k(N);g.done=Math.abs(q)<=u,g.value=g.done?w:G};let R,E;const $=N=>{O(g.value)&&(R=N,E=fg({keyframes:[g.value,_(g.value)],velocity:LL(k,N,g.value),damping:s,stiffness:r,restDelta:u,restSpeed:d}))};return $(0),{calculatedDuration:null,next:N=>{let q=!1;return!E&&R===void 0&&(q=!0,A(N),$(N)),R!==void 0&&N>=R?E.next(N-R):(!q&&A(N),g)}}}function U7(t,e,i){const n=[],s=i||vo.mix||RL,r=t.length-1;for(let o=0;o<r;o++){let l=s(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||Ps:e;l=od(c,l)}n.push(l)}return n}function Y7(t,e,{clamp:i=!0,ease:n,mixer:s}={}){const r=t.length;if(Gx(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=U7(e,n,s),c=l.length,u=d=>{if(o&&d<t[0])return e[0];let p=0;if(c>1)for(;p<t.length-2&&!(d<t[p+1]);p++);const g=Cf(t[p],t[p+1],d);return l[p](g)};return i?d=>u(Ar(t[0],t[r-1],d)):u}function H7(t,e){const i=t[t.length-1];for(let n=1;n<=e;n++){const s=Cf(0,e,n);t.push(zt(i,1,s))}}function F7(t){const e=[0];return H7(e,t.length-1),e}function G7(t,e){return t.map(i=>i*e)}function K7(t,e){return t.map(()=>e||bL).splice(0,t.length-1)}function cf({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){const s=c7(n)?n.map(cT):cT(n),r={done:!1,value:e[0]},o=G7(i&&i.length===e.length?i:F7(e),t),l=Y7(o,e,{ease:Array.isArray(s)?s:K7(e,s)});return{calculatedDuration:t,next:c=>(r.value=l(c),r.done=c>=t,r)}}const J7=t=>t!==null;function oS(t,{repeat:e,repeatType:i="loop"},n,s=1){const r=t.filter(J7),l=s<0||e&&i!=="loop"&&e%2===1?0:r.length-1;return!l||n===void 0?r[l]:n}const eI={decay:y1,inertia:y1,tween:cf,keyframes:cf,spring:fg};function DL(t){typeof t.type=="string"&&(t.type=eI[t.type])}class aS{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,i){return this.finished.then(e,i)}}const tI=t=>t/100;class lS extends aS{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,s;const{motionValue:i}=this.options;i&&i.updatedAt!==On.now()&&this.tick(On.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(n=this.options).onStop)==null||s.call(n))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;DL(e);const{type:i=cf,repeat:n=0,repeatDelay:s=0,repeatType:r,velocity:o=0}=e;let{keyframes:l}=e;const c=i||cf;c!==cf&&typeof l[0]!="number"&&(this.mixKeyframes=od(tI,RL(l[0],l[1])),l=[0,100]);const u=c({...e,keyframes:l});r==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=rS(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}updateTime(e){const i=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=i}tick(e,i=!1){const{generator:n,totalDuration:s,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return n.next(0);const{delay:u=0,keyframes:d,repeat:p,repeatType:g,repeatDelay:O,type:_,onUpdate:b,finalKeyframe:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),i?this.currentTime=e:this.updateTime(e);const w=this.currentTime-u*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?w<0:w>s;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let k=this.currentTime,A=n;if(p){const N=Math.min(this.currentTime,s)/l;let q=Math.floor(N),G=N%1;!G&&N>=1&&(G=1),G===1&&q--,q=Math.min(q,p+1),!!(q%2)&&(g==="reverse"?(G=1-G,O&&(G-=O/l)):g==="mirror"&&(A=o)),k=Ar(0,1,G)*l}const R=T?{done:!1,value:d[0]}:A.next(k);r&&(R.value=r(R.value));let{done:E}=R;!T&&c!==null&&(E=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const $=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return $&&_!==y1&&(R.value=oS(d,this.options,S,this.speed)),b&&b(R.value),$&&this.finish(),R}then(e,i){return this.finished.then(e,i)}get duration(){return Cs(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Cs(e)}get time(){return Cs(this.currentTime)}set time(e){var i;e=Ws(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(i=this.driver)==null||i.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(On.now());const i=this.playbackSpeed!==e;this.playbackSpeed=e,i&&(this.time=Cs(this.currentTime))}play(){var s,r;if(this.isStopped)return;const{driver:e=N7,startTime:i}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(r=(s=this.options).onPlay)==null||r.call(s);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=i??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(On.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,i;this.notifyFinished(),this.teardown(),this.state="finished",(i=(e=this.options).onComplete)==null||i.call(e)}cancel(){var e,i;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(i=(e=this.options).onCancel)==null||i.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var i;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(i=this.driver)==null||i.stop(),e.observe(this)}}function iI(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ml=t=>t*180/Math.PI,b1=t=>{const e=ml(Math.atan2(t[1],t[0]));return x1(e)},nI={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:b1,rotateZ:b1,skewX:t=>ml(Math.atan(t[1])),skewY:t=>ml(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},x1=t=>(t=t%360,t<0&&(t+=360),t),gT=b1,OT=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),vT=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),sI={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:OT,scaleY:vT,scale:t=>(OT(t)+vT(t))/2,rotateX:t=>x1(ml(Math.atan2(t[6],t[5]))),rotateY:t=>x1(ml(Math.atan2(-t[2],t[0]))),rotateZ:gT,rotate:gT,skewX:t=>ml(Math.atan(t[4])),skewY:t=>ml(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function S1(t){return t.includes("scale")?1:0}function w1(t,e){if(!t||t==="none")return S1(e);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,s;if(i)n=sI,s=i;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=nI,s=l}if(!s)return S1(e);const r=n[e],o=s[1].split(",").map(oI);return typeof r=="function"?r(o):o[r]}const rI=(t,e)=>{const{transform:i="none"}=getComputedStyle(t);return w1(i,e)};function oI(t){return parseFloat(t.trim())}const Oh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],vh=new Set(Oh),_T=t=>t===gh||t===Te,aI=new Set(["x","y","z"]),lI=Oh.filter(t=>!aI.has(t));function cI(t){const e=[];return lI.forEach(i=>{const n=t.getValue(i);n!==void 0&&(e.push([i,n.get()]),n.set(i.startsWith("scale")?1:0))}),e}const va={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>w1(e,"x"),y:(t,{transform:e})=>w1(e,"y")};va.translateX=va.x;va.translateY=va.y;const xl=new Set;let C1=!1,k1=!1,T1=!1;function BL(){if(k1){const t=Array.from(xl).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),i=new Map;e.forEach(n=>{const s=cI(n);s.length&&(i.set(n,s),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>{n.render();const s=i.get(n);s&&s.forEach(([r,o])=>{var l;(l=n.getValue(r))==null||l.set(o)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}k1=!1,C1=!1,xl.forEach(t=>t.complete(T1)),xl.clear()}function $L(){xl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(k1=!0)})}function hI(){T1=!0,$L(),BL(),T1=!1}class cS{constructor(e,i,n,s,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=i,this.name=n,this.motionValue=s,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(xl.add(this),C1||(C1=!0,Tt.read($L),Tt.resolveKeyframes(BL))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:i,element:n,motionValue:s}=this;if(e[0]===null){const r=s==null?void 0:s.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(n&&i){const l=n.readValue(i,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),s&&r===void 0&&s.set(e[0])}iI(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),xl.delete(this)}cancel(){this.state==="scheduled"&&(xl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const uI=t=>t.startsWith("--");function fI(t,e,i){uI(e)?t.style.setProperty(e,i):t.style[e]=i}const dI={};function NL(t,e){const i=uL(t);return()=>dI[e]??i()}const pI=NL(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),zL=NL(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Hu=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,yT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hu([0,.65,.55,1]),circOut:Hu([.55,0,1,.45]),backIn:Hu([.31,.01,.66,-.59]),backOut:Hu([.33,1.53,.69,.99])};function jL(t,e){if(t)return typeof t=="function"?zL()?QL(t,e):"ease-out":xL(t)?Hu(t):Array.isArray(t)?t.map(i=>jL(i,e)||yT.easeOut):yT[t]}function mI(t,e,i,{delay:n=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[e]:i};c&&(d.offset=c);const p=jL(l,s);Array.isArray(p)&&(d.easing=p);const g={delay:n,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(g.pseudoElement=u),t.animate(d,g)}function IL(t){return typeof t=="function"&&"applyToOptions"in t}function gI({type:t,...e}){return IL(t)&&zL()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class VL extends aS{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:i,name:n,keyframes:s,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,Gx(typeof e.type!="string");const u=gI(e);this.animation=mI(i,n,s,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const d=oS(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):fI(i,n,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,i;(i=(e=this.animation).finish)==null||i.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var i,n,s;const e=(i=this.options)==null?void 0:i.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(n=this.animation).commitStyles)==null||s.call(n))}get duration(){var i,n;const e=((n=(i=this.animation.effect)==null?void 0:i.getComputedTiming)==null?void 0:n.call(i).duration)||0;return Cs(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Cs(e)}get time(){return Cs(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ws(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:i}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&pI()?(this.animation.timeline=e,Ps):i(this)}}const XL={anticipate:vL,backInOut:OL,circInOut:yL};function OI(t){return t in XL}function vI(t){typeof t.ease=="string"&&OI(t.ease)&&(t.ease=XL[t.ease])}const r_=10;class _I extends VL{constructor(e){vI(e),DL(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:i,onUpdate:n,onComplete:s,element:r,...o}=this.options;if(!i)return;if(e!==void 0){i.set(e);return}const l=new lS({...o,autoplay:!1}),c=Math.max(r_,On.now()-this.startTime),u=Ar(0,r_,c-r_);i.setWithVelocity(l.sample(Math.max(0,c-u)).value,l.sample(c).value,u),l.stop()}}const bT=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Us.test(t)||t==="0")&&!t.startsWith("url("));function yI(t){const e=t[0];if(t.length===1)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}function bI(t,e,i,n){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=bT(s,e),l=bT(r,e);return!o||!l?!1:yI(t)||(i==="spring"||IL(i))&&n}function A1(t){t.duration=0,t.type="keyframes"}const xI=new Set(["opacity","clipPath","filter","transform"]),SI=uL(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function wI(t){var d;const{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:r,type:o}=t;if(!(((d=e==null?void 0:e.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return SI()&&i&&xI.has(i)&&(i!=="transform"||!u)&&!c&&!n&&s!=="mirror"&&r!==0&&o!=="inertia"}const CI=40;class kI extends aS{constructor({autoplay:e=!0,delay:i=0,type:n="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:o="loop",keyframes:l,name:c,motionValue:u,element:d,...p}){var _;super(),this.stop=()=>{var b,S;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(S=this.keyframeResolver)==null||S.cancel()},this.createdAt=On.now();const g={autoplay:e,delay:i,type:n,repeat:s,repeatDelay:r,repeatType:o,name:c,motionValue:u,element:d,...p},O=(d==null?void 0:d.KeyframeResolver)||cS;this.keyframeResolver=new O(l,(b,S,w)=>this.onKeyframesResolved(b,S,g,!w),c,u,d),(_=this.keyframeResolver)==null||_.scheduleResolve()}onKeyframesResolved(e,i,n,s){var S,w;this.keyframeResolver=void 0;const{name:r,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=n;this.resolvedAt=On.now(),bI(e,r,o,l)||((vo.instantAnimations||!c)&&(d==null||d(oS(e,n,i))),e[0]=e[e.length-1],A1(n),n.repeat=0);const g={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>CI?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...n,keyframes:e},O=!u&&wI(g),_=(w=(S=g.motionValue)==null?void 0:S.owner)==null?void 0:w.current,b=O?new _I({...g,element:_}):new lS(g);b.finished.then(()=>{this.notifyFinished()}).catch(Ps),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(e,i){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),hI()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function ZL(t,e,i,n=0,s=1){const r=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),o=t.size,l=(o-1)*n;return typeof i=="function"?i(r,o):s===1?r*n:l-r*n}const TI=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function AI(t){const e=TI.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${i??n}`,s]}function qL(t,e,i=1){const[n,s]=AI(t);if(!n)return;const r=window.getComputedStyle(e).getPropertyValue(n);if(r){const o=r.trim();return lL(o)?parseFloat(o):o}return tS(s)?qL(s,e,i+1):s}const EI={type:"spring",stiffness:500,damping:25,restSpeed:10},MI=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),PI={type:"keyframes",duration:.8},RI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},QI=(t,{keyframes:e})=>e.length>2?PI:vh.has(t)?t.startsWith("scale")?MI(e[1]):EI:RI,LI=t=>t!==null;function DI(t,{repeat:e,repeatType:i="loop"},n){const s=t.filter(LI),r=e&&i!=="loop"&&e%2===1?0:s.length-1;return s[r]}function WL(t,e){if(t!=null&&t.inherit&&e){const{inherit:i,...n}=t;return{...e,...n}}return t}function hS(t,e){const i=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return i!==t?WL(i,t):i}function BI({when:t,delay:e,delayChildren:i,staggerChildren:n,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const uS=(t,e,i,n={},s,r)=>o=>{const l=hS(n,t)||{},c=l.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Ws(c);const d={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:g=>{e.set(g),l.onUpdate&&l.onUpdate(g)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:s};BI(l)||Object.assign(d,QI(t,d)),d.duration&&(d.duration=Ws(d.duration)),d.repeatDelay&&(d.repeatDelay=Ws(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let p=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(A1(d),d.delay===0&&(p=!0)),(vo.instantAnimations||vo.skipAnimations||s!=null&&s.shouldSkipAnimations)&&(p=!0,A1(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,p&&!r&&e.get()!==void 0){const g=DI(d.keyframes,l);if(g!==void 0){Tt.update(()=>{d.onUpdate(g),d.onComplete()});return}}return l.isSync?new lS(d):new kI(d)};function xT(t){const e=[{},{}];return t==null||t.values.forEach((i,n)=>{e[0][n]=i.get(),e[1][n]=i.getVelocity()}),e}function fS(t,e,i,n){if(typeof e=="function"){const[s,r]=xT(n);e=e(i!==void 0?i:t.custom,s,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,r]=xT(n);e=e(i!==void 0?i:t.custom,s,r)}return e}function qc(t,e,i){const n=t.getProps();return fS(n,e,i!==void 0?i:n.custom,t)}const UL=new Set(["width","height","top","left","right","bottom",...Oh]),ST=30,$I=t=>!isNaN(parseFloat(t));class NI{constructor(e,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var r;const s=On.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((r=this.events.change)==null||r.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=i.owner}setCurrent(e){this.current=e,this.updatedAt=On.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=$I(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,i){this.events[e]||(this.events[e]=new Kx);const n=this.events[e].add(i);return e==="change"?()=>{n(),Tt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,i){this.passiveEffect=e,this.stopPassiveEffect=i}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,i,n){this.set(i),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,i=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=On.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ST)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,ST);return fL(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(e){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=e(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,i;(e=this.dependents)==null||e.clear(),(i=this.events.destroy)==null||i.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function nh(t,e){return new NI(t,e)}const E1=t=>Array.isArray(t);function zI(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,nh(i))}function jI(t){return E1(t)?t[t.length-1]||0:t}function II(t,e){const i=qc(t,e);let{transitionEnd:n={},transition:s={},...r}=i||{};r={...r,...n};for(const o in r){const l=jI(r[o]);zI(t,o,l)}}const rn=t=>!!(t&&t.getVelocity);function VI(t){return!!(rn(t)&&t.add)}function M1(t,e){const i=t.getValue("willChange");if(VI(i))return i.add(e);if(!i&&vo.WillChange){const n=new vo.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function dS(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const XI="framerAppearId",YL="data-"+dS(XI);function HL(t){return t.props[YL]}function ZI({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&e[i]!==!0;return e[i]=!1,n}function FL(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:r,transitionEnd:o,...l}=e;const c=t.getDefaultTransition();r=r?WL(r,c):c;const u=r==null?void 0:r.reduceMotion;n&&(r=n);const d=[],p=s&&t.animationState&&t.animationState.getState()[s];for(const g in l){const O=t.getValue(g,t.latestValues[g]??null),_=l[g];if(_===void 0||p&&ZI(p,g))continue;const b={delay:i,...hS(r||{},g)},S=O.get();if(S!==void 0&&!O.isAnimating&&!Array.isArray(_)&&_===S&&!b.velocity)continue;let w=!1;if(window.MotionHandoffAnimation){const A=HL(t);if(A){const R=window.MotionHandoffAnimation(A,g,Tt);R!==null&&(b.startTime=R,w=!0)}}M1(t,g);const T=u??t.shouldReduceMotion;O.start(uS(g,O,_,T&&UL.has(g)?{type:!1}:b,t,w));const k=O.animation;k&&d.push(k)}if(o){const g=()=>Tt.update(()=>{o&&II(t,o)});d.length?Promise.all(d).then(g):g()}return d}function P1(t,e,i={}){var c;const n=qc(t,e,i.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(s=i.transitionOverride);const r=n?()=>Promise.all(FL(t,n,i)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:p,staggerDirection:g}=s;return qI(t,e,u,d,p,g,i)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,d]=l==="beforeChildren"?[r,o]:[o,r];return u().then(()=>d())}else return Promise.all([r(),o(i.delay)])}function qI(t,e,i=0,n=0,s=0,r=1,o){const l=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),l.push(P1(c,e,{...o,delay:i+(typeof n=="function"?0:n)+ZL(t.variantChildren,c,n,s,r)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(l)}function WI(t,e,i={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const s=e.map(r=>P1(t,r,i));n=Promise.all(s)}else if(typeof e=="string")n=P1(t,e,i);else{const s=typeof e=="function"?qc(t,e,i.custom):e;n=Promise.all(FL(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}const UI={test:t=>t==="auto",parse:t=>t},GL=t=>e=>e.test(t),KL=[gh,Te,wr,ha,x7,b7,UI],wT=t=>KL.find(GL(t));function YI(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||hL(t):!0}const HI=new Set(["brightness","contrast","saturate","opacity"]);function FI(t){const[e,i]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=i.match(iS)||[];if(!n)return t;const s=i.replace(n,"");let r=HI.has(e)?1:0;return n!==i&&(r*=100),e+"("+r+s+")"}const GI=/\b([a-z-]*)\(.*?\)/gu,R1={...Us,getAnimatableNone:t=>{const e=t.match(GI);return e?e.map(FI).join(" "):t}},Q1={...Us,getAnimatableNone:t=>{const e=Us.parse(t);return Us.createTransformer(t)(e.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},CT={...gh,transform:Math.round},KI={rotate:ha,rotateX:ha,rotateY:ha,rotateZ:ha,scale:Zp,scaleX:Zp,scaleY:Zp,scaleZ:Zp,skew:ha,skewX:ha,skewY:ha,distance:Te,translateX:Te,translateY:Te,translateZ:Te,x:Te,y:Te,z:Te,perspective:Te,transformPerspective:Te,opacity:kf,originX:uT,originY:uT,originZ:Te},pS={borderWidth:Te,borderTopWidth:Te,borderRightWidth:Te,borderBottomWidth:Te,borderLeftWidth:Te,borderRadius:Te,borderTopLeftRadius:Te,borderTopRightRadius:Te,borderBottomRightRadius:Te,borderBottomLeftRadius:Te,width:Te,maxWidth:Te,height:Te,maxHeight:Te,top:Te,right:Te,bottom:Te,left:Te,inset:Te,insetBlock:Te,insetBlockStart:Te,insetBlockEnd:Te,insetInline:Te,insetInlineStart:Te,insetInlineEnd:Te,padding:Te,paddingTop:Te,paddingRight:Te,paddingBottom:Te,paddingLeft:Te,paddingBlock:Te,paddingBlockStart:Te,paddingBlockEnd:Te,paddingInline:Te,paddingInlineStart:Te,paddingInlineEnd:Te,margin:Te,marginTop:Te,marginRight:Te,marginBottom:Te,marginLeft:Te,marginBlock:Te,marginBlockStart:Te,marginBlockEnd:Te,marginInline:Te,marginInlineStart:Te,marginInlineEnd:Te,fontSize:Te,backgroundPositionX:Te,backgroundPositionY:Te,...KI,zIndex:CT,fillOpacity:kf,strokeOpacity:kf,numOctaves:CT},JI={...pS,color:ai,backgroundColor:ai,outlineColor:ai,fill:ai,stroke:ai,borderColor:ai,borderTopColor:ai,borderRightColor:ai,borderBottomColor:ai,borderLeftColor:ai,filter:R1,WebkitFilter:R1,mask:Q1,WebkitMask:Q1},JL=t=>JI[t],eV=new Set([R1,Q1]);function e3(t,e){let i=JL(t);return eV.has(i)||(i=Us),i.getAnimatableNone?i.getAnimatableNone(e):void 0}const tV=new Set(["auto","none","0"]);function iV(t,e,i){let n=0,s;for(;n<t.length&&!s;){const r=t[n];typeof r=="string"&&!tV.has(r)&&Tf(r).values.length&&(s=t[n]),n++}if(s&&i)for(const r of e)t[r]=e3(i,s)}class nV extends cS{constructor(e,i,n,s,r){super(e,i,n,s,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:i,name:n}=this;if(!i||!i.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let p=e[d];if(typeof p=="string"&&(p=p.trim(),tS(p))){const g=qL(p,i.current);g!==void 0&&(e[d]=g),d===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!UL.has(n)||e.length!==2)return;const[s,r]=e,o=wT(s),l=wT(r),c=hT(s),u=hT(r);if(c!==u&&va[n]){this.needsMeasurement=!0;return}if(o!==l)if(_T(o)&&_T(l))for(let d=0;d<e.length;d++){const p=e[d];typeof p=="string"&&(e[d]=parseFloat(p))}else va[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:i}=this,n=[];for(let s=0;s<e.length;s++)(e[s]===null||YI(e[s]))&&n.push(s);n.length&&iV(e,n,i)}measureInitialState(){const{element:e,unresolvedKeyframes:i,name:n}=this;if(!e||!e.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=va[n](e.measureViewportBox(),window.getComputedStyle(e.current)),i[0]=this.measuredOrigin;const s=i[i.length-1];s!==void 0&&e.getValue(n,s).jump(s,!1)}measureEndState(){var l;const{element:e,name:i,unresolvedKeyframes:n}=this;if(!e||!e.current)return;const s=e.getValue(i);s&&s.jump(this.measuredOrigin,!1);const r=n.length-1,o=n[r];n[r]=va[i](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{e.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const sV=new Set(["opacity","clipPath","filter","transform"]);function t3(t,e,i){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let n=document;const s=(i==null?void 0:i[t])??n.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(n=>n!=null)}const i3=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function L1(t){return cL(t)&&"offsetHeight"in t}const{schedule:mS}=SL(queueMicrotask,!1),Xs={x:!1,y:!1};function n3(){return Xs.x||Xs.y}function rV(t){return t==="x"||t==="y"?Xs[t]?null:(Xs[t]=!0,()=>{Xs[t]=!1}):Xs.x||Xs.y?null:(Xs.x=Xs.y=!0,()=>{Xs.x=Xs.y=!1})}function s3(t,e){const i=t3(t),n=new AbortController,s={passive:!0,...e,signal:n.signal};return[i,s,()=>n.abort()]}function oV(t){return!(t.pointerType==="touch"||n3())}function aV(t,e,i={}){const[n,s,r]=s3(t,i);return n.forEach(o=>{let l=!1,c=!1,u;const d=()=>{o.removeEventListener("pointerleave",_)},p=S=>{u&&(u(S),u=void 0),d()},g=S=>{l=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),c&&(c=!1,p(S))},O=()=>{l=!0,window.addEventListener("pointerup",g,s),window.addEventListener("pointercancel",g,s)},_=S=>{if(S.pointerType!=="touch"){if(l){c=!0;return}p(S)}},b=S=>{if(!oV(S))return;c=!1;const w=e(o,S);typeof w=="function"&&(u=w,o.addEventListener("pointerleave",_,s))};o.addEventListener("pointerenter",b,s),o.addEventListener("pointerdown",O,s)}),r}const r3=(t,e)=>e?t===e?!0:r3(t,e.parentElement):!1,gS=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,lV=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function cV(t){return lV.has(t.tagName)||t.isContentEditable===!0}const hV=new Set(["INPUT","SELECT","TEXTAREA"]);function uV(t){return hV.has(t.tagName)||t.isContentEditable===!0}const Dm=new WeakSet;function kT(t){return e=>{e.key==="Enter"&&t(e)}}function o_(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const fV=(t,e)=>{const i=t.currentTarget;if(!i)return;const n=kT(()=>{if(Dm.has(i))return;o_(i,"down");const s=kT(()=>{o_(i,"up")}),r=()=>o_(i,"cancel");i.addEventListener("keyup",s,e),i.addEventListener("blur",r,e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)};function TT(t){return gS(t)&&!n3()}const AT=new WeakSet;function dV(t,e,i={}){const[n,s,r]=s3(t,i),o=l=>{const c=l.currentTarget;if(!TT(l)||AT.has(l))return;Dm.add(c),i.stopPropagation&&AT.add(l);const u=e(c,l),d=(O,_)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",g),Dm.has(c)&&Dm.delete(c),TT(O)&&typeof u=="function"&&u(O,{success:_})},p=O=>{d(O,c===window||c===document||i.useGlobalTarget||r3(c,O.target))},g=O=>{d(O,!1)};window.addEventListener("pointerup",p,s),window.addEventListener("pointercancel",g,s)};return n.forEach(l=>{(i.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),L1(l)&&(l.addEventListener("focus",u=>fV(u,s)),!cV(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),r}function OS(t){return cL(t)&&"ownerSVGElement"in t}const Bm=new WeakMap;let ua;const o3=(t,e,i)=>(n,s)=>s&&s[0]?s[0][t+"Size"]:OS(n)&&"getBBox"in n?n.getBBox()[e]:n[i],pV=o3("inline","width","offsetWidth"),mV=o3("block","height","offsetHeight");function gV({target:t,borderBoxSize:e}){var i;(i=Bm.get(t))==null||i.forEach(n=>{n(t,{get width(){return pV(t,e)},get height(){return mV(t,e)}})})}function OV(t){t.forEach(gV)}function vV(){typeof ResizeObserver>"u"||(ua=new ResizeObserver(OV))}function _V(t,e){ua||vV();const i=t3(t);return i.forEach(n=>{let s=Bm.get(n);s||(s=new Set,Bm.set(n,s)),s.add(e),ua==null||ua.observe(n)}),()=>{i.forEach(n=>{const s=Bm.get(n);s==null||s.delete(e),s!=null&&s.size||ua==null||ua.unobserve(n)})}}const $m=new Set;let Dc;function yV(){Dc=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};$m.forEach(e=>e(t))},window.addEventListener("resize",Dc)}function bV(t){return $m.add(t),Dc||yV(),()=>{$m.delete(t),!$m.size&&typeof Dc=="function"&&(window.removeEventListener("resize",Dc),Dc=void 0)}}function ET(t,e){return typeof t=="function"?bV(t):_V(t,e)}function xV(t){return OS(t)&&t.tagName==="svg"}const SV=[...KL,ai,Us],wV=t=>SV.find(GL(t)),MT=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bc=()=>({x:MT(),y:MT()}),PT=()=>({min:0,max:0}),Oi=()=>({x:PT(),y:PT()}),CV=new WeakMap;function aO(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Af(t){return typeof t=="string"||Array.isArray(t)}const vS=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_S=["initial",...vS];function lO(t){return aO(t.animate)||_S.some(e=>Af(t[e]))}function a3(t){return!!(lO(t)||t.variants)}function kV(t,e,i){for(const n in e){const s=e[n],r=i[n];if(rn(s))t.addValue(n,s);else if(rn(r))t.addValue(n,nh(s,{owner:t}));else if(r!==s)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(n);t.addValue(n,nh(o!==void 0?o:s,{owner:t}))}}for(const n in i)e[n]===void 0&&t.removeValue(n);return e}const D1={current:null},l3={current:!1},TV=typeof window<"u";function AV(){if(l3.current=!0,!!TV)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>D1.current=t.matches;t.addEventListener("change",e),e()}else D1.current=!1}const RT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let dg={};function c3(t){dg=t}function EV(){return dg}class MV{scrapeMotionValuesFromProps(e,i,n){return{}}constructor({parent:e,props:i,presenceContext:n,reducedMotionConfig:s,skipAnimations:r,blockInitialAnimation:o,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=cS,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const O=On.now();this.renderScheduledAt<O&&(this.renderScheduledAt=O,Tt.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=l;this.latestValues=u,this.baseTarget={...u},this.initialValues=i.initial?{...u}:{},this.renderState=d,this.parent=e,this.props=i,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=r,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=lO(i),this.isVariantNode=a3(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...g}=this.scrapeMotionValuesFromProps(i,{},this);for(const O in g){const _=g[O];u[O]!==void 0&&rn(_)&&_.set(u[O])}}mount(e){var i,n;if(this.hasBeenMounted)for(const s in this.initialValues)(i=this.values.get(s))==null||i.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,CV.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,r)=>this.bindToMotionValue(r,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(l3.current||AV(),this.shouldReduceMotion=D1.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),Sa(this.notifyUpdate),Sa(this.render),this.valueSubscriptions.forEach(i=>i()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const i in this.events)this.events[i].clear();for(const i in this.features){const n=this.features[i];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,i){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),i.accelerate&&sV.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:u,duration:d}=i.accelerate,p=new VL({element:this.current,name:e,keyframes:l,times:c,ease:u,duration:Ws(d)}),g=o(p);this.valueSubscriptions.set(e,()=>{g(),p.cancel()});return}const n=vh.has(e);n&&this.onBindTransform&&this.onBindTransform();const s=i.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Tt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,i)),this.valueSubscriptions.set(e,()=>{s(),r&&r(),i.owner&&i.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in dg){const i=dg[e];if(!i)continue;const{isEnabled:n,Feature:s}=i;if(!this.features[e]&&s&&n(this.props)&&(this.features[e]=new s(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Oi()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,i){this.latestValues[e]=i}update(e,i){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let n=0;n<RT.length;n++){const s=RT[n];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const r="on"+s,o=e[r];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=kV(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(e),()=>i.variantChildren.delete(e)}addValue(e,i){const n=this.values.get(e);i!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,i),this.values.set(e,i),this.latestValues[e]=i.get())}removeValue(e){this.values.delete(e);const i=this.valueSubscriptions.get(e);i&&(i(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,i){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&i!==void 0&&(n=nh(i===null?void 0:i,{owner:this}),this.addValue(e,n)),n}readValue(e,i){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n=="string"&&(lL(n)||hL(n))?n=parseFloat(n):!wV(n)&&Us.test(i)&&(n=e3(e,i)),this.setBaseTarget(e,rn(n)?n.get():n)),rn(n)?n.get():n}setBaseTarget(e,i){this.baseTarget[e]=i}getBaseTarget(e){var r;const{initial:i}=this.props;let n;if(typeof i=="string"||typeof i=="object"){const o=fS(this.props,i,(r=this.presenceContext)==null?void 0:r.custom);o&&(n=o[e])}if(i&&n!==void 0)return n;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!rn(s)?s:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,i){return this.events[e]||(this.events[e]=new Kx),this.events[e].add(i)}notify(e,...i){this.events[e]&&this.events[e].notify(...i)}scheduleRenderMicrotask(){mS.render(this.render)}}class h3 extends MV{constructor(){super(...arguments),this.KeyframeResolver=nV}sortInstanceNodePosition(e,i){return e.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(e,i){const n=e.style;return n?n[i]:void 0}removeValueFromRenderState(e,{vars:i,style:n}){delete i[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;rn(e)&&(this.childSubscription=e.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}class Pa{constructor(e){this.isMounted=!1,this.node=e}update(){}}function u3({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function PV({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function RV(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}function a_(t){return t===void 0||t===1}function B1({scale:t,scaleX:e,scaleY:i}){return!a_(t)||!a_(e)||!a_(i)}function al(t){return B1(t)||f3(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function f3(t){return QT(t.x)||QT(t.y)}function QT(t){return t&&t!=="0%"}function pg(t,e,i){const n=t-i,s=e*n;return i+s}function LT(t,e,i,n,s){return s!==void 0&&(t=pg(t,s,n)),pg(t,i,n)+e}function $1(t,e=0,i=1,n,s){t.min=LT(t.min,e,i,n,s),t.max=LT(t.max,e,i,n,s)}function d3(t,{x:e,y:i}){$1(t.x,e.translate,e.scale,e.originPoint),$1(t.y,i.translate,i.scale,i.originPoint)}const DT=.999999999999,BT=1.0000000000001;function QV(t,e,i,n=!1){const s=i.length;if(!s)return;e.x=e.y=1;let r,o;for(let l=0;l<s;l++){r=i[l],o=r.projectionDelta;const{visualElement:c}=r.options;c&&c.props.style&&c.props.style.display==="contents"||(n&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Nc(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,d3(t,o)),n&&al(r.latestValues)&&Nc(t,r.latestValues))}e.x<BT&&e.x>DT&&(e.x=1),e.y<BT&&e.y>DT&&(e.y=1)}function $c(t,e){t.min=t.min+e,t.max=t.max+e}function $T(t,e,i,n,s=.5){const r=zt(t.min,t.max,s);$1(t,e,i,r,n)}function Nc(t,e){$T(t.x,e.x,e.scaleX,e.scale,e.originX),$T(t.y,e.y,e.scaleY,e.scale,e.originY)}function p3(t,e){return u3(RV(t.getBoundingClientRect(),e))}function LV(t,e,i){const n=p3(t,i),{scroll:s}=e;return s&&($c(n.x,s.offset.x),$c(n.y,s.offset.y)),n}const DV={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},BV=Oh.length;function $V(t,e,i){let n="",s=!0;for(let r=0;r<BV;r++){const o=Oh[r],l=t[o];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(o.startsWith("scale")?1:0);else{const u=parseFloat(l);c=o.startsWith("scale")?u===1:u===0}if(!c||i){const u=i3(l,pS[o]);if(!c){s=!1;const d=DV[o]||o;n+=`${d}(${u}) `}i&&(e[o]=u)}}return n=n.trim(),i?n=i(e,s?"":n):s&&(n="none"),n}function yS(t,e,i){const{style:n,vars:s,transformOrigin:r}=t;let o=!1,l=!1;for(const c in e){const u=e[c];if(vh.has(c)){o=!0;continue}else if(CL(c)){s[c]=u;continue}else{const d=i3(u,pS[c]);c.startsWith("origin")?(l=!0,r[c]=d):n[c]=d}}if(e.transform||(o||i?n.transform=$V(e,t.transform,i):n.transform&&(n.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=r;n.transformOrigin=`${c} ${u} ${d}`}}function m3(t,{style:e,vars:i},n,s){const r=t.style;let o;for(o in e)r[o]=e[o];s==null||s.applyProjectionStyles(r,n);for(o in i)r.setProperty(o,i[o])}function NT(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const wu={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Te.test(t))t=parseFloat(t);else return t;const i=NT(t,e.target.x),n=NT(t,e.target.y);return`${i}% ${n}%`}},NV={correct:(t,{treeScale:e,projectionDelta:i})=>{const n=t,s=Us.parse(t);if(s.length>5)return n;const r=Us.createTransformer(t),o=typeof s[0]!="number"?1:0,l=i.x.scale*e.x,c=i.y.scale*e.y;s[0+o]/=l,s[1+o]/=c;const u=zt(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),r(s)}},N1={borderRadius:{...wu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wu,borderTopRightRadius:wu,borderBottomLeftRadius:wu,borderBottomRightRadius:wu,boxShadow:NV};function g3(t,{layout:e,layoutId:i}){return vh.has(t)||t.startsWith("origin")||(e||i!==void 0)&&(!!N1[t]||t==="opacity")}function bS(t,e,i){var o;const n=t.style,s=e==null?void 0:e.style,r={};if(!n)return r;for(const l in n)(rn(n[l])||s&&rn(s[l])||g3(l,t)||((o=i==null?void 0:i.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(r[l]=n[l]);return r}function zV(t){return window.getComputedStyle(t)}class jV extends h3{constructor(){super(...arguments),this.type="html",this.renderInstance=m3}readValueFromInstance(e,i){var n;if(vh.has(i))return(n=this.projection)!=null&&n.isProjecting?S1(i):rI(e,i);{const s=zV(e),r=(CL(i)?s.getPropertyValue(i):s[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:i}){return p3(e,i)}build(e,i,n){yS(e,i,n.transformTemplate)}scrapeMotionValuesFromProps(e,i,n){return bS(e,i,n)}}const IV={offset:"stroke-dashoffset",array:"stroke-dasharray"},VV={offset:"strokeDashoffset",array:"strokeDasharray"};function XV(t,e,i=1,n=0,s=!0){t.pathLength=1;const r=s?IV:VV;t[r.offset]=`${-n}`,t[r.array]=`${e} ${i}`}const ZV=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function O3(t,{attrX:e,attrY:i,attrScale:n,pathLength:s,pathSpacing:r=1,pathOffset:o=0,...l},c,u,d){if(yS(t,l,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:g}=t;p.transform&&(g.transform=p.transform,delete p.transform),(g.transform||p.transformOrigin)&&(g.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),g.transform&&(g.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete p.transformBox);for(const O of ZV)p[O]!==void 0&&(g[O]=p[O],delete p[O]);e!==void 0&&(p.x=e),i!==void 0&&(p.y=i),n!==void 0&&(p.scale=n),s!==void 0&&XV(p,s,r,o,!1)}const v3=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),_3=t=>typeof t=="string"&&t.toLowerCase()==="svg";function qV(t,e,i,n){m3(t,e,void 0,n);for(const s in e.attrs)t.setAttribute(v3.has(s)?s:dS(s),e.attrs[s])}function y3(t,e,i){const n=bS(t,e,i);for(const s in t)if(rn(t[s])||rn(e[s])){const r=Oh.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;n[r]=t[s]}return n}class WV extends h3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Oi}getBaseTargetFromProps(e,i){return e[i]}readValueFromInstance(e,i){if(vh.has(i)){const n=JL(i);return n&&n.default||0}return i=v3.has(i)?i:dS(i),e.getAttribute(i)}scrapeMotionValuesFromProps(e,i,n){return y3(e,i,n)}build(e,i,n){O3(e,i,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,i,n,s){qV(e,i,n,s)}mount(e){this.isSVGTag=_3(e.tagName),super.mount(e)}}const UV=_S.length;function b3(t){if(!t)return;if(!t.isControllingVariants){const i=t.parent?b3(t.parent)||{}:{};return t.props.initial!==void 0&&(i.initial=t.props.initial),i}const e={};for(let i=0;i<UV;i++){const n=_S[i],s=t.props[n];(Af(s)||s===!1)&&(e[n]=s)}return e}function x3(t,e){if(!Array.isArray(e))return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}const YV=[...vS].reverse(),HV=vS.length;function FV(t){return e=>Promise.all(e.map(({animation:i,options:n})=>WI(t,i,n)))}function GV(t){let e=FV(t),i=zT(),n=!0;const s=c=>(u,d)=>{var g;const p=qc(t,d,c==="exit"?(g=t.presenceContext)==null?void 0:g.custom:void 0);if(p){const{transition:O,transitionEnd:_,...b}=p;u={...u,...b,..._}}return u};function r(c){e=c(t)}function o(c){const{props:u}=t,d=b3(t.parent)||{},p=[],g=new Set;let O={},_=1/0;for(let S=0;S<HV;S++){const w=YV[S],T=i[w],k=u[w]!==void 0?u[w]:d[w],A=Af(k),R=w===c?T.isActive:null;R===!1&&(_=S);let E=k===d[w]&&k!==u[w]&&A;if(E&&n&&t.manuallyAnimateOnMount&&(E=!1),T.protectedKeys={...O},!T.isActive&&R===null||!k&&!T.prevProp||aO(k)||typeof k=="boolean")continue;if(w==="exit"&&T.isActive&&R!==!0){T.prevResolvedValues&&(O={...O,...T.prevResolvedValues});continue}const $=KV(T.prevProp,k);let N=$||w===c&&T.isActive&&!E&&A||S>_&&A,q=!1;const G=Array.isArray(k)?k:[k];let U=G.reduce(s(w),{});R===!1&&(U={});const{prevResolvedValues:Q={}}=T,D={...Q,...U},z=Z=>{N=!0,g.has(Z)&&(q=!0,g.delete(Z)),T.needsAnimating[Z]=!0;const H=t.getValue(Z);H&&(H.liveStyle=!1)};for(const Z in D){const H=U[Z],F=Q[Z];if(O.hasOwnProperty(Z))continue;let M=!1;E1(H)&&E1(F)?M=!x3(H,F):M=H!==F,M?H!=null?z(Z):g.add(Z):H!==void 0&&g.has(Z)?z(Z):T.protectedKeys[Z]=!0}T.prevProp=k,T.prevResolvedValues=U,T.isActive&&(O={...O,...U}),n&&t.blockInitialAnimation&&(N=!1);const j=E&&$;N&&(!j||q)&&p.push(...G.map(Z=>{const H={type:w};if(typeof Z=="string"&&n&&!j&&t.manuallyAnimateOnMount&&t.parent){const{parent:F}=t,M=qc(F,Z);if(F.enteringChildren&&M){const{delayChildren:V}=M.transition||{};H.delay=ZL(F.enteringChildren,t,V)}}return{animation:Z,options:H}}))}if(g.size){const S={};if(typeof u.initial!="boolean"){const w=qc(t,Array.isArray(u.initial)?u.initial[0]:u.initial);w&&w.transition&&(S.transition=w.transition)}g.forEach(w=>{const T=t.getBaseTarget(w),k=t.getValue(w);k&&(k.liveStyle=!0),S[w]=T??null}),p.push({animation:S})}let b=!!p.length;return n&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(b=!1),n=!1,b?e(p):Promise.resolve()}function l(c,u){var p;if(i[c].isActive===u)return Promise.resolve();(p=t.variantChildren)==null||p.forEach(g=>{var O;return(O=g.animationState)==null?void 0:O.setActive(c,u)}),i[c].isActive=u;const d=o(c);for(const g in i)i[g].protectedKeys={};return d}return{animateChanges:o,setActive:l,setAnimateFunction:r,getState:()=>i,reset:()=>{i=zT()}}}function KV(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!x3(e,t):!1}function el(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function zT(){return{animate:el(!0),whileInView:el(),whileHover:el(),whileTap:el(),whileDrag:el(),whileFocus:el(),exit:el()}}function jT(t,e){t.min=e.min,t.max=e.max}function js(t,e){jT(t.x,e.x),jT(t.y,e.y)}function IT(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const S3=1e-4,JV=1-S3,eX=1+S3,w3=.01,tX=0-w3,iX=0+w3;function vn(t){return t.max-t.min}function nX(t,e,i){return Math.abs(t-e)<=i}function VT(t,e,i,n=.5){t.origin=n,t.originPoint=zt(e.min,e.max,t.origin),t.scale=vn(i)/vn(e),t.translate=zt(i.min,i.max,t.origin)-t.originPoint,(t.scale>=JV&&t.scale<=eX||isNaN(t.scale))&&(t.scale=1),(t.translate>=tX&&t.translate<=iX||isNaN(t.translate))&&(t.translate=0)}function hf(t,e,i,n){VT(t.x,e.x,i.x,n?n.originX:void 0),VT(t.y,e.y,i.y,n?n.originY:void 0)}function XT(t,e,i){t.min=i.min+e.min,t.max=t.min+vn(e)}function sX(t,e,i){XT(t.x,e.x,i.x),XT(t.y,e.y,i.y)}function ZT(t,e,i){t.min=e.min-i.min,t.max=t.min+vn(e)}function mg(t,e,i){ZT(t.x,e.x,i.x),ZT(t.y,e.y,i.y)}function qT(t,e,i,n,s){return t-=e,t=pg(t,1/i,n),s!==void 0&&(t=pg(t,1/s,n)),t}function rX(t,e=0,i=1,n=.5,s,r=t,o=t){if(wr.test(e)&&(e=parseFloat(e),e=zt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=zt(r.min,r.max,n);t===r&&(l-=e),t.min=qT(t.min,e,i,l,s),t.max=qT(t.max,e,i,l,s)}function WT(t,e,[i,n,s],r,o){rX(t,e[i],e[n],e[s],e.scale,r,o)}const oX=["x","scaleX","originX"],aX=["y","scaleY","originY"];function UT(t,e,i,n){WT(t.x,e,oX,i?i.x:void 0,n?n.x:void 0),WT(t.y,e,aX,i?i.y:void 0,n?n.y:void 0)}function YT(t){return t.translate===0&&t.scale===1}function C3(t){return YT(t.x)&&YT(t.y)}function HT(t,e){return t.min===e.min&&t.max===e.max}function lX(t,e){return HT(t.x,e.x)&&HT(t.y,e.y)}function FT(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function k3(t,e){return FT(t.x,e.x)&&FT(t.y,e.y)}function GT(t){return vn(t.x)/vn(t.y)}function KT(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function dr(t){return[t("x"),t("y")]}function cX(t,e,i){let n="";const s=t.x.translate/e.x,r=t.y.translate/e.y,o=(i==null?void 0:i.z)||0;if((s||r||o)&&(n=`translate3d(${s}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),i){const{transformPerspective:u,rotate:d,rotateX:p,rotateY:g,skewX:O,skewY:_}=i;u&&(n=`perspective(${u}px) ${n}`),d&&(n+=`rotate(${d}deg) `),p&&(n+=`rotateX(${p}deg) `),g&&(n+=`rotateY(${g}deg) `),O&&(n+=`skewX(${O}deg) `),_&&(n+=`skewY(${_}deg) `)}const l=t.x.scale*e.x,c=t.y.scale*e.y;return(l!==1||c!==1)&&(n+=`scale(${l}, ${c})`),n||"none"}const T3=["TopLeft","TopRight","BottomLeft","BottomRight"],hX=T3.length,JT=t=>typeof t=="string"?parseFloat(t):t,eA=t=>typeof t=="number"||Te.test(t);function uX(t,e,i,n,s,r){s?(t.opacity=zt(0,i.opacity??1,fX(n)),t.opacityExit=zt(e.opacity??1,0,dX(n))):r&&(t.opacity=zt(e.opacity??1,i.opacity??1,n));for(let o=0;o<hX;o++){const l=`border${T3[o]}Radius`;let c=tA(e,l),u=tA(i,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||eA(c)===eA(u)?(t[l]=Math.max(zt(JT(c),JT(u),n),0),(wr.test(u)||wr.test(c))&&(t[l]+="%")):t[l]=u}(e.rotate||i.rotate)&&(t.rotate=zt(e.rotate||0,i.rotate||0,n))}function tA(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const fX=A3(0,.5,_L),dX=A3(.5,.95,Ps);function A3(t,e,i){return n=>n<t?0:n>e?1:i(Cf(t,e,n))}function pX(t,e,i){const n=rn(t)?t:nh(t);return n.start(uS("",n,e,i)),n.animation}function Ef(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}const mX=(t,e)=>t.depth-e.depth;class gX{constructor(){this.children=[],this.isDirty=!1}add(e){Fx(this.children,e),this.isDirty=!0}remove(e){cg(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(mX),this.isDirty=!1,this.children.forEach(e)}}function OX(t,e){const i=On.now(),n=({timestamp:s})=>{const r=s-i;r>=e&&(Sa(n),t(r-e))};return Tt.setup(n,!0),()=>Sa(n)}function Nm(t){return rn(t)?t.get():t}class vX{constructor(){this.members=[]}add(e){Fx(this.members,e);for(let i=this.members.length-1;i>=0;i--){const n=this.members[i];if(n===e||n===this.lead||n===this.prevLead)continue;const s=n.instance;s&&s.isConnected===!1&&n.isPresent!==!1&&!n.snapshot&&cg(this.members,n)}e.scheduleRender()}remove(e){if(cg(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(e){const i=this.members.findIndex(s=>e===s);if(i===0)return!1;let n;for(let s=i;s>=0;s--){const r=this.members[s],o=r.instance;if(r.isPresent!==!1&&(!o||o.isConnected!==!1)){n=r;break}}return n?(this.promote(n),!0):!1}promote(e,i){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender();const s=n.options.layoutDependency,r=e.options.layoutDependency;if(!(s!==void 0&&r!==void 0&&s===r)){const c=n.instance;c&&c.isConnected===!1&&!n.snapshot||(e.resumeFrom=n,i&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0))}const{crossfade:l}=e.options;l===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:i,resumingFrom:n}=e;i.onExitComplete&&i.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const zm={hasAnimatedSinceResize:!0,hasEverUpdated:!1},l_=["","X","Y","Z"],_X=1e3;let yX=0;function c_(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function E3(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=HL(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:s,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",Tt,!(s||r))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&E3(n)}function M3({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:n,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=yX++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(SX),this.nodes.forEach(TX),this.nodes.forEach(AX),this.nodes.forEach(wX)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new gX)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Kx),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=OS(o)&&!xV(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),t){let d,p=0;const g=()=>this.root.updateBlockedByResize=!1;Tt.read(()=>{p=window.innerWidth}),t(o,()=>{const O=window.innerWidth;O!==p&&(p=O,this.root.updateBlockedByResize=!0,d&&d(),d=OX(g,250),zm.hasAnimatedSinceResize&&(zm.hasAnimatedSinceResize=!1,this.nodes.forEach(sA)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:p,hasRelativeLayoutChanged:g,layout:O})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||u.getDefaultTransition()||QX,{onLayoutAnimationStart:b,onLayoutAnimationComplete:S}=u.getProps(),w=!this.targetLayout||!k3(this.targetLayout,O),T=!p&&g;if(this.options.layoutRoot||this.resumeFrom||T||p&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const k={...hS(_,"layout"),onPlay:b,onComplete:S};(u.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k),this.setAnimationOrigin(d,T)}else p||sA(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=O})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Sa(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(EX),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&E3(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const p=this.path[d];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(iA);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(nA);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(kX),this.nodes.forEach(bX),this.nodes.forEach(xX)):this.nodes.forEach(nA),this.clearAllSnapshots();const l=On.now();qi.delta=Ar(0,1e3/60,l-qi.timestamp),qi.timestamp=l,qi.isProcessing=!0,e_.update.process(qi),e_.preRender.process(qi),e_.render.process(qi),qi.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,mS.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(CX),this.sharedNodes.forEach(MX)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Tt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Tt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!vn(this.snapshot.measuredBox.x)&&!vn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Oi(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!C3(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||al(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),LX(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return Oi();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(DX))){const{scroll:d}=this.root;d&&($c(l.x,d.offset.x),$c(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=Oi();if(js(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:p,options:g}=d;d!==this.root&&p&&g.layoutScroll&&(p.wasRoot&&js(l,o),$c(l.x,p.offset.x),$c(l.y,p.offset.y))}return l}applyTransform(o,l=!1){const c=Oi();js(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Nc(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),al(d.latestValues)&&Nc(c,d.latestValues)}return al(this.latestValues)&&Nc(c,this.latestValues),c}removeTransform(o){const l=Oi();js(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!al(u.latestValues))continue;B1(u.latestValues)&&u.updateSnapshot();const d=Oi(),p=u.measurePageBox();js(d,p),UT(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return al(this.latestValues)&&UT(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==qi.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var O;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(O=this.parent)!=null&&O.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:p}=this.options;if(!this.layout||!(d||p))return;this.resolvedRelativeTargetAt=qi.timestamp;const g=this.getClosestProjectingParent();g&&this.linkedParentVersion!==g.layoutVersion&&!g.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(g&&g.layout?this.createRelativeTarget(g,this.layout.layoutBox,g.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Oi(),this.targetWithTransforms=Oi()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),sX(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):js(this.target,this.layout.layoutBox),d3(this.target,this.targetDelta)):js(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?this.createRelativeTarget(g,this.target,g.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||B1(this.parent.latestValues)||f3(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Oi(),this.relativeTargetOrigin=Oi(),mg(this.relativeTargetOrigin,l,c),js(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var _;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===qi.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;js(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,g=this.treeScale.y;QV(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Oi());const{target:O}=o;if(!O){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(IT(this.prevProjectionDelta.x,this.projectionDelta.x),IT(this.prevProjectionDelta.y,this.projectionDelta.y)),hf(this.projectionDelta,this.layoutCorrected,O,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==g||!KT(this.projectionDelta.x,this.prevProjectionDelta.x)||!KT(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",O))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Bc(),this.projectionDelta=Bc(),this.projectionDeltaWithTransform=Bc()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},p=Bc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const g=Oi(),O=c?c.source:void 0,_=this.layout?this.layout.source:void 0,b=O!==_,S=this.getStack(),w=!S||S.members.length<=1,T=!!(b&&!w&&this.options.crossfade===!0&&!this.path.some(RX));this.animationProgress=0;let k;this.mixTargetDelta=A=>{const R=A/1e3;rA(p.x,o.x,R),rA(p.y,o.y,R),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mg(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),PX(this.relativeTarget,this.relativeTargetOrigin,g,R),k&&lX(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Oi()),js(k,this.relativeTarget)),b&&(this.animationValues=d,uX(d,u,this.latestValues,R,T,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=R},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Sa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Tt.update(()=>{zm.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=nh(0)),this.motionValue.jump(0,!1),this.currentAnimation=pX(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(_X),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&P3(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Oi();const p=vn(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+p;const g=vn(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+g}js(l,c),Nc(l,d),hf(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new vX),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&c_("z",o,u,this.animationValues);for(let d=0;d<l_.length;d++)c_(`rotate${l_[d]}`,o,u,this.animationValues),c_(`skew${l_[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Nm(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Nm(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!al(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let p=cX(this.projectionDeltaWithTransform,this.treeScale,d);c&&(p=c(d,p)),o.transform=p;const{x:g,y:O}=this.projectionDelta;o.transformOrigin=`${g.origin*100}% ${O.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const _ in N1){if(d[_]===void 0)continue;const{correct:b,applyTo:S,isCSSVariable:w}=N1[_],T=p==="none"?d[_]:b(d[_],u);if(S){const k=S.length;for(let A=0;A<k;A++)o[S[A]]=T}else w?this.options.visualElement.renderState.vars[_]=T:o[_]=T}this.options.layoutId&&(o.pointerEvents=u===this?Nm(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(iA),this.root.sharedNodes.clear()}}}function bX(t){t.updateLayout()}function xX(t){var i;const e=((i=t.resumeFrom)==null?void 0:i.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;r==="size"?dr(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],O=vn(g);g.min=n[p].min,g.max=g.min+O}):P3(r,e.layoutBox,n)&&dr(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],O=vn(n[p]);g.max=g.min+O,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+O)});const l=Bc();hf(l,n,e.layoutBox);const c=Bc();o?hf(c,t.applyTransform(s,!0),e.measuredBox):hf(c,n,e.layoutBox);const u=!C3(l);let d=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:g,layout:O}=p;if(g&&O){const _=Oi();mg(_,e.layoutBox,g.layoutBox);const b=Oi();mg(b,n,O.layoutBox),k3(_,b)||(d=!0),p.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function SX(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function wX(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function CX(t){t.clearSnapshot()}function iA(t){t.clearMeasurements()}function nA(t){t.isLayoutDirty=!1}function kX(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function sA(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function TX(t){t.resolveTargetDelta()}function AX(t){t.calcProjection()}function EX(t){t.resetSkewAndRotation()}function MX(t){t.removeLeadSnapshot()}function rA(t,e,i){t.translate=zt(e.translate,0,i),t.scale=zt(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function oA(t,e,i,n){t.min=zt(e.min,i.min,n),t.max=zt(e.max,i.max,n)}function PX(t,e,i,n){oA(t.x,e.x,i.x,n),oA(t.y,e.y,i.y,n)}function RX(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const QX={duration:.45,ease:[.4,0,.1,1]},aA=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),lA=aA("applewebkit/")&&!aA("chrome/")?Math.round:Ps;function cA(t){t.min=lA(t.min),t.max=lA(t.max)}function LX(t){cA(t.x),cA(t.y)}function P3(t,e,i){return t==="position"||t==="preserve-aspect"&&!nX(GT(e),GT(i),.2)}function DX(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const BX=M3({attachResizeListener:(t,e)=>Ef(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),h_={current:void 0},R3=M3({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!h_.current){const t=new BX({});t.mount(window),t.setOptions({layoutScroll:!0}),h_.current=t}return h_.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),xS=I.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function hA(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function $X(...t){return e=>{let i=!1;const n=t.map(s=>{const r=hA(s,e);return!i&&typeof r=="function"&&(i=!0),r});if(i)return()=>{for(let s=0;s<n.length;s++){const r=n[s];typeof r=="function"?r():hA(t[s],null)}}}}function NX(...t){return I.useCallback($X(...t),t)}class zX extends I.Component{getSnapshotBeforeUpdate(e){const i=this.props.childRef.current;if(i&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const n=i.offsetParent,s=L1(n)&&n.offsetWidth||0,r=L1(n)&&n.offsetHeight||0,o=this.props.sizeRef.current;o.height=i.offsetHeight||0,o.width=i.offsetWidth||0,o.top=i.offsetTop,o.left=i.offsetLeft,o.right=s-o.width-o.left,o.bottom=r-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function jX({children:t,isPresent:e,anchorX:i,anchorY:n,root:s,pop:r}){var g;const o=I.useId(),l=I.useRef(null),c=I.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=I.useContext(xS),d=((g=t.props)==null?void 0:g.ref)??(t==null?void 0:t.ref),p=NX(l,d);return I.useInsertionEffect(()=>{const{width:O,height:_,top:b,left:S,right:w,bottom:T}=c.current;if(e||r===!1||!l.current||!O||!_)return;const k=i==="left"?`left: ${S}`:`right: ${w}`,A=n==="bottom"?`bottom: ${T}`:`top: ${b}`;l.current.dataset.motionPopId=o;const R=document.createElement("style");u&&(R.nonce=u);const E=s??document.head;return E.appendChild(R),R.sheet&&R.sheet.insertRule(`
50
- [data-motion-pop-id="${o}"] {
51
- position: absolute !important;
52
- width: ${O}px !important;
53
- height: ${_}px !important;
54
- ${k}px !important;
55
- ${A}px !important;
56
- }
57
- `),()=>{E.contains(R)&&E.removeChild(R)}},[e]),x.jsx(zX,{isPresent:e,childRef:l,sizeRef:c,pop:r,children:r===!1?t:I.cloneElement(t,{ref:p})})}const IX=({children:t,initial:e,isPresent:i,onExitComplete:n,custom:s,presenceAffectsLayout:r,mode:o,anchorX:l,anchorY:c,root:u})=>{const d=Hx(VX),p=I.useId();let g=!0,O=I.useMemo(()=>(g=!1,{id:p,initial:e,isPresent:i,custom:s,onExitComplete:_=>{d.set(_,!0);for(const b of d.values())if(!b)return;n&&n()},register:_=>(d.set(_,!1),()=>d.delete(_))}),[i,d,n]);return r&&g&&(O={...O}),I.useMemo(()=>{d.forEach((_,b)=>d.set(b,!1))},[i]),I.useEffect(()=>{!i&&!d.size&&n&&n()},[i]),t=x.jsx(jX,{pop:o==="popLayout",isPresent:i,anchorX:l,anchorY:c,root:u,children:t}),x.jsx(oO.Provider,{value:O,children:t})};function VX(){return new Map}function Q3(t=!0){const e=I.useContext(oO);if(e===null)return[!0,null];const{isPresent:i,onExitComplete:n,register:s}=e,r=I.useId();I.useEffect(()=>{if(t)return s(r)},[t]);const o=I.useCallback(()=>t&&n&&n(r),[r,n,t]);return!i&&n?[!1,o]:[!0]}const qp=t=>t.key||"";function uA(t){const e=[];return I.Children.forEach(t,i=>{I.isValidElement(i)&&e.push(i)}),e}const SS=({children:t,custom:e,initial:i=!0,onExitComplete:n,presenceAffectsLayout:s=!0,mode:r="sync",propagate:o=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[d,p]=Q3(o),g=I.useMemo(()=>uA(t),[t]),O=o&&!d?[]:g.map(qp),_=I.useRef(!0),b=I.useRef(g),S=Hx(()=>new Map),w=I.useRef(new Set),[T,k]=I.useState(g),[A,R]=I.useState(g);aL(()=>{_.current=!1,b.current=g;for(let N=0;N<A.length;N++){const q=qp(A[N]);O.includes(q)?(S.delete(q),w.current.delete(q)):S.get(q)!==!0&&S.set(q,!1)}},[A,O.length,O.join("-")]);const E=[];if(g!==T){let N=[...g];for(let q=0;q<A.length;q++){const G=A[q],U=qp(G);O.includes(U)||(N.splice(q,0,G),E.push(G))}return r==="wait"&&E.length&&(N=E),R(uA(N)),k(g),null}const{forceRender:$}=I.useContext(Yx);return x.jsx(x.Fragment,{children:A.map(N=>{const q=qp(N),G=o&&!d?!1:g===A||O.includes(q),U=()=>{if(w.current.has(q))return;if(w.current.add(q),S.has(q))S.set(q,!0);else return;let Q=!0;S.forEach(D=>{D||(Q=!1)}),Q&&($==null||$(),R(b.current),o&&(p==null||p()),n&&n())};return x.jsx(IX,{isPresent:G,initial:!_.current||i?void 0:!1,custom:e,presenceAffectsLayout:s,mode:r,root:u,onExitComplete:G?void 0:U,anchorX:l,anchorY:c,children:N},q)})})},L3=I.createContext({strict:!1}),fA={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let dA=!1;function XX(){if(dA)return;const t={};for(const e in fA)t[e]={isEnabled:i=>fA[e].some(n=>!!i[n])};c3(t),dA=!0}function D3(){return XX(),EV()}function ZX(t){const e=D3();for(const i in t)e[i]={...e[i],...t[i]};c3(e)}const qX=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function gg(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||qX.has(t)}let B3=t=>!gg(t);function WX(t){typeof t=="function"&&(B3=e=>e.startsWith("on")?!gg(e):t(e))}try{WX(require("@emotion/is-prop-valid").default)}catch{}function UX(t,e,i){const n={};for(const s in t)s==="values"&&typeof t.values=="object"||(B3(s)||i===!0&&gg(s)||!e&&!gg(s)||t.draggable&&s.startsWith("onDrag"))&&(n[s]=t[s]);return n}const cO=I.createContext({});function YX(t,e){if(lO(t)){const{initial:i,animate:n}=t;return{initial:i===!1||Af(i)?i:void 0,animate:Af(n)?n:void 0}}return t.inherit!==!1?e:{}}function HX(t){const{initial:e,animate:i}=YX(t,I.useContext(cO));return I.useMemo(()=>({initial:e,animate:i}),[pA(e),pA(i)])}function pA(t){return Array.isArray(t)?t.join(" "):t}const wS=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function $3(t,e,i){for(const n in e)!rn(e[n])&&!g3(n,i)&&(t[n]=e[n])}function FX({transformTemplate:t},e){return I.useMemo(()=>{const i=wS();return yS(i,e,t),Object.assign({},i.vars,i.style)},[e])}function GX(t,e){const i=t.style||{},n={};return $3(n,i,t),Object.assign(n,FX(t,e)),n}function KX(t,e){const i={},n=GX(t,e);return t.drag&&t.dragListener!==!1&&(i.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=n,i}const N3=()=>({...wS(),attrs:{}});function JX(t,e,i,n){const s=I.useMemo(()=>{const r=N3();return O3(r,e,_3(n),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};$3(r,t.style,t),s.style={...r,...s.style}}return s}const e9=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function CS(t){return typeof t!="string"||t.includes("-")?!1:!!(e9.indexOf(t)>-1||/[A-Z]/u.test(t))}function t9(t,e,i,{latestValues:n},s,r=!1,o){const c=(o??CS(t)?JX:KX)(e,n,s,t),u=UX(e,typeof t=="string",r),d=t!==I.Fragment?{...u,...c,ref:i}:{},{children:p}=e,g=I.useMemo(()=>rn(p)?p.get():p,[p]);return I.createElement(t,{...d,children:g})}function i9({scrapeMotionValuesFromProps:t,createRenderState:e},i,n,s){return{latestValues:n9(i,n,s,t),renderState:e()}}function n9(t,e,i,n){const s={},r=n(t,{});for(const g in r)s[g]=Nm(r[g]);let{initial:o,animate:l}=t;const c=lO(t),u=a3(t);e&&u&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let d=i?i.initial===!1:!1;d=d||o===!1;const p=d?l:o;if(p&&typeof p!="boolean"&&!aO(p)){const g=Array.isArray(p)?p:[p];for(let O=0;O<g.length;O++){const _=fS(t,g[O]);if(_){const{transitionEnd:b,transition:S,...w}=_;for(const T in w){let k=w[T];if(Array.isArray(k)){const A=d?k.length-1:0;k=k[A]}k!==null&&(s[T]=k)}for(const T in b)s[T]=b[T]}}}return s}const z3=t=>(e,i)=>{const n=I.useContext(cO),s=I.useContext(oO),r=()=>i9(t,e,n,s);return i?r():Hx(r)},s9=z3({scrapeMotionValuesFromProps:bS,createRenderState:wS}),r9=z3({scrapeMotionValuesFromProps:y3,createRenderState:N3}),o9=Symbol.for("motionComponentSymbol");function a9(t,e,i){const n=I.useRef(i);I.useInsertionEffect(()=>{n.current=i});const s=I.useRef(null);return I.useCallback(r=>{var l;r&&((l=t.onMount)==null||l.call(t,r)),e&&(r?e.mount(r):e.unmount());const o=n.current;if(typeof o=="function")if(r){const c=o(r);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):o(r);else o&&(o.current=r)},[e])}const j3=I.createContext({});function Mc(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function l9(t,e,i,n,s,r){var k,A;const{visualElement:o}=I.useContext(cO),l=I.useContext(L3),c=I.useContext(oO),u=I.useContext(xS),d=u.reducedMotion,p=u.skipAnimations,g=I.useRef(null),O=I.useRef(!1);n=n||l.renderer,!g.current&&n&&(g.current=n(t,{visualState:e,parent:o,props:i,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:p,isSVG:r}),O.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const _=g.current,b=I.useContext(j3);_&&!_.projection&&s&&(_.type==="html"||_.type==="svg")&&c9(g.current,i,s,b);const S=I.useRef(!1);I.useInsertionEffect(()=>{_&&S.current&&_.update(i,c)});const w=i[YL],T=I.useRef(!!w&&!((k=window.MotionHandoffIsComplete)!=null&&k.call(window,w))&&((A=window.MotionHasOptimisedAnimation)==null?void 0:A.call(window,w)));return aL(()=>{O.current=!0,_&&(S.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),T.current&&_.animationState&&_.animationState.animateChanges())}),I.useEffect(()=>{_&&(!T.current&&_.animationState&&_.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{var R;(R=window.MotionHandoffMarkAsComplete)==null||R.call(window,w)}),T.current=!1),_.enteringChildren=void 0)}),_}function c9(t,e,i,n){const{layoutId:s,layout:r,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=e;t.projection=new i(t.latestValues,e["data-framer-portal-id"]?void 0:I3(t.parent)),t.projection.setOptions({layoutId:s,layout:r,alwaysMeasureLayout:!!o||l&&Mc(l),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:n,crossfade:d,layoutScroll:c,layoutRoot:u})}function I3(t){if(t)return t.options.allowProjection!==!1?t.projection:I3(t.parent)}function u_(t,{forwardMotionProps:e=!1,type:i}={},n,s){n&&ZX(n);const r=i?i==="svg":CS(t),o=r?r9:s9;function l(u,d){let p;const g={...I.useContext(xS),...u,layoutId:h9(u)},{isStatic:O}=g,_=HX(u),b=o(u,O);if(!O&&oL){u9();const S=f9(g);p=S.MeasureLayout,_.visualElement=l9(t,b,g,s,S.ProjectionNode,r)}return x.jsxs(cO.Provider,{value:_,children:[p&&_.visualElement?x.jsx(p,{visualElement:_.visualElement,...g}):null,t9(t,u,a9(b,_.visualElement,d),b,O,e,r)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=I.forwardRef(l);return c[o9]=t,c}function h9({layoutId:t}){const e=I.useContext(Yx).id;return e&&t!==void 0?e+"-"+t:t}function u9(t,e){I.useContext(L3).strict}function f9(t){const e=D3(),{drag:i,layout:n}=e;if(!i&&!n)return{};const s={...i,...n};return{MeasureLayout:i!=null&&i.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function d9(t,e){if(typeof Proxy>"u")return u_;const i=new Map,n=(r,o)=>u_(r,o,t,e),s=(r,o)=>n(r,o);return new Proxy(s,{get:(r,o)=>o==="create"?n:(i.has(o)||i.set(o,u_(o,void 0,t,e)),i.get(o))})}const p9=(t,e)=>e.isSVG??CS(t)?new WV(e):new jV(e,{allowProjection:t!==I.Fragment});class m9 extends Pa{constructor(e){super(e),e.animationState||(e.animationState=GV(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();aO(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:i}=this.node.prevProps||{};e!==i&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let g9=0;class O9 extends Pa{constructor(){super(...arguments),this.id=g9++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:i}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const s=this.node.animationState.setActive("exit",!e);i&&!e&&s.then(()=>{i(this.id)})}mount(){const{register:e,onExitComplete:i}=this.node.presenceContext||{};i&&i(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const v9={animation:{Feature:m9},exit:{Feature:O9}};function cd(t){return{point:{x:t.pageX,y:t.pageY}}}const _9=t=>e=>gS(e)&&t(e,cd(e));function uf(t,e,i,n){return Ef(t,e,_9(i),n)}const V3=({current:t})=>t?t.ownerDocument.defaultView:null,mA=(t,e)=>Math.abs(t-e);function y9(t,e){const i=mA(t.x,e.x),n=mA(t.y,e.y);return Math.sqrt(i**2+n**2)}const gA=new Set(["auto","scroll"]);class X3{constructor(e,i,{transformPagePoint:n,contextWindow:s=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=O=>{this.handleScroll(O.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const O=d_(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,b=y9(O.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!b)return;const{point:S}=O,{timestamp:w}=qi;this.history.push({...S,timestamp:w});const{onStart:T,onMove:k}=this.handlers;_||(T&&T(this.lastMoveEvent,O),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,O)},this.handlePointerMove=(O,_)=>{this.lastMoveEvent=O,this.lastMoveEventInfo=f_(_,this.transformPagePoint),Tt.update(this.updatePoint,!0)},this.handlePointerUp=(O,_)=>{this.end();const{onEnd:b,onSessionEnd:S,resumeAnimation:w}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=d_(O.type==="pointercancel"?this.lastMoveEventInfo:f_(_,this.transformPagePoint),this.history);this.startEvent&&b&&b(O,T),S&&S(O,T)},!gS(e))return;this.dragSnapToOrigin=r,this.handlers=i,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=s||window;const c=cd(e),u=f_(c,this.transformPagePoint),{point:d}=u,{timestamp:p}=qi;this.history=[{...d,timestamp:p}];const{onSessionStart:g}=i;g&&g(e,d_(u,this.history)),this.removeListeners=od(uf(this.contextWindow,"pointermove",this.handlePointerMove),uf(this.contextWindow,"pointerup",this.handlePointerUp),uf(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(e){let i=e.parentElement;for(;i;){const n=getComputedStyle(i);(gA.has(n.overflowX)||gA.has(n.overflowY))&&this.scrollPositions.set(i,{x:i.scrollLeft,y:i.scrollTop}),i=i.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const i=this.scrollPositions.get(e);if(!i)return;const n=e===window,s=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:s.x-i.x,y:s.y-i.y};r.x===0&&r.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,s),Tt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Sa(this.updatePoint)}}function f_(t,e){return e?{point:e(t.point)}:t}function OA(t,e){return{x:t.x-e.x,y:t.y-e.y}}function d_({point:t},e){return{point:t,delta:OA(t,Z3(e)),offset:OA(t,b9(e)),velocity:x9(e,.1)}}function b9(t){return t[0]}function Z3(t){return t[t.length-1]}function x9(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,n=null;const s=Z3(t);for(;i>=0&&(n=t[i],!(s.timestamp-n.timestamp>Ws(e)));)i--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&s.timestamp-n.timestamp>Ws(e)*2&&(n=t[1]);const r=Cs(s.timestamp-n.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-n.x)/r,y:(s.y-n.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function S9(t,{min:e,max:i},n){return e!==void 0&&t<e?t=n?zt(e,t,n.min):Math.max(t,e):i!==void 0&&t>i&&(t=n?zt(i,t,n.max):Math.min(t,i)),t}function vA(t,e,i){return{min:e!==void 0?t.min+e:void 0,max:i!==void 0?t.max+i-(t.max-t.min):void 0}}function w9(t,{top:e,left:i,bottom:n,right:s}){return{x:vA(t.x,i,s),y:vA(t.y,e,n)}}function _A(t,e){let i=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,n]=[n,i]),{min:i,max:n}}function C9(t,e){return{x:_A(t.x,e.x),y:_A(t.y,e.y)}}function k9(t,e){let i=.5;const n=vn(t),s=vn(e);return s>n?i=Cf(e.min,e.max-n,t.min):n>s&&(i=Cf(t.min,t.max-s,e.min)),Ar(0,1,i)}function T9(t,e){const i={};return e.min!==void 0&&(i.min=e.min-t.min),e.max!==void 0&&(i.max=e.max-t.min),i}const z1=.35;function A9(t=z1){return t===!1?t=0:t===!0&&(t=z1),{x:yA(t,"left","right"),y:yA(t,"top","bottom")}}function yA(t,e,i){return{min:bA(t,e),max:bA(t,i)}}function bA(t,e){return typeof t=="number"?t:t[e]||0}const E9=new WeakMap;class M9{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Oi(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:i=!1,distanceThreshold:n}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const r=p=>{i&&this.snapToCursor(cd(p).point),this.stopAnimation()},o=(p,g)=>{const{drag:O,dragPropagation:_,onDragStart:b}=this.getProps();if(O&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=rV(O),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),dr(w=>{let T=this.getAxisMotionValue(w).get()||0;if(wr.test(T)){const{projection:k}=this.visualElement;if(k&&k.layout){const A=k.layout.layoutBox[w];A&&(T=vn(A)*(parseFloat(T)/100))}}this.originPoint[w]=T}),b&&Tt.update(()=>b(p,g),!1,!0),M1(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},l=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g;const{dragPropagation:O,dragDirectionLock:_,onDirectionLock:b,onDrag:S}=this.getProps();if(!O&&!this.openDragLock)return;const{offset:w}=g;if(_&&this.currentDirection===null){this.currentDirection=R9(w),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",g.point,w),this.updateAxis("y",g.point,w),this.visualElement.render(),S&&Tt.update(()=>S(p,g),!1,!0)},c=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g,this.stop(p,g),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new X3(e,{onSessionStart:r,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:n,contextWindow:V3(this.visualElement),element:this.visualElement.current})}stop(e,i){const n=e||this.latestPointerEvent,s=i||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!s||!n)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Tt.postRender(()=>l(n,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:i}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,i,n){const{drag:s}=this.getProps();if(!n||!Wp(e,s,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=S9(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var r;const{dragConstraints:e,dragElastic:i}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(r=this.visualElement.projection)==null?void 0:r.layout,s=this.constraints;e&&Mc(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=w9(n.layoutBox,e):this.constraints=!1,this.elastic=A9(i),s!==this.constraints&&!Mc(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&dr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=T9(n.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:i}=this.getProps();if(!e||!Mc(e))return!1;const n=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=LV(n,s.root,this.visualElement.getTransformPagePoint());let o=C9(s.layout.layoutBox,r);if(i){const l=i(PV(o));this.hasMutatedConstraints=!!l,l&&(o=u3(l))}return o}startAnimation(e){const{drag:i,dragMomentum:n,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=dr(d=>{if(!Wp(d,i,this.currentDirection))return;let p=c&&c[d]||{};o&&(p={min:0,max:0});const g=s?200:1e6,O=s?40:1e7,_={type:"inertia",velocity:n?e[d]:0,bounceStiffness:g,bounceDamping:O,timeConstant:750,restDelta:1,restSpeed:10,...r,...p};return this.startAxisValueAnimation(d,_)});return Promise.all(u).then(l)}startAxisValueAnimation(e,i){const n=this.getAxisMotionValue(e);return M1(this.visualElement,e),n.start(uS(e,n,0,i,this.visualElement,!1))}stopAnimation(){dr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const i=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),s=n[i];return s||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){dr(i=>{const{drag:n}=this.getProps();if(!Wp(i,n,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(i);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[i],c=r.get()||0;r.set(e[i]-zt(o,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:i}=this.getProps(),{projection:n}=this.visualElement;if(!Mc(i)||!n||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};dr(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=k9({min:c,max:c},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),dr(o=>{if(!Wp(o,e,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(zt(c,u,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;E9.set(this.visualElement,this);const e=this.visualElement.current,i=uf(e,"pointerdown",u=>{const{drag:d,dragListener:p=!0}=this.getProps(),g=u.target,O=g!==e&&uV(g);d&&p&&!O&&this.start(u)});let n;const s=()=>{const{dragConstraints:u}=this.getProps();Mc(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),n||(n=P9(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",s);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Tt.read(s);const l=Ef(window,"resize",()=>this.scalePositionWithinConstraints()),c=r.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(dr(p=>{const g=this.getAxisMotionValue(p);g&&(this.originPoint[p]+=u[p].translate,g.set(g.get()+u[p].translate))}),this.visualElement.render())}));return()=>{l(),i(),o(),c&&c(),n&&n()}}getProps(){const e=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=z1,dragMomentum:l=!0}=e;return{...e,drag:i,dragDirectionLock:n,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:l}}}function xA(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function P9(t,e,i){const n=ET(t,xA(i)),s=ET(e,xA(i));return()=>{n(),s()}}function Wp(t,e,i){return(e===!0||e===t)&&(i===null||i===t)}function R9(t,e=10){let i=null;return Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x"),i}class Q9 extends Pa{constructor(e){super(e),this.removeGroupControls=Ps,this.removeListeners=Ps,this.controls=new M9(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ps}update(){const{dragControls:e}=this.node.getProps(),{dragControls:i}=this.node.prevProps||{};e!==i&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const p_=t=>(e,i)=>{t&&Tt.update(()=>t(e,i),!1,!0)};class L9 extends Pa{constructor(){super(...arguments),this.removePointerDownListener=Ps}onPointerDown(e){this.session=new X3(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:V3(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:i,onPan:n,onPanEnd:s}=this.node.getProps();return{onSessionStart:p_(e),onStart:p_(i),onMove:p_(n),onEnd:(r,o)=>{delete this.session,s&&Tt.postRender(()=>s(r,o))}}}mount(){this.removePointerDownListener=uf(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let m_=!1;class D9 extends I.Component{componentDidMount(){const{visualElement:e,layoutGroup:i,switchLayoutGroup:n,layoutId:s}=this.props,{projection:r}=e;r&&(i.group&&i.group.add(r),n&&n.register&&s&&n.register(r),m_&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),zm.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:i,visualElement:n,drag:s,isPresent:r}=this.props,{projection:o}=n;return o&&(o.isPresent=r,e.layoutDependency!==i&&o.setOptions({...o.options,layoutDependency:i}),m_=!0,s||e.layoutDependency!==i||i===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||Tt.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),mS.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:i,switchLayoutGroup:n}=this.props,{projection:s}=e;m_=!0,s&&(s.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(s),n&&n.deregister&&n.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function q3(t){const[e,i]=Q3(),n=I.useContext(Yx);return x.jsx(D9,{...t,layoutGroup:n,switchLayoutGroup:I.useContext(j3),isPresent:e,safeToRemove:i})}const B9={pan:{Feature:L9},drag:{Feature:Q9,ProjectionNode:R3,MeasureLayout:q3}};function SA(t,e,i){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover",i==="Start");const s="onHover"+i,r=n[s];r&&Tt.postRender(()=>r(e,cd(e)))}class $9 extends Pa{mount(){const{current:e}=this.node;e&&(this.unmount=aV(e,(i,n)=>(SA(this.node,n,"Start"),s=>SA(this.node,s,"End"))))}unmount(){}}class N9 extends Pa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=od(Ef(this.node.current,"focus",()=>this.onFocus()),Ef(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function wA(t,e,i){const{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap",i==="Start");const s="onTap"+(i==="End"?"":i),r=n[s];r&&Tt.postRender(()=>r(e,cd(e)))}class z9 extends Pa{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:i,propagate:n}=this.node.props;this.unmount=dV(e,(s,r)=>(wA(this.node,r,"Start"),(o,{success:l})=>wA(this.node,o,l?"End":"Cancel")),{useGlobalTarget:i,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}}const j1=new WeakMap,g_=new WeakMap,j9=t=>{const e=j1.get(t.target);e&&e(t)},I9=t=>{t.forEach(j9)};function V9({root:t,...e}){const i=t||document;g_.has(i)||g_.set(i,{});const n=g_.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver(I9,{root:t,...e})),n[s]}function X9(t,e,i){const n=V9(e);return j1.set(t,i),n.observe(t),()=>{j1.delete(t),n.unobserve(t)}}const Z9={some:0,all:1};class q9 extends Pa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:i,margin:n,amount:s="some",once:r}=e,o={root:i?i.current:void 0,rootMargin:n,threshold:typeof s=="number"?s:Z9[s]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:p}=this.node.getProps(),g=u?d:p;g&&g(c)};return X9(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:i}=this.node;["amount","margin","root"].some(W9(e,i))&&this.startObserver()}unmount(){}}function W9({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}const U9={inView:{Feature:q9},tap:{Feature:z9},focus:{Feature:N9},hover:{Feature:$9}},Y9={layout:{ProjectionNode:R3,MeasureLayout:q3}},H9={...v9,...U9,...B9,...Y9},_o=d9(H9,p9);function F9({roadmap:t,state:e,todos:i}){var p;const{connected:n}=Rr(),s=(t==null?void 0:t.progress_percent)??0,r=(t==null?void 0:t.current_phase)??(e==null?void 0:e.currentPhase)??"--",o=((p=t==null?void 0:t.phases.find(g=>g.number===t.current_phase))==null?void 0:p.name)??"",l=(e==null?void 0:e.blockers.filter(g=>!g.includes("RESOLVED")).length)??0,c=(i==null?void 0:i.pending.length)??0,u=(t==null?void 0:t.completed_phases)??0,d=(t==null?void 0:t.phase_count)??0;return x.jsxs("div",{className:"border-b border-border pb-6",children:[x.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[x.jsx("span",{className:"block w-6 h-px bg-accent"}),x.jsx("span",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground",children:"Milestone Progress"}),x.jsxs("span",{className:"ml-auto flex items-center gap-3",children:[x.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[u,"/",d," phases"]}),x.jsx("span",{className:`inline-block h-1.5 w-1.5 ${n?"bg-success":"bg-danger"}`,title:n?"Connected":"Disconnected"})]})]}),x.jsx("div",{className:"h-1 w-full bg-muted mb-5",children:x.jsx(_o.div,{className:"h-full bg-accent",initial:{width:0},animate:{width:`${s}%`},transition:{duration:.6,ease:"easeOut"}})}),x.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-end sm:gap-10",children:[x.jsxs("div",{className:"flex items-end gap-4 sm:gap-10",children:[x.jsxs("div",{children:[x.jsx("span",{className:"font-mono text-3xl font-bold tabular-nums text-foreground leading-none",children:s}),x.jsx("span",{className:"text-sm text-muted-foreground ml-1",children:"%"})]}),x.jsxs("div",{className:"border-l border-border pl-4 sm:pl-10",children:[x.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground block mb-1",children:"Current"}),x.jsxs("div",{className:"flex items-baseline gap-2",children:[x.jsx("span",{className:"font-mono text-sm font-bold text-accent",children:r}),x.jsx("span",{className:"truncate text-sm text-foreground/80 max-w-[140px] sm:max-w-none",children:o})]})]})]}),x.jsxs("div",{className:"flex items-end gap-6 sm:ml-auto sm:gap-8",children:[x.jsxs("div",{children:[x.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground block mb-1",children:"Blockers"}),x.jsx("span",{className:`font-mono text-xl font-bold tabular-nums ${l>0?"text-danger":"text-muted-foreground"}`,children:l})]}),x.jsxs("div",{children:[x.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground block mb-1",children:"Todos"}),x.jsx("span",{className:`font-mono text-xl font-bold tabular-nums ${c>0?"text-warning":"text-muted-foreground"}`,children:c})]})]})]})]})}function G9(t){switch(t){case"complete":return"bg-success";case"partial":return"bg-accent";default:return"bg-muted-foreground/40"}}function K9(t){switch(t){case"complete":return"bg-success";case"partial":return"bg-accent";default:return"bg-muted-foreground/40"}}function J9({phaseName:t,phaseNumber:e,completedPlans:i,totalPlans:n,status:s,roadmapComplete:r,isCurrent:o,onClick:l,onToggleComplete:c}){const u=n>0?Math.round(i/n*100):0;return x.jsxs("button",{type:"button",onClick:()=>l(e),className:`group relative w-full text-left transition-colors duration-200 bg-background ${o?"border-l-2 border-l-accent":"border-l-2 border-l-transparent hover:border-l-accent/40"}`,children:[x.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-200 bg-card-hover"}),x.jsxs("div",{className:"relative flex items-center gap-3 px-4 py-3",children:[c?x.jsx("input",{type:"checkbox",checked:r,onChange:d=>{d.stopPropagation(),c(e,d.target.checked)},onClick:d=>d.stopPropagation(),className:"h-3 w-3 shrink-0 cursor-pointer accent-accent",title:r?"Mark incomplete":"Mark complete"}):x.jsx("span",{className:`inline-block h-1.5 w-1.5 shrink-0 ${K9(s)}`}),x.jsx("span",{className:`font-mono text-xs font-bold tabular-nums shrink-0 ${o?"text-accent":"text-muted-foreground"}`,children:e}),x.jsx("span",{className:"truncate text-sm text-foreground/90",children:t}),x.jsxs("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground tabular-nums",children:[i,"/",n]})]}),x.jsx("div",{className:"h-px w-full bg-muted/50",children:x.jsx(_o.div,{className:`h-full ${G9(s)}`,initial:{width:0},animate:{width:`${u}%`},transition:{duration:.5,ease:"easeOut"}})})]})}function eZ({phases:t,currentPhase:e,onPhaseClick:i,onToggleComplete:n}){return x.jsxs("div",{className:"flex flex-col gap-4",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("span",{className:"block w-6 h-px bg-accent"}),x.jsx("span",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground",children:"Phases"})]}),x.jsx("span",{className:"text-xs text-muted-foreground",children:t.length})]}),t.length===0?x.jsxs("div",{className:"flex flex-col items-center gap-3 border border-border px-4 py-10 text-center",children:[x.jsx("span",{className:"text-sm text-muted-foreground",children:"No project initialized yet."}),x.jsxs("span",{className:"text-sm text-muted-foreground",children:["Run"," ",x.jsx("code",{className:"bg-muted px-1.5 py-0.5 font-mono text-accent text-xs",children:"/maxsim:new-project"})," ","in Claude Code to get started."]})]}):x.jsx("div",{className:"flex flex-col gap-px bg-border",children:t.map(s=>x.jsx(J9,{phaseNumber:s.number,phaseName:s.name,completedPlans:s.summaryCount,totalPlans:s.planCount,status:s.diskStatus,roadmapComplete:s.roadmapComplete,isCurrent:s.number===e,onClick:i,onToggleComplete:n},s.number))})]})}function W3(t){var e,i,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(i=W3(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}function tZ(){for(var t,e,i=0,n="",s=arguments.length;i<s;i++)(t=arguments[i])&&(e=W3(t))&&(n&&(n+=" "),n+=e);return n}const iZ=(t,e)=>{const i=new Array(t.length+e.length);for(let n=0;n<t.length;n++)i[n]=t[n];for(let n=0;n<e.length;n++)i[t.length+n]=e[n];return i},nZ=(t,e)=>({classGroupId:t,validator:e}),U3=(t=new Map,e=null,i)=>({nextPart:t,validators:e,classGroupId:i}),Og="-",CA=[],sZ="arbitrary..",rZ=t=>{const e=aZ(t),{conflictingClassGroups:i,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return oZ(o);const l=o.split(Og),c=l[0]===""&&l.length>1?1:0;return Y3(l,c,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=n[o],u=i[o];return c?u?iZ(u,c):c:u||CA}return i[o]||CA}}},Y3=(t,e,i)=>{if(t.length-e===0)return i.classGroupId;const s=t[e],r=i.nextPart.get(s);if(r){const u=Y3(t,e+1,r);if(u)return u}const o=i.validators;if(o===null)return;const l=e===0?t.join(Og):t.slice(e).join(Og),c=o.length;for(let u=0;u<c;u++){const d=o[u];if(d.validator(l))return d.classGroupId}},oZ=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),i=e.indexOf(":"),n=e.slice(0,i);return n?sZ+n:void 0})(),aZ=t=>{const{theme:e,classGroups:i}=t;return lZ(i,e)},lZ=(t,e)=>{const i=U3();for(const n in t){const s=t[n];kS(s,i,n,e)}return i},kS=(t,e,i,n)=>{const s=t.length;for(let r=0;r<s;r++){const o=t[r];cZ(o,e,i,n)}},cZ=(t,e,i,n)=>{if(typeof t=="string"){hZ(t,e,i);return}if(typeof t=="function"){uZ(t,e,i,n);return}fZ(t,e,i,n)},hZ=(t,e,i)=>{const n=t===""?e:H3(e,t);n.classGroupId=i},uZ=(t,e,i,n)=>{if(dZ(t)){kS(t(n),e,i,n);return}e.validators===null&&(e.validators=[]),e.validators.push(nZ(i,t))},fZ=(t,e,i,n)=>{const s=Object.entries(t),r=s.length;for(let o=0;o<r;o++){const[l,c]=s[o];kS(c,H3(e,l),i,n)}},H3=(t,e)=>{let i=t;const n=e.split(Og),s=n.length;for(let r=0;r<s;r++){const o=n[r];let l=i.nextPart.get(o);l||(l=U3(),i.nextPart.set(o,l)),i=l}return i},dZ=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,pZ=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,i=Object.create(null),n=Object.create(null);const s=(r,o)=>{i[r]=o,e++,e>t&&(e=0,n=i,i=Object.create(null))};return{get(r){let o=i[r];if(o!==void 0)return o;if((o=n[r])!==void 0)return s(r,o),o},set(r,o){r in i?i[r]=o:s(r,o)}}},I1="!",kA=":",mZ=[],TA=(t,e,i,n,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:i,maybePostfixModifierPosition:n,isExternal:s}),gZ=t=>{const{prefix:e,experimentalParseClassName:i}=t;let n=s=>{const r=[];let o=0,l=0,c=0,u;const d=s.length;for(let b=0;b<d;b++){const S=s[b];if(o===0&&l===0){if(S===kA){r.push(s.slice(c,b)),c=b+1;continue}if(S==="/"){u=b;continue}}S==="["?o++:S==="]"?o--:S==="("?l++:S===")"&&l--}const p=r.length===0?s:s.slice(c);let g=p,O=!1;p.endsWith(I1)?(g=p.slice(0,-1),O=!0):p.startsWith(I1)&&(g=p.slice(1),O=!0);const _=u&&u>c?u-c:void 0;return TA(r,O,g,_)};if(e){const s=e+kA,r=n;n=o=>o.startsWith(s)?r(o.slice(s.length)):TA(mZ,!1,o,void 0,!0)}if(i){const s=n;n=r=>i({className:r,parseClassName:s})}return n},OZ=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((i,n)=>{e.set(i,1e6+n)}),i=>{const n=[];let s=[];for(let r=0;r<i.length;r++){const o=i[r],l=o[0]==="[",c=e.has(o);l||c?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(o)):s.push(o)}return s.length>0&&(s.sort(),n.push(...s)),n}},vZ=t=>({cache:pZ(t.cacheSize),parseClassName:gZ(t),sortModifiers:OZ(t),...rZ(t)}),_Z=/\s+/,yZ=(t,e)=>{const{parseClassName:i,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:r}=e,o=[],l=t.trim().split(_Z);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:p,modifiers:g,hasImportantModifier:O,baseClassName:_,maybePostfixModifierPosition:b}=i(d);if(p){c=d+(c.length>0?" "+c:c);continue}let S=!!b,w=n(S?_.substring(0,b):_);if(!w){if(!S){c=d+(c.length>0?" "+c:c);continue}if(w=n(_),!w){c=d+(c.length>0?" "+c:c);continue}S=!1}const T=g.length===0?"":g.length===1?g[0]:r(g).join(":"),k=O?T+I1:T,A=k+w;if(o.indexOf(A)>-1)continue;o.push(A);const R=s(w,S);for(let E=0;E<R.length;++E){const $=R[E];o.push(k+$)}c=d+(c.length>0?" "+c:c)}return c},bZ=(...t)=>{let e=0,i,n,s="";for(;e<t.length;)(i=t[e++])&&(n=F3(i))&&(s&&(s+=" "),s+=n);return s},F3=t=>{if(typeof t=="string")return t;let e,i="";for(let n=0;n<t.length;n++)t[n]&&(e=F3(t[n]))&&(i&&(i+=" "),i+=e);return i},xZ=(t,...e)=>{let i,n,s,r;const o=c=>{const u=e.reduce((d,p)=>p(d),t());return i=vZ(u),n=i.cache.get,s=i.cache.set,r=l,l(c)},l=c=>{const u=n(c);if(u)return u;const d=yZ(c,i);return s(c,d),d};return r=o,(...c)=>r(bZ(...c))},SZ=[],pi=t=>{const e=i=>i[t]||SZ;return e.isThemeGetter=!0,e},G3=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,K3=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wZ=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,CZ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kZ=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,TZ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,AZ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,EZ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ta=t=>wZ.test(t),We=t=>!!t&&!Number.isNaN(Number(t)),ia=t=>!!t&&Number.isInteger(Number(t)),O_=t=>t.endsWith("%")&&We(t.slice(0,-1)),io=t=>CZ.test(t),J3=()=>!0,MZ=t=>kZ.test(t)&&!TZ.test(t),TS=()=>!1,PZ=t=>AZ.test(t),RZ=t=>EZ.test(t),QZ=t=>!ke(t)&&!Ae(t),LZ=t=>Ra(t,iD,TS),ke=t=>G3.test(t),tl=t=>Ra(t,nD,MZ),AA=t=>Ra(t,VZ,We),DZ=t=>Ra(t,rD,J3),BZ=t=>Ra(t,sD,TS),EA=t=>Ra(t,eD,TS),$Z=t=>Ra(t,tD,RZ),Up=t=>Ra(t,oD,PZ),Ae=t=>K3.test(t),Cu=t=>Ql(t,nD),NZ=t=>Ql(t,sD),MA=t=>Ql(t,eD),zZ=t=>Ql(t,iD),jZ=t=>Ql(t,tD),Yp=t=>Ql(t,oD,!0),IZ=t=>Ql(t,rD,!0),Ra=(t,e,i)=>{const n=G3.exec(t);return n?n[1]?e(n[1]):i(n[2]):!1},Ql=(t,e,i=!1)=>{const n=K3.exec(t);return n?n[1]?e(n[1]):i:!1},eD=t=>t==="position"||t==="percentage",tD=t=>t==="image"||t==="url",iD=t=>t==="length"||t==="size"||t==="bg-size",nD=t=>t==="length",VZ=t=>t==="number",sD=t=>t==="family-name",rD=t=>t==="number"||t==="weight",oD=t=>t==="shadow",XZ=()=>{const t=pi("color"),e=pi("font"),i=pi("text"),n=pi("font-weight"),s=pi("tracking"),r=pi("leading"),o=pi("breakpoint"),l=pi("container"),c=pi("spacing"),u=pi("radius"),d=pi("shadow"),p=pi("inset-shadow"),g=pi("text-shadow"),O=pi("drop-shadow"),_=pi("blur"),b=pi("perspective"),S=pi("aspect"),w=pi("ease"),T=pi("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...A(),Ae,ke],E=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],N=()=>[Ae,ke,c],q=()=>[ta,"full","auto",...N()],G=()=>[ia,"none","subgrid",Ae,ke],U=()=>["auto",{span:["full",ia,Ae,ke]},ia,Ae,ke],Q=()=>[ia,"auto",Ae,ke],D=()=>["auto","min","max","fr",Ae,ke],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],j=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...N()],Z=()=>[ta,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],H=()=>[ta,"screen","full","dvw","lvw","svw","min","max","fit",...N()],F=()=>[ta,"screen","full","lh","dvh","lvh","svh","min","max","fit",...N()],M=()=>[t,Ae,ke],V=()=>[...A(),MA,EA,{position:[Ae,ke]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",zZ,LZ,{size:[Ae,ke]}],ue=()=>[O_,Cu,tl],he=()=>["","none","full",u,Ae,ke],fe=()=>["",We,Cu,tl],Oe=()=>["solid","dashed","dotted","double"],Ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[We,O_,MA,EA],nt=()=>["","none",_,Ae,ke],Qt=()=>["none",We,Ae,ke],Yt=()=>["none",We,Ae,ke],ei=()=>[We,Ae,ke],Le=()=>[ta,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[io],breakpoint:[io],color:[J3],container:[io],"drop-shadow":[io],ease:["in","out","in-out"],font:[QZ],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[io],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[io],shadow:[io],spacing:["px",We],text:[io],"text-shadow":[io],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ta,ke,Ae,S]}],container:["container"],columns:[{columns:[We,ke,Ae,l]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{"inset-s":q(),start:q()}],end:[{"inset-e":q(),end:q()}],"inset-bs":[{"inset-bs":q()}],"inset-be":[{"inset-be":q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[ia,"auto",Ae,ke]}],basis:[{basis:[ta,"full","auto",l,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[We,ta,"auto","initial","none",ke]}],grow:[{grow:["",We,Ae,ke]}],shrink:[{shrink:["",We,Ae,ke]}],order:[{order:[ia,"first","last","none",Ae,ke]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...j(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...j(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pbs:[{pbs:N()}],pbe:[{pbe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...F()]}],"min-block-size":[{"min-block":["auto",...F()]}],"max-block-size":[{"max-block":["none",...F()]}],w:[{w:[l,"screen",...Z()]}],"min-w":[{"min-w":[l,"screen","none",...Z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",i,Cu,tl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,IZ,DZ]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",O_,ke]}],"font-family":[{font:[NZ,BZ,e]}],"font-features":[{"font-features":[ke]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ae,ke]}],"line-clamp":[{"line-clamp":[We,"none",Ae,AA]}],leading:[{leading:[r,...N()]}],"list-image":[{"list-image":["none",Ae,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[We,"from-font","auto",Ae,tl]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[We,"auto",Ae,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ia,Ae,ke],radial:["",Ae,ke],conic:[ia,Ae,ke]},jZ,$Z]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:he()}],"rounded-s":[{"rounded-s":he()}],"rounded-e":[{"rounded-e":he()}],"rounded-t":[{"rounded-t":he()}],"rounded-r":[{"rounded-r":he()}],"rounded-b":[{"rounded-b":he()}],"rounded-l":[{"rounded-l":he()}],"rounded-ss":[{"rounded-ss":he()}],"rounded-se":[{"rounded-se":he()}],"rounded-ee":[{"rounded-ee":he()}],"rounded-es":[{"rounded-es":he()}],"rounded-tl":[{"rounded-tl":he()}],"rounded-tr":[{"rounded-tr":he()}],"rounded-br":[{"rounded-br":he()}],"rounded-bl":[{"rounded-bl":he()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Oe(),"hidden","none"]}],"divide-style":[{divide:[...Oe(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...Oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[We,Ae,ke]}],"outline-w":[{outline:["",We,Cu,tl]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",d,Yp,Up]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",p,Yp,Up]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[We,tl]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",g,Yp,Up]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[We,Ae,ke]}],"mix-blend":[{"mix-blend":[...Ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[We]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Ae,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[We]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,ke]}],filter:[{filter:["","none",Ae,ke]}],blur:[{blur:nt()}],brightness:[{brightness:[We,Ae,ke]}],contrast:[{contrast:[We,Ae,ke]}],"drop-shadow":[{"drop-shadow":["","none",O,Yp,Up]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",We,Ae,ke]}],"hue-rotate":[{"hue-rotate":[We,Ae,ke]}],invert:[{invert:["",We,Ae,ke]}],saturate:[{saturate:[We,Ae,ke]}],sepia:[{sepia:["",We,Ae,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,ke]}],"backdrop-blur":[{"backdrop-blur":nt()}],"backdrop-brightness":[{"backdrop-brightness":[We,Ae,ke]}],"backdrop-contrast":[{"backdrop-contrast":[We,Ae,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",We,Ae,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[We,Ae,ke]}],"backdrop-invert":[{"backdrop-invert":["",We,Ae,ke]}],"backdrop-opacity":[{"backdrop-opacity":[We,Ae,ke]}],"backdrop-saturate":[{"backdrop-saturate":[We,Ae,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",We,Ae,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[We,"initial",Ae,ke]}],ease:[{ease:["linear","initial",w,Ae,ke]}],delay:[{delay:[We,Ae,ke]}],animate:[{animate:["none",T,Ae,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Ae,ke]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:Qt()}],"rotate-x":[{"rotate-x":Qt()}],"rotate-y":[{"rotate-y":Qt()}],"rotate-z":[{"rotate-z":Qt()}],scale:[{scale:Yt()}],"scale-x":[{"scale-x":Yt()}],"scale-y":[{"scale-y":Yt()}],"scale-z":[{"scale-z":Yt()}],"scale-3d":["scale-3d"],skew:[{skew:ei()}],"skew-x":[{"skew-x":ei()}],"skew-y":[{"skew-y":ei()}],transform:[{transform:[Ae,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ae,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mbs":[{"scroll-mbs":N()}],"scroll-mbe":[{"scroll-mbe":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pbs":[{"scroll-pbs":N()}],"scroll-pbe":[{"scroll-pbe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ae,ke]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[We,Cu,tl,AA]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ZZ=xZ(XZ);function Ne(...t){return ZZ(tZ(t))}function qZ(t){const[e,i]=I.useState(null),[n,s]=I.useState(!1),[r,o]=I.useState(null),{lastChange:l}=Rr(),c=I.useCallback(async()=>{if(!t){i(null),s(!1),o(null);return}s(!0),o(null);try{const u=await fetch(`/api/phase/${encodeURIComponent(t)}`);if(!u.ok){const p=await u.json().catch(()=>({}));throw new Error(p.error||`Failed to fetch phase ${t} (${u.status})`)}const d=await u.json();i(d)}catch(u){o(u instanceof Error?u.message:"Unknown error")}finally{s(!1)}},[t]);return I.useEffect(()=>{c()},[c]),I.useEffect(()=>{l>0&&c()},[l,c]),{plans:(e==null?void 0:e.plans)??[],context:(e==null?void 0:e.context)??null,research:(e==null?void 0:e.research)??null,loading:n,error:r,refetch:c}}function WZ({tasks:t,planPath:e,planContent:i,onContentChange:n}){const s=I.useCallback(async r=>{const o=t[r];if(!o)return;let l=i;const c=o.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d=new RegExp(`<name>\\s*${c}\\s*</name>`).exec(l);if(d){const p=l.slice(d.index),g=p.match(/<done>([\s\S]*?)<\/done>/);if(g){const O=g[1],_=d.index+p.indexOf(g[0]),b=_+g[0].length,S=/^\s*\[x\]/i.test(O);let w;S?w=O.replace(/^\s*\[x\]\s*/i,""):w=`[x] ${O.trim()}`,l=l.slice(0,_)+`<done>${w}</done>`+l.slice(b)}}if(l!==i){n(l);try{const g=e.replace(/^\.planning[\\/]/,"").split(/[\\/]/);await fetch(`/api/plan/${g.join("/")}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:l})})}catch(p){console.error("[task-list] Failed to write checkbox change:",p)}}},[t,e,i,n]);return t.length===0?x.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No tasks defined"}):x.jsx("div",{className:"space-y-1",children:t.map((r,o)=>x.jsxs("div",{className:Ne("flex items-start gap-2 py-1 px-2 rounded-md transition-colors","hover:bg-muted/50",r.completed&&"opacity-60"),children:[x.jsx("button",{type:"button",onClick:()=>s(o),className:Ne("mt-0.5 flex-shrink-0 w-4 h-4 rounded-sm border transition-colors","focus:outline-none focus:ring-2 focus:ring-accent/50",r.completed?"bg-success border-success text-background":"border-muted-foreground hover:border-accent"),"aria-label":`Toggle ${r.name}`,children:r.completed&&x.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("path",{d:"M3 8l3 3 7-7"})})}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:Ne("text-sm font-sans",r.completed&&"line-through text-muted-foreground"),children:r.name}),x.jsx("span",{className:Ne("text-xs px-1.5 py-0.5 rounded-sm font-mono",r.type.startsWith("checkpoint")?"bg-warning/20 text-warning":"bg-muted text-muted-foreground"),children:r.type})]}),r.files.length>0&&x.jsx("div",{className:"mt-0.5",children:r.files.map((l,c)=>x.jsx("span",{className:"text-xs font-mono text-muted-foreground mr-2",children:l},c))})]})]},o))})}function UZ({plan:t,onEdit:e}){const[i,n]=I.useState(t.content),s=t.frontmatter,r=s.plan??"?",o=s.wave,l=s.autonomous,c=s.depends_on??[],u=s.files_modified??[];let d="";const p=t.content.match(/<objective>([\s\S]*?)<\/objective>/);if(p){const _=p[1].trim().split(`
58
- `)[0];d=_.length>120?_.slice(0,117)+"...":_}const g=I.useCallback(O=>{n(O)},[]);return x.jsxs("div",{className:"border border-border bg-card transition-colors hover:bg-card-hover",children:[x.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsxs("span",{className:"font-mono text-sm font-bold text-accent tabular-nums",children:["#",String(r).padStart(2,"0")]}),o!==void 0&&x.jsxs("span",{className:"font-mono text-[9px] uppercase tracking-widest px-1.5 py-0.5 border border-accent/20 text-accent/70",children:["Wave ",o]}),l&&x.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-1.5 py-0.5 border border-success/20 text-success",children:"Auto"})]}),x.jsx("button",{type:"button",onClick:()=>e(t.path),className:Ne("font-mono text-[10px] uppercase tracking-widest px-3 py-1","border border-border text-muted-foreground","hover:border-accent hover:text-accent","transition-colors"),children:"Edit"})]}),x.jsxs("div",{className:"px-4 py-3",children:[d&&x.jsx("p",{className:"text-sm text-muted-foreground mb-3 leading-relaxed",children:d}),x.jsxs("div",{className:"flex gap-4 mb-3 font-mono text-[10px] text-muted-foreground",children:[c.length>0&&x.jsxs("span",{children:["deps: ",c.join(", ")]}),u.length>0&&x.jsxs("span",{children:[u.length," file",u.length!==1?"s":""]}),x.jsxs("span",{children:[t.tasks.length," task",t.tasks.length!==1?"s":""]})]}),x.jsx(WZ,{tasks:t.tasks,planPath:t.path,planContent:i,onContentChange:g})]})]})}function V1(){return V1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},V1.apply(null,arguments)}function YZ(t,e){if(t==null)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;i[n]=t[n]}return i}let X1=[],aD=[];(()=>{let t="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,i=0;e<t.length;e++)(e%2?aD:X1).push(i=i+t[e])})();function HZ(t){if(t<768)return!1;for(let e=0,i=X1.length;;){let n=e+i>>1;if(t<X1[n])i=n;else if(t>=aD[n])e=n+1;else return!0;if(e==i)return!1}}function PA(t){return t>=127462&&t<=127487}const RA=8205;function FZ(t,e,i=!0,n=!0){return(i?lD:GZ)(t,e,n)}function lD(t,e,i){if(e==t.length)return e;e&&cD(t.charCodeAt(e))&&hD(t.charCodeAt(e-1))&&e--;let n=v_(t,e);for(e+=QA(n);e<t.length;){let s=v_(t,e);if(n==RA||s==RA||i&&HZ(s))e+=QA(s),n=s;else if(PA(s)){let r=0,o=e-2;for(;o>=0&&PA(v_(t,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function GZ(t,e,i){for(;e>0;){let n=lD(t,e-2,i);if(n<e)return n;e--}return 0}function v_(t,e){let i=t.charCodeAt(e);if(!hD(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return cD(n)?(i-55296<<10)+(n-56320)+65536:i}function cD(t){return t>=56320&&t<57344}function hD(t){return t>=55296&&t<56320}function QA(t){return t<65536?1:2}let at=class uD{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,i,n){[e,i]=sh(this,e,i);let s=[];return this.decompose(0,e,s,2),n.length&&n.decompose(0,n.length,s,3),this.decompose(i,this.length,s,1),mr.from(s,this.length-(i-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,i=this.length){[e,i]=sh(this,e,i);let n=[];return this.decompose(e,i,n,0),mr.from(n,i-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let i=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),s=new ff(this),r=new ff(e);for(let o=i,l=i;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=n)return!0}}iter(e=1){return new ff(this,e)}iterRange(e,i=this.length){return new fD(this,e,i)}iterLines(e,i){let n;if(e==null)n=this.iter();else{i==null&&(i=this.lines+1);let s=this.line(e).from;n=this.iterRange(s,Math.max(s,i==this.lines+1?this.length:i<=1?0:this.line(i-1).to))}return new dD(n)}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]?uD.empty:e.length<=32?new Kt(e):mr.from(Kt.split(e,[]))}};class Kt extends at{constructor(e,i=KZ(e)){super(),this.text=e,this.length=i}get lines(){return this.text.length}get children(){return null}lineInner(e,i,n,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((i?n:l)>=e)return new JZ(s,l,n,o);s=l+1,n++}}decompose(e,i,n,s){let r=e<=0&&i>=this.length?this:new Kt(LA(this.text,e,i),Math.min(i,this.length)-Math.max(0,e));if(s&1){let o=n.pop(),l=jm(r.text,o.text.slice(),0,r.length);if(l.length<=32)n.push(new Kt(l,o.length+r.length));else{let c=l.length>>1;n.push(new Kt(l.slice(0,c)),new Kt(l.slice(c)))}}else n.push(r)}replace(e,i,n){if(!(n instanceof Kt))return super.replace(e,i,n);[e,i]=sh(this,e,i);let s=jm(this.text,jm(n.text,LA(this.text,0,e)),i),r=this.length+n.length-(i-e);return s.length<=32?new Kt(s,r):mr.from(Kt.split(s,[]),r)}sliceString(e,i=this.length,n=`
59
- `){[e,i]=sh(this,e,i);let s="";for(let r=0,o=0;r<=i&&o<this.text.length;o++){let l=this.text[o],c=r+l.length;r>e&&o&&(s+=n),e<c&&i>r&&(s+=l.slice(Math.max(0,e-r),i-r)),r=c+1}return s}flatten(e){for(let i of this.text)e.push(i)}scanIdentical(){return 0}static split(e,i){let n=[],s=-1;for(let r of e)n.push(r),s+=r.length+1,n.length==32&&(i.push(new Kt(n,s)),n=[],s=-1);return s>-1&&i.push(new Kt(n,s)),i}}class mr extends at{constructor(e,i){super(),this.children=e,this.length=i,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,i,n,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,c=n+o.lines-1;if((i?c:l)>=e)return o.lineInner(e,i,n,s);s=l+1,n=c+1}}decompose(e,i,n,s){for(let r=0,o=0;o<=i&&r<this.children.length;r++){let l=this.children[r],c=o+l.length;if(e<=c&&i>=o){let u=s&((o<=e?1:0)|(c>=i?2:0));o>=e&&c<=i&&!u?n.push(l):l.decompose(e-o,i-o,n,u)}o=c+1}}replace(e,i,n){if([e,i]=sh(this,e,i),n.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&i<=l){let c=o.replace(e-r,i-r,n),u=this.lines-o.lines+c.lines;if(c.lines<u>>4&&c.lines>u>>6){let d=this.children.slice();return d[s]=c,new mr(d,this.length-(i-e)+n.length)}return super.replace(r,l,c)}r=l+1}return super.replace(e,i,n)}sliceString(e,i=this.length,n=`
60
- `){[e,i]=sh(this,e,i);let s="";for(let r=0,o=0;r<this.children.length&&o<=i;r++){let l=this.children[r],c=o+l.length;o>e&&r&&(s+=n),e<c&&i>o&&(s+=l.sliceString(e-o,i-o,n)),o=c+1}return s}flatten(e){for(let i of this.children)i.flatten(e)}scanIdentical(e,i){if(!(e instanceof mr))return 0;let n=0,[s,r,o,l]=i>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=i,r+=i){if(s==o||r==l)return n;let c=this.children[s],u=e.children[r];if(c!=u)return n+c.scanIdentical(u,i);n+=c.length+1}}static from(e,i=e.reduce((n,s)=>n+s.length+1,-1)){let n=0;for(let O of e)n+=O.lines;if(n<32){let O=[];for(let _ of e)_.flatten(O);return new Kt(O,i)}let s=Math.max(32,n>>5),r=s<<1,o=s>>1,l=[],c=0,u=-1,d=[];function p(O){let _;if(O.lines>r&&O instanceof mr)for(let b of O.children)p(b);else O.lines>o&&(c>o||!c)?(g(),l.push(O)):O instanceof Kt&&c&&(_=d[d.length-1])instanceof Kt&&O.lines+_.lines<=32?(c+=O.lines,u+=O.length+1,d[d.length-1]=new Kt(_.text.concat(O.text),_.length+1+O.length)):(c+O.lines>s&&g(),c+=O.lines,u+=O.length+1,d.push(O))}function g(){c!=0&&(l.push(d.length==1?d[0]:mr.from(d,u)),u=-1,c=d.length=0)}for(let O of e)p(O);return g(),l.length==1?l[0]:new mr(l,i)}}at.empty=new Kt([""],0);function KZ(t){let e=-1;for(let i of t)e+=i.length+1;return e}function jm(t,e,i=0,n=1e9){for(let s=0,r=0,o=!0;r<t.length&&s<=n;r++){let l=t[r],c=s+l.length;c>=i&&(c>n&&(l=l.slice(0,n-s)),s<i&&(l=l.slice(i-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=c+1}return e}function LA(t,e,i){return jm(t,[""],e,i)}class ff{constructor(e,i=1){this.dir=i,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[i>0?1:(e instanceof Kt?e.text.length:e.children.length)<<1]}nextInner(e,i){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,s=this.nodes[n],r=this.offsets[n],o=r>>1,l=s instanceof Kt?s.text.length:s.children.length;if(o==(i>0?l:0)){if(n==0)return this.done=!0,this.value="",this;i>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(i>0?0:1)){if(this.offsets[n]+=i,e==0)return this.lineBreak=!0,this.value=`
61
- `,this;e--}else if(s instanceof Kt){let c=s.text[o+(i<0?-1:0)];if(this.offsets[n]+=i,c.length>Math.max(0,e))return this.value=e==0?c:i>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=s.children[o+(i<0?-1:0)];e>c.length?(e-=c.length,this.offsets[n]+=i):(i<0&&this.offsets[n]--,this.nodes.push(c),this.offsets.push(i>0?1:(c instanceof Kt?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class fD{constructor(e,i,n){this.value="",this.done=!1,this.cursor=new ff(e,i>n?-1:1),this.pos=i>n?e.length:0,this.from=Math.min(i,n),this.to=Math.max(i,n)}nextInner(e,i){if(i<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,i<0?this.pos-this.to:this.from-this.pos);let n=i<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*i,this.value=s.length<=n?s:i<0?s.slice(s.length-n):s.slice(0,n),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 dD{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:i,lineBreak:n,value:s}=this.inner.next(e);return i&&this.afterBreak?(this.value="",this.afterBreak=!1):i?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(at.prototype[Symbol.iterator]=function(){return this.iter()},ff.prototype[Symbol.iterator]=fD.prototype[Symbol.iterator]=dD.prototype[Symbol.iterator]=function(){return this});let JZ=class{constructor(e,i,n,s){this.from=e,this.to=i,this.number=n,this.text=s}get length(){return this.to-this.from}};function sh(t,e,i){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,i))]}function Di(t,e,i=!0,n=!0){return FZ(t,e,i,n)}function eq(t){return t>=56320&&t<57344}function tq(t){return t>=55296&&t<56320}function Ln(t,e){let i=t.charCodeAt(e);if(!tq(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return eq(n)?(i-55296<<10)+(n-56320)+65536:i}function AS(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function gr(t){return t<65536?1:2}const Z1=/\r\n?|\n/;var Fi=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Fi||(Fi={}));class Cr{constructor(e){this.sections=e}get length(){let e=0;for(let i=0;i<this.sections.length;i+=2)e+=this.sections[i];return e}get newLength(){let e=0;for(let i=0;i<this.sections.length;i+=2){let n=this.sections[i+1];e+=n<0?this.sections[i]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let i=0,n=0,s=0;i<this.sections.length;){let r=this.sections[i++],o=this.sections[i++];o<0?(e(n,s,r),s+=r):s+=o,n+=r}}iterChangedRanges(e,i=!1){q1(this,e,i)}get invertedDesc(){let e=[];for(let i=0;i<this.sections.length;){let n=this.sections[i++],s=this.sections[i++];s<0?e.push(n,s):e.push(s,n)}return new Cr(e)}composeDesc(e){return this.empty?e:e.empty?this:pD(this,e)}mapDesc(e,i=!1){return e.empty?this:W1(this,e,i)}mapPos(e,i=-1,n=Fi.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],c=this.sections[o++],u=s+l;if(c<0){if(u>e)return r+(e-s);r+=l}else{if(n!=Fi.Simple&&u>=e&&(n==Fi.TrackDel&&s<e&&u>e||n==Fi.TrackBefore&&s<e||n==Fi.TrackAfter&&u>e))return null;if(u>e||u==e&&i<0&&!l)return e==s||i<0?r:r+c;r+=c}s=u}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,i=e){for(let n=0,s=0;n<this.sections.length&&s<=i;){let r=this.sections[n++],o=this.sections[n++],l=s+r;if(o>=0&&s<=i&&l>=e)return s<e&&l>i?"cover":!0;s=l}return!1}toString(){let e="";for(let i=0;i<this.sections.length;){let n=this.sections[i++],s=this.sections[i++];e+=(e?" ":"")+n+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(i=>typeof i!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Cr(e)}static create(e){return new Cr(e)}}class vi extends Cr{constructor(e,i){super(e),this.inserted=i}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return q1(this,(i,n,s,r,o)=>e=e.replace(s,s+(n-i),o),!1),e}mapDesc(e,i=!1){return W1(this,e,i,!0)}invert(e){let i=this.sections.slice(),n=[];for(let s=0,r=0;s<i.length;s+=2){let o=i[s],l=i[s+1];if(l>=0){i[s]=l,i[s+1]=o;let c=s>>1;for(;n.length<c;)n.push(at.empty);n.push(o?e.slice(r,r+o):at.empty)}r+=o}return new vi(i,n)}compose(e){return this.empty?e:e.empty?this:pD(this,e,!0)}map(e,i=!1){return e.empty?this:W1(this,e,i,!0)}iterChanges(e,i=!1){q1(this,e,i)}get desc(){return Cr.create(this.sections)}filter(e){let i=[],n=[],s=[],r=new Mf(this);e:for(let o=0,l=0;;){let c=o==e.length?1e9:e[o++];for(;l<c||l==c&&r.len==0;){if(r.done)break e;let d=Math.min(r.len,c-l);tn(s,d,-1);let p=r.ins==-1?-1:r.off==0?r.ins:0;tn(i,d,p),p>0&&_a(n,i,r.text),r.forward(d),l+=d}let u=e[o++];for(;l<u;){if(r.done)break e;let d=Math.min(r.len,u-l);tn(i,d,-1),tn(s,d,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(d),l+=d}}return{changes:new vi(i,n),filtered:Cr.create(s)}}toJSON(){let e=[];for(let i=0;i<this.sections.length;i+=2){let n=this.sections[i],s=this.sections[i+1];s<0?e.push(n):s==0?e.push([n]):e.push([n].concat(this.inserted[i>>1].toJSON()))}return e}static of(e,i,n){let s=[],r=[],o=0,l=null;function c(d=!1){if(!d&&!s.length)return;o<i&&tn(s,i-o,-1);let p=new vi(s,r);l=l?l.compose(p.map(l)):p,s=[],r=[],o=0}function u(d){if(Array.isArray(d))for(let p of d)u(p);else if(d instanceof vi){if(d.length!=i)throw new RangeError(`Mismatched change set length (got ${d.length}, expected ${i})`);c(),l=l?l.compose(d.map(l)):d}else{let{from:p,to:g=p,insert:O}=d;if(p>g||p<0||g>i)throw new RangeError(`Invalid change range ${p} to ${g} (in doc of length ${i})`);let _=O?typeof O=="string"?at.of(O.split(n||Z1)):O:at.empty,b=_.length;if(p==g&&b==0)return;p<o&&c(),p>o&&tn(s,p-o,-1),tn(s,g-p,b),_a(r,s,_),o=g}}return u(e),c(!l),l}static empty(e){return new vi(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let i=[],n=[];for(let s=0;s<e.length;s++){let r=e[s];if(typeof r=="number")i.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)i.push(r[0],0);else{for(;n.length<s;)n.push(at.empty);n[s]=at.of(r.slice(1)),i.push(r[0],n[s].length)}}}return new vi(i,n)}static createSet(e,i){return new vi(e,i)}}function tn(t,e,i,n=!1){if(e==0&&i<=0)return;let s=t.length-2;s>=0&&i<=0&&i==t[s+1]?t[s]+=e:s>=0&&e==0&&t[s]==0?t[s+1]+=i:n?(t[s]+=e,t[s+1]+=i):t.push(e,i)}function _a(t,e,i){if(i.length==0)return;let n=e.length-2>>1;if(n<t.length)t[t.length-1]=t[t.length-1].append(i);else{for(;t.length<n;)t.push(at.empty);t.push(i)}}function q1(t,e,i){let n=t.inserted;for(let s=0,r=0,o=0;o<t.sections.length;){let l=t.sections[o++],c=t.sections[o++];if(c<0)s+=l,r+=l;else{let u=s,d=r,p=at.empty;for(;u+=l,d+=c,c&&n&&(p=p.append(n[o-2>>1])),!(i||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],c=t.sections[o++];e(s,u,r,d,p),s=u,r=d}}}function W1(t,e,i,n=!1){let s=[],r=n?[]:null,o=new Mf(t),l=new Mf(e);for(let c=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let u=Math.min(o.len,l.len);tn(s,u,-1),o.forward(u),l.forward(u)}else if(l.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!i))){let u=l.len;for(tn(s,l.ins,-1);u;){let d=Math.min(o.len,u);o.ins>=0&&c<o.i&&o.len<=d&&(tn(s,0,o.ins),r&&_a(r,s,o.text),c=o.i),o.forward(d),u-=d}l.next()}else if(o.ins>=0){let u=0,d=o.len;for(;d;)if(l.ins==-1){let p=Math.min(d,l.len);u+=p,d-=p,l.forward(p)}else if(l.ins==0&&l.len<d)d-=l.len,l.next();else break;tn(s,u,c<o.i?o.ins:0),r&&c<o.i&&_a(r,s,o.text),c=o.i,o.forward(o.len-d)}else{if(o.done&&l.done)return r?vi.createSet(s,r):Cr.create(s);throw new Error("Mismatched change set lengths")}}}function pD(t,e,i=!1){let n=[],s=i?[]:null,r=new Mf(t),o=new Mf(e);for(let l=!1;;){if(r.done&&o.done)return s?vi.createSet(n,s):Cr.create(n);if(r.ins==0)tn(n,r.len,0,l),r.next();else if(o.len==0&&!o.done)tn(n,0,o.ins,l),s&&_a(s,n,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let c=Math.min(r.len2,o.len),u=n.length;if(r.ins==-1){let d=o.ins==-1?-1:o.off?0:o.ins;tn(n,c,d,l),s&&d&&_a(s,n,o.text)}else o.ins==-1?(tn(n,r.off?0:r.len,c,l),s&&_a(s,n,r.textBit(c))):(tn(n,r.off?0:r.len,o.off?0:o.ins,l),s&&!o.off&&_a(s,n,o.text));l=(r.ins>c||o.ins>=0&&o.len>c)&&(l||n.length>u),r.forward2(c),o.forward(c)}}}}class Mf{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,i=this.i-2>>1;return i>=e.length?at.empty:e[i]}textBit(e){let{inserted:i}=this.set,n=this.i-2>>1;return n>=i.length&&!e?at.empty:i[n].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 gl{constructor(e,i,n){this.from=e,this.to=i,this.flags=n}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,i=-1){let n,s;return this.empty?n=s=e.mapPos(this.from,i):(n=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),n==this.from&&s==this.to?this:new gl(n,s,this.flags)}extend(e,i=e){if(e<=this.anchor&&i>=this.anchor)return re.range(e,i);let n=Math.abs(e-this.anchor)>Math.abs(i-this.anchor)?e:i;return re.range(this.anchor,n)}eq(e,i=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!i||!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 re.range(e.anchor,e.head)}static create(e,i,n){return new gl(e,i,n)}}class re{constructor(e,i){this.ranges=e,this.mainIndex=i}map(e,i=-1){return e.empty?this:re.create(this.ranges.map(n=>n.map(e,i)),this.mainIndex)}eq(e,i=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],i))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new re([this.main],0)}addRange(e,i=!0){return re.create([e].concat(this.ranges),i?0:this.mainIndex+1)}replaceRange(e,i=this.mainIndex){let n=this.ranges.slice();return n[i]=e,re.create(n,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 re(e.ranges.map(i=>gl.fromJSON(i)),e.main)}static single(e,i=e){return new re([re.range(e,i)],0)}static create(e,i=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,s=0;s<e.length;s++){let r=e[s];if(r.empty?r.from<=n:r.from<n)return re.normalized(e.slice(),i);n=r.to}return new re(e,i)}static cursor(e,i=0,n,s){return gl.create(e,e,(i==0?0:i<0?8:16)|(n==null?7:Math.min(6,n))|(s??16777215)<<6)}static range(e,i,n,s){let r=(n??16777215)<<6|(s==null?7:Math.min(6,s));return i<e?gl.create(i,e,48|r):gl.create(e,i,(i>e?8:0)|r)}static normalized(e,i=0){let n=e[i];e.sort((s,r)=>s.from-r.from),i=e.indexOf(n);for(let s=1;s<e.length;s++){let r=e[s],o=e[s-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,c=Math.max(r.to,o.to);s<=i&&i--,e.splice(--s,2,r.anchor>r.head?re.range(c,l):re.range(l,c))}}return new re(e,i)}}function mD(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let ES=0;class xe{constructor(e,i,n,s,r){this.combine=e,this.compareInput=i,this.compare=n,this.isStatic=s,this.id=ES++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new xe(e.combine||(i=>i),e.compareInput||((i,n)=>i===n),e.compare||(e.combine?(i,n)=>i===n:MS),!!e.static,e.enables)}of(e){return new Im([],this,0,e)}compute(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new Im(e,this,1,i)}computeN(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new Im(e,this,2,i)}from(e,i){return i||(i=n=>n),this.compute([e],n=>i(n.field(e)))}}function MS(t,e){return t==e||t.length==e.length&&t.every((i,n)=>i===e[n])}class Im{constructor(e,i,n,s){this.dependencies=e,this.facet=i,this.type=n,this.value=s,this.id=ES++}dynamicSlot(e){var i;let n=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let p of this.dependencies)p=="doc"?c=!0:p=="selection"?u=!0:(((i=e[p.id])!==null&&i!==void 0?i:1)&1)==0&&d.push(e[p.id]);return{create(p){return p.values[o]=n(p),1},update(p,g){if(c&&g.docChanged||u&&(g.docChanged||g.selection)||U1(p,d)){let O=n(p);if(l?!DA(O,p.values[o],s):!s(O,p.values[o]))return p.values[o]=O,1}return 0},reconfigure:(p,g)=>{let O,_=g.config.address[r];if(_!=null){let b=_g(g,_);if(this.dependencies.every(S=>S instanceof xe?g.facet(S)===p.facet(S):S instanceof Bi?g.field(S,!1)==p.field(S,!1):!0)||(l?DA(O=n(p),b,s):s(O=n(p),b)))return p.values[o]=b,0}else O=n(p);return p.values[o]=O,1}}}}function DA(t,e,i){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!i(t[n],e[n]))return!1;return!0}function U1(t,e){let i=!1;for(let n of e)df(t,n)&1&&(i=!0);return i}function iq(t,e,i){let n=i.map(c=>t[c.id]),s=i.map(c=>c.type),r=n.filter(c=>!(c&1)),o=t[e.id]>>1;function l(c){let u=[];for(let d=0;d<n.length;d++){let p=_g(c,n[d]);if(s[d]==2)for(let g of p)u.push(g);else u.push(p)}return e.combine(u)}return{create(c){for(let u of n)df(c,u);return c.values[o]=l(c),1},update(c,u){if(!U1(c,r))return 0;let d=l(c);return e.compare(d,c.values[o])?0:(c.values[o]=d,1)},reconfigure(c,u){let d=U1(c,n),p=u.config.facets[e.id],g=u.facet(e);if(p&&!d&&MS(i,p))return c.values[o]=g,0;let O=l(c);return e.compare(O,g)?(c.values[o]=g,0):(c.values[o]=O,1)}}}const Hp=xe.define({static:!0});class Bi{constructor(e,i,n,s,r){this.id=e,this.createF=i,this.updateF=n,this.compareF=s,this.spec=r,this.provides=void 0}static define(e){let i=new Bi(ES++,e.create,e.update,e.compare||((n,s)=>n===s),e);return e.provide&&(i.provides=e.provide(i)),i}create(e){let i=e.facet(Hp).find(n=>n.field==this);return((i==null?void 0:i.create)||this.createF)(e)}slot(e){let i=e[this.id]>>1;return{create:n=>(n.values[i]=this.create(n),1),update:(n,s)=>{let r=n.values[i],o=this.updateF(r,s);return this.compareF(r,o)?0:(n.values[i]=o,1)},reconfigure:(n,s)=>{let r=n.facet(Hp),o=s.facet(Hp),l;return(l=r.find(c=>c.field==this))&&l!=o.find(c=>c.field==this)?(n.values[i]=l.create(n),1):s.config.address[this.id]!=null?(n.values[i]=s.field(this),0):(n.values[i]=this.create(n),1)}}}init(e){return[this,Hp.of({field:this,create:e})]}get extension(){return this}}const ul={lowest:4,low:3,default:2,high:1,highest:0};function ku(t){return e=>new gD(e,t)}const wo={highest:ku(ul.highest),high:ku(ul.high),default:ku(ul.default),low:ku(ul.low),lowest:ku(ul.lowest)};class gD{constructor(e,i){this.inner=e,this.prec=i}}class hO{of(e){return new Y1(this,e)}reconfigure(e){return hO.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Y1{constructor(e,i){this.compartment=e,this.inner=i}}class vg{constructor(e,i,n,s,r,o){for(this.base=e,this.compartments=i,this.dynamicSlots=n,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let i=this.address[e.id];return i==null?e.default:this.staticValues[i>>1]}static resolve(e,i,n){let s=[],r=Object.create(null),o=new Map;for(let g of nq(e,i,o))g instanceof Bi?s.push(g):(r[g.facet.id]||(r[g.facet.id]=[])).push(g);let l=Object.create(null),c=[],u=[];for(let g of s)l[g.id]=u.length<<1,u.push(O=>g.slot(O));let d=n==null?void 0:n.config.facets;for(let g in r){let O=r[g],_=O[0].facet,b=d&&d[g]||[];if(O.every(S=>S.type==0))if(l[_.id]=c.length<<1|1,MS(b,O))c.push(n.facet(_));else{let S=_.combine(O.map(w=>w.value));c.push(n&&_.compare(S,n.facet(_))?n.facet(_):S)}else{for(let S of O)S.type==0?(l[S.id]=c.length<<1|1,c.push(S.value)):(l[S.id]=u.length<<1,u.push(w=>S.dynamicSlot(w)));l[_.id]=u.length<<1,u.push(S=>iq(S,_,O))}}let p=u.map(g=>g(l));return new vg(e,o,p,l,c,r)}}function nq(t,e,i){let n=[[],[],[],[],[]],s=new Map;function r(o,l){let c=s.get(o);if(c!=null){if(c<=l)return;let u=n[c].indexOf(o);u>-1&&n[c].splice(u,1),o instanceof Y1&&i.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let u of o)r(u,l);else if(o instanceof Y1){if(i.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(o.compartment)||o.inner;i.set(o.compartment,u),r(u,l)}else if(o instanceof gD)r(o.inner,o.prec);else if(o instanceof Bi)n[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Im)n[l].push(o),o.facet.extensions&&r(o.facet.extensions,ul.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(u,l)}}return r(t,ul.default),n.reduce((o,l)=>o.concat(l))}function df(t,e){if(e&1)return 2;let i=e>>1,n=t.status[i];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;t.status[i]=4;let s=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|s}function _g(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const OD=xe.define(),H1=xe.define({combine:t=>t.some(e=>e),static:!0}),vD=xe.define({combine:t=>t.length?t[0]:void 0,static:!0}),_D=xe.define(),yD=xe.define(),bD=xe.define(),xD=xe.define({combine:t=>t.length?t[0]:!1});class Qr{constructor(e,i){this.type=e,this.value=i}static define(){return new sq}}class sq{of(e){return new Qr(this,e)}}class rq{constructor(e){this.map=e}of(e){return new ze(this,e)}}class ze{constructor(e,i){this.type=e,this.value=i}map(e){let i=this.type.map(this.value,e);return i===void 0?void 0:i==this.value?this:new ze(this.type,i)}is(e){return this.type==e}static define(e={}){return new rq(e.map||(i=>i))}static mapEffects(e,i){if(!e.length)return e;let n=[];for(let s of e){let r=s.map(i);r&&n.push(r)}return n}}ze.reconfigure=ze.define();ze.appendConfig=ze.define();class hi{constructor(e,i,n,s,r,o){this.startState=e,this.changes=i,this.selection=n,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,n&&mD(n,i.newLength),r.some(l=>l.type==hi.time)||(this.annotations=r.concat(hi.time.of(Date.now())))}static create(e,i,n,s,r,o){return new hi(e,i,n,s,r,o)}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 i of this.annotations)if(i.type==e)return i.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let i=this.annotation(hi.userEvent);return!!(i&&(i==e||i.length>e.length&&i.slice(0,e.length)==e&&i[e.length]=="."))}}hi.time=Qr.define();hi.userEvent=Qr.define();hi.addToHistory=Qr.define();hi.remote=Qr.define();function oq(t,e){let i=[];for(let n=0,s=0;;){let r,o;if(n<t.length&&(s==e.length||e[s]>=t[n]))r=t[n++],o=t[n++];else if(s<e.length)r=e[s++],o=e[s++];else return i;!i.length||i[i.length-1]<r?i.push(r,o):i[i.length-1]<o&&(i[i.length-1]=o)}}function SD(t,e,i){var n;let s,r,o;return i?(s=e.changes,r=vi.empty(e.changes.length),o=t.changes.compose(e.changes)):(s=e.changes.map(t.changes),r=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(s)),{changes:o,selection:e.selection?e.selection.map(r):(n=t.selection)===null||n===void 0?void 0:n.map(s),effects:ze.mapEffects(t.effects,s).concat(ze.mapEffects(e.effects,r)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function F1(t,e,i){let n=e.selection,s=Wc(e.annotations);return e.userEvent&&(s=s.concat(hi.userEvent.of(e.userEvent))),{changes:e.changes instanceof vi?e.changes:vi.of(e.changes||[],i,t.facet(vD)),selection:n&&(n instanceof re?n:re.single(n.anchor,n.head)),effects:Wc(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function wD(t,e,i){let n=F1(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(i=!1);for(let r=1;r<e.length;r++){e[r].filter===!1&&(i=!1);let o=!!e[r].sequential;n=SD(n,F1(t,e[r],o?n.changes.newLength:t.doc.length),o)}let s=hi.create(t,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return lq(i?aq(s):s)}function aq(t){let e=t.startState,i=!0;for(let s of e.facet(_D)){let r=s(t);if(r===!1){i=!1;break}Array.isArray(r)&&(i=i===!0?r:oq(i,r))}if(i!==!0){let s,r;if(i===!1)r=t.changes.invertedDesc,s=vi.empty(e.doc.length);else{let o=t.changes.filter(i);s=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}t=hi.create(e,s,t.selection&&t.selection.map(r),ze.mapEffects(t.effects,r),t.annotations,t.scrollIntoView)}let n=e.facet(yD);for(let s=n.length-1;s>=0;s--){let r=n[s](t);r instanceof hi?t=r:Array.isArray(r)&&r.length==1&&r[0]instanceof hi?t=r[0]:t=wD(e,Wc(r),!1)}return t}function lq(t){let e=t.startState,i=e.facet(bD),n=t;for(let s=i.length-1;s>=0;s--){let r=i[s](t);r&&Object.keys(r).length&&(n=SD(n,F1(e,r,t.changes.newLength),!0))}return n==t?t:hi.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const cq=[];function Wc(t){return t==null?cq:Array.isArray(t)?t:[t]}var Dt=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Dt||(Dt={}));const hq=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let G1;try{G1=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function uq(t){if(G1)return G1.test(t);for(let e=0;e<t.length;e++){let i=t[e];if(/\w/.test(i)||i>"€"&&(i.toUpperCase()!=i.toLowerCase()||hq.test(i)))return!0}return!1}function fq(t){return e=>{if(!/\S/.test(e))return Dt.Space;if(uq(e))return Dt.Word;for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>-1)return Dt.Word;return Dt.Other}}class et{constructor(e,i,n,s,r,o){this.config=e,this.doc=i,this.selection=n,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)df(this,l<<1);this.computeSlot=null}field(e,i=!0){let n=this.config.address[e.id];if(n==null){if(i)throw new RangeError("Field is not present in this state");return}return df(this,n),_g(this,n)}update(...e){return wD(this,e,!0)}applyTransaction(e){let i=this.config,{base:n,compartments:s}=i;for(let l of e.effects)l.is(hO.reconfigure)?(i&&(s=new Map,i.compartments.forEach((c,u)=>s.set(u,c)),i=null),s.set(l.value.compartment,l.value.extension)):l.is(ze.reconfigure)?(i=null,n=l.value):l.is(ze.appendConfig)&&(i=null,n=Wc(n).concat(l.value));let r;i?r=e.startState.values.slice():(i=vg.resolve(n,s,this),r=new et(i,this.doc,this.selection,i.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let o=e.startState.facet(H1)?e.newSelection:e.newSelection.asSingle();new et(i,e.newDoc,o,r,(l,c)=>c.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:e},range:re.cursor(i.from+e.length)}))}changeByRange(e){let i=this.selection,n=e(i.ranges[0]),s=this.changes(n.changes),r=[n.range],o=Wc(n.effects);for(let l=1;l<i.ranges.length;l++){let c=e(i.ranges[l]),u=this.changes(c.changes),d=u.map(s);for(let g=0;g<l;g++)r[g]=r[g].map(d);let p=s.mapDesc(u,!0);r.push(c.range.map(p)),s=s.compose(d),o=ze.mapEffects(o,d).concat(ze.mapEffects(Wc(c.effects),p))}return{changes:s,selection:re.create(r,i.mainIndex),effects:o}}changes(e=[]){return e instanceof vi?e:vi.of(e,this.doc.length,this.facet(et.lineSeparator))}toText(e){return at.of(e.split(this.facet(et.lineSeparator)||Z1))}sliceDoc(e=0,i=this.doc.length){return this.doc.sliceString(e,i,this.lineBreak)}facet(e){let i=this.config.address[e.id];return i==null?e.default:(df(this,i),_g(this,i))}toJSON(e){let i={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let s=e[n];s instanceof Bi&&this.config.address[s.id]!=null&&(i[n]=s.spec.toJSON(this.field(e[n]),this))}return i}static fromJSON(e,i={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(n){for(let r in n)if(Object.prototype.hasOwnProperty.call(e,r)){let o=n[r],l=e[r];s.push(o.init(c=>o.spec.fromJSON(l,c)))}}return et.create({doc:e.doc,selection:re.fromJSON(e.selection),extensions:i.extensions?s.concat([i.extensions]):s})}static create(e={}){let i=vg.resolve(e.extensions||[],new Map),n=e.doc instanceof at?e.doc:at.of((e.doc||"").split(i.staticFacet(et.lineSeparator)||Z1)),s=e.selection?e.selection instanceof re?e.selection:re.single(e.selection.anchor,e.selection.head):re.single(0);return mD(s,n.length),i.staticFacet(H1)||(s=s.asSingle()),new et(i,n,s,i.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(et.tabSize)}get lineBreak(){return this.facet(et.lineSeparator)||`
62
- `}get readOnly(){return this.facet(xD)}phrase(e,...i){for(let n of this.facet(et.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return i.length&&(e=e.replace(/\$(\$|\d*)/g,(n,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>i.length?n:i[r-1]})),e}languageDataAt(e,i,n=-1){let s=[];for(let r of this.facet(OD))for(let o of r(this,i,n))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){let i=this.languageDataAt("wordChars",e);return fq(i.length?i[0]:"")}wordAt(e){let{text:i,from:n,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let c=Di(i,o,!1);if(r(i.slice(c,o))!=Dt.Word)break;o=c}for(;l<s;){let c=Di(i,l);if(r(i.slice(l,c))!=Dt.Word)break;l=c}return o==l?null:re.range(o+n,l+n)}}et.allowMultipleSelections=H1;et.tabSize=xe.define({combine:t=>t.length?t[0]:4});et.lineSeparator=vD;et.readOnly=xD;et.phrases=xe.define({compare(t,e){let i=Object.keys(t),n=Object.keys(e);return i.length==n.length&&i.every(s=>t[s]==e[s])}});et.languageData=OD;et.changeFilter=_D;et.transactionFilter=yD;et.transactionExtender=bD;hO.reconfigure=ze.define();function Lr(t,e,i={}){let n={};for(let s of t)for(let r of Object.keys(s)){let o=s[r],l=n[r];if(l===void 0)n[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(i,r))n[r]=i[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)n[s]===void 0&&(n[s]=e[s]);return n}class wa{eq(e){return this==e}range(e,i=e){return K1.create(e,i,this)}}wa.prototype.startSide=wa.prototype.endSide=0;wa.prototype.point=!1;wa.prototype.mapMode=Fi.TrackDel;function PS(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let K1=class CD{constructor(e,i,n){this.from=e,this.to=i,this.value=n}static create(e,i,n){return new CD(e,i,n)}};function J1(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class RS{constructor(e,i,n,s){this.from=e,this.to=i,this.value=n,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,i,n,s=0){let r=n?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let c=o+l>>1,u=r[c]-e||(n?this.value[c].endSide:this.value[c].startSide)-i;if(c==o)return u>=0?o:l;u>=0?l=c:o=c+1}}between(e,i,n,s){for(let r=this.findIndex(i,-1e9,!0),o=this.findIndex(n,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,i){let n=[],s=[],r=[],o=-1,l=-1;for(let c=0;c<this.value.length;c++){let u=this.value[c],d=this.from[c]+e,p=this.to[c]+e,g,O;if(d==p){let _=i.mapPos(d,u.startSide,u.mapMode);if(_==null||(g=O=_,u.startSide!=u.endSide&&(O=i.mapPos(d,u.endSide),O<g)))continue}else if(g=i.mapPos(d,u.startSide),O=i.mapPos(p,u.endSide),g>O||g==O&&u.startSide>0&&u.endSide<=0)continue;(O-g||u.endSide-u.startSide)<0||(o<0&&(o=g),u.point&&(l=Math.max(l,O-g)),n.push(u),s.push(g-o),r.push(O-o))}return{mapped:n.length?new RS(s,r,n,l):null,pos:o}}}class Ge{constructor(e,i,n,s){this.chunkPos=e,this.chunk=i,this.nextLayer=n,this.maxPoint=s}static create(e,i,n,s){return new Ge(e,i,n,s)}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 i of this.chunk)e+=i.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:i=[],sort:n=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(i.length==0&&!o)return this;if(n&&(i=i.slice().sort(J1)),this.isEmpty)return i.length?Ge.of(i):this;let l=new kD(this,null,-1).goto(0),c=0,u=[],d=new yo;for(;l.value||c<i.length;)if(c<i.length&&(l.from-i[c].from||l.startSide-i[c].value.startSide)>=0){let p=i[c++];d.addInner(p.from,p.to,p.value)||u.push(p)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(c==i.length||this.chunkEnd(l.chunkIndex)<i[c].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&d.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(d.addInner(l.from,l.to,l.value)||u.push(K1.create(l.from,l.to,l.value))),l.next());return d.finishInner(this.nextLayer.isEmpty&&!u.length?Ge.empty:this.nextLayer.update({add:u,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let i=[],n=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],c=this.chunk[o],u=e.touchesRange(l,l+c.length);if(u===!1)s=Math.max(s,c.maxPoint),i.push(c),n.push(e.mapPos(l));else if(u===!0){let{mapped:d,pos:p}=c.map(l,e);d&&(s=Math.max(s,d.maxPoint),i.push(d),n.push(p))}}let r=this.nextLayer.map(e);return i.length==0?r:new Ge(n,i,r||Ge.empty,s)}between(e,i,n){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(i>=r&&e<=r+o.length&&o.between(r,e-r,i-r,n)===!1)return}this.nextLayer.between(e,i,n)}}iter(e=0){return Pf.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,i=0){return Pf.from(e).goto(i)}static compare(e,i,n,s,r=-1){let o=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=r),l=i.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=r),c=BA(o,l,n),u=new Tu(o,c,r),d=new Tu(l,c,r);n.iterGaps((p,g,O)=>$A(u,p,d,g,O,s)),n.empty&&n.length==0&&$A(u,0,d,0,0,s)}static eq(e,i,n=0,s){s==null&&(s=999999999);let r=e.filter(d=>!d.isEmpty&&i.indexOf(d)<0),o=i.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=BA(r,o),c=new Tu(r,l,0).goto(n),u=new Tu(o,l,0).goto(n);for(;;){if(c.to!=u.to||!eb(c.active,u.active)||c.point&&(!u.point||!PS(c.point,u.point)))return!1;if(c.to>s)return!0;c.next(),u.next()}}static spans(e,i,n,s,r=-1){let o=new Tu(e,null,r).goto(i),l=i,c=o.openStart;for(;;){let u=Math.min(o.to,n);if(o.point){let d=o.activeForPoint(o.to),p=o.pointFrom<i?d.length+1:o.point.startSide<0?d.length:Math.min(d.length,c);s.point(l,u,o.point,d,p,o.pointRank),c=Math.min(o.openEnd(u),d.length)}else u>l&&(s.span(l,u,o.active,c),c=o.openEnd(u));if(o.to>n)return c+(o.point&&o.to>n?1:0);l=o.to,o.next()}}static of(e,i=!1){let n=new yo;for(let s of e instanceof K1?[e]:i?dq(e):e)n.add(s.from,s.to,s.value);return n.finish()}static join(e){if(!e.length)return Ge.empty;let i=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let s=e[n];s!=Ge.empty;s=s.nextLayer)i=new Ge(s.chunkPos,s.chunk,i,Math.max(s.maxPoint,i.maxPoint));return i}}Ge.empty=new Ge([],[],null,-1);function dq(t){if(t.length>1)for(let e=t[0],i=1;i<t.length;i++){let n=t[i];if(J1(e,n)>0)return t.slice().sort(J1);e=n}return t}Ge.empty.nextLayer=Ge.empty;class yo{finishChunk(e){this.chunks.push(new RS(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,i,n){this.addInner(e,i,n)||(this.nextLayer||(this.nextLayer=new yo)).add(e,i,n)}addInner(e,i,n){let s=e-this.lastTo||n.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(i-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=i,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,i-e)),!0)}addChunk(e,i){if((e-this.lastTo||i.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,i.maxPoint),this.chunks.push(i),this.chunkPos.push(e);let n=i.value.length-1;return this.last=i.value[n],this.lastFrom=i.from[n]+e,this.lastTo=i.to[n]+e,!0}finish(){return this.finishInner(Ge.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let i=Ge.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,i}}function BA(t,e,i){let n=new Map;for(let r of t)for(let o=0;o<r.chunk.length;o++)r.chunk[o].maxPoint<=0&&n.set(r.chunk[o],r.chunkPos[o]);let s=new Set;for(let r of e)for(let o=0;o<r.chunk.length;o++){let l=n.get(r.chunk[o]);l!=null&&(i?i.mapPos(l):l)==r.chunkPos[o]&&!(i!=null&&i.touchesRange(l,l+r.chunk[o].length))&&s.add(r.chunk[o])}return s}class kD{constructor(e,i,n,s=0){this.layer=e,this.skip=i,this.minPoint=n,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,i=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,i,!1),this}gotoInner(e,i,n){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],i,!0);(!n||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(e,i){(this.to-e||this.endSide-i)<0&&this.gotoInner(e,i,!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],i=this.layer.chunk[this.chunkIndex],n=e+i.from[this.rangeIndex];if(this.from=n,this.to=e+i.to[this.rangeIndex],this.value=i.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 Pf{constructor(e){this.heap=e}static from(e,i=null,n=-1){let s=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&s.push(new kD(o,i,n,r));return s.length==1?s[0]:new Pf(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,i=-1e9){for(let n of this.heap)n.goto(e,i);for(let n=this.heap.length>>1;n>=0;n--)__(this.heap,n);return this.next(),this}forward(e,i){for(let n of this.heap)n.forward(e,i);for(let n=this.heap.length>>1;n>=0;n--)__(this.heap,n);(this.to-e||this.value.endSide-i)<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(),__(this.heap,0)}}}function __(t,e){for(let i=t[e];;){let n=(e<<1)+1;if(n>=t.length)break;let s=t[n];if(n+1<t.length&&s.compare(t[n+1])>=0&&(s=t[n+1],n++),i.compare(s)<0)break;t[n]=i,t[e]=s,e=n}}class Tu{constructor(e,i,n){this.minPoint=n,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=Pf.from(e,i,n)}goto(e,i=-1e9){return this.cursor.goto(e,i),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=i,this.openStart=-1,this.next(),this}forward(e,i){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-i)<0;)this.removeActive(this.minActive);this.cursor.forward(e,i)}removeActive(e){Fp(this.active,e),Fp(this.activeTo,e),Fp(this.activeRank,e),this.minActive=NA(this.active,this.activeTo)}addActive(e){let i=0,{value:n,to:s,rank:r}=this.cursor;for(;i<this.activeRank.length&&(r-this.activeRank[i]||s-this.activeTo[i])>0;)i++;Gp(this.active,i,n),Gp(this.activeTo,i,s),Gp(this.activeRank,i,r),e&&Gp(e,i,this.cursor.from),this.minActive=NA(this.active,this.activeTo)}next(){let e=this.to,i=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),n&&Fp(n,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(n),this.cursor.next();else if(i&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=r,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=r.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let s=n.length-1;s>=0&&n[s]<e;s--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let i=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&i.push(this.active[n]);return i.reverse()}openEnd(e){let i=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)i++;return i}}function $A(t,e,i,n,s,r){t.goto(e),i.goto(n);let o=n+s,l=n,c=n-e,u=!!r.boundChange;for(let d=!1;;){let p=t.to+c-i.to,g=p||t.endSide-i.endSide,O=g<0?t.to+c:i.to,_=Math.min(O,o);if(t.point||i.point?(t.point&&i.point&&PS(t.point,i.point)&&eb(t.activeForPoint(t.to),i.activeForPoint(i.to))||r.comparePoint(l,_,t.point,i.point),d=!1):(d&&r.boundChange(l),_>l&&!eb(t.active,i.active)&&r.compareRange(l,_,t.active,i.active),u&&_<o&&(p||t.openEnd(O)!=i.openEnd(O))&&(d=!0)),O>o)break;l=O,g<=0&&t.next(),g>=0&&i.next()}}function eb(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!=e[i]&&!PS(t[i],e[i]))return!1;return!0}function Fp(t,e){for(let i=e,n=t.length-1;i<n;i++)t[i]=t[i+1];t.pop()}function Gp(t,e,i){for(let n=t.length-1;n>=e;n--)t[n+1]=t[n];t[e]=i}function NA(t,e){let i=-1,n=1e9;for(let s=0;s<e.length;s++)(e[s]-n||t[s].endSide-t[i].endSide)<0&&(i=s,n=e[s]);return i}function Ys(t,e,i=t.length){let n=0;for(let s=0;s<i&&s<t.length;)t.charCodeAt(s)==9?(n+=e-n%e,s++):(n++,s=Di(t,s));return n}function tb(t,e,i,n){for(let s=0,r=0;;){if(r>=e)return s;if(s==t.length)break;r+=t.charCodeAt(s)==9?i-r%i:1,s=Di(t,s)}return n===!0?-1:t.length}const ib="ͼ",zA=typeof Symbol>"u"?"__"+ib:Symbol.for(ib),nb=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),jA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Ca{constructor(e,i){this.rules=[];let{finish:n}=i||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,c,u){let d=[],p=/^@(\w+)\b/.exec(o[0]),g=p&&p[1]=="keyframes";if(p&&l==null)return c.push(o[0]+";");for(let O in l){let _=l[O];if(/&/.test(O))r(O.split(/,\s*/).map(b=>o.map(S=>b.replace(/&/,S))).reduce((b,S)=>b.concat(S)),_,c);else if(_&&typeof _=="object"){if(!p)throw new RangeError("The value of a property ("+O+") should be a primitive value.");r(s(O),_,d,g)}else _!=null&&d.push(O.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+_+";")}(d.length||g)&&c.push((n&&!p&&!u?o.map(n):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(`
63
- `)}static newName(){let e=jA[zA]||1;return jA[zA]=e+1,ib+e.toString(36)}static mount(e,i,n){let s=e[nb],r=n&&n.nonce;s?r&&s.setNonce(r):s=new pq(e,r),s.mount(Array.isArray(i)?i:[i],e)}}let IA=new Map;class pq{constructor(e,i){let n=e.ownerDocument||e,s=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=IA.get(n);if(r)return e[nb]=r;this.sheet=new s.CSSStyleSheet,IA.set(n,this)}else this.styleTag=n.createElement("style"),i&&this.styleTag.setAttribute("nonce",i);this.modules=[],e[nb]=this}mount(e,i){let n=this.sheet,s=0,r=0;for(let o=0;o<e.length;o++){let l=e[o],c=this.modules.indexOf(l);if(c<r&&c>-1&&(this.modules.splice(c,1),r--,c=-1),c==-1){if(this.modules.splice(r++,0,l),n)for(let u=0;u<l.rules.length;u++)n.insertRule(l.rules[u],s++)}else{for(;r<c;)s+=this.modules[r++].rules.length;s+=l.rules.length,r++}}if(n)i.adoptedStyleSheets.indexOf(this.sheet)<0&&(i.adoptedStyleSheets=[this.sheet,...i.adoptedStyleSheets]);else{let o="";for(let c=0;c<this.modules.length;c++)o+=this.modules[c].getRules()+`
64
- `;this.styleTag.textContent=o;let l=i.head||i;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var ka={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:"'"},Rf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mq=typeof navigator<"u"&&/Mac/.test(navigator.platform),gq=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Hi=0;Hi<10;Hi++)ka[48+Hi]=ka[96+Hi]=String(Hi);for(var Hi=1;Hi<=24;Hi++)ka[Hi+111]="F"+Hi;for(var Hi=65;Hi<=90;Hi++)ka[Hi]=String.fromCharCode(Hi+32),Rf[Hi]=String.fromCharCode(Hi);for(var y_ in ka)Rf.hasOwnProperty(y_)||(Rf[y_]=ka[y_]);function Oq(t){var e=mq&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||gq&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",i=!e&&t.key||(t.shiftKey?Rf:ka)[t.keyCode]||t.key||"Unidentified";return i=="Esc"&&(i="Escape"),i=="Del"&&(i="Delete"),i=="Left"&&(i="ArrowLeft"),i=="Up"&&(i="ArrowUp"),i=="Right"&&(i="ArrowRight"),i=="Down"&&(i="ArrowDown"),i}function vt(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,i=arguments[1];if(i&&typeof i=="object"&&i.nodeType==null&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var s=i[n];typeof s=="string"?t.setAttribute(n,s):s!=null&&(t[n]=s)}e++}for(;e<arguments.length;e++)TD(t,arguments[e]);return t}function TD(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var i=0;i<e.length;i++)TD(t,e[i]);else throw new RangeError("Unsupported child node: "+e)}let mn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},sb=typeof document<"u"?document:{documentElement:{style:{}}};const rb=/Edge\/(\d+)/.exec(mn.userAgent),AD=/MSIE \d/.test(mn.userAgent),ob=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(mn.userAgent),uO=!!(AD||ob||rb),VA=!uO&&/gecko\/(\d+)/i.test(mn.userAgent),b_=!uO&&/Chrome\/(\d+)/.exec(mn.userAgent),vq="webkitFontSmoothing"in sb.documentElement.style,ab=!uO&&/Apple Computer/.test(mn.vendor),XA=ab&&(/Mobile\/\w+/.test(mn.userAgent)||mn.maxTouchPoints>2);var Se={mac:XA||/Mac/.test(mn.platform),windows:/Win/.test(mn.platform),linux:/Linux|X11/.test(mn.platform),ie:uO,ie_version:AD?sb.documentMode||6:ob?+ob[1]:rb?+rb[1]:0,gecko:VA,gecko_version:VA?+(/Firefox\/(\d+)/.exec(mn.userAgent)||[0,0])[1]:0,chrome:!!b_,chrome_version:b_?+b_[1]:0,ios:XA,android:/Android\b/.test(mn.userAgent),webkit_version:vq?+(/\bAppleWebKit\/(\d+)/.exec(mn.userAgent)||[0,0])[1]:0,safari:ab,safari_version:ab?+(/\bVersion\/(\d+(\.\d+)?)/.exec(mn.userAgent)||[0,0])[1]:0,tabSize:sb.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function QS(t,e){for(let i in t)i=="class"&&e.class?e.class+=" "+t.class:i=="style"&&e.style?e.style+=";"+t.style:e[i]=t[i];return e}const yg=Object.create(null);function LS(t,e,i){if(t==e)return!0;t||(t=yg),e||(e=yg);let n=Object.keys(t),s=Object.keys(e);if(n.length-0!=s.length-0)return!1;for(let r of n)if(r!=i&&(s.indexOf(r)==-1||t[r]!==e[r]))return!1;return!0}function _q(t,e){for(let i=t.attributes.length-1;i>=0;i--){let n=t.attributes[i].name;e[n]==null&&t.removeAttribute(n)}for(let i in e){let n=e[i];i=="style"?t.style.cssText=n:t.getAttribute(i)!=n&&t.setAttribute(i,n)}}function ZA(t,e,i){let n=!1;if(e)for(let s in e)i&&s in i||(n=!0,s=="style"?t.style.cssText="":t.removeAttribute(s));if(i)for(let s in i)e&&e[s]==i[s]||(n=!0,s=="style"?t.style.cssText=i[s]:t.setAttribute(s,i[s]));return n}function yq(t){let e=Object.create(null);for(let i=0;i<t.attributes.length;i++){let n=t.attributes[i];e[n.name]=n.value}return e}class Gs{eq(e){return!1}updateDOM(e,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,i,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Ki=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(Ki||(Ki={}));class Pe extends wa{constructor(e,i,n,s){super(),this.startSide=e,this.endSide=i,this.widget=n,this.spec=s}get heightRelevant(){return!1}static mark(e){return new hd(e)}static widget(e){let i=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return i+=n&&!e.inlineOrder?i>0?3e8:-4e8:i>0?1e8:-1e8,new Tl(e,i,i,n,e.widget||null,!1)}static replace(e){let i=!!e.block,n,s;if(e.isBlockGap)n=-5e8,s=4e8;else{let{start:r,end:o}=ED(e,i);n=(r?i?-3e8:-1:5e8)-1,s=(o?i?2e8:1:-6e8)+1}return new Tl(e,n,s,i,e.widget||null,!0)}static line(e){return new ud(e)}static set(e,i=!1){return Ge.of(e,i)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Pe.none=Ge.empty;class hd extends Pe{constructor(e){let{start:i,end:n}=ED(e);super(i?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?QS(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||yg}eq(e){return this==e||e instanceof hd&&this.tagName==e.tagName&&LS(this.attrs,e.attrs)}range(e,i=e){if(e>=i)throw new RangeError("Mark decorations may not be empty");return super.range(e,i)}}hd.prototype.point=!1;class ud extends Pe{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ud&&this.spec.class==e.spec.class&&LS(this.spec.attributes,e.spec.attributes)}range(e,i=e){if(i!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,i)}}ud.prototype.mapMode=Fi.TrackBefore;ud.prototype.point=!0;class Tl extends Pe{constructor(e,i,n,s,r,o){super(i,n,r,e),this.block=s,this.isReplace=o,this.mapMode=s?i<=0?Fi.TrackBefore:Fi.TrackAfter:Fi.TrackDel}get type(){return this.startSide!=this.endSide?Ki.WidgetRange:this.startSide<=0?Ki.WidgetBefore:Ki.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Tl&&bq(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,i=e){if(this.isReplace&&(e>i||e==i&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&i!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,i)}}Tl.prototype.point=!0;function ED(t,e=!1){let{inclusiveStart:i,inclusiveEnd:n}=t;return i==null&&(i=t.inclusive),n==null&&(n=t.inclusive),{start:i??e,end:n??e}}function bq(t,e){return t==e||!!(t&&e&&t.compare(e))}function Uc(t,e,i,n=0){let s=i.length-1;s>=0&&i[s]+n>=t?i[s]=Math.max(i[s],e):i.push(t,e)}class Qf extends wa{constructor(e,i){super(),this.tagName=e,this.attributes=i}eq(e){return e==this||e instanceof Qf&&this.tagName==e.tagName&&LS(this.attributes,e.attributes)}static create(e){return new Qf(e.tagName,e.attributes||yg)}static set(e,i=!1){return Ge.of(e,i)}}Qf.prototype.startSide=Qf.prototype.endSide=-1;function Lf(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function lb(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function pf(t,e){if(!e.anchorNode)return!1;try{return lb(t,e.anchorNode)}catch{return!1}}function mf(t){return t.nodeType==3?Bf(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function gf(t,e,i,n){return i?qA(t,e,i,n,-1)||qA(t,e,i,n,1):!1}function Ta(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function bg(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function qA(t,e,i,n,s){for(;;){if(t==i&&e==n)return!0;if(e==(s<0?0:bo(t))){if(t.nodeName=="DIV")return!1;let r=t.parentNode;if(!r||r.nodeType!=1)return!1;e=Ta(t)+(s<0?0:1),t=r}else if(t.nodeType==1){if(t=t.childNodes[e+(s<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=s<0?bo(t):0}else return!1}}function bo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Df(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function xq(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function MD(t,e){let i=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}function Sq(t,e,i,n,s,r,o,l){let c=t.ownerDocument,u=c.defaultView||window;for(let d=t,p=!1;d&&!p;)if(d.nodeType==1){let g,O=d==c.body,_=1,b=1;if(O)g=xq(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(p=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let T=d.getBoundingClientRect();({scaleX:_,scaleY:b}=MD(d,T)),g={left:T.left,right:T.left+d.clientWidth*_,top:T.top,bottom:T.top+d.clientHeight*b}}let S=0,w=0;if(s=="nearest")e.top<g.top?(w=e.top-(g.top+o),i>0&&e.bottom>g.bottom+w&&(w=e.bottom-g.bottom+o)):e.bottom>g.bottom&&(w=e.bottom-g.bottom+o,i<0&&e.top-w<g.top&&(w=e.top-(g.top+o)));else{let T=e.bottom-e.top,k=g.bottom-g.top;w=(s=="center"&&T<=k?e.top+T/2-k/2:s=="start"||s=="center"&&i<0?e.top-o:e.bottom-k+o)-g.top}if(n=="nearest"?e.left<g.left?(S=e.left-(g.left+r),i>0&&e.right>g.right+S&&(S=e.right-g.right+r)):e.right>g.right&&(S=e.right-g.right+r,i<0&&e.left<g.left+S&&(S=e.left-(g.left+r))):S=(n=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:n=="start"==l?e.left-r:e.right-(g.right-g.left)+r)-g.left,S||w)if(O)u.scrollBy(S,w);else{let T=0,k=0;if(w){let A=d.scrollTop;d.scrollTop+=w/b,k=(d.scrollTop-A)*b}if(S){let A=d.scrollLeft;d.scrollLeft+=S/_,T=(d.scrollLeft-A)*_}e={left:e.left-T,top:e.top-k,right:e.right-T,bottom:e.bottom-k},T&&Math.abs(T-S)<1&&(n="nearest"),k&&Math.abs(k-w)<1&&(s="nearest")}if(O)break;(e.top<g.top||e.bottom>g.bottom||e.left<g.left||e.right>g.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function wq(t){let e=t.ownerDocument,i,n;for(let s=t.parentNode;s&&!(s==e.body||i&&n);)if(s.nodeType==1)!n&&s.scrollHeight>s.clientHeight&&(n=s),!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:n}}class Cq{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:i,focusNode:n}=e;this.set(i,Math.min(e.anchorOffset,i?bo(i):0),n,Math.min(e.focusOffset,n?bo(n):0))}set(e,i,n,s){this.anchorNode=e,this.anchorOffset=i,this.focusNode=n,this.focusOffset=s}}let ll=null;Se.safari&&Se.safari_version>=26&&(ll=!1);function PD(t){if(t.setActive)return t.setActive();if(ll)return t.focus(ll);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(ll==null?{get preventScroll(){return ll={preventScroll:!0},!0}}:void 0),!ll){ll=!1;for(let i=0;i<e.length;){let n=e[i++],s=e[i++],r=e[i++];n.scrollTop!=s&&(n.scrollTop=s),n.scrollLeft!=r&&(n.scrollLeft=r)}}}let WA;function Bf(t,e,i=e){let n=WA||(WA=document.createRange());return n.setEnd(t,i),n.setStart(t,e),n}function Yc(t,e,i,n){let s={key:e,code:e,keyCode:i,which:i,cancelable:!0};n&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=n);let r=new KeyboardEvent("keydown",s);r.synthetic=!0,t.dispatchEvent(r);let o=new KeyboardEvent("keyup",s);return o.synthetic=!0,t.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function kq(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function Tq(t,e){let i=e.focusNode,n=e.focusOffset;if(!i||e.anchorNode!=i||e.anchorOffset!=n)return!1;for(n=Math.min(n,bo(i));;)if(n){if(i.nodeType!=1)return!1;let s=i.childNodes[n-1];s.contentEditable=="false"?n--:(i=s,n=bo(i))}else{if(i==t)return!0;n=Ta(i),i=i.parentNode}}function RD(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function QD(t,e){for(let i=t,n=e;;){if(i.nodeType==3&&n>0)return{node:i,offset:n};if(i.nodeType==1&&n>0){if(i.contentEditable=="false")return null;i=i.childNodes[n-1],n=bo(i)}else if(i.parentNode&&!bg(i))n=Ta(i),i=i.parentNode;else return null}}function LD(t,e){for(let i=t,n=e;;){if(i.nodeType==3&&n<i.nodeValue.length)return{node:i,offset:n};if(i.nodeType==1&&n<i.childNodes.length){if(i.contentEditable=="false")return null;i=i.childNodes[n],n=0}else if(i.parentNode&&!bg(i))n=Ta(i)+1,i=i.parentNode;else return null}}class qs{constructor(e,i,n=!0){this.node=e,this.offset=i,this.precise=n}static before(e,i){return new qs(e.parentNode,Ta(e),i)}static after(e,i){return new qs(e.parentNode,Ta(e)+1,i)}}var xt=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(xt||(xt={}));const Al=xt.LTR,DS=xt.RTL;function DD(t){let e=[];for(let i=0;i<t.length;i++)e.push(1<<+t[i]);return e}const Aq=DD("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Eq=DD("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),cb=Object.create(null),sr=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),i=t.charCodeAt(1);cb[e]=i,cb[i]=-e}function BD(t){return t<=247?Aq[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?Eq[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const Mq=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class _r{get dir(){return this.level%2?DS:Al}constructor(e,i,n){this.from=e,this.to=i,this.level=n}side(e,i){return this.dir==i==e?this.to:this.from}forward(e,i){return e==(this.dir==i)}static find(e,i,n,s){let r=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=i&&l.to>=i){if(l.level==n)return o;(r<0||(s!=0?s<0?l.from<i:l.to>i:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function $D(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++){let n=t[i],s=e[i];if(n.from!=s.from||n.to!=s.to||n.direction!=s.direction||!$D(n.inner,s.inner))return!1}return!0}const bt=[];function Pq(t,e,i,n,s){for(let r=0;r<=n.length;r++){let o=r?n[r-1].to:e,l=r<n.length?n[r].from:i,c=r?256:s;for(let u=o,d=c,p=c;u<l;u++){let g=BD(t.charCodeAt(u));g==512?g=d:g==8&&p==4&&(g=16),bt[u]=g==4?2:g,g&7&&(p=g),d=g}for(let u=o,d=c,p=c;u<l;u++){let g=bt[u];if(g==128)u<l-1&&d==bt[u+1]&&d&24?g=bt[u]=d:bt[u]=256;else if(g==64){let O=u+1;for(;O<l&&bt[O]==64;)O++;let _=u&&d==8||O<i&&bt[O]==8?p==1?1:8:256;for(let b=u;b<O;b++)bt[b]=_;u=O-1}else g==8&&p==1&&(bt[u]=1);d=g,g&7&&(p=g)}}}function Rq(t,e,i,n,s){let r=s==1?2:1;for(let o=0,l=0,c=0;o<=n.length;o++){let u=o?n[o-1].to:e,d=o<n.length?n[o].from:i;for(let p=u,g,O,_;p<d;p++)if(O=cb[g=t.charCodeAt(p)])if(O<0){for(let b=l-3;b>=0;b-=3)if(sr[b+1]==-O){let S=sr[b+2],w=S&2?s:S&4?S&1?r:s:0;w&&(bt[p]=bt[sr[b]]=w),l=b;break}}else{if(sr.length==189)break;sr[l++]=p,sr[l++]=g,sr[l++]=c}else if((_=bt[p])==2||_==1){let b=_==s;c=b?0:1;for(let S=l-3;S>=0;S-=3){let w=sr[S+2];if(w&2)break;if(b)sr[S+2]|=2;else{if(w&4)break;sr[S+2]|=4}}}}}function Qq(t,e,i,n){for(let s=0,r=n;s<=i.length;s++){let o=s?i[s-1].to:t,l=s<i.length?i[s].from:e;for(let c=o;c<l;){let u=bt[c];if(u==256){let d=c+1;for(;;)if(d==l){if(s==i.length)break;d=i[s++].to,l=s<i.length?i[s].from:e}else if(bt[d]==256)d++;else break;let p=r==1,g=(d<e?bt[d]:n)==1,O=p==g?p?1:2:n;for(let _=d,b=s,S=b?i[b-1].to:t;_>c;)_==S&&(_=i[--b].from,S=b?i[b-1].to:t),bt[--_]=O;c=d}else r=u,c++}}}function hb(t,e,i,n,s,r,o){let l=n%2?2:1;if(n%2==s%2)for(let c=e,u=0;c<i;){let d=!0,p=!1;if(u==r.length||c<r[u].from){let b=bt[c];b!=l&&(d=!1,p=b==16)}let g=!d&&l==1?[]:null,O=d?n:n+1,_=c;e:for(;;)if(u<r.length&&_==r[u].from){if(p)break e;let b=r[u];if(!d)for(let S=b.to,w=u+1;;){if(S==i)break e;if(w<r.length&&r[w].from==S)S=r[w++].to;else{if(bt[S]==l)break e;break}}if(u++,g)g.push(b);else{b.from>c&&o.push(new _r(c,b.from,O));let S=b.direction==Al!=!(O%2);ub(t,S?n+1:n,s,b.inner,b.from,b.to,o),c=b.to}_=b.to}else{if(_==i||(d?bt[_]!=l:bt[_]==l))break;_++}g?hb(t,c,_,n+1,s,g,o):c<_&&o.push(new _r(c,_,O)),c=_}else for(let c=i,u=r.length;c>e;){let d=!0,p=!1;if(!u||c>r[u-1].to){let b=bt[c-1];b!=l&&(d=!1,p=b==16)}let g=!d&&l==1?[]:null,O=d?n:n+1,_=c;e:for(;;)if(u&&_==r[u-1].to){if(p)break e;let b=r[--u];if(!d)for(let S=b.from,w=u;;){if(S==e)break e;if(w&&r[w-1].to==S)S=r[--w].from;else{if(bt[S-1]==l)break e;break}}if(g)g.push(b);else{b.to<c&&o.push(new _r(b.to,c,O));let S=b.direction==Al!=!(O%2);ub(t,S?n+1:n,s,b.inner,b.from,b.to,o),c=b.from}_=b.from}else{if(_==e||(d?bt[_-1]!=l:bt[_-1]==l))break;_--}g?hb(t,_,c,n+1,s,g,o):_<c&&o.push(new _r(_,c,O)),c=_}}function ub(t,e,i,n,s,r,o){let l=e%2?2:1;Pq(t,s,r,n,l),Rq(t,s,r,n,l),Qq(s,r,n,l),hb(t,s,r,e,i,n,o)}function Lq(t,e,i){if(!t)return[new _r(0,0,e==DS?1:0)];if(e==Al&&!i.length&&!Mq.test(t))return ND(t.length);if(i.length)for(;t.length>bt.length;)bt[bt.length]=256;let n=[],s=e==Al?0:1;return ub(t,s,s,i,0,t.length,n),n}function ND(t){return[new _r(0,t,0)]}let zD="";function Dq(t,e,i,n,s){var r;let o=n.head-t.from,l=_r.find(e,o,(r=n.bidiLevel)!==null&&r!==void 0?r:-1,n.assoc),c=e[l],u=c.side(s,i);if(o==u){let g=l+=s?1:-1;if(g<0||g>=e.length)return null;c=e[l=g],o=c.side(!s,i),u=c.side(s,i)}let d=Di(t.text,o,c.forward(s,i));(d<c.from||d>c.to)&&(d=u),zD=t.text.slice(Math.min(o,d),Math.max(o,d));let p=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return p&&d==u&&p.level+(s?0:1)<c.level?re.cursor(p.side(!s,i)+t.from,p.forward(s,i)?1:-1,p.level):re.cursor(d+t.from,c.forward(s,i)?-1:1,c.level)}function Bq(t,e,i){for(let n=e;n<i;n++){let s=BD(t.charCodeAt(n));if(s==1)return Al;if(s==2||s==4)return DS}return Al}const jD=xe.define(),ID=xe.define(),VD=xe.define(),XD=xe.define(),fb=xe.define(),ZD=xe.define(),qD=xe.define(),BS=xe.define(),$S=xe.define(),WD=xe.define({combine:t=>t.some(e=>e)}),UD=xe.define({combine:t=>t.some(e=>e)}),YD=xe.define();class Hc{constructor(e,i="nearest",n="nearest",s=5,r=5,o=!1){this.range=e,this.y=i,this.x=n,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new Hc(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 Hc(re.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Kp=ze.define({map:(t,e)=>t.map(e)}),HD=ze.define();function $n(t,e,i){let n=t.facet(XD);n.length?n[0](e):window.onerror&&window.onerror(String(e),i,void 0,void 0,e)||(i?console.error(i+":",e):console.error(e))}const fo=xe.define({combine:t=>t.length?t[0]:!0});let $q=0;const zc=xe.define({combine(t){return t.filter((e,i)=>{for(let n=0;n<i;n++)if(t[n].plugin==e.plugin)return!1;return!0})}});class Jt{constructor(e,i,n,s,r){this.id=e,this.create=i,this.domEventHandlers=n,this.domEventObservers=s,this.baseExtensions=r(this),this.extension=this.baseExtensions.concat(zc.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(zc.of({plugin:this,arg:e}))}static define(e,i){const{eventHandlers:n,eventObservers:s,provide:r,decorations:o}=i||{};return new Jt($q++,e,n,s,l=>{let c=[];return o&&c.push(fO.of(u=>{let d=u.plugin(l);return d?o(d):Pe.none})),r&&c.push(r(l)),c})}static fromClass(e,i){return Jt.define((n,s)=>new e(n,s),i)}}class x_{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 i=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(i)}catch(n){if($n(i.state,n,"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(i){$n(e.state,i,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var i;if(!((i=this.value)===null||i===void 0)&&i.destroy)try{this.value.destroy()}catch(n){$n(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const FD=xe.define(),NS=xe.define(),fO=xe.define(),GD=xe.define(),zS=xe.define(),fd=xe.define(),KD=xe.define();function UA(t,e){let i=t.state.facet(KD);if(!i.length)return i;let n=i.map(r=>r instanceof Function?r(t):r),s=[];return Ge.spans(n,e.from,e.to,{point(){},span(r,o,l,c){let u=r-e.from,d=o-e.from,p=s;for(let g=l.length-1;g>=0;g--,c--){let O=l[g].spec.bidiIsolate,_;if(O==null&&(O=Bq(e.text,u,d)),c>0&&p.length&&(_=p[p.length-1]).to==u&&_.direction==O)_.to=d,p=_.inner;else{let b={from:u,to:d,direction:O,inner:[]};p.push(b),p=b.inner}}}}),s}const JD=xe.define();function jS(t){let e=0,i=0,n=0,s=0;for(let r of t.state.facet(JD)){let o=r(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(i=Math.max(i,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:i,top:n,bottom:s}}const Fu=xe.define();class ks{constructor(e,i,n,s){this.fromA=e,this.toA=i,this.fromB=n,this.toB=s}join(e){return new ks(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 i=e.length,n=this;for(;i>0;i--){let s=e[i-1];if(!(s.fromA>n.toA)){if(s.toA<n.fromA)break;n=n.join(s),e.splice(i-1,1)}}return e.splice(i,0,n),e}static extendWithRanges(e,i){if(i.length==0)return e;let n=[];for(let s=0,r=0,o=0;;){let l=s<e.length?e[s].fromB:1e9,c=r<i.length?i[r]:1e9,u=Math.min(l,c);if(u==1e9)break;let d=u+o,p=u,g=d;for(;;)if(r<i.length&&i[r]<=p){let O=i[r+1];r+=2,p=Math.max(p,O);for(let _=s;_<e.length&&e[_].fromB<=p;_++)o=e[_].toA-e[_].toB;g=Math.max(g,O+o)}else if(s<e.length&&e[s].fromB<=p){let O=e[s++];p=Math.max(p,O.toB),g=Math.max(g,O.toA),o=O.toA-O.toB}else break;n.push(new ks(d,g,u,p))}return n}}class xg{constructor(e,i,n){this.view=e,this.state=i,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=vi.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,c)=>s.push(new ks(r,o,l,c))),this.changedRanges=s}static create(e,i,n){return new xg(e,i,n)}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 Nq=[];class ui{constructor(e,i,n=0){this.dom=e,this.length=i,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Nq}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 i=this.domAttrs;i&&_q(this.dom,i)}}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,i=this.posAtStart){let n=i;for(let s of this.children){if(s==e)return n;n+=s.length+s.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,i){return null}domPosFor(e,i){let n=Ta(this.dom),s=this.length?e>0:i>0;return new qs(this.parent.dom,n+(s?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 pO)return e;return null}static get(e){return e.cmTile}}class dO extends ui{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 i=this.dom,n=null,s,r=(e==null?void 0:e.node)==i?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,s=n?n.nextSibling:i.firstChild,r&&s!=l.dom&&(r.written=!0),l.dom.parentNode==i)for(;s&&s!=l.dom;)s=YA(s);else i.insertBefore(l.dom,s);n=l.dom}for(s=n?n.nextSibling:i.firstChild,r&&s&&(r.written=!0);s;)s=YA(s);this.length=o}}function YA(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class pO extends dO{constructor(e,i){super(i),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 i=ui.get(e);if(i&&this.owns(i))return i;e=e.parentNode}}blockTiles(e){for(let i=[],n=this,s=0,r=0;;)if(s==n.children.length){if(!i.length)return;n=n.parent,n.breakAfter&&r++,s=i.pop()}else{let o=n.children[s++];if(o instanceof go)i.push(s),n=o,s=0;else{let l=r+o.length,c=e(o,r);if(c!==void 0)return c;r=l+o.breakAfter}}}resolveBlock(e,i){let n,s=-1,r,o=-1;if(this.blockTiles((l,c)=>{let u=c+l.length;if(e>=c&&e<=u){if(l.isWidget()&&i>=-1&&i<=1){if(l.flags&32)return!0;l.flags&16&&(n=void 0)}(c<e||e==u&&(i<-1?l.length:l.covers(1)))&&(!n||!l.isWidget()&&n.isWidget())&&(n=l,s=e-c),(u>e||e==c&&(i>1?l.length:l.covers(-1)))&&(!r||!l.isWidget()&&r.isWidget())&&(r=l,o=e-c)}}),!n&&!r)throw new Error("No tile at position "+e);return n&&i<0||!r?{tile:n,offset:s}:{tile:r,offset:o}}}class go extends dO{constructor(e,i){super(e),this.wrapper=i}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,i){let n=new go(i||document.createElement(e.tagName),e);return i||(n.flags|=4),n}}class rh extends dO{constructor(e,i){super(e),this.attrs=i}isLine(){return!0}static start(e,i,n){let s=new rh(i||document.createElement("div"),e);return(!i||!n)&&(s.flags|=4),s}get domAttrs(){return this.attrs}resolveInline(e,i,n){let s=null,r=-1,o=null,l=-1;function c(d,p){for(let g=0,O=0;g<d.children.length&&O<=p;g++){let _=d.children[g],b=O+_.length;b>=p&&(_.isComposite()?c(_,p-O):(!o||o.isHidden&&(i>0||n&&jq(o,_)))&&(b>p||_.flags&32)?(o=_,l=p-O):(O<p||_.flags&16&&!_.isHidden)&&(s=_,r=p-O)),O=b}}c(this,e);let u=(i<0?s:o)||s||o;return u?{tile:u,offset:u==s?r:l}:null}coordsIn(e,i){let n=this.resolveInline(e,i,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),i):zq(this)}domIn(e,i){let n=this.resolveInline(e,i);if(n){let{tile:s,offset:r}=n;if(this.dom.contains(s.dom))return s.isText()?new qs(s.dom,Math.min(s.dom.nodeValue.length,r)):s.domPosFor(r,s.flags&16?1:s.flags&32?-1:i);let o=n.tile.parent,l=!1;for(let c of o.children){if(l)return new qs(c.dom,0);c==n.tile&&(l=!0)}}return new qs(this.dom,0)}}function zq(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let i=mf(e);return i[i.length-1]||null}function jq(t,e){let i=t.coordsIn(0,1),n=e.coordsIn(0,1);return i&&n&&n.top<i.bottom}class Bn extends dO{constructor(e,i){super(e),this.mark=i}get domAttrs(){return this.mark.attrs}static of(e,i){let n=new Bn(i||document.createElement(e.tagName),e);return i||(n.flags|=4),n}}class Ol extends ui{constructor(e,i){super(e,i.length),this.text=i}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,i){let n=this.dom.nodeValue.length;e>n&&(e=n);let s=e,r=e,o=0;e==0&&i<0||e==n&&i>=0?Se.chrome||Se.gecko||(e?(s--,o=1):r<n&&(r++,o=-1)):i<0?s--:r<n&&r++;let l=Bf(this.dom,s,r).getClientRects();if(!l.length)return null;let c=l[(o?o<0:i>=0)?0:l.length-1];return Se.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(l,u=>u.width)||c),o?Df(c,o<0):c||null}static of(e,i){let n=new Ol(i||document.createTextNode(e),e);return i||(n.flags|=2),n}}class El extends ui{constructor(e,i,n,s){super(e,i,s),this.widget=n}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,i){return this.coordsInWidget(e,i,!1)}coordsInWidget(e,i,n){let s=this.widget.coordsAt(this.dom,e,i);if(s)return s;if(n)return Df(this.dom.getBoundingClientRect(),this.length?e==0:i<=0);{let r=this.dom.getClientRects(),o=null;if(!r.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let c=l?r.length-1:0;o=r[c],!(e>0?c==0:c==r.length-1||o.top<o.bottom);c+=l?-1:1);return Df(o,!l)}}get overrideDOMText(){if(!this.length)return at.empty;let{root:e}=this;if(!e)return at.empty;let i=this.posAtStart;return e.view.state.doc.slice(i,i+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,i,n,s,r){return r||(r=e.toDOM(i),e.editable||(r.contentEditable="false")),new El(r,n,e,s)}}class Sg extends ui{constructor(e){let i=document.createElement("img");i.className="cm-widgetBuffer",i.setAttribute("aria-hidden","true"),super(i,0,e)}get isHidden(){return!0}get overrideDOMText(){return at.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class Iq{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,i,n){let{tile:s,index:r,beforeBreak:o,parents:l}=this;for(;e||i>0;)if(s.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(r==s.children.length){if(!e&&!l.length)break;n&&n.leave(s),o=!!s.breakAfter,{tile:s,index:r}=l.pop(),r++}else{let c=s.children[r],u=c.breakAfter;(i>0?c.length<=e:c.length<e)&&(!n||n.skip(c,0,c.length)!==!1||!c.isComposite)?(o=!!u,r++,e-=c.length):(l.push({tile:s,index:r}),s=c,r=0,n&&c.isComposite()&&n.enter(c))}else if(r==s.length)o=!!s.breakAfter,{tile:s,index:r}=l.pop(),r++;else if(e){let c=Math.min(e,s.length-r);n&&n.skip(s,r,r+c),e-=c,r+=c}else break;return this.tile=s,this.index=r,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class Vq{constructor(e,i,n,s){this.from=e,this.to=i,this.wrapper=n,this.rank=s}}class Xq{constructor(e,i,n){this.cache=e,this.root=i,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,i,n,s){var r;this.flushBuffer();let o=this.ensureMarks(i,n),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let c=o.children[o.children.length-1]=new Ol(l.dom,l.text+e);c.parent=o}else o.append(s||Ol.of(e,(r=this.cache.find(Ol))===null||r===void 0?void 0:r.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,i){let n=this.curLine;n.dom!=i.line.dom&&(n.setDOM(this.cache.reused.has(i.line)?S_(i.line.dom):i.line.dom),this.cache.reused.set(i.line,2));let s=n;for(let l=i.marks.length-1;l>=0;l--){let c=i.marks[l],u=s.lastChild;if(u instanceof Bn&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(S_(c.dom)),s=u;else{if(this.cache.reused.get(c)){let p=ui.get(c.dom);p&&p.setDOM(S_(c.dom))}let d=Bn.of(c.mark,c.dom);s.append(d),s=d}this.cache.reused.set(c,2)}let r=ui.get(e.text);r&&this.cache.reused.set(r,2);let o=new Ol(e.text,e.text.nodeValue);o.flags|=8,s.append(o)}addInlineWidget(e,i,n){let s=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);s||this.flushBuffer();let r=this.ensureMarks(i,n);!s&&!(e.flags&16)&&r.append(this.getBuffer(1)),r.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,i,n){this.flushBuffer(),this.ensureMarks(i,n).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 i=this.afterWidget||this.lastBlock;i.length+=e,this.pos+=e}addLineStart(e,i){var n;e||(e=eB);let s=rh.start(e,i||((n=this.cache.find(rh))===null||n===void 0?void 0:n.dom),!!i);this.getBlockPos().append(this.lastBlock=this.curLine=s)}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,i){var n;let s=this.curLine;for(let r=e.length-1;r>=0;r--){let o=e[r],l;if(i>0&&(l=s.lastChild)&&l instanceof Bn&&l.mark.eq(o))s=l,i--;else{let c=Bn.of(o,(n=this.cache.find(Bn,u=>u.mark.eq(o)))===null||n===void 0?void 0:n.dom);s.append(c),s=c,i=0}}return s}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!HA(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Se.ios&&HA(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(w_,0,32)||new El(w_.toDOM(),0,w_,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 i=new Vq(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-i.rank||this.wrappers[n-1].to-i.to)<0;)n--;this.wrappers.splice(n,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let i=this.root;for(let n of this.wrappers){let s=i.lastChild;if(n.from<this.pos&&s instanceof go&&s.wrapper.eq(n.wrapper))i=s;else{let r=go.of(n.wrapper,(e=this.cache.find(go,o=>o.wrapper.eq(n.wrapper)))===null||e===void 0?void 0:e.dom);i.append(r),i=r}}return i}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let i=2|(e<0?16:32),n=this.cache.find(Sg,void 0,1);return n&&(n.flags=i),n||new Sg(i)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Zq{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:s,lineBreak:r,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=s;let l=this.textOff=Math.min(e,s.length);return r?null:s.slice(0,l)}let i=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,i);return this.textOff=i,n}}const wg=[El,rh,Ol,Bn,Sg,go,pO];for(let t=0;t<wg.length;t++)wg[t].bucket=t;class qq{constructor(e){this.view=e,this.buckets=wg.map(()=>[]),this.index=wg.map(()=>0),this.reused=new Map}add(e){let i=e.constructor.bucket,n=this.buckets[i];n.length<6?n.push(e):n[this.index[i]=(this.index[i]+1)%6]=e}find(e,i,n=2){let s=e.bucket,r=this.buckets[s],o=this.index[s];for(let l=r.length-1;l>=0;l--){let c=(l+o)%r.length,u=r[c];if((!i||i(u))&&!this.reused.has(u))return r.splice(c,1),c<o&&this.index[s]--,this.reused.set(u,n),u}return null}findWidget(e,i,n){let s=this.buckets[0];if(s.length)for(let r=0,o=0;;r++){if(r==s.length){if(o)return null;o=1,r=0}let l=s[r];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view)))return s.splice(r,1),r<this.index[0]&&this.index[0]--,l.widget==e&&l.length==i&&(l.flags&497)==n?(this.reused.set(l,1),l):(this.reused.set(l,2),new El(l.dom,i,e,l.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,i=2){if(!this.reused.has(e))return this.reused.set(e,i),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class Wq{constructor(e,i,n,s,r){this.view=e,this.decorations=s,this.disallowBlockEffectsFor=r,this.openWidget=!1,this.openMarks=0,this.cache=new qq(e),this.text=new Zq(e.state.doc),this.builder=new Xq(this.cache,new pO(e,e.contentDOM),Ge.iter(n)),this.cache.reused.set(i,2),this.old=new Iq(i),this.reuseWalker={skip:(o,l,c)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,i){let n=i&&this.getCompositionContext(i.text);for(let s=0,r=0,o=0;;){let l=o<e.length?e[o++]:null,c=l?l.fromA:this.old.root.length;if(c>s){let u=c-s;this.preserve(u,!o,!l),s=c,r+=u}if(!l)break;i&&l.fromA<=i.range.fromA&&l.toA>=i.range.toA?(this.forward(l.fromA,i.range.fromA,i.range.fromA<i.range.toA?1:-1),this.emit(r,i.range.fromB),this.cache.clear(),this.builder.addComposition(i,n),this.text.skip(i.range.toB-i.range.fromB),this.forward(i.range.fromA,l.toA),this.emit(i.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(r,l.toB)),r=l.toB,s=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,i,n){let s=Hq(this.old),r=this.openMarks;this.old.advance(e,n?1:-1,{skip:(o,l,c)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l<o.length?El.of(o.widget,this.view,c-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);u.flags&256?(u.flags&=-2,this.builder.addBlockWidget(u)):(this.builder.ensureLine(null),this.builder.addInlineWidget(u,s,r),r=s.length)}else if(o.isText())this.builder.ensureLine(null),!l&&c==o.length?this.builder.addText(o.text,s,r,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,c),s,r)),r=s.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof Sg)this.cache.add(o);else if(o instanceof Bn)this.builder.ensureLine(null),this.builder.addMark(o,s,r),this.cache.reused.set(o,1),r=s.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Bn&&s.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?s.length&&(s.length=r=0):o instanceof Bn&&(s.shift(),r=Math.min(r,s.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,i){let n=null,s=this.builder,r=0,o=Ge.spans(this.decorations,e,i,{point:(l,c,u,d,p,g)=>{if(u instanceof Tl){if(this.disallowBlockEffectsFor[g]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(r=d.length,p>d.length)s.continueWidget(c-l);else{let O=u.widget||(u.block?oh.block:oh.inline),_=Uq(u),b=this.cache.findWidget(O,c-l,_)||El.of(O,this.view,c-l,_);u.block?(u.startSide>0&&s.addLineStartIfNotCovered(n),s.addBlockWidget(b)):(s.ensureLine(n),s.addInlineWidget(b,d,p))}n=null}else n=Yq(n,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let p=l;p<c;){let g=this.text.next(Math.min(512,c-p));g==null?(s.addLineStartIfNotCovered(n),s.addBreak(),p++):(s.ensureLine(n),s.addText(g,u,p==l?d:u.length),p+=g.length),n=null}}});s.addLineStartIfNotCovered(n),this.openWidget=o>r,this.openMarks=o}forward(e,i,n=1){i-e<=10?this.old.advance(i-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(i-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let i=[],n=null;for(let s=e.parentNode;;s=s.parentNode){let r=ui.get(s);if(s==this.view.contentDOM)break;r instanceof Bn?i.push(r):r!=null&&r.isLine()?n=r:r instanceof go||(s.nodeName=="DIV"&&!n&&s!=this.view.contentDOM?n=new rh(s,eB):n||i.push(Bn.of(new hd({tagName:s.nodeName.toLowerCase(),attributes:yq(s)}),s)))}return{line:n,marks:i}}}function HA(t,e){let i=n=>{for(let s of n.children)if((e?s.isText():s.length)||i(s))return!0;return!1};return i(t)}function Uq(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const eB={class:"cm-line"};function Yq(t,e){let i=e.spec.attributes,n=e.spec.class;return!i&&!n||(t||(t={class:"cm-line"}),i&&QS(i,t),n&&(t.class+=" "+n)),t}function Hq(t){let e=[];for(let i=t.parents.length;i>1;i--){let n=i==t.parents.length?t.tile:t.parents[i].tile;n instanceof Bn&&e.push(n.mark)}return e}function S_(t){let e=ui.get(t);return e&&e.setDOM(t.cloneNode()),t}class oh extends Gs{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}}oh.inline=new oh("span");oh.block=new oh("div");const w_=new class extends Gs{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class FA{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Pe.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 pO(e,e.contentDOM),this.updateInner([new ks(0,0,0,e.state.doc.length)],null)}update(e){var i;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:d,toA:p})=>p<this.minWidthFrom||d>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 s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((i=this.domChanged)===null||i===void 0)&&i.newSel?s=this.domChanged.newSel.head:!sW(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?Gq(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:p}=this.hasComposition;n=new ks(d,p,e.changes.mapPos(d,-1),e.changes.mapPos(p,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(Se.ie||Se.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let c=eW(o,this.decorations,e.changes);c.length&&(n=ks.extendWithRanges(n,c));let u=iW(l,this.blockWrappers,e.changes);return u.length&&(n=ks.extendWithRanges(n,u)),r&&!n.some(d=>d.fromA<=r.range.fromA&&d.toA>=r.range.toA)&&(n=r.range.addToSet(n.slice())),this.tile.flags&2&&n.length==0?!1:(this.updateInner(n,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,i){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(i||e.length){let o=this.tile,l=new Wq(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=l.run(e,i),db(o,l.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 r=Se.chrome||Se.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let r of this.tile.children)r.isWidget()&&r.widget instanceof C_&&s.push(r.dom);n.updateGaps(s)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let i of e.transactions)for(let n of i.effects)n.is(HD)&&(this.editContextFormatting=n.value)}updateSelection(e=!1,i=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,s=this.view.root.activeElement,r=s==n,o=!r&&!(this.view.state.facet(fo)||n.tabIndex>-1)&&pf(n,this.view.observer.selectionRange)&&!(s&&n.contains(s));if(!(r||i||o))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u,d;if(c.empty?d=u=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),u=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),Se.gecko&&c.empty&&!this.hasComposition&&Fq(u)){let g=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(g,u.node.childNodes[u.offset]||null)),u=d=new qs(g,0),l=!0}let p=this.view.observer.selectionRange;(l||!p.focusNode||(!gf(u.node,u.offset,p.anchorNode,p.anchorOffset)||!gf(d.node,d.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,c))&&(this.view.observer.ignore(()=>{Se.android&&Se.chrome&&n.contains(p.focusNode)&&nW(p.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let g=Lf(this.view.root);if(g)if(c.empty){if(Se.gecko){let O=Kq(u.node,u.offset);if(O&&O!=3){let _=(O==1?QD:LD)(u.node,u.offset);_&&(u=new qs(_.node,_.offset))}}g.collapse(u.node,u.offset),c.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=c.bidiLevel)}else if(g.extend){g.collapse(u.node,u.offset);try{g.extend(d.node,d.offset)}catch{}}else{let O=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),O.setEnd(d.node,d.offset),O.setStart(u.node,u.offset),g.removeAllRanges(),g.addRange(O)}o&&this.view.root.activeElement==n&&(n.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new qs(p.anchorNode,p.anchorOffset),this.impreciseHead=d.precise?null:new qs(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,i){return this.hasComposition&&i.empty&&gf(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==i.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,i=e.state.selection.main,n=Lf(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!n||!i.empty||!i.assoc||!n.modify)return;let o=this.lineAt(i.head,i.assoc);if(!o)return;let l=o.posAtStart;if(i.head==l||i.head==l+o.length)return;let c=this.coordsAt(i.head,-1),u=this.coordsAt(i.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(i.head+i.assoc,i.assoc);n.collapse(d.node,d.offset),n.modify("move",i.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=i.from&&n.collapse(s,r)}posFromDOM(e,i){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let s=n.posAtStart;if(n.isComposite()){let r;if(e==n.dom)r=n.dom.childNodes[i];else{let o=bo(e)==0?0:i==0?-1:1;for(;;){let l=e.parentNode;if(l==n.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?r=e:r=e.nextSibling}if(r==n.dom.firstChild)return s;for(;r&&!ui.get(r);)r=r.nextSibling;if(!r)return s+n.length;for(let o=0,l=s;;o++){let c=n.children[o];if(c.dom==r)return l;l+=c.length+c.breakAfter}}else return n.isText()?e==n.dom?s+i:s+(i?n.length:0):s}domAtPos(e,i){let{tile:n,offset:s}=this.tile.resolveBlock(e,i);return n.isWidget()?n.domPosFor(e,i):n.domIn(s,i)}inlineDOMNearPos(e,i){let n,s=-1,r=!1,o,l=-1,c=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=e)return!0;u.flags&16&&(r=!0)}else{let p=d+u.length;if(d<=e&&(n=u,s=e-d,r=p<e),p>=e&&!o&&(o=u,l=e-d,c=d>e),d>e&&o)return!0}}),!n&&!o?this.domAtPos(e,i):(r&&o?n=null:c&&n&&(o=null),n&&i<0||!o?n.domIn(s,i):o.domIn(l,i))}coordsAt(e,i){let{tile:n,offset:s}=this.tile.resolveBlock(e,i);return n.isWidget()?n.widget instanceof C_?null:n.coordsInWidget(s,i,!0):n.coordsIn(s,i)}lineAt(e,i){let{tile:n}=this.tile.resolveBlock(e,i);return n.isLine()?n:null}coordsForChar(e){let{tile:i,offset:n}=this.tile.resolveBlock(e,1);if(!i.isLine())return null;function s(r,o){if(r.isComposite())for(let l of r.children){if(l.length>=o){let c=s(l,o);if(c)return c}if(o-=l.length,o<0)break}else if(r.isText()&&o<r.length){let l=Di(r.text,o);if(l==o)return null;let c=Bf(r.dom,o,l).getClientRects();for(let u=0;u<c.length;u++){let d=c[u];if(u==c.length-1||d.top<d.bottom&&d.left<d.right)return d}}return null}return s(i,n)}measureVisibleLineHeights(e){let i=[],{from:n,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==xt.LTR,u=0,d=(p,g,O)=>{for(let _=0;_<p.children.length&&!(g>s);_++){let b=p.children[_],S=g+b.length,w=b.dom.getBoundingClientRect(),{height:T}=w;if(O&&!_&&(u+=w.top-O.top),b instanceof go)S>n&&d(b,g,w);else if(g>=n&&(u>0&&i.push(-u),i.push(T+u),u=0,o)){let k=b.dom.lastChild,A=k?mf(k):[];if(A.length){let R=A[A.length-1],E=c?R.right-w.left:w.right-R.left;E>l&&(l=E,this.minWidth=r,this.minWidthFrom=g,this.minWidthTo=S)}}O&&_==p.children.length-1&&(u+=O.bottom-w.bottom),g=S+b.breakAfter}};return d(this.tile,0,null),i}textDirectionAt(e){let{tile:i}=this.tile.resolveBlock(e,1);return getComputedStyle(i.dom).direction=="rtl"?xt.RTL:xt.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,c;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=mf(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:c}}});if(e)return e;let i=document.createElement("div"),n,s,r;return i.className="cm-line",i.style.width="99999px",i.style.position="absolute",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(i);let o=mf(i.firstChild)[0];n=i.getBoundingClientRect().height,s=o&&o.width?o.width/27:7,r=o&&o.height?o.height:n,i.remove()}),{lineHeight:n,charWidth:s,textHeight:r}}computeBlockGapDeco(){let e=[],i=this.view.viewState;for(let n=0,s=0;;s++){let r=s==i.viewports.length?null:i.viewports[s],o=r?r.from-1:this.view.state.doc.length;if(o>n){let l=(i.lineBlockAt(o).bottom-i.lineBlockAt(n).top)/this.view.scaleY;e.push(Pe.replace({widget:new C_(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!r)break;n=r.to+1}return Pe.set(e)}updateDeco(){let e=1,i=this.view.state.facet(fO).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),n=!1,s=this.view.state.facet(zS).map((r,o)=>{let l=typeof r=="function";return l&&(n=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[e++]=n,i.push(Ge.join(s))),this.decorations=[this.editContextFormatting,...i,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(GD).map(r=>typeof r=="function"?r(this.view):r)}scrollIntoView(e){if(e.isSnapshot){let u=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=u.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let u of this.view.state.facet(YD))try{if(u(this.view,e.range,e))return!0}catch(d){$n(this.view.state,d,"scroll handler")}let{range:i}=e,n=this.coordsAt(i.head,i.empty?i.assoc:i.head>i.anchor?-1:1),s;if(!n)return;!i.empty&&(s=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,s.left),top:Math.min(n.top,s.top),right:Math.max(n.right,s.right),bottom:Math.max(n.bottom,s.bottom)});let r=jS(this.view),o={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(Sq(this.view.scrollDOM,o,i.head<i.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,c),-c),this.view.textDirection==xt.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let u=this.view.docView.lineAt(i.head,1);u&&u.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let i=n=>n.isWidget()||n.children.some(i);return i(this.tile.resolveBlock(e,1).tile)}destroy(){db(this.tile)}}function db(t,e){let i=e==null?void 0:e.get(t);if(i!=1){i==null&&t.destroy();for(let n of t.children)db(n,e)}}function Fq(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function tB(t,e){let i=t.observer.selectionRange;if(!i.focusNode)return null;let n=QD(i.focusNode,i.focusOffset),s=LD(i.focusNode,i.focusOffset),r=n||s;if(s&&n&&s.node!=n.node){let l=ui.get(s.node);if(!l||l.isText()&&l.text!=s.node.nodeValue)r=s;else if(t.docView.lastCompositionAfterCursor){let c=ui.get(n.node);!c||c.isText()&&c.text!=n.node.nodeValue||(r=s)}}if(t.docView.lastCompositionAfterCursor=r!=n,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function Gq(t,e,i){let n=tB(t,i);if(!n)return null;let{node:s,from:r,to:o}=n,l=s.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(n.from,n.to)!=l)return null;let c=e.invertedDesc;return{range:new ks(c.mapPos(r),c.mapPos(o),r,o),text:s}}function Kq(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let Jq=class{constructor(){this.changes=[]}compareRange(e,i){Uc(e,i,this.changes)}comparePoint(e,i){Uc(e,i,this.changes)}boundChange(e){Uc(e,e,this.changes)}};function eW(t,e,i){let n=new Jq;return Ge.compare(t,e,i,n),n.changes}class tW{constructor(){this.changes=[]}compareRange(e,i){Uc(e,i,this.changes)}comparePoint(){}boundChange(e){Uc(e,e,this.changes)}}function iW(t,e,i){let n=new tW;return Ge.compare(t,e,i,n),n.changes}function nW(t,e){for(let i=t;i&&i!=e;i=i.assignedSlot||i.parentNode)if(i.nodeType==1&&i.contentEditable=="false")return!0;return!1}function sW(t,e){let i=!1;return e&&t.iterChangedRanges((n,s)=>{n<e.to&&s>e.from&&(i=!0)}),i}class C_ extends Gs{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 rW(t,e,i=1){let n=t.charCategorizer(e),s=t.doc.lineAt(e),r=e-s.from;if(s.length==0)return re.cursor(e);r==0?i=1:r==s.length&&(i=-1);let o=r,l=r;i<0?o=Di(s.text,r,!1):l=Di(s.text,r);let c=n(s.text.slice(o,l));for(;o>0;){let u=Di(s.text,o,!1);if(n(s.text.slice(u,o))!=c)break;o=u}for(;l<s.length;){let u=Di(s.text,l);if(n(s.text.slice(l,u))!=c)break;l=u}return re.range(o+s.from,l+s.from)}function oW(t,e,i,n,s){let r=Math.round((n-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&i.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,c=Math.floor((s-i.top-(t.defaultLineHeight-l)*.5)/l);r+=c*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(i.from,i.to);return i.from+tb(o,r,t.state.tabSize)}function pb(t,e,i){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){let s;for(let r of n.type){if(r.from>e)break;if(!(r.to<e)){if(r.from<e&&r.to>e)return r;(!s||r.type==Ki.Text&&(s.type!=r.type||(i<0?r.from<e:r.to>e)))&&(s=r)}}return s||n}return n}function aW(t,e,i,n){let s=pb(t,e.head,e.assoc||-1),r=!n||s.type!=Ki.Text||!(t.lineWrapping||s.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(s.from),c=t.posAtCoords({x:i==(l==xt.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(c!=null)return re.cursor(c,i?-1:1)}return re.cursor(i?s.to:s.from,i?-1:1)}function GA(t,e,i,n){let s=t.state.doc.lineAt(e.head),r=t.bidiSpans(s),o=t.textDirectionAt(s.from);for(let l=e,c=null;;){let u=Dq(s,r,o,l,i),d=zD;if(!u){if(s.number==(i?t.state.doc.lines:1))return l;d=`
65
- `,s=t.state.doc.line(s.number+(i?1:-1)),r=t.bidiSpans(s),u=t.visualLineSide(s,!i)}if(c){if(!c(d))return l}else{if(!n)return u;c=n(d)}l=u}}function lW(t,e,i){let n=t.state.charCategorizer(e),s=n(i);return r=>{let o=n(r);return s==Dt.Space&&(s=o),s==o}}function cW(t,e,i,n){let s=e.head,r=i?1:-1;if(s==(i?t.state.doc.length:0))return re.cursor(s,e.assoc);let o=e.goalColumn,l,c=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(s,(e.empty?e.assoc:0)||(i?1:-1)),d=t.documentTop;if(u)o==null&&(o=u.left-c.left),l=r<0?u.top:u.bottom;else{let _=t.viewState.lineBlockAt(s);o==null&&(o=Math.min(c.right-c.left,t.defaultCharacterWidth*(s-_.from))),l=(r<0?_.top:_.bottom)+d}let p=c.left+o,g=n??t.viewState.heightOracle.textHeight>>1,O=mb(t,{x:p,y:l+g*r},!1,r);return re.cursor(O.pos,O.assoc,void 0,o)}function Of(t,e,i){for(;;){let n=0;for(let s of t)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let c=n||i||(e-r<o-e?-1:1);e=c<0?r:o,n=c}});if(!n)return e}}function iB(t,e){let i=null;for(let n=0;n<e.ranges.length;n++){let s=e.ranges[n],r=null;if(s.empty){let o=Of(t,s.from,0);o!=s.from&&(r=re.cursor(o,-1))}else{let o=Of(t,s.from,-1),l=Of(t,s.to,1);(o!=s.from||l!=s.to)&&(r=re.range(s.from==s.anchor?o:l,s.from==s.head?o:l))}r&&(i||(i=e.ranges.slice()),i[n]=r)}return i?re.create(i,e.mainIndex):e}function k_(t,e,i){let n=Of(t.state.facet(fd).map(s=>s(t)),i.from,e.head>i.from?-1:1);return n==i.from?i:re.cursor(n,n<i.from?1:-1)}class Or{constructor(e,i){this.pos=e,this.assoc=i}}function mb(t,e,i,n){let s=t.contentDOM.getBoundingClientRect(),r=s.top+t.viewState.paddingTop,{x:o,y:l}=e,c=l-r,u;for(;;){if(c<0)return new Or(0,1);if(c>t.viewState.docHeight)return new Or(t.state.doc.length,-1);if(u=t.elementAtHeight(c),n==null)break;if(u.type==Ki.Text){if(n<0?u.to<t.viewport.from:u.from>t.viewport.to)break;let g=t.docView.coordsAt(n<0?u.from:u.to,n>0?-1:1);if(g&&(n<0?g.top<=c+r:g.bottom>=c+r))break}let p=t.viewState.heightOracle.textHeight/2;c=n>0?u.bottom+p:u.top-p}if(t.viewport.from>=u.to||t.viewport.to<=u.from){if(i)return null;if(u.type==Ki.Text){let p=oW(t,s,u,o,l);return new Or(p,p==u.from?1:-1)}}if(u.type!=Ki.Text)return c<(u.top+u.bottom)/2?new Or(u.from,1):new Or(u.to,-1);let d=t.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=t.docView.lineAt(u.from,-2)),new hW(t,o,l,t.textDirectionAt(u.from)).scanTile(d,u.from)}class hW{constructor(e,i,n,s){this.view=e,this.x=i,this.y=n,this.baseDir=s,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,i){let{line:n,spans:s}=this.bidiSpansAt(e);return s[_r.find(s,e-n.from,-1,i)].level==this.baseDir}dirAt(e,i){let{line:n,spans:s}=this.bidiSpansAt(e);return s[_r.find(s,e-n.from,-1,i)].dir}bidiIn(e,i){let{spans:n,line:s}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+s.from<i)}scan(e,i){let n=0,s=e.length-1,r=new Set,o=this.bidiIn(e[0],e[s]),l,c,u=-1,d=1e9,p;e:for(;n<s;){let O=s-n,_=n+s>>1;t:if(r.has(_)){let S=n+Math.floor(Math.random()*O);for(let w=0;w<O;w++){if(!r.has(S)){_=S;break t}S++,S==s&&(S=n)}break e}r.add(_);let b=i(_);if(b)for(let S=0;S<b.length;S++){let w=b[S],T=0;if(w.bottom<this.y)(!l||l.bottom<w.bottom)&&(l=w),T=1;else if(w.top>this.y)(!c||c.top>w.top)&&(c=w),T=-1;else{let k=w.left>this.x?this.x-w.left:w.right<this.x?this.x-w.right:0,A=Math.abs(k);A<d&&(u=_,d=A,p=w),k&&(T=k<0==(this.baseDir==xt.LTR)?-1:1)}T==-1&&(!o||this.baseDirAt(e[_],1))?s=_:T==1&&(!o||this.baseDirAt(e[_+1],-1))&&(n=_+1)}}if(!p){let O=l&&(!c||this.y-l.bottom<c.top-this.y)?l:c;return this.y=(O.top+O.bottom)/2,this.scan(e,i)}let g=(o?this.dirAt(e[u],1):this.baseDir)==xt.LTR;return{i:u,after:this.x>(p.left+p.right)/2==g}}scanText(e,i){let n=[];for(let r=0;r<e.length;r=Di(e.text,r))n.push(i+r);n.push(i+e.length);let s=this.scan(n,r=>{let o=n[r]-i,l=n[r+1]-i;return Bf(e.dom,o,l).getClientRects()});return s.after?new Or(n[s.i+1],-1):new Or(n[s.i],1)}scanTile(e,i){if(!e.length)return new Or(i,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,i);if(l.isComposite())return this.scanTile(l,i)}let n=[i];for(let l=0,c=i;l<e.children.length;l++)n.push(c+=e.children[l].length);let s=this.scan(n,l=>{let c=e.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:Bf(c.dom,0,c.length)).getClientRects()}),r=e.children[s.i],o=n[s.i];return r.isText()?this.scanText(r,o):r.isComposite()?this.scanTile(r,o):s.after?new Or(n[s.i+1],-1):new Or(o,1)}}const Gu="￿";class uW{constructor(e,i){this.points=e,this.view=i,this.text="",this.lineSeparator=i.state.facet(et.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Gu}readRange(e,i){if(!e)return this;let n=e.parentNode;for(let s=e;;){this.findPointBefore(n,s);let r=this.text.length;this.readNode(s);let o=ui.get(s),l=s.nextSibling;if(l==i){o!=null&&o.breakAfter&&!l&&n!=this.view.contentDOM&&this.lineBreak();break}let c=ui.get(l);(o&&c?o.breakAfter:(o?o.breakAfter:bg(s))||bg(l)&&(s.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>r)&&!dW(l,i)&&this.lineBreak(),s=l}return this.findPointBefore(n,i),this}readTextNode(e){let i=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,i.length));for(let n=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=i.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=s.exec(i))&&(r=l.index,o=l[0].length),this.append(i.slice(n,r<0?i.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=o-1);n=r+o}}readNode(e){let i=ui.get(e),n=i&&i.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let s=n.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.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,i){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==i&&(n.pos=this.text.length)}findPointInside(e,i){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(fW(e,n.node,n.offset)?i:0))}}function fW(t,e,i){for(;;){if(!e||i<bo(e))return!1;if(e==t)return!0;i=Ta(e)+1,e=e.parentNode}}function dW(t,e){let i;for(;!(t==e||!t);t=t.nextSibling){let n=ui.get(t);if(!(n!=null&&n.isWidget()))return!1;n&&(i||(i=[])).push(n)}if(i)for(let n of i){let s=n.overrideDOMText;if(s!=null&&s.length)return!1}return!0}class KA{constructor(e,i){this.node=e,this.offset=i,this.pos=-1}}class pW{constructor(e,i,n,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=i>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&i>-1)this.newSel=null;else if(i>-1&&(this.bounds=nB(e.docView.tile,i,n,0))){let l=r||o?[]:gW(e),c=new uW(l,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=OW(l,this.bounds.from)}else{let l=e.observer.selectionRange,c=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!lb(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),u=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!lb(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),d=e.viewport;if((Se.ios||Se.chrome)&&e.state.selection.main.empty&&c!=u&&(d.from>0||d.to<e.state.doc.length)){let p=Math.min(c,u),g=Math.max(c,u),O=d.from-p,_=d.to-g;(O==0||O==1||p==0)&&(_==0||_==-1||g==e.state.doc.length)&&(c=0,u=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(re.range(u,c)):this.newSel=re.single(u,c)}}}function nB(t,e,i,n){if(t.isComposite()){let s=-1,r=-1,o=-1,l=-1;for(let c=0,u=n,d=n;c<t.children.length;c++){let p=t.children[c],g=u+p.length;if(u<e&&g>i)return nB(p,e,i,u);if(g>=e&&s==-1&&(s=c,r=u),u>i&&p.dom.parentNode==t.dom){o=c,l=d;break}d=g,u=g+p.breakAfter}return{from:r,to:l<0?n+t.length:l,startDOM:(s?t.children[s-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o<t.children.length&&o>=0?t.children[o].dom:null}}else return t.isText()?{from:n,to:n+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function sB(t,e){let i,{newSel:n}=e,s=t.state.selection.main,r=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,c=s.from,u=null;(r===8||Se.android&&e.text.length<l-o)&&(c=s.to,u="end");let d=rB(t.state.doc.sliceString(o,l,Gu),e.text,c-o,u);d&&(Se.chrome&&r==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==Gu+Gu&&d.toB--,i={from:o+d.from,to:o+d.toA,insert:at.of(e.text.slice(d.from,d.toB).split(Gu))})}else n&&(!t.hasFocus&&t.state.facet(fo)||Cg(n,s))&&(n=null);if(!i&&!n)return!1;if(!i&&e.typeOver&&!s.empty&&n&&n.main.empty?i={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,s.to)}:(Se.mac||Se.android)&&i&&i.from==i.to&&i.from==s.head-1&&/^\. ?$/.test(i.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(n&&i.insert.length==2&&(n=re.single(n.main.anchor-1,n.main.head-1)),i={from:i.from,to:i.to,insert:at.of([i.insert.toString().replace("."," ")])}):i&&i.from>=s.from&&i.to<=s.to&&(i.from!=s.from||i.to!=s.to)&&s.to-s.from-(i.to-i.from)<=4?i={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,s.to))}:t.state.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?i={from:s.from,to:s.to,insert:t.state.toText(t.inputState.insertingText)}:Se.chrome&&i&&i.from==i.to&&i.from==s.head&&i.insert.toString()==`
66
- `&&t.lineWrapping&&(n&&(n=re.single(n.main.anchor-1,n.main.head-1)),i={from:s.from,to:s.to,insert:at.of([" "])}),i)return IS(t,i,n,r);if(n&&!Cg(n,s)){let o=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(n=iB(t.state.facet(fd).map(c=>c(t)),n))),t.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function IS(t,e,i,n=-1){if(Se.ios&&t.inputState.flushIOSKey(e))return!0;let s=t.state.selection.main;if(Se.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&t.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Yc(t.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&Yc(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Yc(t.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=mW(t,e,i));return t.state.facet(ZD).some(c=>c(t,e.from,e.to,r,l))||t.dispatch(l()),!0}function mW(t,e,i){let n,s=t.state,r=s.selection.main,o=-1;if(e.from==e.to&&e.from<r.from||e.from>r.to){let c=e.from<r.from?-1:1,u=c<0?r.from:r.to,d=Of(s.facet(fd).map(p=>p(t)),u,c);e.from==d&&(o=d)}if(o>-1)n={changes:e,selection:re.cursor(e.from+e.insert.length,-1)};else if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let c=r.from<e.from?s.sliceDoc(r.from,e.from):"",u=r.to>e.to?s.sliceDoc(e.to,r.to):"";n=s.replaceSelection(t.state.toText(c+e.insert.sliceString(0,void 0,t.state.lineBreak)+u))}else{let c=s.changes(e),u=i&&i.main.to<=c.newLength?i.main:void 0;if(s.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=r.to+10&&e.to>=r.to-10){let d=t.state.sliceDoc(e.from,e.to),p,g=i&&tB(t,i.main.head);if(g){let _=e.insert.length-(e.to-e.from);p={from:g.from,to:g.to-_}}else p=t.state.doc.lineAt(r.head);let O=r.to-e.to;n=s.changeByRange(_=>{if(_.from==r.from&&_.to==r.to)return{changes:c,range:u||_.map(c)};let b=_.to-O,S=b-d.length;if(t.state.sliceDoc(S,b)!=d||b>=p.from&&S<=p.to)return{range:_};let w=s.changes({from:S,to:b,insert:e.insert}),T=_.to-r.to;return{changes:w,range:u?re.range(Math.max(0,u.anchor+T),Math.max(0,u.head+T)):_.map(w)}})}else n={changes:c,selection:u&&s.selection.replaceRange(u)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),s.update(n,{userEvent:l,scrollIntoView:!0})}function rB(t,e,i,n){let s=Math.min(t.length,e.length),r=0;for(;r<s&&t.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let c=Math.max(0,r-Math.min(o,l));i-=o+c-r}if(o<r&&t.length<e.length){let c=i<=r&&i>=o?r-i:0;r-=c,l=r+(l-o),o=r}else if(l<r){let c=i<=r&&i>=l?r-i:0;r-=c,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function gW(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r}=t.observer.selectionRange;return i&&(e.push(new KA(i,n)),(s!=i||r!=n)&&e.push(new KA(s,r))),e}function OW(t,e){if(t.length==0)return null;let i=t[0].pos,n=t.length==2?t[1].pos:i;return i>-1&&n>-1?re.single(i+e,n+e):null}function Cg(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class vW{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=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,Se.safari&&e.contentDOM.addEventListener("input",()=>null),Se.gecko&&QW(e.contentDOM.ownerDocument)}handleEvent(e){!kW(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,i){let n=this.handlers[e];if(n){for(let s of n.observers)s(this.view,i);for(let s of n.handlers){if(i.defaultPrevented)break;if(s(this.view,i)){i.preventDefault();break}}}}ensureHandlers(e){let i=_W(e),n=this.handlers,s=this.view.contentDOM;for(let r in i)if(r!="scroll"){let o=!i[r].handlers.length,l=n[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in n)r!="scroll"&&!i[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=i}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&&aB.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Se.android&&Se.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let i;return Se.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((i=oB.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||yW.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=i||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let i=this.pendingIOSKey;return!i||i.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Yc(this.view.contentDOM,i.key,i.keyCode,i instanceof KeyboardEvent?i:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Se.safari&&!Se.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 JA(t,e){return(i,n)=>{try{return e.call(t,n,i)}catch(s){$n(i.state,s)}}}function _W(t){let e=Object.create(null);function i(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of t){let s=n.spec,r=s&&s.plugin.domEventHandlers,o=s&&s.plugin.domEventObservers;if(r)for(let l in r){let c=r[l];c&&i(l).handlers.push(JA(n.value,c))}if(o)for(let l in o){let c=o[l];c&&i(l).observers.push(JA(n.value,c))}}for(let n in Hs)i(n).handlers.push(Hs[n]);for(let n in Qs)i(n).observers.push(Qs[n]);return e}const oB=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],yW="dthko",aB=[16,17,18,20,91,92,224,225],Jp=6;function em(t){return Math.max(0,t)*.7+8}function bW(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class xW{constructor(e,i,n,s){this.view=e,this.startEvent=i,this.style=n,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=i,this.scrollParents=wq(e.contentDOM),this.atoms=e.state.facet(fd).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=i.shiftKey,this.multiple=e.state.facet(et.allowMultipleSelections)&&SW(e,i),this.dragging=CW(e,i)&&hB(i)==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&&bW(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,n=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=jS(this.view);e.clientX-c.left<=s+Jp?i=-em(s-e.clientX):e.clientX+c.right>=o-Jp&&(i=em(e.clientX-o)),e.clientY-c.top<=r+Jp?n=-em(r-e.clientY):e.clientY+c.bottom>=l-Jp&&(n=em(e.clientY-l)),this.setScrollSpeed(i,n)}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,i){this.scrollSpeed={x:e,y:i},e||i?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:i}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),i&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=i,i=0),(e||i)&&this.view.win.scrollBy(e,i),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:i}=this,n=iB(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(i.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(i=>i.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function SW(t,e){let i=t.state.facet(jD);return i.length?i[0](e):Se.mac?e.metaKey:e.ctrlKey}function wW(t,e){let i=t.state.facet(ID);return i.length?i[0](e):Se.mac?!e.altKey:!e.ctrlKey}function CW(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let n=Lf(t.root);if(!n||n.rangeCount==0)return!0;let s=n.getRangeAt(0).getClientRects();for(let r=0;r<s.length;r++){let o=s[r];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function kW(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i=e.target,n;i!=t.contentDOM;i=i.parentNode)if(!i||i.nodeType==11||(n=ui.get(i))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(e))return!1;return!0}const Hs=Object.create(null),Qs=Object.create(null),lB=Se.ie&&Se.ie_version<15||Se.ios&&Se.webkit_version<604;function TW(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(()=>{t.focus(),i.remove(),cB(t,i.value)},50)}function mO(t,e,i){for(let n of t.facet(e))i=n(i,t);return i}function cB(t,e){e=mO(t.state,BS,e);let{state:i}=t,n,s=1,r=i.toText(e),o=r.lines==i.selection.ranges.length;if(gb!=null&&i.selection.ranges.every(c=>c.empty)&&gb==r.toString()){let c=-1;n=i.changeByRange(u=>{let d=i.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let p=i.toText((o?r.line(s++).text:e)+i.lineBreak);return{changes:{from:d.from,insert:p},range:re.cursor(u.from+p.length)}})}else o?n=i.changeByRange(c=>{let u=r.line(s++);return{changes:{from:c.from,to:c.to,insert:u.text},range:re.cursor(c.from+u.length)}}):n=i.replaceSelection(r);t.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Qs.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Hs.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Qs.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Qs.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Hs.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let n of t.state.facet(VD))if(i=n(t,e),i)break;if(!i&&e.button==0&&(i=EW(t,e)),i){let n=!t.hasFocus;t.inputState.startMouseSelection(new xW(t,e,i,n)),n&&t.observer.ignore(()=>{PD(t.contentDOM);let r=t.root.activeElement;r&&!r.contains(t.contentDOM)&&r.blur()});let s=t.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function eE(t,e,i,n){if(n==1)return re.cursor(e,i);if(n==2)return rW(t.state,e,i);{let s=t.docView.lineAt(e,i),r=t.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return l<t.state.doc.length&&l==r.to&&l++,re.range(o,l)}}const AW=Se.ie&&Se.ie_version<=11;let tE=null,iE=0,nE=0;function hB(t){if(!AW)return t.detail;let e=tE,i=nE;return tE=t,nE=Date.now(),iE=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(iE+1)%3:1}function EW(t,e){let i=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=hB(e),s=t.state.selection;return{update(r){r.docChanged&&(i.pos=r.changes.mapPos(i.pos),s=s.map(r.changes))},get(r,o,l){let c=t.posAndSideAtCoords({x:r.clientX,y:r.clientY},!1),u,d=eE(t,c.pos,c.assoc,n);if(i.pos!=c.pos&&!o){let p=eE(t,i.pos,i.assoc,n),g=Math.min(p.from,d.from),O=Math.max(p.to,d.to);d=g<d.from?re.range(g,O):re.range(O,g)}return o?s.replaceRange(s.main.extend(d.from,d.to)):l&&n==1&&s.ranges.length>1&&(u=MW(s,c.pos))?u:l?s.addRange(d):re.create([d])}}}function MW(t,e){for(let i=0;i<t.ranges.length;i++){let{from:n,to:s}=t.ranges[i];if(n<=e&&s>=e)return re.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}return null}Hs.dragstart=(t,e)=>{let{selection:{main:i}}=t.state;if(e.target.draggable){let s=t.docView.tile.nearest(e.target);if(s&&s.isWidget()){let r=s.posAtStart,o=r+s.length;(r>=i.to||o<=i.from)&&(i=re.range(r,o))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",mO(t.state,$S,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Hs.dragend=t=>(t.inputState.draggedContent=null,!1);function sE(t,e,i,n){if(i=mO(t.state,BS,i),!i)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=t.inputState,o=n&&r&&wW(t,e)?{from:r.from,to:r.to}:null,l={from:s,insert:i},c=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:c,selection:{anchor:c.mapPos(s,-1),head:c.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Hs.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let i=e.dataTransfer.files;if(i&&i.length){let n=Array(i.length),s=0,r=()=>{++s==i.length&&sE(t,e,n.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<i.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[o]=l.result),r()},l.readAsText(i[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return sE(t,e,n,!0),!0}return!1};Hs.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let i=lB?null:e.clipboardData;return i?(cB(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(TW(t),!1)};function PW(t,e){let i=t.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),t.focus()},50)}function RW(t){let e=[],i=[],n=!1;for(let s of t.selection.ranges)s.empty||(e.push(t.sliceDoc(s.from,s.to)),i.push(s));if(!e.length){let s=-1;for(let{from:r}of t.selection.ranges){let o=t.doc.lineAt(r);o.number>s&&(e.push(o.text),i.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),s=o.number}n=!0}return{text:mO(t,$S,e.join(t.lineBreak)),ranges:i,linewise:n}}let gb=null;Hs.copy=Hs.cut=(t,e)=>{if(!pf(t.contentDOM,t.observer.selectionRange))return!1;let{text:i,ranges:n,linewise:s}=RW(t.state);if(!i&&!s)return!1;gb=s?i:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let r=lB?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",i),!0):(PW(t,i),!1)};const uB=Qr.define();function fB(t,e){let i=[];for(let n of t.facet(qD)){let s=n(t,e);s&&i.push(s)}return i.length?t.update({effects:i,annotations:uB.of(!0)}):null}function dB(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=fB(t.state,e);i?t.dispatch(i):t.update([])}},10)}Qs.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),dB(t)};Qs.blur=t=>{t.observer.clearSelectionRange(),dB(t)};Qs.compositionstart=Qs.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Qs.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Se.chrome&&Se.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Qs.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Hs.beforeinput=(t,e)=>{var i,n;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let r=(i=e.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain"),o=e.getTargetRanges();if(r&&o.length){let l=o[0],c=t.posAtDOM(l.startContainer,l.startOffset),u=t.posAtDOM(l.endContainer,l.endOffset);return IS(t,{from:c,to:u,insert:t.state.toText(r)},null),!0}}let s;if(Se.chrome&&Se.android&&(s=oB.find(r=>r.inputType==e.inputType))&&(t.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let r=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Se.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Se.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Qs.compositionend(t,e),20),!1};const rE=new Set;function QW(t){rE.has(t)||(rE.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const oE=["pre-wrap","normal","pre-line","break-spaces"];let ah=!1;function aE(){ah=!1}class LW{constructor(e){this.lineWrapping=e,this.doc=at.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,i){let n=this.doc.lineAt(i).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((i-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}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 oE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let i=!1;for(let n=0;n<e.length;n++){let s=e[n];s<0?n++:this.heightSamples[Math.floor(s*10)]||(i=!0,this.heightSamples[Math.floor(s*10)]=!0)}return i}refresh(e,i,n,s,r,o){let l=oE.indexOf(e)>-1,c=Math.abs(i-this.lineHeight)>.3||this.lineWrapping!=l||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=l,this.lineHeight=i,this.charWidth=n,this.textHeight=s,this.lineLength=r,c){this.heightSamples={};for(let u=0;u<o.length;u++){let d=o[u];d<0?u++:this.heightSamples[Math.floor(d*10)]=!0}}return c}}class DW{constructor(e,i){this.from=e,this.heights=i,this.index=0}get more(){return this.index<this.heights.length}}class Zs{constructor(e,i,n,s,r){this.from=e,this.length=i,this.top=n,this.height=s,this._content=r}get type(){return typeof this._content=="number"?Ki.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 Tl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let i=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Zs(this.from,this.length+e.length,this.top,this.height+e.height,i)}}var Ct=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Ct||(Ct={}));const Vm=.001;class _n{constructor(e,i,n=2){this.length=e,this.height=i,this.flags=n}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)>Vm&&(ah=!0),this.height=e)}replace(e,i,n){return _n.of(n)}decomposeLeft(e,i){i.push(this)}decomposeRight(e,i){i.push(this)}applyChanges(e,i,n,s){let r=this,o=n.doc;for(let l=s.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:p}=s[l],g=r.lineAt(c,Ct.ByPosNoHeight,n.setDoc(i),0,0),O=g.to>=u?g:r.lineAt(u,Ct.ByPosNoHeight,n,0,0);for(p+=O.to-u,u=O.to;l>0&&g.from<=s[l-1].toA;)c=s[l-1].fromA,d=s[l-1].fromB,l--,c<g.from&&(g=r.lineAt(c,Ct.ByPosNoHeight,n,0,0));d+=g.from-c,c=g.from;let _=VS.build(n.setDoc(o),e,d,p);r=kg(r,r.replace(c,u,_))}return r.updateHeight(n,0)}static empty(){return new ts(0,0,0)}static of(e){if(e.length==1)return e[0];let i=0,n=e.length,s=0,r=0;for(;;)if(i==n)if(s>r*2){let l=e[i-1];l.break?e.splice(--i,1,l.left,null,l.right):e.splice(--i,1,l.left,l.right),n+=1+l.break,s-=l.size}else if(r>s*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,r-=l.size}else break;else if(s<r){let l=e[i++];l&&(s+=l.size)}else{let l=e[--n];l&&(r+=l.size)}let o=0;return e[i-1]==null?(o=1,i--):e[i]==null&&(o=1,n++),new $W(_n.of(e.slice(0,i)),o,_n.of(e.slice(n)))}}function kg(t,e){return t==e?t:(t.constructor!=e.constructor&&(ah=!0),e)}_n.prototype.size=1;const BW=Pe.replace({});class pB extends _n{constructor(e,i,n){super(e,i),this.deco=n,this.spaceAbove=0}mainBlock(e,i){return new Zs(i,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,i,n,s){return this.spaceAbove&&e<n+this.spaceAbove?new Zs(s,0,n,this.spaceAbove,BW):this.mainBlock(n,s)}lineAt(e,i,n,s,r){let o=this.mainBlock(s,r);return this.spaceAbove?this.blockAt(0,n,s,r).join(o):o}forEachLine(e,i,n,s,r,o){e<=r+this.length&&i>=r&&o(this.lineAt(0,Ct.ByPos,n,s,r))}setMeasuredHeight(e){let i=e.heights[e.index++];i<0?(this.spaceAbove=-i,i=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(i)}updateHeight(e,i=0,n=!1,s){return s&&s.from<=i&&s.more&&this.setMeasuredHeight(s),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ts extends pB{constructor(e,i,n){super(e,i,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,i){return new Zs(i,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,i,n){let s=n[0];return n.length==1&&(s instanceof ts||s instanceof Wi&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof Wi?s=new ts(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):_n.of(n)}updateHeight(e,i=0,n=!1,s){return s&&s.from<=i&&s.more?this.setMeasuredHeight(s):(n||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 Wi extends _n{constructor(e){super(e,0)}heightMetrics(e,i){let n=e.doc.lineAt(i).number,s=e.doc.lineAt(i+this.length).number,r=s-n+1,o,l=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*r);o=c/r,this.length>r+1&&(l=(this.height-c)/(this.length-r-1))}else o=this.height/r;return{firstLine:n,lastLine:s,perLine:o,perChar:l}}blockAt(e,i,n,s){let{firstLine:r,lastLine:o,perLine:l,perChar:c}=this.heightMetrics(i,s);if(i.lineWrapping){let u=s+(e<i.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),d=i.doc.lineAt(u),p=l+d.length*c,g=Math.max(n,e-p/2);return new Zs(d.from,d.length,g,p,0)}else{let u=Math.max(0,Math.min(o-r,Math.floor((e-n)/l))),{from:d,length:p}=i.doc.line(r+u);return new Zs(d,p,n+l*u,l,0)}}lineAt(e,i,n,s,r){if(i==Ct.ByHeight)return this.blockAt(e,n,s,r);if(i==Ct.ByPosNoHeight){let{from:O,to:_}=n.doc.lineAt(e);return new Zs(O,_-O,0,0,0)}let{firstLine:o,perLine:l,perChar:c}=this.heightMetrics(n,r),u=n.doc.lineAt(e),d=l+u.length*c,p=u.number-o,g=s+l*p+c*(u.from-r-p);return new Zs(u.from,u.length,Math.max(s,Math.min(g,s+this.height-d)),d,0)}forEachLine(e,i,n,s,r,o){e=Math.max(e,r),i=Math.min(i,r+this.length);let{firstLine:l,perLine:c,perChar:u}=this.heightMetrics(n,r);for(let d=e,p=s;d<=i;){let g=n.doc.lineAt(d);if(d==e){let _=g.number-l;p+=c*_+u*(e-r-_)}let O=c+u*g.length;o(new Zs(g.from,g.length,p,O,0)),p+=O,d=g.to+1}}replace(e,i,n){let s=this.length-i;if(s>0){let r=n[n.length-1];r instanceof Wi?n[n.length-1]=new Wi(r.length+s):n.push(null,new Wi(s-1))}if(e>0){let r=n[0];r instanceof Wi?n[0]=new Wi(e+r.length):n.unshift(new Wi(e-1),null)}return _n.of(n)}decomposeLeft(e,i){i.push(new Wi(e-1),null)}decomposeRight(e,i){i.push(null,new Wi(this.length-e-1))}updateHeight(e,i=0,n=!1,s){let r=i+this.length;if(s&&s.from<=i+this.length&&s.more){let o=[],l=Math.max(i,s.from),c=-1;for(s.from>i&&o.push(new Wi(s.from-i-1).updateHeight(e,i));l<=r&&s.more;){let d=e.doc.lineAt(l).length;o.length&&o.push(null);let p=s.heights[s.index++],g=0;p<0&&(g=-p,p=s.heights[s.index++]),c==-1?c=p:Math.abs(p-c)>=Vm&&(c=-2);let O=new ts(d,p,g);O.outdated=!1,o.push(O),l+=d+1}l<=r&&o.push(null,new Wi(r-l).updateHeight(e,l));let u=_n.of(o);return(c<0||Math.abs(u.height-this.height)>=Vm||Math.abs(c-this.heightMetrics(e,i).perLine)>=Vm)&&(ah=!0),kg(this,u)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(i,i+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class $W extends _n{constructor(e,i,n){super(e.length+i+n.length,e.height+n.height,i|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,i,n,s){let r=n+this.left.height;return e<r?this.left.blockAt(e,i,n,s):this.right.blockAt(e,i,r,s+this.left.length+this.break)}lineAt(e,i,n,s,r){let o=s+this.left.height,l=r+this.left.length+this.break,c=i==Ct.ByHeight?e<o:e<l,u=c?this.left.lineAt(e,i,n,s,r):this.right.lineAt(e,i,n,o,l);if(this.break||(c?u.to<l:u.from>l))return u;let d=i==Ct.ByPosNoHeight?Ct.ByPosNoHeight:Ct.ByPos;return c?u.join(this.right.lineAt(l,d,n,o,l)):this.left.lineAt(l,d,n,s,r).join(u)}forEachLine(e,i,n,s,r,o){let l=s+this.left.height,c=r+this.left.length+this.break;if(this.break)e<c&&this.left.forEachLine(e,i,n,s,r,o),i>=c&&this.right.forEachLine(e,i,n,l,c,o);else{let u=this.lineAt(c,Ct.ByPos,n,s,r);e<u.from&&this.left.forEachLine(e,u.from-1,n,s,r,o),u.to>=e&&u.from<=i&&o(u),i>u.to&&this.right.forEachLine(u.to+1,i,n,l,c,o)}}replace(e,i,n){let s=this.left.length+this.break;if(i<s)return this.balanced(this.left.replace(e,i,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-s,i-s,n));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of n)r.push(l);if(e>0&&lE(r,o-1),i<this.length){let l=r.length;this.decomposeRight(i,r),lE(r,l)}return _n.of(r)}decomposeLeft(e,i){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,i);i.push(this.left),this.break&&(n++,e>=n&&i.push(null)),e>n&&this.right.decomposeLeft(e-n,i)}decomposeRight(e,i){let n=this.left.length,s=n+this.break;if(e>=s)return this.right.decomposeRight(e-s,i);e<n&&this.left.decomposeRight(e,i),this.break&&e<s&&i.push(null),i.push(this.right)}balanced(e,i){return e.size>2*i.size||i.size>2*e.size?_n.of(this.break?[e,null,i]:[e,i]):(this.left=kg(this.left,e),this.right=kg(this.right,i),this.setHeight(e.height+i.height),this.outdated=e.outdated||i.outdated,this.size=e.size+i.size,this.length=e.length+this.break+i.length,this)}updateHeight(e,i=0,n=!1,s){let{left:r,right:o}=this,l=i+r.length+this.break,c=null;return s&&s.from<=i+r.length&&s.more?c=r=r.updateHeight(e,i,n,s):r.updateHeight(e,i,n),s&&s.from<=l+o.length&&s.more?c=o=o.updateHeight(e,l,n,s):o.updateHeight(e,l,n),c?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function lE(t,e){let i,n;t[e]==null&&(i=t[e-1])instanceof Wi&&(n=t[e+1])instanceof Wi&&t.splice(e-1,3,new Wi(i.length+1+n.length))}const NW=5;class VS{constructor(e,i){this.pos=e,this.oracle=i,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,i){if(this.lineStart>-1){let n=Math.min(i,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof ts?s.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new ts(n-this.pos,-1,0)),this.writtenTo=n,i>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=i}point(e,i,n){if(e<i||n.heightRelevant){let s=n.widget?n.widget.estimatedHeight:0,r=n.widget?n.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let o=i-e;n.block?this.addBlock(new pB(o,s,n)):(o||r||s>=NW)&&this.addLineDeco(s,r,o)}else i>e&&this.span(e,i);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:i}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=i,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 ts(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,i){let n=new Wi(i-e);return this.oracle.doc.lineAt(e).to==i&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ts)return e;let i=new ts(0,-1,0);return this.nodes.push(i),i}addBlock(e){this.enterLine();let i=e.deco;i&&i.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,i&&i.endSide>0&&(this.covering=e)}addLineDeco(e,i,n){let s=this.ensureLine();s.length+=n,s.collapsed+=n,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=i,this.writtenTo=this.pos=this.pos+n}finish(e){let i=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(i instanceof ts)&&!this.isCovered?this.nodes.push(new ts(0,-1,0)):(this.writtenTo<this.pos||i==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let s of this.nodes)s instanceof ts&&s.updateHeight(this.oracle,n),n+=s?s.length:1;return this.nodes}static build(e,i,n,s){let r=new VS(n,e);return Ge.spans(i,n,s,r,0),r.finish(n)}}function zW(t,e,i){let n=new jW;return Ge.compare(t,e,i,n,0),n.changes}class jW{constructor(){this.changes=[]}compareRange(){}comparePoint(e,i,n,s){(e<i||n&&n.heightRelevant||s&&s.heightRelevant)&&Uc(e,i,this.changes,5)}}function IW(t,e){let i=t.getBoundingClientRect(),n=t.ownerDocument,s=n.defaultView||window,r=Math.max(0,i.left),o=Math.min(s.innerWidth,i.right),l=Math.max(0,i.top),c=Math.min(s.innerHeight,i.bottom);for(let u=t.parentNode;u&&u!=n.body;)if(u.nodeType==1){let d=u,p=window.getComputedStyle(d);if((d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth)&&p.overflow!="visible"){let g=d.getBoundingClientRect();r=Math.max(r,g.left),o=Math.min(o,g.right),l=Math.max(l,g.top),c=Math.min(u==t.parentNode?s.innerHeight:c,g.bottom)}u=p.position=="absolute"||p.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:r-i.left,right:Math.max(r,o)-i.left,top:l-(i.top+e),bottom:Math.max(l,c)-(i.top+e)}}function VW(t){let e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView||window;return e.left<i.innerWidth&&e.right>0&&e.top<i.innerHeight&&e.bottom>0}function XW(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class T_{constructor(e,i,n,s){this.from=e,this.to=i,this.size=n,this.displaySize=s}static same(e,i){if(e.length!=i.length)return!1;for(let n=0;n<e.length;n++){let s=e[n],r=i[n];if(s.from!=r.from||s.to!=r.to||s.size!=r.size)return!1}return!0}draw(e,i){return Pe.replace({widget:new ZW(this.displaySize*(i?e.scaleY:e.scaleX),i)}).range(this.from,this.to)}}class ZW extends Gs{constructor(e,i){super(),this.size=e,this.vertical=i}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 cE{constructor(e){this.state=e,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.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=hE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=xt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=e.facet(NS).some(n=>typeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new LW(i),this.stateDeco=uE(e),this.heightMap=_n.empty().applyChanges(this.stateDeco,at.empty,this.heightOracle.setDoc(e.doc),[new ks(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Pe.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:i}=this.state.selection;for(let n=0;n<=1;n++){let s=n?i.head:i.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new tm(r,o))}}return this.viewports=e.sort((n,s)=>n.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?hE:new XS(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(Ku(e,this.scaler))})}update(e,i=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=uE(this.state);let s=e.changedRanges,r=ks.extendWithRanges(s,zW(n,this.stateDeco,e?e.changes:vi.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);aE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||ah)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let c=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(i&&(i.range.head<c.from||i.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,i));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(u||!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),i&&(this.scrollTarget=i),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(UD)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let i=e.contentDOM,n=window.getComputedStyle(i),s=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?xt.RTL:xt.LTR;let o=this.heightOracle.mustRefreshForWrapping(r)||this.mustMeasureContent==="refresh",l=i.getBoundingClientRect(),c=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:A,scaleY:R}=MD(i,l);(A>.005&&Math.abs(this.scaleX-A)>.005||R>.005&&Math.abs(this.scaleY-R)>.005)&&(this.scaleX=A,this.scaleY=R,u|=16,o=c=!0)}let p=(parseInt(n.paddingTop)||0)*this.scaleY,g=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=g)&&(this.paddingTop=p,this.paddingBottom=g,u|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=16);let O=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=O&&(this.scrollAnchorHeight=-1,this.scrollTop=O),this.scrolledToBottom=RD(e.scrollDOM);let _=(this.printing?XW:IW)(i,this.paddingTop),b=_.top-this.pixelViewport.top,S=_.bottom-this.pixelViewport.bottom;this.pixelViewport=_;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(c=!0)),!this.inView&&!this.scrollTarget&&!VW(e.dom))return 0;let T=l.width;if((this.contentDOMWidth!=T||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),c){let A=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(A)&&(o=!0),o||s.lineWrapping&&Math.abs(T-this.contentDOMWidth)>s.charWidth){let{lineHeight:R,charWidth:E,textHeight:$}=e.docView.measureTextSize();o=R>0&&s.refresh(r,R,E,$,Math.max(5,T/E),A),o&&(e.docView.minWidth=0,u|=16)}b>0&&S>0?d=Math.max(b,S):b<0&&S<0&&(d=Math.min(b,S)),aE();for(let R of this.viewports){let E=R.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(R);this.heightMap=(o?_n.empty().applyChanges(this.stateDeco,at.empty,this.heightOracle,[new ks(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new DW(R.from,E))}ah&&(u|=2)}let k=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return k&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,i){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,c=new tm(s.lineAt(o-n*1e3,Ct.ByHeight,r,0,0).from,s.lineAt(l+(1-n)*1e3,Ct.ByHeight,r,0,0).to);if(i){let{head:u}=i.range;if(u<c.from||u>c.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=s.lineAt(u,Ct.ByPos,r,0,0),g;i.y=="center"?g=(p.top+p.bottom)/2-d/2:i.y=="start"||i.y=="nearest"&&u<c.from?g=p.top:g=p.bottom-d,c=new tm(s.lineAt(g-1e3/2,Ct.ByHeight,r,0,0).from,s.lineAt(g+d+1e3/2,Ct.ByHeight,r,0,0).to)}}return c}mapViewport(e,i){let n=i.mapPos(e.from,-1),s=i.mapPos(e.to,1);return new tm(this.heightMap.lineAt(n,Ct.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,Ct.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:i},n=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,Ct.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(i,Ct.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||s<=o-Math.max(10,Math.min(-n,250)))&&(i==this.state.doc.length||r>=l+Math.max(10,Math.min(n,250)))&&s>o-2*1e3&&r<l+2*1e3}mapLineGaps(e,i){if(!e.length||i.empty)return e;let n=[];for(let s of e)i.touchesRange(s.from,s.to)||n.push(new T_(i.mapPos(s.from),i.mapPos(s.to),s.size,s.displaySize));return n}ensureLineGaps(e,i){let n=this.heightOracle.lineWrapping,s=n?1e4:2e3,r=s>>1,o=s<<1;if(this.defaultTextDirection!=xt.LTR&&!n)return[];let l=[],c=(d,p,g,O)=>{if(p-d<r)return;let _=this.state.selection.main,b=[_.from];_.empty||b.push(_.to);for(let w of b)if(w>d&&w<p){c(d,w-10,g,O),c(w+10,p,g,O);return}let S=WW(e,w=>w.from>=g.from&&w.to<=g.to&&Math.abs(w.from-d)<r&&Math.abs(w.to-p)<r&&!b.some(T=>w.from<T&&w.to>T));if(!S){if(p<g.to&&i&&n&&i.visibleRanges.some(k=>k.from<=p&&k.to>=p)){let k=i.moveToLineBoundary(re.cursor(p),!1,!0).head;k>d&&(p=k)}let w=this.gapSize(g,d,p,O),T=n||w<2e6?w:2e6;S=new T_(d,p,w,T)}l.push(S)},u=d=>{if(d.length<o||d.type!=Ki.Text)return;let p=qW(d.from,d.to,this.stateDeco);if(p.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,O,_;if(n){let b=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,S,w;if(g!=null){let T=nm(p,g),k=((this.visibleBottom-this.visibleTop)/2+b)/d.height;S=T-k,w=T+k}else S=(this.visibleTop-d.top-b)/d.height,w=(this.visibleBottom-d.top+b)/d.height;O=im(p,S),_=im(p,w)}else{let b=p.total*this.heightOracle.charWidth,S=s*this.heightOracle.charWidth,w=0;if(b>2e6)for(let E of e)E.from>=d.from&&E.from<d.to&&E.size!=E.displaySize&&E.from*this.heightOracle.charWidth+w<this.pixelViewport.left&&(w=E.size-E.displaySize);let T=this.pixelViewport.left+w,k=this.pixelViewport.right+w,A,R;if(g!=null){let E=nm(p,g),$=((k-T)/2+S)/b;A=E-$,R=E+$}else A=(T-S)/b,R=(k+S)/b;O=im(p,A),_=im(p,R)}O>d.from&&c(d.from,O,d,p),_<d.to&&c(_,d.to,d,p)};for(let d of this.viewportLines)Array.isArray(d.type)?d.type.forEach(u):u(d);return l}gapSize(e,i,n,s){let r=nm(s,n)-nm(s,i);return this.heightOracle.lineWrapping?e.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(e){T_.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Pe.set(e.map(i=>i.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let i=this.stateDeco;this.lineGaps.length&&(i=i.concat(this.lineGapDeco));let n=[];Ge.spans(i,this.viewport.from,this.viewport.to,{span(r,o){n.push({from:r,to:o})},point(){}},20);let s=0;if(n.length!=this.visibleRanges.length)s=12;else for(let r=0;r<n.length&&!(s&8);r++){let o=this.visibleRanges[r],l=n[r];(o.from!=l.from||o.to!=l.to)&&(s|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(s|=8))}return this.visibleRanges=n,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(i=>i.from<=e&&i.to>=e)||Ku(this.heightMap.lineAt(e,Ct.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(i=>i.top<=e&&i.bottom>=e)||Ku(this.heightMap.lineAt(this.scaler.fromDOM(e),Ct.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let i=this.lineBlockAtHeight(e+8);return i.from>=this.viewport.from||this.viewportLines[0].top-e>200?i:this.viewportLines[0]}elementAtHeight(e){return Ku(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 tm{constructor(e,i){this.from=e,this.to=i}}function qW(t,e,i){let n=[],s=t,r=0;return Ge.spans(i,t,e,{span(){},point(o,l){o>s&&(n.push({from:s,to:o}),r+=o-s),s=l}},20),s<e&&(n.push({from:s,to:e}),r+=e-s),{total:r,ranges:n}}function im({total:t,ranges:e},i){if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;let n=Math.floor(t*i);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(n<=l)return r+n;n-=l}}function nm(t,e){let i=0;for(let{from:n,to:s}of t.ranges){if(e<=s){i+=e-n;break}i+=s-n}return i/t.total}function WW(t,e){for(let i of t)if(e(i))return i}const hE={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function uE(t){let e=t.facet(fO).filter(n=>typeof n!="function"),i=t.facet(zS).filter(n=>typeof n!="function");return i.length&&e.push(Ge.join(i)),e}class XS{constructor(e,i,n){let s=0,r=0,o=0;this.viewports=n.map(({from:l,to:c})=>{let u=i.lineAt(l,Ct.ByPos,e,0,0).top,d=i.lineAt(c,Ct.ByPos,e,0,0).bottom;return s+=d-u,{from:l,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(i.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let i=0,n=0,s=0;;i++){let r=i<this.viewports.length?this.viewports[i]:null;if(!r||e<r.top)return s+(e-n)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);n=r.bottom,s=r.domBottom}}fromDOM(e){for(let i=0,n=0,s=0;;i++){let r=i<this.viewports.length?this.viewports[i]:null;if(!r||e<r.domTop)return n+(e-s)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);n=r.bottom,s=r.domBottom}}eq(e){return e instanceof XS?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((i,n)=>i.from==e.viewports[n].from&&i.to==e.viewports[n].to):!1}}function Ku(t,e){if(e.scale==1)return t;let i=e.toDOM(t.top),n=e.toDOM(t.bottom);return new Zs(t.from,t.length,i,n-i,Array.isArray(t._content)?t._content.map(s=>Ku(s,e)):t._content)}const sm=xe.define({combine:t=>t.join(" ")}),Ob=xe.define({combine:t=>t.indexOf(!0)>-1}),vb=Ca.newName(),mB=Ca.newName(),gB=Ca.newName(),OB={"&light":"."+mB,"&dark":"."+gB};function _b(t,e,i){return new Ca(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,s=>{if(s=="&")return t;if(!i||!i[s])throw new RangeError(`Unsupported selector: ${s}`);return i[s]}):t+" "+n}})}const UW=_b("."+vb,{"&":{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-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"}},OB),YW={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},A_=Se.ie&&Se.ie_version<=11;class HW{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Cq,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(i=>{for(let n of i)this.queue.push(n);(Se.ie&&Se.ie_version<=11||Se.ios&&e.composing)&&i.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Se.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Se.chrome&&Se.chrome_version<126)&&(this.editContext=new GW(e),e.state.facet(fo)&&(e.contentDOM.editContext=this.editContext.editContext)),A_&&(this.onCharData=i=>{this.queue.push({target:i.target,type:"characterData",oldValue:i.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 i;((i=this.view.docView)===null||i===void 0?void 0:i.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(i=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),i.length>0&&i[i.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(i=>{i.length>0&&i[i.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((i,n)=>i!=e[n]))){this.gapIntersection.disconnect();for(let i of e)this.gapIntersection.observe(i);this.gaps=e}}onSelectionChange(e){let i=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,s=this.selectionRange;if(n.state.facet(fo)?n.root.activeElement!=this.dom:!pf(this.dom,s))return;let r=s.anchorNode&&n.docView.tile.nearest(s.anchorNode);if(r&&r.isWidget()&&r.widget.ignoreEvent(e)){i||(this.selectionChanged=!1);return}(Se.ie&&Se.ie_version<=11||Se.android&&Se.chrome)&&!n.state.selection.main.empty&&s.focusNode&&gf(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,i=Lf(e.root);if(!i)return!1;let n=Se.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&FW(this.view,i)||i;if(!n||this.selectionRange.eq(n))return!1;let s=pf(this.dom,n);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Tq(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),s&&(this.selectionChanged=!0),!0)}setSelectionRange(e,i){this.selectionRange.set(e.node,e.offset,i.node,i.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,i=null;for(let n=this.dom;n;)if(n.nodeType==1)!i&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:i||(i=this.scrollTargets.slice(0,e)),i&&i.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!i&&(i=this.scrollTargets.slice(0,e)),i){for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);for(let n of this.scrollTargets=i)n.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,YW),A_&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),A_&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,i){var n;if(!this.delayedAndroidKey){let s=()=>{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Yc(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:i,force:this.lastChange<Date.now()-50||!!(!((n=this.delayedAndroidKey)===null||n===void 0)&&n.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 i=-1,n=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),i==-1?{from:i,to:n}=o:(i=Math.min(o.from,i),n=Math.max(o.to,n)))}return{from:i,to:n,typeOver:s}}readChange(){let{from:e,to:i,typeOver:n}=this.processRecords(),s=this.selectionChanged&&pf(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new pW(this.view,e,i,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let i=this.readChange();if(!i)return this.view.requestMeasure(),!1;let n=this.view.state,s=sB(this.view,i);return this.view.state==n&&(i.domChanged||i.newSel&&!Cg(this.view.state.selection,i.newSel.main))&&this.view.update([]),s}readMutation(e){let i=this.view.docView.tile.nearest(e.target);if(!i||i.isWidget())return null;if(i.markDirty(e.type=="attributes"),e.type=="childList"){let n=fE(i,e.previousSibling||e.target.previousSibling,-1),s=fE(i,e.nextSibling||e.target.nextSibling,1);return{from:n?i.posAfter(n):i.posAtStart,to:s?i.posBefore(s):i.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:i.posAtStart,to:i.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(fo)!=e.state.facet(fo)&&(e.view.contentDOM.editContext=e.state.facet(fo)?this.editContext.editContext:null))}destroy(){var e,i,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(i=this.gapIntersection)===null||i===void 0||i.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let s of this.scrollTargets)s.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 fE(t,e,i){for(;e;){let n=ui.get(e);if(n&&n.parent==t)return n;let s=e.parentNode;e=s!=t.dom?s:i>0?e.nextSibling:e.previousSibling}return null}function dE(t,e){let i=e.startContainer,n=e.startOffset,s=e.endContainer,r=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return gf(o.node,o.offset,s,r)&&([i,n,s,r]=[s,r,i,n]),{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r}}function FW(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return dE(t,s)}let i=null;function n(s){s.preventDefault(),s.stopImmediatePropagation(),i=s.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",n,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",n,!0),i?dE(t,i):null}class GW{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let i=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=n=>{let s=e.state.selection.main,{anchor:r,head:o}=s,l=this.toEditorPos(n.updateRangeStart),c=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>n.text.length;l==this.from&&r<this.from?l=r:c==this.to&&r>this.to&&(c=r);let d=rB(e.state.sliceDoc(l,c),n.text,(u?s.from:s.to)-l,u?"end":null);if(!d){let g=re.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));Cg(g,s)||e.dispatch({selection:g,userEvent:"select"});return}let p={from:d.from+l,to:d.toA+l,insert:at.of(n.text.slice(d.from,d.toB).split(`
67
- `))};if((Se.mac||Se.android)&&p.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:l,to:c,insert:at.of([n.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let g=this.to-this.from+(p.to-p.from+p.insert.length);IS(e,p,re.single(this.toEditorPos(n.selectionStart,g),this.toEditorPos(n.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(i.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(i.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let s=[],r=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o<l;o++){let c=e.coordsForChar(o);r=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.top)||r||new DOMRect,s.push(r)}i.updateCharacterBounds(n.rangeStart,s)},this.handlers.textformatupdate=n=>{let s=[];for(let r of n.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let c=this.toEditorPos(r.rangeStart),u=this.toEditorPos(r.rangeEnd);if(c<u){let d=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;s.push(Pe.mark({attributes:{style:d}}).range(c,u))}}}e.dispatch({effects:HD.of(Pe.set(s))})},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:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)i.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let s=Lf(n.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let i=0,n=!1,s=this.pendingContextChange;return e.changes.iterChanges((r,o,l,c,u)=>{if(n)return;let d=u.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(u)){s=this.pendingContextChange=null,i+=d,this.to+=d;return}else s=null,this.revertPending(e.state);if(r+=i,o+=i,o<=this.from)this.from+=d,this.to+=d;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+u.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),u.toString()),this.to+=d}i+=d}),s&&!n&&this.revertPending(e.state),!n}update(e){let i=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.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||i)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:i}=e.selection.main;this.from=Math.max(0,i-1e4),this.to=Math.min(e.doc.length,i+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 i=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(i.from),this.toContextPos(i.from+i.insert.length),e.doc.sliceString(i.from,i.to))}setSelection(e){let{main:i}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,i.anchor))),s=this.toContextPos(i.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(n,s)}rangeIsValid(e){let{head:i}=e.selection.main;return!(this.from>0&&i-this.from<500||this.to<e.doc.length&&this.to-i<500||this.to-this.from>1e4*3)}toEditorPos(e,i=this.to-this.from){e=Math.min(e,i);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let i=this.composing;return i&&i.drifted?i.contextBase+(e-i.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class ve{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 i;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:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(s=>s.forEach(r=>n(r,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||kq(e.parent)||document,this.viewState=new cE(e.state||et.create(e)),e.scrollTo&&e.scrollTo.is(Kp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(zc).map(s=>new x_(s));for(let s of this.plugins)s.update(this);this.observer=new HW(this),this.inputState=new vW(this),this.inputState.ensureHandlers(this.plugins),this.docView=new FA(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((i=document.fonts)===null||i===void 0)&&i.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let i=e.length==1&&e[0]instanceof hi?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(i,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let i=!1,n=!1,s,r=this.state;for(let g of e){if(g.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=g.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,c=null;e.some(g=>g.annotation(uB))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=fB(r,o),c||(l=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(d=null)):this.observer.clear(),r.facet(et.phrases)!=this.state.facet(et.phrases))return this.setState(r);s=xg.create(this,r,e),s.flags|=l;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(p&&(p=p.map(g.changes)),g.scrollIntoView){let{main:O}=g.state.selection;p=new Hc(O.empty?O:re.cursor(O.head,O.head>O.anchor?-1:1))}for(let O of g.effects)O.is(Kp)&&(p=O.value.clip(this.state))}this.viewState.update(s,p),this.bidiCache=Tg.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),i=this.docView.update(s),this.state.facet(Fu)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(i,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(sm)!=s.state.facet(sm)&&(this.viewState.mustMeasureContent=!0),(i||n||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!s.empty)for(let g of this.state.facet(fb))try{g(s)}catch(O){$n(this.state,O,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!sB(this,d)&&u.force&&Yc(this.contentDOM,u.key,u.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 i=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new cE(e),this.plugins=e.facet(zc).map(n=>new x_(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new FA(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}i&&this.focus(),this.requestMeasure()}updatePlugins(e){let i=e.startState.facet(zc),n=e.state.facet(zc);if(i!=n){let s=[];for(let r of n){let o=i.indexOf(r);if(o<0)s.push(new x_(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);i!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let i=e.value;if(i&&i.docViewUpdate)try{i.docViewUpdate(this)}catch(n){$n(this.state,n,"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 i=null,n=this.scrollDOM,s=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(RD(n))r=-1,o=this.viewState.heightMap.height;else{let O=this.viewState.scrollAnchorAt(s);r=O.from,o=O.top}this.updateState=1;let c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(O=>{try{return O.read(this)}catch(_){return $n(this.state,_),pE}}),p=xg.create(this,this.state,[]),g=!1;p.flags|=c,i?i.flags|=c:i=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),g=this.docView.update(p),g&&this.docViewUpdate());for(let O=0;O<u.length;O++)if(d[O]!=pE)try{let _=u[O];_.write&&_.write(d[O],this)}catch(_){$n(this.state,_)}if(g&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let _=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(_>1||_<-1){s=s+_,n.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(i&&!i.empty)for(let l of this.state.facet(fb))l(i)}get themeClasses(){return vb+" "+(this.state.facet(Ob)?gB:mB)+" "+this.state.facet(sm)}updateAttrs(){let e=mE(this,FD,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),i={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(fo)?"true":"false",class:"cm-content",style:`${Se.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(i["aria-readonly"]="true"),mE(this,NS,i);let n=this.observer.ignore(()=>{let s=ZA(this.contentDOM,this.contentAttrs,i),r=ZA(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=i,n}showAnnouncements(e){let i=!0;for(let n of e)for(let s of n.effects)if(s.is(ve.announce)){i&&(this.announceDOM.textContent=""),i=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Fu);let e=this.state.facet(ve.cspNonce);Ca.mount(this.root,this.styleModules.concat(UW).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 i=0;i<this.measureRequests.length;i++)if(this.measureRequests[i].key===e.key){this.measureRequests[i]=e;return}}this.measureRequests.push(e)}}plugin(e){let i=this.pluginMap.get(e);return(i===void 0||i&&i.plugin!=e)&&this.pluginMap.set(e,i=this.plugins.find(n=>n.plugin==e)||null),i&&i.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,i,n){return k_(this,e,GA(this,e,i,n))}moveByGroup(e,i){return k_(this,e,GA(this,e,i,n=>lW(this,e.head,n)))}visualLineSide(e,i){let n=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=n[i?n.length-1:0];return re.cursor(r.side(i,s)+e.from,r.forward(!i,s)?1:-1)}moveToLineBoundary(e,i,n=!0){return aW(this,e,i,n)}moveVertically(e,i,n){return k_(this,e,cW(this,e,i,n))}domAtPos(e,i=1){return this.docView.domAtPos(e,i)}posAtDOM(e,i=0){return this.docView.posFromDOM(e,i)}posAtCoords(e,i=!0){this.readMeasured();let n=mb(this,e,i);return n&&n.pos}posAndSideAtCoords(e,i=!0){return this.readMeasured(),mb(this,e,i)}coordsAtPos(e,i=1){this.readMeasured();let n=this.docView.coordsAt(e,i);if(!n||n.left==n.right)return n;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[_r.find(r,e-s.from,-1,i)];return Df(n,o.dir==xt.LTR==i>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(WD)||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>KW)return ND(e.length);let i=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==i&&(r.fresh||$D(r.isolates,n=UA(this,e))))return r.order;n||(n=UA(this,e));let s=Lq(e.text,i,n);return this.bidiCache.push(new Tg(e.from,e.to,i,n,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Se.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{PD(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,i={}){return Kp.of(new Hc(typeof e=="number"?re.cursor(e):e,i.y,i.x,i.yMargin,i.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:i}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Kp.of(new Hc(re.cursor(n.from),"start","start",n.top-e,i,!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 Jt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Jt.define(()=>({}),{eventObservers:e})}static theme(e,i){let n=Ca.newName(),s=[sm.of(n),Fu.of(_b(`.${n}`,e))];return i&&i.dark&&s.push(Ob.of(!0)),s}static baseTheme(e){return wo.lowest(Fu.of(_b("."+vb,e,OB)))}static findFromDOM(e){var i;let n=e.querySelector(".cm-content"),s=n&&ui.get(n)||ui.get(e);return((i=s==null?void 0:s.root)===null||i===void 0?void 0:i.view)||null}}ve.styleModule=Fu;ve.inputHandler=ZD;ve.clipboardInputFilter=BS;ve.clipboardOutputFilter=$S;ve.scrollHandler=YD;ve.focusChangeEffect=qD;ve.perLineTextDirection=WD;ve.exceptionSink=XD;ve.updateListener=fb;ve.editable=fo;ve.mouseSelectionStyle=VD;ve.dragMovesSelection=ID;ve.clickAddsSelectionRange=jD;ve.decorations=fO;ve.blockWrappers=GD;ve.outerDecorations=zS;ve.atomicRanges=fd;ve.bidiIsolatedRanges=KD;ve.scrollMargins=JD;ve.darkTheme=Ob;ve.cspNonce=xe.define({combine:t=>t.length?t[0]:""});ve.contentAttributes=NS;ve.editorAttributes=FD;ve.lineWrapping=ve.contentAttributes.of({class:"cm-lineWrapping"});ve.announce=ze.define();const KW=4096,pE={};class Tg{constructor(e,i,n,s,r,o){this.from=e,this.to=i,this.dir=n,this.isolates=s,this.fresh=r,this.order=o}static update(e,i){if(i.empty&&!e.some(r=>r.fresh))return e;let n=[],s=e.length?e[e.length-1].dir:xt.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir==s&&!i.touchesRange(o.from,o.to)&&n.push(new Tg(i.mapPos(o.from,1),i.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function mE(t,e,i){for(let n=t.state.facet(e),s=n.length-1;s>=0;s--){let r=n[s],o=typeof r=="function"?r(t):r;o&&QS(o,i)}return i}const JW=Se.mac?"mac":Se.windows?"win":Se.linux?"linux":"key";function eU(t,e){const i=t.split(/-(?!$)/);let n=i[i.length-1];n=="Space"&&(n=" ");let s,r,o,l;for(let c=0;c<i.length-1;++c){const u=i[c];if(/^(cmd|meta|m)$/i.test(u))l=!0;else if(/^a(lt)?$/i.test(u))s=!0;else if(/^(c|ctrl|control)$/i.test(u))r=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))e=="mac"?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+u)}return s&&(n="Alt-"+n),r&&(n="Ctrl-"+n),l&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function rm(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),i!==!1&&e.shiftKey&&(t="Shift-"+t),t}const tU=wo.default(ve.domEventHandlers({keydown(t,e){return _B(vB(e.state),t,e,"editor")}})),Ll=xe.define({enables:tU}),gE=new WeakMap;function vB(t){let e=t.facet(Ll),i=gE.get(e);return i||gE.set(e,i=sU(e.reduce((n,s)=>n.concat(s),[]))),i}function iU(t,e,i){return _B(vB(t.state),e,t,i)}let Oa=null;const nU=4e3;function sU(t,e=JW){let i=Object.create(null),n=Object.create(null),s=(o,l)=>{let c=n[o];if(c==null)n[o]=l;else if(c!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,c,u,d)=>{var p,g;let O=i[o]||(i[o]=Object.create(null)),_=l.split(/ (?!$)/).map(w=>eU(w,e));for(let w=1;w<_.length;w++){let T=_.slice(0,w).join(" ");s(T,!0),O[T]||(O[T]={preventDefault:!0,stopPropagation:!1,run:[k=>{let A=Oa={view:k,prefix:T,scope:o};return setTimeout(()=>{Oa==A&&(Oa=null)},nU),!0}]})}let b=_.join(" ");s(b,!1);let S=O[b]||(O[b]={preventDefault:!1,stopPropagation:!1,run:((g=(p=O._any)===null||p===void 0?void 0:p.run)===null||g===void 0?void 0:g.slice())||[]});c&&S.run.push(c),u&&(S.preventDefault=!0),d&&(S.stopPropagation=!0)};for(let o of t){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of l){let d=i[u]||(i[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=o;for(let g in d)d[g].run.push(O=>p(O,yb))}let c=o[e]||o.key;if(c)for(let u of l)r(u,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(u,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return i}let yb=null;function _B(t,e,i,n){yb=e;let s=Oq(e),r=Ln(s,0),o=gr(r)==s.length&&s!=" ",l="",c=!1,u=!1,d=!1;Oa&&Oa.view==i&&Oa.scope==n&&(l=Oa.prefix+" ",aB.indexOf(e.keyCode)<0&&(u=!0,Oa=null));let p=new Set,g=S=>{if(S){for(let w of S.run)if(!p.has(w)&&(p.add(w),w(i)))return S.stopPropagation&&(d=!0),!0;S.preventDefault&&(S.stopPropagation&&(d=!0),u=!0)}return!1},O=t[n],_,b;return O&&(g(O[l+rm(s,e,!o)])?c=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Se.windows&&e.ctrlKey&&e.altKey)&&!(Se.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(_=ka[e.keyCode])&&_!=s?(g(O[l+rm(_,e,!0)])||e.shiftKey&&(b=Rf[e.keyCode])!=s&&b!=_&&g(O[l+rm(b,e,!1)]))&&(c=!0):o&&e.shiftKey&&g(O[l+rm(s,e,!0)])&&(c=!0),!c&&g(O._any)&&(c=!0)),u&&(c=!0),c&&d&&e.stopPropagation(),yb=null,c}class dd{constructor(e,i,n,s,r){this.className=e,this.left=i,this.top=n,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,i){return i.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,i,n){if(n.empty){let s=e.coordsAtPos(n.head,n.assoc||1);if(!s)return[];let r=yB(e);return[new dd(i,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return rU(e,i,n)}}function yB(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==xt.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function OE(t,e,i,n){let s=t.coordsAtPos(e,i*2);if(!s)return n;let r=t.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,l=t.posAtCoords({x:r.left+1,y:o}),c=t.posAtCoords({x:r.right-1,y:o});return l==null||c==null?n:{from:Math.max(n.from,Math.min(l,c)),to:Math.min(n.to,Math.max(l,c))}}function rU(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];let n=Math.max(i.from,t.viewport.from),s=Math.min(i.to,t.viewport.to),r=t.textDirection==xt.LTR,o=t.contentDOM,l=o.getBoundingClientRect(),c=yB(t),u=o.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),p=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),g=l.right-(d?parseInt(d.paddingRight):0),O=pb(t,n,1),_=pb(t,s,-1),b=O.type==Ki.Text?O:null,S=_.type==Ki.Text?_:null;if(b&&(t.lineWrapping||O.widgetLineBreaks)&&(b=OE(t,n,1,b)),S&&(t.lineWrapping||_.widgetLineBreaks)&&(S=OE(t,s,-1,S)),b&&S&&b.from==S.from&&b.to==S.to)return T(k(i.from,i.to,b));{let R=b?k(i.from,null,b):A(O,!1),E=S?k(null,i.to,S):A(_,!0),$=[];return(b||O).to<(S||_).from-(b&&S?1:0)||O.widgetLineBreaks>1&&R.bottom+t.defaultLineHeight/2<E.top?$.push(w(p,R.bottom,g,E.top)):R.bottom<E.top&&t.elementAtHeight((R.bottom+E.top)/2).type==Ki.Text&&(R.bottom=E.top=(R.bottom+E.top)/2),T(R).concat($).concat(T(E))}function w(R,E,$,N){return new dd(e,R-c.left,E-c.top,Math.max(0,$-R),N-E)}function T({top:R,bottom:E,horizontal:$}){let N=[];for(let q=0;q<$.length;q+=2)N.push(w($[q],R,$[q+1],E));return N}function k(R,E,$){let N=1e9,q=-1e9,G=[];function U(z,j,B,Z,H){let F=t.coordsAtPos(z,z==$.to?-2:2),M=t.coordsAtPos(B,B==$.from?2:-2);!F||!M||(N=Math.min(F.top,M.top,N),q=Math.max(F.bottom,M.bottom,q),H==xt.LTR?G.push(r&&j?p:F.left,r&&Z?g:M.right):G.push(!r&&Z?p:M.left,!r&&j?g:F.right))}let Q=R??$.from,D=E??$.to;for(let z of t.visibleRanges)if(z.to>Q&&z.from<D)for(let j=Math.max(z.from,Q),B=Math.min(z.to,D);;){let Z=t.state.doc.lineAt(j);for(let H of t.bidiSpans(Z)){let F=H.from+Z.from,M=H.to+Z.from;if(F>=B)break;M>j&&U(Math.max(F,j),R==null&&F<=Q,Math.min(M,B),E==null&&M>=D,H.dir)}if(j=Z.to+1,j>=B)break}return G.length==0&&U(Q,R==null,D,E==null,t.textDirection),{top:N,bottom:q,horizontal:G}}function A(R,E){let $=l.top+(E?R.top:R.bottom);return{top:$,bottom:$,horizontal:[]}}}function oU(t,e){return t.constructor==e.constructor&&t.eq(e)}class aU{constructor(e,i){this.view=e,this.layer=i,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"),i.above&&this.dom.classList.add("cm-layer-above"),i.class&&this.dom.classList.add(i.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),i.mount&&i.mount(this.dom,e)}update(e){e.startState.facet(Xm)!=e.state.facet(Xm)&&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 i=0,n=e.facet(Xm);for(;i<n.length&&n[i]!=this.layer;)i++;this.dom.style.zIndex=String((this.layer.above?150:-1)-i)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:i}=this.view;(e!=this.scaleX||i!=this.scaleY)&&(this.scaleX=e,this.scaleY=i,this.dom.style.transform=`scale(${1/e}, ${1/i})`)}draw(e){if(e.length!=this.drawn.length||e.some((i,n)=>!oU(i,this.drawn[n]))){let i=this.dom.firstChild,n=0;for(let s of e)s.update&&i&&s.constructor&&this.drawn[n].constructor&&s.update(i,this.drawn[n])?(i=i.nextSibling,n++):this.dom.insertBefore(s.draw(),i);for(;i;){let s=i.nextSibling;i.remove(),i=s}this.drawn=e,Se.safari&&Se.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Xm=xe.define();function bB(t){return[Jt.define(e=>new aU(e,t)),Xm.of(t)]}const $f=xe.define({combine(t){return Lr(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,i)=>Math.min(e,i),drawRangeCursor:(e,i)=>e||i})}});function lU(t={}){return[$f.of(t),cU,hU,uU,UD.of(!0)]}function xB(t){return t.startState.facet($f)!=t.state.facet($f)}const cU=bB({above:!0,markers(t){let{state:e}=t,i=e.facet($f),n=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty||i.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:re.cursor(s.head,s.head>s.anchor?-1:1);for(let c of dd.forRange(t,o,l))n.push(c)}}return n},update(t,e){t.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let i=xB(t);return i&&vE(t.state,e),t.docChanged||t.selectionSet||i},mount(t,e){vE(e.state,t)},class:"cm-cursorLayer"});function vE(t,e){e.style.animationDuration=t.facet($f).cursorBlinkRate+"ms"}const hU=bB({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:dd.forRange(t,"cm-selectionBackground",e)).reduce((e,i)=>e.concat(i))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||xB(t)},class:"cm-selectionLayer"}),uU=wo.highest(ve.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"}}}})),SB=ze.define({map(t,e){return t==null?null:e.mapPos(t)}}),Ju=Bi.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((i,n)=>n.is(SB)?n.value:i,t)}}),fU=Jt.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let i=t.state.field(Ju);i==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"),(t.startState.field(Ju)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Ju),i=e!=null&&t.coordsAtPos(e);if(!i)return null;let n=t.scrollDOM.getBoundingClientRect();return{left:i.left-n.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-n.top+t.scrollDOM.scrollTop*t.scaleY,height:i.bottom-i.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:i}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/i+"px",this.cursor.style.height=t.height/i+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(Ju)!=t&&this.view.dispatch({effects:SB.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function dU(){return[Ju,fU]}function _E(t,e,i,n,s){e.lastIndex=0;for(let r=t.iterRange(i,n),o=i,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function pU(t,e){let i=t.visibleRanges;if(i.length==1&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;let n=[];for(let{from:s,to:r}of i)s=Math.max(t.state.doc.lineAt(s).from,s-e),r=Math.min(t.state.doc.lineAt(r).to,r+e),n.length&&n[n.length-1].to>=s?n[n.length-1].to=r:n.push({from:s,to:r});return n}class mU{constructor(e){const{regexp:i,decoration:n,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!i.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=i,s)this.addMatch=(l,c,u,d)=>s(d,u,u+l[0].length,l,c);else if(typeof n=="function")this.addMatch=(l,c,u,d)=>{let p=n(l,c,u);p&&d(u,u+l[0].length,p)};else if(n)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let i=new yo,n=i.add.bind(i);for(let{from:s,to:r}of pU(e,this.maxLength))_E(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,n));return i.finish()}updateDeco(e,i){let n=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,c)=>{c>=e.view.viewport.from&&l<=e.view.viewport.to&&(n=Math.min(l,n),s=Math.max(c,s))}),e.viewportMoved||s-n>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,i.map(e.changes),n,s):i}updateRange(e,i,n,s){for(let r of e.visibleRanges){let o=Math.max(r.from,n),l=Math.min(r.to,s);if(l>=o){let c=e.state.doc.lineAt(o),u=c.to<l?e.state.doc.lineAt(l):c,d=Math.max(r.from,c.from),p=Math.min(r.to,u.to);if(this.boundary){for(;o>c.from;o--)if(this.boundary.test(c.text[o-1-c.from])){d=o;break}for(;l<u.to;l++)if(this.boundary.test(u.text[l-u.from])){p=l;break}}let g=[],O,_=(b,S,w)=>g.push(w.range(b,S));if(c==u)for(this.regexp.lastIndex=d-c.from;(O=this.regexp.exec(c.text))&&O.index<p-c.from;)this.addMatch(O,e,O.index+c.from,_);else _E(e.state.doc,this.regexp,d,p,(b,S)=>this.addMatch(S,e,b,_));i=i.update({filterFrom:d,filterTo:p,filter:(b,S)=>b<d||S>p,add:g})}}return i}}const bb=/x/.unicode!=null?"gu":"g",gU=new RegExp(`[\0-\b
68
- --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,bb),OU={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 E_=null;function vU(){var t;if(E_==null&&typeof document<"u"&&document.body){let e=document.body.style;E_=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return E_||!1}const Zm=xe.define({combine(t){let e=Lr(t,{render:null,specialChars:gU,addSpecialChars:null});return(e.replaceTabs=!vU())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,bb)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,bb)),e}});function _U(t={}){return[Zm.of(t),yU()]}let yE=null;function yU(){return yE||(yE=Jt.fromClass(class{constructor(t){this.view=t,this.decorations=Pe.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Zm)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new mU({regexp:t.specialChars,decoration:(e,i,n)=>{let{doc:s}=i.state,r=Ln(e[0],0);if(r==9){let o=s.lineAt(n),l=i.state.tabSize,c=Ys(o.text,l,n-o.from);return Pe.replace({widget:new wU((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=Pe.replace({widget:new SU(t,r)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Zm);t.startState.facet(Zm)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const bU="•";function xU(t){return t>=32?bU:t==10?"␤":String.fromCharCode(9216+t)}class SU extends Gs{constructor(e,i){super(),this.options=e,this.code=i}eq(e){return e.code==this.code}toDOM(e){let i=xU(this.code),n=e.state.phrase("Control character")+" "+(OU[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,n,i);if(s)return s;let r=document.createElement("span");return r.textContent=i,r.title=n,r.setAttribute("aria-label",n),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class wU extends Gs{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 CU(){return TU}const kU=Pe.line({class:"cm-activeLine"}),TU=Jt.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,i=[];for(let n of t.state.selection.ranges){let s=t.lineBlockAt(n.head);s.from>e&&(i.push(kU.range(s.from)),e=s.from)}return Pe.set(i)}},{decorations:t=>t.decorations});class AU extends Gs{constructor(e){super(),this.content=e}toDOM(e){let i=document.createElement("span");return i.className="cm-placeholder",i.style.pointerEvents="none",i.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),i.setAttribute("aria-hidden","true"),i}coordsAt(e){let i=e.firstChild?mf(e.firstChild):[];if(!i.length)return null;let n=window.getComputedStyle(e.parentNode),s=Df(i[0],n.direction!="rtl"),r=parseInt(n.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function EU(t){let e=Jt.fromClass(class{constructor(i){this.view=i,this.placeholder=t?Pe.set([Pe.widget({widget:new AU(t),side:1}).range(0)]):Pe.none}get decorations(){return this.view.state.doc.length?Pe.none:this.placeholder}},{decorations:i=>i.decorations});return typeof t=="string"?[e,ve.contentAttributes.of({"aria-placeholder":t})]:e}const xb=2e3;function MU(t,e,i){let n=Math.min(e.line,i.line),s=Math.max(e.line,i.line),r=[];if(e.off>xb||i.off>xb||e.col<0||i.col<0){let o=Math.min(e.off,i.off),l=Math.max(e.off,i.off);for(let c=n;c<=s;c++){let u=t.doc.line(c);u.length<=l&&r.push(re.range(u.from+o,u.to+l))}}else{let o=Math.min(e.col,i.col),l=Math.max(e.col,i.col);for(let c=n;c<=s;c++){let u=t.doc.line(c),d=tb(u.text,o,t.tabSize,!0);if(d<0)r.push(re.cursor(u.to));else{let p=tb(u.text,l,t.tabSize);r.push(re.range(u.from+d,u.from+p))}}}return r}function PU(t,e){let i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1}function bE(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.state.doc.lineAt(i),s=i-n.from,r=s>xb?-1:s==n.length?PU(t,e.clientX):Ys(n.text,t.state.tabSize,i-n.from);return{line:n.number,col:r,off:s}}function RU(t,e){let i=bE(t,e),n=t.state.selection;return i?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(i.line).from),o=s.state.doc.lineAt(r);i={line:o.number,col:i.col,off:Math.min(i.off,o.length)},n=n.map(s.changes)}},get(s,r,o){let l=bE(t,s);if(!l)return n;let c=MU(t.state,i,l);return c.length?o?re.create(c.concat(n.ranges)):re.create(c):n}}:null}function QU(t){let e=(i=>i.altKey&&i.button==0);return ve.mouseSelectionStyle.of((i,n)=>e(n)?RU(i,n):null)}const LU={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},DU={style:"cursor: crosshair"};function BU(t={}){let[e,i]=LU[t.key||"Alt"],n=Jt.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||i(s))},keyup(s){(s.keyCode==e||!i(s))&&this.set(!1)},mousemove(s){this.set(i(s))}}});return[n,ve.contentAttributes.of(s=>{var r;return!((r=s.plugin(n))===null||r===void 0)&&r.isDown?DU:null})]}const om="-10000px";class wB{constructor(e,i,n,s){this.facet=i,this.createTooltipView=n,this.removeTooltipView=s,this.input=e.state.facet(i),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=n(o,r))}update(e,i){var n;let s=e.state.facet(this.facet),r=s.filter(c=>c);if(s===this.input){for(let c of this.tooltipViews)c.update&&c.update(e);return!1}let o=[],l=i?[]:null;for(let c=0;c<r.length;c++){let u=r[c],d=-1;if(u){for(let p=0;p<this.tooltips.length;p++){let g=this.tooltips[p];g&&g.create==u.create&&(d=p)}if(d<0)o[c]=this.createTooltipView(u,c?o[c-1]:null),l&&(l[c]=!!u.above);else{let p=o[c]=this.tooltipViews[d];l&&(l[c]=i[d]),p.update&&p.update(e)}}}for(let c of this.tooltipViews)o.indexOf(c)<0&&(this.removeTooltipView(c),(n=c.destroy)===null||n===void 0||n.call(c));return i&&(l.forEach((c,u)=>i[u]=c),i.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}}function $U(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const M_=xe.define({combine:t=>{var e,i,n;return{position:Se.ios?"absolute":((e=t.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((i=t.find(s=>s.parent))===null||i===void 0?void 0:i.parent)||null,tooltipSpace:((n=t.find(s=>s.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||$U}}}),xE=new WeakMap,ZS=Jt.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(M_);this.position=e.position,this.parent=e.parent,this.classes=t.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 wB(t,qS,(i,n)=>this.createTooltip(i,n),i=>{this.resizeObserver&&this.resizeObserver.unobserve(i.dom),i.dom.remove()}),this.above=this.manager.tooltips.map(i=>!!i.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(i=>{Date.now()>this.lastTransaction-50&&i.length>0&&i[i.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.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 t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let i=e||t.geometryChanged,n=t.state.facet(M_);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t,e){let i=t.create(this.view),n=e?e.dom:null;if(i.dom.classList.add("cm-tooltip"),t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",i.dom.appendChild(s)}return i.dom.style.position=this.position,i.dom.style.top=om,i.dom.style.left="0px",this.container.insertBefore(i.dom,n),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i}destroy(){var t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(t=n.destroy)===null||t===void 0||t.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(i=this.intersectionObserver)===null||i===void 0||i.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(Se.safari){let o=r.getBoundingClientRect();i=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else i=!!r.offsetParent&&r.offsetParent!=this.container.ownerDocument.body}if(i||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(t=r.width/this.parent.offsetWidth,e=r.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),s=jS(this.view);return{visible:{left:n.left+s.left,top:n.top+s.top,right:n.right-s.right,bottom:n.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(M_).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:i,space:n,scaleX:s,scaleY:r}=t,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let c=this.manager.tooltips[l],u=this.manager.tooltipViews[l],{dom:d}=u,p=t.pos[l],g=t.size[l];if(!p||c.clip!==!1&&(p.bottom<=Math.max(i.top,n.top)||p.top>=Math.min(i.bottom,n.bottom)||p.right<Math.max(i.left,n.left)-.1||p.left>Math.min(i.right,n.right)+.1)){d.style.top=om;continue}let O=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,_=O?7:0,b=g.right-g.left,S=(e=xE.get(u))!==null&&e!==void 0?e:g.bottom-g.top,w=u.offset||zU,T=this.view.textDirection==xt.LTR,k=g.width>n.right-n.left?T?n.left:n.right-g.width:T?Math.max(n.left,Math.min(p.left-(O?14:0)+w.x,n.right-b)):Math.min(Math.max(n.left,p.left-b+(O?14:0)-w.x),n.right-b),A=this.above[l];!c.strictSide&&(A?p.top-S-_-w.y<n.top:p.bottom+S+_+w.y>n.bottom)&&A==n.bottom-p.bottom>p.top-n.top&&(A=this.above[l]=!A);let R=(A?p.top-n.top:n.bottom-p.bottom)-_;if(R<S&&u.resize!==!1){if(R<this.view.defaultLineHeight){d.style.top=om;continue}xE.set(u,S),d.style.height=(S=R)/r+"px"}else d.style.height&&(d.style.height="");let E=A?p.top-S-_-w.y:p.bottom+_+w.y,$=k+b;if(u.overlap!==!0)for(let N of o)N.left<$&&N.right>k&&N.top<E+S&&N.bottom>E&&(E=A?N.top-S-2-_:N.bottom+_+2);if(this.position=="absolute"?(d.style.top=(E-t.parent.top)/r+"px",SE(d,(k-t.parent.left)/s)):(d.style.top=E/r+"px",SE(d,k/s)),O){let N=p.left+(T?w.x:-w.x)-(k+14-7);O.style.left=N/s+"px"}u.overlap!==!0&&o.push({left:k,top:E,right:$,bottom:E+S}),d.classList.toggle("cm-tooltip-above",A),d.classList.toggle("cm-tooltip-below",!A),u.positioned&&u.positioned(t.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 t of this.manager.tooltipViews)t.dom.style.top=om}},{eventObservers:{scroll(){this.maybeMeasure()}}});function SE(t,e){let i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px")}const NU=ve.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"}}}),zU={x:0,y:0},qS=xe.define({enables:[ZS,NU]}),Ag=xe.define({combine:t=>t.reduce((e,i)=>e.concat(i),[])});class gO{static create(e){return new gO(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new wB(e,Ag,(i,n)=>this.createHostedView(i,n),i=>i.dom.remove())}createHostedView(e,i){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,i?i.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let i of this.manager.tooltipViews)i.mount&&i.mount(e);this.mounted=!0}positioned(e){for(let i of this.manager.tooltipViews)i.positioned&&i.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let i of this.manager.tooltipViews)(e=i.destroy)===null||e===void 0||e.call(i)}passProp(e){let i;for(let n of this.manager.tooltipViews){let s=n[e];if(s!==void 0){if(i===void 0)i=s;else if(i!==s)return}}return i}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 jU=qS.compute([Ag],t=>{let e=t.facet(Ag);return e.length===0?null:{pos:Math.min(...e.map(i=>i.pos)),end:Math.max(...e.map(i=>{var n;return(n=i.end)!==null&&n!==void 0?n:i.pos})),create:gO.create,above:e[0].above,arrow:e.some(i=>i.arrow)}});class IU{constructor(e,i,n,s,r){this.view=e,this.source=i,this.field=n,this.setHover=s,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(){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:i}=this,n=e.docView.tile.nearest(i.target);if(!n)return;let s,r=1;if(n.isWidget())s=n.posAtStart;else{if(s=e.posAtCoords(i),s==null)return;let l=e.coordsAtPos(s);if(!l||i.y<l.top||i.y>l.bottom||i.x<l.left-e.defaultCharacterWidth||i.x>l.right+e.defaultCharacterWidth)return;let c=e.bidiSpans(e.state.doc.lineAt(s)).find(d=>d.from<=s&&d.to>=s),u=c&&c.dir==xt.RTL?-1:1;r=i.x<l.left?-u:u}let o=this.source(e,s,r);if(o!=null&&o.then){let l=this.pending={pos:s};o.then(c=>{this.pending==l&&(this.pending=null,c&&!(Array.isArray(c)&&!c.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(c)?c:[c])}))},c=>$n(e.state,c,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(ZS),i=e?e.manager.tooltips.findIndex(n=>n.create==gO.create):-1;return i>-1?e.manager.tooltipViews[i]:null}mousemove(e){var i,n;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:s,tooltip:r}=this;if(s.length&&r&&!VU(r.dom,e)||this.pending){let{pos:o}=s[0]||this.pending,l=(n=(i=s[0])===null||i===void 0?void 0:i.end)!==null&&n!==void 0?n:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!XU(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:i}=this;if(i.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let i=n=>{e.removeEventListener("mouseleave",i),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",i)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const am=4;function VU(t,e){let{left:i,right:n,top:s,bottom:r}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();s=Math.min(l.top,s),r=Math.max(l.bottom,r)}return e.clientX>=i-am&&e.clientX<=n+am&&e.clientY>=s-am&&e.clientY<=r+am}function XU(t,e,i,n,s,r){let o=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>n||o.right<n||o.top>s||Math.min(o.bottom,l)<s)return!1;let c=t.posAtCoords({x:n,y:s},!1);return c>=e&&c<=i}function ZU(t,e={}){let i=ze.define(),n=Bi.define({create(){return[]},update(s,r){if(s.length&&(e.hideOnChange&&(r.docChanged||r.selection)?s=[]:e.hideOn&&(s=s.filter(o=>!e.hideOn(r,o))),r.docChanged)){let o=[];for(let l of s){let c=r.changes.mapPos(l.pos,-1,Fi.TrackDel);if(c!=null){let u=Object.assign(Object.create(null),l);u.pos=c,u.end!=null&&(u.end=r.changes.mapPos(u.end)),o.push(u)}}s=o}for(let o of r.effects)o.is(i)&&(s=o.value),o.is(qU)&&(s=[]);return s},provide:s=>Ag.from(s)});return{active:n,extension:[n,Jt.define(s=>new IU(s,t,n,i,e.hoverTime||300)),jU]}}function CB(t,e){let i=t.plugin(ZS);if(!i)return null;let n=i.manager.tooltips.indexOf(e);return n<0?null:i.manager.tooltipViews[n]}const qU=ze.define(),wE=xe.define({combine(t){let e,i;for(let n of t)e=e||n.topContainer,i=i||n.bottomContainer;return{topContainer:e,bottomContainer:i}}});function WS(t,e){let i=t.plugin(kB),n=i?i.specs.indexOf(e):-1;return n>-1?i.panels[n]:null}const kB=Jt.fromClass(class{constructor(t){this.input=t.state.facet(Nf),this.specs=this.input.filter(i=>i),this.panels=this.specs.map(i=>i(t));let e=t.state.facet(wE);this.top=new lm(t,!0,e.topContainer),this.bottom=new lm(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(i=>i.top)),this.bottom.sync(this.panels.filter(i=>!i.top));for(let i of this.panels)i.dom.classList.add("cm-panel"),i.mount&&i.mount()}update(t){let e=t.state.facet(wE);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new lm(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new lm(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet(Nf);if(i!=this.input){let n=i.filter(c=>c),s=[],r=[],o=[],l=[];for(let c of n){let u=this.specs.indexOf(c),d;u<0?(d=c(t.view),l.push(d)):(d=this.panels[u],d.update&&d.update(t)),s.push(d),(d.top?r:o).push(d)}this.specs=n,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let n of this.panels)n.update&&n.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>ve.scrollMargins.of(e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}})});class lm{constructor(e,i,n){this.view=e,this.top=i,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let i of this.panels)i.destroy&&e.indexOf(i)<0&&i.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 i=this.container||this.view.dom;i.insertBefore(this.dom,this.top?i.firstChild:null)}let e=this.dom.firstChild;for(let i of this.panels)if(i.dom.parentNode==this.dom){for(;e!=i.dom;)e=CE(e);e=e.nextSibling}else this.dom.insertBefore(i.dom,e);for(;e;)e=CE(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 CE(t){let e=t.nextSibling;return t.remove(),e}const Nf=xe.define({enables:kB});function WU(t,e){let i,n=new Promise(o=>i=o),s=o=>UU(o,e,i);t.state.field(P_,!1)?t.dispatch({effects:TB.of(s)}):t.dispatch({effects:ze.appendConfig.of(P_.init(()=>[s]))});let r=AB.of(s);return{close:r,result:n.then(o=>((t.win.queueMicrotask||(c=>t.win.setTimeout(c,10)))(()=>{t.state.field(P_).indexOf(s)>-1&&t.dispatch({effects:r})}),o))}}const P_=Bi.define({create(){return[]},update(t,e){for(let i of e.effects)i.is(TB)?t=[i.value].concat(t):i.is(AB)&&(t=t.filter(n=>n!=i.value));return t},provide:t=>Nf.computeN([t],e=>e.field(t))}),TB=ze.define(),AB=ze.define();function UU(t,e,i){let n=e.content?e.content(t,()=>o(null)):null;if(!n){if(n=vt("form"),e.input){let l=vt("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),n.appendChild(vt("label",(e.label||"")+": ",l))}else n.appendChild(document.createTextNode(e.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild(vt("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let s=n.nodeName=="FORM"?[n]:n.querySelectorAll("form");for(let l=0;l<s.length;l++){let c=s[l];c.addEventListener("keydown",u=>{u.keyCode==27?(u.preventDefault(),o(null)):u.keyCode==13&&(u.preventDefault(),o(c))}),c.addEventListener("submit",u=>{u.preventDefault(),o(c)})}let r=vt("div",n,vt("button",{onclick:()=>o(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(r.className=e.class),r.classList.add("cm-dialog");function o(l){r.contains(r.ownerDocument.activeElement)&&t.focus(),i(l)}return{dom:r,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=n.querySelector(e.focus):l=n.querySelector("input")||n.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class xo extends wa{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}xo.prototype.elementClass="";xo.prototype.toDOM=void 0;xo.prototype.mapMode=Fi.TrackBefore;xo.prototype.startSide=xo.prototype.endSide=-1;xo.prototype.point=!0;const qm=xe.define(),YU=xe.define(),HU={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ge.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},vf=xe.define();function FU(t){return[EB(),vf.of({...HU,...t})]}const kE=xe.define({combine:t=>t.some(e=>e)});function EB(t){return[GU]}const GU=Jt.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.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=t.state.facet(vf).map(e=>new AE(t,e)),this.fixed=!t.state.facet(kE);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),t.scrollDOM.insertBefore(this.dom,t.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(t){if(this.updateGutters(t)){let e=this.prevViewport,i=t.view.viewport,n=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(n<(i.to-i.from)*.8)}if(t.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(kE)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let i=Ge.iter(this.view.state.facet(qm),this.view.viewport.from),n=[],s=this.gutters.map(r=>new KU(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==Ki.Text&&o){Sb(i,n,l.from);for(let c of s)c.line(this.view,l,n);o=!1}else if(l.widget)for(let c of s)c.widget(this.view,l)}else if(r.type==Ki.Text){Sb(i,n,r.from);for(let o of s)o.line(this.view,r,n)}else if(r.widget)for(let o of s)o.widget(this.view,r);for(let r of s)r.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(vf),i=t.state.facet(vf),n=t.docChanged||t.heightChanged||t.viewportChanged||!Ge.eq(t.startState.facet(qm),t.state.facet(qm),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let s of this.gutters)s.update(t)&&(n=!0);else{n=!0;let s=[];for(let r of i){let o=e.indexOf(r);o<0?s.push(new AE(this.view,r)):(this.gutters[o].update(t),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)r.config.side=="after"?this.getDOMAfter().appendChild(r.dom):this.dom.appendChild(r.dom);this.gutters=s}return n}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>ve.scrollMargins.of(e=>{let i=e.plugin(t);if(!i||i.gutters.length==0||!i.fixed)return null;let n=i.dom.offsetWidth*e.scaleX,s=i.domAfter?i.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==xt.LTR?{left:n,right:s}:{right:n,left:s}})});function TE(t){return Array.isArray(t)?t:[t]}function Sb(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class KU{constructor(e,i,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Ge.iter(e.markers,i.from)}addElement(e,i,n){let{gutter:s}=this,r=(i.top-this.height)/e.scaleY,o=i.height/e.scaleY;if(this.i==s.elements.length){let l=new MB(e,o,r,n);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,o,r,n);this.height=i.bottom,this.i++}line(e,i,n){let s=[];Sb(this.cursor,s,i.from),n.length&&(s=s.concat(n));let r=this.gutter.config.lineMarker(e,i,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,i,s)}widget(e,i){let n=this.gutter.config.widgetMarker(e,i.widget,i),s=n?[n]:null;for(let r of e.state.facet(YU)){let o=r(e,i.widget,i);o&&(s||(s=[])).push(o)}s&&this.addElement(e,i,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let i=e.elements.pop();e.dom.removeChild(i.dom),i.destroy()}}}class AE{constructor(e,i){this.view=e,this.config=i,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in i.domEventHandlers)this.dom.addEventListener(n,s=>{let r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let c=r.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=s.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);i.domEventHandlers[n](e,l,s)&&s.preventDefault()});this.markers=TE(i.markers(e)),i.initialSpacer&&(this.spacer=new MB(e,0,0,[i.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let i=this.markers;if(this.markers=TE(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let n=e.view.viewport;return!Ge.eq(this.markers,i,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class MB{constructor(e,i,n,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,i,n,s)}update(e,i,n,s){this.height!=i&&(this.height=i,this.dom.style.height=i+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),JU(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,i){let n="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,c=r<i.length?i[r++]:null,u=!1;if(c){let d=c.elementClass;d&&(n+=" "+d);for(let p=o;p<this.markers.length;p++)if(this.markers[p].compare(c)){l=p,u=!0;break}}else l=this.markers.length;for(;o<l;){let d=this.markers[o++];if(d.toDOM){d.destroy(s);let p=s.nextSibling;s.remove(),s=p}}if(!c)break;c.toDOM&&(u?s=s.nextSibling:this.dom.insertBefore(c.toDOM(e),s)),u&&o++}this.dom.className=n,this.markers=i}destroy(){this.setMarkers(null,[])}}function JU(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].compare(e[i]))return!1;return!0}const eY=xe.define(),tY=xe.define(),jc=xe.define({combine(t){return Lr(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,i){let n=Object.assign({},e);for(let s in i){let r=n[s],o=i[s];n[s]=r?(l,c,u)=>r(l,c,u)||o(l,c,u):o}return n}})}});class R_ extends xo{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Q_(t,e){return t.state.facet(jc).formatNumber(e,t.state)}const iY=vf.compute([jc],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(eY)},lineMarker(e,i,n){return n.some(s=>s.toDOM)?null:new R_(Q_(e,e.state.doc.lineAt(i.from).number))},widgetMarker:(e,i,n)=>{for(let s of e.state.facet(tY)){let r=s(e,i,n);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(jc)!=e.state.facet(jc),initialSpacer(e){return new R_(Q_(e,EE(e.state.doc.lines)))},updateSpacer(e,i){let n=Q_(i.view,EE(i.view.state.doc.lines));return n==e.number?e:new R_(n)},domEventHandlers:t.facet(jc).domEventHandlers,side:"before"}));function nY(t={}){return[jc.of(t),EB(),iY]}function EE(t){let e=9;for(;e<t;)e=e*10+9;return e}const sY=new class extends xo{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},rY=qm.compute(["selection"],t=>{let e=[],i=-1;for(let n of t.selection.ranges){let s=t.doc.lineAt(n.head).from;s>i&&(i=s,e.push(sY.range(s)))}return Ge.of(e)});function oY(){return rY}const PB=1024;let aY=0;class Ts{constructor(e,i){this.from=e,this.to=i}}class je{constructor(e={}){this.id=aY++,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=_i.match(e)),i=>{let n=e(i);return n===void 0?null:[this,n]}}}je.closedBy=new je({deserialize:t=>t.split(" ")});je.openedBy=new je({deserialize:t=>t.split(" ")});je.group=new je({deserialize:t=>t.split(" ")});je.isolate=new je({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});je.contextHash=new je({perNode:!0});je.lookAhead=new je({perNode:!0});je.mounted=new je({perNode:!0});class Fc{constructor(e,i,n,s=!1){this.tree=e,this.overlay=i,this.parser=n,this.bracketed=s}static get(e){return e&&e.props&&e.props[je.mounted.id]}}const lY=Object.create(null);class _i{constructor(e,i,n,s=0){this.name=e,this.props=i,this.id=n,this.flags=s}static define(e){let i=e.props&&e.props.length?Object.create(null):lY,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new _i(e.name||"",i,e.id,n);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");i[r[0].id]=r[1]}}return s}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 i=this.prop(je.group);return i?i.indexOf(e)>-1:!1}return this.id==e}static match(e){let i=Object.create(null);for(let n in e)for(let s of n.split(" "))i[s]=e[n];return n=>{for(let s=n.prop(je.group),r=-1;r<(s?s.length:0);r++){let o=i[r<0?n.name:s[r]];if(o)return o}}}}_i.none=new _i("",Object.create(null),0,8);class pd{constructor(e){this.types=e;for(let i=0;i<e.length;i++)if(e[i].id!=i)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let i=[];for(let n of this.types){let s=null;for(let r of e){let o=r(n);if(o){s||(s=Object.assign({},n.props));let l=o[1],c=o[0];c.combine&&c.id in s&&(l=c.combine(s[c.id],l)),s[c.id]=l}}i.push(s?new _i(n.name,s,n.id,n.flags):n)}return new pd(i)}}const cm=new WeakMap,ME=new WeakMap;var ut;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(ut||(ut={}));class ct{constructor(e,i,n,s,r){if(this.type=e,this.children=i,this.positions=n,this.length=s,this.props=null,r&&r.length){this.props=Object.create(null);for(let[o,l]of r)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=Fc.get(this);if(e&&!e.overlay)return e.tree.toString();let i="";for(let n of this.children){let s=n.toString();s&&(i&&(i+=","),i+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(i.length?"("+i+")":""):i}cursor(e=0){return new Eg(this.topNode,e)}cursorAt(e,i=0,n=0){let s=cm.get(this)||this.topNode,r=new Eg(s);return r.moveTo(e,i),cm.set(this,r._tree),r}get topNode(){return new on(this,0,0,null)}resolve(e,i=0){let n=zf(cm.get(this)||this.topNode,e,i,!1);return cm.set(this,n),n}resolveInner(e,i=0){let n=zf(ME.get(this)||this.topNode,e,i,!0);return ME.set(this,n),n}resolveStack(e,i=0){return uY(this,e,i)}iterate(e){let{enter:i,leave:n,from:s=0,to:r=this.length}=e,o=e.mode||0,l=(o&ut.IncludeAnonymous)>0;for(let c=this.cursor(o|ut.IncludeAnonymous);;){let u=!1;if(c.from<=r&&c.to>=s&&(!l&&c.type.isAnonymous||i(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&n&&(l||!c.type.isAnonymous)&&n(c),!c.nextSibling();){if(!c.parent())return;u=!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 i in this.props)e.push([+i,this.props[i]]);return e}balance(e={}){return this.children.length<=8?this:HS(_i.none,this.children,this.positions,0,this.children.length,0,this.length,(i,n,s)=>new ct(this.type,i,n,s,this.propValues),e.makeTree||((i,n,s)=>new ct(_i.none,i,n,s)))}static build(e){return fY(e)}}ct.empty=new ct(_i.none,[],[],0);class US{constructor(e,i){this.buffer=e,this.index=i}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 US(this.buffer,this.index)}}class Aa{constructor(e,i,n){this.buffer=e,this.length=i,this.set=n}get type(){return _i.none}toString(){let e=[];for(let i=0;i<this.buffer.length;)e.push(this.childString(i)),i=this.buffer[i+3];return e.join(",")}childString(e){let i=this.buffer[e],n=this.buffer[e+3],s=this.set.types[i],r=s.name;if(/\W/.test(r)&&!s.isError&&(r=JSON.stringify(r)),e+=4,n==e)return r;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return r+"("+o.join(",")+")"}findChild(e,i,n,s,r){let{buffer:o}=this,l=-1;for(let c=e;c!=i&&!(RB(r,s,o[c+1],o[c+2])&&(l=c,n>0));c=o[c+3]);return l}slice(e,i,n){let s=this.buffer,r=new Uint16Array(i-e),o=0;for(let l=e,c=0;l<i;){r[c++]=s[l++],r[c++]=s[l++]-n;let u=r[c++]=s[l++]-n;r[c++]=s[l++]-e,o=Math.max(o,u)}return new Aa(r,o,this.set)}}function RB(t,e,i,n){switch(t){case-2:return i<e;case-1:return n>=e&&i<e;case 0:return i<e&&n>e;case 1:return i<=e&&n>e;case 2:return n>e;case 4:return!0}}function zf(t,e,i,n){for(var s;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to<e);){let o=!n&&t instanceof on&&t.index<0?null:t.parent;if(!o)return t;t=o}let r=n?0:ut.IgnoreOverlays;if(n)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof on&&o.index<0&&((s=l.enter(e,i,r))===null||s===void 0?void 0:s.from)!=o.from&&(t=l);for(;;){let o=t.enter(e,i,r);if(!o)return t;t=o}}class QB{cursor(e=0){return new Eg(this,e)}getChild(e,i=null,n=null){let s=PE(this,e,i,n);return s.length?s[0]:null}getChildren(e,i=null,n=null){return PE(this,e,i,n)}resolve(e,i=0){return zf(this,e,i,!1)}resolveInner(e,i=0){return zf(this,e,i,!0)}matchContext(e){return wb(this.parent,e)}enterUnfinishedNodesBefore(e){let i=this.childBefore(e),n=this;for(;i;){let s=i.lastChild;if(!s||s.to!=i.to)break;s.type.isError&&s.from==s.to?(n=i,i=s.prevSibling):i=s}return n}get node(){return this}get next(){return this.parent}}class on extends QB{constructor(e,i,n,s){super(),this._tree=e,this.from=i,this.index=n,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,i,n,s,r=0){for(let o=this;;){for(let{children:l,positions:c}=o._tree,u=i>0?l.length:-1;e!=u;e+=i){let d=l[e],p=c[e]+o.from,g;if(!(!(r&ut.EnterBracketed&&d instanceof ct&&(g=Fc.get(d))&&!g.overlay&&g.bracketed&&n>=p&&n<=p+d.length)&&!RB(s,n,p,p+d.length))){if(d instanceof Aa){if(r&ut.ExcludeBuffers)continue;let O=d.findChild(0,d.buffer.length,i,n-p,s);if(O>-1)return new yr(new cY(o,d,e,p),null,O)}else if(r&ut.IncludeAnonymous||!d.type.isAnonymous||YS(d)){let O;if(!(r&ut.IgnoreMounts)&&(O=Fc.get(d))&&!O.overlay)return new on(O.tree,p,e,o);let _=new on(d,p,e,o);return r&ut.IncludeAnonymous||!_.type.isAnonymous?_:_.nextChild(i<0?d.children.length-1:0,i,n,s,r)}}}if(r&ut.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+i:e=i<0?-1:o._parent._tree.children.length,o=o._parent,!o))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,i,n=0){let s;if(!(n&ut.IgnoreOverlays)&&(s=Fc.get(this._tree))&&s.overlay){let r=e-this.from,o=n&ut.EnterBracketed&&s.bracketed;for(let{from:l,to:c}of s.overlay)if((i>0||o?l<=r:l<r)&&(i<0||o?c>=r:c>r))return new on(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,i,n)}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 PE(t,e,i,n){let s=t.cursor(),r=[];if(!s.firstChild())return r;if(i!=null){for(let o=!1;!o;)if(o=s.type.is(i),!s.nextSibling())return r}for(;;){if(n!=null&&s.type.is(n))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return n==null?r:[]}}function wb(t,e,i=e.length-1){for(let n=t;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[i]&&e[i]!=n.name)return!1;i--}}return!0}class cY{constructor(e,i,n,s){this.parent=e,this.buffer=i,this.index=n,this.start=s}}class yr extends QB{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,i,n){super(),this.context=e,this._parent=i,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,i,n){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,i-this.context.start,n);return r<0?null:new yr(this.context,this,r)}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,i,n=0){if(n&ut.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],i>0?1:-1,e-this.context.start,i);return r<0?null:new yr(this.context,this,r)}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,i=e.buffer[this.index+3];return i<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new yr(this.context,this._parent,i):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,i=this._parent?this._parent.index+4:0;return this.index==i?this.externalSibling(-1):new yr(this.context,this._parent,e.findChild(i,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],i=[],{buffer:n}=this.context,s=this.index+4,r=n.buffer[this.index+3];if(r>s){let o=n.buffer[this.index+1];e.push(n.slice(s,r,o)),i.push(0)}return new ct(this.type,e,i,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function LB(t){if(!t.length)return null;let e=0,i=t[0];for(let r=1;r<t.length;r++){let o=t[r];(o.from>i.from||o.to<i.to)&&(i=o,e=r)}let n=i instanceof on&&i.index<0?null:i.parent,s=t.slice();return n?s[e]=n:s.splice(e,1),new hY(s,i)}class hY{constructor(e,i){this.heads=e,this.node=i}get next(){return LB(this.heads)}}function uY(t,e,i){let n=t.resolveInner(e,i),s=null;for(let r=n instanceof on?n:n.context.parent;r;r=r.parent)if(r.index<0){let o=r.parent;(s||(s=[n])).push(o.resolve(e,i)),r=o}else{let o=Fc.get(r.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new on(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[n])).push(zf(l,e,i,!1))}}return s?LB(s):n}class Eg{get name(){return this.type.name}constructor(e,i=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=i&~ut.EnterBracketed,e instanceof on)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.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,i){this.index=e;let{start:n,buffer:s}=this.buffer;return this.type=i||s.set.types[s.buffer[e]],this.from=n+s.buffer[e+1],this.to=n+s.buffer[e+2],!0}yield(e){return e?e instanceof on?(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,i,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,i,n,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,i-this.buffer.start,n);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}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,i,n=this.mode){return this.buffer?n&ut.ExcludeBuffers?!1:this.enterChild(1,e,i):this.yield(this._tree.enter(e,i,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ut.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ut.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:i}=this.buffer,n=this.stack.length-1;if(e<0){let s=n<0?0:this.stack[n]+4;if(this.index!=s)return this.yieldBuf(i.findChild(s,this.index,-1,0,4))}else{let s=i.buffer[this.index+3];if(s<(n<0?i.buffer.length:i.buffer[this.stack[n]+3]))return this.yieldBuf(s)}return n<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 i,n,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let r=0;r<this.index;r++)if(s.buffer.buffer[r+3]<this.index)return!1;({index:i,parent:n}=s)}else({index:i,_parent:n}=this._tree);for(;n;{index:i,_parent:n}=n)if(i>-1)for(let r=i+e,o=e<0?-1:n._tree.children.length;r!=o;r+=e){let l=n._tree.children[r];if(this.mode&ut.IncludeAnonymous||l instanceof Aa||!l.type.isAnonymous||YS(l))return!1}return!0}move(e,i){if(i&&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,i=0){for(;(this.from==this.to||(i<1?this.from>=e:this.from>e)||(i>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,i););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,i=null,n=0;if(e&&e.context==this.buffer)e:for(let s=this.index,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;i=o,n=r+1;break e}s=this.stack[--r]}for(let s=n;s<this.stack.length;s++)i=new yr(this.buffer,i,this.stack[s]);return this.bufferNode=new yr(this.buffer,i,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,i){for(let n=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&i&&i(this),s=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,s=!0}}}matchContext(e){if(!this.buffer)return wb(this.node.parent,e);let{buffer:i}=this.buffer,{types:n}=i.set;for(let s=e.length-1,r=this.stack.length-1;s>=0;r--){if(r<0)return wb(this._tree,e,s);let o=n[i.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function YS(t){return t.children.some(e=>e instanceof Aa||!e.type.isAnonymous||YS(e))}function fY(t){var e;let{buffer:i,nodeSet:n,maxBufferLength:s=PB,reused:r=[],minRepeatType:o=n.types.length}=t,l=Array.isArray(i)?new US(i,i.length):i,c=n.types,u=0,d=0;function p(R,E,$,N,q,G){let{id:U,start:Q,end:D,size:z}=l,j=d,B=u;if(z<0)if(l.next(),z==-1){let V=r[U];$.push(V),N.push(Q-R);return}else if(z==-3){u=U;return}else if(z==-4){d=U;return}else throw new RangeError(`Unrecognized record size: ${z}`);let Z=c[U],H,F,M=Q-R;if(D-Q<=s&&(F=S(l.pos-E,q))){let V=new Uint16Array(F.size-F.skip),J=l.pos-F.size,L=V.length;for(;l.pos>J;)L=w(F.start,V,L);H=new Aa(V,D-F.start,n),M=F.start-R}else{let V=l.pos-z;l.next();let J=[],L=[],ue=U>=o?U:-1,he=0,fe=D;for(;l.pos>V;)ue>=0&&l.id==ue&&l.size>=0?(l.end<=fe-s&&(_(J,L,Q,he,l.end,fe,ue,j,B),he=J.length,fe=l.end),l.next()):G>2500?g(Q,V,J,L):p(Q,V,J,L,ue,G+1);if(ue>=0&&he>0&&he<J.length&&_(J,L,Q,he,Q,fe,ue,j,B),J.reverse(),L.reverse(),ue>-1&&he>0){let Oe=O(Z,B);H=HS(Z,J,L,0,J.length,0,D-Q,Oe,Oe)}else H=b(Z,J,L,D-Q,j-D,B)}$.push(H),N.push(M)}function g(R,E,$,N){let q=[],G=0,U=-1;for(;l.pos>E;){let{id:Q,start:D,end:z,size:j}=l;if(j>4)l.next();else{if(U>-1&&D<U)break;U<0&&(U=z-s),q.push(Q,D,z),G++,l.next()}}if(G){let Q=new Uint16Array(G*4),D=q[q.length-2];for(let z=q.length-3,j=0;z>=0;z-=3)Q[j++]=q[z],Q[j++]=q[z+1]-D,Q[j++]=q[z+2]-D,Q[j++]=j;$.push(new Aa(Q,q[2]-D,n)),N.push(D-R)}}function O(R,E){return($,N,q)=>{let G=0,U=$.length-1,Q,D;if(U>=0&&(Q=$[U])instanceof ct){if(!U&&Q.type==R&&Q.length==q)return Q;(D=Q.prop(je.lookAhead))&&(G=N[U]+Q.length+D)}return b(R,$,N,q,G,E)}}function _(R,E,$,N,q,G,U,Q,D){let z=[],j=[];for(;R.length>N;)z.push(R.pop()),j.push(E.pop()+$-q);R.push(b(n.types[U],z,j,G-q,Q-G,D)),E.push(q-$)}function b(R,E,$,N,q,G,U){if(G){let Q=[je.contextHash,G];U=U?[Q].concat(U):[Q]}if(q>25){let Q=[je.lookAhead,q];U=U?[Q].concat(U):[Q]}return new ct(R,E,$,N,U)}function S(R,E){let $=l.fork(),N=0,q=0,G=0,U=$.end-s,Q={size:0,start:0,skip:0};e:for(let D=$.pos-R;$.pos>D;){let z=$.size;if($.id==E&&z>=0){Q.size=N,Q.start=q,Q.skip=G,G+=4,N+=4,$.next();continue}let j=$.pos-z;if(z<0||j<D||$.start<U)break;let B=$.id>=o?4:0,Z=$.start;for($.next();$.pos>j;){if($.size<0)if($.size==-3||$.size==-4)B+=4;else break e;else $.id>=o&&(B+=4);$.next()}q=Z,N+=z,G+=B}return(E<0||N==R)&&(Q.size=N,Q.start=q,Q.skip=G),Q.size>4?Q:void 0}function w(R,E,$){let{id:N,start:q,end:G,size:U}=l;if(l.next(),U>=0&&N<o){let Q=$;if(U>4){let D=l.pos-(U-4);for(;l.pos>D;)$=w(R,E,$)}E[--$]=Q,E[--$]=G-R,E[--$]=q-R,E[--$]=N}else U==-3?u=N:U==-4&&(d=N);return $}let T=[],k=[];for(;l.pos>0;)p(t.start||0,t.bufferStart||0,T,k,-1,0);let A=(e=t.length)!==null&&e!==void 0?e:T.length?k[0]+T[0].length:0;return new ct(c[t.topID],T.reverse(),k.reverse(),A)}const RE=new WeakMap;function Wm(t,e){if(!t.isAnonymous||e instanceof Aa||e.type!=t)return 1;let i=RE.get(e);if(i==null){i=1;for(let n of e.children){if(n.type!=t||!(n instanceof ct)){i=1;break}i+=Wm(t,n)}RE.set(e,i)}return i}function HS(t,e,i,n,s,r,o,l,c){let u=0;for(let _=n;_<s;_++)u+=Wm(t,e[_]);let d=Math.ceil(u*1.5/8),p=[],g=[];function O(_,b,S,w,T){for(let k=S;k<w;){let A=k,R=b[k],E=Wm(t,_[k]);for(k++;k<w;k++){let $=Wm(t,_[k]);if(E+$>=d)break;E+=$}if(k==A+1){if(E>d){let $=_[A];O($.children,$.positions,0,$.children.length,b[A]+T);continue}p.push(_[A])}else{let $=b[k-1]+_[k-1].length-R;p.push(HS(t,_,b,A,k,R,$,null,c))}g.push(R+T-r)}}return O(e,i,n,s,0),(l||c)(p,g,o)}class DB{constructor(){this.map=new WeakMap}setBuffer(e,i,n){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(i,n)}getBuffer(e,i){let n=this.map.get(e);return n&&n.get(i)}set(e,i){e instanceof yr?this.setBuffer(e.context.buffer,e.index,i):e instanceof on&&this.map.set(e.tree,i)}get(e){return e instanceof yr?this.getBuffer(e.context.buffer,e.index):e instanceof on?this.map.get(e.tree):void 0}cursorSet(e,i){e.buffer?this.setBuffer(e.buffer.buffer,e.index,i):this.map.set(e.tree,i)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Oo{constructor(e,i,n,s,r=!1,o=!1){this.from=e,this.to=i,this.tree=n,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,i=[],n=!1){let s=[new Oo(0,e.length,e,0,!1,n)];for(let r of i)r.to>e.length&&s.push(r);return s}static applyChanges(e,i,n=128){if(!i.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,c=0,u=0;;l++){let d=l<i.length?i[l]:null,p=d?d.fromA:1e9;if(p-c>=n)for(;o&&o.from<p;){let g=o;if(c>=g.from||p<=g.to||u){let O=Math.max(g.from,c)-u,_=Math.min(g.to,p)-u;g=O>=_?null:new Oo(O,_,g.tree,g.offset+u,l>0,!!d)}if(g&&s.push(g),o.to>p)break;o=r<e.length?e[r++]:null}if(!d)break;c=d.toA,u=d.toA-d.toB}return s}}class FS{startParse(e,i,n){return typeof e=="string"&&(e=new dY(e)),n=n?n.length?n.map(s=>new Ts(s.from,s.to)):[new Ts(0,0)]:[new Ts(0,e.length)],this.createParse(e,i||[],n)}parse(e,i,n){let s=this.startParse(e,i,n);for(;;){let r=s.advance();if(r)return r}}}class dY{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,i){return this.string.slice(e,i)}}function BB(t){return(e,i,n,s)=>new mY(e,t,i,n,s)}class QE{constructor(e,i,n,s,r,o){this.parser=e,this.parse=i,this.overlay=n,this.bracketed=s,this.target=r,this.from=o}}function LE(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class pY{constructor(e,i,n,s,r,o,l,c){this.parser=e,this.predicate=i,this.mounts=n,this.index=s,this.start=r,this.bracketed=o,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const Cb=new je({perNode:!0});class mY{constructor(e,i,n,s,r){this.nest=i,this.input=n,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new ct(n.type,n.children,n.positions,n.length,n.propValues.concat([[Cb,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],i=e.parse.advance();if(i){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[je.mounted.id]=new Fc(i,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].from<e&&(e=Math.min(e,this.inner[i].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].parse.stopAt(e)}startInner(){let e=new vY(this.fragments),i=null,n=null,s=new Eg(new on(this.baseTree,this.ranges[0].from,0,null),ut.IncludeAnonymous|ut.IgnoreMounts);e:for(let r,o;;){let l=!0,c;if(this.stoppedAt!=null&&s.from>=this.stoppedAt)l=!1;else if(e.hasNode(s)){if(i){let u=i.mounts.find(d=>d.frag.from<=s.from&&d.frag.to>=s.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let p=d.from+u.pos,g=d.to+u.pos;p>=s.from&&g<=s.to&&!i.ranges.some(O=>O.from<g&&O.to>p)&&i.ranges.push({from:p,to:g})}}l=!1}else if(n&&(o=gY(n.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&(r=this.nest(s,this.input))&&(s.from<s.to||!r.overlay)){s.tree||(OY(s),i&&i.depth++,n&&n.depth++);let u=e.findMounts(s.from,r.parser);if(typeof r.overlay=="function")i=new pY(r.parser,r.overlay,u,this.inner.length,s.from,!!r.bracketed,s.tree,i);else{let d=$E(this.ranges,r.overlay||(s.from<s.to?[new Ts(s.from,s.to)]:[]));d.length&&LE(d),(d.length||!r.overlay)&&this.inner.push(new QE(r.parser,d.length?r.parser.startParse(this.input,NE(u,d),d):r.parser.startParse(""),r.overlay?r.overlay.map(p=>new Ts(p.from-s.from,p.to-s.from)):null,!!r.bracketed,s.tree,d.length?d[0].from:s.from)),r.overlay?d.length&&(n={ranges:d,depth:0,prev:n}):l=!1}}else if(i&&(c=i.predicate(s))&&(c===!0&&(c=new Ts(s.from,s.to)),c.from<c.to)){let u=i.ranges.length-1;u>=0&&i.ranges[u].to==c.from?i.ranges[u]={from:i.ranges[u].from,to:c.to}:i.ranges.push(c)}if(l&&s.firstChild())i&&i.depth++,n&&n.depth++;else for(;!s.nextSibling();){if(!s.parent())break e;if(i&&!--i.depth){let u=$E(this.ranges,i.ranges);u.length&&(LE(u),this.inner.splice(i.index,0,new QE(i.parser,i.parser.startParse(this.input,NE(i.mounts,u),u),i.ranges.map(d=>new Ts(d.from-i.start,d.to-i.start)),i.bracketed,i.target,u[0].from))),i=i.prev}n&&!--n.depth&&(n=n.prev)}}}}function gY(t,e,i){for(let n of t){if(n.from>=i)break;if(n.to>e)return n.from<=e&&n.to>=i?2:1}return 0}function DE(t,e,i,n,s,r){if(e<i){let o=t.buffer[e+1];n.push(t.slice(e,i,o)),s.push(o-r)}}function OY(t){let{node:e}=t,i=[],n=e.context.buffer;do i.push(t.index),t.parent();while(!t.tree);let s=t.tree,r=s.children.indexOf(n),o=s.children[r],l=o.buffer,c=[r];function u(d,p,g,O,_,b){let S=i[b],w=[],T=[];DE(o,d,S,w,T,O);let k=l[S+1],A=l[S+2];c.push(w.length);let R=b?u(S+4,l[S+3],o.set.types[l[S]],k,A-k,b-1):e.toTree();return w.push(R),T.push(k-O),DE(o,l[S+3],p,w,T,O),new ct(g,w,T,_)}s.children[r]=u(0,l.length,_i.none,0,o.length,i.length-1);for(let d of c){let p=t.tree.children[d],g=t.tree.positions[d];t.yield(new on(p,g+t.from,d,t._tree))}}class BE{constructor(e,i){this.offset=i,this.done=!1,this.cursor=e.cursor(ut.IncludeAnonymous|ut.IgnoreMounts)}moveTo(e){let{cursor:i}=this,n=e-this.offset;for(;!this.done&&i.from<n;)i.to>=e&&i.enter(n,1,ut.IgnoreOverlays|ut.ExcludeBuffers)||i.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let i=this.cursor.tree;;){if(i==e.tree)return!0;if(i.children.length&&i.positions[0]==0&&i.children[0]instanceof ct)i=i.children[0];else break}return!1}}let vY=class{constructor(e){var i;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(i=n.tree.prop(Cb))!==null&&i!==void 0?i:n.to,this.inner=new BE(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let i=this.curFrag=this.fragments[this.fragI];this.curTo=(e=i.tree.prop(Cb))!==null&&e!==void 0?e:i.to,this.inner=new BE(i.tree,-i.offset)}}findMounts(e,i){var n;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(n=r.tree)===null||n===void 0?void 0:n.prop(je.mounted);if(o&&o.parser==i)for(let l=this.fragI;l<this.fragments.length;l++){let c=this.fragments[l];if(c.from>=r.to)break;c.tree==this.curFrag.tree&&s.push({frag:c,pos:r.from-c.offset,mount:o})}}}return s}};function $E(t,e){let i=null,n=e;for(let s=1,r=0;s<t.length;s++){let o=t[s-1].to,l=t[s].from;for(;r<n.length;r++){let c=n[r];if(c.from>=l)break;c.to<=o||(i||(n=i=e.slice()),c.from<o?(i[r]=new Ts(c.from,o),c.to>l&&i.splice(r+1,0,new Ts(l,c.to))):c.to>l?i[r--]=new Ts(l,c.to):i.splice(r--,1))}}return n}function _Y(t,e,i,n){let s=0,r=0,o=!1,l=!1,c=-1e9,u=[];for(;;){let d=s==t.length?1e9:o?t[s].to:t[s].from,p=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let g=Math.max(c,i),O=Math.min(d,p,n);g<O&&u.push(new Ts(g,O))}if(c=Math.min(d,p),c==1e9)break;d==c&&(o?(o=!1,s++):o=!0),p==c&&(l?(l=!1,r++):l=!0)}return u}function NE(t,e){let i=[];for(let{pos:n,mount:s,frag:r}of t){let o=n+(s.overlay?s.overlay[0].from:0),l=o+s.tree.length,c=Math.max(r.from,o),u=Math.min(r.to,l);if(s.overlay){let d=s.overlay.map(g=>new Ts(g.from+n,g.to+n)),p=_Y(e,d,c,u);for(let g=0,O=c;;g++){let _=g==p.length,b=_?u:p[g].from;if(b>O&&i.push(new Oo(O,b,s.tree,-o,r.from>=O||r.openStart,r.to<=b||r.openEnd)),_)break;O=p[g].to}}else i.push(new Oo(c,u,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return i}let yY=0;class ns{constructor(e,i,n,s){this.name=e,this.set=i,this.base=n,this.modified=s,this.id=yY++}toString(){let{name:e}=this;for(let i of this.modified)i.name&&(e=`${i.name}(${e})`);return e}static define(e,i){let n=typeof e=="string"?e:"?";if(e instanceof ns&&(i=e),i!=null&&i.base)throw new Error("Can not derive from a modified tag");let s=new ns(n,[],null,[]);if(s.set.push(s),i)for(let r of i.set)s.set.push(r);return s}static defineModifier(e){let i=new Mg(e);return n=>n.modified.indexOf(i)>-1?n:Mg.get(n.base||n,n.modified.concat(i).sort((s,r)=>s.id-r.id))}}let bY=0;class Mg{constructor(e){this.name=e,this.instances=[],this.id=bY++}static get(e,i){if(!i.length)return e;let n=i[0].instances.find(l=>l.base==e&&xY(i,l.modified));if(n)return n;let s=[],r=new ns(e.name,s,e,i);for(let l of i)l.instances.push(r);let o=SY(i);for(let l of e.set)if(!l.modified.length)for(let c of o)s.push(Mg.get(l,c));return r}}function xY(t,e){return t.length==e.length&&t.every((i,n)=>i==e[n])}function SY(t){let e=[[]];for(let i=0;i<t.length;i++)for(let n=0,s=e.length;n<s;n++)e.push(e[n].concat(t[i]));return e.sort((i,n)=>n.length-i.length)}function _h(t){let e=Object.create(null);for(let i in t){let n=t[i];Array.isArray(n)||(n=[n]);for(let s of i.split(" "))if(s){let r=[],o=2,l=s;for(let p=0;;){if(l=="..."&&p>0&&p+3==s.length){o=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!g)throw new RangeError("Invalid path: "+s);if(r.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),p+=g[0].length,p==s.length)break;let O=s[p++];if(p==s.length&&O=="!"){o=0;break}if(O!="/")throw new RangeError("Invalid path: "+s);l=s.slice(p)}let c=r.length-1,u=r[c];if(!u)throw new RangeError("Invalid path: "+s);let d=new jf(n,o,c>0?r.slice(0,c):null);e[u]=d.sort(e[u])}}return $B.add(e)}const $B=new je({combine(t,e){let i,n,s;for(;t||e;){if(!t||e&&t.depth>=e.depth?(s=e,e=e.next):(s=t,t=t.next),i&&i.mode==s.mode&&!s.context&&!i.context)continue;let r=new jf(s.tags,s.mode,s.context);i?i.next=r:n=r,i=r}return n}});class jf{constructor(e,i,n,s){this.tags=e,this.mode=i,this.context=n,this.next=s}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}}jf.empty=new jf([],2,null);function NB(t,e){let i=Object.create(null);for(let r of t)if(!Array.isArray(r.tag))i[r.tag.id]=r.class;else for(let o of r.tag)i[o.id]=r.class;let{scope:n,all:s=null}=e||{};return{style:r=>{let o=s;for(let l of r)for(let c of l.set){let u=i[c.id];if(u){o=o?o+" "+u:u;break}}return o},scope:n}}function wY(t,e){let i=null;for(let n of t){let s=n.style(e);s&&(i=i?i+" "+s:s)}return i}function CY(t,e,i,n=0,s=t.length){let r=new kY(n,Array.isArray(e)?e:[e],i);r.highlightRange(t.cursor(),n,s,"",r.highlighters),r.flush(s)}class kY{constructor(e,i,n){this.at=e,this.highlighters=i,this.span=n,this.class=""}startSpan(e,i){i!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=i)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,i,n,s,r){let{type:o,from:l,to:c}=e;if(l>=n||c<=i)return;o.isTop&&(r=this.highlighters.filter(O=>!O.scope||O.scope(o)));let u=s,d=TY(e)||jf.empty,p=wY(r,d.tags);if(p&&(u&&(u+=" "),u+=p,d.mode==1&&(s+=(s?" ":"")+p)),this.startSpan(Math.max(i,l),u),d.opaque)return;let g=e.tree&&e.tree.prop(je.mounted);if(g&&g.overlay){let O=e.node.enter(g.overlay[0].from+l,1),_=this.highlighters.filter(S=>!S.scope||S.scope(g.tree.type)),b=e.firstChild();for(let S=0,w=l;;S++){let T=S<g.overlay.length?g.overlay[S]:null,k=T?T.from+l:c,A=Math.max(i,w),R=Math.min(n,k);if(A<R&&b)for(;e.from<R&&(this.highlightRange(e,A,R,s,r),this.startSpan(Math.min(R,e.to),u),!(e.to>=k||!e.nextSibling())););if(!T||k>n)break;w=T.to+l,w>i&&(this.highlightRange(O.cursor(),Math.max(i,T.from+l),Math.min(n,w),"",_),this.startSpan(Math.min(n,w),u))}b&&e.parent()}else if(e.firstChild()){g&&(s="");do if(!(e.to<=i)){if(e.from>=n)break;this.highlightRange(e,i,n,s,r),this.startSpan(Math.min(n,e.to),u)}while(e.nextSibling());e.parent()}}}function TY(t){let e=t.type.prop($B);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const _e=ns.define,hm=_e(),pa=_e(),zE=_e(pa),jE=_e(pa),ma=_e(),um=_e(ma),L_=_e(ma),ur=_e(),il=_e(ur),rr=_e(),or=_e(),kb=_e(),Au=_e(kb),fm=_e(),X={comment:hm,lineComment:_e(hm),blockComment:_e(hm),docComment:_e(hm),name:pa,variableName:_e(pa),typeName:zE,tagName:_e(zE),propertyName:jE,attributeName:_e(jE),className:_e(pa),labelName:_e(pa),namespace:_e(pa),macroName:_e(pa),literal:ma,string:um,docString:_e(um),character:_e(um),attributeValue:_e(um),number:L_,integer:_e(L_),float:_e(L_),bool:_e(ma),regexp:_e(ma),escape:_e(ma),color:_e(ma),url:_e(ma),keyword:rr,self:_e(rr),null:_e(rr),atom:_e(rr),unit:_e(rr),modifier:_e(rr),operatorKeyword:_e(rr),controlKeyword:_e(rr),definitionKeyword:_e(rr),moduleKeyword:_e(rr),operator:or,derefOperator:_e(or),arithmeticOperator:_e(or),logicOperator:_e(or),bitwiseOperator:_e(or),compareOperator:_e(or),updateOperator:_e(or),definitionOperator:_e(or),typeOperator:_e(or),controlOperator:_e(or),punctuation:kb,separator:_e(kb),bracket:Au,angleBracket:_e(Au),squareBracket:_e(Au),paren:_e(Au),brace:_e(Au),content:ur,heading:il,heading1:_e(il),heading2:_e(il),heading3:_e(il),heading4:_e(il),heading5:_e(il),heading6:_e(il),contentSeparator:_e(ur),list:_e(ur),quote:_e(ur),emphasis:_e(ur),strong:_e(ur),link:_e(ur),monospace:_e(ur),strikethrough:_e(ur),inserted:_e(),deleted:_e(),changed:_e(),invalid:_e(),meta:fm,documentMeta:_e(fm),annotation:_e(fm),processingInstruction:_e(fm),definition:ns.defineModifier("definition"),constant:ns.defineModifier("constant"),function:ns.defineModifier("function"),standard:ns.defineModifier("standard"),local:ns.defineModifier("local"),special:ns.defineModifier("special")};for(let t in X){let e=X[t];e instanceof ns&&(e.name=t)}NB([{tag:X.link,class:"tok-link"},{tag:X.heading,class:"tok-heading"},{tag:X.emphasis,class:"tok-emphasis"},{tag:X.strong,class:"tok-strong"},{tag:X.keyword,class:"tok-keyword"},{tag:X.atom,class:"tok-atom"},{tag:X.bool,class:"tok-bool"},{tag:X.url,class:"tok-url"},{tag:X.labelName,class:"tok-labelName"},{tag:X.inserted,class:"tok-inserted"},{tag:X.deleted,class:"tok-deleted"},{tag:X.literal,class:"tok-literal"},{tag:X.string,class:"tok-string"},{tag:X.number,class:"tok-number"},{tag:[X.regexp,X.escape,X.special(X.string)],class:"tok-string2"},{tag:X.variableName,class:"tok-variableName"},{tag:X.local(X.variableName),class:"tok-variableName tok-local"},{tag:X.definition(X.variableName),class:"tok-variableName tok-definition"},{tag:X.special(X.variableName),class:"tok-variableName2"},{tag:X.definition(X.propertyName),class:"tok-propertyName tok-definition"},{tag:X.typeName,class:"tok-typeName"},{tag:X.namespace,class:"tok-namespace"},{tag:X.className,class:"tok-className"},{tag:X.macroName,class:"tok-macroName"},{tag:X.propertyName,class:"tok-propertyName"},{tag:X.operator,class:"tok-operator"},{tag:X.comment,class:"tok-comment"},{tag:X.meta,class:"tok-meta"},{tag:X.invalid,class:"tok-invalid"},{tag:X.punctuation,class:"tok-punctuation"}]);var D_;const vl=new je;function GS(t){return xe.define({combine:t?e=>e.concat(t):void 0})}const KS=new je;class As{constructor(e,i,n=[],s=""){this.data=e,this.name=s,et.prototype.hasOwnProperty("tree")||Object.defineProperty(et.prototype,"tree",{get(){return St(this)}}),this.parser=i,this.extension=[Ea.of(this),et.languageData.of((r,o,l)=>{let c=IE(r,o,l),u=c.type.prop(vl);if(!u)return[];let d=r.facet(u),p=c.type.prop(KS);if(p){let g=c.resolve(o-c.from,l);for(let O of p)if(O.test(g,r)){let _=r.facet(O.facet);return O.type=="replace"?_:_.concat(d)}}return d})].concat(n)}isActiveAt(e,i,n=-1){return IE(e,i,n).type.prop(vl)==this.data}findRegions(e){let i=e.facet(Ea);if((i==null?void 0:i.data)==this.data)return[{from:0,to:e.doc.length}];if(!i||!i.allowsNesting)return[];let n=[],s=(r,o)=>{if(r.prop(vl)==this.data){n.push({from:o,to:o+r.length});return}let l=r.prop(je.mounted);if(l){if(l.tree.prop(vl)==this.data){if(l.overlay)for(let c of l.overlay)n.push({from:c.from+o,to:c.to+o});else n.push({from:o,to:o+r.length});return}else if(l.overlay){let c=n.length;if(s(l.tree,l.overlay[0].from+o),n.length>c)return}}for(let c=0;c<r.children.length;c++){let u=r.children[c];u instanceof ct&&s(u,r.positions[c]+o)}};return s(St(e),0),n}get allowsNesting(){return!0}}As.setState=ze.define();function IE(t,e,i){let n=t.facet(Ea),s=St(t).topNode;if(!n||n.allowsNesting)for(let r=s;r;r=r.enter(e,i,ut.ExcludeBuffers|ut.EnterBracketed))r.type.isTop&&(s=r);return s}class lh extends As{constructor(e,i,n){super(e,i,[],n),this.parser=i}static define(e){let i=GS(e.languageData);return new lh(i,e.parser.configure({props:[vl.add(n=>n.isTop?i:void 0)]}),e.name)}configure(e,i){return new lh(this.data,this.parser.configure(e),i||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function St(t){let e=t.field(As.state,!1);return e?e.tree:ct.empty}class AY{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,i){let n=this.cursorPos-this.string.length;return e<n||i>=this.cursorPos?this.doc.sliceString(e,i):this.string.slice(e-n,i-n)}}let Eu=null;class If{constructor(e,i,n=[],s,r,o,l,c){this.parser=e,this.state=i,this.fragments=n,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,i,n){return new If(e,i,[],ct.empty,0,n,[],null)}startParse(){return this.parser.startParse(new AY(this.state.doc),this.fragments)}work(e,i){return i!=null&&i>=this.state.doc.length&&(i=void 0),this.tree!=ct.empty&&this.isDone(i??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),i!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>i)&&i<this.state.doc.length&&this.parse.stopAt(i);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(Oo.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(n=this.parse.stoppedAt)!==null&&n!==void 0?n:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(i??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,i;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(i=this.parse.advance()););}),this.treeLen=e,this.tree=i,this.fragments=this.withoutTempSkipped(Oo.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let i=Eu;Eu=this;try{return e()}finally{Eu=i}}withoutTempSkipped(e){for(let i;i=this.tempSkipped.pop();)e=VE(e,i.from,i.to);return e}changes(e,i){let{fragments:n,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((u,d,p,g)=>c.push({fromA:u,toA:d,fromB:p,toB:g})),n=Oo.applyChanges(n,c),s=ct.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let d=e.mapPos(u.from,1),p=e.mapPos(u.to,-1);d<p&&l.push({from:d,to:p})}}}return new If(this.parser,i,n,s,r,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let i=this.skipped.length;for(let n=0;n<this.skipped.length;n++){let{from:s,to:r}=this.skipped[n];s<e.to&&r>e.from&&(this.fragments=VE(this.fragments,s,r),this.skipped.splice(n--,1))}return this.skipped.length>=i?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,i){this.skipped.push({from:e,to:i})}static getSkippingParser(e){return new class extends FS{createParse(i,n,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let c=Eu;if(c){for(let u of s)c.tempSkipped.push(u);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=o,new ct(_i.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let i=this.fragments;return this.treeLen>=e&&i.length&&i[0].from==0&&i[0].to>=e}static get(){return Eu}}function VE(t,e,i){return Oo.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class ch{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let i=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),i.viewport.to);return i.work(20,n)||i.takeTree(),new ch(i)}static init(e){let i=Math.min(3e3,e.doc.length),n=If.create(e.facet(Ea).parser,e,{from:0,to:i});return n.work(20,i)||n.takeTree(),new ch(n)}}As.state=Bi.define({create:ch.init,update(t,e){for(let i of e.effects)if(i.is(As.setState))return i.value;return e.startState.facet(Ea)!=e.state.facet(Ea)?ch.init(e.state):t.apply(e)}});let zB=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(zB=t=>{let e=-1,i=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const B_=typeof navigator<"u"&&(!((D_=navigator.scheduling)===null||D_===void 0)&&D_.isInputPending)?()=>navigator.scheduling.isInputPending():null,EY=Jt.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 i=this.view.state.field(As.state).context;(i.updateViewport(e.view.viewport)||this.view.viewport.to>i.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(i)}scheduleWork(){if(this.working)return;let{state:e}=this.view,i=e.field(As.state);(i.tree!=i.context.tree||!i.context.isDone(e.doc.length))&&(this.working=zB(this.work))}work(e){this.working=null;let i=Date.now();if(this.chunkEnd<i&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=i+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:s}}=this.view,r=n.field(As.state);if(r.tree==r.context.tree&&r.context.isDone(s+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!B_?Math.max(25,e.timeRemaining()-5):1e9),l=r.context.treeLen<s&&n.doc.length>s+1e3,c=r.context.work(()=>B_&&B_()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-i,(c||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:As.setState.of(new ch(r.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(i=>$n(this.view.state,i)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ea=xe.define({combine(t){return t.length?t[0]:null},enables:t=>[As.state,EY,ve.contentAttributes.compute([t],e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}})]});class Vf{constructor(e,i=[]){this.language=e,this.support=i,this.extension=[e,i]}}class Pg{constructor(e,i,n,s,r,o=void 0){this.name=e,this.alias=i,this.extensions=n,this.filename=s,this.loadFunc=r,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:i,support:n}=e;if(!i){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");i=()=>Promise.resolve(n)}return new Pg(e.name,(e.alias||[]).concat(e.name).map(s=>s.toLowerCase()),e.extensions||[],e.filename,i,n)}static matchFilename(e,i){for(let s of e)if(s.filename&&s.filename.test(i))return s;let n=/\.([^.]+)$/.exec(i);if(n){for(let s of e)if(s.extensions.indexOf(n[1])>-1)return s}return null}static matchLanguageName(e,i,n=!0){i=i.toLowerCase();for(let s of e)if(s.alias.some(r=>r==i))return s;if(n)for(let s of e)for(let r of s.alias){let o=i.indexOf(r);if(o>-1&&(r.length>2||!/\w/.test(i[o-1])&&!/\w/.test(i[o+r.length])))return s}return null}}const MY=xe.define(),yh=xe.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(i=>i!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Rg(t){let e=t.facet(yh);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Xf(t,e){let i="",n=t.tabSize,s=t.facet(yh)[0];if(s==" "){for(;e>=n;)i+=" ",e-=n;s=" "}for(let r=0;r<e;r++)i+=s;return i}function JS(t,e){t instanceof et&&(t=new OO(t));for(let n of t.state.facet(MY)){let s=n(t,e);if(s!==void 0)return s}let i=St(t.state);return i.length>=e?PY(t,i,e):null}class OO{constructor(e,i={}){this.state=e,this.options=i,this.unit=Rg(e)}lineAt(e,i=1){let n=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=n.from&&s<=n.to?r&&s==e?{text:"",from:e}:(i<0?s<e:s<=e)?{text:n.text.slice(s-n.from),from:s}:{text:n.text.slice(0,s-n.from),from:n.from}:n}textAfterPos(e,i=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:s}=this.lineAt(e,i);return n.slice(e-s,Math.min(n.length,e+100-s))}column(e,i=1){let{text:n,from:s}=this.lineAt(e,i),r=this.countColumn(n,e-s),o=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return o>-1&&(r+=o-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,i=e.length){return Ys(e,this.state.tabSize,i)}lineIndent(e,i=1){let{text:n,from:s}=this.lineAt(e,i),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const md=new je;function PY(t,e,i){let n=e.resolveStack(i),s=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(s!=n.node){let r=[];for(let o=s;o&&!(o.from<n.node.from||o.to>n.node.to||o.from==n.node.from&&o.type==n.node.type);o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)n={node:r[o],next:n}}return jB(n,t,i)}function jB(t,e,i){for(let n=t;n;n=n.next){let s=QY(n.node);if(s)return s(ew.create(e,i,n))}return 0}function RY(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function QY(t){let e=t.type.prop(md);if(e)return e;let i=t.firstChild,n;if(i&&(n=i.type.prop(je.closedBy))){let s=t.lastChild,r=s&&n.indexOf(s.name)>-1;return o=>IB(o,!0,1,void 0,r&&!RY(o)?s.from:void 0)}return t.parent==null?LY:null}function LY(){return 0}class ew extends OO{constructor(e,i,n){super(e.state,e.options),this.base=e,this.pos=i,this.context=n}get node(){return this.context.node}static create(e,i,n){return new ew(e,i,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let i=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(i.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(DY(n,e))break;i=this.state.doc.lineAt(n.from)}return this.lineIndent(i.from)}continue(){return jB(this.context.next,this.base,this.pos)}}function DY(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}function BY(t){let e=t.node,i=e.childAfter(e.from),n=e.lastChild;if(!i)return null;let s=t.options.simulateBreak,r=t.state.doc.lineAt(i.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=i.to;;){let c=e.childAfter(l);if(!c||c==n)return null;if(!c.type.isSkipped){if(c.from>=o)return null;let u=/^ */.exec(r.text.slice(i.to-r.from))[0].length;return{from:i.from,to:i.to+u}}l=c.to}}function $Y({closing:t,align:e=!0,units:i=1}){return n=>IB(n,e,i,t)}function IB(t,e,i,n,s){let r=t.textAfter,o=r.match(/^\s*/)[0].length,l=n&&r.slice(o,o+n.length)==n||s==t.pos+o,c=e?BY(t):null;return c?l?t.column(c.from):t.column(c.to):t.baseIndent+(l?0:t.unit*i)}const NY=t=>t.baseIndent;function Um({except:t,units:e=1}={}){return i=>{let n=t&&t.test(i.textAfter);return i.baseIndent+(n?0:e*i.unit)}}const zY=200;function jY(){return et.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let i=t.newDoc,{head:n}=t.newSelection.main,s=i.lineAt(n);if(n>s.from+zY)return t;let r=i.sliceString(s.from,n);if(!e.some(u=>u.test(r)))return t;let{state:o}=t,l=-1,c=[];for(let{head:u}of o.selection.ranges){let d=o.doc.lineAt(u);if(d.from==l)continue;l=d.from;let p=JS(o,d.from);if(p==null)continue;let g=/^\s*/.exec(d.text)[0],O=Xf(o,p);g!=O&&c.push({from:d.from,to:d.from+g.length,insert:O})}return c.length?[t,{changes:c,sequential:!0}]:t})}const VB=xe.define(),bh=new je;function XB(t){let e=t.firstChild,i=t.lastChild;return e&&e.to<i.from?{from:e.to,to:i.type.isError?t.to:i.from}:null}function IY(t,e,i){let n=St(t);if(n.length<i)return null;let s=n.resolveStack(i,1),r=null;for(let o=s;o;o=o.next){let l=o.node;if(l.to<=i||l.from>i)continue;if(r&&l.from<e)break;let c=l.type.prop(bh);if(c&&(l.to<n.length-50||n.length==t.doc.length||!VY(l))){let u=c(l,t);u&&u.from<=i&&u.from>=e&&u.to>i&&(r=u)}}return r}function VY(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function Qg(t,e,i){for(let n of t.facet(VB)){let s=n(t,e,i);if(s)return s}return IY(t,e,i)}function ZB(t,e){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);return i>=n?void 0:{from:i,to:n}}const vO=ze.define({map:ZB}),gd=ze.define({map:ZB});function qB(t){let e=[];for(let{head:i}of t.state.selection.ranges)e.some(n=>n.from<=i&&n.to>=i)||e.push(t.lineBlockAt(i));return e}const Ml=Bi.define({create(){return Pe.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((i,n)=>t=XE(t,i,n)),t=t.map(e.changes);for(let i of e.effects)if(i.is(vO)&&!XY(t,i.value.from,i.value.to)){let{preparePlaceholder:n}=e.state.facet(YB),s=n?Pe.replace({widget:new FY(n(e.state,i.value))}):ZE;t=t.update({add:[s.range(i.value.from,i.value.to)]})}else i.is(gd)&&(t=t.update({filter:(n,s)=>i.value.from!=n||i.value.to!=s,filterFrom:i.value.from,filterTo:i.value.to}));return e.selection&&(t=XE(t,e.selection.main.head)),t},provide:t=>ve.decorations.from(t),toJSON(t,e){let i=[];return t.between(0,e.doc.length,(n,s)=>{i.push(n,s)}),i},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let i=0;i<t.length;){let n=t[i++],s=t[i++];if(typeof n!="number"||typeof s!="number")throw new RangeError("Invalid JSON for fold state");e.push(ZE.range(n,s))}return Pe.set(e,!0)}});function XE(t,e,i=e){let n=!1;return t.between(e,i,(s,r)=>{s<i&&r>e&&(n=!0)}),n?t.update({filterFrom:e,filterTo:i,filter:(s,r)=>s>=i||r<=e}):t}function Lg(t,e,i){var n;let s=null;return(n=t.field(Ml,!1))===null||n===void 0||n.between(e,i,(r,o)=>{(!s||s.from>r)&&(s={from:r,to:o})}),s}function XY(t,e,i){let n=!1;return t.between(e,e,(s,r)=>{s==e&&r==i&&(n=!0)}),n}function WB(t,e){return t.field(Ml,!1)?e:e.concat(ze.appendConfig.of(HB()))}const ZY=t=>{for(let e of qB(t)){let i=Qg(t.state,e.from,e.to);if(i)return t.dispatch({effects:WB(t.state,[vO.of(i),UB(t,i)])}),!0}return!1},qY=t=>{if(!t.state.field(Ml,!1))return!1;let e=[];for(let i of qB(t)){let n=Lg(t.state,i.from,i.to);n&&e.push(gd.of(n),UB(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function UB(t,e,i=!0){let n=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return ve.announce.of(`${t.state.phrase(i?"Folded lines":"Unfolded lines")} ${n} ${t.state.phrase("to")} ${s}.`)}const WY=t=>{let{state:e}=t,i=[];for(let n=0;n<e.doc.length;){let s=t.lineBlockAt(n),r=Qg(e,s.from,s.to);r&&i.push(vO.of(r)),n=(r?t.lineBlockAt(r.to):s).to+1}return i.length&&t.dispatch({effects:WB(t.state,i)}),!!i.length},UY=t=>{let e=t.state.field(Ml,!1);if(!e||!e.size)return!1;let i=[];return e.between(0,t.state.doc.length,(n,s)=>{i.push(gd.of({from:n,to:s}))}),t.dispatch({effects:i}),!0},YY=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:ZY},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:qY},{key:"Ctrl-Alt-[",run:WY},{key:"Ctrl-Alt-]",run:UY}],HY={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},YB=xe.define({combine(t){return Lr(t,HY)}});function HB(t){return[Ml,JY]}function FB(t,e){let{state:i}=t,n=i.facet(YB),s=o=>{let l=t.lineBlockAt(t.posAtDOM(o.target)),c=Lg(t.state,l.from,l.to);c&&t.dispatch({effects:gd.of(c)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,s,e);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",i.phrase("folded code")),r.title=i.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}const ZE=Pe.replace({widget:new class extends Gs{toDOM(t){return FB(t,null)}}});class FY extends Gs{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return FB(e,this.value)}}const GY={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class $_ extends xo{constructor(e,i){super(),this.config=e,this.open=i}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let i=document.createElement("span");return i.textContent=this.open?this.config.openText:this.config.closedText,i.title=e.state.phrase(this.open?"Fold line":"Unfold line"),i}}function KY(t={}){let e={...GY,...t},i=new $_(e,!0),n=new $_(e,!1),s=Jt.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Ea)!=o.state.facet(Ea)||o.startState.field(Ml,!1)!=o.state.field(Ml,!1)||St(o.startState)!=St(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new yo;for(let c of o.viewportLineBlocks){let u=Lg(o.state,c.from,c.to)?n:Qg(o.state,c.from,c.to)?i:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:r}=e;return[s,FU({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(s))===null||l===void 0?void 0:l.markers)||Ge.empty},initialSpacer(){return new $_(e,!1)},domEventHandlers:{...r,click:(o,l,c)=>{if(r.click&&r.click(o,l,c))return!0;let u=Lg(o.state,l.from,l.to);if(u)return o.dispatch({effects:gd.of(u)}),!0;let d=Qg(o.state,l.from,l.to);return d?(o.dispatch({effects:vO.of(d)}),!0):!1}}}),HB()]}const JY=ve.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 Od{constructor(e,i){this.specs=e;let n;function s(l){let c=Ca.newName();return(n||(n=Object.create(null)))["."+c]=l,c}const r=typeof i.all=="string"?i.all:i.all?s(i.all):void 0,o=i.scope;this.scope=o instanceof As?l=>l.prop(vl)==o.data:o?l=>l==o:void 0,this.style=NB(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=n?new Ca(n):null,this.themeType=i.themeType}static define(e,i){return new Od(e,i||{})}}const Tb=xe.define(),GB=xe.define({combine(t){return t.length?[t[0]]:null}});function N_(t){let e=t.facet(Tb);return e.length?e:t.facet(GB)}function KB(t,e){let i=[tH],n;return t instanceof Od&&(t.module&&i.push(ve.styleModule.of(t.module)),n=t.themeType),e!=null&&e.fallback?i.push(GB.of(t)):n?i.push(Tb.computeN([ve.darkTheme],s=>s.facet(ve.darkTheme)==(n=="dark")?[t]:[])):i.push(Tb.of(t)),i}class eH{constructor(e){this.markCache=Object.create(null),this.tree=St(e.state),this.decorations=this.buildDeco(e,N_(e.state)),this.decoratedTo=e.viewport.to}update(e){let i=St(e.state),n=N_(e.state),s=n!=N_(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);i.length<r.to&&!s&&i.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(i!=this.tree||e.viewportChanged||s)&&(this.tree=i,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,i){if(!i||!this.tree.length)return Pe.none;let n=new yo;for(let{from:s,to:r}of e.visibleRanges)CY(this.tree,i,(o,l,c)=>{n.add(o,l,this.markCache[c]||(this.markCache[c]=Pe.mark({class:c})))},s,r);return n.finish()}}const tH=wo.high(Jt.fromClass(eH,{decorations:t=>t.decorations})),iH=Od.define([{tag:X.meta,color:"#404740"},{tag:X.link,textDecoration:"underline"},{tag:X.heading,textDecoration:"underline",fontWeight:"bold"},{tag:X.emphasis,fontStyle:"italic"},{tag:X.strong,fontWeight:"bold"},{tag:X.strikethrough,textDecoration:"line-through"},{tag:X.keyword,color:"#708"},{tag:[X.atom,X.bool,X.url,X.contentSeparator,X.labelName],color:"#219"},{tag:[X.literal,X.inserted],color:"#164"},{tag:[X.string,X.deleted],color:"#a11"},{tag:[X.regexp,X.escape,X.special(X.string)],color:"#e40"},{tag:X.definition(X.variableName),color:"#00f"},{tag:X.local(X.variableName),color:"#30a"},{tag:[X.typeName,X.namespace],color:"#085"},{tag:X.className,color:"#167"},{tag:[X.special(X.variableName),X.macroName],color:"#256"},{tag:X.definition(X.propertyName),color:"#00c"},{tag:X.comment,color:"#940"},{tag:X.invalid,color:"#f00"}]),nH=ve.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),JB=1e4,e$="()[]{}",t$=xe.define({combine(t){return Lr(t,{afterCursor:!0,brackets:e$,maxScanDistance:JB,renderMatch:oH})}}),sH=Pe.mark({class:"cm-matchingBracket"}),rH=Pe.mark({class:"cm-nonmatchingBracket"});function oH(t){let e=[],i=t.matched?sH:rH;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e}const aH=Bi.define({create(){return Pe.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let i=[],n=e.state.facet(t$);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=br(e.state,s.head,-1,n)||s.head>0&&br(e.state,s.head-1,1,n)||n.afterCursor&&(br(e.state,s.head,1,n)||s.head<e.state.doc.length&&br(e.state,s.head+1,-1,n));r&&(i=i.concat(n.renderMatch(r,e.state)))}return Pe.set(i,!0)},provide:t=>ve.decorations.from(t)}),lH=[aH,nH];function cH(t={}){return[t$.of(t),lH]}const i$=new je;function Ab(t,e,i){let n=t.prop(e<0?je.openedBy:je.closedBy);if(n)return n;if(t.name.length==1){let s=i.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[i[s+e]]}return null}function Eb(t){let e=t.type.prop(i$);return e?e(t.node):t}function br(t,e,i,n={}){let s=n.maxScanDistance||JB,r=n.brackets||e$,o=St(t),l=o.resolveInner(e,i);for(let c=l;c;c=c.parent){let u=Ab(c.type,i,r);if(u&&c.from<c.to){let d=Eb(c);if(d&&(i>0?e>=d.from&&e<d.to:e>d.from&&e<=d.to))return hH(t,e,i,c,d,u,r)}}return uH(t,e,i,o,l.type,s,r)}function hH(t,e,i,n,s,r,o){let l=n.parent,c={from:s.from,to:s.to},u=0,d=l==null?void 0:l.cursor();if(d&&(i<0?d.childBefore(n.from):d.childAfter(n.to)))do if(i<0?d.to<=n.from:d.from>=n.to){if(u==0&&r.indexOf(d.type.name)>-1&&d.from<d.to){let p=Eb(d);return{start:c,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(Ab(d.type,i,o))u++;else if(Ab(d.type,-i,o)){if(u==0){let p=Eb(d);return{start:c,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}u--}}while(i<0?d.prevSibling():d.nextSibling());return{start:c,matched:!1}}function uH(t,e,i,n,s,r,o){let l=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),c=o.indexOf(l);if(c<0||c%2==0!=i>0)return null;let u={from:i<0?e-1:e,to:i>0?e+1:e},d=t.doc.iterRange(e,i>0?t.doc.length:0),p=0;for(let g=0;!d.next().done&&g<=r;){let O=d.value;i<0&&(g+=O.length);let _=e+g*i;for(let b=i>0?0:O.length-1,S=i>0?O.length:-1;b!=S;b+=i){let w=o.indexOf(O[b]);if(!(w<0||n.resolveInner(_+b,1).type!=s))if(w%2==0==i>0)p++;else{if(p==1)return{start:u,end:{from:_+b,to:_+b+1},matched:w>>1==c>>1};p--}}i>0&&(g+=O.length)}return d.done?{start:u,matched:!1}:null}const fH=Object.create(null),qE=[_i.none],WE=[],UE=Object.create(null),dH=Object.create(null);for(let[t,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"]])dH[t]=pH(fH,e);function z_(t,e){WE.indexOf(t)>-1||(WE.push(t),console.warn(e))}function pH(t,e){let i=[];for(let l of e.split(" ")){let c=[];for(let u of l.split(".")){let d=t[u]||X[u];d?typeof d=="function"?c.length?c=c.map(d):z_(u,`Modifier ${u} used at start of tag`):c.length?z_(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:z_(u,`Unknown highlighting tag ${u}`)}for(let u of c)i.push(u)}if(!i.length)return 0;let n=e.replace(/ /g,"_"),s=n+" "+i.map(l=>l.id),r=UE[s];if(r)return r.id;let o=UE[s]=_i.define({id:qE.length,name:n,props:[_h({[n]:i})]});return qE.push(o),o.id}xt.RTL,xt.LTR;const mH=t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),n=iw(t.state,i.from);return n.line?gH(t):n.block?vH(t):!1};function tw(t,e){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let s=t(e,i);return s?(n(i.update(s)),!0):!1}}const gH=tw(bH,0),OH=tw(n$,0),vH=tw((t,e)=>n$(t,e,yH(e)),0);function iw(t,e){let i=t.languageDataAt("commentTokens",e,1);return i.length?i[0]:{}}const Mu=50;function _H(t,{open:e,close:i},n,s){let r=t.sliceDoc(n-Mu,n),o=t.sliceDoc(s,s+Mu),l=/\s*$/.exec(r)[0].length,c=/^\s*/.exec(o)[0].length,u=r.length-l;if(r.slice(u-e.length,u)==e&&o.slice(c,c+i.length)==i)return{open:{pos:n-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let d,p;s-n<=2*Mu?d=p=t.sliceDoc(n,s):(d=t.sliceDoc(n,n+Mu),p=t.sliceDoc(s-Mu,s));let g=/^\s*/.exec(d)[0].length,O=/\s*$/.exec(p)[0].length,_=p.length-O-i.length;return d.slice(g,g+e.length)==e&&p.slice(_,_+i.length)==i?{open:{pos:n+g+e.length,margin:/\s/.test(d.charAt(g+e.length))?1:0},close:{pos:s-O-i.length,margin:/\s/.test(p.charAt(_-1))?1:0}}:null}function yH(t){let e=[];for(let i of t.selection.ranges){let n=t.doc.lineAt(i.from),s=i.to<=n.to?n:t.doc.lineAt(i.to);s.from>n.from&&s.from==i.to&&(s=i.to==n.to+1?n:t.doc.lineAt(i.to-1));let r=e.length-1;r>=0&&e[r].to>n.from?e[r].to=s.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return e}function n$(t,e,i=e.selection.ranges){let n=i.map(r=>iw(e,r.from).block);if(!n.every(r=>r))return null;let s=i.map((r,o)=>_H(e,n[o],r.from,r.to));if(t!=2&&!s.every(r=>r))return{changes:e.changes(i.map((r,o)=>s[o]?[]:[{from:r.from,insert:n[o].open+" "},{from:r.to,insert:" "+n[o].close}]))};if(t!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let c=n[o],{open:u,close:d}=l;r.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:r}}return null}function bH(t,e,i=e.selection.ranges){let n=[],s=-1;e:for(let{from:r,to:o}of i){let l=n.length,c=1e9,u;for(let d=r;d<=o;){let p=e.doc.lineAt(d);if(u==null&&(u=iw(e,p.from).line,!u))continue e;if(p.from>s&&(r==o||o>p.from)){s=p.from;let g=/^\s*/.exec(p.text)[0].length,O=g==p.length,_=p.text.slice(g,g+u.length)==u?g:-1;g<p.text.length&&g<c&&(c=g),n.push({line:p,comment:_,token:u,indent:g,empty:O,single:!1})}d=p.to+1}if(c<1e9)for(let d=l;d<n.length;d++)n[d].indent<n[d].line.text.length&&(n[d].indent=c);n.length==l+1&&(n[l].single=!0)}if(t!=2&&n.some(r=>r.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:c,indent:u,empty:d,single:p}of n)(p||!d)&&r.push({from:l.from+u,insert:c+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&n.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:c}of n)if(l>=0){let u=o.from+l,d=u+c.length;o.text[d-o.from]==" "&&d++,r.push({from:u,to:d})}return{changes:r}}return null}const Mb=Qr.define(),xH=Qr.define(),SH=xe.define(),s$=xe.define({combine(t){return Lr(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,i)=>i},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,i)=>(n,s)=>e(n,s)||i(n,s)})}}),r$=Bi.define({create(){return xr.empty},update(t,e){let i=e.state.facet(s$),n=e.annotation(Mb);if(n){let c=Nn.fromTransaction(e,n.selection),u=n.side,d=u==0?t.undone:t.done;return c?d=Dg(d,d.length,i.minDepth,c):d=l$(d,e.startState.selection),new xr(u==0?n.rest:d,u==0?d:n.rest)}let s=e.annotation(xH);if((s=="full"||s=="before")&&(t=t.isolate()),e.annotation(hi.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let r=Nn.fromTransaction(e),o=e.annotation(hi.time),l=e.annotation(hi.userEvent);return r?t=t.addChanges(r,o,l,i,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,i.newGroupDelay)),(s=="full"||s=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new xr(t.done.map(Nn.fromJSON),t.undone.map(Nn.fromJSON))}});function wH(t={}){return[r$,s$.of(t),ve.domEventHandlers({beforeinput(e,i){let n=e.inputType=="historyUndo"?o$:e.inputType=="historyRedo"?Pb:null;return n?(e.preventDefault(),n(i)):!1}})]}function _O(t,e){return function({state:i,dispatch:n}){if(!e&&i.readOnly)return!1;let s=i.field(r$,!1);if(!s)return!1;let r=s.pop(t,i,e);return r?(n(r),!0):!1}}const o$=_O(0,!1),Pb=_O(1,!1),CH=_O(0,!0),kH=_O(1,!0);class Nn{constructor(e,i,n,s,r){this.changes=e,this.effects=i,this.mapped=n,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new Nn(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,i,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(i=this.mapped)===null||i===void 0?void 0:i.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Nn(e.changes&&vi.fromJSON(e.changes),[],e.mapped&&Cr.fromJSON(e.mapped),e.startSelection&&re.fromJSON(e.startSelection),e.selectionsAfter.map(re.fromJSON))}static fromTransaction(e,i){let n=Es;for(let s of e.startState.facet(SH)){let r=s(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new Nn(e.changes.invert(e.startState.doc),n,void 0,i||e.startState.selection,Es)}static selection(e){return new Nn(void 0,Es,void 0,void 0,e)}}function Dg(t,e,i,n){let s=e+1>i+20?e-i-1:0,r=t.slice(s,e);return r.push(n),r}function TH(t,e){let i=[],n=!1;return t.iterChangedRanges((s,r)=>i.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let c=0;c<i.length;){let u=i[c++],d=i[c++];l>=u&&o<=d&&(n=!0)}}),n}function AH(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((i,n)=>i.empty!=e.ranges[n].empty).length===0}function a$(t,e){return t.length?e.length?t.concat(e):t:e}const Es=[],EH=200;function l$(t,e){if(t.length){let i=t[t.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-EH));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),Dg(t,t.length-1,1e9,i.setSelAfter(n)))}else return[Nn.selection([e])]}function MH(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}function j_(t,e){if(!t.length)return t;let i=t.length,n=Es;for(;i;){let s=PH(t[i-1],e,n);if(s.changes&&!s.changes.empty||s.effects.length){let r=t.slice(0,i);return r[i-1]=s,r}else e=s.mapped,i--,n=s.selectionsAfter}return n.length?[Nn.selection(n)]:Es}function PH(t,e,i){let n=a$(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):Es,i);if(!t.changes)return Nn.selection(n);let s=t.changes.map(e),r=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(r):r;return new Nn(s,ze.mapEffects(t.effects,e),o,t.startSelection.map(r),n)}const RH=/^(input\.type|delete)($|\.)/;class xr{constructor(e,i,n=0,s=void 0){this.done=e,this.undone=i,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new xr(this.done,this.undone):this}addChanges(e,i,n,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!n||RH.test(n))&&(!l.selectionsAfter.length&&i-this.prevTime<s.newGroupDelay&&s.joinToEvent(r,TH(l.changes,e.changes))||n=="input.type.compose")?o=Dg(o,o.length-1,s.minDepth,new Nn(e.changes.compose(l.changes),a$(ze.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,Es)):o=Dg(o,o.length,s.minDepth,e),new xr(o,Es,i,n)}addSelection(e,i,n,s){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Es;return r.length>0&&i-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&AH(r[r.length-1],e)?this:new xr(l$(this.done,e),this.undone,i,n)}addMapping(e){return new xr(j_(this.done,e),j_(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,i,n){let s=e==0?this.done:this.undone;if(s.length==0)return null;let r=s[s.length-1],o=r.selectionsAfter[0]||(r.startSelection?r.startSelection.map(r.changes.invertedDesc,1):i.selection);if(n&&r.selectionsAfter.length)return i.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:Mb.of({side:e,rest:MH(s),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let l=s.length==1?Es:s.slice(0,s.length-1);return r.mapped&&(l=j_(l,r.mapped)),i.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:Mb.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}xr.empty=new xr(Es,Es);const QH=[{key:"Mod-z",run:o$,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Pb,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Pb,preventDefault:!0},{key:"Mod-u",run:CH,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:kH,preventDefault:!0}];function xh(t,e){return re.create(t.ranges.map(e),t.mainIndex)}function Ks(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Js({state:t,dispatch:e},i){let n=xh(t.selection,i);return n.eq(t.selection,!0)?!1:(e(Ks(t,n)),!0)}function yO(t,e){return re.cursor(e?t.to:t.from)}function c$(t,e){return Js(t,i=>i.empty?t.moveByChar(i,e):yO(i,e))}function an(t){return t.textDirectionAt(t.state.selection.main.head)==xt.LTR}const h$=t=>c$(t,!an(t)),u$=t=>c$(t,an(t));function f$(t,e){return Js(t,i=>i.empty?t.moveByGroup(i,e):yO(i,e))}const LH=t=>f$(t,!an(t)),DH=t=>f$(t,an(t));function BH(t,e,i){if(e.type.prop(i))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function bO(t,e,i){let n=St(t).resolveInner(e.head),s=i?je.closedBy:je.openedBy;for(let c=e.head;;){let u=i?n.childAfter(c):n.childBefore(c);if(!u)break;BH(t,u,s)?n=u:c=i?u.to:u.from}let r=n.type.prop(s),o,l;return r&&(o=i?br(t,n.from,1):br(t,n.to,-1))&&o.matched?l=i?o.end.to:o.end.from:l=i?n.to:n.from,re.cursor(l,i?-1:1)}const $H=t=>Js(t,e=>bO(t.state,e,!an(t))),NH=t=>Js(t,e=>bO(t.state,e,an(t)));function d$(t,e){return Js(t,i=>{if(!i.empty)return yO(i,e);let n=t.moveVertically(i,e);return n.head!=i.head?n:t.moveToLineBoundary(i,e)})}const p$=t=>d$(t,!1),m$=t=>d$(t,!0);function g$(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,i=0,n=0,s;if(e){for(let r of t.state.facet(ve.scrollMargins)){let o=r(t);o!=null&&o.top&&(i=Math.max(o==null?void 0:o.top,i)),o!=null&&o.bottom&&(n=Math.max(o==null?void 0:o.bottom,n))}s=t.scrollDOM.clientHeight-i-n}else s=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:i,marginBottom:n,selfScroll:e,height:Math.max(t.defaultLineHeight,s-5)}}function O$(t,e){let i=g$(t),{state:n}=t,s=xh(n.selection,o=>o.empty?t.moveVertically(o,e,i.height):yO(o,e));if(s.eq(n.selection))return!1;let r;if(i.selfScroll){let o=t.coordsAtPos(n.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),c=l.top+i.marginTop,u=l.bottom-i.marginBottom;o&&o.top>c&&o.bottom<u&&(r=ve.scrollIntoView(s.main.head,{y:"start",yMargin:o.top-c}))}return t.dispatch(Ks(n,s),{effects:r}),!0}const YE=t=>O$(t,!1),Rb=t=>O$(t,!0);function Qa(t,e,i){let n=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,i);if(s.head==e.head&&s.head!=(i?n.to:n.from)&&(s=t.moveToLineBoundary(e,i,!1)),!i&&s.head==n.from&&n.length){let r=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;r&&e.head!=n.from+r&&(s=re.cursor(n.from+r))}return s}const zH=t=>Js(t,e=>Qa(t,e,!0)),jH=t=>Js(t,e=>Qa(t,e,!1)),IH=t=>Js(t,e=>Qa(t,e,!an(t))),VH=t=>Js(t,e=>Qa(t,e,an(t))),XH=t=>Js(t,e=>re.cursor(t.lineBlockAt(e.head).from,1)),ZH=t=>Js(t,e=>re.cursor(t.lineBlockAt(e.head).to,-1));function qH(t,e,i){let n=!1,s=xh(t.selection,r=>{let o=br(t,r.head,-1)||br(t,r.head,1)||r.head>0&&br(t,r.head-1,1)||r.head<t.doc.length&&br(t,r.head+1,-1);if(!o||!o.end)return r;n=!0;let l=o.start.from==r.head?o.end.to:o.end.from;return re.cursor(l)});return n?(e(Ks(t,s)),!0):!1}const WH=({state:t,dispatch:e})=>qH(t,e);function Ls(t,e){let i=xh(t.state.selection,n=>{let s=e(n);return re.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return i.eq(t.state.selection)?!1:(t.dispatch(Ks(t.state,i)),!0)}function v$(t,e){return Ls(t,i=>t.moveByChar(i,e))}const _$=t=>v$(t,!an(t)),y$=t=>v$(t,an(t));function b$(t,e){return Ls(t,i=>t.moveByGroup(i,e))}const UH=t=>b$(t,!an(t)),YH=t=>b$(t,an(t)),HH=t=>Ls(t,e=>bO(t.state,e,!an(t))),FH=t=>Ls(t,e=>bO(t.state,e,an(t)));function x$(t,e){return Ls(t,i=>t.moveVertically(i,e))}const S$=t=>x$(t,!1),w$=t=>x$(t,!0);function C$(t,e){return Ls(t,i=>t.moveVertically(i,e,g$(t).height))}const HE=t=>C$(t,!1),FE=t=>C$(t,!0),GH=t=>Ls(t,e=>Qa(t,e,!0)),KH=t=>Ls(t,e=>Qa(t,e,!1)),JH=t=>Ls(t,e=>Qa(t,e,!an(t))),eF=t=>Ls(t,e=>Qa(t,e,an(t))),tF=t=>Ls(t,e=>re.cursor(t.lineBlockAt(e.head).from)),iF=t=>Ls(t,e=>re.cursor(t.lineBlockAt(e.head).to)),GE=({state:t,dispatch:e})=>(e(Ks(t,{anchor:0})),!0),KE=({state:t,dispatch:e})=>(e(Ks(t,{anchor:t.doc.length})),!0),JE=({state:t,dispatch:e})=>(e(Ks(t,{anchor:t.selection.main.anchor,head:0})),!0),eM=({state:t,dispatch:e})=>(e(Ks(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),nF=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),sF=({state:t,dispatch:e})=>{let i=xO(t).map(({from:n,to:s})=>re.range(n,Math.min(s+1,t.doc.length)));return e(t.update({selection:re.create(i),userEvent:"select"})),!0},rF=({state:t,dispatch:e})=>{let i=xh(t.selection,n=>{let s=St(t),r=s.resolveStack(n.from,1);if(n.empty){let o=s.resolveStack(n.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from<n.from&&l.to>=n.to||l.to>n.to&&l.from<=n.from)&&o.next)return re.range(l.to,l.from)}return n});return i.eq(t.selection)?!1:(e(Ks(t,i)),!0)};function k$(t,e){let{state:i}=t,n=i.selection,s=i.selection.ranges.slice();for(let r of i.selection.ranges){let o=i.doc.lineAt(r.head);if(e?o.to<t.state.doc.length:o.from>0)for(let l=r;;){let c=t.moveVertically(l,e);if(c.head<o.from||c.head>o.to){s.some(u=>u.head==c.head)||s.push(c);break}else{if(c.head==l.head)break;l=c}}}return s.length==n.ranges.length?!1:(t.dispatch(Ks(i,re.create(s,s.length-1))),!0)}const oF=t=>k$(t,!1),aF=t=>k$(t,!0),lF=({state:t,dispatch:e})=>{let i=t.selection,n=null;return i.ranges.length>1?n=re.create([i.main]):i.main.empty||(n=re.create([re.cursor(i.main.head)])),n?(e(Ks(t,n)),!0):!1};function vd(t,e){if(t.state.readOnly)return!1;let i="delete.selection",{state:n}=t,s=n.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let c=e(r);c<o?(i="delete.backward",c=dm(t,c,!1)):c>o&&(i="delete.forward",c=dm(t,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=dm(t,o,!1),l=dm(t,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:re.cursor(o,o<r.head?-1:1)}});return s.changes.empty?!1:(t.dispatch(n.update(s,{scrollIntoView:!0,userEvent:i,effects:i=="delete.selection"?ve.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function dm(t,e,i){if(t instanceof ve)for(let n of t.state.facet(ve.atomicRanges).map(s=>s(t)))n.between(e,e,(s,r)=>{s<e&&r>e&&(e=i?r:s)});return e}const T$=(t,e,i)=>vd(t,n=>{let s=n.from,{state:r}=t,o=r.doc.lineAt(s),l,c;if(i&&!e&&s>o.from&&s<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,s-o.from))){if(l[l.length-1]==" ")return s-1;let u=Ys(l,r.tabSize),d=u%Rg(r)||Rg(r);for(let p=0;p<d&&l[l.length-1-p]==" ";p++)s--;c=s}else c=Di(o.text,s-o.from,e,e)+o.from,c==s&&o.number!=(e?r.doc.lines:1)?c+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,s-o.from))&&(c=Di(o.text,c-o.from,!1,!1)+o.from);return c}),Qb=t=>T$(t,!1,!0),A$=t=>T$(t,!0,!1),E$=(t,e)=>vd(t,i=>{let n=i.head,{state:s}=t,r=s.doc.lineAt(n),o=s.charCategorizer(n);for(let l=null;;){if(n==(e?r.to:r.from)){n==i.head&&r.number!=(e?s.doc.lines:1)&&(n+=e?1:-1);break}let c=Di(r.text,n-r.from,e)+r.from,u=r.text.slice(Math.min(n,c)-r.from,Math.max(n,c)-r.from),d=o(u);if(l!=null&&d!=l)break;(u!=" "||n!=i.head)&&(l=d),n=c}return n}),M$=t=>E$(t,!1),cF=t=>E$(t,!0),hF=t=>vd(t,e=>{let i=t.lineBlockAt(e.head).to;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)}),uF=t=>vd(t,e=>{let i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1)}),fF=t=>vd(t,e=>{let i=t.moveToLineBoundary(e,!0).head;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)}),dF=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:at.of(["",""])},range:re.cursor(n.from)}));return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0},pF=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{if(!n.empty||n.from==0||n.from==t.doc.length)return{range:n};let s=n.from,r=t.doc.lineAt(s),o=s==r.from?s-1:Di(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:Di(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:t.doc.slice(s,l).append(t.doc.slice(o,s))},range:re.cursor(l)}});return i.changes.empty?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function xO(t){let e=[],i=-1;for(let n of t.selection.ranges){let s=t.doc.lineAt(n.from),r=t.doc.lineAt(n.to);if(!n.empty&&n.to==r.from&&(r=t.doc.lineAt(n.to-1)),i>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(n)}else e.push({from:s.from,to:r.to,ranges:[n]});i=r.number+1}return e}function P$(t,e,i){if(t.readOnly)return!1;let n=[],s=[];for(let r of xO(t)){if(i?r.to==t.doc.length:r.from==0)continue;let o=t.doc.lineAt(i?r.to+1:r.from-1),l=o.length+1;if(i){n.push({from:r.to,to:o.to},{from:r.from,insert:o.text+t.lineBreak});for(let c of r.ranges)s.push(re.range(Math.min(t.doc.length,c.anchor+l),Math.min(t.doc.length,c.head+l)))}else{n.push({from:o.from,to:r.from},{from:r.to,insert:t.lineBreak+o.text});for(let c of r.ranges)s.push(re.range(c.anchor-l,c.head-l))}}return n.length?(e(t.update({changes:n,scrollIntoView:!0,selection:re.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const mF=({state:t,dispatch:e})=>P$(t,e,!1),gF=({state:t,dispatch:e})=>P$(t,e,!0);function R$(t,e,i){if(t.readOnly)return!1;let n=[];for(let r of xO(t))i?n.push({from:r.from,insert:t.doc.slice(r.from,r.to)+t.lineBreak}):n.push({from:r.to,insert:t.lineBreak+t.doc.slice(r.from,r.to)});let s=t.changes(n);return e(t.update({changes:s,selection:t.selection.map(s,i?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const OF=({state:t,dispatch:e})=>R$(t,e,!1),vF=({state:t,dispatch:e})=>R$(t,e,!0),_F=t=>{if(t.state.readOnly)return!1;let{state:e}=t,i=e.changes(xO(e).map(({from:s,to:r})=>(s>0?s--:r<e.doc.length&&r++,{from:s,to:r}))),n=xh(e.selection,s=>{let r;if(t.lineWrapping){let o=t.lineBlockAt(s.head),l=t.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(s,!0,r)}).map(i);return t.dispatch({changes:i,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function yF(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i=St(t).resolveInner(e),n=i.childBefore(e),s=i.childAfter(e),r;return n&&s&&n.to<=e&&s.from>=e&&(r=n.type.prop(je.closedBy))&&r.indexOf(s.name)>-1&&t.doc.lineAt(n.to).from==t.doc.lineAt(s.from).from&&!/\S/.test(t.sliceDoc(n.to,s.from))?{from:n.to,to:s.from}:null}const tM=Q$(!1),bF=Q$(!0);function Q$(t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),c=!t&&r==o&&yF(e,r);t&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let u=new OO(e,{simulateBreak:r,simulateDoubleBreak:!!c}),d=JS(u,r);for(d==null&&(d=Ys(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;c?{from:r,to:o}=c:r>l.from&&r<l.from+100&&!/\S/.test(l.text.slice(0,r))&&(r=l.from);let p=["",Xf(e,d)];return c&&p.push(Xf(e,u.lineIndent(l.from,-1))),{changes:{from:r,to:o,insert:at.of(p)},range:re.cursor(r+1+p[1].length)}});return i(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function nw(t,e){let i=-1;return t.changeByRange(n=>{let s=[];for(let o=n.from;o<=n.to;){let l=t.doc.lineAt(o);l.number>i&&(n.empty||n.to>l.from)&&(e(l,s,n),i=l.number),o=l.to+1}let r=t.changes(s);return{changes:s,range:re.range(r.mapPos(n.anchor,1),r.mapPos(n.head,1))}})}const xF=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=Object.create(null),n=new OO(t,{overrideIndentation:r=>{let o=i[r];return o??-1}}),s=nw(t,(r,o,l)=>{let c=JS(n,r.from);if(c==null)return;/\S/.test(r.text)||(c=0);let u=/^\s*/.exec(r.text)[0],d=Xf(t,c);(u!=d||l.from<r.from+u.length)&&(i[r.from]=c,o.push({from:r.from,to:r.from+u.length,insert:d}))});return s.changes.empty||e(t.update(s,{userEvent:"indent"})),!0},L$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(nw(t,(i,n)=>{n.push({from:i.from,insert:t.facet(yh)})}),{userEvent:"input.indent"})),!0),D$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(nw(t,(i,n)=>{let s=/^\s*/.exec(i.text)[0];if(!s)return;let r=Ys(s,t.tabSize),o=0,l=Xf(t,Math.max(0,r-Rg(t)));for(;o<s.length&&o<l.length&&s.charCodeAt(o)==l.charCodeAt(o);)o++;n.push({from:i.from+o,to:i.from+s.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),SF=t=>(t.setTabFocusMode(),!0),wF=[{key:"Ctrl-b",run:h$,shift:_$,preventDefault:!0},{key:"Ctrl-f",run:u$,shift:y$},{key:"Ctrl-p",run:p$,shift:S$},{key:"Ctrl-n",run:m$,shift:w$},{key:"Ctrl-a",run:XH,shift:tF},{key:"Ctrl-e",run:ZH,shift:iF},{key:"Ctrl-d",run:A$},{key:"Ctrl-h",run:Qb},{key:"Ctrl-k",run:hF},{key:"Ctrl-Alt-h",run:M$},{key:"Ctrl-o",run:dF},{key:"Ctrl-t",run:pF},{key:"Ctrl-v",run:Rb}],CF=[{key:"ArrowLeft",run:h$,shift:_$,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:LH,shift:UH,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:IH,shift:JH,preventDefault:!0},{key:"ArrowRight",run:u$,shift:y$,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:DH,shift:YH,preventDefault:!0},{mac:"Cmd-ArrowRight",run:VH,shift:eF,preventDefault:!0},{key:"ArrowUp",run:p$,shift:S$,preventDefault:!0},{mac:"Cmd-ArrowUp",run:GE,shift:JE},{mac:"Ctrl-ArrowUp",run:YE,shift:HE},{key:"ArrowDown",run:m$,shift:w$,preventDefault:!0},{mac:"Cmd-ArrowDown",run:KE,shift:eM},{mac:"Ctrl-ArrowDown",run:Rb,shift:FE},{key:"PageUp",run:YE,shift:HE},{key:"PageDown",run:Rb,shift:FE},{key:"Home",run:jH,shift:KH,preventDefault:!0},{key:"Mod-Home",run:GE,shift:JE},{key:"End",run:zH,shift:GH,preventDefault:!0},{key:"Mod-End",run:KE,shift:eM},{key:"Enter",run:tM,shift:tM},{key:"Mod-a",run:nF},{key:"Backspace",run:Qb,shift:Qb,preventDefault:!0},{key:"Delete",run:A$,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:M$,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:cF,preventDefault:!0},{mac:"Mod-Backspace",run:uF,preventDefault:!0},{mac:"Mod-Delete",run:fF,preventDefault:!0}].concat(wF.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),kF=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:$H,shift:HH},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:NH,shift:FH},{key:"Alt-ArrowUp",run:mF},{key:"Shift-Alt-ArrowUp",run:OF},{key:"Alt-ArrowDown",run:gF},{key:"Shift-Alt-ArrowDown",run:vF},{key:"Mod-Alt-ArrowUp",run:oF},{key:"Mod-Alt-ArrowDown",run:aF},{key:"Escape",run:lF},{key:"Mod-Enter",run:bF},{key:"Alt-l",mac:"Ctrl-l",run:sF},{key:"Mod-i",run:rF,preventDefault:!0},{key:"Mod-[",run:D$},{key:"Mod-]",run:L$},{key:"Mod-Alt-\\",run:xF},{key:"Shift-Mod-k",run:_F},{key:"Shift-Mod-\\",run:WH},{key:"Mod-/",run:mH},{key:"Alt-A",run:OH},{key:"Ctrl-m",mac:"Shift-Alt-m",run:SF}].concat(CF),TF={key:"Tab",run:L$,shift:D$},iM=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class hh{constructor(e,i,n=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,s),this.bufferStart=n,this.normalize=r?l=>r(iM(l)):iM,this.query=this.normalize(i)}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 Ln(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 i=AS(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=gr(e);let s=this.normalize(i);if(s.length)for(let r=0,o=n;;r++){let l=s.charCodeAt(r),c=this.match(l,o,this.bufferPos+this.bufferStart);if(r==s.length-1){if(c)return this.value=c,this;break}o==n&&r<i.length&&i.charCodeAt(r)==l&&o++}}}match(e,i,n){let s=null;for(let r=0;r<this.matches.length;r+=2){let o=this.matches[r],l=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?s={from:this.matches[r+1],to:n}:(this.matches[r]++,l=!0)),l||(this.matches.splice(r,2),r-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?s={from:i,to:n}:this.matches.push(1,i)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(hh.prototype[Symbol.iterator]=function(){return this});const B$={from:-1,to:-1,match:/.*/.exec("")},sw="gm"+(/x/.unicode==null?"":"u");class $${constructor(e,i,n,s=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=B$,/\\[sWDnr]|\n|\r|\[\^/.test(i))return new N$(e,i,n,s,r);this.re=new RegExp(i,sw+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.iter=e.iter();let o=e.lineAt(s);this.curLineStart=o.from,this.matchPos=Bg(e,s),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 i=this.matchPos<=this.to&&this.re.exec(this.curLine);if(i){let n=this.curLineStart+i.index,s=n+i[0].length;if(this.matchPos=Bg(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<s||n>this.value.to)&&(!this.test||this.test(n,s,i)))return this.value={from:n,to:s,match:i},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 I_=new WeakMap;class Gc{constructor(e,i){this.from=e,this.text=i}get to(){return this.from+this.text.length}static get(e,i,n){let s=I_.get(e);if(!s||s.from>=n||s.to<=i){let l=new Gc(i,e.sliceString(i,n));return I_.set(e,l),l}if(s.from==i&&s.to==n)return s;let{text:r,from:o}=s;return o>i&&(r=e.sliceString(i,o)+r,o=i),s.to<n&&(r+=e.sliceString(s.to,n)),I_.set(e,new Gc(o,r)),new Gc(i,r.slice(i-o,n-o))}}class N${constructor(e,i,n,s,r){this.text=e,this.to=r,this.done=!1,this.value=B$,this.matchPos=Bg(e,s),this.re=new RegExp(i,sw+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.flat=Gc.get(e,s,this.chunkEnd(s+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,i=this.re.exec(this.flat.text);if(i&&!i[0]&&i.index==e&&(this.re.lastIndex=e+1,i=this.re.exec(this.flat.text)),i){let n=this.flat.from+i.index,s=n+i[0].length;if((this.flat.to>=this.to||i.index+i[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,i)))return this.value={from:n,to:s,match:i},this.matchPos=Bg(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Gc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&($$.prototype[Symbol.iterator]=N$.prototype[Symbol.iterator]=function(){return this});function AF(t){try{return new RegExp(t,sw),!0}catch{return!1}}function Bg(t,e){if(e>=t.length)return e;let i=t.lineAt(e),n;for(;e<i.to&&(n=i.text.charCodeAt(e-i.from))>=56320&&n<57344;)e++;return e}const EF=t=>{let{state:e}=t,i=String(e.doc.lineAt(t.state.selection.main.head).number),{close:n,result:s}=WU(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:i},focus:!0,submitLabel:e.phrase("go")});return s.then(r=>{let o=r&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.elements.line.value);if(!o){t.dispatch({effects:n});return}let l=e.doc.lineAt(e.selection.main.head),[,c,u,d,p]=o,g=d?+d.slice(1):0,O=u?+u:l.number;if(u&&p){let S=O/100;c&&(S=S*(c=="-"?-1:1)+l.number/e.doc.lines),O=Math.round(e.doc.lines*S)}else u&&c&&(O=O*(c=="-"?-1:1)+l.number);let _=e.doc.line(Math.max(1,Math.min(e.doc.lines,O))),b=re.cursor(_.from+Math.max(0,Math.min(g,_.length)));t.dispatch({effects:[n,ve.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},MF={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},PF=xe.define({combine(t){return Lr(t,MF,{highlightWordAroundCursor:(e,i)=>e||i,minSelectionLength:Math.min,maxMatches:Math.min})}});function RF(t){return[$F,BF]}const QF=Pe.mark({class:"cm-selectionMatch"}),LF=Pe.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function nM(t,e,i,n){return(i==0||t(e.sliceDoc(i-1,i))!=Dt.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=Dt.Word)}function DF(t,e,i,n){return t(e.sliceDoc(i,i+1))==Dt.Word&&t(e.sliceDoc(n-1,n))==Dt.Word}const BF=Jt.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(PF),{state:i}=t,n=i.selection;if(n.ranges.length>1)return Pe.none;let s=n.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return Pe.none;let c=i.wordAt(s.head);if(!c)return Pe.none;o=i.charCategorizer(s.head),r=i.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<e.minSelectionLength||c>200)return Pe.none;if(e.wholeWords){if(r=i.sliceDoc(s.from,s.to),o=i.charCategorizer(s.head),!(nM(o,i,s.from,s.to)&&DF(o,i,s.from,s.to)))return Pe.none}else if(r=i.sliceDoc(s.from,s.to),!r)return Pe.none}let l=[];for(let c of t.visibleRanges){let u=new hh(i.doc,r,c.from,c.to);for(;!u.next().done;){let{from:d,to:p}=u.value;if((!o||nM(o,i,d,p))&&(s.empty&&d<=s.from&&p>=s.to?l.push(LF.range(d,p)):(d>=s.to||p<=s.from)&&l.push(QF.range(d,p)),l.length>e.maxMatches))return Pe.none}}return Pe.set(l)}},{decorations:t=>t.decorations}),$F=ve.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),NF=({state:t,dispatch:e})=>{let{selection:i}=t,n=re.create(i.ranges.map(s=>t.wordAt(s.head)||re.cursor(s.head)),i.mainIndex);return n.eq(i)?!1:(e(t.update({selection:n})),!0)};function zF(t,e){let{main:i,ranges:n}=t.selection,s=t.wordAt(i.head),r=s&&s.from==i.from&&s.to==i.to;for(let o=!1,l=new hh(t.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new hh(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(c=>c.from==l.value.from))continue;if(r){let c=t.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const jF=({state:t,dispatch:e})=>{let{ranges:i}=t.selection;if(i.some(r=>r.from===r.to))return NF({state:t,dispatch:e});let n=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some(r=>t.sliceDoc(r.from,r.to)!=n))return!1;let s=zF(t,n);return s?(e(t.update({selection:t.selection.addRange(re.range(s.from,s.to),!1),effects:ve.scrollIntoView(s.to)})),!0):!1},Sh=xe.define({combine(t){return Lr(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new eG(e),scrollToMatch:e=>ve.scrollIntoView(e)})}});class z${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||AF(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,(i,n)=>n=="n"?`
69
- `:n=="r"?"\r":n=="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 WF(this):new XF(this)}getCursor(e,i=0,n){let s=e.doc?e:et.create({doc:e});return n==null&&(n=s.doc.length),this.regexp?Rc(this,s,i,n):Pc(this,s,i,n)}}class j${constructor(e){this.spec=e}}function IF(t,e,i){return(n,s,r,o)=>{if(i&&!i(n,s,r,o))return!1;let l=n>=o&&s<=o+r.length?r.slice(n-o,s-o):e.doc.sliceString(n,s);return t(l,e,n,s)}}function Pc(t,e,i,n){let s;return t.wholeWord&&(s=VF(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(s=IF(t.test,e,s)),new hh(e.doc,t.unquoted,i,n,t.caseSensitive?void 0:r=>r.toLowerCase(),s)}function VF(t,e){return(i,n,s,r)=>((r>i||r+s.length<n)&&(r=Math.max(0,i-2),s=t.sliceString(r,Math.min(t.length,n+2))),(e($g(s,i-r))!=Dt.Word||e(Ng(s,i-r))!=Dt.Word)&&(e(Ng(s,n-r))!=Dt.Word||e($g(s,n-r))!=Dt.Word))}class XF extends j${constructor(e){super(e)}nextMatch(e,i,n){let s=Pc(this.spec,e,n,e.doc.length).nextOverlapping();if(s.done){let r=Math.min(e.doc.length,i+this.spec.unquoted.length);s=Pc(this.spec,e,0,r).nextOverlapping()}return s.done||s.value.from==i&&s.value.to==n?null:s.value}prevMatchInRange(e,i,n){for(let s=n;;){let r=Math.max(i,s-1e4-this.spec.unquoted.length),o=Pc(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==i)return null;s-=1e4}}prevMatch(e,i,n){let s=this.prevMatchInRange(e,0,i);return s||(s=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=i||s.to!=n)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,i){let n=Pc(this.spec,e,0,e.doc.length),s=[];for(;!n.next().done;){if(s.length>=i)return null;s.push(n.value)}return s}highlight(e,i,n,s){let r=Pc(this.spec,e,Math.max(0,i-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function ZF(t,e,i){return(n,s,r)=>(!i||i(n,s,r))&&t(r[0],e,n,s)}function Rc(t,e,i,n){let s;return t.wholeWord&&(s=qF(e.charCategorizer(e.selection.main.head))),t.test&&(s=ZF(t.test,e,s)),new $$(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:s},i,n)}function $g(t,e){return t.slice(Di(t,e,!1),e)}function Ng(t,e){return t.slice(e,Di(t,e))}function qF(t){return(e,i,n)=>!n[0].length||(t($g(n.input,n.index))!=Dt.Word||t(Ng(n.input,n.index))!=Dt.Word)&&(t(Ng(n.input,n.index+n[0].length))!=Dt.Word||t($g(n.input,n.index+n[0].length))!=Dt.Word)}class WF extends j${nextMatch(e,i,n){let s=Rc(this.spec,e,n,e.doc.length).next();return s.done&&(s=Rc(this.spec,e,0,i).next()),s.done?null:s.value}prevMatchInRange(e,i,n){for(let s=1;;s++){let r=Math.max(i,n-s*1e4),o=Rc(this.spec,e,r,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==i||l.from>r+10))return l;if(r==i)return null}}prevMatch(e,i,n){return this.prevMatchInRange(e,0,i)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(i,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let s=n.length;s>0;s--){let r=+n.slice(0,s);if(r>0&&r<e.match.length)return e.match[r]+n.slice(s)}return i})}matchAll(e,i){let n=Rc(this.spec,e,0,e.doc.length),s=[];for(;!n.next().done;){if(s.length>=i)return null;s.push(n.value)}return s}highlight(e,i,n,s){let r=Rc(this.spec,e,Math.max(0,i-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Zf=ze.define(),rw=ze.define(),ba=Bi.define({create(t){return new V_(Lb(t).create(),null)},update(t,e){for(let i of e.effects)i.is(Zf)?t=new V_(i.value.create(),t.panel):i.is(rw)&&(t=new V_(t.query,i.value?ow:null));return t},provide:t=>Nf.from(t,e=>e.panel)});class V_{constructor(e,i){this.query=e,this.panel=i}}const UF=Pe.mark({class:"cm-searchMatch"}),YF=Pe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),HF=Jt.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(ba))}update(t){let e=t.state.field(ba);(e!=t.startState.field(ba)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Pe.none;let{view:i}=this,n=new yo;for(let s=0,r=i.visibleRanges,o=r.length;s<o;s++){let{from:l,to:c}=r[s];for(;s<o-1&&c>r[s+1].from-500;)c=r[++s].to;t.highlight(i.state,l,c,(u,d)=>{let p=i.state.selection.ranges.some(g=>g.from==u&&g.to==d);n.add(u,d,p?YF:UF)})}return n.finish()}},{decorations:t=>t.decorations});function _d(t){return e=>{let i=e.state.field(ba,!1);return i&&i.query.spec.valid?t(e,i):X$(e)}}const zg=_d((t,{query:e})=>{let{to:i}=t.state.selection.main,n=e.nextMatch(t.state,i,i);if(!n)return!1;let s=re.single(n.from,n.to),r=t.state.facet(Sh);return t.dispatch({selection:s,effects:[aw(t,n),r.scrollToMatch(s.main,t)],userEvent:"select.search"}),V$(t),!0}),jg=_d((t,{query:e})=>{let{state:i}=t,{from:n}=i.selection.main,s=e.prevMatch(i,n,n);if(!s)return!1;let r=re.single(s.from,s.to),o=t.state.facet(Sh);return t.dispatch({selection:r,effects:[aw(t,s),o.scrollToMatch(r.main,t)],userEvent:"select.search"}),V$(t),!0}),FF=_d((t,{query:e})=>{let i=e.matchAll(t.state,1e3);return!i||!i.length?!1:(t.dispatch({selection:re.create(i.map(n=>re.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),GF=({state:t,dispatch:e})=>{let i=t.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:n,to:s}=i.main,r=[],o=0;for(let l=new hh(t.doc,t.sliceDoc(n,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==n&&(o=r.length),r.push(re.range(l.value.from,l.value.to))}return e(t.update({selection:re.create(r,o),userEvent:"select.search.matches"})),!0},sM=_d((t,{query:e})=>{let{state:i}=t,{from:n,to:s}=i.selection.main;if(i.readOnly)return!1;let r=e.nextMatch(i,n,n);if(!r)return!1;let o=r,l=[],c,u,d=[];o.from==n&&o.to==s&&(u=i.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:u}),o=e.nextMatch(i,o.from,o.to),d.push(ve.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(n).number)+".")));let p=t.state.changes(l);return o&&(c=re.single(o.from,o.to).map(p),d.push(aw(t,o)),d.push(i.facet(Sh).scrollToMatch(c.main,t))),t.dispatch({changes:p,selection:c,effects:d,userEvent:"input.replace"}),!0}),KF=_d((t,{query:e})=>{if(t.state.readOnly)return!1;let i=e.matchAll(t.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!i.length)return!1;let n=t.state.phrase("replaced $ matches",i.length)+".";return t.dispatch({changes:i,effects:ve.announce.of(n),userEvent:"input.replace.all"}),!0});function ow(t){return t.state.facet(Sh).createPanel(t)}function Lb(t,e){var i,n,s,r,o;let l=t.selection.main,c=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!c)return e;let u=t.facet(Sh);return new z$({search:((i=e==null?void 0:e.literal)!==null&&i!==void 0?i:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(n=e==null?void 0:e.caseSensitive)!==null&&n!==void 0?n:u.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:u.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:u.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function I$(t){let e=WS(t,ow);return e&&e.dom.querySelector("[main-field]")}function V$(t){let e=I$(t);e&&e==t.root.activeElement&&e.select()}const X$=t=>{let e=t.state.field(ba,!1);if(e&&e.panel){let i=I$(t);if(i&&i!=t.root.activeElement){let n=Lb(t.state,e.query.spec);n.valid&&t.dispatch({effects:Zf.of(n)}),i.focus(),i.select()}}else t.dispatch({effects:[rw.of(!0),e?Zf.of(Lb(t.state,e.query.spec)):ze.appendConfig.of(iG)]});return!0},Z$=t=>{let e=t.state.field(ba,!1);if(!e||!e.panel)return!1;let i=WS(t,ow);return i&&i.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:rw.of(!1)}),!0},JF=[{key:"Mod-f",run:X$,scope:"editor search-panel"},{key:"F3",run:zg,shift:jg,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:zg,shift:jg,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Z$,scope:"editor search-panel"},{key:"Mod-Shift-l",run:GF},{key:"Mod-Alt-g",run:EF},{key:"Mod-d",run:jF,preventDefault:!0}];class eG{constructor(e){this.view=e;let i=this.query=e.state.field(ba).query.spec;this.commit=this.commit.bind(this),this.searchField=vt("input",{value:i.search,placeholder:Hn(e,"Find"),"aria-label":Hn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=vt("input",{value:i.replace,placeholder:Hn(e,"Replace"),"aria-label":Hn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=vt("input",{type:"checkbox",name:"case",form:"",checked:i.caseSensitive,onchange:this.commit}),this.reField=vt("input",{type:"checkbox",name:"re",form:"",checked:i.regexp,onchange:this.commit}),this.wordField=vt("input",{type:"checkbox",name:"word",form:"",checked:i.wholeWord,onchange:this.commit});function n(s,r,o){return vt("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=vt("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>zg(e),[Hn(e,"next")]),n("prev",()=>jg(e),[Hn(e,"previous")]),n("select",()=>FF(e),[Hn(e,"all")]),vt("label",null,[this.caseField,Hn(e,"match case")]),vt("label",null,[this.reField,Hn(e,"regexp")]),vt("label",null,[this.wordField,Hn(e,"by word")]),...e.state.readOnly?[]:[vt("br"),this.replaceField,n("replace",()=>sM(e),[Hn(e,"replace")]),n("replaceAll",()=>KF(e),[Hn(e,"replace all")])],vt("button",{name:"close",onclick:()=>Z$(e),"aria-label":Hn(e,"close"),type:"button"},["×"])])}commit(){let e=new z$({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:Zf.of(e)}))}keydown(e){iU(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?jg:zg)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),sM(this.view))}update(e){for(let i of e.transactions)for(let n of i.effects)n.is(Zf)&&!n.value.eq(this.query)&&this.setQuery(n.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(Sh).top}}function Hn(t,e){return t.state.phrase(e)}const pm=30,mm=/[\s\.,:;?!]/;function aw(t,{from:e,to:i}){let n=t.state.doc.lineAt(e),s=t.state.doc.lineAt(i).to,r=Math.max(n.from,e-pm),o=Math.min(s,i+pm),l=t.state.sliceDoc(r,o);if(r!=n.from){for(let c=0;c<pm;c++)if(!mm.test(l[c+1])&&mm.test(l[c])){l=l.slice(c);break}}if(o!=s){for(let c=l.length-1;c>l.length-pm;c--)if(!mm.test(l[c-1])&&mm.test(l[c])){l=l.slice(0,c);break}}return ve.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${n.number}.`)}const tG=ve.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"}}),iG=[ba,wo.low(HF),tG];class lw{constructor(e,i,n,s){this.state=e,this.pos=i,this.explicit=n,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let i=St(this.state).resolveInner(this.pos,-1);for(;i&&e.indexOf(i.name)<0;)i=i.parent;return i?{from:i.from,to:this.pos,text:this.state.sliceDoc(i.from,this.pos),type:i.type}:null}matchBefore(e){let i=this.state.doc.lineAt(this.pos),n=Math.max(i.from,this.pos-250),s=i.text.slice(n-i.from,this.pos-i.from),r=s.search(W$(e,!1));return r<0?null:{from:n+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,i,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(i),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function rM(t){let e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function nG(t){let e=Object.create(null),i=Object.create(null);for(let{label:s}of t){e[s[0]]=!0;for(let r=1;r<s.length;r++)i[s[r]]=!0}let n=rM(e)+rM(i)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function q$(t){let e=t.map(s=>typeof s=="string"?{label:s}:s),[i,n]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:nG(e);return s=>{let r=s.matchBefore(n);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:i}:null}}function sG(t,e){return i=>{for(let n=St(i.state).resolveInner(i.pos,-1);n;n=n.parent){if(t.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(i)}}class oM{constructor(e,i,n,s){this.completion=e,this.source=i,this.match=n,this.score=s}}function Sl(t){return t.selection.main.from}function W$(t,e){var i;let{source:n}=t,s=e&&n[0]!="^",r=n[n.length-1]!="$";return!s&&!r?t:new RegExp(`${s?"^":""}(?:${n})${r?"$":""}`,(i=t.flags)!==null&&i!==void 0?i:t.ignoreCase?"i":"")}const cw=Qr.define();function rG(t,e,i,n){let{main:s}=t.selection,r=i-s.from,o=n-s.from;return{...t.changeByRange(l=>{if(l!=s&&i!=n&&t.sliceDoc(l.from+r,l.from+o)!=t.sliceDoc(i,n))return{range:l};let c=t.toText(e);return{changes:{from:l.from+r,to:n==s.from?l.to:l.from+o,insert:c},range:re.cursor(l.from+r+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const aM=new WeakMap;function oG(t){if(!Array.isArray(t))return t;let e=aM.get(t);return e||aM.set(t,e=q$(t)),e}const Ig=ze.define(),qf=ze.define();class aG{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let i=0;i<e.length;){let n=Ln(e,i),s=gr(n);this.chars.push(n);let r=e.slice(i,i+s),o=r.toUpperCase();this.folded.push(Ln(o==r?r.toLowerCase():o,0)),i+=s}this.astral=e.length!=this.chars.length}ret(e,i){return this.score=e,this.matched=i,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:i,folded:n,any:s,precise:r,byWord:o}=this;if(i.length==1){let T=Ln(e,0),k=gr(T),A=k==e.length?0:-100;if(T!=i[0])if(T==n[0])A+=-200;else return null;return this.ret(A,[0,k])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=i.length,u=0;if(l<0){for(let T=0,k=Math.min(e.length,200);T<k&&u<c;){let A=Ln(e,T);(A==i[u]||A==n[u])&&(s[u++]=T),T+=gr(A)}if(u<c)return null}let d=0,p=0,g=!1,O=0,_=-1,b=-1,S=/[a-z]/.test(e),w=!0;for(let T=0,k=Math.min(e.length,200),A=0;T<k&&p<c;){let R=Ln(e,T);l<0&&(d<c&&R==i[d]&&(r[d++]=T),O<c&&(R==i[O]||R==n[O]?(O==0&&(_=T),b=T+1,O++):O=0));let E,$=R<255?R>=48&&R<=57||R>=97&&R<=122?2:R>=65&&R<=90?1:0:(E=AS(R))!=E.toLowerCase()?1:E!=E.toUpperCase()?2:0;(!T||$==1&&S||A==0&&$!=0)&&(i[p]==R||n[p]==R&&(g=!0)?o[p++]=T:o.length&&(w=!1)),A=$,T+=gr(R)}return p==c&&o[0]==0&&w?this.result(-100+(g?-200:0),o,e):O==c&&_==0?this.ret(-200-e.length+(b==e.length?0:-100),[0,b]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):O==c?this.ret(-900-e.length,[_,b]):p==c?this.result(-100+(g?-200:0)+-700+(w?0:-1100),o,e):i.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,i,n){let s=[],r=0;for(let o of i){let l=o+(this.astral?gr(Ln(n,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-n.length,s)}}class lG{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 i=e.slice(0,this.pattern.length),n=i==this.pattern?0:i.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,i.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const Li=xe.define({combine(t){return Lr(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:cG,filterStrict:!1,compareCompletions:(e,i)=>(e.sortText||e.label).localeCompare(i.sortText||i.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,i)=>e&&i,closeOnBlur:(e,i)=>e&&i,icons:(e,i)=>e&&i,tooltipClass:(e,i)=>n=>lM(e(n),i(n)),optionClass:(e,i)=>n=>lM(e(n),i(n)),addToOptions:(e,i)=>e.concat(i),filterStrict:(e,i)=>e||i})}});function lM(t,e){return t?e?t+" "+e:t:e}function cG(t,e,i,n,s,r){let o=t.textDirection==xt.RTL,l=o,c=!1,u="top",d,p,g=e.left-s.left,O=s.right-e.right,_=n.right-n.left,b=n.bottom-n.top;if(l&&g<Math.min(_,O)?l=!1:!l&&O<Math.min(_,g)&&(l=!0),_<=(l?g:O))d=Math.max(s.top,Math.min(i.top,s.bottom-b))-e.top,p=Math.min(400,l?g:O);else{c=!0,p=Math.min(400,(o?e.right:s.right-e.left)-30);let T=s.bottom-e.bottom;T>=b||T>e.top?d=i.bottom-e.top:(u="bottom",d=e.bottom-i.top)}let S=(e.bottom-e.top)/r.offsetHeight,w=(e.right-e.left)/r.offsetWidth;return{style:`${u}: ${d/S}px; max-width: ${p/w}px`,class:"cm-completionInfo-"+(c?o?"left-narrow":"right-narrow":l?"left":"right")}}function hG(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(i){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),i.type&&n.classList.add(...i.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(i,n,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=i.displayLabel||i.label,c=0;for(let u=0;u<r.length;){let d=r[u++],p=r[u++];d>c&&o.appendChild(document.createTextNode(l.slice(c,d)));let g=o.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(l.slice(d,p))),g.className="cm-completionMatchedText",c=p}return c<l.length&&o.appendChild(document.createTextNode(l.slice(c))),o},position:50},{render(i){if(!i.detail)return null;let n=document.createElement("span");return n.className="cm-completionDetail",n.textContent=i.detail,n},position:80}),e.sort((i,n)=>i.position-n.position).map(i=>i.render)}function X_(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let s=Math.floor(e/i);return{from:s*i,to:(s+1)*i}}let n=Math.floor((t-e)/i);return{from:t-(n+1)*i,to:t-n*i}}class uG{constructor(e,i,n){this.view=e,this.stateField=i,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let s=e.state.field(i),{options:r,selected:o}=s.open,l=e.state.facet(Li);this.optionContent=hG(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=X_(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=e.state.field(i).open;for(let d=c.target,p;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(p=/-(\d+)$/.exec(d.id))&&+p[1]<u.length){this.applyCompletion(e,u[+p[1]]),c.preventDefault();return}}),this.dom.addEventListener("focusout",c=>{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(Li).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:qf.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(e,i){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,i,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var i;let n=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=s){let{options:r,selected:o,disabled:l}=n.open;(!s.open||s.open.options!=r)&&(this.range=X_(r.length,o,e.state.facet(Li).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),l!=((i=s.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let i=this.tooltipClass(e);if(i!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of i.split(" "))n&&this.dom.classList.add(n);this.currentClass=i}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),i=e.open;(i.selected>-1&&i.selected<this.range.from||i.selected>=this.range.to)&&(this.range=X_(i.options.length,i.selected,this.view.state.facet(Li).maxRenderedOptions),this.showOptions(i.options,e.id));let n=this.updateSelectedOption(i.selected);if(n){this.destroyInfo();let{completion:s}=i.options[i.selected],{info:r}=s;if(!r)return;let o=typeof r=="string"?document.createTextNode(r):r(s);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,s)}).catch(l=>$n(this.view.state,l,"completion info")):(this.addInfoPane(o,s),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,i){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;n.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let i=null;for(let n=this.list.firstChild,s=this.range.from;n;n=n.nextSibling,s++)n.nodeName!="LI"||!n.id?s--:s==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),i=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby"));return i&&dG(this.list,i),i}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let i=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return s.top>Math.min(r.bottom,i.bottom)-10||s.bottom<Math.max(r.top,i.top)+10?null:this.view.state.facet(Li).positionInfo(this.view,i,s,n,r,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,i,n){const s=document.createElement("ul");s.id=i,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions")),s.addEventListener("mousedown",o=>{o.target==s&&o.preventDefault()});let r=null;for(let o=n.from;o<n.to;o++){let{completion:l,match:c}=e[o],{section:u}=l;if(u){let g=typeof u=="string"?u:u.name;if(g!=r&&(o>n.from||n.from==0))if(r=g,typeof u!="string"&&u.header)s.appendChild(u.header(u));else{let O=s.appendChild(document.createElement("completion-section"));O.textContent=g}}const d=s.appendChild(document.createElement("li"));d.id=i+"-"+o,d.setAttribute("role","option");let p=this.optionClass(l);p&&(d.className=p);for(let g of this.optionContent){let O=g(l,this.view.state,this.view,c);O&&d.appendChild(O)}}return n.from&&s.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&s.classList.add("cm-completionListIncompleteBottom"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function fG(t,e){return i=>new uG(i,t,e)}function dG(t,e){let i=t.getBoundingClientRect(),n=e.getBoundingClientRect(),s=i.height/t.offsetHeight;n.top<i.top?t.scrollTop-=(i.top-n.top)/s:n.bottom>i.bottom&&(t.scrollTop+=(n.bottom-i.bottom)/s)}function cM(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function pG(t,e){let i=[],n=null,s=null,r=d=>{i.push(d);let{section:p}=d.completion;if(p){n||(n=[]);let g=typeof p=="string"?p:p.name;n.some(O=>O.name==g)||n.push(typeof p=="string"?{name:g}:p)}},o=e.facet(Li);for(let d of t)if(d.hasResult()){let p=d.result.getMatch;if(d.result.filter===!1)for(let g of d.result.options)r(new oM(g,d.source,p?p(g):[],1e9-i.length));else{let g=e.sliceDoc(d.from,d.to),O,_=o.filterStrict?new lG(g):new aG(g);for(let b of d.result.options)if(O=_.match(b.label)){let S=b.displayLabel?p?p(b,O.matched):[]:O.matched,w=O.score+(b.boost||0);if(r(new oM(b,d.source,S,w)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:T}=b.section;s||(s=Object.create(null)),s[T]=Math.max(w,s[T]||-1e9)}}}}if(n){let d=Object.create(null),p=0,g=(O,_)=>(O.rank==="dynamic"&&_.rank==="dynamic"?s[_.name]-s[O.name]:0)||(typeof O.rank=="number"?O.rank:1e9)-(typeof _.rank=="number"?_.rank:1e9)||(O.name<_.name?-1:1);for(let O of n.sort(g))p-=1e5,d[O.name]=p;for(let O of i){let{section:_}=O.completion;_&&(O.score+=d[typeof _=="string"?_:_.name])}}let l=[],c=null,u=o.compareCompletions;for(let d of i.sort((p,g)=>g.score-p.score||u(p.completion,g.completion))){let p=d.completion;!c||c.label!=p.label||c.detail!=p.detail||c.type!=null&&p.type!=null&&c.type!=p.type||c.apply!=p.apply||c.boost!=p.boost?l.push(d):cM(d.completion)>cM(c)&&(l[l.length-1]=d),c=d.completion}return l}class Ic{constructor(e,i,n,s,r,o){this.options=e,this.attrs=i,this.tooltip=n,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,i){return e==this.selected||e>=this.options.length?this:new Ic(this.options,hM(i,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,i,n,s,r,o){if(s&&!o&&e.some(u=>u.isPending))return s.setDisabled();let l=pG(e,i);if(!l.length)return s&&e.some(u=>u.isPending)?s.setDisabled():null;let c=i.facet(Li).selectOnOpen?0:-1;if(s&&s.selected!=c&&s.selected!=-1){let u=s.options[s.selected].completion;for(let d=0;d<l.length;d++)if(l[d].completion==u){c=d;break}}return new Ic(l,hM(n,c),{pos:e.reduce((u,d)=>d.hasResult()?Math.min(u,d.from):u,1e8),create:yG,above:r.aboveCursor},s?s.timestamp:Date.now(),c,!1)}map(e){return new Ic(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Ic(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Vg{constructor(e,i,n){this.active=e,this.id=i,this.open=n}static start(){return new Vg(vG,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:i}=e,n=i.facet(Li),r=(n.override||i.languageDataAt("autocomplete",Sl(i)).map(oG)).map(c=>(this.active.find(d=>d.source==c)||new Ms(c,this.active.some(d=>d.state!=0)?1:0)).update(e,n));r.length==this.active.length&&r.every((c,u)=>c==this.active[u])&&(r=this.active);let o=this.open,l=e.effects.some(c=>c.is(hw));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!mG(r,this.active)||l?o=Ic.build(r,i,this.id,o,n,l):o&&o.disabled&&!r.some(c=>c.isPending)&&(o=null),!o&&r.every(c=>!c.isPending)&&r.some(c=>c.hasResult())&&(r=r.map(c=>c.hasResult()?new Ms(c.source,0):c));for(let c of e.effects)c.is(Y$)&&(o=o&&o.setSelected(c.value,this.id));return r==this.active&&o==this.open?this:new Vg(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?gG:OG}}function mG(t,e){if(t==e)return!0;for(let i=0,n=0;;){for(;i<t.length&&!t[i].hasResult();)i++;for(;n<e.length&&!e[n].hasResult();)n++;let s=i==t.length,r=n==e.length;if(s||r)return s==r;if(t[i++].result!=e[n++].result)return!1}}const gG={"aria-autocomplete":"list"},OG={};function hM(t,e){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i}const vG=[];function U$(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation(cw);if(n&&e.activateOnCompletion(n))return 12}let i=t.isUserEvent("input.type");return i&&e.activateOnTyping?5:i?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Ms{constructor(e,i,n=!1){this.source=e,this.state=i,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,i){let n=U$(e,i),s=this;(n&8||n&16&&this.touches(e))&&(s=new Ms(s.source,0)),n&4&&s.state==0&&(s=new Ms(this.source,1)),s=s.updateFor(e,n);for(let r of e.effects)if(r.is(Ig))s=new Ms(s.source,1,r.value);else if(r.is(qf))s=new Ms(s.source,0);else if(r.is(hw))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(e,i){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Sl(e.state))}}class Kc extends Ms{constructor(e,i,n,s,r,o){super(e,3,i),this.limit=n,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,i){var n;if(!(i&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=Sl(e.state);if(l>o||!s||i&2&&(Sl(e.startState)==this.from||l<this.limit))return new Ms(this.source,i&4?1:0);let c=e.changes.mapPos(this.limit);return _G(s.validFor,e.state,r,o)?new Kc(this.source,this.explicit,c,s,r,o):s.update&&(s=s.update(s,r,o,new lw(e.state,l,!1)))?new Kc(this.source,this.explicit,c,s,s.from,(n=s.to)!==null&&n!==void 0?n:Sl(e.state)):new Ms(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Kc(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Ms(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function _G(t,e,i,n){if(!t)return!1;let s=e.sliceDoc(i,n);return typeof t=="function"?t(s,i,n,e):W$(t,!0).test(s)}const hw=ze.define({map(t,e){return t.map(i=>i.map(e))}}),Y$=ze.define(),Dn=Bi.define({create(){return Vg.start()},update(t,e){return t.update(e)},provide:t=>[qS.from(t,e=>e.tooltip),ve.contentAttributes.from(t,e=>e.attrs)]});function uw(t,e){const i=e.completion.apply||e.completion.label;let n=t.state.field(Dn).active.find(s=>s.source==e.source);return n instanceof Kc?(typeof i=="string"?t.dispatch({...rG(t.state,i,n.from,n.to),annotations:cw.of(e.completion)}):i(t,e.completion,n.from,n.to),!0):!1}const yG=fG(Dn,uw);function gm(t,e="option"){return i=>{let n=i.state.field(Dn,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<i.state.facet(Li).interactionDelay)return!1;let s=1,r;e=="page"&&(r=CB(i,n.open.tooltip))&&(s=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:o}=n.open.options,l=n.open.selected>-1?n.open.selected+s*(t?1:-1):t?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),i.dispatch({effects:Y$.of(l)}),!0}}const bG=t=>{let e=t.state.field(Dn,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Li).interactionDelay?!1:uw(t,e.open.options[e.open.selected])},Z_=t=>t.state.field(Dn,!1)?(t.dispatch({effects:Ig.of(!0)}),!0):!1,xG=t=>{let e=t.state.field(Dn,!1);return!e||!e.active.some(i=>i.state!=0)?!1:(t.dispatch({effects:qf.of(null)}),!0)};class SG{constructor(e,i){this.active=e,this.context=i,this.time=Date.now(),this.updates=[],this.done=void 0}}const wG=50,CG=1e3,kG=Jt.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Dn).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Dn),i=t.state.facet(Li);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Dn)==e)return;let n=t.transactions.some(r=>{let o=U$(r,i);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;r<this.running.length;r++){let o=this.running[r];if(n||o.context.abortOnDocChange&&t.docChanged||o.updates.length+t.transactions.length>wG&&Date.now()-o.time>CG){for(let l of o.context.abortListeners)try{l()}catch(c){$n(this.view.state,c)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(r=>r.effects.some(o=>o.is(Ig)))&&(this.pendingStart=!0);let s=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of t.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Dn);for(let i of e.active)i.isPending&&!this.running.some(n=>n.active.source==i.source)&&this.startQuery(i);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Li).updateSyncTime))}startQuery(t){let{state:e}=this.view,i=Sl(e),n=new lw(e,i,t.explicit,this.view),s=new SG(t,n);this.running.push(s),Promise.resolve(t.source(n)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:qf.of(null)}),$n(this.view.state,r)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Li).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(Li),n=this.view.state.field(Dn);for(let s=0;s<this.running.length;s++){let r=this.running[s];if(r.done===void 0)continue;if(this.running.splice(s--,1),r.done){let l=Sl(r.updates.length?r.updates[0].startState:this.view.state),c=Math.min(l,r.done.from+(r.active.explicit?0:1)),u=new Kc(r.active.source,r.active.explicit,c,r.done,r.done.from,(t=r.done.to)!==null&&t!==void 0?t:l);for(let d of r.updates)u=u.update(d,i);if(u.hasResult()){e.push(u);continue}}let o=n.active.find(l=>l.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Ms(r.active.source,0);for(let c of r.updates)l=l.update(c,i);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:hw.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Dn,!1);if(e&&e.tooltip&&this.view.state.facet(Li).closeOnBlur){let i=e.open&&CB(this.view,e.open.tooltip);(!i||!i.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:qf.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Ig.of(!1)}),20),this.composing=0}}}),TG=typeof navigator=="object"&&/Win/.test(navigator.platform),AG=wo.highest(ve.domEventHandlers({keydown(t,e){let i=e.state.field(Dn,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&!(TG&&t.altKey)||t.metaKey)return!1;let n=i.open.options[i.open.selected],s=i.active.find(o=>o.source==n.source),r=n.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(t.key)>-1&&uw(e,n),!1}})),H$=ve.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"},".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"}}});class EG{constructor(e,i,n,s){this.field=e,this.line=i,this.from=n,this.to=s}}class fw{constructor(e,i,n){this.field=e,this.from=i,this.to=n}map(e){let i=e.mapPos(this.from,-1,Fi.TrackDel),n=e.mapPos(this.to,1,Fi.TrackDel);return i==null||n==null?null:new fw(this.field,i,n)}}class dw{constructor(e,i){this.lines=e,this.fieldPositions=i}instantiate(e,i){let n=[],s=[i],r=e.doc.lineAt(i),o=/^\s*/.exec(r.text)[0];for(let c of this.lines){if(n.length){let u=o,d=/^\t*/.exec(c)[0].length;for(let p=0;p<d;p++)u+=e.facet(yh);s.push(i+u.length-d),c=u+c.slice(d)}n.push(c),i+=c.length+1}let l=this.fieldPositions.map(c=>new fw(c.field,s[c.line]+c.from,s[c.line]+c.to));return{text:n,ranges:l}}static parse(e){let i=[],n=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,c=r[2]||r[3]||"",u=-1,d=c.replace(/\\[{}]/g,p=>p[1]);for(let p=0;p<i.length;p++)(l!=null?i[p].seq==l:d&&i[p].name==d)&&(u=p);if(u<0){let p=0;for(;p<i.length&&(l==null||i[p].seq!=null&&i[p].seq<l);)p++;i.splice(p,0,{seq:l,name:d}),u=p;for(let g of s)g.field>=u&&g.field++}for(let p of s)if(p.line==n.length&&p.from>r.index){let g=r[2]?3+(r[1]||"").length:2;p.from-=g,p.to-=g}s.push(new EG(u,n.length,r.index,r.index+d.length)),o=o.slice(0,r.index)+c+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,c,u)=>{for(let d of s)d.line==n.length&&d.from>u&&(d.from--,d.to--);return c}),n.push(o)}return new dw(n,s)}}let MG=Pe.widget({widget:new class extends Gs{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),PG=Pe.mark({class:"cm-snippetField"});class wh{constructor(e,i){this.ranges=e,this.active=i,this.deco=Pe.set(e.map(n=>(n.from==n.to?MG:PG).range(n.from,n.to)),!0)}map(e){let i=[];for(let n of this.ranges){let s=n.map(e);if(!s)return null;i.push(s)}return new wh(i,this.active)}selectionInsideField(e){return e.ranges.every(i=>this.ranges.some(n=>n.field==this.active&&n.from<=i.from&&n.to>=i.to))}}const yd=ze.define({map(t,e){return t&&t.map(e)}}),RG=ze.define(),Wf=Bi.define({create(){return null},update(t,e){for(let i of e.effects){if(i.is(yd))return i.value;if(i.is(RG)&&t)return new wh(t.ranges,i.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>ve.decorations.from(t,e=>e?e.deco:Pe.none)});function pw(t,e){return re.create(t.filter(i=>i.field==e).map(i=>re.range(i.from,i.to)))}function QG(t){let e=dw.parse(t);return(i,n,s,r)=>{let{text:o,ranges:l}=e.instantiate(i.state,s),{main:c}=i.state.selection,u={changes:{from:s,to:r==c.from?c.to:r,insert:at.of(o)},scrollIntoView:!0,annotations:n?[cw.of(n),hi.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=pw(l,0)),l.some(d=>d.field>0)){let d=new wh(l,0),p=u.effects=[yd.of(d)];i.state.field(Wf,!1)===void 0&&p.push(ze.appendConfig.of([Wf,NG,zG,H$]))}i.dispatch(i.state.update(u))}}function F$(t){return({state:e,dispatch:i})=>{let n=e.field(Wf,!1);if(!n||t<0&&n.active==0)return!1;let s=n.active+t,r=t>0&&!n.ranges.some(o=>o.field==s+t);return i(e.update({selection:pw(n.ranges,s),effects:yd.of(r?null:new wh(n.ranges,s)),scrollIntoView:!0})),!0}}const LG=({state:t,dispatch:e})=>t.field(Wf,!1)?(e(t.update({effects:yd.of(null)})),!0):!1,DG=F$(1),BG=F$(-1),$G=[{key:"Tab",run:DG,shift:BG},{key:"Escape",run:LG}],uM=xe.define({combine(t){return t.length?t[0]:$G}}),NG=wo.highest(Ll.compute([uM],t=>t.facet(uM)));function Qn(t,e){return{...e,apply:QG(t)}}const zG=ve.domEventHandlers({mousedown(t,e){let i=e.state.field(Wf,!1),n;if(!i||(n=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let s=i.ranges.find(r=>r.from<=n&&r.to>=n);return!s||s.field==i.active?!1:(e.dispatch({selection:pw(i.ranges,s.field),effects:yd.of(i.ranges.some(r=>r.field>s.field)?new wh(i.ranges,s.field):null),scrollIntoView:!0}),!0)}}),Uf={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},_l=ze.define({map(t,e){let i=e.mapPos(t,-1,Fi.TrackAfter);return i??void 0}}),mw=new class extends wa{};mw.startSide=1;mw.endSide=-1;const G$=Bi.define({create(){return Ge.empty},update(t,e){if(t=t.map(e.changes),e.selection){let i=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:n=>n>=i.from&&n<=i.to})}for(let i of e.effects)i.is(_l)&&(t=t.update({add:[mw.range(i.value,i.value+1)]}));return t}});function jG(){return[VG,G$]}const q_="()[]{}<>«»»«[]{}";function K$(t){for(let e=0;e<q_.length;e+=2)if(q_.charCodeAt(e)==t)return q_.charAt(e+1);return AS(t<128?t:t+1)}function J$(t,e){return t.languageDataAt("closeBrackets",e)[0]||Uf}const IG=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),VG=ve.inputHandler.of((t,e,i,n)=>{if((IG?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let s=t.state.selection.main;if(n.length>2||n.length==2&&gr(Ln(n,0))==1||e!=s.from||i!=s.to)return!1;let r=qG(t.state,n);return r?(t.dispatch(r),!0):!1}),XG=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=J$(t,t.selection.main.head).brackets||Uf.brackets,s=null,r=t.changeByRange(o=>{if(o.empty){let l=WG(t.doc,o.head);for(let c of n)if(c==l&&SO(t.doc,o.head)==K$(Ln(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:re.cursor(o.head-c.length)}}return{range:s=o}});return s||e(t.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},ZG=[{key:"Backspace",run:XG}];function qG(t,e){let i=J$(t,t.selection.main.head),n=i.brackets||Uf.brackets;for(let s of n){let r=K$(Ln(s,0));if(e==s)return r==s?HG(t,s,n.indexOf(s+s+s)>-1,i):UG(t,s,r,i.before||Uf.before);if(e==r&&e4(t,t.selection.main.from))return YG(t,s,r)}return null}function e4(t,e){let i=!1;return t.field(G$).between(0,t.doc.length,n=>{n==e&&(i=!0)}),i}function SO(t,e){let i=t.sliceString(e,e+2);return i.slice(0,gr(Ln(i,0)))}function WG(t,e){let i=t.sliceString(e-2,e);return gr(Ln(i,0))==i.length?i:i.slice(1)}function UG(t,e,i,n){let s=null,r=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:i,from:o.to}],effects:_l.of(o.to+e.length),range:re.range(o.anchor+e.length,o.head+e.length)};let l=SO(t.doc,o.head);return!l||/\s/.test(l)||n.indexOf(l)>-1?{changes:{insert:e+i,from:o.head},effects:_l.of(o.head+e.length),range:re.cursor(o.head+e.length)}:{range:s=o}});return s?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function YG(t,e,i){let n=null,s=t.changeByRange(r=>r.empty&&SO(t.doc,r.head)==i?{changes:{from:r.head,to:r.head+i.length,insert:i},range:re.cursor(r.head+i.length)}:n={range:r});return n?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function HG(t,e,i,n){let s=n.stringPrefixes||Uf.stringPrefixes,r=null,o=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:_l.of(l.to+e.length),range:re.range(l.anchor+e.length,l.head+e.length)};let c=l.head,u=SO(t.doc,c),d;if(u==e){if(fM(t,c))return{changes:{insert:e+e,from:c},effects:_l.of(c+e.length),range:re.cursor(c+e.length)};if(e4(t,c)){let g=i&&t.sliceDoc(c,c+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:c,to:c+g.length,insert:g},range:re.cursor(c+g.length)}}}else{if(i&&t.sliceDoc(c-2*e.length,c)==e+e&&(d=dM(t,c-2*e.length,s))>-1&&fM(t,d))return{changes:{insert:e+e+e+e,from:c},effects:_l.of(c+e.length),range:re.cursor(c+e.length)};if(t.charCategorizer(c)(u)!=Dt.Word&&dM(t,c,s)>-1&&!FG(t,c,e,s))return{changes:{insert:e+e,from:c},effects:_l.of(c+e.length),range:re.cursor(c+e.length)}}return{range:r=l}});return r?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function fM(t,e){let i=St(t).resolveInner(e+1);return i.parent&&i.from==e}function FG(t,e,i,n){let s=St(t).resolveInner(e,-1),r=n.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=t.sliceDoc(s.from,Math.min(s.to,s.from+i.length+r)),c=l.indexOf(i);if(!c||c>-1&&n.indexOf(l.slice(0,c))>-1){let d=s.firstChild;for(;d&&d.from==s.from&&d.to-d.from>i.length+c;){if(t.sliceDoc(d.to-i.length,d.to)==i)return!1;d=d.firstChild}return!0}let u=s.to==e&&s.parent;if(!u)break;s=u}return!1}function dM(t,e,i){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=Dt.Word)return e;for(let s of i){let r=e-s.length;if(t.sliceDoc(r,e)==s&&n(t.sliceDoc(r-1,r))!=Dt.Word)return r}return-1}function GG(t={}){return[AG,Dn,Li.of(t),kG,KG,H$]}const t4=[{key:"Ctrl-Space",run:Z_},{mac:"Alt-`",run:Z_},{mac:"Alt-i",run:Z_},{key:"Escape",run:xG},{key:"ArrowDown",run:gm(!0)},{key:"ArrowUp",run:gm(!1)},{key:"PageDown",run:gm(!0,"page")},{key:"PageUp",run:gm(!1,"page")},{key:"Enter",run:bG}],KG=wo.highest(Ll.computeN([Li],t=>t.facet(Li).defaultKeymap?[t4]:[]));class pM{constructor(e,i,n){this.from=e,this.to=i,this.diagnostic=n}}class fl{constructor(e,i,n){this.diagnostics=e,this.panel=i,this.selected=n}static init(e,i,n){let s=n.facet(Yf).markerFilter;s&&(e=s(e,n));let r=e.slice().sort((O,_)=>O.from-_.from||O.to-_.to),o=new yo,l=[],c=0,u=n.doc.iter(),d=0,p=n.doc.length;for(let O=0;;){let _=O==r.length?null:r[O];if(!_&&!l.length)break;let b,S;if(l.length)b=c,S=l.reduce((k,A)=>Math.min(k,A.to),_&&_.from>b?_.from:1e8);else{if(b=_.from,b>p)break;S=_.to,l.push(_),O++}for(;O<r.length;){let k=r[O];if(k.from==b&&(k.to>k.from||k.to==b))l.push(k),O++,S=Math.min(k.to,S);else{S=Math.min(k.from,S);break}}S=Math.min(S,p);let w=!1;if(l.some(k=>k.from==b&&(k.to==S||S==p))&&(w=b==S,!w&&S-b<10)){let k=b-(d+u.value.length);k>0&&(u.next(k),d=b);for(let A=b;;){if(A>=S){w=!0;break}if(!u.lineBreak&&d+u.value.length>A)break;A=d+u.value.length,d+=u.value.length,u.next()}}let T=uK(l);if(w)o.add(b,b,Pe.widget({widget:new aK(T),diagnostics:l.slice()}));else{let k=l.reduce((A,R)=>R.markClass?A+" "+R.markClass:A,"");o.add(b,S,Pe.mark({class:"cm-lintRange cm-lintRange-"+T+k,diagnostics:l.slice(),inclusiveEnd:l.some(A=>A.to>S)}))}if(c=S,c==p)break;for(let k=0;k<l.length;k++)l[k].to<=c&&l.splice(k--,1)}let g=o.finish();return new fl(g,i,Ma(g))}}function Ma(t,e=null,i=0){let n=null;return t.between(i,1e9,(s,r,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!n)n=new pM(s,r,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new pM(n.from,r,n.diagnostic)}}),n}function JG(t,e){let i=e.pos,n=e.end||i,s=t.state.facet(Yf).hideOn(t,i,n);if(s!=null)return s;let r=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(i4))||t.changes.touchesRange(r.from,Math.max(r.to,n)))}function eK(t,e){return t.field(ss,!1)?e:e.concat(ze.appendConfig.of(fK))}const i4=ze.define(),gw=ze.define(),n4=ze.define(),ss=Bi.define({create(){return new fl(Pe.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let i=t.diagnostics.map(e.changes),n=null,s=t.panel;if(t.selected){let r=e.changes.mapPos(t.selected.from,1);n=Ma(i,t.selected.diagnostic,r)||Ma(i,null,r)}!i.size&&s&&e.state.facet(Yf).autoPanel&&(s=null),t=new fl(i,s,n)}for(let i of e.effects)if(i.is(i4)){let n=e.state.facet(Yf).autoPanel?i.value.length?Hf.open:null:t.panel;t=fl.init(i.value,n,e.state)}else i.is(gw)?t=new fl(t.diagnostics,i.value?Hf.open:null,t.selected):i.is(n4)&&(t=new fl(t.diagnostics,t.panel,i.value));return t},provide:t=>[Nf.from(t,e=>e.panel),ve.decorations.from(t,e=>e.diagnostics)]}),tK=Pe.mark({class:"cm-lintRange cm-lintRange-active"});function iK(t,e,i){let{diagnostics:n}=t.state.field(ss),s,r=-1,o=-1;n.between(e-(i<0?1:0),e+(i>0?1:0),(c,u,{spec:d})=>{if(e>=c&&e<=u&&(c==u||(e>c||i>0)&&(e<u||i<0)))return s=d.diagnostics,r=c,o=u,!1});let l=t.state.facet(Yf).tooltipFilter;return s&&l&&(s=l(s,t.state)),s?{pos:r,end:o,above:t.state.doc.lineAt(r).to<o,create(){return{dom:nK(t,s)}}}:null}function nK(t,e){return vt("ul",{class:"cm-tooltip-lint"},e.map(i=>r4(t,i,!1)))}const sK=t=>{let e=t.state.field(ss,!1);(!e||!e.panel)&&t.dispatch({effects:eK(t.state,[gw.of(!0)])});let i=WS(t,Hf.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},mM=t=>{let e=t.state.field(ss,!1);return!e||!e.panel?!1:(t.dispatch({effects:gw.of(!1)}),!0)},rK=t=>{let e=t.state.field(ss,!1);if(!e)return!1;let i=t.state.selection.main,n=Ma(e.diagnostics,null,i.to+1);return!n&&(n=Ma(e.diagnostics,null,0),!n||n.from==i.from&&n.to==i.to)?!1:(t.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)},oK=[{key:"Mod-Shift-m",run:sK,preventDefault:!0},{key:"F8",run:rK}],Yf=xe.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...Lr(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:gM,tooltipFilter:gM,needsRefresh:(e,i)=>e?i?n=>e(n)||i(n):e:i,hideOn:(e,i)=>e?i?(n,s,r)=>e(n,s,r)||i(n,s,r):e:i,autoPanel:(e,i)=>e||i})}}});function gM(t,e){return t?e?(i,n)=>e(t(i,n),n):t:e}function s4(t){let e=[];if(t)e:for(let{name:i}of t){for(let n=0;n<i.length;n++){let s=i[n];if(/[a-zA-Z]/.test(s)&&!e.some(r=>r.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function r4(t,e,i){var n;let s=i?s4(e.actions):[];return vt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},vt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((r,o)=>{let l=!1,c=O=>{if(O.preventDefault(),l)return;l=!0;let _=Ma(t.state.field(ss).diagnostics,e);_&&r.apply(t,_.from,_.to)},{name:u}=r,d=s[o]?u.indexOf(s[o]):-1,p=d<0?u:[u.slice(0,d),vt("u",u.slice(d,d+1)),u.slice(d+1)],g=r.markClass?" "+r.markClass:"";return vt("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${s[o]})"`}.`},p)}),e.source&&vt("div",{class:"cm-diagnosticSource"},e.source))}class aK extends Gs{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return vt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class OM{constructor(e,i){this.diagnostic=i,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=r4(e,i,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Hf{constructor(e){this.view=e,this.items=[];let i=s=>{if(!(s.ctrlKey||s.altKey||s.metaKey)){if(s.keyCode==27)mM(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=s4(r.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==s.keyCode){let c=Ma(this.view.state.field(ss).diagnostics,r);c&&r.actions[l].apply(e,c.from,c.to)}}else return;s.preventDefault()}},n=s=>{for(let r=0;r<this.items.length;r++)this.items[r].dom.contains(s.target)&&this.moveSelection(r)};this.list=vt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:i,onclick:n}),this.dom=vt("div",{class:"cm-panel-lint"},this.list,vt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>mM(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(ss).selected;if(!e)return-1;for(let i=0;i<this.items.length;i++)if(this.items[i].diagnostic==e.diagnostic)return i;return-1}update(){let{diagnostics:e,selected:i}=this.view.state.field(ss),n=0,s=!1,r=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,c,{spec:u})=>{for(let d of u.diagnostics){if(o.has(d))continue;o.add(d);let p=-1,g;for(let O=n;O<this.items.length;O++)if(this.items[O].diagnostic==d){p=O;break}p<0?(g=new OM(this.view,d),this.items.splice(n,0,g),s=!0):(g=this.items[p],p>n&&(this.items.splice(n,p-n),s=!0)),i&&g.diagnostic==i.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),r=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new OM(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.top<c.top?this.list.scrollTop-=(c.top-l.top)/u:l.bottom>c.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function i(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)i();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)i()}moveSelection(e){if(this.selectedIndex<0)return;let i=this.view.state.field(ss),n=Ma(i.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:n4.of(n)})}static open(e){return new Hf(e)}}function lK(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function Om(t){return lK(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const cK=ve.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:Om("#d11")},".cm-lintRange-warning":{backgroundImage:Om("orange")},".cm-lintRange-info":{backgroundImage:Om("#999")},".cm-lintRange-hint":{backgroundImage:Om("#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}}});function hK(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function uK(t){let e="hint",i=1;for(let n of t){let s=hK(n.severity);s>i&&(i=s,e=n.severity)}return e}const fK=[ss,ve.decorations.compute([ss],t=>{let{selected:e,panel:i}=t.field(ss);return!e||!i||e.from==e.to?Pe.none:Pe.set([tK.range(e.from,e.to)])}),ZU(iK,{hideOn:JG}),cK];var vM=function(e){e===void 0&&(e={});var{crosshairCursor:i=!1}=e,n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(ZG)),e.defaultKeymap!==!1&&(n=n.concat(kF)),e.searchKeymap!==!1&&(n=n.concat(JF)),e.historyKeymap!==!1&&(n=n.concat(QH)),e.foldKeymap!==!1&&(n=n.concat(YY)),e.completionKeymap!==!1&&(n=n.concat(t4)),e.lintKeymap!==!1&&(n=n.concat(oK));var s=[];return e.lineNumbers!==!1&&s.push(nY()),e.highlightActiveLineGutter!==!1&&s.push(oY()),e.highlightSpecialChars!==!1&&s.push(_U()),e.history!==!1&&s.push(wH()),e.foldGutter!==!1&&s.push(KY()),e.drawSelection!==!1&&s.push(lU()),e.dropCursor!==!1&&s.push(dU()),e.allowMultipleSelections!==!1&&s.push(et.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&s.push(jY()),e.syntaxHighlighting!==!1&&s.push(KB(iH,{fallback:!0})),e.bracketMatching!==!1&&s.push(cH()),e.closeBrackets!==!1&&s.push(jG()),e.autocompletion!==!1&&s.push(GG()),e.rectangularSelection!==!1&&s.push(QU()),i!==!1&&s.push(BU()),e.highlightActiveLine!==!1&&s.push(CU()),e.highlightSelectionMatches!==!1&&s.push(RF()),e.tabSize&&typeof e.tabSize=="number"&&s.push(yh.of(" ".repeat(e.tabSize))),s.concat([Ll.of(n.flat())]).filter(Boolean)};const dK="#e5c07b",_M="#e06c75",pK="#56b6c2",mK="#ffffff",Ym="#abb2bf",Db="#7d8799",gK="#61afef",OK="#98c379",yM="#d19a66",vK="#c678dd",_K="#21252b",bM="#2c313a",xM="#282c34",W_="#353a42",yK="#3E4451",SM="#528bff",bK=ve.theme({"&":{color:Ym,backgroundColor:xM},".cm-content":{caretColor:SM},".cm-cursor, .cm-dropCursor":{borderLeftColor:SM},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:yK},".cm-panels":{backgroundColor:_K,color:Ym},".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:xM,color:Db,border:"none"},".cm-activeLineGutter":{backgroundColor:bM},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:W_},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:W_,borderBottomColor:W_},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:bM,color:Ym}}},{dark:!0}),xK=Od.define([{tag:X.keyword,color:vK},{tag:[X.name,X.deleted,X.character,X.propertyName,X.macroName],color:_M},{tag:[X.function(X.variableName),X.labelName],color:gK},{tag:[X.color,X.constant(X.name),X.standard(X.name)],color:yM},{tag:[X.definition(X.name),X.separator],color:Ym},{tag:[X.typeName,X.className,X.number,X.changed,X.annotation,X.modifier,X.self,X.namespace],color:dK},{tag:[X.operator,X.operatorKeyword,X.url,X.escape,X.regexp,X.link,X.special(X.string)],color:pK},{tag:[X.meta,X.comment],color:Db},{tag:X.strong,fontWeight:"bold"},{tag:X.emphasis,fontStyle:"italic"},{tag:X.strikethrough,textDecoration:"line-through"},{tag:X.link,color:Db,textDecoration:"underline"},{tag:X.heading,fontWeight:"bold",color:_M},{tag:[X.atom,X.bool,X.special(X.variableName)],color:yM},{tag:[X.processingInstruction,X.string,X.inserted],color:OK},{tag:X.invalid,color:mK}]),o4=[bK,KB(xK)];var SK=ve.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),wK=function(e){e===void 0&&(e={});var{indentWithTab:i=!0,editable:n=!0,readOnly:s=!1,theme:r="light",placeholder:o="",basicSetup:l=!0}=e,c=[];switch(i&&c.unshift(Ll.of([TF])),l&&(typeof l=="boolean"?c.unshift(vM()):c.unshift(vM(l))),o&&c.unshift(EU(o)),r){case"light":c.push(SK);break;case"dark":c.push(o4);break;case"none":break;default:c.push(r);break}return n===!1&&c.push(ve.editable.of(!1)),s&&c.push(et.readOnly.of(!0)),[...c]},CK=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)});class kK{constructor(e,i){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=i,this.timeoutMS=i,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(i=>{try{i()}catch(n){console.error("TimeoutLatch callback error:",n)}})}}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 wM{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 U_=null,TK=()=>typeof window>"u"?new wM:(U_||(U_=new wM),U_),CM=Qr.define(),AK=200,EK=[];function MK(t){var{value:e,selection:i,onChange:n,onStatistics:s,onCreateEditor:r,onUpdate:o,extensions:l=EK,autoFocus:c,theme:u="light",height:d=null,minHeight:p=null,maxHeight:g=null,width:O=null,minWidth:_=null,maxWidth:b=null,placeholder:S="",editable:w=!0,readOnly:T=!1,indentWithTab:k=!0,basicSetup:A=!0,root:R,initialState:E}=t,[$,N]=I.useState(),[q,G]=I.useState(),[U,Q]=I.useState(),D=I.useState(()=>({current:null}))[0],z=I.useState(()=>({current:null}))[0],j=ve.theme({"&":{height:d,minHeight:p,maxHeight:g,width:O,minWidth:_,maxWidth:b},"& .cm-scroller":{height:"100% !important"}}),B=ve.updateListener.of(F=>{if(F.docChanged&&typeof n=="function"&&!F.transactions.some(J=>J.annotation(CM))){D.current?D.current.reset():(D.current=new kK(()=>{if(z.current){var J=z.current;z.current=null,J()}D.current=null},AK),TK().add(D.current));var M=F.state.doc,V=M.toString();n(V,F)}s&&s(CK(F))}),Z=wK({theme:u,editable:w,readOnly:T,placeholder:S,indentWithTab:k,basicSetup:A}),H=[B,j,...Z];return o&&typeof o=="function"&&H.push(ve.updateListener.of(o)),H=H.concat(l),I.useLayoutEffect(()=>{if($&&!U){var F={doc:e,selection:i,extensions:H},M=E?et.fromJSON(E.json,F,E.fields):et.create(F);if(Q(M),!q){var V=new ve({state:M,parent:$,root:R});G(V),r&&r(V,M)}}return()=>{q&&(Q(void 0),G(void 0))}},[$,U]),I.useEffect(()=>{t.container&&N(t.container)},[t.container]),I.useEffect(()=>()=>{q&&(q.destroy(),G(void 0)),D.current&&(D.current.cancel(),D.current=null)},[q]),I.useEffect(()=>{c&&q&&q.focus()},[c,q]),I.useEffect(()=>{q&&q.dispatch({effects:ze.reconfigure.of(H)})},[u,l,d,p,g,O,_,b,S,w,T,k,A,n,o]),I.useEffect(()=>{if(e!==void 0){var F=q?q.state.doc.toString():"";if(q&&e!==F){var M=D.current&&!D.current.isDone,V=()=>{q&&e!==q.state.doc.toString()&&q.dispatch({changes:{from:0,to:q.state.doc.toString().length,insert:e||""},annotations:[CM.of(!0)]})};M?z.current=V:V()}}},[e,q]),{state:U,setState:Q,view:q,setView:G,container:$,setContainer:N}}var PK=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],a4=I.forwardRef((t,e)=>{var{className:i,value:n="",selection:s,extensions:r=[],onChange:o,onStatistics:l,onCreateEditor:c,onUpdate:u,autoFocus:d,theme:p="light",height:g,minHeight:O,maxHeight:_,width:b,minWidth:S,maxWidth:w,basicSetup:T,placeholder:k,indentWithTab:A,editable:R,readOnly:E,root:$,initialState:N}=t,q=YZ(t,PK),G=I.useRef(null),{state:U,view:Q,container:D,setContainer:z}=MK({root:$,value:n,autoFocus:d,theme:p,height:g,minHeight:O,maxHeight:_,width:b,minWidth:S,maxWidth:w,basicSetup:T,placeholder:k,indentWithTab:A,editable:R,readOnly:E,selection:s,onChange:o,onStatistics:l,onCreateEditor:c,onUpdate:u,extensions:r,initialState:N});I.useImperativeHandle(e,()=>({editor:G.current,state:U,view:Q}),[G,D,U,Q]);var j=I.useCallback(Z=>{G.current=Z,z(Z)},[z]);if(typeof n!="string")throw new Error("value must be typeof string but got "+typeof n);var B=typeof p=="string"?"cm-theme-"+p:"cm-theme";return x.jsx("div",V1({ref:j,className:""+B+(i?" "+i:"")},q))});a4.displayName="CodeMirror";class Xg{static create(e,i,n,s,r){let o=s+(s<<8)+e+(i<<4)|0;return new Xg(e,i,n,o,r,[],[])}constructor(e,i,n,s,r,o,l){this.type=e,this.value=i,this.from=n,this.hash=s,this.end=r,this.children=o,this.positions=l,this.hashProp=[[je.contextHash,s]]}addChild(e,i){e.prop(je.contextHash)!=this.hash&&(e=new ct(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(i)}toTree(e,i=this.end){let n=this.children.length-1;return n>=0&&(i=Math.max(i,this.positions[n]+this.children[n].length+this.from)),new ct(e.types[this.type],this.children,this.positions,i-this.from).balance({makeTree:(s,r,o)=>new ct(_i.none,s,r,o,this.hashProp)})}}var pe;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(pe||(pe={}));class RK{constructor(e,i){this.start=e,this.content=i,this.marks=[],this.parsers=[]}}class QK{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return _f(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,i=0,n=0){for(let s=i;s<e;s++)n+=this.text.charCodeAt(s)==9?4-n%4:1;return n}findColumn(e){let i=0;for(let n=0;i<this.text.length&&n<e;i++)n+=this.text.charCodeAt(i)==9?4-n%4:1;return i}scrub(){if(!this.baseIndent)return this.text;let e="";for(let i=0;i<this.basePos;i++)e+=" ";return e+this.text.slice(this.basePos)}}function kM(t,e,i){if(i.pos==i.text.length||t!=e.block&&i.indent>=e.stack[i.depth+1].value+i.baseIndent)return!0;if(i.indent>=i.baseIndent+4)return!1;let n=(t.type==pe.OrderedList?_w:vw)(i,e,!1);return n>0&&(t.type!=pe.BulletList||Ow(i,e,!1)<0)&&i.text.charCodeAt(i.pos+n-1)==t.value}const l4={[pe.Blockquote](t,e,i){return i.next!=62?!1:(i.markers.push(it(pe.QuoteMark,e.lineStart+i.pos,e.lineStart+i.pos+1)),i.moveBase(i.pos+(Ds(i.text.charCodeAt(i.pos+1))?2:1)),t.end=e.lineStart+i.text.length,!0)},[pe.ListItem](t,e,i){return i.indent<i.baseIndent+t.value&&i.next>-1?!1:(i.moveBaseColumn(i.baseIndent+t.value),!0)},[pe.OrderedList]:kM,[pe.BulletList]:kM,[pe.Document](){return!0}};function Ds(t){return t==32||t==9||t==10||t==13}function _f(t,e=0){for(;e<t.length&&Ds(t.charCodeAt(e));)e++;return e}function TM(t,e,i){for(;e>i&&Ds(t.charCodeAt(e-1));)e--;return e}function c4(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let i=e;i<t.text.length;i++)if(t.text.charCodeAt(i)==96)return-1}return e}function h4(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function Ow(t,e,i){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let n=1;for(let s=t.pos+1;s<t.text.length;s++){let r=t.text.charCodeAt(s);if(r==t.next)n++;else if(!Ds(r))return-1}return i&&t.next==45&&d4(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(O4.SetextHeading)>-1||n<3?-1:1}function u4(t,e){for(let i=t.stack.length-1;i>=0;i--)if(t.stack[i].type==e)return!0;return!1}function vw(t,e,i){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||Ds(t.text.charCodeAt(t.pos+1)))&&(!i||u4(e,pe.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function _w(t,e,i){let n=t.pos,s=t.next;for(;s>=48&&s<=57;){n++;if(n==t.text.length)return-1;s=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||s!=46&&s!=41||n<t.text.length-1&&!Ds(t.text.charCodeAt(n+1))||i&&!u4(e,pe.OrderedList)&&(t.skipSpace(n+1)==t.text.length||n>t.pos+1||t.next!=49)?-1:n+1-t.pos}function f4(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let i=e-t.pos;return i>6?-1:i}function d4(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let i=e;for(;e<t.text.length&&Ds(t.text.charCodeAt(e));)e++;return e==t.text.length?i:-1}const Bb=/^[ \t]*$/,p4=/-->/,m4=/\?>/,$b=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,p4],[/^\s*<\?/,m4],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,Bb],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,Bb]];function g4(t,e,i){if(t.next!=60)return-1;let n=t.text.slice(t.pos);for(let s=0,r=$b.length-(i?1:0);s<r;s++)if($b[s][0].test(n))return s;return-1}function AM(t,e){let i=t.countIndent(e,t.pos,t.indent),n=t.countIndent(t.skipSpace(e),e,i);return n>=i+5?i+1:n}function na(t,e,i){let n=t.length-1;n>=0&&t[n].to==e&&t[n].type==pe.CodeText?t[n].to=i:t.push(it(pe.CodeText,e,i))}const vm={LinkReference:void 0,IndentedCode(t,e){let i=e.baseIndent+4;if(e.indent<i)return!1;let n=e.findColumn(i),s=t.lineStart+n,r=t.lineStart+e.text.length,o=[],l=[];for(na(o,s,r);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){na(l,t.lineStart-1,t.lineStart);for(let c of e.markers)l.push(c)}else{if(e.indent<i)break;{if(l.length){for(let u of l)u.type==pe.CodeText?na(o,u.from,u.to):o.push(u);l=[]}na(o,t.lineStart-1,t.lineStart);for(let u of e.markers)o.push(u);r=t.lineStart+e.text.length;let c=t.lineStart+e.findColumn(e.baseIndent+4);c<r&&na(o,c,r)}}return l.length&&(l=l.filter(c=>c.type!=pe.CodeText),l.length&&(e.markers=l.concat(e.markers))),t.addNode(t.buffer.writeElements(o,-s).finish(pe.CodeBlock,r-s),s),!0},FencedCode(t,e){let i=c4(e);if(i<0)return!1;let n=t.lineStart+e.pos,s=e.next,r=i-e.pos,o=e.skipSpace(i),l=TM(e.text,e.text.length,o),c=[it(pe.CodeMark,n,n+r)];o<l&&c.push(it(pe.CodeInfo,t.lineStart+o,t.lineStart+l));for(let u=!0,d=!0,p=!1;t.nextLine()&&e.depth>=t.stack.length;u=!1){let g=e.pos;if(e.indent-e.baseIndent<4)for(;g<e.text.length&&e.text.charCodeAt(g)==s;)g++;if(g-e.pos>=r&&e.skipSpace(g)==e.text.length){for(let O of e.markers)c.push(O);d&&p&&na(c,t.lineStart-1,t.lineStart),c.push(it(pe.CodeMark,t.lineStart+e.pos,t.lineStart+g)),t.nextLine();break}else{p=!0,u||(na(c,t.lineStart-1,t.lineStart),d=!1);for(let b of e.markers)c.push(b);let O=t.lineStart+e.basePos,_=t.lineStart+e.text.length;O<_&&(na(c,O,_),d=!1)}}return t.addNode(t.buffer.writeElements(c,-n).finish(pe.FencedCode,t.prevLineEnd()-n),n),!0},Blockquote(t,e){let i=h4(e);return i<0?!1:(t.startContext(pe.Blockquote,e.pos),t.addNode(pe.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+i),null)},HorizontalRule(t,e){if(Ow(e,t,!1)<0)return!1;let i=t.lineStart+e.pos;return t.nextLine(),t.addNode(pe.HorizontalRule,i),!0},BulletList(t,e){let i=vw(e,t,!1);if(i<0)return!1;t.block.type!=pe.BulletList&&t.startContext(pe.BulletList,e.basePos,e.next);let n=AM(e,e.pos+1);return t.startContext(pe.ListItem,e.basePos,n-e.baseIndent),t.addNode(pe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+i),e.moveBaseColumn(n),null},OrderedList(t,e){let i=_w(e,t,!1);if(i<0)return!1;t.block.type!=pe.OrderedList&&t.startContext(pe.OrderedList,e.basePos,e.text.charCodeAt(e.pos+i-1));let n=AM(e,e.pos+i);return t.startContext(pe.ListItem,e.basePos,n-e.baseIndent),t.addNode(pe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+i),e.moveBaseColumn(n),null},ATXHeading(t,e){let i=f4(e);if(i<0)return!1;let n=e.pos,s=t.lineStart+n,r=TM(e.text,e.text.length,n),o=r;for(;o>n&&e.text.charCodeAt(o-1)==e.next;)o--;(o==r||o==n||!Ds(e.text.charCodeAt(o-1)))&&(o=e.text.length);let l=t.buffer.write(pe.HeaderMark,0,i).writeElements(t.parser.parseInline(e.text.slice(n+i+1,o),s+i+1),-s);o<e.text.length&&l.write(pe.HeaderMark,o-n,r-n);let c=l.finish(pe.ATXHeading1-1+i,e.text.length-n);return t.nextLine(),t.addNode(c,s),!0},HTMLBlock(t,e){let i=g4(e,t,!1);if(i<0)return!1;let n=t.lineStart+e.pos,s=$b[i][1],r=[],o=s!=Bb;for(;!s.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){o=!1;break}for(let u of e.markers)r.push(u)}o&&t.nextLine();let l=s==p4?pe.CommentBlock:s==m4?pe.ProcessingInstructionBlock:pe.HTMLBlock,c=t.prevLineEnd();return t.addNode(t.buffer.writeElements(r,-n).finish(l,c-n),n),!0},SetextHeading:void 0};class LK{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,i,n){if(this.stage==-1)return!1;let s=n.content+`
70
- `+i.scrub(),r=this.advance(s);return r>-1&&r<s.length?this.complete(e,n,r):!1}finish(e,i){return(this.stage==2||this.stage==3)&&_f(i.content,this.pos)==i.content.length?this.complete(e,i,i.content.length):!1}complete(e,i,n){return e.addLeafElement(i,it(pe.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(k4(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(it(pe.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(w4(e,_f(e,this.pos),this.start)))return-1}else if(this.stage==2){let i=_f(e,this.pos),n=0;if(i>this.pos){let s=C4(e,i,this.start);if(s){let r=Y_(e,s.to-this.start);r>0&&(this.nextStage(s),n=r)}}return n||(n=Y_(e,this.pos)),n>0&&n<e.length?n:-1}else return Y_(e,this.pos)}}}function Y_(t,e){for(;e<t.length;e++){let i=t.charCodeAt(e);if(i==10)break;if(!Ds(i))return-1}return e}class DK{nextLine(e,i,n){let s=i.depth<e.stack.length?-1:d4(i),r=i.next;if(s<0)return!1;let o=it(pe.HeaderMark,e.lineStart+i.pos,e.lineStart+s);return e.nextLine(),e.addLeafElement(n,it(r==61?pe.SetextHeading1:pe.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}}const O4={LinkReference(t,e){return e.content.charCodeAt(0)==91?new LK(e):null},SetextHeading(){return new DK}},BK=[(t,e)=>f4(e)>=0,(t,e)=>c4(e)>=0,(t,e)=>h4(e)>=0,(t,e)=>vw(e,t,!0)>=0,(t,e)=>_w(e,t,!0)>=0,(t,e)=>Ow(e,t,!0)>=0,(t,e)=>g4(e,t,!0)>=0],$K={text:"",end:0};class NK{constructor(e,i,n,s){this.parser=e,this.input=i,this.ranges=s,this.line=new QK,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=s[s.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=s[0].from,this.block=Xg.create(pe.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new IK(n,i):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let n=0;;){let s=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;n<e.markers.length&&(!s||e.markers[n].from<s.end);){let r=e.markers[n++];this.addNode(r.type,r.from,r.to)}if(!s)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let n of this.parser.blockParsers)if(n){let s=n(this,e);if(s!=!1){if(s==!0)return null;e.forward();continue e}}break}let i=new RK(this.lineStart+e.pos,e.text.slice(e.pos));for(let n of this.parser.leafBlockParsers)if(n){let s=n(this,i);s&&i.parsers.push(s)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,i))break e}for(let n of i.parsers)if(n.nextLine(this,e,i))return null;i.content+=`
71
- `+e.scrub();for(let n of e.markers)i.marks.push(n)}return this.finishLeaf(i),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let i=this.fragments.takeNodes(this);return i?(this.absoluteLineStart+=i,this.lineStart=T4(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let i=$K;if(i.end=e,e>=this.to)i.text="";else if(i.text=this.lineChunkAt(e),i.end+=i.text.length,this.ranges.length>1){let n=this.absoluteLineStart,s=this.rangeI;for(;this.ranges[s].to<i.end;){s++;let r=this.ranges[s].from,o=this.lineChunkAt(r);i.end=r+o.length,i.text=i.text.slice(0,this.ranges[s-1].to-n)+o,n=i.end-i.text.length}}return i}readLine(){let{line:e}=this,{text:i,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(i);e.depth<this.stack.length;e.depth++){let s=this.stack[e.depth],r=this.parser.skipContextMarkup[s.type];if(!r)throw new Error("Unhandled block context "+pe[s.type]);let o=this.line.markers.length;if(!r(s,this,e)){this.line.markers.length>o&&(s.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let i=this.input.chunk(e),n;if(this.input.lineChunks)n=i==`
72
- `?"":i;else{let s=i.indexOf(`
73
- `);n=s<0?i:i.slice(0,s)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,i,n=0){this.block=Xg.create(e,n,this.lineStart+i,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,i,n=0){this.startContext(this.parser.getNodeType(e),i,n)}addNode(e,i,n){typeof e=="number"&&(e=new ct(this.parser.nodeSet.types[e],uh,uh,(n??this.prevLineEnd())-i)),this.block.addChild(e,i-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,i){this.addNode(this.buffer.writeElements(zb(i.children,e.marks),-i.from).finish(i.type,i.to-i.from),i.from)}finishContext(){let e=this.stack.pop(),i=this.stack[this.stack.length-1];i.addChild(e.toTree(this.parser.nodeSet),e.from-i.from),this.block=i}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?v4(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let i=zb(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(i,-e.start).finish(pe.Paragraph,e.content.length),e.start)}elt(e,i,n,s){return typeof e=="string"?it(this.parser.getNodeType(e),i,n,s):new b4(e,i)}get buffer(){return new y4(this.parser.nodeSet)}}function v4(t,e,i,n,s){let r=t[e].to,o=[],l=[],c=i.from+n;function u(d,p){for(;p?d>=r:d>r;){let g=t[e+1].from-r;n+=g,d+=g,e++,r=t[e].to}}for(let d=i.firstChild;d;d=d.nextSibling){u(d.from+n,!0);let p=d.from+n,g,O=s.get(d.tree);O?g=O:d.to+n>r?(g=v4(t,e,d,n,s),u(d.to+n,!1)):g=d.toTree(),o.push(g),l.push(p-c)}return u(i.to+n,!1),new ct(i.type,o,l,i.to+n-c,i.tree?i.tree.propValues:void 0)}class wO extends FS{constructor(e,i,n,s,r,o,l,c,u){super(),this.nodeSet=e,this.blockParsers=i,this.leafBlockParsers=n,this.blockNames=s,this.endLeafBlock=r,this.skipContextMarkup=o,this.inlineParsers=l,this.inlineNames=c,this.wrappers=u,this.nodeTypes=Object.create(null);for(let d of e.types)this.nodeTypes[d.name]=d.id}createParse(e,i,n){let s=new NK(this,e,i,n);for(let r of this.wrappers)s=r(s,e,i,n);return s}configure(e){let i=Nb(e);if(!i)return this;let{nodeSet:n,skipContextMarkup:s}=this,r=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),c=this.inlineParsers.slice(),u=this.inlineNames.slice(),d=this.endLeafBlock.slice(),p=this.wrappers;if(Pu(i.defineNodes)){s=Object.assign({},s);let g=n.types.slice(),O;for(let _ of i.defineNodes){let{name:b,block:S,composite:w,style:T}=typeof _=="string"?{name:_}:_;if(g.some(R=>R.name==b))continue;w&&(s[g.length]=(R,E,$)=>w(E,$,R.value));let k=g.length,A=w?["Block","BlockContext"]:S?k>=pe.ATXHeading1&&k<=pe.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;g.push(_i.define({id:k,name:b,props:A&&[[je.group,A]]})),T&&(O||(O={}),Array.isArray(T)||T instanceof ns?O[b]=T:Object.assign(O,T))}n=new pd(g),O&&(n=n.extend(_h(O)))}if(Pu(i.props)&&(n=n.extend(...i.props)),Pu(i.remove))for(let g of i.remove){let O=this.blockNames.indexOf(g),_=this.inlineNames.indexOf(g);O>-1&&(r[O]=o[O]=void 0),_>-1&&(c[_]=void 0)}if(Pu(i.parseBlock))for(let g of i.parseBlock){let O=l.indexOf(g.name);if(O>-1)r[O]=g.parse,o[O]=g.leaf;else{let _=g.before?_m(l,g.before):g.after?_m(l,g.after)+1:l.length-1;r.splice(_,0,g.parse),o.splice(_,0,g.leaf),l.splice(_,0,g.name)}g.endLeaf&&d.push(g.endLeaf)}if(Pu(i.parseInline))for(let g of i.parseInline){let O=u.indexOf(g.name);if(O>-1)c[O]=g.parse;else{let _=g.before?_m(u,g.before):g.after?_m(u,g.after)+1:u.length-1;c.splice(_,0,g.parse),u.splice(_,0,g.name)}}return i.wrap&&(p=p.concat(i.wrap)),new wO(n,r,o,l,d,s,c,u,p)}getNodeType(e){let i=this.nodeTypes[e];if(i==null)throw new RangeError(`Unknown node type '${e}'`);return i}parseInline(e,i){let n=new yw(this,e,i);e:for(let s=i;s<n.end;){let r=n.char(s);for(let o of this.inlineParsers)if(o){let l=o(n,r,s);if(l>=0){s=l;continue e}}s++}return n.resolveMarkers(0)}}function Pu(t){return t!=null&&t.length>0}function Nb(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=Nb(t[0]);if(t.length==1)return e;let i=Nb(t.slice(1));if(!i||!e)return e||i;let n=(o,l)=>(o||uh).concat(l||uh),s=e.wrap,r=i.wrap;return{props:n(e.props,i.props),defineNodes:n(e.defineNodes,i.defineNodes),parseBlock:n(e.parseBlock,i.parseBlock),parseInline:n(e.parseInline,i.parseInline),remove:n(e.remove,i.remove),wrap:s?r?(o,l,c,u)=>s(r(o,l,c,u),l,c,u):s:r}}function _m(t,e){let i=t.indexOf(e);if(i<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return i}let _4=[_i.none];for(let t=1,e;e=pe[t];t++)_4[t]=_i.define({id:t,name:e,props:t>=pe.Escape?[]:[[je.group,t in l4?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const uh=[];class y4{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,i,n,s=0){return this.content.push(e,i,n,4+s*4),this}writeElements(e,i=0){for(let n of e)n.writeTo(this,i);return this}finish(e,i){return ct.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:i})}}let Ff=class{constructor(e,i,n,s=uh){this.type=e,this.from=i,this.to=n,this.children=s}writeTo(e,i){let n=e.content.length;e.writeElements(this.children,i),e.content.push(this.type,this.from+i,this.to+i,e.content.length+4-n)}toTree(e){return new y4(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class b4{constructor(e,i){this.tree=e,this.from=i}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return uh}writeTo(e,i){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+i,this.to+i,-1)}toTree(){return this.tree}}function it(t,e,i,n){return new Ff(t,e,i,n)}const x4={resolve:"Emphasis",mark:"EmphasisMark"},S4={resolve:"Emphasis",mark:"EmphasisMark"},dl={},Zg={};class is{constructor(e,i,n,s){this.type=e,this.from=i,this.to=n,this.side=s}}const EM="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Gf=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Gf=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const H_={Escape(t,e,i){if(e!=92||i==t.end-1)return-1;let n=t.char(i+1);for(let s=0;s<EM.length;s++)if(EM.charCodeAt(s)==n)return t.append(it(pe.Escape,i,i+2));return-1},Entity(t,e,i){if(e!=38)return-1;let n=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(i+1,i+31));return n?t.append(it(pe.Entity,i,i+1+n[0].length)):-1},InlineCode(t,e,i){if(e!=96||i&&t.char(i-1)==96)return-1;let n=i+1;for(;n<t.end&&t.char(n)==96;)n++;let s=n-i,r=0;for(;n<t.end;n++)if(t.char(n)==96){if(r++,r==s&&t.char(n+1)!=96)return t.append(it(pe.InlineCode,i,n+1,[it(pe.CodeMark,i,i+s),it(pe.CodeMark,n+1-s,n+1)]))}else r=0;return-1},HTMLTag(t,e,i){if(e!=60||i==t.end-1)return-1;let n=t.slice(i+1,t.end),s=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(n);if(s)return t.append(it(pe.Autolink,i,i+1+s[0].length,[it(pe.LinkMark,i,i+1),it(pe.URL,i+1,i+s[0].length),it(pe.LinkMark,i+s[0].length,i+1+s[0].length)]));let r=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(n);if(r)return t.append(it(pe.Comment,i,i+1+r[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return t.append(it(pe.ProcessingInstruction,i,i+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return l?t.append(it(pe.HTMLTag,i,i+1+l[0].length)):-1},Emphasis(t,e,i){if(e!=95&&e!=42)return-1;let n=i+1;for(;t.char(n)==e;)n++;let s=t.slice(i-1,i),r=t.slice(n,n+1),o=Gf.test(s),l=Gf.test(r),c=/\s|^$/.test(s),u=/\s|^$/.test(r),d=!u&&(!l||c||o),p=!c&&(!o||u||l),g=d&&(e==42||!p||o),O=p&&(e==42||!d||l);return t.append(new is(e==95?x4:S4,i,n,(g?1:0)|(O?2:0)))},HardBreak(t,e,i){if(e==92&&t.char(i+1)==10)return t.append(it(pe.HardBreak,i,i+2));if(e==32){let n=i+1;for(;t.char(n)==32;)n++;if(t.char(n)==10&&n>=i+2)return t.append(it(pe.HardBreak,i,n+1))}return-1},Link(t,e,i){return e==91?t.append(new is(dl,i,i+1,1)):-1},Image(t,e,i){return e==33&&t.char(i+1)==91?t.append(new is(Zg,i,i+2,1)):-1},LinkEnd(t,e,i){if(e!=93)return-1;for(let n=t.parts.length-1;n>=0;n--){let s=t.parts[n];if(s instanceof is&&(s.type==dl||s.type==Zg)){if(!s.side||t.skipSpace(s.to)==i&&!/[(\[]/.test(t.slice(i+1,i+2)))return t.parts[n]=null,-1;let r=t.takeContent(n),o=t.parts[n]=zK(t,r,s.type==dl?pe.Link:pe.Image,s.from,i+1);if(s.type==dl)for(let l=0;l<n;l++){let c=t.parts[l];c instanceof is&&c.type==dl&&(c.side=0)}return o.to}}return-1}};function zK(t,e,i,n,s){let{text:r}=t,o=t.char(s),l=s;if(e.unshift(it(pe.LinkMark,n,n+(i==pe.Image?2:1))),e.push(it(pe.LinkMark,s-1,s)),o==40){let c=t.skipSpace(s+1),u=w4(r,c-t.offset,t.offset),d;u&&(c=t.skipSpace(u.to),c!=u.to&&(d=C4(r,c-t.offset,t.offset),d&&(c=t.skipSpace(d.to)))),t.char(c)==41&&(e.push(it(pe.LinkMark,s,s+1)),l=c+1,u&&e.push(u),d&&e.push(d),e.push(it(pe.LinkMark,c,l)))}else if(o==91){let c=k4(r,s-t.offset,t.offset,!1);c&&(e.push(c),l=c.to)}return it(i,n,l,e)}function w4(t,e,i){if(t.charCodeAt(e)==60){for(let s=e+1;s<t.length;s++){let r=t.charCodeAt(s);if(r==62)return it(pe.URL,e+i,s+1+i);if(r==60||r==10)return!1}return null}else{let s=0,r=e;for(let o=!1;r<t.length;r++){let l=t.charCodeAt(r);if(Ds(l))break;if(o)o=!1;else if(l==40)s++;else if(l==41){if(!s)break;s--}else l==92&&(o=!0)}return r>e?it(pe.URL,e+i,r+i):r==t.length?null:!1}}function C4(t,e,i){let n=t.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let s=n==40?41:n;for(let r=e+1,o=!1;r<t.length;r++){let l=t.charCodeAt(r);if(o)o=!1;else{if(l==s)return it(pe.LinkTitle,e+i,r+1+i);l==92&&(o=!0)}}return null}function k4(t,e,i,n){for(let s=!1,r=e+1,o=Math.min(t.length,r+999);r<o;r++){let l=t.charCodeAt(r);if(s)s=!1;else{if(l==93)return n?!1:it(pe.LinkLabel,e+i,r+1+i);if(n&&!Ds(l)&&(n=!1),l==91)return!1;l==92&&(s=!0)}}return null}class yw{constructor(e,i,n){this.parser=e,this.text=i,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,i){return this.text.slice(e-this.offset,i-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,i,n,s,r){return this.append(new is(e,i,n,(s?1:0)|(r?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let i=this.parts[e];if(i instanceof is&&(i.type==dl||i.type==Zg))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n<this.parts.length;n++){let s=this.parts[n];if(!(s instanceof is&&s.type.resolve&&s.side&2))continue;let r=s.type==x4||s.type==S4,o=s.to-s.from,l,c=n-1;for(;c>=e;c--){let b=this.parts[c];if(b instanceof is&&b.side&1&&b.type==s.type&&!(r&&(s.side&1||b.side&2)&&(b.to-b.from+o)%3==0&&((b.to-b.from)%3||o%3))){l=b;break}}if(!l)continue;let u=s.type.resolve,d=[],p=l.from,g=s.to;if(r){let b=Math.min(2,l.to-l.from,o);p=l.to-b,g=s.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,p,l.to));for(let b=c+1;b<n;b++)this.parts[b]instanceof Ff&&d.push(this.parts[b]),this.parts[b]=null;s.type.mark&&d.push(this.elt(s.type.mark,s.from,g));let O=this.elt(u,p,g,d);this.parts[c]=r&&l.from!=p?new is(l.type,l.from,p,l.side):null,(this.parts[n]=r&&s.to!=g?new is(s.type,g,s.to,s.side):null)?this.parts.splice(n,0,O):this.parts[n]=O}let i=[];for(let n=e;n<this.parts.length;n++){let s=this.parts[n];s instanceof Ff&&i.push(s)}return i}findOpeningDelimiter(e){for(let i=this.parts.length-1;i>=0;i--){let n=this.parts[i];if(n instanceof is&&n.type==e&&n.side&1)return i}return null}takeContent(e){let i=this.resolveMarkers(e);return this.parts.length=e,i}getDelimiterAt(e){let i=this.parts[e];return i instanceof is?i:null}skipSpace(e){return _f(this.text,e-this.offset)+this.offset}elt(e,i,n,s){return typeof e=="string"?it(this.parser.getNodeType(e),i,n,s):new b4(e,i)}}yw.linkStart=dl;yw.imageStart=Zg;function zb(t,e){if(!e.length)return t;if(!t.length)return e;let i=t.slice(),n=0;for(let s of e){for(;n<i.length&&i[n].to<s.to;)n++;if(n<i.length&&i[n].from<s.from){let r=i[n];r instanceof Ff&&(i[n]=new Ff(r.type,r.from,r.to,zb(r.children,[s])))}else i.splice(n++,0,s)}return i}const jK=[pe.CodeBlock,pe.ListItem,pe.OrderedList,pe.BulletList];let IK=class{constructor(e,i){this.fragments=e,this.input=i,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,i){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let r=this.fragment.to;for(;r>0&&this.input.read(r-1,r)!=`
74
- `;)r--;this.fragmentEnd=r?r-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let s=e+this.fragment.offset;for(;n.to<=s;)if(!n.parent())return!1;for(;;){if(n.from>=s)return this.fragment.from<=i;if(!n.childAfter(s))return!1}}matches(e){let i=this.cursor.tree;return i&&i.prop(je.contextHash)==e}takeNodes(e){let i=this.cursor,n=this.fragment.offset,s=this.fragmentEnd-(this.fragment.openEnd?1:0),r=e.absoluteLineStart,o=r,l=e.block.children.length,c=o,u=l;for(;;){if(i.to-n>s){if(i.type.isAnonymous&&i.firstChild())continue;break}let d=T4(i.from-n,e.ranges);if(i.to-n<=e.ranges[e.rangeI].to)e.addNode(i.tree,d);else{let p=new ct(e.parser.nodeSet.types[pe.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(p,i.tree),e.addNode(p,d)}if(i.type.is("Block")&&(jK.indexOf(i.type.id)<0?(o=i.to-n,l=e.block.children.length):(o=c,l=u),c=i.to-n,u=e.block.children.length),!i.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-r}};function T4(t,e){let i=t;for(let n=1;n<e.length;n++){let s=e[n-1].to,r=e[n].from;s<t&&(i-=r-s)}return i}const VK=_h({"Blockquote/...":X.quote,HorizontalRule:X.contentSeparator,"ATXHeading1/... SetextHeading1/...":X.heading1,"ATXHeading2/... SetextHeading2/...":X.heading2,"ATXHeading3/...":X.heading3,"ATXHeading4/...":X.heading4,"ATXHeading5/...":X.heading5,"ATXHeading6/...":X.heading6,"Comment CommentBlock":X.comment,Escape:X.escape,Entity:X.character,"Emphasis/...":X.emphasis,"StrongEmphasis/...":X.strong,"Link/... Image/...":X.link,"OrderedList/... BulletList/...":X.list,"BlockQuote/...":X.quote,"InlineCode CodeText":X.monospace,"URL Autolink":X.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":X.processingInstruction,"CodeInfo LinkLabel":X.labelName,LinkTitle:X.string,Paragraph:X.content}),XK=new wO(new pd(_4).extend(VK),Object.keys(vm).map(t=>vm[t]),Object.keys(vm).map(t=>O4[t]),Object.keys(vm),BK,l4,Object.keys(H_).map(t=>H_[t]),Object.keys(H_),[]);function ZK(t,e,i){let n=[];for(let s=t.firstChild,r=e;;s=s.nextSibling){let o=s?s.from:i;if(o>r&&n.push({from:r,to:o}),!s)break;r=s.to}return n}function qK(t){let{codeParser:e,htmlParser:i}=t;return{wrap:BB((s,r)=>{let o=s.type.id;if(e&&(o==pe.CodeBlock||o==pe.FencedCode)){let l="";if(o==pe.FencedCode){let u=s.node.getChild(pe.CodeInfo);u&&(l=r.read(u.from,u.to))}let c=e(l);if(c)return{parser:c,overlay:u=>u.type.id==pe.CodeText,bracketed:o==pe.FencedCode}}else if(i&&(o==pe.HTMLBlock||o==pe.HTMLTag||o==pe.CommentBlock))return{parser:i,overlay:ZK(s.node,s.from,s.to)};return null})}}const WK={resolve:"Strikethrough",mark:"StrikethroughMark"},UK={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":X.strikethrough}},{name:"StrikethroughMark",style:X.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,i){if(e!=126||t.char(i+1)!=126||t.char(i+2)==126)return-1;let n=t.slice(i-1,i),s=t.slice(i+2,i+3),r=/\s|^$/.test(n),o=/\s|^$/.test(s),l=Gf.test(n),c=Gf.test(s);return t.addDelimiter(WK,i,i+2,!o&&(!c||r||l),!r&&(!l||o||c))},after:"Emphasis"}]};function yf(t,e,i=0,n,s=0){let r=0,o=!0,l=-1,c=-1,u=!1,d=()=>{n.push(t.elt("TableCell",s+l,s+c,t.parser.parseInline(e.slice(l,c),s+l)))};for(let p=i;p<e.length;p++){let g=e.charCodeAt(p);g==124&&!u?((!o||l>-1)&&r++,o=!1,n&&(l>-1&&d(),n.push(t.elt("TableDelimiter",p+s,p+s+1))),l=c=-1):(u||g!=32&&g!=9)&&(l<0&&(l=p),c=p+1),u=!u&&g==92}return l>-1&&(r++,n&&d()),r}function MM(t,e){for(let i=e;i<t.length;i++){let n=t.charCodeAt(i);if(n==124)return!0;n==92&&i++}return!1}const A4=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class PM{constructor(){this.rows=null}nextLine(e,i,n){if(this.rows==null){this.rows=!1;let s;if((i.next==45||i.next==58||i.next==124)&&A4.test(s=i.text.slice(i.pos))){let r=[];yf(e,n.content,0,r,n.start)==yf(e,s,i.pos)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,r),e.elt("TableDelimiter",e.lineStart+i.pos,e.lineStart+i.text.length)])}}else if(this.rows){let s=[];yf(e,i.text,i.pos,s,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+i.pos,e.lineStart+i.text.length,s))}return!1}finish(e,i){return this.rows?(e.addLeafElement(i,e.elt("Table",i.start,i.start+i.content.length,this.rows)),!0):!1}}const YK={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":X.heading}},"TableRow",{name:"TableCell",style:X.content},{name:"TableDelimiter",style:X.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return MM(e.content,0)?new PM:null},endLeaf(t,e,i){if(i.parsers.some(s=>s instanceof PM)||!MM(e.text,e.basePos))return!1;let n=t.peekLine();return A4.test(n)&&yf(t,e.text,e.basePos)==yf(t,n,e.basePos)},before:"SetextHeading"}]};class HK{nextLine(){return!1}finish(e,i){return e.addLeafElement(i,e.elt("Task",i.start,i.start+i.content.length,[e.elt("TaskMarker",i.start,i.start+3),...e.parser.parseInline(i.content.slice(3),i.start+3)])),!0}}const FK={defineNodes:[{name:"Task",block:!0,style:X.list},{name:"TaskMarker",style:X.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new HK:null},after:"SetextHeading"}]},RM=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,QM=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,GK=/[\w-]+\.[\w-]+($|\/)/,LM=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,DM=/\/[a-zA-Z\d@.]+/gy;function BM(t,e,i,n){let s=0;for(let r=e;r<i;r++)t[r]==n&&s++;return s}function KK(t,e){QM.lastIndex=e;let i=QM.exec(t);if(!i||GK.exec(i[0])[0].indexOf("_")>-1)return-1;let n=e+i[0].length;for(;;){let s=t[n-1],r;if(/[?!.,:*_~]/.test(s)||s==")"&&BM(t,e,n,")")>BM(t,e,n,"("))n--;else if(s==";"&&(r=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,n))))n=e+r.index;else break}return n}function $M(t,e){LM.lastIndex=e;let i=LM.exec(t);if(!i)return-1;let n=i[0][i[0].length-1];return n=="_"||n=="-"?-1:e+i[0].length-(n=="."?1:0)}const JK={parseInline:[{name:"Autolink",parse(t,e,i){let n=i-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;RM.lastIndex=n;let s=RM.exec(t.text),r=-1;if(!s)return-1;if(s[1]||s[2]){if(r=KK(t.text,n+s[0].length),r>-1&&t.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(n,r));r=n+o[0].length}}else s[3]?r=$M(t.text,n):(r=$M(t.text,n+s[0].length),r>-1&&s[0]=="xmpp:"&&(DM.lastIndex=r,s=DM.exec(t.text),s&&(r=s.index+s[0].length)));return r<0?-1:(t.addElement(t.elt("URL",i,r+t.offset)),r+t.offset)}}]},eJ=[YK,FK,UK,JK];function E4(t,e,i){return(n,s,r)=>{if(s!=t||n.char(r+1)==t)return-1;let o=[n.elt(i,r,r+1)];for(let l=r+1;l<n.end;l++){let c=n.char(l);if(c==t)return n.addElement(n.elt(e,r,l+1,o.concat(n.elt(i,l,l+1))));if(c==92&&o.push(n.elt("Escape",l,l+++2)),Ds(c))break}return-1}}const tJ={defineNodes:[{name:"Superscript",style:X.special(X.content)},{name:"SuperscriptMark",style:X.processingInstruction}],parseInline:[{name:"Superscript",parse:E4(94,"Superscript","SuperscriptMark")}]},iJ={defineNodes:[{name:"Subscript",style:X.special(X.content)},{name:"SubscriptMark",style:X.processingInstruction}],parseInline:[{name:"Subscript",parse:E4(126,"Subscript","SubscriptMark")}]},nJ={defineNodes:[{name:"Emoji",style:X.character}],parseInline:[{name:"Emoji",parse(t,e,i){let n;return e!=58||!(n=/^[a-zA-Z_0-9]+:/.exec(t.slice(i+1,t.end)))?-1:t.addElement(t.elt("Emoji",i,i+1+n[0].length))}}]};var NM={};class qg{constructor(e,i,n,s,r,o,l,c,u,d=0,p){this.p=e,this.stack=i,this.state=n,this.reducePos=s,this.pos=r,this.score=o,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=p}toString(){return`[${this.stack.filter((e,i)=>i%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,i,n=0){let s=e.parser.context;return new qg(e,[],i,n,n,0,[],0,s?new zM(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,i){this.stack.push(this.state,i,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var i;let n=e>>19,s=e&65535,{parser:r}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=r.dynamicPrecedence(s);if(l&&(this.score+=l),n==0){this.pushState(r.getGoto(this.state,s,!0),this.reducePos),s<r.minRepeatTerm&&this.storeNode(s,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(s,this.reducePos);return}let c=this.stack.length-(n-1)*3-(e&262144?6:0),u=c?this.stack[c-2]:this.p.ranges[0].from,d=this.reducePos-u;d>=2e3&&!(!((i=this.p.parser.nodeSet.types[s])===null||i===void 0)&&i.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSize<d&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=u,this.p.lastBigReductionSize=d));let p=c?this.stack[c-1]:0,g=this.bufferBase+this.buffer.length-p;if(s<r.minRepeatTerm||e&131072){let O=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(s,u,O,g+4,!0)}if(e&262144)this.state=this.stack[c];else{let O=this.stack[c-3];this.state=r.getGoto(O,s,!0)}for(;this.stack.length>c;)this.stack.pop();this.reduceContext(s,u)}storeNode(e,i,n,s=4,r=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,l=this.buffer.length;if(l==0&&o.parent&&(l=o.bufferBase-o.parent.bufferBase,o=o.parent),l>0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(i==n)return;if(o.buffer[l-2]>=i){o.buffer[l-2]=n;return}}}if(!r||this.pos==n)this.buffer.push(e,i,n,s);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let c=o;c>0&&this.buffer[c-2]>n;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,s>4&&(s-=4)}this.buffer[o]=e,this.buffer[o+1]=i,this.buffer[o+2]=n,this.buffer[o+3]=s}}shift(e,i,n,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let r=e,{parser:o}=this.p;this.pos=s;let l=o.stateFlag(r,1);!l&&(s>n||i<=o.maxNode)&&(this.reducePos=s),this.pushState(r,l?n:Math.min(n,this.reducePos)),this.shiftContext(i,n),i<=o.maxNode&&this.buffer.push(i,n,s,4)}else this.pos=s,this.shiftContext(i,n),i<=this.p.parser.maxNode&&this.buffer.push(i,n,s,4)}apply(e,i,n,s){e&65536?this.reduce(e):this.shift(e,i,n,s)}useNode(e,i){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(i,s),this.buffer.push(n,s,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,i=e.buffer.length;for(;i>0&&e.buffer[i-2]>e.reducePos;)i-=4;let n=e.buffer.slice(i),s=e.bufferBase+i;for(;e&&s==e.bufferBase;)e=e.parent;return new qg(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,i){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,i,4),this.storeNode(0,this.pos,i,n?8:4),this.pos=this.reducePos=i,this.score-=190}canShift(e){for(let i=new sJ(this);;){let n=this.p.parser.stateSlot(i.state,4)||this.p.parser.hasAction(i.state,e);if(n==0)return!1;if((n&65536)==0)return!0;i.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let i=this.p.parser.nextStates(this.state);if(i.length>8||this.stack.length>=120){let s=[];for(let r=0,o;r<i.length;r+=2)(o=i[r+1])!=this.state&&this.p.parser.hasAction(o,e)&&s.push(i[r],o);if(this.stack.length<120)for(let r=0;s.length<8&&r<i.length;r+=2){let o=i[r+1];s.some((l,c)=>c&1&&l==o)||s.push(i[r],o)}i=s}let n=[];for(let s=0;s<i.length&&n.length<4;s+=2){let r=i[s+1];if(r==this.state)continue;let o=this.split();o.pushState(r,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(i[s],this.pos),o.reducePos=this.pos,o.score-=200,n.push(o)}return n}forceReduce(){let{parser:e}=this.p,i=e.stateSlot(this.state,5);if((i&65536)==0)return!1;if(!e.validAction(this.state,i)){let n=i>>19,s=i&65535,r=this.stack.length-n*3;if(r<0||e.getGoto(this.stack[r],s,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;i=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(i),!0}findForcedReduction(){let{parser:e}=this.p,i=[],n=(s,r)=>{if(!i.includes(s))return i.push(s),e.allActions(s,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-r;if(l>1){let c=o&65535,u=this.stack.length-l*3;if(u>=0&&e.getGoto(this.stack[u],c,!1)>=0)return l<<19|65536|c}}else{let l=n(o,r+1);if(l!=null)return l}})};return n(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 i=0;i<this.stack.length;i+=3)if(this.stack[i]!=e.stack[i])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,i){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(i)))}reduceContext(e,i){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(i)))}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 i=new zM(this.curContext.tracker,e);i.hash!=this.curContext.hash&&this.emitContext(),this.curContext=i}}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 zM{constructor(e,i){this.tracker=e,this.context=i,this.hash=e.strict?e.hash(i):0}}class sJ{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let i=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],i,!0);this.state=s}}class Wg{constructor(e,i,n){this.stack=e,this.pos=i,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,i=e.bufferBase+e.buffer.length){return new Wg(e,i,i-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 Wg(this.stack,this.pos,this.index)}}function ef(t,e=Uint16Array){if(typeof t!="string")return t;let i=null;for(let n=0,s=0;n<t.length;){let r=0;for(;;){let o=t.charCodeAt(n++),l=!1;if(o==126){r=65535;break}o>=92&&o--,o>=34&&o--;let c=o-32;if(c>=46&&(c-=46,l=!0),r+=c,l)break;r*=46}i?i[s++]=r:i=new e(r)}return i}class Hm{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const jM=new Hm;class rJ{constructor(e,i){this.input=e,this.ranges=i,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=jM,this.rangeIndex=0,this.pos=this.chunkPos=i[0].from,this.range=i[0],this.end=i[i.length-1].to,this.readNext()}resolveOffset(e,i){let n=this.range,s=this.rangeIndex,r=this.pos+e;for(;r<n.from;){if(!s)return null;let o=this.ranges[--s];r-=n.from-o.to,n=o}for(;i<0?r>n.to:r>=n.to;){if(s==this.ranges.length-1)return null;let o=this.ranges[++s];r+=o.from-n.to,n=o}return r}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let i of this.ranges)if(i.to>e)return Math.max(e,i.from);return this.end}peek(e){let i=this.chunkOff+e,n,s;if(i>=0&&i<this.chunk.length)n=this.pos+e,s=this.chunk.charCodeAt(i);else{let r=this.resolveOffset(e,1);if(r==null)return-1;if(n=r,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)s=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=n;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),s=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),s}acceptToken(e,i=0){let n=i?this.resolveOffset(i,-1):this.pos;if(n==null||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,i){this.token.value=e,this.token.end=i}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:i}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=i,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),i=this.pos+e.length;this.chunk=i>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,i){if(i?(this.token=i,i.start=e,i.lookAhead=e+1,i.value=i.extended=-1):this.token=jM,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,i){if(e>=this.chunkPos&&i<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,i-this.chunkPos);if(e>=this.chunk2Pos&&i<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,i-this.chunk2Pos);if(e>=this.range.from&&i<=this.range.to)return this.input.read(e,i);let n="";for(let s of this.ranges){if(s.from>=i)break;s.to>e&&(n+=this.input.read(Math.max(s.from,e),Math.min(s.to,i)))}return n}}class Jc{constructor(e,i){this.data=e,this.id=i}token(e,i){let{parser:n}=i.p;M4(this.data,e,i,this.id,n.data,n.tokenPrecTable)}}Jc.prototype.contextual=Jc.prototype.fallback=Jc.prototype.extend=!1;class Ug{constructor(e,i,n){this.precTable=i,this.elseToken=n,this.data=typeof e=="string"?ef(e):e}token(e,i){let n=e.pos,s=0;for(;;){let r=e.next<0,o=e.resolveOffset(1,1);if(M4(this.data,e,i,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(r||s++,o==null)break;e.reset(o,e.token)}s&&(e.reset(n,e.token),e.acceptToken(this.elseToken,s))}}Ug.prototype.contextual=Jc.prototype.fallback=Jc.prototype.extend=!1;class os{constructor(e,i={}){this.token=e,this.contextual=!!i.contextual,this.fallback=!!i.fallback,this.extend=!!i.extend}}function M4(t,e,i,n,s,r){let o=0,l=1<<n,{dialect:c}=i.p.parser;e:for(;(l&t[o])!=0;){let u=t[o+1];for(let O=o+3;O<u;O+=2)if((t[O+1]&l)>0){let _=t[O];if(c.allows(_)&&(e.token.value==-1||e.token.value==_||oJ(_,e.token.value,s,r))){e.acceptToken(_);break}}let d=e.next,p=0,g=t[o+2];if(e.next<0&&g>p&&t[u+g*3-3]==65535){o=t[u+g*3-1];continue e}for(;p<g;){let O=p+g>>1,_=u+O+(O<<1),b=t[_],S=t[_+1]||65536;if(d<b)g=O;else if(d>=S)p=O+1;else{o=t[_+2],e.advance();continue e}}break}}function IM(t,e,i){for(let n=e,s;(s=t[n])!=65535;n++)if(s==i)return n-e;return-1}function oJ(t,e,i,n){let s=IM(i,n,e);return s<0||IM(i,n,t)<s}const Fn=typeof process<"u"&&NM&&/\bparse\b/.test(NM.LOG);let F_=null;function VM(t,e,i){let n=t.cursor(ut.IncludeAnonymous);for(n.moveTo(e);;)if(!(i<0?n.childBefore(e):n.childAfter(e)))for(;;){if((i<0?n.to<e:n.from>e)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(t.length,Math.max(n.from+1,e+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:t.length}}class aJ{constructor(e,i){this.fragments=e,this.nodeSet=i,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?VM(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?VM(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 i=this.trees.length-1;if(i<0)return this.nextFragment(),null;let n=this.trees[i],s=this.index[i];if(s==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let r=n.children[s],o=this.start[i]+n.positions[s];if(o>e)return this.nextStart=o,null;if(r instanceof ct){if(o==e){if(o<this.safeFrom)return null;let l=o+r.length;if(l<=this.safeTo){let c=r.prop(je.lookAhead);if(!c||l+c<this.fragment.to)return r}}this.index[i]++,o+r.length>=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[i]++,this.nextStart=o+r.length}}}class lJ{constructor(e,i){this.stream=i,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Hm)}getActions(e){let i=0,n=null,{parser:s}=e.p,{tokenizers:r}=s,o=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,c=0;for(let u=0;u<r.length;u++){if((1<<u&o)==0)continue;let d=r[u],p=this.tokens[u];if(!(n&&!d.fallback)&&((d.contextual||p.start!=e.pos||p.mask!=o||p.context!=l)&&(this.updateCachedToken(p,d,e),p.mask=o,p.context=l),p.lookAhead>p.end+25&&(c=Math.max(p.lookAhead,c)),p.value!=0)){let g=i;if(p.extended>-1&&(i=this.addActions(e,p.extended,p.end,i)),i=this.addActions(e,p.value,p.end,i),!d.extend&&(n=p,i>g))break}}for(;this.actions.length>i;)this.actions.pop();return c&&e.setLookAhead(c),!n&&e.pos==this.stream.end&&(n=new Hm,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,i=this.addActions(e,n.value,n.end,i)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let i=new Hm,{pos:n,p:s}=e;return i.start=n,i.end=Math.min(n+1,s.stream.end),i.value=n==s.stream.end?s.parser.eofTerm:0,i}updateCachedToken(e,i,n){let s=this.stream.clipPos(n.pos);if(i.token(this.stream.reset(s,e),n),e.value>-1){let{parser:r}=n.p;for(let o=0;o<r.specialized.length;o++)if(r.specialized[o]==e.value){let l=r.specializers[o](this.stream.read(e.start,e.end),n);if(l>=0&&n.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,i,n,s){for(let r=0;r<s;r+=3)if(this.actions[r]==e)return s;return this.actions[s++]=e,this.actions[s++]=i,this.actions[s++]=n,s}addActions(e,i,n,s){let{state:r}=e,{parser:o}=e.p,{data:l}=o;for(let c=0;c<2;c++)for(let u=o.stateSlot(r,c?2:1);;u+=3){if(l[u]==65535)if(l[u+1]==1)u=uo(l,u+2);else{s==0&&l[u+1]==2&&(s=this.putAction(uo(l,u+2),i,n,s));break}l[u]==i&&(s=this.putAction(uo(l,u+1),i,n,s))}return s}}class cJ{constructor(e,i,n,s){this.parser=e,this.input=i,this.ranges=s,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 rJ(i,s),this.tokens=new lJ(e,this.stream),this.topTerm=e.top[1];let{from:r}=s[0];this.stacks=[qg.start(this,e.top[0],r)],this.fragments=n.length&&this.stream.end-r>e.bufferLength*4?new aJ(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,i=this.minStackPos,n=this.stacks=[],s,r;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>i)n.push(l);else{if(this.advanceStack(l,n,e))continue;{s||(s=[],r=[]),s.push(l);let c=this.tokens.getMainToken(l);r.push(c.value,c.end)}}break}}if(!n.length){let o=s&&uJ(s);if(o)return Fn&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Fn&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&s){let o=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,r,n);if(o)return Fn&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,c)=>c.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>i)&&this.recovering--}else if(n.length>1){e:for(let o=0;o<n.length-1;o++){let l=n[o];for(let c=o+1;c<n.length;c++){let u=n[c];if(l.sameState(u)||l.buffer.length>500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)n.splice(c--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,l)=>l.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o<n.length;o++)n[o].pos<this.minStackPos&&(this.minStackPos=n[o].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,i,n){let s=e.pos,{parser:r}=this,o=Fn?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,d=u?e.curContext.hash:0;for(let p=this.fragments.nodeAt(s);p;){let g=this.parser.nodeSet.types[p.type.id]==p.type?r.getGoto(e.state,p.type.id):-1;if(g>-1&&p.length&&(!u||(p.prop(je.contextHash)||0)==d))return e.useNode(p,g),Fn&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(p.type.id)})`),!0;if(!(p instanceof ct)||p.children.length==0||p.positions[0]>0)break;let O=p.children[0];if(O instanceof ct&&p.positions[0]==0)p=O;else break}}let l=r.stateSlot(e.state,4);if(l>0)return e.reduce(l),Fn&&console.log(o+this.stackID(e)+` (via always-reduce ${r.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let c=this.tokens.getActions(e);for(let u=0;u<c.length;){let d=c[u++],p=c[u++],g=c[u++],O=u==c.length||!n,_=O?e:e.split(),b=this.tokens.mainToken;if(_.apply(d,p,b?b.start:_.pos,g),Fn&&console.log(o+this.stackID(_)+` (via ${(d&65536)==0?"shift":`reduce of ${r.getName(d&65535)}`} for ${r.getName(p)} @ ${s}${_==e?"":", split"})`),O)return!0;_.pos>s?i.push(_):n.push(_)}return!1}advanceFully(e,i){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return XM(e,i),!0}}runRecovery(e,i,n){let s=null,r=!1;for(let o=0;o<e.length;o++){let l=e[o],c=i[o<<1],u=i[(o<<1)+1],d=Fn?this.stackID(l)+" -> ":"";if(l.deadEnd&&(r||(r=!0,l.restart(),Fn&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let p=l.split(),g=d;for(let O=0;O<10&&p.forceReduce()&&(Fn&&console.log(g+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,n));O++)Fn&&(g=this.stackID(p)+" -> ");for(let O of l.recoverByInsert(c))Fn&&console.log(d+this.stackID(O)+" (via recover-insert)"),this.advanceFully(O,n);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),Fn&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),XM(l,n)):(!s||s.score<p.score)&&(s=p)}return s}stackToTree(e){return e.close(),ct.build({buffer:Wg.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 i=(F_||(F_=new WeakMap)).get(e);return i||F_.set(e,i=String.fromCodePoint(this.nextStackID++)),i+e}}function XM(t,e){for(let i=0;i<e.length;i++){let n=e[i];if(n.pos==t.pos&&n.sameState(t)){e[i].score<t.score&&(e[i]=t);return}}e.push(t)}class hJ{constructor(e,i,n){this.source=e,this.flags=i,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}}const G_=t=>t;class P4{constructor(e){this.start=e.start,this.shift=e.shift||G_,this.reduce=e.reduce||G_,this.reuse=e.reuse||G_,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class fh extends FS{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let i=e.nodeNames.split(" ");this.minRepeatTerm=i.length;for(let l=0;l<e.repeatNodeCount;l++)i.push("");let n=Object.keys(e.topRules).map(l=>e.topRules[l][1]),s=[];for(let l=0;l<i.length;l++)s.push([]);function r(l,c,u){s[l].push([c,c.deserialize(String(u))])}if(e.nodeProps)for(let l of e.nodeProps){let c=l[0];typeof c=="string"&&(c=je[c]);for(let u=1;u<l.length;){let d=l[u++];if(d>=0)r(d,c,l[u++]);else{let p=l[u+-d];for(let g=-d;g>0;g--)r(l[u++],c,p);u++}}}this.nodeSet=new pd(i.map((l,c)=>_i.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:s[c],top:n.indexOf(c)>-1,error:c==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(c)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=PB;let o=ef(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(ZM),this.states=ef(e.states,Uint32Array),this.data=ef(e.stateData),this.goto=ef(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new Jc(o,l):l),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,i,n){let s=new cJ(this,e,i,n);for(let r of this.wrappers)s=r(s,e,i,n);return s}getGoto(e,i,n=!1){let s=this.goto;if(i>=s[0])return-1;for(let r=s[i+1];;){let o=s[r++],l=o&1,c=s[r++];if(l&&n)return c;for(let u=r+(o>>1);r<u;r++)if(s[r]==e)return c;if(l)return-1}}hasAction(e,i){let n=this.data;for(let s=0;s<2;s++)for(let r=this.stateSlot(e,s?2:1),o;;r+=3){if((o=n[r])==65535)if(n[r+1]==1)o=n[r=uo(n,r+2)];else{if(n[r+1]==2)return uo(n,r+2);break}if(o==i||o==0)return uo(n,r+1)}return 0}stateSlot(e,i){return this.states[e*6+i]}stateFlag(e,i){return(this.stateSlot(e,0)&i)>0}validAction(e,i){return!!this.allActions(e,n=>n==i?!0:null)}allActions(e,i){let n=this.stateSlot(e,4),s=n?i(n):void 0;for(let r=this.stateSlot(e,1);s==null;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=uo(this.data,r+2);else break;s=i(uo(this.data,r+1))}return s}nextStates(e){let i=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=uo(this.data,n+2);else break;if((this.data[n+2]&1)==0){let s=this.data[n+1];i.some((r,o)=>o&1&&r==s)||i.push(this.data[n],s)}}return i}configure(e){let i=Object.assign(Object.create(fh.prototype),this);if(e.props&&(i.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);i.top=n}return e.tokenizers&&(i.tokenizers=this.tokenizers.map(n=>{let s=e.tokenizers.find(r=>r.from==n);return s?s.to:n})),e.specializers&&(i.specializers=this.specializers.slice(),i.specializerSpecs=this.specializerSpecs.map((n,s)=>{let r=e.specializers.find(l=>l.from==n.external);if(!r)return n;let o=Object.assign(Object.assign({},n),{external:r.to});return i.specializers[s]=ZM(o),o})),e.contextTracker&&(i.context=e.contextTracker),e.dialect&&(i.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(i.strict=e.strict),e.wrap&&(i.wrappers=i.wrappers.concat(e.wrap)),e.bufferLength!=null&&(i.bufferLength=e.bufferLength),i}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 i=this.dynamicPrecedences;return i==null?0:i[e]||0}parseDialect(e){let i=Object.keys(this.dialects),n=i.map(()=>!1);if(e)for(let r of e.split(" ")){let o=i.indexOf(r);o>=0&&(n[o]=!0)}let s=null;for(let r=0;r<i.length;r++)if(!n[r])for(let o=this.dialects[i[r]],l;(l=this.data[o++])!=65535;)(s||(s=new Uint8Array(this.maxTerm+1)))[l]=1;return new hJ(e,n,s)}static deserialize(e){return new fh(e)}}function uo(t,e){return t[e]|t[e+1]<<16}function uJ(t){let e=null;for(let i of t){let n=i.p.stoppedAt;(i.pos==i.p.stream.end||n!=null&&i.pos>n)&&i.p.parser.stateFlag(i.state,2)&&(!e||e.score<i.score)&&(e=i)}return e}function ZM(t){if(t.external){let e=t.extend?1:0;return(i,n)=>t.external(i,n)<<1|e}return t.get}const fJ=55,dJ=1,pJ=56,mJ=2,gJ=57,OJ=3,qM=4,vJ=5,bw=6,R4=7,Q4=8,L4=9,D4=10,_J=11,yJ=12,bJ=13,K_=58,xJ=14,SJ=15,WM=59,B4=21,wJ=23,$4=24,CJ=25,jb=27,N4=28,kJ=29,TJ=32,AJ=35,EJ=37,MJ=38,PJ=0,RJ=1,QJ={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},LJ={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},UM={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function DJ(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let YM=null,HM=null,FM=0;function Ib(t,e){let i=t.pos+e;if(FM==i&&HM==t)return YM;let n=t.peek(e),s="";for(;DJ(n);)s+=String.fromCharCode(n),n=t.peek(++e);return HM=t,FM=i,YM=s?s.toLowerCase():n==BJ||n==$J?void 0:null}const z4=60,Yg=62,xw=47,BJ=63,$J=33,NJ=45;function GM(t,e){this.name=t,this.parent=e}const zJ=[bw,D4,R4,Q4,L4],jJ=new P4({start:null,shift(t,e,i,n){return zJ.indexOf(e)>-1?new GM(Ib(n,1)||"",t):t},reduce(t,e){return e==B4&&t?t.parent:t},reuse(t,e,i,n){let s=e.type.id;return s==bw||s==EJ?new GM(Ib(n,1)||"",t):t},strict:!1}),IJ=new os((t,e)=>{if(t.next!=z4){t.next<0&&e.context&&t.acceptToken(K_);return}t.advance();let i=t.next==xw;i&&t.advance();let n=Ib(t,0);if(n===void 0)return;if(!n)return t.acceptToken(i?SJ:xJ);let s=e.context?e.context.name:null;if(i){if(n==s)return t.acceptToken(_J);if(s&&LJ[s])return t.acceptToken(K_,-2);if(e.dialectEnabled(PJ))return t.acceptToken(yJ);for(let r=e.context;r;r=r.parent)if(r.name==n)return;t.acceptToken(bJ)}else{if(n=="script")return t.acceptToken(R4);if(n=="style")return t.acceptToken(Q4);if(n=="textarea")return t.acceptToken(L4);if(QJ.hasOwnProperty(n))return t.acceptToken(D4);s&&UM[s]&&UM[s][n]?t.acceptToken(K_,-1):t.acceptToken(bw)}},{contextual:!0}),VJ=new os(t=>{for(let e=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(WM);break}if(t.next==NJ)e++;else if(t.next==Yg&&e>=2){i>=3&&t.acceptToken(WM,-2);break}else e=0;t.advance()}});function XJ(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const ZJ=new os((t,e)=>{if(t.next==xw&&t.peek(1)==Yg){let i=e.dialectEnabled(RJ)||XJ(e.context);t.acceptToken(i?vJ:qM,2)}else t.next==Yg&&t.acceptToken(qM,1)});function Sw(t,e,i){let n=2+t.length;return new os(s=>{for(let r=0,o=0,l=0;;l++){if(s.next<0){l&&s.acceptToken(e);break}if(r==0&&s.next==z4||r==1&&s.next==xw||r>=2&&r<n&&s.next==t.charCodeAt(r-2))r++,o++;else if(r==n&&s.next==Yg){l>o?s.acceptToken(e,-o):s.acceptToken(i,-(o-2));break}else if((s.next==10||s.next==13)&&l){s.acceptToken(e,1);break}else r=o=0;s.advance()}})}const qJ=Sw("script",fJ,dJ),WJ=Sw("style",pJ,mJ),UJ=Sw("textarea",gJ,OJ),YJ=_h({"Text RawText IncompleteTag IncompleteCloseTag":X.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":X.angleBracket,TagName:X.tagName,"MismatchedCloseTag/TagName":[X.tagName,X.invalid],AttributeName:X.attributeName,"AttributeValue UnquotedAttributeValue":X.attributeValue,Is:X.definitionOperator,"EntityReference CharacterReference":X.character,Comment:X.blockComment,ProcessingInst:X.processingInstruction,DoctypeDecl:X.documentMeta}),HJ=fh.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:jJ,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[YJ],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[qJ,WJ,UJ,ZJ,IJ,VJ,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function j4(t,e){let i=Object.create(null);for(let n of t.getChildren($4)){let s=n.getChild(CJ),r=n.getChild(jb)||n.getChild(N4);s&&(i[e.read(s.from,s.to)]=r?r.type.id==jb?e.read(r.from+1,r.to-1):e.read(r.from,r.to):"")}return i}function KM(t,e){let i=t.getChild(wJ);return i?e.read(i.from,i.to):" "}function J_(t,e,i){let n;for(let s of i)if(!s.attrs||s.attrs(n||(n=j4(t.node.parent.firstChild,e))))return{parser:s.parser,bracketed:!0};return null}function I4(t=[],e=[]){let i=[],n=[],s=[],r=[];for(let l of t)(l.tag=="script"?i:l.tag=="style"?n:l.tag=="textarea"?s:r).push(l);let o=e.length?Object.create(null):null;for(let l of e)(o[l.name]||(o[l.name]=[])).push(l);return BB((l,c)=>{let u=l.type.id;if(u==kJ)return J_(l,c,i);if(u==TJ)return J_(l,c,n);if(u==AJ)return J_(l,c,s);if(u==B4&&r.length){let d=l.node,p=d.firstChild,g=p&&KM(p,c),O;if(g){for(let _ of r)if(_.tag==g&&(!_.attrs||_.attrs(O||(O=j4(p,c))))){let b=d.lastChild,S=b.type.id==MJ?b.from:d.to;if(S>p.to)return{parser:_.parser,overlay:[{from:p.to,to:S}]}}}}if(o&&u==$4){let d=l.node,p;if(p=d.firstChild){let g=o[c.read(p.from,p.to)];if(g)for(let O of g){if(O.tagName&&O.tagName!=KM(d.parent,c))continue;let _=d.lastChild;if(_.type.id==jb){let b=_.from+1,S=_.lastChild,w=_.to-(S&&S.isError?0:1);if(w>b)return{parser:O.parser,overlay:[{from:b,to:w}],bracketed:!0}}else if(_.type.id==N4)return{parser:O.parser,overlay:[{from:_.from,to:_.to}]}}}}return null})}const FJ=122,JM=1,GJ=123,KJ=124,V4=2,JJ=125,eee=3,tee=4,X4=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],iee=58,nee=40,Z4=95,see=91,Fm=45,ree=46,oee=35,aee=37,lee=38,cee=92,hee=10,uee=42;function Kf(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function ww(t){return t>=48&&t<=57}function eP(t){return ww(t)||t>=97&&t<=102||t>=65&&t<=70}const q4=(t,e,i)=>(n,s)=>{for(let r=!1,o=0,l=0;;l++){let{next:c}=n;if(Kf(c)||c==Fm||c==Z4||r&&ww(c))!r&&(c!=Fm||l>0)&&(r=!0),o===l&&c==Fm&&o++,n.advance();else if(c==cee&&n.peek(1)!=hee){if(n.advance(),eP(n.next)){do n.advance();while(eP(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();r=!0}else{r&&n.acceptToken(o==2&&s.canShift(V4)?e:c==nee?i:t);break}}},fee=new os(q4(GJ,V4,KJ)),dee=new os(q4(JJ,eee,tee)),pee=new os(t=>{if(X4.includes(t.peek(-1))){let{next:e}=t;(Kf(e)||e==Z4||e==oee||e==ree||e==uee||e==see||e==iee&&Kf(t.peek(1))||e==Fm||e==lee)&&t.acceptToken(FJ)}}),mee=new os(t=>{if(!X4.includes(t.peek(-1))){let{next:e}=t;if(e==aee&&(t.advance(),t.acceptToken(JM)),Kf(e)){do t.advance();while(Kf(t.next)||ww(t.next));t.acceptToken(JM)}}}),gee=_h({"AtKeyword import charset namespace keyframes media supports":X.definitionKeyword,"from to selector":X.keyword,NamespaceName:X.namespace,KeyframeName:X.labelName,KeyframeRangeName:X.operatorKeyword,TagName:X.tagName,ClassName:X.className,PseudoClassName:X.constant(X.className),IdName:X.labelName,"FeatureName PropertyName":X.propertyName,AttributeName:X.attributeName,NumberLiteral:X.number,KeywordQuery:X.keyword,UnaryQueryOp:X.operatorKeyword,"CallTag ValueName":X.atom,VariableName:X.variableName,Callee:X.operatorKeyword,Unit:X.unit,"UniversalSelector NestingSelector":X.definitionOperator,"MatchOp CompareOp":X.compareOperator,"ChildOp SiblingOp, LogicOp":X.logicOperator,BinOp:X.arithmeticOperator,Important:X.modifier,Comment:X.blockComment,ColorLiteral:X.color,"ParenthesizedContent StringLiteral":X.string,":":X.punctuation,"PseudoOp #":X.derefOperator,"; ,":X.separator,"( )":X.paren,"[ ]":X.squareBracket,"{ }":X.brace}),Oee={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},vee={__proto__:null,or:98,and:98,not:106,only:106,layer:170},_ee={__proto__:null,selector:112,layer:166},yee={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},bee={__proto__:null,to:207},xee=fh.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mO<rQhO'#EQOOQW'#EQ'#EQO=WQ`O1G0UO1[QhO1G0UOOQ[,59o,59oO'tQhO'#DXOOQ[,59q,59qO=]Q#tO,5:VOOQS1G0[1G0[OOQS1G0^1G0^OOQS1G0`1G0`O=hQ`O1G0`O=mQdO'#E`OOQS1G0c1G0cOOQS1G0i1G0iO=xQaO,5:RO-`Q`O1G0kOOQS1G0k1G0kO-eQ`O1G0kO>PQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<<IOOElQdO'#EqOEvQ`O,5;yOOQP1G/u1G/uOOQS-E8j-E8jOFOQdO'#EpOFYQ`O,5;rOOQ]1G.x1G.xOOQP<<IO<<IOOFbQdO7+$|OOQO'#D]'#D]OFiQ!bO7+%QOFqQhO'#EoOF{Q`O,5;xO&lQdO,5;xOOQW1G/o1G/oOOQO'#ES'#ESOGTQ`O1G0WOOQS<<I[<<I[O&lQdO,59tOGnQhO1G/_OOQ[1G/_1G/_OGuQ`O1G/_OOQW-E8l-E8lOOQ[7+%]7+%]OOQO,5:{,5:{O=pQdO'#ExOCeQ`O,5;cOOQS,5;c,5;cOOQS-E8u-E8uOOQS1G0f1G0fOOQS<<Iq<<IqOG}Q!fO,5;_OOQS-E8q-E8qOOQO<<IX<<IXOOQPAN>jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<<Hh<<HhOOQW<<Hl<<HlOIjQhO<<HlOI{QhO,5;ZOJWQ`O,5;ZOOQO-E8m-E8mOJ]QdO1G1dOBZQdO'#EuOJgQ`O7+%rOOQW7+%r7+%rOJoQ!bO1G/`OOQ[7+$y7+$yOJzQhO7+$yPKRQ`O'#EnOOQO,5;d,5;dOOQO-E8v-E8vOOQS1G0}1G0}OKWQ`OAN>WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<<I^<<I^OOQ[<<He<<HePOQW,5;Y,5;YOOQWG23rG23rOKeQdO7+&a",stateData:"Kx~O#sOS#tQQ~OW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#oRO~OQiOW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#ohO~O#m$SP~P!dO#tmO~O#ooO~O]qO`rOarOjsOmtO!juO!mwO#nvO~OpzO!^xO~P$SOc!QO#o|O#p}O~O#o!RO~O#o!TO~OW[OZ[O]TO`VOaVOjWOmXO!jYO!mZO#oRO~OS!]Oe!YO!V![O!Y!`O#q!XOp$TP~Ok$TP~P&POQ!jOe!cOm!dOp!eOr!mOt!mOz!kO!`!lO#o!bO#p!hO#}!fO~Ot!qO!`!lO#o!pO~Ot!sO#o!sO~OS!]Oe!YO!V![O!Y!`O#q!XO~Oe!vOpzO#Z!xO~O]YX`YX`!pXaYXjYXmYXpYX!^YX!jYX!mYX#nYX~O`!zO~Ok!{O#m$SXo$SX~O#m$SXo$SX~P!dO#u#OO#v#OO#w#QO~Oc#UO#o|O#p}O~OpzO!^xO~Oo$SP~P!dOe#`O~Oe#aO~Ol#bO!h#cO~O]qO`rOarOjsOmtO~Op!ia!^!ia!j!ia!m!ia#n!iad!ia~P*zOp!la!^!la!j!la!m!la#n!lad!la~P*zOR#gOS!]Oe!YOr#gOt#gO!V![O!Y!`O#q#dO#}!fO~O!R#iO!^#jOk$TXp$TX~Oe#mO~Ok#oOpzO~Oe!vO~O]#rO`#rOd#uOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl#wO~P&lO]#rO`#rOi#rOj#rOk#rOo#yO~P&lOP#zOSsXesXksXvsX!VsX!YsX!usX!wsX#qsX!TsXQsX]sX`sXdsXisXjsXmsXpsXrsXtsXzsX!`sX#osX#psX#}sXlsXosX!^sX!qsX#msX~Ov#{O!u#|O!w#}Ok$TP~P'tOe#aOS#{Xk#{Xv#{X!V#{X!Y#{X!u#{X!w#{X#q#{XQ#{X]#{X`#{Xd#{Xi#{Xj#{Xm#{Xp#{Xr#{Xt#{Xz#{X!`#{X#o#{X#p#{X#}#{Xl#{Xo#{X!^#{X!q#{X#m#{X~Oe$RO~Oe$TO~Ok$VOv#{O~Ok$WO~Ot$XO!`!lO~Op$YO~OpzO!R#iO~OpzO#Z$`O~O!q$bOk!oa#m!oao!oa~P&lOk#hX#m#hXo#hX~P!dOk!{O#m$Sao$Sa~O#u#OO#v#OO#w$hO~Ol$jO!h$kO~Op!ii!^!ii!j!ii!m!ii#n!iid!ii~P*zOp!ki!^!ki!j!ki!m!ki#n!kid!ki~P*zOp!li!^!li!j!li!m!li#n!lid!li~P*zOp#fa!^#fa~P$SOo$lO~Od$RP~P%_Od#zP~P&lO`!PXd}X!R}X!T!PX~O`$sO!T$tO~Od$uO!R#iO~Ok#jXp#jX!^#jX~P'tO!^#jOk$Tap$Ta~O!R#iOk!Uap!Ua!^!Uad!Ua`!Ua~OS!]Oe!YO!V![O!Y!`O#q$yO~Od$QP~P9dOv#{OQ#|X]#|X`#|Xd#|Xe#|Xi#|Xj#|Xk#|Xm#|Xp#|Xr#|Xt#|Xz#|X!`#|X#o#|X#p#|X#}#|Xl#|Xo#|X~O]#rO`#rOd%OOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl%PO~P&lO]#rO`#rOi#rOj#rOk#rOo%QO~P&lOe%SOS!tXk!tX!V!tX!Y!tX#q!tX~Ok%TO~Od%YOt%ZO!a%ZO~Ok%[O~Oo%cO#o%^O#}%]O~Od%dO~P$SOv#{O!^%hO!q%jOk!oi#m!oio!oi~P&lOk#ha#m#hao#ha~P!dOk!{O#m$Sio$Si~O!^%mOd$RX~P$SOd%oO~Ov#{OQ#`Xd#`Xe#`Xm#`Xp#`Xr#`Xt#`Xz#`X!^#`X!`#`X#o#`X#p#`X#}#`X~O!^%qOd#zX~P&lOd%sO~Ol%tOv#{O~OR#gOr#gOt#gO#q%vO#}!fO~O!R#iOk#jap#ja!^#ja~O`!PXd}X!R}X!^}X~O!R#iO!^%xOd$QX~O`%zO~Od%{O~O#o%|O~Ok&OO~O`&PO!R#iO~Od&ROk&QO~Od&UO~OP#zOpsX!^sXdsX~O#}%]Op#TX!^#TX~OpzO!^&WO~Oo&[O#o%^O#}%]O~Ov#{OQ#gXe#gXk#gXm#gXp#gXr#gXt#gXz#gX!^#gX!`#gX!q#gX#m#gX#o#gX#p#gX#}#gXo#gX~O!^%hO!q&`Ok!oq#m!oqo!oq~P&lOl&aOv#{O~Od#eX!^#eX~P%_O!^%mOd$Ra~Od#dX!^#dX~P&lO!^%qOd#za~Od&fO~P&lOd&gO!T&hO~Od#cX!^#cX~P9dO!^%xOd$Qa~O]&mOd&oO~OS#bae#ba!V#ba!Y#ba#q#ba~Od&qO~PG]Od&qOk&rO~Ov#{OQ#gae#gak#gam#gap#gar#gat#gaz#ga!^#ga!`#ga!q#ga#m#ga#o#ga#p#ga#}#gao#ga~Od#ea!^#ea~P$SOd#da!^#da~P&lOR#gOr#gOt#gO#q%vO#}%]O~O!R#iOd#ca!^#ca~O`&xO~O!^%xOd$Qi~P&lO]&mOd&|O~Ov#{Od|ik|i~Od&}O~PG]Ok'OO~Od'PO~O!^%xOd$Qq~Od#cq!^#cq~P&lO#s!a#t#}]#}v!m~",goto:"2h$UPPPPP$VP$YP$c$uP$cP%X$cPP%_PPP%e%o%oPPPPP%oPP%oP&]P%oP%o'W%oP't'w'}'}(^'}P'}P'}P'}'}P(m'}(yP(|PP)p)v$c)|$c*SP$cP$c$cP*Y*{+YP$YP+aP+dP$YP$YP$YP+j$YP+m+p+s+z$YP$YPP$YP,P,V,f,|-[-b-l-r-x.O.U.`.f.l.rPPPPPPPPPPP.x/R/w/z0|P1U1u2O2R2U2[RnQ_^OP`kz!{$dq[OPYZ`kuvwxz!v!{#`$d%mqSOPYZ`kuvwxz!v!{#`$d%mQpTR#RqQ!OVR#SrQ#S!QS$Q!i!jR$i#U!V!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'Q!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QU#g!Y$t&hU%`$Y%b&WR&V%_!V!iac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QR$S!kQ%W$RR&S%Xk!^]bf!Y![!g#i#j#m$P$R%X%xQ#e!YQ${#mQ%w$tQ&j%xR&w&hQ!ygQ#p!`Q$^!xR%f$`R#n!]!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QQ!qdR$X!rQ!PVR#TrQ#S!PR$i#TQ!SWR#VsQ!UXR#WtQ{UQ!wgQ#^yQ#o!_Q$U!nQ$[!uQ$_!yQ%e$^Q&Y%aQ&]%fR&v&XSjPzQ!}kQ$c!{R%k$dZiPkz!{$dR$P!gQ%}%SR&z&mR!rdR!teR$Z!tS%a$Y%bR&t&WV%_$Y%b&WQ#PmR$g#PQ`OSkPzU!a`k$dR$d!{Q$p#aY%p$p%u&d&l'QQ%u$sQ&d%qQ&l%zR'Q&xQ#t!cQ#v!dQ#x!eV$}#t#v#xQ%X$RR&T%XQ%y$zS&k%y&yR&y&lQ%r$pR&e%rQ%n$mR&c%nQyUR#]yQ%i$aR&_%iQ!|jS$e!|$fR$f!}Q&n%}R&{&nQ#k!ZR$x#kQ%b$YR&Z%bQ&X%aR&u&X__OP`kz!{$d^UOP`kz!{$dQ!VYQ!WZQ#XuQ#YvQ#ZwQ#[xQ$]!vQ$m#`R&b%mR$q#aQ!gaQ!oc[#q!c!d!e#t#v#xQ$a!zd$o#a$p$s%q%u%z&d&l&x'QQ$r#cQ%R#{S%g$a%iQ%l$kQ&^%hR&p&P]#s!c!d!e#t#v#xW!Z]b!g$PQ!ufQ#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles",maxTerm:143,nodeProps:[["isolate",-2,5,36,""],["openedBy",20,"(",28,"[",31,"{"],["closedBy",21,")",29,"]",32,"}"]],propSources:[gee],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj<VY!a`Oy%Qz{%Q{|<u|}%Q}!O<u!O!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj<zU!a`Oy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj=eU!a`#}YOy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj>O[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj>yS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%QjBUU`YOy%Qz![%Q![!]Bh!];'S%Q;'S;=`%c<%lO%QbBoSaQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjCQSkYOy%Qz;'S%Q;'S;=`%c<%lO%QhCcU!TWOy%Qz!_%Q!_!`Cu!`;'S%Q;'S;=`%c<%lO%QhC|S!TW!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QlDaS!TW!hSOy%Qz;'S%Q;'S;=`%c<%lO%QjDtV!jQ!TWOy%Qz!_%Q!_!`Cu!`!aEZ!a;'S%Q;'S;=`%c<%lO%QbEbS!jQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjEqYOy%Qz}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[pee,mee,fee,dee,1,2,3,4,new Ug("m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~",28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},dynamicPrecedences:{76:1},specialized:[{term:124,get:t=>Oee[t]||-1},{term:125,get:t=>vee[t]||-1},{term:4,get:t=>_ee[t]||-1},{term:25,get:t=>yee[t]||-1},{term:123,get:t=>bee[t]||-1}],tokenPrec:1963});let ey=null;function ty(){if(!ey&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],i=new Set;for(let n in t)n!="cssText"&&n!="cssFloat"&&typeof t[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())),i.has(n)||(e.push(n),i.add(n)));ey=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return ey||[]}const tP=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),iP=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),See=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),wee=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),no=/^(\w[\w-]*|-\w[\w-]*|)$/,Cee=/^-(-[\w-]*)?$/;function kee(t,e){var i;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let n=(i=t.parent)===null||i===void 0?void 0:i.firstChild;return(n==null?void 0:n.name)!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}const nP=new DB,Tee=["Declaration"];function Aee(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function W4(t,e,i){if(e.to-e.from>4096){let n=nP.get(e);if(n)return n;let s=[],r=new Set,o=e.cursor(ut.IncludeAnonymous);if(o.firstChild())do for(let l of W4(t,o.node,i))r.has(l.label)||(r.add(l.label),s.push(l));while(o.nextSibling());return nP.set(e,s),s}else{let n=[],s=new Set;return e.cursor().iterate(r=>{var o;if(i(r)&&r.matchContext(Tee)&&((o=r.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=t.sliceString(r.from,r.to);s.has(l)||(s.add(l),n.push({label:l,type:"variable"}))}}),n}}const Eee=t=>e=>{let{state:i,pos:n}=e,s=St(i).resolveInner(n,-1),r=s.type.isError&&s.from==s.to-1&&i.doc.sliceString(s.from,s.to)=="-";if(s.name=="PropertyName"||(r||s.name=="TagName")&&/^(Block|Styles)$/.test(s.resolve(s.to).name))return{from:s.from,options:ty(),validFor:no};if(s.name=="ValueName")return{from:s.from,options:iP,validFor:no};if(s.name=="PseudoClassName")return{from:s.from,options:tP,validFor:no};if(t(s)||(e.explicit||r)&&kee(s,i.doc))return{from:t(s)||r?s.from:n,options:W4(i.doc,Aee(s),t),validFor:Cee};if(s.name=="TagName"){for(let{parent:c}=s;c;c=c.parent)if(c.name=="Block")return{from:s.from,options:ty(),validFor:no};return{from:s.from,options:See,validFor:no}}if(s.name=="AtKeyword")return{from:s.from,options:wee,validFor:no};if(!e.explicit)return null;let o=s.resolve(n),l=o.childBefore(n);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:tP,validFor:no}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:iP,validFor:no}:o.name=="Block"||o.name=="Styles"?{from:n,options:ty(),validFor:no}:null},Mee=Eee(t=>t.name=="VariableName"),Hg=lh.define({name:"css",parser:xee.configure({props:[md.add({Declaration:Um()}),bh.add({"Block KeyframeList":XB})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Pee(){return new Vf(Hg,Hg.data.of({autocomplete:Mee}))}const Ree=316,Qee=317,sP=1,Lee=2,Dee=3,Bee=4,$ee=318,Nee=320,zee=321,jee=5,Iee=6,Vee=0,Vb=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],U4=125,Xee=59,Xb=47,Zee=42,qee=43,Wee=45,Uee=60,Yee=44,Hee=63,Fee=46,Gee=91,Kee=new P4({start:!1,shift(t,e){return e==jee||e==Iee||e==Nee?t:e==zee},strict:!1}),Jee=new os((t,e)=>{let{next:i}=t;(i==U4||i==-1||e.context)&&t.acceptToken($ee)},{contextual:!0,fallback:!0}),ete=new os((t,e)=>{let{next:i}=t,n;Vb.indexOf(i)>-1||i==Xb&&((n=t.peek(1))==Xb||n==Zee)||i!=U4&&i!=Xee&&i!=-1&&!e.context&&t.acceptToken(Ree)},{contextual:!0}),tte=new os((t,e)=>{t.next==Gee&&!e.context&&t.acceptToken(Qee)},{contextual:!0}),ite=new os((t,e)=>{let{next:i}=t;if(i==qee||i==Wee){if(t.advance(),i==t.next){t.advance();let n=!e.context&&e.canShift(sP);t.acceptToken(n?sP:Lee)}}else i==Hee&&t.peek(1)==Fee&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(Dee))},{contextual:!0});function iy(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const nte=new os((t,e)=>{if(t.next!=Uee||!e.dialectEnabled(Vee)||(t.advance(),t.next==Xb))return;let i=0;for(;Vb.indexOf(t.next)>-1;)t.advance(),i++;if(iy(t.next,!0)){for(t.advance(),i++;iy(t.next,!1);)t.advance(),i++;for(;Vb.indexOf(t.next)>-1;)t.advance(),i++;if(t.next==Yee)return;for(let n=0;;n++){if(n==7){if(!iy(t.next,!0))return;break}if(t.next!="extends".charCodeAt(n))break;t.advance(),i++}}t.acceptToken(Bee,-i)}),ste=_h({"get set async static":X.modifier,"for while do if else switch try catch finally return throw break continue default case defer":X.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":X.operatorKeyword,"let var const using function class extends":X.definitionKeyword,"import export from":X.moduleKeyword,"with debugger new":X.keyword,TemplateString:X.special(X.string),super:X.atom,BooleanLiteral:X.bool,this:X.self,null:X.null,Star:X.modifier,VariableName:X.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":X.function(X.variableName),VariableDefinition:X.definition(X.variableName),Label:X.labelName,PropertyName:X.propertyName,PrivatePropertyName:X.special(X.propertyName),"CallExpression/MemberExpression/PropertyName":X.function(X.propertyName),"FunctionDeclaration/VariableDefinition":X.function(X.definition(X.variableName)),"ClassDeclaration/VariableDefinition":X.definition(X.className),"NewExpression/VariableName":X.className,PropertyDefinition:X.definition(X.propertyName),PrivatePropertyDefinition:X.definition(X.special(X.propertyName)),UpdateOp:X.updateOperator,"LineComment Hashbang":X.lineComment,BlockComment:X.blockComment,Number:X.number,String:X.string,Escape:X.escape,ArithOp:X.arithmeticOperator,LogicOp:X.logicOperator,BitOp:X.bitwiseOperator,CompareOp:X.compareOperator,RegExp:X.regexp,Equals:X.definitionOperator,Arrow:X.function(X.punctuation),": Spread":X.punctuation,"( )":X.paren,"[ ]":X.squareBracket,"{ }":X.brace,"InterpolationStart InterpolationEnd":X.special(X.brace),".":X.derefOperator,", ;":X.separator,"@":X.meta,TypeName:X.typeName,TypeDefinition:X.definition(X.typeName),"type enum interface implements namespace module declare":X.definitionKeyword,"abstract global Privacy readonly override":X.modifier,"is keyof unique infer asserts":X.operatorKeyword,JSXAttributeValue:X.attributeValue,JSXText:X.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":X.angleBracket,"JSXIdentifier JSXNameSpacedName":X.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":X.attributeName,"JSXBuiltin/JSXIdentifier":X.standard(X.tagName)}),rte={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},ote={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},ate={__proto__:null,"<":193},lte=fh.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]",stateData:"()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O![*^O(T*XO!k)OP~P!1uO#k*aO~O!l*bO~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T*dO(VTO(YUO(a$uO(y$}O(z%PO~O![*gO!Y)PP~P!3tOr*sOs!nO!S*iO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO(e!mO~O!^*pO~P!5iO#S$dOn(`X!Q(`X'y(`X(y(`X(z(`X!](`X#`(`X~Og(`X$O(`X~P!6kOn*xO#`*wOg(_X!](_X~O!]*yOg(^X~Oj%dOk%dOl%dO(T&ZOg(^P~Os*|O~Og)}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hO![+ZO!](^O!_%iO(T%gO!Y(vP~Os'[O!S+]O![+[O(VTO(YUO(e(|O~O!^(xP~P!9|O!]+^Oa)TX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WO![/mO!](^O(T/lO!Y(vP!Y)PP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~",goto:"$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:Kee,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[ste],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!k!Lf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!S0,v$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ete,tte,ite,nte,2,3,4,5,6,7,8,9,10,11,12,13,14,Jee,new Ug("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Ug("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>rte[t]||-1},{term:343,get:t=>ote[t]||-1},{term:95,get:t=>ate[t]||-1}],tokenPrec:15201}),Y4=[Qn("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Qn("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Qn("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Qn("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Qn("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Qn(`try {
75
- \${}
76
- } catch (\${error}) {
77
- \${}
78
- }`,{label:"try",detail:"/ catch block",type:"keyword"}),Qn("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Qn(`if (\${}) {
79
- \${}
80
- } else {
81
- \${}
82
- }`,{label:"if",detail:"/ else block",type:"keyword"}),Qn(`class \${name} {
83
- constructor(\${params}) {
84
- \${}
85
- }
86
- }`,{label:"class",detail:"definition",type:"keyword"}),Qn('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Qn('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],cte=Y4.concat([Qn("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Qn("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Qn("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),rP=new DB,H4=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Ru(t){return(e,i)=>{let n=e.node.getChild("VariableDefinition");return n&&i(n,t),!0}}const hte=["FunctionDeclaration"],ute={FunctionDeclaration:Ru("function"),ClassDeclaration:Ru("class"),ClassExpression:()=>!0,EnumDeclaration:Ru("constant"),TypeAliasDeclaration:Ru("type"),NamespaceDeclaration:Ru("namespace"),VariableDefinition(t,e){t.matchContext(hte)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function F4(t,e){let i=rP.get(e);if(i)return i;let n=[],s=!0;function r(o,l){let c=t.sliceString(o.from,o.to);n.push({label:c,type:l})}return e.cursor(ut.IncludeAnonymous).iterate(o=>{if(s)s=!1;else if(o.name){let l=ute[o.name];if(l&&l(o,r)||H4.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of F4(t,o.node))n.push(l);return!1}}),rP.set(e,n),n}const oP=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,G4=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function fte(t){let e=St(t.state).resolveInner(t.pos,-1);if(G4.indexOf(e.name)>-1)return null;let i=e.name=="VariableName"||e.to-e.from<20&&oP.test(t.state.sliceDoc(e.from,e.to));if(!i&&!t.explicit)return null;let n=[];for(let s=e;s;s=s.parent)H4.has(s.name)&&(n=n.concat(F4(t.state.doc,s)));return{options:n,from:i?e.from:t.pos,validFor:oP}}const kr=lh.define({name:"javascript",parser:lte.configure({props:[md.add({IfStatement:Um({except:/^\s*({|else\b)/}),TryStatement:Um({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:NY,SwitchBody:t=>{let e=t.textAfter,i=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:n?1:2)*t.unit},Block:$Y({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Um({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),bh.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":XB,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),K4={test:t=>/^JSX/.test(t.name),facet:GS({commentTokens:{block:{open:"{/*",close:"*/}"}}})},J4=kr.configure({dialect:"ts"},"typescript"),eN=kr.configure({dialect:"jsx",props:[KS.add(t=>t.isTop?[K4]:void 0)]}),tN=kr.configure({dialect:"jsx ts",props:[KS.add(t=>t.isTop?[K4]:void 0)]},"typescript");let iN=t=>({label:t,type:"keyword"});const nN="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(iN),dte=nN.concat(["declare","implements","private","protected","public"].map(iN));function pte(t={}){let e=t.jsx?t.typescript?tN:eN:t.typescript?J4:kr,i=t.typescript?cte.concat(dte):Y4.concat(nN);return new Vf(e,[kr.data.of({autocomplete:sG(G4,q$(i))}),kr.data.of({autocomplete:fte}),t.jsx?Ote:[]])}function mte(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function aP(t,e,i=t.length){for(let n=e==null?void 0:e.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return t.sliceString(n.from,Math.min(n.to,i));return""}const gte=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Ote=ve.inputHandler.of((t,e,i,n,s)=>{if((gte?t.composing:t.compositionStarted)||t.state.readOnly||e!=i||n!=">"&&n!="/"||!kr.isActiveAt(t.state,e,-1))return!1;let r=s(),{state:o}=r,l=o.changeByRange(c=>{var u;let{head:d}=c,p=St(o).resolveInner(d-1,-1),g;if(p.name=="JSXStartTag"&&(p=p.parent),!(o.doc.sliceString(d-1,d)!=n||p.name=="JSXAttributeValue"&&p.to>d)){if(n==">"&&p.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(n=="/"&&p.name=="JSXStartCloseTag"){let O=p.parent,_=O.parent;if(_&&O.from==d-2&&((g=aP(o.doc,_.firstChild,d))||((u=_.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let b=`${g}>`;return{range:re.cursor(d+b.length,-1),changes:{from:d,insert:b}}}}else if(n==">"){let O=mte(p);if(O&&O.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(d,d+2))&&(g=aP(o.doc,O,d)))return{range:c,changes:{from:d,insert:`</${g}>`}}}}return{range:c}});return l.changes.empty?!1:(t.dispatch([r,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Qu=["_blank","_self","_top","_parent"],ny=["ascii","utf-8","utf-16","latin1","latin1"],sy=["get","post","put","delete"],ry=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Gn=["true","false"],Me={},vte={a:{attrs:{href:null,ping:null,type:null,media:null,target:Qu,hreflang:null}},abbr:Me,address:Me,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Me,aside:Me,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Me,base:{attrs:{href:null,target:Qu}},bdi:Me,bdo:Me,blockquote:{attrs:{cite:null}},body:Me,br:Me,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:ry,formmethod:sy,formnovalidate:["novalidate"],formtarget:Qu,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Me,center:Me,cite:Me,code:Me,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Me,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Me,div:Me,dl:Me,dt:Me,em:Me,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Me,figure:Me,footer:Me,form:{attrs:{action:null,name:null,"accept-charset":ny,autocomplete:["on","off"],enctype:ry,method:sy,novalidate:["novalidate"],target:Qu}},h1:Me,h2:Me,h3:Me,h4:Me,h5:Me,h6:Me,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Me,hgroup:Me,hr:Me,html:{attrs:{manifest:null}},i:Me,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:ry,formmethod:sy,formnovalidate:["novalidate"],formtarget:Qu,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Me,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Me,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Me,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:ny,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Me,noscript:Me,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Me,param:{attrs:{name:null,value:null}},pre:Me,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Me,rt:Me,ruby:Me,samp:Me,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:ny}},section:Me,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Me,source:{attrs:{src:null,type:null,media:null}},span:Me,strong:Me,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Me,summary:Me,sup:Me,table:Me,tbody:Me,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Me,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Me,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Me,time:{attrs:{datetime:null}},title:Me,tr:Me,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Me,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Me},sN={accesskey:null,class:null,contenteditable:Gn,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Gn,autocorrect:Gn,autocapitalize:Gn,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Gn,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Gn,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Gn,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Gn,"aria-hidden":Gn,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Gn,"aria-multiselectable":Gn,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Gn,"aria-relevant":null,"aria-required":Gn,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},rN="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of rN)sN[t]=null;let Jf=class{constructor(e,i){this.tags={...vte,...e},this.globalAttrs={...sN,...i},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};Jf.default=new Jf;function dh(t,e,i=t.length){if(!e)return"";let n=e.firstChild,s=n&&n.getChild("TagName");return s?t.sliceString(s.from,Math.min(s.to,i)):""}function ph(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function oN(t,e,i){let n=i.tags[dh(t,ph(e))];return(n==null?void 0:n.children)||i.allTags}function Cw(t,e){let i=[];for(let n=ph(e);n&&!n.type.isTop;n=ph(n.parent)){let s=dh(t,n);if(s&&n.lastChild.name=="CloseTag")break;s&&i.indexOf(s)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&i.push(s)}return i}const aN=/^[:\-\.\w\u00b7-\uffff]*$/;function lP(t,e,i,n,s){let r=/\s*>/.test(t.sliceDoc(s,s+5))?"":">",o=ph(i,i.name=="StartTag"||i.name=="TagName");return{from:n,to:s,options:oN(t.doc,o,e).map(l=>({label:l,type:"type"})).concat(Cw(t.doc,i).map((l,c)=>({label:"/"+l,apply:"/"+l+r,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function cP(t,e,i,n){let s=/\s*>/.test(t.sliceDoc(n,n+5))?"":">";return{from:i,to:n,options:Cw(t.doc,e).map((r,o)=>({label:r,apply:r+s,type:"type",boost:99-o})),validFor:aN}}function _te(t,e,i,n){let s=[],r=0;for(let o of oN(t.doc,i,e))s.push({label:"<"+o,type:"type"});for(let o of Cw(t.doc,i))s.push({label:"</"+o+">",type:"type",boost:99-r++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function yte(t,e,i,n,s){let r=ph(i),o=r?e.tags[dh(t.doc,r)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:aN}}function bte(t,e,i,n,s){var r;let o=(r=i.parent)===null||r===void 0?void 0:r.getChild("AttributeName"),l=[],c;if(o){let u=t.sliceDoc(o.from,o.to),d=e.globalAttrs[u];if(!d){let p=ph(i),g=p?e.tags[dh(t.doc,p)]:null;d=(g==null?void 0:g.attrs)&&g.attrs[u]}if(d){let p=t.sliceDoc(n,s).toLowerCase(),g='"',O='"';/^['"]/.test(p)?(c=p[0]=='"'?/^[^"]*$/:/^[^']*$/,g="",O=t.sliceDoc(s,s+1)==p[0]?"":p[0],p=p.slice(1),n++):c=/^[^\s<>='"]*$/;for(let _ of d)l.push({label:_,apply:g+_+O,type:"constant"})}}return{from:n,to:s,options:l,validFor:c}}function lN(t,e){let{state:i,pos:n}=e,s=St(i).resolveInner(n,-1),r=s.resolve(n);for(let o=n,l;r==s&&(l=s.childBefore(o));){let c=l.lastChild;if(!c||!c.type.isError||c.from<c.to)break;r=s=l,o=c.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?cP(i,s,s.from,n):lP(i,t,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?lP(i,t,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?cP(i,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?yte(i,t,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?bte(i,t,s,s.name=="Is"?n:s.from,n):e.explicit&&(r.name=="Element"||r.name=="Text"||r.name=="Document")?_te(i,t,s,n):null}function xte(t){return lN(Jf.default,t)}function Ste(t){let{extraTags:e,extraGlobalAttributes:i}=t,n=i||e?new Jf(e,i):Jf.default;return s=>lN(n,s)}const wte=kr.parser.configure({top:"SingleExpression"}),cN=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:J4.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:eN.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:tN.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:wte},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:kr.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:Hg.parser}],hN=[{name:"style",parser:Hg.parser.configure({top:"Styles"})}].concat(rN.map(t=>({name:t,parser:kr.parser}))),uN=lh.define({name:"html",parser:HJ.configure({props:[md.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e=null,i;for(let n=t.node;;){let s=n.lastChild;if(!s||s.name!="Element"||s.to!=n.to)break;e=n=s}return e&&!((i=e.lastChild)&&(i.name=="CloseTag"||i.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),bh.add({Element(t){let e=t.firstChild,i=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:i.name=="CloseTag"?i.from:t.to}}}),i$.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Gm=uN.configure({wrap:I4(cN,hN)});function Cte(t={}){let e="",i;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(i=I4((t.nestedLanguages||[]).concat(cN),(t.nestedAttributes||[]).concat(hN)));let n=i?uN.configure({wrap:i,dialect:e}):e?Gm.configure({dialect:e}):Gm;return new Vf(n,[Gm.data.of({autocomplete:Ste(t)}),t.autoCloseTags!==!1?kte:[],pte().support,Pee().support])}const hP=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),kte=ve.inputHandler.of((t,e,i,n,s)=>{if(t.composing||t.state.readOnly||e!=i||n!=">"&&n!="/"||!Gm.isActiveAt(t.state,e,-1))return!1;let r=s(),{state:o}=r,l=o.changeByRange(c=>{var u,d,p;let g=o.doc.sliceString(c.from-1,c.to)==n,{head:O}=c,_=St(o).resolveInner(O,-1),b;if(g&&n==">"&&_.name=="EndTag"){let S=_.parent;if(((d=(u=S.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=dh(o.doc,S.parent,O))&&!hP.has(b)){let w=O+(o.doc.sliceString(O,O+1)===">"?1:0),T=`</${b}>`;return{range:c,changes:{from:O,to:w,insert:T}}}}else if(g&&n=="/"&&_.name=="IncompleteCloseTag"){let S=_.parent;if(_.from==O-2&&((p=S.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(b=dh(o.doc,S,O))&&!hP.has(b)){let w=O+(o.doc.sliceString(O,O+1)===">"?1:0),T=`${b}>`;return{range:re.cursor(O+T.length,-1),changes:{from:O,to:w,insert:T}}}}return{range:c}});return l.changes.empty?!1:(t.dispatch([r,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),fN=GS({commentTokens:{block:{open:"<!--",close:"-->"}}}),dN=new je,pN=XK.configure({props:[bh.add(t=>!t.is("Block")||t.is("Document")||Zb(t)!=null||Tte(t)?void 0:(e,i)=>({from:i.doc.lineAt(e.from).to,to:e.to})),dN.add(Zb),md.add({Document:()=>null}),vl.add({Document:fN})]});function Zb(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function Tte(t){return t.name=="OrderedList"||t.name=="BulletList"}function Ate(t,e){let i=t;for(;;){let n=i.nextSibling,s;if(!n||(s=Zb(n.type))!=null&&s<=e)break;i=n}return i.to}const Ete=VB.of((t,e,i)=>{for(let n=St(t).resolveInner(i,-1);n&&!(n.from<e);n=n.parent){let s=n.type.prop(dN);if(s==null)continue;let r=Ate(n,s);if(r>i)return{from:i,to:r}}return null});function kw(t){return new As(fN,t,[],"markdown")}const Mte=kw(pN),Pte=pN.configure([eJ,iJ,tJ,nJ,{props:[bh.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),ed=kw(Pte);function Rte(t,e){return i=>{if(i&&t){let n=null;if(i=/\S*/.exec(i)[0],typeof t=="function"?n=t(i):n=Pg.matchLanguageName(t,i,!0),n instanceof Pg)return n.support?n.support.language.parser:If.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class oy{constructor(e,i,n,s,r,o,l){this.node=e,this.from=i,this.to=n,this.spaceBefore=s,this.spaceAfter=r,this.type=o,this.item=l}blank(e,i=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length<e;)n+=" ";return n}else{for(let s=this.to-this.from-n.length-this.spaceAfter.length;s>0;s--)n+=" ";return n+(i?this.spaceAfter:"")}}marker(e,i){let n=this.node.name=="OrderedList"?String(+gN(this.item,e)[2]+i):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function mN(t,e){let i=[],n=[];for(let s=t;s;s=s.parent){if(s.name=="FencedCode")return n;(s.name=="ListItem"||s.name=="Blockquote")&&i.push(s)}for(let s=i.length-1;s>=0;s--){let r=i[s],o,l=e.lineAt(r.from),c=r.from-l.from;if(r.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(c))))n.push(new oy(r,c,c+o[0].length,"",o[1],">",null));else if(r.name=="ListItem"&&r.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=o[3],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),n.push(new oy(r.parent,c,c+d,o[1],u,o[2],r))}else if(r.name=="ListItem"&&r.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=o[4],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let p=o[2];o[3]&&(p+=o[3].replace(/[xX]/," ")),n.push(new oy(r.parent,c,c+d,o[1],u,p,r))}}return n}function gN(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function ay(t,e,i,n=0){for(let s=-1,r=t;;){if(r.name=="ListItem"){let l=gN(r,e),c=+l[2];if(s>=0){if(c!=s+1)return;i.push({from:r.from+l[1].length,to:r.from+l[0].length,insert:String(s+2+n)})}s=c}let o=r.nextSibling;if(!o)break;r=o}}function Tw(t,e){let i=/^[ \t]*/.exec(t)[0].length;if(!i||e.facet(yh)!=" ")return t;let n=Ys(t,4,i),s="";for(let r=n;r>0;)r>=4?(s+=" ",r-=4):(s+=" ",r--);return s+t.slice(i)}const Qte=(t={})=>({state:e,dispatch:i})=>{let n=St(e),{doc:s}=e,r=null,o=e.changeByRange(l=>{if(!l.empty||!ed.isActiveAt(e,l.from,-1)&&!ed.isActiveAt(e,l.from,1))return r={range:l};let c=l.from,u=s.lineAt(c),d=mN(n.resolveInner(c,-1),s);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return r={range:l};let p=d[d.length-1];if(p.to-p.spaceAfter.length>c-u.from)return r={range:l};let g=c>=p.to-p.spaceAfter.length&&!/\S/.test(u.text.slice(p.to));if(p.item&&g){let w=p.node.firstChild,T=p.node.getChild("ListItem","ListItem");if(w.to>=c||T&&T.to<c||u.from>0&&!/[^\s>]/.test(s.lineAt(u.from-1).text)||t.nonTightLists===!1){let k=d.length>1?d[d.length-2]:null,A,R="";k&&k.item?(A=u.from+k.from,R=k.marker(s,1)):A=u.from+(k?k.to:0);let E=[{from:A,to:c,insert:R}];return p.node.name=="OrderedList"&&ay(p.item,s,E,-2),k&&k.node.name=="OrderedList"&&ay(k.item,s,E),{range:re.cursor(A+R.length),changes:E}}else{let k=fP(d,e,u);return{range:re.cursor(c+k.length+1),changes:{from:u.from,insert:k+e.lineBreak}}}}if(p.node.name=="Blockquote"&&g&&u.from){let w=s.lineAt(u.from-1),T=/>\s*$/.exec(w.text);if(T&&T.index==p.from){let k=e.changes([{from:w.from+T.index,to:w.to},{from:u.from+p.from,to:u.to}]);return{range:l.map(k),changes:k}}}let O=[];p.node.name=="OrderedList"&&ay(p.item,s,O);let _=p.item&&p.item.from<u.from,b="";if(!_||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=p.to)for(let w=0,T=d.length-1;w<=T;w++)b+=w==T&&!_?d[w].marker(s,1):d[w].blank(w<T?Ys(u.text,4,d[w+1].from)-b.length:null);let S=c;for(;S>u.from&&/\s/.test(u.text.charAt(S-u.from-1));)S--;return b=Tw(b,e),Dte(p.node,e.doc)&&(b=fP(d,e,u)+e.lineBreak+b),O.push({from:S,to:c,insert:e.lineBreak+b}),{range:re.cursor(S+b.length+1),changes:O}});return r?!1:(i(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},Lte=Qte();function uP(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Dte(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let i=t.firstChild,n=t.getChild("ListItem","ListItem");if(!n)return!1;let s=e.lineAt(i.to),r=e.lineAt(n.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1)<r.number}function fP(t,e,i){let n="";for(let s=0,r=t.length-2;s<=r;s++)n+=t[s].blank(s<r?Ys(i.text,4,t[s+1].from)-n.length:null,s<r);return Tw(n,e)}function Bte(t,e){let i=t.resolveInner(e,-1),n=e;uP(i)&&(n=i.from,i=i.parent);for(let s;s=i.childBefore(n);)if(uP(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")i=s.lastChild,n=i.to;else break;return i}const $te=({state:t,dispatch:e})=>{let i=St(t),n=null,s=t.changeByRange(r=>{let o=r.from,{doc:l}=t;if(r.empty&&ed.isActiveAt(t,r.from)){let c=l.lineAt(o),u=mN(Bte(i,o),l);if(u.length){let d=u[u.length-1],p=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>p&&!/\S/.test(c.text.slice(p,o-c.from)))return{range:re.cursor(c.from+p),changes:{from:c.from+p,to:o}};if(o-c.from==p&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let g=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let O=d.blank(Ys(c.text,4,d.to)-Ys(c.text,4,d.from));return g==c.from&&(O=Tw(O,t)),{range:re.cursor(g+O.length),changes:{from:g,to:c.from+d.to,insert:O}}}if(g<o)return{range:re.cursor(g),changes:{from:g,to:o}}}}}return n={range:r}});return n?!1:(e(t.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},Nte=[{key:"Enter",run:Lte},{key:"Backspace",run:$te}],ON=Cte({matchClosingTags:!1});function zte(t={}){let{codeLanguages:e,defaultCodeLanguage:i,addKeymap:n=!0,base:{parser:s}=Mte,completeHTMLTags:r=!0,pasteURLAsLink:o=!0,htmlTagLanguage:l=ON}=t;if(!(s instanceof wO))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=t.extensions?[t.extensions]:[],u=[l.support,Ete],d;o&&u.push(Xte),i instanceof Vf?(u.push(i.support),d=i.language):i&&(d=i);let p=e||d?Rte(e,d):void 0;c.push(qK({codeParser:p,htmlParser:l.language.parser})),n&&u.push(wo.high(Ll.of(Nte)));let g=kw(s.configure(c));return r&&u.push(g.data.of({autocomplete:jte})),new Vf(g,u)}function jte(t){let{state:e,pos:i}=t,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(i-25,i));if(!n)return null;let s=St(e).resolveInner(i,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:i-n[0].length,to:i,options:Ite(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let ly=null;function Ite(){if(ly)return ly;let t=xte(new lw(et.create({extensions:ON}),0,!0));return ly=t?t.options:[]}const Vte=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Xte=ve.domEventHandlers({paste:(t,e)=>{var i;let{main:n}=e.state.selection;if(n.empty)return!1;let s=(i=t.clipboardData)===null||i===void 0?void 0:i.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!ed.isActiveAt(e.state,n.from,1)))return!1;let r=St(e.state),o=!1;return r.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||Vte.test(l.name))&&(o=!0)},leave:l=>{l.to<n.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}});function Zte({initialContent:t,filePath:e,onSave:i,onClose:n}){const[s,r]=I.useState(t),[o,l]=I.useState(!1),[c,u]=I.useState(!1),d=I.useRef(s);I.useEffect(()=>{d.current=s},[s]);const p=I.useCallback(b=>{r(b),u(b!==t)},[t]),g=I.useCallback(async()=>{if(!o){l(!0);try{await i(d.current),u(!1)}catch(b){console.error("[plan-editor] Save failed:",b)}finally{l(!1)}}},[i,o]),O=I.useCallback(()=>{c&&!window.confirm("Unsaved changes -- discard?")||n()},[c,n]),_=Ll.of([{key:"Mod-s",run:()=>(g(),!0)}]);return I.useEffect(()=>{const b=S=>{(S.ctrlKey||S.metaKey)&&S.key==="s"&&S.preventDefault()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[]),x.jsxs("div",{className:"fixed inset-0 z-50 bg-background/95 flex flex-col",children:[x.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-card",children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:e}),c&&x.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-sm bg-warning/20 text-warning font-mono",children:"unsaved"})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[c&&x.jsx("button",{type:"button",onClick:g,disabled:o,className:Ne("text-xs px-3 py-1.5 rounded-md font-mono","bg-accent text-foreground","hover:bg-accent-glow","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50"),children:o?"Saving...":"Save"}),x.jsx("button",{type:"button",onClick:O,className:Ne("text-xs px-3 py-1.5 rounded-md font-mono","bg-muted text-muted-foreground","hover:bg-danger/20 hover:text-danger","transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50"),children:"Close"})]})]}),x.jsx("div",{className:"flex-1 overflow-auto",children:x.jsx(a4,{value:s,onChange:p,theme:o4,extensions:[zte({base:ed}),_],height:"calc(100vh - 56px)",basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!0,bracketMatching:!0,indentOnInput:!0}})})]})}function qte({phaseId:t,onBack:e}){const{plans:i,context:n,research:s,loading:r,error:o,refetch:l}=qZ(t),[c,u]=I.useState(null),[d,p]=I.useState(""),g=i.length>0?i[0].frontmatter.phase??t:t,O=I.useCallback(async S=>{try{const T=S.replace(/^\.planning[\\/]/,"").split(/[\\/]/),k=await fetch(`/api/plan/${T.join("/")}`);if(!k.ok)return;const A=await k.json();p(A.content),u(S)}catch(w){console.error("[phase-detail]",w)}},[]),_=I.useCallback(async S=>{if(!c)return;const T=c.replace(/^\.planning[\\/]/,"").split(/[\\/]/);if(!(await fetch(`/api/plan/${T.join("/")}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:S})})).ok)throw new Error("Failed to save plan")},[c]),b=I.useCallback(()=>{u(null),p(""),l()},[l]);return x.jsxs("div",{className:"space-y-6",children:[x.jsxs("button",{type:"button",onClick:e,className:Ne("flex items-center gap-2 font-mono text-[10px] uppercase tracking-widest text-muted-foreground","hover:text-foreground transition-colors"),children:[x.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("path",{d:"M10 3L5 8l5 5"})}),"Overview"]}),x.jsxs("div",{className:"border-b border-border pb-4",children:[x.jsxs("div",{className:"flex items-baseline gap-3 mb-2",children:[x.jsxs("span",{className:"font-mono text-xs font-bold text-accent uppercase tracking-widest",children:["Phase ",t]}),x.jsx("h2",{className:"text-lg font-semibold tracking-tight text-foreground",children:g})]}),x.jsxs("div",{className:"flex gap-2",children:[n&&x.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 border border-success/30 text-success",children:"Context"}),s&&x.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 border border-success/30 text-success",children:"Research"}),!n&&!s&&!r&&x.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 border border-border text-muted-foreground",children:"No context"})]})]}),o&&x.jsx("div",{className:"border border-danger/30 p-4 text-danger text-sm font-mono text-xs",children:o}),r&&i.length===0&&x.jsx("div",{className:"space-y-3",children:[1,2,3].map(S=>x.jsxs("div",{className:"border border-border p-4 animate-pulse",children:[x.jsx("div",{className:"h-4 w-24 bg-muted mb-3"}),x.jsx("div",{className:"h-3 w-3/4 bg-muted mb-2"}),x.jsx("div",{className:"h-3 w-1/2 bg-muted"})]},S))}),!r&&!o&&i.length===0&&x.jsx("div",{className:"border border-border p-8 text-center",children:x.jsxs("p",{className:"font-mono text-xs text-muted-foreground",children:["No plans yet — run"," ",x.jsx("code",{className:"text-accent",children:"/maxsim:plan-phase"})]})}),i.length>0&&x.jsx("div",{className:"space-y-3",children:i.map(S=>x.jsx(UZ,{plan:S,onEdit:O},S.path))}),c&&x.jsx(Zte,{initialContent:d,filePath:c,onSave:_,onClose:b})]})}function Wte(){const{lastChange:t}=Rr(),[e,i]=I.useState([]),[n,s]=I.useState([]),[r,o]=I.useState(!0),[l,c]=I.useState(null),[u,d]=I.useState(""),[p,g]=I.useState(!1),[O,_]=I.useState(!1),b=I.useCallback(async()=>{try{c(null);const T=await fetch("/api/todos");if(!T.ok)throw new Error(`Failed to fetch todos: ${T.status}`);const k=await T.json();i(k.pending),s(k.completed)}catch(T){c(T instanceof Error?T.message:"Failed to fetch todos")}finally{o(!1)}},[]);I.useEffect(()=>{b()},[b]),I.useEffect(()=>{t>0&&b()},[t,b]);const S=I.useCallback(async()=>{const T=u.trim();if(T){g(!0);try{if(!(await fetch("/api/todos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:T})})).ok)throw new Error("Failed to create todo");d(""),await b()}catch(k){c(k instanceof Error?k.message:"Failed to create todo")}finally{g(!1)}}},[u,b]),w=I.useCallback(async(T,k)=>{try{if(!(await fetch("/api/todos",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:T,completed:k})})).ok)throw new Error("Failed to update todo");await b()}catch(A){c(A instanceof Error?A.message:"Failed to update todo")}},[b]);return x.jsxs("div",{className:"space-y-6",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("h2",{className:"font-mono text-xs uppercase tracking-widest text-foreground",children:"Todos"}),x.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[e.length," pending"]})]}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx("input",{type:"text",value:u,onChange:T=>d(T.target.value),onKeyDown:T=>{T.key==="Enter"&&!p&&S()},placeholder:"Add a new todo...",className:"flex-1 border border-border bg-card px-3 py-2 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:border-accent focus:outline-none"}),x.jsx("button",{type:"button",onClick:S,disabled:p||!u.trim(),className:Ne("bg-accent px-4 py-2 font-mono text-[10px] uppercase tracking-widest text-foreground transition-colors","hover:opacity-80 disabled:opacity-30 disabled:cursor-not-allowed"),children:"Add"})]}),l&&x.jsx("div",{className:"border border-danger/30 px-3 py-2 font-mono text-xs text-danger",children:l}),r&&x.jsx("div",{className:"space-y-px",children:[1,2,3].map(T=>x.jsxs("div",{className:"flex items-center gap-3 bg-card px-4 py-3",children:[x.jsx("div",{className:"h-3 w-3 animate-pulse bg-muted"}),x.jsx("div",{className:"h-3 w-48 animate-pulse bg-muted"})]},T))}),!r&&x.jsx("div",{className:"space-y-1",children:e.length===0?x.jsx("p",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:"No pending todos"}):e.map(T=>x.jsxs("button",{type:"button",onClick:()=>w(T.file,!0),className:"group flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors hover:bg-card-hover border-b border-border",children:[x.jsx("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center border border-muted-foreground transition-colors group-hover:border-accent"}),x.jsx("span",{className:"text-sm text-foreground",children:T.text})]},T.file))}),!r&&n.length>0&&x.jsxs("div",{className:"border-t border-border pt-4",children:[x.jsxs("button",{type:"button",onClick:()=>_(!O),className:"flex w-full items-center gap-2 text-left",children:[x.jsx("svg",{className:Ne("h-3 w-3 text-muted-foreground transition-transform",O&&"rotate-90"),viewBox:"0 0 12 12",fill:"currentColor",children:x.jsx("path",{d:"M4 2l5 4-5 4z"})}),x.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["Completed (",n.length,")"]})]}),O&&x.jsx("div",{className:"mt-2 space-y-1",children:n.map(T=>x.jsxs("button",{type:"button",onClick:()=>w(T.file,!1),className:"group flex w-full items-center gap-3 rounded-sm px-4 py-2 text-left transition-colors hover:bg-card-hover",children:[x.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-success bg-success/20",children:x.jsx("svg",{className:"h-3 w-3 text-success",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("path",{d:"M2 6l3 3 5-5"})})}),x.jsx("span",{className:"text-sm text-muted-foreground line-through",children:T.text})]},T.file))})]})]})}function Ute({onEntryAdded:t}){const[e,i]=I.useState(!1),[n,s]=I.useState("decision"),[r,o]=I.useState(""),[l,c]=I.useState(""),[u,d]=I.useState(!1),[p,g]=I.useState(null),[O,_]=I.useState(null),b=I.useCallback(async()=>{const S=l.trim();if(S){d(!0),g(null),_(null);try{if(n==="decision"){const w=await fetch("/api/state/decision",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phase:r.trim()||void 0,text:S})});if(!w.ok){const T=await w.json().catch(()=>({}));throw new Error(T.error||"Could not add decision")}_("Decision added")}else{const w=await fetch("/api/state/blocker",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:S})});if(!w.ok){const T=await w.json().catch(()=>({}));throw new Error(T.error||"Could not add blocker")}_("Blocker added")}c(""),o(""),t==null||t(),setTimeout(()=>_(null),2e3)}catch(w){g(w instanceof Error?w.message:"Failed to update STATE.md")}finally{d(!1)}}},[n,r,l,t]);return x.jsxs("div",{className:"border-t border-border pt-4",children:[x.jsxs("button",{type:"button",onClick:()=>i(!e),className:"flex w-full items-center gap-2 text-left",children:[x.jsx("svg",{className:Ne("h-3 w-3 text-muted-foreground transition-transform",e&&"rotate-90"),viewBox:"0 0 12 12",fill:"currentColor",children:x.jsx("path",{d:"M4 2l5 4-5 4z"})}),x.jsx("span",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Add to STATE.md"})]}),e&&x.jsxs("div",{className:"mt-3 space-y-3",children:[x.jsxs("div",{className:"flex gap-1",children:[x.jsx("button",{type:"button",onClick:()=>s("decision"),className:Ne("rounded-sm px-3 py-1 font-mono text-xs transition-colors",n==="decision"?"bg-accent/20 text-accent":"text-muted-foreground hover:text-foreground"),children:"Decision"}),x.jsx("button",{type:"button",onClick:()=>s("blocker"),className:Ne("rounded-sm px-3 py-1 font-mono text-xs transition-colors",n==="blocker"?"bg-danger/20 text-danger":"text-muted-foreground hover:text-foreground"),children:"Blocker"})]}),n==="decision"&&x.jsx("input",{type:"text",value:r,onChange:S=>o(S.target.value),placeholder:"Phase (e.g. 13-06)",className:"w-full rounded-sm border border-border bg-card px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:border-accent focus:outline-none"}),x.jsx("input",{type:"text",value:l,onChange:S=>c(S.target.value),onKeyDown:S=>{S.key==="Enter"&&!u&&b()},placeholder:n==="decision"?"Decision text...":"Blocker description...",className:"w-full rounded-sm border border-border bg-card px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:border-accent focus:outline-none"}),x.jsx("button",{type:"button",onClick:b,disabled:u||!l.trim(),className:Ne("rounded-sm px-3 py-1.5 font-mono text-xs font-semibold transition-colors","disabled:opacity-40 disabled:cursor-not-allowed",n==="decision"?"bg-accent/20 text-accent hover:bg-accent/30":"bg-danger/20 text-danger hover:bg-danger/30"),children:u?"Saving...":`Add ${n==="decision"?"Decision":"Blocker"}`}),p&&x.jsx("p",{className:"text-xs text-danger",children:p}),O&&x.jsx("p",{className:"text-xs text-success",children:O})]})]})}function Yte(t){return t.map(e=>({text:e.replace(/~~(.+)~~/,"$1").replace(/\s*RESOLVED.*$/i,"").trim(),resolved:e.includes("RESOLVED")||e.startsWith("~~")&&e.endsWith("~~")}))}function Hte(){const{state:t}=So(),[e,i]=I.useState(!1),[n,s]=I.useState(null),[r,o]=I.useState(null),[l,c]=I.useState(0),u=Yte((t==null?void 0:t.blockers)??[]),d=u.filter(_=>!_.resolved),p=u.filter(_=>_.resolved),g=I.useCallback(async _=>{s(_),o(null);try{if(!(await fetch("/api/state",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({field:"blockers",value:`~~${_}~~ RESOLVED`})})).ok)throw new Error("Failed to resolve blocker");c(S=>S+1)}catch(b){o(b instanceof Error?b.message:"Failed to resolve blocker")}finally{s(null)}},[]),O=I.useCallback(()=>{c(_=>_+1)},[]);return x.jsxs("div",{className:"space-y-6",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("h2",{className:"font-mono text-xs uppercase tracking-widest text-foreground",children:"Blockers"}),x.jsx("span",{className:Ne("font-mono text-xs",d.length>0?"text-danger":"text-success"),children:d.length>0?`${d.length} active`:"No active blockers"})]}),r&&x.jsx("div",{className:"border border-danger/30 px-3 py-2 font-mono text-xs text-danger",children:r}),d.length===0?x.jsx("div",{className:"border border-success/20 px-4 py-6 text-center",children:x.jsx("p",{className:"font-mono text-xs text-success",children:"No active blockers"})}):x.jsx("div",{className:"border border-border divide-y divide-border",children:d.map(_=>x.jsxs("div",{className:"flex items-start gap-3 bg-card px-4 py-3",children:[x.jsx("span",{className:"mt-1.5 inline-block h-1.5 w-1.5 shrink-0 bg-danger"}),x.jsx("div",{className:"flex-1",children:x.jsx("p",{className:"text-sm text-foreground",children:_.text})}),x.jsx("button",{type:"button",onClick:()=>g(_.text),disabled:n===_.text,className:Ne("shrink-0 border border-success/30 px-3 py-1 font-mono text-[10px] uppercase tracking-widest transition-colors","text-success hover:bg-success/10","disabled:opacity-30 disabled:cursor-not-allowed"),children:n===_.text?"...":"Resolve"})]},_.text))}),p.length>0&&x.jsxs("div",{className:"border-t border-border pt-4",children:[x.jsxs("button",{type:"button",onClick:()=>i(!e),className:"flex w-full items-center gap-2 text-left",children:[x.jsx("svg",{className:Ne("h-3 w-3 text-muted-foreground transition-transform",e&&"rotate-90"),viewBox:"0 0 12 12",fill:"currentColor",children:x.jsx("path",{d:"M4 2l5 4-5 4z"})}),x.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["Resolved (",p.length,")"]})]}),e&&x.jsx("div",{className:"mt-2 space-y-1",children:p.map(_=>x.jsxs("div",{className:"flex items-center gap-3 rounded-sm px-4 py-2",children:[x.jsx("span",{className:"inline-block h-1.5 w-1.5 shrink-0 bg-muted"}),x.jsx("p",{className:"text-sm text-muted-foreground line-through",children:_.text})]},_.text))})]}),x.jsx(Ute,{onEntryAdded:O})]},l)}function Fte({sidebar:t,children:e,mobileMenuOpen:i=!1,onMobileMenuToggle:n,onMobileMenuClose:s}){return x.jsxs("div",{className:"flex h-screen flex-col overflow-hidden md:flex-row",children:[x.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-card px-4 py-3 md:hidden",children:[x.jsxs("span",{className:"text-sm font-bold tracking-tight text-foreground",children:["MAXSIM",x.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground",children:"Dashboard"})]}),x.jsx("button",{type:"button",onClick:n,className:"flex h-8 w-8 items-center justify-center text-muted-foreground transition-colors hover:text-foreground","aria-label":"Toggle menu",children:i?x.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("path",{d:"M3 3l10 10M13 3L3 13"})}):x.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("path",{d:"M2 4h12M2 8h12M2 12h12"})})})]}),i&&x.jsxs("div",{className:"fixed inset-0 z-50 md:hidden",children:[x.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:s}),x.jsx("div",{className:"absolute left-0 top-0 h-full w-64",children:t})]}),x.jsx("div",{className:"hidden shrink-0 md:flex",children:t}),x.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:e})]})}var Sc={},cy,dP;function Gte(){return dP||(dP=1,cy=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),cy}var hy={},sa={},pP;function Dl(){if(pP)return sa;pP=1;let t;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return sa.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},sa.getSymbolTotalCodewords=function(n){return e[n]},sa.getBCHDigit=function(i){let n=0;for(;i!==0;)n++,i>>>=1;return n},sa.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');t=n},sa.isKanjiModeEnabled=function(){return typeof t<"u"},sa.toSJIS=function(n){return t(n)},sa}var uy={},mP;function Aw(){return mP||(mP=1,(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+i)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,s){if(t.isValid(n))return n;try{return e(n)}catch{return s}}})(uy)),uy}var fy,gP;function Kte(){if(gP)return fy;gP=1;function t(){this.buffer=[],this.length=0}return t.prototype={get:function(e){const i=Math.floor(e/8);return(this.buffer[i]>>>7-e%8&1)===1},put:function(e,i){for(let n=0;n<i;n++)this.putBit((e>>>i-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),e&&(this.buffer[i]|=128>>>this.length%8),this.length++}},fy=t,fy}var dy,OP;function Jte(){if(OP)return dy;OP=1;function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return t.prototype.set=function(e,i,n,s){const r=e*this.size+i;this.data[r]=n,s&&(this.reservedBit[r]=!0)},t.prototype.get=function(e,i){return this.data[e*this.size+i]},t.prototype.xor=function(e,i,n){this.data[e*this.size+i]^=n},t.prototype.isReserved=function(e,i){return this.reservedBit[e*this.size+i]},dy=t,dy}var py={},vP;function eie(){return vP||(vP=1,(function(t){const e=Dl().getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const s=Math.floor(n/7)+2,r=e(n),o=r===145?26:Math.ceil((r-13)/(2*s-2))*2,l=[r-7];for(let c=1;c<s-1;c++)l[c]=l[c-1]-o;return l.push(6),l.reverse()},t.getPositions=function(n){const s=[],r=t.getRowColCoords(n),o=r.length;for(let l=0;l<o;l++)for(let c=0;c<o;c++)l===0&&c===0||l===0&&c===o-1||l===o-1&&c===0||s.push([r[l],r[c]]);return s}})(py)),py}var my={},_P;function tie(){if(_P)return my;_P=1;const t=Dl().getSymbolSize,e=7;return my.getPositions=function(n){const s=t(n);return[[0,0],[s-e,0],[0,s-e]]},my}var gy={},yP;function iie(){return yP||(yP=1,(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(s){return s!=null&&s!==""&&!isNaN(s)&&s>=0&&s<=7},t.from=function(s){return t.isValid(s)?parseInt(s,10):void 0},t.getPenaltyN1=function(s){const r=s.size;let o=0,l=0,c=0,u=null,d=null;for(let p=0;p<r;p++){l=c=0,u=d=null;for(let g=0;g<r;g++){let O=s.get(p,g);O===u?l++:(l>=5&&(o+=e.N1+(l-5)),u=O,l=1),O=s.get(g,p),O===d?c++:(c>=5&&(o+=e.N1+(c-5)),d=O,c=1)}l>=5&&(o+=e.N1+(l-5)),c>=5&&(o+=e.N1+(c-5))}return o},t.getPenaltyN2=function(s){const r=s.size;let o=0;for(let l=0;l<r-1;l++)for(let c=0;c<r-1;c++){const u=s.get(l,c)+s.get(l,c+1)+s.get(l+1,c)+s.get(l+1,c+1);(u===4||u===0)&&o++}return o*e.N2},t.getPenaltyN3=function(s){const r=s.size;let o=0,l=0,c=0;for(let u=0;u<r;u++){l=c=0;for(let d=0;d<r;d++)l=l<<1&2047|s.get(u,d),d>=10&&(l===1488||l===93)&&o++,c=c<<1&2047|s.get(d,u),d>=10&&(c===1488||c===93)&&o++}return o*e.N3},t.getPenaltyN4=function(s){let r=0;const o=s.data.length;for(let c=0;c<o;c++)r+=s.data[c];return Math.abs(Math.ceil(r*100/o/5)-10)*e.N4};function i(n,s,r){switch(n){case t.Patterns.PATTERN000:return(s+r)%2===0;case t.Patterns.PATTERN001:return s%2===0;case t.Patterns.PATTERN010:return r%3===0;case t.Patterns.PATTERN011:return(s+r)%3===0;case t.Patterns.PATTERN100:return(Math.floor(s/2)+Math.floor(r/3))%2===0;case t.Patterns.PATTERN101:return s*r%2+s*r%3===0;case t.Patterns.PATTERN110:return(s*r%2+s*r%3)%2===0;case t.Patterns.PATTERN111:return(s*r%3+(s+r)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(s,r){const o=r.size;for(let l=0;l<o;l++)for(let c=0;c<o;c++)r.isReserved(c,l)||r.xor(c,l,i(s,c,l))},t.getBestMask=function(s,r){const o=Object.keys(t.Patterns).length;let l=0,c=1/0;for(let u=0;u<o;u++){r(u),t.applyMask(u,s);const d=t.getPenaltyN1(s)+t.getPenaltyN2(s)+t.getPenaltyN3(s)+t.getPenaltyN4(s);t.applyMask(u,s),d<c&&(c=d,l=u)}return l}})(gy)),gy}var ym={},bP;function vN(){if(bP)return ym;bP=1;const t=Aw(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return ym.getBlocksCount=function(s,r){switch(r){case t.L:return e[(s-1)*4+0];case t.M:return e[(s-1)*4+1];case t.Q:return e[(s-1)*4+2];case t.H:return e[(s-1)*4+3];default:return}},ym.getTotalCodewordsCount=function(s,r){switch(r){case t.L:return i[(s-1)*4+0];case t.M:return i[(s-1)*4+1];case t.Q:return i[(s-1)*4+2];case t.H:return i[(s-1)*4+3];default:return}},ym}var Oy={},Lu={},xP;function nie(){if(xP)return Lu;xP=1;const t=new Uint8Array(512),e=new Uint8Array(256);return(function(){let n=1;for(let s=0;s<255;s++)t[s]=n,e[n]=s,n<<=1,n&256&&(n^=285);for(let s=255;s<512;s++)t[s]=t[s-255]})(),Lu.log=function(n){if(n<1)throw new Error("log("+n+")");return e[n]},Lu.exp=function(n){return t[n]},Lu.mul=function(n,s){return n===0||s===0?0:t[e[n]+e[s]]},Lu}var SP;function sie(){return SP||(SP=1,(function(t){const e=nie();t.mul=function(n,s){const r=new Uint8Array(n.length+s.length-1);for(let o=0;o<n.length;o++)for(let l=0;l<s.length;l++)r[o+l]^=e.mul(n[o],s[l]);return r},t.mod=function(n,s){let r=new Uint8Array(n);for(;r.length-s.length>=0;){const o=r[0];for(let c=0;c<s.length;c++)r[c]^=e.mul(s[c],o);let l=0;for(;l<r.length&&r[l]===0;)l++;r=r.slice(l)}return r},t.generateECPolynomial=function(n){let s=new Uint8Array([1]);for(let r=0;r<n;r++)s=t.mul(s,new Uint8Array([1,e.exp(r)]));return s}})(Oy)),Oy}var vy,wP;function rie(){if(wP)return vy;wP=1;const t=sie();function e(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},e.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const s=new Uint8Array(n.length+this.degree);s.set(n);const r=t.mod(s,this.genPoly),o=this.degree-r.length;if(o>0){const l=new Uint8Array(this.degree);return l.set(r,o),l}return r},vy=e,vy}var _y={},yy={},by={},CP;function _N(){return CP||(CP=1,by.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),by}var ar={},kP;function yN(){if(kP)return ar;kP=1;const t="[0-9]+",e="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r
87
- ]))+`;ar.KANJI=new RegExp(i,"g"),ar.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ar.BYTE=new RegExp(n,"g"),ar.NUMERIC=new RegExp(t,"g"),ar.ALPHANUMERIC=new RegExp(e,"g");const s=new RegExp("^"+i+"$"),r=new RegExp("^"+t+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return ar.testKanji=function(c){return s.test(c)},ar.testNumeric=function(c){return r.test(c)},ar.testAlphanumeric=function(c){return o.test(c)},ar}var TP;function Bl(){return TP||(TP=1,(function(t){const e=_N(),i=yN();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(r,o){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?r.ccBits[0]:o<27?r.ccBits[1]:r.ccBits[2]},t.getBestModeForData=function(r){return i.testNumeric(r)?t.NUMERIC:i.testAlphanumeric(r)?t.ALPHANUMERIC:i.testKanji(r)?t.KANJI:t.BYTE},t.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},t.isValid=function(r){return r&&r.bit&&r.ccBits};function n(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+s)}}t.from=function(r,o){if(t.isValid(r))return r;try{return n(r)}catch{return o}}})(yy)),yy}var AP;function oie(){return AP||(AP=1,(function(t){const e=Dl(),i=vN(),n=Aw(),s=Bl(),r=_N(),o=7973,l=e.getBCHDigit(o);function c(g,O,_){for(let b=1;b<=40;b++)if(O<=t.getCapacity(b,_,g))return b}function u(g,O){return s.getCharCountIndicator(g,O)+4}function d(g,O){let _=0;return g.forEach(function(b){const S=u(b.mode,O);_+=S+b.getBitsLength()}),_}function p(g,O){for(let _=1;_<=40;_++)if(d(g,_)<=t.getCapacity(_,O,s.MIXED))return _}t.from=function(O,_){return r.isValid(O)?parseInt(O,10):_},t.getCapacity=function(O,_,b){if(!r.isValid(O))throw new Error("Invalid QR Code version");typeof b>"u"&&(b=s.BYTE);const S=e.getSymbolTotalCodewords(O),w=i.getTotalCodewordsCount(O,_),T=(S-w)*8;if(b===s.MIXED)return T;const k=T-u(b,O);switch(b){case s.NUMERIC:return Math.floor(k/10*3);case s.ALPHANUMERIC:return Math.floor(k/11*2);case s.KANJI:return Math.floor(k/13);case s.BYTE:default:return Math.floor(k/8)}},t.getBestVersionForData=function(O,_){let b;const S=n.from(_,n.M);if(Array.isArray(O)){if(O.length>1)return p(O,S);if(O.length===0)return 1;b=O[0]}else b=O;return c(b.mode,b.getLength(),S)},t.getEncodedBits=function(O){if(!r.isValid(O)||O<7)throw new Error("Invalid QR Code version");let _=O<<12;for(;e.getBCHDigit(_)-l>=0;)_^=o<<e.getBCHDigit(_)-l;return O<<12|_}})(_y)),_y}var xy={},EP;function aie(){if(EP)return xy;EP=1;const t=Dl(),e=1335,i=21522,n=t.getBCHDigit(e);return xy.getEncodedBits=function(r,o){const l=r.bit<<3|o;let c=l<<10;for(;t.getBCHDigit(c)-n>=0;)c^=e<<t.getBCHDigit(c)-n;return(l<<10|c)^i},xy}var Sy={},wy,MP;function lie(){if(MP)return wy;MP=1;const t=Bl();function e(i){this.mode=t.NUMERIC,this.data=i.toString()}return e.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(n){let s,r,o;for(s=0;s+3<=this.data.length;s+=3)r=this.data.substr(s,3),o=parseInt(r,10),n.put(o,10);const l=this.data.length-s;l>0&&(r=this.data.substr(s),o=parseInt(r,10),n.put(o,l*3+1))},wy=e,wy}var Cy,PP;function cie(){if(PP)return Cy;PP=1;const t=Bl(),e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(n){this.mode=t.ALPHANUMERIC,this.data=n}return i.getBitsLength=function(s){return 11*Math.floor(s/2)+6*(s%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(s){let r;for(r=0;r+2<=this.data.length;r+=2){let o=e.indexOf(this.data[r])*45;o+=e.indexOf(this.data[r+1]),s.put(o,11)}this.data.length%2&&s.put(e.indexOf(this.data[r]),6)},Cy=i,Cy}var ky,RP;function hie(){if(RP)return ky;RP=1;const t=Bl();function e(i){this.mode=t.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}return e.getBitsLength=function(n){return n*8},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(i){for(let n=0,s=this.data.length;n<s;n++)i.put(this.data[n],8)},ky=e,ky}var Ty,QP;function uie(){if(QP)return Ty;QP=1;const t=Bl(),e=Dl();function i(n){this.mode=t.KANJI,this.data=n}return i.getBitsLength=function(s){return s*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(n){let s;for(s=0;s<this.data.length;s++){let r=e.toSJIS(this.data[s]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[s]+`
88
- Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),n.put(r,13)}},Ty=i,Ty}var Ay={exports:{}},LP;function fie(){return LP||(LP=1,(function(t){var e={single_source_shortest_paths:function(i,n,s){var r={},o={};o[n]=0;var l=e.PriorityQueue.make();l.push(n,0);for(var c,u,d,p,g,O,_,b,S;!l.empty();){c=l.pop(),u=c.value,p=c.cost,g=i[u]||{};for(d in g)g.hasOwnProperty(d)&&(O=g[d],_=p+O,b=o[d],S=typeof o[d]>"u",(S||b>_)&&(o[d]=_,l.push(d,_),r[d]=u))}if(typeof s<"u"&&typeof o[s]>"u"){var w=["Could not find a path from ",n," to ",s,"."].join("");throw new Error(w)}return r},extract_shortest_path_from_predecessor_list:function(i,n){for(var s=[],r=n;r;)s.push(r),i[r],r=i[r];return s.reverse(),s},find_path:function(i,n,s){var r=e.single_source_shortest_paths(i,n,s);return e.extract_shortest_path_from_predecessor_list(r,s)},PriorityQueue:{make:function(i){var n=e.PriorityQueue,s={},r;i=i||{};for(r in n)n.hasOwnProperty(r)&&(s[r]=n[r]);return s.queue=[],s.sorter=i.sorter||n.default_sorter,s},default_sorter:function(i,n){return i.cost-n.cost},push:function(i,n){var s={value:i,cost:n};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Ay)),Ay.exports}var DP;function die(){return DP||(DP=1,(function(t){const e=Bl(),i=lie(),n=cie(),s=hie(),r=uie(),o=yN(),l=Dl(),c=fie();function u(w){return unescape(encodeURIComponent(w)).length}function d(w,T,k){const A=[];let R;for(;(R=w.exec(k))!==null;)A.push({data:R[0],index:R.index,mode:T,length:R[0].length});return A}function p(w){const T=d(o.NUMERIC,e.NUMERIC,w),k=d(o.ALPHANUMERIC,e.ALPHANUMERIC,w);let A,R;return l.isKanjiModeEnabled()?(A=d(o.BYTE,e.BYTE,w),R=d(o.KANJI,e.KANJI,w)):(A=d(o.BYTE_KANJI,e.BYTE,w),R=[]),T.concat(k,A,R).sort(function($,N){return $.index-N.index}).map(function($){return{data:$.data,mode:$.mode,length:$.length}})}function g(w,T){switch(T){case e.NUMERIC:return i.getBitsLength(w);case e.ALPHANUMERIC:return n.getBitsLength(w);case e.KANJI:return r.getBitsLength(w);case e.BYTE:return s.getBitsLength(w)}}function O(w){return w.reduce(function(T,k){const A=T.length-1>=0?T[T.length-1]:null;return A&&A.mode===k.mode?(T[T.length-1].data+=k.data,T):(T.push(k),T)},[])}function _(w){const T=[];for(let k=0;k<w.length;k++){const A=w[k];switch(A.mode){case e.NUMERIC:T.push([A,{data:A.data,mode:e.ALPHANUMERIC,length:A.length},{data:A.data,mode:e.BYTE,length:A.length}]);break;case e.ALPHANUMERIC:T.push([A,{data:A.data,mode:e.BYTE,length:A.length}]);break;case e.KANJI:T.push([A,{data:A.data,mode:e.BYTE,length:u(A.data)}]);break;case e.BYTE:T.push([{data:A.data,mode:e.BYTE,length:u(A.data)}])}}return T}function b(w,T){const k={},A={start:{}};let R=["start"];for(let E=0;E<w.length;E++){const $=w[E],N=[];for(let q=0;q<$.length;q++){const G=$[q],U=""+E+q;N.push(U),k[U]={node:G,lastCount:0},A[U]={};for(let Q=0;Q<R.length;Q++){const D=R[Q];k[D]&&k[D].node.mode===G.mode?(A[D][U]=g(k[D].lastCount+G.length,G.mode)-g(k[D].lastCount,G.mode),k[D].lastCount+=G.length):(k[D]&&(k[D].lastCount=G.length),A[D][U]=g(G.length,G.mode)+4+e.getCharCountIndicator(G.mode,T))}}R=N}for(let E=0;E<R.length;E++)A[R[E]].end=0;return{map:A,table:k}}function S(w,T){let k;const A=e.getBestModeForData(w);if(k=e.from(T,A),k!==e.BYTE&&k.bit<A.bit)throw new Error('"'+w+'" cannot be encoded with mode '+e.toString(k)+`.
89
- Suggested mode is: `+e.toString(A));switch(k===e.KANJI&&!l.isKanjiModeEnabled()&&(k=e.BYTE),k){case e.NUMERIC:return new i(w);case e.ALPHANUMERIC:return new n(w);case e.KANJI:return new r(w);case e.BYTE:return new s(w)}}t.fromArray=function(T){return T.reduce(function(k,A){return typeof A=="string"?k.push(S(A,null)):A.data&&k.push(S(A.data,A.mode)),k},[])},t.fromString=function(T,k){const A=p(T,l.isKanjiModeEnabled()),R=_(A),E=b(R,k),$=c.find_path(E.map,"start","end"),N=[];for(let q=1;q<$.length-1;q++)N.push(E.table[$[q]].node);return t.fromArray(O(N))},t.rawSplit=function(T){return t.fromArray(p(T,l.isKanjiModeEnabled()))}})(Sy)),Sy}var BP;function pie(){if(BP)return hy;BP=1;const t=Dl(),e=Aw(),i=Kte(),n=Jte(),s=eie(),r=tie(),o=iie(),l=vN(),c=rie(),u=oie(),d=aie(),p=Bl(),g=die();function O(E,$){const N=E.size,q=r.getPositions($);for(let G=0;G<q.length;G++){const U=q[G][0],Q=q[G][1];for(let D=-1;D<=7;D++)if(!(U+D<=-1||N<=U+D))for(let z=-1;z<=7;z++)Q+z<=-1||N<=Q+z||(D>=0&&D<=6&&(z===0||z===6)||z>=0&&z<=6&&(D===0||D===6)||D>=2&&D<=4&&z>=2&&z<=4?E.set(U+D,Q+z,!0,!0):E.set(U+D,Q+z,!1,!0))}}function _(E){const $=E.size;for(let N=8;N<$-8;N++){const q=N%2===0;E.set(N,6,q,!0),E.set(6,N,q,!0)}}function b(E,$){const N=s.getPositions($);for(let q=0;q<N.length;q++){const G=N[q][0],U=N[q][1];for(let Q=-2;Q<=2;Q++)for(let D=-2;D<=2;D++)Q===-2||Q===2||D===-2||D===2||Q===0&&D===0?E.set(G+Q,U+D,!0,!0):E.set(G+Q,U+D,!1,!0)}}function S(E,$){const N=E.size,q=u.getEncodedBits($);let G,U,Q;for(let D=0;D<18;D++)G=Math.floor(D/3),U=D%3+N-8-3,Q=(q>>D&1)===1,E.set(G,U,Q,!0),E.set(U,G,Q,!0)}function w(E,$,N){const q=E.size,G=d.getEncodedBits($,N);let U,Q;for(U=0;U<15;U++)Q=(G>>U&1)===1,U<6?E.set(U,8,Q,!0):U<8?E.set(U+1,8,Q,!0):E.set(q-15+U,8,Q,!0),U<8?E.set(8,q-U-1,Q,!0):U<9?E.set(8,15-U-1+1,Q,!0):E.set(8,15-U-1,Q,!0);E.set(q-8,8,1,!0)}function T(E,$){const N=E.size;let q=-1,G=N-1,U=7,Q=0;for(let D=N-1;D>0;D-=2)for(D===6&&D--;;){for(let z=0;z<2;z++)if(!E.isReserved(G,D-z)){let j=!1;Q<$.length&&(j=($[Q]>>>U&1)===1),E.set(G,D-z,j),U--,U===-1&&(Q++,U=7)}if(G+=q,G<0||N<=G){G-=q,q=-q;break}}}function k(E,$,N){const q=new i;N.forEach(function(z){q.put(z.mode.bit,4),q.put(z.getLength(),p.getCharCountIndicator(z.mode,E)),z.write(q)});const G=t.getSymbolTotalCodewords(E),U=l.getTotalCodewordsCount(E,$),Q=(G-U)*8;for(q.getLengthInBits()+4<=Q&&q.put(0,4);q.getLengthInBits()%8!==0;)q.putBit(0);const D=(Q-q.getLengthInBits())/8;for(let z=0;z<D;z++)q.put(z%2?17:236,8);return A(q,E,$)}function A(E,$,N){const q=t.getSymbolTotalCodewords($),G=l.getTotalCodewordsCount($,N),U=q-G,Q=l.getBlocksCount($,N),D=q%Q,z=Q-D,j=Math.floor(q/Q),B=Math.floor(U/Q),Z=B+1,H=j-B,F=new c(H);let M=0;const V=new Array(Q),J=new Array(Q);let L=0;const ue=new Uint8Array(E.buffer);for(let ye=0;ye<Q;ye++){const nt=ye<z?B:Z;V[ye]=ue.slice(M,M+nt),J[ye]=F.encode(V[ye]),M+=nt,L=Math.max(L,nt)}const he=new Uint8Array(q);let fe=0,Oe,Ce;for(Oe=0;Oe<L;Oe++)for(Ce=0;Ce<Q;Ce++)Oe<V[Ce].length&&(he[fe++]=V[Ce][Oe]);for(Oe=0;Oe<H;Oe++)for(Ce=0;Ce<Q;Ce++)he[fe++]=J[Ce][Oe];return he}function R(E,$,N,q){let G;if(Array.isArray(E))G=g.fromArray(E);else if(typeof E=="string"){let j=$;if(!j){const B=g.rawSplit(E);j=u.getBestVersionForData(B,N)}G=g.fromString(E,j||40)}else throw new Error("Invalid data");const U=u.getBestVersionForData(G,N);if(!U)throw new Error("The amount of data is too big to be stored in a QR Code");if(!$)$=U;else if($<U)throw new Error(`
90
- The chosen QR Code version cannot contain this amount of data.
91
- Minimum version required to store current data is: `+U+`.
92
- `);const Q=k($,N,G),D=t.getSymbolSize($),z=new n(D);return O(z,$),_(z),b(z,$),w(z,N,0),$>=7&&S(z,$),T(z,Q),isNaN(q)&&(q=o.getBestMask(z,w.bind(null,z,N))),o.applyMask(q,z),w(z,N,q),{modules:z,version:$,errorCorrectionLevel:N,maskPattern:q,segments:G}}return hy.create=function($,N){if(typeof $>"u"||$==="")throw new Error("No input text");let q=e.M,G,U;return typeof N<"u"&&(q=e.from(N.errorCorrectionLevel,e.M),G=u.from(N.version),U=o.from(N.maskPattern),N.toSJISFunc&&t.setToSJISFunction(N.toSJISFunc)),R($,G,q,U)},hy}var Ey={},My={},$P;function bN(){return $P||($P=1,(function(t){function e(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let n=i.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+i);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(r){return[r,r]}))),n.length===6&&n.push("F","F");const s=parseInt(n.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const s=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,r=n.width&&n.width>=21?n.width:void 0,o=n.scale||4;return{width:r,scale:r?4:o,margin:s,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,s){return s.width&&s.width>=n+s.margin*2?s.width/(n+s.margin*2):s.scale},t.getImageWidth=function(n,s){const r=t.getScale(n,s);return Math.floor((n+s.margin*2)*r)},t.qrToImageData=function(n,s,r){const o=s.modules.size,l=s.modules.data,c=t.getScale(o,r),u=Math.floor((o+r.margin*2)*c),d=r.margin*c,p=[r.color.light,r.color.dark];for(let g=0;g<u;g++)for(let O=0;O<u;O++){let _=(g*u+O)*4,b=r.color.light;if(g>=d&&O>=d&&g<u-d&&O<u-d){const S=Math.floor((g-d)/c),w=Math.floor((O-d)/c);b=p[l[S*o+w]?1:0]}n[_++]=b.r,n[_++]=b.g,n[_++]=b.b,n[_]=b.a}}})(My)),My}var NP;function mie(){return NP||(NP=1,(function(t){const e=bN();function i(s,r,o){s.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=o,r.width=o,r.style.height=o+"px",r.style.width=o+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(r,o,l){let c=l,u=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(u=n()),c=e.getOptions(c);const d=e.getImageWidth(r.modules.size,c),p=u.getContext("2d"),g=p.createImageData(d,d);return e.qrToImageData(g.data,r,c),i(p,u,d),p.putImageData(g,0,0),u},t.renderToDataURL=function(r,o,l){let c=l;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const u=t.render(r,o,c),d=c.type||"image/png",p=c.rendererOpts||{};return u.toDataURL(d,p.quality)}})(Ey)),Ey}var Py={},zP;function gie(){if(zP)return Py;zP=1;const t=bN();function e(s,r){const o=s.a/255,l=r+'="'+s.hex+'"';return o<1?l+" "+r+'-opacity="'+o.toFixed(2).slice(1)+'"':l}function i(s,r,o){let l=s+r;return typeof o<"u"&&(l+=" "+o),l}function n(s,r,o){let l="",c=0,u=!1,d=0;for(let p=0;p<s.length;p++){const g=Math.floor(p%r),O=Math.floor(p/r);!g&&!u&&(u=!0),s[p]?(d++,p>0&&g>0&&s[p-1]||(l+=u?i("M",g+o,.5+O+o):i("m",c,0),c=0,u=!1),g+1<r&&s[p+1]||(l+=i("h",d),d=0)):c++}return l}return Py.render=function(r,o,l){const c=t.getOptions(o),u=r.modules.size,d=r.modules.data,p=u+c.margin*2,g=c.color.light.a?"<path "+e(c.color.light,"fill")+' d="M0 0h'+p+"v"+p+'H0z"/>':"",O="<path "+e(c.color.dark,"stroke")+' d="'+n(d,u,c.margin)+'"/>',_='viewBox="0 0 '+p+" "+p+'"',S='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+_+' shape-rendering="crispEdges">'+g+O+`</svg>
93
- `;return typeof l=="function"&&l(null,S),S},Py}var jP;function Oie(){if(jP)return Sc;jP=1;const t=Gte(),e=pie(),i=mie(),n=gie();function s(r,o,l,c,u){const d=[].slice.call(arguments,1),p=d.length,g=typeof d[p-1]=="function";if(!g&&!t())throw new Error("Callback required as last argument");if(g){if(p<2)throw new Error("Too few arguments provided");p===2?(u=l,l=o,o=c=void 0):p===3&&(o.getContext&&typeof u>"u"?(u=c,c=void 0):(u=c,c=l,l=o,o=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(l=o,o=c=void 0):p===2&&!o.getContext&&(c=l,l=o,o=void 0),new Promise(function(O,_){try{const b=e.create(l,c);O(r(b,o,c))}catch(b){_(b)}})}try{const O=e.create(l,c);u(null,r(O,o,c))}catch(O){u(O)}}return Sc.create=e.create,Sc.toCanvas=s.bind(null,i.render),Sc.toDataURL=s.bind(null,i.renderToDataURL),Sc.toString=s.bind(null,function(r,o,l){return n.render(r,l)}),Sc}var vie=Oie();const IP=qx(vie);function _ie(){const[t,e]=I.useState(null),[i,n]=I.useState(!1),[s,r]=I.useState(null),[o,l]=I.useState(null);I.useEffect(()=>{fetch("/api/server-info").then(p=>p.json()).then(p=>e(p)).catch(()=>{})},[]),I.useEffect(()=>{t!=null&&t.tailscaleUrl&&IP.toDataURL(t.tailscaleUrl,{width:192,margin:2}).then(r).catch(()=>{}),t!=null&&t.networkUrl&&IP.toDataURL(t.networkUrl,{width:192,margin:2}).then(l).catch(()=>{})},[t==null?void 0:t.tailscaleUrl,t==null?void 0:t.networkUrl]);const c=!!(t!=null&&t.tailscaleUrl),u=!!(t!=null&&t.networkUrl),d=c||u;return x.jsxs("div",{className:"relative border-t border-border px-1 py-2",children:[i&&x.jsxs("div",{className:"absolute bottom-full left-2 right-2 mb-2 border border-border bg-card shadow-xl",children:[c&&x.jsxs("div",{className:"p-3",children:[x.jsxs("div",{className:"mb-2 flex items-center gap-1.5",children:[x.jsx("span",{className:"inline-block h-1.5 w-1.5 bg-success"}),x.jsx("p",{className:"font-mono text-[9px] uppercase tracking-widest text-success",children:"Tailscale — Secure"})]}),x.jsx("p",{className:"mb-3 break-all font-mono text-[11px] text-foreground",children:t.tailscaleUrl}),s&&x.jsx("img",{src:s,alt:"QR code for Tailscale access",width:192,height:192,className:"w-full"}),x.jsx("p",{className:"mt-2 font-mono text-[9px] text-muted-foreground",children:"Only visible to your Tailscale devices"})]}),u&&x.jsxs("div",{className:`p-3 ${c?"border-t border-border":""}`,children:[x.jsx("p",{className:"mb-0.5 font-mono text-[9px] uppercase tracking-widest text-muted-foreground",children:"Local Network"}),x.jsx("p",{className:"mb-3 break-all font-mono text-[11px] text-foreground",children:t.networkUrl}),o&&x.jsx("img",{src:o,alt:"QR code for local network access",width:192,height:192,className:"w-full"}),x.jsx("p",{className:"mt-2 font-mono text-[9px] text-muted-foreground",children:"Anyone on your local network can access this"})]}),!d&&x.jsxs("div",{className:"p-3",children:[x.jsxs("div",{className:"mb-2 flex items-center gap-1.5",children:[x.jsx("span",{className:"inline-block h-1.5 w-1.5 bg-muted-foreground"}),x.jsx("p",{className:"font-mono text-[9px] uppercase tracking-widest text-muted-foreground",children:"Remote Access"})]}),x.jsx("p",{className:"mb-3 font-mono text-[11px] leading-relaxed text-muted-foreground",children:"Install Tailscale on this device and your phone to securely access the dashboard from anywhere — no port forwarding, no public URLs."}),x.jsx("a",{href:"https://tailscale.com/download",target:"_blank",rel:"noopener noreferrer",className:"block w-full border border-border px-3 py-1.5 text-center font-mono text-[10px] uppercase tracking-widest text-muted-foreground transition-colors hover:border-accent hover:text-accent",children:"Get Tailscale →"}),x.jsx("p",{className:"mt-2 font-mono text-[9px] text-muted-foreground",children:"Free · E2E encrypted · No account sharing"})]})]}),x.jsxs("button",{type:"button",onClick:()=>n(p=>!p),title:c?"Open on another device via Tailscale":u?"Open on another device via local network":"Set up remote access",className:"flex w-full items-center gap-2.5 rounded-sm px-3 py-2 text-left text-sm transition-colors hover:bg-card-hover text-muted-foreground",children:[x.jsx(yie,{active:c}),x.jsx("span",{className:"font-mono text-xs uppercase tracking-wide",children:"Share"}),c&&x.jsx("span",{className:"ml-auto inline-block h-1.5 w-1.5 bg-success"})]})]})}function yie({active:t}){return x.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[x.jsx("circle",{cx:"18",cy:"5",r:"3"}),x.jsx("circle",{cx:"6",cy:"12",r:"3"}),x.jsx("circle",{cx:"18",cy:"19",r:"3"}),x.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),x.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]})}const bie=3e4;function xie(){const[t,e]=I.useState([]),[i,n]=I.useState(!0),s=I.useRef(null),r=I.useCallback(async()=>{try{const o=await fetch("/api/dashboards");if(!o.ok)return;const l=await o.json();e(l.dashboards)}catch{}finally{n(!1)}},[]);return I.useEffect(()=>(r(),s.current=setInterval(r,bie),()=>{s.current&&clearInterval(s.current)}),[r]),{dashboards:t,loading:i,refresh:r}}function Sie(t){if(t<60)return`${Math.floor(t)}s`;if(t<3600)return`${Math.floor(t/60)}m`;const e=Math.floor(t/3600),i=Math.floor(t%3600/60);return i>0?`${e}h ${i}m`:`${e}h`}function wie(t,e=36){return t.length<=e?t:`...${t.slice(-(e-3))}`}function Cie(){const{dashboards:t,loading:e}=xie(),[i,n]=I.useState(!1),s=I.useRef(null),r=t.find(c=>c.isCurrent),o=(r==null?void 0:r.projectName)??"Dashboard";I.useEffect(()=>{if(!i)return;function c(d){s.current&&!s.current.contains(d.target)&&n(!1)}function u(d){d.key==="Escape"&&n(!1)}return document.addEventListener("mousedown",c),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",u)}},[i]);function l(c,u=!1){if(c.isCurrent){n(!1);return}const d=`http://localhost:${c.port}`;u?window.open(d,"_blank"):window.location.href=d,n(!1)}return x.jsxs("div",{ref:s,className:"relative",children:[x.jsxs("button",{type:"button",onClick:()=>n(c=>!c),className:"flex items-center gap-1 text-left min-w-0 group",children:[x.jsx("span",{className:"text-xs text-muted-foreground truncate max-w-[140px] group-hover:text-foreground transition-colors duration-150",title:o,children:o}),e?x.jsx("span",{className:"inline-block h-3 w-3 shrink-0 animate-spin rounded-full border border-muted-foreground/30 border-t-muted-foreground"}):x.jsx("svg",{className:Ne("h-3 w-3 shrink-0 text-muted-foreground transition-transform duration-150",i&&"rotate-180"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:x.jsx("path",{d:"M4 6l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),i&&x.jsxs("div",{className:"absolute left-0 top-full z-50 mt-1 w-64 rounded border border-border bg-card shadow-lg",children:[x.jsx("div",{className:"px-3 py-2 border-b border-border",children:x.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Running dashboards"})}),x.jsxs("div",{className:"max-h-64 overflow-y-auto py-1",children:[t.length===0&&x.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No dashboards found"}),t.map(c=>x.jsxs("button",{type:"button",onClick:u=>l(c,u.ctrlKey||u.metaKey),onAuxClick:u=>{u.button===1&&l(c,!0)},className:Ne("flex w-full flex-col gap-0.5 px-3 py-2 text-left transition-colors duration-150",c.isCurrent?"bg-accent/10 border-l-2 border-l-accent":"border-l-2 border-l-transparent hover:bg-card-hover"),children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:Ne("text-xs font-medium truncate",c.isCurrent?"text-accent":"text-foreground"),children:c.projectName}),c.isCurrent&&x.jsx("span",{className:"text-[10px] text-accent/70",children:"current"}),x.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground tabular-nums shrink-0",children:Sie(c.uptime)})]}),x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx("span",{className:"text-[10px] text-muted-foreground truncate",title:c.cwd,children:wie(c.cwd)}),!c.isCurrent&&x.jsx("span",{className:"ml-auto text-[9px] text-muted-foreground/50 shrink-0",children:"Ctrl+click: new tab"})]})]},c.port)),t.length===1&&x.jsx("div",{className:"px-3 py-1.5 text-[10px] text-muted-foreground/60 text-center",children:"(only instance)"})]})]})]})}function kie(t){switch(t){case"complete":return"bg-success";case"partial":return"bg-accent";case"planned":case"researched":case"discussed":return"bg-muted-foreground/50";default:return"bg-muted"}}function Tie({activeView:t,activePhaseId:e,onNavigate:i,terminalOpen:n,onTerminalToggle:s}){const{roadmap:r,state:o,todos:l}=So(),{connected:c,pendingQuestionCount:u}=Rr(),[d,p]=I.useState(!1);I.useEffect(()=>{if(!d)return;const w=setTimeout(()=>p(!1),3e3);return()=>clearTimeout(w)},[d]);async function g(){if(!d){p(!0);return}try{await fetch("/api/shutdown",{method:"POST"})}catch{}}const O=((r==null?void 0:r.phases)??[]).map(w=>({number:w.number,name:w.name,goal:w.goal??"",dependsOn:w.depends_on?[w.depends_on]:[],planCount:w.plan_count,summaryCount:w.summary_count,diskStatus:w.disk_status,roadmapComplete:w.roadmap_complete,hasContext:w.has_context,hasResearch:w.has_research})),_=(r==null?void 0:r.current_phase)??null,b=(o==null?void 0:o.blockers.filter(w=>!w.includes("RESOLVED")).length)??0,S=(l==null?void 0:l.pending.length)??0;return x.jsxs("aside",{className:"flex h-full w-56 shrink-0 flex-col border-r border-border bg-card",children:[x.jsx("div",{className:"border-b border-border px-5 py-4 flex items-center justify-between",children:x.jsxs("button",{type:"button",onClick:()=>i("overview"),className:"flex flex-col gap-0.5 text-left min-w-0",children:[x.jsx("span",{className:"text-sm font-bold tracking-tight text-foreground",children:"MAXSIM"}),x.jsx(Cie,{})]})}),x.jsx("div",{className:"border-b border-border",children:x.jsxs("button",{type:"button",onClick:()=>i("discussion"),className:Ne("flex w-full items-center gap-2 px-5 py-2.5 text-left transition-colors duration-200",t==="discussion"?"text-foreground bg-card-hover border-l-2 border-l-accent":"border-l-2 border-l-transparent text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[x.jsx("svg",{className:"h-3.5 w-3.5 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:x.jsx("path",{d:"M2 3h12v8H6l-3 2.5V11H2V3z",strokeLinejoin:"round"})}),x.jsx("span",{className:"text-sm",children:"Q&A / Discussion"})]})}),x.jsxs("div",{className:"flex-1 overflow-y-auto",children:[x.jsxs("div",{className:"flex items-center gap-2 px-5 py-3",children:[x.jsx("span",{className:"block w-4 h-px bg-border"}),x.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Phases"})]}),x.jsx("nav",{className:"flex flex-col",children:O.map(w=>{const T=t==="phase"&&e===w.number,k=w.number===_;return x.jsxs("button",{type:"button",onClick:()=>i("phase",w.number),className:Ne("flex w-full items-center gap-2.5 px-5 py-2 text-left transition-colors duration-200",T?"bg-card-hover border-l-2 border-l-accent text-foreground":"border-l-2 border-l-transparent text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[x.jsx("span",{className:Ne("inline-block h-1.5 w-1.5 shrink-0",kie(w.diskStatus))}),x.jsx("span",{className:Ne("font-mono text-xs tabular-nums shrink-0",k||T?"text-accent":""),children:w.number}),x.jsx("span",{className:"truncate text-xs",children:w.name})]},w.number)})})]}),x.jsxs("div",{className:"border-t border-border",children:[x.jsxs("button",{type:"button",onClick:()=>i("todos"),className:Ne("flex w-full items-center justify-between px-5 py-2.5 text-left transition-colors duration-200",t==="todos"?"text-foreground bg-card-hover":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[x.jsx("span",{className:"text-sm",children:"Todos"}),S>0&&x.jsx("span",{className:"font-mono text-xs text-warning tabular-nums",children:S})]}),x.jsxs("button",{type:"button",onClick:()=>i("blockers"),className:Ne("flex w-full items-center justify-between border-t border-border px-5 py-2.5 text-left transition-colors duration-200",t==="blockers"?"text-foreground bg-card-hover":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[x.jsx("span",{className:"text-sm",children:"Blockers"}),b>0&&x.jsx("span",{className:"font-mono text-xs text-danger tabular-nums",children:b})]})]}),x.jsx("div",{className:"border-t border-border",children:x.jsxs("button",{type:"button",onClick:s,className:Ne("flex w-full items-center gap-2 px-5 py-2.5 text-left transition-colors duration-200",n?"text-foreground bg-card-hover":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[x.jsxs("span",{className:"font-mono text-xs",children:[">","_"]}),x.jsx("span",{className:"text-sm",children:"Terminal"}),!n&&u>0&&x.jsx("span",{className:"ml-auto font-mono text-xs text-accent tabular-nums",children:u}),n&&x.jsx("span",{className:"ml-auto inline-block h-1.5 w-1.5 bg-success"})]})}),x.jsx(_ie,{}),x.jsx("div",{className:"border-t border-border px-5 py-3",children:x.jsxs("div",{className:"flex items-center justify-between gap-2",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:Ne("inline-block h-1.5 w-1.5",c?"bg-success":"bg-danger")}),x.jsx("span",{className:"text-xs text-muted-foreground",children:c?"Connected":"Disconnected"})]}),x.jsxs("button",{type:"button",onClick:g,title:d?"Click again to confirm shutdown":"Shut down dashboard server",className:Ne("flex items-center gap-1 rounded px-1.5 py-0.5 text-xs transition-colors duration-150",d?"bg-danger/15 text-danger hover:bg-danger/25":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[x.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"h-3 w-3 shrink-0","aria-hidden":"true",children:[x.jsx("path",{d:"M6 2.5A5.5 5.5 0 1 0 10 3",strokeLinecap:"round"}),x.jsx("path",{d:"M8 1v5",strokeLinecap:"round"})]}),d&&x.jsx("span",{children:"Confirm"})]})]})})]})}/**
94
- * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
95
- * @license MIT
96
- *
97
- * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
98
- * @license MIT
99
- *
100
- * Originally forked from (with the author's permission):
101
- * Fabrice Bellard's javascript vt100 for jslinux:
102
- * http://bellard.org/jslinux/
103
- * Copyright (c) 2011 Fabrice Bellard
104
- */var xN=Object.defineProperty,Aie=Object.getOwnPropertyDescriptor,Eie=(t,e)=>{for(var i in e)xN(t,i,{get:e[i],enumerable:!0})},Ut=(t,e,i,n)=>{for(var s=n>1?void 0:n?Aie(e,i):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(s=(n?o(e,i,s):o(s))||s);return n&&s&&xN(e,i,s),s},be=(t,e)=>(i,n)=>e(i,n,t),VP="Terminal input",qb={get:()=>VP,set:t=>VP=t},XP="Too much output to announce, navigate to rows manually to read",Wb={get:()=>XP,set:t=>XP=t};function Mie(t){return t.replace(/\r?\n/g,"\r")}function Pie(t,e){return e?"\x1B[200~"+t+"\x1B[201~":t}function Rie(t,e){t.clipboardData&&t.clipboardData.setData("text/plain",e.selectionText),t.preventDefault()}function Qie(t,e,i,n){if(t.stopPropagation(),t.clipboardData){let s=t.clipboardData.getData("text/plain");SN(s,e,i,n)}}function SN(t,e,i,n){t=Mie(t),t=Pie(t,i.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(t,!0),e.value=""}function wN(t,e,i){let n=i.getBoundingClientRect(),s=t.clientX-n.left-10,r=t.clientY-n.top-10;e.style.width="20px",e.style.height="20px",e.style.left=`${s}px`,e.style.top=`${r}px`,e.style.zIndex="1000",e.focus()}function ZP(t,e,i,n,s){wN(t,e,i),s&&n.rightClickSelect(t),e.value=n.selectionText,e.select()}function ga(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function CO(t,e=0,i=t.length){let n="";for(let s=e;s<i;++s){let r=t[s];r>65535?(r-=65536,n+=String.fromCharCode((r>>10)+55296)+String.fromCharCode(r%1024+56320)):n+=String.fromCharCode(r)}return n}var Lie=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let n=e.length;if(!n)return 0;let s=0,r=0;if(this._interim){let o=e.charCodeAt(r++);56320<=o&&o<=57343?i[s++]=(this._interim-55296)*1024+o-56320+65536:(i[s++]=this._interim,i[s++]=o),this._interim=0}for(let o=r;o<n;++o){let l=e.charCodeAt(o);if(55296<=l&&l<=56319){if(++o>=n)return this._interim=l,s;let c=e.charCodeAt(o);56320<=c&&c<=57343?i[s++]=(l-55296)*1024+c-56320+65536:(i[s++]=l,i[s++]=c);continue}l!==65279&&(i[s++]=l)}return s}},Die=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let n=e.length;if(!n)return 0;let s=0,r,o,l,c,u=0,d=0;if(this.interim[0]){let O=!1,_=this.interim[0];_&=(_&224)===192?31:(_&240)===224?15:7;let b=0,S;for(;(S=this.interim[++b]&63)&&b<4;)_<<=6,_|=S;let w=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,T=w-b;for(;d<T;){if(d>=n)return 0;if(S=e[d++],(S&192)!==128){d--,O=!0;break}else this.interim[b++]=S,_<<=6,_|=S&63}O||(w===2?_<128?d--:i[s++]=_:w===3?_<2048||_>=55296&&_<=57343||_===65279||(i[s++]=_):_<65536||_>1114111||(i[s++]=_)),this.interim.fill(0)}let p=n-4,g=d;for(;g<n;){for(;g<p&&!((r=e[g])&128)&&!((o=e[g+1])&128)&&!((l=e[g+2])&128)&&!((c=e[g+3])&128);)i[s++]=r,i[s++]=o,i[s++]=l,i[s++]=c,g+=4;if(r=e[g++],r<128)i[s++]=r;else if((r&224)===192){if(g>=n)return this.interim[0]=r,s;if(o=e[g++],(o&192)!==128){g--;continue}if(u=(r&31)<<6|o&63,u<128){g--;continue}i[s++]=u}else if((r&240)===224){if(g>=n)return this.interim[0]=r,s;if(o=e[g++],(o&192)!==128){g--;continue}if(g>=n)return this.interim[0]=r,this.interim[1]=o,s;if(l=e[g++],(l&192)!==128){g--;continue}if(u=(r&15)<<12|(o&63)<<6|l&63,u<2048||u>=55296&&u<=57343||u===65279)continue;i[s++]=u}else if((r&248)===240){if(g>=n)return this.interim[0]=r,s;if(o=e[g++],(o&192)!==128){g--;continue}if(g>=n)return this.interim[0]=r,this.interim[1]=o,s;if(l=e[g++],(l&192)!==128){g--;continue}if(g>=n)return this.interim[0]=r,this.interim[1]=o,this.interim[2]=l,s;if(c=e[g++],(c&192)!==128){g--;continue}if(u=(r&7)<<18|(o&63)<<12|(l&63)<<6|c&63,u<65536||u>1114111)continue;i[s++]=u}}return s}},CN="",ya=" ",bd=class kN{constructor(){this.fg=0,this.bg=0,this.extended=new Fg}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new kN;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Fg=class TN{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new TN(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Rs=class AN extends bd{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Fg,this.combinedData=""}static fromCharData(e){let i=new AN;return i.setFromCharData(e),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?ga(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let s=e[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(n-55296)*1024+s-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},qP="di$target",Ub="di$dependencies",Ry=new Map;function Bie(t){return t[Ub]||[]}function $i(t){if(Ry.has(t))return Ry.get(t);let e=function(i,n,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");$ie(e,i,s)};return e._id=t,Ry.set(t,e),e}function $ie(t,e,i){e[qP]===e?e[Ub].push({id:t,index:i}):(e[Ub]=[{id:t,index:i}],e[qP]=e)}var yn=$i("BufferService"),EN=$i("CoreMouseService"),$l=$i("CoreService"),Nie=$i("CharsetService"),Ew=$i("InstantiationService"),MN=$i("LogService"),bn=$i("OptionsService"),PN=$i("OscLinkService"),zie=$i("UnicodeService"),xd=$i("DecorationService"),Yb=class{constructor(e,i,n){this._bufferService=e,this._optionsService=i,this._oscLinkService=n}provideLinks(e,i){var p;let n=this._bufferService.buffer.lines.get(e-1);if(!n){i(void 0);return}let s=[],r=this._optionsService.rawOptions.linkHandler,o=new Rs,l=n.getTrimmedLength(),c=-1,u=-1,d=!1;for(let g=0;g<l;g++)if(!(u===-1&&!n.hasContent(g))){if(n.loadCell(g,o),o.hasExtendedAttrs()&&o.extended.urlId)if(u===-1){u=g,c=o.extended.urlId;continue}else d=o.extended.urlId!==c;else u!==-1&&(d=!0);if(d||u!==-1&&g===l-1){let O=(p=this._oscLinkService.getLinkData(c))==null?void 0:p.uri;if(O){let _={start:{x:u+1,y:e},end:{x:g+(!d&&g===l-1?1:0),y:e}},b=!1;if(!(r!=null&&r.allowNonHttpProtocols))try{let S=new URL(O);["http:","https:"].includes(S.protocol)||(b=!0)}catch{b=!0}b||s.push({text:O,range:_,activate:(S,w)=>r?r.activate(S,w,_):jie(S,w),hover:(S,w)=>{var T;return(T=r==null?void 0:r.hover)==null?void 0:T.call(r,S,w,_)},leave:(S,w)=>{var T;return(T=r==null?void 0:r.leave)==null?void 0:T.call(r,S,w,_)}})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(u=g,c=o.extended.urlId):(u=-1,c=-1)}}i(s)}};Yb=Ut([be(0,yn),be(1,bn),be(2,PN)],Yb);function jie(t,e){if(confirm(`Do you want to navigate to ${e}?
105
-
106
- WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}var kO=$i("CharSizeService"),Co=$i("CoreBrowserService"),Mw=$i("MouseService"),ko=$i("RenderService"),Iie=$i("SelectionService"),RN=$i("CharacterJoinerService"),Ch=$i("ThemeService"),QN=$i("LinkProviderService"),Vie=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?WP.isErrorNoTelemetry(e)?new WP(e.message+`
107
-
108
- `+e.stack):new Error(e.message+`
109
-
110
- `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},Xie=new Vie;function Km(t){Zie(t)||Xie.onUnexpectedError(t)}var Hb="Canceled";function Zie(t){return t instanceof qie?!0:t instanceof Error&&t.name===Hb&&t.message===Hb}var qie=class extends Error{constructor(){super(Hb),this.name=this.message}};function Wie(t){return new Error(`Illegal argument: ${t}`)}var WP=class Fb extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Fb)return e;let i=new Fb;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Gb=class LN extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,LN.prototype)}};function Kn(t,e=0){return t[t.length-(1+e)]}var Uie;(t=>{function e(r){return r<0}t.isLessThan=e;function i(r){return r<=0}t.isLessThanOrEqual=i;function n(r){return r>0}t.isGreaterThan=n;function s(r){return r===0}t.isNeitherLessOrGreaterThan=s,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(Uie||(Uie={}));function Yie(t,e){let i=this,n=!1,s;return function(){return n||(n=!0,e||(s=t.apply(i,arguments))),s}}var DN;(t=>{function e(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function n(){return i}t.empty=n;function*s(A){yield A}t.single=s;function r(A){return e(A)?A:s(A)}t.wrap=r;function o(A){return A||i}t.from=o;function*l(A){for(let R=A.length-1;R>=0;R--)yield A[R]}t.reverse=l;function c(A){return!A||A[Symbol.iterator]().next().done===!0}t.isEmpty=c;function u(A){return A[Symbol.iterator]().next().value}t.first=u;function d(A,R){let E=0;for(let $ of A)if(R($,E++))return!0;return!1}t.some=d;function p(A,R){for(let E of A)if(R(E))return E}t.find=p;function*g(A,R){for(let E of A)R(E)&&(yield E)}t.filter=g;function*O(A,R){let E=0;for(let $ of A)yield R($,E++)}t.map=O;function*_(A,R){let E=0;for(let $ of A)yield*R($,E++)}t.flatMap=_;function*b(...A){for(let R of A)yield*R}t.concat=b;function S(A,R,E){let $=E;for(let N of A)$=R($,N);return $}t.reduce=S;function*w(A,R,E=A.length){for(R<0&&(R+=A.length),E<0?E+=A.length:E>A.length&&(E=A.length);R<E;R++)yield A[R]}t.slice=w;function T(A,R=Number.POSITIVE_INFINITY){let E=[];if(R===0)return[E,A];let $=A[Symbol.iterator]();for(let N=0;N<R;N++){let q=$.next();if(q.done)return[E,t.empty()];E.push(q.value)}return[E,{[Symbol.iterator](){return $}}]}t.consume=T;async function k(A){let R=[];for await(let E of A)R.push(E);return Promise.resolve(R)}t.asyncToArray=k})(DN||(DN={}));function Pl(t){if(DN.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function Hie(...t){return Bt(()=>Pl(t))}function Bt(t){return{dispose:Yie(()=>{t()})}}var BN=class $N{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Pl(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?$N.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};BN.DISABLE_DISPOSED_WARNING=!1;var xa=BN,Ue=class{constructor(){this._store=new xa,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Ue.None=Object.freeze({dispose(){}});var mh=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var i;this._isDisposed||e===this._value||((i=this._value)==null||i.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},po=typeof window=="object"?window:globalThis,Kb=class Jb{constructor(e){this.element=e,this.next=Jb.Undefined,this.prev=Jb.Undefined}};Kb.Undefined=new Kb(void 0);var $t=Kb,UP=class{constructor(){this._first=$t.Undefined,this._last=$t.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===$t.Undefined}clear(){let e=this._first;for(;e!==$t.Undefined;){let i=e.next;e.prev=$t.Undefined,e.next=$t.Undefined,e=i}this._first=$t.Undefined,this._last=$t.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let n=new $t(e);if(this._first===$t.Undefined)this._first=n,this._last=n;else if(i){let r=this._last;this._last=n,n.prev=r,r.next=n}else{let r=this._first;this._first=n,n.next=r,r.prev=n}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(n))}}shift(){if(this._first!==$t.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==$t.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==$t.Undefined&&e.next!==$t.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===$t.Undefined&&e.next===$t.Undefined?(this._first=$t.Undefined,this._last=$t.Undefined):e.next===$t.Undefined?(this._last=this._last.prev,this._last.next=$t.Undefined):e.prev===$t.Undefined&&(this._first=this._first.next,this._first.prev=$t.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==$t.Undefined;)yield e.element,e=e.next}},Fie=globalThis.performance&&typeof globalThis.performance.now=="function",Gie=class NN{static create(e){return new NN(e)}constructor(e){this._now=Fie&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Gi;(t=>{t.None=()=>Ue.None;function e(Q,D){return p(Q,()=>{},0,void 0,!0,void 0,D)}t.defer=e;function i(Q){return(D,z=null,j)=>{let B=!1,Z;return Z=Q(H=>{if(!B)return Z?Z.dispose():B=!0,D.call(z,H)},null,j),B&&Z.dispose(),Z}}t.once=i;function n(Q,D,z){return u((j,B=null,Z)=>Q(H=>j.call(B,D(H)),null,Z),z)}t.map=n;function s(Q,D,z){return u((j,B=null,Z)=>Q(H=>{D(H),j.call(B,H)},null,Z),z)}t.forEach=s;function r(Q,D,z){return u((j,B=null,Z)=>Q(H=>D(H)&&j.call(B,H),null,Z),z)}t.filter=r;function o(Q){return Q}t.signal=o;function l(...Q){return(D,z=null,j)=>{let B=Hie(...Q.map(Z=>Z(H=>D.call(z,H))));return d(B,j)}}t.any=l;function c(Q,D,z,j){let B=z;return n(Q,Z=>(B=D(B,Z),B),j)}t.reduce=c;function u(Q,D){let z,j={onWillAddFirstListener(){z=Q(B.fire,B)},onDidRemoveLastListener(){z==null||z.dispose()}},B=new me(j);return D==null||D.add(B),B.event}function d(Q,D){return D instanceof Array?D.push(Q):D&&D.add(Q),Q}function p(Q,D,z=100,j=!1,B=!1,Z,H){let F,M,V,J=0,L,ue={leakWarningThreshold:Z,onWillAddFirstListener(){F=Q(fe=>{J++,M=D(M,fe),j&&!V&&(he.fire(M),M=void 0),L=()=>{let Oe=M;M=void 0,V=void 0,(!j||J>1)&&he.fire(Oe),J=0},typeof z=="number"?(clearTimeout(V),V=setTimeout(L,z)):V===void 0&&(V=0,queueMicrotask(L))})},onWillRemoveListener(){B&&J>0&&(L==null||L())},onDidRemoveLastListener(){L=void 0,F.dispose()}},he=new me(ue);return H==null||H.add(he),he.event}t.debounce=p;function g(Q,D=0,z){return t.debounce(Q,(j,B)=>j?(j.push(B),j):[B],D,void 0,!0,void 0,z)}t.accumulate=g;function O(Q,D=(j,B)=>j===B,z){let j=!0,B;return r(Q,Z=>{let H=j||!D(Z,B);return j=!1,B=Z,H},z)}t.latch=O;function _(Q,D,z){return[t.filter(Q,D,z),t.filter(Q,j=>!D(j),z)]}t.split=_;function b(Q,D=!1,z=[],j){let B=z.slice(),Z=Q(M=>{B?B.push(M):F.fire(M)});j&&j.add(Z);let H=()=>{B==null||B.forEach(M=>F.fire(M)),B=null},F=new me({onWillAddFirstListener(){Z||(Z=Q(M=>F.fire(M)),j&&j.add(Z))},onDidAddFirstListener(){B&&(D?setTimeout(H):H())},onDidRemoveLastListener(){Z&&Z.dispose(),Z=null}});return j&&j.add(F),F.event}t.buffer=b;function S(Q,D){return(z,j,B)=>{let Z=D(new T);return Q(function(H){let F=Z.evaluate(H);F!==w&&z.call(j,F)},void 0,B)}}t.chain=S;let w=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(D){return this.steps.push(D),this}forEach(D){return this.steps.push(z=>(D(z),z)),this}filter(D){return this.steps.push(z=>D(z)?z:w),this}reduce(D,z){let j=z;return this.steps.push(B=>(j=D(j,B),j)),this}latch(D=(z,j)=>z===j){let z=!0,j;return this.steps.push(B=>{let Z=z||!D(B,j);return z=!1,j=B,Z?B:w}),this}evaluate(D){for(let z of this.steps)if(D=z(D),D===w)break;return D}}function k(Q,D,z=j=>j){let j=(...F)=>H.fire(z(...F)),B=()=>Q.on(D,j),Z=()=>Q.removeListener(D,j),H=new me({onWillAddFirstListener:B,onDidRemoveLastListener:Z});return H.event}t.fromNodeEventEmitter=k;function A(Q,D,z=j=>j){let j=(...F)=>H.fire(z(...F)),B=()=>Q.addEventListener(D,j),Z=()=>Q.removeEventListener(D,j),H=new me({onWillAddFirstListener:B,onDidRemoveLastListener:Z});return H.event}t.fromDOMEventEmitter=A;function R(Q){return new Promise(D=>i(Q)(D))}t.toPromise=R;function E(Q){let D=new me;return Q.then(z=>{D.fire(z)},()=>{D.fire(void 0)}).finally(()=>{D.dispose()}),D.event}t.fromPromise=E;function $(Q,D){return Q(z=>D.fire(z))}t.forward=$;function N(Q,D,z){return D(z),Q(j=>D(j))}t.runAndSubscribe=N;class q{constructor(D,z){this._observable=D,this._counter=0,this._hasChanged=!1;let j={onWillAddFirstListener:()=>{D.addObserver(this)},onDidRemoveLastListener:()=>{D.removeObserver(this)}};this.emitter=new me(j),z&&z.add(this.emitter)}beginUpdate(D){this._counter++}handlePossibleChange(D){}handleChange(D,z){this._hasChanged=!0}endUpdate(D){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function G(Q,D){return new q(Q,D).emitter.event}t.fromObservable=G;function U(Q){return(D,z,j)=>{let B=0,Z=!1,H={beginUpdate(){B++},endUpdate(){B--,B===0&&(Q.reportChanges(),Z&&(Z=!1,D.call(z)))},handlePossibleChange(){},handleChange(){Z=!0}};Q.addObserver(H),Q.reportChanges();let F={dispose(){Q.removeObserver(H)}};return j instanceof xa?j.add(F):Array.isArray(j)&&j.push(F),F}}t.fromObservableLight=U})(Gi||(Gi={}));var ex=class tx{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${tx._idPool++}`,tx.all.add(this)}start(e){this._stopWatch=new Gie,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};ex.all=new Set,ex._idPool=0;var Kie=ex,Jie=-1,zN=class jN{constructor(e,i,n=(jN._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,i){let n=this.threshold;if(n<=0||i<n)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[r,o]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(l),console.warn(r);let c=new ine(l,r);this._errorHandler(c)}return()=>{let r=this._stacks.get(e.value)||0;this._stacks.set(e.value,r-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[n,s]of this._stacks)(!e||i<s)&&(e=[n,s],i=s);return e}};zN._idPool=1;var ene=zN,tne=class IN{constructor(e){this.value=e}static create(){let e=new Error;return new IN(e.stack??"")}print(){console.warn(this.value.split(`
111
- `).slice(2).join(`
112
- `))}},ine=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},nne=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},sne=0,Qy=class{constructor(e){this.value=e,this.id=sne++}},rne=2,one,me=class{constructor(e){var i,n,s,r;this._size=0,this._options=e,this._leakageMon=(i=this._options)!=null&&i.leakWarningThreshold?new ene((e==null?void 0:e.onListenerError)??Km,((n=this._options)==null?void 0:n.leakWarningThreshold)??Jie):void 0,this._perfMon=(s=this._options)!=null&&s._profName?new Kie(this._options._profName):void 0,this._deliveryQueue=(r=this._options)==null?void 0:r.deliveryQueue}dispose(){var e,i,n,s;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(i=this._options)==null?void 0:i.onDidRemoveLastListener)==null||n.call(i),(s=this._leakageMon)==null||s.dispose())}get event(){return this._event??(this._event=(e,i,n)=>{var l,c,u,d,p;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let g=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(g);let O=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],_=new nne(`${g}. HINT: Stack shows most frequent listener (${O[1]}-times)`,O[0]);return(((l=this._options)==null?void 0:l.onListenerError)||Km)(_),Ue.None}if(this._disposed)return Ue.None;i&&(e=e.bind(i));let s=new Qy(e),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=tne.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof Qy?(this._deliveryQueue??(this._deliveryQueue=new ane),this._listeners=[this._listeners,s]):this._listeners.push(s):((u=(c=this._options)==null?void 0:c.onWillAddFirstListener)==null||u.call(c,this),this._listeners=s,(p=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||p.call(d,this)),this._size++;let o=Bt(()=>{r==null||r(),this._removeListener(s)});return n instanceof xa?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}_removeListener(e){var r,o,l,c;if((o=(r=this._options)==null?void 0:r.onWillRemoveListener)==null||o.call(r,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(c=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||c.call(l,this),this._size=0;return}let i=this._listeners,n=i.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[n]=void 0;let s=this._deliveryQueue.current===this;if(this._size*rne<=i.length){let u=0;for(let d=0;d<i.length;d++)i[d]?i[u++]=i[d]:s&&(this._deliveryQueue.end--,u<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=u}}_deliver(e,i){var s;if(!e)return;let n=((s=this._options)==null?void 0:s.onListenerError)||Km;if(!n){e.value(i);return}try{e.value(i)}catch(r){n(r)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){var i,n,s,r;if((i=this._deliveryQueue)!=null&&i.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(s=this._perfMon)==null||s.start(this._size),this._listeners)if(this._listeners instanceof Qy)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(r=this._perfMon)==null||r.stop()}hasListeners(){return this._size>0}},ane=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,n){this.i=0,this.end=n,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},ix=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new me,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new me,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,i){if(this.getZoomLevel(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),e)}setFullscreen(e,i){if(this.isFullscreen(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};ix.INSTANCE=new ix;var Pw=ix;function lne(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}Pw.INSTANCE.onDidChangeZoomLevel;function cne(t){return Pw.INSTANCE.getZoomFactor(t)}Pw.INSTANCE.onDidChangeFullscreen;var kh=typeof navigator=="object"?navigator.userAgent:"",nx=kh.indexOf("Firefox")>=0,hne=kh.indexOf("AppleWebKit")>=0,Rw=kh.indexOf("Chrome")>=0,une=!Rw&&kh.indexOf("Safari")>=0;kh.indexOf("Electron/")>=0;kh.indexOf("Android")>=0;var Ly=!1;if(typeof po.matchMedia=="function"){let t=po.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=po.matchMedia("(display-mode: fullscreen)");Ly=t.matches,lne(po,t,({matches:i})=>{Ly&&e.matches||(Ly=i)})}var Vc="en",sx=!1,rx=!1,Jm=!1,VN=!1,bm,eg=Vc,YP=Vc,fne,Is,wl=globalThis,Ui,FQ;typeof wl.vscode<"u"&&typeof wl.vscode.process<"u"?Ui=wl.vscode.process:typeof process<"u"&&typeof((FQ=process==null?void 0:process.versions)==null?void 0:FQ.node)=="string"&&(Ui=process);var GQ,dne=typeof((GQ=Ui==null?void 0:Ui.versions)==null?void 0:GQ.electron)=="string",pne=dne&&(Ui==null?void 0:Ui.type)==="renderer",KQ;if(typeof Ui=="object"){sx=Ui.platform==="win32",rx=Ui.platform==="darwin",Jm=Ui.platform==="linux",Jm&&Ui.env.SNAP&&Ui.env.SNAP_REVISION,Ui.env.CI||Ui.env.BUILD_ARTIFACTSTAGINGDIRECTORY,bm=Vc,eg=Vc;let t=Ui.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);bm=e.userLocale,YP=e.osLocale,eg=e.resolvedLanguage||Vc,fne=(KQ=e.languagePack)==null?void 0:KQ.translationsConfigFile}catch{}VN=!0}else typeof navigator=="object"&&!pne?(Is=navigator.userAgent,sx=Is.indexOf("Windows")>=0,rx=Is.indexOf("Macintosh")>=0,(Is.indexOf("Macintosh")>=0||Is.indexOf("iPad")>=0||Is.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Jm=Is.indexOf("Linux")>=0,(Is==null?void 0:Is.indexOf("Mobi"))>=0,eg=globalThis._VSCODE_NLS_LANGUAGE||Vc,bm=navigator.language.toLowerCase(),YP=bm):console.error("Unable to resolve platform.");var XN=sx,Tr=rx,mne=Jm,HP=VN,Er=Is,ra=eg,gne;(t=>{function e(){return ra}t.value=e;function i(){return ra.length===2?ra==="en":ra.length>=3?ra[0]==="e"&&ra[1]==="n"&&ra[2]==="-":!1}t.isDefaultVariant=i;function n(){return ra==="en"}t.isDefault=n})(gne||(gne={}));var One=typeof wl.postMessage=="function"&&!wl.importScripts;(()=>{if(One){let t=[];wl.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let n=0,s=t.length;n<s;n++){let r=t[n];if(r.id===i.data.vscodeScheduleAsyncWork){t.splice(n,1),r.callback();return}}});let e=0;return i=>{let n=++e;t.push({id:n,callback:i}),wl.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var vne=!!(Er&&Er.indexOf("Chrome")>=0);Er&&Er.indexOf("Firefox")>=0;!vne&&Er&&Er.indexOf("Safari")>=0;Er&&Er.indexOf("Edg/")>=0;Er&&Er.indexOf("Android")>=0;var wc=typeof navigator=="object"?navigator:{};HP||document.queryCommandSupported&&document.queryCommandSupported("copy")||wc&&wc.clipboard&&wc.clipboard.writeText,HP||wc&&wc.clipboard&&wc.clipboard.readText;var Qw=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,i){this._keyCodeToStr[e]=i,this._strToKeyCode[i.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Dy=new Qw,FP=new Qw,GP=new Qw,_ne=new Array(230),ZN;(t=>{function e(l){return Dy.keyCodeToStr(l)}t.toString=e;function i(l){return Dy.strToKeyCode(l)}t.fromString=i;function n(l){return FP.keyCodeToStr(l)}t.toUserSettingsUS=n;function s(l){return GP.keyCodeToStr(l)}t.toUserSettingsGeneral=s;function r(l){return FP.strToKeyCode(l)||GP.strToKeyCode(l)}t.fromUserSettings=r;function o(l){if(l>=98&&l<=113)return null;switch(l){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Dy.keyCodeToStr(l)}t.toElectronAccelerator=o})(ZN||(ZN={}));var yne=class qN{constructor(e,i,n,s,r){this.ctrlKey=e,this.shiftKey=i,this.altKey=n,this.metaKey=s,this.keyCode=r}equals(e){return e instanceof qN&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}getHashCode(){let e=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",n=this.altKey?"1":"0",s=this.metaKey?"1":"0";return`K${e}${i}${n}${s}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new bne([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},bne=class{constructor(t){if(t.length===0)throw Wie("chords");this.chords=t}getHashCode(){let t="";for(let e=0,i=this.chords.length;e<i;e++)e!==0&&(t+=";"),t+=this.chords[e].getHashCode();return t}equals(t){if(t===null||this.chords.length!==t.chords.length)return!1;for(let e=0;e<this.chords.length;e++)if(!this.chords[e].equals(t.chords[e]))return!1;return!0}};function xne(t){if(t.charCode){let i=String.fromCharCode(t.charCode).toUpperCase();return ZN.fromString(i)}let e=t.keyCode;if(e===3)return 7;if(nx)switch(e){case 59:return 85;case 60:if(mne)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Tr)return 57;break}else if(hne&&(Tr&&e===93||!Tr&&e===92))return 57;return _ne[e]||0}var Sne=Tr?256:2048,wne=512,Cne=1024,kne=Tr?2048:256,KP=class{constructor(t){var i;this._standardKeyboardEventBrand=!0;let e=t;this.browserEvent=e,this.target=e.target,this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,this.altGraphKey=(i=e.getModifierState)==null?void 0:i.call(e,"AltGraph"),this.keyCode=xne(e),this.code=e.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(t){return this._asKeybinding===t}_computeKeybinding(){let t=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode);let e=0;return this.ctrlKey&&(e|=Sne),this.altKey&&(e|=wne),this.shiftKey&&(e|=Cne),this.metaKey&&(e|=kne),e|=t,e}_computeKeyCodeChord(){let t=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode),new yne(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,t)}},JP=new WeakMap;function Tne(t){if(!t.parent||t.parent===t)return null;try{let e=t.location,i=t.parent.location;if(e.origin!=="null"&&i.origin!=="null"&&e.origin!==i.origin)return null}catch{return null}return t.parent}var Ane=class{static getSameOriginWindowChain(t){let e=JP.get(t);if(!e){e=[],JP.set(t,e);let i=t,n;do n=Tne(i),n?e.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):e.push({window:new WeakRef(i),iframeElement:null}),i=n;while(i)}return e.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(t,e){if(!e||t===e)return{top:0,left:0};let i=0,n=0,s=this.getSameOriginWindowChain(t);for(let r of s){let o=r.window.deref();if(i+=(o==null?void 0:o.scrollY)??0,n+=(o==null?void 0:o.scrollX)??0,o===e||!r.iframeElement)break;let l=r.iframeElement.getBoundingClientRect();i+=l.top,n+=l.left}return{top:i,left:n}}},xm=class{constructor(e,i){this.timestamp=Date.now(),this.browserEvent=i,this.leftButton=i.button===0,this.middleButton=i.button===1,this.rightButton=i.button===2,this.buttons=i.buttons,this.target=i.target,this.detail=i.detail||1,i.type==="dblclick"&&(this.detail=2),this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,typeof i.pageX=="number"?(this.posx=i.pageX,this.posy=i.pageY):(this.posx=i.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=i.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=Ane.getPositionOfChildWindowRelativeToAncestorWindow(e,i.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},eR=class{constructor(e,i=0,n=0){var r;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=i;let s=!1;if(Rw){let o=navigator.userAgent.match(/Chrome\/(\d+)/);s=(o?parseInt(o[1]):123)<=122}if(e){let o=e,l=e,c=((r=e.view)==null?void 0:r.devicePixelRatio)||1;if(typeof o.wheelDeltaY<"u")s?this.deltaY=o.wheelDeltaY/(120*c):this.deltaY=o.wheelDeltaY/120;else if(typeof l.VERTICAL_AXIS<"u"&&l.axis===l.VERTICAL_AXIS)this.deltaY=-l.detail/3;else if(e.type==="wheel"){let u=e;u.deltaMode===u.DOM_DELTA_LINE?nx&&!Tr?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")une&&XN?this.deltaX=-(o.wheelDeltaX/120):s?this.deltaX=o.wheelDeltaX/(120*c):this.deltaX=o.wheelDeltaX/120;else if(typeof l.HORIZONTAL_AXIS<"u"&&l.axis===l.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let u=e;u.deltaMode===u.DOM_DELTA_LINE?nx&&!Tr?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(s?this.deltaY=e.wheelDelta/(120*c):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},WN=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),Ene;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof Mne?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Gi.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:WN})})(Ene||(Ene={}));var Mne=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?WN:(this._emitter||(this._emitter=new me),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Lw=class{constructor(e,i){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof i=="number"&&this.setIfNotSet(e,i)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,i){if(this._isDisposed)throw new Gb("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},i)}setIfNotSet(e,i){if(this._isDisposed)throw new Gb("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},i))}},Pne=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,i,n=globalThis){if(this.isDisposed)throw new Gb("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=n.setInterval(()=>{e()},i);this.disposable=Bt(()=>{n.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Rne;(t=>{async function e(n){let s,r=await Promise.all(n.map(o=>o.then(l=>l,l=>{s||(s=l)})));if(typeof s<"u")throw s;return r}t.settled=e;function i(n){return new Promise(async(s,r)=>{try{await n(s,r)}catch(o){r(o)}})}t.withAsyncBody=i})(Rne||(Rne={}));var tR=class _s{static fromArray(e){return new _s(i=>{i.emitMany(e)})}static fromPromise(e){return new _s(async i=>{i.emitMany(await e)})}static fromPromises(e){return new _s(async i=>{await Promise.all(e.map(async n=>i.emitOne(await n)))})}static merge(e){return new _s(async i=>{await Promise.all(e.map(async n=>{for await(let s of n)i.emitOne(s)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new me,queueMicrotask(async()=>{let n={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(e(n)),this.resolve()}catch(s){this.reject(s)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await Gi.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var i;return(i=this._onReturn)==null||i.call(this),{done:!0,value:void 0}}}}static map(e,i){return new _s(async n=>{for await(let s of e)n.emitOne(i(s))})}map(e){return _s.map(this,e)}static filter(e,i){return new _s(async n=>{for await(let s of e)i(s)&&n.emitOne(s)})}filter(e){return _s.filter(this,e)}static coalesce(e){return _s.filter(e,i=>!!i)}coalesce(){return _s.coalesce(this)}static async toPromise(e){let i=[];for await(let n of e)i.push(n);return i}toPromise(){return _s.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};tR.EMPTY=tR.fromArray([]);var{getWindow:Sr,getWindowId:Qne,onDidRegisterWindow:Lne}=(function(){let t=new Map,e={window:po,disposables:new xa};t.set(po.vscodeWindowId,e);let i=new me,n=new me,s=new me;function r(o,l){return(typeof o=="number"?t.get(o):void 0)??(l?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:n.event,registerWindow(o){if(t.has(o.vscodeWindowId))return Ue.None;let l=new xa,c={window:o,disposables:l.add(new xa)};return t.set(o.vscodeWindowId,c),l.add(Bt(()=>{t.delete(o.vscodeWindowId),n.fire(o)})),l.add(Be(o,wi.BEFORE_UNLOAD,()=>{s.fire(o)})),i.fire(c),l},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return t.has(o)},getWindowById:r,getWindow(o){var u;let l=o;if((u=l==null?void 0:l.ownerDocument)!=null&&u.defaultView)return l.ownerDocument.defaultView.window;let c=o;return c!=null&&c.view?c.view.window:po},getDocument(o){return Sr(o).document}}})(),Dne=class{constructor(e,i,n,s){this._node=e,this._type=i,this._handler=n,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Be(t,e,i,n){return new Dne(t,e,i,n)}var iR=function(t,e,i,n){return Be(t,e,i,n)},Dw,Bne=class extends Pne{constructor(t){super(),this.defaultTarget=t&&Sr(t)}cancelAndSet(t,e,i){return super.cancelAndSet(t,e,i??this.defaultTarget)}},nR=class{constructor(e,i=0){this._runner=e,this.priority=i,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Km(e)}}static sort(e,i){return i.priority-e.priority}};(function(){let t=new Map,e=new Map,i=new Map,n=new Map,s=r=>{i.set(r,!1);let o=t.get(r)??[];for(e.set(r,o),t.set(r,[]),n.set(r,!0);o.length>0;)o.sort(nR.sort),o.shift().execute();n.set(r,!1)};Dw=(r,o,l=0)=>{let c=Qne(r),u=new nR(o,l),d=t.get(c);return d||(d=[],t.set(c,d)),d.push(u),i.get(c)||(i.set(c,!0),r.requestAnimationFrame(()=>s(c))),u}})();function $ne(t){let e=t.getBoundingClientRect(),i=Sr(t);return{left:e.left+i.scrollX,top:e.top+i.scrollY,width:e.width,height:e.height}}var wi={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},Nne=class{constructor(t){this.domNode=t,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(t){let e=Mn(t);this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth)}setWidth(t){let e=Mn(t);this._width!==e&&(this._width=e,this.domNode.style.width=this._width)}setHeight(t){let e=Mn(t);this._height!==e&&(this._height=e,this.domNode.style.height=this._height)}setTop(t){let e=Mn(t);this._top!==e&&(this._top=e,this.domNode.style.top=this._top)}setLeft(t){let e=Mn(t);this._left!==e&&(this._left=e,this.domNode.style.left=this._left)}setBottom(t){let e=Mn(t);this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom)}setRight(t){let e=Mn(t);this._right!==e&&(this._right=e,this.domNode.style.right=this._right)}setPaddingTop(t){let e=Mn(t);this._paddingTop!==e&&(this._paddingTop=e,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(t){let e=Mn(t);this._paddingLeft!==e&&(this._paddingLeft=e,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(t){let e=Mn(t);this._paddingBottom!==e&&(this._paddingBottom=e,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(t){let e=Mn(t);this._paddingRight!==e&&(this._paddingRight=e,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(t){let e=Mn(t);this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize)}setFontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(t){this._fontFeatureSettings!==t&&(this._fontFeatureSettings=t,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(t){this._fontVariationSettings!==t&&(this._fontVariationSettings=t,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(t){this._textDecoration!==t&&(this._textDecoration=t,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(t){let e=Mn(t);this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(t){let e=Mn(t);this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(t){this._className!==t&&(this._className=t,this.domNode.className=this._className)}toggleClassName(t,e){this.domNode.classList.toggle(t,e),this._className=this.domNode.className}setDisplay(t){this._display!==t&&(this._display=t,this.domNode.style.display=this._display)}setPosition(t){this._position!==t&&(this._position=t,this.domNode.style.position=this._position)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this.domNode.style.visibility=this._visibility)}setColor(t){this._color!==t&&(this._color=t,this.domNode.style.color=this._color)}setBackgroundColor(t){this._backgroundColor!==t&&(this._backgroundColor=t,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(t){this._layerHint!==t&&(this._layerHint=t,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(t){this._boxShadow!==t&&(this._boxShadow=t,this.domNode.style.boxShadow=t)}setContain(t){this._contain!==t&&(this._contain=t,this.domNode.style.contain=this._contain)}setAttribute(t,e){this.domNode.setAttribute(t,e)}removeAttribute(t){this.domNode.removeAttribute(t)}appendChild(t){this.domNode.appendChild(t.domNode)}removeChild(t){this.domNode.removeChild(t.domNode)}};function Mn(t){return typeof t=="number"?`${t}px`:t}function bf(t){return new Nne(t)}var UN=class{constructor(){this._hooks=new xa,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,i){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(i)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,i,n,s,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=r;let o=e;try{e.setPointerCapture(i),this._hooks.add(Bt(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{o=Sr(e)}this._hooks.add(Be(o,wi.POINTER_MOVE,l=>{if(l.buttons!==n){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(Be(o,wi.POINTER_UP,l=>this.stopMonitoring(!0)))}};function zne(t,e,i){let n=null,s=null;if(typeof i.value=="function"?(n="value",s=i.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(n="get",s=i.get),!s)throw new Error("not supported");let r=`$memoize$${e}`;i[n]=function(...o){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,o)}),this[r]}}var fr;(t=>(t.Tap="-xterm-gesturetap",t.Change="-xterm-gesturechange",t.Start="-xterm-gesturestart",t.End="-xterm-gesturesend",t.Contextmenu="-xterm-gesturecontextmenu"))(fr||(fr={}));var tf=class en extends Ue{constructor(){super(),this.dispatched=!1,this.targets=new UP,this.ignoreTargets=new UP,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Gi.runAndSubscribe(Lne,({window:e,disposables:i})=>{i.add(Be(e.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),i.add(Be(e.document,"touchend",n=>this.onTouchEnd(e,n))),i.add(Be(e.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:po,disposables:this._store}))}static addTarget(e){if(!en.isTouchDevice())return Ue.None;en.INSTANCE||(en.INSTANCE=new en);let i=en.INSTANCE.targets.push(e);return Bt(i)}static ignoreTarget(e){if(!en.isTouchDevice())return Ue.None;en.INSTANCE||(en.INSTANCE=new en);let i=en.INSTANCE.ignoreTargets.push(e);return Bt(i)}static isTouchDevice(){return"ontouchstart"in po||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,s=e.targetTouches.length;n<s;n++){let r=e.targetTouches.item(n);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:i,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[i],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};let o=this.newGestureEvent(fr.Start,r.target);o.pageX=r.pageX,o.pageY=r.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,i){let n=Date.now(),s=Object.keys(this.activeTouches).length;for(let r=0,o=i.changedTouches.length;r<o;r++){let l=i.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("move of an UNKNOWN touch",l);continue}let c=this.activeTouches[l.identifier],u=Date.now()-c.initialTimeStamp;if(u<en.HOLD_DELAY&&Math.abs(c.initialPageX-Kn(c.rollingPageX))<30&&Math.abs(c.initialPageY-Kn(c.rollingPageY))<30){let d=this.newGestureEvent(fr.Tap,c.initialTarget);d.pageX=Kn(c.rollingPageX),d.pageY=Kn(c.rollingPageY),this.dispatchEvent(d)}else if(u>=en.HOLD_DELAY&&Math.abs(c.initialPageX-Kn(c.rollingPageX))<30&&Math.abs(c.initialPageY-Kn(c.rollingPageY))<30){let d=this.newGestureEvent(fr.Contextmenu,c.initialTarget);d.pageX=Kn(c.rollingPageX),d.pageY=Kn(c.rollingPageY),this.dispatchEvent(d)}else if(s===1){let d=Kn(c.rollingPageX),p=Kn(c.rollingPageY),g=Kn(c.rollingTimestamps)-c.rollingTimestamps[0],O=d-c.rollingPageX[0],_=p-c.rollingPageY[0],b=[...this.targets].filter(S=>c.initialTarget instanceof Node&&S.contains(c.initialTarget));this.inertia(e,b,n,Math.abs(O)/g,O>0?1:-1,d,Math.abs(_)/g,_>0?1:-1,p)}this.dispatchEvent(this.newGestureEvent(fr.End,c.initialTarget)),delete this.activeTouches[l.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,i){let n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=i,n.tapCount=0,n}dispatchEvent(e){if(e.type===fr.Tap){let i=new Date().getTime(),n=0;i-this._lastSetTapCountTime>en.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=i,e.tapCount=n}else(e.type===fr.Change||e.type===fr.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(e.initialTarget))return;let i=[];for(let n of this.targets)if(n.contains(e.initialTarget)){let s=0,r=e.initialTarget;for(;r&&r!==n;)s++,r=r.parentElement;i.push([s,n])}i.sort((n,s)=>n[0]-s[0]);for(let[n,s]of i)s.dispatchEvent(e),this.dispatched=!0}}inertia(e,i,n,s,r,o,l,c,u){this.handle=Dw(e,()=>{let d=Date.now(),p=d-n,g=0,O=0,_=!0;s+=en.SCROLL_FRICTION*p,l+=en.SCROLL_FRICTION*p,s>0&&(_=!1,g=r*s*p),l>0&&(_=!1,O=c*l*p);let b=this.newGestureEvent(fr.Change);b.translationX=g,b.translationY=O,i.forEach(S=>S.dispatchEvent(b)),_||this.inertia(e,i,d,s,r,o+g,l,c,u+O)})}onTouchMove(e){let i=Date.now();for(let n=0,s=e.changedTouches.length;n<s;n++){let r=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn("end of an UNKNOWN touch",r);continue}let o=this.activeTouches[r.identifier],l=this.newGestureEvent(fr.Change,o.initialTarget);l.translationX=r.pageX-Kn(o.rollingPageX),l.translationY=r.pageY-Kn(o.rollingPageY),l.pageX=r.pageX,l.pageY=r.pageY,this.dispatchEvent(l),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(r.pageX),o.rollingPageY.push(r.pageY),o.rollingTimestamps.push(i)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};tf.SCROLL_FRICTION=-.005,tf.HOLD_DELAY=700,tf.CLEAR_TAP_COUNT_TIME=400,Ut([zne],tf,"isTouchDevice",1);var jne=tf,Bw=class extends Ue{onclick(e,i){this._register(Be(e,wi.CLICK,n=>i(new xm(Sr(e),n))))}onmousedown(e,i){this._register(Be(e,wi.MOUSE_DOWN,n=>i(new xm(Sr(e),n))))}onmouseover(e,i){this._register(Be(e,wi.MOUSE_OVER,n=>i(new xm(Sr(e),n))))}onmouseleave(e,i){this._register(Be(e,wi.MOUSE_LEAVE,n=>i(new xm(Sr(e),n))))}onkeydown(e,i){this._register(Be(e,wi.KEY_DOWN,n=>i(new KP(n))))}onkeyup(e,i){this._register(Be(e,wi.KEY_UP,n=>i(new KP(n))))}oninput(e,i){this._register(Be(e,wi.INPUT,i))}onblur(e,i){this._register(Be(e,wi.BLUR,i))}onfocus(e,i){this._register(Be(e,wi.FOCUS,i))}onchange(e,i){this._register(Be(e,wi.CHANGE,i))}ignoreGesture(e){return jne.ignoreTarget(e)}},sR=11,Ine=class extends Bw{constructor(t){super(),this._onActivate=t.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=t.bgWidth+"px",this.bgDomNode.style.height=t.bgHeight+"px",typeof t.top<"u"&&(this.bgDomNode.style.top="0px"),typeof t.left<"u"&&(this.bgDomNode.style.left="0px"),typeof t.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof t.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=t.className,this.domNode.style.position="absolute",this.domNode.style.width=sR+"px",this.domNode.style.height=sR+"px",typeof t.top<"u"&&(this.domNode.style.top=t.top+"px"),typeof t.left<"u"&&(this.domNode.style.left=t.left+"px"),typeof t.bottom<"u"&&(this.domNode.style.bottom=t.bottom+"px"),typeof t.right<"u"&&(this.domNode.style.right=t.right+"px"),this._pointerMoveMonitor=this._register(new UN),this._register(iR(this.bgDomNode,wi.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(iR(this.domNode,wi.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new Bne),this._pointerdownScheduleRepeatTimer=this._register(new Lw)}_arrowPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Sr(t))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(e,200),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),t.preventDefault()}},Vne=class ox{constructor(e,i,n,s,r,o,l){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,n=n|0,s=s|0,r=r|0,o=o|0,l=l|0),this.rawScrollLeft=s,this.rawScrollTop=l,i<0&&(i=0),s+i>n&&(s=n-i),s<0&&(s=0),r<0&&(r=0),l+r>o&&(l=o-r),l<0&&(l=0),this.width=i,this.scrollWidth=n,this.scrollLeft=s,this.height=r,this.scrollHeight=o,this.scrollTop=l}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,i){return new ox(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new ox(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,i){let n=this.width!==e.width,s=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,l=this.scrollHeight!==e.scrollHeight,c=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:i,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:s,scrollLeftChanged:r,heightChanged:o,scrollHeightChanged:l,scrollTopChanged:c}}},Xne=class extends Ue{constructor(t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this._smoothScrollDuration=t.smoothScrollDuration,this._scheduleAtNextAnimationFrame=t.scheduleAtNextAnimationFrame,this._state=new Vne(t.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(t){this._smoothScrollDuration=t}validateScrollPosition(t){return this._state.withScrollPosition(t)}getScrollDimensions(){return this._state}setScrollDimensions(t,e){var n;let i=this._state.withScrollDimensions(t,e);this._setState(i,!!this._smoothScrolling),(n=this._smoothScrolling)==null||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(t){let e=this._state.withScrollPosition(t);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(e,!1)}setScrollPositionSmooth(t,e){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(t);if(this._smoothScrolling){t={scrollLeft:typeof t.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:t.scrollLeft,scrollTop:typeof t.scrollTop>"u"?this._smoothScrolling.to.scrollTop:t.scrollTop};let i=this._state.withScrollPosition(t);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;e?n=new oR(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let i=this._state.withScrollPosition(t);this._smoothScrolling=oR.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let t=this._smoothScrolling.tick(),e=this._state.withScrollPosition(t);if(this._setState(e,!0),!!this._smoothScrolling){if(t.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(t,e){let i=this._state;i.equals(t)||(this._state=t,this._onScroll.fire(this._state.createScrollEvent(i,e)))}},rR=class{constructor(e,i,n){this.scrollLeft=e,this.scrollTop=i,this.isDone=n}};function By(t,e){let i=e-t;return function(n){return t+i*Wne(n)}}function Zne(t,e,i){return function(n){return n<i?t(n/i):e((n-i)/(1-i))}}var oR=class ax{constructor(e,i,n,s){this.from=e,this.to=i,this.duration=s,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,i,n){if(Math.abs(e-i)>2.5*n){let s,r;return e<i?(s=e+.75*n,r=i-.75*n):(s=e-.75*n,r=i+.75*n),Zne(By(e,s),By(r,i),.33)}return By(e,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let i=(e-this.startTime)/this.duration;if(i<1){let n=this.scrollLeft(i),s=this.scrollTop(i);return new rR(n,s,!1)}return new rR(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,i,n){return ax.start(e,i,n)}static start(e,i,n){n=n+10;let s=Date.now()-10;return new ax(e,i,s,n)}};function qne(t){return Math.pow(t,3)}function Wne(t){return 1-qne(1-t)}var Une=class extends Ue{constructor(e,i,n){super(),this._visibility=e,this._visibleClassName=i,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Lw)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var i;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(i=this._domNode)==null||i.setClassName(this._invisibleClassName+(e?" fade":"")))}},Yne=140,YN=class extends Bw{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Une(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new UN),this._shouldRender=!0,this.domNode=bf(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Be(this.domNode.domNode,wi.POINTER_DOWN,i=>this._domNodePointerDown(i)))}_createArrow(e){let i=this._register(new Ine(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,n,s){this.slider=bf(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(i),typeof n=="number"&&this.slider.setWidth(n),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Be(this.slider.domNode,wi.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let i=this.domNode.domNode.getClientRects()[0].top,n=i+this._scrollbarState.getSliderPosition(),s=i+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);n<=r&&r<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let i,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")i=e.offsetX,n=e.offsetY;else{let r=$ne(this.domNode.domNode);i=e.pageX-r.left,n=e.pageY-r.top}let s=this._pointerDownRelativePosition(i,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{let o=this._sliderOrthogonalPointerPosition(r),l=Math.abs(o-n);if(XN&&l>Yne){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let c=this._sliderPointerPosition(r)-i;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let i={};this.writeScrollPosition(i,e),this._scrollable.setScrollPositionNow(i)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},HN=class lx{constructor(e,i,n,s,r,o){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=r,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new lx(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let i=Math.round(e);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(e){let i=Math.round(e);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(e){let i=Math.round(e);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,i,n,s,r){let o=Math.max(0,n-e),l=Math.max(0,o-2*i),c=s>0&&s>n;if(!c)return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:0,computedSliderPosition:0};let u=Math.round(Math.max(20,Math.floor(n*l/s))),d=(l-u)/(s-n),p=r*d;return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(u),computedSliderRatio:d,computedSliderPosition:Math.round(p)}}_refreshComputedValues(){let e=lx._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let i=e-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let i=e-this._arrowSize,n=this._scrollPosition;return i<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+e;return Math.round(i/this._computedSliderRatio)}},Hne=class extends YN{constructor(e,i,n){let s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new HN(i.horizontalHasArrows?i.arrowSize:0,i.horizontal===2?0:i.horizontalScrollbarSize,i.vertical===2?0:i.verticalScrollbarSize,s.width,s.scrollWidth,r.scrollLeft),visibility:i.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:i.scrollByPage}),i.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((i.horizontalScrollbarSize-i.horizontalSliderSize)/2),0,void 0,i.horizontalSliderSize)}_updateSlider(e,i){this.slider.setWidth(e),this.slider.setLeft(i)}_renderDomNode(e,i){this.domNode.setWidth(e),this.domNode.setHeight(i),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,i){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,i){e.scrollLeft=i}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},Fne=class extends YN{constructor(t,e,i){let n=t.getScrollDimensions(),s=t.getCurrentScrollPosition();if(super({lazyRender:e.lazyRender,host:i,scrollbarState:new HN(e.verticalHasArrows?e.arrowSize:0,e.vertical===2?0:e.verticalScrollbarSize,0,n.height,n.scrollHeight,s.scrollTop),visibility:e.vertical,extraScrollbarClassName:"vertical",scrollable:t,scrollByPage:e.scrollByPage}),e.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((e.verticalScrollbarSize-e.verticalSliderSize)/2),e.verticalSliderSize,void 0)}_updateSlider(t,e){this.slider.setHeight(t),this.slider.setTop(e)}_renderDomNode(t,e){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(t){return this._shouldRender=this._onElementScrollSize(t.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(t.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(t.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(t,e){return e}_sliderPointerPosition(t){return t.pageY}_sliderOrthogonalPointerPosition(t){return t.pageX}_updateScrollbarSize(t){this.slider.setWidth(t)}writeScrollPosition(t,e){t.scrollTop=e}updateOptions(t){this.updateScrollbarSize(t.vertical===2?0:t.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(t.vertical),this._scrollByPage=t.scrollByPage}},Gne=500,aR=50,Kne=class{constructor(e,i,n){this.timestamp=e,this.deltaX=i,this.deltaY=n,this.score=0}},cx=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,i=0,n=1,s=this._rear;do{let r=s===this._front?e:Math.pow(2,-n);if(e-=r,i+=this._memory[s].score*r,s===this._front)break;s=(this._capacity+s-1)%this._capacity,n++}while(!0);return i<=.5}acceptStandardWheelEvent(e){if(Rw){let i=Sr(e.browserEvent),n=cne(i);this.accept(Date.now(),e.deltaX*n,e.deltaY*n)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,i,n){let s=null,r=new Kne(e,i,n);this._front===-1&&this._rear===-1?(this._memory[0]=r,this._front=0,this._rear=0):(s=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=r),r.score=this._computeScore(r,s)}_computeScore(e,i){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),i){let s=Math.abs(e.deltaX),r=Math.abs(e.deltaY),o=Math.abs(i.deltaX),l=Math.abs(i.deltaY),c=Math.max(Math.min(s,o),1),u=Math.max(Math.min(r,l),1),d=Math.max(s,o),p=Math.max(r,l);d%c===0&&p%u===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};cx.INSTANCE=new cx;var Jne=cx,ese=class extends Bw{constructor(t,e,i){super(),this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new me),this.onWillScroll=this._onWillScroll.event,this._options=ise(e),this._scrollable=i,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));let n={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Fne(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new Hne(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(t),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=bf(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=bf(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=bf(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new Lw),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Pl(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(t){this._verticalScrollbar.delegatePointerDown(t)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(t){this._scrollable.setScrollDimensions(t,!1)}updateClassName(t){this._options.className=t,Tr&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(t){typeof t.handleMouseWheel<"u"&&(this._options.handleMouseWheel=t.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof t.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity),typeof t.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=t.fastScrollSensitivity),typeof t.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=t.scrollPredominantAxis),typeof t.horizontal<"u"&&(this._options.horizontal=t.horizontal),typeof t.vertical<"u"&&(this._options.vertical=t.vertical),typeof t.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=t.horizontalScrollbarSize),typeof t.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=t.verticalScrollbarSize),typeof t.scrollByPage<"u"&&(this._options.scrollByPage=t.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(t){this._revealOnScroll=t}delegateScrollFromMouseWheelEvent(t){this._onMouseWheel(new eR(t))}_setListeningToMouseWheel(t){if(this._mouseWheelToDispose.length>0!==t&&(this._mouseWheelToDispose=Pl(this._mouseWheelToDispose),t)){let e=i=>{this._onMouseWheel(new eR(i))};this._mouseWheelToDispose.push(Be(this._listenOnDomNode,wi.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(t){var s;if((s=t.browserEvent)!=null&&s.defaultPrevented)return;let e=Jne.INSTANCE;e.acceptStandardWheelEvent(t);let i=!1;if(t.deltaY||t.deltaX){let r=t.deltaY*this._options.mouseWheelScrollSensitivity,o=t.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+r===0?o=r=0:Math.abs(r)>=Math.abs(o)?o=0:r=0),this._options.flipAxes&&([r,o]=[o,r]);let l=!Tr&&t.browserEvent&&t.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!o&&(o=r,r=0),t.browserEvent&&t.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);let c=this._scrollable.getFutureScrollPosition(),u={};if(r){let d=aR*r,p=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,p)}if(o){let d=aR*o,p=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,p)}u=this._scrollable.validateScrollPosition(u),(c.scrollLeft!==u.scrollLeft||c.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&e.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(t.preventDefault(),t.stopPropagation())}_onDidScroll(t){this._shouldRender=this._horizontalScrollbar.onDidScroll(t)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(t)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let t=this._scrollable.getCurrentScrollPosition(),e=t.scrollTop>0,i=t.scrollLeft>0,n=i?" left":"",s=e?" top":"",r=i||e?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${s}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(t){this._mouseIsOver=!1,this._hide()}_onMouseOver(t){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Gne)}},tse=class extends ese{constructor(e,i,n){super(e,i,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function ise(t){let e={lazyRender:typeof t.lazyRender<"u"?t.lazyRender:!1,className:typeof t.className<"u"?t.className:"",useShadows:typeof t.useShadows<"u"?t.useShadows:!0,handleMouseWheel:typeof t.handleMouseWheel<"u"?t.handleMouseWheel:!0,flipAxes:typeof t.flipAxes<"u"?t.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof t.consumeMouseWheelIfScrollbarIsNeeded<"u"?t.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof t.alwaysConsumeMouseWheel<"u"?t.alwaysConsumeMouseWheel:!1,scrollYToX:typeof t.scrollYToX<"u"?t.scrollYToX:!1,mouseWheelScrollSensitivity:typeof t.mouseWheelScrollSensitivity<"u"?t.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof t.fastScrollSensitivity<"u"?t.fastScrollSensitivity:5,scrollPredominantAxis:typeof t.scrollPredominantAxis<"u"?t.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof t.mouseWheelSmoothScroll<"u"?t.mouseWheelSmoothScroll:!0,arrowSize:typeof t.arrowSize<"u"?t.arrowSize:11,listenOnDomNode:typeof t.listenOnDomNode<"u"?t.listenOnDomNode:null,horizontal:typeof t.horizontal<"u"?t.horizontal:1,horizontalScrollbarSize:typeof t.horizontalScrollbarSize<"u"?t.horizontalScrollbarSize:10,horizontalSliderSize:typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:0,horizontalHasArrows:typeof t.horizontalHasArrows<"u"?t.horizontalHasArrows:!1,vertical:typeof t.vertical<"u"?t.vertical:1,verticalScrollbarSize:typeof t.verticalScrollbarSize<"u"?t.verticalScrollbarSize:10,verticalHasArrows:typeof t.verticalHasArrows<"u"?t.verticalHasArrows:!1,verticalSliderSize:typeof t.verticalSliderSize<"u"?t.verticalSliderSize:0,scrollByPage:typeof t.scrollByPage<"u"?t.scrollByPage:!1};return e.horizontalSliderSize=typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof t.verticalSliderSize<"u"?t.verticalSliderSize:e.verticalScrollbarSize,Tr&&(e.className+=" mac"),e}var hx=class extends Ue{constructor(e,i,n,s,r,o,l,c){super(),this._bufferService=n,this._optionsService=l,this._renderService=c,this._onRequestScrollLines=this._register(new me),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let u=this._register(new Xne({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>Dw(s.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{u.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new tse(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},u)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(r.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Gi.runAndSubscribe(o.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=o.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Bt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register(Bt(()=>this._styleElement.remove())),this._register(Gi.runAndSubscribe(o.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${o.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${o.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${o.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
113
- `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(d=>this._handleScroll(d)))}scrollLines(e){let i=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i){i&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let i=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=i-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=i,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};hx=Ut([be(2,yn),be(3,Co),be(4,EN),be(5,Ch),be(6,bn),be(7,ko)],hx);var ux=class extends Ue{constructor(e,i,n,s,r){super(),this._screenElement=e,this._bufferService=i,this._coreBrowserService=n,this._decorationService=s,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(o=>this._removeDecoration(o))),this._register(Bt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var s;let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",((s=e==null?void 0:e.options)==null?void 0:s.layer)==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){let i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${i*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,i=e.element){if(!i)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?i.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":i.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var i;(i=this._decorationElements.get(e))==null||i.remove(),this._decorationElements.delete(e),e.dispose()}};ux=Ut([be(1,yn),be(2,Co),be(3,xd),be(4,ko)],ux);var nse=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let i of this._zones)if(i.color===e.options.overviewRulerOptions.color&&i.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(i,e.marker.line))return;if(this._lineAdjacentToZone(i,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(i,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,i){return i>=e.startBufferLine&&i<=e.endBufferLine}_lineAdjacentToZone(e,i,n){return i>=e.startBufferLine-this._linePadding[n||"full"]&&i<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,i){e.startBufferLine=Math.min(e.startBufferLine,i),e.endBufferLine=Math.max(e.endBufferLine,i)}},lr={full:0,left:0,center:0,right:0},oa={full:0,left:0,center:0,right:0},Du={full:0,left:0,center:0,right:0},Gg=class extends Ue{constructor(e,i,n,s,r,o,l,c){var d;super(),this._viewportElement=e,this._screenElement=i,this._bufferService=n,this._decorationService=s,this._renderService=r,this._optionsService=o,this._themeService=l,this._coreBrowserService=c,this._colorZoneStore=new nse,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(d=this._viewportElement.parentElement)==null||d.insertBefore(this._canvas,this._viewportElement),this._register(Bt(()=>{var p;return(p=this._canvas)==null?void 0:p.remove()}));let u=this._canvas.getContext("2d");if(u)this._ctx=u;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),i=Math.ceil((this._canvas.width-1)/3);oa.full=this._canvas.width,oa.left=e,oa.center=i,oa.right=e,this._refreshDrawHeightConstants(),Du.full=1,Du.left=1,Du.center=1+oa.left,Du.right=1+oa.left+oa.center}_refreshDrawHeightConstants(){lr.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,i=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);lr.left=i,lr.center=i,lr.right=i}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*lr.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*lr.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*lr.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*lr.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let i of this._decorationService.decorations)this._colorZoneStore.addDecoration(i);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let i of e)i.position!=="full"&&this._renderColorZone(i);for(let i of e)i.position==="full"&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Du[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-lr[e.position||"full"]/2),oa[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+lr[e.position||"full"]))}_queueRefresh(e,i){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=i||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Gg=Ut([be(2,yn),be(3,xd),be(4,ko),be(5,bn),be(6,Ch),be(7,Co)],Gg);var ce;(t=>(t.NUL="\0",t.SOH="",t.STX="",t.ETX="",t.EOT="",t.ENQ="",t.ACK="",t.BEL="\x07",t.BS="\b",t.HT=" ",t.LF=`
114
- `,t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="\x1B",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""))(ce||(ce={}));var tg;(t=>(t.PAD="€",t.HOP="",t.BPH="‚",t.NBH="ƒ",t.IND="„",t.NEL="…",t.SSA="†",t.ESA="‡",t.HTS="ˆ",t.HTJ="‰",t.VTS="Š",t.PLD="‹",t.PLU="Œ",t.RI="",t.SS2="Ž",t.SS3="",t.DCS="",t.PU1="‘",t.PU2="’",t.STS="“",t.CCH="”",t.MW="•",t.SPA="–",t.EPA="—",t.SOS="˜",t.SGCI="™",t.SCI="š",t.CSI="›",t.ST="œ",t.OSC="",t.PM="ž",t.APC="Ÿ"))(tg||(tg={}));var FN;(t=>t.ST=`${ce.ESC}\\`)(FN||(FN={}));var fx=class{constructor(e,i,n,s,r,o){this._textarea=e,this._compositionView=i,this._bufferService=n,this._optionsService=s,this._coreService=r,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;i.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(i.start,this._compositionPosition.start):n=this._textarea.value.substring(i.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let i=this._textarea.value,n=i.replace(e,"");this._dataAlreadySent=n,i.length>e.length?this._coreService.triggerDataEvent(n,!0):i.length<e.length?this._coreService.triggerDataEvent(`${ce.DEL}`,!0):i.length===e.length&&i!==e&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let o=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};fx=Ut([be(2,yn),be(3,bn),be(4,$l),be(5,ko)],fx);var Ci=0,ki=0,Ti=0,Zt=0,lR={css:"#00000000",rgba:0},ci;(t=>{function e(s,r,o,l){return l!==void 0?`#${nl(s)}${nl(r)}${nl(o)}${nl(l)}`:`#${nl(s)}${nl(r)}${nl(o)}`}t.toCss=e;function i(s,r,o,l=255){return(s<<24|r<<16|o<<8|l)>>>0}t.toRgba=i;function n(s,r,o,l){return{css:t.toCss(s,r,o,l),rgba:t.toRgba(s,r,o,l)}}t.toColor=n})(ci||(ci={}));var Pt;(t=>{function e(c,u){if(Zt=(u.rgba&255)/255,Zt===1)return{css:u.css,rgba:u.rgba};let d=u.rgba>>24&255,p=u.rgba>>16&255,g=u.rgba>>8&255,O=c.rgba>>24&255,_=c.rgba>>16&255,b=c.rgba>>8&255;Ci=O+Math.round((d-O)*Zt),ki=_+Math.round((p-_)*Zt),Ti=b+Math.round((g-b)*Zt);let S=ci.toCss(Ci,ki,Ti),w=ci.toRgba(Ci,ki,Ti);return{css:S,rgba:w}}t.blend=e;function i(c){return(c.rgba&255)===255}t.isOpaque=i;function n(c,u,d){let p=ig.ensureContrastRatio(c.rgba,u.rgba,d);if(p)return ci.toColor(p>>24&255,p>>16&255,p>>8&255)}t.ensureContrastRatio=n;function s(c){let u=(c.rgba|255)>>>0;return[Ci,ki,Ti]=ig.toChannels(u),{css:ci.toCss(Ci,ki,Ti),rgba:u}}t.opaque=s;function r(c,u){return Zt=Math.round(u*255),[Ci,ki,Ti]=ig.toChannels(c.rgba),{css:ci.toCss(Ci,ki,Ti,Zt),rgba:ci.toRgba(Ci,ki,Ti,Zt)}}t.opacity=r;function o(c,u){return Zt=c.rgba&255,r(c,Zt*u/255)}t.multiplyOpacity=o;function l(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}t.toColorRGB=l})(Pt||(Pt={}));var Nt;(t=>{let e,i;try{let s=document.createElement("canvas");s.width=1,s.height=1;let r=s.getContext("2d",{willReadFrequently:!0});r&&(e=r,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return Ci=parseInt(s.slice(1,2).repeat(2),16),ki=parseInt(s.slice(2,3).repeat(2),16),Ti=parseInt(s.slice(3,4).repeat(2),16),ci.toColor(Ci,ki,Ti);case 5:return Ci=parseInt(s.slice(1,2).repeat(2),16),ki=parseInt(s.slice(2,3).repeat(2),16),Ti=parseInt(s.slice(3,4).repeat(2),16),Zt=parseInt(s.slice(4,5).repeat(2),16),ci.toColor(Ci,ki,Ti,Zt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let r=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return Ci=parseInt(r[1]),ki=parseInt(r[2]),Ti=parseInt(r[3]),Zt=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),ci.toColor(Ci,ki,Ti,Zt);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=s,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Ci,ki,Ti,Zt]=e.getImageData(0,0,1,1).data,Zt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:ci.toRgba(Ci,ki,Ti,Zt),css:s}}t.toColor=n})(Nt||(Nt={}));var fn;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,s,r){let o=n/255,l=s/255,c=r/255,u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return u*.2126+d*.7152+p*.0722}t.relativeLuminance2=i})(fn||(fn={}));var ig;(t=>{function e(o,l){if(Zt=(l&255)/255,Zt===1)return l;let c=l>>24&255,u=l>>16&255,d=l>>8&255,p=o>>24&255,g=o>>16&255,O=o>>8&255;return Ci=p+Math.round((c-p)*Zt),ki=g+Math.round((u-g)*Zt),Ti=O+Math.round((d-O)*Zt),ci.toRgba(Ci,ki,Ti)}t.blend=e;function i(o,l,c){let u=fn.relativeLuminance(o>>8),d=fn.relativeLuminance(l>>8);if(so(u,d)<c){if(d<u){let O=n(o,l,c),_=so(u,fn.relativeLuminance(O>>8));if(_<c){let b=s(o,l,c),S=so(u,fn.relativeLuminance(b>>8));return _>S?O:b}return O}let p=s(o,l,c),g=so(u,fn.relativeLuminance(p>>8));if(g<c){let O=n(o,l,c),_=so(u,fn.relativeLuminance(O>>8));return g>_?p:O}return p}}t.ensureContrastRatio=i;function n(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=so(fn.relativeLuminance2(g,O,_),fn.relativeLuminance2(u,d,p));for(;b<c&&(g>0||O>0||_>0);)g-=Math.max(0,Math.ceil(g*.1)),O-=Math.max(0,Math.ceil(O*.1)),_-=Math.max(0,Math.ceil(_*.1)),b=so(fn.relativeLuminance2(g,O,_),fn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.reduceLuminance=n;function s(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=so(fn.relativeLuminance2(g,O,_),fn.relativeLuminance2(u,d,p));for(;b<c&&(g<255||O<255||_<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),O=Math.min(255,O+Math.ceil((255-O)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),b=so(fn.relativeLuminance2(g,O,_),fn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.increaseLuminance=s;function r(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=r})(ig||(ig={}));function nl(t){let e=t.toString(16);return e.length<2?"0"+e:e}function so(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}var sse=class extends bd{constructor(e,i,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Kg=class{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Rs}register(t){let e={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(e),e.id}deregister(t){for(let e=0;e<this._characterJoiners.length;e++)if(this._characterJoiners[e].id===t)return this._characterJoiners.splice(e,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];let e=this._bufferService.buffer.lines.get(t);if(!e||e.length===0)return[];let i=[],n=e.translateToString(!0),s=0,r=0,o=0,l=e.getFg(0),c=e.getBg(0);for(let u=0;u<e.getTrimmedLength();u++)if(e.loadCell(u,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==l||this._workCell.bg!==c){if(u-s>1){let d=this._getJoinedRanges(n,o,r,e,s);for(let p=0;p<d.length;p++)i.push(d[p])}s=u,o=r,l=this._workCell.fg,c=this._workCell.bg}r+=this._workCell.getChars().length||ya.length}if(this._bufferService.cols-s>1){let u=this._getJoinedRanges(n,o,r,e,s);for(let d=0;d<u.length;d++)i.push(u[d])}return i}_getJoinedRanges(t,e,i,n,s){let r=t.substring(e,i),o=[];try{o=this._characterJoiners[0].handler(r)}catch(l){console.error(l)}for(let l=1;l<this._characterJoiners.length;l++)try{let c=this._characterJoiners[l].handler(r);for(let u=0;u<c.length;u++)Kg._mergeRanges(o,c[u])}catch(c){console.error(c)}return this._stringRangesToCellRanges(o,n,s),o}_stringRangesToCellRanges(t,e,i){let n=0,s=!1,r=0,o=t[n];if(o){for(let l=i;l<this._bufferService.cols;l++){let c=e.getWidth(l),u=e.getString(l).length||ya.length;if(c!==0){if(!s&&o[0]<=r&&(o[0]=l,s=!0),o[1]<=r){if(o[1]=l,o=t[++n],!o)break;o[0]<=r?(o[0]=l,s=!0):s=!1}r+=u}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(t,e){let i=!1;for(let n=0;n<t.length;n++){let s=t[n];if(i){if(e[1]<=s[0])return t[n-1][1]=e[1],t;if(e[1]<=s[1])return t[n-1][1]=Math.max(e[1],s[1]),t.splice(n,1),t;t.splice(n,1),n--}else{if(e[1]<=s[0])return t.splice(n,0,e),t;if(e[1]<=s[1])return s[0]=Math.min(e[0],s[0]),t;e[0]<s[1]&&(s[0]=Math.min(e[0],s[0]),i=!0);continue}}return i?t[t.length-1][1]=e[1]:t.push(e),t}};Kg=Ut([be(0,yn)],Kg);function rse(t){return 57508<=t&&t<=57558}function ose(t){return 9472<=t&&t<=9631}function ase(t){return rse(t)||ose(t)}function lse(){return{css:{canvas:Sm(),cell:Sm()},device:{canvas:Sm(),cell:Sm(),char:{width:0,height:0,left:0,top:0}}}}function Sm(){return{width:0,height:0}}var dx=class{constructor(e,i,n,s,r,o,l){this._document=e,this._characterJoinerService=i,this._optionsService=n,this._coreBrowserService=s,this._coreService=r,this._decorationService=o,this._themeService=l,this._workCell=new Rs,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,i,n){this._selectionStart=e,this._selectionEnd=i,this._columnSelectMode=n}createRow(e,i,n,s,r,o,l,c,u,d,p){let g=[],O=this._characterJoinerService.getJoinedCharacters(i),_=this._themeService.colors,b=e.getNoBgTrimmedLength();n&&b<o+1&&(b=o+1);let S,w=0,T="",k=0,A=0,R=0,E=0,$=!1,N=0,q=!1,G=0,U=0,Q=[],D=d!==-1&&p!==-1;for(let z=0;z<b;z++){e.loadCell(z,this._workCell);let j=this._workCell.getWidth();if(j===0)continue;let B=!1,Z=z>=U,H=z,F=this._workCell;if(O.length>0&&z===O[0][0]&&Z){let Le=O.shift(),as=this._isCellInSelection(Le[0],i);for(k=Le[0]+1;k<Le[1];k++)Z&&(Z=as===this._isCellInSelection(k,i));Z&&(Z=!n||o<Le[0]||o>=Le[1]),Z?(B=!0,F=new sse(this._workCell,e.translateToString(!0,Le[0],Le[1]),Le[1]-Le[0]),H=Le[1]-1,j=F.getWidth()):U=Le[1]}let M=this._isCellInSelection(z,i),V=n&&z===o,J=D&&z>=d&&z<=p,L=!1;this._decorationService.forEachDecorationAtCell(z,i,void 0,Le=>{L=!0});let ue=F.getChars()||ya;if(ue===" "&&(F.isUnderline()||F.isOverline())&&(ue=" "),G=j*c-u.get(ue,F.isBold(),F.isItalic()),!S)S=this._document.createElement("span");else if(w&&(M&&q||!M&&!q&&F.bg===A)&&(M&&q&&_.selectionForeground||F.fg===R)&&F.extended.ext===E&&J===$&&G===N&&!V&&!B&&!L&&Z){F.isInvisible()?T+=ya:T+=ue,w++;continue}else w&&(S.textContent=T),S=this._document.createElement("span"),w=0,T="";if(A=F.bg,R=F.fg,E=F.extended.ext,$=J,N=G,q=M,B&&o>=z&&o<=H&&(o=z),!this._coreService.isCursorHidden&&V&&this._coreService.isCursorInitialized){if(Q.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&Q.push("xterm-cursor-blink"),Q.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(r)switch(r){case"outline":Q.push("xterm-cursor-outline");break;case"block":Q.push("xterm-cursor-block");break;case"bar":Q.push("xterm-cursor-bar");break;case"underline":Q.push("xterm-cursor-underline");break}}if(F.isBold()&&Q.push("xterm-bold"),F.isItalic()&&Q.push("xterm-italic"),F.isDim()&&Q.push("xterm-dim"),F.isInvisible()?T=ya:T=F.getChars()||ya,F.isUnderline()&&(Q.push(`xterm-underline-${F.extended.underlineStyle}`),T===" "&&(T=" "),!F.isUnderlineColorDefault()))if(F.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${bd.toColorRGB(F.getUnderlineColor()).join(",")})`;else{let Le=F.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&F.isBold()&&Le<8&&(Le+=8),S.style.textDecorationColor=_.ansi[Le].css}F.isOverline()&&(Q.push("xterm-overline"),T===" "&&(T=" ")),F.isStrikethrough()&&Q.push("xterm-strikethrough"),J&&(S.style.textDecoration="underline");let he=F.getFgColor(),fe=F.getFgColorMode(),Oe=F.getBgColor(),Ce=F.getBgColorMode(),ye=!!F.isInverse();if(ye){let Le=he;he=Oe,Oe=Le;let as=fe;fe=Ce,Ce=as}let nt,Qt,Yt=!1;this._decorationService.forEachDecorationAtCell(z,i,void 0,Le=>{Le.options.layer!=="top"&&Yt||(Le.backgroundColorRGB&&(Ce=50331648,Oe=Le.backgroundColorRGB.rgba>>8&16777215,nt=Le.backgroundColorRGB),Le.foregroundColorRGB&&(fe=50331648,he=Le.foregroundColorRGB.rgba>>8&16777215,Qt=Le.foregroundColorRGB),Yt=Le.options.layer==="top")}),!Yt&&M&&(nt=this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque,Oe=nt.rgba>>8&16777215,Ce=50331648,Yt=!0,_.selectionForeground&&(fe=50331648,he=_.selectionForeground.rgba>>8&16777215,Qt=_.selectionForeground)),Yt&&Q.push("xterm-decoration-top");let ei;switch(Ce){case 16777216:case 33554432:ei=_.ansi[Oe],Q.push(`xterm-bg-${Oe}`);break;case 50331648:ei=ci.toColor(Oe>>16,Oe>>8&255,Oe&255),this._addStyle(S,`background-color:#${cR((Oe>>>0).toString(16),"0",6)}`);break;case 0:default:ye?(ei=_.foreground,Q.push("xterm-bg-257")):ei=_.background}switch(nt||F.isDim()&&(nt=Pt.multiplyOpacity(ei,.5)),fe){case 16777216:case 33554432:F.isBold()&&he<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(he+=8),this._applyMinimumContrast(S,ei,_.ansi[he],F,nt,void 0)||Q.push(`xterm-fg-${he}`);break;case 50331648:let Le=ci.toColor(he>>16&255,he>>8&255,he&255);this._applyMinimumContrast(S,ei,Le,F,nt,Qt)||this._addStyle(S,`color:#${cR(he.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(S,ei,_.foreground,F,nt,Qt)||ye&&Q.push("xterm-fg-257")}Q.length&&(S.className=Q.join(" "),Q.length=0),!V&&!B&&!L&&Z?w++:S.textContent=T,G!==this.defaultSpacing&&(S.style.letterSpacing=`${G}px`),g.push(S),z=H}return S&&w&&(S.textContent=T),g}_applyMinimumContrast(e,i,n,s,r,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||ase(s.getCode()))return!1;let l=this._getContrastCache(s),c;if(!r&&!o&&(c=l.getColor(i.rgba,n.rgba)),c===void 0){let u=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);c=Pt.ensureContrastRatio(r||i,o||n,u),l.setColor((r||i).rgba,(o||n).rgba,c??null)}return c?(this._addStyle(e,`color:${c.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,i){e.setAttribute("style",`${e.getAttribute("style")||""}${i};`)}_isCellInSelection(e,i){let n=this._selectionStart,s=this._selectionEnd;return!n||!s?!1:this._columnSelectMode?n[0]<=s[0]?e>=n[0]&&i>=n[1]&&e<s[0]&&i<=s[1]:e<n[0]&&i>=n[1]&&e>=s[0]&&i<=s[1]:i>n[1]&&i<s[1]||n[1]===s[1]&&i===n[1]&&e>=n[0]&&e<s[0]||n[1]<s[1]&&i===s[1]&&e<s[0]||n[1]<s[1]&&i===n[1]&&e>=n[0]}};dx=Ut([be(1,RN),be(2,bn),be(3,Co),be(4,$l),be(5,xd),be(6,Ch)],dx);function cR(t,e,i){for(;t.length<i;)t=e+t;return t}var cse=class{constructor(e,i){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontStyle="italic";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold",o.style.fontStyle="italic",this._measureElements=[n,s,r,o],this._container.appendChild(n),this._container.appendChild(s),this._container.appendChild(r),this._container.appendChild(o),i.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,i,n,s){e===this._font&&i===this._fontSize&&n===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=i,this._weight=n,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,i,n){let s=0;if(!i&&!n&&e.length===1&&(s=e.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];let l=this._measure(e,0);return l>0&&(this._flat[s]=l),l}let r=e;i&&(r+="B"),n&&(r+="I");let o=this._holey.get(r);if(o===void 0){let l=0;i&&(l|=1),n&&(l|=2),o=this._measure(e,l),o>0&&this._holey.set(r,o)}return o}_measure(e,i){let n=this._measureElements[i];return n.textContent=e.repeat(32),n.offsetWidth/32}},hse=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,i,n,s=!1){if(this.selectionStart=i,this.selectionEnd=n,!i||!n||i[0]===n[0]&&i[1]===n[1]){this.clear();return}let r=e.buffers.active.ydisp,o=i[1]-r,l=n[1]-r,c=Math.max(o,0),u=Math.min(l,e.rows-1);if(c>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=o,this.viewportEndRow=l,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=i[0],this.endCol=n[0]}isCellSelected(e,i,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&n>=this.viewportCappedStartRow&&i<this.endCol&&n<=this.viewportCappedEndRow:i<this.startCol&&n>=this.viewportCappedStartRow&&i>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol):!1}};function use(){return new hse}var $y="xterm-dom-renderer-owner-",vs="xterm-rows",wm="xterm-fg-",hR="xterm-bg-",Bu="xterm-focus",Cm="xterm-selection",fse=1,px=class extends Ue{constructor(e,i,n,s,r,o,l,c,u,d,p,g,O,_){super(),this._terminal=e,this._document=i,this._element=n,this._screenElement=s,this._viewportElement=r,this._helperContainer=o,this._linkifier2=l,this._charSizeService=u,this._optionsService=d,this._bufferService=p,this._coreService=g,this._coreBrowserService=O,this._themeService=_,this._terminalClass=fse++,this._rowElements=[],this._selectionRenderModel=use(),this.onRequestRedraw=this._register(new me).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(vs),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(Cm),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=lse(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(b=>this._injectCss(b))),this._injectCss(this._themeService.colors),this._rowFactory=c.createInstance(dx,document),this._element.classList.add($y+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(b=>this._handleLinkHover(b))),this._register(this._linkifier2.onHideLinkUnderline(b=>this._handleLinkLeave(b))),this._register(Bt(()=>{this._element.classList.remove($y+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new cse(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i=`${this._terminalSelector} .${vs} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=i,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .${vs} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;i+=`${this._terminalSelector} .${vs} .xterm-dim { color: ${Pt.multiplyOpacity(e.foreground,.5).css};}`,i+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,r=`blink_block_${this._terminalClass}`;i+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,i+=`@keyframes ${s} { 50% { box-shadow: none; }}`,i+=`@keyframes ${r} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,i+=`${this._terminalSelector} .${vs}.${Bu} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${vs}.${Bu} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${vs}.${Bu} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${vs} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${vs} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${vs} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${vs} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${vs} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${Cm} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Cm} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Cm} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,l]of e.ansi.entries())i+=`${this._terminalSelector} .${wm}${o} { color: ${l.css}; }${this._terminalSelector} .${wm}${o}.xterm-dim { color: ${Pt.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${hR}${o} { background-color: ${l.css}; }`;i+=`${this._terminalSelector} .${wm}257 { color: ${Pt.opaque(e.background).css}; }${this._terminalSelector} .${wm}257.xterm-dim { color: ${Pt.multiplyOpacity(Pt.opaque(e.background),.5).css}; }${this._terminalSelector} .${hR}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=i}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,i){for(let n=this._rowElements.length;n<=i;n++){let s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,i){this._refreshRowElements(e,i),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Bu),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Bu),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i,n),this.renderRows(0,this._bufferService.rows-1),!e||!i||(this._selectionRenderModel.update(this._terminal,e,i,n),!this._selectionRenderModel.hasSelection))return;let s=this._selectionRenderModel.viewportStartRow,r=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,c=this._document.createDocumentFragment();if(n){let u=e[0]>i[0];c.appendChild(this._createSelectionElement(o,u?i[0]:e[0],u?e[0]:i[0],l-o+1))}else{let u=s===o?e[0]:0,d=o===r?i[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(o,u,d));let p=l-o-1;if(c.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,p)),o!==l){let g=r===l?i[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(l,0,g))}}this._selectionContainer.appendChild(c)}_createSelectionElement(e,i,n,s=1){let r=this._document.createElement("div"),o=i*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(n-i);return o+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-o),r.style.height=`${s*this.dimensions.css.cell.height}px`,r.style.top=`${e*this.dimensions.css.cell.height}px`,r.style.left=`${o}px`,r.style.width=`${l}px`,r}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,i){let n=this._bufferService.buffer,s=n.ybase+n.y,r=Math.min(n.x,this._bufferService.cols-1),o=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,c=this._optionsService.rawOptions.cursorInactiveStyle;for(let u=e;u<=i;u++){let d=u+n.ydisp,p=this._rowElements[u],g=n.lines.get(d);if(!p||!g)break;p.replaceChildren(...this._rowFactory.createRow(g,d,d===s,l,c,r,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${$y}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,i,n,s,r,o){n<0&&(e=0),s<0&&(i=0);let l=this._bufferService.rows-1;n=Math.max(Math.min(n,l),0),s=Math.max(Math.min(s,l),0),r=Math.min(r,this._bufferService.cols);let c=this._bufferService.buffer,u=c.ybase+c.y,d=Math.min(c.x,r-1),p=this._optionsService.rawOptions.cursorBlink,g=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let _=n;_<=s;++_){let b=_+c.ydisp,S=this._rowElements[_],w=c.lines.get(b);if(!S||!w)break;S.replaceChildren(...this._rowFactory.createRow(w,b,b===u,g,O,d,p,this.dimensions.css.cell.width,this._widthCache,o?_===n?e:0:-1,o?(_===s?i:r)-1:-1))}}};px=Ut([be(7,Ew),be(8,kO),be(9,bn),be(10,yn),be(11,$l),be(12,Co),be(13,Ch)],px);var mx=class extends Ue{constructor(e,i,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new me),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new pse(this._optionsService))}catch{this._measureStrategy=this._register(new dse(e,i,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};mx=Ut([be(2,bn)],mx);var GN=class extends Ue{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,e){t!==void 0&&t>0&&e!==void 0&&e>0&&(this._result.width=t,this._result.height=e)}},dse=class extends GN{constructor(t,e,i){super(),this._document=t,this._parentElement=e,this._optionsService=i,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},pse=class extends GN{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let i=this._ctx.measureText("W");if(!("width"in i&&"fontBoundingBoxAscent"in i&&"fontBoundingBoxDescent"in i))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},mse=class extends Ue{constructor(e,i,n){super(),this._textarea=e,this._window=i,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new gse(this._window)),this._onDprChange=this._register(new me),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new me),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(Gi.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Be(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Be(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},gse=class extends Ue{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new mh),this._onDprChange=this._register(new me),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Bt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Be(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},Ose=class extends Ue{constructor(){super(),this.linkProviders=[],this._register(Bt(()=>this.linkProviders.length=0))}registerLinkProvider(t){return this.linkProviders.push(t),{dispose:()=>{let e=this.linkProviders.indexOf(t);e!==-1&&this.linkProviders.splice(e,1)}}}};function $w(t,e,i){let n=i.getBoundingClientRect(),s=t.getComputedStyle(i),r=parseInt(s.getPropertyValue("padding-left")),o=parseInt(s.getPropertyValue("padding-top"));return[e.clientX-n.left-r,e.clientY-n.top-o]}function vse(t,e,i,n,s,r,o,l,c){if(!r)return;let u=$w(t,e,i);if(u)return u[0]=Math.ceil((u[0]+(c?o/2:0))/o),u[1]=Math.ceil(u[1]/l),u[0]=Math.min(Math.max(u[0],1),n+(c?1:0)),u[1]=Math.min(Math.max(u[1],1),s),u}var gx=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,n,s,r){return vse(window,e,i,n,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(e,i){let n=$w(window,e,i);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};gx=Ut([be(0,ko),be(1,kO)],gx);var _se=class{constructor(e,i){this._renderCallback=e,this._coreBrowserService=i,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},KN={};Eie(KN,{getSafariVersion:()=>bse,isChromeOS:()=>i6,isFirefox:()=>JN,isIpad:()=>xse,isIphone:()=>Sse,isLegacyEdge:()=>yse,isLinux:()=>Nw,isMac:()=>Jg,isNode:()=>TO,isSafari:()=>e6,isWindows:()=>t6});var TO=typeof process<"u"&&"title"in process,Sd=TO?"node":navigator.userAgent,wd=TO?"node":navigator.platform,JN=Sd.includes("Firefox"),yse=Sd.includes("Edge"),e6=/^((?!chrome|android).)*safari/i.test(Sd);function bse(){if(!e6)return 0;let t=Sd.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}var Jg=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(wd),xse=wd==="iPad",Sse=wd==="iPhone",t6=["Windows","Win16","Win32","WinCE"].includes(wd),Nw=wd.indexOf("Linux")>=0,i6=/\bCrOS\b/.test(Sd),n6=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(t){this._idleCallback=void 0;let e=0,i=0,n=t.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(e=performance.now(),this._tasks[this._i]()||this._i++,e=Math.max(1,performance.now()-e),i=Math.max(e,i),s=t.timeRemaining(),i*1.5>s){n-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-e))}ms`),this._start();return}n=s}this.clear()}},wse=class extends n6{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let i=performance.now()+e;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},Cse=class extends n6{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},eO=!TO&&"requestIdleCallback"in window?Cse:wse,kse=class{constructor(){this._queue=new eO}set(t){this._queue.clear(),this._queue.enqueue(t)}flush(){this._queue.flush()}},Ox=class extends Ue{constructor(e,i,n,s,r,o,l,c,u){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=s,this._coreService=r,this._coreBrowserService=c,this._renderer=this._register(new mh),this._pausedResizeTask=new kse,this._observerDisposable=this._register(new mh),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new me),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new me),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new me),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new me),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new _se((d,p)=>this._renderRows(d,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new Tse(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Bt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.buffers.onBufferActivate(()=>{var d;return(d=this._renderer.value)==null?void 0:d.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(o.onDecorationRegistered(()=>this._fullRefresh())),this._register(o.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(l.cols,l.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(l.buffer.y,l.buffer.y,!0))),this._register(u.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,i),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,i)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});n.observe(i),this._observerDisposable.value=Bt(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,i,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}let s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),i=Math.max(i,s.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount)}_renderRows(e,i){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0}}resize(e,i){this._rowCount=i,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(i=>this.refreshRows(i.start,i.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,i;this._renderer.value&&((i=(e=this._renderer.value).clearTextureAtlas)==null||i.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,i)}):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,i,n){var s;this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=n,(s=this._renderer.value)==null||s.handleSelectionChanged(e,i,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Ox=Ut([be(2,bn),be(3,kO),be(4,$l),be(5,xd),be(6,yn),be(7,Co),be(8,Ch)],Ox);var Tse=class{constructor(t,e,i){this._coreBrowserService=t,this._coreService=e,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(t,e){this._isBuffering?(this._start=Math.min(this._start,t),this._end=Math.max(this._end,e)):(this._start=t,this._end=e,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let t={start:this._start,end:this._end};return this._isBuffering=!1,t}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function Ase(t,e,i,n){let s=i.buffer.x,r=i.buffer.y;if(!i.buffer.hasScrollback)return Pse(s,r,t,e,i,n)+AO(r,e,i,n)+Rse(s,r,t,e,i,n);let o;if(r===e)return o=s>t?"D":"C",id(Math.abs(s-t),td(o,n));o=r>e?"D":"C";let l=Math.abs(r-e),c=Mse(r>e?t:s,i)+(l-1)*i.cols+1+Ese(r>e?s:t);return id(c,td(o,n))}function Ese(t,e){return t-1}function Mse(t,e){return e.cols-t}function Pse(t,e,i,n,s,r){return AO(e,n,s,r).length===0?"":id(r6(t,e,t,e-Rl(e,s),!1,s).length,td("D",r))}function AO(t,e,i,n){let s=t-Rl(t,i),r=e-Rl(e,i),o=Math.abs(s-r)-Qse(t,e,i);return id(o,td(s6(t,e),n))}function Rse(t,e,i,n,s,r){let o;AO(e,n,s,r).length>0?o=n-Rl(n,s):o=e;let l=n,c=Lse(t,e,i,n,s,r);return id(r6(t,o,i,l,c==="C",s).length,td(c,r))}function Qse(t,e,i){var o;let n=0,s=t-Rl(t,i),r=e-Rl(e,i);for(let l=0;l<Math.abs(s-r);l++){let c=s6(t,e)==="A"?-1:1;(o=i.buffer.lines.get(s+c*l))!=null&&o.isWrapped&&n++}return n}function Rl(t,e){let i=0,n=e.buffer.lines.get(t),s=n==null?void 0:n.isWrapped;for(;s&&t>=0&&t<e.rows;)i++,n=e.buffer.lines.get(--t),s=n==null?void 0:n.isWrapped;return i}function Lse(t,e,i,n,s,r){let o;return AO(i,n,s,r).length>0?o=n-Rl(n,s):o=e,t<i&&o<=n||t>=i&&o<n?"C":"D"}function s6(t,e){return t>e?"A":"B"}function r6(t,e,i,n,s,r){let o=t,l=e,c="";for(;(o!==i||l!==n)&&l>=0&&l<r.buffer.lines.length;)o+=s?1:-1,s&&o>r.cols-1?(c+=r.buffer.translateBufferLineToString(l,!1,t,o),o=0,t=0,l++):!s&&o<0&&(c+=r.buffer.translateBufferLineToString(l,!1,0,t+1),o=r.cols-1,t=o,l--);return c+r.buffer.translateBufferLineToString(l,!1,t,o)}function td(t,e){let i=e?"O":"[";return ce.ESC+i+t}function id(t,e){t=Math.floor(t);let i="";for(let n=0;n<t;n++)i+=e;return i}var Dse=class{constructor(t){this._bufferService=t,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?t%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let t=this.selectionStart,e=this.selectionEnd;return!t||!e?!1:t[1]>e[1]||t[1]===e[1]&&t[0]>e[0]}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function uR(t,e){if(t.start.y>t.end.y)throw new Error(`Buffer range end (${t.end.x}, ${t.end.y}) cannot be before start (${t.start.x}, ${t.start.y})`);return e*(t.end.y-t.start.y)+(t.end.x-t.start.x+1)}var Ny=50,Bse=15,$se=50,Nse=500,zse=" ",jse=new RegExp(zse,"g"),vx=class extends Ue{constructor(e,i,n,s,r,o,l,c,u){super(),this._element=e,this._screenElement=i,this._linkifier=n,this._bufferService=s,this._coreService=r,this._mouseService=o,this._optionsService=l,this._renderService=c,this._coreBrowserService=u,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Rs,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new me),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new me),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new me),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new me),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new Dse(this._bufferService),this._activeSelectionMode=0,this._register(Bt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!e||!i?!1:e[0]!==i[0]||e[1]!==i[1]}get selectionText(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;if(!e||!i)return"";let n=this._bufferService.buffer,s=[];if(this._activeSelectionMode===3){if(e[0]===i[0])return"";let r=e[0]<i[0]?e[0]:i[0],o=e[0]<i[0]?i[0]:e[0];for(let l=e[1];l<=i[1];l++){let c=n.translateBufferLineToString(l,!0,r,o);s.push(c)}}else{let r=e[1]===i[1]?i[0]:void 0;s.push(n.translateBufferLineToString(e[1],!0,e[0],r));for(let o=e[1]+1;o<=i[1]-1;o++){let l=n.lines.get(o),c=n.translateBufferLineToString(o,!0);l!=null&&l.isWrapped?s[s.length-1]+=c:s.push(c)}if(e[1]!==i[1]){let o=n.lines.get(i[1]),l=n.translateBufferLineToString(i[1],!0,0,i[0]);o&&o.isWrapped?s[s.length-1]+=l:s.push(l)}}return s.map(r=>r.replace(jse," ")).join(t6?`\r
115
- `:`
116
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Nw&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let i=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!n||!s||!i?!1:this._areCoordsInSelection(i,n,s)}isCellInSelection(e,i){let n=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!n||!s?!1:this._areCoordsInSelection([e,i],n,s)}_areCoordsInSelection(e,i,n){return e[1]>i[1]&&e[1]<n[1]||i[1]===n[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<n[0]||i[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||i[1]<n[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){var r,o;let n=(o=(r=this._linkifier.currentLink)==null?void 0:r.link)==null?void 0:o.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=uR(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,i),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=$w(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=n?0:(i>n&&(i-=n),i=Math.min(Math.max(i,-Ny),Ny),i/=Ny,i/Math.abs(i)+Math.round(i*(Bse-1)))}shouldForceSelection(e){return Jg?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),$se)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&i.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(Jg&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let s=n.lines.get(this._model.selectionEnd[1]);s&&s.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!i||i[0]!==this._model.selectionEnd[0]||i[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&i<Nse&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let s=Ase(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(s,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd,n=!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,i,n);return}!e||!i||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||i[0]!==this._oldSelectionEnd[0]||i[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,i,n)}_fireOnSelectionChange(e,i,n){this._oldSelectionStart=e,this._oldSelectionEnd=i,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(i=>this._handleTrim(i))}_convertViewportColToCharacterIndex(e,i){let n=i;for(let s=0;i>=s;s++){let r=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:r>1&&i!==s&&(n+=r-1)}return n}setSelection(e,i,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,n=!0,s=!0){if(e[0]>=this._bufferService.cols)return;let r=this._bufferService.buffer,o=r.lines.get(e[1]);if(!o)return;let l=r.translateBufferLineToString(e[1],!1),c=this._convertViewportColToCharacterIndex(o,e[0]),u=c,d=e[0]-c,p=0,g=0,O=0,_=0;if(l.charAt(c)===" "){for(;c>0&&l.charAt(c-1)===" ";)c--;for(;u<l.length&&l.charAt(u+1)===" ";)u++}else{let w=e[0],T=e[0];o.getWidth(w)===0&&(p++,w--),o.getWidth(T)===2&&(g++,T++);let k=o.getString(T).length;for(k>1&&(_+=k-1,u+=k-1);w>0&&c>0&&!this._isCharWordSeparator(o.loadCell(w-1,this._workCell));){o.loadCell(w-1,this._workCell);let A=this._workCell.getChars().length;this._workCell.getWidth()===0?(p++,w--):A>1&&(O+=A-1,c-=A-1),c--,w--}for(;T<o.length&&u+1<l.length&&!this._isCharWordSeparator(o.loadCell(T+1,this._workCell));){o.loadCell(T+1,this._workCell);let A=this._workCell.getChars().length;this._workCell.getWidth()===2?(g++,T++):A>1&&(_+=A-1,u+=A-1),u++,T++}}u++;let b=c+d-p+O,S=Math.min(this._bufferService.cols,u-c+p+g-O-_);if(!(!i&&l.slice(c,u).trim()==="")){if(n&&b===0&&o.getCodePoint(0)!==32){let w=r.lines.get(e[1]-1);if(w&&o.isWrapped&&w.getCodePoint(this._bufferService.cols-1)!==32){let T=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(T){let k=this._bufferService.cols-T.start;b-=k,S+=k}}}if(s&&b+S===this._bufferService.cols&&o.getCodePoint(this._bufferService.cols-1)!==32){let w=r.lines.get(e[1]+1);if(w!=null&&w.isWrapped&&w.getCodePoint(0)!==32){let T=this._getWordAt([0,e[1]+1],!1,!1,!0);T&&(S+=T.length)}}return{start:b,length:S}}}_selectWordAt(e,i){let n=this._getWordAt(e,i);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let n=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=uR(n,this._bufferService.cols)}};vx=Ut([be(3,yn),be(4,$l),be(5,Mw),be(6,bn),be(7,ko),be(8,Co)],vx);var fR=class{constructor(){this._data={}}set(e,i,n){this._data[e]||(this._data[e]={}),this._data[e][i]=n}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},dR=class{constructor(){this._color=new fR,this._css=new fR}setCss(e,i,n){this._css.set(e,i,n)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,n){this._color.set(e,i,n)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},mi=Object.freeze((()=>{let t=[Nt.toColor("#2e3436"),Nt.toColor("#cc0000"),Nt.toColor("#4e9a06"),Nt.toColor("#c4a000"),Nt.toColor("#3465a4"),Nt.toColor("#75507b"),Nt.toColor("#06989a"),Nt.toColor("#d3d7cf"),Nt.toColor("#555753"),Nt.toColor("#ef2929"),Nt.toColor("#8ae234"),Nt.toColor("#fce94f"),Nt.toColor("#729fcf"),Nt.toColor("#ad7fa8"),Nt.toColor("#34e2e2"),Nt.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let i=0;i<216;i++){let n=e[i/36%6|0],s=e[i/6%6|0],r=e[i%6];t.push({css:ci.toCss(n,s,r),rgba:ci.toRgba(n,s,r)})}for(let i=0;i<24;i++){let n=8+i*10;t.push({css:ci.toCss(n,n,n),rgba:ci.toRgba(n,n,n)})}return t})()),cl=Nt.toColor("#ffffff"),nf=Nt.toColor("#000000"),pR=Nt.toColor("#ffffff"),mR=nf,$u={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},Ise=cl,_x=class extends Ue{constructor(e){super(),this._optionsService=e,this._contrastCache=new dR,this._halfContrastCache=new dR,this._onChangeColors=this._register(new me),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:cl,background:nf,cursor:pR,cursorAccent:mR,selectionForeground:void 0,selectionBackgroundTransparent:$u,selectionBackgroundOpaque:Pt.blend(nf,$u),selectionInactiveBackgroundTransparent:$u,selectionInactiveBackgroundOpaque:Pt.blend(nf,$u),scrollbarSliderBackground:Pt.opacity(cl,.2),scrollbarSliderHoverBackground:Pt.opacity(cl,.4),scrollbarSliderActiveBackground:Pt.opacity(cl,.5),overviewRulerBorder:cl,ansi:mi.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let i=this._colors;if(i.foreground=Ot(e.foreground,cl),i.background=Ot(e.background,nf),i.cursor=Pt.blend(i.background,Ot(e.cursor,pR)),i.cursorAccent=Pt.blend(i.background,Ot(e.cursorAccent,mR)),i.selectionBackgroundTransparent=Ot(e.selectionBackground,$u),i.selectionBackgroundOpaque=Pt.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=Ot(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=Pt.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?Ot(e.selectionForeground,lR):void 0,i.selectionForeground===lR&&(i.selectionForeground=void 0),Pt.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=Pt.opacity(i.selectionBackgroundTransparent,.3)),Pt.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=Pt.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=Ot(e.scrollbarSliderBackground,Pt.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=Ot(e.scrollbarSliderHoverBackground,Pt.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=Ot(e.scrollbarSliderActiveBackground,Pt.opacity(i.foreground,.5)),i.overviewRulerBorder=Ot(e.overviewRulerBorder,Ise),i.ansi=mi.slice(),i.ansi[0]=Ot(e.black,mi[0]),i.ansi[1]=Ot(e.red,mi[1]),i.ansi[2]=Ot(e.green,mi[2]),i.ansi[3]=Ot(e.yellow,mi[3]),i.ansi[4]=Ot(e.blue,mi[4]),i.ansi[5]=Ot(e.magenta,mi[5]),i.ansi[6]=Ot(e.cyan,mi[6]),i.ansi[7]=Ot(e.white,mi[7]),i.ansi[8]=Ot(e.brightBlack,mi[8]),i.ansi[9]=Ot(e.brightRed,mi[9]),i.ansi[10]=Ot(e.brightGreen,mi[10]),i.ansi[11]=Ot(e.brightYellow,mi[11]),i.ansi[12]=Ot(e.brightBlue,mi[12]),i.ansi[13]=Ot(e.brightMagenta,mi[13]),i.ansi[14]=Ot(e.brightCyan,mi[14]),i.ansi[15]=Ot(e.brightWhite,mi[15]),e.extendedAnsi){let n=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<n;s++)i.ansi[s+16]=Ot(e.extendedAnsi[s],mi[s+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let i=0;i<this._restoreColors.ansi.length;++i)this._colors.ansi[i]=this._restoreColors.ansi[i];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};_x=Ut([be(0,bn)],_x);function Ot(t,e){if(t!==void 0)try{return Nt.toColor(t)}catch{}return e}var Vse=class{constructor(...e){this._entries=new Map;for(let[i,n]of e)this.set(i,n)}set(e,i){let n=this._entries.get(e);return this._entries.set(e,i),n}forEach(e){for(let[i,n]of this._entries.entries())e(i,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},Xse=class{constructor(){this._services=new Vse,this._services.set(Ew,this)}setService(t,e){this._services.set(t,e)}getService(t){return this._services.get(t)}createInstance(t,...e){let i=Bie(t).sort((r,o)=>r.index-o.index),n=[];for(let r of i){let o=this._services.get(r.id);if(!o)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${r.id._id}.`);n.push(o)}let s=i.length>0?i[0].index:e.length;if(e.length!==s)throw new Error(`[createInstance] First service dependency of ${t.name} at position ${s+1} conflicts with ${e.length} static arguments`);return new t(...e,...n)}},Zse={trace:0,debug:1,info:2,warn:3,error:4,off:5},qse="xterm.js: ",yx=class extends Ue{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=Zse[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":qse)+i,...n)}trace(e,...i){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,i)}debug(e,...i){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,i)}info(e,...i){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,i)}warn(e,...i){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,i)}error(e,...i){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,i)}};yx=Ut([be(0,bn)],yx);var gR=class extends Ue{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new me),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new me),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new me),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let i=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)i[n]=this._array[this._getCyclicIndex(n)];this._array=i,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let i=this._length;i<e;i++)this._array[i]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,i){this._array[this._getCyclicIndex(e)]=i}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,i,...n){if(i){for(let s=e;s<this._length-i;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+i)];this._length-=i,this.onDeleteEmitter.fire({index:e,amount:i})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+n.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<n.length;s++)this._array[this._getCyclicIndex(e+s)]=n[s];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let s=this._length+n.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,n){if(!(i<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let r=i-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let s=e+i+n-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<i;s++)this.set(e+s+n,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},qe=3,oi=Object.freeze(new bd),km=0,zy=2,sf=class o6{constructor(e,i,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*qe);let s=i||Rs.fromCharData([0,CN,1,0]);for(let r=0;r<e;++r)this.setCell(r,s);this.length=e}get(e){let i=this._data[e*qe+0],n=i&2097151;return[this._data[e*qe+1],i&2097152?this._combined[e]:n?ga(n):"",i>>22,i&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,i){this._data[e*qe+1]=i[0],i[1].length>1?(this._combined[e]=i[1],this._data[e*qe+0]=e|2097152|i[2]<<22):this._data[e*qe+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(e){return this._data[e*qe+0]>>22}hasWidth(e){return this._data[e*qe+0]&12582912}getFg(e){return this._data[e*qe+1]}getBg(e){return this._data[e*qe+2]}hasContent(e){return this._data[e*qe+0]&4194303}getCodePoint(e){let i=this._data[e*qe+0];return i&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):i&2097151}isCombined(e){return this._data[e*qe+0]&2097152}getString(e){let i=this._data[e*qe+0];return i&2097152?this._combined[e]:i&2097151?ga(i&2097151):""}isProtected(e){return this._data[e*qe+2]&536870912}loadCell(e,i){return km=e*qe,i.content=this._data[km+0],i.fg=this._data[km+1],i.bg=this._data[km+2],i.content&2097152&&(i.combinedData=this._combined[e]),i.bg&268435456&&(i.extended=this._extendedAttrs[e]),i}setCell(e,i){i.content&2097152&&(this._combined[e]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[e]=i.extended),this._data[e*qe+0]=i.content,this._data[e*qe+1]=i.fg,this._data[e*qe+2]=i.bg}setCellFromCodepoint(e,i,n,s){s.bg&268435456&&(this._extendedAttrs[e]=s.extended),this._data[e*qe+0]=i|n<<22,this._data[e*qe+1]=s.fg,this._data[e*qe+2]=s.bg}addCodepointToCell(e,i,n){let s=this._data[e*qe+0];s&2097152?this._combined[e]+=ga(i):s&2097151?(this._combined[e]=ga(s&2097151)+ga(i),s&=-2097152,s|=2097152):s=i|1<<22,n&&(s&=-12582913,s|=n<<22),this._data[e*qe+0]=s}insertCells(e,i,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length-e){let s=new Rs;for(let r=this.length-e-i-1;r>=0;--r)this.setCell(e+i+r,this.loadCell(e+r,s));for(let r=0;r<i;++r)this.setCell(e+r,n)}else for(let s=e;s<this.length;++s)this.setCell(s,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(e,i,n){if(e%=this.length,i<this.length-e){let s=new Rs;for(let r=0;r<this.length-e-i;++r)this.setCell(e+r,this.loadCell(e+i+r,s));for(let r=this.length-i;r<this.length;++r)this.setCell(r,n)}else for(let s=e;s<this.length;++s)this.setCell(s,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,i,n,s=!1){if(s){for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,n);e<i&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;return}for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,n);e<i&&e<this.length;)this.setCell(e++,n)}resize(e,i){if(e===this.length)return this._data.length*4*zy<this._data.buffer.byteLength;let n=e*qe;if(e>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let s=new Uint32Array(n);s.set(this._data),this._data=s}for(let s=this.length;s<e;++s)this.setCell(s,i)}else{this._data=this._data.subarray(0,n);let s=Object.keys(this._combined);for(let o=0;o<s.length;o++){let l=parseInt(s[o],10);l>=e&&delete this._combined[l]}let r=Object.keys(this._extendedAttrs);for(let o=0;o<r.length;o++){let l=parseInt(r[o],10);l>=e&&delete this._extendedAttrs[l]}}return this.length=e,n*4*zy<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*zy<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,i=!1){if(i){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,e);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,e)}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(let i in e._combined)this._combined[i]=e._combined[i];this._extendedAttrs={};for(let i in e._extendedAttrs)this._extendedAttrs[i]=e._extendedAttrs[i];this.isWrapped=e.isWrapped}clone(){let e=new o6(0);e._data=new Uint32Array(this._data),e.length=this.length;for(let i in this._combined)e._combined[i]=this._combined[i];for(let i in this._extendedAttrs)e._extendedAttrs[i]=this._extendedAttrs[i];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*qe+0]&4194303)return e+(this._data[e*qe+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*qe+0]&4194303||this._data[e*qe+2]&50331648)return e+(this._data[e*qe+0]>>22);return 0}copyCellsFrom(e,i,n,s,r){let o=e._data;if(r)for(let c=s-1;c>=0;c--){for(let u=0;u<qe;u++)this._data[(n+c)*qe+u]=o[(i+c)*qe+u];o[(i+c)*qe+2]&268435456&&(this._extendedAttrs[n+c]=e._extendedAttrs[i+c])}else for(let c=0;c<s;c++){for(let u=0;u<qe;u++)this._data[(n+c)*qe+u]=o[(i+c)*qe+u];o[(i+c)*qe+2]&268435456&&(this._extendedAttrs[n+c]=e._extendedAttrs[i+c])}let l=Object.keys(e._combined);for(let c=0;c<l.length;c++){let u=parseInt(l[c],10);u>=i&&(this._combined[u-i+n]=e._combined[u])}}translateToString(e,i,n,s){i=i??0,n=n??this.length,e&&(n=Math.min(n,this.getTrimmedLength())),s&&(s.length=0);let r="";for(;i<n;){let o=this._data[i*qe+0],l=o&2097151,c=o&2097152?this._combined[i]:l?ga(l):ya;if(r+=c,s)for(let u=0;u<c.length;++u)s.push(i);i+=o>>22||1}return s&&s.push(i),r}};function Wse(t,e,i,n,s,r){let o=[];for(let l=0;l<t.length-1;l++){let c=l,u=t.get(++c);if(!u.isWrapped)continue;let d=[t.get(l)];for(;c<t.length&&u.isWrapped;)d.push(u),u=t.get(++c);if(!r&&n>=l&&n<c){l+=d.length-1;continue}let p=0,g=nd(d,p,e),O=1,_=0;for(;O<d.length;){let S=nd(d,O,e),w=S-_,T=i-g,k=Math.min(w,T);d[p].copyCellsFrom(d[O],_,g,k,!1),g+=k,g===i&&(p++,g=0),_+=k,_===S&&(O++,_=0),g===0&&p!==0&&d[p-1].getWidth(i-1)===2&&(d[p].copyCellsFrom(d[p-1],i-1,g++,1,!1),d[p-1].setCell(i-1,s))}d[p].replaceCells(g,i,s);let b=0;for(let S=d.length-1;S>0&&(S>p||d[S].getTrimmedLength()===0);S--)b++;b>0&&(o.push(l+d.length-b),o.push(b)),l+=d.length-1}return o}function Use(t,e){let i=[],n=0,s=e[n],r=0;for(let o=0;o<t.length;o++)if(s===o){let l=e[++n];t.onDeleteEmitter.fire({index:o-r,amount:l}),o+=l-1,r+=l,s=e[++n]}else i.push(o);return{layout:i,countRemoved:r}}function Yse(t,e){let i=[];for(let n=0;n<e.length;n++)i.push(t.get(e[n]));for(let n=0;n<i.length;n++)t.set(n,i[n]);t.length=e.length}function Hse(t,e,i){let n=[],s=t.map((c,u)=>nd(t,u,e)).reduce((c,u)=>c+u),r=0,o=0,l=0;for(;l<s;){if(s-l<i){n.push(s-l);break}r+=i;let c=nd(t,o,e);r>c&&(r-=c,o++);let u=t[o].getWidth(r-1)===2;u&&r--;let d=u?i-1:i;n.push(d),l+=d}return n}function nd(t,e,i){if(e===t.length-1)return t[e].getTrimmedLength();let n=!t[e].hasContent(i-1)&&t[e].getWidth(i-1)===1,s=t[e+1].getWidth(0)===2;return n&&s?i-1:i}var a6=class l6{constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=l6._nextId++,this._onDispose=this.register(new me),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Pl(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};a6._nextId=1;var Fse=a6,yi={},hl=yi.B;yi[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};yi.A={"#":"£"};yi.B=void 0;yi[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};yi.C=yi[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};yi.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};yi.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};yi.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};yi.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};yi.E=yi[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};yi.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};yi.H=yi[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};yi["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var OR=4294967295,vR=class{constructor(t,e,i){this._hasScrollback=t,this._optionsService=e,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=oi.clone(),this.savedCharset=hl,this.markers=[],this._nullCell=Rs.fromCharData([0,CN,1,0]),this._whitespaceCell=Rs.fromCharData([0,ya,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new eO,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new gR(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Fg),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Fg),this._whitespaceCell}getBlankLine(t,e){return new sf(this._bufferService.cols,this.getNullCell(t),e)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;let e=t+this._optionsService.rawOptions.scrollback;return e>OR?OR:e}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=oi);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new gR(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,e){let i=this.getNullCell(oi),n=0,s=this._getCorrectBufferLength(e);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<t)for(let o=0;o<this.lines.length;o++)n+=+this.lines.get(o).resize(t,i);let r=0;if(this._rows<e)for(let o=this._rows;o<e;o++)this.lines.length<e+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new sf(t,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+r+1?(this.ybase--,r++,this.ydisp>0&&this.ydisp--):this.lines.push(new sf(t,i)));else for(let o=this._rows;o>e;o--)this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let o=this.lines.length-s;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=s}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,e-1),r&&(this.y+=r),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=e-1,this._isReflowEnabled&&(this._reflow(t,e),this._cols>t))for(let r=0;r<this.lines.length;r++)n+=+this.lines.get(r).resize(t,i);this._cols=t,this._rows=e,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let e=0;for(;this._memoryCleanupPosition<this.lines.length;)if(e+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),e>100)return!0;return t}get _isReflowEnabled(){let t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,e){this._cols!==t&&(t>this._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))}_reflowLarger(t,e){let i=this._optionsService.rawOptions.reflowCursorLine,n=Wse(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(oi),i);if(n.length>0){let s=Use(this.lines,n);Yse(this.lines,s.layout),this._reflowLargerAdjustViewport(t,e,s.countRemoved)}}_reflowLargerAdjustViewport(t,e,i){let n=this.getNullCell(oi),s=i;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<e&&this.lines.push(new sf(t,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(t,e){let i=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(oi),s=[],r=0;for(let o=this.lines.length-1;o>=0;o--){let l=this.lines.get(o);if(!l||!l.isWrapped&&l.getTrimmedLength()<=t)continue;let c=[l];for(;l.isWrapped&&o>0;)l=this.lines.get(--o),c.unshift(l);if(!i){let k=this.ybase+this.y;if(k>=o&&k<o+c.length)continue}let u=c[c.length-1].getTrimmedLength(),d=Hse(c,this._cols,t),p=d.length-c.length,g;this.ybase===0&&this.y!==this.lines.length-1?g=Math.max(0,this.y-this.lines.maxLength+p):g=Math.max(0,this.lines.length-this.lines.maxLength+p);let O=[];for(let k=0;k<p;k++){let A=this.getBlankLine(oi,!0);O.push(A)}O.length>0&&(s.push({start:o+c.length+r,newLines:O}),r+=O.length),c.push(...O);let _=d.length-1,b=d[_];b===0&&(_--,b=d[_]);let S=c.length-p-1,w=u;for(;S>=0;){let k=Math.min(w,b);if(c[_]===void 0)break;if(c[_].copyCellsFrom(c[S],w-k,b-k,k,!0),b-=k,b===0&&(_--,b=d[_]),w-=k,w===0){S--;let A=Math.max(S,0);w=nd(c,A,this._cols)}}for(let k=0;k<c.length;k++)d[k]<t&&c[k].setCell(d[k],n);let T=p-g;for(;T-- >0;)this.ybase===0?this.y<e-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+r)-e&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+e-1)}if(s.length>0){let o=[],l=[];for(let b=0;b<this.lines.length;b++)l.push(this.lines.get(b));let c=this.lines.length,u=c-1,d=0,p=s[d];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+r);let g=0;for(let b=Math.min(this.lines.maxLength-1,c+r-1);b>=0;b--)if(p&&p.start>u+g){for(let S=p.newLines.length-1;S>=0;S--)this.lines.set(b--,p.newLines[S]);b++,o.push({index:u+1,amount:p.newLines.length}),g+=p.newLines.length,p=s[++d]}else this.lines.set(b,l[u--]);let O=0;for(let b=o.length-1;b>=0;b--)o[b].index+=O,this.lines.onInsertEmitter.fire(o[b]),O+=o[b].amount;let _=Math.max(0,c+r-this.lines.maxLength);_>0&&this.lines.onTrimEmitter.fire(_)}}translateBufferLineToString(t,e,i=0,n){let s=this.lines.get(t);return s?s.translateToString(e,i,n):""}getWrappedRangeForLine(t){let e=t,i=t;for(;e>0&&this.lines.get(e).isWrapped;)e--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:e,last:i}}setupTabStops(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].line===t&&(this.markers[e].dispose(),this.markers.splice(e--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose();this.markers.length=0,this._isClearing=!1}addMarker(t){let e=new Fse(t);return this.markers.push(e),e.register(this.lines.onTrim(i=>{e.line-=i,e.line<0&&e.dispose()})),e.register(this.lines.onInsert(i=>{e.line>=i.index&&(e.line+=i.amount)})),e.register(this.lines.onDelete(i=>{e.line>=i.index&&e.line<i.index+i.amount&&e.dispose(),e.line>i.index&&(e.line-=i.amount)})),e.register(e.onDispose(()=>this._removeMarker(e))),e}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}},Gse=class extends Ue{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new me),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new vR(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new vR(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},c6=2,h6=1,bx=class extends Ue{constructor(t){super(),this.isUserScrolling=!1,this._onResize=this._register(new me),this.onResize=this._onResize.event,this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,c6),this.rows=Math.max(t.rawOptions.rows||0,h6),this.buffers=this._register(new Gse(t,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(t,e){let i=this.cols!==t,n=this.rows!==e;this.cols=t,this.rows=e,this.buffers.resize(t,e),this._onResize.fire({cols:t,rows:e,colsChanged:i,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,e=!1){let i=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==t.fg||n.getBg(0)!==t.bg)&&(n=i.getBlankLine(t,e),this._cachedBlankLine=n),n.isWrapped=e;let s=i.ybase+i.scrollTop,r=i.ybase+i.scrollBottom;if(i.scrollTop===0){let o=i.lines.isFull;r===i.lines.length-1?o?i.lines.recycle().copyFrom(n):i.lines.push(n.clone()):i.lines.splice(r+1,0,n.clone()),o?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let o=r-s+1;i.lines.shiftElements(s+1,o-1,-1),i.lines.set(r,n.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(t,e){let i=this.buffer;if(t<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else t+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let n=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+t,i.ybase),0),n!==i.ydisp&&(e||this._onScroll.fire(i.ydisp))}};bx=Ut([be(0,bn)],bx);var Cc={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Jg,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},Kse=["normal","bold","100","200","300","400","500","600","700","800","900"],Jse=class extends Ue{constructor(e){super(),this._onOptionChange=this._register(new me),this.onOptionChange=this._onOptionChange.event;let i={...Cc};for(let n in e)if(n in i)try{let s=e[n];i[n]=this._sanitizeAndValidateOption(n,s)}catch(s){console.error(s)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(Bt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(n=>{n===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&i()})}_setupOptions(){let e=n=>{if(!(n in Cc))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,s)=>{if(!(n in Cc))throw new Error(`No option with key "${n}"`);s=this._sanitizeAndValidateOption(n,s),this.rawOptions[n]!==s&&(this.rawOptions[n]=s,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let s={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this.options,n,s)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=Cc[e]),!ere(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=Cc[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=Kse.includes(i)?i:Cc[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(i*10)/10));break;case"scrollback":if(i=Math.min(i,4294967295),i<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{};break}return i}};function ere(t){return t==="block"||t==="underline"||t==="bar"}function rf(t,e=5){if(typeof t!="object")return t;let i=Array.isArray(t)?[]:{};for(let n in t)i[n]=e<=1?t[n]:t[n]&&rf(t[n],e-1);return i}var _R=Object.freeze({insertMode:!1}),yR=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),xx=class extends Ue{constructor(e,i,n){super(),this._bufferService=e,this._logService=i,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new me),this.onData=this._onData.event,this._onUserInput=this._register(new me),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new me),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new me),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=rf(_R),this.decPrivateModes=rf(yR)}reset(){this.modes=rf(_R),this.decPrivateModes=rf(yR)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};xx=Ut([be(0,yn),be(1,MN),be(2,bn)],xx);var bR={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button===4||t.action!==1?!1:(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>!(t.action===32&&t.button===3)},ANY:{events:31,restrict:t=>!0}};function jy(t,e){let i=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(i|=64,i|=t.action):(i|=t.button&3,t.button&4&&(i|=64),t.button&8&&(i|=128),t.action===32?i|=32:t.action===0&&!e&&(i|=3)),i}var Iy=String.fromCharCode,xR={DEFAULT:t=>{let e=[jy(t,!1)+32,t.col+32,t.row+32];return e[0]>255||e[1]>255||e[2]>255?"":`\x1B[M${Iy(e[0])}${Iy(e[1])}${Iy(e[2])}`},SGR:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${jy(t,!0)};${t.col};${t.row}${e}`},SGR_PIXELS:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${jy(t,!0)};${t.x};${t.y}${e}`}},Sx=class extends Ue{constructor(t,e,i){super(),this._bufferService=t,this._coreService=e,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new me),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(bR))this.addProtocol(n,bR[n]);for(let n of Object.keys(xR))this.addEncoding(n,xR[n]);this.reset()}addProtocol(t,e){this._protocols[t]=e}addEncoding(t,e){this._encodings[t]=e}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(t,e,i){if(t.deltaY===0||t.shiftKey||e===void 0||i===void 0)return 0;let n=e/i,s=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=n+0,Math.abs(t.deltaY)<50&&(s*=.3),this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(t,e){return e.altKey||e.ctrlKey||e.shiftKey?t*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:t*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;let e=this._encodings[this._activeEncoding](t);return e&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(e):this._coreService.triggerDataEvent(e,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(t&1),up:!!(t&2),drag:!!(t&4),move:!!(t&8),wheel:!!(t&16)}}_equalEvents(t,e,i){if(i){if(t.x!==e.x||t.y!==e.y)return!1}else if(t.col!==e.col||t.row!==e.row)return!1;return!(t.button!==e.button||t.action!==e.action||t.ctrl!==e.ctrl||t.alt!==e.alt||t.shift!==e.shift)}};Sx=Ut([be(0,yn),be(1,$l),be(2,bn)],Sx);var Vy=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],tre=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],gi;function ire(t,e){let i=0,n=e.length-1,s;if(t<e[0][0]||t>e[n][1])return!1;for(;n>=i;)if(s=i+n>>1,t>e[s][1])i=s+1;else if(t<e[s][0])n=s-1;else return!0;return!1}var nre=class{constructor(){if(this.version="6",!gi){gi=new Uint8Array(65536),gi.fill(1),gi[0]=0,gi.fill(0,1,32),gi.fill(0,127,160),gi.fill(2,4352,4448),gi[9001]=2,gi[9002]=2,gi.fill(2,11904,42192),gi[12351]=1,gi.fill(2,44032,55204),gi.fill(2,63744,64256),gi.fill(2,65040,65050),gi.fill(2,65072,65136),gi.fill(2,65280,65377),gi.fill(2,65504,65511);for(let e=0;e<Vy.length;++e)gi.fill(0,Vy[e][0],Vy[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?gi[e]:ire(e,tre)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,i){let n=this.wcwidth(e),s=n===0&&i!==0;if(s){let r=yl.extractWidth(i);r===0?s=!1:r>n&&(n=r)}return yl.createPropertyValue(0,n,s)}},yl=class ng{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new me,this.onChange=this._onChange.event;let e=new nre;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,i,n=!1){return(e&16777215)<<3|(i&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let i=0,n=0,s=e.length;for(let r=0;r<s;++r){let o=e.charCodeAt(r);if(55296<=o&&o<=56319){if(++r>=s)return i+this.wcwidth(o);let u=e.charCodeAt(r);56320<=u&&u<=57343?o=(o-55296)*1024+u-56320+65536:i+=this.wcwidth(u)}let l=this.charProperties(o,n),c=ng.extractWidth(l);ng.extractShouldJoin(l)&&(c-=ng.extractWidth(n)),i+=c,n=l}return i}charProperties(e,i){return this._activeProvider.charProperties(e,i)}},sre=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,i){this._charsets[e]=i,this.glevel===e&&(this.charset=i)}};function SR(t){var n;let e=(n=t.buffer.lines.get(t.buffer.ybase+t.buffer.y-1))==null?void 0:n.get(t.cols-1),i=t.buffer.lines.get(t.buffer.ybase+t.buffer.y);i&&e&&(i.isWrapped=e[3]!==0&&e[3]!==32)}var Nu=2147483647,rre=256,u6=class wx{constructor(e=32,i=32){if(this.maxLength=e,this.maxSubParamsLength=i,i>rre)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(e){let i=new wx;if(!e.length)return i;for(let n=Array.isArray(e[0])?1:0;n<e.length;++n){let s=e[n];if(Array.isArray(s))for(let r=0;r<s.length;++r)i.addSubParam(s[r]);else i.addParam(s)}return i}clone(){let e=new wx(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){let e=[];for(let i=0;i<this.length;++i){e.push(this.params[i]);let n=this._subParamsIdx[i]>>8,s=this._subParamsIdx[i]&255;s-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,s))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>Nu?Nu:e}addSubParam(e){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>Nu?Nu:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let i=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;return n-i>0?this._subParams.subarray(i,n):null}getSubParamsAll(){let e={};for(let i=0;i<this.length;++i){let n=this._subParamsIdx[i]>>8,s=this._subParamsIdx[i]&255;s-n>0&&(e[i]=this._subParams.slice(n,s))}return e}addDigit(e){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,s=n[i-1];n[i-1]=~s?Math.min(s*10+e,Nu):e}},zu=[],ore=class{constructor(){this._state=0,this._active=zu,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let s=n.indexOf(i);s!==-1&&n.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=zu}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=zu,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||zu,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,i,n){if(!this._active.length)this._handlerFb(this._id,"PUT",CO(e,i,n));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,i,n)}start(){this.reset(),this._state=1}put(e,i,n){if(this._state!==3){if(this._state===1)for(;i<n;){let s=e[i++];if(s===59){this._state=2,this._start();break}if(s<48||57<s){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+s-48}this._state===2&&n-i>0&&this._put(e,i,n)}}end(e,i=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,n=i,r=this._stack.fallThrough,this._stack.paused=!1),!r&&n===!1){for(;s>=0&&(n=this._active[s].end(e),n!==!0);s--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,n;s--}for(;s>=0;s--)if(n=this._active[s].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,n}this._active=zu,this._id=-1,this._state=0}}},Jn=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=CO(e,i,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data),i instanceof Promise))return i.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,i}},ju=[],are=class{constructor(){this._handlers=Object.create(null),this._active=ju,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=ju}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let s=n.indexOf(i);s!==-1&&n.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=ju,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||ju,!this._active.length)this._handlerFb(this._ident,"HOOK",i);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(i)}put(e,i,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",CO(e,i,n));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,i,n)}unhook(e,i=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,n=i,r=this._stack.fallThrough,this._stack.paused=!1),!r&&n===!1){for(;s>=0&&(n=this._active[s].unhook(e),n!==!0);s--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,n;s--}for(;s>=0;s--)if(n=this._active[s].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,n}this._active=ju,this._ident=0}},of=new u6;of.addParam(0);var wR=class{constructor(t){this._handler=t,this._data="",this._params=of,this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():of,this._data="",this._hitLimit=!1}put(t,e,i){this._hitLimit||(this._data+=CO(t,e,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data,this._params),e instanceof Promise))return e.then(i=>(this._params=of,this._data="",this._hitLimit=!1,i));return this._params=of,this._data="",this._hitLimit=!1,e}},lre=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,n,s){this.table[i<<8|e]=n<<4|s}addMany(e,i,n,s){for(let r=0;r<e.length;r++)this.table[i<<8|e[r]]=n<<4|s}},xs=160,cre=(function(){let t=new lre(4095),e=Array.apply(null,Array(256)).map((l,c)=>c),i=(l,c)=>e.slice(l,c),n=i(32,127),s=i(0,24);s.push(25),s.push.apply(s,i(28,32));let r=i(0,14),o;t.setDefault(1,0),t.addMany(n,0,2,0);for(o in r)t.addMany([24,26,153,154],o,3,0),t.addMany(i(128,144),o,3,0),t.addMany(i(144,152),o,3,0),t.add(156,o,0,0),t.add(27,o,11,1),t.add(157,o,4,8),t.addMany([152,158,159],o,0,7),t.add(155,o,11,3),t.add(144,o,11,9);return t.addMany(s,0,3,0),t.addMany(s,1,3,1),t.add(127,1,0,1),t.addMany(s,8,0,8),t.addMany(s,3,3,3),t.add(127,3,0,3),t.addMany(s,4,3,4),t.add(127,4,0,4),t.addMany(s,6,3,6),t.addMany(s,5,3,5),t.add(127,5,0,5),t.addMany(s,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(n,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(i(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(n,7,0,7),t.addMany(s,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(i(64,127),3,7,0),t.addMany(i(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(i(48,60),4,8,4),t.addMany(i(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(i(32,64),6,0,6),t.add(127,6,0,6),t.addMany(i(64,127),6,0,0),t.addMany(i(32,48),3,9,5),t.addMany(i(32,48),5,9,5),t.addMany(i(48,64),5,0,6),t.addMany(i(64,127),5,7,0),t.addMany(i(32,48),4,9,5),t.addMany(i(32,48),1,9,2),t.addMany(i(32,48),2,9,2),t.addMany(i(48,127),2,10,0),t.addMany(i(48,80),1,10,0),t.addMany(i(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(i(96,127),1,10,0),t.add(80,1,11,9),t.addMany(s,9,0,9),t.add(127,9,0,9),t.addMany(i(28,32),9,0,9),t.addMany(i(32,48),9,9,12),t.addMany(i(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(s,11,0,11),t.addMany(i(32,128),11,0,11),t.addMany(i(28,32),11,0,11),t.addMany(s,10,0,10),t.add(127,10,0,10),t.addMany(i(28,32),10,0,10),t.addMany(i(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(i(32,48),10,9,12),t.addMany(s,12,0,12),t.add(127,12,0,12),t.addMany(i(28,32),12,0,12),t.addMany(i(32,48),12,9,12),t.addMany(i(48,64),12,0,11),t.addMany(i(64,127),12,12,13),t.addMany(i(64,127),10,12,13),t.addMany(i(64,127),9,12,13),t.addMany(s,13,13,13),t.addMany(n,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(xs,0,2,0),t.add(xs,8,5,8),t.add(xs,6,0,6),t.add(xs,11,0,11),t.add(xs,13,13,13),t})(),hre=class extends Ue{constructor(e=cre){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new u6,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,n,s)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,n)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Bt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new ore),this._dcsParser=this._register(new are),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let r=0;r<e.intermediates.length;++r){let o=e.intermediates.charCodeAt(r);if(32>o||o>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=o}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(i[0]>s||s>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return n<<=8,n|=s,n}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(e&255)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let s=this._escHandlers[n];return s.push(i),{dispose:()=>{let r=s.indexOf(i);r!==-1&&s.splice(r,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let s=this._csiHandlers[n];return s.push(i),{dispose:()=>{let r=s.indexOf(i);r!==-1&&s.splice(r,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,i,n,s,r){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=n,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,i,n){let s=0,r=0,o=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let c=this._parseStack.handlers,u=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&u>-1){for(;u>=0&&(l=c[u](this._params),l!==!0);u--)if(l instanceof Promise)return this._parseStack.handlerPos=u,l}this._parseStack.handlers=[];break;case 4:if(n===!1&&u>-1){for(;u>=0&&(l=c[u](),l!==!0);u--)if(l instanceof Promise)return this._parseStack.handlerPos=u,l}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(s!==24&&s!==26,n),l)return l;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],l=this._oscParser.end(s!==24&&s!==26,n),l)return l;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let c=o;c<i;++c){switch(s=e[c],r=this._transitions.table[this.currentState<<8|(s<160?s:xs)],r>>4){case 2:for(let O=c+1;;++O){if(O>=i||(s=e[O])<32||s>126&&s<xs){this._printHandler(e,c,O),c=O-1;break}if(++O>=i||(s=e[O])<32||s>126&&s<xs){this._printHandler(e,c,O),c=O-1;break}if(++O>=i||(s=e[O])<32||s>126&&s<xs){this._printHandler(e,c,O),c=O-1;break}if(++O>=i||(s=e[O])<32||s>126&&s<xs){this._printHandler(e,c,O),c=O-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:c,code:s,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let u=this._csiHandlers[this._collect<<8|s],d=u?u.length-1:-1;for(;d>=0&&(l=u[d](this._params),l!==!0);d--)if(l instanceof Promise)return this._preserveStack(3,u,d,r,c),l;d<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++c<i&&(s=e[c])>47&&s<60);c--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let p=this._escHandlers[this._collect<<8|s],g=p?p.length-1:-1;for(;g>=0&&(l=p[g](),l!==!0);g--)if(l instanceof Promise)return this._preserveStack(4,p,g,r,c),l;g<0&&this._escHandlerFb(this._collect<<8|s),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|s,this._params);break;case 13:for(let O=c+1;;++O)if(O>=i||(s=e[O])===24||s===26||s===27||s>127&&s<xs){this._dcsParser.put(e,c,O),c=O-1;break}break;case 14:if(l=this._dcsParser.unhook(s!==24&&s!==26),l)return this._preserveStack(6,[],0,r,c),l;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let O=c+1;;O++)if(O>=i||(s=e[O])<32||s>127&&s<xs){this._oscParser.put(e,c,O),c=O-1;break}break;case 6:if(l=this._oscParser.end(s!==24&&s!==26),l)return this._preserveStack(5,[],0,r,c),l;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=r&15}}},ure=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,fre=/^[\da-f]+$/;function CR(t){if(!t)return;let e=t.toLowerCase();if(e.indexOf("rgb:")===0){e=e.slice(4);let i=ure.exec(e);if(i){let n=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/n*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/n*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/n*255)]}}else if(e.indexOf("#")===0&&(e=e.slice(1),fre.exec(e)&&[3,6,9,12].includes(e.length))){let i=e.length/3,n=[0,0,0];for(let s=0;s<3;++s){let r=parseInt(e.slice(i*s,i*s+i),16);n[s]=i===1?r<<4:i===2?r:i===3?r>>4:r>>8}return n}}function Xy(t,e){let i=t.toString(16),n=i.length<2?"0"+i:i;switch(e){case 4:return i[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function dre(t,e=16){let[i,n,s]=t;return`rgb:${Xy(i,e)}/${Xy(n,e)}/${Xy(s,e)}`}var pre={"(":0,")":1,"*":2,"+":3,"-":1,".":2},aa=131072,kR=10;function TR(t,e){if(t>24)return e.setWinLines||!1;switch(t){case 1:return!!e.restoreWin;case 2:return!!e.minimizeWin;case 3:return!!e.setWinPosition;case 4:return!!e.setWinSizePixels;case 5:return!!e.raiseWin;case 6:return!!e.lowerWin;case 7:return!!e.refreshWin;case 8:return!!e.setWinSizeChars;case 9:return!!e.maximizeWin;case 10:return!!e.fullscreenWin;case 11:return!!e.getWinState;case 13:return!!e.getWinPosition;case 14:return!!e.getWinSizePixels;case 15:return!!e.getScreenSizePixels;case 16:return!!e.getCellSizePixels;case 18:return!!e.getWinSizeChars;case 19:return!!e.getScreenSizeChars;case 20:return!!e.getIconTitle;case 21:return!!e.getWinTitle;case 22:return!!e.pushTitle;case 23:return!!e.popTitle;case 24:return!!e.setWinLines}return!1}var AR=5e3,ER=0,mre=class extends Ue{constructor(t,e,i,n,s,r,o,l,c=new hre){super(),this._bufferService=t,this._charsetService=e,this._coreService=i,this._logService=n,this._optionsService=s,this._oscLinkService=r,this._coreMouseService=o,this._unicodeService=l,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new Lie,this._utf8Decoder=new Die,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=oi.clone(),this._eraseAttrDataInternal=oi.clone(),this._onRequestBell=this._register(new me),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new me),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new me),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new me),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new me),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new me),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new me),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new me),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new me),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new me),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new me),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new me),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Cx(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(u=>this._activeBuffer=u.activeBuffer)),this._parser.setCsiHandlerFallback((u,d)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(u),params:d.toArray()})}),this._parser.setEscHandlerFallback(u=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(u)})}),this._parser.setExecuteHandlerFallback(u=>{this._logService.debug("Unknown EXECUTE code: ",{code:u})}),this._parser.setOscHandlerFallback((u,d,p)=>{this._logService.debug("Unknown OSC code: ",{identifier:u,action:d,data:p})}),this._parser.setDcsHandlerFallback((u,d,p)=>{d==="HOOK"&&(p=p.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(u),action:d,payload:p})}),this._parser.setPrintHandler((u,d,p)=>this.print(u,d,p)),this._parser.registerCsiHandler({final:"@"},u=>this.insertChars(u)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},u=>this.scrollLeft(u)),this._parser.registerCsiHandler({final:"A"},u=>this.cursorUp(u)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},u=>this.scrollRight(u)),this._parser.registerCsiHandler({final:"B"},u=>this.cursorDown(u)),this._parser.registerCsiHandler({final:"C"},u=>this.cursorForward(u)),this._parser.registerCsiHandler({final:"D"},u=>this.cursorBackward(u)),this._parser.registerCsiHandler({final:"E"},u=>this.cursorNextLine(u)),this._parser.registerCsiHandler({final:"F"},u=>this.cursorPrecedingLine(u)),this._parser.registerCsiHandler({final:"G"},u=>this.cursorCharAbsolute(u)),this._parser.registerCsiHandler({final:"H"},u=>this.cursorPosition(u)),this._parser.registerCsiHandler({final:"I"},u=>this.cursorForwardTab(u)),this._parser.registerCsiHandler({final:"J"},u=>this.eraseInDisplay(u,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},u=>this.eraseInDisplay(u,!0)),this._parser.registerCsiHandler({final:"K"},u=>this.eraseInLine(u,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},u=>this.eraseInLine(u,!0)),this._parser.registerCsiHandler({final:"L"},u=>this.insertLines(u)),this._parser.registerCsiHandler({final:"M"},u=>this.deleteLines(u)),this._parser.registerCsiHandler({final:"P"},u=>this.deleteChars(u)),this._parser.registerCsiHandler({final:"S"},u=>this.scrollUp(u)),this._parser.registerCsiHandler({final:"T"},u=>this.scrollDown(u)),this._parser.registerCsiHandler({final:"X"},u=>this.eraseChars(u)),this._parser.registerCsiHandler({final:"Z"},u=>this.cursorBackwardTab(u)),this._parser.registerCsiHandler({final:"`"},u=>this.charPosAbsolute(u)),this._parser.registerCsiHandler({final:"a"},u=>this.hPositionRelative(u)),this._parser.registerCsiHandler({final:"b"},u=>this.repeatPrecedingCharacter(u)),this._parser.registerCsiHandler({final:"c"},u=>this.sendDeviceAttributesPrimary(u)),this._parser.registerCsiHandler({prefix:">",final:"c"},u=>this.sendDeviceAttributesSecondary(u)),this._parser.registerCsiHandler({final:"d"},u=>this.linePosAbsolute(u)),this._parser.registerCsiHandler({final:"e"},u=>this.vPositionRelative(u)),this._parser.registerCsiHandler({final:"f"},u=>this.hVPosition(u)),this._parser.registerCsiHandler({final:"g"},u=>this.tabClear(u)),this._parser.registerCsiHandler({final:"h"},u=>this.setMode(u)),this._parser.registerCsiHandler({prefix:"?",final:"h"},u=>this.setModePrivate(u)),this._parser.registerCsiHandler({final:"l"},u=>this.resetMode(u)),this._parser.registerCsiHandler({prefix:"?",final:"l"},u=>this.resetModePrivate(u)),this._parser.registerCsiHandler({final:"m"},u=>this.charAttributes(u)),this._parser.registerCsiHandler({final:"n"},u=>this.deviceStatus(u)),this._parser.registerCsiHandler({prefix:"?",final:"n"},u=>this.deviceStatusPrivate(u)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},u=>this.softReset(u)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},u=>this.setCursorStyle(u)),this._parser.registerCsiHandler({final:"r"},u=>this.setScrollRegion(u)),this._parser.registerCsiHandler({final:"s"},u=>this.saveCursor(u)),this._parser.registerCsiHandler({final:"t"},u=>this.windowOptions(u)),this._parser.registerCsiHandler({final:"u"},u=>this.restoreCursor(u)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},u=>this.insertColumns(u)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},u=>this.deleteColumns(u)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},u=>this.selectProtected(u)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},u=>this.requestMode(u,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},u=>this.requestMode(u,!1)),this._parser.setExecuteHandler(ce.BEL,()=>this.bell()),this._parser.setExecuteHandler(ce.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ce.BS,()=>this.backspace()),this._parser.setExecuteHandler(ce.HT,()=>this.tab()),this._parser.setExecuteHandler(ce.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ce.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(tg.IND,()=>this.index()),this._parser.setExecuteHandler(tg.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(tg.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Jn(u=>(this.setTitle(u),this.setIconName(u),!0))),this._parser.registerOscHandler(1,new Jn(u=>this.setIconName(u))),this._parser.registerOscHandler(2,new Jn(u=>this.setTitle(u))),this._parser.registerOscHandler(4,new Jn(u=>this.setOrReportIndexedColor(u))),this._parser.registerOscHandler(8,new Jn(u=>this.setHyperlink(u))),this._parser.registerOscHandler(10,new Jn(u=>this.setOrReportFgColor(u))),this._parser.registerOscHandler(11,new Jn(u=>this.setOrReportBgColor(u))),this._parser.registerOscHandler(12,new Jn(u=>this.setOrReportCursorColor(u))),this._parser.registerOscHandler(104,new Jn(u=>this.restoreIndexedColor(u))),this._parser.registerOscHandler(110,new Jn(u=>this.restoreFgColor(u))),this._parser.registerOscHandler(111,new Jn(u=>this.restoreBgColor(u))),this._parser.registerOscHandler(112,new Jn(u=>this.restoreCursorColor(u))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let u in yi)this._parser.registerEscHandler({intermediates:"(",final:u},()=>this.selectCharset("("+u)),this._parser.registerEscHandler({intermediates:")",final:u},()=>this.selectCharset(")"+u)),this._parser.registerEscHandler({intermediates:"*",final:u},()=>this.selectCharset("*"+u)),this._parser.registerEscHandler({intermediates:"+",final:u},()=>this.selectCharset("+"+u)),this._parser.registerEscHandler({intermediates:"-",final:u},()=>this.selectCharset("-"+u)),this._parser.registerEscHandler({intermediates:".",final:u},()=>this.selectCharset("."+u)),this._parser.registerEscHandler({intermediates:"/",final:u},()=>this.selectCharset("/"+u));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(u=>(this._logService.error("Parsing error: ",u),u)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new wR((u,d)=>this.requestStatusString(u,d)))}getAttrData(){return this._curAttrData}_preserveStack(t,e,i,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=t,this._parseStack.cursorStartY=e,this._parseStack.decodedLength=i,this._parseStack.position=n}_logSlowResolvingAsync(t){this._logService.logLevel<=3&&Promise.race([t,new Promise((e,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),AR))]).catch(e=>{if(e!=="#SLOW_TIMEOUT")throw e;console.warn(`async parser handler taking longer than ${AR} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(t,e){let i,n=this._activeBuffer.x,s=this._activeBuffer.y,r=0,o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,e))return this._logSlowResolvingAsync(i),i;n=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,t.length>aa&&(r=this._parseStack.position+aa)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof t=="string"?` "${t}"`:` "${Array.prototype.map.call(t,u=>String.fromCharCode(u)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof t=="string"?t.split("").map(u=>u.charCodeAt(0)):t),this._parseBuffer.length<t.length&&this._parseBuffer.length<aa&&(this._parseBuffer=new Uint32Array(Math.min(t.length,aa))),o||this._dirtyRowTracker.clearRange(),t.length>aa)for(let u=r;u<t.length;u+=aa){let d=u+aa<t.length?u+aa:t.length,p=typeof t=="string"?this._stringDecoder.decode(t.substring(u,d),this._parseBuffer):this._utf8Decoder.decode(t.subarray(u,d),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,p))return this._preserveStack(n,s,p,u),this._logSlowResolvingAsync(i),i}else if(!o){let u=typeof t=="string"?this._stringDecoder.decode(t,this._parseBuffer):this._utf8Decoder.decode(t,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,u))return this._preserveStack(n,s,u,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==n||this._activeBuffer.y!==s)&&this._onCursorMove.fire();let l=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(l,this._bufferService.rows-1)})}print(t,e,i){let n,s,r=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,l=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,u=this._coreService.modes.insertMode,d=this._curAttrData,p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-e>0&&p.getWidth(this._activeBuffer.x-1)===2&&p.setCellFromCodepoint(this._activeBuffer.x-1,0,1,d);let g=this._parser.precedingJoinState;for(let O=e;O<i;++O){if(n=t[O],n<127&&r){let w=r[String.fromCharCode(n)];w&&(n=w.charCodeAt(0))}let _=this._unicodeService.charProperties(n,g);s=yl.extractWidth(_);let b=yl.extractShouldJoin(_),S=b?yl.extractWidth(g):0;if(g=_,o&&this._onA11yChar.fire(ga(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-S>l){if(c){let w=p,T=this._activeBuffer.x-S;for(this._activeBuffer.x=S,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),S>0&&p instanceof sf&&p.copyCellsFrom(w,T,0,S,!1);T<l;)w.setCellFromCodepoint(T++,0,1,d)}else if(this._activeBuffer.x=l-1,s===2)continue}if(b&&this._activeBuffer.x){let w=p.getWidth(this._activeBuffer.x-1)?1:2;p.addCodepointToCell(this._activeBuffer.x-w,n,s);for(let T=s-S;--T>=0;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,d);continue}if(u&&(p.insertCells(this._activeBuffer.x,s-S,this._activeBuffer.getNullCell(d)),p.getWidth(l-1)===2&&p.setCellFromCodepoint(l-1,0,1,d)),p.setCellFromCodepoint(this._activeBuffer.x++,n,s,d),s>0)for(;--s;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,d)}this._parser.precedingJoinState=g,this._activeBuffer.x<l&&i-e>0&&p.getWidth(this._activeBuffer.x)===0&&!p.hasContent(this._activeBuffer.x)&&p.setCellFromCodepoint(this._activeBuffer.x,0,1,d),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(t,e){return t.final==="t"&&!t.prefix&&!t.intermediates?this._parser.registerCsiHandler(t,i=>TR(i.params[0],this._optionsService.rawOptions.windowOptions)?e(i):!0):this._parser.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._parser.registerDcsHandler(t,new wR(e))}registerEscHandler(t,e){return this._parser.registerEscHandler(t,e)}registerOscHandler(t,e){return this._parser.registerOscHandler(t,new Jn(e))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var t;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&t.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-t),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(t=this._bufferService.cols-1){this._activeBuffer.x=Math.min(t,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(t,e){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=t,this._activeBuffer.y=this._activeBuffer.scrollTop+e):(this._activeBuffer.x=t,this._activeBuffer.y=e),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(t,e){this._restrictCursor(),this._setCursor(this._activeBuffer.x+t,this._activeBuffer.y+e)}cursorUp(t){let e=this._activeBuffer.y-this._activeBuffer.scrollTop;return e>=0?this._moveCursor(0,-Math.min(e,t.params[0]||1)):this._moveCursor(0,-(t.params[0]||1)),!0}cursorDown(t){let e=this._activeBuffer.scrollBottom-this._activeBuffer.y;return e>=0?this._moveCursor(0,Math.min(e,t.params[0]||1)):this._moveCursor(0,t.params[0]||1),!0}cursorForward(t){return this._moveCursor(t.params[0]||1,0),!0}cursorBackward(t){return this._moveCursor(-(t.params[0]||1),0),!0}cursorNextLine(t){return this.cursorDown(t),this._activeBuffer.x=0,!0}cursorPrecedingLine(t){return this.cursorUp(t),this._activeBuffer.x=0,!0}cursorCharAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(t){return this._setCursor(t.length>=2?(t.params[1]||1)-1:0,(t.params[0]||1)-1),!0}charPosAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(t){return this._moveCursor(t.params[0]||1,0),!0}linePosAbsolute(t){return this._setCursor(this._activeBuffer.x,(t.params[0]||1)-1),!0}vPositionRelative(t){return this._moveCursor(0,t.params[0]||1),!0}hVPosition(t){return this.cursorPosition(t),!0}tabClear(t){let e=t.params[0];return e===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:e===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(t){let e=t.params[0];return e===1&&(this._curAttrData.bg|=536870912),(e===2||e===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(t,e,i,n=!1,s=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);r.replaceCells(e,i,this._activeBuffer.getNullCell(this._eraseAttrData()),s),n&&(r.isWrapped=!1)}_resetBufferLine(t,e=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),e),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+t),i.isWrapped=!1)}eraseInDisplay(t,e=!1){var n;this._restrictCursor(this._bufferService.cols);let i;switch(t.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);i<this._bufferService.rows;i++)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,e),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!((n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i))!=null&&n.getTrimmedLength()););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(t,e=!1){switch(this._restrictCursor(this._bufferService.cols),t.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,e);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,e);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(t){this._restrictCursor();let e=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;e--;)this._activeBuffer.lines.splice(s-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(t){this._restrictCursor();let e=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;e--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.insertCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.deleteCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(t){let e=t.params[0]||1;for(;e--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(t){let e=t.params[0]||1;for(;e--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(oi));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.deleteCells(0,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.insertCells(0,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.insertCells(this._activeBuffer.x,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.deleteCells(this._activeBuffer.x,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(t.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(t){let e=this._parser.precedingJoinState;if(!e)return!0;let i=t.params[0]||1,n=yl.extractWidth(e),s=this._activeBuffer.x-n,r=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),o=new Uint32Array(r.length*i),l=0;for(let u=0;u<r.length;){let d=r.codePointAt(u)||0;o[l++]=d,u+=d>65535?2:1}let c=l;for(let u=1;u<i;++u)o.copyWithin(c,0,l),c+=l;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(t){return t.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ce.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ce.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(t){return t.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ce.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ce.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(t.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ce.ESC+"[>83;40003;0c")),!0}_is(t){return(this._optionsService.rawOptions.termName+"").indexOf(t)===0}setMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,hl),this._charsetService.setgCharset(1,hl),this._charsetService.setgCharset(2,hl),this._charsetService.setgCharset(3,hl);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),t.params[e]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(t,e){(b=>(b[b.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",b[b.SET=1]="SET",b[b.RESET=2]="RESET",b[b.PERMANENTLY_SET=3]="PERMANENTLY_SET",b[b.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(i={}));let n=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:r}=this._coreMouseService,o=this._coreService,{buffers:l,cols:c}=this._bufferService,{active:u,alt:d}=l,p=this._optionsService.rawOptions,g=(b,S)=>(o.triggerDataEvent(`${ce.ESC}[${e?"":"?"}${b};${S}$y`),!0),O=b=>b?1:2,_=t.params[0];return e?_===2?g(_,4):_===4?g(_,O(o.modes.insertMode)):_===12?g(_,3):_===20?g(_,O(p.convertEol)):g(_,0):_===1?g(_,O(n.applicationCursorKeys)):_===3?g(_,p.windowOptions.setWinLines?c===80?2:c===132?1:0:0):_===6?g(_,O(n.origin)):_===7?g(_,O(n.wraparound)):_===8?g(_,3):_===9?g(_,O(s==="X10")):_===12?g(_,O(p.cursorBlink)):_===25?g(_,O(!o.isCursorHidden)):_===45?g(_,O(n.reverseWraparound)):_===66?g(_,O(n.applicationKeypad)):_===67?g(_,4):_===1e3?g(_,O(s==="VT200")):_===1002?g(_,O(s==="DRAG")):_===1003?g(_,O(s==="ANY")):_===1004?g(_,O(n.sendFocus)):_===1005?g(_,4):_===1006?g(_,O(r==="SGR")):_===1015?g(_,4):_===1016?g(_,O(r==="SGR_PIXELS")):_===1048?g(_,1):_===47||_===1047||_===1049?g(_,O(u===d)):_===2004?g(_,O(n.bracketedPasteMode)):_===2026?g(_,O(n.synchronizedOutput)):g(_,0)}_updateAttrColor(t,e,i,n,s){return e===2?(t|=50331648,t&=-16777216,t|=bd.fromColorRGB([i,n,s])):e===5&&(t&=-50331904,t|=33554432|i&255),t}_extractColor(t,e,i){let n=[0,0,-1,0,0,0],s=0,r=0;do{if(n[r+s]=t.params[e+r],t.hasSubParams(e+r)){let o=t.getSubParams(e+r),l=0;do n[1]===5&&(s=1),n[r+l+1+s]=o[l];while(++l<o.length&&l+r+1+s<n.length);break}if(n[1]===5&&r+s>=2||n[1]===2&&r+s>=5)break;n[1]&&(s=1)}while(++r+e<t.length&&r+s<n.length);for(let o=2;o<n.length;++o)n[o]===-1&&(n[o]=0);switch(n[0]){case 38:i.fg=this._updateAttrColor(i.fg,n[1],n[3],n[4],n[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,n[1],n[3],n[4],n[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,n[1],n[3],n[4],n[5])}return r}_processUnderline(t,e){e.extended=e.extended.clone(),(!~t||t>5)&&(t=1),e.extended.underlineStyle=t,e.fg|=268435456,t===0&&(e.fg&=-268435457),e.updateExtended()}_processSGR0(t){t.fg=oi.fg,t.bg=oi.bg,t.extended=t.extended.clone(),t.extended.underlineStyle=0,t.extended.underlineColor&=-67108864,t.updateExtended()}charAttributes(t){if(t.length===1&&t.params[0]===0)return this._processSGR0(this._curAttrData),!0;let e=t.length,i,n=this._curAttrData;for(let s=0;s<e;s++)i=t.params[s],i>=30&&i<=37?(n.fg&=-50331904,n.fg|=16777216|i-30):i>=40&&i<=47?(n.bg&=-50331904,n.bg|=16777216|i-40):i>=90&&i<=97?(n.fg&=-50331904,n.fg|=16777216|i-90|8):i>=100&&i<=107?(n.bg&=-50331904,n.bg|=16777216|i-100|8):i===0?this._processSGR0(n):i===1?n.fg|=134217728:i===3?n.bg|=67108864:i===4?(n.fg|=268435456,this._processUnderline(t.hasSubParams(s)?t.getSubParams(s)[0]:1,n)):i===5?n.fg|=536870912:i===7?n.fg|=67108864:i===8?n.fg|=1073741824:i===9?n.fg|=2147483648:i===2?n.bg|=134217728:i===21?this._processUnderline(2,n):i===22?(n.fg&=-134217729,n.bg&=-134217729):i===23?n.bg&=-67108865:i===24?(n.fg&=-268435457,this._processUnderline(0,n)):i===25?n.fg&=-536870913:i===27?n.fg&=-67108865:i===28?n.fg&=-1073741825:i===29?n.fg&=2147483647:i===39?(n.fg&=-67108864,n.fg|=oi.fg&16777215):i===49?(n.bg&=-67108864,n.bg|=oi.bg&16777215):i===38||i===48||i===58?s+=this._extractColor(t,s,n):i===53?n.bg|=1073741824:i===55?n.bg&=-1073741825:i===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):i===100?(n.fg&=-67108864,n.fg|=oi.fg&16777215,n.bg&=-67108864,n.bg|=oi.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(t){switch(t.params[0]){case 5:this._coreService.triggerDataEvent(`${ce.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[${e};${i}R`);break}return!0}deviceStatusPrivate(t){switch(t.params[0]){case 6:let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[?${e};${i}R`);break}return!0}softReset(t){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=oi.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(t){let e=t.length===0?1:t.params[0];if(e===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(e){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=e%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(t){let e=t.params[0]||1,i;return(t.length<2||(i=t.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>e&&(this._activeBuffer.scrollTop=e-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(t){if(!TR(t.params[0],this._optionsService.rawOptions.windowOptions))return!0;let e=t.length>1?t.params[1]:0;switch(t.params[0]){case 14:e!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${ce.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(e===0||e===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>kR&&this._windowTitleStack.shift()),(e===0||e===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>kR&&this._iconNameStack.shift());break;case 23:(e===0||e===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(e===0||e===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(t){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(t){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(t){return this._windowTitle=t,this._onTitleChange.fire(t),!0}setIconName(t){return this._iconName=t,!0}setOrReportIndexedColor(t){let e=[],i=t.split(";");for(;i.length>1;){let n=i.shift(),s=i.shift();if(/^\d+$/.exec(n)){let r=parseInt(n);if(MR(r))if(s==="?")e.push({type:0,index:r});else{let o=CR(s);o&&e.push({type:1,index:r,color:o})}}}return e.length&&this._onColor.fire(e),!0}setHyperlink(t){let e=t.indexOf(";");if(e===-1)return!0;let i=t.slice(0,e).trim(),n=t.slice(e+1);return n?this._createHyperlink(i,n):i.trim()?!1:this._finishHyperlink()}_createHyperlink(t,e){this._getCurrentLinkId()&&this._finishHyperlink();let i=t.split(":"),n,s=i.findIndex(r=>r.startsWith("id="));return s!==-1&&(n=i[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:e}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(t,e){let i=t.split(";");for(let n=0;n<i.length&&!(e>=this._specialColors.length);++n,++e)if(i[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[e]}]);else{let s=CR(i[n]);s&&this._onColor.fire([{type:1,index:this._specialColors[e],color:s}])}return!0}setOrReportFgColor(t){return this._setOrReportSpecialColor(t,0)}setOrReportBgColor(t){return this._setOrReportSpecialColor(t,1)}setOrReportCursorColor(t){return this._setOrReportSpecialColor(t,2)}restoreIndexedColor(t){if(!t)return this._onColor.fire([{type:2}]),!0;let e=[],i=t.split(";");for(let n=0;n<i.length;++n)if(/^\d+$/.exec(i[n])){let s=parseInt(i[n]);MR(s)&&e.push({type:2,index:s})}return e.length&&this._onColor.fire(e),!0}restoreFgColor(t){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(t){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(t){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,hl),!0}selectCharset(t){return t.length!==2?(this.selectDefaultCharset(),!0):(t[0]==="/"||this._charsetService.setgCharset(pre[t[0]],yi[t[1]]||hl),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let t=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,t,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=oi.clone(),this._eraseAttrDataInternal=oi.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(t){return this._charsetService.setgLevel(t),!0}screenAlignmentPattern(){let t=new Rs;t.content=1<<22|69,t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let e=0;e<this._bufferService.rows;++e){let i=this._activeBuffer.ybase+this._activeBuffer.y+e,n=this._activeBuffer.lines.get(i);n&&(n.fill(t),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(t,e){let i=o=>(this._coreService.triggerDataEvent(`${ce.ESC}${o}${ce.ESC}\\`),!0),n=this._bufferService.buffer,s=this._optionsService.rawOptions;return i(t==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:t==='"p'?'P1$r61;1"p':t==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:t==="m"?"P1$r0m":t===" q"?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(t,e){this._dirtyRowTracker.markRangeDirty(t,e)}},Cx=class{constructor(t){this._bufferService=t,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(t){t<this.start?this.start=t:t>this.end&&(this.end=t)}markRangeDirty(t,e){t>e&&(ER=t,t=e,e=ER),t<this.start&&(this.start=t),e>this.end&&(this.end=e)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Cx=Ut([be(0,yn)],Cx);function MR(t){return 0<=t&&t<256}var gre=5e7,PR=12,Ore=50,vre=class extends Ue{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new me),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){if(i!==void 0&&this._syncCalls>i){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,i){if(this._pendingData>gre)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],r=this._action(s,i);if(r){let l=c=>performance.now()-n>=PR?setTimeout(()=>this._innerWrite(0,c)):this._innerWrite(n,c);r.catch(c=>(queueMicrotask(()=>{throw c}),Promise.resolve(!1))).then(l);return}let o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-n>=PR)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>Ore&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},kx=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let i=this._bufferService.buffer;if(e.id===void 0){let c=i.addMarker(i.ybase+i.y),u={data:e,id:this._nextId++,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(u,c)),this._dataByLinkId.set(u.id,u),u.id}let n=e,s=this._getEntryIdKey(n),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,i.ybase+i.y),r.id;let o=i.addMarker(i.ybase+i.y),l={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(l,o)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(e,i){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(s=>s.line!==i)){let s=this._bufferService.buffer.addMarker(i);n.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(n,s))}}getLinkData(e){var i;return(i=this._dataByLinkId.get(e))==null?void 0:i.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,i){let n=e.lines.indexOf(i);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};kx=Ut([be(0,yn)],kx);var RR=!1,_re=class extends Ue{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new mh),this._onBinary=this._register(new me),this.onBinary=this._onBinary.event,this._onData=this._register(new me),this.onData=this._onData.event,this._onLineFeed=this._register(new me),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new me),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new me),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new me),this._instantiationService=new Xse,this.optionsService=this._register(new Jse(e)),this._instantiationService.setService(bn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(bx)),this._instantiationService.setService(yn,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(yx)),this._instantiationService.setService(MN,this._logService),this.coreService=this._register(this._instantiationService.createInstance(xx)),this._instantiationService.setService($l,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Sx)),this._instantiationService.setService(EN,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(yl)),this._instantiationService.setService(zie,this.unicodeService),this._charsetService=this._instantiationService.createInstance(sre),this._instantiationService.setService(Nie,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(kx),this._instantiationService.setService(PN,this._oscLinkService),this._inputHandler=this._register(new mre(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Gi.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Gi.forward(this._bufferService.onResize,this._onResize)),this._register(Gi.forward(this.coreService.onData,this._onData)),this._register(Gi.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new vre((i,n)=>this._inputHandler.parse(i,n))),this._register(Gi.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new me),this._onScroll.event(e=>{var i;(i=this._onScrollApi)==null||i.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!RR&&(this._logService.warn("writeSync is unreliable and will be removed soon."),RR=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,c6),i=Math.max(i,h6),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&i.buildNumber!==void 0&&i.buildNumber!==void 0?e=i.backend==="conpty"&&i.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(SR.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(SR(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Bt(()=>{for(let i of e)i.dispose()})}}},yre={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function bre(t,e,i,n){var o;let s={type:0,cancel:!1,key:void 0},r=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:t.key==="UIKeyInputUpArrow"?e?s.key=ce.ESC+"OA":s.key=ce.ESC+"[A":t.key==="UIKeyInputLeftArrow"?e?s.key=ce.ESC+"OD":s.key=ce.ESC+"[D":t.key==="UIKeyInputRightArrow"?e?s.key=ce.ESC+"OC":s.key=ce.ESC+"[C":t.key==="UIKeyInputDownArrow"&&(e?s.key=ce.ESC+"OB":s.key=ce.ESC+"[B");break;case 8:s.key=t.ctrlKey?"\b":ce.DEL,t.altKey&&(s.key=ce.ESC+s.key);break;case 9:if(t.shiftKey){s.key=ce.ESC+"[Z";break}s.key=ce.HT,s.cancel=!0;break;case 13:s.key=t.altKey?ce.ESC+ce.CR:ce.CR,s.cancel=!0;break;case 27:s.key=ce.ESC,t.altKey&&(s.key=ce.ESC+ce.ESC),s.cancel=!0;break;case 37:if(t.metaKey)break;r?s.key=ce.ESC+"[1;"+(r+1)+"D":e?s.key=ce.ESC+"OD":s.key=ce.ESC+"[D";break;case 39:if(t.metaKey)break;r?s.key=ce.ESC+"[1;"+(r+1)+"C":e?s.key=ce.ESC+"OC":s.key=ce.ESC+"[C";break;case 38:if(t.metaKey)break;r?s.key=ce.ESC+"[1;"+(r+1)+"A":e?s.key=ce.ESC+"OA":s.key=ce.ESC+"[A";break;case 40:if(t.metaKey)break;r?s.key=ce.ESC+"[1;"+(r+1)+"B":e?s.key=ce.ESC+"OB":s.key=ce.ESC+"[B";break;case 45:!t.shiftKey&&!t.ctrlKey&&(s.key=ce.ESC+"[2~");break;case 46:r?s.key=ce.ESC+"[3;"+(r+1)+"~":s.key=ce.ESC+"[3~";break;case 36:r?s.key=ce.ESC+"[1;"+(r+1)+"H":e?s.key=ce.ESC+"OH":s.key=ce.ESC+"[H";break;case 35:r?s.key=ce.ESC+"[1;"+(r+1)+"F":e?s.key=ce.ESC+"OF":s.key=ce.ESC+"[F";break;case 33:t.shiftKey?s.type=2:t.ctrlKey?s.key=ce.ESC+"[5;"+(r+1)+"~":s.key=ce.ESC+"[5~";break;case 34:t.shiftKey?s.type=3:t.ctrlKey?s.key=ce.ESC+"[6;"+(r+1)+"~":s.key=ce.ESC+"[6~";break;case 112:r?s.key=ce.ESC+"[1;"+(r+1)+"P":s.key=ce.ESC+"OP";break;case 113:r?s.key=ce.ESC+"[1;"+(r+1)+"Q":s.key=ce.ESC+"OQ";break;case 114:r?s.key=ce.ESC+"[1;"+(r+1)+"R":s.key=ce.ESC+"OR";break;case 115:r?s.key=ce.ESC+"[1;"+(r+1)+"S":s.key=ce.ESC+"OS";break;case 116:r?s.key=ce.ESC+"[15;"+(r+1)+"~":s.key=ce.ESC+"[15~";break;case 117:r?s.key=ce.ESC+"[17;"+(r+1)+"~":s.key=ce.ESC+"[17~";break;case 118:r?s.key=ce.ESC+"[18;"+(r+1)+"~":s.key=ce.ESC+"[18~";break;case 119:r?s.key=ce.ESC+"[19;"+(r+1)+"~":s.key=ce.ESC+"[19~";break;case 120:r?s.key=ce.ESC+"[20;"+(r+1)+"~":s.key=ce.ESC+"[20~";break;case 121:r?s.key=ce.ESC+"[21;"+(r+1)+"~":s.key=ce.ESC+"[21~";break;case 122:r?s.key=ce.ESC+"[23;"+(r+1)+"~":s.key=ce.ESC+"[23~";break;case 123:r?s.key=ce.ESC+"[24;"+(r+1)+"~":s.key=ce.ESC+"[24~";break;default:if(t.ctrlKey&&!t.shiftKey&&!t.altKey&&!t.metaKey)t.keyCode>=65&&t.keyCode<=90?s.key=String.fromCharCode(t.keyCode-64):t.keyCode===32?s.key=ce.NUL:t.keyCode>=51&&t.keyCode<=55?s.key=String.fromCharCode(t.keyCode-51+27):t.keyCode===56?s.key=ce.DEL:t.keyCode===219?s.key=ce.ESC:t.keyCode===220?s.key=ce.FS:t.keyCode===221&&(s.key=ce.GS);else if((!i||n)&&t.altKey&&!t.metaKey){let l=(o=yre[t.keyCode])==null?void 0:o[t.shiftKey?1:0];if(l)s.key=ce.ESC+l;else if(t.keyCode>=65&&t.keyCode<=90){let c=t.ctrlKey?t.keyCode-64:t.keyCode+32,u=String.fromCharCode(c);t.shiftKey&&(u=u.toUpperCase()),s.key=ce.ESC+u}else if(t.keyCode===32)s.key=ce.ESC+(t.ctrlKey?ce.NUL:" ");else if(t.key==="Dead"&&t.code.startsWith("Key")){let c=t.code.slice(3,4);t.shiftKey||(c=c.toLowerCase()),s.key=ce.ESC+c,s.cancel=!0}}else i&&!t.altKey&&!t.ctrlKey&&!t.shiftKey&&t.metaKey?t.keyCode===65&&(s.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.keyCode>=48&&t.key.length===1?s.key=t.key:t.key&&t.ctrlKey&&(t.key==="_"&&(s.key=ce.US),t.key==="@"&&(s.key=ce.NUL));break}return s}var Gt=0,xre=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new eO,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new eO,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((r,o)=>this._getKey(r)-this._getKey(o)),i=0,n=0,s=new Array(this._array.length+this._insertedValues.length);for(let r=0;r<s.length;r++)n>=this._array.length||this._getKey(e[i])<=this._getKey(this._array[n])?(s[r]=e[i],i++):s[r]=this._array[n++];this._array=s,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let i=this._getKey(e);if(i===void 0||(Gt=this._search(i),Gt===-1)||this._getKey(this._array[Gt])!==i)return!1;do if(this._array[Gt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Gt),!0;while(++Gt<this._array.length&&this._getKey(this._array[Gt])===i);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((r,o)=>r-o),i=0,n=new Array(this._array.length-e.length),s=0;for(let r=0;r<this._array.length;r++)e[i]===r?i++:n[s++]=this._array[r];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Gt=this._search(e),!(Gt<0||Gt>=this._array.length)&&this._getKey(this._array[Gt])===e))do yield this._array[Gt];while(++Gt<this._array.length&&this._getKey(this._array[Gt])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Gt=this._search(e),!(Gt<0||Gt>=this._array.length)&&this._getKey(this._array[Gt])===e))do i(this._array[Gt]);while(++Gt<this._array.length&&this._getKey(this._array[Gt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let i=0,n=this._array.length-1;for(;n>=i;){let s=i+n>>1,r=this._getKey(this._array[s]);if(r>e)n=s-1;else if(r<e)i=s+1;else{for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}return i}},Zy=0,QR=0,Sre=class extends Ue{constructor(){super(),this._decorations=new xre(t=>t==null?void 0:t.marker.line),this._onDecorationRegistered=this._register(new me),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new me),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Bt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(t){if(t.marker.isDisposed)return;let e=new wre(t);if(e){let i=e.marker.onDispose(()=>e.dispose()),n=e.onDispose(()=>{n.dispose(),e&&(this._decorations.delete(e)&&this._onDecorationRemoved.fire(e),i.dispose())});this._decorations.insert(e),this._onDecorationRegistered.fire(e)}return e}reset(){for(let t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,e,i){let n=0,s=0;for(let r of this._decorations.getKeyIterator(e))n=r.options.x??0,s=n+(r.options.width??1),t>=n&&t<s&&(!i||(r.options.layer??"bottom")===i)&&(yield r)}forEachDecorationAtCell(t,e,i,n){this._decorations.forEachByKey(e,s=>{Zy=s.options.x??0,QR=Zy+(s.options.width??1),t>=Zy&&t<QR&&(!i||(s.options.layer??"bottom")===i)&&n(s)})}},wre=class extends xa{constructor(t){super(),this.options=t,this.onRenderEmitter=this.add(new me),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new me),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=t.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Nt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Nt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},Cre=1e3,kre=class{constructor(e,i=Cre){this._renderCallback=e,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i;let s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let r=s-this._lastRefreshMs,o=this._debounceThresholdMS-r;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},o)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i)}},LR=20,tO=class extends Ue{constructor(t,e,i,n){super(),this._terminal=t,this._coreBrowserService=i,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let r=0;r<this._terminal.rows;r++)this._rowElements[r]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[r]);if(this._topBoundaryFocusListener=r=>this._handleBoundaryFocus(r,0),this._bottomBoundaryFocusListener=r=>this._handleBoundaryFocus(r,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new kre(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(r=>this._handleResize(r.rows))),this._register(this._terminal.onRender(r=>this._refreshRows(r.start,r.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(r=>this._handleChar(r))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
117
- `))),this._register(this._terminal.onA11yTab(r=>this._handleTab(r))),this._register(this._terminal.onKey(r=>this._handleKey(r.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Be(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Bt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let e=0;e<t;e++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<LR+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
118
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===LR+1&&(this._liveRegion.textContent+=Wb.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,e){this._liveRegionDebouncer.refresh(t,e,this._terminal.rows)}_renderRows(t,e){let i=this._terminal.buffer,n=i.lines.length.toString();for(let s=t;s<=e;s++){let r=i.lines.get(i.ydisp+s),o=[],l=(r==null?void 0:r.translateToString(!0,void 0,void 0,o))||"",c=(i.ydisp+s+1).toString(),u=this._rowElements[s];u&&(l.length===0?(u.textContent=" ",this._rowColumns.set(u,[0,1])):(u.textContent=l,this._rowColumns.set(u,o)),u.setAttribute("aria-posinset",c),u.setAttribute("aria-setsize",n),this._alignRowWidth(u))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,e){let i=t.target,n=this._rowElements[e===0?1:this._rowElements.length-2],s=i.getAttribute("aria-posinset"),r=e===0?"1":`${this._terminal.buffer.lines.length}`;if(s===r||t.relatedTarget!==n)return;let o,l;if(e===0?(o=i,l=this._rowElements.pop(),this._rowContainer.removeChild(l)):(o=this._rowElements.shift(),l=i,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),l.removeEventListener("focus",this._bottomBoundaryFocusListener),e===0){let c=this._createAccessibilityTreeNode();this._rowElements.unshift(c),this._rowContainer.insertAdjacentElement("afterbegin",c)}else{let c=this._createAccessibilityTreeNode();this._rowElements.push(c),this._rowContainer.appendChild(c)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(e===0?-1:1),this._rowElements[e===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){var l;if(this._rowElements.length===0)return;let t=this._coreBrowserService.mainDocument.getSelection();if(!t)return;if(t.isCollapsed){this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection();return}if(!t.anchorNode||!t.focusNode){console.error("anchorNode and/or focusNode are null");return}let e={node:t.anchorNode,offset:t.anchorOffset},i={node:t.focusNode,offset:t.focusOffset};if((e.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||e.node===i.node&&e.offset>i.offset)&&([e,i]=[i,e]),e.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(e={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(e.node))return;let n=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:n,offset:((l=n.textContent)==null?void 0:l.length)??0}),!this._rowContainer.contains(i.node))return;let s=({node:c,offset:u})=>{let d=c instanceof Text?c.parentNode:c,p=parseInt(d==null?void 0:d.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let g=this._rowColumns.get(d);if(!g)return console.warn("columns is null. Race condition?"),null;let O=u<g.length?g[u]:g.slice(-1)[0]+1;return O>=this._terminal.cols&&(++p,O=0),{row:p,column:O}},r=s(e),o=s(i);if(!(!r||!o)){if(r.row>o.row||r.row===o.row&&r.column>=o.column)throw new Error("invalid range");this._terminal.select(r.column,r.row,(o.row-r.row)*this._terminal.cols-r.column+o.column)}}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t]),this._alignRowWidth(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(t){var s,r;t.style.transform="";let e=t.getBoundingClientRect().width,i=(r=(s=this._rowColumns.get(t))==null?void 0:s.slice(-1))==null?void 0:r[0];if(!i)return;let n=i*this._renderService.dimensions.css.cell.width;t.style.transform=`scaleX(${n/e})`}};tO=Ut([be(1,Ew),be(2,Co),be(3,ko)],tO);var Tx=class extends Ue{constructor(t,e,i,n,s){super(),this._element=t,this._mouseService=e,this._renderService=i,this._bufferService=n,this._linkProviderService=s,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new me),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new me),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Bt(()=>{var r;Pl(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(r=this._activeProviderReplies)==null||r.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Be(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Be(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Be(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Be(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(t){this._lastMouseEvent=t;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;let i=t.composedPath();for(let n=0;n<i.length;n++){let s=i[n];if(s.classList.contains("xterm"))break;if(s.classList.contains("xterm-hover"))return}(!this._lastBufferCell||e.x!==this._lastBufferCell.x||e.y!==this._lastBufferCell.y)&&(this._handleHover(e),this._lastBufferCell=e)}_handleHover(t){if(this._activeLine!==t.y||this._wasResized){this._clearCurrentLink(),this._askForLink(t,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,t)||(this._clearCurrentLink(),this._askForLink(t,!0))}_askForLink(t,e){var n,s;(!this._activeProviderReplies||!e)&&((n=this._activeProviderReplies)==null||n.forEach(r=>{r==null||r.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=t.y);let i=!1;for(let[r,o]of this._linkProviderService.linkProviders.entries())e?(s=this._activeProviderReplies)!=null&&s.get(r)&&(i=this._checkLinkProviderResult(r,t,i)):o.provideLinks(t.y,l=>{var u,d;if(this._isMouseOut)return;let c=l==null?void 0:l.map(p=>({link:p}));(u=this._activeProviderReplies)==null||u.set(r,c),i=this._checkLinkProviderResult(r,t,i),((d=this._activeProviderReplies)==null?void 0:d.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(t.y,this._activeProviderReplies)})}_removeIntersectingLinks(t,e){let i=new Set;for(let n=0;n<e.size;n++){let s=e.get(n);if(s)for(let r=0;r<s.length;r++){let o=s[r],l=o.link.range.start.y<t?0:o.link.range.start.x,c=o.link.range.end.y>t?this._bufferService.cols:o.link.range.end.x;for(let u=l;u<=c;u++){if(i.has(u)){s.splice(r--,1);break}i.add(u)}}}}_checkLinkProviderResult(t,e,i){var r;if(!this._activeProviderReplies)return i;let n=this._activeProviderReplies.get(t),s=!1;for(let o=0;o<t;o++)(!this._activeProviderReplies.has(o)||this._activeProviderReplies.get(o))&&(s=!0);if(!s&&n){let o=n.find(l=>this._linkAtPosition(l.link,e));o&&(i=!0,this._handleNewLink(o))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let o=0;o<this._activeProviderReplies.size;o++){let l=(r=this._activeProviderReplies.get(o))==null?void 0:r.find(c=>this._linkAtPosition(c.link,e));if(l){i=!0,this._handleNewLink(l);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(t){if(!this._currentLink)return;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);e&&this._mouseDownLink&&Tre(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(t,this._currentLink.link.text)}_clearCurrentLink(t,e){!this._currentLink||!this._lastMouseEvent||(!t||!e||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Pl(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(t){if(!this._lastMouseEvent)return;let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(t.link,e)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0?!0:t.link.decorations.underline,pointerCursor:t.link.decorations===void 0?!0:t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:()=>{var i,n;return(n=(i=this._currentLink)==null?void 0:i.state)==null?void 0:n.decorations.pointerCursor},set:i=>{var n;(n=this._currentLink)!=null&&n.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>{var i,n;return(n=(i=this._currentLink)==null?void 0:i.state)==null?void 0:n.decorations.underline},set:i=>{var n,s,r;(n=this._currentLink)!=null&&n.state&&((r=(s=this._currentLink)==null?void 0:s.state)==null?void 0:r.decorations.underline)!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(t.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let n=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=s&&(this._clearCurrentLink(n,s),this._lastMouseEvent)){let r=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);r&&this._askForLink(r,!1)}})))}_linkHover(t,e,i){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(i,e.text)}_fireUnderlineEvent(t,e){let i=t.range,n=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-n-1,i.end.x,i.end.y-n-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(t,e,i){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(i,e.text)}_linkAtPosition(t,e){let i=t.range.start.y*this._bufferService.cols+t.range.start.x,n=t.range.end.y*this._bufferService.cols+t.range.end.x,s=e.y*this._bufferService.cols+e.x;return i<=s&&s<=n}_positionFromMouseEvent(t,e,i){let n=i.getCoords(t,e,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(t,e,i,n,s){return{x1:t,y1:e,x2:i,y2:n,cols:this._bufferService.cols,fg:s}}};Tx=Ut([be(1,Mw),be(2,ko),be(3,yn),be(4,QN)],Tx);function Tre(t,e){return t.text===e.text&&t.range.start.x===e.range.start.x&&t.range.start.y===e.range.start.y&&t.range.end.x===e.range.end.x&&t.range.end.y===e.range.end.y}var Are=class extends _re{constructor(e={}){super(e),this._linkifier=this._register(new mh),this.browser=KN,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new mh),this._onCursorMove=this._register(new me),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new me),this.onKey=this._onKey.event,this._onRender=this._register(new me),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new me),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new me),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new me),this.onBell=this._onBell.event,this._onFocus=this._register(new me),this._onBlur=this._register(new me),this._onA11yCharEmitter=this._register(new me),this._onA11yTabEmitter=this._register(new me),this._onWillOpen=this._register(new me),this._setup(),this._decorationService=this._instantiationService.createInstance(Sre),this._instantiationService.setService(xd,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Ose),this._instantiationService.setService(QN,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Yb)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i=>this.refresh((i==null?void 0:i.start)??0,(i==null?void 0:i.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(i=>this._reportWindowsOptions(i))),this._register(this._inputHandler.onColor(i=>this._handleColorEvent(i))),this._register(Gi.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Gi.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Gi.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Gi.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register(Bt(()=>{var i,n;this._customKeyEventHandler=void 0,(n=(i=this.element)==null?void 0:i.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let i of e){let n,s="";switch(i.index){case 256:n="foreground",s="10";break;case 257:n="background",s="11";break;case 258:n="cursor",s="12";break;default:n="ansi",s="4;"+i.index}switch(i.type){case 0:let r=Pt.toColorRGB(n==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${ce.ESC}]${s};${dre(r)}${FN.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(o=>o.ansi[i.index]=ci.toColor(...i.color));else{let o=n;this._themeService.modifyColors(l=>l[o]=ci.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(tO,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ce.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ce.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i=this.buffer.lines.get(e);if(!i)return;let n=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=i.getWidth(n),o=this._renderService.dimensions.css.cell.width*r,l=this.buffer.y*this._renderService.dimensions.css.cell.height,c=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=c+"px",this.textarea.style.top=l+"px",this.textarea.style.width=o+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Be(this.element,"copy",i=>{this.hasSelection()&&Rie(i,this._selectionService)}));let e=i=>Qie(i,this.textarea,this.coreService,this.optionsService);this._register(Be(this.textarea,"paste",e)),this._register(Be(this.element,"paste",e)),JN?this._register(Be(this.element,"mousedown",i=>{i.button===2&&ZP(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Be(this.element,"contextmenu",i=>{ZP(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Nw&&this._register(Be(this.element,"auxclick",i=>{i.button===1&&wN(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Be(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Be(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Be(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Be(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Be(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Be(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Be(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var r;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((r=this.element)==null?void 0:r.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Be(this.screenElement,"mousemove",o=>this.updateCursorStyle(o))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",qb.get()),i6||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(mse,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Co,this._coreBrowserService),this._register(Be(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(Be(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(mx,this._document,this._helperContainer),this._instantiationService.setService(kO,this._charSizeService),this._themeService=this._instantiationService.createInstance(_x),this._instantiationService.setService(Ch,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Kg),this._instantiationService.setService(RN,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Ox,this.rows,this.screenElement)),this._instantiationService.setService(ko,this._renderService),this._register(this._renderService.onRenderedViewportChange(o=>this._onRender.fire(o))),this.onResize(o=>this._renderService.resize(o.cols,o.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(fx,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(gx),this._instantiationService.setService(Mw,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(Tx,this.screenElement));this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(hx,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(o=>{super.scrollLines(o,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(vx,this.element,this.screenElement,s)),this._instantiationService.setService(Iie,this._selectionService),this._register(this._selectionService.onRequestScrollLines(o=>this.scrollLines(o.amount,o.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(o=>this._renderService.handleSelectionChanged(o.start,o.end,o.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(o=>{this.textarea.value=o,this.textarea.focus(),this.textarea.select()})),this._register(Gi.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var o;this._selectionService.refresh(),(o=this._viewport)==null||o.queueSync()})),this._register(this._instantiationService.createInstance(ux,this.screenElement)),this._register(Be(this.element,"mousedown",o=>this._selectionService.handleMouseDown(o))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(tO,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Gg,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Gg,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(px,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function n(o){var d,p,g,O,_;let l=e._mouseService.getMouseReportCoords(o,e.screenElement);if(!l)return!1;let c,u;switch(o.overrideType||o.type){case"mousemove":u=32,o.buttons===void 0?(c=3,o.button!==void 0&&(c=o.button<3?o.button:3)):c=o.buttons&1?0:o.buttons&4?1:o.buttons&2?2:3;break;case"mouseup":u=0,c=o.button<3?o.button:3;break;case"mousedown":u=1,c=o.button<3?o.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(o)===!1)return!1;let b=o.deltaY;if(b===0||e.coreMouseService.consumeWheelEvent(o,(O=(g=(p=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:p.device)==null?void 0:g.cell)==null?void 0:O.height,(_=e._coreBrowserService)==null?void 0:_.dpr)===0)return!1;u=b<0?0:1,c=4;break;default:return!1}return u===void 0||c===void 0||c>4?!1:e.coreMouseService.triggerMouseEvent({col:l.col,row:l.row,x:l.x,y:l.y,button:c,action:u,ctrl:o.ctrlKey,alt:o.altKey,shift:o.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:o=>(n(o),o.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(o)),wheel:o=>(n(o),this.cancel(o,!0)),mousedrag:o=>{o.buttons&&n(o)},mousemove:o=>{o.buttons||n(o)}};this._register(this.coreMouseService.onProtocolChange(o=>{o?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(o)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),o&8?s.mousemove||(i.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(i.removeEventListener("mousemove",s.mousemove),s.mousemove=null),o&16?s.wheel||(i.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(i.removeEventListener("wheel",s.wheel),s.wheel=null),o&2?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),o&4?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Be(i,"mousedown",o=>{if(o.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(o)))return n(o),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(o)})),this._register(Be(i,"wheel",o=>{var l,c,u,d,p;if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(o)===!1)return!1;if(!this.buffer.hasScrollback){if(o.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(o,(d=(u=(c=(l=e._renderService)==null?void 0:l.dimensions)==null?void 0:c.device)==null?void 0:u.cell)==null?void 0:d.height,(p=e._coreBrowserService)==null?void 0:p.dpr)===0)return this.cancel(o,!0);let g=ce.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(o.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(g,!0),this.cancel(o,!0)}}},{passive:!1}))}refresh(e,i){var n;(n=this._renderService)==null||n.refreshRows(e,i)}updateCursorStyle(e){var i;(i=this._selectionService)!=null&&i.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}paste(e){SN(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,i,n){this._selectionService.setSelection(e,i,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,i){var n;(n=this._selectionService)==null||n.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!i&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=bre(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let s=this.rows-1;return this.scrollLines(n.type===2?-s:s),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===ce.ETX||n.key===ce.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,i){let n=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return i.type==="keypress"?n:n&&(!i.keyCode||i.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Ere(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(e.which===null||e.which===void 0)i=e.keyCode;else if(e.which!==0&&e.charCode!==0)i=e.which;else return!1;return!i||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){var n;(n=this._charSizeService)==null||n.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(oi));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var i;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(i=this._selectionService)==null||i.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(ce.ESC+"[I"):this.coreService.triggerDataEvent(ce.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[4;${n};${i}t`);break;case 1:let s=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[6;${r};${s}t`);break}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}};function Ere(t){return t.keyCode===16||t.keyCode===17||t.keyCode===18}var Mre=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let n={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(n),i.dispose=()=>this._wrappedAddonDispose(n),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){i=n;break}if(i===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(i,1)}},Pre=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,i){if(!(e<0||e>=this._line.length))return i?(this._line.loadCell(e,i),i):this._line.loadCell(e,new Rs)}translateToString(e,i,n){return this._line.translateToString(e,i,n)}},DR=class{constructor(t,e){this._buffer=t,this.type=e}init(t){return this._buffer=t,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(t){let e=this._buffer.lines.get(t);if(e)return new Pre(e)}getNullCell(){return new Rs}},Rre=class extends Ue{constructor(t){super(),this._core=t,this._onBufferChange=this._register(new me),this.onBufferChange=this._onBufferChange.event,this._normal=new DR(this._core.buffers.normal,"normal"),this._alternate=new DR(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},Qre=class{constructor(t){this._core=t}registerCsiHandler(t,e){return this._core.registerCsiHandler(t,i=>e(i.toArray()))}addCsiHandler(t,e){return this.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._core.registerDcsHandler(t,(i,n)=>e(i,n.toArray()))}addDcsHandler(t,e){return this.registerDcsHandler(t,e)}registerEscHandler(t,e){return this._core.registerEscHandler(t,e)}addEscHandler(t,e){return this.registerEscHandler(t,e)}registerOscHandler(t,e){return this._core.registerOscHandler(t,e)}addOscHandler(t,e){return this.registerOscHandler(t,e)}},Lre=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},Dre=["cols","rows"],cr=0,Bre=class extends Ue{constructor(t){super(),this._core=this._register(new Are(t)),this._addonManager=this._register(new Mre),this._publicOptions={...this._core.options};let e=n=>this._core.options[n],i=(n,s)=>{this._checkReadonlyOptions(n),this._core.options[n]=s};for(let n in this._core.options){let s={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this._publicOptions,n,s)}}_checkReadonlyOptions(t){if(Dre.includes(t))throw new Error(`Option "${t}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new Qre(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new Lre(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new Rre(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let t=this._core.coreService.decPrivateModes,e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any";break}return{applicationCursorKeysMode:t.applicationCursorKeys,applicationKeypadMode:t.applicationKeypad,bracketedPasteMode:t.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:t.origin,reverseWraparoundMode:t.reverseWraparound,sendFocusMode:t.sendFocus,synchronizedOutputMode:t.synchronizedOutput,wraparoundMode:t.wraparound}}get options(){return this._publicOptions}set options(t){for(let e in t)this._publicOptions[e]=t[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(t,e=!0){this._core.input(t,e)}resize(t,e){this._verifyIntegers(t,e),this._core.resize(t,e)}open(t){this._core.open(t)}attachCustomKeyEventHandler(t){this._core.attachCustomKeyEventHandler(t)}attachCustomWheelEventHandler(t){this._core.attachCustomWheelEventHandler(t)}registerLinkProvider(t){return this._core.registerLinkProvider(t)}registerCharacterJoiner(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)}deregisterCharacterJoiner(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)}registerMarker(t=0){return this._verifyIntegers(t),this._core.registerMarker(t)}registerDecoration(t){return this._checkProposedApi(),this._verifyPositiveIntegers(t.x??0,t.width??0,t.height??0),this._core.registerDecoration(t)}hasSelection(){return this._core.hasSelection()}select(t,e,i){this._verifyIntegers(t,e,i),this._core.select(t,e,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(t,e){this._verifyIntegers(t,e),this._core.selectLines(t,e)}dispose(){super.dispose()}scrollLines(t){this._verifyIntegers(t),this._core.scrollLines(t)}scrollPages(t){this._verifyIntegers(t),this._core.scrollPages(t)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(t){this._verifyIntegers(t),this._core.scrollToLine(t)}clear(){this._core.clear()}write(t,e){this._core.write(t,e)}writeln(t,e){this._core.write(t),this._core.write(`\r
119
- `,e)}paste(t){this._core.paste(t)}refresh(t,e){this._verifyIntegers(t,e),this._core.refresh(t,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return{get promptLabel(){return qb.get()},set promptLabel(t){qb.set(t)},get tooMuchOutput(){return Wb.get()},set tooMuchOutput(t){Wb.set(t)}}}_verifyIntegers(...t){for(cr of t)if(cr===1/0||isNaN(cr)||cr%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(cr of t)if(cr&&(cr===1/0||isNaN(cr)||cr%1!==0||cr<0))throw new Error("This API only accepts positive integers")}};/**
120
- * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
121
- * @license MIT
122
- *
123
- * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
124
- * @license MIT
125
- *
126
- * Originally forked from (with the author's permission):
127
- * Fabrice Bellard's javascript vt100 for jslinux:
128
- * http://bellard.org/jslinux/
129
- * Copyright (c) 2011 Fabrice Bellard
130
- */var $re=2,Nre=1,zre=class{activate(t){this._terminal=t}dispose(){}fit(){let t=this.proposeDimensions();if(!t||!this._terminal||isNaN(t.cols)||isNaN(t.rows))return;let e=this._terminal._core;(this._terminal.rows!==t.rows||this._terminal.cols!==t.cols)&&(e._renderService.clear(),this._terminal.resize(t.cols,t.rows))}proposeDimensions(){var p;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal._core._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let e=this._terminal.options.scrollback===0?0:((p=this._terminal.options.overviewRuler)==null?void 0:p.width)||14,i=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(i.getPropertyValue("height")),s=Math.max(0,parseInt(i.getPropertyValue("width"))),r=window.getComputedStyle(this._terminal.element),o={top:parseInt(r.getPropertyValue("padding-top")),bottom:parseInt(r.getPropertyValue("padding-bottom")),right:parseInt(r.getPropertyValue("padding-right")),left:parseInt(r.getPropertyValue("padding-left"))},l=o.top+o.bottom,c=o.right+o.left,u=n-l,d=s-c-e;return{cols:Math.max($re,Math.floor(d/t.css.cell.width)),rows:Math.max(Nre,Math.floor(u/t.css.cell.height))}}};/**
131
- * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
132
- * @license MIT
133
- *
134
- * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
135
- * @license MIT
136
- *
137
- * Originally forked from (with the author's permission):
138
- * Fabrice Bellard's javascript vt100 for jslinux:
139
- * http://bellard.org/jslinux/
140
- * Copyright (c) 2011 Fabrice Bellard
141
- */var jre=(t,e,i,n)=>{for(var s=e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(s=o(s)||s);return s},Ire=(t,e)=>(i,n)=>e(i,n,t),Vre=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?BR.isErrorNoTelemetry(t)?new BR(t.message+`
142
-
143
- `+t.stack):new Error(t.message+`
144
-
145
- `+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},Xre=new Vre;function qy(t){Zre(t)||Xre.onUnexpectedError(t)}var Ax="Canceled";function Zre(t){return t instanceof qre?!0:t instanceof Error&&t.name===Ax&&t.message===Ax}var qre=class extends Error{constructor(){super(Ax),this.name=this.message}},BR=class Ex extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Ex)return e;let i=new Ex;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Wre;(t=>{function e(r){return r<0}t.isLessThan=e;function i(r){return r<=0}t.isLessThanOrEqual=i;function n(r){return r>0}t.isGreaterThan=n;function s(r){return r===0}t.isNeitherLessOrGreaterThan=s,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(Wre||(Wre={}));function Ure(t,e){let i=this,n=!1,s;return function(){return n||(n=!0,e||(s=t.apply(i,arguments))),s}}var f6;(t=>{function e(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function n(){return i}t.empty=n;function*s(A){yield A}t.single=s;function r(A){return e(A)?A:s(A)}t.wrap=r;function o(A){return A||i}t.from=o;function*l(A){for(let R=A.length-1;R>=0;R--)yield A[R]}t.reverse=l;function c(A){return!A||A[Symbol.iterator]().next().done===!0}t.isEmpty=c;function u(A){return A[Symbol.iterator]().next().value}t.first=u;function d(A,R){let E=0;for(let $ of A)if(R($,E++))return!0;return!1}t.some=d;function p(A,R){for(let E of A)if(R(E))return E}t.find=p;function*g(A,R){for(let E of A)R(E)&&(yield E)}t.filter=g;function*O(A,R){let E=0;for(let $ of A)yield R($,E++)}t.map=O;function*_(A,R){let E=0;for(let $ of A)yield*R($,E++)}t.flatMap=_;function*b(...A){for(let R of A)yield*R}t.concat=b;function S(A,R,E){let $=E;for(let N of A)$=R($,N);return $}t.reduce=S;function*w(A,R,E=A.length){for(R<0&&(R+=A.length),E<0?E+=A.length:E>A.length&&(E=A.length);R<E;R++)yield A[R]}t.slice=w;function T(A,R=Number.POSITIVE_INFINITY){let E=[];if(R===0)return[E,A];let $=A[Symbol.iterator]();for(let N=0;N<R;N++){let q=$.next();if(q.done)return[E,t.empty()];E.push(q.value)}return[E,{[Symbol.iterator](){return $}}]}t.consume=T;async function k(A){let R=[];for await(let E of A)R.push(E);return Promise.resolve(R)}t.asyncToArray=k})(f6||(f6={}));function d6(t){if(f6.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function p6(...t){return sn(()=>d6(t))}function sn(t){return{dispose:Ure(()=>{t()})}}var m6=class g6{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{d6(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?g6.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};m6.DISABLE_DISPOSED_WARNING=!1;var eh=m6,Fs=class{constructor(){this._store=new eh,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Fs.None=Object.freeze({dispose(){}});var Iu=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){var e;this._isDisposed||t===this._value||((e=this._value)==null||e.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,(t=this._value)==null||t.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},zw=typeof process<"u"&&"title"in process,EO=zw?"node":navigator.userAgent,Yre=zw?"node":navigator.platform,Hre=EO.includes("Firefox"),Fre=EO.includes("Edge"),O6=/^((?!chrome|android).)*safari/i.test(EO);function Gre(){if(!O6)return 0;let t=EO.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}Yre.indexOf("Linux")>=0;var Kre="",Ai=0,Ei=0,Mi=0,qt=0,ys={css:"#00000000",rgba:0},gn;(t=>{function e(s,r,o,l){return l!==void 0?`#${sl(s)}${sl(r)}${sl(o)}${sl(l)}`:`#${sl(s)}${sl(r)}${sl(o)}`}t.toCss=e;function i(s,r,o,l=255){return(s<<24|r<<16|o<<8|l)>>>0}t.toRgba=i;function n(s,r,o,l){return{css:t.toCss(s,r,o,l),rgba:t.toRgba(s,r,o,l)}}t.toColor=n})(gn||(gn={}));var af;(t=>{function e(c,u){if(qt=(u.rgba&255)/255,qt===1)return{css:u.css,rgba:u.rgba};let d=u.rgba>>24&255,p=u.rgba>>16&255,g=u.rgba>>8&255,O=c.rgba>>24&255,_=c.rgba>>16&255,b=c.rgba>>8&255;Ai=O+Math.round((d-O)*qt),Ei=_+Math.round((p-_)*qt),Mi=b+Math.round((g-b)*qt);let S=gn.toCss(Ai,Ei,Mi),w=gn.toRgba(Ai,Ei,Mi);return{css:S,rgba:w}}t.blend=e;function i(c){return(c.rgba&255)===255}t.isOpaque=i;function n(c,u,d){let p=Cl.ensureContrastRatio(c.rgba,u.rgba,d);if(p)return gn.toColor(p>>24&255,p>>16&255,p>>8&255)}t.ensureContrastRatio=n;function s(c){let u=(c.rgba|255)>>>0;return[Ai,Ei,Mi]=Cl.toChannels(u),{css:gn.toCss(Ai,Ei,Mi),rgba:u}}t.opaque=s;function r(c,u){return qt=Math.round(u*255),[Ai,Ei,Mi]=Cl.toChannels(c.rgba),{css:gn.toCss(Ai,Ei,Mi,qt),rgba:gn.toRgba(Ai,Ei,Mi,qt)}}t.opacity=r;function o(c,u){return qt=c.rgba&255,r(c,qt*u/255)}t.multiplyOpacity=o;function l(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}t.toColorRGB=l})(af||(af={}));var Jre;(t=>{let e,i;try{let s=document.createElement("canvas");s.width=1,s.height=1;let r=s.getContext("2d",{willReadFrequently:!0});r&&(e=r,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return Ai=parseInt(s.slice(1,2).repeat(2),16),Ei=parseInt(s.slice(2,3).repeat(2),16),Mi=parseInt(s.slice(3,4).repeat(2),16),gn.toColor(Ai,Ei,Mi);case 5:return Ai=parseInt(s.slice(1,2).repeat(2),16),Ei=parseInt(s.slice(2,3).repeat(2),16),Mi=parseInt(s.slice(3,4).repeat(2),16),qt=parseInt(s.slice(4,5).repeat(2),16),gn.toColor(Ai,Ei,Mi,qt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let r=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return Ai=parseInt(r[1]),Ei=parseInt(r[2]),Mi=parseInt(r[3]),qt=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),gn.toColor(Ai,Ei,Mi,qt);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=s,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Ai,Ei,Mi,qt]=e.getImageData(0,0,1,1).data,qt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:gn.toRgba(Ai,Ei,Mi,qt),css:s}}t.toColor=n})(Jre||(Jre={}));var dn;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,s,r){let o=n/255,l=s/255,c=r/255,u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return u*.2126+d*.7152+p*.0722}t.relativeLuminance2=i})(dn||(dn={}));var Cl;(t=>{function e(o,l){if(qt=(l&255)/255,qt===1)return l;let c=l>>24&255,u=l>>16&255,d=l>>8&255,p=o>>24&255,g=o>>16&255,O=o>>8&255;return Ai=p+Math.round((c-p)*qt),Ei=g+Math.round((u-g)*qt),Mi=O+Math.round((d-O)*qt),gn.toRgba(Ai,Ei,Mi)}t.blend=e;function i(o,l,c){let u=dn.relativeLuminance(o>>8),d=dn.relativeLuminance(l>>8);if(ro(u,d)<c){if(d<u){let O=n(o,l,c),_=ro(u,dn.relativeLuminance(O>>8));if(_<c){let b=s(o,l,c),S=ro(u,dn.relativeLuminance(b>>8));return _>S?O:b}return O}let p=s(o,l,c),g=ro(u,dn.relativeLuminance(p>>8));if(g<c){let O=n(o,l,c),_=ro(u,dn.relativeLuminance(O>>8));return g>_?p:O}return p}}t.ensureContrastRatio=i;function n(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=ro(dn.relativeLuminance2(g,O,_),dn.relativeLuminance2(u,d,p));for(;b<c&&(g>0||O>0||_>0);)g-=Math.max(0,Math.ceil(g*.1)),O-=Math.max(0,Math.ceil(O*.1)),_-=Math.max(0,Math.ceil(_*.1)),b=ro(dn.relativeLuminance2(g,O,_),dn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.reduceLuminance=n;function s(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=ro(dn.relativeLuminance2(g,O,_),dn.relativeLuminance2(u,d,p));for(;b<c&&(g<255||O<255||_<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),O=Math.min(255,O+Math.ceil((255-O)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),b=ro(dn.relativeLuminance2(g,O,_),dn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.increaseLuminance=s;function r(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=r})(Cl||(Cl={}));function sl(t){let e=t.toString(16);return e.length<2?"0"+e:e}function ro(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}function li(t){if(!t)throw new Error("value must not be falsy");return t}function jw(t){return 57508<=t&&t<=57558}function eoe(t){return 57520<=t&&t<=57527}function toe(t){return 57344<=t&&t<=63743}function ioe(t){return 9472<=t&&t<=9631}function noe(t){return t>=128512&&t<=128591||t>=127744&&t<=128511||t>=128640&&t<=128767||t>=9728&&t<=9983||t>=9984&&t<=10175||t>=65024&&t<=65039||t>=129280&&t<=129535||t>=127462&&t<=127487}function soe(t,e,i,n){return e===1&&i>Math.ceil(n*1.5)&&t!==void 0&&t>255&&!noe(t)&&!jw(t)&&!toe(t)}function v6(t){return jw(t)||ioe(t)}function roe(){return{css:{canvas:Tm(),cell:Tm()},device:{canvas:Tm(),cell:Tm(),char:{width:0,height:0,left:0,top:0}}}}function Tm(){return{width:0,height:0}}function ooe(t,e,i=0){return(t-(Math.round(e)*2-i))%(Math.round(e)*2)}var Xi=0,Si=0,hr=!1,oo=!1,Am=!1,Pn,Wy=0,aoe=class{constructor(t,e,i,n,s,r){this._terminal=t,this._optionService=e,this._selectionRenderModel=i,this._decorationService=n,this._coreBrowserService=s,this._themeService=r,this.result={fg:0,bg:0,ext:0}}resolve(t,e,i,n){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=t.bg&268435456?t.extended.ext:0,Si=0,Xi=0,oo=!1,hr=!1,Am=!1,Pn=this._themeService.colors,Wy=0,t.getCode()!==0&&t.extended.underlineStyle===4){let s=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));Wy=e*n%(Math.round(s)*2)}if(this._decorationService.forEachDecorationAtCell(e,i,"bottom",s=>{s.backgroundColorRGB&&(Si=s.backgroundColorRGB.rgba>>8&16777215,oo=!0),s.foregroundColorRGB&&(Xi=s.foregroundColorRGB.rgba>>8&16777215,hr=!0)}),Am=this._selectionRenderModel.isCellSelected(this._terminal,e,i),Am){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:Si=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Si=(this.result.fg&16777215)<<8|255;break;case 0:default:Si=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:Si=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Si=(this.result.bg&16777215)<<8|255;break}Si=Cl.blend(Si,(this._coreBrowserService.isFocused?Pn.selectionBackgroundOpaque:Pn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else Si=(this._coreBrowserService.isFocused?Pn.selectionBackgroundOpaque:Pn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(oo=!0,Pn.selectionForeground&&(Xi=Pn.selectionForeground.rgba>>8&16777215,hr=!0),v6(t.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Xi=(this._coreBrowserService.isFocused?Pn.selectionBackgroundOpaque:Pn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Xi=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Xi=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Xi=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Xi=(this.result.fg&16777215)<<8|255;break;case 0:default:Xi=this._themeService.colors.foreground.rgba}Xi=Cl.blend(Xi,(this._coreBrowserService.isFocused?Pn.selectionBackgroundOpaque:Pn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}hr=!0}}this._decorationService.forEachDecorationAtCell(e,i,"top",s=>{s.backgroundColorRGB&&(Si=s.backgroundColorRGB.rgba>>8&16777215,oo=!0),s.foregroundColorRGB&&(Xi=s.foregroundColorRGB.rgba>>8&16777215,hr=!0)}),oo&&(Am?Si=t.bg&-16777216&-134217729|Si|50331648:Si=t.bg&-16777216|Si|50331648),hr&&(Xi=t.fg&-16777216&-67108865|Xi|50331648),this.result.fg&67108864&&(oo&&!hr&&((this.result.bg&50331648)===0?Xi=this.result.fg&-134217728|Pn.background.rgba>>8&16777215&16777215|50331648:Xi=this.result.fg&-134217728|this.result.bg&67108863,hr=!0),!oo&&hr&&((this.result.fg&50331648)===0?Si=this.result.bg&-67108864|Pn.foreground.rgba>>8&16777215&16777215|50331648:Si=this.result.bg&-67108864|this.result.fg&67108863,oo=!0)),Pn=void 0,this.result.bg=oo?Si:this.result.bg,this.result.fg=hr?Xi:this.result.fg,this.result.ext&=536870911,this.result.ext|=Wy<<29&3758096384}},loe=.5,_6=Hre||Fre?"bottom":"ideographic",coe={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},hoe={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},uoe={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╒":{1:(t,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(t,e)=>`M${.5-t},1 L${.5-t},.5 L1,.5 M${.5+t},.5 L${.5+t},1`},"╔":{1:(t,e)=>`M1,${.5-e} L${.5-t},${.5-e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╕":{1:(t,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(t,e)=>`M${.5+t},1 L${.5+t},.5 L0,.5 M${.5-t},.5 L${.5-t},1`},"╗":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5+t},${.5-e} L${.5+t},1`},"╘":{1:(t,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(t,e)=>`M1,.5 L${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╚":{1:(t,e)=>`M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0 M1,${.5+e} L${.5-t},${.5+e} L${.5-t},0`},"╛":{1:(t,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(t,e)=>`M0,.5 L${.5+t},.5 L${.5+t},0 M${.5-t},.5 L${.5-t},0`},"╝":{1:(t,e)=>`M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M0,${.5+e} L${.5+t},${.5+e} L${.5+t},0`},"╞":{1:(t,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1 M${.5+t},.5 L1,.5`},"╠":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╡":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(t,e)=>`M0,.5 L${.5-t},.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╣":{1:(t,e)=>`M${.5+t},0 L${.5+t},1 M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0`},"╤":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},1 M${.5+t},.5 L${.5+t},1`},"╦":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╧":{1:(t,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╩":{1:(t,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╪":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╬":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},sd={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};sd[""]=sd[""];sd[""]=sd[""];function foe(t,e,i,n,s,r,o,l){let c=coe[e];if(c)return doe(t,c,i,n,s,r),!0;let u=hoe[e];if(u)return poe(t,u,i,n,s,r),!0;let d=uoe[e];if(d)return moe(t,d,i,n,s,r,l),!0;let p=sd[e];return p?(goe(t,p,i,n,s,r,o,l),!0):!1}function doe(t,e,i,n,s,r){for(let o=0;o<e.length;o++){let l=e[o],c=s/8,u=r/8;t.fillRect(i+l.x*c,n+l.y*u,l.w*c,l.h*u)}}var $R=new Map;function poe(t,e,i,n,s,r){let o=$R.get(e);o||(o=new Map,$R.set(e,o));let l=t.fillStyle;if(typeof l!="string")throw new Error(`Unexpected fillStyle type "${l}"`);let c=o.get(l);if(!c){let u=e[0].length,d=e.length,p=t.canvas.ownerDocument.createElement("canvas");p.width=u,p.height=d;let g=li(p.getContext("2d")),O=new ImageData(u,d),_,b,S,w;if(l.startsWith("#"))_=parseInt(l.slice(1,3),16),b=parseInt(l.slice(3,5),16),S=parseInt(l.slice(5,7),16),w=l.length>7&&parseInt(l.slice(7,9),16)||1;else if(l.startsWith("rgba"))[_,b,S,w]=l.substring(5,l.length-1).split(",").map(T=>parseFloat(T));else throw new Error(`Unexpected fillStyle color format "${l}" when drawing pattern glyph`);for(let T=0;T<d;T++)for(let k=0;k<u;k++)O.data[(T*u+k)*4]=_,O.data[(T*u+k)*4+1]=b,O.data[(T*u+k)*4+2]=S,O.data[(T*u+k)*4+3]=e[T][k]*(w*255);g.putImageData(O,0,0),c=li(t.createPattern(p,null)),o.set(l,c)}t.fillStyle=c,t.fillRect(i,n,s,r)}function moe(t,e,i,n,s,r,o){t.strokeStyle=t.fillStyle;for(let[l,c]of Object.entries(e)){t.beginPath(),t.lineWidth=o*Number.parseInt(l);let u;if(typeof c=="function"){let d=.15/r*s;u=c(.15,d)}else u=c;for(let d of u.split(" ")){let p=d[0],g=y6[p];if(!g){console.error(`Could not find drawing instructions for "${p}"`);continue}let O=d.substring(1).split(",");!O[0]||!O[1]||g(t,b6(O,s,r,i,n,!0,o))}t.stroke(),t.closePath()}}function goe(t,e,i,n,s,r,o,l){let c=new Path2D;c.rect(i,n,s,r),t.clip(c),t.beginPath();let u=o/12;t.lineWidth=l*u;for(let d of e.d.split(" ")){let p=d[0],g=y6[p];if(!g){console.error(`Could not find drawing instructions for "${p}"`);continue}let O=d.substring(1).split(",");!O[0]||!O[1]||g(t,b6(O,s,r,i,n,!1,l,(e.leftPadding??0)*(u/2),(e.rightPadding??0)*(u/2)))}e.type===1?(t.strokeStyle=t.fillStyle,t.stroke()):t.fill(),t.closePath()}function NR(t,e,i=0){return Math.max(Math.min(t,e),i)}var y6={C:(t,e)=>t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(t,e)=>t.lineTo(e[0],e[1]),M:(t,e)=>t.moveTo(e[0],e[1])};function b6(t,e,i,n,s,r,o,l=0,c=0){let u=t.map(d=>parseFloat(d)||parseInt(d));if(u.length<2)throw new Error("Too few arguments for instruction");for(let d=0;d<u.length;d+=2)u[d]*=e-l*o-c*o,r&&u[d]!==0&&(u[d]=NR(Math.round(u[d]+.5)-.5,e,0)),u[d]+=n+l*o;for(let d=1;d<u.length;d+=2)u[d]*=i,r&&u[d]!==0&&(u[d]=NR(Math.round(u[d]+.5)-.5,i,0)),u[d]+=s;return u}var zR=class{constructor(){this._data={}}set(t,e,i){this._data[t]||(this._data[t]={}),this._data[t][e]=i}get(t,e){return this._data[t]?this._data[t][e]:void 0}clear(){this._data={}}},jR=class{constructor(){this._data=new zR}set(t,e,i,n,s){this._data.get(t,e)||this._data.set(t,e,new zR),this._data.get(t,e).set(i,n,s)}get(t,e,i,n){var s;return(s=this._data.get(t,e))==null?void 0:s.get(i,n)}clear(){this._data.clear()}},x6=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(t){this._idleCallback=void 0;let e=0,i=0,n=t.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(e=performance.now(),this._tasks[this._i]()||this._i++,e=Math.max(1,performance.now()-e),i=Math.max(e,i),s=t.timeRemaining(),i*1.5>s){n-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-e))}ms`),this._start();return}n=s}this.clear()}},Ooe=class extends x6{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let e=performance.now()+t;return{timeRemaining:()=>Math.max(0,e-performance.now())}}},voe=class extends x6{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},_oe=!zw&&"requestIdleCallback"in window?voe:Ooe,Xc=class S6{constructor(){this.fg=0,this.bg=0,this.extended=new w6}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new S6;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},w6=class C6{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new C6(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},yoe=globalThis.performance&&typeof globalThis.performance.now=="function",boe=class k6{static create(e){return new k6(e)}constructor(e){this._now=yoe&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},mo;(t=>{t.None=()=>Fs.None;function e(Q,D){return p(Q,()=>{},0,void 0,!0,void 0,D)}t.defer=e;function i(Q){return(D,z=null,j)=>{let B=!1,Z;return Z=Q(H=>{if(!B)return Z?Z.dispose():B=!0,D.call(z,H)},null,j),B&&Z.dispose(),Z}}t.once=i;function n(Q,D,z){return u((j,B=null,Z)=>Q(H=>j.call(B,D(H)),null,Z),z)}t.map=n;function s(Q,D,z){return u((j,B=null,Z)=>Q(H=>{D(H),j.call(B,H)},null,Z),z)}t.forEach=s;function r(Q,D,z){return u((j,B=null,Z)=>Q(H=>D(H)&&j.call(B,H),null,Z),z)}t.filter=r;function o(Q){return Q}t.signal=o;function l(...Q){return(D,z=null,j)=>{let B=p6(...Q.map(Z=>Z(H=>D.call(z,H))));return d(B,j)}}t.any=l;function c(Q,D,z,j){let B=z;return n(Q,Z=>(B=D(B,Z),B),j)}t.reduce=c;function u(Q,D){let z,j={onWillAddFirstListener(){z=Q(B.fire,B)},onDidRemoveLastListener(){z==null||z.dispose()}},B=new Rt(j);return D==null||D.add(B),B.event}function d(Q,D){return D instanceof Array?D.push(Q):D&&D.add(Q),Q}function p(Q,D,z=100,j=!1,B=!1,Z,H){let F,M,V,J=0,L,ue={leakWarningThreshold:Z,onWillAddFirstListener(){F=Q(fe=>{J++,M=D(M,fe),j&&!V&&(he.fire(M),M=void 0),L=()=>{let Oe=M;M=void 0,V=void 0,(!j||J>1)&&he.fire(Oe),J=0},typeof z=="number"?(clearTimeout(V),V=setTimeout(L,z)):V===void 0&&(V=0,queueMicrotask(L))})},onWillRemoveListener(){B&&J>0&&(L==null||L())},onDidRemoveLastListener(){L=void 0,F.dispose()}},he=new Rt(ue);return H==null||H.add(he),he.event}t.debounce=p;function g(Q,D=0,z){return t.debounce(Q,(j,B)=>j?(j.push(B),j):[B],D,void 0,!0,void 0,z)}t.accumulate=g;function O(Q,D=(j,B)=>j===B,z){let j=!0,B;return r(Q,Z=>{let H=j||!D(Z,B);return j=!1,B=Z,H},z)}t.latch=O;function _(Q,D,z){return[t.filter(Q,D,z),t.filter(Q,j=>!D(j),z)]}t.split=_;function b(Q,D=!1,z=[],j){let B=z.slice(),Z=Q(M=>{B?B.push(M):F.fire(M)});j&&j.add(Z);let H=()=>{B==null||B.forEach(M=>F.fire(M)),B=null},F=new Rt({onWillAddFirstListener(){Z||(Z=Q(M=>F.fire(M)),j&&j.add(Z))},onDidAddFirstListener(){B&&(D?setTimeout(H):H())},onDidRemoveLastListener(){Z&&Z.dispose(),Z=null}});return j&&j.add(F),F.event}t.buffer=b;function S(Q,D){return(z,j,B)=>{let Z=D(new T);return Q(function(H){let F=Z.evaluate(H);F!==w&&z.call(j,F)},void 0,B)}}t.chain=S;let w=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(D){return this.steps.push(D),this}forEach(D){return this.steps.push(z=>(D(z),z)),this}filter(D){return this.steps.push(z=>D(z)?z:w),this}reduce(D,z){let j=z;return this.steps.push(B=>(j=D(j,B),j)),this}latch(D=(z,j)=>z===j){let z=!0,j;return this.steps.push(B=>{let Z=z||!D(B,j);return z=!1,j=B,Z?B:w}),this}evaluate(D){for(let z of this.steps)if(D=z(D),D===w)break;return D}}function k(Q,D,z=j=>j){let j=(...F)=>H.fire(z(...F)),B=()=>Q.on(D,j),Z=()=>Q.removeListener(D,j),H=new Rt({onWillAddFirstListener:B,onDidRemoveLastListener:Z});return H.event}t.fromNodeEventEmitter=k;function A(Q,D,z=j=>j){let j=(...F)=>H.fire(z(...F)),B=()=>Q.addEventListener(D,j),Z=()=>Q.removeEventListener(D,j),H=new Rt({onWillAddFirstListener:B,onDidRemoveLastListener:Z});return H.event}t.fromDOMEventEmitter=A;function R(Q){return new Promise(D=>i(Q)(D))}t.toPromise=R;function E(Q){let D=new Rt;return Q.then(z=>{D.fire(z)},()=>{D.fire(void 0)}).finally(()=>{D.dispose()}),D.event}t.fromPromise=E;function $(Q,D){return Q(z=>D.fire(z))}t.forward=$;function N(Q,D,z){return D(z),Q(j=>D(j))}t.runAndSubscribe=N;class q{constructor(D,z){this._observable=D,this._counter=0,this._hasChanged=!1;let j={onWillAddFirstListener:()=>{D.addObserver(this)},onDidRemoveLastListener:()=>{D.removeObserver(this)}};this.emitter=new Rt(j),z&&z.add(this.emitter)}beginUpdate(D){this._counter++}handlePossibleChange(D){}handleChange(D,z){this._hasChanged=!0}endUpdate(D){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function G(Q,D){return new q(Q,D).emitter.event}t.fromObservable=G;function U(Q){return(D,z,j)=>{let B=0,Z=!1,H={beginUpdate(){B++},endUpdate(){B--,B===0&&(Q.reportChanges(),Z&&(Z=!1,D.call(z)))},handlePossibleChange(){},handleChange(){Z=!0}};Q.addObserver(H),Q.reportChanges();let F={dispose(){Q.removeObserver(H)}};return j instanceof eh?j.add(F):Array.isArray(j)&&j.push(F),F}}t.fromObservableLight=U})(mo||(mo={}));var Mx=class Px{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Px._idPool++}`,Px.all.add(this)}start(e){this._stopWatch=new boe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};Mx.all=new Set,Mx._idPool=0;var xoe=Mx,Soe=-1,T6=class A6{constructor(e,i,n=(A6._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,i){let n=this.threshold;if(n<=0||i<n)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[r,o]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(l),console.warn(r);let c=new koe(l,r);this._errorHandler(c)}return()=>{let r=this._stacks.get(e.value)||0;this._stacks.set(e.value,r-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[n,s]of this._stacks)(!e||i<s)&&(e=[n,s],i=s);return e}};T6._idPool=1;var woe=T6,Coe=class E6{constructor(e){this.value=e}static create(){let e=new Error;return new E6(e.stack??"")}print(){console.warn(this.value.split(`
146
- `).slice(2).join(`
147
- `))}},koe=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},Toe=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},Aoe=0,Uy=class{constructor(t){this.value=t,this.id=Aoe++}},Eoe=2,Moe,Rt=class{constructor(e){var i,n,s,r;this._size=0,this._options=e,this._leakageMon=(i=this._options)!=null&&i.leakWarningThreshold?new woe((e==null?void 0:e.onListenerError)??qy,((n=this._options)==null?void 0:n.leakWarningThreshold)??Soe):void 0,this._perfMon=(s=this._options)!=null&&s._profName?new xoe(this._options._profName):void 0,this._deliveryQueue=(r=this._options)==null?void 0:r.deliveryQueue}dispose(){var e,i,n,s;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(i=this._options)==null?void 0:i.onDidRemoveLastListener)==null||n.call(i),(s=this._leakageMon)==null||s.dispose())}get event(){return this._event??(this._event=(e,i,n)=>{var l,c,u,d,p;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let g=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(g);let O=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],_=new Toe(`${g}. HINT: Stack shows most frequent listener (${O[1]}-times)`,O[0]);return(((l=this._options)==null?void 0:l.onListenerError)||qy)(_),Fs.None}if(this._disposed)return Fs.None;i&&(e=e.bind(i));let s=new Uy(e),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=Coe.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof Uy?(this._deliveryQueue??(this._deliveryQueue=new Poe),this._listeners=[this._listeners,s]):this._listeners.push(s):((u=(c=this._options)==null?void 0:c.onWillAddFirstListener)==null||u.call(c,this),this._listeners=s,(p=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||p.call(d,this)),this._size++;let o=sn(()=>{r==null||r(),this._removeListener(s)});return n instanceof eh?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}_removeListener(e){var r,o,l,c;if((o=(r=this._options)==null?void 0:r.onWillRemoveListener)==null||o.call(r,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(c=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||c.call(l,this),this._size=0;return}let i=this._listeners,n=i.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[n]=void 0;let s=this._deliveryQueue.current===this;if(this._size*Eoe<=i.length){let u=0;for(let d=0;d<i.length;d++)i[d]?i[u++]=i[d]:s&&(this._deliveryQueue.end--,u<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=u}}_deliver(e,i){var s;if(!e)return;let n=((s=this._options)==null?void 0:s.onListenerError)||qy;if(!n){e.value(i);return}try{e.value(i)}catch(r){n(r)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){var i,n,s,r;if((i=this._deliveryQueue)!=null&&i.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(s=this._perfMon)==null||s.start(this._size),this._listeners)if(this._listeners instanceof Uy)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(r=this._perfMon)==null||r.stop()}hasListeners(){return this._size>0}},Poe=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},IR={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},Vu=2,Xu,fa=class Qc{constructor(e,i,n){this._document=e,this._config=i,this._unicodeService=n,this._didWarmUp=!1,this._cacheMap=new jR,this._cacheMapCombined=new jR,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Xc,this._textureSize=512,this._onAddTextureAtlasCanvas=new Rt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Rt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=M6(e,this._config.deviceCellWidth*4+Vu*2,this._config.deviceCellHeight+Vu*2),this._tmpCtx=li(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let e=new _oe;for(let i=33;i<126;i++)e.enqueue(()=>{if(!this._cacheMap.get(i,0,0,0)){let n=this._drawToCache(i,0,0,0,!1,void 0);this._cacheMap.set(i,0,0,0,n)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Qc.maxAtlasPages&&this._pages.length>=Math.max(4,Qc.maxAtlasPages)){let i=this._pages.filter(u=>u.canvas.width*2<=(Qc.maxTextureSize||4096)).sort((u,d)=>d.canvas.width!==u.canvas.width?d.canvas.width-u.canvas.width:d.percentageUsed-u.percentageUsed),n=-1,s=0;for(let u=0;u<i.length;u++)if(i[u].canvas.width!==s)n=u,s=i[u].canvas.width;else if(u-n===3)break;let r=i.slice(n,n+4),o=r.map(u=>u.glyphs[0].texturePage).sort((u,d)=>u>d?1:-1),l=this.pages.length-r.length,c=this._mergePages(r,l);c.version++;for(let u=o.length-1;u>=0;u--)this._deletePage(o[u]);this.pages.push(c),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(c.canvas)}let e=new Yy(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,i){let n=e[0].canvas.width*2,s=new Yy(this._document,n,e);for(let[r,o]of e.entries()){let l=r*o.canvas.width%n,c=Math.floor(r/2)*o.canvas.height;s.ctx.drawImage(o.canvas,l,c);for(let d of o.glyphs)d.texturePage=i,d.sizeClipSpace.x=d.size.x/n,d.sizeClipSpace.y=d.size.y/n,d.texturePosition.x+=l,d.texturePosition.y+=c,d.texturePositionClipSpace.x=d.texturePosition.x/n,d.texturePositionClipSpace.y=d.texturePosition.y/n;this._onRemoveTextureAtlasCanvas.fire(o.canvas);let u=this._activePages.indexOf(o);u!==-1&&this._activePages.splice(u,1)}return s}_deletePage(e){this._pages.splice(e,1);for(let i=e;i<this._pages.length;i++){let n=this._pages[i];for(let s of n.glyphs)s.texturePage--;n.version++}}getRasterizedGlyphCombinedChar(e,i,n,s,r,o){return this._getFromCacheMap(this._cacheMapCombined,e,i,n,s,r,o)}getRasterizedGlyph(e,i,n,s,r,o){return this._getFromCacheMap(this._cacheMap,e,i,n,s,r,o)}_getFromCacheMap(e,i,n,s,r,o,l){return Xu=e.get(i,n,s,r),Xu||(Xu=this._drawToCache(i,n,s,r,o,l),e.set(i,n,s,r,Xu)),Xu}_getColorFromAnsiIndex(e){if(e>=this._config.colors.ansi.length)throw new Error("No color found for idx "+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,i,n,s){if(this._config.allowTransparency)return ys;let r;switch(e){case 16777216:case 33554432:r=this._getColorFromAnsiIndex(i);break;case 50331648:let o=Xc.toColorRGB(i);r=gn.toColor(o[0],o[1],o[2]);break;case 0:default:n?r=af.opaque(this._config.colors.foreground):r=this._config.colors.background;break}return this._config.allowTransparency||(r=af.opaque(r)),r}_getForegroundColor(e,i,n,s,r,o,l,c,u,d){let p=this._getMinimumContrastColor(e,i,n,s,r,o,l,u,c,d);if(p)return p;let g;switch(r){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&u&&o<8&&(o+=8),g=this._getColorFromAnsiIndex(o);break;case 50331648:let O=Xc.toColorRGB(o);g=gn.toColor(O[0],O[1],O[2]);break;case 0:default:l?g=this._config.colors.background:g=this._config.colors.foreground}return this._config.allowTransparency&&(g=af.opaque(g)),c&&(g=af.multiplyOpacity(g,loe)),g}_resolveBackgroundRgba(e,i,n){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;case 0:default:return n?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,i,n,s){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&s&&i<8&&(i+=8),this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;case 0:default:return n?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,i,n,s,r,o,l,c,u,d){if(this._config.minimumContrastRatio===1||d)return;let p=this._getContrastCache(u),g=p.getColor(e,s);if(g!==void 0)return g||void 0;let O=this._resolveBackgroundRgba(i,n,l),_=this._resolveForegroundRgba(r,o,l,c),b=Cl.ensureContrastRatio(O,_,this._config.minimumContrastRatio/(u?2:1));if(!b){p.setColor(e,s,null);return}let S=gn.toColor(b>>24&255,b>>16&255,b>>8&255);return p.setColor(e,s,S),S}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(e,i,n,s,r,o){let l=typeof e=="number"?String.fromCharCode(e):e;o&&this._tmpCanvas.parentElement!==o&&(this._tmpCanvas.style.display="none",o.append(this._tmpCanvas));let c=Math.min(this._config.deviceCellWidth*Math.max(l.length,2)+Vu*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<c&&(this._tmpCanvas.width=c);let u=Math.min(this._config.deviceCellHeight+Vu*4,this._textureSize);if(this._tmpCanvas.height<u&&(this._tmpCanvas.height=u),this._tmpCtx.save(),this._workAttributeData.fg=n,this._workAttributeData.bg=i,this._workAttributeData.extended.ext=s,!!this._workAttributeData.isInvisible())return IR;let d=!!this._workAttributeData.isBold(),p=!!this._workAttributeData.isInverse(),g=!!this._workAttributeData.isDim(),O=!!this._workAttributeData.isItalic(),_=!!this._workAttributeData.isUnderline(),b=!!this._workAttributeData.isStrikethrough(),S=!!this._workAttributeData.isOverline(),w=this._workAttributeData.getFgColor(),T=this._workAttributeData.getFgColorMode(),k=this._workAttributeData.getBgColor(),A=this._workAttributeData.getBgColorMode();if(p){let M=w;w=k,k=M;let V=T;T=A,A=V}let R=this._getBackgroundColor(A,k,p,g);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=R.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let E=d?this._config.fontWeightBold:this._config.fontWeight,$=O?"italic":"";this._tmpCtx.font=`${$} ${E} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=_6;let N=l.length===1&&jw(l.charCodeAt(0)),q=l.length===1&&eoe(l.charCodeAt(0)),G=this._getForegroundColor(i,A,k,n,T,w,p,g,d,v6(l.charCodeAt(0)));this._tmpCtx.fillStyle=G.css;let U=q?0:Vu*2,Q=!1;this._config.customGlyphs!==!1&&(Q=foe(this._tmpCtx,l,U,U,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let D=!N,z;if(typeof e=="number"?z=this._unicodeService.wcwidth(e):z=this._unicodeService.getStringCellWidth(e),_){this._tmpCtx.save();let M=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),V=M%2===1?.5:0;if(this._tmpCtx.lineWidth=M,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())D=!1,this._tmpCtx.strokeStyle=`rgb(${Xc.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{D=!1;let Oe=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Oe<8&&(Oe+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Oe).css}this._tmpCtx.beginPath();let J=U,L=Math.ceil(U+this._config.deviceCharHeight)-V-(r?M*2:0),ue=L+M,he=L+M*2,fe=this._workAttributeData.getUnderlineVariantOffset();for(let Oe=0;Oe<z;Oe++){this._tmpCtx.save();let Ce=J+Oe*this._config.deviceCellWidth,ye=J+(Oe+1)*this._config.deviceCellWidth,nt=Ce+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ce,L),this._tmpCtx.lineTo(ye,L),this._tmpCtx.moveTo(Ce,he),this._tmpCtx.lineTo(ye,he);break;case 3:let Qt=M<=1?he:Math.ceil(U+this._config.deviceCharHeight-M/2)-V,Yt=M<=1?L:Math.ceil(U+this._config.deviceCharHeight+M/2)-V,ei=new Path2D;ei.rect(Ce,L,this._config.deviceCellWidth,he-L),this._tmpCtx.clip(ei),this._tmpCtx.moveTo(Ce-this._config.deviceCellWidth/2,ue),this._tmpCtx.bezierCurveTo(Ce-this._config.deviceCellWidth/2,Yt,Ce,Yt,Ce,ue),this._tmpCtx.bezierCurveTo(Ce,Qt,nt,Qt,nt,ue),this._tmpCtx.bezierCurveTo(nt,Yt,ye,Yt,ye,ue),this._tmpCtx.bezierCurveTo(ye,Qt,ye+this._config.deviceCellWidth/2,Qt,ye+this._config.deviceCellWidth/2,ue);break;case 4:let Le=fe===0?0:fe>=M?M*2-fe:M-fe;fe>=M||Le===0?(this._tmpCtx.setLineDash([Math.round(M),Math.round(M)]),this._tmpCtx.moveTo(Ce+Le,L),this._tmpCtx.lineTo(ye,L)):(this._tmpCtx.setLineDash([Math.round(M),Math.round(M)]),this._tmpCtx.moveTo(Ce,L),this._tmpCtx.lineTo(Ce+Le,L),this._tmpCtx.moveTo(Ce+Le+M,L),this._tmpCtx.lineTo(ye,L)),fe=ooe(ye-Ce,M,fe);break;case 5:let as=.6,To=.3,Ao=ye-Ce,Da=Math.floor(as*Ao),Br=Math.floor(To*Ao),Eo=Ao-Da-Br;this._tmpCtx.setLineDash([Da,Br,Eo]),this._tmpCtx.moveTo(Ce,L),this._tmpCtx.lineTo(ye,L);break;case 1:default:this._tmpCtx.moveTo(Ce,L),this._tmpCtx.lineTo(ye,L);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Q&&this._config.fontSize>=12&&!this._config.allowTransparency&&l!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let Oe=this._tmpCtx.measureText(l);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Oe&&Oe.actualBoundingBoxDescent>0){this._tmpCtx.save();let Ce=new Path2D;Ce.rect(J,L-Math.ceil(M/2),this._config.deviceCellWidth*z,he-L+Math.ceil(M/2)),this._tmpCtx.clip(Ce),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=R.css,this._tmpCtx.strokeText(l,U,U+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(S){let M=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),V=M%2===1?.5:0;this._tmpCtx.lineWidth=M,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+V),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*z,U+V),this._tmpCtx.stroke()}if(Q||this._tmpCtx.fillText(l,U,U+this._config.deviceCharHeight),l==="_"&&!this._config.allowTransparency){let M=Hy(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),R,G,D);if(M)for(let V=1;V<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=R.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(l,U,U+this._config.deviceCharHeight-V),M=Hy(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),R,G,D),!!M);V++);}if(b){let M=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),V=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=M,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+Math.floor(this._config.deviceCharHeight/2)-V),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*z,U+Math.floor(this._config.deviceCharHeight/2)-V),this._tmpCtx.stroke()}this._tmpCtx.restore();let j=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),B;if(this._config.allowTransparency?B=Roe(j):B=Hy(j,R,G,D),B)return IR;let Z=this._findGlyphBoundingBox(j,this._workBoundingBox,c,q,Q,U),H,F;for(;;){if(this._activePages.length===0){let M=this._createNewPage();H=M,F=M.currentRow,F.height=Z.size.y;break}H=this._activePages[this._activePages.length-1],F=H.currentRow;for(let M of this._activePages)Z.size.y<=M.currentRow.height&&(H=M,F=M.currentRow);for(let M=this._activePages.length-1;M>=0;M--)for(let V of this._activePages[M].fixedRows)V.height<=F.height&&Z.size.y<=V.height&&(H=this._activePages[M],F=V);if(Z.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new Yy(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),H=this._overflowSizePage,F=this._overflowSizePage.currentRow,F.x+Z.size.x>=H.canvas.width&&(F.x=0,F.y+=F.height,F.height=0);break}if(F.y+Z.size.y>=H.canvas.height||F.height>Z.size.y+2){let M=!1;if(H.currentRow.y+H.currentRow.height+Z.size.y>=H.canvas.height){let V;for(let J of this._activePages)if(J.currentRow.y+J.currentRow.height+Z.size.y<J.canvas.height){V=J;break}if(V)H=V;else if(Qc.maxAtlasPages&&this._pages.length>=Qc.maxAtlasPages&&F.y+Z.size.y<=H.canvas.height&&F.height>=Z.size.y&&F.x+Z.size.x<=H.canvas.width)M=!0;else{let J=this._createNewPage();H=J,F=J.currentRow,F.height=Z.size.y,M=!0}}M||(H.currentRow.height>0&&H.fixedRows.push(H.currentRow),F={x:0,y:H.currentRow.y+H.currentRow.height,height:Z.size.y},H.fixedRows.push(F),H.currentRow={x:0,y:F.y+F.height,height:0})}if(F.x+Z.size.x<=H.canvas.width)break;F===H.currentRow?(F.x=0,F.y+=F.height,F.height=0):H.fixedRows.splice(H.fixedRows.indexOf(F),1)}return Z.texturePage=this._pages.indexOf(H),Z.texturePosition.x=F.x,Z.texturePosition.y=F.y,Z.texturePositionClipSpace.x=F.x/H.canvas.width,Z.texturePositionClipSpace.y=F.y/H.canvas.height,Z.sizeClipSpace.x/=H.canvas.width,Z.sizeClipSpace.y/=H.canvas.height,F.height=Math.max(F.height,Z.size.y),F.x+=Z.size.x,H.ctx.putImageData(j,Z.texturePosition.x-this._workBoundingBox.left,Z.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Z.size.x,Z.size.y),H.addGlyph(Z),H.version++,Z}_findGlyphBoundingBox(e,i,n,s,r,o){i.top=0;let l=s?this._config.deviceCellHeight:this._tmpCanvas.height,c=s?this._config.deviceCellWidth:n,u=!1;for(let d=0;d<l;d++){for(let p=0;p<c;p++){let g=d*this._tmpCanvas.width*4+p*4+3;if(e.data[g]!==0){i.top=d,u=!0;break}}if(u)break}i.left=0,u=!1;for(let d=0;d<o+c;d++){for(let p=0;p<l;p++){let g=p*this._tmpCanvas.width*4+d*4+3;if(e.data[g]!==0){i.left=d,u=!0;break}}if(u)break}i.right=c,u=!1;for(let d=o+c-1;d>=o;d--){for(let p=0;p<l;p++){let g=p*this._tmpCanvas.width*4+d*4+3;if(e.data[g]!==0){i.right=d,u=!0;break}}if(u)break}i.bottom=l,u=!1;for(let d=l-1;d>=0;d--){for(let p=0;p<c;p++){let g=d*this._tmpCanvas.width*4+p*4+3;if(e.data[g]!==0){i.bottom=d,u=!0;break}}if(u)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:i.right-i.left+1,y:i.bottom-i.top+1},sizeClipSpace:{x:i.right-i.left+1,y:i.bottom-i.top+1},offset:{x:-i.left+o+(s||r?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-i.top+o+(s||r?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},Yy=class{constructor(t,e,i){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],i)for(let n of i)this._glyphs.push(...n.glyphs),this._usedPixels+=n._usedPixels;this.canvas=M6(t,e,e),this.ctx=li(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(t){this._glyphs.push(t),this._usedPixels+=t.size.x*t.size.y}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}};function Hy(t,e,i,n){let s=e.rgba>>>24,r=e.rgba>>>16&255,o=e.rgba>>>8&255,l=i.rgba>>>24,c=i.rgba>>>16&255,u=i.rgba>>>8&255,d=Math.floor((Math.abs(s-l)+Math.abs(r-c)+Math.abs(o-u))/12),p=!0;for(let g=0;g<t.data.length;g+=4)t.data[g]===s&&t.data[g+1]===r&&t.data[g+2]===o||n&&Math.abs(t.data[g]-s)+Math.abs(t.data[g+1]-r)+Math.abs(t.data[g+2]-o)<d?t.data[g+3]=0:p=!1;return p}function Roe(t){for(let e=0;e<t.data.length;e+=4)if(t.data[e+3]>0)return!1;return!0}function M6(t,e,i){let n=t.createElement("canvas");return n.width=e,n.height=i,n}function Qoe(t,e,i,n,s,r,o,l){let c={foreground:r.foreground,background:r.background,cursor:ys,cursorAccent:ys,selectionForeground:ys,selectionBackgroundTransparent:ys,selectionBackgroundOpaque:ys,selectionInactiveBackgroundTransparent:ys,selectionInactiveBackgroundOpaque:ys,overviewRulerBorder:ys,scrollbarSliderBackground:ys,scrollbarSliderHoverBackground:ys,scrollbarSliderActiveBackground:ys,ansi:r.ansi.slice(),contrastCache:r.contrastCache,halfContrastCache:r.halfContrastCache};return{customGlyphs:s.customGlyphs,devicePixelRatio:o,deviceMaxTextureSize:l,letterSpacing:s.letterSpacing,lineHeight:s.lineHeight,deviceCellWidth:t,deviceCellHeight:e,deviceCharWidth:i,deviceCharHeight:n,fontFamily:s.fontFamily,fontSize:s.fontSize,fontWeight:s.fontWeight,fontWeightBold:s.fontWeightBold,allowTransparency:s.allowTransparency,drawBoldTextInBrightColors:s.drawBoldTextInBrightColors,minimumContrastRatio:s.minimumContrastRatio,colors:c}}function VR(t,e){for(let i=0;i<t.colors.ansi.length;i++)if(t.colors.ansi[i].rgba!==e.colors.ansi[i].rgba)return!1;return t.devicePixelRatio===e.devicePixelRatio&&t.customGlyphs===e.customGlyphs&&t.lineHeight===e.lineHeight&&t.letterSpacing===e.letterSpacing&&t.fontFamily===e.fontFamily&&t.fontSize===e.fontSize&&t.fontWeight===e.fontWeight&&t.fontWeightBold===e.fontWeightBold&&t.allowTransparency===e.allowTransparency&&t.deviceCharWidth===e.deviceCharWidth&&t.deviceCharHeight===e.deviceCharHeight&&t.drawBoldTextInBrightColors===e.drawBoldTextInBrightColors&&t.minimumContrastRatio===e.minimumContrastRatio&&t.colors.foreground.rgba===e.colors.foreground.rgba&&t.colors.background.rgba===e.colors.background.rgba}function Loe(t){return(t&50331648)===16777216||(t&50331648)===33554432}var Ss=[];function P6(t,e,i,n,s,r,o,l,c){let u=Qoe(n,s,r,o,e,i,l,c);for(let g=0;g<Ss.length;g++){let O=Ss[g],_=O.ownedBy.indexOf(t);if(_>=0){if(VR(O.config,u))return O.atlas;O.ownedBy.length===1?(O.atlas.dispose(),Ss.splice(g,1)):O.ownedBy.splice(_,1);break}}for(let g=0;g<Ss.length;g++){let O=Ss[g];if(VR(O.config,u))return O.ownedBy.push(t),O.atlas}let d=t._core,p={atlas:new fa(document,u,d.unicodeService),config:u,ownedBy:[t]};return Ss.push(p),p.atlas}function XR(t){for(let e=0;e<Ss.length;e++){let i=Ss[e].ownedBy.indexOf(t);if(i!==-1){Ss[e].ownedBy.length===1?(Ss[e].atlas.dispose(),Ss.splice(e,1)):Ss[e].ownedBy.splice(i,1);break}}}var Em=600,Doe=class{constructor(t,e){this._renderCallback=t,this._coreBrowserService=e,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(t=Em){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let e=Em-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0){this._restartInterval(e);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let e=Em-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(e);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},Em)},t)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function ZR(t,e,i){let n=new e.ResizeObserver(s=>{let r=s.find(c=>c.target===t);if(!r)return;if(!("devicePixelContentBoxSize"in r)){n==null||n.disconnect(),n=void 0;return}let o=r.devicePixelContentBoxSize[0].inlineSize,l=r.devicePixelContentBoxSize[0].blockSize;o>0&&l>0&&i(o,l)});try{n.observe(t,{box:["device-pixel-content-box"]})}catch{n.disconnect(),n=void 0}return sn(()=>n==null?void 0:n.disconnect())}function Boe(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}var qR=class R6 extends Xc{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new w6,this.combinedData=""}static fromCharData(e){let i=new R6;return i.setFromCharData(e),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Boe(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let s=e[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(n-55296)*1024+s-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Q6=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function L6(t,e,i){let n=li(t.createProgram());if(t.attachShader(n,li(WR(t,t.VERTEX_SHADER,e))),t.attachShader(n,li(WR(t,t.FRAGMENT_SHADER,i))),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS))return n;console.error(t.getProgramInfoLog(n)),t.deleteProgram(n)}function WR(t,e,i){let n=li(t.createShader(e));if(t.shaderSource(n,i),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS))return n;console.error(t.getShaderInfoLog(n)),t.deleteShader(n)}function $oe(t,e){let i=Math.min(t.length*2,e),n=new Float32Array(i);for(let s=0;s<t.length;s++)n[s]=t[s];return n}var Noe=class{constructor(t){this.texture=t,this.version=-1}},zoe=`#version 300 es
148
- layout (location = 0) in vec2 a_unitquad;
149
- layout (location = 1) in vec2 a_cellpos;
150
- layout (location = 2) in vec2 a_offset;
151
- layout (location = 3) in vec2 a_size;
152
- layout (location = 4) in float a_texpage;
153
- layout (location = 5) in vec2 a_texcoord;
154
- layout (location = 6) in vec2 a_texsize;
155
-
156
- uniform mat4 u_projection;
157
- uniform vec2 u_resolution;
158
-
159
- out vec2 v_texcoord;
160
- flat out int v_texpage;
161
-
162
- void main() {
163
- vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
164
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
165
- v_texpage = int(a_texpage);
166
- v_texcoord = a_texcoord + a_unitquad * a_texsize;
167
- }`;function joe(t){let e="";for(let i=1;i<t;i++)e+=` else if (v_texpage == ${i}) { outColor = texture(u_texture[${i}], v_texcoord); }`;return`#version 300 es
168
- precision lowp float;
169
-
170
- in vec2 v_texcoord;
171
- flat in int v_texpage;
172
-
173
- uniform sampler2D u_texture[${t}];
174
-
175
- out vec4 outColor;
176
-
177
- void main() {
178
- if (v_texpage == 0) {
179
- outColor = texture(u_texture[0], v_texcoord);
180
- } ${e}
181
- }`}var da=11,kc=da*Float32Array.BYTES_PER_ELEMENT,Ioe=2,Vt=0,Mt,Fy=0,Zu=0,Voe=class extends Fs{constructor(t,e,i,n){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._optionsService=n,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let s=this._gl;fa.maxAtlasPages===void 0&&(fa.maxAtlasPages=Math.min(32,li(s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS))),fa.maxTextureSize=li(s.getParameter(s.MAX_TEXTURE_SIZE))),this._program=li(L6(s,zoe,joe(fa.maxAtlasPages))),this._register(sn(()=>s.deleteProgram(this._program))),this._projectionLocation=li(s.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=li(s.getUniformLocation(this._program,"u_resolution")),this._textureLocation=li(s.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=s.createVertexArray(),s.bindVertexArray(this._vertexArrayObject);let r=new Float32Array([0,0,1,0,0,1,1,1]),o=s.createBuffer();this._register(sn(()=>s.deleteBuffer(o))),s.bindBuffer(s.ARRAY_BUFFER,o),s.bufferData(s.ARRAY_BUFFER,r,s.STATIC_DRAW),s.enableVertexAttribArray(0),s.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let l=new Uint8Array([0,1,2,3]),c=s.createBuffer();this._register(sn(()=>s.deleteBuffer(c))),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,c),s.bufferData(s.ELEMENT_ARRAY_BUFFER,l,s.STATIC_DRAW),this._attributesBuffer=li(s.createBuffer()),this._register(sn(()=>s.deleteBuffer(this._attributesBuffer))),s.bindBuffer(s.ARRAY_BUFFER,this._attributesBuffer),s.enableVertexAttribArray(2),s.vertexAttribPointer(2,2,s.FLOAT,!1,kc,0),s.vertexAttribDivisor(2,1),s.enableVertexAttribArray(3),s.vertexAttribPointer(3,2,s.FLOAT,!1,kc,2*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(3,1),s.enableVertexAttribArray(4),s.vertexAttribPointer(4,1,s.FLOAT,!1,kc,4*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(4,1),s.enableVertexAttribArray(5),s.vertexAttribPointer(5,2,s.FLOAT,!1,kc,5*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(5,1),s.enableVertexAttribArray(6),s.vertexAttribPointer(6,2,s.FLOAT,!1,kc,7*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(6,1),s.enableVertexAttribArray(1),s.vertexAttribPointer(1,2,s.FLOAT,!1,kc,9*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(1,1),s.useProgram(this._program);let u=new Int32Array(fa.maxAtlasPages);for(let d=0;d<fa.maxAtlasPages;d++)u[d]=d;s.uniform1iv(this._textureLocation,u),s.uniformMatrix4fv(this._projectionLocation,!1,Q6),this._atlasTextures=[];for(let d=0;d<fa.maxAtlasPages;d++){let p=new Noe(li(s.createTexture()));this._register(sn(()=>s.deleteTexture(p.texture))),s.activeTexture(s.TEXTURE0+d),s.bindTexture(s.TEXTURE_2D,p.texture),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[d]=p}s.enable(s.BLEND),s.blendFunc(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(t,e,i,n,s,r,o,l,c){this._updateCell(this._vertices.attributes,t,e,i,n,s,r,o,l,c)}_updateCell(t,e,i,n,s,r,o,l,c,u){if(Vt=(i*this._terminal.cols+e)*da,n===0||n===void 0){t.fill(0,Vt,Vt+da-1-Ioe);return}this._atlas&&(l&&l.length>1?Mt=this._atlas.getRasterizedGlyphCombinedChar(l,s,r,o,!1,this._terminal.element):Mt=this._atlas.getRasterizedGlyph(n,s,r,o,!1,this._terminal.element),Fy=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),s!==u&&Mt.offset.x>Fy?(Zu=Mt.offset.x-Fy,t[Vt]=-(Mt.offset.x-Zu)+this._dimensions.device.char.left,t[Vt+1]=-Mt.offset.y+this._dimensions.device.char.top,t[Vt+2]=(Mt.size.x-Zu)/this._dimensions.device.canvas.width,t[Vt+3]=Mt.size.y/this._dimensions.device.canvas.height,t[Vt+4]=Mt.texturePage,t[Vt+5]=Mt.texturePositionClipSpace.x+Zu/this._atlas.pages[Mt.texturePage].canvas.width,t[Vt+6]=Mt.texturePositionClipSpace.y,t[Vt+7]=Mt.sizeClipSpace.x-Zu/this._atlas.pages[Mt.texturePage].canvas.width,t[Vt+8]=Mt.sizeClipSpace.y):(t[Vt]=-Mt.offset.x+this._dimensions.device.char.left,t[Vt+1]=-Mt.offset.y+this._dimensions.device.char.top,t[Vt+2]=Mt.size.x/this._dimensions.device.canvas.width,t[Vt+3]=Mt.size.y/this._dimensions.device.canvas.height,t[Vt+4]=Mt.texturePage,t[Vt+5]=Mt.texturePositionClipSpace.x,t[Vt+6]=Mt.texturePositionClipSpace.y,t[Vt+7]=Mt.sizeClipSpace.x,t[Vt+8]=Mt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&soe(n,c,Mt.size.x,this._dimensions.device.cell.width)&&(t[Vt+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let t=this._terminal,e=t.cols*t.rows*da;this._vertices.count!==e?this._vertices.attributes=new Float32Array(e):this._vertices.attributes.fill(0);let i=0;for(;i<this._vertices.attributesBuffers.length;i++)this._vertices.count!==e?this._vertices.attributesBuffers[i]=new Float32Array(e):this._vertices.attributesBuffers[i].fill(0);this._vertices.count=e,i=0;for(let n=0;n<t.rows;n++)for(let s=0;s<t.cols;s++)this._vertices.attributes[i+9]=s/t.cols,this._vertices.attributes[i+10]=n/t.rows,i+=da}handleResize(){let t=this._gl;t.useProgram(this._program),t.viewport(0,0,t.canvas.width,t.canvas.height),t.uniform2f(this._resolutionLocation,t.canvas.width,t.canvas.height),this.clear()}render(t){if(!this._atlas)return;let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let i=this._vertices.attributesBuffers[this._activeBuffer],n=0;for(let s=0;s<t.lineLengths.length;s++){let r=s*this._terminal.cols*da,o=this._vertices.attributes.subarray(r,r+t.lineLengths[s]*da);i.set(o,n),n+=o.length}e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,i.subarray(0,n),e.STREAM_DRAW);for(let s=0;s<this._atlas.pages.length;s++)this._atlas.pages[s].version!==this._atlasTextures[s].version&&this._bindAtlasPageTexture(e,this._atlas,s);e.drawElementsInstanced(e.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,n/da)}setAtlas(t){this._atlas=t;for(let e of this._atlasTextures)e.version=-1}_bindAtlasPageTexture(t,e,i){t.activeTexture(t.TEXTURE0+i),t.bindTexture(t.TEXTURE_2D,this._atlasTextures[i].texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e.pages[i].canvas),t.generateMipmap(t.TEXTURE_2D),this._atlasTextures[i].version=e.pages[i].version}setDimensions(t){this._dimensions=t}},Xoe=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(t,e,i,n=!1){if(this.selectionStart=e,this.selectionEnd=i,!e||!i||e[0]===i[0]&&e[1]===i[1]){this.clear();return}let s=t.buffers.active.ydisp,r=e[1]-s,o=i[1]-s,l=Math.max(r,0),c=Math.min(o,t.rows-1);if(l>=t.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=r,this.viewportEndRow=o,this.viewportCappedStartRow=l,this.viewportCappedEndRow=c,this.startCol=e[0],this.endCol=i[0]}isCellSelected(t,e,i){return this.hasSelection?(i-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?e>=this.startCol&&i>=this.viewportCappedStartRow&&e<this.endCol&&i<=this.viewportCappedEndRow:e<this.startCol&&i>=this.viewportCappedStartRow&&e>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&e>=this.startCol&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&e>=this.startCol):!1}};function Zoe(){return new Xoe}var iO=4,sg=1,rg=2,Gy=3,qoe=2147483648,Woe=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=Zoe()}resize(t,e){let i=t*e*iO;i!==this.cells.length&&(this.cells=new Uint32Array(i),this.lineLengths=new Uint32Array(e))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},Uoe=`#version 300 es
182
- layout (location = 0) in vec2 a_position;
183
- layout (location = 1) in vec2 a_size;
184
- layout (location = 2) in vec4 a_color;
185
- layout (location = 3) in vec2 a_unitquad;
186
-
187
- uniform mat4 u_projection;
188
-
189
- out vec4 v_color;
190
-
191
- void main() {
192
- vec2 zeroToOne = a_position + (a_unitquad * a_size);
193
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
194
- v_color = a_color;
195
- }`,Yoe=`#version 300 es
196
- precision lowp float;
197
-
198
- in vec4 v_color;
199
-
200
- out vec4 outColor;
201
-
202
- void main() {
203
- outColor = v_color;
204
- }`,ho=8,Ky=ho*Float32Array.BYTES_PER_ELEMENT,Hoe=20*ho,UR=class{constructor(){this.attributes=new Float32Array(Hoe),this.count=0}},ao=0,YR=0,HR=0,FR=0,GR=0,KR=0,JR=0,Foe=class extends Fs{constructor(t,e,i,n){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._themeService=n,this._vertices=new UR,this._verticesCursor=new UR;let s=this._gl;this._program=li(L6(s,Uoe,Yoe)),this._register(sn(()=>s.deleteProgram(this._program))),this._projectionLocation=li(s.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=s.createVertexArray(),s.bindVertexArray(this._vertexArrayObject);let r=new Float32Array([0,0,1,0,0,1,1,1]),o=s.createBuffer();this._register(sn(()=>s.deleteBuffer(o))),s.bindBuffer(s.ARRAY_BUFFER,o),s.bufferData(s.ARRAY_BUFFER,r,s.STATIC_DRAW),s.enableVertexAttribArray(3),s.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let l=new Uint8Array([0,1,2,3]),c=s.createBuffer();this._register(sn(()=>s.deleteBuffer(c))),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,c),s.bufferData(s.ELEMENT_ARRAY_BUFFER,l,s.STATIC_DRAW),this._attributesBuffer=li(s.createBuffer()),this._register(sn(()=>s.deleteBuffer(this._attributesBuffer))),s.bindBuffer(s.ARRAY_BUFFER,this._attributesBuffer),s.enableVertexAttribArray(0),s.vertexAttribPointer(0,2,s.FLOAT,!1,Ky,0),s.vertexAttribDivisor(0,1),s.enableVertexAttribArray(1),s.vertexAttribPointer(1,2,s.FLOAT,!1,Ky,2*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(1,1),s.enableVertexAttribArray(2),s.vertexAttribPointer(2,4,s.FLOAT,!1,Ky,4*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(2,1),this._updateCachedColors(n.colors),this._register(this._themeService.onChangeColors(u=>{this._updateCachedColors(u),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(t){let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),e.uniformMatrix4fv(this._projectionLocation,!1,Q6),e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,t.attributes,e.DYNAMIC_DRAW),e.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,t.count)}handleResize(){this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(t){this._bgFloat=this._colorToFloat32Array(t.background),this._cursorFloat=this._colorToFloat32Array(t.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(t){let e=this._terminal,i=this._vertices,n=1,s,r,o,l,c,u,d,p,g,O,_;for(s=0;s<e.rows;s++){for(o=-1,l=0,c=0,u=!1,r=0;r<e.cols;r++)d=(s*e.cols+r)*iO,p=t.cells[d+sg],g=t.cells[d+rg],O=!!(g&67108864),(p!==l||g!==c&&(u||O))&&((l!==0||u&&c!==0)&&(_=n++*ho,this._updateRectangle(i,_,c,l,o,r,s)),o=r,l=p,c=g,u=O);(l!==0||u&&c!==0)&&(_=n++*ho,this._updateRectangle(i,_,c,l,o,e.cols,s))}i.count=n}updateCursor(t){let e=this._verticesCursor,i=t.cursor;if(!i||i.style==="block"){e.count=0;return}let n,s=0;(i.style==="bar"||i.style==="outline")&&(n=s++*ho,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.style==="bar"?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(i.style==="underline"||i.style==="outline")&&(n=s++*ho,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),i.style==="outline"&&(n=s++*ho,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),n=s++*ho,this._addRectangleFloat(e.attributes,n,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),e.count=s}_updateRectangle(t,e,i,n,s,r,o){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:ao=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:ao=(i&16777215)<<8;break;case 0:default:ao=this._themeService.colors.foreground.rgba}else switch(n&50331648){case 16777216:case 33554432:ao=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:ao=(n&16777215)<<8;break;case 0:default:ao=this._themeService.colors.background.rgba}t.attributes.length<e+4&&(t.attributes=$oe(t.attributes,this._terminal.rows*this._terminal.cols*ho)),YR=s*this._dimensions.device.cell.width,HR=o*this._dimensions.device.cell.height,FR=(ao>>24&255)/255,GR=(ao>>16&255)/255,KR=(ao>>8&255)/255,JR=1,this._addRectangle(t.attributes,e,YR,HR,(r-s)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,FR,GR,KR,JR)}_addRectangle(t,e,i,n,s,r,o,l,c,u){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=n/this._dimensions.device.canvas.height,t[e+2]=s/this._dimensions.device.canvas.width,t[e+3]=r/this._dimensions.device.canvas.height,t[e+4]=o,t[e+5]=l,t[e+6]=c,t[e+7]=u}_addRectangleFloat(t,e,i,n,s,r,o){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=n/this._dimensions.device.canvas.height,t[e+2]=s/this._dimensions.device.canvas.width,t[e+3]=r/this._dimensions.device.canvas.height,t[e+4]=o[0],t[e+5]=o[1],t[e+6]=o[2],t[e+7]=o[3]}_colorToFloat32Array(t){return new Float32Array([(t.rgba>>24&255)/255,(t.rgba>>16&255)/255,(t.rgba>>8&255)/255,(t.rgba&255)/255])}},Goe=class extends Fs{constructor(t,e,i,n,s,r,o,l){super(),this._container=e,this._alpha=s,this._coreBrowserService=r,this._optionsService=o,this._themeService=l,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=n.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(c=>{this._refreshCharAtlas(t,c),this.reset(t)})),this._register(sn(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=li(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(t){}handleFocus(t){}handleCursorMove(t){}handleGridChanged(t,e,i){}handleSelectionChanged(t,e,i,n=!1){}_setTransparency(t,e){if(e===this._alpha)return;let i=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(t,this._themeService.colors),this.handleGridChanged(t,0,t.rows-1)}_refreshCharAtlas(t,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=P6(t,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(t,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(t,this._themeService.colors)}_fillBottomLineAtCells(t,e,i=1){this._ctx.fillRect(t*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(t,e,i,n){this._alpha?this._ctx.clearRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,n*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,n*this._deviceCellHeight))}_fillCharTrueColor(t,e,i,n){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=_6,this._clipCell(i,n,e.getWidth()),this._ctx.fillText(e.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,n*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(t,e,i){this._ctx.beginPath(),this._ctx.rect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(t,e,i){let n=e?t.options.fontWeightBold:t.options.fontWeight;return`${i?"italic":""} ${n} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}},Koe=class extends Goe{constructor(t,e,i,n,s,r,o){super(i,t,"link",e,!0,s,r,o),this._register(n.onShowLinkUnderline(l=>this._handleShowLinkUnderline(l))),this._register(n.onHideLinkUnderline(l=>this._handleHideLinkUnderline(l)))}resize(t,e){super.resize(t,e),this._state=void 0}reset(t){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let t=this._state.y2-this._state.y1-1;t>0&&this._clearCells(0,this._state.y1+1,this._state.cols,t),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(t){if(t.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:t.fg!==void 0&&Loe(t.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[t.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,t.y1===t.y2)this._fillBottomLineAtCells(t.x1,t.y1,t.x2-t.x1);else{this._fillBottomLineAtCells(t.x1,t.y1,t.cols-t.x1);for(let e=t.y1+1;e<t.y2;e++)this._fillBottomLineAtCells(0,e,t.cols);this._fillBottomLineAtCells(0,t.y2,t.x2)}this._state=t}_handleHideLinkUnderline(t){this._clearCurrentLink()}},bl=typeof window=="object"?window:globalThis,Rx=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Rt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Rt,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,i){if(this.getZoomLevel(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),e)}setFullscreen(e,i){if(this.isFullscreen(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};Rx.INSTANCE=new Rx;var D6=Rx;function Joe(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}D6.INSTANCE.onDidChangeZoomLevel;D6.INSTANCE.onDidChangeFullscreen;var Th=typeof navigator=="object"?navigator.userAgent:"";Th.indexOf("Firefox")>=0;Th.indexOf("AppleWebKit")>=0;var eae=Th.indexOf("Chrome")>=0;!eae&&Th.indexOf("Safari")>=0;Th.indexOf("Electron/")>=0;Th.indexOf("Android")>=0;var Jy=!1;if(typeof bl.matchMedia=="function"){let t=bl.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=bl.matchMedia("(display-mode: fullscreen)");Jy=t.matches,Joe(bl,t,({matches:i})=>{Jy&&e.matches||(Jy=i)})}var Zc="en",e1=!1,B6=!1,Mm,og=Zc,eQ=Zc,tae,Vs,kl=globalThis,Yi,JQ;typeof kl.vscode<"u"&&typeof kl.vscode.process<"u"?Yi=kl.vscode.process:typeof process<"u"&&typeof((JQ=process==null?void 0:process.versions)==null?void 0:JQ.node)=="string"&&(Yi=process);var eL,iae=typeof((eL=Yi==null?void 0:Yi.versions)==null?void 0:eL.electron)=="string",nae=iae&&(Yi==null?void 0:Yi.type)==="renderer",tL;if(typeof Yi=="object"){Yi.platform,Yi.platform,e1=Yi.platform==="linux",e1&&Yi.env.SNAP&&Yi.env.SNAP_REVISION,Yi.env.CI||Yi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Mm=Zc,og=Zc;let t=Yi.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);Mm=e.userLocale,eQ=e.osLocale,og=e.resolvedLanguage||Zc,tae=(tL=e.languagePack)==null?void 0:tL.translationsConfigFile}catch{}B6=!0}else typeof navigator=="object"&&!nae?(Vs=navigator.userAgent,Vs.indexOf("Windows")>=0,Vs.indexOf("Macintosh")>=0,(Vs.indexOf("Macintosh")>=0||Vs.indexOf("iPad")>=0||Vs.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,e1=Vs.indexOf("Linux")>=0,(Vs==null?void 0:Vs.indexOf("Mobi"))>=0,og=globalThis._VSCODE_NLS_LANGUAGE||Zc,Mm=navigator.language.toLowerCase(),eQ=Mm):console.error("Unable to resolve platform.");var tQ=B6,Mr=Vs,la=og,sae;(t=>{function e(){return la}t.value=e;function i(){return la.length===2?la==="en":la.length>=3?la[0]==="e"&&la[1]==="n"&&la[2]==="-":!1}t.isDefaultVariant=i;function n(){return la==="en"}t.isDefault=n})(sae||(sae={}));var rae=typeof kl.postMessage=="function"&&!kl.importScripts;(()=>{if(rae){let t=[];kl.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let n=0,s=t.length;n<s;n++){let r=t[n];if(r.id===i.data.vscodeScheduleAsyncWork){t.splice(n,1),r.callback();return}}});let e=0;return i=>{let n=++e;t.push({id:n,callback:i}),kl.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var oae=!!(Mr&&Mr.indexOf("Chrome")>=0);Mr&&Mr.indexOf("Firefox")>=0;!oae&&Mr&&Mr.indexOf("Safari")>=0;Mr&&Mr.indexOf("Edg/")>=0;Mr&&Mr.indexOf("Android")>=0;var Tc=typeof navigator=="object"?navigator:{};tQ||document.queryCommandSupported&&document.queryCommandSupported("copy")||Tc&&Tc.clipboard&&Tc.clipboard.writeText,tQ||Tc&&Tc.clipboard&&Tc.clipboard.readText;var Iw=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,e){this._keyCodeToStr[t]=e,this._strToKeyCode[e.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},t1=new Iw,iQ=new Iw,nQ=new Iw;new Array(230);var aae;(t=>{function e(l){return t1.keyCodeToStr(l)}t.toString=e;function i(l){return t1.strToKeyCode(l)}t.fromString=i;function n(l){return iQ.keyCodeToStr(l)}t.toUserSettingsUS=n;function s(l){return nQ.keyCodeToStr(l)}t.toUserSettingsGeneral=s;function r(l){return iQ.strToKeyCode(l)||nQ.strToKeyCode(l)}t.fromUserSettings=r;function o(l){if(l>=98&&l<=113)return null;switch(l){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return t1.keyCodeToStr(l)}t.toElectronAccelerator=o})(aae||(aae={}));var $6=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),lae;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof cae?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:mo.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:$6})})(lae||(lae={}));var cae=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?$6:(this._emitter||(this._emitter=new Rt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},hae;(t=>{async function e(n){let s,r=await Promise.all(n.map(o=>o.then(l=>l,l=>{s||(s=l)})));if(typeof s<"u")throw s;return r}t.settled=e;function i(n){return new Promise(async(s,r)=>{try{await n(s,r)}catch(o){r(o)}})}t.withAsyncBody=i})(hae||(hae={}));var sQ=class bs{static fromArray(e){return new bs(i=>{i.emitMany(e)})}static fromPromise(e){return new bs(async i=>{i.emitMany(await e)})}static fromPromises(e){return new bs(async i=>{await Promise.all(e.map(async n=>i.emitOne(await n)))})}static merge(e){return new bs(async i=>{await Promise.all(e.map(async n=>{for await(let s of n)i.emitOne(s)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new Rt,queueMicrotask(async()=>{let n={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(e(n)),this.resolve()}catch(s){this.reject(s)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await mo.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var i;return(i=this._onReturn)==null||i.call(this),{done:!0,value:void 0}}}}static map(e,i){return new bs(async n=>{for await(let s of e)n.emitOne(i(s))})}map(e){return bs.map(this,e)}static filter(e,i){return new bs(async n=>{for await(let s of e)i(s)&&n.emitOne(s)})}filter(e){return bs.filter(this,e)}static coalesce(e){return bs.filter(e,i=>!!i)}coalesce(){return bs.coalesce(this)}static async toPromise(e){let i=[];for await(let n of e)i.push(n);return i}toPromise(){return bs.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};sQ.EMPTY=sQ.fromArray([]);var{getWindow:uae}=(function(){let t=new Map,e={window:bl,disposables:new eh};t.set(bl.vscodeWindowId,e);let i=new Rt,n=new Rt,s=new Rt;function r(o,l){return(typeof o=="number"?t.get(o):void 0)??(l?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:n.event,registerWindow(o){if(t.has(o.vscodeWindowId))return Fs.None;let l=new eh,c={window:o,disposables:l.add(new eh)};return t.set(o.vscodeWindowId,c),l.add(sn(()=>{t.delete(o.vscodeWindowId),n.fire(o)})),l.add(Qx(o,dae.BEFORE_UNLOAD,()=>{s.fire(o)})),i.fire(c),l},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return t.has(o)},getWindowById:r,getWindow(o){var u;let l=o;if((u=l==null?void 0:l.ownerDocument)!=null&&u.defaultView)return l.ownerDocument.defaultView.window;let c=o;return c!=null&&c.view?c.view.window:bl},getDocument(o){return uae(o).document}}})(),fae=class{constructor(t,e,i,n){this._node=t,this._type=e,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Qx(t,e,i,n){return new fae(t,e,i,n)}var dae={BEFORE_UNLOAD:"beforeunload"},pae=class extends Fs{constructor(t,e,i,n,s,r,o,l,c){super(),this._terminal=t,this._characterJoinerService=e,this._charSizeService=i,this._coreBrowserService=n,this._coreService=s,this._decorationService=r,this._optionsService=o,this._themeService=l,this._cursorBlinkStateManager=new Iu,this._charAtlasDisposable=this._register(new Iu),this._observerDisposable=this._register(new Iu),this._model=new Woe,this._workCell=new qR,this._workCell2=new qR,this._rectangleRenderer=this._register(new Iu),this._glyphRenderer=this._register(new Iu),this._onChangeTextureAtlas=this._register(new Rt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Rt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Rt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Rt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Rt),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let u={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext("webgl2",u),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new aoe(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new Koe(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=roe(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(Qx(this._canvas,"webglcontextlost",d=>{console.log("webglcontextlost event received"),d.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(d)},3e3)})),this._register(Qx(this._canvas,"webglcontextrestored",d=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,XR(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=ZR(this._canvas,this._coreBrowserService.window,(d,p)=>this._setCanvasDevicePixelDimensions(d,p)),this._register(this._coreBrowserService.onWindowChange(d=>{this._observerDisposable.value=ZR(this._canvas,d,(p,g)=>this._setCanvasDevicePixelDimensions(p,g))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(sn(()=>{var d;for(let p of this._renderLayers)p.dispose();(d=this._canvas.parentElement)==null||d.removeChild(this._canvas),XR(this._terminal)}))}get textureAtlas(){var t;return(t=this._charAtlas)==null?void 0:t.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(t,e){var i,n,s,r;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let o of this._renderLayers)o.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(i=this._rectangleRenderer.value)==null||i.setDimensions(this.dimensions),(n=this._rectangleRenderer.value)==null||n.handleResize(),(s=this._glyphRenderer.value)==null||s.setDimensions(this.dimensions),(r=this._glyphRenderer.value)==null||r.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var t;for(let e of this._renderLayers)e.handleBlur(this._terminal);(t=this._cursorBlinkStateManager.value)==null||t.pause(),this._requestRedrawViewport()}handleFocus(){var t;for(let e of this._renderLayers)e.handleFocus(this._terminal);(t=this._cursorBlinkStateManager.value)==null||t.resume(),this._requestRedrawViewport()}handleSelectionChanged(t,e,i){for(let n of this._renderLayers)n.handleSelectionChanged(this._terminal,t,e,i);this._model.selection.update(this._core,t,e,i),this._requestRedrawViewport()}handleCursorMove(){var t;for(let e of this._renderLayers)e.handleCursorMove(this._terminal);(t=this._cursorBlinkStateManager.value)==null||t.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new Foe(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new Voe(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var e;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let t=P6(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==t&&(this._onChangeTextureAtlas.fire(t.pages[0].canvas),this._charAtlasDisposable.value=p6(mo.forward(t.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),mo.forward(t.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=t,this._charAtlas.warmUp(),(e=this._glyphRenderer.value)==null||e.setAtlas(this._charAtlas)}_clearModel(t){var e;this._model.clear(),t&&((e=this._glyphRenderer.value)==null||e.clear())}clearTextureAtlas(){var t;(t=this._charAtlas)==null||t.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var t;this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);(t=this._cursorBlinkStateManager.value)==null||t.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(t,e){var i;if(!this._isAttached)if((i=this._core.screenElement)!=null&&i.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let n of this._renderLayers)n.handleGridChanged(this._terminal,t,e);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(t,e),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new Doe(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(t,e){let i=this._core,n=this._workCell,s,r,o,l,c,u,d=0,p=!0,g,O,_,b,S,w,T,k,A;t=rQ(t,i.rows-1,0),e=rQ(e,i.rows-1,0);let R=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",E=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,$=E-i.buffer.ydisp,N=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),q=-1,G=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let U=!1;for(r=t;r<=e;r++)for(o=r+i.buffer.ydisp,l=i.buffer.lines.get(o),this._model.lineLengths[r]=0,_=E===o,d=0,c=this._characterJoinerService.getJoinedCharacters(o),k=0;k<i.cols;k++){if(s=this._cellColorResolver.result.bg,l.loadCell(k,n),k===0&&(s=this._cellColorResolver.result.bg),u=!1,p=k>=d,g=k,c.length>0&&k===c[0][0]&&p){O=c.shift();let Q=this._model.selection.isCellSelected(this._terminal,O[0],o);for(T=O[0]+1;T<O[1];T++)p&&(p=Q===this._model.selection.isCellSelected(this._terminal,T,o));p&&(p=!_||N<O[0]||N>=O[1]),p?(u=!0,n=new mae(n,l.translateToString(!0,O[0],O[1]),O[1]-O[0]),g=O[1]-1):d=O[1]}if(b=n.getChars(),S=n.getCode(),T=(r*i.cols+k)*iO,this._cellColorResolver.resolve(n,k,o,this.dimensions.device.cell.width),G&&o===E&&(k===N&&(this._model.cursor={x:N,y:$,width:n.getWidth(),style:this._coreBrowserService.isFocused?R:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},q=N+n.getWidth()-1),k>=N&&k<=q&&(this._coreBrowserService.isFocused&&R==="block"||this._coreBrowserService.isFocused===!1&&i.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),S!==0&&(this._model.lineLengths[r]=k+1),!(this._model.cells[T]===S&&this._model.cells[T+sg]===this._cellColorResolver.result.bg&&this._model.cells[T+rg]===this._cellColorResolver.result.fg&&this._model.cells[T+Gy]===this._cellColorResolver.result.ext)&&(U=!0,b.length>1&&(S|=qoe),this._model.cells[T]=S,this._model.cells[T+sg]=this._cellColorResolver.result.bg,this._model.cells[T+rg]=this._cellColorResolver.result.fg,this._model.cells[T+Gy]=this._cellColorResolver.result.ext,w=n.getWidth(),this._glyphRenderer.value.updateCell(k,r,S,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,b,w,s),u)){for(n=this._workCell,k++;k<=g;k++)A=(r*i.cols+k)*iO,this._glyphRenderer.value.updateCell(k,r,0,0,0,0,Kre,0,0),this._model.cells[A]=0,this._model.cells[A+sg]=this._cellColorResolver.result.bg,this._model.cells[A+rg]=this._cellColorResolver.result.fg,this._model.cells[A+Gy]=this._cellColorResolver.result.ext;k--}}U&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(t,e){this._canvas.width===t&&this._canvas.height===e||(this._canvas.width=t,this._canvas.height=e,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let t=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:t,end:t})}},mae=class extends Xc{constructor(t,e,i){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=e,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function rQ(t,e,i=0){return Math.max(Math.min(t,e),i)}var oQ="di$target",aQ="di$dependencies",i1=new Map;function Dr(t){if(i1.has(t))return i1.get(t);let e=function(i,n,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");gae(e,i,s)};return e._id=t,i1.set(t,e),e}function gae(t,e,i){e[oQ]===e?e[aQ].push({id:t,index:i}):(e[aQ]=[{id:t,index:i}],e[oQ]=e)}Dr("BufferService");Dr("CoreMouseService");Dr("CoreService");Dr("CharsetService");Dr("InstantiationService");Dr("LogService");var Oae=Dr("OptionsService");Dr("OscLinkService");Dr("UnicodeService");Dr("DecorationService");var vae={trace:0,debug:1,info:2,warn:3,error:4,off:5},_ae="xterm.js: ",lQ=class extends Fs{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=vae[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;e<t.length;e++)typeof t[e]=="function"&&(t[e]=t[e]())}_log(t,e,i){this._evalLazyOptionalParams(i),t.call(console,(this._optionsService.options.logger?"":_ae)+e,...i)}trace(t,...e){var i;this._logLevel<=0&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.trace.bind(this._optionsService.options.logger))??console.log,t,e)}debug(t,...e){var i;this._logLevel<=1&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.debug.bind(this._optionsService.options.logger))??console.log,t,e)}info(t,...e){var i;this._logLevel<=2&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.info.bind(this._optionsService.options.logger))??console.info,t,e)}warn(t,...e){var i;this._logLevel<=3&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.warn.bind(this._optionsService.options.logger))??console.warn,t,e)}error(t,...e){var i;this._logLevel<=4&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.error.bind(this._optionsService.options.logger))??console.error,t,e)}};lQ=jre([Ire(0,Oae)],lQ);var yae=class extends Fs{constructor(t){if(O6&&Gre()<16){let e={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",e))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=t,this._onChangeTextureAtlas=this._register(new Rt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Rt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Rt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Rt),this.onContextLoss=this._onContextLoss.event}activate(t){let e=t._core;if(!t.element){this._register(e.onWillOpen(()=>this.activate(t)));return}this._terminal=t;let i=e.coreService,n=e.optionsService,s=e,r=s._renderService,o=s._characterJoinerService,l=s._charSizeService,c=s._coreBrowserService,u=s._decorationService;s._logService;let d=s._themeService;this._renderer=this._register(new pae(t,o,l,c,i,u,n,d,this._preserveDrawingBuffer)),this._register(mo.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(mo.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(mo.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(mo.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),r.setRenderer(this._renderer),this._register(sn(()=>{if(this._terminal._core._store._isDisposed)return;let p=this._terminal._core._renderService;p.setRenderer(this._terminal._core._createRenderer()),p.handleResize(t.cols,t.rows)}))}get textureAtlas(){var t;return(t=this._renderer)==null?void 0:t.textureAtlas}clearTextureAtlas(){var t;(t=this._renderer)==null||t.clearTextureAtlas()}};/**
205
- * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
206
- * @license MIT
207
- *
208
- * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
209
- * @license MIT
210
- *
211
- * Originally forked from (with the author's permission):
212
- * Fabrice Bellard's javascript vt100 for jslinux:
213
- * http://bellard.org/jslinux/
214
- * Copyright (c) 2011 Fabrice Bellard
215
- */var Pi=0,Ri=0,Qi=0,Wt=0,nn;(t=>{function e(s,r,o,l){return l!==void 0?`#${rl(s)}${rl(r)}${rl(o)}${rl(l)}`:`#${rl(s)}${rl(r)}${rl(o)}`}t.toCss=e;function i(s,r,o,l=255){return(s<<24|r<<16|o<<8|l)>>>0}t.toRgba=i;function n(s,r,o,l){return{css:t.toCss(s,r,o,l),rgba:t.toRgba(s,r,o,l)}}t.toColor=n})(nn||(nn={}));var bae;(t=>{function e(c,u){if(Wt=(u.rgba&255)/255,Wt===1)return{css:u.css,rgba:u.rgba};let d=u.rgba>>24&255,p=u.rgba>>16&255,g=u.rgba>>8&255,O=c.rgba>>24&255,_=c.rgba>>16&255,b=c.rgba>>8&255;Pi=O+Math.round((d-O)*Wt),Ri=_+Math.round((p-_)*Wt),Qi=b+Math.round((g-b)*Wt);let S=nn.toCss(Pi,Ri,Qi),w=nn.toRgba(Pi,Ri,Qi);return{css:S,rgba:w}}t.blend=e;function i(c){return(c.rgba&255)===255}t.isOpaque=i;function n(c,u,d){let p=ag.ensureContrastRatio(c.rgba,u.rgba,d);if(p)return nn.toColor(p>>24&255,p>>16&255,p>>8&255)}t.ensureContrastRatio=n;function s(c){let u=(c.rgba|255)>>>0;return[Pi,Ri,Qi]=ag.toChannels(u),{css:nn.toCss(Pi,Ri,Qi),rgba:u}}t.opaque=s;function r(c,u){return Wt=Math.round(u*255),[Pi,Ri,Qi]=ag.toChannels(c.rgba),{css:nn.toCss(Pi,Ri,Qi,Wt),rgba:nn.toRgba(Pi,Ri,Qi,Wt)}}t.opacity=r;function o(c,u){return Wt=c.rgba&255,r(c,Wt*u/255)}t.multiplyOpacity=o;function l(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}t.toColorRGB=l})(bae||(bae={}));var Zi;(t=>{let e,i;try{let s=document.createElement("canvas");s.width=1,s.height=1;let r=s.getContext("2d",{willReadFrequently:!0});r&&(e=r,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return Pi=parseInt(s.slice(1,2).repeat(2),16),Ri=parseInt(s.slice(2,3).repeat(2),16),Qi=parseInt(s.slice(3,4).repeat(2),16),nn.toColor(Pi,Ri,Qi);case 5:return Pi=parseInt(s.slice(1,2).repeat(2),16),Ri=parseInt(s.slice(2,3).repeat(2),16),Qi=parseInt(s.slice(3,4).repeat(2),16),Wt=parseInt(s.slice(4,5).repeat(2),16),nn.toColor(Pi,Ri,Qi,Wt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let r=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return Pi=parseInt(r[1]),Ri=parseInt(r[2]),Qi=parseInt(r[3]),Wt=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),nn.toColor(Pi,Ri,Qi,Wt);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=s,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Pi,Ri,Qi,Wt]=e.getImageData(0,0,1,1).data,Wt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:nn.toRgba(Pi,Ri,Qi,Wt),css:s}}t.toColor=n})(Zi||(Zi={}));var pn;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,s,r){let o=n/255,l=s/255,c=r/255,u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return u*.2126+d*.7152+p*.0722}t.relativeLuminance2=i})(pn||(pn={}));var ag;(t=>{function e(o,l){if(Wt=(l&255)/255,Wt===1)return l;let c=l>>24&255,u=l>>16&255,d=l>>8&255,p=o>>24&255,g=o>>16&255,O=o>>8&255;return Pi=p+Math.round((c-p)*Wt),Ri=g+Math.round((u-g)*Wt),Qi=O+Math.round((d-O)*Wt),nn.toRgba(Pi,Ri,Qi)}t.blend=e;function i(o,l,c){let u=pn.relativeLuminance(o>>8),d=pn.relativeLuminance(l>>8);if(lo(u,d)<c){if(d<u){let O=n(o,l,c),_=lo(u,pn.relativeLuminance(O>>8));if(_<c){let b=s(o,l,c),S=lo(u,pn.relativeLuminance(b>>8));return _>S?O:b}return O}let p=s(o,l,c),g=lo(u,pn.relativeLuminance(p>>8));if(g<c){let O=n(o,l,c),_=lo(u,pn.relativeLuminance(O>>8));return g>_?p:O}return p}}t.ensureContrastRatio=i;function n(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=lo(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));for(;b<c&&(g>0||O>0||_>0);)g-=Math.max(0,Math.ceil(g*.1)),O-=Math.max(0,Math.ceil(O*.1)),_-=Math.max(0,Math.ceil(_*.1)),b=lo(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.reduceLuminance=n;function s(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=lo(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));for(;b<c&&(g<255||O<255||_<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),O=Math.min(255,O+Math.ceil((255-O)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),b=lo(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.increaseLuminance=s;function r(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=r})(ag||(ag={}));function rl(t){let e=t.toString(16);return e.length<2?"0"+e:e}function lo(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}var xae=Object.freeze((()=>{let t=[Zi.toColor("#2e3436"),Zi.toColor("#cc0000"),Zi.toColor("#4e9a06"),Zi.toColor("#c4a000"),Zi.toColor("#3465a4"),Zi.toColor("#75507b"),Zi.toColor("#06989a"),Zi.toColor("#d3d7cf"),Zi.toColor("#555753"),Zi.toColor("#ef2929"),Zi.toColor("#8ae234"),Zi.toColor("#fce94f"),Zi.toColor("#729fcf"),Zi.toColor("#ad7fa8"),Zi.toColor("#34e2e2"),Zi.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let i=0;i<216;i++){let n=e[i/36%6|0],s=e[i/6%6|0],r=e[i%6];t.push({css:nn.toCss(n,s,r),rgba:nn.toRgba(n,s,r)})}for(let i=0;i<24;i++){let n=8+i*10;t.push({css:nn.toCss(n,n,n),rgba:nn.toRgba(n,n,n)})}return t})());function cQ(t,e,i){return Math.max(e,Math.min(t,i))}function Sae(t){switch(t){case"&":return"&amp;";case"<":return"&lt;"}return t}var N6=class{constructor(t){this._buffer=t}serialize(t,e){let i=this._buffer.getNullCell(),n=this._buffer.getNullCell(),s=i,r=t.start.y,o=t.end.y,l=t.start.x,c=t.end.x;this._beforeSerialize(o-r,r,o);for(let u=r;u<=o;u++){let d=this._buffer.getLine(u);if(d){let p=u===t.start.y?l:0,g=u===t.end.y?c:d.length;for(let O=p;O<g;O++){let _=d.getCell(O,s===i?n:i);if(!_){console.warn(`Can't get cell at row=${u}, col=${O}`);continue}this._nextCell(_,s,u,O),s=_}}this._rowEnd(u,u===o)}return this._afterSerialize(),this._serializeString(e)}_nextCell(t,e,i,n){}_rowEnd(t,e){}_beforeSerialize(t,e,i){}_afterSerialize(){}_serializeString(t){return""}};function z6(t,e){return t.getFgColorMode()===e.getFgColorMode()&&t.getFgColor()===e.getFgColor()}function co(t,e){return t.getBgColorMode()===e.getBgColorMode()&&t.getBgColor()===e.getBgColor()}function j6(t,e){return t.isInverse()===e.isInverse()&&t.isBold()===e.isBold()&&t.isUnderline()===e.isUnderline()&&t.isOverline()===e.isOverline()&&t.isBlink()===e.isBlink()&&t.isInvisible()===e.isInvisible()&&t.isItalic()===e.isItalic()&&t.isDim()===e.isDim()&&t.isStrikethrough()===e.isStrikethrough()}var wae=class extends N6{constructor(t,e){super(t),this._terminal=e,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(t,e,i){this._allRows=new Array(t),this._lastContentCursorRow=e,this._lastCursorRow=e,this._firstRow=e}_rowEnd(t,e){var n;this._nullCellCount>0&&!co(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let i="";if(!e){t-this._firstRow>=this._terminal.rows&&((n=this._buffer.getLine(this._cursorStyleRow))==null||n.getCell(this._cursorStyleCol,this._backgroundCell));let s=this._buffer.getLine(t),r=this._buffer.getLine(t+1);if(!r.isWrapped)i=`\r
216
- `,this._lastCursorRow=t+1,this._lastCursorCol=0;else{i="";let o=s.getCell(s.length-1,this._thisRowLastChar),l=s.getCell(s.length-2,this._thisRowLastSecondChar),c=r.getCell(0,this._nextRowFirstChar),u=c.getWidth()>1,d=!1;(c.getChars()&&u?this._nullCellCount<=1:this._nullCellCount<=0)&&((o.getChars()||o.getWidth()===0)&&co(o,c)&&(d=!0),u&&(l.getChars()||l.getWidth()===0)&&co(o,c)&&co(l,c)&&(d=!0)),d||(i="-".repeat(this._nullCellCount+1),i+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(i+="\x1B[A",i+=`\x1B[${s.length-this._nullCellCount}C`,i+=`\x1B[${this._nullCellCount}X`,i+=`\x1B[${s.length-this._nullCellCount}D`,i+="\x1B[B"),this._lastContentCursorRow=t+1,this._lastContentCursorCol=0,this._lastCursorRow=t+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=i,this._currentRow="",this._nullCellCount=0}_diffStyle(t,e){let i=[],n=!z6(t,e),s=!co(t,e),r=!j6(t,e);if(n||s||r)if(t.isAttributeDefault())e.isAttributeDefault()||i.push(0);else{if(n){let o=t.getFgColor();t.isFgRGB()?i.push(38,2,o>>>16&255,o>>>8&255,o&255):t.isFgPalette()?o>=16?i.push(38,5,o):i.push(o&8?90+(o&7):30+(o&7)):i.push(39)}if(s){let o=t.getBgColor();t.isBgRGB()?i.push(48,2,o>>>16&255,o>>>8&255,o&255):t.isBgPalette()?o>=16?i.push(48,5,o):i.push(o&8?100+(o&7):40+(o&7)):i.push(49)}r&&(t.isInverse()!==e.isInverse()&&i.push(t.isInverse()?7:27),t.isBold()!==e.isBold()&&i.push(t.isBold()?1:22),t.isUnderline()!==e.isUnderline()&&i.push(t.isUnderline()?4:24),t.isOverline()!==e.isOverline()&&i.push(t.isOverline()?53:55),t.isBlink()!==e.isBlink()&&i.push(t.isBlink()?5:25),t.isInvisible()!==e.isInvisible()&&i.push(t.isInvisible()?8:28),t.isItalic()!==e.isItalic()&&i.push(t.isItalic()?3:23),t.isDim()!==e.isDim()&&i.push(t.isDim()?2:22),t.isStrikethrough()!==e.isStrikethrough()&&i.push(t.isStrikethrough()?9:29))}return i}_nextCell(t,e,i,n){if(t.getWidth()===0)return;let s=t.getChars()==="",r=this._diffStyle(t,this._cursorStyle);if(s?!co(this._cursorStyle,t):r.length>0){this._nullCellCount>0&&(co(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=i,this._lastContentCursorCol=this._lastCursorCol=n,this._currentRow+=`\x1B[${r.join(";")}m`;let o=this._buffer.getLine(i);o!==void 0&&(o.getCell(n,this._cursorStyle),this._cursorStyleRow=i,this._cursorStyleCol=n)}s?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(co(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=t.getChars(),this._lastContentCursorRow=this._lastCursorRow=i,this._lastContentCursorCol=this._lastCursorCol=n+t.getWidth())}_serializeString(t){let e=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(e=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let i="";for(let r=0;r<e;r++)i+=this._allRows[r],r+1<e&&(i+=this._allRowSeparators[r]);if(!t){let r=this._buffer.baseY+this._buffer.cursorY,o=this._buffer.cursorX,l=r!==this._lastCursorRow||o!==this._lastCursorCol,c=u=>{u>0?i+=`\x1B[${u}C`:u<0&&(i+=`\x1B[${-u}D`)};l&&((u=>{u>0?i+=`\x1B[${u}B`:u<0&&(i+=`\x1B[${-u}A`)})(r-this._lastCursorRow),c(o-this._lastCursorCol))}let n=this._terminal._core._inputHandler._curAttrData,s=this._diffStyle(n,this._cursorStyle);return s.length>0&&(i+=`\x1B[${s.join(";")}m`),i}},Cae=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,e,i){let n=e.length,s=i===void 0?n:cQ(i+t.rows,0,n);return this._serializeBufferByRange(t,e,{start:n-s,end:n-1},!1)}_serializeBufferByRange(t,e,i,n){return new wae(e,t).serialize({start:{x:0,y:typeof i.start=="number"?i.start:i.start.line},end:{x:t.cols,y:typeof i.end=="number"?i.end:i.end.line}},n)}_serializeBufferAsHTML(t,e){var l;let i=t.buffer.active,n=new kae(i,t,e),s=e.onlySelection??!1,r=e.range;if(r)return n.serialize({start:{x:r.startCol,y:(r.startLine,r.startLine)},end:{x:t.cols,y:(r.endLine,r.endLine)}});if(!s){let c=i.length,u=e.scrollback,d=u===void 0?c:cQ(u+t.rows,0,c);return n.serialize({start:{x:0,y:c-d},end:{x:t.cols,y:c-1}})}let o=(l=this._terminal)==null?void 0:l.getSelectionPosition();return o!==void 0?n.serialize({start:{x:o.start.x,y:o.start.y},end:{x:o.end.x,y:o.end.y}}):""}_serializeModes(t){let e="",i=t.modes;if(i.applicationCursorKeysMode&&(e+="\x1B[?1h"),i.applicationKeypadMode&&(e+="\x1B[?66h"),i.bracketedPasteMode&&(e+="\x1B[?2004h"),i.insertMode&&(e+="\x1B[4h"),i.originMode&&(e+="\x1B[?6h"),i.reverseWraparoundMode&&(e+="\x1B[?45h"),i.sendFocusMode&&(e+="\x1B[?1004h"),i.wraparoundMode===!1&&(e+="\x1B[?7l"),i.mouseTrackingMode!=="none")switch(i.mouseTrackingMode){case"x10":e+="\x1B[?9h";break;case"vt200":e+="\x1B[?1000h";break;case"drag":e+="\x1B[?1002h";break;case"any":e+="\x1B[?1003h";break}return e}serialize(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let e=t!=null&&t.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,t.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,t==null?void 0:t.scrollback);if(!(t!=null&&t.excludeAltBuffer)&&this._terminal.buffer.active.type==="alternate"){let i=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);e+=`\x1B[?1049h\x1B[H${i}`}return t!=null&&t.excludeModes||(e+=this._serializeModes(this._terminal)),e}serializeAsHTML(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,t||{})}dispose(){}},kae=class extends N6{constructor(t,e,i){super(t),this._terminal=e,this._options=i,this._currentRow="",this._htmlContent="",e._core._themeService?this._ansiColors=e._core._themeService.colors.ansi:this._ansiColors=xae}_padStart(t,e,i){return e=e>>0,i=i??" ",t.length>e?t:(e-=t.length,e>i.length&&(i+=i.repeat(e/i.length)),i.slice(0,e)+t)}_beforeSerialize(t,e,i){var o,l;this._htmlContent+="<html><body><!--StartFragment--><pre>";let n="#000000",s="#ffffff";(this._options.includeGlobalBackground??!1)&&(n=((o=this._terminal.options.theme)==null?void 0:o.foreground)??"#ffffff",s=((l=this._terminal.options.theme)==null?void 0:l.background)??"#000000");let r=[];r.push("color: "+n+";"),r.push("background-color: "+s+";"),r.push("font-family: "+this._terminal.options.fontFamily+";"),r.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+r.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(t,e){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(t,e){let i=e?t.getFgColor():t.getBgColor();if(e?t.isFgRGB():t.isBgRGB())return"#"+[i>>16&255,i>>8&255,i&255].map(n=>this._padStart(n.toString(16),2,"0")).join("");if(e?t.isFgPalette():t.isBgPalette())return this._ansiColors[i].css}_diffStyle(t,e){let i=[],n=!z6(t,e),s=!co(t,e),r=!j6(t,e);if(n||s||r){let o=this._getHexColor(t,!0);o&&i.push("color: "+o+";");let l=this._getHexColor(t,!1);return l&&i.push("background-color: "+l+";"),t.isInverse()&&i.push("color: #000000; background-color: #BFBFBF;"),t.isBold()&&i.push("font-weight: bold;"),t.isUnderline()&&t.isOverline()?i.push("text-decoration: overline underline;"):t.isUnderline()?i.push("text-decoration: underline;"):t.isOverline()&&i.push("text-decoration: overline;"),t.isBlink()&&i.push("text-decoration: blink;"),t.isInvisible()&&i.push("visibility: hidden;"),t.isItalic()&&i.push("font-style: italic;"),t.isDim()&&i.push("opacity: 0.5;"),t.isStrikethrough()&&i.push("text-decoration: line-through;"),i}}_nextCell(t,e,i,n){if(t.getWidth()===0)return;let s=t.getChars()==="",r=this._diffStyle(t,e);r&&(this._currentRow+=r.length===0?"</span><span>":"</span><span style='"+r.join(" ")+"'>"),s?this._currentRow+=" ":this._currentRow+=Sae(t.getChars())}_serializeString(){return this._htmlContent}};const Tae=10,Aae=2e3;function Eae(t={}){const{autoSpawn:e=!1,skipPermissions:i=!1}=t,[n,s]=I.useState(!1),[r,o]=I.useState(!1),[l,c]=I.useState(null),[u,d]=I.useState(null),p=I.useRef(null),g=I.useRef(0),O=I.useRef(null),_=I.useRef(!0),b=I.useRef(null),S=I.useRef(null),w=I.useRef(e),T=I.useRef(i);w.current=e,T.current=i;const k=I.useCallback(N=>{const q=p.current;q&&q.readyState===WebSocket.OPEN&&q.send(JSON.stringify(N))},[]),A=I.useCallback(N=>{k({type:"spawn",skipPermissions:N})},[k]),R=I.useCallback(()=>{k({type:"kill"})},[k]),E=I.useCallback((N,q)=>{k({type:"resize",cols:N,rows:q})},[k]),$=I.useCallback(N=>{k({type:"input",data:N})},[k]);return I.useEffect(()=>{_.current=!0;function N(){if(!_.current)return;const G=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`,U=new WebSocket(G);p.current=U,U.onopen=()=>{_.current&&(s(!0),g.current=0,w.current&&U.send(JSON.stringify({type:"spawn",skipPermissions:T.current})))},U.onclose=()=>{_.current&&(s(!1),p.current=null,g.current<Tae&&(g.current++,O.current=setTimeout(N,Aae)))},U.onmessage=Q=>{var D,z;if(_.current)try{const j=JSON.parse(Q.data);switch(j.type){case"output":(D=b.current)==null||D.call(b,j.data);break;case"scrollback":(z=S.current)==null||z.call(S,j.data);break;case"status":c({pid:j.pid,uptime:j.uptime,cwd:j.cwd,memoryMB:j.memoryMB,isActive:j.isActive,skipPermissions:j.skipPermissions,alive:j.alive});break;case"exit":d(j.code??1);break;case"started":d(null);break;case"unavailable":o(!0);break}}catch{}},U.onerror=()=>{}}return N(),()=>{_.current=!1,O.current!==null&&(clearTimeout(O.current),O.current=null),p.current&&(p.current.onclose=null,p.current.close(),p.current=null)}},[]),{connected:n,unavailable:r,status:l,exitCode:u,send:k,spawn:A,kill:R,resize:E,writeInput:$,onOutput:b,onScrollback:S}}function Mae(t){const e=Math.floor(t/60),i=t%60;return`${e}m ${i}s`}function Pae(t){const e=t.replace(/\\/g,"/").split("/").filter(Boolean);return e.length<=2?t:".../"+e.slice(-2).join("/")}function Rae({status:t,connected:e,exitCode:i,skipPermissions:n,onToggleSkipPermissions:s,onStop:r,onRestart:o}){const l=e&&(t==null?void 0:t.alive),c=e?l?"bg-green-500":"bg-yellow-500":"bg-red-500",u=e?l?`Running (PID ${(t==null?void 0:t.pid)??"?"})`:"Stopped":"Disconnected";return x.jsxs("div",{className:"flex items-center justify-between border-t border-border bg-card px-3 py-1.5 font-mono text-xs text-muted-foreground",children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("span",{className:Ne("inline-block h-2 w-2 rounded-full",c),title:u}),x.jsx("span",{children:u}),t&&l&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-border",children:"|"}),x.jsx("span",{children:Mae(t.uptime)}),x.jsx("span",{className:"text-border",children:"|"}),x.jsx("span",{title:t.cwd,children:Pae(t.cwd)}),x.jsx("span",{className:"text-border",children:"|"}),x.jsxs("span",{children:[t.memoryMB," MB"]})]})]}),x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5",children:[x.jsx("input",{type:"checkbox",checked:n,onChange:s,className:"h-3 w-3 accent-accent"}),x.jsx("span",{children:"Skip Perms"})]}),l&&x.jsx("button",{type:"button",onClick:r,className:"rounded-sm px-2 py-0.5 text-red-400 transition-colors hover:bg-red-500/20",children:"Stop"}),x.jsx("button",{type:"button",onClick:o,className:"rounded-sm px-2 py-0.5 transition-colors hover:bg-accent/20",children:"Restart"})]})]})}const Qae=[{label:"Progress",command:"/maxsim:progress"},{label:"New Project",command:"/maxsim:new-project"},{label:"Discuss",command:"/maxsim:discuss-phase N"},{label:"Plan",command:"/maxsim:plan-phase N"},{label:"Execute",command:"/maxsim:execute-phase N"},{label:"Roadmap",command:"/maxsim:roadmap"},{label:"Verify",command:"/maxsim:verify-work"},{label:"Resume",command:"/maxsim:resume-work"}],I6="maxsim-quick-commands",Lae=3e4;function Dae(){try{const t=localStorage.getItem(I6);if(t)return JSON.parse(t)}catch{}return Qae}function Bae(t){localStorage.setItem(I6,JSON.stringify(t))}function $ae({onSendCommand:t,isActive:e,isAlive:i,unavailable:n=!1}){const[s,r]=I.useState(!1),[o,l]=I.useState(Dae),[c,u]=I.useState(!1),[d,p]=I.useState(null),g=I.useRef(null),O=I.useCallback(async E=>{if(!E.includes(" N"))return E;const $=g.current;if($&&Date.now()-$.ts<Lae)return E.replace(" N",` ${$.value}`);try{const N=await fetch("/api/state");if(N.ok){const q=await N.json(),G=String(q.currentPhase??"1");return g.current={value:G,ts:Date.now()},E.replace(" N",` ${G}`)}}catch{}return E},[]),_=n||!i,b=I.useCallback(async E=>{if(_)return;const $=await O(E.command);p({label:E.label,resolved:$})},[_,O]),S=I.useCallback(()=>{d&&(t(d.resolved+`\r
217
- `),p(null))},[d,t]),w=I.useCallback(()=>{p(null)},[]);I.useEffect(()=>{if(!d)return;const E=$=>{$.key==="Enter"?($.preventDefault(),S()):$.key==="Escape"&&w()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[d,S,w]);const[T,k]=I.useState([]),A=I.useCallback(()=>{k([...o]),u(!0)},[o]),R=I.useCallback(()=>{const E=T.filter($=>$.label.trim()&&$.command.trim());l(E),Bae(E),u(!1)},[T]);return s?x.jsx("div",{className:"absolute bottom-2 right-2 z-20",children:x.jsx("button",{type:"button",onClick:()=>r(!1),className:"rounded-md bg-card/80 p-1.5 text-xs text-muted-foreground shadow-lg backdrop-blur-sm border border-border hover:text-foreground transition-colors",title:"Show quick actions",children:x.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("path",{d:"M18 15l-6-6-6 6"})})})}):x.jsxs("div",{className:"absolute bottom-2 right-2 z-20 flex flex-col items-end gap-1",children:[d&&x.jsxs("div",{className:"rounded-lg bg-card border border-border shadow-lg p-2 text-xs mb-1 backdrop-blur-sm",children:[x.jsxs("p",{className:"text-muted-foreground mb-1.5",children:["Send"," ",x.jsx("span",{className:"font-mono text-foreground",children:d.resolved}),"?"]}),x.jsxs("div",{className:"flex gap-1.5",children:[x.jsx("button",{type:"button",onClick:S,className:"rounded-sm bg-accent px-2 py-0.5 text-foreground hover:bg-accent-glow transition-colors",children:"Confirm"}),x.jsx("button",{type:"button",onClick:w,className:"rounded-sm bg-muted px-2 py-0.5 text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"})]})]}),c&&x.jsxs("div",{className:"rounded-lg bg-card border border-border shadow-lg p-3 text-xs mb-1 backdrop-blur-sm w-72 max-h-64 overflow-y-auto",children:[x.jsx("p",{className:"text-muted-foreground font-medium mb-2",children:"Quick Commands"}),T.map((E,$)=>x.jsxs("div",{className:"flex gap-1 mb-1",children:[x.jsx("input",{className:"flex-[1] rounded-sm border border-border bg-muted px-1.5 py-0.5 text-xs text-foreground",value:E.label,onChange:N=>{const q=[...T];q[$]={...q[$],label:N.target.value},k(q)},placeholder:"Label"}),x.jsx("input",{className:"flex-[2] rounded-sm border border-border bg-muted px-1.5 py-0.5 text-xs font-mono text-foreground",value:E.command,onChange:N=>{const q=[...T];q[$]={...q[$],command:N.target.value},k(q)},placeholder:"Command"}),x.jsx("button",{type:"button",onClick:()=>k(T.filter((N,q)=>q!==$)),className:"text-muted-foreground hover:text-destructive transition-colors px-0.5",title:"Remove",children:"x"})]},$)),x.jsxs("div",{className:"flex justify-between mt-2",children:[x.jsx("button",{type:"button",onClick:()=>k([...T,{label:"",command:""}]),className:"text-muted-foreground hover:text-foreground transition-colors",children:"+ Add"}),x.jsxs("div",{className:"flex gap-1.5",children:[x.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-sm bg-muted px-2 py-0.5 text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"}),x.jsx("button",{type:"button",onClick:R,className:"rounded-sm bg-accent px-2 py-0.5 text-foreground hover:bg-accent-glow transition-colors",children:"Save"})]})]})]}),x.jsxs("div",{className:"flex items-center gap-1 rounded-lg bg-card/80 border border-border shadow-lg p-1.5 backdrop-blur-sm",children:[o.map(E=>x.jsx("button",{type:"button",onClick:()=>b(E),disabled:_,className:"rounded-md px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40 disabled:cursor-not-allowed",title:n?"Terminal unavailable — node-pty not installed":E.command,children:E.label},E.label)),x.jsx("button",{type:"button",onClick:A,className:"rounded-md px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground transition-colors ml-0.5",title:"Settings",children:x.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[x.jsx("circle",{cx:"12",cy:"12",r:"3"}),x.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.32 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]})}),x.jsx("button",{type:"button",onClick:()=>r(!0),className:"rounded-md px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground transition-colors",title:"Minimize",children:x.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("path",{d:"M6 9l6 6 6-6"})})})]})]})}function Nae(){const{phase:t,currentQuestion:e,submitAnswer:i}=Ux(),[n,s]=I.useState(null),[r,o]=I.useState(new Set),[l,c]=I.useState(""),[u,d]=I.useState(!1),p=I.useRef(null);if(I.useEffect(()=>{s(null),o(new Set),c(""),d(!1)},[e==null?void 0:e.id]),I.useEffect(()=>{const k=p.current;k&&(k.style.height="auto",k.style.height=`${k.scrollHeight}px`)},[l]),t!=="active"||!e)return null;if(u)return x.jsxs("button",{type:"button",onClick:()=>d(!1),className:"absolute top-2 right-2 z-20 flex items-center gap-1.5 rounded bg-accent/20 border border-accent/40 px-2 py-1 text-xs font-mono text-accent hover:bg-accent/30 transition-colors",children:[x.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-accent animate-pulse"}),"Q&A pending"]});const g=e.multiSelect,O=e.options.length>0;function _(k){g?o(A=>{const R=new Set(A);return R.has(k)?R.delete(k):R.add(k),R}):s(k)}function b(k){c(k),!g&&k.length>0&&s(null)}function S(k){k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),T())}const w=g?r.size>0||l.trim().length>0:n!==null||l.trim().length>0;function T(){if(!w||!e)return;let k;if(g){const A=e.options.filter(R=>r.has(R.id)).map(R=>R.label);k={questionId:e.id,header:e.header,selectedOptionIds:Array.from(r),selectedLabels:A,freeText:l.trim()}}else if(n){const A=e.options.find(R=>R.id===n);k={questionId:e.id,header:e.header,selectedOptionIds:[n],selectedLabels:A?[A.label]:[],freeText:""}}else k={questionId:e.id,header:e.header,selectedOptionIds:[],selectedLabels:[],freeText:l.trim()};i(k)}return x.jsx("div",{className:"absolute top-0 inset-x-0 z-20 border-b border-accent/30 bg-card/95 backdrop-blur-sm shadow-lg",children:x.jsxs("div",{className:"flex flex-col gap-2 p-3 sm:p-4",children:[x.jsxs("div",{className:"flex items-start justify-between gap-2",children:[x.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x.jsx("span",{className:"inline-block bg-accent/20 border border-accent/40 px-1.5 py-0.5 text-[10px] font-mono uppercase tracking-wider text-accent shrink-0",children:e.header}),x.jsx("span",{className:"text-xs text-muted-foreground truncate",children:"Answer below or dismiss"})]}),x.jsx("button",{type:"button",onClick:()=>d(!0),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0.5",title:"Dismiss (question stays pending)",children:x.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:x.jsx("path",{d:"M4 4l8 8M12 4l-8 8",strokeLinecap:"round"})})})]}),x.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:e.question}),O&&x.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.options.map(k=>{const A=g?r.has(k.id):n===k.id;return x.jsx("button",{type:"button",onClick:()=>_(k.id),title:k.description||void 0,className:Ne("border px-2 py-1 text-xs font-mono transition-colors",A?"border-accent bg-accent/15 text-accent":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30"),children:k.label},k.id)})}),x.jsxs("div",{className:"flex items-end gap-2",children:[x.jsx("div",{className:"flex-1 border border-border bg-muted/10 px-2 py-1.5",children:x.jsx("textarea",{ref:p,value:l,onChange:k=>b(k.target.value),onKeyDown:S,placeholder:"Type your answer...",rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground outline-none leading-relaxed placeholder:text-muted-foreground/50"})}),x.jsx("button",{type:"button",onClick:T,disabled:!w,className:Ne("shrink-0 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",w?"border-accent bg-accent/10 text-accent hover:bg-accent hover:text-background":"border-border text-muted-foreground cursor-not-allowed"),children:"Submit"})]})]})})}function zae({onReady:t,writeInputRef:e}){const i=I.useRef(null),n=I.useRef(null),s=I.useRef(null),r=I.useRef(null),o=I.useRef(null),[l,c]=I.useState(!0),{connected:u,unavailable:d,status:p,exitCode:g,writeInput:O,resize:_,spawn:b,kill:S,onOutput:w,onScrollback:T}=Eae({autoSpawn:!0,skipPermissions:l});I.useEffect(()=>(e&&(e.current=O),()=>{e&&(e.current=null)}),[O,e]);const k=I.useCallback(N=>{var q;(q=n.current)==null||q.write(N)},[]),A=I.useCallback(N=>{var q;(q=n.current)==null||q.write(N)},[]);I.useEffect(()=>(w.current=k,T.current=A,()=>{w.current=null,T.current=null}),[k,A,w,T]),I.useEffect(()=>{if(!i.current)return;const N=new Bre({cursorBlink:!0,fontSize:14,lineHeight:1.2,theme:{background:"#0a0a0a",foreground:"#e0e0e0",cursor:"#e0e0e0"}}),q=new zre,G=new Cae;N.loadAddon(q),N.loadAddon(G);try{N.loadAddon(new yae)}catch{}N.open(i.current),q.fit(),n.current=N,s.current=q;const U=N.onData(D=>{O(D)}),Q=new ResizeObserver(()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{s.current&&n.current&&(s.current.fit(),_(n.current.cols,n.current.rows))},100)});return Q.observe(i.current),r.current=Q,t==null||t(N),()=>{U.dispose(),Q.disconnect(),o.current&&clearTimeout(o.current),N.dispose(),n.current=null,s.current=null,r.current=null}},[]);const R=I.useCallback(()=>{b(l),setTimeout(()=>{var N;return(N=n.current)==null?void 0:N.focus()},100)},[b,l]),E=I.useCallback(()=>{S()},[S]),$=I.useCallback(()=>{c(N=>!N)},[]);return x.jsxs("div",{className:"flex h-full w-full flex-col",onWheel:N=>N.stopPropagation(),children:[x.jsxs("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:[x.jsx("div",{ref:i,className:"h-full w-full"}),x.jsx(Nae,{}),x.jsx($ae,{onSendCommand:O,isActive:(p==null?void 0:p.isActive)??!1,isAlive:(p==null?void 0:p.alive)??!1,unavailable:d}),d&&x.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-card",children:x.jsxs("div",{className:"max-w-sm text-center",children:[x.jsx("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Terminal unavailable"}),x.jsxs("p",{className:"text-sm text-muted-foreground",children:["node-pty is not installed. Run ",x.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:"npm install node-pty"})," in the dashboard directory."]})]})}),!u&&g===null&&x.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-black/60",children:x.jsxs("div",{className:"flex items-center gap-3 font-mono text-sm text-muted-foreground",children:[x.jsxs("svg",{className:"h-5 w-5 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[x.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),x.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Reconnecting..."]})}),g!==null&&x.jsxs("div",{className:"absolute inset-x-0 bottom-0 z-10 flex items-center justify-between bg-card/90 px-4 py-2 font-mono text-sm backdrop-blur-sm",children:[x.jsxs("span",{className:"text-muted-foreground",children:["Process exited (code ",g,")"]}),x.jsx("button",{type:"button",onClick:R,className:"rounded-sm bg-accent px-3 py-1 text-xs text-foreground transition-colors hover:bg-accent-glow",children:"Restart"})]})]}),x.jsx(Rae,{status:p,connected:u,exitCode:g,skipPermissions:l,onToggleSkipPermissions:$,onStop:E,onRestart:R})]})}function jae(){const[t,e]=I.useState(!1),i=I.useCallback(()=>e(n=>!n),[]);return{splitMode:t,toggleSplit:i}}function Iae({splitMode:t,onToggle:e}){return x.jsx("button",{type:"button",onClick:e,title:t?"Full-height mode":"Split-panel mode",className:"absolute right-3 top-2 z-20 flex h-7 w-7 items-center justify-center rounded-sm border border-border bg-card text-muted-foreground transition-colors hover:bg-card-hover hover:text-foreground",children:t?x.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:x.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5"})}):x.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[x.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),x.jsx("line",{x1:"1",y1:"7",x2:"13",y2:"7",stroke:"currentColor",strokeWidth:"1.5"})]})})}function ol(t){var e;return(((e=t==null?void 0:t.phases)==null?void 0:e.length)??0)>0}function hQ(t){var e;return((e=t==null?void 0:t.phases)==null?void 0:e.some(i=>i.disk_status==="partial"||i.disk_status==="planned"||i.disk_status==="discussed"||i.disk_status==="researched"))??!1}const Lx=[{id:"plan-new-phase",tab:"plan",title:"Plan New Phase",description:"Create a detailed execution plan for the next phase",icon:x.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[x.jsx("rect",{x:"3",y:"4",width:"14",height:"13",rx:"1"}),x.jsx("path",{d:"M7 8h6M7 11h4M10 2v4",strokeLinecap:"round"})]}),requiresInput:!0,command:"/maxsim:plan-phase",isAvailable:t=>ol(t),unavailableReason:"No phases found in ROADMAP.md — create a project first"},{id:"add-phase",tab:"plan",title:"Add Phase",description:"Insert a new phase into the roadmap",icon:x.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[x.jsx("rect",{x:"3",y:"4",width:"14",height:"13",rx:"1"}),x.jsx("path",{d:"M10 8v6M7 11h6",strokeLinecap:"round"})]}),requiresInput:!0,command:"/maxsim:add-phase",isAvailable:t=>ol(t),unavailableReason:"No project loaded — create a project first"},{id:"discuss-phase",tab:"plan",title:"Discuss Phase",description:"Answer planning questions to define requirements for a phase",icon:x.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:x.jsx("path",{d:"M3 6a1 1 0 011-1h12a1 1 0 011 1v7a1 1 0 01-1 1H7l-4 3V6z",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:discuss-phase",isAvailable:t=>hQ(t),unavailableReason:"No active phase to discuss — plan a phase first"},{id:"init-existing",tab:"plan",title:"Init Existing",description:"Set up MAXSIM planning for an existing project",icon:x.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[x.jsx("path",{d:"M10 3v10M10 13l-3-3M10 13l3-3",strokeLinecap:"round",strokeLinejoin:"round"}),x.jsx("path",{d:"M4 17h12",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:init-existing",isAvailable:()=>!0,unavailableReason:""},{id:"new-project",tab:"plan",title:"New Project",description:"Start a brand new MAXSIM project from scratch",icon:x.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:x.jsx("path",{d:"M10 4v12M4 10h12",strokeLinecap:"round"})}),requiresInput:!1,command:"/maxsim:new-project",isAvailable:()=>!0,unavailableReason:""},{id:"execute-phase",tab:"execute",title:"Execute Phase",description:"Run the current phase plan and implement the changes",icon:x.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:x.jsx("path",{d:"M6 4l10 6-10 6V4z",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:execute-phase",isAvailable:t=>hQ(t),unavailableReason:"No phase is currently planned — plan a phase first"},{id:"verify-work",tab:"execute",title:"Verify Work",description:"Check that completed phase work meets all acceptance criteria",icon:x.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:x.jsx("path",{d:"M4 10l4 4 8-8",strokeLinecap:"round",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:verify-work",isAvailable:t=>ol(t),unavailableReason:"No phases to verify — complete a phase first"},{id:"audit-milestone",tab:"execute",title:"Audit Milestone",description:"Review and archive a completed milestone",icon:x.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[x.jsx("path",{d:"M4 5h12M4 10h8M4 15h10",strokeLinecap:"round"}),x.jsx("circle",{cx:"16",cy:"14",r:"2.5"}),x.jsx("path",{d:"M18 16l1.5 1.5",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:audit-milestone",isAvailable:t=>ol(t),unavailableReason:"No milestone to audit — complete some phases first"},{id:"fix-gaps",tab:"execute",title:"Fix Gaps",description:"Create plans to close verification failures",icon:x.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[x.jsx("path",{d:"M10 4v6h6",strokeLinecap:"round",strokeLinejoin:"round"}),x.jsx("path",{d:"M4 10a6 6 0 1012 0",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:plan-phase --gaps",isAvailable:t=>ol(t),unavailableReason:"No phases to fix — complete a verification first"},{id:"find-gaps",tab:"execute",title:"Find Gaps",description:"Identify missing requirements or unverified work",icon:x.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[x.jsx("circle",{cx:"9",cy:"9",r:"5"}),x.jsx("path",{d:"M16 16l-3-3",strokeLinecap:"round"}),x.jsx("path",{d:"M9 7v2M9 11h.01",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:verify-work --find-gaps",isAvailable:t=>ol(t),unavailableReason:"No phases to analyze — create some phases first"},{id:"view-roadmap",tab:"execute",title:"View Roadmap",description:"See all phases and their status inline",icon:x.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:x.jsx("path",{d:"M3 5h14M3 10h14M3 15h8",strokeLinecap:"round"})}),requiresInput:!1,command:"",isAvailable:t=>ol(t),unavailableReason:"No roadmap to display"}];function Vae(){var c,u;const{roadmap:t}=So(),{setTab:e,setExpanded:i}=rO(),n=(c=t==null?void 0:t.phases)==null?void 0:c.find(d=>d.number===(t==null?void 0:t.current_phase));let s=null;if(n){const d=n.disk_status;d==="empty"||d==="no_directory"||d==="discussed"||d==="researched"?s="plan-new-phase":d==="planned"||d==="partial"?s="execute-phase":d==="complete"&&(s="verify-work")}else(((u=t==null?void 0:t.phases)==null?void 0:u.length)??0)===0&&(s="new-project");if(!s)return null;const r=Lx.find(d=>d.id===s);if(!r)return null;const o=n?`Phase ${n.number}: ${n.name}`:"your project";function l(){const d=r.tab;e(d),i(r.id)}return x.jsxs("div",{className:"border border-simple-accent/40 bg-simple-accent/5 p-4 flex items-center justify-between gap-4 mb-4",children:[x.jsxs("div",{className:"min-w-0",children:[x.jsx("p",{className:"text-xs uppercase tracking-widest text-simple-accent font-mono mb-1",children:"Recommended"}),x.jsxs("p",{className:"text-sm text-foreground",children:[x.jsx("span",{className:"font-medium",children:o})," is ready to"," ",x.jsx("span",{className:"text-simple-accent",children:r.title.toLowerCase()})]})]}),x.jsx("button",{type:"button",onClick:l,className:"shrink-0 border border-simple-accent bg-simple-accent/10 px-3 py-1.5 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:r.title})]})}function Xae({action:t,onExecute:e}){const{inputValues:i,setInput:n,reset:s}=rO(),{roadmap:r}=So(),o=I.useRef(null),[l,c]=I.useState(!1),[u,d]=I.useState(!1),p=(()=>{var R;if(!t.requiresInput)return"";const A=(R=r==null?void 0:r.phases)==null?void 0:R.find(E=>!E.roadmap_complete&&(E.disk_status==="empty"||E.disk_status==="no_directory"));return A?`Phase ${A.number}: ${A.name}`:""})(),g=i[t.id]??p;I.useEffect(()=>{const A=o.current;A&&(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)},[g]);function O(){const A=o.current;A&&(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)}function _(A){n(t.id,A)}function b(A){A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),w())}function S(){const A=g.trim();return t.command===""?"":A?`${t.command} "${A}"`:t.command}function w(){if(t.requiresInput&&!g.trim()||t.id==="view-roadmap")return;const A=S();A&&e(A)}function T(){u?(s(),d(!1),c(!1)):(d(!0),setTimeout(()=>d(!1),3e3))}const k=t.requiresInput&&!g.trim();return x.jsxs("div",{className:"flex flex-col gap-3 relative",children:[x.jsx("p",{className:"text-xs text-muted-foreground",children:t.requiresInput?"Describe what this phase should accomplish.":"Add optional context (or leave blank to use defaults)."}),x.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 flex gap-2 items-start",children:x.jsx("textarea",{ref:o,value:g,onChange:A=>{_(A.target.value),O()},onKeyDown:b,placeholder:t.requiresInput?"e.g. Phase 31: Simple Mode UI Shell":"Additional context (optional)",rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground placeholder:text-muted-foreground outline-none leading-relaxed"})}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsxs("button",{type:"button",onClick:w,disabled:k,className:Ne("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",k?"border-border text-muted-foreground cursor-not-allowed":"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background"),children:[x.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"currentColor","aria-hidden":"true",children:x.jsx("path",{d:"M2 2l8 4-8 4V2z"})}),"Run in Terminal"]}),x.jsxs("div",{className:"relative ml-auto",children:[x.jsx("button",{type:"button",onClick:()=>c(A=>!A),"aria-label":"More options",className:"flex h-6 w-6 items-center justify-center text-muted-foreground hover:text-foreground",children:x.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[x.jsx("circle",{cx:"4",cy:"8",r:"1.2"}),x.jsx("circle",{cx:"8",cy:"8",r:"1.2"}),x.jsx("circle",{cx:"12",cy:"8",r:"1.2"})]})}),l&&x.jsx("div",{className:"absolute right-0 bottom-8 z-20 border border-border bg-card shadow-lg min-w-max",children:x.jsx("button",{type:"button",onClick:T,className:Ne("flex w-full items-center gap-2 px-4 py-2.5 text-xs text-left transition-colors",u?"text-danger hover:bg-danger/10":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:u?"Click again to confirm reset":"Reset Simple Mode"})})]})]})]})}function Zae({action:t,roadmap:e,onExecute:i}){var g,O;const{expandedCardId:n,setExpanded:s}=rO(),{roadmap:r}=So(),o=n===t.id,l=!t.isAvailable(e),c=(g=r==null?void 0:r.phases)==null?void 0:g.find(_=>_.number===(r==null?void 0:r.current_phase));let u=null;if(c){const _=c.disk_status;_==="empty"||_==="no_directory"||_==="discussed"||_==="researched"?u="plan-new-phase":_==="planned"||_==="partial"?u="execute-phase":_==="complete"&&(u="verify-work")}else(((O=r==null?void 0:r.phases)==null?void 0:O.length)??0)===0&&(u="new-project");const d=t.id===u;function p(){l||s(o?null:t.id)}return x.jsxs("div",{className:Ne("bg-card border-0 transition-all duration-200",l?"opacity-50":"cursor-pointer hover:shadow-md hover:-translate-y-px",o&&"ring-1 ring-simple-accent/40"),title:l?t.unavailableReason:void 0,children:[x.jsxs("button",{type:"button",disabled:l,onClick:p,className:"flex w-full items-start gap-3 p-4 text-left","aria-expanded":o,children:[x.jsx("span",{className:Ne("mt-0.5 shrink-0",l?"text-muted-foreground":"text-simple-accent"),children:t.icon}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.title}),x.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:t.description}),d&&!l&&x.jsx("span",{className:"mt-1 inline-block bg-simple-accent/20 border border-simple-accent/40 px-1.5 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent",children:"Recommended"})]}),x.jsx("svg",{className:Ne("mt-1 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform duration-200",o&&"rotate-180"),viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:x.jsx("path",{d:"M2 4l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),x.jsx(SS,{initial:!1,children:o&&x.jsx(_o.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden border-t border-border/60",children:x.jsx("div",{className:"p-4",children:x.jsx(Xae,{action:t,onExecute:i})})},"expanded")})]})}const n1=6;function qae({onExecute:t}){var k;const{roadmap:e}=So(),{activeTab:i,setTab:n}=rO(),s=I.useRef(i),[r,o]=I.useState({plan:!1,execute:!1}),l=e??null,c=Lx.filter(A=>A.tab==="plan"),u=Lx.filter(A=>A.tab==="execute"),d=(((k=e==null?void 0:e.phases)==null?void 0:k.length)??0)===0,p=d?c.filter(A=>A.id==="new-project"||A.id==="init-existing"):c,g=d?[]:u,O=i==="plan"?p:g,_=r[i],b=_?O:O.slice(0,n1),S=O.length>n1&&!_;function w(A){s.current=i,n(A)}const T=i==="plan"&&s.current==="execute"?-1:1;return x.jsxs("div",{className:"flex flex-col gap-0",children:[x.jsx("div",{className:"flex border-b border-border",children:["plan","execute"].map(A=>{const R=A==="plan"?p.length:g.length,E=A==="plan"?"Plan & Discuss":"Execute & Verify";return x.jsxs("button",{type:"button",onClick:()=>w(A),className:Ne("flex-1 py-2.5 text-xs font-mono uppercase tracking-widest transition-colors duration-200 border-b-2",i===A?"border-b-simple-accent text-simple-accent":"border-b-transparent text-muted-foreground hover:text-foreground"),children:[E," (",R,")"]},A)})}),x.jsx("div",{className:"overflow-hidden",children:x.jsx(SS,{mode:"wait",initial:!1,children:x.jsx(_o.div,{initial:{x:T*20,opacity:0},animate:{x:0,opacity:1},exit:{x:T*-20,opacity:0},transition:{duration:.15},children:O.length===0?x.jsx("div",{className:"py-12 text-center",children:x.jsx("p",{className:"text-sm text-muted-foreground",children:"No actions available in this tab."})}):x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"grid grid-cols-2 gap-px bg-border lg:grid-cols-3",children:b.map(A=>x.jsx(Zae,{action:A,roadmap:l,onExecute:t},A.id))}),S&&x.jsxs("button",{type:"button",onClick:()=>o(A=>({...A,[i]:!0})),className:"w-full border-t border-border py-2.5 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:text-foreground hover:bg-card-hover",children:["Show more (",O.length-n1," more)"]})]})},i)})})]})}function Wae(){var d;const{roadmap:t,state:e}=So(),i=(t==null?void 0:t.current_phase)??(e==null?void 0:e.currentPhase)??null,n=(d=t==null?void 0:t.phases)==null?void 0:d.find(p=>p.number===i),s=(t==null?void 0:t.progress_percent)??0,r=(t==null?void 0:t.completed_phases)??0,o=(t==null?void 0:t.phase_count)??0;if(!n&&o===0)return null;const l=n?`${n.number} - ${n.name}`:"No active phase",c=(n==null?void 0:n.disk_status)??"empty",u=c==="complete"?"Complete":c==="partial"?"In Progress":c==="planned"?"Planned":c==="discussed"?"Discussed":c==="researched"?"Researched":"Not Started";return x.jsxs("div",{className:"border border-border bg-card p-4",children:[x.jsxs("div",{className:"flex items-center justify-between mb-3",children:[x.jsx("span",{className:"text-xs font-mono uppercase tracking-widest text-muted-foreground",children:"Current Phase"}),x.jsxs("span",{className:"text-xs font-mono text-muted-foreground tabular-nums",children:[r,"/",o," phases"]})]}),x.jsxs("div",{className:"flex items-baseline gap-3 mb-3",children:[x.jsxs("span",{className:"font-mono text-2xl font-bold tabular-nums text-foreground leading-none",children:[s,"%"]}),x.jsx("span",{className:"text-sm text-foreground/80 truncate",children:l})]}),x.jsx("div",{className:"h-1 w-full bg-muted mb-2",children:x.jsx(_o.div,{className:"h-full bg-simple-accent",initial:{width:0},animate:{width:`${s}%`},transition:{duration:.6,ease:"easeOut"}})}),x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-muted-foreground",children:u}),n&&n.plan_count>0&&x.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground tabular-nums",children:[n.summary_count,"/",n.plan_count," plans"]})]})]})}function Uae(){const{lastChange:t}=Rr(),[e,i]=I.useState([]),[n,s]=I.useState(!0),r=I.useCallback(async()=>{try{const l=await fetch("/api/todos");if(!l.ok)return;const c=await l.json();i(c.pending)}catch{}finally{s(!1)}},[]);I.useEffect(()=>{r()},[r]),I.useEffect(()=>{t>0&&r()},[t,r]);const o=I.useCallback(async l=>{try{await fetch("/api/todos",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:l,completed:!0})}),await r()}catch{}},[r]);return n?x.jsxs("div",{className:"border border-border bg-card p-4",children:[x.jsx("div",{className:"h-3 w-20 animate-pulse bg-muted mb-3"}),x.jsxs("div",{className:"space-y-2",children:[x.jsx("div",{className:"h-3 w-full animate-pulse bg-muted"}),x.jsx("div",{className:"h-3 w-3/4 animate-pulse bg-muted"})]})]}):x.jsxs("div",{className:"border border-border bg-card p-4",children:[x.jsxs("div",{className:"flex items-center justify-between mb-3",children:[x.jsx("span",{className:"text-xs font-mono uppercase tracking-widest text-muted-foreground",children:"Todos"}),x.jsxs("span",{className:Ne("text-xs font-mono tabular-nums",e.length>0?"text-warning":"text-muted-foreground"),children:[e.length," pending"]})]}),e.length===0?x.jsx("p",{className:"text-xs text-muted-foreground",children:"No pending todos"}):x.jsxs("div",{className:"space-y-0.5 max-h-40 overflow-y-auto",children:[e.slice(0,8).map(l=>x.jsxs("button",{type:"button",onClick:()=>o(l.file),className:"group flex w-full items-center gap-2.5 py-1.5 text-left transition-colors hover:bg-card-hover",children:[x.jsx("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center border border-muted-foreground/60 transition-colors group-hover:border-simple-accent"}),x.jsx("span",{className:"text-xs text-foreground/90 truncate",children:l.text})]},l.file)),e.length>8&&x.jsxs("p",{className:"text-[10px] text-muted-foreground pt-1",children:["+",e.length-8," more"]})]})]})}function Yae(t,e){return e||t==="complete"?{color:"bg-success",label:"Complete"}:t==="partial"?{color:"bg-simple-accent",label:"In Progress"}:t==="planned"?{color:"bg-blue-400",label:"Planned"}:t==="discussed"||t==="researched"?{color:"bg-yellow-500",label:t==="discussed"?"Discussed":"Researched"}:{color:"bg-muted-foreground/40",label:"Not Started"}}function Hae(){const{roadmap:t}=So(),e=(t==null?void 0:t.phases)??[],i=(t==null?void 0:t.current_phase)??null;return e.length===0?null:x.jsxs("div",{className:"border border-border bg-card p-4",children:[x.jsxs("div",{className:"flex items-center justify-between mb-3",children:[x.jsx("span",{className:"text-xs font-mono uppercase tracking-widest text-muted-foreground",children:"Roadmap"}),x.jsxs("span",{className:"text-xs font-mono text-muted-foreground tabular-nums",children:[e.length," phases"]})]}),x.jsx("div",{className:"space-y-0.5 max-h-52 overflow-y-auto",children:e.map(n=>{const s=n.number===i,{color:r,label:o}=Yae(n.disk_status,n.roadmap_complete);return x.jsxs("div",{className:Ne("flex items-center gap-2.5 py-1.5 px-1",s&&"bg-simple-accent/5 border-l-2 border-l-simple-accent -ml-1 pl-2"),children:[x.jsx("span",{className:Ne("inline-block h-1.5 w-1.5 shrink-0 rounded-full",r),title:o}),x.jsx("span",{className:Ne("font-mono text-[10px] font-bold tabular-nums shrink-0",s?"text-simple-accent":"text-muted-foreground"),children:n.number}),x.jsx("span",{className:"text-xs text-foreground/80 truncate",children:n.name}),s&&x.jsx("span",{className:"ml-auto text-[9px] font-mono uppercase tracking-wider text-simple-accent shrink-0",children:"current"})]},n.number)})})]})}function Fae(t,e){const i={};return(t[t.length-1]===""?[...t,""]:t).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const Gae=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Kae=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jae={};function uQ(t,e){return(Jae.jsx?Kae:Gae).test(t)}const ele=/[ \t\n\f\r]/g;function tle(t){return typeof t=="object"?t.type==="text"?fQ(t.value):!1:fQ(t)}function fQ(t){return t.replace(ele,"")===""}class Cd{constructor(e,i,n){this.normal=i,this.property=e,n&&(this.space=n)}}Cd.prototype.normal={};Cd.prototype.property={};Cd.prototype.space=void 0;function V6(t,e){const i={},n={};for(const s of t)Object.assign(i,s.property),Object.assign(n,s.normal);return new Cd(i,n,e)}function Dx(t){return t.toLowerCase()}class jn{constructor(e,i){this.attribute=i,this.property=e}}jn.prototype.attribute="";jn.prototype.booleanish=!1;jn.prototype.boolean=!1;jn.prototype.commaOrSpaceSeparated=!1;jn.prototype.commaSeparated=!1;jn.prototype.defined=!1;jn.prototype.mustUseProperty=!1;jn.prototype.number=!1;jn.prototype.overloadedBoolean=!1;jn.prototype.property="";jn.prototype.spaceSeparated=!1;jn.prototype.space=void 0;let ile=0;const Ze=Nl(),ri=Nl(),Bx=Nl(),de=Nl(),wt=Nl(),th=Nl(),es=Nl();function Nl(){return 2**++ile}const $x=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ze,booleanish:ri,commaOrSpaceSeparated:es,commaSeparated:th,number:de,overloadedBoolean:Bx,spaceSeparated:wt},Symbol.toStringTag,{value:"Module"})),s1=Object.keys($x);class Vw extends jn{constructor(e,i,n,s){let r=-1;if(super(e,i),dQ(this,"space",s),typeof n=="number")for(;++r<s1.length;){const o=s1[r];dQ(this,s1[r],(n&$x[o])===$x[o])}}}Vw.prototype.defined=!0;function dQ(t,e,i){i&&(t[e]=i)}function Ah(t){const e={},i={};for(const[n,s]of Object.entries(t.properties)){const r=new Vw(n,t.transform(t.attributes||{},n),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(n)&&(r.mustUseProperty=!0),e[n]=r,i[Dx(n)]=n,i[Dx(r.attribute)]=n}return new Cd(e,i,t.space)}const X6=Ah({properties:{ariaActiveDescendant:null,ariaAtomic:ri,ariaAutoComplete:null,ariaBusy:ri,ariaChecked:ri,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:wt,ariaCurrent:null,ariaDescribedBy:wt,ariaDetails:null,ariaDisabled:ri,ariaDropEffect:wt,ariaErrorMessage:null,ariaExpanded:ri,ariaFlowTo:wt,ariaGrabbed:ri,ariaHasPopup:null,ariaHidden:ri,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wt,ariaLevel:de,ariaLive:null,ariaModal:ri,ariaMultiLine:ri,ariaMultiSelectable:ri,ariaOrientation:null,ariaOwns:wt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:ri,ariaReadOnly:ri,ariaRelevant:null,ariaRequired:ri,ariaRoleDescription:wt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:ri,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Z6(t,e){return e in t?t[e]:e}function q6(t,e){return Z6(t,e.toLowerCase())}const nle=Ah({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:th,acceptCharset:wt,accessKey:wt,action:null,allow:null,allowFullScreen:Ze,allowPaymentRequest:Ze,allowUserMedia:Ze,alt:null,as:null,async:Ze,autoCapitalize:null,autoComplete:wt,autoFocus:Ze,autoPlay:Ze,blocking:wt,capture:null,charSet:null,checked:Ze,cite:null,className:wt,cols:de,colSpan:null,content:null,contentEditable:ri,controls:Ze,controlsList:wt,coords:de|th,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ze,defer:Ze,dir:null,dirName:null,disabled:Ze,download:Bx,draggable:ri,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ze,formTarget:null,headers:wt,height:de,hidden:Bx,high:de,href:null,hrefLang:null,htmlFor:wt,httpEquiv:wt,id:null,imageSizes:null,imageSrcSet:null,inert:Ze,inputMode:null,integrity:null,is:null,isMap:Ze,itemId:null,itemProp:wt,itemRef:wt,itemScope:Ze,itemType:wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ze,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Ze,muted:Ze,name:null,nonce:null,noModule:Ze,noValidate:Ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ze,optimum:de,pattern:null,ping:wt,placeholder:null,playsInline:Ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ze,referrerPolicy:null,rel:wt,required:Ze,reversed:Ze,rows:de,rowSpan:de,sandbox:wt,scope:null,scoped:Ze,seamless:Ze,selected:Ze,shadowRootClonable:Ze,shadowRootDelegatesFocus:Ze,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:ri,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Ze,useMap:null,value:ri,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ze,declare:Ze,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Ze,noHref:Ze,noShade:Ze,noWrap:Ze,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:ri,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ze,disableRemotePlayback:Ze,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:q6}),sle=Ah({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:es,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:wt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:th,g2:th,glyphName:th,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:es,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:es,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:es,rev:es,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:es,requiredFeatures:es,requiredFonts:es,requiredFormats:es,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:es,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:es,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:es,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Z6}),W6=Ah({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),U6=Ah({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:q6}),Y6=Ah({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),rle={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ole=/[A-Z]/g,pQ=/-[a-z]/g,ale=/^data[-\w.:]+$/i;function lle(t,e){const i=Dx(e);let n=e,s=jn;if(i in t.normal)return t.property[t.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&ale.test(e)){if(e.charAt(4)==="-"){const r=e.slice(5).replace(pQ,hle);n="data"+r.charAt(0).toUpperCase()+r.slice(1)}else{const r=e.slice(4);if(!pQ.test(r)){let o=r.replace(ole,cle);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}s=Vw}return new s(n,e)}function cle(t){return"-"+t.toLowerCase()}function hle(t){return t.charAt(1).toUpperCase()}const ule=V6([X6,nle,W6,U6,Y6],"html"),Xw=V6([X6,sle,W6,U6,Y6],"svg");function fle(t){return t.join(" ").trim()}var Ac={},r1,mQ;function dle(){if(mQ)return r1;mQ=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,i=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,r=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
218
- `,u="/",d="*",p="",g="comment",O="declaration";function _(S,w){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];w=w||{};var T=1,k=1;function A(z){var j=z.match(e);j&&(T+=j.length);var B=z.lastIndexOf(c);k=~B?z.length-B:k+z.length}function R(){var z={line:T,column:k};return function(j){return j.position=new E(z),q(),j}}function E(z){this.start=z,this.end={line:T,column:k},this.source=w.source}E.prototype.content=S;function $(z){var j=new Error(w.source+":"+T+":"+k+": "+z);if(j.reason=z,j.filename=w.source,j.line=T,j.column=k,j.source=S,!w.silent)throw j}function N(z){var j=z.exec(S);if(j){var B=j[0];return A(B),S=S.slice(B.length),j}}function q(){N(i)}function G(z){var j;for(z=z||[];j=U();)j!==!1&&z.push(j);return z}function U(){var z=R();if(!(u!=S.charAt(0)||d!=S.charAt(1))){for(var j=2;p!=S.charAt(j)&&(d!=S.charAt(j)||u!=S.charAt(j+1));)++j;if(j+=2,p===S.charAt(j-1))return $("End of comment missing");var B=S.slice(2,j-2);return k+=2,A(B),S=S.slice(j),k+=2,z({type:g,comment:B})}}function Q(){var z=R(),j=N(n);if(j){if(U(),!N(s))return $("property missing ':'");var B=N(r),Z=z({type:O,property:b(j[0].replace(t,p)),value:B?b(B[0].replace(t,p)):p});return N(o),Z}}function D(){var z=[];G(z);for(var j;j=Q();)j!==!1&&(z.push(j),G(z));return z}return q(),D()}function b(S){return S?S.replace(l,p):p}return r1=_,r1}var gQ;function ple(){if(gQ)return Ac;gQ=1;var t=Ac&&Ac.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.default=i;const e=t(dle());function i(n,s){let r=null;if(!n||typeof n!="string")return r;const o=(0,e.default)(n),l=typeof s=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:d}=c;l?s(u,d,c):d&&(r=r||{},r[u]=d)}),r}return Ac}var qu={},OQ;function mle(){if(OQ)return qu;OQ=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,i=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,r=function(u){return!u||i.test(u)||t.test(u)},o=function(u,d){return d.toUpperCase()},l=function(u,d){return"".concat(d,"-")},c=function(u,d){return d===void 0&&(d={}),r(u)?u:(u=u.toLowerCase(),d.reactCompat?u=u.replace(s,l):u=u.replace(n,l),u.replace(e,o))};return qu.camelCase=c,qu}var Wu,vQ;function gle(){if(vQ)return Wu;vQ=1;var t=Wu&&Wu.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(ple()),i=mle();function n(s,r){var o={};return!s||typeof s!="string"||(0,e.default)(s,function(l,c){l&&c&&(o[(0,i.camelCase)(l,r)]=c)}),o}return n.default=n,Wu=n,Wu}var Ole=gle();const vle=qx(Ole),H6=F6("end"),Zw=F6("start");function F6(t){return e;function e(i){const n=i&&i.position&&i.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function _le(t){const e=Zw(t),i=H6(t);if(e&&i)return{start:e,end:i}}function xf(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?_Q(t.position):"start"in t||"end"in t?_Q(t):"line"in t||"column"in t?Nx(t):""}function Nx(t){return yQ(t&&t.line)+":"+yQ(t&&t.column)}function _Q(t){return Nx(t&&t.start)+"-"+Nx(t&&t.end)}function yQ(t){return t&&typeof t=="number"?t:1}class ln extends Error{constructor(e,i,n){super(),typeof i=="string"&&(n=i,i=void 0);let s="",r={},o=!1;if(i&&("line"in i&&"column"in i?r={place:i}:"start"in i&&"end"in i?r={place:i}:"type"in i?r={ancestors:[i],place:i.position}:r={...i}),typeof e=="string"?s=e:!r.cause&&e&&(o=!0,s=e.message,r.cause=e),!r.ruleId&&!r.source&&typeof n=="string"){const c=n.indexOf(":");c===-1?r.ruleId=n:(r.source=n.slice(0,c),r.ruleId=n.slice(c+1))}if(!r.place&&r.ancestors&&r.ancestors){const c=r.ancestors[r.ancestors.length-1];c&&(r.place=c.position)}const l=r.place&&"start"in r.place?r.place.start:r.place;this.ancestors=r.ancestors||void 0,this.cause=r.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=xf(r.place)||"1:1",this.place=r.place||void 0,this.reason=this.message,this.ruleId=r.ruleId||void 0,this.source=r.source||void 0,this.stack=o&&r.cause&&typeof r.cause.stack=="string"?r.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ln.prototype.file="";ln.prototype.name="";ln.prototype.reason="";ln.prototype.message="";ln.prototype.stack="";ln.prototype.column=void 0;ln.prototype.line=void 0;ln.prototype.ancestors=void 0;ln.prototype.cause=void 0;ln.prototype.fatal=void 0;ln.prototype.place=void 0;ln.prototype.ruleId=void 0;ln.prototype.source=void 0;const qw={}.hasOwnProperty,yle=new Map,ble=/[A-Z]/g,xle=new Set(["table","tbody","thead","tfoot","tr"]),Sle=new Set(["td","th"]),G6="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function wle(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=e.filePath||void 0;let n;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=Rle(i,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Ple(i,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:n,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Xw:ule,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},r=K6(s,t,void 0);return r&&typeof r!="string"?r:s.create(t,s.Fragment,{children:r||void 0},void 0)}function K6(t,e,i){if(e.type==="element")return Cle(t,e,i);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return kle(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Ale(t,e,i);if(e.type==="mdxjsEsm")return Tle(t,e);if(e.type==="root")return Ele(t,e,i);if(e.type==="text")return Mle(t,e)}function Cle(t,e,i){const n=t.schema;let s=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(s=Xw,t.schema=s),t.ancestors.push(e);const r=ez(t,e.tagName,!1),o=Qle(t,e);let l=Uw(t,e);return xle.has(e.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!tle(c):!0})),J6(t,o,r,e),Ww(o,l),t.ancestors.pop(),t.schema=n,t.create(e,r,o,i)}function kle(t,e){if(e.data&&e.data.estree&&t.evaluater){const n=e.data.estree.body[0];return n.type,t.evaluater.evaluateExpression(n.expression)}rd(t,e.position)}function Tle(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);rd(t,e.position)}function Ale(t,e,i){const n=t.schema;let s=n;e.name==="svg"&&n.space==="html"&&(s=Xw,t.schema=s),t.ancestors.push(e);const r=e.name===null?t.Fragment:ez(t,e.name,!0),o=Lle(t,e),l=Uw(t,e);return J6(t,o,r,e),Ww(o,l),t.ancestors.pop(),t.schema=n,t.create(e,r,o,i)}function Ele(t,e,i){const n={};return Ww(n,Uw(t,e)),t.create(e,t.Fragment,n,i)}function Mle(t,e){return e.value}function J6(t,e,i,n){typeof i!="string"&&i!==t.Fragment&&t.passNode&&(e.node=n)}function Ww(t,e){if(e.length>0){const i=e.length>1?e:e[0];i&&(t.children=i)}}function Ple(t,e,i){return n;function n(s,r,o,l){const u=Array.isArray(o.children)?i:e;return l?u(r,o,l):u(r,o)}}function Rle(t,e){return i;function i(n,s,r,o){const l=Array.isArray(r.children),c=Zw(n);return e(s,r,o,l,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function Qle(t,e){const i={};let n,s;for(s in e.properties)if(s!=="children"&&qw.call(e.properties,s)){const r=Dle(t,s,e.properties[s]);if(r){const[o,l]=r;t.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Sle.has(e.tagName)?n=l:i[o]=l}}if(n){const r=i.style||(i.style={});r[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return i}function Lle(t,e){const i={};for(const n of e.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&t.evaluater){const r=n.data.estree.body[0];r.type;const o=r.expression;o.type;const l=o.properties[0];l.type,Object.assign(i,t.evaluater.evaluateExpression(l.argument))}else rd(t,e.position);else{const s=n.name;let r;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&t.evaluater){const l=n.value.data.estree.body[0];l.type,r=t.evaluater.evaluateExpression(l.expression)}else rd(t,e.position);else r=n.value===null?!0:n.value;i[s]=r}return i}function Uw(t,e){const i=[];let n=-1;const s=t.passKeys?new Map:yle;for(;++n<e.children.length;){const r=e.children[n];let o;if(t.passKeys){const c=r.type==="element"?r.tagName:r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement"?r.name:void 0;if(c){const u=s.get(c)||0;o=c+"-"+u,s.set(c,u+1)}}const l=K6(t,r,o);l!==void 0&&i.push(l)}return i}function Dle(t,e,i){const n=lle(t.schema,e);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=n.commaSeparated?Fae(i):fle(i)),n.property==="style"){let s=typeof i=="object"?i:Ble(t,String(i));return t.stylePropertyNameCase==="css"&&(s=$le(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&n.space?rle[n.property]||n.property:n.attribute,i]}}function Ble(t,e){try{return vle(e,{reactCompat:!0})}catch(i){if(t.ignoreInvalidStyle)return{};const n=i,s=new ln("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=G6+"#cannot-parse-style-attribute",s}}function ez(t,e,i){let n;if(!i)n={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let r=-1,o;for(;++r<s.length;){const l=uQ(s[r])?{type:"Identifier",name:s[r]}:{type:"Literal",value:s[r]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(r&&l.type==="Literal"),optional:!1}:l}n=o}else n=uQ(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(n.type==="Literal"){const s=n.value;return qw.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(n);rd(t)}function rd(t,e){const i=new ln("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=G6+"#cannot-handle-mdx-estrees-without-createevaluater",i}function $le(t){const e={};let i;for(i in t)qw.call(t,i)&&(e[Nle(i)]=t[i]);return e}function Nle(t){let e=t.replace(ble,zle);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function zle(t){return"-"+t.toLowerCase()}const o1={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},jle={};function Ile(t,e){const i=jle,n=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,s=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return tz(t,n,s)}function tz(t,e,i){if(Vle(t)){if("value"in t)return t.type==="html"&&!i?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return bQ(t.children,e,i)}return Array.isArray(t)?bQ(t,e,i):""}function bQ(t,e,i){const n=[];let s=-1;for(;++s<t.length;)n[s]=tz(t[s],e,i);return n.join("")}function Vle(t){return!!(t&&typeof t=="object")}const xQ=document.createElement("i");function Yw(t){const e="&"+t+";";xQ.innerHTML=e;const i=xQ.textContent;return i.charCodeAt(i.length-1)===59&&t!=="semi"||i===e?!1:i}function Pr(t,e,i,n){const s=t.length;let r=0,o;if(e<0?e=-e>s?0:s+e:e=e>s?s:e,i=i>0?i:0,n.length<1e4)o=Array.from(n),o.unshift(e,i),t.splice(...o);else for(i&&t.splice(e,i);r<n.length;)o=n.slice(r,r+1e4),o.unshift(e,0),t.splice(...o),r+=1e4,e+=1e4}function ws(t,e){return t.length>0?(Pr(t,t.length,0,e),t):e}const SQ={}.hasOwnProperty;function Xle(t){const e={};let i=-1;for(;++i<t.length;)Zle(e,t[i]);return e}function Zle(t,e){let i;for(i in e){const s=(SQ.call(t,i)?t[i]:void 0)||(t[i]={}),r=e[i];let o;if(r)for(o in r){SQ.call(s,o)||(s[o]=[]);const l=r[o];qle(s[o],Array.isArray(l)?l:l?[l]:[])}}}function qle(t,e){let i=-1;const n=[];for(;++i<e.length;)(e[i].add==="after"?t:n).push(e[i]);Pr(t,0,0,n)}function iz(t,e){const i=Number.parseInt(t,e);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function ih(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vr=La(/[A-Za-z]/),rs=La(/[\dA-Za-z]/),Wle=La(/[#-'*+\--9=?A-Z^-~]/);function zx(t){return t!==null&&(t<32||t===127)}const jx=La(/\d/),Ule=La(/[\dA-Fa-f]/),Yle=La(/[!-/:-@[-`{-~]/);function $e(t){return t!==null&&t<-2}function zn(t){return t!==null&&(t<0||t===32)}function lt(t){return t===-2||t===-1||t===32}const Hle=La(new RegExp("\\p{P}|\\p{S}","u")),Fle=La(/\s/);function La(t){return e;function e(i){return i!==null&&i>-1&&t.test(String.fromCharCode(i))}}function Eh(t){const e=[];let i=-1,n=0,s=0;for(;++i<t.length;){const r=t.charCodeAt(i);let o="";if(r===37&&rs(t.charCodeAt(i+1))&&rs(t.charCodeAt(i+2)))s=2;else if(r<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(r))||(o=String.fromCharCode(r));else if(r>55295&&r<57344){const l=t.charCodeAt(i+1);r<56320&&l>56319&&l<57344?(o=String.fromCharCode(r,l),s=1):o="�"}else o=String.fromCharCode(r);o&&(e.push(t.slice(n,i),encodeURIComponent(o)),n=i+s+1,o=""),s&&(i+=s,s=0)}return e.join("")+t.slice(n)}function kt(t,e,i,n){const s=n?n-1:Number.POSITIVE_INFINITY;let r=0;return o;function o(c){return lt(c)?(t.enter(i),l(c)):e(c)}function l(c){return lt(c)&&r++<s?(t.consume(c),l):(t.exit(i),e(c))}}const Gle={tokenize:Kle};function Kle(t){const e=t.attempt(this.parser.constructs.contentInitial,n,s);let i;return e;function n(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),kt(t,e,"linePrefix")}function s(l){return t.enter("paragraph"),r(l)}function r(l){const c=t.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=c),i=c,o(l)}function o(l){if(l===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(l);return}return $e(l)?(t.consume(l),t.exit("chunkText"),r):(t.consume(l),o)}}const Jle={tokenize:ece},wQ={tokenize:tce};function ece(t){const e=this,i=[];let n=0,s,r,o;return l;function l(k){if(n<i.length){const A=i[n];return e.containerState=A[1],t.attempt(A[0].continuation,c,u)(k)}return u(k)}function c(k){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,s&&T();const A=e.events.length;let R=A,E;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){E=e.events[R][1].end;break}w(n);let $=A;for(;$<e.events.length;)e.events[$][1].end={...E},$++;return Pr(e.events,R+1,0,e.events.slice(A)),e.events.length=$,u(k)}return l(k)}function u(k){if(n===i.length){if(!s)return g(k);if(s.currentConstruct&&s.currentConstruct.concrete)return _(k);e.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(wQ,d,p)(k)}function d(k){return s&&T(),w(n),g(k)}function p(k){return e.parser.lazy[e.now().line]=n!==i.length,o=e.now().offset,_(k)}function g(k){return e.containerState={},t.attempt(wQ,O,_)(k)}function O(k){return n++,i.push([e.currentConstruct,e.containerState]),g(k)}function _(k){if(k===null){s&&T(),w(0),t.consume(k);return}return s=s||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:r}),b(k)}function b(k){if(k===null){S(t.exit("chunkFlow"),!0),w(0),t.consume(k);return}return $e(k)?(t.consume(k),S(t.exit("chunkFlow")),n=0,e.interrupt=void 0,l):(t.consume(k),b)}function S(k,A){const R=e.sliceStream(k);if(A&&R.push(null),k.previous=r,r&&(r.next=k),r=k,s.defineSkip(k.start),s.write(R),e.parser.lazy[k.start.line]){let E=s.events.length;for(;E--;)if(s.events[E][1].start.offset<o&&(!s.events[E][1].end||s.events[E][1].end.offset>o))return;const $=e.events.length;let N=$,q,G;for(;N--;)if(e.events[N][0]==="exit"&&e.events[N][1].type==="chunkFlow"){if(q){G=e.events[N][1].end;break}q=!0}for(w(n),E=$;E<e.events.length;)e.events[E][1].end={...G},E++;Pr(e.events,N+1,0,e.events.slice($)),e.events.length=E}}function w(k){let A=i.length;for(;A-- >k;){const R=i[A];e.containerState=R[1],R[0].exit.call(e,t)}i.length=k}function T(){s.write([null]),r=void 0,s=void 0,e.containerState._closeFlow=void 0}}function tce(t,e,i){return kt(t,t.attempt(this.parser.constructs.document,e,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function CQ(t){if(t===null||zn(t)||Fle(t))return 1;if(Hle(t))return 2}function Hw(t,e,i){const n=[];let s=-1;for(;++s<t.length;){const r=t[s].resolveAll;r&&!n.includes(r)&&(e=r(e,i),n.push(r))}return e}const Ix={name:"attention",resolveAll:ice,tokenize:nce};function ice(t,e){let i=-1,n,s,r,o,l,c,u,d;for(;++i<t.length;)if(t[i][0]==="enter"&&t[i][1].type==="attentionSequence"&&t[i][1]._close){for(n=i;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[i][1]).charCodeAt(0)){if((t[n][1]._close||t[i][1]._open)&&(t[i][1].end.offset-t[i][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[i][1].end.offset-t[i][1].start.offset)%3))continue;c=t[n][1].end.offset-t[n][1].start.offset>1&&t[i][1].end.offset-t[i][1].start.offset>1?2:1;const p={...t[n][1].end},g={...t[i][1].start};kQ(p,-c),kQ(g,c),o={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...t[n][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...t[i][1].start},end:g},r={type:c>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[i][1].start}},s={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},t[n][1].end={...o.start},t[i][1].start={...l.end},u=[],t[n][1].end.offset-t[n][1].start.offset&&(u=ws(u,[["enter",t[n][1],e],["exit",t[n][1],e]])),u=ws(u,[["enter",s,e],["enter",o,e],["exit",o,e],["enter",r,e]]),u=ws(u,Hw(e.parser.constructs.insideSpan.null,t.slice(n+1,i),e)),u=ws(u,[["exit",r,e],["enter",l,e],["exit",l,e],["exit",s,e]]),t[i][1].end.offset-t[i][1].start.offset?(d=2,u=ws(u,[["enter",t[i][1],e],["exit",t[i][1],e]])):d=0,Pr(t,n-1,i-n+3,u),i=n+u.length-d-2;break}}for(i=-1;++i<t.length;)t[i][1].type==="attentionSequence"&&(t[i][1].type="data");return t}function nce(t,e){const i=this.parser.constructs.attentionMarkers.null,n=this.previous,s=CQ(n);let r;return o;function o(c){return r=c,t.enter("attentionSequence"),l(c)}function l(c){if(c===r)return t.consume(c),l;const u=t.exit("attentionSequence"),d=CQ(c),p=!d||d===2&&s||i.includes(c),g=!s||s===2&&d||i.includes(n);return u._open=!!(r===42?p:p&&(s||!g)),u._close=!!(r===42?g:g&&(d||!p)),e(c)}}function kQ(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const sce={name:"autolink",tokenize:rce};function rce(t,e,i){let n=0;return s;function s(O){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(O),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),r}function r(O){return vr(O)?(t.consume(O),o):O===64?i(O):u(O)}function o(O){return O===43||O===45||O===46||rs(O)?(n=1,l(O)):u(O)}function l(O){return O===58?(t.consume(O),n=0,c):(O===43||O===45||O===46||rs(O))&&n++<32?(t.consume(O),l):(n=0,u(O))}function c(O){return O===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(O),t.exit("autolinkMarker"),t.exit("autolink"),e):O===null||O===32||O===60||zx(O)?i(O):(t.consume(O),c)}function u(O){return O===64?(t.consume(O),d):Wle(O)?(t.consume(O),u):i(O)}function d(O){return rs(O)?p(O):i(O)}function p(O){return O===46?(t.consume(O),n=0,d):O===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(O),t.exit("autolinkMarker"),t.exit("autolink"),e):g(O)}function g(O){if((O===45||rs(O))&&n++<63){const _=O===45?g:p;return t.consume(O),_}return i(O)}}const MO={partial:!0,tokenize:oce};function oce(t,e,i){return n;function n(r){return lt(r)?kt(t,s,"linePrefix")(r):s(r)}function s(r){return r===null||$e(r)?e(r):i(r)}}const nz={continuation:{tokenize:lce},exit:cce,name:"blockQuote",tokenize:ace};function ace(t,e,i){const n=this;return s;function s(o){if(o===62){const l=n.containerState;return l.open||(t.enter("blockQuote",{_container:!0}),l.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(o),t.exit("blockQuoteMarker"),r}return i(o)}function r(o){return lt(o)?(t.enter("blockQuotePrefixWhitespace"),t.consume(o),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(o))}}function lce(t,e,i){const n=this;return s;function s(o){return lt(o)?kt(t,r,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):r(o)}function r(o){return t.attempt(nz,e,i)(o)}}function cce(t){t.exit("blockQuote")}const sz={name:"characterEscape",tokenize:hce};function hce(t,e,i){return n;function n(r){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(r),t.exit("escapeMarker"),s}function s(r){return Yle(r)?(t.enter("characterEscapeValue"),t.consume(r),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):i(r)}}const rz={name:"characterReference",tokenize:uce};function uce(t,e,i){const n=this;let s=0,r,o;return l;function l(p){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),c}function c(p){return p===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(p),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),r=31,o=rs,d(p))}function u(p){return p===88||p===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(p),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),r=6,o=Ule,d):(t.enter("characterReferenceValue"),r=7,o=jx,d(p))}function d(p){if(p===59&&s){const g=t.exit("characterReferenceValue");return o===rs&&!Yw(n.sliceSerialize(g))?i(p):(t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return o(p)&&s++<r?(t.consume(p),d):i(p)}}const TQ={partial:!0,tokenize:dce},AQ={concrete:!0,name:"codeFenced",tokenize:fce};function fce(t,e,i){const n=this,s={partial:!0,tokenize:R};let r=0,o=0,l;return c;function c(E){return u(E)}function u(E){const $=n.events[n.events.length-1];return r=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,l=E,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(E)}function d(E){return E===l?(o++,t.consume(E),d):o<3?i(E):(t.exit("codeFencedFenceSequence"),lt(E)?kt(t,p,"whitespace")(E):p(E))}function p(E){return E===null||$e(E)?(t.exit("codeFencedFence"),n.interrupt?e(E):t.check(TQ,b,A)(E)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||$e(E)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),p(E)):lt(E)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),kt(t,O,"whitespace")(E)):E===96&&E===l?i(E):(t.consume(E),g)}function O(E){return E===null||$e(E)?p(E):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),_(E))}function _(E){return E===null||$e(E)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),p(E)):E===96&&E===l?i(E):(t.consume(E),_)}function b(E){return t.attempt(s,A,S)(E)}function S(E){return t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),w}function w(E){return r>0&&lt(E)?kt(t,T,"linePrefix",r+1)(E):T(E)}function T(E){return E===null||$e(E)?t.check(TQ,b,A)(E):(t.enter("codeFlowValue"),k(E))}function k(E){return E===null||$e(E)?(t.exit("codeFlowValue"),T(E)):(t.consume(E),k)}function A(E){return t.exit("codeFenced"),e(E)}function R(E,$,N){let q=0;return G;function G(j){return E.enter("lineEnding"),E.consume(j),E.exit("lineEnding"),U}function U(j){return E.enter("codeFencedFence"),lt(j)?kt(E,Q,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):Q(j)}function Q(j){return j===l?(E.enter("codeFencedFenceSequence"),D(j)):N(j)}function D(j){return j===l?(q++,E.consume(j),D):q>=o?(E.exit("codeFencedFenceSequence"),lt(j)?kt(E,z,"whitespace")(j):z(j)):N(j)}function z(j){return j===null||$e(j)?(E.exit("codeFencedFence"),$(j)):N(j)}}}function dce(t,e,i){const n=this;return s;function s(o){return o===null?i(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r)}function r(o){return n.parser.lazy[n.now().line]?i(o):e(o)}}const a1={name:"codeIndented",tokenize:mce},pce={partial:!0,tokenize:gce};function mce(t,e,i){const n=this;return s;function s(u){return t.enter("codeIndented"),kt(t,r,"linePrefix",5)(u)}function r(u){const d=n.events[n.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):i(u)}function o(u){return u===null?c(u):$e(u)?t.attempt(pce,o,c)(u):(t.enter("codeFlowValue"),l(u))}function l(u){return u===null||$e(u)?(t.exit("codeFlowValue"),o(u)):(t.consume(u),l)}function c(u){return t.exit("codeIndented"),e(u)}}function gce(t,e,i){const n=this;return s;function s(o){return n.parser.lazy[n.now().line]?i(o):$e(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s):kt(t,r,"linePrefix",5)(o)}function r(o){const l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(o):$e(o)?s(o):i(o)}}const Oce={name:"codeText",previous:_ce,resolve:vce,tokenize:yce};function vce(t){let e=t.length-4,i=3,n,s;if((t[i][1].type==="lineEnding"||t[i][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=i;++n<e;)if(t[n][1].type==="codeTextData"){t[i][1].type="codeTextPadding",t[e][1].type="codeTextPadding",i+=2,e-=2;break}}for(n=i-1,e++;++n<=e;)s===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(s=n):(n===e||t[n][1].type==="lineEnding")&&(t[s][1].type="codeTextData",n!==s+2&&(t[s][1].end=t[n-1][1].end,t.splice(s+2,n-s-2),e-=n-s-2,n=s+2),s=void 0);return t}function _ce(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function yce(t,e,i){let n=0,s,r;return o;function o(p){return t.enter("codeText"),t.enter("codeTextSequence"),l(p)}function l(p){return p===96?(t.consume(p),n++,l):(t.exit("codeTextSequence"),c(p))}function c(p){return p===null?i(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),c):p===96?(r=t.enter("codeTextSequence"),s=0,d(p)):$e(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),c):(t.enter("codeTextData"),u(p))}function u(p){return p===null||p===32||p===96||$e(p)?(t.exit("codeTextData"),c(p)):(t.consume(p),u)}function d(p){return p===96?(t.consume(p),s++,d):s===n?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(r.type="codeTextData",u(p))}}class bce{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,i){const n=i??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,i,n){const s=i||0;this.setCursor(Math.trunc(e));const r=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return n&&Uu(this.left,n),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Uu(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Uu(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const i=this.left.splice(e,Number.POSITIVE_INFINITY);Uu(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Uu(this.left,i.reverse())}}}function Uu(t,e){let i=0;if(e.length<1e4)t.push(...e);else for(;i<e.length;)t.push(...e.slice(i,i+1e4)),i+=1e4}function oz(t){const e={};let i=-1,n,s,r,o,l,c,u;const d=new bce(t);for(;++i<d.length;){for(;i in e;)i=e[i];if(n=d.get(i),i&&n[1].type==="chunkFlow"&&d.get(i-1)[1].type==="listItemPrefix"&&(c=n[1]._tokenizer.events,r=0,r<c.length&&c[r][1].type==="lineEndingBlank"&&(r+=2),r<c.length&&c[r][1].type==="content"))for(;++r<c.length&&c[r][1].type!=="content";)c[r][1].type==="chunkText"&&(c[r][1]._isInFirstContentOfListItem=!0,r++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,xce(d,i)),i=e[i],u=!0);else if(n[1]._container){for(r=i,s=void 0;r--;)if(o=d.get(r),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=r);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(n[1].end={...d.get(s)[1].start},l=d.slice(s,i),l.unshift(n),d.splice(s,i-s+1,l))}}return Pr(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function xce(t,e){const i=t.get(e)[1],n=t.get(e)[2];let s=e-1;const r=[];let o=i._tokenizer;o||(o=n.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],u={};let d,p,g=-1,O=i,_=0,b=0;const S=[b];for(;O;){for(;t.get(++s)[1]!==O;);r.push(s),O._tokenizer||(d=n.sliceStream(O),O.next||d.push(null),p&&o.defineSkip(O.start),O._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),O._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=O,O=O.next}for(O=i;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(b=g+1,S.push(b),O._tokenizer=void 0,O.previous=void 0,O=O.next);for(o.events=[],O?(O._tokenizer=void 0,O.previous=void 0):S.pop(),g=S.length;g--;){const w=l.slice(S[g],S[g+1]),T=r.pop();c.push([T,T+w.length-1]),t.splice(T,2,w)}for(c.reverse(),g=-1;++g<c.length;)u[_+c[g][0]]=_+c[g][1],_+=c[g][1]-c[g][0]-1;return u}const Sce={resolve:Cce,tokenize:kce},wce={partial:!0,tokenize:Tce};function Cce(t){return oz(t),t}function kce(t,e){let i;return n;function n(l){return t.enter("content"),i=t.enter("chunkContent",{contentType:"content"}),s(l)}function s(l){return l===null?r(l):$e(l)?t.check(wce,o,r)(l):(t.consume(l),s)}function r(l){return t.exit("chunkContent"),t.exit("content"),e(l)}function o(l){return t.consume(l),t.exit("chunkContent"),i.next=t.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,s}}function Tce(t,e,i){const n=this;return s;function s(o){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),kt(t,r,"linePrefix")}function r(o){if(o===null||$e(o))return i(o);const l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(o):t.interrupt(n.parser.constructs.flow,i,e)(o)}}function az(t,e,i,n,s,r,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return p;function p(w){return w===60?(t.enter(n),t.enter(s),t.enter(r),t.consume(w),t.exit(r),g):w===null||w===32||w===41||zx(w)?i(w):(t.enter(n),t.enter(o),t.enter(l),t.enter("chunkString",{contentType:"string"}),b(w))}function g(w){return w===62?(t.enter(r),t.consume(w),t.exit(r),t.exit(s),t.exit(n),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),O(w))}function O(w){return w===62?(t.exit("chunkString"),t.exit(l),g(w)):w===null||w===60||$e(w)?i(w):(t.consume(w),w===92?_:O)}function _(w){return w===60||w===62||w===92?(t.consume(w),O):O(w)}function b(w){return!d&&(w===null||w===41||zn(w))?(t.exit("chunkString"),t.exit(l),t.exit(o),t.exit(n),e(w)):d<u&&w===40?(t.consume(w),d++,b):w===41?(t.consume(w),d--,b):w===null||w===32||w===40||zx(w)?i(w):(t.consume(w),w===92?S:b)}function S(w){return w===40||w===41||w===92?(t.consume(w),b):b(w)}}function lz(t,e,i,n,s,r){const o=this;let l=0,c;return u;function u(O){return t.enter(n),t.enter(s),t.consume(O),t.exit(s),t.enter(r),d}function d(O){return l>999||O===null||O===91||O===93&&!c||O===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?i(O):O===93?(t.exit(r),t.enter(s),t.consume(O),t.exit(s),t.exit(n),e):$e(O)?(t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),p(O))}function p(O){return O===null||O===91||O===93||$e(O)||l++>999?(t.exit("chunkString"),d(O)):(t.consume(O),c||(c=!lt(O)),O===92?g:p)}function g(O){return O===91||O===92||O===93?(t.consume(O),l++,p):p(O)}}function cz(t,e,i,n,s,r){let o;return l;function l(g){return g===34||g===39||g===40?(t.enter(n),t.enter(s),t.consume(g),t.exit(s),o=g===40?41:g,c):i(g)}function c(g){return g===o?(t.enter(s),t.consume(g),t.exit(s),t.exit(n),e):(t.enter(r),u(g))}function u(g){return g===o?(t.exit(r),c(o)):g===null?i(g):$e(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),kt(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===o||g===null||$e(g)?(t.exit("chunkString"),u(g)):(t.consume(g),g===92?p:d)}function p(g){return g===o||g===92?(t.consume(g),d):d(g)}}function Sf(t,e){let i;return n;function n(s){return $e(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i=!0,n):lt(s)?kt(t,n,i?"linePrefix":"lineSuffix")(s):e(s)}}const Ace={name:"definition",tokenize:Mce},Ece={partial:!0,tokenize:Pce};function Mce(t,e,i){const n=this;let s;return r;function r(O){return t.enter("definition"),o(O)}function o(O){return lz.call(n,t,l,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(O)}function l(O){return s=ih(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),O===58?(t.enter("definitionMarker"),t.consume(O),t.exit("definitionMarker"),c):i(O)}function c(O){return zn(O)?Sf(t,u)(O):u(O)}function u(O){return az(t,d,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(O)}function d(O){return t.attempt(Ece,p,p)(O)}function p(O){return lt(O)?kt(t,g,"whitespace")(O):g(O)}function g(O){return O===null||$e(O)?(t.exit("definition"),n.parser.defined.push(s),e(O)):i(O)}}function Pce(t,e,i){return n;function n(l){return zn(l)?Sf(t,s)(l):i(l)}function s(l){return cz(t,r,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function r(l){return lt(l)?kt(t,o,"whitespace")(l):o(l)}function o(l){return l===null||$e(l)?e(l):i(l)}}const Rce={name:"hardBreakEscape",tokenize:Qce};function Qce(t,e,i){return n;function n(r){return t.enter("hardBreakEscape"),t.consume(r),s}function s(r){return $e(r)?(t.exit("hardBreakEscape"),e(r)):i(r)}}const Lce={name:"headingAtx",resolve:Dce,tokenize:Bce};function Dce(t,e){let i=t.length-2,n=3,s,r;return t[n][1].type==="whitespace"&&(n+=2),i-2>n&&t[i][1].type==="whitespace"&&(i-=2),t[i][1].type==="atxHeadingSequence"&&(n===i-1||i-4>n&&t[i-2][1].type==="whitespace")&&(i-=n+1===i?2:4),i>n&&(s={type:"atxHeadingText",start:t[n][1].start,end:t[i][1].end},r={type:"chunkText",start:t[n][1].start,end:t[i][1].end,contentType:"text"},Pr(t,n,i-n+1,[["enter",s,e],["enter",r,e],["exit",r,e],["exit",s,e]])),t}function Bce(t,e,i){let n=0;return s;function s(d){return t.enter("atxHeading"),r(d)}function r(d){return t.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&n++<6?(t.consume(d),o):d===null||zn(d)?(t.exit("atxHeadingSequence"),l(d)):i(d)}function l(d){return d===35?(t.enter("atxHeadingSequence"),c(d)):d===null||$e(d)?(t.exit("atxHeading"),e(d)):lt(d)?kt(t,l,"whitespace")(d):(t.enter("atxHeadingText"),u(d))}function c(d){return d===35?(t.consume(d),c):(t.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||zn(d)?(t.exit("atxHeadingText"),l(d)):(t.consume(d),u)}}const $ce=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],EQ=["pre","script","style","textarea"],Nce={concrete:!0,name:"htmlFlow",resolveTo:Ice,tokenize:Vce},zce={partial:!0,tokenize:Zce},jce={partial:!0,tokenize:Xce};function Ice(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Vce(t,e,i){const n=this;let s,r,o,l,c;return u;function u(L){return d(L)}function d(L){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(L),p}function p(L){return L===33?(t.consume(L),g):L===47?(t.consume(L),r=!0,b):L===63?(t.consume(L),s=3,n.interrupt?e:M):vr(L)?(t.consume(L),o=String.fromCharCode(L),S):i(L)}function g(L){return L===45?(t.consume(L),s=2,O):L===91?(t.consume(L),s=5,l=0,_):vr(L)?(t.consume(L),s=4,n.interrupt?e:M):i(L)}function O(L){return L===45?(t.consume(L),n.interrupt?e:M):i(L)}function _(L){const ue="CDATA[";return L===ue.charCodeAt(l++)?(t.consume(L),l===ue.length?n.interrupt?e:Q:_):i(L)}function b(L){return vr(L)?(t.consume(L),o=String.fromCharCode(L),S):i(L)}function S(L){if(L===null||L===47||L===62||zn(L)){const ue=L===47,he=o.toLowerCase();return!ue&&!r&&EQ.includes(he)?(s=1,n.interrupt?e(L):Q(L)):$ce.includes(o.toLowerCase())?(s=6,ue?(t.consume(L),w):n.interrupt?e(L):Q(L)):(s=7,n.interrupt&&!n.parser.lazy[n.now().line]?i(L):r?T(L):k(L))}return L===45||rs(L)?(t.consume(L),o+=String.fromCharCode(L),S):i(L)}function w(L){return L===62?(t.consume(L),n.interrupt?e:Q):i(L)}function T(L){return lt(L)?(t.consume(L),T):G(L)}function k(L){return L===47?(t.consume(L),G):L===58||L===95||vr(L)?(t.consume(L),A):lt(L)?(t.consume(L),k):G(L)}function A(L){return L===45||L===46||L===58||L===95||rs(L)?(t.consume(L),A):R(L)}function R(L){return L===61?(t.consume(L),E):lt(L)?(t.consume(L),R):k(L)}function E(L){return L===null||L===60||L===61||L===62||L===96?i(L):L===34||L===39?(t.consume(L),c=L,$):lt(L)?(t.consume(L),E):N(L)}function $(L){return L===c?(t.consume(L),c=null,q):L===null||$e(L)?i(L):(t.consume(L),$)}function N(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||zn(L)?R(L):(t.consume(L),N)}function q(L){return L===47||L===62||lt(L)?k(L):i(L)}function G(L){return L===62?(t.consume(L),U):i(L)}function U(L){return L===null||$e(L)?Q(L):lt(L)?(t.consume(L),U):i(L)}function Q(L){return L===45&&s===2?(t.consume(L),B):L===60&&s===1?(t.consume(L),Z):L===62&&s===4?(t.consume(L),V):L===63&&s===3?(t.consume(L),M):L===93&&s===5?(t.consume(L),F):$e(L)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(zce,J,D)(L)):L===null||$e(L)?(t.exit("htmlFlowData"),D(L)):(t.consume(L),Q)}function D(L){return t.check(jce,z,J)(L)}function z(L){return t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),j}function j(L){return L===null||$e(L)?D(L):(t.enter("htmlFlowData"),Q(L))}function B(L){return L===45?(t.consume(L),M):Q(L)}function Z(L){return L===47?(t.consume(L),o="",H):Q(L)}function H(L){if(L===62){const ue=o.toLowerCase();return EQ.includes(ue)?(t.consume(L),V):Q(L)}return vr(L)&&o.length<8?(t.consume(L),o+=String.fromCharCode(L),H):Q(L)}function F(L){return L===93?(t.consume(L),M):Q(L)}function M(L){return L===62?(t.consume(L),V):L===45&&s===2?(t.consume(L),M):Q(L)}function V(L){return L===null||$e(L)?(t.exit("htmlFlowData"),J(L)):(t.consume(L),V)}function J(L){return t.exit("htmlFlow"),e(L)}}function Xce(t,e,i){const n=this;return s;function s(o){return $e(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r):i(o)}function r(o){return n.parser.lazy[n.now().line]?i(o):e(o)}}function Zce(t,e,i){return n;function n(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(MO,e,i)}}const qce={name:"htmlText",tokenize:Wce};function Wce(t,e,i){const n=this;let s,r,o;return l;function l(M){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(M),c}function c(M){return M===33?(t.consume(M),u):M===47?(t.consume(M),R):M===63?(t.consume(M),k):vr(M)?(t.consume(M),N):i(M)}function u(M){return M===45?(t.consume(M),d):M===91?(t.consume(M),r=0,_):vr(M)?(t.consume(M),T):i(M)}function d(M){return M===45?(t.consume(M),O):i(M)}function p(M){return M===null?i(M):M===45?(t.consume(M),g):$e(M)?(o=p,Z(M)):(t.consume(M),p)}function g(M){return M===45?(t.consume(M),O):p(M)}function O(M){return M===62?B(M):M===45?g(M):p(M)}function _(M){const V="CDATA[";return M===V.charCodeAt(r++)?(t.consume(M),r===V.length?b:_):i(M)}function b(M){return M===null?i(M):M===93?(t.consume(M),S):$e(M)?(o=b,Z(M)):(t.consume(M),b)}function S(M){return M===93?(t.consume(M),w):b(M)}function w(M){return M===62?B(M):M===93?(t.consume(M),w):b(M)}function T(M){return M===null||M===62?B(M):$e(M)?(o=T,Z(M)):(t.consume(M),T)}function k(M){return M===null?i(M):M===63?(t.consume(M),A):$e(M)?(o=k,Z(M)):(t.consume(M),k)}function A(M){return M===62?B(M):k(M)}function R(M){return vr(M)?(t.consume(M),E):i(M)}function E(M){return M===45||rs(M)?(t.consume(M),E):$(M)}function $(M){return $e(M)?(o=$,Z(M)):lt(M)?(t.consume(M),$):B(M)}function N(M){return M===45||rs(M)?(t.consume(M),N):M===47||M===62||zn(M)?q(M):i(M)}function q(M){return M===47?(t.consume(M),B):M===58||M===95||vr(M)?(t.consume(M),G):$e(M)?(o=q,Z(M)):lt(M)?(t.consume(M),q):B(M)}function G(M){return M===45||M===46||M===58||M===95||rs(M)?(t.consume(M),G):U(M)}function U(M){return M===61?(t.consume(M),Q):$e(M)?(o=U,Z(M)):lt(M)?(t.consume(M),U):q(M)}function Q(M){return M===null||M===60||M===61||M===62||M===96?i(M):M===34||M===39?(t.consume(M),s=M,D):$e(M)?(o=Q,Z(M)):lt(M)?(t.consume(M),Q):(t.consume(M),z)}function D(M){return M===s?(t.consume(M),s=void 0,j):M===null?i(M):$e(M)?(o=D,Z(M)):(t.consume(M),D)}function z(M){return M===null||M===34||M===39||M===60||M===61||M===96?i(M):M===47||M===62||zn(M)?q(M):(t.consume(M),z)}function j(M){return M===47||M===62||zn(M)?q(M):i(M)}function B(M){return M===62?(t.consume(M),t.exit("htmlTextData"),t.exit("htmlText"),e):i(M)}function Z(M){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),H}function H(M){return lt(M)?kt(t,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):F(M)}function F(M){return t.enter("htmlTextData"),o(M)}}const Fw={name:"labelEnd",resolveAll:Fce,resolveTo:Gce,tokenize:Kce},Uce={tokenize:Jce},Yce={tokenize:ehe},Hce={tokenize:the};function Fce(t){let e=-1;const i=[];for(;++e<t.length;){const n=t[e][1];if(i.push(t[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const s=n.type==="labelImage"?4:2;n.type="data",e+=s}}return t.length!==i.length&&Pr(t,0,t.length,i),t}function Gce(t,e){let i=t.length,n=0,s,r,o,l;for(;i--;)if(s=t[i][1],r){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;t[i][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(t[i][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(r=i,s.type!=="labelLink")){n=2;break}}else s.type==="labelEnd"&&(o=i);const c={type:t[r][1].type==="labelLink"?"link":"image",start:{...t[r][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[r][1].start},end:{...t[o][1].end}},d={type:"labelText",start:{...t[r+n+2][1].end},end:{...t[o-2][1].start}};return l=[["enter",c,e],["enter",u,e]],l=ws(l,t.slice(r+1,r+n+3)),l=ws(l,[["enter",d,e]]),l=ws(l,Hw(e.parser.constructs.insideSpan.null,t.slice(r+n+4,o-3),e)),l=ws(l,[["exit",d,e],t[o-2],t[o-1],["exit",u,e]]),l=ws(l,t.slice(o+1)),l=ws(l,[["exit",c,e]]),Pr(t,r,t.length,l),t}function Kce(t,e,i){const n=this;let s=n.events.length,r,o;for(;s--;)if((n.events[s][1].type==="labelImage"||n.events[s][1].type==="labelLink")&&!n.events[s][1]._balanced){r=n.events[s][1];break}return l;function l(g){return r?r._inactive?p(g):(o=n.parser.defined.includes(ih(n.sliceSerialize({start:r.end,end:n.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(g),t.exit("labelMarker"),t.exit("labelEnd"),c):i(g)}function c(g){return g===40?t.attempt(Uce,d,o?d:p)(g):g===91?t.attempt(Yce,d,o?u:p)(g):o?d(g):p(g)}function u(g){return t.attempt(Hce,d,p)(g)}function d(g){return e(g)}function p(g){return r._balanced=!0,i(g)}}function Jce(t,e,i){return n;function n(p){return t.enter("resource"),t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),s}function s(p){return zn(p)?Sf(t,r)(p):r(p)}function r(p){return p===41?d(p):az(t,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return zn(p)?Sf(t,c)(p):d(p)}function l(p){return i(p)}function c(p){return p===34||p===39||p===40?cz(t,u,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):d(p)}function u(p){return zn(p)?Sf(t,d)(p):d(p)}function d(p){return p===41?(t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),t.exit("resource"),e):i(p)}}function ehe(t,e,i){const n=this;return s;function s(l){return lz.call(n,t,r,o,"reference","referenceMarker","referenceString")(l)}function r(l){return n.parser.defined.includes(ih(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(l):i(l)}function o(l){return i(l)}}function the(t,e,i){return n;function n(r){return t.enter("reference"),t.enter("referenceMarker"),t.consume(r),t.exit("referenceMarker"),s}function s(r){return r===93?(t.enter("referenceMarker"),t.consume(r),t.exit("referenceMarker"),t.exit("reference"),e):i(r)}}const ihe={name:"labelStartImage",resolveAll:Fw.resolveAll,tokenize:nhe};function nhe(t,e,i){const n=this;return s;function s(l){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(l),t.exit("labelImageMarker"),r}function r(l){return l===91?(t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelImage"),o):i(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?i(l):e(l)}}const she={name:"labelStartLink",resolveAll:Fw.resolveAll,tokenize:rhe};function rhe(t,e,i){const n=this;return s;function s(o){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelLink"),r}function r(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?i(o):e(o)}}const l1={name:"lineEnding",tokenize:ohe};function ohe(t,e){return i;function i(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),kt(t,e,"linePrefix")}}const lg={name:"thematicBreak",tokenize:ahe};function ahe(t,e,i){let n=0,s;return r;function r(u){return t.enter("thematicBreak"),o(u)}function o(u){return s=u,l(u)}function l(u){return u===s?(t.enter("thematicBreakSequence"),c(u)):n>=3&&(u===null||$e(u))?(t.exit("thematicBreak"),e(u)):i(u)}function c(u){return u===s?(t.consume(u),n++,c):(t.exit("thematicBreakSequence"),lt(u)?kt(t,l,"whitespace")(u):l(u))}}const Rn={continuation:{tokenize:uhe},exit:dhe,name:"list",tokenize:hhe},lhe={partial:!0,tokenize:phe},che={partial:!0,tokenize:fhe};function hhe(t,e,i){const n=this,s=n.events[n.events.length-1];let r=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(O){const _=n.containerState.type||(O===42||O===43||O===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!n.containerState.marker||O===n.containerState.marker:jx(O)){if(n.containerState.type||(n.containerState.type=_,t.enter(_,{_container:!0})),_==="listUnordered")return t.enter("listItemPrefix"),O===42||O===45?t.check(lg,i,u)(O):u(O);if(!n.interrupt||O===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),c(O)}return i(O)}function c(O){return jx(O)&&++o<10?(t.consume(O),c):(!n.interrupt||o<2)&&(n.containerState.marker?O===n.containerState.marker:O===41||O===46)?(t.exit("listItemValue"),u(O)):i(O)}function u(O){return t.enter("listItemMarker"),t.consume(O),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||O,t.check(MO,n.interrupt?i:d,t.attempt(lhe,g,p))}function d(O){return n.containerState.initialBlankLine=!0,r++,g(O)}function p(O){return lt(O)?(t.enter("listItemPrefixWhitespace"),t.consume(O),t.exit("listItemPrefixWhitespace"),g):i(O)}function g(O){return n.containerState.size=r+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(O)}}function uhe(t,e,i){const n=this;return n.containerState._closeFlow=void 0,t.check(MO,s,r);function s(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,kt(t,e,"listItemIndent",n.containerState.size+1)(l)}function r(l){return n.containerState.furtherBlankLines||!lt(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,o(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(che,e,o)(l))}function o(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,kt(t,t.attempt(Rn,e,i),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function fhe(t,e,i){const n=this;return kt(t,s,"listItemIndent",n.containerState.size+1);function s(r){const o=n.events[n.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===n.containerState.size?e(r):i(r)}}function dhe(t){t.exit(this.containerState.type)}function phe(t,e,i){const n=this;return kt(t,s,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(r){const o=n.events[n.events.length-1];return!lt(r)&&o&&o[1].type==="listItemPrefixWhitespace"?e(r):i(r)}}const MQ={name:"setextUnderline",resolveTo:mhe,tokenize:ghe};function mhe(t,e){let i=t.length,n,s,r;for(;i--;)if(t[i][0]==="enter"){if(t[i][1].type==="content"){n=i;break}t[i][1].type==="paragraph"&&(s=i)}else t[i][1].type==="content"&&t.splice(i,1),!r&&t[i][1].type==="definition"&&(r=i);const o={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",r?(t.splice(s,0,["enter",o,e]),t.splice(r+1,0,["exit",t[n][1],e]),t[n][1].end={...t[r][1].end}):t[n][1]=o,t.push(["exit",o,e]),t}function ghe(t,e,i){const n=this;let s;return r;function r(u){let d=n.events.length,p;for(;d--;)if(n.events[d][1].type!=="lineEnding"&&n.events[d][1].type!=="linePrefix"&&n.events[d][1].type!=="content"){p=n.events[d][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||p)?(t.enter("setextHeadingLine"),s=u,o(u)):i(u)}function o(u){return t.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===s?(t.consume(u),l):(t.exit("setextHeadingLineSequence"),lt(u)?kt(t,c,"lineSuffix")(u):c(u))}function c(u){return u===null||$e(u)?(t.exit("setextHeadingLine"),e(u)):i(u)}}const Ohe={tokenize:vhe};function vhe(t){const e=this,i=t.attempt(MO,n,t.attempt(this.parser.constructs.flowInitial,s,kt(t,t.attempt(this.parser.constructs.flow,s,t.attempt(Sce,s)),"linePrefix")));return i;function n(r){if(r===null){t.consume(r);return}return t.enter("lineEndingBlank"),t.consume(r),t.exit("lineEndingBlank"),e.currentConstruct=void 0,i}function s(r){if(r===null){t.consume(r);return}return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),e.currentConstruct=void 0,i}}const _he={resolveAll:uz()},yhe=hz("string"),bhe=hz("text");function hz(t){return{resolveAll:uz(t==="text"?xhe:void 0),tokenize:e};function e(i){const n=this,s=this.parser.constructs[t],r=i.attempt(s,o,l);return o;function o(d){return u(d)?r(d):l(d)}function l(d){if(d===null){i.consume(d);return}return i.enter("data"),i.consume(d),c}function c(d){return u(d)?(i.exit("data"),r(d)):(i.consume(d),c)}function u(d){if(d===null)return!0;const p=s[d];let g=-1;if(p)for(;++g<p.length;){const O=p[g];if(!O.previous||O.previous.call(n,n.previous))return!0}return!1}}}function uz(t){return e;function e(i,n){let s=-1,r;for(;++s<=i.length;)r===void 0?i[s]&&i[s][1].type==="data"&&(r=s,s++):(!i[s]||i[s][1].type!=="data")&&(s!==r+2&&(i[r][1].end=i[s-1][1].end,i.splice(r+2,s-r-2),s=r+2),r=void 0);return t?t(i,n):i}}function xhe(t,e){let i=0;for(;++i<=t.length;)if((i===t.length||t[i][1].type==="lineEnding")&&t[i-1][1].type==="data"){const n=t[i-1][1],s=e.sliceStream(n);let r=s.length,o=-1,l=0,c;for(;r--;){const u=s[r];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(u===-2)c=!0,l++;else if(u!==-1){r++;break}}if(e._contentTypeTextTrailing&&i===t.length&&(l=0),l){const u={type:i===t.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:r?o:n.start._bufferIndex+o,_index:n.start._index+r,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...u.start},n.start.offset===n.end.offset?Object.assign(n,u):(t.splice(i,0,["enter",u,e],["exit",u,e]),i+=2)}i++}return t}const She={42:Rn,43:Rn,45:Rn,48:Rn,49:Rn,50:Rn,51:Rn,52:Rn,53:Rn,54:Rn,55:Rn,56:Rn,57:Rn,62:nz},whe={91:Ace},Che={[-2]:a1,[-1]:a1,32:a1},khe={35:Lce,42:lg,45:[MQ,lg],60:Nce,61:MQ,95:lg,96:AQ,126:AQ},The={38:rz,92:sz},Ahe={[-5]:l1,[-4]:l1,[-3]:l1,33:ihe,38:rz,42:Ix,60:[sce,qce],91:she,92:[Rce,sz],93:Fw,95:Ix,96:Oce},Ehe={null:[Ix,_he]},Mhe={null:[42,95]},Phe={null:[]},Rhe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Mhe,contentInitial:whe,disable:Phe,document:She,flow:khe,flowInitial:Che,insideSpan:Ehe,string:The,text:Ahe},Symbol.toStringTag,{value:"Module"}));function Qhe(t,e,i){let n={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const s={},r=[];let o=[],l=[];const c={attempt:$(R),check:$(E),consume:T,enter:k,exit:A,interrupt:$(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:b,events:[],now:_,parser:t,previous:null,sliceSerialize:g,sliceStream:O,write:p};let d=e.tokenize.call(u,c);return e.resolveAll&&r.push(e),u;function p(U){return o=ws(o,U),S(),o[o.length-1]!==null?[]:(N(e,0),u.events=Hw(r,u.events,u),u.events)}function g(U,Q){return Dhe(O(U),Q)}function O(U){return Lhe(o,U)}function _(){const{_bufferIndex:U,_index:Q,line:D,column:z,offset:j}=n;return{_bufferIndex:U,_index:Q,line:D,column:z,offset:j}}function b(U){s[U.line]=U.column,G()}function S(){let U;for(;n._index<o.length;){const Q=o[n._index];if(typeof Q=="string")for(U=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===U&&n._bufferIndex<Q.length;)w(Q.charCodeAt(n._bufferIndex));else w(Q)}}function w(U){d=d(U)}function T(U){$e(U)?(n.line++,n.column=1,n.offset+=U===-3?2:1,G()):U!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===o[n._index].length&&(n._bufferIndex=-1,n._index++)),u.previous=U}function k(U,Q){const D=Q||{};return D.type=U,D.start=_(),u.events.push(["enter",D,u]),l.push(D),D}function A(U){const Q=l.pop();return Q.end=_(),u.events.push(["exit",Q,u]),Q}function R(U,Q){N(U,Q.from)}function E(U,Q){Q.restore()}function $(U,Q){return D;function D(z,j,B){let Z,H,F,M;return Array.isArray(z)?J(z):"tokenize"in z?J([z]):V(z);function V(fe){return Oe;function Oe(Ce){const ye=Ce!==null&&fe[Ce],nt=Ce!==null&&fe.null,Qt=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(nt)?nt:nt?[nt]:[]];return J(Qt)(Ce)}}function J(fe){return Z=fe,H=0,fe.length===0?B:L(fe[H])}function L(fe){return Oe;function Oe(Ce){return M=q(),F=fe,fe.partial||(u.currentConstruct=fe),fe.name&&u.parser.constructs.disable.null.includes(fe.name)?he():fe.tokenize.call(Q?Object.assign(Object.create(u),Q):u,c,ue,he)(Ce)}}function ue(fe){return U(F,M),j}function he(fe){return M.restore(),++H<Z.length?L(Z[H]):B}}}function N(U,Q){U.resolveAll&&!r.includes(U)&&r.push(U),U.resolve&&Pr(u.events,Q,u.events.length-Q,U.resolve(u.events.slice(Q),u)),U.resolveTo&&(u.events=U.resolveTo(u.events,u))}function q(){const U=_(),Q=u.previous,D=u.currentConstruct,z=u.events.length,j=Array.from(l);return{from:z,restore:B};function B(){n=U,u.previous=Q,u.currentConstruct=D,u.events.length=z,l=j,G()}}function G(){n.line in s&&n.column<2&&(n.column=s[n.line],n.offset+=s[n.line]-1)}}function Lhe(t,e){const i=e.start._index,n=e.start._bufferIndex,s=e.end._index,r=e.end._bufferIndex;let o;if(i===s)o=[t[i].slice(n,r)];else{if(o=t.slice(i,s),n>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(n):o.shift()}r>0&&o.push(t[s].slice(0,r))}return o}function Dhe(t,e){let i=-1;const n=[];let s;for(;++i<t.length;){const r=t[i];let o;if(typeof r=="string")o=r;else switch(r){case-5:{o="\r";break}case-4:{o=`
219
- `;break}case-3:{o=`\r
220
- `;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&s)continue;o=" ";break}default:o=String.fromCharCode(r)}s=r===-2,n.push(o)}return n.join("")}function Bhe(t){const n={constructs:Xle([Rhe,...(t||{}).extensions||[]]),content:s(Gle),defined:[],document:s(Jle),flow:s(Ohe),lazy:{},string:s(yhe),text:s(bhe)};return n;function s(r){return o;function o(l){return Qhe(n,r,l)}}}function $he(t){for(;!oz(t););return t}const PQ=/[\0\t\n\r]/g;function Nhe(){let t=1,e="",i=!0,n;return s;function s(r,o,l){const c=[];let u,d,p,g,O;for(r=e+(typeof r=="string"?r.toString():new TextDecoder(o||void 0).decode(r)),p=0,e="",i&&(r.charCodeAt(0)===65279&&p++,i=void 0);p<r.length;){if(PQ.lastIndex=p,u=PQ.exec(r),g=u&&u.index!==void 0?u.index:r.length,O=r.charCodeAt(g),!u){e=r.slice(p);break}if(O===10&&p===g&&n)c.push(-3),n=void 0;else switch(n&&(c.push(-5),n=void 0),p<g&&(c.push(r.slice(p,g)),t+=g-p),O){case 0:{c.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,c.push(-2);t++<d;)c.push(-1);break}case 10:{c.push(-4),t=1;break}default:n=!0,t=1}p=g+1}return l&&(n&&c.push(-5),e&&c.push(e),c.push(null)),c}}const zhe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jhe(t){return t.replace(zhe,Ihe)}function Ihe(t,e,i){if(e)return e;if(i.charCodeAt(0)===35){const s=i.charCodeAt(1),r=s===120||s===88;return iz(i.slice(r?2:1),r?16:10)}return Yw(i)||t}const fz={}.hasOwnProperty;function Vhe(t,e,i){return e&&typeof e=="object"&&(i=e,e=void 0),Xhe(i)($he(Bhe(i).document().write(Nhe()(t,e,!0))))}function Xhe(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(Br),autolinkProtocol:q,autolinkEmail:q,atxHeading:r(as),blockQuote:r(nt),characterEscape:q,characterReference:q,codeFenced:r(Qt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:r(Qt,o),codeText:r(Yt,o),codeTextData:q,data:q,codeFlowValue:q,definition:r(ei),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:r(Le),hardBreakEscape:r(To),hardBreakTrailing:r(To),htmlFlow:r(Ao,o),htmlFlowData:q,htmlText:r(Ao,o),htmlTextData:q,image:r(Da),label:o,link:r(Br),listItem:r(Mh),listItemValue:g,listOrdered:r(Eo,p),listUnordered:r(Eo),paragraph:r(QO),reference:L,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:r(as),strong:r(LO),thematicBreak:r(DO)},exit:{atxHeading:c(),atxHeadingSequence:R,autolink:c(),autolinkEmail:ye,autolinkProtocol:Ce,blockQuote:c(),characterEscapeValue:G,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:fe,characterReference:Oe,codeFenced:c(S),codeFencedFence:b,codeFencedFenceInfo:O,codeFencedFenceMeta:_,codeFlowValue:G,codeIndented:c(w),codeText:c(j),codeTextData:G,data:G,definition:c(),definitionDestinationString:A,definitionLabelString:T,definitionTitleString:k,emphasis:c(),hardBreakEscape:c(Q),hardBreakTrailing:c(Q),htmlFlow:c(D),htmlFlowData:G,htmlText:c(z),htmlTextData:G,image:c(Z),label:F,labelText:H,lineEnding:U,link:c(B),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ue,resourceDestinationString:M,resourceTitleString:V,resource:J,setextHeading:c(N),setextHeadingLineSequence:$,setextHeadingText:E,strong:c(),thematicBreak:c()}};dz(e,(t||{}).mdastExtensions||[]);const i={};return n;function n(oe){let ge={type:"root",children:[]};const De={stack:[ge],tokenStack:[],config:e,enter:l,exit:u,buffer:o,resume:d,data:i},Ye=[];let ht=-1;for(;++ht<oe.length;)if(oe[ht][1].type==="listOrdered"||oe[ht][1].type==="listUnordered")if(oe[ht][0]==="enter")Ye.push(ht);else{const In=Ye.pop();ht=s(oe,In,ht)}for(ht=-1;++ht<oe.length;){const In=e[oe[ht][0]];fz.call(In,oe[ht][1].type)&&In[oe[ht][1].type].call(Object.assign({sliceSerialize:oe[ht][2].sliceSerialize},De),oe[ht][1])}if(De.tokenStack.length>0){const In=De.tokenStack[De.tokenStack.length-1];(In[1]||RQ).call(De,void 0,In[0])}for(ge.position={start:ca(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:ca(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},ht=-1;++ht<e.transforms.length;)ge=e.transforms[ht](ge)||ge;return ge}function s(oe,ge,De){let Ye=ge-1,ht=-1,In=!1,$r,hn,fi,xn;for(;++Ye<=De;){const _t=oe[Ye];switch(_t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{_t[0]==="enter"?ht++:ht--,xn=void 0;break}case"lineEndingBlank":{_t[0]==="enter"&&($r&&!xn&&!ht&&!fi&&(fi=Ye),xn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:xn=void 0}if(!ht&&_t[0]==="enter"&&_t[1].type==="listItemPrefix"||ht===-1&&_t[0]==="exit"&&(_t[1].type==="listUnordered"||_t[1].type==="listOrdered")){if($r){let Mo=Ye;for(hn=void 0;Mo--;){const Bs=oe[Mo];if(Bs[1].type==="lineEnding"||Bs[1].type==="lineEndingBlank"){if(Bs[0]==="exit")continue;hn&&(oe[hn][1].type="lineEndingBlank",In=!0),Bs[1].type="lineEnding",hn=Mo}else if(!(Bs[1].type==="linePrefix"||Bs[1].type==="blockQuotePrefix"||Bs[1].type==="blockQuotePrefixWhitespace"||Bs[1].type==="blockQuoteMarker"||Bs[1].type==="listItemIndent"))break}fi&&(!hn||fi<hn)&&($r._spread=!0),$r.end=Object.assign({},hn?oe[hn][1].start:_t[1].end),oe.splice(hn||Ye,0,["exit",$r,_t[2]]),Ye++,De++}if(_t[1].type==="listItemPrefix"){const Mo={type:"listItem",_spread:!1,start:Object.assign({},_t[1].start),end:void 0};$r=Mo,oe.splice(Ye,0,["enter",Mo,_t[2]]),Ye++,De++,fi=void 0,xn=!0}}}return oe[ge][1]._spread=In,De}function r(oe,ge){return De;function De(Ye){l.call(this,oe(Ye),Ye),ge&&ge.call(this,Ye)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(oe,ge,De){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([ge,De||void 0]),oe.position={start:ca(ge.start),end:void 0}}function c(oe){return ge;function ge(De){oe&&oe.call(this,De),u.call(this,De)}}function u(oe,ge){const De=this.stack.pop(),Ye=this.tokenStack.pop();if(Ye)Ye[0].type!==oe.type&&(ge?ge.call(this,oe,Ye[0]):(Ye[1]||RQ).call(this,oe,Ye[0]));else throw new Error("Cannot close `"+oe.type+"` ("+xf({start:oe.start,end:oe.end})+"): it’s not open");De.position.end=ca(oe.end)}function d(){return Ile(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function g(oe){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function O(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=oe}function _(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=oe}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe.replace(/(\r?\n|\r)$/g,"")}function T(oe){const ge=this.resume(),De=this.stack[this.stack.length-1];De.label=ge,De.identifier=ih(this.sliceSerialize(oe)).toLowerCase()}function k(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=oe}function A(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=oe}function R(oe){const ge=this.stack[this.stack.length-1];if(!ge.depth){const De=this.sliceSerialize(oe).length;ge.depth=De}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function $(oe){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function q(oe){const De=this.stack[this.stack.length-1].children;let Ye=De[De.length-1];(!Ye||Ye.type!=="text")&&(Ye=cn(),Ye.position={start:ca(oe.start),end:void 0},De.push(Ye)),this.stack.push(Ye)}function G(oe){const ge=this.stack.pop();ge.value+=this.sliceSerialize(oe),ge.position.end=ca(oe.end)}function U(oe){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=ge.children[ge.children.length-1];De.position.end=ca(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ge.type)&&(q.call(this,oe),G.call(this,oe))}function Q(){this.data.atHardBreak=!0}function D(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function z(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function j(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function B(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ge,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function Z(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ge,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function H(oe){const ge=this.sliceSerialize(oe),De=this.stack[this.stack.length-2];De.label=jhe(ge),De.identifier=ih(ge).toLowerCase()}function F(){const oe=this.stack[this.stack.length-1],ge=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const Ye=oe.children;De.children=Ye}else De.alt=ge}function M(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=oe}function V(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=oe}function J(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function ue(oe){const ge=this.resume(),De=this.stack[this.stack.length-1];De.label=ge,De.identifier=ih(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function he(oe){this.data.characterReferenceType=oe.type}function fe(oe){const ge=this.sliceSerialize(oe),De=this.data.characterReferenceType;let Ye;De?(Ye=iz(ge,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ye=Yw(ge);const ht=this.stack[this.stack.length-1];ht.value+=Ye}function Oe(oe){const ge=this.stack.pop();ge.position.end=ca(oe.end)}function Ce(oe){G.call(this,oe);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(oe)}function ye(oe){G.call(this,oe);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(oe)}function nt(){return{type:"blockquote",children:[]}}function Qt(){return{type:"code",lang:null,meta:null,value:""}}function Yt(){return{type:"inlineCode",value:""}}function ei(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Le(){return{type:"emphasis",children:[]}}function as(){return{type:"heading",depth:0,children:[]}}function To(){return{type:"break"}}function Ao(){return{type:"html",value:""}}function Da(){return{type:"image",title:null,url:"",alt:null}}function Br(){return{type:"link",title:null,url:"",children:[]}}function Eo(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function Mh(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function QO(){return{type:"paragraph",children:[]}}function LO(){return{type:"strong",children:[]}}function cn(){return{type:"text",value:""}}function DO(){return{type:"thematicBreak"}}}function ca(t){return{line:t.line,column:t.column,offset:t.offset}}function dz(t,e){let i=-1;for(;++i<e.length;){const n=e[i];Array.isArray(n)?dz(t,n):Zhe(t,n)}}function Zhe(t,e){let i;for(i in e)if(fz.call(e,i))switch(i){case"canContainEols":{const n=e[i];n&&t[i].push(...n);break}case"transforms":{const n=e[i];n&&t[i].push(...n);break}case"enter":case"exit":{const n=e[i];n&&Object.assign(t[i],n);break}}}function RQ(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+xf({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+xf({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+xf({start:e.start,end:e.end})+") is still open")}function qhe(t){const e=this;e.parser=i;function i(n){return Vhe(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Whe(t,e){const i={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,i),t.applyData(e,i)}function Uhe(t,e){const i={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,i),[t.applyData(e,i),{type:"text",value:`
221
- `}]}function Yhe(t,e){const i=e.value?e.value+`
222
- `:"",n={},s=e.lang?e.lang.split(/\s+/):[];s.length>0&&(n.className=["language-"+s[0]]);let r={type:"element",tagName:"code",properties:n,children:[{type:"text",value:i}]};return e.meta&&(r.data={meta:e.meta}),t.patch(e,r),r=t.applyData(e,r),r={type:"element",tagName:"pre",properties:{},children:[r]},t.patch(e,r),r}function Hhe(t,e){const i={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Fhe(t,e){const i={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Ghe(t,e){const i=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),s=Eh(n.toLowerCase()),r=t.footnoteOrder.indexOf(n);let o,l=t.footnoteCounts.get(n);l===void 0?(l=0,t.footnoteOrder.push(n),o=t.footnoteOrder.length):o=r+1,l+=1,t.footnoteCounts.set(n,l);const c={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+s,id:i+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return t.patch(e,u),t.applyData(e,u)}function Khe(t,e){const i={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Jhe(t,e){if(t.options.allowDangerousHtml){const i={type:"raw",value:e.value};return t.patch(e,i),t.applyData(e,i)}}function pz(t,e){const i=e.referenceType;let n="]";if(i==="collapsed"?n+="[]":i==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const s=t.all(e),r=s[0];r&&r.type==="text"?r.value="["+r.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=n:s.push({type:"text",value:n}),s}function eue(t,e){const i=String(e.identifier).toUpperCase(),n=t.definitionById.get(i);if(!n)return pz(t,e);const s={src:Eh(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"img",properties:s,children:[]};return t.patch(e,r),t.applyData(e,r)}function tue(t,e){const i={src:Eh(e.url)};e.alt!==null&&e.alt!==void 0&&(i.alt=e.alt),e.title!==null&&e.title!==void 0&&(i.title=e.title);const n={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,n),t.applyData(e,n)}function iue(t,e){const i={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,i);const n={type:"element",tagName:"code",properties:{},children:[i]};return t.patch(e,n),t.applyData(e,n)}function nue(t,e){const i=String(e.identifier).toUpperCase(),n=t.definitionById.get(i);if(!n)return pz(t,e);const s={href:Eh(n.url||"")};n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"a",properties:s,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function sue(t,e){const i={href:Eh(e.url)};e.title!==null&&e.title!==void 0&&(i.title=e.title);const n={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function rue(t,e,i){const n=t.all(e),s=i?oue(i):mz(e),r={},o=[];if(typeof e.checked=="boolean"){const d=n[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},n.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),r.className=["task-list-item"]}let l=-1;for(;++l<n.length;){const d=n[l];(s||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
223
- `}),d.type==="element"&&d.tagName==="p"&&!s?o.push(...d.children):o.push(d)}const c=n[n.length-1];c&&(s||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
224
- `});const u={type:"element",tagName:"li",properties:r,children:o};return t.patch(e,u),t.applyData(e,u)}function oue(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const i=t.children;let n=-1;for(;!e&&++n<i.length;)e=mz(i[n])}return e}function mz(t){const e=t.spread;return e??t.children.length>1}function aue(t,e){const i={},n=t.all(e);let s=-1;for(typeof e.start=="number"&&e.start!==1&&(i.start=e.start);++s<n.length;){const o=n[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const r={type:"element",tagName:e.ordered?"ol":"ul",properties:i,children:t.wrap(n,!0)};return t.patch(e,r),t.applyData(e,r)}function lue(t,e){const i={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function cue(t,e){const i={type:"root",children:t.wrap(t.all(e))};return t.patch(e,i),t.applyData(e,i)}function hue(t,e){const i={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function uue(t,e){const i=t.all(e),n=i.shift(),s=[];if(n){const o={type:"element",tagName:"thead",properties:{},children:t.wrap([n],!0)};t.patch(e.children[0],o),s.push(o)}if(i.length>0){const o={type:"element",tagName:"tbody",properties:{},children:t.wrap(i,!0)},l=Zw(e.children[1]),c=H6(e.children[e.children.length-1]);l&&c&&(o.position={start:l,end:c}),s.push(o)}const r={type:"element",tagName:"table",properties:{},children:t.wrap(s,!0)};return t.patch(e,r),t.applyData(e,r)}function fue(t,e,i){const n=i?i.children:void 0,r=(n?n.indexOf(e):1)===0?"th":"td",o=i&&i.type==="table"?i.align:void 0,l=o?o.length:e.children.length;let c=-1;const u=[];for(;++c<l;){const p=e.children[c],g={},O=o?o[c]:void 0;O&&(g.align=O);let _={type:"element",tagName:r,properties:g,children:[]};p&&(_.children=t.all(p),t.patch(p,_),_=t.applyData(p,_)),u.push(_)}const d={type:"element",tagName:"tr",properties:{},children:t.wrap(u,!0)};return t.patch(e,d),t.applyData(e,d)}function due(t,e){const i={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}const QQ=9,LQ=32;function pue(t){const e=String(t),i=/\r?\n|\r/g;let n=i.exec(e),s=0;const r=[];for(;n;)r.push(DQ(e.slice(s,n.index),s>0,!0),n[0]),s=n.index+n[0].length,n=i.exec(e);return r.push(DQ(e.slice(s),s>0,!1)),r.join("")}function DQ(t,e,i){let n=0,s=t.length;if(e){let r=t.codePointAt(n);for(;r===QQ||r===LQ;)n++,r=t.codePointAt(n)}if(i){let r=t.codePointAt(s-1);for(;r===QQ||r===LQ;)s--,r=t.codePointAt(s-1)}return s>n?t.slice(n,s):""}function mue(t,e){const i={type:"text",value:pue(String(e.value))};return t.patch(e,i),t.applyData(e,i)}function gue(t,e){const i={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,i),t.applyData(e,i)}const Oue={blockquote:Whe,break:Uhe,code:Yhe,delete:Hhe,emphasis:Fhe,footnoteReference:Ghe,heading:Khe,html:Jhe,imageReference:eue,image:tue,inlineCode:iue,linkReference:nue,link:sue,listItem:rue,list:aue,paragraph:lue,root:cue,strong:hue,table:uue,tableCell:due,tableRow:fue,text:mue,thematicBreak:gue,toml:Pm,yaml:Pm,definition:Pm,footnoteDefinition:Pm};function Pm(){}const gz=-1,PO=0,wf=1,nO=2,Gw=3,Kw=4,Jw=5,eC=6,Oz=7,vz=8,BQ=typeof self=="object"?self:globalThis,vue=(t,e)=>{const i=(s,r)=>(t.set(r,s),s),n=s=>{if(t.has(s))return t.get(s);const[r,o]=e[s];switch(r){case PO:case gz:return i(o,s);case wf:{const l=i([],s);for(const c of o)l.push(n(c));return l}case nO:{const l=i({},s);for(const[c,u]of o)l[n(c)]=n(u);return l}case Gw:return i(new Date(o),s);case Kw:{const{source:l,flags:c}=o;return i(new RegExp(l,c),s)}case Jw:{const l=i(new Map,s);for(const[c,u]of o)l.set(n(c),n(u));return l}case eC:{const l=i(new Set,s);for(const c of o)l.add(n(c));return l}case Oz:{const{name:l,message:c}=o;return i(new BQ[l](c),s)}case vz:return i(BigInt(o),s);case"BigInt":return i(Object(BigInt(o)),s);case"ArrayBuffer":return i(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return i(new DataView(l),o)}}return i(new BQ[r](o),s)};return n},$Q=t=>vue(new Map,t)(0),Ec="",{toString:_ue}={},{keys:yue}=Object,Yu=t=>{const e=typeof t;if(e!=="object"||!t)return[PO,e];const i=_ue.call(t).slice(8,-1);switch(i){case"Array":return[wf,Ec];case"Object":return[nO,Ec];case"Date":return[Gw,Ec];case"RegExp":return[Kw,Ec];case"Map":return[Jw,Ec];case"Set":return[eC,Ec];case"DataView":return[wf,i]}return i.includes("Array")?[wf,i]:i.includes("Error")?[Oz,i]:[nO,i]},Rm=([t,e])=>t===PO&&(e==="function"||e==="symbol"),bue=(t,e,i,n)=>{const s=(o,l)=>{const c=n.push(o)-1;return i.set(l,c),c},r=o=>{if(i.has(o))return i.get(o);let[l,c]=Yu(o);switch(l){case PO:{let d=o;switch(c){case"bigint":l=vz,d=o.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return s([gz],o)}return s([l,d],o)}case wf:{if(c){let g=o;return c==="DataView"?g=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(o)),s([c,[...g]],o)}const d=[],p=s([l,d],o);for(const g of o)d.push(r(g));return p}case nO:{if(c)switch(c){case"BigInt":return s([c,o.toString()],o);case"Boolean":case"Number":case"String":return s([c,o.valueOf()],o)}if(e&&"toJSON"in o)return r(o.toJSON());const d=[],p=s([l,d],o);for(const g of yue(o))(t||!Rm(Yu(o[g])))&&d.push([r(g),r(o[g])]);return p}case Gw:return s([l,o.toISOString()],o);case Kw:{const{source:d,flags:p}=o;return s([l,{source:d,flags:p}],o)}case Jw:{const d=[],p=s([l,d],o);for(const[g,O]of o)(t||!(Rm(Yu(g))||Rm(Yu(O))))&&d.push([r(g),r(O)]);return p}case eC:{const d=[],p=s([l,d],o);for(const g of o)(t||!Rm(Yu(g)))&&d.push(r(g));return p}}const{message:u}=o;return s([l,{name:c,message:u}],o)};return r},NQ=(t,{json:e,lossy:i}={})=>{const n=[];return bue(!(e||i),!!e,new Map,n)(t),n},sO=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?$Q(NQ(t,e)):structuredClone(t):(t,e)=>$Q(NQ(t,e));function xue(t,e){const i=[{type:"text",value:"↩"}];return e>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),i}function Sue(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function wue(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=t.options.footnoteBackContent||xue,n=t.options.footnoteBackLabel||Sue,s=t.options.footnoteLabel||"Footnotes",r=t.options.footnoteLabelTagName||"h2",o=t.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<t.footnoteOrder.length;){const u=t.footnoteById.get(t.footnoteOrder[c]);if(!u)continue;const d=t.all(u),p=String(u.identifier).toUpperCase(),g=Eh(p.toLowerCase());let O=0;const _=[],b=t.footnoteCounts.get(p);for(;b!==void 0&&++O<=b;){_.length>0&&_.push({type:"text",value:" "});let T=typeof i=="string"?i:i(c,O);typeof T=="string"&&(T={type:"text",value:T}),_.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(O>1?"-"+O:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(c,O),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const S=d[d.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const T=S.children[S.children.length-1];T&&T.type==="text"?T.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(..._)}else d.push(..._);const w={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(d,!0)};t.patch(u,w),l.push(w)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:r,properties:{...sO(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
225
- `},{type:"element",tagName:"ol",properties:{},children:t.wrap(l,!0)},{type:"text",value:`
226
- `}]}}const _z=(function(t){if(t==null)return Aue;if(typeof t=="function")return RO(t);if(typeof t=="object")return Array.isArray(t)?Cue(t):kue(t);if(typeof t=="string")return Tue(t);throw new Error("Expected function, string, or object as test")});function Cue(t){const e=[];let i=-1;for(;++i<t.length;)e[i]=_z(t[i]);return RO(n);function n(...s){let r=-1;for(;++r<e.length;)if(e[r].apply(this,s))return!0;return!1}}function kue(t){const e=t;return RO(i);function i(n){const s=n;let r;for(r in t)if(s[r]!==e[r])return!1;return!0}}function Tue(t){return RO(e);function e(i){return i&&i.type===t}}function RO(t){return e;function e(i,n,s){return!!(Eue(i)&&t.call(this,i,typeof n=="number"?n:void 0,s||void 0))}}function Aue(){return!0}function Eue(t){return t!==null&&typeof t=="object"&&"type"in t}const yz=[],Mue=!0,zQ=!1,Pue="skip";function Rue(t,e,i,n){let s;typeof e=="function"&&typeof i!="function"?(n=i,i=e):s=e;const r=_z(s),o=n?-1:1;l(t,void 0,[])();function l(c,u,d){const p=c&&typeof c=="object"?c:{};if(typeof p.type=="string"){const O=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(c.type+(O?"<"+O+">":""))+")"})}return g;function g(){let O=yz,_,b,S;if((!e||r(c,u,d[d.length-1]||void 0))&&(O=Que(i(c,d)),O[0]===zQ))return O;if("children"in c&&c.children){const w=c;if(w.children&&O[0]!==Pue)for(b=(n?w.children.length:-1)+o,S=d.concat(w);b>-1&&b<w.children.length;){const T=w.children[b];if(_=l(T,b,S)(),_[0]===zQ)return _;b=typeof _[1]=="number"?_[1]:b+o}}return O}}}function Que(t){return Array.isArray(t)?t:typeof t=="number"?[Mue,t]:t==null?yz:[t]}function bz(t,e,i,n){let s,r,o;typeof e=="function"&&typeof i!="function"?(r=void 0,o=e,s=i):(r=e,o=i,s=n),Rue(t,r,l,s);function l(c,u){const d=u[u.length-1],p=d?d.children.indexOf(c):void 0;return o(c,p,d)}}const Vx={}.hasOwnProperty,Lue={};function Due(t,e){const i=e||Lue,n=new Map,s=new Map,r=new Map,o={...Oue,...i.handlers},l={all:u,applyData:$ue,definitionById:n,footnoteById:s,footnoteCounts:r,footnoteOrder:[],handlers:o,one:c,options:i,patch:Bue,wrap:zue};return bz(t,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const p=d.type==="definition"?n:s,g=String(d.identifier).toUpperCase();p.has(g)||p.set(g,d)}}),l;function c(d,p){const g=d.type,O=l.handlers[g];if(Vx.call(l.handlers,g)&&O)return O(l,d,p);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in d){const{children:b,...S}=d,w=sO(S);return w.children=l.all(d),w}return sO(d)}return(l.options.unknownHandler||Nue)(l,d,p)}function u(d){const p=[];if("children"in d){const g=d.children;let O=-1;for(;++O<g.length;){const _=l.one(g[O],d);if(_){if(O&&g[O-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=jQ(_.value)),!Array.isArray(_)&&_.type==="element")){const b=_.children[0];b&&b.type==="text"&&(b.value=jQ(b.value))}Array.isArray(_)?p.push(..._):p.push(_)}}}return p}}function Bue(t,e){t.position&&(e.position=_le(t))}function $ue(t,e){let i=e;if(t&&t.data){const n=t.data.hName,s=t.data.hChildren,r=t.data.hProperties;if(typeof n=="string")if(i.type==="element")i.tagName=n;else{const o="children"in i?i.children:[i];i={type:"element",tagName:n,properties:{},children:o}}i.type==="element"&&r&&Object.assign(i.properties,sO(r)),"children"in i&&i.children&&s!==null&&s!==void 0&&(i.children=s)}return i}function Nue(t,e){const i=e.data||{},n="value"in e&&!(Vx.call(i,"hProperties")||Vx.call(i,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function zue(t,e){const i=[];let n=-1;for(e&&i.push({type:"text",value:`
227
- `});++n<t.length;)n&&i.push({type:"text",value:`
228
- `}),i.push(t[n]);return e&&t.length>0&&i.push({type:"text",value:`
229
- `}),i}function jQ(t){let e=0,i=t.charCodeAt(e);for(;i===9||i===32;)e++,i=t.charCodeAt(e);return t.slice(e)}function IQ(t,e){const i=Due(t,e),n=i.one(t,void 0),s=wue(i),r=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return s&&r.children.push({type:"text",value:`
230
- `},s),r}function jue(t,e){return t&&"run"in t?async function(i,n){const s=IQ(i,{file:n,...e});await t.run(s,n)}:function(i,n){return IQ(i,{file:n,...t||e})}}function VQ(t){if(t)throw t}var c1,XQ;function Iue(){if(XQ)return c1;XQ=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},r=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var d=t.call(u,"constructor"),p=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!p)return!1;var g;for(g in u);return typeof g>"u"||t.call(u,g)},o=function(u,d){i&&d.name==="__proto__"?i(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},l=function(u,d){if(d==="__proto__")if(t.call(u,d)){if(n)return n(u,d).value}else return;return u[d]};return c1=function c(){var u,d,p,g,O,_,b=arguments[0],S=1,w=arguments.length,T=!1;for(typeof b=="boolean"&&(T=b,b=arguments[1]||{},S=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});S<w;++S)if(u=arguments[S],u!=null)for(d in u)p=l(b,d),g=l(u,d),b!==g&&(T&&g&&(r(g)||(O=s(g)))?(O?(O=!1,_=p&&s(p)?p:[]):_=p&&r(p)?p:{},o(b,{name:d,newValue:c(T,_,g)})):typeof g<"u"&&o(b,{name:d,newValue:g}));return b},c1}var Vue=Iue();const h1=qx(Vue);function Xx(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Xue(){const t=[],e={run:i,use:n};return e;function i(...s){let r=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...s);function l(c,...u){const d=t[++r];let p=-1;if(c){o(c);return}for(;++p<s.length;)(u[p]===null||u[p]===void 0)&&(u[p]=s[p]);s=u,d?Zue(d,l)(...u):o(null,...u)}}function n(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return t.push(s),e}}function Zue(t,e){let i;return n;function n(...o){const l=t.length>o.length;let c;l&&o.push(s);try{c=t.apply(this,o)}catch(u){const d=u;if(l&&i)throw d;return s(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(r,s):c instanceof Error?s(c):r(c))}function s(o,...l){i||(i=!0,e(o,...l))}function r(o){s(null,o)}}const pr={basename:que,dirname:Wue,extname:Uue,join:Yue,sep:"/"};function que(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');kd(t);let i=0,n=-1,s=t.length,r;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(r){i=s+1;break}}else n<0&&(r=!0,n=s+1);return n<0?"":t.slice(i,n)}if(e===t)return"";let o=-1,l=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(r){i=s+1;break}}else o<0&&(r=!0,o=s+1),l>-1&&(t.codePointAt(s)===e.codePointAt(l--)?l<0&&(n=s):(l=-1,n=o));return i===n?n=o:n<0&&(n=t.length),t.slice(i,n)}function Wue(t){if(kd(t),t.length===0)return".";let e=-1,i=t.length,n;for(;--i;)if(t.codePointAt(i)===47){if(n){e=i;break}}else n||(n=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Uue(t){kd(t);let e=t.length,i=-1,n=0,s=-1,r=0,o;for(;e--;){const l=t.codePointAt(e);if(l===47){if(o){n=e+1;break}continue}i<0&&(o=!0,i=e+1),l===46?s<0?s=e:r!==1&&(r=1):s>-1&&(r=-1)}return s<0||i<0||r===0||r===1&&s===i-1&&s===n+1?"":t.slice(s,i)}function Yue(...t){let e=-1,i;for(;++e<t.length;)kd(t[e]),t[e]&&(i=i===void 0?t[e]:i+"/"+t[e]);return i===void 0?".":Hue(i)}function Hue(t){kd(t);const e=t.codePointAt(0)===47;let i=Fue(t,!e);return i.length===0&&!e&&(i="."),i.length>0&&t.codePointAt(t.length-1)===47&&(i+="/"),e?"/"+i:i}function Fue(t,e){let i="",n=0,s=-1,r=0,o=-1,l,c;for(;++o<=t.length;){if(o<t.length)l=t.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(s===o-1||r===1))if(s!==o-1&&r===2){if(i.length<2||n!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(c=i.lastIndexOf("/"),c!==i.length-1){c<0?(i="",n=0):(i=i.slice(0,c),n=i.length-1-i.lastIndexOf("/")),s=o,r=0;continue}}else if(i.length>0){i="",n=0,s=o,r=0;continue}}e&&(i=i.length>0?i+"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(s+1,o):i=t.slice(s+1,o),n=o-s-1;s=o,r=0}else l===46&&r>-1?r++:r=-1}return i}function kd(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Gue={cwd:Kue};function Kue(){return"/"}function Zx(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Jue(t){if(typeof t=="string")t=new URL(t);else if(!Zx(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return efe(t)}function efe(t){if(t.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=t.pathname;let i=-1;for(;++i<e.length;)if(e.codePointAt(i)===37&&e.codePointAt(i+1)===50){const n=e.codePointAt(i+2);if(n===70||n===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(e)}const u1=["history","path","basename","stem","extname","dirname"];class xz{constructor(e){let i;e?Zx(e)?i={path:e}:typeof e=="string"||tfe(e)?i={value:e}:i=e:i={},this.cwd="cwd"in i?"":Gue.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<u1.length;){const r=u1[n];r in i&&i[r]!==void 0&&i[r]!==null&&(this[r]=r==="history"?[...i[r]]:i[r])}let s;for(s in i)u1.includes(s)||(this[s]=i[s])}get basename(){return typeof this.path=="string"?pr.basename(this.path):void 0}set basename(e){d1(e,"basename"),f1(e,"basename"),this.path=pr.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?pr.dirname(this.path):void 0}set dirname(e){ZQ(this.basename,"dirname"),this.path=pr.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?pr.extname(this.path):void 0}set extname(e){if(f1(e,"extname"),ZQ(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pr.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Zx(e)&&(e=Jue(e)),d1(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?pr.basename(this.path,this.extname):void 0}set stem(e){d1(e,"stem"),f1(e,"stem"),this.path=pr.join(this.dirname||"",e+(this.extname||""))}fail(e,i,n){const s=this.message(e,i,n);throw s.fatal=!0,s}info(e,i,n){const s=this.message(e,i,n);return s.fatal=void 0,s}message(e,i,n){const s=new ln(e,i,n);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function f1(t,e){if(t&&t.includes(pr.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+pr.sep+"`")}function d1(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function ZQ(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function tfe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const ife=(function(t){const n=this.constructor.prototype,s=n[t],r=function(){return s.apply(r,arguments)};return Object.setPrototypeOf(r,n),r}),nfe={}.hasOwnProperty;class tC extends ife{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Xue()}copy(){const e=new tC;let i=-1;for(;++i<this.attachers.length;){const n=this.attachers[i];e.use(...n)}return e.data(h1(!0,{},this.namespace)),e}data(e,i){return typeof e=="string"?arguments.length===2?(g1("data",this.frozen),this.namespace[e]=i,this):nfe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(g1("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const s=i.call(e,...n);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const i=Qm(e),n=this.parser||this.Parser;return p1("parse",n),n(String(i),i)}process(e,i){const n=this;return this.freeze(),p1("process",this.parser||this.Parser),m1("process",this.compiler||this.Compiler),i?s(void 0,i):new Promise(s);function s(r,o){const l=Qm(e),c=n.parse(l);n.run(c,l,function(d,p,g){if(d||!p||!g)return u(d);const O=p,_=n.stringify(O,g);ofe(_)?g.value=_:g.result=_,u(d,g)});function u(d,p){d||!p?o(d):r?r(p):i(void 0,p)}}}processSync(e){let i=!1,n;return this.freeze(),p1("processSync",this.parser||this.Parser),m1("processSync",this.compiler||this.Compiler),this.process(e,s),WQ("processSync","process",i),n;function s(r,o){i=!0,VQ(r),n=o}}run(e,i,n){qQ(e),this.freeze();const s=this.transformers;return!n&&typeof i=="function"&&(n=i,i=void 0),n?r(void 0,n):new Promise(r);function r(o,l){const c=Qm(i);s.run(e,c,u);function u(d,p,g){const O=p||e;d?l(d):o?o(O):n(void 0,O,g)}}}runSync(e,i){let n=!1,s;return this.run(e,i,r),WQ("runSync","run",n),s;function r(o,l){VQ(o),s=l,n=!0}}stringify(e,i){this.freeze();const n=Qm(i),s=this.compiler||this.Compiler;return m1("stringify",s),qQ(e),s(e,n)}use(e,...i){const n=this.attachers,s=this.namespace;if(g1("use",this.frozen),e!=null)if(typeof e=="function")c(e,i);else if(typeof e=="object")Array.isArray(e)?l(e):o(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function r(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...p]=u;c(d,p)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(s.settings=h1(!0,s.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const p=u[d];r(p)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let p=-1,g=-1;for(;++p<n.length;)if(n[p][0]===u){g=p;break}if(g===-1)n.push([u,...d]);else if(d.length>0){let[O,..._]=d;const b=n[g][1];Xx(b)&&Xx(O)&&(O=h1(!0,b,O)),n[g]=[u,O,..._]}}}}const sfe=new tC().freeze();function p1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function m1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function g1(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function qQ(t){if(!Xx(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function WQ(t,e,i){if(!i)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Qm(t){return rfe(t)?t:new xz(t)}function rfe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function ofe(t){return typeof t=="string"||afe(t)}function afe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const lfe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",UQ=[],YQ={allowDangerousHtml:!0},cfe=/^(https?|ircs?|mailto|xmpp)$/i,hfe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Sz(t){const e=ufe(t),i=ffe(t);return dfe(e.runSync(e.parse(i),i),t)}function ufe(t){const e=t.rehypePlugins||UQ,i=t.remarkPlugins||UQ,n=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...YQ}:YQ;return sfe().use(qhe).use(i).use(jue,n).use(e)}function ffe(t){const e=t.children||"",i=new xz;return typeof e=="string"&&(i.value=e),i}function dfe(t,e){const i=e.allowedElements,n=e.allowElement,s=e.components,r=e.disallowedElements,o=e.skipHtml,l=e.unwrapDisallowed,c=e.urlTransform||pfe;for(const d of hfe)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+lfe+d.id,void 0);return bz(t,u),wle(t,{Fragment:x.Fragment,components:s,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function u(d,p,g){if(d.type==="raw"&&g&&typeof p=="number")return o?g.children.splice(p,1):g.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let O;for(O in o1)if(Object.hasOwn(o1,O)&&Object.hasOwn(d.properties,O)){const _=d.properties[O],b=o1[O];(b===null||b.includes(d.tagName))&&(d.properties[O]=c(String(_||""),O,d))}}if(d.type==="element"){let O=i?!i.includes(d.tagName):r?r.includes(d.tagName):!1;if(!O&&n&&typeof p=="number"&&(O=!n(d,p,g)),O&&g&&typeof p=="number")return l&&d.children?g.children.splice(p,1,...d.children):g.children.splice(p,1),p}}}function pfe(t){const e=t.indexOf(":"),i=t.indexOf("?"),n=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||i!==-1&&e>i||n!==-1&&e>n||cfe.test(t.slice(0,e))?t:""}function mfe({option:t,selected:e,variant:i,onSelect:n,onFocus:s,onBlur:r}){var p;const[o,l]=I.useState(!1),c=t.description.split(`
231
- `),u=c.length>1||t.description.length>120,d=o?t.description:((p=c[0])==null?void 0:p.slice(0,120))??"";return x.jsxs("button",{type:"button",onClick:n,onMouseEnter:s,onMouseLeave:r,onFocus:s,onBlur:r,className:Ne("flex items-start gap-3 border p-3 text-left transition-colors w-full",e?"border-simple-accent bg-simple-accent/10":"border-border bg-card hover:border-muted-foreground/40"),children:[x.jsx("span",{className:"mt-0.5 shrink-0",children:i==="radio"?x.jsx("span",{className:Ne("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent":"border-muted-foreground"),style:{borderRadius:"50%"},children:e&&x.jsx("span",{className:"h-2 w-2 bg-simple-accent",style:{borderRadius:"50%"}})}):x.jsx("span",{className:Ne("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent bg-simple-accent/20":"border-muted-foreground"),children:e&&x.jsx("svg",{className:"h-3 w-3 text-simple-accent",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:x.jsx("path",{d:"M2 6l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})})})}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.label}),x.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:[d,!o&&u&&"..."]}),u&&x.jsx("span",{role:"button",tabIndex:0,onClick:g=>{g.stopPropagation(),l(O=>!O)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.stopPropagation(),g.preventDefault(),l(O=>!O))},className:"text-[10px] text-simple-accent mt-1 inline-block cursor-pointer hover:underline",children:o?"Show less":"Show more"})]})]})}function gfe({markdown:t,visible:e}){return e?x.jsx("div",{className:"border border-border bg-card p-4 text-xs font-mono text-foreground/80 leading-relaxed overflow-auto max-h-64 lg:absolute lg:right-0 lg:top-0 lg:w-80 lg:translate-x-[calc(100%+0.75rem)] lg:z-10 lg:shadow-lg mt-2 lg:mt-0",children:x.jsx(Sz,{children:t})}):null}function Ofe({question:t,onSubmit:e}){const[i,n]=I.useState(null),[s,r]=I.useState(new Set),[o,l]=I.useState(""),[c,u]=I.useState(null),d=I.useRef(null);I.useEffect(()=>{const T=d.current;T&&(T.style.height="auto",T.style.height=`${T.scrollHeight}px`)},[o]),I.useEffect(()=>{n(null),r(new Set),l(""),u(null)},[t.id]);function p(T){t.multiSelect?r(k=>{const A=new Set(k);return A.has(T)?A.delete(T):A.add(T),A}):n(T)}function g(T){l(T),!t.multiSelect&&T.length>0&&n(null)}function O(T){T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),_())}function _(){if(b)if(t.multiSelect){const T=t.options.filter(k=>s.has(k.id)).map(k=>k.label);e({questionId:t.id,header:t.header,selectedOptionIds:Array.from(s),selectedLabels:T,freeText:o.trim()})}else if(i){const T=t.options.find(k=>k.id===i);e({questionId:t.id,header:t.header,selectedOptionIds:[i],selectedLabels:T?[T.label]:[],freeText:""})}else e({questionId:t.id,header:t.header,selectedOptionIds:[],selectedLabels:[],freeText:o.trim()})}const b=t.multiSelect?s.size>0||o.trim().length>0:i!==null||o.trim().length>0,S=c?t.options.find(T=>T.id===c):null,w=(S==null?void 0:S.markdown)??"";return x.jsxs("div",{className:"border border-border bg-card p-4 relative",children:[x.jsx("span",{className:"inline-block bg-simple-accent/20 border border-simple-accent/40 px-2 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent mb-2",children:t.header}),x.jsx("div",{className:"text-sm text-foreground leading-relaxed mb-4 prose prose-invert prose-sm max-w-none [&_a]:text-simple-accent [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs",children:x.jsx(Sz,{children:t.question})}),t.options.length>0&&x.jsxs("div",{className:"relative",children:[x.jsx("div",{className:"grid gap-2 mb-3",children:t.options.map(T=>{const k=t.multiSelect?s.has(T.id):i===T.id;return x.jsx(mfe,{option:T,selected:k,variant:t.multiSelect?"checkbox":"radio",onSelect:()=>p(T.id),onFocus:()=>u(T.id),onBlur:()=>u(null)},T.id)})}),x.jsx(gfe,{markdown:w,visible:!!w})]}),x.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 mb-3",children:x.jsx("textarea",{ref:d,value:o,onChange:T=>g(T.target.value),onKeyDown:O,rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground outline-none leading-relaxed"})}),x.jsx("button",{type:"button",onClick:_,disabled:!b,className:Ne("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",b?"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background":"border-border text-muted-foreground cursor-not-allowed"),children:"Submit"})]})}function vfe({answer:t}){const e=t.selectedLabels.length>0?t.selectedLabels.join(", "):t.freeText.slice(0,80)+(t.freeText.length>80?"...":"");return x.jsx(_o.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:x.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/40 text-xs text-muted-foreground",children:[x.jsx("svg",{className:"h-3.5 w-3.5 text-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:x.jsx("path",{d:"M6.5 12.5l-4-4 1.4-1.4L6.5 9.7l5.6-5.6 1.4 1.4z"})}),x.jsx("span",{className:"font-mono text-simple-accent shrink-0",children:t.header}),x.jsx("span",{className:"text-foreground/70 truncate",children:e})]})})}function _fe(){return x.jsxs("div",{className:"border border-border bg-card p-4 animate-pulse",children:[x.jsx("div",{className:"h-3 w-16 bg-muted mb-3"}),x.jsx("div",{className:"h-4 w-3/4 bg-muted mb-2"}),x.jsx("div",{className:"h-4 w-1/2 bg-muted mb-4"}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx("div",{className:"h-10 flex-1 bg-muted"}),x.jsx("div",{className:"h-10 flex-1 bg-muted"})]}),x.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[x.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:x.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),x.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Loading question..."})]})]})}function yfe({onAskMore:t,onDoneExecute:e,disabled:i}){return x.jsxs("div",{className:"sticky bottom-0 z-10 flex items-center justify-end gap-3 border-t border-border bg-background/95 backdrop-blur px-4 py-3",children:[x.jsx("button",{type:"button",onClick:t,disabled:i,className:"border border-simple-accent/50 px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent/10 disabled:opacity-50",children:"Ask me more"}),x.jsx("button",{type:"button",onClick:e,disabled:i,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background disabled:opacity-50",children:"Done, execute"})]})}function bfe({open:t,onConfirm:e,onCancel:i}){return x.jsx(SS,{children:t&&x.jsx(_o.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:i,children:x.jsxs(_o.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"mx-4 w-full max-w-sm border border-border bg-card p-6",onClick:n=>n.stopPropagation(),children:[x.jsx("p",{className:"text-sm text-foreground leading-relaxed mb-6",children:"This will end discussion and start execution. Continue?"}),x.jsxs("div",{className:"flex items-center justify-end gap-3",children:[x.jsx("button",{type:"button",onClick:i,className:"border border-border px-4 py-2 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:border-muted-foreground hover:text-foreground",children:"Cancel"}),x.jsx("button",{type:"button",onClick:e,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:"Confirm"})]})]})})})}function xfe({answerCount:t}){return x.jsxs(_o.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.25,ease:"easeOut"},className:"border border-border bg-card p-6 text-center",children:[x.jsx("div",{className:"flex justify-center mb-3",children:x.jsxs("svg",{className:"h-8 w-8 text-success",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[x.jsx("circle",{cx:"12",cy:"12",r:"10"}),x.jsx("path",{d:"M8 12l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),x.jsx("h3",{className:"text-sm font-medium text-foreground mb-1",children:"Discussion Complete"}),x.jsxs("p",{className:"text-xs text-muted-foreground mb-4",children:[t," ",t===1?"question":"questions"," answered"]}),x.jsxs("div",{className:"flex items-center justify-center gap-2",children:[x.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:x.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),x.jsx("span",{className:"text-[10px] font-mono text-muted-foreground uppercase tracking-wider",children:"Execution queued..."})]})]})}function Sfe(){const{phase:t,currentQuestion:e,answeredQuestions:i,answerCount:n,submitAnswer:s,askMore:r,doneExecute:o,receiveQuestions:l}=Ux(),{onQuestionReceivedRef:c}=Rr();I.useEffect(()=>(c.current=S=>{l(S)},()=>{c.current=null}),[l,c]);const[u,d]=I.useState(!1),p=I.useRef(null);I.useEffect(()=>{t==="active"&&p.current&&p.current.scrollIntoView({behavior:"smooth",block:"start"})},[t,e==null?void 0:e.id]);function g(){d(!0)}function O(){d(!1),o()}function _(){d(!1)}const b=t==="submitting"||t==="complete";return x.jsxs("div",{className:"flex flex-col h-full",children:[x.jsx("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:x.jsxs("span",{className:"text-xs font-mono uppercase tracking-wider text-muted-foreground",children:["Discussion (",n,"/?)"]})}),x.jsx("div",{className:"flex-1 overflow-y-auto pb-20",children:x.jsxs("div",{className:"mx-auto max-w-3xl p-4 flex flex-col gap-2",children:[i.map(S=>x.jsx(vfe,{answer:S},S.questionId)),t==="active"&&e&&x.jsx("div",{ref:p,children:x.jsx(Ofe,{question:e,onSubmit:s})}),t==="loading"&&x.jsx(_fe,{}),t==="complete"&&x.jsx(xfe,{answerCount:n})]})}),t!=="complete"&&x.jsx(yfe,{onAskMore:r,onDoneExecute:g,disabled:b}),x.jsx(bfe,{open:u,onConfirm:O,onCancel:_})]})}function HQ(){var i;const{lifecycleEvent:t,pendingQuestionCount:e}=Rr();return!t&&e===0?null:x.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 bg-muted/50 border-b border-border text-xs font-mono text-muted-foreground",children:[t&&x.jsxs("span",{children:["Phase ",t.phase_number,": ",t.phase_name," — ",(i=t.event_type)==null?void 0:i.replace(/-/g," "),t.step&&t.total_steps?` (Step ${t.step}/${t.total_steps})`:""]}),e>0&&x.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:[e," pending"]})]})}function wfe({onExecute:t}){const{phase:e,startDiscussion:i,resetDiscussion:n}=Ux(),{pendingQuestionCount:s}=Rr(),r=e!=="idle";function o(l){if(l.startsWith("/maxsim:discuss-phase")){i();return}t(l)}return r?x.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[x.jsx(HQ,{}),x.jsxs("div",{className:"px-4 pt-3 sm:px-6 flex items-center gap-2",children:[x.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-xs font-mono text-muted-foreground hover:text-foreground transition-colors",children:[x.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:x.jsx("path",{d:"M8 1L3 6l5 5",strokeLinecap:"round",strokeLinejoin:"round"})}),"Back to actions"]}),s>0&&x.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:s})]}),x.jsx("div",{className:"flex-1 min-h-0",children:x.jsx(Sfe,{})})]}):x.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[x.jsx(HQ,{}),x.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:x.jsxs("div",{className:"mx-auto max-w-3xl flex flex-col gap-4",children:[x.jsx(Wae,{}),x.jsx(Vae,{}),x.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[x.jsx(Uae,{}),x.jsx(Hae,{})]}),x.jsx(qae,{onExecute:o})]})})]})}function Cfe(){const{connected:t}=Rr(),[e,i]=I.useState(!0),[n,s]=I.useState(!1),[r,o]=I.useState(!1);I.useEffect(()=>{if(t){o(!1),i(!0);return}const c=setTimeout(()=>o(!0),3e3);return()=>clearTimeout(c)},[t]);const l=I.useCallback(async()=>{s(!0);try{const c=await fetch("/api/health",{signal:AbortSignal.timeout(5e3)});i(c.ok),c.ok&&window.location.reload()}catch{i(!1)}finally{s(!1)}},[]);return r?x.jsxs("div",{className:"shrink-0 flex items-center justify-between gap-3 border-b border-danger/30 bg-danger/5 px-4 py-2",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-danger animate-pulse"}),x.jsx("span",{className:"font-mono text-xs text-danger",children:e?"WebSocket disconnected. Reconnecting...":"Dashboard server unreachable"})]}),x.jsx("button",{type:"button",disabled:n,onClick:l,className:"shrink-0 border border-danger/40 px-3 py-1 font-mono text-[10px] uppercase tracking-widest text-danger transition-colors hover:bg-danger/10 disabled:opacity-50",children:n?"Checking...":"Retry"})]}):null}function kfe(){return x.jsxs("div",{className:"flex flex-col gap-6",children:[x.jsxs("div",{className:"flex flex-col gap-4 border-b border-border pb-6",children:[x.jsx("div",{className:"h-2 w-32 animate-pulse bg-muted"}),x.jsx("div",{className:"h-px w-full animate-pulse bg-muted"}),x.jsxs("div",{className:"flex gap-10",children:[x.jsx("div",{className:"h-8 w-16 animate-pulse bg-muted"}),x.jsx("div",{className:"h-8 w-40 animate-pulse bg-muted"}),x.jsxs("div",{className:"ml-auto flex gap-8",children:[x.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"}),x.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"})]})]})]}),x.jsxs("div",{className:"flex flex-col",children:[x.jsxs("div",{className:"flex justify-between px-4 pb-3",children:[x.jsx("div",{className:"h-2 w-12 animate-pulse bg-muted"}),x.jsx("div",{className:"h-2 w-4 animate-pulse bg-muted"})]}),Array.from({length:6}).map((t,e)=>x.jsxs("div",{className:"border-b border-border",children:[x.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[x.jsx("div",{className:"h-1.5 w-1.5 animate-pulse bg-muted"}),x.jsx("div",{className:"h-3 w-6 animate-pulse bg-muted"}),x.jsx("div",{className:"h-3 w-36 animate-pulse bg-muted"})]}),x.jsx("div",{className:"h-px w-full animate-pulse bg-muted"})]},e))]})]})}function Tfe({message:t,onRetry:e}){return x.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-4",children:[x.jsx("p",{className:"font-mono text-sm text-danger",children:t}),x.jsx("button",{type:"button",onClick:e,className:"border border-accent bg-accent/10 px-4 py-2 font-mono text-xs uppercase tracking-widest text-accent transition-colors hover:bg-accent hover:text-foreground",children:"Retry"})]})}function Afe(){const{roadmap:t,state:e,todos:i,loading:n,error:s}=So(),[r,o]=I.useState("discussion"),[l,c]=I.useState(null),[u,d]=I.useState(!1),[p,g]=I.useState(!1),{splitMode:O,toggleSplit:_}=jae(),b=I.useRef(null),S=I.useCallback((G,U)=>{o(G),G==="phase"&&U&&c(U),d(!1)},[]),w=I.useRef(null),T=I.useCallback(G=>{b.current?b.current(G+`\r
232
- `):w.current=G,g(!0)},[]);I.useEffect(()=>{const G=setInterval(()=>{w.current&&b.current&&(b.current(w.current+`\r
233
- `),w.current=null,clearInterval(G))},100);return()=>clearInterval(G)},[]);const k=I.useCallback(G=>{o("phase"),c(G)},[]),A=I.useCallback(()=>{o("overview"),c(null)},[]),R=I.useCallback(async(G,U)=>{try{const Q=await fetch("/api/roadmap",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({phaseNumber:G,checked:U})});Q.ok||console.error("[toggle-phase]",await Q.text())}catch(Q){console.error("[toggle-phase]",Q)}},[]),E=((t==null?void 0:t.phases)??[]).map(G=>({number:G.number,name:G.name,goal:G.goal??"",dependsOn:G.depends_on?[G.depends_on]:[],planCount:G.plan_count,summaryCount:G.summary_count,diskStatus:G.disk_status,roadmapComplete:G.roadmap_complete,hasContext:G.has_context,hasResearch:G.has_research})),$=(t==null?void 0:t.current_phase)??null;function N(){if(n)return x.jsx(kfe,{});if(s)return x.jsx(Tfe,{message:s,onRetry:()=>window.location.reload()});switch(r){case"overview":return x.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-6",children:[x.jsx(F9,{roadmap:t,state:e,todos:i}),x.jsx(eZ,{phases:E,currentPhase:$,onPhaseClick:k,onToggleComplete:R})]});case"phase":return l?x.jsx("div",{className:"mx-auto max-w-4xl",children:x.jsx(qte,{phaseId:l,onBack:A})}):null;case"todos":return x.jsx("div",{className:"mx-auto max-w-3xl",children:x.jsx(Wte,{})});case"blockers":return x.jsx("div",{className:"mx-auto max-w-3xl",children:x.jsx(Hte,{})});case"discussion":return x.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:x.jsx(wfe,{onExecute:T})});default:return null}}const q=I.useCallback(()=>{g(G=>!G)},[]);return x.jsxs(Fte,{mobileMenuOpen:u,onMobileMenuToggle:()=>d(G=>!G),onMobileMenuClose:()=>d(!1),sidebar:x.jsx(Tie,{activeView:r,activePhaseId:l,onNavigate:S,terminalOpen:p,onTerminalToggle:q}),children:[x.jsx(Cfe,{}),x.jsx("div",{className:p&&O?"h-1/2 min-h-0 overflow-auto p-4 sm:p-6":p?"hidden":"flex-1 overflow-y-auto p-4 sm:p-6",children:N()}),p&&x.jsxs("div",{className:`relative min-h-0 flex flex-col overflow-hidden border-t border-border ${O?"h-1/2":"flex-1"}`,children:[x.jsxs("div",{className:"flex items-center justify-between px-3 py-1 bg-card border-b border-border",children:[x.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:"Terminal"}),x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx(Iae,{splitMode:O,onToggle:_}),x.jsx("button",{type:"button",onClick:q,title:"Close terminal",className:"flex h-6 w-6 items-center justify-center text-muted-foreground hover:text-foreground transition-colors",children:x.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:x.jsx("path",{d:"M2 2l8 8M10 2L2 10",strokeLinecap:"round"})})})]})]}),x.jsx(zae,{writeInputRef:b})]})]})}function Efe(){return x.jsx(Gj,{children:x.jsx(e7,{children:x.jsx(i7,{children:x.jsx(Afe,{})})})})}const wz=document.getElementById("root");if(!wz)throw new Error("Root element not found");Yj.createRoot(wz).render(x.jsx(I.StrictMode,{children:x.jsx(Efe,{})}));