@agent-workshop/adoc-webapp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/LICENSE +5 -0
  2. package/THIRD_PARTY_NOTICES.md +49 -0
  3. package/dist/assets/app.css +406 -0
  4. package/dist/assets/app.js +201 -0
  5. package/dist/assets/chunks/abnfDiagram-YUKMZFIV-UTBMKFXS.js +1 -0
  6. package/dist/assets/chunks/architecture-WOLXFQ4H-S6WNHT5H.js +1 -0
  7. package/dist/assets/chunks/architectureDiagram-47P4ROYG-SQCOEPXG.js +36 -0
  8. package/dist/assets/chunks/blockDiagram-E7TT5TSB-F5DSMBHI.js +140 -0
  9. package/dist/assets/chunks/c4Diagram-CRA5TL53-G4W35RYC.js +38 -0
  10. package/dist/assets/chunks/chunk-2TCGAX73.js +1 -0
  11. package/dist/assets/chunks/chunk-35SWHG2Z.js +1 -0
  12. package/dist/assets/chunks/chunk-4UKVVSLZ.js +2 -0
  13. package/dist/assets/chunks/chunk-56PLA4MI.js +1 -0
  14. package/dist/assets/chunks/chunk-6QSLXF4I.js +1 -0
  15. package/dist/assets/chunks/chunk-7DQROAU7.js +1 -0
  16. package/dist/assets/chunks/chunk-7FXP6RHI.js +1 -0
  17. package/dist/assets/chunks/chunk-7ITQOSYJ.js +15 -0
  18. package/dist/assets/chunks/chunk-7W3KTJUJ.js +1 -0
  19. package/dist/assets/chunks/chunk-ABLFMIK7.js +1 -0
  20. package/dist/assets/chunks/chunk-AVITUR4K.js +1 -0
  21. package/dist/assets/chunks/chunk-AVJJGJEF.js +1 -0
  22. package/dist/assets/chunks/chunk-BYKZQKZN.js +1 -0
  23. package/dist/assets/chunks/chunk-CBAFHIQV.js +213 -0
  24. package/dist/assets/chunks/chunk-CMFTFM5L.js +1 -0
  25. package/dist/assets/chunks/chunk-E2AIA637.js +14 -0
  26. package/dist/assets/chunks/chunk-ENUKY65A.js +72 -0
  27. package/dist/assets/chunks/chunk-EPS7YYLR.js +2 -0
  28. package/dist/assets/chunks/chunk-FDHLSHAZ.js +1 -0
  29. package/dist/assets/chunks/chunk-GBOXGTKU.js +1 -0
  30. package/dist/assets/chunks/chunk-GDF64WIG.js +1 -0
  31. package/dist/assets/chunks/chunk-GTJDAHEV.js +2 -0
  32. package/dist/assets/chunks/chunk-H57PPMTP.js +1 -0
  33. package/dist/assets/chunks/chunk-HHYS5L3R.js +1 -0
  34. package/dist/assets/chunks/chunk-INV6BDXO.js +2 -0
  35. package/dist/assets/chunks/chunk-IR3NHMOO.js +1 -0
  36. package/dist/assets/chunks/chunk-KLF2A562.js +1 -0
  37. package/dist/assets/chunks/chunk-LZTAJOGZ.js +1 -0
  38. package/dist/assets/chunks/chunk-M3XBBO6R.js +135 -0
  39. package/dist/assets/chunks/chunk-NBZPV65B.js +62 -0
  40. package/dist/assets/chunks/chunk-NCTJNXDF.js +1 -0
  41. package/dist/assets/chunks/chunk-O4U2B2FP.js +339 -0
  42. package/dist/assets/chunks/chunk-OB665XPY.js +1 -0
  43. package/dist/assets/chunks/chunk-OFD4YTIR.js +10 -0
  44. package/dist/assets/chunks/chunk-PHKIAKHS.js +1 -0
  45. package/dist/assets/chunks/chunk-R4OZRASH.js +32 -0
  46. package/dist/assets/chunks/chunk-UAGOPMXU.js +1 -0
  47. package/dist/assets/chunks/chunk-UAQETDSH.js +3 -0
  48. package/dist/assets/chunks/chunk-UORYZEAD.js +1 -0
  49. package/dist/assets/chunks/chunk-W4ELJFHG.js +1 -0
  50. package/dist/assets/chunks/chunk-WBPRABWA.js +136 -0
  51. package/dist/assets/chunks/chunk-XISCFCXG.js +88 -0
  52. package/dist/assets/chunks/chunk-XLJVPE6C.js +1 -0
  53. package/dist/assets/chunks/chunk-XQHNSJKC.js +1 -0
  54. package/dist/assets/chunks/chunk-XYDA52BE.js +1 -0
  55. package/dist/assets/chunks/chunk-YAHQK6MQ.js +1 -0
  56. package/dist/assets/chunks/chunk-ZGUCZDEK.js +1 -0
  57. package/dist/assets/chunks/chunk-ZRBDUQXP.js +1 -0
  58. package/dist/assets/chunks/classDiagram-v2-K4WV4PDN-EMBTPOHC.js +217 -0
  59. package/dist/assets/chunks/cose-bilkent-JH36ORCC-CNYFETCT.js +1 -0
  60. package/dist/assets/chunks/cynefin-EF2NZ3EQ-2AP5N5QY.js +1 -0
  61. package/dist/assets/chunks/cynefinDiagram-3GCD6N5R-WVTLESK3.js +62 -0
  62. package/dist/assets/chunks/dagre-W4DXFKR2-FPRZGQVB.js +4 -0
  63. package/dist/assets/chunks/diagram-2UJZ2QOL-VPSSQLZN.js +200 -0
  64. package/dist/assets/chunks/diagram-OVF4WLC6-PZ2RN37Y.js +24 -0
  65. package/dist/assets/chunks/diagram-PFPMY2P6-5GPN6RRZ.js +30 -0
  66. package/dist/assets/chunks/diagram-UMYRVEAY-OHFOPEFR.js +24 -0
  67. package/dist/assets/chunks/diagram-YEKJPTXX-PFA7KRZC.js +41 -0
  68. package/dist/assets/chunks/diagram-ZIFT7M5P-XOPZR7XN.js +3 -0
  69. package/dist/assets/chunks/ebnfDiagram-VR2GEFS7-MAGCN3HN.js +1 -0
  70. package/dist/assets/chunks/elk-IJKZMXRS-FZ2NQWIX.js +27 -0
  71. package/dist/assets/chunks/erDiagram-O2IAPWRE-746JHX2P.js +99 -0
  72. package/dist/assets/chunks/eventmodeling-K75KTNOO-FKRVI4N2.js +1 -0
  73. package/dist/assets/chunks/flowDiagram-OXPTDLAJ-XYHRK7XD.js +1 -0
  74. package/dist/assets/chunks/ganttDiagram-R7TSEDQI-DN5XENJA.js +292 -0
  75. package/dist/assets/chunks/gitGraph-VSP46ZUC-YT36MSRW.js +1 -0
  76. package/dist/assets/chunks/gitGraphDiagram-XJZIOB7I-NXP267LJ.js +106 -0
  77. package/dist/assets/chunks/info-OHQRW6UA-BRTC44VB.js +1 -0
  78. package/dist/assets/chunks/infoDiagram-5W2HQ5XZ-RT6YEU7N.js +2 -0
  79. package/dist/assets/chunks/ishikawaDiagram-K3B6WC7H-EJP5H2KV.js +70 -0
  80. package/dist/assets/chunks/journeyDiagram-COXZFDF6-M6MBFVND.js +139 -0
  81. package/dist/assets/chunks/kanban-definition-P3RFRI5V-WBYRNWVT.js +89 -0
  82. package/dist/assets/chunks/katex-42FXWECD.js +257 -0
  83. package/dist/assets/chunks/mermaid.core-SMXJOLYJ.js +18 -0
  84. package/dist/assets/chunks/mindmap-definition-LZFPQGKD-KVJVOCR5.js +96 -0
  85. package/dist/assets/chunks/packet-JDAUHWVQ-SGFXPYMB.js +1 -0
  86. package/dist/assets/chunks/pegDiagram-BGZESJAR-ECEGDREM.js +1 -0
  87. package/dist/assets/chunks/pie-XZMESJXO-LSQBPXPC.js +1 -0
  88. package/dist/assets/chunks/pieDiagram-CAPJLFHJ-D75MPXOK.js +39 -0
  89. package/dist/assets/chunks/quadrantDiagram-GDMTTRAM-HMUXMSEH.js +7 -0
  90. package/dist/assets/chunks/radar-ABXABTNO-TPYHBLNO.js +1 -0
  91. package/dist/assets/chunks/railroad-I3PHUGI6-WWIXL3LY.js +1 -0
  92. package/dist/assets/chunks/railroad-abnf-LNEFI6M7-DHJUY4R6.js +1 -0
  93. package/dist/assets/chunks/railroad-ebnf-DWYD2UWJ-4OJ4ECXX.js +1 -0
  94. package/dist/assets/chunks/railroad-peg-JR7BVNR7-VUOBDVLQ.js +1 -0
  95. package/dist/assets/chunks/railroadDiagram-SM67HX2B-Z757I54E.js +1 -0
  96. package/dist/assets/chunks/requirementDiagram-X7JNWC4A-7BW46JLY.js +84 -0
  97. package/dist/assets/chunks/sankeyDiagram-UM26HJRW-273BIID3.js +40 -0
  98. package/dist/assets/chunks/sequenceDiagram-ZO4K6R2Y-KG23HXTI.js +169 -0
  99. package/dist/assets/chunks/sizeCapture-INFHLROL-5N3POCQZ.js +1 -0
  100. package/dist/assets/chunks/stateDiagram-v2-TBUQTH76-AIML3PSW.js +291 -0
  101. package/dist/assets/chunks/swimlanes-N4OXWK64-TBFQZWAR.js +1 -0
  102. package/dist/assets/chunks/swimlanesDiagram-K3J5GTZL-TREAP6RB.js +8 -0
  103. package/dist/assets/chunks/timeline-definition-YOQAKGHF-QHTD5EBR.js +120 -0
  104. package/dist/assets/chunks/treeView-D4JQ5SDB-JJEYBPMW.js +1 -0
  105. package/dist/assets/chunks/treemap-SAJKECNS-I3YRCM2B.js +1 -0
  106. package/dist/assets/chunks/usecaseDiagram-VIAY4XPW-GNNFV4RS.js +370 -0
  107. package/dist/assets/chunks/vennDiagram-BLWOH2XV-YE23JXYX.js +34 -0
  108. package/dist/assets/chunks/wardley-7MLQ67FV-AKOGXXNF.js +1 -0
  109. package/dist/assets/chunks/wardleyDiagram-YMQ3BMBF-D7XYLZCZ.js +78 -0
  110. package/dist/assets/chunks/xychartDiagram-TAQBALBS-AT4Y7JWY.js +7 -0
  111. package/dist/assets/fonts/D2Coding-Bold.woff2 +0 -0
  112. package/dist/assets/fonts/D2Coding-OFL.txt +97 -0
  113. package/dist/assets/fonts/D2Coding.woff2 +0 -0
  114. package/dist/assets/fonts/Pretendard-LICENSE.txt +94 -0
  115. package/dist/assets/fonts/PretendardVariable.woff2 +0 -0
  116. package/dist/assets/fonts/SymbolsNerdFont-LICENSE.txt +21 -0
  117. package/dist/assets/fonts/SymbolsNerdFontMono.woff2 +0 -0
  118. package/dist/assets/xterm.css +285 -0
  119. package/dist/index.html +14 -0
  120. package/dist/licenses/@braintree__sanitize-url@7.1.2/LICENSE +21 -0
  121. package/dist/licenses/@chevrotain__cst-dts-gen@13.2.0/LICENSE.txt +202 -0
  122. package/dist/licenses/@chevrotain__gast@13.2.0/LICENSE.txt +202 -0
  123. package/dist/licenses/@chevrotain__regexp-to-ast@13.2.0/LICENSE.txt +202 -0
  124. package/dist/licenses/@chevrotain__utils@13.2.0/LICENSE.txt +202 -0
  125. package/dist/licenses/@iconify__utils@3.1.7/license.txt +21 -0
  126. package/dist/licenses/@mermaid-js__parser@2.0.1/LICENSE +21 -0
  127. package/dist/licenses/@remix-run__route-pattern@0.22.1/LICENSE +21 -0
  128. package/dist/licenses/@upsetjs__venn.js@2.0.0/LICENSE +22 -0
  129. package/dist/licenses/@xterm__addon-fit@0.11.0/LICENSE +19 -0
  130. package/dist/licenses/@xterm__xterm@6.0.0/LICENSE +21 -0
  131. package/dist/licenses/chevrotain@13.2.0/LICENSE.txt +202 -0
  132. package/dist/licenses/cookie-es@3.1.1/LICENSE +28 -0
  133. package/dist/licenses/cose-base@1.0.3/LICENSE +21 -0
  134. package/dist/licenses/cose-base@2.2.0/LICENSE +21 -0
  135. package/dist/licenses/cytoscape-cose-bilkent@4.1.0/LICENSE +21 -0
  136. package/dist/licenses/cytoscape-fcose@2.2.0/LICENSE +19 -0
  137. package/dist/licenses/cytoscape@3.34.3/LICENSE +19 -0
  138. package/dist/licenses/cytoscape@3.34.3/license-update.mjs +32 -0
  139. package/dist/licenses/d3-array@2.12.1/LICENSE +27 -0
  140. package/dist/licenses/d3-array@3.2.4/LICENSE +13 -0
  141. package/dist/licenses/d3-axis@3.0.0/LICENSE +13 -0
  142. package/dist/licenses/d3-brush@3.0.0/LICENSE +13 -0
  143. package/dist/licenses/d3-chord@3.0.1/LICENSE +13 -0
  144. package/dist/licenses/d3-color@3.1.0/LICENSE +13 -0
  145. package/dist/licenses/d3-contour@4.0.2/LICENSE +13 -0
  146. package/dist/licenses/d3-delaunay@6.0.4/LICENSE +14 -0
  147. package/dist/licenses/d3-dispatch@3.0.1/LICENSE +13 -0
  148. package/dist/licenses/d3-drag@3.0.0/LICENSE +13 -0
  149. package/dist/licenses/d3-dsv@3.0.1/LICENSE +13 -0
  150. package/dist/licenses/d3-ease@3.0.1/LICENSE +28 -0
  151. package/dist/licenses/d3-fetch@3.0.1/LICENSE +13 -0
  152. package/dist/licenses/d3-force@3.0.0/LICENSE +13 -0
  153. package/dist/licenses/d3-format@3.1.2/LICENSE +13 -0
  154. package/dist/licenses/d3-geo@3.1.1/LICENSE +34 -0
  155. package/dist/licenses/d3-hierarchy@3.1.2/LICENSE +13 -0
  156. package/dist/licenses/d3-interpolate@3.0.1/LICENSE +13 -0
  157. package/dist/licenses/d3-path@1.0.9/LICENSE +27 -0
  158. package/dist/licenses/d3-path@3.1.0/LICENSE +13 -0
  159. package/dist/licenses/d3-polygon@3.0.1/LICENSE +13 -0
  160. package/dist/licenses/d3-quadtree@3.0.1/LICENSE +13 -0
  161. package/dist/licenses/d3-random@3.0.1/LICENSE +13 -0
  162. package/dist/licenses/d3-sankey@0.12.3/LICENSE +27 -0
  163. package/dist/licenses/d3-scale-chromatic@3.1.0/LICENSE +28 -0
  164. package/dist/licenses/d3-scale@4.0.2/LICENSE +13 -0
  165. package/dist/licenses/d3-selection@3.0.0/LICENSE +13 -0
  166. package/dist/licenses/d3-shape@1.3.7/LICENSE +27 -0
  167. package/dist/licenses/d3-shape@3.2.0/LICENSE +13 -0
  168. package/dist/licenses/d3-time-format@4.1.0/LICENSE +13 -0
  169. package/dist/licenses/d3-time@3.1.0/LICENSE +13 -0
  170. package/dist/licenses/d3-timer@3.0.1/LICENSE +13 -0
  171. package/dist/licenses/d3-transition@3.0.1/LICENSE +13 -0
  172. package/dist/licenses/d3-zoom@3.0.0/LICENSE +13 -0
  173. package/dist/licenses/d3@7.9.0/LICENSE +13 -0
  174. package/dist/licenses/dagre-d3-es@7.0.14/LICENSE.md +23 -0
  175. package/dist/licenses/dayjs@1.11.23/LICENSE +21 -0
  176. package/dist/licenses/delaunator@5.1.0/LICENSE +15 -0
  177. package/dist/licenses/dompurify@3.4.16/LICENSE +202 -0
  178. package/dist/licenses/dompurify@3.4.16/LICENSE-MPL +373 -0
  179. package/dist/licenses/elkjs@0.9.3/LICENSE.md +264 -0
  180. package/dist/licenses/es-toolkit@1.52.0/LICENSE +21 -0
  181. package/dist/licenses/es-toolkit@1.52.0/NOTICE +39 -0
  182. package/dist/licenses/internmap@1.0.1/LICENSE +13 -0
  183. package/dist/licenses/internmap@2.0.3/LICENSE +13 -0
  184. package/dist/licenses/katex@0.16.47/LICENSE +21 -0
  185. package/dist/licenses/khroma@2.1.0/license +21 -0
  186. package/dist/licenses/layout-base@1.0.2/LICENSE +21 -0
  187. package/dist/licenses/layout-base@2.0.1/LICENSE +21 -0
  188. package/dist/licenses/lodash-es@4.18.1/LICENSE +47 -0
  189. package/dist/licenses/lucide-react@1.50.0/LICENSE +43 -0
  190. package/dist/licenses/lucide-react@1.50.0/copyright.mjs +22 -0
  191. package/dist/licenses/marked@16.4.2/LICENSE.md +44 -0
  192. package/dist/licenses/mermaid@12.1.0/LICENSE +21 -0
  193. package/dist/licenses/packages.json +945 -0
  194. package/dist/licenses/pretendard@1.3.9/LICENSE.txt +94 -0
  195. package/dist/licenses/react-dom@19.3.0/LICENSE +21 -0
  196. package/dist/licenses/react-router@8.4.0/LICENSE.md +23 -0
  197. package/dist/licenses/react@19.3.0/LICENSE +21 -0
  198. package/dist/licenses/robust-predicates@3.0.3/LICENSE +24 -0
  199. package/dist/licenses/roughjs@4.6.6/LICENSE +21 -0
  200. package/dist/licenses/scheduler@0.28.0/LICENSE +21 -0
  201. package/dist/licenses/stylis@4.4.0/LICENSE +21 -0
  202. package/dist/licenses/ts-dedent@2.3.0/LICENSE +21 -0
  203. package/dist/licenses/uuid@14.0.2/LICENSE.md +9 -0
  204. package/package.json +44 -0
@@ -0,0 +1,201 @@
1
+ import{b as Ar,c as P}from"./chunks/chunk-PHKIAKHS.js";var IS=Ar(je=>{"use strict";function jh(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,i=e[r];if(0<Dc(i,t))e[r]=t,e[a]=i,a=r;else break e}}function Br(e){return e.length===0?null:e[0]}function Tc(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,i=e.length,s=i>>>1;r<s;){var o=2*(r+1)-1,l=e[o],n=o+1,u=e[n];if(0>Dc(l,a))n<i&&0>Dc(u,l)?(e[r]=u,e[n]=a,r=n):(e[r]=l,e[o]=a,r=o);else if(n<i&&0>Dc(u,a))e[r]=u,e[n]=a,r=n;else break e}}return t}function Dc(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}je.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(vS=performance,je.unstable_now=function(){return vS.now()}):(Kh=Date,SS=Kh.now(),je.unstable_now=function(){return Kh.now()-SS});var vS,Kh,SS,ui=[],zi=[],EE=1,sr=null,ia=3,Zh=!1,un=!1,cn=!1,Qh=!1,LS=typeof setTimeout=="function"?setTimeout:null,xS=typeof clearTimeout=="function"?clearTimeout:null,yS=typeof setImmediate<"u"?setImmediate:null;function Mc(e){for(var t=Br(zi);t!==null;){if(t.callback===null)Tc(zi);else if(t.startTime<=e)Tc(zi),t.sortIndex=t.expirationTime,jh(ui,t);else break;t=Br(zi)}}function Jh(e){if(cn=!1,Mc(e),!un)if(Br(ui)!==null)un=!0,Wo||(Wo=!0,$o());else{var t=Br(zi);t!==null&&em(Jh,t.startTime-e)}}var Wo=!1,dn=-1,wS=5,bS=-1;function RS(){return Qh?!0:!(je.unstable_now()-bS<wS)}function Xh(){if(Qh=!1,Wo){var e=je.unstable_now();bS=e;var t=!0;try{e:{un=!1,cn&&(cn=!1,xS(dn),dn=-1),Zh=!0;var a=ia;try{t:{for(Mc(e),sr=Br(ui);sr!==null&&!(sr.expirationTime>e&&RS());){var r=sr.callback;if(typeof r=="function"){sr.callback=null,ia=sr.priorityLevel;var i=r(sr.expirationTime<=e);if(e=je.unstable_now(),typeof i=="function"){sr.callback=i,Mc(e),t=!0;break t}sr===Br(ui)&&Tc(ui),Mc(e)}else Tc(ui);sr=Br(ui)}if(sr!==null)t=!0;else{var s=Br(zi);s!==null&&em(Jh,s.startTime-e),t=!1}}break e}finally{sr=null,ia=a,Zh=!1}t=void 0}}finally{t?$o():Wo=!1}}}var $o;typeof yS=="function"?$o=function(){yS(Xh)}:typeof MessageChannel<"u"?(Yh=new MessageChannel,CS=Yh.port2,Yh.port1.onmessage=Xh,$o=function(){CS.postMessage(null)}):$o=function(){LS(Xh,0)};var Yh,CS;function em(e,t){dn=LS(function(){e(je.unstable_now())},t)}je.unstable_IdlePriority=5;je.unstable_ImmediatePriority=1;je.unstable_LowPriority=4;je.unstable_NormalPriority=3;je.unstable_Profiling=null;je.unstable_UserBlockingPriority=2;je.unstable_cancelCallback=function(e){e.callback=null};je.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):wS=0<e?Math.floor(1e3/e):5};je.unstable_getCurrentPriorityLevel=function(){return ia};je.unstable_next=function(e){switch(ia){case 1:case 2:case 3:var t=3;break;default:t=ia}var a=ia;ia=t;try{return e()}finally{ia=a}};je.unstable_requestPaint=function(){Qh=!0};je.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=ia;ia=e;try{return t()}finally{ia=a}};je.unstable_scheduleCallback=function(e,t,a){var r=je.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=a+i,e={id:EE++,callback:t,priorityLevel:e,startTime:a,expirationTime:i,sortIndex:-1},a>r?(e.sortIndex=a,jh(zi,e),Br(ui)===null&&e===Br(zi)&&(cn?(xS(dn),dn=-1):cn=!0,em(Jh,a-r))):(e.sortIndex=i,jh(ui,e),un||Zh||(un=!0,Wo||(Wo=!0,$o()))),e};je.unstable_shouldYield=RS;je.unstable_wrapCallback=function(e){var t=ia;return function(){var a=ia;ia=t;try{return e.apply(this,arguments)}finally{ia=a}}}});var kS=Ar((GP,ES)=>{"use strict";ES.exports=IS()});var qS=Ar(fe=>{"use strict";var rm=Symbol.for("react.transitional.element"),kE=Symbol.for("react.portal"),DE=Symbol.for("react.fragment"),ME=Symbol.for("react.strict_mode"),TE=Symbol.for("react.profiler"),AE=Symbol.for("react.consumer"),BE=Symbol.for("react.context"),OE=Symbol.for("react.forward_ref"),PE=Symbol.for("react.suspense"),NE=Symbol.for("react.memo"),BS=Symbol.for("react.lazy"),HE=Symbol.for("react.activity"),zE=Symbol.for("react.view_transition"),DS=Symbol.iterator;function UE(e){return e===null||typeof e!="object"?null:(e=DS&&e[DS]||e["@@iterator"],typeof e=="function"?e:null)}var OS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},PS=Object.assign,NS={};function Ko(e,t,a){this.props=e,this.context=t,this.refs=NS,this.updater=a||OS}Ko.prototype.isReactComponent={};Ko.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Ko.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function HS(){}HS.prototype=Ko.prototype;function im(e,t,a){this.props=e,this.context=t,this.refs=NS,this.updater=a||OS}var sm=im.prototype=new HS;sm.constructor=im;PS(sm,Ko.prototype);sm.isPureReactComponent=!0;var MS=Array.isArray;function am(){}var qe={H:null,A:null,T:null,S:null},zS=Object.prototype.hasOwnProperty;function om(e,t,a){var r=a.ref;return{$$typeof:rm,type:e,key:t,ref:r!==void 0?r:null,props:a}}function FE(e,t){return om(e.type,t,e.props)}function lm(e){return typeof e=="object"&&e!==null&&e.$$typeof===rm}function qE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var TS=/\/+/g;function tm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?qE(""+e.key):t.toString(36)}function VE(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(am,am):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Go(e,t,a,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case rm:case kE:o=!0;break;case BS:return o=e._init,Go(o(e._payload),t,a,r,i)}}if(o)return i=i(e),o=r===""?"."+tm(e,0):r,MS(i)?(a="",o!=null&&(a=o.replace(TS,"$&/")+"/"),Go(i,t,a,"",function(u){return u})):i!=null&&(lm(i)&&(i=FE(i,a+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(TS,"$&/")+"/")+o)),t.push(i)),1;o=0;var l=r===""?".":r+":";if(MS(e))for(var n=0;n<e.length;n++)r=e[n],s=l+tm(r,n),o+=Go(r,t,a,s,i);else if(n=UE(e),typeof n=="function")for(e=n.call(e),n=0;!(r=e.next()).done;)r=r.value,s=l+tm(r,n++),o+=Go(r,t,a,s,i);else if(s==="object"){if(typeof e.then=="function")return Go(VE(e),t,a,r,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function Ac(e,t,a){if(e==null)return e;var r=[],i=0;return Go(e,r,"","",function(s){return t.call(a,s,i++)}),r}function $E(e){if(e._status===-1){var t=e._result,a=t();a.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r,a.status===void 0&&(a.status="fulfilled",a.value=r))},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r,a.status===void 0&&(a.status="rejected",a.reason=r))}),e._status===-1&&(e._status=0,e._result=a)}if(e._status===1)return e._result.default;throw e._result}var AS=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function US(e){var t=qe.T,a={};a.types=t!==null?t.types:null,qe.T=a;try{var r=e(),i=qe.S;i!==null&&i(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(am,AS)}catch(s){AS(s)}finally{t!==null&&a.types!==null&&(t.types=a.types),qe.T=t}}function FS(e){var t=qe.T;if(t!==null){var a=t.types;a===null?t.types=[e]:a.indexOf(e)===-1&&a.push(e)}else US(FS.bind(null,e))}var WE={map:Ac,forEach:function(e,t,a){Ac(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return Ac(e,function(){t++}),t},toArray:function(e){return Ac(e,function(t){return t})||[]},only:function(e){if(!lm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};fe.Activity=HE;fe.Children=WE;fe.Component=Ko;fe.Fragment=DE;fe.Profiler=TE;fe.PureComponent=im;fe.StrictMode=ME;fe.Suspense=PE;fe.ViewTransition=zE;fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=qe;fe.__COMPILER_RUNTIME={__proto__:null,c:function(e){return qe.H.useMemoCache(e)}};fe.addTransitionType=FS;fe.cache=function(e){return function(){return e.apply(null,arguments)}};fe.cacheSignal=function(){return null};fe.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=PS({},e.props),i=e.key;if(t!=null)for(s in t.key!==void 0&&(i=""+t.key),t)!zS.call(t,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&t.ref===void 0||(r[s]=t[s]);var s=arguments.length-2;if(s===1)r.children=a;else if(1<s){for(var o=Array(s),l=0;l<s;l++)o[l]=arguments[l+2];r.children=o}return om(e.type,i,r)};fe.createContext=function(e){return e={$$typeof:BE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:AE,_context:e},e};fe.createElement=function(e,t,a){var r,i={},s=null;if(t!=null)for(r in t.key!==void 0&&(s=""+t.key),t)zS.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=a;else if(1<o){for(var l=Array(o),n=0;n<o;n++)l[n]=arguments[n+2];i.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return om(e,s,i)};fe.createRef=function(){return{current:null}};fe.forwardRef=function(e){return{$$typeof:OE,render:e}};fe.isValidElement=lm;fe.lazy=function(e){return{$$typeof:BS,_payload:{_status:-1,_result:e},_init:$E}};fe.memo=function(e,t){return{$$typeof:NE,type:e,compare:t===void 0?null:t}};fe.startTransition=US;fe.unstable_useCacheRefresh=function(){return qe.H.useCacheRefresh()};fe.use=function(e){return qe.H.use(e)};fe.useActionState=function(e,t,a){return qe.H.useActionState(e,t,a)};fe.useCallback=function(e,t){return qe.H.useCallback(e,t)};fe.useContext=function(e){return qe.H.useContext(e)};fe.useDebugValue=function(){};fe.useDeferredValue=function(e,t){return qe.H.useDeferredValue(e,t)};fe.useEffect=function(e,t){return qe.H.useEffect(e,t)};fe.useEffectEvent=function(e){return qe.H.useEffectEvent(e)};fe.useId=function(){return qe.H.useId()};fe.useImperativeHandle=function(e,t,a){return qe.H.useImperativeHandle(e,t,a)};fe.useInsertionEffect=function(e,t){return qe.H.useInsertionEffect(e,t)};fe.useLayoutEffect=function(e,t){return qe.H.useLayoutEffect(e,t)};fe.useMemo=function(e,t){return qe.H.useMemo(e,t)};fe.useOptimistic=function(e,t){return qe.H.useOptimistic(e,t)};fe.useReducer=function(e,t,a){return qe.H.useReducer(e,t,a)};fe.useRef=function(e){return qe.H.useRef(e)};fe.useState=function(e){return qe.H.useState(e)};fe.useSyncExternalStore=function(e,t,a){return qe.H.useSyncExternalStore(e,t,a)};fe.useTransition=function(){return qe.H.useTransition()};fe.version="19.3.0"});var ye=Ar((XP,VS)=>{"use strict";VS.exports=qS()});var GS=Ar(sa=>{"use strict";var GE=ye();function WS(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Ui(){}var da={d:{f:Ui,r:function(){throw Error(WS(522))},D:Ui,C:Ui,L:Ui,m:Ui,X:Ui,S:Ui,M:Ui},p:0,findDOMNode:null},KE=Symbol.for("react.portal"),XE=Symbol.for("react.recoverable"),$S=Symbol.for("react.optimistic_key");function YE(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:KE,key:r==null?null:r===$S?$S:""+r,children:e,containerInfo:t,implementation:a}}var fn=GE.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Bc(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}sa.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=da;sa.browser=function(e){return{$$typeof:XE,_reason:e}};sa.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(WS(299));return YE(e,t,null,a)};sa.flushSync=function(e){var t=fn.T,a=da.p;try{if(fn.T=null,da.p=2,e)return e()}finally{fn.T=t,da.p=a,da.d.f()}};sa.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,da.d.C(e,t))};sa.prefetchDNS=function(e){typeof e=="string"&&da.d.D(e)};sa.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,r=Bc(a,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,s=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?da.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:s}):a==="script"&&da.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:s,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};sa.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=Bc(t.as,t.crossOrigin);da.d.M(e,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}}else t==null&&da.d.M(e)};sa.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,r=Bc(a,t.crossOrigin);da.d.L(e,a,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};sa.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=Bc(t.as,t.crossOrigin);da.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}else da.d.m(e)};sa.requestFormReset=function(e){da.d.r(e)};sa.unstable_batchedUpdates=function(e,t){return e(t)};sa.useFormState=function(e,t,a){return fn.H.useFormState(e,t,a)};sa.useFormStatus=function(){return fn.H.useHostTransitionStatus()};sa.version="19.3.0"});var YS=Ar((jP,XS)=>{"use strict";function KS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(KS)}catch(e){console.error(e)}}KS(),XS.exports=GS()});var OL=Ar(gf=>{"use strict";var Rt=kS(),B0=ye(),jE=YS();function D(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function O0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Jn(e){for(var t=e,a=t;a&&!a.alternate;)t=a,(t.flags&4098)!==0&&(e=t.return),a=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function P0(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function N0(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function jS(e){if(Jn(e)!==e)throw Error(D(188))}function ZE(e){var t=e.alternate;if(!t){if(t=Jn(e),t===null)throw Error(D(188));return t!==e?null:e}for(var a=e,r=t;;){var i=a.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){a=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===a)return jS(i),e;if(s===r)return jS(i),t;s=s.sibling}throw Error(D(188))}if(a.return!==r.return)a=i,r=s;else{for(var o=!1,l=i.child;l;){if(l===a){o=!0,a=i,r=s;break}if(l===r){o=!0,r=i,a=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===a){o=!0,a=s,r=i;break}if(l===r){o=!0,r=s,a=i;break}l=l.sibling}if(!o)throw Error(D(189))}}if(a.alternate!==r)throw Error(D(190))}if(a.tag!==3)throw Error(D(188));return a.stateNode.current===a?e:t}function H0(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=H0(e),t!==null)return t;e=e.sibling}return null}function Da(e,t,a,r,i,s){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&a(e,r,i,s)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&Da(e.child,t,a,r,i,s))return!0;e=e.sibling}return!1}function fo(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function ZS(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function z0(e){var t=[null,null],a=fo(e);return a===null||U0(t,e,a.child,{foundSelf:!1}),t}function U0(e,t,a,r){for(;a!==null;){if(a===t)r.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(r.foundSelf)return e[1]=a,!0;e[0]=a}else if((a.tag!==22||a.memoizedState===null)&&U0(e,t,a.child,r))return!0;a=a.sibling}return!1}function bt(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(D(559))}}var el=null,zm=null;function QE(e,t,a){return e===a?!0:e===t?(el=e,!0):!1}function JE(e,t,a){return e===a?(zm=e,!1):e===t?(zm!==null&&(el=e),!0):!1}function QS(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function Um(e,t,a){for(var r=0,i=e;i;i=a(i))r++;i=0;for(var s=t;s;s=a(s))i++;for(;0<r-i;)e=a(e),r--;for(;0<i-r;)t=a(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=a(e),t=a(t)}return null}var Fe=Object.assign,ek=Symbol.for("react.element"),Oc=Symbol.for("react.transitional.element"),Sn=Symbol.for("react.portal"),tl=Symbol.for("react.fragment"),F0=Symbol.for("react.strict_mode"),Fm=Symbol.for("react.profiler"),q0=Symbol.for("react.consumer"),Ur=Symbol.for("react.context"),jp=Symbol.for("react.forward_ref"),qm=Symbol.for("react.suspense"),Vm=Symbol.for("react.suspense_list"),Zp=Symbol.for("react.memo"),$i=Symbol.for("react.lazy"),$m=Symbol.for("react.activity"),tk=Symbol.for("react.legacy_hidden"),ak=Symbol.for("react.memo_cache_sentinel"),Wm=Symbol.for("react.view_transition"),rk=Symbol.for("react.recoverable"),JS=Symbol.iterator;function hn(e){return e===null||typeof e!="object"?null:(e=JS&&e[JS]||e["@@iterator"],typeof e=="function"?e:null)}var ik=Symbol.for("react.client.reference");function Gm(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ik?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case tl:return"Fragment";case Fm:return"Profiler";case F0:return"StrictMode";case qm:return"Suspense";case Vm:return"SuspenseList";case $m:return"Activity";case Wm:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case Sn:return"Portal";case Ur:return e.displayName||"Context";case q0:return(e._context.displayName||"Context")+".Consumer";case jp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Zp:return t=e.displayName||null,t!==null?t:Gm(e.type)||"Memo";case $i:t=e._payload,e=e._init;try{return Gm(e(t))}catch{}}return null}var yn=Array.isArray,ce=B0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Te=jE.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Qs={pending:!1,data:null,method:null,action:null},Km=[],al=-1;function Kr(e){return{current:e}}function jt(e){0>al||(e.current=Km[al],Km[al]=null,al--)}function We(e,t){al++,Km[al]=e.current,e.current=t}var $r=Kr(null),Nn=Kr(null),Ji=Kr(null),Cd=Kr(null);function Ld(e,t){switch(We(Ji,t),We(Nn,e),We($r,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?h0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=h0(t),e=cL(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}jt($r),We($r,e)}function Ll(){jt($r),jt(Nn),jt(Ji)}function Xm(e){var t=e.memoizedState;t!==null&&(Tl._currentValue=t.memoizedState,We(Cd,e)),t=$r.current;var a=cL(t,e.type);t!==a&&(We(Nn,e),We($r,a))}function xd(e){Nn.current===e&&(jt($r),jt(Nn)),Cd.current===e&&(jt(Cd),Tl._currentValue=Qs)}var nm,ey;function qi(e){if(nm===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);nm=t&&t[1]||"",ey=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+nm+e+ey}var um=!1;function cm(e,t){if(!e||um)return"";um=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(m){var f=m}Reflect.construct(e,[],d)}else{try{d.call()}catch(m){f=m}d=!1;try{var h=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),d=!0,new e}finally{d&&(h!==void 0?Object.defineProperty(e.prototype,"props",h):delete e.prototype.props)}}}else{try{throw Error()}catch(m){f=m}(d=e())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(m){if(m&&f&&typeof m.stack=="string")return[m.stack,f.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=r.DetermineComponentFrameRoot(),o=s[0],l=s[1];if(o&&l){var n=o.split(`
4
+ `),u=l.split(`
5
+ `);for(i=r=0;r<n.length&&!n[r].includes("DetermineComponentFrameRoot");)r++;for(;i<u.length&&!u[i].includes("DetermineComponentFrameRoot");)i++;if(r===n.length||i===u.length)for(r=n.length-1,i=u.length-1;1<=r&&0<=i&&n[r]!==u[i];)i--;for(;1<=r&&0<=i;r--,i--)if(n[r]!==u[i]){if(r!==1||i!==1)do if(r--,i--,0>i||n[r]!==u[i]){var c=`
6
+ `+n[r].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=r&&0<=i);break}}}finally{um=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?qi(a):""}function sk(e,t){switch(e.tag){case 26:case 27:case 5:return qi(e.type);case 16:return qi("Lazy");case 13:return e.child!==t&&t!==null?qi("Suspense Fallback"):qi("Suspense");case 19:return qi("SuspenseList");case 0:case 15:return cm(e.type,!1);case 11:return cm(e.type.render,!1);case 1:return cm(e.type,!0);case 31:return qi("Activity");case 30:return qi("ViewTransition");default:return""}}function ty(e){try{var t="",a=null;do t+=sk(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
7
+ Error generating stack: `+r.message+`
8
+ `+r.stack}}var Ym=Object.prototype.hasOwnProperty,Qp=Rt.unstable_scheduleCallback,dm=Rt.unstable_cancelCallback,ok=Rt.unstable_shouldYield,lk=Rt.unstable_requestPaint,Ga=Rt.unstable_now,nk=Rt.unstable_getCurrentPriorityLevel,V0=Rt.unstable_ImmediatePriority,$0=Rt.unstable_UserBlockingPriority,wd=Rt.unstable_NormalPriority,uk=Rt.unstable_LowPriority,W0=Rt.unstable_IdlePriority,ck=Rt.log,dk=Rt.unstable_setDisableYieldValue,eu=null,Ka=null;function Ki(e){if(typeof ck=="function"&&dk(e),Ka&&typeof Ka.setStrictMode=="function")try{Ka.setStrictMode(eu,e)}catch{}}var Xa=Math.clz32?Math.clz32:mk,fk=Math.log,hk=Math.LN2;function mk(e){return e>>>=0,e===0?32:31-(fk(e)/hk|0)|0}var Pc=256,Nc=262144,Hc=4194304;function Ks(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function jd(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var i=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~s,r!==0?i=Ks(r):(o&=l,o!==0?i=Ks(o):a||(a=l&~e,a!==0&&(i=Ks(a))))):(l=r&~s,l!==0?i=Ks(l):o!==0?i=Ks(o):a||(a=r&~e,a!==0&&(i=Ks(a)))),i===0?0:t!==0&&t!==i&&(t&s)===0&&(s=i&-i,a=t&-t,s>=a||s===32&&(a&4194048)!==0)?t:i}function tu(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function G0(e,t){(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var r=31-Xa(a),i=1<<r;t|=e[r],a&=~i}return t}function pk(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 K0(){var e=Hc;return Hc<<=1,(Hc&62914560)===0&&(Hc=4194304),e}function fm(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function au(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gk(e,t,a,r,i,s){var o=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,n=e.expirationTimes,u=e.hiddenUpdates;for(a=o&~a;0<a;){var c=31-Xa(a),d=1<<c;l[c]=0,n[c]=-1;var f=u[c];if(f!==null)for(u[c]=null,c=0;c<f.length;c++){var h=f[c];h!==null&&(h.lane&=-536870913)}a&=~d}r!==0&&X0(e,r,0),s!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=s&~(o&~t))}function X0(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Xa(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function Y0(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Xa(a),i=1<<r;i&t|e[r]&t&&(e[r]|=t),a&=~i}}function j0(e,t){var a=t&-t;return a=(a&42)!==0?1:Jp(a),(a&(e.suspendedLanes|t))!==0?0:a}function Jp(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function eg(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Z0(){var e=Te.p;return e!==0?e:(e=window.event,e===void 0?32:TL(e.type))}function ay(e,t){var a=Te.p;try{return Te.p=e,t()}finally{Te.p=a}}var Li=Math.random().toString(36).slice(2),Xt="__reactFiber$"+Li,Ma="__reactProps$"+Li,Ol="__reactContainer$"+Li,ry="__reactEvents$"+Li,_k="__reactListeners$"+Li,vk="__reactHandles$"+Li,iy="__reactResources$"+Li,ru="__reactMarker$"+Li,bd="__reactLoad$"+Li;function Zd(e){delete e[Xt],delete e[Ma],delete e[_k],delete e[vk]}function js(e){var t;if(t=e[Xt])return t;for(var a=e.parentNode;a;){if(t=a[Ol]||a[Xt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=C0(e);e!==null;){if(a=e[Xt])return a;e=C0(e)}return t}e=a,a=e.parentNode}return null}function Pl(e){if(e=e[Xt]||e[Ol]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Cn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(D(33))}function fl(e){var t=e[iy];return t||(t=e[iy]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pt(e){e[ru]=!0}function Q0(e){e[bd]=void 0}var J0=new Set,eC={};function ho(e,t){xl(e,t),xl(e+"Capture",t)}function xl(e,t){for(eC[e]=t,e=0;e<t.length;e++)J0.add(t[e])}var Sk=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]*$"),sy={},oy={};function yk(e){return Ym.call(oy,e)?!0:Ym.call(sy,e)?!1:Sk.test(e)?oy[e]=!0:(sy[e]=!0,!1)}var Ee=!1;function ly(){var e=Ee;return Ee=!1,e}function ad(e,t,a){if(yk(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,a)}}function zc(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,a)}}function ci(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,r)}}function qa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ck(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){a=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(o){a=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function jm(e){if(!e._valueTracker){var t=tC(e)?"checked":"value";e._valueTracker=Ck(e,t,""+e[t])}}function aC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=tC(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}var Lk=/[\n"\\]/g;function cr(e){return e.replace(Lk,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Zm(e,t,a,r,i,s,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+qa(t)):e.value!==""+qa(t)&&(e.value=""+qa(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?o==="number"&&e.value==t?hm(e,qa(e.value)):hm(e,qa(t)):a!=null?hm(e,qa(a)):r!=null&&e.removeAttribute("value"),i==null&&s!=null&&(e.defaultChecked=!!s),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+qa(l):e.removeAttribute("name")}function rC(e,t,a,r,i,s,o,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||a!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){jm(e);return}a=a!=null?""+qa(a):"",t=t!=null?""+qa(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),jm(e)}function hm(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function hl(e,t,a,r){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&r&&(e[a].defaultSelected=!0)}else{for(a=""+qa(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function iC(e,t,a){if(t!=null&&(t=""+qa(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+qa(a):""}function sC(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(D(92));if(yn(r)){if(1<r.length)throw Error(D(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=qa(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),jm(e)}function wl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var xk=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 ny(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||xk.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function oC(e,t,a){if(t!=null&&typeof t!="object")throw Error(D(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="",Ee=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&a[i]!==r&&(ny(e,i,r),Ee=!0)}else for(var s in t)t.hasOwnProperty(s)&&ny(e,s,t[s])}function tg(e){if(e.indexOf("-")===-1)return!1;switch(e){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 wk=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"],["maskType","mask-type"],["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"]]),bk=/^[\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 rd(e){return bk.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Fr(){}var Qm=null;function ag(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rl=null,ml=null;function uy(e){var t=Pl(e);if(t&&(e=t.stateNode)){var a=e[Ma]||null;e:switch(e=t.stateNode,t.type){case"input":if(Zm(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+cr(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var i=r[Ma]||null;if(!i)throw Error(D(90));Zm(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&aC(r)}break e;case"textarea":iC(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&hl(e,!!a.multiple,t,!1)}}}var mm=!1;function lC(e,t,a){if(mm)return e(t,a);mm=!0;try{var r=e(t);return r}finally{if(mm=!1,(rl!==null||ml!==null)&&(ff(),rl&&(t=rl,e=ml,ml=rl=null,uy(t),e)))for(t=0;t<e.length;t++)uy(e[t])}}function Hn(e,t){var a=e.stateNode;if(a===null)return null;var r=a[Ma]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(D(231,t,typeof a));return a}var gi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jm=!1;if(gi)try{Xo={},Object.defineProperty(Xo,"passive",{get:function(){Jm=!0}}),window.addEventListener("test",Xo,Xo),window.removeEventListener("test",Xo,Xo)}catch{Jm=!1}var Xo,Xi=null,rg=null,id=null;function nC(){if(id)return id;var e,t=rg,a=t.length,r,i="value"in Xi?Xi.value:Xi.textContent,s=i.length;for(e=0;e<a&&t[e]===i[e];e++);var o=a-e;for(r=1;r<=o&&t[a-r]===i[s-r];r++);return id=i.slice(e,1<r?1-r:void 0)}function sd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Uc(){return!0}function cy(){return!1}function pa(e){function t(a,r,i,s,o){this._reactName=a,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Uc:cy,this.isPropagationStopped=cy,this}return Fe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Uc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Uc)},persist:function(){},isPersistent:Uc}),t}var ms={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qd=pa(ms),iu=Fe({},ms,{view:0,detail:0}),Rk=pa(iu),pm,gm,mn,Jd=Fe({},iu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ig,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==mn&&(mn&&e.type==="mousemove"?(pm=e.screenX-mn.screenX,gm=e.screenY-mn.screenY):gm=pm=0,mn=e),pm)},movementY:function(e){return"movementY"in e?e.movementY:gm}}),dy=pa(Jd),Ik=Fe({},Jd,{dataTransfer:0}),Ek=pa(Ik),kk=Fe({},iu,{relatedTarget:0}),_m=pa(kk),Dk=Fe({},ms,{animationName:0,elapsedTime:0,pseudoElement:0}),Mk=pa(Dk),Tk=Fe({},ms,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ak=pa(Tk),Bk=Fe({},ms,{data:0}),fy=pa(Bk),Ok={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pk={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"},Nk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hk(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nk[e])?!!t[e]:!1}function ig(){return Hk}var zk=Fe({},iu,{key:function(e){if(e.key){var t=Ok[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=sd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ig,charCode:function(e){return e.type==="keypress"?sd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?sd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Uk=pa(zk),Fk=Fe({},Jd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hy=pa(Fk),qk=Fe({},ms,{submitter:0}),Vk=pa(qk),$k=Fe({},iu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ig}),Wk=pa($k),Gk=Fe({},ms,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kk=pa(Gk),Xk=Fe({},Jd,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Yk=pa(Xk),jk=Fe({},ms,{newState:0,oldState:0,source:0}),Zk=pa(jk),Qk=[9,13,27,32],sg=gi&&"CompositionEvent"in window,wn=null;gi&&"documentMode"in document&&(wn=document.documentMode);var Jk=gi&&"TextEvent"in window&&!wn,uC=gi&&(!sg||wn&&8<wn&&11>=wn),my=" ",py=!1;function cC(e,t){switch(e){case"keyup":return Qk.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var il=!1;function e2(e,t){switch(e){case"compositionend":return dC(t);case"keypress":return t.which!==32?null:(py=!0,my);case"textInput":return e=t.data,e===my&&py?null:e;default:return null}}function t2(e,t){if(il)return e==="compositionend"||!sg&&cC(e,t)?(e=nC(),id=rg=Xi=null,il=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return uC&&t.locale!=="ko"?null:t.data;default:return null}}var a2={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 gy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!a2[e.type]:t==="textarea"}function fC(e,t,a,r){rl?ml?ml.push(r):ml=[r]:rl=r,t=Kd(t,"onChange"),0<t.length&&(a=new Qd("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var bn=null,zn=null;function r2(e){lL(e,0)}function ef(e){var t=Cn(e);if(aC(t))return e}function _y(e,t){if(e==="change")return t}var hC=!1;gi&&(gi?(qc="oninput"in document,qc||(vm=document.createElement("div"),vm.setAttribute("oninput","return;"),qc=typeof vm.oninput=="function"),Fc=qc):Fc=!1,hC=Fc&&(!document.documentMode||9<document.documentMode));var Fc,qc,vm;function vy(){bn&&(bn.detachEvent("onpropertychange",mC),zn=bn=null)}function mC(e){if(e.propertyName==="value"&&ef(zn)){var t=[];fC(t,zn,e,ag(e)),lC(r2,t)}}function i2(e,t,a){e==="focusin"?(vy(),bn=t,zn=a,bn.attachEvent("onpropertychange",mC)):e==="focusout"&&vy()}function s2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ef(zn)}function o2(e,t){if(e==="click")return ef(t)}function l2(e,t){if(e==="input"||e==="change")return ef(t)}function n2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ja=typeof Object.is=="function"?Object.is:n2;function Un(e,t){if(ja(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var i=a[r];if(!Ym.call(t,i)||!ja(e[i],t[i]))return!1}return!0}function ep(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Sy(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yy(e,t){var a=Sy(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Sy(a)}}function pC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gC(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ep(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ep(e.document)}return t}function og(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var u2=gi&&"documentMode"in document&&11>=document.documentMode,sl=null,tp=null,Rn=null,ap=!1;function Cy(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ap||sl==null||sl!==ep(r)||(r=sl,"selectionStart"in r&&og(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Rn&&Un(Rn,r)||(Rn=r,r=Kd(tp,"onSelect"),0<r.length&&(t=new Qd("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=sl)))}function Ws(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var ol={animationend:Ws("Animation","AnimationEnd"),animationiteration:Ws("Animation","AnimationIteration"),animationstart:Ws("Animation","AnimationStart"),transitionrun:Ws("Transition","TransitionRun"),transitionstart:Ws("Transition","TransitionStart"),transitioncancel:Ws("Transition","TransitionCancel"),transitionend:Ws("Transition","TransitionEnd")},Sm={},_C={};gi&&(_C=document.createElement("div").style,"AnimationEvent"in window||(delete ol.animationend.animation,delete ol.animationiteration.animation,delete ol.animationstart.animation),"TransitionEvent"in window||delete ol.transitionend.transition);function mo(e){if(Sm[e])return Sm[e];if(!ol[e])return e;var t=ol[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in _C)return Sm[e]=t[a];return e}var vC=mo("animationend"),SC=mo("animationiteration"),yC=mo("animationstart"),c2=mo("transitionrun"),d2=mo("transitionstart"),f2=mo("transitioncancel"),CC=mo("transitionend"),LC=new Map,rp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");rp.push("scrollEnd");function kr(e,t){LC.set(e,t),ho(t,[e])}var h2=0;function _i(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Er.identifierPrefix;var a=h2++;return e="_"+e+"t_"+a.toString(32)+"_",t.autoName=e}function Ly(e){if(e==null||typeof e=="string")return e;var t=null,a=Cl;if(a!==null)for(var r=0;r<a.length;r++){var i=e[a[r]];if(i!=null){if(i==="none")return"none";t=t==null?i:t+(" "+i)}}return t??e.default}function xi(e,t){return e=Ly(e),t=Ly(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Rd=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},lr=[],ll=0,lg=0;function tf(){for(var e=ll,t=lg=ll=0;t<e;){var a=lr[t];lr[t++]=null;var r=lr[t];lr[t++]=null;var i=lr[t];lr[t++]=null;var s=lr[t];if(lr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}s!==0&&xC(a,i,s)}}function af(e,t,a,r){lr[ll++]=e,lr[ll++]=t,lr[ll++]=a,lr[ll++]=r,lg|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ng(e,t,a,r){return af(e,t,a,r),Id(e)}function po(e,t){return af(e,null,null,t),Id(e)}function xC(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var i=!1,s=e.return;s!==null;)s.childLanes|=a,r=s.alternate,r!==null&&(r.childLanes|=a),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(i=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,i&&t!==null&&(i=31-Xa(a),e=s.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=a|536870912),s):null}function Id(e){if(50<Pn)throw Pn=0,pd=null,Error(D(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var nl={};function m2(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ea(e,t,a,r){return new m2(e,t,a,r)}function ug(e){return e=e.prototype,!(!e||!e.isReactComponent)}function mi(e,t){var a=e.alternate;return a===null?(a=Ea(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&1206910976,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function wC(e,t){e.flags&=1206910978;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function od(e,t,a,r,i,s){var o=0;if(r=e,typeof r=="function")ug(r)&&(o=1);else if(typeof r=="string")o=UD(e,a,$r.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(r){case $m:return e=Ea(31,a,t,i),e.elementType=$m,e.lanes=s,e;case tl:return Js(a.children,i,s,t);case F0:o=8,i|=24;break;case Fm:return e=Ea(12,a,t,i|2),e.elementType=Fm,e.lanes=s,e;case qm:return e=Ea(13,a,t,i),e.elementType=qm,e.lanes=s,e;case Vm:return e=Ea(19,a,t,i),e.elementType=Vm,e.lanes=s,e;case tk:case Wm:return e=i|32,e=Ea(30,a,t,e),e.elementType=Wm,e.lanes=s,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case Ur:o=10;break e;case q0:o=9;break e;case jp:o=11;break e;case Zp:o=14;break e;case $i:o=16,r=null;break e}o=29,a=Error(D(130,e===null?"null":typeof e,"")),r=null}return t=Ea(o,a,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Js(e,t,a,r){return e=Ea(7,e,r,t),e.lanes=a,e}function ym(e,t,a){return e=Ea(6,e,null,t),e.lanes=a,e}function bC(e){var t=Ea(18,null,null,0);return t.stateNode=e,t}function Cm(e,t,a){return t=Ea(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var xy=new WeakMap;function dr(e,t){if(typeof e=="object"&&e!==null){var a=xy.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ty(t)},xy.set(e,t),t)}return{value:e,source:t,stack:ty(t)}}var ul=[],cl=0,Ed=null,Fn=0,nr=[],ur=0,us=null,qr=1,Vr="";function fi(e,t){ul[cl++]=Fn,ul[cl++]=Ed,Ed=e,Fn=t}function RC(e,t,a){nr[ur++]=qr,nr[ur++]=Vr,nr[ur++]=us,us=e;var r=qr;e=Vr;var i=32-Xa(r)-1;r&=~(1<<i),a+=1;var s=32-Xa(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,qr=1<<32-Xa(t)+i|a<<i|r,Vr=s+e}else qr=1<<s|a<<i|r,Vr=e}function rf(e){e.return!==null&&(fi(e,1),RC(e,1,0))}function cg(e){for(;e===Ed;)Ed=ul[--cl],ul[cl]=null,Fn=ul[--cl],ul[cl]=null;for(;e===us;)us=nr[--ur],nr[ur]=null,Vr=nr[--ur],nr[ur]=null,qr=nr[--ur],nr[ur]=null}function IC(e,t){nr[ur++]=qr,nr[ur++]=Vr,nr[ur++]=us,qr=t.id,Vr=t.overflow,us=e}var Nt=null,$e=null,ge=!1,es=null,fr=!1,ip=Error(D(519));function cs(e){var t=Error(D(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qn(dr(t,e)),ip}function wy(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[Xt]=e,t[Ma]=r,a){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(a=0;a<Gn.length;a++)ve(Gn[a],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),rC(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),sC(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||uL(t.textContent,a)?(r.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),r.onScroll!=null&&ve("scroll",t),r.onScrollEnd!=null&&ve("scrollend",t),r.onClick!=null&&(t.onclick=Fr),t=!0):t=!1,t||cs(e,!0)}function kd(e){for(Nt=e.return;Nt;)switch(Nt.tag){case 5:case 31:case 13:fr=!1;return;case 27:case 3:fr=!0;return;default:Nt=Nt.return}}function Yo(e){if(e!==Nt)return!1;if(!ge)return kd(e),ge=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||qp(e.type,e.memoizedProps)),a=!a),a&&$e&&cs(e),kd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(317));$e=y0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(317));$e=y0(e)}else t===27?(t=$e,ps(e.type)?(e=Gp,Gp=null,$e=e):$e=t):$e=Nt?hr(e.stateNode.nextSibling):null;return!0}function ro(){$e=Nt=null,ge=!1}function Lm(){var e=es;return e!==null&&(Ra===null?Ra=e:Ra.push.apply(Ra,e),es=null),e}function qn(e){es===null?es=[e]:es.push(e)}var sp=Kr(null),go=null,hi=null;function Yi(e,t,a){We(sp,t._currentValue),t._currentValue=a}function pi(e){e._currentValue=sp.current,jt(sp)}function ld(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function op(e,t,a,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var s=i.dependencies;if(s!==null){var o=i.child;s=s.firstContext;e:for(;s!==null;){var l=s;s=i;for(var n=0;n<t.length;n++)if(l.context===t[n]){s.lanes|=a,l=s.alternate,l!==null&&(l.lanes|=a),ld(s.return,a,e),r||(o=null);break e}s=l.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(D(341));o.lanes|=a,s=o.alternate,s!==null&&(s.lanes|=a),ld(o,a,e),o=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=a,o=i.alternate,o!==null&&(o.lanes|=a),ld(i.return,a,e),o=i.child,o=o!==null?o.sibling:null):o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function io(e,t,a,r){e=null;for(var i=t,s=!1;i!==null;){if(!s){if((i.flags&524288)!==0)s=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(D(387));if(o=o.memoizedProps,o!==null){var l=i.type;ja(i.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(i===Cd.current){if(o=i.alternate,o===null)throw Error(D(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Tl):e=[Tl])}i=i.return}return e!==null&&op(t,e,a,r),t.flags|=262144,e!==null}function Dd(e){for(e=e.firstContext;e!==null;){if(!ja(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function so(e){go=e,hi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yt(e){return EC(go,e)}function Vc(e,t){return go===null&&so(e),EC(e,t)}function EC(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},hi===null){if(e===null)throw Error(D(308));hi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else hi=hi.next=t;return a}var p2=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},g2=Rt.unstable_scheduleCallback,_2=Rt.unstable_NormalPriority,gt={$$typeof:Ur,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function dg(){return{controller:new p2,data:new Map,refCount:0}}function su(e){e.refCount--,e.refCount===0&&g2(_2,function(){e.controller.abort()})}function by(e,t){if((e.pendingLanes&4194048)!==0){var a=e.transitionTypes;for(a===null&&(a=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];a.indexOf(r)===-1&&a.push(r)}}}var Ln=null;function v2(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var In=null,lp=0,oo=0,pl=null;function S2(e,t){if(In===null){var a=In=[];lp=0,oo=zg(),pl={status:"pending",value:void 0,then:function(r){a.push(r)}}}return lp++,t.then(Ry,Ry),t}function Ry(){if(--lp===0&&(Ln=null,In!==null)){pl!==null&&(pl.status="fulfilled");var e=In;In=null,oo=0,pl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function y2(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),r}var Iy=ce.S;ce.S=function(e,t){if(G1=Ga(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&S2(e,t),Ln!==null)for(var a=kl;a!==null;)by(a,Ln),a=a.next;if(a=e.types,a!==null){for(var r=kl;r!==null;)by(r,a),r=r.next;if(oo!==0){r=Ln,r===null&&(r=Ln=[]);for(var i=0;i<a.length;i++){var s=a[i];r.indexOf(s)===-1&&r.push(s)}}}Iy!==null&&Iy(e,t)};var eo=Kr(null);function fg(){var e=eo.current;return e!==null?e:Ue.pooledCache}function nd(e,t){t===null?We(eo,eo.current):We(eo,t.pool)}function kC(){var e=fg();return e===null?null:{parent:gt._currentValue,pool:e}}var Nl=Error(D(460)),hg=Error(D(474)),sf=Error(D(542)),Md={then:function(){}};function Ey(e){return e=e.status,e==="fulfilled"||e==="rejected"}function DC(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Fr,Fr),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Dy(e),e===void 0&&!("reason"in t)?Error(D(600)):e;default:if(typeof t.status=="string")t.then(Fr,Fr);else{if(e=Ue,e!==null&&100<e.shellSuspendCounter)throw Error(D(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Dy(e),e}throw to=t,Nl}}function Xs(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(to=a,Nl):a}}var to=null;function ky(){if(to===null)throw Error(D(459));var e=to;return to=null,e}function Dy(e){if(e===Nl||e===sf)throw Error(D(483))}var gl=null,Vn=0;function $c(e){var t=Vn;return Vn+=1,gl===null&&(gl=[]),DC(gl,e,t)}function Fi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Wc(e,t){throw t.$$typeof===ek?Error(D(525)):(e=Object.prototype.toString.call(t),Error(D(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function MC(e){function t(p,g){if(e){var v=p.deletions;v===null?(p.deletions=[g],p.flags|=16):v.push(g)}}function a(p,g){if(!e)return null;for(;g!==null;)t(p,g),g=g.sibling;return null}function r(p){for(var g=new Map;p!==null;)p.key===null?g.set(p.index,p):g.set(p.key,p),p=p.sibling;return g}function i(p,g){return p=mi(p,g),p.index=0,p.sibling=null,p}function s(p,g,v){return p.index=v,e?(v=p.alternate,v!==null?(v=v.index,v<g?(p.flags|=2,g):v):(p.flags|=134217730,g)):(p.flags|=1048576,g)}function o(p){return e&&p.alternate===null&&(p.flags|=134217730),p}function l(p,g,v,C){return g===null||g.tag!==6?(g=ym(v,p.mode,C),g.return=p,g):(g=i(g,v),g.return=p,g)}function n(p,g,v,C){var x=v.type;return x===tl?(p=c(p,g,v.props.children,C,v.key),Fi(p,v),p):g!==null&&(g.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===$i&&Xs(x)===g.type)?(g=i(g,v.props),Fi(g,v),g.return=p,g):(g=od(v.type,v.key,v.props,null,p.mode,C),Fi(g,v),g.return=p,g)}function u(p,g,v,C){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=Cm(v,p.mode,C),g.return=p,g):(g=i(g,v.children||[]),g.return=p,g)}function c(p,g,v,C,x){return g===null||g.tag!==7?(g=Js(v,p.mode,C,x),g.return=p,g):(g=i(g,v),g.return=p,g)}function d(p,g,v){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=ym(""+g,p.mode,v),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Oc:return v=od(g.type,g.key,g.props,null,p.mode,v),Fi(v,g),v.return=p,v;case Sn:return g=Cm(g,p.mode,v),g.return=p,g;case $i:return g=Xs(g),d(p,g,v)}if(yn(g)||hn(g))return g=Js(g,p.mode,v,null),g.return=p,g;if(typeof g.then=="function")return d(p,$c(g),v);if(g.$$typeof===Ur)return d(p,Vc(p,g),v);Wc(p,g)}return null}function f(p,g,v,C){var x=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return x!==null?null:l(p,g,""+v,C);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Oc:return v.key===x?n(p,g,v,C):null;case Sn:return v.key===x?u(p,g,v,C):null;case $i:return v=Xs(v),f(p,g,v,C)}if(yn(v)||hn(v))return x!==null?null:c(p,g,v,C,null);if(typeof v.then=="function")return f(p,g,$c(v),C);if(v.$$typeof===Ur)return f(p,g,Vc(p,v),C);Wc(p,v)}return null}function h(p,g,v,C,x){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return p=p.get(v)||null,l(g,p,""+C,x);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Oc:return p=p.get(C.key===null?v:C.key)||null,n(g,p,C,x);case Sn:return p=p.get(C.key===null?v:C.key)||null,u(g,p,C,x);case $i:return C=Xs(C),h(p,g,v,C,x)}if(yn(C)||hn(C))return p=p.get(v)||null,c(g,p,C,x,null);if(typeof C.then=="function")return h(p,g,v,$c(C),x);if(C.$$typeof===Ur)return h(p,g,v,Vc(g,C),x);Wc(g,C)}return null}function m(p,g,v,C){for(var x=null,k=null,T=g,U=g=0,w=null;T!==null&&U<v.length;U++){T.index>U?(w=T,T=null):w=T.sibling;var N=f(p,T,v[U],C);if(N===null){T===null&&(T=w);break}e&&T&&N.alternate===null&&t(p,T),g=s(N,g,U),k===null?x=N:k.sibling=N,k=N,T=w}if(U===v.length)return a(p,T),ge&&fi(p,U),x;if(T===null){for(;U<v.length;U++)T=d(p,v[U],C),T!==null&&(g=s(T,g,U),k===null?x=T:k.sibling=T,k=T);return ge&&fi(p,U),x}for(T=r(T);U<v.length;U++)w=h(T,p,U,v[U],C),w!==null&&(e&&(N=w.alternate,N!==null&&T.delete(N.key===null?U:N.key)),g=s(w,g,U),k===null?x=w:k.sibling=w,k=w);return e&&T.forEach(function(H){return t(p,H)}),ge&&fi(p,U),x}function _(p,g,v,C){if(v==null)throw Error(D(151));for(var x=null,k=null,T=g,U=g=0,w=null,N=v.next();T!==null&&!N.done;U++,N=v.next()){T.index>U?(w=T,T=null):w=T.sibling;var H=f(p,T,N.value,C);if(H===null){T===null&&(T=w);break}e&&T&&H.alternate===null&&t(p,T),g=s(H,g,U),k===null?x=H:k.sibling=H,k=H,T=w}if(N.done)return a(p,T),ge&&fi(p,U),x;if(T===null){for(;!N.done;U++,N=v.next())N=d(p,N.value,C),N!==null&&(g=s(N,g,U),k===null?x=N:k.sibling=N,k=N);return ge&&fi(p,U),x}for(T=r(T);!N.done;U++,N=v.next())N=h(T,p,U,N.value,C),N!==null&&(e&&(w=N.alternate,w!==null&&T.delete(w.key===null?U:w.key)),g=s(N,g,U),k===null?x=N:k.sibling=N,k=N);return e&&T.forEach(function(ee){return t(p,ee)}),ge&&fi(p,U),x}function y(p,g,v,C){if(typeof v=="object"&&v!==null&&v.type===tl&&v.key===null&&v.props.ref===void 0&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Oc:e:{for(var x=v.key;g!==null;){if(g.key===x){if(x=v.type,x===tl){if(g.tag===7){a(p,g.sibling),C=i(g,v.props.children),Fi(C,v),C.return=p,p=C;break e}}else if(g.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===$i&&Xs(x)===g.type){a(p,g.sibling),C=i(g,v.props),Fi(C,v),C.return=p,p=C;break e}a(p,g);break}else t(p,g);g=g.sibling}v.type===tl?(C=Js(v.props.children,p.mode,C,v.key),Fi(C,v),C.return=p,p=C):(C=od(v.type,v.key,v.props,null,p.mode,C),Fi(C,v),C.return=p,p=C)}return o(p);case Sn:e:{for(x=v.key;g!==null;){if(g.key===x)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){a(p,g.sibling),C=i(g,v.children||[]),C.return=p,p=C;break e}else{a(p,g);break}else t(p,g);g=g.sibling}C=Cm(v,p.mode,C),C.return=p,p=C}return o(p);case $i:return v=Xs(v),y(p,g,v,C)}if(yn(v))return m(p,g,v,C);if(hn(v)){if(x=hn(v),typeof x!="function")throw Error(D(150));return v=x.call(v),_(p,g,v,C)}if(typeof v.then=="function")return y(p,g,$c(v),C);if(v.$$typeof===Ur)return y(p,g,Vc(p,v),C);Wc(p,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,g!==null&&g.tag===6?(a(p,g.sibling),C=i(g,v),C.return=p,p=C):(a(p,g),C=ym(v,p.mode,C),C.return=p,p=C),o(p)):a(p,g)}return function(p,g,v,C){try{Vn=0;var x=y(p,g,v,C);return gl=null,x}catch(T){if(T===Nl||T===sf)throw T;var k=Ea(29,T,null,p.mode);return k.lanes=C,k.return=p,k}}}var lo=MC(!0),TC=MC(!1),Wi=!1;function mg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function np(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ts(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function as(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Me&2)!==0){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Id(e),xC(e,null,a),t}return af(e,r,t,a),Id(e)}function En(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Y0(e,a)}}function xm(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var i=null,s=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};s===null?i=s=o:s=s.next=o,a=a.next}while(a!==null);s===null?i=s=t:s=s.next=t}else i=s=t;a={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var up=!1;function kn(){if(up){var e=pl;if(e!==null)throw e}}function Dn(e,t,a,r){up=!1;var i=e.updateQueue;Wi=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var n=l,u=n.next;n.next=null,o===null?s=u:o.next=u,o=n;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==o&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=n))}if(s!==null){var d=i.baseState;o=0,c=u=n=null,l=s;do{var f=l.lane&-536870913,h=f!==l.lane;if(h?(Ce&f)===f:(r&f)===f){f!==0&&f===oo&&(up=!0),c!==null&&(c=c.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var m=e,_=l;f=t;var y=a;switch(_.tag){case 1:if(m=_.payload,typeof m=="function"){d=m.call(y,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=_.payload,f=typeof m=="function"?m.call(y,d,f):m,f==null)break e;d=Fe({},d,f);break e;case 2:Wi=!0}}f=l.callback,f!==null&&(e.flags|=64,h&&(e.flags|=8192),h=i.callbacks,h===null?i.callbacks=[f]:h.push(f))}else h={lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=h,n=d):c=c.next=h,o|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);c===null&&(n=d),i.baseState=n,i.firstBaseUpdate=u,i.lastBaseUpdate=c,s===null&&(i.shared.lanes=0),hs|=o,e.lanes=o,e.memoizedState=d}}function AC(e,t){if(typeof e!="function")throw Error(D(191,e));e.call(t)}function BC(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)AC(a[e],t)}var ds=Kr(null),Td=Kr(0);function My(e,t){e=Ci,We(Td,e),We(ds,t),Ci=e|t.baseLanes}function cp(){We(Td,Ci),We(ds,ds.current)}function pg(){Ci=Td.current,jt(ds),jt(Td)}var Jt=Kr(null),oa=null;function rs(e){var t=e.alternate;We(Zt,Zt.current&1),We(Jt,e),oa===null&&(t===null||ds.current!==null||t.memoizedState!==null)&&(oa=e)}function dp(e){We(Zt,Zt.current),We(Jt,e),oa===null&&(oa=e)}function OC(e){e.tag===22?(We(Zt,Zt.current),We(Jt,e),oa===null&&(oa=e)):is()}function is(){We(Zt,Zt.current),We(Jt,Jt.current)}function Va(e){jt(Jt),oa===e&&(oa=null),jt(Zt)}var Zt=Kr(0);function $n(e,t){We(Jt,Jt.current),We(Zt,t)}function gg(e){jt(Zt),jt(Jt),oa===e&&(oa=null)}function Ad(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Wp(a)||Vg(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var vi=0,he=null,He=null,pt=null,Bd=!1,_l=!1,no=!1,Od=0,Wn=0,vl=null,C2=0;function ot(){throw Error(D(321))}function _g(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ja(e[a],t[a]))return!1;return!0}function vg(e,t,a,r,i,s){return vi=s,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ce.H=e===null||e.memoizedState===null?f1:h1,no=!1,s=a(r,i),no=!1,_l&&(s=NC(t,a,r,i)),PC(e),s}function PC(e){ce.H=Pd;var t=He!==null&&He.next!==null;if(vi=0,pt=He=he=null,Bd=!1,Wn=0,vl=null,t)throw Error(D(300));e===null||_t||(e=e.dependencies,e!==null&&Dd(e)&&(_t=!0))}function NC(e,t,a,r){he=e;var i=0;do{if(_l&&(vl=null),Wn=0,_l=!1,25<=i)throw Error(D(301));if(i+=1,pt=He=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}ce.H=k2,s=t(a,r)}while(_l);return s}function L2(){var e=ce.H,t=e.useState()[0];return t=typeof t.then=="function"?ou(t):t,e=e.useState()[0],(He!==null?He.memoizedState:null)!==e&&(he.flags|=1024),t}function Sg(){var e=Od!==0;return Od=0,e}function yg(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Cg(e){if(Bd){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bd=!1}vi=0,pt=He=he=null,_l=!1,Wn=Od=0,vl=null}function ma(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?he.memoizedState=pt=e:pt=pt.next=e,pt}function ft(){if(He===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=pt===null?he.memoizedState:pt.next;if(t!==null)pt=t,He=e;else{if(e===null)throw he.alternate===null?Error(D(467)):Error(D(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},pt===null?he.memoizedState=pt=e:pt=pt.next=e}return pt}function of(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ou(e){var t=Wn;return Wn+=1,vl===null&&(vl=[]),e=DC(vl,e,t),t=he,(pt===null?t.memoizedState:pt.next)===null&&(t=t.alternate,ce.H=t===null||t.memoizedState===null?f1:h1),e}function lf(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ou(e);if(e.$$typeof===rk)return;if(e.$$typeof===Ur)return Yt(e)}throw Error(D(438,String(e)))}function Lg(e){var t=null,a=he.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=he.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=of(),he.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=ak;return t.index++,a}function Si(e,t){return typeof t=="function"?t(e):t}function ud(e){var t=ft();return xg(t,He,e)}function xg(e,t,a){var r=e.queue;if(r===null)throw Error(D(311));r.lastRenderedReducer=a;var i=e.baseQueue,s=r.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}t.baseQueue=i=s,r.pending=null}if(s=e.baseState,i===null)e.memoizedState=s;else{t=i.next;var l=o=null,n=null,u=t,c=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(Ce&d)===d:(vi&d)===d){var f=u.revertLane;if(f===0)n!==null&&(n=n.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===oo&&(c=!0);else if((vi&f)===f){u=u.next,f===oo&&(c=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},n===null?(l=n=d,o=s):n=n.next=d,he.lanes|=f,hs|=f;d=u.action,no&&a(s,d),s=u.hasEagerState?u.eagerState:a(s,d)}else f={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},n===null?(l=n=f,o=s):n=n.next=f,he.lanes|=d,hs|=d;u=u.next}while(u!==null&&u!==t);if(n===null?o=s:n.next=l,!ja(s,e.memoizedState)&&(_t=!0,c&&(a=pl,a!==null)))throw a;e.memoizedState=s,e.baseState=o,e.baseQueue=n,r.lastRenderedState=s}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function wm(e){var t=ft(),a=t.queue;if(a===null)throw Error(D(311));a.lastRenderedReducer=e;var r=a.dispatch,i=a.pending,s=t.memoizedState;if(i!==null){a.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);ja(s,t.memoizedState)||(_t=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),a.lastRenderedState=s}return[s,r]}function HC(e,t,a){var r=he,i=ft(),s=ge;if(s){if(a===void 0)throw Error(D(407));a=a()}else a=t();var o=!ja((He||i).memoizedState,a);if(o&&(i.memoizedState=a,_t=!0),i=i.queue,wg(FC.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||o||pt!==null&&(pt.memoizedState.tag&1)!==0,bl(e?9:8,{destroy:void 0},UC.bind(null,r,i,a,t),null),e){if(r.flags|=2048,Ue===null)throw Error(D(349));s||(vi&127)!==0||zC(r,t,a)}return a}function zC(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=he.updateQueue,t===null?(t=of(),he.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function UC(e,t,a,r){t.value=a,t.getSnapshot=r,qC(t)&&VC(e)}function FC(e,t,a){return a(function(){qC(t)&&VC(e)})}function qC(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ja(e,a)}catch{return!0}}function VC(e){var t=po(e,2);t!==null&&ka(t,e,2)}function fp(e){var t=ma();if(typeof e=="function"){var a=e;if(e=a(),no){Ki(!0);try{a()}finally{Ki(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:e},t}function $C(e,t,a,r){return e.baseState=a,xg(e,He,typeof r=="function"?r:Si)}function x2(e,t,a,r,i){if(uf(e))throw Error(D(485));if(e=t.action,e!==null){var s={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){s.listeners.push(o)}};ce.T!==null?a(!0):s.isTransition=!1,r(s),a=t.pending,a===null?(s.next=t.pending=s,WC(t,s)):(s.next=a.next,t.pending=a.next=s)}}function WC(e,t){var a=t.action,r=t.payload,i=e.state;if(t.isTransition){var s=ce.T,o={};o.types=s!==null?s.types:null,ce.T=o;try{var l=a(i,r),n=ce.S;n!==null&&n(o,l),Ty(e,t,l)}catch(u){hp(e,t,u)}finally{s!==null&&o.types!==null&&(s.types=o.types),ce.T=s}}else try{s=a(i,r),Ty(e,t,s)}catch(u){hp(e,t,u)}}function Ty(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Ay(e,t,r)},function(r){return hp(e,t,r)}):Ay(e,t,a)}function Ay(e,t,a){t.status="fulfilled",t.value=a,GC(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,WC(e,a)))}function hp(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,GC(t),t=t.next;while(t!==r)}e.action=null}function GC(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function KC(e,t){return t}function By(e,t){if(ge){var a=Ue.formState;if(a!==null){e:{var r=he;if(ge){if($e){t:{for(var i=$e,s=fr;i.nodeType!==8;){if(!s){i=null;break t}if(i=hr(i.nextSibling),i===null){i=null;break t}}s=i.data,i=s==="F!"||s==="F"?i:null}if(i){$e=hr(i.nextSibling),r=i.data==="F!";break e}}cs(r)}r=!1}r&&(t=a[0])}}return a=ma(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:KC,lastRenderedState:t},a.queue=r,a=u1.bind(null,he,r),r.dispatch=a,r=fp(!1),s=Eg.bind(null,he,!1,r.queue),r=ma(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,a=x2.bind(null,he,i,s,a),i.dispatch=a,r.memoizedState=e,[t,a,!1]}function Oy(e){var t=ft();return XC(t,He,e)}function XC(e,t,a){if(t=xg(e,t,KC)[0],e=ud(Si)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=ou(t)}catch(o){throw o===Nl?sf:o}else r=t;t=ft();var i=t.queue,s=i.dispatch;return a!==t.memoizedState&&(he.flags|=2048,bl(9,{destroy:void 0},w2.bind(null,i,a),null)),[r,s,e]}function w2(e,t){e.action=t}function Py(e){var t=ft(),a=He;if(a!==null)return XC(t,a,e);ft(),t=t.memoizedState,a=ft();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function bl(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=he.updateQueue,t===null&&(t=of(),he.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function YC(){return ft().memoizedState}function cd(e,t,a,r){var i=ma();he.flags|=e,i.memoizedState=bl(1|t,{destroy:void 0},a,r===void 0?null:r)}function nf(e,t,a,r){var i=ft();r=r===void 0?null:r;var s=i.memoizedState.inst;He!==null&&r!==null&&_g(r,He.memoizedState.deps)?i.memoizedState=bl(t,s,a,r):(he.flags|=e,i.memoizedState=bl(1|t,s,a,r))}function Ny(e,t){cd(8390656,8,e,t)}function wg(e,t){nf(2048,8,e,t)}function b2(e){he.flags|=4;var t=he.updateQueue;if(t===null)t=of(),he.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function jC(e){var t=ft().memoizedState;return b2({ref:t,nextImpl:e}),function(){if((Me&2)!==0)throw Error(D(440));return t.impl.apply(void 0,arguments)}}function ZC(e,t){return nf(4,2,e,t)}function QC(e,t){return nf(4,4,e,t)}function JC(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function e1(e,t,a){a=a!=null?a.concat([e]):null,nf(4,4,JC.bind(null,t,e),a)}function bg(){}function t1(e,t){var a=ft();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&_g(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function a1(e,t){var a=ft();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&_g(t,r[1]))return r[0];if(r=e(),no){Ki(!0);try{e()}finally{Ki(!1)}}return a.memoizedState=[r,t],r}function Rg(e,t,a){return a===void 0||(vi&1073741824)!==0&&(Ce&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=X1(),he.lanes|=e,hs|=e,a)}function r1(e,t,a,r){return ja(a,t)?a:ds.current!==null?(e=Rg(e,a,r),ja(e,t)||(_t=!0),e):(vi&106)===0||(vi&1073741824)!==0&&(Ce&261930)===0?(_t=!0,e.memoizedState=a):(e=X1(),he.lanes|=e,hs|=e,t)}function i1(e,t,a,r,i){var s=Te.p;Te.p=s!==0&&8>s?s:8;var o=ce.T,l={};l.types=o!==null?o.types:null,ce.T=l,Eg(e,!1,t,a);try{var n=i(),u=ce.S;if(u!==null&&u(l,n),n!==null&&typeof n=="object"&&typeof n.then=="function"){var c=y2(n,r);Mn(e,t,c,Ya(e))}else Mn(e,t,r,Ya(e))}catch(d){Mn(e,t,{then:function(){},status:"rejected",reason:d},Ya())}finally{Te.p=s,o!==null&&l.types!==null&&(o.types=l.types),ce.T=o}}function R2(){}function mp(e,t,a,r){if(e.tag!==5)throw Error(D(476));var i=s1(e).queue;i1(e,i,t,Qs,a===null?R2:function(){return o1(e),a(r)})}function s1(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Qs,baseState:Qs,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:Qs},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function o1(e){var t=s1(e);t.next===null&&(t=e.alternate.memoizedState),Mn(e,t.next.queue,{},Ya())}function Ig(){return Yt(Tl)}function l1(){return ft().memoizedState}function n1(){return ft().memoizedState}function I2(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ya();e=ts(a);var r=as(t,e,a);r!==null&&(ka(r,t,a),En(r,t,a)),t={cache:dg()},e.payload=t;return}t=t.return}}function E2(e,t,a){var r=Ya();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},uf(e)?c1(t,a):(a=ng(e,t,a,r),a!==null&&(ka(a,e,r),d1(a,t,r)))}function u1(e,t,a){var r=Ya();Mn(e,t,a,r)}function Mn(e,t,a,r){var i={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(uf(e))c1(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,a);if(i.hasEagerState=!0,i.eagerState=l,ja(l,o))return af(e,t,i,0),Ue===null&&tf(),!1}catch{}if(a=ng(e,t,i,r),a!==null)return ka(a,e,r),d1(a,t,r),!0}return!1}function Eg(e,t,a,r){if(r={lane:2,revertLane:zg(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},uf(e)){if(t)throw Error(D(479))}else t=ng(e,a,r,2),t!==null&&ka(t,e,2)}function uf(e){var t=e.alternate;return e===he||t!==null&&t===he}function c1(e,t){_l=Bd=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function d1(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Y0(e,a)}}var Pd={readContext:Yt,use:lf,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot,useEffectEvent:ot},f1={readContext:Yt,use:lf,useCallback:function(e,t){return ma().memoizedState=[e,t===void 0?null:t],e},useContext:Yt,useEffect:Ny,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,cd(4194308,4,JC.bind(null,t,e),a)},useLayoutEffect:function(e,t){return cd(4194308,4,e,t)},useInsertionEffect:function(e,t){cd(4,2,e,t)},useMemo:function(e,t){var a=ma();t=t===void 0?null:t;var r=e();if(no){Ki(!0);try{e()}finally{Ki(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=ma();if(a!==void 0){var i=a(t);if(no){Ki(!0);try{a(t)}finally{Ki(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=E2.bind(null,he,e),[r.memoizedState,e]},useRef:function(e){var t=ma();return e={current:e},t.memoizedState=e},useState:function(e){e=fp(e);var t=e.queue,a=u1.bind(null,he,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:bg,useDeferredValue:function(e,t){var a=ma();return Rg(a,e,t)},useTransition:function(){var e=fp(!1);return e=i1.bind(null,he,e.queue,!0,!1),ma().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=he,i=ma();if(ge){if(a===void 0)throw Error(D(407));a=a()}else{if(a=t(),Ue===null)throw Error(D(349));(Ce&127)!==0||zC(r,t,a)}i.memoizedState=a;var s={value:a,getSnapshot:t};return i.queue=s,Ny(FC.bind(null,r,s,e),[e]),r.flags|=2048,bl(9,{destroy:void 0},UC.bind(null,r,s,a,t),null),a},useId:function(){var e=ma(),t=Ue.identifierPrefix;if(ge){var a=Vr,r=qr;a=(r&~(1<<32-Xa(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Od++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=C2++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ig,useFormState:By,useActionState:By,useOptimistic:function(e){var t=ma();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Eg.bind(null,he,!0,a),a.dispatch=t,[e,t]},useMemoCache:Lg,useCacheRefresh:function(){return ma().memoizedState=I2.bind(null,he)},useEffectEvent:function(e){var t=ma(),a={impl:e};return t.memoizedState=a,function(){if((Me&2)!==0)throw Error(D(440));return a.impl.apply(void 0,arguments)}}},h1={readContext:Yt,use:lf,useCallback:t1,useContext:Yt,useEffect:wg,useImperativeHandle:e1,useInsertionEffect:ZC,useLayoutEffect:QC,useMemo:a1,useReducer:ud,useRef:YC,useState:function(){return ud(Si)},useDebugValue:bg,useDeferredValue:function(e,t){var a=ft();return r1(a,He.memoizedState,e,t)},useTransition:function(){var e=ud(Si)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:ou(e),t]},useSyncExternalStore:HC,useId:l1,useHostTransitionStatus:Ig,useFormState:Oy,useActionState:Oy,useOptimistic:function(e,t){var a=ft();return $C(a,He,e,t)},useMemoCache:Lg,useCacheRefresh:n1,useEffectEvent:jC},k2={readContext:Yt,use:lf,useCallback:t1,useContext:Yt,useEffect:wg,useImperativeHandle:e1,useInsertionEffect:ZC,useLayoutEffect:QC,useMemo:a1,useReducer:wm,useRef:YC,useState:function(){return wm(Si)},useDebugValue:bg,useDeferredValue:function(e,t){var a=ft();return He===null?Rg(a,e,t):r1(a,He.memoizedState,e,t)},useTransition:function(){var e=wm(Si)[0],t=ft().memoizedState;return[typeof e=="boolean"?e:ou(e),t]},useSyncExternalStore:HC,useId:l1,useHostTransitionStatus:Ig,useFormState:Py,useActionState:Py,useOptimistic:function(e,t){var a=ft();return He!==null?$C(a,He,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Lg,useCacheRefresh:n1,useEffectEvent:jC};function bm(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Fe({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var pp={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=Ya(),i=ts(r);i.payload=t,a!=null&&(i.callback=a),t=as(e,i,r),t!==null&&(ka(t,e,r),En(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=Ya(),i=ts(r);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=as(e,i,r),t!==null&&(ka(t,e,r),En(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ya(),r=ts(a);r.tag=2,t!=null&&(r.callback=t),t=as(e,r,a),t!==null&&(ka(t,e,a),En(t,e,a))}};function Hy(e,t,a,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!Un(a,r)||!Un(i,s):!0}function zy(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&pp.enqueueReplaceState(t,t.state,null)}function uo(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=Fe({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function m1(e){Rd(e)}function p1(e){console.error(e)}function g1(e){Rd(e)}function Nd(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Uy(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function gp(e,t,a){return a=ts(a),a.tag=3,a.payload={element:null},a.callback=function(){Nd(e,t)},a}function _1(e){return e=ts(e),e.tag=3,e}function v1(e,t,a,r){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var s=r.value;e.payload=function(){return i(s)},e.callback=function(){Uy(t,a,r)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){Uy(t,a,r),typeof i!="function"&&(ss===null?ss=new Set([this]):ss.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function D2(e,t,a,r,i){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&io(t,a,i,!0),a=Jt.current,a!==null){switch(a.tag){case 31:case 13:case 19:return oa===null?Wd():a.alternate===null&&lt===0&&(lt=3),a.flags&=-257,a.flags|=65536,a.lanes=i,r===Md?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),Tm(e,r,i)),!1;case 22:return a.flags|=65536,r===Md?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),Tm(e,r,i)),!1}throw Error(D(435,a.tag))}return Tm(e,r,i),Wd(),!1}if(ge)return t=Jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==ip&&(e=Error(D(422),{cause:r}),qn(dr(e,a)))):(r!==ip&&(t=Error(D(423),{cause:r}),qn(dr(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=dr(r,a),i=gp(e.stateNode,r,i),xm(e,i),lt!==4&&(lt=2)),!1;var s=Error(D(520),{cause:r});if(s=dr(s,a),On===null?On=[s]:On.push(s),lt!==4&&(lt=2),t===null)return!0;r=dr(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=gp(a.stateNode,r,e),xm(a,e),!1;case 1:if(t=a.type,s=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(ss===null||!ss.has(s))))return a.flags|=65536,i&=-i,a.lanes|=i,i=_1(i),v1(i,e,a,r),xm(a,i),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var kg=Error(D(461)),_t=!1;function wt(e,t,a,r){t.child=e===null?TC(t,null,a,r):lo(t,e.child,a,r)}function Fy(e,t,a,r,i){a=a.render;var s=t.ref;if("ref"in r){var o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}else o=r;return so(t),r=vg(e,t,a,o,s,i),l=Sg(),e!==null&&!_t?(yg(e,t,i),yi(e,t,i)):(ge&&l&&rf(t),t.flags|=1,wt(e,t,r,i),t.child)}function qy(e,t,a,r,i){if(e===null){var s=a.type;return typeof s=="function"&&!ug(s)&&s.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=s,S1(e,t,s,r,i)):(e=od(a.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!Mg(e,i)){var o=s.memoizedProps;if(a=a.compare,a=a!==null?a:Un,a(o,r)&&e.ref===t.ref)return yi(e,t,i)}return t.flags|=1,e=mi(s,r),e.ref=t.ref,e.return=t,t.child=e}function S1(e,t,a,r,i){if(e!==null){var s=e.memoizedProps;if(Un(s,r)&&e.ref===t.ref)if(_t=!1,t.pendingProps=r=s,Mg(e,i))(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,yi(e,t,i)}return _p(e,t,a,r,i)}function y1(e,t,a,r){var i=r.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(s=s!==null?s.baseLanes|a:a,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~s}else r=0,t.child=null;return Vy(e,t,s,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&nd(t,s!==null?s.cachePool:null),s!==null?My(t,s):cp(),OC(t);else return r=t.lanes=536870912,Vy(e,t,s!==null?s.baseLanes|a:a,a,r)}else s!==null?(nd(t,s.cachePool),My(t,s),is(),t.memoizedState=null):(e!==null&&nd(t,null),cp(),is());return wt(e,t,i,a),t.child}function Tn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vy(e,t,a,r,i){var s=fg();return s=s===null?null:{parent:gt._currentValue,pool:s},t.memoizedState={baseLanes:a,cachePool:s},e!==null&&nd(t,null),cp(),OC(t),e!==null&&io(e,t,r,!0),t.childLanes=i,null}function dd(e,t){return t=cf({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function $y(e,t,a){return lo(t,e.child,null,a),e=dd(t,t.pendingProps),e.flags|=2,Va(t),t.memoizedState=null,e}function M2(e,t,a){var r=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ge){if(r.mode==="hidden")return e=dd(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Tn(null,e);if(dp(t),(e=$e)?(e=yL(e,fr),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:us!==null?{id:qr,overflow:Vr}:null,retryLane:536870912,hydrationErrors:null},a=bC(e),a.return=t,t.child=a,Nt=t,$e=null)):e=null,e===null)throw cs(t);return t.lanes=536870912,null}return dd(t,r)}var s=e.memoizedState;if(s!==null){var o=s.dehydrated;if(dp(t),i)if(t.flags&256)t.flags&=-257,t=$y(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(D(558));else if(_t||io(e,t,a,!1),i=(a&e.childLanes)!==0,_t||i){if(ds.current===null){if(r=Ue,r!==null&&(o=j0(r,a),o!==0&&o!==s.retryLane))throw s.retryLane=o,po(e,o),ka(r,e,o),kg;Wd()}t=$y(e,t,a)}else e=s.treeContext,$e=hr(o.nextSibling),Nt=t,ge=!0,es=null,fr=!1,e!==null&&IC(t,e),t=dd(t,r),t.flags|=134221824;return t}return e=mi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Zo(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(D(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function _p(e,t,a,r,i){return so(t),a=vg(e,t,a,r,void 0,i),r=Sg(),e!==null&&!_t?(yg(e,t,i),yi(e,t,i)):(ge&&r&&rf(t),t.flags|=1,wt(e,t,a,i),t.child)}function Wy(e,t,a,r,i,s){return so(t),t.updateQueue=null,a=NC(t,r,a,i),PC(e),r=Sg(),e!==null&&!_t?(yg(e,t,s),yi(e,t,s)):(ge&&r&&rf(t),t.flags|=1,wt(e,t,a,s),t.child)}function Gy(e,t,a,r,i){if(so(t),t.stateNode===null){var s=nl,o=a.contextType;typeof o=="object"&&o!==null&&(s=Yt(o)),s=new a(r,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=pp,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=r,s.state=t.memoizedState,s.refs={},mg(t),o=a.contextType,s.context=typeof o=="object"&&o!==null?Yt(o):nl,s.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(bm(t,a,o,r),s.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(o=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),o!==s.state&&pp.enqueueReplaceState(s,s.state,null),Dn(t,r,s,i),kn(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){s=t.stateNode;var l=t.memoizedProps,n=uo(a,l);s.props=n;var u=s.context,c=a.contextType;o=nl,typeof c=="object"&&c!==null&&(o=Yt(c));var d=a.getDerivedStateFromProps;c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l||u!==o)&&zy(t,s,r,o),Wi=!1;var f=t.memoizedState;s.state=f,Dn(t,r,s,i),kn(),u=t.memoizedState,l||f!==u||Wi?(typeof d=="function"&&(bm(t,a,d,r),u=t.memoizedState),(n=Wi||Hy(t,a,n,r,f,u,o))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),s.props=r,s.state=u,s.context=o,r=n):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,np(e,t),o=t.memoizedProps,c=uo(a,o),s.props=c,d=t.pendingProps,f=s.context,u=a.contextType,n=nl,typeof u=="object"&&u!==null&&(n=Yt(u)),l=a.getDerivedStateFromProps,(u=typeof l=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==d||f!==n)&&zy(t,s,r,n),Wi=!1,f=t.memoizedState,s.state=f,Dn(t,r,s,i),kn();var h=t.memoizedState;o!==d||f!==h||Wi||e!==null&&e.dependencies!==null&&Dd(e.dependencies)?(typeof l=="function"&&(bm(t,a,l,r),h=t.memoizedState),(c=Wi||Hy(t,a,c,r,f,h,n)||e!==null&&e.dependencies!==null&&Dd(e.dependencies))?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,h,n),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,h,n)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),s.props=r,s.state=h,s.context=n,r=c):(typeof s.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return s=r,Zo(e,t),r=(t.flags&128)!==0,s||r?(s=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&r?(t.child=lo(t,e.child,null,i),t.child=lo(t,null,a,i)):wt(e,t,a,i),t.memoizedState=s.state,e=t.child):e=yi(e,t,i),e}function Ky(e,t,a,r){return ro(),t.flags|=256,wt(e,t,a,r),t.child}var vp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sp(e){return{baseLanes:e,cachePool:kC()}}function yp(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Wa),e}function C1(e,t,a){var r=t.pendingProps,i=!1,s=(t.flags&128)!==0,o;if((o=s)||(o=e!==null&&e.memoizedState===null?!1:(Zt.current&2)!==0),o&&(i=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(ge){if(i?rs(t):is(),(e=$e)?(e=yL(e,fr),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:us!==null?{id:qr,overflow:Vr}:null,retryLane:536870912,hydrationErrors:null},a=bC(e),a.return=t,t.child=a,Nt=t,$e=null)):e=null,e===null)throw cs(t);return Vg(e)?t.lanes=32:t.lanes=536870912,null}return s=r.children,r=r.fallback,i?(is(),i=t.mode,s=cf({mode:"hidden",children:s},i),r=Js(r,i,a,null),s.return=t,r.return=t,s.sibling=r,t.child=s,r=t.child,r.memoizedState=Sp(a),r.childLanes=yp(e,o,a),t.memoizedState=vp,Tn(null,r)):(rs(t),Dg(t,s))}var l=e.memoizedState;if(l!==null){var n=l.dehydrated;if(n!==null)return T2(e,t,s,o,r,n,l,a)}return i?(is(),i=r.fallback,s=t.mode,l=e.child,n=l.sibling,r=mi(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&1206910976,n!==null?i=mi(n,i):(i=Js(i,s,a,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,Tn(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Sp(a):(s=i.cachePool,s!==null?(l=gt._currentValue,s=s.parent!==l?{parent:l,pool:l}:s):s=kC(),i={baseLanes:i.baseLanes|a,cachePool:s}),r.memoizedState=i,r.childLanes=yp(e,o,a),t.memoizedState=vp,Tn(e.child,r)):(rs(t),a=e.child,e=a.sibling,a=mi(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=a,t.memoizedState=null,a)}function Dg(e,t){return t=cf({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function cf(e,t){return e=Ea(22,e,null,t),e.lanes=0,e}function Gc(e,t,a){return lo(t,e.child,null,a),e=Dg(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function T2(e,t,a,r,i,s,o,l){if(a)return t.flags&256?(rs(t),t.flags&=-257,Gc(e,t,l)):t.memoizedState!==null?(is(),t.child=e.child,t.flags|=128,null):(is(),s=i.fallback,o=t.mode,i=cf({mode:"visible",children:i.children},o),s=Js(s,o,l,null),s.flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,lo(t,e.child,null,l),i=t.child,i.memoizedState=Sp(l),i.childLanes=yp(e,r,l),t.memoizedState=vp,Tn(null,i));if(rs(t),Vg(s)){if(r=s.nextSibling&&s.nextSibling.dataset,r)var n=r.dgst;return r=n,r!==""&&(i=Error(D(419)),i.stack="",i.digest=r,qn({value:i,source:null,stack:null})),Gc(e,t,l)}if(_t||io(e,t,l,!1),r=(l&e.childLanes)!==0,_t||r){if(ds.current!==null)return Gc(e,t,l);if(r=Ue,r!==null&&(i=j0(r,l),i!==0&&i!==o.retryLane))throw o.retryLane=i,po(e,i),ka(r,e,i),kg;return Wp(s)||Wd(),Gc(e,t,l)}return Wp(s)?(t.flags|=192,t.child=e.child,null):(e=o.treeContext,$e=hr(s.nextSibling),Nt=t,ge=!0,es=null,fr=!1,e!==null&&IC(t,e),t=Dg(t,i.children),t.flags|=134221824,t)}function Xy(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ld(e.return,t,a)}function Yy(e){for(var t=null;e!==null;){var a=e.alternate;a!==null&&Ad(a)===null&&(t=e),e=e.sibling}return t}function Kc(e,t,a,r,i,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:i,treeForkCount:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=a,o.tailMode=i,o.treeForkCount=s)}function Rm(e){var t=e.child;for(e.child=null;t!==null;){var a=t.sibling;t.sibling=e.child,e.child=t,t=a}}function Cp(e,t,a){var r=t.pendingProps,i=r.revealOrder,s=r.tail;r=r.children;var o=Zt.current;if(t.flags&128)return $n(t,o),null;var l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,$n(t,o),i==="backwards"&&e!==null?(Rm(e),wt(e,t,r,a),Rm(e)):wt(e,t,r,a),r=ge?Fn:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xy(e,a,t);else if(e.tag===19)Xy(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"backwards":a=Yy(t.child),a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null,Rm(t)),Kc(t,!0,i,null,s,r);break;case"unstable_legacy-backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ad(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}Kc(t,!0,a,null,s,r);break;case"together":Kc(t,!1,null,null,void 0,r);break;case"independent":t.memoizedState=null;break;default:a=Yy(t.child),a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),Kc(t,!1,i,a,s,r)}return t.child}function jy(e,t,a){var r=t.pendingProps;return Yi(t,t.type,r.value),wt(e,t,r.children,a),t.child}function yi(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),hs|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(io(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(D(153));if(t.child!==null){for(e=t.child,a=mi(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=mi(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Mg(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Dd(e)))}function A2(e,t,a){switch(t.tag){case 3:Ld(t,t.stateNode.containerInfo),Yi(t,gt,e.memoizedState.cache),ro();break;case 27:case 5:Xm(t);break;case 4:Ld(t,t.stateNode.containerInfo);break;case 10:Yi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,dp(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return rs(t),t.flags|=128,null;r=io(e,t,a,!1);var i=t.child.childLanes;return r||(a&i)!==0?C1(e,t,a):(rs(t),e=yi(e,t,a),e!==null?e.sibling:null)}rs(t);break;case 19:if(t.flags&128)return Cp(e,t,a);if(i=(e.flags&128)!==0,r=(a&t.childLanes)!==0,r||(io(e,t,a,!1),r=(a&t.childLanes)!==0),i){if(r)return Cp(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),$n(t,Zt.current),r)break;return null;case 22:return t.lanes=0,y1(e,t,a,t.pendingProps);case 24:Yi(t,gt,e.memoizedState.cache)}return yi(e,t,a)}function L1(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)_t=!0;else{if(!Mg(e,a)&&(t.flags&128)===0)return _t=!1,A2(e,t,a);_t=(e.flags&131072)!==0}else _t=!1,ge&&(t.flags&1048576)!==0&&RC(t,Fn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Xs(t.elementType),t.type=e,typeof e=="function")ug(e)?(r=uo(e,r),t.tag=1,t=Gy(null,t,e,r,a)):(t.tag=0,t=_p(null,t,e,r,a));else{if(e!=null){var i=e.$$typeof;if(i===jp){t.tag=11,t=Fy(null,t,e,r,a);break e}else if(i===Zp){t.tag=14,t=qy(null,t,e,r,a);break e}else if(i===Ur){t.tag=10,t.type=e,t=jy(null,t,a);break e}}throw t=Gm(e)||e,Error(D(306,t,""))}}return t;case 0:return _p(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,i=uo(r,t.pendingProps),Gy(e,t,r,i,a);case 3:e:{if(Ld(t,t.stateNode.containerInfo),e===null)throw Error(D(387));r=t.pendingProps;var s=t.memoizedState;i=s.element,np(e,t),Dn(t,r,null,a);var o=t.memoizedState;if(r=o.cache,Yi(t,gt,r),r!==s.cache&&op(t,[gt],a,!0),kn(),r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=Ky(e,t,r,a);break e}else if(r!==i){i=dr(Error(D(424)),t),qn(i),t=Ky(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,$e=hr(e.firstChild),Nt=t,ge=!0,es=null,fr=!0,a=TC(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling;else{if(ro(),r===i){t=yi(e,t,a);break e}wt(e,t,r,a)}t=t.child}return t;case 26:return Zo(e,t),e===null?(a=x0(t.type,null,t.pendingProps,null))?t.memoizedState=a:ge||(t.stateNode=dL(t.type,t.pendingProps,Ji.current,t)):t.memoizedState=x0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Xm(t),e===null&&ge&&(r=t.stateNode=CL(t.type,t.pendingProps,Ji.current),Nt=t,fr=!0,i=$e,ps(t.type)?(Gp=i,$e=hr(r.firstChild)):$e=i),wt(e,t,t.pendingProps.children,a),Zo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ge&&((i=r=$e)&&(r=bD(r,t.type,t.pendingProps,fr),r!==null?(t.stateNode=r,Nt=t,$e=hr(r.firstChild),fr=!1,i=!0):i=!1),i||cs(t)),Xm(t),i=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,r=s.children,qp(i,s)?r=null:o!==null&&qp(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=vg(e,t,L2,null,null,a),Tl._currentValue=i),Zo(e,t),wt(e,t,r,a),t.child;case 6:return e===null&&ge&&((e=a=$e)&&(a=RD(a,t.pendingProps,fr),a!==null?(t.stateNode=a,Nt=t,$e=null,e=!0):e=!1),e||cs(t)),null;case 13:return C1(e,t,a);case 4:return Ld(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=lo(t,null,r,a):wt(e,t,r,a),t.child;case 11:return Fy(e,t,t.type,t.pendingProps,a);case 7:return r=t.pendingProps,Zo(e,t),wt(e,t,r,a),t.child;case 8:return wt(e,t,t.pendingProps.children,a),t.child;case 12:return wt(e,t,t.pendingProps.children,a),t.child;case 10:return jy(e,t,a);case 9:return i=t.type._context,r=t.pendingProps.children,so(t),i=Yt(i),r=r(i),t.flags|=1,wt(e,t,r,a),t.child;case 14:return qy(e,t,t.type,t.pendingProps,a);case 15:return S1(e,t,t.type,t.pendingProps,a);case 19:return Cp(e,t,a);case 31:return M2(e,t,a);case 22:return y1(e,t,a,t.pendingProps);case 24:return so(t),r=Yt(gt),e===null?(i=fg(),i===null&&(i=Ue,s=dg(),i.pooledCache=s,s.refCount++,s!==null&&(i.pooledCacheLanes|=a),i=s),t.memoizedState={parent:r,cache:i},mg(t),Yi(t,gt,i)):((e.lanes&a)!==0&&(np(e,t),Dn(t,null,null,a),kn()),i=e.memoizedState,s=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Yi(t,gt,r)):(r=s.cache,Yi(t,gt,r),r!==i.cache&&op(t,[gt],a,!0))),wt(e,t,t.pendingProps.children,a),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!=="auto"?t.flags|=e===null?18882560:18874368:ge&&rf(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Zo(e,t),wt(e,t,r.children,a),t.child;case 29:throw t.pendingProps}throw Error(D(156,t.tag))}function di(e){e.flags|=4}function Im(e,t,a,r,i){var s;if((s=(e.mode&32)!==0)&&(s=a===null?R0(t,r):R0(t,r)&&(r.src!==a.src||r.srcSet!==a.srcSet)),s){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Z1())e.flags|=8192;else throw to=Md,hg}else e.flags&=-16777217}function Zy(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!bL(t))if(Z1())e.flags|=8192;else throw to=Md,hg}function Xc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?K0():536870912,e.lanes|=t,Rl|=t)}function pn(e,t){if(!ge)switch(e.tailMode){case"visible":break;case"collapsed":for(var a=e.tail,r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null}}function Ve(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function B2(e,t,a){var r=t.pendingProps;switch(cg(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ve(t),null;case 1:return Ve(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),pi(gt),Ll(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Yo(t)?di(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Lm())),Ve(t),null;case 26:var i=t.type,s=t.memoizedState;return e===null?(di(t),s!==null?(Ve(t),Zy(t,s)):(Ve(t),Im(t,i,null,r,a))):s?s!==e.memoizedState?(di(t),Ve(t),Zy(t,s)):(Ve(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&di(t),Ve(t),Im(t,i,e,r,a)),null;case 27:if(xd(t),a=Ji.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&di(t);else{if(!r){if(t.stateNode===null)throw Error(D(166));return Ve(t),t.subtreeFlags&=-33554433,null}e=$r.current,Yo(t)?wy(t,e):(e=CL(i,r,a),t.stateNode=e,di(t))}return Ve(t),t.subtreeFlags&=-33554433,null;case 5:if(xd(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&di(t);else{if(!r){if(t.stateNode===null)throw Error(D(166));return Ve(t),t.subtreeFlags&=-33554433,null}if(s=$r.current,Yo(t))wy(t,s);else{var o=Xn(Ji.current);switch(s){case 1:s=o.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:s=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":s=o.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":s=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":s=o.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s=typeof r.is=="string"?o.createElement(i,{is:r.is}):o.createElement(i)}}s[Xt]=t,s[Ma]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)s.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=s;e:switch(Qt(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&di(t)}}return Ve(t),t.subtreeFlags&=-33554433,Im(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&di(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(D(166));if(e=Ji.current,Yo(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,i=Nt,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Xt]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||uL(e.nodeValue,a)),e||cs(t,!0)}else e=Xn(e).createTextNode(r),e[Xt]=t,t.stateNode=e}return Ve(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Yo(t),a!==null){if(e===null){if(!r)throw Error(D(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(557));e[Xt]=t}else ro(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),e=!1}else a=Lm(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Va(t),t):(Va(t),null);if((t.flags&128)!==0)throw Error(D(558))}return Ve(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Yo(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(D(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(D(317));i[Xt]=t}else ro(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),i=!1}else i=Lm(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Va(t),t):(Va(t),null)}return Va(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Xc(t,t.updateQueue),Ve(t),null);case 4:return Ll(),e===null&&Ug(t.stateNode.containerInfo),t.flags|=67108864,Ve(t),null;case 10:return pi(t.type),Ve(t),null;case 19:if(gg(t),r=t.memoizedState,r===null)return Ve(t),null;if(i=(t.flags&128)!==0,s=r.rendering,s===null)if(i)pn(r,!1);else{if(lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Ad(e),s!==null){for(t.flags|=128,pn(r,!1),e=s.updateQueue,t.updateQueue=e,Xc(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)wC(a,e),a=a.sibling;return $n(t,Zt.current&1|2),ge&&fi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ga()>Vd&&(t.flags|=128,i=!0,pn(r,!1),t.lanes=4194304)}else{if(!i)if(e=Ad(s),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Xc(t,e),pn(r,!0),r.tail===null&&r.tailMode!=="collapsed"&&r.tailMode!=="visible"&&!s.alternate&&!ge)return Ve(t),null}else 2*Ga()-r.renderingStartTime>Vd&&a!==536870912&&(t.flags|=128,i=!0,pn(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(e=r.last,e!==null?e.sibling=s:t.child=s,r.last=s)}if(r.tail!==null){e=r.tail;e:{for(a=e;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ga(),e.sibling=null,s=Zt.current,s=i?s&1|2:s&1,r.tailMode==="visible"||r.tailMode==="collapsed"||!a||ge?$n(t,s):(a=s,We(Jt,t),We(Zt,a),oa===null&&(oa=t)),ge&&fi(t,r.treeForkCount),e}return Ve(t),null;case 22:case 23:return Va(t),pg(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(Ve(t),t.subtreeFlags&6&&(t.flags|=8192)):Ve(t),a=t.updateQueue,a!==null&&Xc(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&jt(eo),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),pi(gt),Ve(t),null;case 25:return null;case 30:return t.flags|=33554432,Ve(t),null}throw Error(D(156,t.tag))}function O2(e,t){switch(cg(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pi(gt),Ll(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xd(t),null;case 31:if(t.memoizedState!==null){if(Va(t),t.alternate===null)throw Error(D(340));ro()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Va(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));ro()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return gg(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ll(),null;case 10:return pi(t.type),null;case 22:case 23:return Va(t),pg(),e!==null&&jt(eo),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return pi(gt),null;case 25:return null;default:return null}}function x1(e,t){switch(cg(t),t.tag){case 3:pi(gt),Ll();break;case 26:case 27:case 5:xd(t);break;case 4:Ll();break;case 31:t.memoizedState!==null&&Va(t);break;case 13:Va(t);break;case 19:gg(t);break;case 10:pi(t.type);break;case 22:case 23:Va(t),pg(),e!==null&&jt(eo);break;case 24:pi(gt)}}function lu(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var i=r.next;a=i;do{if((a.tag&e)===e){r=void 0;var s=a.create,o=a.inst;r=s(),o.destroy=r}a=a.next}while(a!==i)}}catch(l){Pe(t,t.return,l)}}function fs(e,t,a){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var s=i.next;r=s;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,i=t;var n=a,u=l;try{u()}catch(c){Pe(i,n,c)}}}r=r.next}while(r!==s)}}catch(c){Pe(t,t.return,c)}}function w1(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{BC(t,a)}catch(r){Pe(e,e.return,r)}}}function b1(e,t,a){a.props=uo(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Pe(e,t,r)}}function Hr(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,s=_i(e.memoizedProps,i);(i.ref===null||i.ref.name!==s)&&(i.ref=pL(s)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Za(e);Da(e.child,!1,xD,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(l){Pe(e,t,l)}}function Kt(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(i){Pe(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){Pe(e,t,i)}else a.current=null}function Hd(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var a=0;a<t.length;a++)SL(e.stateNode,t[a])}function Qy(e){for(var t=e.return;t!==null&&(Ag(t)&&SL(e.stateNode,t.stateNode),!Tg(t));)t=t.return}function An(e){for(var t=e.return;t!==null&&(Ag(t)&&wD(e.stateNode,t.stateNode),!Tg(t));)t=t.return}function Tg(e){return e.tag===5||e.tag===3||e.tag===27}function Ag(e){return e&&e.tag===7&&e.stateNode!==null}function Lp(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(i){Pe(e,e.return,i)}}function Em(e,t,a){try{var r=e.stateNode;sD(r,e.type,a,t),r[Ma]=t}catch(i){Pe(e,e.return,i)}}function R1(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ps(e.type)||e.tag===4}function km(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||R1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ps(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function xp(e,t,a,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(i,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(i),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Fr)),Hd(e,r),Ee=!0;else if(i!==4&&(i===27&&(Hd(e,r),r=null,ps(e.type)&&(a=e.stateNode,t=null)),e=e.child,e!==null))for(xp(e,t,a,r),e=e.sibling;e!==null;)xp(e,t,a,r),e=e.sibling}function zd(e,t,a,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?a.insertBefore(i,t):a.appendChild(i),Hd(e,r),Ee=!0;else if(i!==4&&(i===27&&(Hd(e,r),r=null,ps(e.type)&&(a=e.stateNode)),e=e.child,e!==null))for(zd(e,t,a,r),e=e.sibling;e!==null;)zd(e,t,a,r),e=e.sibling}function I1(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Qt(t,r,a),t[Xt]=e,t[Ma]=a}catch(s){Pe(e,e.return,s)}}var Ud=!1,$a=null;function Jy(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Ud=!0)}var zr=null;function e0(){var e=zr;return zr=null,e}var Ia=0;function Hl(e,t,a,r,i){return Ia=0,E1(e.child,t,a,r,i)}function E1(e,t,a,r,i){for(var s=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var l=Vp(o);r.push(l),l.view&&(s=!0)}else s||Vp(o).view&&(s=!0);Ud=!0,fL(o,Ia===0?t:t+"_"+Ia,a),Ia++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||E1(e.child,t,a,r,i)&&(s=!0));e=e.sibling}return s}function Gr(e,t){for(;e!==null;)e.tag===5?hL(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Gr(e.child,t)),e=e.sibling}function fd(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(fd(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(D(544));var a=t.name;t=xi(t.default,t.share),t!=="none"&&(Hl(e,a,t,null,!1)||Gr(e.child,!1))}e=e.sibling}}function wp(e,t){if(e.tag===30){var a=e.stateNode,r=e.memoizedProps,i=_i(r,a),s=xi(r.default,a.paired?r.share:r.enter);s!=="none"?Hl(e,i,s,null,!1)?(fd(e),a.paired||t||Il(e,r.onEnter)):Gr(e.child,!1):fd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)wp(e,t),e=e.sibling;else fd(e)}function bp(e){if($a!==null&&$a.size!==0){var t=$a;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var a=e.memoizedProps,r=a.name;if(r!=null&&r!=="auto"){var i=t.get(r);if(i!==void 0){var s=xi(a.default,a.share);if(s!=="none"&&(Hl(e,r,s,null,!1)?(s=e.stateNode,i.paired=s,s.paired=i,Il(e,a.onShare)):Gr(e.child,!1)),t.delete(r),t.size===0)break}}}bp(e)}e=e.sibling}}}function Rp(e){if(e.tag===30){var t=e.memoizedProps,a=_i(t,e.stateNode),r=$a!==null?$a.get(a):void 0,i=xi(t.default,r!==void 0?t.share:t.exit);i!=="none"&&(Hl(e,a,i,null,!1)?r!==void 0?(i=e.stateNode,r.paired=i,i.paired=r,$a.delete(a),Il(e,t.onShare)):Il(e,t.onExit):Gr(e.child,!1)),$a!==null&&bp(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Rp(e),e=e.sibling;else $a!==null&&bp(e)}function k1(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,a=_i(t,e.stateNode);t=xi(t.default,t.update),e.flags&=-5,t!=="none"&&Hl(e,a,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&k1(e);e=e.sibling}}function Ip(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,Gr(e.child,!1))}Ip(e)}e=e.sibling}}function hd(e){if(e.tag===30)e.stateNode.paired=null,Gr(e.child,!1),Ip(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)hd(e),e=e.sibling;else Ip(e)}function D1(e){for(e=e.child;e!==null;)e.tag===30?Gr(e.child,!1):(e.subtreeFlags&33554432)!==0&&D1(e),e=e.sibling}function Bg(e,t,a,r,i,s,o){for(var l=!1;t!==null;){if(t.tag===5){var n=t.stateNode;if(s!==null&&Ia<s.length){var u=s[Ia],c=Vp(n);(u.view||c.view)&&(l=!0);var d;if(d=(e.flags&4)===0)if(c.clip)d=!0;else{d=u.rect;var f=c.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}d&&(e.flags|=4),c.abs?c=!u.abs:(u=u.rect,c=c.rect,c=u.height!==c.height||u.width!==c.width),c&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&fL(n,Ia===0?a:a+"_"+Ia,i),l&&(e.flags&4)!==0||(zr===null&&(zr=[]),zr.push(n,Ia===0?r:r+"_"+Ia,t.memoizedProps)),Ia++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Bg(e,t.child,a,r,i,s,o)&&(l=!0));t=t.sibling}return l}function M1(e,t){for(e=e.child;e!==null;){if(e.tag===30){var a=e.memoizedProps,r=e.stateNode,i=_i(a,r),s=xi(a.default,a.update);if(t){r=r.clones;var o=r===null?null:r.map(dD)}else o=e.memoizedState,e.memoizedState=null;r=e;var l=e.child;Ia=0,i=Bg(r,l,i,i,s,o,!1),(e.flags&4)!==0&&i&&(t||Il(e,a.onUpdate))}else(e.subtreeFlags&33554432)!==0&&M1(e,t);e=e.sibling}}var Bt=!1,Ae=!1,Or=!1,Dm=!1,t0=typeof WeakSet=="function"?WeakSet:Set,Ot=null,Pr=!1,xn=!1,Fd=!1,Ep=!1;function P2(e,t,a){if(e=e.containerInfo,Up=Al,e=gC(e),og(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var s=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var l=0,n=-1,u=-1,c=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==r||s!==0&&f.nodeType!==3||(n=l+s),f!==o||i!==0&&f.nodeType!==3||(u=l+i),f.nodeType===3&&(l+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===r&&++c===s&&(n=l),h===o&&++d===i&&(u=l),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}r=n===-1||u===-1?null:{start:n,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Fp={focusedElem:e,selectionRange:r},Al=!1,a=(a&335544064)===a,Ot=t,t=a?9270:1024;Ot!==null;){if(e=Ot,a&&(r=e.deletions,r!==null))for(s=0;s<r.length;s++)a&&Rp(r[s]);if(e.alternate===null&&(e.flags&2)!==0)a&&Jy(e),Yc(a);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&a&&Rp(r),Yc(a);continue}else if(r!==null&&r.memoizedState!==null){a&&Jy(e),Yc(a);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,Ot=r):(a&&k1(e),Yc(a))}}$a=null}function Yc(e){for(;Ot!==null;){var t=Ot,a=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((i&1024)!==0&&r!==null){a=void 0,i=r.memoizedProps,r=r.memoizedState;var s=t.stateNode;try{var o=uo(t.type,i);a=s.getSnapshotBeforeUpdate(o,r),s.__reactInternalSnapshotBeforeUpdate=a}catch(l){Pe(t,t.return,l)}}break;case 3:if((i&1024)!==0){if(r=t.stateNode.containerInfo,a=r.nodeType,a===9)$p(r);else if(a===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":$p(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&r!==null&&(a=_i(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=xi(i.default,i.update),i!=="none"&&Hl(r,a,i,r.memoizedState=[],!0));break;default:if((i&1024)!==0)throw Error(D(163))}if(r=t.sibling,r!==null){r.return=t.return,Ot=r;break}Ot=t.return}}function T1(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Nr(e,a),r&4&&lu(5,a);break;case 1:if(Nr(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){Pe(a,a.return,o)}else{var i=uo(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Pe(a,a.return,o)}}r&64&&w1(a),r&512&&Hr(a,a.return);break;case 3:if(Nr(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{BC(e,t)}catch(o){Pe(a,a.return,o)}}break;case 27:t===null&&r&4&&I1(a);case 26:case 5:Nr(e,a),t===null&&r&4&&Lp(a),r&512&&Hr(a,a.return);break;case 12:Nr(e,a);break;case 31:Nr(e,a),r&4&&P1(e,a);break;case 13:Nr(e,a),r&4&&N1(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=X2.bind(null,a),ID(e,a))));break;case 22:if(r=a.memoizedState!==null||Bt,!r){var s=t!==null&&t.memoizedState!==null||Ae;t=Bt,i=Ae,Bt=r,(Ae=s)&&!i?(r=2,(a.subtreeFlags&8772)!==0&&(r|=1),br(e,a,r)):Nr(e,a),Bt=t,Ae=i}break;case 30:Nr(e,a),r&512&&Hr(a,a.return);break;case 7:r&512&&Hr(a,a.return);default:Nr(e,a)}}function kp(e,t){for(e=e.child;e!==null;)A1(e,t),e=e.sibling}function A1(e,t){switch(e.tag){case 5:case 26:try{var a=e.stateNode;if(t){var r=a.style;typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none"}else{var i=e.stateNode,s=e.memoizedProps.style,o=s!=null&&s.hasOwnProperty("display")?s.display:null;i.style.display=o==null||typeof o=="boolean"?"":(""+o).trim()}}catch(n){Pe(e,e.return,n)}Dp(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Ee=!0}catch(n){Pe(e,e.return,n)}break;case 18:try{var l=e.stateNode;t?_0(l,!0):_0(e.stateNode,!1)}catch(n){Pe(e,e.return,n)}break;case 22:case 23:e.memoizedState===null&&kp(e,t);break;default:kp(e,t)}}function Dp(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var a=e,r=t;switch(a.tag){case 4:A1(a,r);break e;case 22:a.memoizedState===null&&Dp(a,r);break e;default:Dp(a,r)}}e=e.sibling}}function B1(e){var t=e.alternate;t!==null&&(e.alternate=null,B1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Zd(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ze=null,ba=!1;function wr(e,t,a){for(a=a.child;a!==null;)O1(e,t,a),a=a.sibling}function O1(e,t,a){if(Ka&&typeof Ka.onCommitFiberUnmount=="function")try{Ka.onCommitFiberUnmount(eu,a)}catch{}switch(a.tag){case 26:Ae||Kt(a,t),wr(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!Ae&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ae||Kt(a,t),An(a);var r=Ze,i=ba;ps(a.type)&&(Ze=a.stateNode,ba=!1),wr(e,t,a),LL(a.stateNode,a.type,a.memoizedProps),Ze=r,ba=i;break;case 5:Ae||Kt(a,t),An(a);case 6:if(a.tag===6&&An(a),r=Ze,i=ba,Ze=null,wr(e,t,a),Ze=r,ba=i,Ze!==null)if(ba)try{(Ze.nodeType===9?Ze.body:Ze.nodeName==="HTML"?Ze.ownerDocument.body:Ze).removeChild(a.stateNode),Ee=!0}catch(s){Pe(a,t,s)}else try{Ze.removeChild(a.stateNode),Ee=!0}catch(s){Pe(a,t,s)}break;case 18:Ze!==null&&(ba?(e=Ze,g0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Bl(e)):g0(Ze,a.stateNode));break;case 4:r=Ze,i=ba,Ze=a.stateNode.containerInfo,ba=!0,wr(e,t,a),Ze=r,ba=i;break;case 0:case 11:case 14:case 15:fs(2,a,t),Ae||fs(4,a,t),wr(e,t,a);break;case 1:Ae||(Kt(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&b1(a,t,r)),wr(e,t,a);break;case 21:wr(e,t,a);break;case 22:Ae=(r=Ae)||a.memoizedState!==null,wr(e,t,a),Ae=r;break;case 30:Kt(a,t),wr(e,t,a);break;case 7:Ae||Kt(a,t),wr(e,t,a);break;default:wr(e,t,a)}}function P1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Bl(e)}catch(a){Pe(t,t.return,a)}}}function N1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Bl(e)}catch(a){Pe(t,t.return,a)}}function N2(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new t0),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new t0),t;default:throw Error(D(435,e.tag))}}function jc(e,t){var a=N2(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var i=Y2.bind(null,e,r);r.then(i,i)}})}function fa(e,t,a){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var s=r[i],o=e,l=t,n=l;e:for(;n!==null;){switch(n.tag){case 27:if(ps(n.type)){Ze=n.stateNode,ba=!1;break e}break;case 5:Ze=n.stateNode,ba=!1;break e;case 3:case 4:Ze=n.stateNode.containerInfo,ba=!0;break e}n=n.return}if(Ze===null)throw Error(D(160));O1(o,l,s),Ze=null,ba=!1,o=s.alternate,o!==null&&(o.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)H1(t,e,a),t=t.sibling}var Rr=null;function H1(e,t,a){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r!==null?r.events:null,r!==null))for(var s=0;s<r.length;s++){var o=r[s];o.ref.impl=o.nextImpl}fa(t,e,a),ha(e),i&4&&(fs(3,e,e.return),lu(3,e),fs(5,e,e.return));break;case 1:fa(t,e,a),ha(e),i&512&&(Ae||r===null||Kt(r,r.return)),i&64&&Bt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?t:a.concat(t))));break;case 26:if(s=Rr,fa(t,e,a),ha(e),i&512&&(Ae||r===null||Kt(r,r.return)),i&4)if(i=r!==null?r.memoizedState:null,a=e.memoizedState,r===null)if(a===null)if(e.stateNode===null)if(Bt)e.stateNode=dL(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,a=e.memoizedProps,i=s.ownerDocument||s;t:switch(t){case"title":r=i.getElementsByTagName("title")[0],(!r||r[ru]||r[Xt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector("head > title"))),Qt(r,t,a),r[Xt]=e,Pt(r),t=r;break e;case"link":if(s=b0("link","href",i).get(t+(a.href||""))){for(o=0;o<s.length;o++)if(r=s[o],r.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&r.getAttribute("rel")===(a.rel==null?null:a.rel)&&r.getAttribute("title")===(a.title==null?null:a.title)&&r.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){s.splice(o,1);break t}}r=i.createElement(t),Qt(r,t,a),i.head.appendChild(r);break;case"meta":if(s=b0("meta","content",i).get(t+(a.content||""))){for(o=0;o<s.length;o++)if(r=s[o],r.getAttribute("content")===(a.content==null?null:""+a.content)&&r.getAttribute("name")===(a.name==null?null:a.name)&&r.getAttribute("property")===(a.property==null?null:a.property)&&r.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&r.getAttribute("charset")===(a.charSet==null?null:a.charSet)){s.splice(o,1);break t}}r=i.createElement(t),Qt(r,t,a),i.head.appendChild(r);break;default:throw Error(D(468,t))}r[Xt]=e,Pt(r),t=r}e.stateNode=t}else Bt||Kp(s,e.type,e.stateNode);else e.stateNode=w0(s,a,e.memoizedProps);else i!==a?(i===null?(t=r.stateNode,t===null||Ae||t.parentNode.removeChild(t)):i.count--,a===null?Bt||Kp(s,e.type,e.stateNode):w0(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Em(e,e.memoizedProps,r.memoizedProps);break;case 27:fa(t,e,a),ha(e),i&512&&(Ae||r===null||Kt(r,r.return)),r!==null&&i&4&&Em(e,e.memoizedProps,r.memoizedProps);break;case 5:if(s=Or,Or=!1,fa(t,e,a),Or=s,ha(e),i&512&&(Ae||r===null||Kt(r,r.return)),e.flags&32){t=e.stateNode;try{wl(t,""),Ee=!0}catch(c){Pe(e,e.return,c)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Em(e,t,r!==null?r.memoizedProps:t)),i&1024&&(Dm=!0);break;case 6:if(fa(t,e,a),ha(e),i&4){if(e.stateNode===null)throw Error(D(162));t=e.memoizedProps,a=e.stateNode;try{a.nodeValue=t,Ee=!0}catch(c){Pe(e,e.return,c)}}break;case 3:if(Ee=!1,_d=null,s=Rr,Rr=Yn(t.containerInfo),fa(t,e,a),Rr=s,ha(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Bl(t.containerInfo)}catch(c){Pe(e,e.return,c)}Dm&&(Dm=!1,z1(e)),Ee=!1;break;case 4:i=Or,Or=Bt,r=ly(),s=Rr,Rr=Yn(e.stateNode.containerInfo),fa(t,e,a),ha(e),Rr=s,Ee&&xn&&(Fd=!0),Ee=r,Or=i;break;case 12:fa(t,e,a),ha(e);break;case 31:fa(t,e,a),ha(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,jc(e,t)));break;case 13:fa(t,e,a),ha(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(df=Ga()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,jc(e,t)));break;case 22:s=e.memoizedState!==null,o=r!==null&&r.memoizedState!==null;var l=Bt,n=Ae,u=Or;Bt=l||s,Or=u||s,Ae=n||o,fa(t,e,a),Ae=n,Or=u,Bt=l,ha(e),i&8192&&(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,!s||r===null||o||Bt||Ae||(t=o||Ae,a=Bt,r=Ae,Bt=s||Bt,Ae=t,Vi(e,2),Bt=a,Ae=r),!s&&Or||kp(e,s)),i&4&&(t=e.updateQueue,t!==null&&(a=t.retryQueue,a!==null&&(t.retryQueue=null,jc(e,a))));break;case 19:fa(t,e,a),ha(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,jc(e,t)));break;case 30:i&512&&(Ae||r===null||Kt(r,r.return)),i=ly(),s=xn,o=(a&335544064)===a,l=e.memoizedProps,xn=o&&xi(l.default,l.update)!=="none",fa(t,e,a),ha(e),o&&r!==null&&Ee&&(e.flags|=4),xn=s,Ee=i;break;case 21:break;case 7:i&512&&(Ae||r===null||Kt(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:fa(t,e,a),ha(e)}}function ha(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(R1(r)){a=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Ag(i)){var s=i.stateNode;r===null?r=[s]:r.push(s)}if(Tg(i))break;i=i.return}var o=r;if(a==null)throw Error(D(160));switch(a.tag){case 27:var l=a.stateNode,n=km(e);zd(e,n,l,o);break;case 5:var u=a.stateNode;a.flags&32&&(wl(u,""),a.flags&=-33);var c=km(e);zd(e,c,u,o);break;case 3:case 4:var d=a.stateNode.containerInfo,f=km(e);xp(e,f,d,o);break;default:throw Error(D(161))}}catch(h){Pe(e,e.return,h)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function z1(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;z1(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Al=!0,t.reset(),Al=!1),e=e.sibling}}function jo(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)U1(t,e),t=t.sibling;else M1(t,!1)}function U1(e,t){var a=e.alternate;if(a===null)wp(e,!1);else switch(e.tag){case 3:if(Ep=Pr=!1,e0(),jo(t,e),!Pr&&!Fd){if(e=zr,e!==null)for(var r=0;r<e.length;r+=3){a=e[r];var i=e[r+1];hL(a,e[r+2]),a=a.ownerDocument.documentElement,a!==null&&a.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+i+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Ep=!0}zr=null;break;case 5:jo(t,e);break;case 4:r=Pr,Pr=!1,jo(t,e),Pr&&(Fd=!0),Pr=r;break;case 22:e.memoizedState===null&&(a.memoizedState!==null?wp(e,!1):jo(t,e));break;case 30:r=Pr,i=e0(),Pr=!1,jo(t,e),Pr&&(e.flags|=4);var s=e.memoizedProps,o=e.stateNode;t=_i(s,o),o=_i(a.memoizedProps,o);var l=xi(s.default,s.update);l==="none"?t=!1:(s=a.memoizedState,a.memoizedState=null,a=e.child,Ia=0,t=Bg(e,a,t,o,l,s,!0),Ia!==(s===null?0:s.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Il(e,e.memoizedProps.onUpdate),zr=i):i!==null&&(i.push.apply(i,zr),zr=i),Pr=(e.flags&32)!==0?!0:r;break;default:jo(t,e)}}function Nr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)T1(e,t.alternate,t),t=t.sibling}function Vi(e,t){for(e=e.child;e!==null;){var a=e,r=t;switch(a.tag){case 0:case 11:case 14:case 15:fs(4,a,a.return),Vi(a,r);break;case 1:Kt(a,a.return);var i=a.stateNode;typeof i.componentWillUnmount=="function"&&b1(a,a.return,i),Vi(a,r);break;case 27:(r&2)!==0&&LL(a.stateNode,a.type,a.memoizedProps);case 5:Kt(a,a.return),a.tag!==5&&a.tag!==27||An(a),Vi(a,r);break;case 6:An(a);break;case 26:Kt(a,a.return),i=a.stateNode,a.memoizedState!==null||i===null||Ae||i.parentNode.removeChild(i),Vi(a,r);break;case 22:a.memoizedState===null&&Vi(a,r);break;case 30:Kt(a,a.return),Vi(a,r);break;case 7:Kt(a,a.return);default:Vi(a,r)}e=e.sibling}}function br(e,t,a){for(a=(t.subtreeFlags&8772)!==0?a:a&-2,t=t.child;t!==null;){var r=t.alternate,i=e,s=t,o=s.flags,l=(a&1)!==0;switch(s.tag){case 0:case 11:case 15:br(i,s,a),lu(4,s);break;case 1:if(br(i,s,a),r=s,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(c){Pe(r,r.return,c)}if(r=s,i=r.updateQueue,i!==null){var n=r.stateNode;try{var u=i.shared.hiddenCallbacks;if(u!==null)for(i.shared.hiddenCallbacks=null,i=0;i<u.length;i++)AC(u[i],n)}catch(c){Pe(r,r.return,c)}}l&&o&64&&w1(s),Hr(s,s.return);break;case 27:(a&2)!==0&&I1(s);case 5:s.tag!==5&&s.tag!==27||Qy(s),br(i,s,a),l&&r===null&&o&4&&Lp(s),Hr(s,s.return);break;case 6:Qy(s);break;case 26:n=s.stateNode,s.memoizedState!==null||n===null||Bt||Kp(Yn(n.ownerDocument),s.type,n),br(i,s,a),l&&r===null&&o&4&&Lp(s),Hr(s,s.return);break;case 12:br(i,s,a);break;case 31:br(i,s,a),l&&o&4&&P1(i,s);break;case 13:br(i,s,a),l&&o&4&&N1(i,s);break;case 22:s.memoizedState===null&&br(i,s,a),Hr(s,s.return);break;case 30:br(i,s,a),Hr(s,s.return);break;case 7:Hr(s,s.return);default:br(i,s,a)}t=t.sibling}}function Og(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&su(a))}function Pg(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&su(e))}function or(e,t,a,r){var i=(a&335544064)===a;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)F1(e,t,a,r),t=t.sibling;else i&&D1(t)}function F1(e,t,a,r){var i=(a&335544064)===a;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&hd(t);var s=t.flags;switch(t.tag){case 0:case 11:case 15:or(e,t,a,r),s&2048&&lu(9,t);break;case 1:or(e,t,a,r);break;case 3:or(e,t,a,r),i&&Ep&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),s&2048&&(s=null,t.alternate!==null&&(s=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==s&&(t.refCount++,s!=null&&su(s)));break;case 12:if(s&2048){or(e,t,a,r),s=t.stateNode;try{var o=t.memoizedProps,l=o.id,n=o.onPostCommit;typeof n=="function"&&n(l,t.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(u){Pe(t,t.return,u)}}else or(e,t,a,r);break;case 31:or(e,t,a,r);break;case 13:or(e,t,a,r);break;case 23:break;case 22:o=t.stateNode,l=t.alternate,t.memoizedState!==null?(i&&l!==null&&l.memoizedState===null&&hd(l),o._visibility&2?or(e,t,a,r):Bn(e,t)):(i&&l!==null&&l.memoizedState!==null&&hd(t),o._visibility&2?or(e,t,a,r):(o._visibility|=2,Qo(e,t,a,r,(t.subtreeFlags&10256)!==0||!1))),s&2048&&Og(l,t);break;case 24:or(e,t,a,r),s&2048&&Pg(t.alternate,t);break;case 30:i&&(s=t.alternate,s!==null&&(Gr(s.child,!0),Gr(t.child,!0))),or(e,t,a,r);break;default:or(e,t,a,r)}}function Qo(e,t,a,r,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,o=t,l=a,n=r,u=o.flags;switch(o.tag){case 0:case 11:case 15:Qo(s,o,l,n,i),lu(8,o);break;case 23:break;case 22:var c=o.stateNode;o.memoizedState!==null?c._visibility&2?Qo(s,o,l,n,i):Bn(s,o):(c._visibility|=2,Qo(s,o,l,n,i)),i&&u&2048&&Og(o.alternate,o);break;case 24:Qo(s,o,l,n,i),i&&u&2048&&Pg(o.alternate,o);break;default:Qo(s,o,l,n,i)}t=t.sibling}}function Bn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,i=r.flags;switch(r.tag){case 22:Bn(a,r),i&2048&&Og(r.alternate,r);break;case 24:Bn(a,r),i&2048&&Pg(r.alternate,r);break;default:Bn(a,r)}t=t.sibling}}var Ys=8192;function Gs(e,t,a){if(e.subtreeFlags&Ys)for(e=e.child;e!==null;)q1(e,t,a),e=e.sibling}function q1(e,t,a){switch(e.tag){case 26:Gs(e,t,a),e.flags&Ys&&(e.memoizedState!==null?FD(a,Rr,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&I0(a,e)));break;case 5:Gs(e,t,a),e.flags&Ys&&(e=e.stateNode,(t&335544128)===t&&I0(a,e));break;case 3:case 4:var r=Rr;Rr=Yn(e.stateNode.containerInfo),Gs(e,t,a),Rr=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ys,Ys=16777216,Gs(e,t,a),Ys=r):Gs(e,t,a));break;case 30:if((e.flags&Ys)!==0&&(r=e.memoizedProps.name,r!=null&&r!=="auto")){var i=e.stateNode;i.paired=null,$a===null&&($a=new Map),$a.set(r,i)}Gs(e,t,a);break;default:Gs(e,t,a)}}function V1(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function gn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];Ot=r,W1(r,e)}V1(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$1(e),e=e.sibling}function $1(e){switch(e.tag){case 0:case 11:case 15:gn(e),e.flags&2048&&fs(9,e,e.return);break;case 3:gn(e);break;case 12:gn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,md(e)):gn(e);break;default:gn(e)}}function md(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];Ot=r,W1(r,e)}V1(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:fs(8,t,t.return),md(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,md(t));break;default:md(t)}e=e.sibling}}function W1(e,t){for(;Ot!==null;){var a=Ot;switch(a.tag){case 0:case 11:case 15:fs(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:su(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,Ot=r;else e:for(a=e;Ot!==null;){r=Ot;var i=r.sibling,s=r.return;if(B1(r),r===a){Ot=null;break e}if(i!==null){i.return=s,Ot=i;break e}Ot=s}}}var H2={getCacheForType:function(e){var t=Yt(gt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Yt(gt).controller.signal}},z2=typeof WeakMap=="function"?WeakMap:Map,Me=0,Ue=null,Se=null,Ce=0,Be=0,Fa=null,ji=!1,zl=!1,Ng=!1,Ci=0,lt=0,hs=0,ao=0,qd=0,Wa=0,Rl=0,On=null,Ra=null,Mp=!1,df=0,G1=0,Vd=1/0,$d=null,ss=null,Qe=0,Er=null,co=null,Wr=0,Tp=0,Ap=null,K1=null,Sl=null,yl=null,Cl=null,Pn=0,pd=null;function Ya(){return(Me&2)!==0&&Ce!==0?Ce&-Ce:ce.T!==null?zg():Z0()}function X1(){if(Wa===0)if((Ce&536870912)===0||ge){var e=Nc;Nc<<=1,(Nc&3932160)===0&&(Nc=262144),Wa=e}else Wa=536870912;return e=Jt.current,e!==null&&(e.flags|=32),Wa}function Il(e,t){if(t!=null){var a=e.stateNode,r=a.ref;r===null&&(r=a.ref=pL(_i(e.memoizedProps,a))),yl===null&&(yl=[]),yl.push(t.bind(null,r))}}function ka(e,t,a){(e===Ue&&(Be===2||Be===9)||e.cancelPendingCommit!==null)&&(El(e,0),Zi(e,Ce,Wa,!1)),au(e,a),((Me&2)===0||e!==Ue)&&(e===Ue&&((Me&2)===0&&(ao|=a),lt===4&&Zi(e,Ce,Wa,!1)),Xr(e))}function Y1(e,t,a){if((Me&6)!==0)throw Error(D(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||tu(e,t),i=r?q2(e,t):Mm(e,t,!0),s=r;do{if(i===0){zl&&!r&&Zi(e,t,0,!1);break}else{if(a=e.current.alternate,s&&!U2(a)){i=Mm(e,t,!1),s=!1;continue}if(i===2){if(s=t,e.errorRecoveryDisabledLanes&s)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;i=On;var n=l.current.memoizedState.isDehydrated;if(n&&(El(l,o).flags|=256),o=Mm(l,o,!1),o!==2&&o!==6){if(Ng&&!n){l.errorRecoveryDisabledLanes|=s,ao|=s,i=4;break e}s=Ra,Ra=i,s!==null&&(Ra===null?Ra=s:Ra.push.apply(Ra,s))}i=o}if(s=!1,i!==2)continue}}if(i===1){El(e,0),Zi(e,t,0,!0);break}e:{switch(r=e,s=i,s){case 0:case 1:throw Error(D(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Zi(r,t,Wa,!ji);break e;case 2:Ra=null;break;case 3:case 5:break;default:throw Error(D(329))}if((t&62914560)===t&&(i=df+300-Ga(),10<i)){if(Zi(r,t,Wa,!ji),jd(r,0,!0)!==0)break e;Wr=t,r.timeoutHandle=Fg(a0.bind(null,r,a,Ra,$d,Mp,t,Wa,ao,Rl,ji,s,"Throttled",-0,0),i);break e}a0(r,a,Ra,$d,Mp,t,Wa,ao,Rl,ji,s,null,-0,0)}}break}while(!0);Xr(e)}function a0(e,t,a,r,i,s,o,l,n,u,c,d,f,h){e.timeoutHandle=-1;var m=t.subtreeFlags,_=(s&335544064)===s;if(d=null,(_||m&8192||(m&16785408)===16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Fr},$a=null,q1(t,s,d),_&&(m=d,_=e.containerInfo,_=(_.nodeType===9?_:_.ownerDocument).__reactViewTransition,_!=null&&(m.count++,m.waitingForViewTransition=!0,m=jn.bind(m),_.finished.then(m,m))),m=(s&62914560)===s?df-Ga():(s&4194048)===s?G1-Ga():0,m=qD(d,m),m!==null)){Wr=s,e.cancelPendingCommit=m(i0.bind(null,e,t,s,a,r,i,o,l,n,u,c,d,null,f,h)),Zi(e,s,o,!u);return}i0(e,t,s,a,r,i,o,l,n,u,c,d)}function U2(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var i=a[r],s=i.getSnapshot;i=i.value;try{if(!ja(s(),i))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Zi(e,t,a,r){t=G0(e,t),t&=~qd,t&=~ao,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var s=31-Xa(i),o=1<<s;r[s]=-1,i&=~o}a!==0&&X0(e,a,t)}function ff(){return(Me&6)===0?(nu(0,!1),!1):!0}function Hg(){if(Se!==null){if(Be===0)var e=Se.return;else e=Se,hi=go=null,Cg(e),gl=null,Vn=0,e=Se;for(;e!==null;)x1(e.alternate,e),e=e.return;Se=null}}function El(e,t){var a=e.timeoutHandle;return a!==-1&&(e.timeoutHandle=-1,nD(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Wr=0,Hg(),Ue=e,Se=a=mi(e.current,null),Ce=t,Be=0,Fa=null,ji=!1,zl=tu(e,t),Ng=!1,Rl=Wa=qd=ao=hs=lt=0,Ra=On=null,Mp=!1,Ci=G0(e,t),tf(),a}function j1(e,t){he=null,ce.H=Pd,t===Nl||t===sf?(t=ky(),Be=3):t===hg?(t=ky(),Be=4):Be=t===kg?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Fa=t,Se===null&&(lt=1,Nd(e,dr(t,e.current)))}function Z1(){var e=Jt.current;return e===null?!0:(Ce&4194048)===Ce?oa===null:(Ce&62914560)===Ce||(Ce&536870912)!==0?e===oa:!1}function Q1(){var e=ce.H;return ce.H=Pd,e===null?Pd:e}function J1(){var e=ce.A;return ce.A=H2,e}function Wd(){lt=4,ji||(Ce&4194048)!==Ce&&Jt.current!==null||(zl=!0),(hs&134217727)===0&&(ao&134217727)===0||Ue===null||Zi(Ue,Ce,Wa,!1)}function Mm(e,t,a){var r=Me;Me|=2;var i=Q1(),s=J1();(Ue!==e||Ce!==t)&&($d=null,El(e,t)),t=!1;var o=lt;e:do try{if(Be!==0&&Se!==null){var l=Se,n=Fa;switch(Be){case 8:Hg(),o=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(t=!0);var u=Be;if(Be=0,Fa=null,dl(e,l,n,u),a&&zl){o=0;break e}break;default:u=Be,Be=0,Fa=null,dl(e,l,n,u)}}F2(),o=lt;break}catch(c){j1(e,c)}while(!0);return t&&e.shellSuspendCounter++,hi=go=null,Me=r,ce.H=i,ce.A=s,Se===null&&(Ue=null,Ce=0,tf()),o}function F2(){for(;Se!==null;)eL(Se)}function q2(e,t){var a=Me;Me|=2;var r=Q1(),i=J1();Ue!==e||Ce!==t?($d=null,Vd=Ga()+500,El(e,t)):zl=tu(e,t);e:do try{if(Be!==0&&Se!==null){t=Se;var s=Fa;t:switch(Be){case 1:Be=0,Fa=null,dl(e,t,s,1);break;case 2:case 9:if(Ey(s)){Be=0,Fa=null,r0(t);break}t=function(){Be!==2&&Be!==9||Ue!==e||(Be=7),Xr(e)},s.then(t,t);break e;case 3:Be=7;break e;case 4:Be=5;break e;case 7:Ey(s)?(Be=0,Fa=null,r0(t)):(Be=0,Fa=null,dl(e,t,s,7));break;case 5:var o=null;switch(Se.tag){case 26:o=Se.memoizedState;case 5:case 27:var l=Se;if(o?bL(o):l.stateNode.complete){Be=0,Fa=null;var n=l.sibling;if(n!==null)Se=n;else{var u=l.return;u!==null?(Se=u,hf(u)):Se=null}break t}}Be=0,Fa=null,dl(e,t,s,5);break;case 6:Be=0,Fa=null,dl(e,t,s,6);break;case 8:Hg(),lt=6;break e;default:throw Error(D(462))}}V2();break}catch(c){j1(e,c)}while(!0);return hi=go=null,ce.H=r,ce.A=i,Me=a,Se!==null?0:(Ue=null,Ce=0,tf(),lt)}function V2(){for(;Se!==null&&!ok();)eL(Se)}function eL(e){var t=L1(e.alternate,e,Ci);e.memoizedProps=e.pendingProps,t===null?hf(e):Se=t}function r0(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Wy(a,t,t.pendingProps,t.type,void 0,Ce);break;case 11:t=Wy(a,t,t.pendingProps,t.type.render,t.ref,Ce);break;case 5:Cg(t);var r=t;r===Nt&&(ge?(kd(r),r.tag===5&&r.stateNode!=null&&($e=r.stateNode)):(kd(r),ge=!0));default:x1(a,t),t=Se=wC(t,Ci),t=L1(a,t,Ci)}e.memoizedProps=e.pendingProps,t===null?hf(e):Se=t}function dl(e,t,a,r){hi=go=null,Cg(t),gl=null,Vn=0;var i=t.return;try{if(D2(e,i,t,a,Ce)){lt=1,Nd(e,dr(a,e.current)),Se=null;return}}catch(s){if(i!==null)throw Se=i,s;lt=1,Nd(e,dr(a,e.current)),Se=null;return}t.flags&32768?(ge||r===1?e=!0:zl||(Ce&536870912)!==0?e=!1:(ji=e=!0,(r===2||r===9||r===3||r===6)&&(r=Jt.current,r!==null&&r.tag===13&&(r.flags|=16384))),tL(t,e)):hf(t)}function hf(e){var t=e;do{if((t.flags&32768)!==0){tL(t,ji);return}e=t.return;var a=B2(t.alternate,t,Ci);if(a!==null){Se=a;return}if(t=t.sibling,t!==null){Se=t;return}Se=t=e}while(t!==null);lt===0&&(lt=5)}function tL(e,t){do{var a=O2(e.alternate,e);if(a!==null){a.flags&=32767,Se=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Se=e;return}Se=e=a}while(e!==null);lt=6,Se=null}function i0(e,t,a,r,i,s,o,l,n,u,c,d){e.cancelPendingCommit=null;do mf();while(Qe!==0);if((Me&6)!==0)throw Error(D(327));if(t!==null){if(t===e.current)throw Error(D(177));e===Ue&&(Se=Ue=null,Ce=0),co=t,Er=e,Wr=a,Ap=i,K1=r,$2(e,t,a,o,l,n,d)}}function $2(e,t,a,r,i,s,o){var l=t.lanes|t.childLanes;if(Tp=l,l|=lg,gk(e,a,l,r,i,s),yl=null,(a&335544064)===a?(Cl=v2(e),r=10262):(Cl=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,j2(wd,function(){return Np(),null})):(e.callbackNode=null,e.callbackPriority=0),Ud=!1,r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=ce.T,ce.T=null,i=Te.p,Te.p=2,s=Me,Me|=4;try{P2(e,t,a)}finally{Me=s,Te.p=i,ce.T=r}}Qe=1,Ud?Sl=mD(o,e.containerInfo,Cl,Bp,Op,G2,Pp,Np,W2,null,null):(Bp(),Op(),Pp())}function W2(e){if(Qe!==0){var t=Er.onRecoverableError;t(e,{componentStack:null})}}function G2(){Qe===3&&(Qe=0,U1(co,Er),Qe=4)}function Bp(){if(Qe===1){Qe=0;var e=Er,t=co,a=Wr,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=ce.T,ce.T=null;var i=Te.p;Te.p=2;var s=Me;Me|=4;try{xn=Fd=!1,H1(t,e,a),a=Fp;var o=gC(e.containerInfo),l=a.focusedElem,n=a.selectionRange;if(o!==l&&l&&l.ownerDocument&&pC(l.ownerDocument.documentElement,l)){if(n!==null&&og(l)){var u=n.start,c=n.end;if(c===void 0&&(c=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(c,l.value.length);else{var d=l.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var h=f.getSelection(),m=l.textContent.length,_=Math.min(n.start,m),y=n.end===void 0?_:Math.min(n.end,m);!h.extend&&_>y&&(o=y,y=_,_=o);var p=yy(l,_),g=yy(l,y);if(p&&g&&(h.rangeCount!==1||h.anchorNode!==p.node||h.anchorOffset!==p.offset||h.focusNode!==g.node||h.focusOffset!==g.offset)){var v=d.createRange();v.setStart(p.node,p.offset),h.removeAllRanges(),_>y?(h.addRange(v),h.extend(g.node,g.offset)):(v.setEnd(g.node,g.offset),h.addRange(v))}}}}for(d=[],h=l;h=h.parentNode;)h.nodeType===1&&d.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<d.length;l++){var C=d[l];C.element.scrollLeft=C.left,C.element.scrollTop=C.top}}Al=!!Up,Fp=Up=null}finally{Me=s,Te.p=i,ce.T=r}}e.current=t,Qe=2}}function Op(){if(Qe===2){Qe=0;var e=Er,t=co,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=ce.T,ce.T=null;var r=Te.p;Te.p=2;var i=Me;Me|=4;try{T1(e,t.alternate,t)}finally{Me=i,Te.p=r,ce.T=a}}Qe=3}}function Pp(){if(Qe===4||Qe===3){Qe=0;var e=Sl;Sl=null,lk();var t=Er,a=co,r=Wr,i=K1,s=(r&335544064)===r?10262:10256;if((a.subtreeFlags&s)!==0||(a.flags&s)!==0?Qe=5:(Qe=0,co=Er=null,aL(t,t.pendingLanes)),s=t.pendingLanes,s===0&&(ss=null),eg(r),a=a.stateNode,Ka&&typeof Ka.onCommitFiberRoot=="function")try{Ka.onCommitFiberRoot(eu,a,void 0,(a.current.flags&128)===128)}catch{}if(i!==null){a=ce.T,s=Te.p,Te.p=2,ce.T=null;try{for(var o=t.onRecoverableError,l=0;l<i.length;l++){var n=i[l];o(n.value,{componentStack:n.stack})}}finally{ce.T=a,Te.p=s}}if(i=yl,o=Cl,Cl=null,i!==null&&(yl=null,o===null&&(o=[]),e!==null))for(n=0;n<i.length;n++)a=(0,i[n])(o),a!==void 0&&e.finished.finally(a);(Wr&3)!==0&&mf(),Xr(t),s=t.pendingLanes,(r&261930)!==0&&(s&42)!==0?t===pd?Pn++:(Pn=0,pd=t):(Pn=0,pd=null),nu(0,!1)}}function aL(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,su(t)))}function mf(){return Sl!==null&&(Sl.skipTransition(),Sl=null),Bp(),Op(),Pp(),Np()}function Np(){if(Qe!==5)return!1;var e=Er,t=Tp;Tp=0;var a=eg(Wr),r=ce.T,i=Te.p;try{Te.p=32>a?32:a,ce.T=null,a=Ap,Ap=null;var s=Er,o=Wr;if(Qe=0,co=Er=null,Wr=0,(Me&6)!==0)throw Error(D(331));var l=Me;if(Me|=4,$1(s.current),F1(s,s.current,o,a),Me=l,nu(0,!1),Ka&&typeof Ka.onPostCommitFiberRoot=="function")try{Ka.onPostCommitFiberRoot(eu,s)}catch{}return!0}finally{Te.p=i,ce.T=r,aL(e,t)}}function s0(e,t,a){t=dr(a,t),t=gp(e.stateNode,t,2),e=as(e,t,2),e!==null&&(au(e,2),Xr(e))}function Pe(e,t,a){if(e.tag===3)s0(e,e,a);else for(;t!==null;){if(t.tag===3){s0(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ss===null||!ss.has(r))){e=dr(a,e),a=_1(2),r=as(t,a,2),r!==null&&(v1(a,r,t,e),au(r,2),Xr(r));break}}t=t.return}}function Tm(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new z2;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(a)||(Ng=!0,i.add(a),e=K2.bind(null,e,t,a),t.then(e,e))}function K2(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ue===e&&(Ce&a)===a&&((lt===4||lt===3&&(Ce&62914560)===Ce&&300>Ga()-df)&&(Me&2)===0?El(e,0):qd|=a,Rl===Ce&&(Rl=0)),Xr(e)}function rL(e,t){t===0&&(t=K0()),e=po(e,t),e!==null&&(au(e,t),Xr(e))}function X2(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),rL(e,a)}function Y2(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(D(314))}r!==null&&r.delete(t),rL(e,a)}function j2(e,t){return Qp(e,t)}var kl=null,Jo=null,Hp=!1,Gd=!1,Am=!1,Qi=0;function Xr(e){e!==Jo&&e.next===null&&(Jo===null?kl=Jo=e:Jo=Jo.next=e),Gd=!0,Hp||(Hp=!0,Q2())}function nu(e,t){if(!Am&&Gd){Am=!0;do for(var a=!1,r=kl;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var s=0;else{var o=r.suspendedLanes,l=r.pingedLanes;s=(1<<31-Xa(42|e)+1)-1,s&=i&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(a=!0,o0(r,s))}else s=Ce,s=jd(r,r===Ue?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(s&3)===0||tu(r,s)||(a=!0,o0(r,s));r=r.next}while(a);Am=!1}}function Z2(){iL()}function iL(){Gd=Hp=!1;var e=0;Qi!==0&&lD()&&(e=Qi);for(var t=Ga(),a=null,r=kl;r!==null;){var i=r.next,s=sL(r,t);s===0?(r.next=null,a===null?kl=i:a.next=i,i===null&&(Jo=a)):(a=r,(e!==0||(s&3)!==0)&&(Gd=!0)),r=i}Qe!==0&&Qe!==5||nu(e,!1),Qi!==0&&(Qi=0)}function sL(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var o=31-Xa(s),l=1<<o,n=i[o];n===-1?((l&a)===0||(l&r)!==0)&&(i[o]=pk(l,t)):n<=t&&(e.expiredLanes|=l),s&=~l}if(t=Ue,a=Ce,a=jd(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Be===2||Be===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&dm(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||tu(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&dm(r),eg(a)){case 2:case 8:a=$0;break;case 32:a=wd;break;case 268435456:a=W0;break;default:a=wd}return r=oL.bind(null,e),a=Qp(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&dm(r),e.callbackPriority=2,e.callbackNode=null,2}function oL(e,t){if(Qe!==0&&Qe!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(mf()&&e.callbackNode!==a)return null;var r=Ce;return r=jd(e,e===Ue?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Y1(e,r,t),sL(e,Ga()),e.callbackNode!=null&&e.callbackNode===a?oL.bind(null,e):null)}function o0(e,t){if(mf())return null;Y1(e,t,!0)}function Q2(){uD(function(){(Me&6)!==0?Qp(V0,Z2):iL()})}function zg(){if(Qi===0){var e=oo;e===0&&(e=Pc,Pc<<=1,(Pc&261888)===0&&(Pc=256)),Qi=e}return Qi}function l0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:rd(e)}function J2(e,t,a,r,i){if(t==="submit"&&a&&a.stateNode===i){var s=l0((i[Ma]||null).action),o=r.submitter;o&&(t=(t=o[Ma]||null)?l0(t.formAction):o.getAttribute("formAction"),t!==null&&(s=t,o=null));var l=new Qd("action","action",null,r,i);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Qi!==0){var n=new FormData(i,o);mp(a,{pending:!0,data:n,method:i.method,action:s},null,n)}}else typeof s=="function"&&(l.preventDefault(),n=new FormData(i,o),mp(a,{pending:!0,data:n,method:i.method,action:s},s,n))},currentTarget:i}]})}}for(Zc=0;Zc<rp.length;Zc++)Qc=rp[Zc],n0=Qc.toLowerCase(),u0=Qc[0].toUpperCase()+Qc.slice(1),kr(n0,"on"+u0);var Qc,n0,u0,Zc;kr(vC,"onAnimationEnd");kr(SC,"onAnimationIteration");kr(yC,"onAnimationStart");kr("dblclick","onDoubleClick");kr("focusin","onFocus");kr("focusout","onBlur");kr(c2,"onTransitionRun");kr(d2,"onTransitionStart");kr(f2,"onTransitionCancel");kr(CC,"onTransitionEnd");xl("onMouseEnter",["mouseout","mouseover"]);xl("onMouseLeave",["mouseout","mouseover"]);xl("onPointerEnter",["pointerout","pointerover"]);xl("onPointerLeave",["pointerout","pointerover"]);ho("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ho("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ho("onBeforeInput",["compositionend","keypress","textInput","paste"]);ho("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ho("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ho("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gn="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(" "),eD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Gn));function lL(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],n=l.instance,u=l.currentTarget;if(l=l.listener,n!==s&&i.isPropagationStopped())break e;s=l,i.currentTarget=u;try{s(i)}catch(c){Rd(c)}i.currentTarget=null,s=n}else for(o=0;o<r.length;o++){if(l=r[o],n=l.instance,u=l.currentTarget,l=l.listener,n!==s&&i.isPropagationStopped())break e;s=l,i.currentTarget=u;try{s(i)}catch(c){Rd(c)}i.currentTarget=null,s=n}}}}function ve(e,t){var a=t[ry];a===void 0&&(a=t[ry]=new Set);var r=e+"__bubble";a.has(r)||(nL(t,e,2,!1),a.add(r))}function Bm(e,t,a){var r=0;t&&(r|=4),nL(a,e,r,t)}var Jc="_reactListening"+Math.random().toString(36).slice(2);function Ug(e){if(!e[Jc]){e[Jc]=!0,J0.forEach(function(a){a!=="selectionchange"&&(eD.has(a)||Bm(a,!1,e),Bm(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jc]||(t[Jc]=!0,Bm("selectionchange",!1,t))}}function nL(e,t,a,r){switch(TL(t)){case 2:var i=GD;break;case 8:i=KD;break;default:i=Kg}a=i.bind(null,t,a,e),i=void 0,!Jm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function Om(e,t,a,r,i){var s=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===i)break;if(o===4)for(o=r.return;o!==null;){var n=o.tag;if((n===3||n===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;l!==null;){if(o=js(l),o===null)return;if(n=o.tag,n===5||n===6||n===26||n===27){r=s=o;continue e}l=l.parentNode}}r=r.return}lC(function(){var u=s,c=ag(a),d=[];e:{var f=LC.get(e);if(f!==void 0){var h=Qd,m=e;switch(e){case"keypress":if(sd(a)===0)break e;case"keydown":case"keyup":h=Uk;break;case"focusin":m="focus",h=_m;break;case"focusout":m="blur",h=_m;break;case"beforeblur":case"afterblur":h=_m;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=dy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=Ek;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Wk;break;case vC:case SC:case yC:h=Mk;break;case CC:h=Kk;break;case"scroll":case"scrollend":h=Rk;break;case"wheel":h=Yk;break;case"copy":case"cut":case"paste":h=Ak;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=hy;break;case"submit":h=Vk;break;case"toggle":case"beforetoggle":h=Zk}var _=(t&4)!==0,y=!_&&(e==="scroll"||e==="scrollend"),p=_?f!==null?f+"Capture":null:f;_=[];for(var g=u,v;g!==null;){var C=g;if(v=C.stateNode,C=C.tag,C!==5&&C!==26&&C!==27||v===null||p===null||(C=Hn(g,p),C!=null&&_.push(Kn(g,C,v))),y)break;g=g.return}0<_.length&&(f=new h(f,m,null,a,c),d.push({event:f,listeners:_}))}}if((t&7)===0){e:{if(h=e==="mouseover"||e==="pointerover",f=e==="mouseout"||e==="pointerout",h&&a!==Qm&&(m=a.relatedTarget||a.fromElement)&&(js(m)||m[Ol]))break e;(f||h)&&(m=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,f?(h=a.relatedTarget||a.toElement,f=u,h=h?js(h):null,h!==null&&(y=Jn(h),_=h.tag,h!==y||_!==5&&_!==27&&_!==6)&&(h=null)):(f=null,h=u),f!==h&&(_=dy,C="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(_=hy,C="onPointerLeave",p="onPointerEnter",g="pointer"),y=f==null?m:Cn(f),v=h==null?m:Cn(h),m=new _(C,g+"leave",f,a,c),m.target=y,m.relatedTarget=v,C=null,js(c)===u&&(_=new _(p,g+"enter",h,a,c),_.target=v,_.relatedTarget=y,C=_),y=C,_=f&&h?Um(f,h,tD):null,f!==null&&c0(d,m,f,_,!1),h!==null&&y!==null&&c0(d,y,h,_,!0)))}e:{if(f=u?Cn(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var x=_y;else if(gy(f))if(hC)x=l2;else{x=s2;var k=i2}else h=f.nodeName,!h||h.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?u&&tg(u.elementType)&&(x=_y):x=o2;if(x&&(x=x(e,u))){fC(d,x,a,c);break e}k&&k(e,f,u)}switch(k=u?Cn(u):window,e){case"focusin":(gy(k)||k.contentEditable==="true")&&(sl=k,tp=u,Rn=null);break;case"focusout":Rn=tp=sl=null;break;case"mousedown":ap=!0;break;case"contextmenu":case"mouseup":case"dragend":ap=!1,Cy(d,a,c);break;case"selectionchange":if(u2)break;case"keydown":case"keyup":Cy(d,a,c)}var T;if(sg)e:{switch(e){case"compositionstart":var U="onCompositionStart";break e;case"compositionend":U="onCompositionEnd";break e;case"compositionupdate":U="onCompositionUpdate";break e}U=void 0}else il?cC(e,a)&&(U="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(U="onCompositionStart");U&&(uC&&a.locale!=="ko"&&(il||U!=="onCompositionStart"?U==="onCompositionEnd"&&il&&(T=nC()):(Xi=c,rg="value"in Xi?Xi.value:Xi.textContent,il=!0)),k=Kd(u,U),0<k.length&&(U=new fy(U,e,null,a,c),d.push({event:U,listeners:k}),T?U.data=T:(T=dC(a),T!==null&&(U.data=T)))),(T=Jk?e2(e,a):t2(e,a))&&(U=Kd(u,"onBeforeInput"),0<U.length&&(k=new fy("onBeforeInput","beforeinput",null,a,c),d.push({event:k,listeners:U}),k.data=T)),J2(d,e,u,a,c)}lL(d,t)})}function Kn(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Kd(e,t){for(var a=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||s===null||(i=Hn(e,a),i!=null&&r.unshift(Kn(e,i,s)),i=Hn(e,t),i!=null&&r.push(Kn(e,i,s))),e.tag===3)return r;e=e.return}return[]}function tD(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function c0(e,t,a,r,i){for(var s=t._reactName,o=[];a!==null&&a!==r;){var l=a,n=l.alternate,u=l.stateNode;if(l=l.tag,n!==null&&n===r)break;l!==5&&l!==26&&l!==27||u===null||(n=u,i?(u=Hn(a,s),u!=null&&o.unshift(Kn(a,u,n))):i||(u=Hn(a,s),u!=null&&o.push(Kn(a,u,n)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var aD=/\r\n?/g,rD=/\u0000|\uFFFD/g;function d0(e){return(typeof e=="string"?e:""+e).replace(aD,`
9
+ `).replace(rD,"")}function uL(e,t){return t=d0(t),d0(e)===t}function Oe(e,t,a,r,i,s){switch(a){case"children":if(typeof r=="string")t==="body"||t==="textarea"&&r===""||wl(e,r);else if(typeof r=="number"||typeof r=="bigint")t!=="body"&&wl(e,""+r);else return;break;case"className":zc(e,"class",r);break;case"tabIndex":zc(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":zc(e,a,r);break;case"style":oC(e,r,s);return;case"data":if(t!=="object"){zc(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=rd(r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"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 s=="function"&&(a==="formAction"?(t!=="input"&&Oe(e,t,"name",i.name,i,null),Oe(e,t,"formEncType",i.formEncType,i,null),Oe(e,t,"formMethod",i.formMethod,i,null),Oe(e,t,"formTarget",i.formTarget,i,null)):(Oe(e,t,"encType",i.encType,i,null),Oe(e,t,"method",i.method,i,null),Oe(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=rd(r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=Fr);return;case"onScroll":r!=null&&ve("scroll",e);return;case"onScrollEnd":r!=null&&ve("scrollend",e);return;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(D(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(D(60));s?.__html!==a&&(e.innerHTML=a)}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=rd(r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":ve("beforetoggle",e),ve("toggle",e),ad(e,"popover",r);break;case"xlinkActuate":ci(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":ci(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":ci(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":ci(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":ci(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":ci(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":ci(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":ci(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":ci(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":ad(e,"is",r);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=wk.get(a)||a,ad(e,a,r);else return}Ee=!0}function zp(e,t,a,r,i,s){switch(a){case"style":oC(e,r,s);return;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(D(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(D(60));s?.__html!==a&&(e.innerHTML=a)}}break;case"children":if(typeof r=="string")wl(e,r);else if(typeof r=="number"||typeof r=="bigint")wl(e,""+r);else return;break;case"onScroll":r!=null&&ve("scroll",e);return;case"onScrollEnd":r!=null&&ve("scrollend",e);return;case"onClick":r!=null&&(e.onclick=Fr);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!eC.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),s=a.slice(2,i?a.length-7:void 0),t=e[Ma]||null,t=t!=null?t[a]:null,typeof t=="function"&&e.removeEventListener(s,t,i),typeof r=="function")){typeof t!="function"&&t!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(s,r,i);break e}Ee=!0,a in e?e[a]=r:r===!0?e.setAttribute(a,""):ad(e,a,r)}return}Ee=!0}function Qt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var r=!1,i=!1,s;for(s in a)if(a.hasOwnProperty(s)){var o=a[s];if(o!=null)switch(s){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(D(137,t));default:Oe(e,t,s,o,a,null)}}i&&Oe(e,t,"srcSet",a.srcSet,a,null),r&&Oe(e,t,"src",a.src,a,null);return;case"input":ve("invalid",e);var l=s=o=i=null,n=null,u=null;for(r in a)if(a.hasOwnProperty(r)){var c=a[r];if(c!=null)switch(r){case"name":i=c;break;case"type":o=c;break;case"checked":n=c;break;case"defaultChecked":u=c;break;case"value":s=c;break;case"defaultValue":l=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(D(137,t));break;default:Oe(e,t,r,c,a,null)}}rC(e,s,l,n,u,o,i,!1);return;case"select":ve("invalid",e),r=o=s=null;for(i in a)if(a.hasOwnProperty(i)&&(l=a[i],l!=null))switch(i){case"value":s=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:Oe(e,t,i,l,a,null)}t=s,a=o,e.multiple=!!r,t!=null?hl(e,!!r,t,!1):a!=null&&hl(e,!!r,a,!0);return;case"textarea":ve("invalid",e),s=i=r=null;for(o in a)if(a.hasOwnProperty(o)&&(l=a[o],l!=null))switch(o){case"value":r=l;break;case"defaultValue":i=l;break;case"children":s=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(D(91));break;default:Oe(e,t,o,l,a,null)}sC(e,r,i,s);return;case"option":for(n in a)a.hasOwnProperty(n)&&(r=a[n],r!=null)&&(n==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Oe(e,t,n,r,a,null));return;case"dialog":ve("beforetoggle",e),ve("toggle",e),ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(r=0;r<Gn.length;r++)ve(Gn[r],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in a)if(a.hasOwnProperty(u)&&(r=a[u],r!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(D(137,t));default:Oe(e,t,u,r,a,null)}return;default:if(tg(t)){for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!==void 0&&zp(e,t,c,r,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null&&Oe(e,t,l,r,a,null))}var iD={};function sD(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,o=null,l=null,n=null,u=null,c=null;for(h in a){var d=a[h];if(a.hasOwnProperty(h)&&d!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":n=d;default:r.hasOwnProperty(h)||Oe(e,t,h,null,r,d)}}for(var f in r){var h=r[f];if(d=a[f],r.hasOwnProperty(f)&&(h!=null||d!=null))switch(f){case"type":h!==d&&(Ee=!0),s=h;break;case"name":h!==d&&(Ee=!0),i=h;break;case"checked":h!==d&&(Ee=!0),u=h;break;case"defaultChecked":h!==d&&(Ee=!0),c=h;break;case"value":h!==d&&(Ee=!0),o=h;break;case"defaultValue":h!==d&&(Ee=!0),l=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(D(137,t));break;default:h!==d&&Oe(e,t,f,h,r,d)}}Zm(e,o,l,n,u,c,s,i);return;case"select":h=o=l=f=null;for(s in a)if(n=a[s],a.hasOwnProperty(s)&&n!=null)switch(s){case"value":break;case"multiple":h=n;default:r.hasOwnProperty(s)||Oe(e,t,s,null,r,n)}for(i in r)if(s=r[i],n=a[i],r.hasOwnProperty(i)&&(s!=null||n!=null))switch(i){case"value":s!==n&&(Ee=!0),f=s;break;case"defaultValue":s!==n&&(Ee=!0),l=s;break;case"multiple":s!==n&&(Ee=!0),o=s;default:s!==n&&Oe(e,t,i,s,r,n)}t=l,a=o,r=h,f!=null?hl(e,!!a,f,!1):!!r!=!!a&&(t!=null?hl(e,!!a,t,!0):hl(e,!!a,a?[]:"",!1));return;case"textarea":h=f=null;for(l in a)if(i=a[l],a.hasOwnProperty(l)&&i!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Oe(e,t,l,null,r,i)}for(o in r)if(i=r[o],s=a[o],r.hasOwnProperty(o)&&(i!=null||s!=null))switch(o){case"value":i!==s&&(Ee=!0),f=i;break;case"defaultValue":i!==s&&(Ee=!0),h=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(D(91));break;default:i!==s&&Oe(e,t,o,i,r,s)}iC(e,f,h);return;case"option":for(var m in a)f=a[m],a.hasOwnProperty(m)&&f!=null&&!r.hasOwnProperty(m)&&(m==="selected"?e.selected=!1:Oe(e,t,m,null,r,f));for(n in r)f=r[n],h=a[n],r.hasOwnProperty(n)&&f!==h&&(f!=null||h!=null)&&(n==="selected"?(f!==h&&(Ee=!0),e.selected=f&&typeof f!="function"&&typeof f!="symbol"):Oe(e,t,n,f,r,h));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 _ in a)f=a[_],a.hasOwnProperty(_)&&f!=null&&!r.hasOwnProperty(_)&&Oe(e,t,_,null,r,f);for(u in r)if(f=r[u],h=a[u],r.hasOwnProperty(u)&&f!==h&&(f!=null||h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(D(137,t));break;default:Oe(e,t,u,f,r,h)}return;default:if(tg(t)){for(var y in a)f=a[y],a.hasOwnProperty(y)&&f!==void 0&&!r.hasOwnProperty(y)&&zp(e,t,y,void 0,r,f);for(c in r)f=r[c],h=a[c],!r.hasOwnProperty(c)||f===h||f===void 0&&h===void 0||zp(e,t,c,f,r,h);return}}for(var p in a)f=a[p],a.hasOwnProperty(p)&&f!=null&&!r.hasOwnProperty(p)&&Oe(e,t,p,null,r,f);for(d in r)f=r[d],h=a[d],!r.hasOwnProperty(d)||f===h||f==null&&h==null||Oe(e,t,d,f,r,h)}function f0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function oD(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var i=a[r],s=i.transferSize,o=i.initiatorType,l=i.duration;if(s&&l&&f0(o)){for(o=0,l=i.responseEnd,r+=1;r<a.length;r++){var n=a[r],u=n.startTime;if(u>l)break;var c=n.transferSize,d=n.initiatorType;c&&f0(d)&&(n=n.responseEnd,o+=c*(n<l?1:(l-u)/(n-u)))}if(--r,t+=8*(s+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Up=null,Fp=null;function Xn(e){return e.nodeType===9?e:e.ownerDocument}function h0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function cL(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function dL(e,t,a,r){return a=Xn(a).createElement(e),a[Xt]=r,a[Ma]=t,Qt(a,e,t),Pt(a),a}function qp(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pm=null;function lD(){var e=window.event;return e&&e.type==="popstate"?e===Pm?!1:(Pm=e,!0):(Pm=null,!1)}var Fg=typeof setTimeout=="function"?setTimeout:void 0,nD=typeof clearTimeout=="function"?clearTimeout:void 0,m0=typeof Promise=="function"?Promise:void 0,p0=typeof requestAnimationFrame=="function"?requestAnimationFrame:Fg,uD=typeof queueMicrotask=="function"?queueMicrotask:typeof m0<"u"?function(e){return m0.resolve(null).then(e).catch(cD)}:Fg;function cD(e){setTimeout(function(){throw e})}function ps(e){return e==="head"}function g0(e,t){var a=t,r=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(i),Bl(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")Hm(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Hm(a);for(var s=a.firstChild;s;){var o=s.nextSibling,l=s.nodeName;s[ru]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&s.rel.toLowerCase()==="stylesheet"||a.removeChild(s),s=o}}else a==="body"&&Hm(e.ownerDocument.body);a=i}while(a);Bl(t)}function _0(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function fL(e,t,a){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,a!=null&&(e.style.viewTransitionClass=a),a=getComputedStyle(e),a.display==="inline"){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var s=t[i];0<s.width&&0<s.height&&r++}r===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+a.paddingTop,e.marginBottom="-"+a.paddingBottom)}}function hL(e,t){e=e.style,t=t.style;var a=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=a==null||typeof a=="boolean"?"":(""+a).trim(),a=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=a==null||typeof a=="boolean"?"":(""+a).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(a=t.display,e.display=a==null||typeof a=="boolean"?"":a,a=t.margin,a!=null?e.margin=a:(a=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=a==null||typeof a=="boolean"?"":a,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function mL(e,t,a){return a=a.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=a.innerHeight&&e.left<=a.innerWidth}}function Vp(e){var t=e.getBoundingClientRect(),a=getComputedStyle(e);return mL(t,a,e)}function dD(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var a=getComputedStyle(e);return mL(t,a,e)}function fD(e){return e.documentElement.clientHeight}function hD(e){this.addEventListener("load",e),this.addEventListener("error",e)}function mD(e,t,a,r,i,s,o,l,n){var u=t.nodeType===9?t:t.ownerDocument;try{var c=u.startViewTransition({update:function(){var f=u.defaultView,h=f.navigation&&f.navigation.transition,m=u.fonts.status;r();var _=[];if(m==="loaded"&&(fD(u),u.fonts.status==="loading"&&_.push(u.fonts.ready)),m=_.length,e!==null)for(var y=e.suspenseyImages,p=0,g=0;g<y.length;g++){var v=y[g];if(!v.complete){var C=v.getBoundingClientRect();if(0<C.bottom&&0<C.right&&C.top<f.innerHeight&&C.left<f.innerWidth){if(p+=RL(v),p>vd){_.length=m;break}v=new Promise(hD.bind(v)),_.push(v)}}}if(0<_.length)return f=Promise.race([Promise.all(_),new Promise(function(x){return setTimeout(x,500)})]).then(i,i),(h?Promise.allSettled([h.finished,f]):f).then(s,s);if(i(),h)return h.finished.then(s,s);s()},types:a});u.__reactViewTransition=c;var d=[];return c.ready.then(function(){for(var f=u.documentElement.getAnimations({subtree:!0}),h=0;h<f.length;h++){var m=f[h],_=m.effect,y=_.pseudoElement;if(y!=null&&y.startsWith("::view-transition")){d.push(m),m=_.getKeyframes();for(var p=y=void 0,g=!0,v=0;v<m.length;v++){var C=m[v],x=C.width;if(y===void 0)y=x;else if(y!==x){g=!1;break}if(x=C.height,p===void 0)p=x;else if(p!==x){g=!1;break}delete C.width,delete C.height,C.transform==="none"&&delete C.transform}g&&y!==void 0&&p!==void 0&&(_.setKeyframes(m),g=getComputedStyle(_.target,_.pseudoElement),g.width!==y||g.height!==p)&&(g=m[0],g.width=y,g.height=p,g=m[m.length-1],g.width=y,g.height=p,_.setKeyframes(m))}}o()},function(f){u.__reactViewTransition===c&&(u.__reactViewTransition=null);try{typeof f=="object"&&f!==null&&f.name==="InvalidStateError"&&(f.message==="View transition was skipped because document visibility state is hidden."||f.message==="Skipping view transition because document visibility state has become hidden."||f.message==="Skipping view transition because viewport size changed."||f.message==="Transition was aborted because of invalid state")&&(f=null),f!==null&&n(f)}finally{r(),i(),o()}}),c.finished.finally(function(){for(var f=0;f<d.length;f++)d[f].cancel();u.__reactViewTransition===c&&(u.__reactViewTransition=null),l()}),c}catch{return r(),i(),o(),null}}function Zs(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Zs.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:Fe({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)};Zs.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,a=e.getAnimations({subtree:!0}),r=[],i=0;i<a.length;i++){var s=a[i].effect;s!==null&&s.target===e&&s.pseudoElement===t&&r.push(a[i])}return r};Zs.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function pL(e){return{name:e,group:new Zs("group",e),imagePair:new Zs("image-pair",e),old:new Zs("old",e),new:new Zs("new",e)}}function Za(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Za.prototype.addEventListener=function(e,t,a){var r=null,i=null;if(!(a!=null&&typeof a!="boolean"&&(r=a.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var s=this._eventListeners;if(gL(s,e,t,a)===-1){var o=this,l=t;a!=null&&typeof a!="boolean"&&a.once===!0&&(l=function(n){o.removeEventListener(e,t,a),typeof t=="function"?t.call(this,n):t.handleEvent(n)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,a),r.addEventListener("abort",i,{once:!0}),i=r.removeEventListener.bind(r,"abort",i)),r=Dl(a),s.push({type:e,listener:t,optionsOrUseCapture:a,attachedListener:l,cleanup:i}),Da(this._fragmentFiber.child,!1,pD,e,l,r)}this._eventListeners=s}};function pD(e,t,a,r){return bt(e).addEventListener(t,a,r),!1}Za.prototype.removeEventListener=function(e,t,a){var r=this._eventListeners;if(r!==null&&(t=gL(r,e,t,a),t!==-1)){var i=r[t];a=i.attachedListener;var s=i.cleanup;i=Dl(i.optionsOrUseCapture),Da(this._fragmentFiber.child,!1,gD,e,a,i),r.splice(t,1),s!==null&&s()}};function gD(e,t,a,r){return bt(e).removeEventListener(t,a,r),!1}function Dl(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function v0(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function gL(e,t,a,r){if(e.length===0)return-1;r=v0(r);for(var i=0;i<e.length;i++){var s=e[i];if(s.type===t&&s.listener===a&&v0(s.optionsOrUseCapture)===r)return i}return-1}Za.prototype.dispatchEvent=function(e){var t=fo(this._fragmentFiber);if(t===null)return!0;t=bt(t);var a=this._eventListeners;if(a!==null&&0<a.length||!e.bubbles){var r=t.nodeType===9?t.createComment(""):document.createTextNode("");if(a)for(var i=0;i<a.length;i++){var s=a[i];r.addEventListener(s.type,s.attachedListener,Dl(s.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),a)for(i=0;i<a.length;i++)s=a[i],r.removeEventListener(s.type,s.attachedListener,Dl(s.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)};Za.prototype.focus=function(e){Da(this._fragmentFiber.child,!0,_L,e,void 0,void 0)};function _L(e,t){return e.tag===6?!1:(e=bt(e),ED(e,t))}Za.prototype.focusLast=function(e){var t=[];Da(this._fragmentFiber.child,!0,qg,t,void 0,void 0);for(var a=t.length-1;0<=a&&!_L(t[a],e);a--);};function qg(e,t){return t.push(e),!1}Za.prototype.blur=function(){var e=fo(this._fragmentFiber);e!==null&&(e=bt(e),e=Xn(e).activeElement,e!==null&&Da(this._fragmentFiber.child,!1,_D,e,void 0,void 0))};function _D(e,t){return e.tag===6?!1:(e=bt(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Za.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),Da(this._fragmentFiber.child,!1,vD,e,void 0,void 0)};function vD(e,t){return e.tag===6||(e=bt(e),t.observe(e)),!1}Za.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),Da(this._fragmentFiber.child,!1,SD,e,void 0,void 0);for(var a=t=0;a<Ir.length;a++){var r=Ir[a];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Ir[t++]=r}Ir.length=t}};function SD(e,t){return e.tag===6||(e=bt(e),t.unobserve(e)),!1}var Ir=[],Nm=!1;function yD(e,t,a){Ir.push({fragmentInstance:e,observer:t,instance:a}),Nm||(Nm=!0,kD(function(){Nm=!1;var r=Ir;Ir=[];for(var i=0;i<r.length;i++){var s=r[i];s.observer.unobserve(s.instance)}}))}Za.prototype.getClientRects=function(){var e=[];return Da(this._fragmentFiber.child,!1,CD,e,void 0,void 0),e};function CD(e,t){if(e.tag===6){e=e.stateNode;var a=e.ownerDocument.createRange();a.selectNodeContents(e),t.push.apply(t,a.getClientRects())}else e=bt(e),t.push.apply(t,e.getClientRects());return!1}Za.prototype.getRootNode=function(e){var t=fo(this._fragmentFiber);return t===null?this:bt(t).getRootNode(e)};Za.prototype.compareDocumentPosition=function(e){var t=fo(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];Da(this._fragmentFiber.child,!1,qg,a,void 0,void 0);var r=bt(t);if(a.length===0){if(a=r,ZS(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(a=t)}t=this._fragmentFiber;var i=r=a.compareDocumentPosition(e);return a===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(a=z0(t)[1],a===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=bt(a).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=bt(a[0]),i=bt(a[a.length-1]);var s=ZS(this._fragmentFiber)?t.parentElement:r;if(s==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=s.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,s=s.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),l=i.compareDocumentPosition(e),n=o&Node.DOCUMENT_POSITION_CONTAINED_BY||l&Node.DOCUMENT_POSITION_CONTAINED_BY;return l=r&&s&&o&Node.DOCUMENT_POSITION_FOLLOWING&&l&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||s&&i===e||n||l?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!s&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||LD(t,this._fragmentFiber,a[0],a[a.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function LD(e,t,a,r,i){var s=js(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!s)e:{for(;s!==null;){if(s.tag===7&&(s===t||s.alternate===t)){a=!0;break e}s=s.return}a=!1}return a}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(s===null)return s=i.ownerDocument,i===s||i===s.documentElement||i===s.body;e:{for(s=t,t=fo(t);s!==null;){if(!(s.tag!==5&&s.tag!==3&&s.tag!==27||s!==t&&s.alternate!==t)){s=!0;break e}s=s.return}s=!1}return s}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!s)&&!(t=s===a)&&(t=Um(a,s,QS),t===null?t=!1:(Da(t,!0,QE,s,a),s=el,el=null,t=s!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!s)&&!(t=s===r)&&(t=Um(r,s,QS),t===null?t=!1:(Da(t,!0,JE,s,r),s=el,zm=el=null,t=s!==null)),t):!1}function S0(e,t){var a=e.ownerDocument.createRange();a.selectNodeContents(e),e=a.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Za.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(D(566));var t=[];Da(this._fragmentFiber.child,!1,qg,t,void 0,void 0);var a=e!==!1;if(t.length===0){var r=z0(this._fragmentFiber);if(r=a?r[1]||r[0]||fo(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=bt(r),S0(e,a);return}if(r=bt(r),r.nodeType!==9){if(r.nodeType===11){a="host"in r?r.host:null,a!==null&&a.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=a?t.length-1:0;r!==(a?-1:t.length);){var i=t[r];i.tag===6?(i=bt(i),S0(i,a)):bt(i).scrollIntoView(e),r+=a?-1:1}};function xD(e,t){return e=bt(e),vL(e,t),!1}function vL(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function SL(e,t){var a=t._eventListeners;if(a!==null)for(var r=0;r<a.length;r++){var i=a[r];e.addEventListener(i.type,i.attachedListener,Dl(i.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(s){for(var o=0,l=0;l<Ir.length;l++){var n=Ir[l];(n.fragmentInstance!==t||n.observer!==s||n.instance!==e)&&(Ir[o++]=n)}Ir.length=o,s.observe(e)}),vL(e,t))}function wD(e,t){var a=t._eventListeners;if(a!==null)for(var r=0;r<a.length;r++){var i=a[r];e.removeEventListener(i.type,i.attachedListener,Dl(i.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(s){typeof s.rootMargin=="string"?yD(t,s,e):s.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function $p(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":$p(a),Zd(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function bD(e,t,a,r){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[ru])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=hr(e.nextSibling),e===null)break}return null}function RD(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=hr(e.nextSibling),e===null))return null;return e}function yL(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=hr(e.nextSibling),e===null))return null;return e}function Wp(e){return e.data==="$?"||e.data==="$~"}function Vg(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ID(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function hr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Gp=null;function y0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return hr(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function C0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function ED(e,t){function a(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener("focus",a,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",a,!0)}return r}function kD(e){p0(function(){p0(function(t){return e(t)})})}function CL(e,t,a){switch(t=Xn(a),e){case"html":if(e=t.documentElement,!e)throw Error(D(452));return e;case"head":if(e=t.head,!e)throw Error(D(453));return e;case"body":if(e=t.body,!e)throw Error(D(454));return e;default:throw Error(D(451))}}function LL(e,t,a){for(var r in a){var i=a[r];a.hasOwnProperty(r)&&i!=null&&Oe(e,t,r,null,iD,i)}a.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Fr&&(e.onclick=null),Zd(e)}function Hm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Zd(e)}var mr=new Map,L0=new Set;function Yn(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var wi=Te.d;Te.d={f:DD,r:MD,D:TD,C:AD,L:BD,m:OD,X:ND,S:PD,M:HD};function DD(){var e=wi.f(),t=ff();return e||t}function MD(e){var t=Pl(e);t!==null&&t.tag===5&&t.type==="form"?o1(t):wi.r(e)}var Ul=typeof document>"u"?null:document;function xL(e,t,a){var r=Ul;if(r&&typeof t=="string"&&t){var i=cr(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),L0.has(i)||(L0.add(i),e={rel:e,crossOrigin:a,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),Qt(t,"link",e),Pt(t),r.head.appendChild(t)))}}function TD(e){wi.D(e),xL("dns-prefetch",e,null)}function AD(e,t){wi.C(e,t),xL("preconnect",e,t)}function BD(e,t,a){wi.L(e,t,a);var r=Ul;if(r&&e&&t){var i='link[rel="preload"][as="'+cr(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+cr(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+cr(a.imageSizes)+'"]')):i+='[href="'+cr(e)+'"]';var s=i;switch(t){case"style":s=Ml(e);break;case"script":s=Fl(e)}if(!(mr.has(s)||(e=Fe({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),mr.set(s,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(uu(s))||t==="script"&&r.querySelector(cu(s))))){var o=r.createElement("link");Qt(o,"link",e),t==="style"&&(o[bd]=!0,o.onload=o.onerror=function(){Q0(o)}),Pt(o),r.head.appendChild(o)}}}function OD(e,t){wi.m(e,t);var a=Ul;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+cr(r)+'"][href="'+cr(e)+'"]',s=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Fl(e)}if(!mr.has(s)&&(e=Fe({rel:"modulepreload",href:e},t),mr.set(s,e),a.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(cu(s)))return}r=a.createElement("link"),Qt(r,"link",e),Pt(r),a.head.appendChild(r)}}}function PD(e,t,a){wi.S(e,t,a);var r=Ul;if(r&&e){var i=fl(r).hoistableStyles,s=Ml(e);t=t||"default";var o=i.get(s);if(!o){var l={loading:0,preload:null};if(o=r.querySelector(uu(s)))l.loading=5;else{e=Fe({rel:"stylesheet",href:e,"data-precedence":t},a),(a=mr.get(s))&&$g(e,a);var n=o=r.createElement("link");Pt(n),Qt(n,"link",e),n._p=new Promise(function(u,c){n.onload=u,n.onerror=c}),n.addEventListener("load",function(){l.loading|=1}),n.addEventListener("error",function(){l.loading|=2}),l.loading|=4,gd(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},i.set(s,o)}}}function ND(e,t){wi.X(e,t);var a=Ul;if(a&&e){var r=fl(a).hoistableScripts,i=Fl(e),s=r.get(i);s||(s=a.querySelector(cu(i)),s||(e=Fe({src:e,async:!0},t),(t=mr.get(i))&&Wg(e,t),s=a.createElement("script"),Pt(s),Qt(s,"link",e),a.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},r.set(i,s))}}function HD(e,t){wi.M(e,t);var a=Ul;if(a&&e){var r=fl(a).hoistableScripts,i=Fl(e),s=r.get(i);s||(s=a.querySelector(cu(i)),s||(e=Fe({src:e,async:!0,type:"module"},t),(t=mr.get(i))&&Wg(e,t),s=a.createElement("script"),Pt(s),Qt(s,"link",e),a.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},r.set(i,s))}}function x0(e,t,a,r){var i=(i=Ji.current)?Yn(i):null;if(!i)throw Error(D(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=Ml(a.href),t=fl(i).hoistableStyles,r=t.get(a),r||(r={type:"style",instance:null,count:0,state:null},t.set(a,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Ml(a.href);var s=fl(i).hoistableStyles,o=s.get(e);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,o),(s=i.querySelector(uu(e)))?s._p||(o.instance=s,o.state.loading=5):(s=mr.get(e),s||(s={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},mr.set(e,s)),zD(i,e,s,o.state))),t&&r===null)throw Error(D(528,""));return o}if(t&&r!==null)throw Error(D(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(a=Fl(a),t=fl(i).hoistableScripts,r=t.get(a),r||(r={type:"script",instance:null,count:0,state:null},t.set(a,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(D(444,e))}}function Ml(e){return'href="'+cr(e)+'"'}function uu(e){return'link[rel="stylesheet"]['+e+"]"}function wL(e){return Fe({},e,{"data-precedence":e.precedence,precedence:null})}function zD(e,t,a,r){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[bd]!==!0){r.loading=1;return}}else t=e.createElement("link"),t[bd]=!0,t.onload=t.onerror=Q0.bind(null,t),Qt(t,"link",a),Pt(t),e.head.appendChild(t);r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2})}function Fl(e){return'[src="'+cr(e)+'"]'}function cu(e){return"script[async]"+e}function w0(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+cr(a.href)+'"]');if(r)return t.instance=r,Pt(r),r;var i=Fe({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Pt(r),Qt(r,"style",i),gd(r,a.precedence,e),t.instance=r;case"stylesheet":i=Ml(a.href);var s=e.querySelector(uu(i));if(s)return t.state.loading|=4,t.instance=s,Pt(s),s;r=wL(a),(i=mr.get(i))&&$g(r,i),s=(e.ownerDocument||e).createElement("link"),Pt(s);var o=s;return o._p=new Promise(function(l,n){o.onload=l,o.onerror=n}),Qt(s,"link",r),t.state.loading|=4,gd(s,a.precedence,e),t.instance=s;case"script":return s=Fl(a.src),(i=e.querySelector(cu(s)))?(t.instance=i,Pt(i),i):(r=a,(i=mr.get(s))&&(r=Fe({},a),Wg(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),Pt(i),Qt(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(D(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,gd(r,a.precedence,e));return t.instance}function gd(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,s=i,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)s=l;else if(s!==i)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function $g(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Wg(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var _d=null;function b0(e,t,a){if(_d===null){var r=new Map,i=_d=new Map;i.set(a,r)}else i=_d,r=i.get(a),r||(r=new Map,i.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var s=a[i];if(!(s[ru]||s[Xt]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var o=s.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(s):r.set(o,[s])}}return r}function Kp(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function UD(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function R0(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function bL(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function RL(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function I0(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=RL(t),e.suspenseyImages.push(t)),e=VD.bind(e),t.decode().then(e,e))}function FD(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=Ml(r.href),s=t.querySelector(uu(i));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=jn.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=s,Pt(s);return}s=t.ownerDocument||t,r=wL(r),(i=mr.get(i))&&$g(r,i),s=s.createElement("link"),Pt(s);var o=s;o._p=new Promise(function(l,n){o.onload=l,o.onerror=n}),Qt(s,"link",r),a.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=jn.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var vd=0;function qD(e,t){return e.stylesheets&&e.count===0&&Sd(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Sd(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&vd===0&&(vd=62500*oD());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Sd(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>vd?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function IL(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Sd(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function jn(){this.count--,IL(this)}function VD(){this.imgCount--,IL(this)}var Xd=null;function Sd(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xd=new Map,t.forEach($D,e),Xd=null,jn.call(e))}function $D(e,t){if(!(t.state.loading&4)){var a=Xd.get(e);if(a)var r=a.get(null);else{a=new Map,Xd.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<i.length;s++){var o=i[s];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),r=o)}r&&a.set(null,r)}i=t.instance,o=i.getAttribute("data-precedence"),s=a.get(o)||r,s===r&&a.set(null,i),a.set(o,i),this.count++,r=jn.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),s?s.parentNode.insertBefore(i,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Tl={$$typeof:Ur,Provider:null,Consumer:null,_currentValue:Qs,_currentValue2:Qs,_threadCount:0};function WD(e,t,a,r,i,s,o,l,n){this.tag=1,this.containerInfo=e,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=fm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fm(0),this.hiddenUpdates=fm(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=s,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=n,this.transitionTypes=null,this.incompleteTransitions=new Map}function EL(e,t,a,r,i,s,o,l,n,u,c,d){return e=new WD(e,t,a,o,n,u,c,d,l),t=1,s===!0&&(t|=24),s=Ea(3,null,null,t),e.current=s,s.stateNode=e,t=dg(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:r,isDehydrated:a,cache:t},mg(s),e}function kL(e){return e?(e=nl,e):nl}function DL(e,t,a,r,i,s){i=kL(i),r.context===null?r.context=i:r.pendingContext=i,r=ts(t),r.payload={element:a},s=s===void 0?null:s,s!==null&&(r.callback=s),a=as(e,r,t),a!==null&&(ka(a,e,t),En(a,e,t))}function E0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Gg(e,t){E0(e,t),(e=e.alternate)&&E0(e,t)}function ML(e){if(e.tag===13||e.tag===31){var t=po(e,67108864);t!==null&&ka(t,e,67108864),Gg(e,67108864)}}function k0(e){if(e.tag===13||e.tag===31){var t=Ya();t=Jp(t);var a=po(e,t);a!==null&&ka(a,e,t),Gg(e,t)}}var Al=!0;function GD(e,t,a,r){var i=ce.T;ce.T=null;var s=Te.p;try{Te.p=2,Kg(e,t,a,r)}finally{Te.p=s,ce.T=i}}function KD(e,t,a,r){var i=ce.T;ce.T=null;var s=Te.p;try{Te.p=8,Kg(e,t,a,r)}finally{Te.p=s,ce.T=i}}function Kg(e,t,a,r){if(Al){var i=Xp(r);if(i===null)Om(e,t,r,Yd,a),D0(e,r);else if(YD(i,e,t,a,r))r.stopPropagation();else if(D0(e,r),t&4&&-1<XD.indexOf(e)){for(;i!==null;){var s=Pl(i);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var o=Ks(s.pendingLanes);if(o!==0){var l=s;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var n=1<<31-Xa(o);l.entanglements[1]|=n,o&=~n}Xr(s),(Me&6)===0&&(Vd=Ga()+500,nu(0,!1))}}break;case 31:case 13:l=po(s,2),l!==null&&ka(l,s,2),ff(),Gg(s,2)}if(s=Xp(r),s===null&&Om(e,t,r,Yd,a),s===i)break;i=s}i!==null&&r.stopPropagation()}else Om(e,t,r,null,a)}}function Xp(e){return e=ag(e),Xg(e)}var Yd=null;function Xg(e){if(Yd=null,e=js(e),e!==null){var t=Jn(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=P0(t),e!==null)return e;e=null}else if(a===31){if(e=N0(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Yd=e,null}function TL(e){switch(e){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(nk()){case V0:return 2;case $0:return 8;case wd:case uk:return 32;case W0:return 268435456;default:return 32}default:return 32}}var Yp=!1,os=null,ls=null,ns=null,Zn=new Map,Qn=new Map,Gi=[],XD="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 D0(e,t){switch(e){case"focusin":case"focusout":os=null;break;case"dragenter":case"dragleave":ls=null;break;case"mouseover":case"mouseout":ns=null;break;case"pointerover":case"pointerout":Zn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qn.delete(t.pointerId)}}function _n(e,t,a,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Pl(t),t!==null&&ML(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function YD(e,t,a,r,i){switch(t){case"focusin":return os=_n(os,e,t,a,r,i),!0;case"dragenter":return ls=_n(ls,e,t,a,r,i),!0;case"mouseover":return ns=_n(ns,e,t,a,r,i),!0;case"pointerover":var s=i.pointerId;return Zn.set(s,_n(Zn.get(s)||null,e,t,a,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Qn.set(s,_n(Qn.get(s)||null,e,t,a,r,i)),!0}return!1}function AL(e){var t=js(e.target);if(t!==null){var a=Jn(t);if(a!==null){if(t=a.tag,t===13){if(t=P0(a),t!==null){e.blockedOn=t,ay(e.priority,function(){k0(a)});return}}else if(t===31){if(t=N0(a),t!==null){e.blockedOn=t,ay(e.priority,function(){k0(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function yd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Xp(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Qm=r,a.target.dispatchEvent(r),Qm=null}else return t=Pl(a),t!==null&&ML(t),e.blockedOn=a,!1;t.shift()}return!0}function M0(e,t,a){yd(e)&&a.delete(t)}function jD(){Yp=!1,os!==null&&yd(os)&&(os=null),ls!==null&&yd(ls)&&(ls=null),ns!==null&&yd(ns)&&(ns=null),Zn.forEach(M0),Qn.forEach(M0)}function ed(e,t){e.blockedOn===t&&(e.blockedOn=null,Yp||(Yp=!0,Rt.unstable_scheduleCallback(Rt.unstable_NormalPriority,jD)))}var td=null;function T0(e){td!==e&&(td=e,Rt.unstable_scheduleCallback(Rt.unstable_NormalPriority,function(){td===e&&(td=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(Xg(r||a)===null)continue;break}var s=Pl(a);s!==null&&(e.splice(t,3),t-=3,mp(s,{pending:!0,data:i,method:a.method,action:r},r,i))}}))}function Bl(e){function t(n){return ed(n,e)}os!==null&&ed(os,e),ls!==null&&ed(ls,e),ns!==null&&ed(ns,e),Zn.forEach(t),Qn.forEach(t);for(var a=0;a<Gi.length;a++){var r=Gi[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Gi.length&&(a=Gi[0],a.blockedOn===null);)AL(a),a.blockedOn===null&&Gi.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var i=a[r],s=a[r+1],o=i[Ma]||null;if(typeof s=="function")o||T0(a);else if(o){var l=null;if(s&&s.hasAttribute("formAction")){if(i=s,o=s[Ma]||null)l=o.formAction;else if(Xg(i)!==null)continue}else l=o.action;typeof l=="function"?a[r+1]=l:(a.splice(r,3),r-=3),T0(a)}}}function BL(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(o){return i=o})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function Yg(e){this._internalRoot=e}pf.prototype.render=Yg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(D(409));var a=t.current,r=Ya();DL(a,r,e,t,null,null)};pf.prototype.unmount=Yg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;DL(e.current,2,null,e,null,null),ff(),t[Ol]=null}};function pf(e){this._internalRoot=e}pf.prototype.unstable_scheduleHydration=function(e){if(e){var t=Z0();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Gi.length&&t!==0&&t<Gi[a].priority;a++);Gi.splice(a,0,e),a===0&&AL(e)}};var A0=B0.version;if(A0!=="19.3.0")throw Error(D(527,A0,"19.3.0"));Te.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(D(188)):(e=Object.keys(e).join(","),Error(D(268,e)));return e=ZE(t),e=e!==null?H0(e):null,e=e===null?null:e.stateNode,e};var ZD={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:ce,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(vn=__REACT_DEVTOOLS_GLOBAL_HOOK__,!vn.isDisabled&&vn.supportsFiber))try{eu=vn.inject(ZD),Ka=vn}catch{}var vn;gf.createRoot=function(e,t){if(!O0(e))throw Error(D(299));var a=!1,r="",i=m1,s=p1,o=g1;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=EL(e,1,!1,null,null,a,r,null,i,s,o,BL),e[Ol]=t.current,Ug(e),new Yg(t)};gf.hydrateRoot=function(e,t,a){if(!O0(e))throw Error(D(299));var r=!1,i="",s=m1,o=p1,l=g1,n=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(s=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(n=a.formState)),t=EL(e,1,!0,t,a??null,r,i,n,s,o,l,BL),t.context=kL(null),a=t.current,r=Ya(),r=Jp(r),i=ts(r),i.callback=null,as(a,i,r),a=r,t.current.lanes=a,au(t,a),Xr(t),e[Ol]=t.current,Ug(e),new pf(t)};gf.version="19.3.0"});var HL=Ar((QP,NL)=>{"use strict";function PL(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(PL)}catch(e){console.error(e)}}PL(),NL.exports=OL()});var mw=Ar($f=>{"use strict";var qT=Symbol.for("react.transitional.element"),VT=Symbol.for("react.fragment");function hw(e,t,a){var r=null;if(a!==void 0&&(r=""+a),t.key!==void 0&&(r=""+t.key),"key"in t){a={};for(var i in t)i!=="key"&&(a[i]=t[i])}else a=t;return t=a.ref,{$$typeof:qT,type:e,key:r,ref:t!==void 0?t:null,props:a}}$f.Fragment=VT;$f.jsx=hw;$f.jsxs=hw});var W=Ar((i4,pw)=>{"use strict";pw.exports=mw()});var cE=P(HL(),1);var ql=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,_o=/^[\\/]{2}/;function _f(e,t){return t+e.replace(/\\/g,"/")}var zL="popstate";function UL(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function qL(e={}){function t(r,i){let s=i.state?.masked,{pathname:o,search:l,hash:n}=s||r.location;return Vl("",{pathname:o,search:l,hash:n},i.state&&i.state.usr||null,i.state&&i.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function a(r,i){return typeof i=="string"?i:It(i)}return JD(t,a,null,e)}function ne(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Je(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function QD(){return Math.random().toString(36).substring(2,10)}function FL(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Vl(e,t,a=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ga(t):t,state:a,key:t&&t.key||r||QD(),mask:i}}function It({pathname:e="/",search:t="",hash:a=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function ga(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function JD(e,t,a,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,l="POP",n=null,u=c();u==null&&(u=0,o.replaceState({...o.state,idx:u},""));function c(){return(o.state||{idx:null}).idx}function d(){l="POP";let y=c(),p=y==null?null:y-u;u=y,n&&n({action:l,location:_.location,delta:p})}function f(y,p){l="PUSH";let g=UL(y)?y:Vl(_.location,y,p);a&&a(g,y),u=c()+1;let v=FL(g,u),C=_.createHref(g.mask||g);try{o.pushState(v,"",C)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;i.location.assign(C)}s&&n&&n({action:l,location:_.location,delta:1})}function h(y,p){l="REPLACE";let g=UL(y)?y:Vl(_.location,y,p);a&&a(g,y),u=c();let v=FL(g,u),C=_.createHref(g.mask||g);o.replaceState(v,"",C),s&&n&&n({action:l,location:_.location,delta:0})}function m(y){return jg(i,y)}let _={get action(){return l},get location(){return e(i,o)},listen(y){if(n)throw new Error("A history only accepts one active listener");return i.addEventListener(zL,d),n=y,()=>{i.removeEventListener(zL,d),n=null}},createHref(y){return t(i,y)},createURL:m,encodeLocation(y){let p=m(y);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:f,replace:h,go(y){return o.go(y)}};return _}function jg(e,t,a=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),ne(r,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:It(t);return i=i.replace(/ $/,"%20"),!a&&_o.test(i)&&(i=r+i),new URL(i,r)}var vf=P(ye(),1);function GL(e){return{defaultValue:e}}var yf=class{#e=new Map;constructor(e){if(e)for(let[t,a]of e)this.set(t,a)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){this.#e.set(e,t)}},eM=new Set(["lazy","caseSensitive","path","id","index","children","unstable_validateParams"]);function KL(e){return eM.has(e)}var tM=new Set(["lazy","caseSensitive","path","id","index","middleware","children","unstable_validateParams"]);function XL(e){return tM.has(e)}function aM(e){return e.index===!0}function Cf(e){let t={};return e.Component&&Object.assign(t,{element:vf.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:vf.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:vf.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function $l(e,t=Cf,a=[],r={},i=!1){return e.map((s,o)=>{let l=[...a,String(o)],n=typeof s.id=="string"?s.id:l.join("-");if(ne(s.index!==!0||!s.children,"Cannot specify children on an index route"),ne(i||!r[n],`Found a route id collision on id "${n}". Route id's must be globally unique within Data Router usages`),aM(s)){let u={...s,id:n};return r[n]=VL(u,t(u)),u}else{let u={...s,id:n,children:void 0};return r[n]=VL(u,t(u)),s.children&&(u.children=$l(s.children,t,l,r,i)),u}})}function VL(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function YL(e,t,a="/"){return Qg(e,t,a,!1)}function Qg(e,t,a,r,i){let s=ea((typeof t=="string"?ga(t):t).pathname||"/",a);if(s==null)return null;let o=i??Jg(e),l=null,n=e_(s);for(let u=0;l==null&&u<o.length;++u)l=mM(o[u],n,r);return l}function Lf(e,t){let{route:a,pathname:r,params:i}=e;return{id:a.id,pathname:r,params:i,loaderData:t[a.id],handle:a.handle}}function Jg(e){let t=jL(e);return rM(t),t}function jL(e,t=[],a=[],r="",i=!1){let s=(o,l,n=i,u)=>{let c={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(r)&&n)return;ne(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let d=Ta([r,c.relativePath]),f=a.concat(c);o.children&&o.children.length>0&&(ne(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),jL(o.children,t,f,d,n)),!(o.path==null&&!o.index)&&t.push({path:d,score:fM(d,o.index),routesMeta:f.map((h,m)=>{let[_,y]=JL(h.relativePath,h.caseSensitive,m===f.length-1);return{...h,matcher:_,compiledParams:y}})})};return e.forEach((o,l)=>{if(o.path===""||!o.path?.includes("?"))s(o,l);else for(let n of ZL(o.path))s(o,l,!0,n)}),t}function ZL(e){let t=e.split("/");if(t.length===0)return[];let[a,...r]=t,i=a.endsWith("?"),s=a.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=ZL(r.join("/")),l=[];return l.push(...o.map(n=>n===""?s:[s,n].join("/"))),i&&l.push(...o),l.map(n=>e.startsWith("/")&&n===""?"/":n)}function rM(e){e.sort((t,a)=>t.score!==a.score?a.score-t.score:hM(t.routesMeta.map(r=>r.childrenIndex),a.routesMeta.map(r=>r.childrenIndex)))}var iM=/^:[\w-]+$/,sM=/^:[\w-]+/,oM=3.5,lM=3,nM=2,uM=1,cM=10,dM=-2,$L=e=>e==="*";function fM(e,t){let a=e.split("/"),r=a.length;return a.some($L)&&(r+=dM),t&&(r+=nM),a.filter(i=>!$L(i)).reduce((i,s)=>i+(iM.test(s)?lM:sM.test(s)?oM:s===""?uM:cM),r)}function hM(e,t){return e.length===t.length&&e.slice(0,-1).every((a,r)=>a===t[r])?e[e.length-1]-t[t.length-1]:0}function mM(e,t,a=!1){let{routesMeta:r}=e,i={},s="/",o=[];for(let l=0;l<r.length;++l){let n=r[l],u=l===r.length-1,c=s==="/"?t:t.slice(s.length)||"/",d={path:n.relativePath,caseSensitive:n.caseSensitive,end:u},f=n.matcher&&n.compiledParams?QL(d,c,n.matcher,n.compiledParams):vo(d,c),h=n.route;if(!f&&u&&a&&!r[r.length-1].route.index&&(f=vo({path:n.relativePath,caseSensitive:n.caseSensitive,end:!1},c)),!f)return null;Object.assign(i,f.params),o.push({params:i,pathname:Ta([s,f.pathname]),pathnameBase:gM(Ta([s,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(s=Ta([s,f.pathnameBase]))}return o}function vo(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=JL(e.path,e.caseSensitive,e.end);return QL(e,t,a,r)}function QL(e,t,a,r){let i=t.match(a);if(!i)return null;let s=i[0],o=Sf(s,1),l=i.slice(1);return{params:r.reduce((n,{paramName:u,isOptional:c},d)=>{if(u==="*"){let h=l[d]||"";o=Sf(s.slice(0,s.length-h.length),1)}let f=l[d];return c&&!f?n[u]=void 0:n[u]=(f||"").replace(/%2F/g,"/"),n},{}),pathname:s,pathnameBase:o,pattern:e}}function JL(e,t=!1,a=!0){Je(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,l,n,u)=>{if(r.push({paramName:o,isOptional:l!=null}),l){let c=u.charAt(n+s.length);return c&&c!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,"(?:/$1)?");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function e_(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Je(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ea(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,r=e.charAt(a);return r&&r!=="/"?null:e.slice(a)||"/"}function ex({basename:e,pathname:t}){return t==="/"?e:Ta([e,t])}var xf=e=>ql.test(e);function pM(e,t="/"){let{pathname:a,search:r="",hash:i=""}=typeof e=="string"?ga(e):e,s;return a?(a=wf(a),a.startsWith("/")||a.startsWith("\\")?s=WL(a.substring(1),"/"):s=WL(a,t)):s=t,{pathname:s,search:_M(r),hash:vM(i)}}function WL(e,t){let a=Sf(t).split("/");return e.split("/").forEach(r=>{r===".."?a.length>1&&a.pop():r!=="."&&a.push(r)}),a.length>1?a.join("/"):"/"}function Zg(e,t,a,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function t_(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function Wl(e){let t=t_(e);return t.map((a,r)=>r===t.length-1?a.pathname:a.pathnameBase)}function gs(e,t,a,r=!1){let i;typeof e=="string"?i=ga(e):(i={...e},ne(!i.pathname||!i.pathname.includes("?"),Zg("?","pathname","search",i)),ne(!i.pathname||!i.pathname.includes("#"),Zg("#","pathname","hash",i)),ne(!i.search||!i.search.includes("#"),Zg("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,l;if(o==null)l=a;else{let d=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}l=d>=0?t[d]:"/"}let n=pM(i,l),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&a.endsWith("/");return!n.pathname.endsWith("/")&&(u||c)&&(n.pathname+="/"),n}var wf=e=>e.replace(/[\\/]{2,}/g,"/"),Ta=e=>wf(e.join("/"));function Sf(e,t=0){let a=e.length;for(;a>t&&e.charCodeAt(a-1)===47;)a--;return a===e.length?e:e.slice(0,a)}var gM=e=>Sf(e).replace(/^\/*/,"/"),_M=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,vM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var tx=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_s=class{status;statusText;data;error;internal;constructor(e,t,a,r=!1){this.status=e,this.statusText=t||"",this.internal=r,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function So(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function bi(e){return Ta(e.map(t=>t.route.path).filter(Boolean))||"/"}function bf(e,t){let a=new URL(typeof e=="string"||e instanceof URL?e:e.url),r=typeof t=="string"?ga(t):t;if(a.pathname=r.pathname||"/",r.search){let i=new URLSearchParams(r.search),s=i.getAll("index");i.delete("index");for(let l of s.filter(Boolean))i.append("index",l);let o=i.toString();a.search=o?`?${o}`:""}else a.search="";return a.hash=r.hash||"",a}var a_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Rf(e,t){let a=e;if(typeof a!="string"||!ql.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let r=a,i=!1;if(a_)try{let s=new URL(window.location.href),o=_o.test(a)?new URL(_f(a,s.protocol)):new URL(a),l=ea(o.pathname,t);o.origin===s.origin&&l!=null?a=l+o.search+o.hash:i=!0}catch{Je(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:a}}var ix=Symbol("Uninstrumented"),u3=GL(),du=new WeakMap;function sx(e,t){let a={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(i=>i({id:t.id,index:t.index,path:t.path,instrument(s){s.lazy!=null&&a.lazy.push(s.lazy),s["lazy.loader"]!=null&&a["lazy.loader"].push(s["lazy.loader"]),s["lazy.action"]!=null&&a["lazy.action"].push(s["lazy.action"]),s["lazy.middleware"]!=null&&a["lazy.middleware"].push(s["lazy.middleware"]),s.middleware!=null&&a.middleware.push(s.middleware),s.loader!=null&&a.loader.push(s.loader),s.action!=null&&a.action.push(s.action)}}));let r={};if(typeof t.lazy=="function"&&a.lazy.length>0){let i=t.lazy;r.lazy=async(...s)=>Ri(await Yr(a.lazy,void 0,()=>i(...s),Ii))}if(typeof t.lazy=="object"){let i=t.lazy;if(typeof i.middleware=="function"&&a["lazy.middleware"].length>0){let s=i.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...o)=>Ri(await Yr(a["lazy.middleware"],void 0,()=>s(...o),Ii))})}if(typeof i.loader=="function"&&a["lazy.loader"].length>0){let s=i.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...o)=>Ri(await Yr(a["lazy.loader"],void 0,()=>s(...o),Ii))})}if(typeof i.action=="function"&&a["lazy.action"].length>0){let s=i.action;r.lazy=Object.assign(r.lazy||{},{action:async(...o)=>Ri(await Yr(a["lazy.action"],void 0,()=>s(...o),Ii))})}}if(typeof t.loader=="function"&&a.loader.length>0){let i=fu(t.loader),s=async(...o)=>Ri(await Yr(a.loader,r_(o[0]),()=>i(...o),Ii));i.hydrate===!0&&(s.hydrate=!0),hu(s,i),r.loader=s}if(typeof t.action=="function"&&a.action.length>0){let i=fu(t.action),s=async(...o)=>Ri(await Yr(a.action,r_(o[0]),()=>i(...o),Ii));hu(s,i),r.action=s}return t.middleware&&t.middleware.length>0&&a.middleware.length>0&&(r.middleware=t.middleware.map(i=>{let s=fu(i),o=async(...l)=>Ri(await Yr(a.middleware,r_(l[0]),()=>s(...l),Ii));return hu(o,s),o})),r}function ox(e,t){let a={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(i){i.navigate!=null&&a.navigate.push(i.navigate),i.fetch!=null&&a.fetch.push(i.fetch)}})),a.navigate.length>0){let r=fu(e.navigate),i=async(...s)=>{let[o,l]=s,n,u={to:typeof o=="number"||typeof o=="string"?o:o?It(o):".",...rx(e,l??{})};return Ri(await Yr(a.navigate,u,async()=>{if(typeof o=="number")return await r(...s);let c=ax(e,d=>{n=d});try{return await r(...s)}finally{c()}},c=>({...Ii(c),meta:n})))};hu(i,r),e.navigate=i}if(a.fetch.length>0){let r=fu(e.fetch),i=async(...s)=>{let[o,l,n,u]=s,c;return Ri(await Yr(a.fetch,{href:n??".",fetcherKey:o,...rx(e,u??{})},async()=>{let d=ax(e,f=>{c=f});try{return await r(...s)}finally{d()}},d=>({...Ii(d),meta:c})))};hu(i,r),e.fetch=i}return e}function fu(e){return e[ix]??e}function hu(e,t){e[ix]=t}function ax(e,t){return du.set(e,t),()=>{du.get(e)===t&&du.delete(e)}}function i_(e){let t=du.get(e);return du.delete(e),t}function Ri(e){if(e.type==="error")throw e.value;return e.value}async function Yr(e,t,a,r,i={result:null,innerResult:null},s=e.length-1){let o=e[s];if(o){let l,n=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=Yr(e,t,a,r,i,s-1),await l,ne(i.innerResult,"Expected an inner result"),i.innerResult);try{await o(n,t)}catch(u){console.error("An instrumentation function threw an error:",u)}l||await n(),await l}else{try{i.result={type:"success",value:await a()}}catch(l){i.result={type:"error",value:l}}i.innerResult=r(i.result,t)}return i.result||(i.result={type:"error",value:new Error("No result assigned in instrumentation chain.")},i.innerResult=r(i.result,t)),i.result}function Ii(e){return e.type==="error"&&e.value instanceof Error?{status:"error",error:e.value}:{status:"success",error:void 0}}function r_(e){let{request:t,context:a,params:r}=e;return{...e,request:SM(t),params:{...r},context:yM(a)}}function rx(e,t){return{currentUrl:It(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function SM(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function yM(e){return{get:t=>e.get(t)}}var lx=class{#e=[];#t=[];#a;constructor(e){this.#a=e}update(e){this.#e=e,this.#t=Jg(e)}match(e,t=!1){return Qg(this.#e,e,this.#a,t,this.#t)}};var CM;function nx(){return CM}var ux=new URL("http://localhost");function o_(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),ux)}catch{return ux}}function s_(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function LM(e,t){if(e.startsWith("//"))return!0;let a=t.protocol.toLowerCase();return e.toLowerCase().startsWith(a)?t.host===""||e.slice(a.length).startsWith("//"):!1}function yo(e,t,a,r){let i=null;try{i=e==null?null:new URL(e,a)}catch{}let s=new URL(t,a),o=i!=null&&!s_(i,a),l=!s_(s,a);if(r==="reject"){if(o||l)throw new Error("External navigation is not allowed")}else if(l&&(i==null||!LM(e,i)||!s_(i,s)))throw new Error("External navigation is not allowed")}var bx=["POST","PUT","PATCH","DELETE"],xM=new Set(bx),wM=["GET",...bx],bM=new Set(wM),Rx=new Set([301,302,303,307,308]),RM=new Set([307,308]),l_={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ix={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Gl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ex="remix-router-transitions",kx=Symbol("ResetLoaderData");function IM(e,t){if(e.unstable_routePatternMatching){let a=nx();return ne(a,'You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.'),new a(t)}return new lx(t)}var EM=class{#e;#t;#a;constructor(e,t){this.#e=e,this.#a=t,this.#a.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#a.update(e)}setHmrRoutes(e){this.#t=e,this.#a.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#a.update(this.#e))}};function Dx(e){let t=e.window?e.window:typeof window<"u"?window:void 0,a=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";ne(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties,s=i||(()=>({}));if(e.instrumentations){let S=e.instrumentations;s=L=>({...i?.(L),...sx(S.map(b=>b.route).filter(Boolean),L)})}let o={...e.future},l=e.basename||"/";l.startsWith("/")||(l=`/${l}`);let n=IM(o,l),u={},c=new EM($l(e.routes,s,void 0,u),n),d=e.dataStrategy||AM,f=null,h=new Set,m=null,_=null,y=null,p=null,g=e.hydrationData!=null,v=n.match(e.history.location),C=!1,x=null,k,T;if(v==null&&!e.patchRoutesOnNavigation){let S=pr(404,{pathname:e.history.location.pathname}),{matches:L,route:b}=If(c.activeRoutes);k=!0,T=!k,v=L,x={[b.id]:S}}else if(v&&!e.hydrationData&&wc(v,e.history.location.pathname).active&&(v=null),v)if(v.some(S=>S.route.lazy))k=!1,T=!k;else if(!v.some(S=>f_(S.route)))k=!0,T=!k;else{let S=e.hydrationData?e.hydrationData.loaderData:null,L=e.hydrationData?e.hydrationData.errors:null,b=v;if(L){let O=v.findIndex(q=>L[q.route.id]!==void 0);b=b.slice(0,O+1)}T=!1,k=!0,b.forEach(O=>{let q=Mx(O.route,S,L);T=T||q.renderFallback,k=k&&!q.shouldLoad})}else{k=!1,T=!k,v=[];let S=wc(null,e.history.location.pathname);S.active&&S.matches&&(C=!0,v=S.matches)}let U,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:k,renderFallback:T,navigation:l_,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},N="POP",H=null,ee=!1,R,E=!1,z=new Map,F=null,I=!1,A=!1,te=new Set,J=new Map,Re=0,Ye=-1,it=new Map,M=new Set,G=new Map,K=new Map,le=new Set,ue=new Map,be,xt=null;function Tt(){if(f=e.history.listen(({action:S,location:L,delta:b})=>{if(be){be(),be=void 0;return}Je(ue.size===0||b!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let O=hS({currentLocation:w.location,nextLocation:L,historyAction:S});if(O&&b!=null){let q=new Promise(Z=>{be=Z});e.history.go(b*-1),xc(O,{state:"blocked",location:L,proceed(){xc(O,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),q.then(()=>e.history.go(b))},reset(){let Z=new Map(w.blockers);Z.set(O,Gl),mt({blockers:Z})}}),H?.resolve(),H=null;return}return Fs(S,L)}),a){QM(t,z);let S=()=>JM(t,z);t.addEventListener("pagehide",S),F=()=>t.removeEventListener("pagehide",S)}return w.initialized||Fs("POP",w.location,{initialHydration:!0}),U}function Ua(){f&&f(),F&&F(),h.clear(),R&&R.abort(),w.fetchers.forEach((S,L)=>$h(w.fetchers,L)),w.blockers.forEach((S,L)=>fS(L))}function ke(S){if(h.add(S),m){let{newErrors:L}=m;m=null,S(w,{deletedFetchers:[],newErrors:L,viewTransitionOpts:void 0,flushSync:!1})}return()=>h.delete(S)}function mt(S,L={}){S.matches&&(S.matches=S.matches.map(q=>{let Z=u[q.route.id],Q=q.route;return Q.element!==Z.element||Q.errorElement!==Z.errorElement||Q.hydrateFallbackElement!==Z.hydrateFallbackElement?{...q,route:Z}:q})),w={...w,...S};let b=[],O=[];w.fetchers.forEach((q,Z)=>{q.state==="idle"&&(le.has(Z)?b.push(Z):O.push(Z))}),le.forEach(q=>{!w.fetchers.has(q)&&!J.has(q)&&b.push(q)}),h.size===0&&(m={newErrors:S.errors??null}),[...h].forEach(q=>q(w,{deletedFetchers:b,newErrors:S.errors??null,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),b.forEach(q=>$h(w.fetchers,q)),O.forEach(q=>w.fetchers.delete(q))}function zo(S,L,{flushSync:b}={}){let O=w.actionData!=null&&w.navigation.formMethod!=null&&la(w.navigation.formMethod)&&w.navigation.state==="loading"&&S.state?._isRedirect!==!0,q;L.actionData?Object.keys(L.actionData).length>0?q=L.actionData:q=null:O?q=w.actionData:q=null;let Z=L.loaderData?Sx(w.loaderData,L.loaderData,L.matches||[],L.errors):w.loaderData,Q=w.blockers;Q.size>0&&!I&&(Q=new Map(Q),Q.forEach((ie,se)=>Q.set(se,Gl)));let $=I?!1:pS(S,L.matches||w.matches),j=ee===!0||w.navigation.formMethod!=null&&la(w.navigation.formMethod)&&S.state?._isRedirect!==!0;c.commitHmrRoutes(),I||N==="POP"||(N==="PUSH"?e.history.push(S,S.state):N==="REPLACE"&&e.history.replace(S,S.state));let me;if(N==="POP"&&!I&&S!==w.location){let ie=z.get(w.location.pathname);ie&&ie.has(S.pathname)?me={currentLocation:w.location,nextLocation:S}:z.has(S.pathname)&&(me={currentLocation:S,nextLocation:w.location})}else if(E){let ie=z.get(w.location.pathname);ie?ie.add(S.pathname):(ie=new Set([S.pathname]),z.set(w.location.pathname,ie)),me={currentLocation:w.location,nextLocation:S}}mt({...L,actionData:q,loaderData:Z,historyAction:N,location:S,initialized:!0,renderFallback:!1,navigation:l_,revalidation:"idle",restoreScrollPosition:$,preventScrollReset:j,blockers:Q},{viewTransitionOpts:me,flushSync:b===!0}),N="POP",ee=!1,E=!1,I=!1,A=!1,H?.resolve(),H=null,xt?.resolve(),xt=null}async function oS(S,L){if(H?.resolve(),H=null,typeof S=="number"){H||(H=wx());let De=H.promise;return e.history.go(S),De}let b=i_(U),{path:O,submission:q,error:Z}=cx(!1,u_(w.location,w.matches,l,S,L?.fromRouteId,L?.relative),L),Q;if(L?.mask){let De=typeof L.mask=="string"?ga(L.mask):{...w.location.mask,...L.mask};if(Q={pathname:De.pathname??"",search:De.search??"",hash:De.hash??""},_o.test(Q.pathname))throw new Error("External navigation is not allowed");Q.pathname.startsWith("\\")&&(Q.pathname=Q.pathname.replace(/^\\+/,"/")),yo(typeof L.mask=="string"?L.mask:It(L.mask),It(Q),e.history.createURL("/"),"reject")}let $=w.location,j=Vl($,O,L&&L.state,void 0,Q);j={...j,...e.history.encodeLocation(j)},yo(S==null?e.history.createHref(w.location):typeof S=="string"?S:It(S),e.history.createHref(j.mask||j),e.history.createURL("/"),"reject");let me=L&&L.replace!=null?L.replace:void 0,ie="PUSH";me===!0?ie="REPLACE":me===!1||q!=null&&la(q.formMethod)&&q.formAction===w.location.pathname+w.location.search&&(ie="REPLACE");let se=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,Le=(L&&L.flushSync)===!0,dt=hS({currentLocation:$,nextLocation:j,historyAction:ie});if(dt){xc(dt,{state:"blocked",location:j,proceed(){xc(dt,{state:"proceeding",proceed:void 0,reset:void 0,location:j}),oS(S,L)},reset(){let De=new Map(w.blockers);De.set(dt,Gl),mt({blockers:De})}});return}await Fs(ie,j,{submission:q,pendingError:Z,preventScrollReset:se,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:Le,callSiteDefaultShouldRevalidate:L&&L.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:b})}function fE(){xt||(xt=wx()),Vh(),mt({revalidation:"loading"});let S=xt.promise;return w.navigation.state==="submitting"?S:w.navigation.state==="idle"?(Fs(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),S):(Fs(N||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:E===!0}),S)}async function Fs(S,L,b){R&&R.abort(),R=null,N=S,I=(b&&b.startUninterruptedRevalidation)===!0,wE(w.location,w.matches),ee=(b&&b.preventScrollReset)===!0,E=(b&&b.enableViewTransition)===!0;let O=b?.initialHydration&&w.matches&&w.matches.length>0&&!C?w.matches:n.match(L),q=(b&&b.flushSync)===!0;if(O&&w.initialized&&!A&&qM(w.location,L)&&!(b&&b.submission&&la(b.submission.formMethod))){zo(L,{matches:O},{flushSync:q});return}let Z=wc(O,L.pathname);if(Z.active&&Z.matches&&(O=Z.matches),b?.instrumentationNavigateMetaReceiver){let Ne=Lx(e.history,L,O);b.instrumentationNavigateMetaReceiver(Ne)}if(!O){let{error:Ne,notFoundMatches:Ie,route:Gt}=Wh(L.pathname);zo(L,{matches:Ie,loaderData:{},errors:{[Gt.id]:Ne}},{flushSync:q});return}let Q=b&&b.overrideNavigation?{...b.overrideNavigation,matches:O,historyAction:S}:void 0;R=new AbortController;let $=Kl(e.history,L,R.signal,b&&b.submission),j=e.getContext?await e.getContext():new yf,me;if(b&&b.pendingError)me=[vs(O).route.id,{type:"error",error:b.pendingError}];else if(b&&b.submission&&la(b.submission.formMethod)){let Ne=await hE($,L,b.submission,O,S,j,Z.active,b&&b.initialHydration===!0,{replace:b.replace,flushSync:q});if(Ne.shortCircuited)return;if(Ne.pendingActionResult){let[Ie,Gt]=Ne.pendingActionResult;if(Qa(Gt)&&So(Gt.error)&&Gt.error.status===404){R=null,zo(L,{matches:Ne.matches,loaderData:{},errors:{[Ie]:Gt.error}});return}}O=Ne.matches||O,me=Ne.pendingActionResult,Q=n_(L,O,S,b.submission),q=!1,Z.active=!1,$=Kl(e.history,$.url,$.signal)}let{shortCircuited:ie,matches:se,loaderData:Le,errors:dt,workingFetchers:De}=await mE($,L,O,S,j,Z.active,Q,b&&b.submission,b&&b.fetcherSubmission,b&&b.replace,b&&b.initialHydration===!0,q,me,b&&b.callSiteDefaultShouldRevalidate);ie||(R=null,zo(L,{matches:se||O,...yx(me),loaderData:Le,errors:dt,...De?{fetchers:De}:{}}))}async function hE(S,L,b,O,q,Z,Q,$,j={}){if(Vh(),mt({navigation:jM(L,O,q,b)},{flushSync:j.flushSync===!0}),Q){let se=await bc(O,L.pathname,S.signal);if(se.type==="aborted")return{shortCircuited:!0};if(se.type==="error"){if(se.partialMatches.length===0){let{matches:dt,route:De}=If(c.activeRoutes);return{matches:dt,pendingActionResult:[De.id,{type:"error",error:se.error}]}}let Le=vs(se.partialMatches).route.id;return{matches:se.partialMatches,pendingActionResult:[Le,{type:"error",error:se.error}]}}else if(se.matches)O=se.matches;else{let{notFoundMatches:Le,error:dt,route:De}=Wh(L.pathname);return{matches:Le,pendingActionResult:[De.id,{type:"error",error:dt}]}}}let me,ie=kf(O,L);if(!ie.route.action&&!ie.route.lazy)me={type:"error",error:pr(405,{method:S.method,pathname:L.pathname,routeId:ie.route.id})};else{let se=await nn(S,L,Xl(s,u,S,L,O,ie,$?[]:r,Z),Z,null);if(me=se[ie.route.id],!me){for(let Le of O)if(se[Le.route.id]){me=se[Le.route.id];break}}if(S.signal.aborted)return{shortCircuited:!0}}if(Co(me)){let se;return j&&j.replace!=null?se=j.replace:se=gx(me.response.headers.get("Location"),new URL(S.url),l,e.history)===w.location.pathname+w.location.search,await qs(S,me,!0,{submission:b,replace:se}),{shortCircuited:!0}}if(Qa(me)){let se=vs(O,ie.route.id);return(j&&j.replace)!==!0&&(N="PUSH"),{matches:O,pendingActionResult:[se.route.id,me,ie.route.id]}}return{matches:O,pendingActionResult:[ie.route.id,me]}}async function mE(S,L,b,O,q,Z,Q,$,j,me,ie,se,Le,dt){let De=Q||n_(L,b,O,$),Ne=$||j||xx(De),Ie=!I&&!ie;if(Z){if(Ie){let At=lS(Le);mt({navigation:De,...At!==void 0?{actionData:At}:{}},{flushSync:se})}let xe=await bc(b,L.pathname,S.signal);if(xe.type==="aborted")return{shortCircuited:!0};if(xe.type==="error"){if(xe.partialMatches.length===0){let{matches:ni,route:Vo}=If(c.activeRoutes);return{matches:ni,loaderData:{},errors:{[Vo.id]:xe.error}}}let At=vs(xe.partialMatches).route.id;return{matches:xe.partialMatches,loaderData:{},errors:{[At]:xe.error}}}else if(xe.matches)b=xe.matches;else{let{error:At,notFoundMatches:ni,route:Vo}=Wh(L.pathname);return{matches:ni,loaderData:{},errors:{[Vo.id]:At}}}}let{dsMatches:Gt,revalidatingFetchers:wa}=dx(S,q,s,u,e.history,w,b,Ne,L,ie?[]:r,ie===!0,A,te,le,G,M,n,Le,dt);if(Ye=++Re,!e.dataStrategy&&!Gt.some(xe=>xe.shouldLoad)&&!Gt.some(xe=>xe.route.middleware&&xe.route.middleware.length>0)&&wa.length===0){let xe=new Map(w.fetchers),At=cS(xe);return zo(L,{matches:b,loaderData:{},errors:Le&&Qa(Le[1])?{[Le[0]]:Le[1].error}:null,...yx(Le),...At?{fetchers:xe}:{}},{flushSync:se}),{shortCircuited:!0}}if(Ie){let xe={};if(!Z){xe.navigation=De;let At=lS(Le);At!==void 0&&(xe.actionData=At)}wa.length>0&&(xe.fetchers=pE(wa)),mt(xe,{flushSync:se})}wa.forEach(xe=>{li(xe.key),xe.controller&&J.set(xe.key,xe.controller)});let Hi=()=>wa.forEach(xe=>li(xe.key));R&&R.signal.addEventListener("abort",Hi);let{loaderResults:Vs,fetcherResults:Rc}=await nS(Gt,wa,S,L,q);if(S.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",Hi),wa.forEach(xe=>J.delete(xe.key));let ir=Ef(Vs);if(ir)return await qs(S,ir.result,!0,{replace:me}),{shortCircuited:!0};if(ir=Ef(Rc),ir)return M.add(ir.key),await qs(S,ir.result,!0,{replace:me}),{shortCircuited:!0};let Uo=new Map(w.fetchers),{loaderData:Fo,errors:qo}=vx(w,b,Vs,Le,wa,Rc,Uo);ie&&w.errors&&(qo={...w.errors,...qo});let Ic=cS(Uo),Ec=dS(Ye,Uo),kc=Ic||Ec||wa.length>0;return{matches:b,loaderData:Fo,errors:qo,...kc?{workingFetchers:Uo}:{}}}function lS(S){if(S&&!Qa(S[1]))return{[S[0]]:S[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function pE(S){let L=new Map(w.fetchers);return S.forEach(b=>{let O=L.get(b.key),q=mu(void 0,O?O.data:void 0);L.set(b.key,q)}),L}async function gE(S,L,b,O){li(S);let q=(O&&O.flushSync)===!0,Z=i_(U),Q=u_(w.location,w.matches,l,b,L,O?.relative),$=n.match(Q),j=wc($,Q);if(j.active&&j.matches&&($=j.matches),Z&&Z(Lx(e.history,Q,$)),!$){oi(S,L,pr(404,{pathname:Q}),{flushSync:q});return}let{path:me,submission:ie,error:se}=cx(!0,Q,O);if(se){oi(S,L,se,{flushSync:q});return}let Le=e.getContext?await e.getContext():new yf,dt=(O&&O.preventScrollReset)===!0;if(ie&&la(ie.formMethod)){await _E(S,L,me,$,Le,j.active,q,dt,ie,O&&O.defaultShouldRevalidate);return}let De={routeId:L,path:me,isDiscovering:j.active};G.set(S,De),await vE(S,De,$,Le,q,dt,ie)}async function _E(S,L,b,O,q,Z,Q,$,j,me){Vh(),G.delete(S),si(S,ZM(j,w.fetchers.get(S)),{flushSync:Q});let ie=new AbortController,se=Kl(e.history,b,ie.signal,j);if(Z){let st=await bc(O,new URL(se.url).pathname,se.signal,S);if(st.type==="aborted")return;if(st.type==="error"){oi(S,L,st.error,{flushSync:Q});return}else if(st.matches)O=st.matches;else{oi(S,L,pr(404,{pathname:b}),{flushSync:Q});return}}let Le=kf(O,b);if(!Le.route.action&&!Le.route.lazy){oi(S,L,pr(405,{method:j.formMethod,pathname:b,routeId:L}),{flushSync:Q});return}J.set(S,ie);let dt=Re,De=Xl(s,u,se,b,O,Le,r,q),Ne=await nn(se,b,De,q,S),Ie=Ne[Le.route.id];if(!Ie){for(let st of De)if(Ne[st.route.id]){Ie=Ne[st.route.id];break}}if(se.signal.aborted){J.get(S)===ie&&J.delete(S);return}if(le.has(S)){if(Co(Ie)||Qa(Ie)){si(S,jr(void 0));return}}else{if(Co(Ie))if(J.delete(S),Ye>dt){si(S,jr(void 0));return}else return M.add(S),si(S,mu(j)),qs(se,Ie,!1,{fetcherSubmission:j,preventScrollReset:$});if(Qa(Ie)){oi(S,L,Ie.error);return}}let Gt=w.navigation.location||w.location,wa=Kl(e.history,Gt,ie.signal),Hi=w.navigation.state!=="idle"?n.match(w.navigation.location):w.matches;ne(Hi,"Didn't find any matches after fetcher action");let Vs=++Re;it.set(S,Vs);let{dsMatches:Rc,revalidatingFetchers:ir}=dx(wa,q,s,u,e.history,w,Hi,j,Gt,r,!1,A,te,le,G,M,n,[Le.route.id,Ie],me),Uo=mu(j,Ie.data),Fo=new Map(w.fetchers);Fo.set(S,Uo),ir.filter(st=>st.key!==S).forEach(st=>{let $s=st.key,_S=Fo.get($s),IE=mu(void 0,_S?_S.data:void 0);Fo.set($s,IE),li($s),st.controller&&J.set($s,st.controller)}),mt({fetchers:Fo});let qo=()=>ir.forEach(st=>li(st.key));ie.signal.addEventListener("abort",qo);let{loaderResults:Ic,fetcherResults:Ec}=await nS(Rc,ir,wa,Gt,q);if(ie.signal.aborted){it.get(S)===Vs&&it.delete(S);return}ie.signal.removeEventListener("abort",qo),it.delete(S),J.delete(S),ir.forEach(st=>J.delete(st.key));let kc=w.fetchers.has(S),xe=st=>{if(!kc)return st;let $s=new Map(st.fetchers);return $s.set(S,jr(Ie.data)),{...st,fetchers:$s}},At=Ef(Ic);if(At)return w=xe(w),qs(wa,At.result,!1,{preventScrollReset:$});if(At=Ef(Ec),At)return M.add(At.key),w=xe(w),qs(wa,At.result,!1,{preventScrollReset:$});let ni=new Map(w.fetchers);kc&&ni.set(S,jr(Ie.data));let{loaderData:Vo,errors:Gh}=vx(w,Hi,Ic,void 0,ir,Ec,ni);dS(Vs,ni),w.navigation.state==="loading"&&Vs>Ye?(ne(N,"Expected pending action"),R&&R.abort(),zo(w.navigation.location,{matches:Hi,loaderData:Vo,errors:Gh,fetchers:ni})):(mt({errors:Gh,loaderData:Sx(w.loaderData,Vo,Hi,Gh),fetchers:ni}),A=!1)}async function vE(S,L,b,O,q,Z,Q){let{routeId:$,path:j}=L,me=w.fetchers.get(S);si(S,mu(Q,me?me.data:void 0),{flushSync:q});let ie=new AbortController,se=Kl(e.history,j,ie.signal);if(L.isDiscovering){let Ie=await bc(b,new URL(se.url).pathname,se.signal,S);if(Ie.type==="aborted")return;if(Ie.type==="error"){oi(S,$,Ie.error,{flushSync:q});return}else if(Ie.matches)b=Ie.matches,L.isDiscovering=!1;else{oi(S,$,pr(404,{pathname:j}),{flushSync:q});return}}let Le=kf(b,j);J.set(S,ie);let dt=Re,De=await nn(se,j,Xl(s,u,se,j,b,Le,r,O),O,S),Ne=De[Le.route.id];if(!Ne){for(let Ie of b)if(De[Ie.route.id]){Ne=De[Ie.route.id];break}}if(J.get(S)===ie&&J.delete(S),!se.signal.aborted){if(le.has(S)){si(S,jr(void 0));return}if(Co(Ne))if(Ye>dt){si(S,jr(void 0));return}else{M.add(S),await qs(se,Ne,!1,{preventScrollReset:Z});return}if(Qa(Ne)){oi(S,$,Ne.error);return}si(S,jr(Ne.data))}}async function qs(S,L,b,{submission:O,fetcherSubmission:q,preventScrollReset:Z,replace:Q}={}){b||(H?.resolve(),H=null),L.response.headers.has("X-Remix-Revalidate")&&(A=!0);let $=L.response.headers.get("Location");ne($,"Expected a Location header on the redirect Response");let j=$,me=new URL(S.url);$=gx($,me,l,e.history),yo(j,$,me,"allow-explicit");let ie=Vl(w.location,$,{_isRedirect:!0});if(a){let Ie=!1;if(L.response.headers.has("X-Remix-Reload-Document"))Ie=!0;else if(xf($)){let Gt=jg(t,$,!0);Ie=Gt.origin!==t.location.origin||ea(Gt.pathname,l)==null}if(Ie){Q?t.location.replace($):t.location.assign($);return}}R=null;let se=Q===!0||L.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Le,formAction:dt,formEncType:De}=w.navigation;!O&&!q&&Le&&dt&&De&&(O=xx(w.navigation));let Ne=O||q;RM.has(L.response.status)&&Ne&&la(Ne.formMethod)?await Fs(se,ie,{submission:{...Ne,formAction:$},preventScrollReset:Z||ee,enableViewTransition:b?E:void 0}):await Fs(se,ie,{overrideNavigation:n_(ie,[],se,O),fetcherSubmission:q,preventScrollReset:Z||ee,enableViewTransition:b?E:void 0})}async function nn(S,L,b,O,q){let Z,Q={};try{Z=await OM(d,S,L,b,q,O,!1)}catch($){return b.filter(j=>j.shouldLoad).forEach(j=>{Q[j.route.id]={type:"error",error:$}}),Q}if(S.signal.aborted)return Q;if(!la(S.method))for(let $ of b){if(Z[$.route.id]?.type==="error")break;!Z.hasOwnProperty($.route.id)&&!w.loaderData.hasOwnProperty($.route.id)&&(!w.errors||!w.errors.hasOwnProperty($.route.id))&&$.shouldCallHandler()&&(Z[$.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${$.route.id}`)})}for(let[$,j]of Object.entries(Z))if(GM(j)){let me=j.result;Q[$]={type:"redirect",response:zM(me,S,$,b,l)}}else Q[$]=await HM(j);return Q}async function nS(S,L,b,O,q){let Z=nn(b,O,S,q,null),Q=Promise.all(L.map(async $=>{if($.matches&&$.match&&$.request&&$.controller){let j=(await nn($.request,$.path,$.matches,q,$.key))[$.match.route.id];return{[$.key]:j}}else return Promise.resolve({[$.key]:{type:"error",error:pr(404,{pathname:$.path})}})}));return{loaderResults:await Z,fetcherResults:(await Q).reduce(($,j)=>Object.assign($,j),{})}}function Vh(){A=!0,G.forEach((S,L)=>{J.has(L)&&te.add(L),li(L)})}function si(S,L,b={}){let O=new Map(w.fetchers);O.set(S,L),mt({fetchers:O},{flushSync:(b&&b.flushSync)===!0})}function oi(S,L,b,O={}){let q=vs(w.matches,L),Z=new Map(w.fetchers);$h(Z,S),mt({errors:{[q.route.id]:b},fetchers:Z},{flushSync:(O&&O.flushSync)===!0})}function SE(S){return K.set(S,(K.get(S)||0)+1),le.has(S)&&le.delete(S),w.fetchers.get(S)||Ix}function yE(S,L){li(S,L?.reason),si(S,jr(null))}function $h(S,L){let b=w.fetchers.get(L);J.has(L)&&!(b&&b.state==="loading"&&it.has(L))&&li(L),G.delete(L),it.delete(L),M.delete(L),le.delete(L),te.delete(L),S.delete(L)}function CE(S){let L=(K.get(S)||0)-1;L<=0?(K.delete(S),le.add(S)):K.set(S,L),mt({fetchers:new Map(w.fetchers)})}function li(S,L){let b=J.get(S);b&&(b.abort(L),J.delete(S))}function uS(S,L){for(let b of S){let O=L.get(b);ne(O,`Expected fetcher: ${b}`);let q=jr(O.data);L.set(b,q)}}function cS(S){let L=[],b=!1;for(let O of M){let q=S.get(O);ne(q,`Expected fetcher: ${O}`),q.state==="loading"&&(M.delete(O),L.push(O),b=!0)}return uS(L,S),b}function dS(S,L){let b=[];for(let[O,q]of it)if(q<S){let Z=L.get(O);ne(Z,`Expected fetcher: ${O}`),Z.state==="loading"&&(li(O),it.delete(O),b.push(O))}return uS(b,L),b.length>0}function LE(S,L){let b=w.blockers.get(S)||Gl;return ue.get(S)!==L&&ue.set(S,L),b}function fS(S){w.blockers.delete(S),ue.delete(S)}function xc(S,L){let b=w.blockers.get(S)||Gl;ne(b.state==="unblocked"&&L.state==="blocked"||b.state==="blocked"&&L.state==="blocked"||b.state==="blocked"&&L.state==="proceeding"||b.state==="blocked"&&L.state==="unblocked"||b.state==="proceeding"&&L.state==="unblocked",`Invalid blocker state transition: ${b.state} -> ${L.state}`);let O=new Map(w.blockers);O.set(S,L),mt({blockers:O})}function hS({currentLocation:S,nextLocation:L,historyAction:b}){if(ue.size===0)return;ue.size>1&&Je(!1,"A router only supports one blocker at a time");let O=Array.from(ue.entries()),[q,Z]=O[O.length-1],Q=w.blockers.get(q);if(!(Q&&Q.state==="proceeding")&&Z({currentLocation:S,nextLocation:L,historyAction:b}))return q}function Wh(S){let L=pr(404,{pathname:S}),b=c.activeRoutes,{matches:O,route:q}=If(b);return{notFoundMatches:O,route:q,error:L}}function xE(S,L,b){if(_=S,p=L,y=b||null,!g&&w.navigation===l_){g=!0;let O=pS(w.location,w.matches);O!=null&&mt({restoreScrollPosition:O})}return()=>{_=null,p=null,y=null}}function mS(S,L){return y&&y(S,L.map(b=>Lf(b,w.loaderData)))||S.key}function wE(S,L){if(_&&p){let b=mS(S,L);_[b]=p()}}function pS(S,L){if(_){let b=mS(S,L),O=_[b];if(typeof O=="number")return O}return null}function wc(S,L){if(e.patchRoutesOnNavigation)if(S){if(Object.keys(S[0].params).length>0)return{active:!0,matches:n.match(L,!0)}}else return{active:!0,matches:n.match(L,!0)||[]};return{active:!1,matches:null}}async function bc(S,L,b,O){if(!e.patchRoutesOnNavigation)return{type:"success",matches:S};let q=S;for(;;){let Z=u;try{await e.patchRoutesOnNavigation({signal:b,path:L,matches:q,fetcherKey:O,patch:(j,me)=>{b.aborted||fx(j,me,c,Z,s,!1)}})}catch(j){return{type:"error",error:j,partialMatches:q}}if(b.aborted)return{type:"aborted"};let Q=n.match(L),$=null;if(Q){if(Object.keys(Q[0].params).length===0)return{type:"success",matches:Q};if($=n.match(L,!0),!($&&q.length<$.length&&gS(q,$.slice(0,q.length))))return{type:"success",matches:Q}}if($||($=n.match(L,!0)),!$||gS(q,$))return{type:"success",matches:null};q=$}}function gS(S,L){return S.length===L.length&&S.every((b,O)=>b.route.id===L[O].route.id)}function bE(S){u={},c.setHmrRoutes($l(S,s,void 0,u))}function RE(S,L,b=!1){fx(S,L,c,u,s,b),c.hasHMRRoutes||mt({})}return U={get basename(){return l},get future(){return o},get state(){return w},get routes(){return c.stableRoutes},match(S){return n.match(S)},get manifest(){return u},get window(){return t},initialize:Tt,subscribe:ke,enableScrollRestoration:xE,navigate:oS,fetch:gE,revalidate:fE,createHref:S=>e.history.createHref(S),createURL:S=>e.history.createURL(S),encodeLocation:S=>e.history.encodeLocation(S),getFetcher:SE,resetFetcher:yE,deleteFetcher:CE,dispose:Ua,getBlocker:LE,deleteBlocker:fS,patchRoutes:RE,_internalFetchControllers:J,_internalSetRoutes:bE,_internalSetStateDoNotUseOrYouWillBreakYourApp(S){mt(S)}},e.instrumentations&&(U=ox(U,e.instrumentations.map(S=>S.router).filter(Boolean))),U}function kM(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function u_(e,t,a,r,i,s){let o,l;if(i){o=[];for(let u of t)if(o.push(u),u.route.id===i){l=u;break}}else o=t,l=t[t.length-1];let n=gs(r||".",Wl(o),ea(e.pathname,a)||e.pathname,s==="path");if(r==null&&(n.search=e.search,n.hash=e.hash),(r==null||r===""||r===".")&&l){let u=m_(n.search);if(l.route.index&&!u)n.search=n.search?n.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&u){let c=new URLSearchParams(n.search),d=c.getAll("index");c.delete("index"),d.filter(h=>h).forEach(h=>c.append("index",h));let f=c.toString();n.search=f?`?${f}`:""}}return a!=="/"&&(n.pathname=ex({basename:a,pathname:n.pathname})),It(n)}function cx(e,t,a){if(!a||!kM(a))return{path:t};if(a.formMethod&&!YM(a.formMethod))return{path:t,error:pr(405,{method:a.formMethod})};let r=()=>({path:t,error:pr(400,{type:"invalid-body"})}),i=(a.formMethod||"get").toUpperCase(),s=Nx(t);if(a.body!==void 0){if(a.formEncType==="text/plain"){if(!la(i))return r();let c=typeof a.body=="string"?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce((d,[f,h])=>`${d}${f}=${h}
10
+ `,""):String(a.body);return{path:t,submission:{formMethod:i,formAction:s,formEncType:a.formEncType,formData:void 0,json:void 0,text:c}}}else if(a.formEncType==="application/json"){if(!la(i))return r();try{let c=typeof a.body=="string"?JSON.parse(a.body):a.body;return{path:t,submission:{formMethod:i,formAction:s,formEncType:a.formEncType,formData:void 0,json:c,text:void 0}}}catch{return r()}}}ne(typeof FormData=="function","FormData is not available in this environment");let o,l;if(a.formData)o=d_(a.formData),l=a.formData;else if(a.body instanceof FormData)o=d_(a.body),l=a.body;else if(a.body instanceof URLSearchParams)o=a.body,l=_x(o);else if(a.body==null)o=new URLSearchParams,l=new FormData;else try{o=new URLSearchParams(a.body),l=_x(o)}catch{return r()}let n={formMethod:i,formAction:s,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(la(n.formMethod))return{path:t,submission:n};let u=ga(t);return e&&u.search&&m_(u.search)&&o.append("index",""),u.search=`?${o}`,{path:It(u),submission:n}}function dx(e,t,a,r,i,s,o,l,n,u,c,d,f,h,m,_,y,p,g){let v=p?Qa(p[1])?p[1].error:p[1].data:void 0,C=i.createURL(s.location),x=i.createURL(n),k;if(c&&s.errors){let R=Object.keys(s.errors)[0];k=o.findIndex(E=>E.route.id===R)}else if(p&&Qa(p[1])){let R=p[0];k=o.findIndex(E=>E.route.id===R)-1}let T=p?p[1].statusCode:void 0,U=T&&T>=400,w={currentUrl:C,currentParams:s.matches[0]?.params||{},nextUrl:x,nextParams:o[0].params,...l,actionResult:v,actionStatus:T},N=bi(o),H=o.map((R,E)=>{let{route:z}=R,F=null;if(k!=null&&E>k)F=!1;else if(z.lazy)F=!0;else if(!f_(z))F=!1;else if(c){let{shouldLoad:te}=Mx(z,s.loaderData,s.errors);F=te}else DM(s.loaderData,s.matches[E],R)&&(F=!0);if(F!==null)return c_(a,r,e,n,N,R,u,t,F);let I=!1;typeof g=="boolean"?I=g:U?I=!1:(d||C.pathname+C.search===x.pathname+x.search||C.search!==x.search||MM(s.matches[E],R))&&(I=!0);let A={...w,defaultShouldRevalidate:I};return c_(a,r,e,n,N,R,u,t,pu(R,A),A,g)}),ee=[];return m.forEach((R,E)=>{if(c||!o.some(Ye=>Ye.route.id===R.routeId)||h.has(E)||R.isDiscovering)return;let z=s.fetchers.get(E),F=z&&z.state!=="idle"&&z.data===void 0,I=y.match(R.path);if(!I){ee.push({key:E,routeId:R.routeId,path:R.path,matches:null,match:null,request:null,controller:null});return}if(_.has(E))return;let A=kf(I,R.path),te=new AbortController,J=Kl(i,R.path,te.signal),Re=null;if(f.has(E))f.delete(E),Re=Xl(a,r,J,R.path,I,A,u,t);else if(F)d&&(Re=Xl(a,r,J,R.path,I,A,u,t));else{let Ye;typeof g=="boolean"?Ye=g:U?Ye=!1:Ye=d;let it={...w,defaultShouldRevalidate:Ye};pu(A,it)&&(Re=Xl(a,r,J,R.path,I,A,u,t,it))}Re&&ee.push({key:E,routeId:R.routeId,path:R.path,matches:Re,match:A,request:J,controller:te})}),{dsMatches:H,revalidatingFetchers:ee}}function f_(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Mx(e,t,a){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!f_(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=a!=null&&a[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let s=!r&&!i;return{shouldLoad:s,renderFallback:s}}function DM(e,t,a){let r=!t||a.route.id!==t.route.id,i=!e.hasOwnProperty(a.route.id);return r||i}function MM(e,t){let a=e.route.path;return e.pathname!==t.pathname||a!=null&&a.endsWith("*")&&e.params["*"]!==t.params["*"]}function pu(e,t){if(e.route.shouldRevalidate){let a=e.route.shouldRevalidate(t);if(typeof a=="boolean")return a}return t.defaultShouldRevalidate}function fx(e,t,a,r,i,s){let o;if(e){let u=r[e];ne(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),o=u.children}else o=a.activeRoutes;let l=[],n=[];if(t.forEach(u=>{let c=o.find(d=>Tx(u,d));c?n.push({existingRoute:c,newRoute:u}):l.push(u)}),l.length>0){let u=$l(l,i,[e||"_","patch",String(o?.length||"0")],r);o.push(...u)}if(s&&n.length>0)for(let u=0;u<n.length;u++){let{existingRoute:c,newRoute:d}=n[u],f=c,[h]=$l([d],i,[],{},!0);Object.assign(f,{element:h.element?h.element:f.element,errorElement:h.errorElement?h.errorElement:f.errorElement,hydrateFallbackElement:h.hydrateFallbackElement?h.hydrateFallbackElement:f.hydrateFallbackElement})}a.hasHMRRoutes||a.setRoutes([...a.activeRoutes])}function Tx(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((a,r)=>t.children?.some(i=>Tx(a,i)))??!1:!1}var hx=new WeakMap,Ax=({key:e,route:t,manifest:a,mapRouteProperties:r})=>{let i=a[t.id];if(ne(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let s=i.lazy[e];if(!s)return;let o=hx.get(i);o||(o={},hx.set(i,o));let l=o[e];if(l)return l;let n=(async()=>{let u=KL(e),c=i[e]!==void 0;if(u)Je(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),o[e]=Promise.resolve();else if(c)Je(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let d=await s();d!=null&&(Object.assign(i,{[e]:d}),Object.assign(i,r(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(d=>d===void 0)&&(i.lazy=void 0))})();return o[e]=n,n},mx=new WeakMap;function TM(e,t,a,r,i){let s=a[e.id];if(ne(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let c=mx.get(s);if(c)return{lazyRoutePromise:c,lazyHandlerPromise:c};let d=(async()=>{ne(typeof e.lazy=="function","No lazy route function found");let f=await e.lazy(),h={};for(let m in f){let _=f[m];if(_===void 0)continue;let y=XL(m),p=s[m]!==void 0;y?Je(!y,"Route property "+m+" is not a supported property to be returned from a lazy route function. This property will be ignored."):p?Je(!p,`Route "${s.id}" has a static property "${m}" defined but its lazy function is also returning a value for this property. The lazy route property "${m}" will be ignored.`):h[m]=_}Object.assign(s,h),Object.assign(s,{...r(s),lazy:void 0})})();return mx.set(s,d),d.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:d}}let o=Object.keys(e.lazy),l=[],n;for(let c of o){if(i&&i.includes(c))continue;let d=Ax({key:c,route:e,manifest:a,mapRouteProperties:r});d&&(l.push(d),c===t&&(n=d))}let u=l.length>0?Promise.all(l).then(()=>{}):void 0;return u?.catch(()=>{}),n?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:n}}async function px(e){let t=e.matches.filter(r=>r.shouldLoad),a={};return(await Promise.all(t.map(r=>r.resolve()))).forEach((r,i)=>{a[t[i].route.id]=r}),a}async function AM(e){return e.matches.some(t=>t.route.middleware)?Bx(e,()=>px(e)):px(e)}function Bx(e,t){return BM(e,t,r=>{if(XM(r))throw r;return r},$M,a);async function a(r,i,s){if(s)return Object.assign(s.value,{[i]:{type:"error",result:r}});{let{matches:o}=e,l=Math.min(Math.max(o.findIndex(u=>u.route.id===i),0),Math.max(o.findIndex(u=>u.shouldCallHandler()),0)),n=o[l].route.id;for(let u of o.slice(0,l+1))try{await u._lazyPromises?.route}catch{n=u.route.id;break}return{[vs(o,n).route.id]:{type:"error",result:r}}}}}async function BM(e,t,a,r,i){let{matches:s,...o}=e;return await Ox(o,s.flatMap(l=>l.route.middleware?l.route.middleware.map(n=>[l.route.id,n]):[]),t,a,r,i)}async function Ox(e,t,a,r,i,s,o=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let n=t[o];if(!n)return await a();let[u,c]=n,d,f=async()=>{if(d)throw new Error("You may only call `next()` once per middleware");try{return d={value:await Ox(e,t,a,r,i,s,o+1)},d.value}catch(h){return d={value:await s(h,u,d)},d.value}};try{let h=await c(e,f),m=h!=null?r(h):void 0;return i(m)?m:d?m??d.value:(d={value:await f()},d.value)}catch(h){return await s(h,u,d)}}function Px(e,t,a,r,i){let s=Ax({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),o=TM(r.route,la(a.method)?"action":"loader",t,e,i);return{middleware:s,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function c_(e,t,a,r,i,s,o,l,n,u=null,c){let d=!1,f=Px(e,t,a,s,o);return{...s,_lazyPromises:f,shouldLoad:n,shouldRevalidateArgs:u,shouldCallHandler(h){return d=!0,u?typeof c=="boolean"?pu(s,{...u,defaultShouldRevalidate:c}):typeof h=="boolean"?pu(s,{...u,defaultShouldRevalidate:h}):pu(s,u):n},resolve(h){let{lazy:m,loader:_,middleware:y}=s.route,p=d||n||h&&!la(a.method)&&(m||_),g=y&&y.length>0&&!_&&!m;return p&&(la(a.method)||!g)?PM({request:a,path:r,pattern:i,match:s,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:h,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Xl(e,t,a,r,i,s,o,l,n=null){return i.map(u=>u.route.id!==s.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:n,shouldCallHandler:()=>!1,_lazyPromises:Px(e,t,a,u,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:c_(e,t,a,r,bi(i),u,o,l,!0,n))}async function OM(e,t,a,r,i,s,o){r.some(c=>c._lazyPromises?.middleware)&&await Promise.all(r.map(c=>c._lazyPromises?.middleware));let l={request:t,url:bf(t,a),pattern:bi(r),params:r[0].params,context:s,matches:r},u=await e({...l,fetcherKey:i,runClientMiddleware:o?()=>{throw new Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:c=>{let d=l;return Bx(d,()=>c({...d,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(c=>[c._lazyPromises?.handler,c._lazyPromises?.route]))}catch{}return u}async function PM({request:e,path:t,pattern:a,match:r,lazyHandlerPromise:i,lazyRoutePromise:s,handlerOverride:o,scopedContext:l}){let n,u,c=la(e.method),d=c?"action":"loader",f=h=>{let m,_=new Promise((g,v)=>m=v);u=()=>m(),e.signal.addEventListener("abort",u);let y=g=>typeof h!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)):h({request:e,url:bf(e,t),pattern:a,params:r.params,context:l},...g!==void 0?[g]:[]),p=(async()=>{try{return{type:"data",result:await(o?o(g=>y(g)):y())}}catch(g){return{type:"error",result:g}}})();return Promise.race([p,_])};try{let h=c?r.route.action:r.route.loader;if(i||s)if(h){let m,[_]=await Promise.all([f(h).catch(y=>{m=y}),i,s]);if(m!==void 0)throw m;n=_}else{await i;let m=c?r.route.action:r.route.loader;if(m)[n]=await Promise.all([f(m),s]);else if(d==="action"){let _=new URL(e.url),y=_.pathname+_.search;throw pr(405,{method:e.method,pathname:y,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(h)n=await f(h);else{let m=new URL(e.url);throw pr(404,{pathname:m.pathname+m.search})}}catch(h){return{type:"error",result:h}}finally{u&&e.signal.removeEventListener("abort",u)}return n}async function NM(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function HM(e){let{result:t,type:a}=e;if(h_(t)){let r;try{r=await NM(t)}catch(i){return{type:"error",error:i}}return a==="error"?{type:"error",error:new _s(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return a==="error"?Cx(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:VM(t),statusCode:So(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:So(t)?t.status:void 0}:Cx(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function zM(e,t,a,r,i){let s=e.headers.get("Location");if(ne(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!xf(s)){let o=r.slice(0,r.findIndex(l=>l.route.id===a)+1);s=u_(new URL(t.url),o,i,s),e.headers.set("Location",s)}return e}var UM=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Df(e){try{return UM.includes(new URL(e).protocol)}catch{return!1}}function gx(e,t,a,r){if(xf(e)){let i=e,s=_o.test(i)?new URL(_f(i,t.protocol)):new URL(i);if(Df(s.toString()))throw new Error("Invalid redirect location");let o=ea(s.pathname,a)!=null;if(s.origin===t.origin&&o)return wf(s.pathname)+s.search+s.hash}try{if(Df(r.createURL(e).toString()))throw new Error("Invalid redirect location")}catch{}return e}function Kl(e,t,a,r){let i=e.createURL(Nx(t)).toString(),s={signal:a};if(r&&la(r.formMethod)){let{formMethod:o,formEncType:l}=r;s.method=o.toUpperCase(),l==="application/json"?(s.headers=new Headers({"Content-Type":l}),s.body=JSON.stringify(r.json)):l==="text/plain"?s.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?s.body=d_(r.formData):s.body=r.formData}return new Request(i,s)}function d_(e){let t=new URLSearchParams;for(let[a,r]of e.entries())t.append(a,typeof r=="string"?r:r.name);return t}function _x(e){let t=new FormData;for(let[a,r]of e.entries())t.append(a,r);return t}function FM(e,t,a,r=!1,i=!1){let s={},o=null,l,n=!1,u={},c=a&&Qa(a[1])?a[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let f=d.route.id,h=t[f];if(ne(!Co(h),"Cannot handle redirect results in processLoaderData"),Qa(h)){let m=h.error;if(c!==void 0&&(m=c,c=void 0),o=o||{},i)o[f]=m;else{let _=vs(e,f);o[_.route.id]==null&&(o[_.route.id]=m)}r||(s[f]=kx),n||(n=!0,l=So(h.error)?h.error.status:500),h.headers&&(u[f]=h.headers)}else s[f]=h.data,h.statusCode&&h.statusCode!==200&&!n&&(l=h.statusCode),h.headers&&(u[f]=h.headers)}),c!==void 0&&a&&(o={[a[0]]:c},a[2]&&(s[a[2]]=void 0)),{loaderData:s,errors:o,statusCode:l||200,loaderHeaders:u}}function vx(e,t,a,r,i,s,o){let{loaderData:l,errors:n}=FM(t,a,r);return i.filter(u=>!u.matches||u.matches.some(c=>c.shouldLoad)).forEach(u=>{let{key:c,match:d,controller:f}=u;if(f&&f.signal.aborted)return;let h=s[c];if(ne(h,"Did not find corresponding fetcher result"),Qa(h)){let m=vs(e.matches,d?.route.id);n&&n[m.route.id]||(n={...n,[m.route.id]:h.error}),o.delete(c)}else if(Co(h))ne(!1,"Unhandled fetcher revalidation redirect");else{let m=jr(h.data);o.set(c,m)}}),{loaderData:l,errors:n}}function Sx(e,t,a,r){let i=Object.entries(t).filter(([,o])=>o!==kx).reduce((o,[l,n])=>(o[l]=n,o),{}),s=0;for(let o of a){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(i[l]=e[l],s++),r&&r.hasOwnProperty(l))break}return Object.keys(t).length===0&&s===Object.keys(e).length?e:i}function yx(e){return e?Qa(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function vs(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.ErrorBoundary!=null||a.route.errorElement!=null)||e[0]}function If(e){let t=e.length===1?e[0]:e.find(a=>a.index||!a.path||a.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function pr(e,{pathname:t,routeId:a,method:r,type:i,message:s}={}){let o="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(o="Bad Request",r&&t&&a?l=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${a}", so there is no way to handle the request.`:i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(o="Forbidden",l=`Route "${a}" does not match URL "${t}"`):e===404?(o="Not Found",l=`No route matches URL "${t}"`):e===405&&(o="Method Not Allowed",r&&t&&a?l=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${a}", so there is no way to handle the request.`:r&&(l=`Invalid request method "${r.toUpperCase()}"`)),new _s(e||500,o,new Error(l),!0)}function Ef(e){let t=Object.entries(e);for(let a=t.length-1;a>=0;a--){let[r,i]=t[a];if(Co(i))return{key:r,result:i}}}function Nx(e){return It({...typeof e=="string"?ga(e):e,hash:""})}function qM(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function VM(e){return new _s(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function $M(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,a])=>typeof t=="string"&&WM(a))}function WM(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function GM(e){return h_(e.result)&&Rx.has(e.result.status)}function Qa(e){return e.type==="error"}function Co(e){return(e&&e.type)==="redirect"}function Cx(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function h_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function KM(e){return Rx.has(e)}function XM(e){return h_(e)&&KM(e.status)&&e.headers.has("Location")}function YM(e){return bM.has(e.toUpperCase())}function la(e){return xM.has(e.toUpperCase())}function m_(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function kf(e,t){let a=typeof t=="string"?ga(t).search:t.search;if(e[e.length-1].route.index&&m_(a||""))return e[e.length-1];let r=t_(e);return r[r.length-1]}function Lx(e,t,a){return{url:bf(e.createURL(t),t),pattern:a?bi(a):"",params:a?.[0]?.params?{...a[0].params}:{}}}function xx(e){let{formMethod:t,formAction:a,formEncType:r,text:i,formData:s,json:o}=e;if(!(!t||!a||!r)){if(i!=null)return{formMethod:t,formAction:a,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:t,formAction:a,formEncType:r,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:a,formEncType:r,formData:void 0,json:o,text:void 0}}}function n_(e,t,a,r){return r?{state:"loading",location:e,matches:t,historyAction:a,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:e,matches:t,historyAction:a,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function jM(e,t,a,r){return{state:"submitting",location:e,matches:t,historyAction:a,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function mu(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function ZM(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function jr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function QM(e,t){try{let a=e.sessionStorage.getItem(Ex);if(a){let r=JSON.parse(a);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(i,new Set(s||[]))}}catch{}}function JM(e,t){if(t.size>0){let a={};for(let[r,i]of t)a[r]=[...i];try{e.sessionStorage.setItem(Ex,JSON.stringify(a))}catch(r){Je(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function wx(){let e,t,a=new Promise((r,i)=>{e=async s=>{r(s);try{await a}catch{}},t=async s=>{i(s);try{await a}catch{}}});return{promise:a,resolve:e,reject:t}}var Ht=P(ye(),1);var Ss=Ht.createContext(null);Ss.displayName="DataRouter";var gu=Ht.createContext(null);gu.displayName="DataRouterState";var _u=Ht.createContext(null);_u.displayName="DataRouterData";var Lo=Ht.createContext(null);Lo.displayName="DataRouterNavigation";var p_=Ht.createContext(!1);function Mf(){return Ht.useContext(p_)}var vu=Ht.createContext({isTransitioning:!1});vu.displayName="ViewTransition";var Tf=Ht.createContext(null);Tf.displayName="Fetchers";var g_=Ht.createContext(null);g_.displayName="Await";var na=Ht.createContext(null);na.displayName="Navigation";var xo=Ht.createContext(null);xo.displayName="Location";var gr=Ht.createContext({outlet:null,matches:[],isDataRoute:!1});gr.displayName="Route";var Su=Ht.createContext(!1);Su.displayName="IsDataRoute";var yu=Ht.createContext(void 0);yu.displayName="RouteId";var Af=Ht.createContext(null);Af.displayName="RouteError";var Hx="REACT_ROUTER_ERROR",eT="REDIRECT",tT="ROUTE_ERROR_RESPONSE";function zx(e){if(e.startsWith(`${Hx}:${eT}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Ux(e){if(e.startsWith(`${Hx}:${tT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new _s(t.status,t.statusText,t.data)}catch{}}var Y=P(ye(),1);function v_(e,{relative:t}={}){ne(ys(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:r}=Y.useContext(na),{hash:i,pathname:s,search:o}=wo(e,{relative:t}),l=s;return a!=="/"&&(l=s==="/"?a:Ta([a,s])),r.createHref({pathname:l,search:o,hash:i})}function ys(){return Y.useContext(xo)!=null}function vt(){return ne(ys(),"useLocation() may be used only in the context of a <Router> component."),Y.useContext(xo).location}function Bf(e){ne(ys(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=vt();return Y.useMemo(()=>vo(e,e_(t)),[t,e])}var qx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Zr(){return Y.useContext(Su)?cT():aT()}function aT(){ne(ys(),"useNavigate() may be used only in the context of a <Router> component.");let e=Y.useContext(Ss),{basename:t,navigator:a}=Y.useContext(na),{matches:r}=Y.useContext(gr),{pathname:i}=vt(),s=JSON.stringify(Wl(r)),o=Y.useRef(!1);return Y.useLayoutEffect(()=>{o.current=!0}),Y.useCallback((l,n={})=>{if(Je(o.current,qx),!o.current)return;if(typeof l=="number"){a.go(l);return}let u=gs(l,JSON.parse(s),i,n.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Ta([t,u.pathname])),yo(typeof l=="string"?l:It(l),a.createHref(u),o_(a),"reject"),(n.replace?a.replace:a.push)(u,n.state,n)},[t,a,s,i,e])}var rT=Y.createContext(null);function S_(e){let t=Y.useContext(gr).outlet;return Y.useMemo(()=>t&&Y.createElement(rT.Provider,{value:e},t),[t,e])}function Cs(){let{matches:e}=Y.useContext(gr);return e[e.length-1]?.params??{}}function wo(e,{relative:t}={}){let{matches:a}=Y.useContext(gr),{pathname:r}=vt(),i=JSON.stringify(Wl(a));return Y.useMemo(()=>gs(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function Vx(e,t,a){ne(ys(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=Y.useContext(na),{matches:i}=Y.useContext(gr),s=i[i.length-1],o=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let n=vt(),u;if(t){let m=typeof t=="string"?ga(t):t;ne(l==="/"||m.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${m.pathname}" was given in the \`location\` prop.`),u=m}else u=n;let c=u.pathname||"/",d=c;if(l!=="/"){let m=l.replace(/^\//,"").split("/");d="/"+c.replace(/^\//,"").split("/").slice(m.length).join("/")}let f;a?a.state.matches.length?f=a.state.matches.map(m=>Object.assign(m,{route:a.manifest[m.route.id]||m.route})):f=a.router.match(a.state.location):f=YL(e,{pathname:d});let h=$x(f&&f.map(m=>Object.assign({},m,{params:Object.assign({},o,m.params),pathname:Ta([l,r.encodeLocation?r.encodeLocation(m.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?l:Ta([l,r.encodeLocation?r.encodeLocation(m.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathnameBase])})),i,a);return t&&h?Y.createElement(xo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...u},navigationType:"POP"}},h):h}function iT(){let e=C_(),t=So(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null;return Y.createElement(Y.Fragment,null,Y.createElement("h2",null,"Unexpected Application Error!"),Y.createElement("h3",{style:{fontStyle:"italic"}},t),a?Y.createElement("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"}},a):null,null)}var sT=Y.createElement(iT,null),oT=class extends Y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=p_;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let a=Ux(e.digest);a&&(e=a)}let t=e!==void 0?Y.createElement(gr.Provider,{value:this.props.routeContext},Y.createElement(Su.Provider,{value:this.props.routeContext.isDataRoute},Y.createElement(yu.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},Y.createElement(Af.Provider,{value:e,children:this.props.component})))):this.props.children;return this.context?Y.createElement(lT,{error:e},t):t}},__=new WeakMap;function lT({children:e,error:t}){let{basename:a,navigator:r}=Y.useContext(na);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=zx(t.digest);if(i){let s=__.get(t);if(s)throw s;let o=Rf(i.location,a),l=o.absoluteURL||o.to;if(yo(i.location,l,o_(r),"allow-explicit"),Df(l))throw new Error("Invalid redirect location");if(a_&&!__.get(t))if(o.isExternal||i.reloadDocument)window.location.href=l;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:i.replace}));throw __.set(t,n),n}return Y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function nT({routeContext:e,match:t,children:a}){let r=Y.useContext(Ss);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),Y.createElement(gr.Provider,{value:e},Y.createElement(Su.Provider,{value:e.isDataRoute},Y.createElement(yu.Provider,{value:t.route.id},a)))}function $x(e,t=[],a){let r=a?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,s=r?.errors;if(s!=null){let c=i.findIndex(d=>d.route.id&&s?.[d.route.id]!==void 0);ne(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,c+1))}let o=!1,l=-1;if(a&&r){o=r.renderFallback;for(let c=0;c<i.length;c++){let d=i[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=c),d.route.id){let{loaderData:f,errors:h}=r,m=d.route.loader&&!f.hasOwnProperty(d.route.id)&&(!h||h[d.route.id]===void 0);if(d.route.lazy||m){a.isStatic&&(o=!0),l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}}let n=a?.onError,u=r&&n?(c,d)=>{n(c,{location:r.location,params:r.matches?.[0]?.params??{},pattern:bi(r.matches),errorInfo:d})}:void 0;return i.reduceRight((c,d,f)=>{let h,m=!1,_=null,y=null;r&&(h=s&&d.route.id?s[d.route.id]:void 0,_=d.route.errorElement||sT,o&&(l<0&&f===0?(dT("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,y=null):l===f&&(m=!0,y=d.route.hydrateFallbackElement||null)));let p=t.concat(i.slice(0,f+1)),g=()=>{let v;return h?v=_:m?v=y:d.route.Component?v=Y.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=c,Y.createElement(nT,{match:d,routeContext:{outlet:c,matches:p,isDataRoute:r!=null},children:v})};return r&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?Y.createElement(oT,{location:r.location,revalidation:r.revalidation,component:_,error:h,children:g(),routeContext:{outlet:null,matches:p,isDataRoute:!0},onError:u}):g()},null)}function Of(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bo(e){let t=Y.useContext(Ss);return ne(t,Of(e)),t}function Cu(e){let t=Y.useContext(gu);return ne(t,Of(e)),t}function Pf(e){let t=Y.useContext(_u);return ne(t,Of(e)),t}function uT(e){let t=Y.useContext(Lo);return ne(t,Of(e)),t}function Nf(e){let t=Y.useContext(yu);return ne(t,`${e} can only be used on routes that contain a unique "id"`),t}function y_(){let{navigation:e}=uT("useNavigation");return Y.useMemo(()=>{let{matches:t,historyAction:a,...r}=e;return r},[e])}function Lu(){let{matches:e}=Cu("useMatches"),{loaderData:t}=Pf("useMatches");return Y.useMemo(()=>e.map(a=>Lf(a,t)),[e,t])}function C_(){let e=Y.useContext(Af),t=Pf("useRouteError"),a=Nf("useRouteError");return e!==void 0?e:t.errors?.[a]}function cT(){let{router:e}=bo("useNavigate"),t=Nf("useNavigate"),a=Y.useRef(!1);return Y.useLayoutEffect(()=>{a.current=!0}),Y.useCallback(async(r,i={})=>{Je(a.current,qx),a.current&&(typeof r=="number"?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Fx={};function dT(e,t,a){!t&&!Fx[e]&&(Fx[e]=!0,Je(!1,a))}var Wx={};function L_(e,t){!e&&!Wx[t]&&(Wx[t]=!0,console.warn(t))}var ae=P(ye(),1),Kx=P(ye(),1);var x_=["HydrateFallback","hydrateFallbackElement"];var gT=class{status="pending";promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=a=>{this.status==="pending"&&(this.status="resolved",e(a))},this.reject=a=>{this.status==="pending"&&(this.status="rejected",t(a))}})}};function w_({router:e,flushSync:t,onError:a,useTransitions:r}){r=Mf()||r;let[i,s]=ae.useState(e.state),[o,l]=(0,Kx.useOptimistic)(i),[n,u]=ae.useState(),[c,d]=ae.useState({isTransitioning:!1}),[f,h]=ae.useState(),[m,_]=ae.useState(),[y,p]=ae.useState(),g=ae.useRef(new Map),v=ae.useCallback((H,{deletedFetchers:ee,newErrors:R,flushSync:E,viewTransitionOpts:z})=>{R&&a&&Object.values(R).forEach(I=>a(I,{location:H.location,params:H.matches[0]?.params??{},pattern:bi(H.matches)})),H.fetchers.forEach((I,A)=>{I.data!==void 0&&g.current.set(A,I.data)}),ee.forEach(I=>g.current.delete(I)),L_(E===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let F=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(L_(z==null||F,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!z||!F){t&&E?t(()=>s(H)):r===!1?s(H):ae.startTransition(()=>{r===!0&&l(I=>Gx(I,H)),s(H)});return}if(t&&E){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:z.currentLocation,nextLocation:z.nextLocation})});let I=e.window.document.startViewTransition(()=>{t(()=>s(H))});I.finished.finally(()=>{t(()=>{h(void 0),_(void 0),u(void 0),d({isTransitioning:!1})})}),t(()=>_(I));return}m?(f?.resolve(),m.skipTransition(),p({state:H,currentLocation:z.currentLocation,nextLocation:z.nextLocation})):(u(H),d({isTransitioning:!0,flushSync:!1,currentLocation:z.currentLocation,nextLocation:z.nextLocation}))},[e.window,t,m,f,r,l,a]);ae.useLayoutEffect(()=>e.subscribe(v),[e,v]),ae.useEffect(()=>{c.isTransitioning&&!c.flushSync&&h(new gT)},[c]),ae.useEffect(()=>{if(f&&n&&e.window){let H=n,ee=f.promise,R=e.window.document.startViewTransition(async()=>{r===!1?s(H):ae.startTransition(()=>{r===!0&&l(E=>Gx(E,H)),s(H)}),await ee});R.finished.finally(()=>{h(void 0),_(void 0),u(void 0),d({isTransitioning:!1})}),_(R)}},[n,f,e.window,r,l]),ae.useEffect(()=>{f&&n&&o.location.key===n.location.key&&f.resolve()},[f,m,o.location,n]),ae.useEffect(()=>{!c.isTransitioning&&y&&(u(y.state),d({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),p(void 0))},[c.isTransitioning,y]);let C=ae.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:H=>e.navigate(H),push:(H,ee,R)=>e.navigate(H,{state:ee,preventScrollReset:R?.preventScrollReset}),replace:(H,ee,R)=>e.navigate(H,{replace:!0,state:ee,preventScrollReset:R?.preventScrollReset})}),[e]),x=e.basename||"/",k=ae.useMemo(()=>({router:e,navigator:C,static:!1,basename:x,onError:a}),[e,C,x,a]),T=ae.useMemo(()=>({historyAction:o.historyAction,location:o.location,matches:o.matches,initialized:o.initialized,renderFallback:o.renderFallback,restoreScrollPosition:o.restoreScrollPosition,preventScrollReset:o.preventScrollReset,blockers:o.blockers}),[o.historyAction,o.location,o.matches,o.initialized,o.renderFallback,o.restoreScrollPosition,o.preventScrollReset,o.blockers]),U=ae.useMemo(()=>({navigation:o.navigation,revalidation:o.revalidation}),[o.navigation,o.revalidation]),w=ae.useMemo(()=>({loaderData:o.loaderData,actionData:o.actionData,errors:o.errors}),[o.loaderData,o.actionData,o.errors]),N=ae.useMemo(()=>({fetchers:o.fetchers,fetcherData:g.current}),[o.fetchers]);return ae.createElement(ae.Fragment,null,ae.createElement(Ss.Provider,{value:k},ae.createElement(gu.Provider,{value:T},ae.createElement(Lo.Provider,{value:U},ae.createElement(_u.Provider,{value:w},ae.createElement(Tf.Provider,{value:N},ae.createElement(vu.Provider,{value:c},ae.createElement(Hf,{basename:x,location:o.location,navigationType:o.historyAction,navigator:C,useTransitions:r},ae.createElement(_T,{routes:e.routes,manifest:e.manifest,state:o,isStatic:!1,onError:a})))))))),null)}function Gx(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var _T=ae.memo(vT);function vT({routes:e,manifest:t,state:a,isStatic:r,onError:i}){let s=ae.useContext(Ss);return ne(s,"You must render this element inside a <DataRouterContext.Provider> element"),Vx(e,void 0,{router:s.router,manifest:t,state:a,isStatic:r,onError:i})}function b_(e){return S_(e.context)}function Hf({basename:e="/",children:t=null,location:a,navigationType:r="POP",navigator:i,static:s=!1,useTransitions:o}){ne(!ys(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),n=ae.useMemo(()=>({basename:l,navigator:i,static:s,useTransitions:o,future:{}}),[l,i,s,o]);typeof a=="string"&&(a=ga(a));let{pathname:u="/",search:c="",hash:d="",state:f=null,key:h="default",mask:m}=a,_=ae.useMemo(()=>{let y=ea(u,l);return y==null?null:{location:{pathname:y,search:c,hash:d,state:f,key:h,mask:m},navigationType:r}},[l,u,c,d,f,h,r,m]);return Je(_!=null,`<Router basename="${l}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:ae.createElement(na.Provider,{value:n},ae.createElement(xo.Provider,{children:t,value:_}))}var Uf="application/x-www-form-urlencoded";function Ff(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function ST(e){return Ff(e)&&e.tagName.toLowerCase()==="button"}function yT(e){return Ff(e)&&e.tagName.toLowerCase()==="form"}function CT(e){return Ff(e)&&e.tagName.toLowerCase()==="input"}function LT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Xx(e,t){return e.button===0&&(!t||t==="_self")&&!LT(e)}var zf=null;function xT(){if(zf===null)try{new FormData(document.createElement("form"),0),zf=!1}catch{zf=!0}return zf}var wT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function R_(e){return e!=null&&!wT.has(e)?(Je(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Uf}"`),null):e}function Yx(e,t){let a,r,i,s,o;if(yT(e)){let l=e.getAttribute("action");r=l?ea(l,t):null,a=e.getAttribute("method")||"get",i=R_(e.getAttribute("enctype"))||Uf,s=new FormData(e)}else if(ST(e)||CT(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let n=e.getAttribute("formaction")||l.getAttribute("action");if(r=n?ea(n,t):null,a=e.getAttribute("formmethod")||l.getAttribute("method")||"get",i=R_(e.getAttribute("formenctype"))||R_(l.getAttribute("enctype"))||Uf,s=new FormData(l,e),!xT()){let{name:u,type:c,value:d}=e;if(c==="image"){let f=u?`${u}.`:"";s.append(`${f}x`,"0"),s.append(`${f}y`,"0")}else u&&s.append(u,d)}}else{if(Ff(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a="get",r=null,i=Uf,o=e}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:a.toLowerCase(),encType:i,formData:s,body:o}}function jx(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var bT={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},RT=/[&><\u2028\u2029]/g;function I_(e){return e.replace(RT,t=>bT[t])}var E_=P(ye(),1);function k_(e,t){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${t}`:a.pathname=`${a.pathname}.${t}`,a}async function Zx(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(a){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&import.meta.hot)throw a;return window.location.reload(),new Promise(()=>{})}}function Qx(e){return e!=null&&typeof e.page=="string"}function IT(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Jx(e,t,a){return DT((await Promise.all(e.map(async r=>{let i=t.routes[r.route.id];if(i){let s=await Zx(i,a);return s.links?s.links():[]}return[]}))).flat(1).filter(IT).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function D_(e,t,a,r,i,s){let o=(n,u)=>a[u]?n.route.id!==a[u].route.id:!0,l=(n,u)=>a[u].pathname!==n.pathname||a[u].route.path?.endsWith("*")&&a[u].params["*"]!==n.params["*"];return s==="assets"?t.filter((n,u)=>o(n,u)||l(n,u)):s==="data"?t.filter((n,u)=>{let c=r.routes[n.route.id];if(!c||!c.hasLoader)return!1;if(o(n,u)||l(n,u))return!0;if(n.route.shouldRevalidate){let d=n.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:a[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:n.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function ew(e,t,{includeHydrateFallback:a}={}){return ET(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),a&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function ET(e){return[...new Set(e)]}function kT(e){let t={},a=Object.keys(e).sort();for(let r of a)t[r]=e[r];return t}function DT(e,t){let a=new Set,r=new Set(t);return e.reduce((i,s)=>{if(t&&!Qx(s)&&s.as==="script"&&s.href&&r.has(s.href))return i;let o=JSON.stringify(kT(s));return a.has(o)||(a.add(o),i.push({key:o,link:s})),i},[])}var we=P(ye(),1);var wu=we.createContext(void 0);wu.displayName="FrameworkContext";function M_(){let e=we.useContext(wu);return jx(e,"You must render this element inside a <HydratedRouter> element"),e}function tw(e,t){let a=we.useContext(wu),[r,i]=we.useState(!1),[s,o]=we.useState(!1),{onFocus:l,onBlur:n,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,f=we.useRef(null);we.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let _=p=>{p.forEach(g=>{o(g.isIntersecting)})},y=new IntersectionObserver(_,{threshold:.5});return f.current&&y.observe(f.current),()=>{y.disconnect()}}},[e]),we.useEffect(()=>{if(r){let _=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(_)}}},[r]);let h=()=>{i(!0)},m=()=>{i(!1),o(!1)};return a?e!=="intent"?[s,f,{}]:[s,f,{onFocus:xu(l,h),onBlur:xu(n,m),onMouseEnter:xu(u,h),onMouseLeave:xu(c,m),onTouchStart:xu(d,h)}]:[!1,f,{}]}function xu(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function aw({page:e,...t}){let a=Mf(),{nonce:r}=M_(),{router:i}=bo("PrefetchPageLinks"),s=we.useMemo(()=>i.match(e),[i,i.routes,e]);return s?(t.nonce==null&&r&&(t={...t,nonce:r}),a?we.createElement(TT,{page:e,matches:s,...t}):we.createElement(AT,{page:e,matches:s,...t})):null}function MT(e){let{manifest:t,routeModules:a}=M_(),[r,i]=we.useState([]);return we.useEffect(()=>{let s=!1;return Jx(e,t,a).then(o=>{s||i(o)}),()=>{s=!0}},[e,t,a]),r}function TT({page:e,matches:t,...a}){let r=vt(),i=we.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let s=k_(e,"rsc"),o=!1,l=[];for(let n of t)typeof n.route.shouldRevalidate=="function"?o=!0:l.push(n.route.id);return o&&l.length>0&&s.searchParams.set("_routes",l.join(",")),[s.pathname+s.search]},[e,r,t]);return we.createElement(we.Fragment,null,i.map(s=>we.createElement("link",{key:s,rel:"prefetch",as:"fetch",href:s,...a})))}function AT({page:e,matches:t,...a}){let r=vt(),{manifest:i,routeModules:s}=M_(),{matches:o}=Cu("PrefetchPageLinks"),{loaderData:l}=Pf("PrefetchPageLinks"),n=we.useMemo(()=>D_(e,t,o,i,r,"data"),[e,t,o,i,r]),u=we.useMemo(()=>D_(e,t,o,i,r,"assets"),[e,t,o,i,r]),c=we.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let h=new Set,m=!1;if(t.forEach(y=>{let p=i.routes[y.route.id];!p||!p.hasLoader||(!n.some(g=>g.route.id===y.route.id)&&y.route.id in l&&s[y.route.id]?.shouldRevalidate||p.hasClientLoader?m=!0:h.add(y.route.id))}),h.size===0)return[];let _=k_(e,"data");return m&&h.size>0&&_.searchParams.set("_routes",t.filter(y=>h.has(y.route.id)).map(y=>y.route.id).join(",")),[_.pathname+_.search]},[l,r,i,n,t,e,s]),d=we.useMemo(()=>ew(u,i),[u,i]),f=MT(u);return we.createElement(we.Fragment,null,c.map(h=>we.createElement("link",{key:h,rel:"prefetch",as:"fetch",href:h,...a})),d.map(h=>we.createElement("link",{key:h,rel:"modulepreload",href:h,...a})),f.map(({key:h,link:m})=>we.createElement("link",{key:h,nonce:a.nonce,...m,crossOrigin:m.crossOrigin??a.crossOrigin})))}function rw(...e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}var re=P(ye(),1);var OT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{OT&&(window.__reactRouterVersion="8")}catch{}function B_(e,t){return Dx({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:qL({window:t?.window}),hydrationData:t?.hydrationData||PT(),routes:e,mapRouteProperties:Cf,hydrationRouteProperties:x_,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function PT(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:NT(e.errors)}),e}function NT(e){if(!e)return null;let t=Object.entries(e),a={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")a[r]=new _s(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(typeof i.__subType=="string"&&tx.includes(i.__subType)){let s=window[i.__subType];if(typeof s=="function")try{let o=new s(i.message);o.stack="",a[r]=o}catch{}}if(a[r]==null){let s=new Error(i.message);s.stack="",a[r]=s}}else a[r]=i;return a}function iw({basename:e,children:t,history:a,useTransitions:r}){let[i,s]=re.useState({action:a.action,location:a.location}),o=re.useCallback(l=>{r===!1?s(l):re.startTransition(()=>s(l))},[r]);return re.useLayoutEffect(()=>a.listen(o),[a,o]),re.createElement(Hf,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:a,useTransitions:r})}iw.displayName="unstable_HistoryRouter";var _r=re.forwardRef(function({onClick:t,discover:a="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,mask:l,state:n,target:u,to:c,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:h,...m},_){let{basename:y,navigator:p,useTransitions:g}=re.useContext(na),v=typeof c=="string"&&ql.test(c),C=Rf(c,y);c=C.to;let x=v_(c,{relative:i}),k=vt(),T=null;if(l){let z=gs(l,[],k.mask?k.mask.pathname:"/",!0);y!=="/"&&(z.pathname=z.pathname==="/"?y:Ta([y,z.pathname])),T=p.createHref(z)}let[U,w,N]=tw(r,m),H=lw(c,{replace:o,mask:l,state:n,target:u,preventScrollReset:d,relative:i,viewTransition:f,defaultShouldRevalidate:h,useTransitions:g});function ee(z){t&&t(z),z.defaultPrevented||H(z)}let R=!(C.isExternal||s),E=re.createElement("a",{...m,...N,href:(R?T:void 0)||C.absoluteURL||x,onClick:R?ee:t,ref:rw(_,w),target:u,"data-discover":!v&&a==="render"?"true":void 0});return U&&!v?re.createElement(re.Fragment,null,E,re.createElement(aw,{page:x})):E});_r.displayName="Link";var Vf=re.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:l,children:n,...u},c){let d=wo(o,{relative:u.relative}),f=vt(),h=re.useContext(Lo),{navigator:m,basename:_}=re.useContext(na),y=h!=null&&dw(d)&&l===!0,p=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,g=f.pathname,v=h?.navigation.location?h.navigation.location.pathname:null;a||(g=g.toLowerCase(),v=v?v.toLowerCase():null,p=p.toLowerCase()),v&&_&&(v=ea(v,_)||v);let C=p!=="/"&&p.endsWith("/")?p.length-1:p.length,x=g===p||!i&&g.startsWith(p)&&g.charAt(C)==="/",k=v!=null&&(v===p||!i&&v.startsWith(p)&&v.charAt(C)==="/"),T={isActive:x,isPending:k,isTransitioning:y},U=x?t:void 0,w;typeof r=="function"?w=r(T):w=[r,x?"active":null,k?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let N=typeof s=="function"?s(T):s;return re.createElement(_r,{...u,"aria-current":U,className:w,ref:c,style:N,to:o,viewTransition:l},typeof n=="function"?n(T):n)});Vf.displayName="NavLink";var sw=re.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:r,replace:i,state:s,method:o="get",action:l,onSubmit:n,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:f,...h},m)=>{let{useTransitions:_}=re.useContext(na),y=nw(),p=uw(l,{relative:u}),g=o.toLowerCase()==="get"?"get":"post",v=typeof l=="string"&&ql.test(l);return re.createElement("form",{ref:m,method:g,action:p,onSubmit:r?n:x=>{if(n&&n(x),x.defaultPrevented)return;x.preventDefault();let k=x.nativeEvent.submitter,T=k?.getAttribute("formmethod")||o,U=()=>y(k||x.currentTarget,{fetcherKey:t,method:T,navigate:a,replace:i,state:s,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:f});_&&a!==!1?re.startTransition(()=>U()):U()},...h,"data-discover":!v&&e==="render"?"true":void 0})});sw.displayName="Form";function ow({getKey:e,storageKey:t,...a}){let r=re.useContext(wu),{basename:i}=re.useContext(na),s=vt(),o=Lu();cw({getKey:e,storageKey:t});let l=re.useMemo(()=>{if(!r||!e)return null;let u=A_(s,o,i,e);return u!==s.key?u:null},[]);if(!r||r.isSpaMode)return null;let n=((u,c)=>{if(!window.history.state||!window.history.state.key){let d=Math.random().toString(32).slice(2);window.history.replaceState({key:d},"")}try{let d=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof d=="number"&&window.scrollTo(0,d)}catch(d){console.error(d),sessionStorage.removeItem(u)}}).toString();return a.nonce==null&&r?.nonce&&(a.nonce=r.nonce),re.createElement("script",{...a,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${n})(${I_(JSON.stringify(t||T_))}, ${I_(JSON.stringify(l))})`}})}ow.displayName="ScrollRestoration";function lw(e,{target:t,replace:a,mask:r,state:i,preventScrollReset:s,relative:o,viewTransition:l,defaultShouldRevalidate:n,useTransitions:u}={}){let c=Zr(),d=vt(),f=wo(e,{relative:o});return re.useCallback(h=>{if(Xx(h,t)){h.preventDefault();let m=a!==void 0?a:It(d)===It(f),_=()=>c(e,{replace:m,mask:r,state:i,preventScrollReset:s,relative:o,viewTransition:l,defaultShouldRevalidate:n});u?re.startTransition(()=>_()):_()}},[d,c,f,a,r,i,t,e,s,o,l,n,u])}var HT=0,zT=()=>`__${String(++HT)}__`;function nw(){let{router:e}=bo("useSubmit"),{basename:t}=re.useContext(na),a=Nf("useSubmit"),r=e.fetch,i=e.navigate;return re.useCallback(async(s,o={})=>{let{action:l,method:n,encType:u,formData:c,body:d}=Yx(s,t);o.navigate===!1?await r(o.fetcherKey||zT(),a,o.action||l,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,relative:o.relative,formData:c,body:d,formMethod:o.method||n,formEncType:o.encType||u,flushSync:o.flushSync}):await i(o.action||l,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,relative:o.relative,formData:c,body:d,formMethod:o.method||n,formEncType:o.encType||u,replace:o.replace,state:o.state,fromRouteId:a,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,t,a])}function uw(e,{relative:t}={}){let{basename:a}=re.useContext(na),r=re.useContext(gr);ne(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...wo(e||".",{relative:t})},o=vt();if(e==null){s.search=o.search;let l=new URLSearchParams(s.search),n=l.getAll("index");if(n.some(u=>u==="")){l.delete("index"),n.filter(c=>c).forEach(c=>l.append("index",c));let u=l.toString();s.search=u?`?${u}`:""}}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(s.pathname=s.pathname==="/"?a:Ta([a,s.pathname])),It(s)}var T_="react-router-scroll-positions",qf={};function A_(e,t,a,r){let i=null;return r&&(a!=="/"?i=r({...e,pathname:ea(e.pathname,a)||e.pathname},t):i=r(e,t)),i==null&&(i=e.key),i}function cw({getKey:e,storageKey:t}={}){let{router:a}=bo("useScrollRestoration"),{restoreScrollPosition:r,preventScrollReset:i}=Cu("useScrollRestoration"),{basename:s}=re.useContext(na),o=vt(),l=Lu(),n=y_();re.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),FT(re.useCallback(u=>{u.persisted&&(window.history.scrollRestoration="manual")},[])),UT(re.useCallback(()=>{if(n.state==="idle"){let u=A_(o,l,s,e);qf[u]=window.scrollY}try{sessionStorage.setItem(t||T_,JSON.stringify(qf))}catch(u){Je(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[n.state,e,s,o,l,t])),typeof document<"u"&&(re.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||T_);u&&(qf=JSON.parse(u))}catch{}},[t]),re.useLayoutEffect(()=>{let u=a?.enableScrollRestoration(qf,()=>window.scrollY,e?(c,d)=>A_(c,d,s,e):void 0);return()=>u&&u()},[a,s,e]),re.useLayoutEffect(()=>{if(r!==!1){if(typeof r=="number"){window.scrollTo(0,r);return}try{if(o.hash){let u=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{Je(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function UT(e,t){let{capture:a}=t||{};re.useEffect(()=>{let r=a!=null?{capture:a}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,a])}function FT(e,t){let{capture:a}=t||{};re.useEffect(()=>{let r=a!=null?{capture:a}:void 0;return window.addEventListener("pageshow",e,r),()=>{window.removeEventListener("pageshow",e,r)}},[e,a])}function dw(e,{relative:t}={}){let a=re.useContext(vu);ne(a!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=bo("useViewTransitionState"),i=wo(e,{relative:t});if(!a.isTransitioning)return!1;let s=ea(a.currentLocation.pathname,r)||a.currentLocation.pathname,o=ea(a.nextLocation.pathname,r)||a.nextLocation.pathname;return vo(i.pathname,o)!=null||vo(i.pathname,s)!=null}var Oi=P(ye(),1);var Ls=P(ye(),1);function Et(e,t){try{let a=localStorage.getItem(e);return a===null?t:JSON.parse(a)}catch{return t}}function ua(e,t){try{t===void 0?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t))}catch{}}function fw(){try{let e=sessionStorage.getItem("adoc.session");return e||(e=Math.random().toString(36).slice(2,10),sessionStorage.setItem("adoc.session",e)),e}catch{return"anonymous"}}var bu={get(e){return Et("adoc.seen",{})[e]},set(e,t){ua("adoc.seen",{...Et("adoc.seen",{}),[e]:t})}};var yw=P(W(),1),O_=new Set;function xs(e){Yl?.readyState===WebSocket.OPEN&&Yl.send(JSON.stringify(e))}function gw(e){return O_.add(e),()=>O_.delete(e)}var _w={status:"connecting",revision:0,changed:{keys:[],tick:0},messages:[],connection:0},vw=(0,Ls.createContext)(_w),Yl;function Wf(e){Yl?.readyState===WebSocket.OPEN&&Yl.send(JSON.stringify({type:"activity",location:e}))}function Sw({children:e,onNavigate:t}){let[a,r]=(0,Ls.useState)(_w);return(0,Ls.useEffect)(()=>{let i,s=!1,o=()=>{let l=new WebSocket(`${location.protocol==="https:"?"wss":"ws"}://${location.host}/api/events?session=${fw()}`);Yl=l,l.onopen=()=>Wf(location.pathname+location.hash),l.onmessage=n=>{let u=JSON.parse(String(n.data));if(u.type==="navigate"){t(u.location);return}if(typeof u.type=="string"&&u.type.startsWith("terminal.")){for(let c of O_)c(u);return}r(c=>u.type==="hello"?{...c,status:"connected",revision:c.revision+1,messages:u.messages,agent:u.agent,connection:c.connection+1,changed:{keys:["*"],tick:c.changed.tick+1}}:u.type==="agent"?{...c,agent:u.agent}:u.type==="documents"?(window.dispatchEvent(new CustomEvent("adoc-documents-changed",{detail:{keys:u.changed}})),{...c,revision:c.revision+1,changed:{keys:u.changed,tick:c.changed.tick+1}}):u.type==="messages"?{...c,messages:u.messages}:c)},l.onclose=()=>{r(n=>({...n,status:"disconnected"})),s||(i=window.setTimeout(o,1e3))}};return o(),()=>{s=!0,clearTimeout(i),Yl?.close()}},[t]),(0,yw.jsx)(vw.Provider,{value:a,children:e})}function Aa(){return(0,Ls.useContext)(vw)}var ws=P(ye(),1);var Ru=class extends Error{constructor(a,r){super(r);this.status=a}status};async function Ja(e,t){let a=await fetch(e,t),r=await a.json().catch(()=>({}));if(!a.ok&&a.status!==409&&a.status!==422)throw new Ru(a.status,r.error??`${e} failed (${a.status})`);return r}var Gf=e=>({method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),nt={workspace:()=>Ja("/api/workspace"),documents:e=>Ja(`/api/plugins/${e}/documents`),document:(e,t)=>Ja(`/api/documents/${encodeURIComponent(e)}${t?`?base=${t}`:""}`),versions:e=>Ja(`/api/documents/${encodeURIComponent(e)}/versions`),references:e=>Ja(`/api/references?targets=${e.map(encodeURIComponent).join(",")}`),sendComments:e=>Ja("/api/messages",Gf(e)),sendAction:e=>Ja("/api/actions",Gf(e)),skills:()=>Ja("/api/skills"),skillFile:e=>Ja(`/api/skills/${encodeURIComponent(e)}/file`),editSkillFile:(e,t)=>Ja(`/api/skills/${encodeURIComponent(e)}/file`,Gf(t)),skill:e=>Ja(`/api/skills/${encodeURIComponent(e)}`),file:e=>Ja(`/api/documents/${encodeURIComponent(e)}/file`),editFile:(e,t)=>Ja(`/api/documents/${encodeURIComponent(e)}/file`,Gf(t))};function et(e){switch(e.level){case"workspace":return"workspace";case"plugin":return e.pluginKey;case"document":return e.key;case"anchor":return`${e.key}#${e.anchor}`;case"skill":return`skill ${e.name}`}}function Cw(e,t){let a=t.find(r=>r.skill===e);return a?`/p/${a.key}/skill`:`/skills/${e}`}function Ro(e){return e.slice(0,e.indexOf("-"))}var Lw=new Set;function xw(e){for(let t of e){if(!t.client||Lw.has(t.key))continue;Lw.add(t.key);let a=`/assets/plugins/${t.key}/`;if(t.client.style){let i=document.createElement("link");i.rel="stylesheet",i.href=`${a}index.css`,document.head.appendChild(i)}import(`${a}index.js`).catch(i=>console.error(`adoc: the client module of ${t.key} failed to load`,i))}}var Rw=P(W(),1),ww=(0,ws.createContext)(void 0);function bw({children:e}){let{revision:t}=Aa(),[a,r]=(0,ws.useState)();return(0,ws.useEffect)(()=>{let i=!1;return nt.workspace().then(s=>{i||(xw(s.plugins),r(s))},()=>{}),()=>{i=!0}},[t]),(0,Rw.jsx)(ww.Provider,{value:a,children:e})}function Ba(){return(0,ws.useContext)(ww)}var Kf=P(W(),1);function Iw(){let{status:e}=Aa(),t=e==="connected"?"connected":e==="connecting"?"connecting\u2026":"disconnected: server unreachable";return(0,Kf.jsxs)("span",{className:`connection-status ${e}`,"data-testid":"connection-status",children:[(0,Kf.jsx)("span",{className:"dot"}),t]})}var Xf=P(ye(),1);var Ew=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function kw(e,t,a=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Ew(e),size:24,node:t,...a.length>0?{aliases:a}:{}}}var Dw=e=>{let t="",a=!1;for(let r of e){if(r==="-"||r==="_"||r<=" "){a=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=a?r.toUpperCase():r,a=!1}return t};var Mw=e=>{let t=Dw(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Eu=P(ye(),1);var Iu=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim();var bs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function P_(e){return e!=null}function Tw(e,t={}){let a=t.attributeNames??{},r=f=>a[f]??f,i=e.size??e.width??bs.width,s=e.size??e.height??bs.height,o=e.aliases?.filter(f=>typeof f=="string"&&f.trim()!=="").map(f=>`lucide-${f}`)??[],l=[...e.name?[`lucide-${e.name}`]:[],...o],n=t.className?.split(" ").filter(Boolean)??[],u=t.includeDefaultClasses===!1?Iu(...n):Iu("lucide",...l,...n),c=t.absoluteStrokeWidth?Number(t.strokeWidth??bs["stroke-width"])*Number(e.size??e.width??bs.width)/Number(t.size??t.width??bs.width):t.strokeWidth??bs["stroke-width"];return["svg",{...Object.entries(bs).reduce((f,[h,m])=>(f[r(h)]=m,f),{}),..."color"in t&&t.color&&{[r("stroke")]:t.color},..."size"in t&&P_(t.size)&&{[r("width")]:t.size,[r("height")]:t.size},..."width"in t&&P_(t.width)&&{[r("width")]:t.width},..."height"in t&&P_(t.height)&&{[r("height")]:t.height},[r("stroke-width")]:c,...u&&{[r("class")]:u},[r("viewBox")]:`0 0 ${i} ${s}`,...t.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(f=>{let[h,m,_]=f,y=t.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...m}:m;return _?[h,y,_]:[h,y]})]}function Aw(e,t={}){return Tw(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var Bw=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var jl=P(ye(),1);var $T=(0,jl.createContext)({});var Ow=()=>(0,jl.useContext)($T);var Pw=(0,Eu.forwardRef)(({color:e,size:t,width:a,height:r,strokeWidth:i,absoluteStrokeWidth:s,nonScalingStroke:o,className:l="",children:n,iconNode:u=[],icon:c={node:u,aliases:[],size:24},...d},f)=>{let{size:h=24,strokeWidth:m=2,absoluteStrokeWidth:_=!1,nonScalingStroke:y=!1,color:p="currentColor",className:g=""}=Ow()??{},v=!!n||Bw(d),[C,x,k=[]]=Aw(c,{color:e??p,width:a??t??h,height:r??t??h,strokeWidth:i??m,absoluteStrokeWidth:s??_,nonScalingStroke:o??y,className:Iu(g,l),hasA11yProp:v,attributes:d});return(0,Eu.createElement)(C,{ref:f,...x},[...k.map(([T,U])=>(0,Eu.createElement)(T,U)),...Array.isArray(n)?n:[n]])});function oe(e,t=[],a=[]){let r=typeof e=="string"?kw(e,t,a):e,i=(0,Xf.forwardRef)(({className:s,...o},l)=>(0,Xf.createElement)(Pw,{ref:l,icon:r,className:s,...o}));return r.name&&(i.displayName=Mw(r.name)),i}var Nw={name:"archive-restore",size:24,node:[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]};Nw.node;var ku=oe(Nw);var Hw={name:"archive",size:24,node:[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]};Hw.node;var Io=oe(Hw);var zw={name:"arrow-left-right",size:24,node:[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]};zw.node;var Du=oe(zw);var Uw={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};Uw.node;var Zl=oe(Uw);var Fw={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};Fw.node;var Mu=oe(Fw);var qw={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};qw.node;var Tu=oe(qw);var Vw={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};Vw.node;var Au=oe(Vw);var $w={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};$w.node;var Bu=oe($w);var Ww={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};Ww.node;var Ou=oe(Ww);var Gw={name:"git-compare",size:24,node:[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]};Gw.node;var Pu=oe(Gw);var Kw={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};Kw.node;var Nu=oe(Kw);var Xw={name:"keyboard",size:24,node:[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]};Xw.node;var Hu=oe(Xw);var Yw={name:"message-square-plus",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]]};Yw.node;var zu=oe(Yw);var jw={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};jw.node;var Uu=oe(jw);var Zw={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};Zw.node;var Fu=oe(Zw);var Qw={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};Qw.node;var qu=oe(Qw);var Jw={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};Jw.node;var Ei=oe(Jw);var eb={name:"pin",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]};eb.node;var Vu=oe(eb);var tb={name:"pin-off",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]};tb.node;var $u=oe(tb);var ab={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};ab.node;var Wu=oe(ab);var rb={name:"send-horizontal",size:24,node:[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],aliases:["send-horizonal"]};rb.node;var Rs=oe(rb);var ib={name:"square-terminal",size:24,node:[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],aliases:["terminal-square"]};ib.node;var Is=oe(ib);var sb={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};sb.node;var Gu=oe(sb);var ob={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};ob.node;var Es=oe(ob);var lb={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};lb.node;var Dr=oe(lb);var Ql=P(W(),1);function nb(){let{agent:e}=Aa(),t=e?.claim;return t?(0,Ql.jsxs)("span",{className:`agent-pane-label${t.gone?" gone":""}`,"data-testid":"agent-pane-label",title:`${t.agent??"agent"} in herdr session ${t.herdrSession}`,children:[(0,Ql.jsx)(Zl,{}),t.pane," ",t.gone?"gone":t.status??""]}):(0,Ql.jsxs)("span",{className:"agent-pane-label none","data-testid":"agent-pane-label",title:"Run adoc agent claim in the agent's pane",children:[(0,Ql.jsx)(Zl,{}),"no agent"]})}var Yf=P(W(),1);function ub({git:e}){return(0,Yf.jsxs)("span",{className:`git-status ${e?"present":"absent"}`,"data-testid":"git-status",title:e?"The workspace is in a git repository":"The workspace is not in a git repository",children:[(0,Yf.jsx)(Ou,{}),e?"git":"no git"]})}var Zf=P(ye(),1),jf=P(W(),1);function cb({width:e,onWidth:t,dockLeft:a,onSwap:r}){let i=(0,Zf.useRef)(void 0);return(0,Zf.useEffect)(()=>{let s=l=>{if(!i.current)return;let n=l.clientX-i.current.x,u=i.current.width+(a?n:-n);t(Math.max(280,Math.min(window.innerWidth-400,u)))},o=()=>{i.current&&window.dispatchEvent(new CustomEvent("adoc:panel-resized")),i.current=void 0,document.body.classList.remove("resizing")};return window.addEventListener("pointermove",s),window.addEventListener("pointerup",o),()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",o)}},[t,a]),(0,jf.jsx)("div",{className:"panel-resizer","data-testid":"panel-resizer",title:"Drag to resize",onPointerDown:s=>{i.current={x:s.clientX,width:e},document.body.classList.add("resizing")},children:(0,jf.jsx)("button",{className:"panel-swap",title:a?"Put the main area on the left":"Put the agent panel on the left","data-testid":"panel-swap",onPointerDown:s=>s.stopPropagation(),onClick:r,children:(0,jf.jsx)(Du,{})})})}var db=P(ye(),1);function fb({id:e,origin:t,base:a,...r}){return r}var N_=(e,t,a)=>e.origin===t&&et(e.target)===et(a),hb="adoc.drafts",H_=new Set;function WT(){try{let e=JSON.parse(localStorage.getItem(hb)??"[]");return Array.isArray(e)?e:[]}catch{return[]}}var ks=WT();function Ku(e){ks=e;try{localStorage.setItem(hb,JSON.stringify(e))}catch{}for(let t of H_)t()}var _a={add(e){Ku([...ks,{...e,id:Date.now()+Math.random()}])},putOwnDraft(e,t,a,r){let i=ks.filter(s=>!N_(s,e,t));Ku([...i,{target:t,text:a,id:Date.now()+Math.random(),origin:e,...r!==void 0?{base:r}:{}}])},ownDraft(e,t){return ks.find(a=>N_(a,e,t))},removeOwnDraft(e,t){Ku(ks.filter(a=>!N_(a,e,t)))},remove(e){Ku(ks.filter(t=>t.id!==e))},clear(e){Ku(ks.filter(t=>!e.includes(t.id)))}};function Qf(){return(0,db.useSyncExternalStore)(e=>(H_.add(e),()=>H_.delete(e)),()=>ks)}var Oa=P(ye(),1);var mb=P(ye(),1);var Jf=P(W(),1);function eh(e){let[t,a]=(0,mb.useState)(()=>Et(e,!1));return[t,r=>{a(r),ua(e,r||void 0)}]}function th({pinned:e,onPin:t,what:a,testId:r}){return(0,Jf.jsx)("button",{className:"quiet",onClick:()=>t(!e),title:e?`Unpin: fold the ${a} when the pointer leaves it`:`Pin: keep the ${a} open`,"data-testid":r,children:e?(0,Jf.jsx)($u,{}):(0,Jf.jsx)(Vu,{})})}var Jl=P(W(),1);function pb({drafts:e}){let t=Zr(),a=Ba()?.plugins??[];if(e.length===0)return null;let r=i=>{if(i.target.level==="document"||i.target.level==="anchor"){let s=i.target.key;t(`/p/${Ro(s)}/${s}${i.target.level==="anchor"?`#${encodeURIComponent(i.target.anchor)}`:""}`)}else i.target.level==="plugin"?t(`/p/${i.target.pluginKey}`):i.target.level==="skill"?t(Cw(i.target.name,a)):t("/")};return(0,Jl.jsx)("div",{className:"draft-chip-list","data-testid":"draft-chip-list",children:e.map(i=>(0,Jl.jsxs)("span",{className:"adoc-chip draft-chip",title:`${i.quote?`"${i.quote}" \u2014 `:""}${i.text}`,children:[(0,Jl.jsx)("button",{className:"chip-label",onClick:()=>r(i),children:et(i.target).replace(/^[A-Z]+-[^#]*#/,"#")}),(0,Jl.jsx)("button",{className:"chip-remove",title:"Remove this draft",onClick:()=>_a.remove(i.id),children:"\xD7"})]},i.id))})}var St=P(W(),1),gb="adoc.composer";function GT(e,t,a){let r=[];return t&&r.push({level:"document",key:t}),a&&r.push({level:"skill",name:a}),e&&r.push({level:"plugin",pluginKey:e}),r.push({level:"workspace"}),r}function _b({drafts:e}){let{pluginKey:t,documentKey:a}=Cs(),r=Ba()?.plugins??[],i=Bf("/p/:pluginKey/skill")!==null,s=Bf("/skills/:skillName")?.params.skillName,o=i?r.find(N=>N.key===t)?.skill:s,l=GT(t,a,o),[n,u]=(0,Oa.useState)(0),[c,d]=(0,Oa.useState)(()=>Et(gb,"")),[f,h]=(0,Oa.useState)(!1),[m,_]=(0,Oa.useState)(),[y,p]=eh("adoc.composer-pinned");(0,Oa.useEffect)(()=>u(0),[t,a,o]);let g=(0,Oa.useRef)(null),v=(0,Oa.useRef)(null),C=()=>{let N=g.current;!N||N.offsetParent===null||(N.style.height="auto",N.style.height=`${N.scrollHeight}px`)};(0,Oa.useLayoutEffect)(C,[c,y]);let x=()=>{let N=v.current,H=N?.parentElement;if(!N||!H)return;N.querySelector(":scope > .fold-open")?.offsetHeight||(N.classList.add("measuring"),C()),H.style.setProperty("--adoc-composer-space",`${N.offsetHeight}px`),N.classList.remove("measuring")};(0,Oa.useEffect)(()=>{if(!v.current)return;let N=new ResizeObserver(x);return N.observe(v.current),()=>N.disconnect()},[]),(0,Oa.useLayoutEffect)(x,[y]);let k=l[Math.min(n,l.length-1)],T=N=>{ua(gb,N||void 0),d(N)},U=(c.trim()!==""||e.length>0)&&!f,w=async()=>{if(!U)return;h(!0),_(void 0);let N=e.map(fb);try{await nt.sendComments(c.trim()?{target:k,text:c,comments:N}:{comments:N}),_a.clear(e.map(H=>H.id)),T("")}catch(H){_(H.message)}finally{h(!1)}};return(0,St.jsxs)("div",{ref:v,className:`composer-area foldable${y?"":" unpinned"}`,onPointerEnter:C,onFocus:C,children:[(0,St.jsxs)("button",{className:"composer-folded fold-closed",onClick:()=>g.current?.focus(),"data-testid":"composer-folded",children:[(0,St.jsx)(Uu,{}),(0,St.jsx)("span",{children:"Message to the agent"}),e.length>0&&(0,St.jsxs)("span",{className:"adoc-chip adoc-tone-secondary",children:[e.length," ",e.length===1?"draft":"drafts"]}),c.trim()&&(0,St.jsx)("span",{className:"adoc-chip",children:"text typed"})]}),(0,St.jsxs)("div",{className:"fold-open",children:[(0,St.jsx)(pb,{drafts:e}),(0,St.jsxs)("div",{className:"comment-composer","data-testid":"comment-composer",children:[(0,St.jsxs)("div",{className:"composer-target",children:[l.map((N,H)=>(0,St.jsx)("button",{className:`adoc-chip mono${N===k?" active":""}`,onClick:()=>u(H),title:"Target of the message you type here",children:et(N)},et(N))),(0,St.jsx)("span",{className:"spacer"}),(0,St.jsx)(th,{pinned:y,onPin:p,what:"composer",testId:"composer-pin"})]}),(0,St.jsxs)("div",{className:"composer-row",children:[(0,St.jsx)("textarea",{ref:g,value:c,rows:3,placeholder:e.length?`Optional message about ${et(k)}`:`Message about ${et(k)}`,onChange:N=>T(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(N.ctrlKey||N.metaKey)&&(N.preventDefault(),w())}}),(0,St.jsx)("button",{type:"button",className:"primary send-button",disabled:!U,onClick:()=>{w()},title:`${e.length?`Send with ${e.length} ${e.length===1?"draft":"drafts"}`:"Send"} (Ctrl+Enter)`,"data-testid":"composer-send",children:(0,St.jsx)(Rs,{})})]}),m&&(0,St.jsx)("div",{className:"error small",children:m})]})]})]})}var jv=P(ye(),1);var va=P(W(),1);function vb({messages:e}){return e.length===0?(0,va.jsx)("p",{className:"muted pending-empty",children:"The agent has received everything."}):(0,va.jsx)("ol",{className:"pending-message-list","data-testid":"pending-message-list",children:e.map(t=>(0,va.jsxs)("li",{className:`pending-message adoc-block ${t.kind}`,title:t.formatted,children:[(0,va.jsxs)("div",{className:"pending-head",children:[(0,va.jsxs)("span",{className:"number",children:["#",t.number]}),(0,va.jsx)("span",{className:"kind",children:t.kind}),t.target&&(0,va.jsx)("code",{children:t.target}),t.kind==="action"&&(0,va.jsx)("span",{className:"muted",children:t.applied?"applied":"request"})]}),t.text&&(0,va.jsx)("div",{className:"pending-text",children:t.text}),t.comments?.map((a,r)=>(0,va.jsxs)("div",{className:"pending-comment",children:[(0,va.jsx)("code",{children:a.target}),a.quote&&(0,va.jsx)("blockquote",{children:a.quote}),(0,va.jsx)("div",{className:"pending-text",children:a.text})]},r))]},t.number))})}var KT=2,XT=1,Sb=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,a=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(a.getPropertyValue("height")),i=Math.max(0,parseInt(a.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),o={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},l=o.top+o.bottom,n=o.right+o.left,u=r-l,c=i-n-t;return{cols:Math.max(KT,Math.floor(c/e.css.cell.width)),rows:Math.max(XT,Math.floor(u/e.css.cell.height))}}};var xR=Object.defineProperty,YT=Object.getOwnPropertyDescriptor,jT=(e,t)=>{for(var a in t)xR(e,a,{get:t[a],enumerable:!0})},ct=(e,t,a,r)=>{for(var i=r>1?void 0:r?YT(t,a):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=(r?o(t,a,i):o(i))||i);return r&&i&&xR(t,a,i),i},X=(e,t)=>(a,r)=>t(a,r,e),yb="Terminal input",tv={get:()=>yb,set:e=>yb=e},Cb="Too much output to announce, navigate to rows manually to read",av={get:()=>Cb,set:e=>Cb=e};function ZT(e){return e.replace(/\r?\n/g,"\r")}function QT(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function JT(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function eA(e,t,a,r){if(e.stopPropagation(),e.clipboardData){let i=e.clipboardData.getData("text/plain");wR(i,t,a,r)}}function wR(e,t,a,r){e=ZT(e),e=QT(e,a.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),a.triggerDataEvent(e,!0),t.value=""}function bR(e,t,a){let r=a.getBoundingClientRect(),i=e.clientX-r.left-10,s=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${i}px`,t.style.top=`${s}px`,t.style.zIndex="1000",t.focus()}function Lb(e,t,a,r,i){bR(e,t,a),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Bs(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Rh(e,t=0,a=e.length){let r="";for(let i=t;i<a;++i){let s=e[i];s>65535?(s-=65536,r+=String.fromCharCode((s>>10)+55296)+String.fromCharCode(s%1024+56320)):r+=String.fromCharCode(s)}return r}var tA=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let a=e.length;if(!a)return 0;let r=0,i=0;if(this._interim){let s=e.charCodeAt(i++);56320<=s&&s<=57343?t[r++]=(this._interim-55296)*1024+s-56320+65536:(t[r++]=this._interim,t[r++]=s),this._interim=0}for(let s=i;s<a;++s){let o=e.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=a)return this._interim=o,r;let l=e.charCodeAt(s);56320<=l&&l<=57343?t[r++]=(o-55296)*1024+l-56320+65536:(t[r++]=o,t[r++]=l);continue}o!==65279&&(t[r++]=o)}return r}},aA=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let a=e.length;if(!a)return 0;let r=0,i,s,o,l,n=0,u=0;if(this.interim[0]){let f=!1,h=this.interim[0];h&=(h&224)===192?31:(h&240)===224?15:7;let m=0,_;for(;(_=this.interim[++m]&63)&&m<4;)h<<=6,h|=_;let y=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,p=y-m;for(;u<p;){if(u>=a)return 0;if(_=e[u++],(_&192)!==128){u--,f=!0;break}else this.interim[m++]=_,h<<=6,h|=_&63}f||(y===2?h<128?u--:t[r++]=h:y===3?h<2048||h>=55296&&h<=57343||h===65279||(t[r++]=h):h<65536||h>1114111||(t[r++]=h)),this.interim.fill(0)}let c=a-4,d=u;for(;d<a;){for(;d<c&&!((i=e[d])&128)&&!((s=e[d+1])&128)&&!((o=e[d+2])&128)&&!((l=e[d+3])&128);)t[r++]=i,t[r++]=s,t[r++]=o,t[r++]=l,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)===192){if(d>=a)return this.interim[0]=i,r;if(s=e[d++],(s&192)!==128){d--;continue}if(n=(i&31)<<6|s&63,n<128){d--;continue}t[r++]=n}else if((i&240)===224){if(d>=a)return this.interim[0]=i,r;if(s=e[d++],(s&192)!==128){d--;continue}if(d>=a)return this.interim[0]=i,this.interim[1]=s,r;if(o=e[d++],(o&192)!==128){d--;continue}if(n=(i&15)<<12|(s&63)<<6|o&63,n<2048||n>=55296&&n<=57343||n===65279)continue;t[r++]=n}else if((i&248)===240){if(d>=a)return this.interim[0]=i,r;if(s=e[d++],(s&192)!==128){d--;continue}if(d>=a)return this.interim[0]=i,this.interim[1]=s,r;if(o=e[d++],(o&192)!==128){d--;continue}if(d>=a)return this.interim[0]=i,this.interim[1]=s,this.interim[2]=o,r;if(l=e[d++],(l&192)!==128){d--;continue}if(n=(i&7)<<18|(s&63)<<12|(o&63)<<6|l&63,n<65536||n>1114111)continue;t[r++]=n}}return r}},RR="",Os=" ",hc=class IR{constructor(){this.fg=0,this.bg=0,this.extended=new _h}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new IR;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}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}},_h=class ER{constructor(t=0,a=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=a}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new ER(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Cr=class kR extends hc{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new _h,this.combinedData=""}static fromCharData(t){let a=new kR;return a.setFromCharData(t),a}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Bs(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let a=!1;if(t[1].length>2)a=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let i=t[1].charCodeAt(1);56320<=i&&i<=57343?this.content=(r-55296)*1024+i-56320+65536|t[2]<<22:a=!0}else a=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;a&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},xb="di$target",rv="di$dependencies",z_=new Map;function rA(e){return e[rv]||[]}function Vt(e){if(z_.has(e))return z_.get(e);let t=function(a,r,i){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");iA(t,a,i)};return t._id=e,z_.set(e,t),t}function iA(e,t,a){t[xb]===t?t[rv].push({id:e,index:a}):(t[rv]=[{id:e,index:a}],t[xb]=t)}var ya=Vt("BufferService"),DR=Vt("CoreMouseService"),Oo=Vt("CoreService"),sA=Vt("CharsetService"),zv=Vt("InstantiationService"),MR=Vt("LogService"),Ca=Vt("OptionsService"),TR=Vt("OscLinkService"),oA=Vt("UnicodeService"),mc=Vt("DecorationService"),iv=class{constructor(e,t,a){this._bufferService=e,this._optionsService=t,this._oscLinkService=a}provideLinks(e,t){let a=this._bufferService.buffer.lines.get(e-1);if(!a){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,s=new Cr,o=a.getTrimmedLength(),l=-1,n=-1,u=!1;for(let c=0;c<o;c++)if(!(n===-1&&!a.hasContent(c))){if(a.loadCell(c,s),s.hasExtendedAttrs()&&s.extended.urlId)if(n===-1){n=c,l=s.extended.urlId;continue}else u=s.extended.urlId!==l;else n!==-1&&(u=!0);if(u||n!==-1&&c===o-1){let d=this._oscLinkService.getLinkData(l)?.uri;if(d){let f={start:{x:n+1,y:e},end:{x:c+(!u&&c===o-1?1:0),y:e}},h=!1;if(!i?.allowNonHttpProtocols)try{let m=new URL(d);["http:","https:"].includes(m.protocol)||(h=!0)}catch{h=!0}h||r.push({text:d,range:f,activate:(m,_)=>i?i.activate(m,_,f):lA(m,_),hover:(m,_)=>i?.hover?.(m,_,f),leave:(m,_)=>i?.leave?.(m,_,f)})}u=!1,s.hasExtendedAttrs()&&s.extended.urlId?(n=c,l=s.extended.urlId):(n=-1,l=-1)}}t(r)}};iv=ct([X(0,ya),X(1,Ca),X(2,TR)],iv);function lA(e,t){if(confirm(`Do you want to navigate to ${t}?
11
+
12
+ WARNING: This link could potentially be dangerous`)){let a=window.open();if(a){try{a.opener=null}catch{}a.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Ih=Vt("CharSizeService"),Ai=Vt("CoreBrowserService"),Uv=Vt("MouseService"),Bi=Vt("RenderService"),nA=Vt("SelectionService"),AR=Vt("CharacterJoinerService"),rn=Vt("ThemeService"),BR=Vt("LinkProviderService"),uA=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?wb.isErrorNoTelemetry(e)?new wb(e.message+`
13
+
14
+ `+e.stack):new Error(e.message+`
15
+
16
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(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)}},cA=new uA;function lh(e){dA(e)||cA.onUnexpectedError(e)}var sv="Canceled";function dA(e){return e instanceof fA?!0:e instanceof Error&&e.name===sv&&e.message===sv}var fA=class extends Error{constructor(){super(sv),this.name=this.message}};function hA(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}var wb=class ov extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof ov)return t;let a=new ov;return a.message=t.message,a.stack=t.stack,a}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},lv=class OR extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,OR.prototype)}};function mA(e,t,a=0,r=e.length){let i=a,s=r;for(;i<s;){let o=Math.floor((i+s)/2);t(e[o])?i=o+1:s=o}return i-1}var pA=class PR{constructor(t){this._array=t,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(PR.assertInvariants){if(this._prevFindLastPredicate){for(let r of this._array)if(this._prevFindLastPredicate(r)&&!t(r))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let a=mA(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=a+1,a===-1?void 0:this._array[a]}};pA.assertInvariants=!1;function er(e,t=0){return e[e.length-(1+t)]}var NR;(e=>{function t(s){return s<0}e.isLessThan=t;function a(s){return s<=0}e.isLessThanOrEqual=a;function r(s){return s>0}e.isGreaterThan=r;function i(s){return s===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(NR||={});function gA(e,t){return(a,r)=>t(e(a),e(r))}var _A=(e,t)=>e-t,bb=class nv{constructor(t){this.iterate=t}forEach(t){this.iterate(a=>(t(a),!0))}toArray(){let t=[];return this.iterate(a=>(t.push(a),!0)),t}filter(t){return new nv(a=>this.iterate(r=>t(r)?a(r):!0))}map(t){return new nv(a=>this.iterate(r=>a(t(r))))}some(t){let a=!1;return this.iterate(r=>(a=t(r),!a)),a}findFirst(t){let a;return this.iterate(r=>t(r)?(a=r,!1):!0),a}findLast(t){let a;return this.iterate(r=>(t(r)&&(a=r),!0)),a}findLastMaxBy(t){let a,r=!0;return this.iterate(i=>((r||NR.isGreaterThan(t(i,a)))&&(r=!1,a=i),!0)),a}};bb.empty=new bb(e=>{});function vA(e,t){let a=Object.create(null);for(let r of e){let i=t(r),s=a[i];s||(s=a[i]=[]),s.push(r)}return a}var Rb,Ib,PH=class{constructor(e,t){this.toKey=t,this._map=new Map,this[Rb]="SetWithKey";for(let a of e)this.add(a)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(a=>e.call(t,a,a,this))}[(Ib=Symbol.iterator,Rb=Symbol.toStringTag,Ib)](){return this.values()}},SA=class{constructor(){this.map=new Map}add(e,t){let a=this.map.get(e);a||(a=new Set,this.map.set(e,a)),a.add(t)}delete(e,t){let a=this.map.get(e);a&&(a.delete(t),a.size===0&&this.map.delete(e))}forEach(e,t){let a=this.map.get(e);a&&a.forEach(t)}get(e){return this.map.get(e)||new Set}};function yA(e,t){let a=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(a,arguments)}finally{t()}else i=e.apply(a,arguments);return i}}var HR;(e=>{function t(C){return C&&typeof C=="object"&&typeof C[Symbol.iterator]=="function"}e.is=t;let a=Object.freeze([]);function r(){return a}e.empty=r;function*i(C){yield C}e.single=i;function s(C){return t(C)?C:i(C)}e.wrap=s;function o(C){return C||a}e.from=o;function*l(C){for(let x=C.length-1;x>=0;x--)yield C[x]}e.reverse=l;function n(C){return!C||C[Symbol.iterator]().next().done===!0}e.isEmpty=n;function u(C){return C[Symbol.iterator]().next().value}e.first=u;function c(C,x){let k=0;for(let T of C)if(x(T,k++))return!0;return!1}e.some=c;function d(C,x){for(let k of C)if(x(k))return k}e.find=d;function*f(C,x){for(let k of C)x(k)&&(yield k)}e.filter=f;function*h(C,x){let k=0;for(let T of C)yield x(T,k++)}e.map=h;function*m(C,x){let k=0;for(let T of C)yield*x(T,k++)}e.flatMap=m;function*_(...C){for(let x of C)yield*x}e.concat=_;function y(C,x,k){let T=k;for(let U of C)T=x(T,U);return T}e.reduce=y;function*p(C,x,k=C.length){for(x<0&&(x+=C.length),k<0?k+=C.length:k>C.length&&(k=C.length);x<k;x++)yield C[x]}e.slice=p;function g(C,x=Number.POSITIVE_INFINITY){let k=[];if(x===0)return[k,C];let T=C[Symbol.iterator]();for(let U=0;U<x;U++){let w=T.next();if(w.done)return[k,e.empty()];k.push(w.value)}return[k,{[Symbol.iterator](){return T}}]}e.consume=g;async function v(C){let x=[];for await(let k of C)x.push(k);return Promise.resolve(x)}e.asyncToArray=v})(HR||={});var CA=!1,To=null,LA=class zR{constructor(){this.livingDisposables=new Map}getDisposableData(t){let a=this.livingDisposables.get(t);return a||(a={parent:null,source:null,isSingleton:!1,value:t,idx:zR.idx++},this.livingDisposables.set(t,a)),a}trackDisposable(t){let a=this.getDisposableData(t);a.source||(a.source=new Error().stack)}setParent(t,a){let r=this.getDisposableData(t);r.parent=a}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,a){let r=a.get(t);if(r)return r;let i=t.parent?this.getRootParent(this.getDisposableData(t.parent),a):t;return a.set(t,i),i}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,a])=>a.source!==null&&!this.getRootParent(a,t).isSingleton).flatMap(([a])=>a)}computeLeakingDisposables(t=10,a){let r;if(a)r=a;else{let n=new Map,u=[...this.livingDisposables.values()].filter(d=>d.source!==null&&!this.getRootParent(d,n).isSingleton);if(u.length===0)return;let c=new Set(u.map(d=>d.value));if(r=u.filter(d=>!(d.parent&&c.has(d.parent))),r.length===0)throw new Error("There are cyclic diposable chains!")}if(!r)return;function i(n){function u(d,f){for(;d.length>0&&f.some(h=>typeof h=="string"?h===d[0]:d[0].match(h));)d.shift()}let c=n.source.split(`
17
+ `).map(d=>d.trim().replace("at ","")).filter(d=>d!=="");return u(c,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),c.reverse()}let s=new SA;for(let n of r){let u=i(n);for(let c=0;c<=u.length;c++)s.add(u.slice(0,c).join(`
18
+ `),n)}r.sort(gA(n=>n.idx,_A));let o="",l=0;for(let n of r.slice(0,t)){l++;let u=i(n),c=[];for(let d=0;d<u.length;d++){let f=u[d];f=`(shared with ${s.get(u.slice(0,d+1).join(`
19
+ `)).size}/${r.length} leaks) at ${f}`;let h=s.get(u.slice(0,d).join(`
20
+ `)),m=vA([...h].map(_=>i(_)[d]),_=>_);delete m[u[d]];for(let[_,y]of Object.entries(m))c.unshift(` - stacktraces of ${y.length} other leaks continue with ${_}`);c.unshift(f)}o+=`
21
+
22
+
23
+ ==================== Leaking disposable ${l}/${r.length}: ${n.value.constructor.name} ====================
24
+ ${c.join(`
25
+ `)}
26
+ ============================================================
27
+
28
+ `}return r.length>t&&(o+=`
29
+
30
+
31
+ ... and ${r.length-t} more leaking disposables
32
+
33
+ `),{leaks:r,details:o}}};LA.idx=0;function xA(e){To=e}if(CA){let e="__is_disposable_tracked__";xA(new class{trackDisposable(t){let a=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(a)},3e3)}setParent(t,a){if(t&&t!==pe.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==pe.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}function Eh(e){return To?.trackDisposable(e),e}function kh(e){To?.markAsDisposed(e)}function uc(e,t){To?.setParent(e,t)}function wA(e,t){if(To)for(let a of e)To.setParent(a,t)}function Eb(e){return To?.markAsSingleton(e),e}function Ao(e){if(HR.is(e)){let t=[];for(let a of e)if(a)try{a.dispose()}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function bA(...e){let t=Ke(()=>Ao(e));return wA(e,t),t}function Ke(e){let t=Eh({dispose:yA(()=>{kh(t),e()})});return t}var UR=class FR{constructor(){this._toDispose=new Set,this._isDisposed=!1,Eh(this)}dispose(){this._isDisposed||(kh(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ao(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return uc(t,this),this._isDisposed?FR.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(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),uc(t,null))}};UR.DISABLE_DISPOSED_WARNING=!1;var Ps=UR,pe=class{constructor(){this._store=new Ps,Eh(this),uc(this._store,this)}dispose(){kh(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};pe.None=Object.freeze({dispose(){}});var an=class{constructor(){this._isDisposed=!1,Eh(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&uc(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,kh(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&uc(e,null),e}},rr=typeof window=="object"?window:globalThis,uv=class cv{constructor(t){this.element=t,this.next=cv.Undefined,this.prev=cv.Undefined}};uv.Undefined=new uv(void 0);var tt=uv,kb=class{constructor(){this._first=tt.Undefined,this._last=tt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===tt.Undefined}clear(){let e=this._first;for(;e!==tt.Undefined;){let t=e.next;e.prev=tt.Undefined,e.next=tt.Undefined,e=t}this._first=tt.Undefined,this._last=tt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let a=new tt(e);if(this._first===tt.Undefined)this._first=a,this._last=a;else if(t){let i=this._last;this._last=a,a.prev=i,i.next=a}else{let i=this._first;this._first=a,a.next=i,i.prev=a}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(a))}}shift(){if(this._first!==tt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==tt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==tt.Undefined&&e.next!==tt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===tt.Undefined&&e.next===tt.Undefined?(this._first=tt.Undefined,this._last=tt.Undefined):e.next===tt.Undefined?(this._last=this._last.prev,this._last.next=tt.Undefined):e.prev===tt.Undefined&&(this._first=this._first.next,this._first.prev=tt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==tt.Undefined;)yield e.element,e=e.next}},RA=globalThis.performance&&typeof globalThis.performance.now=="function",IA=class qR{static create(t){return new qR(t)}constructor(t){this._now=RA&&t===!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}},EA=!1,Db=!1,kA=!1,ta;(e=>{e.None=()=>pe.None;function t(R){if(kA){let{onDidAddListener:E}=R,z=hv.create(),F=0;R.onDidAddListener=()=>{++F===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),z.print()),E?.()}}}function a(R,E){return f(R,()=>{},0,void 0,!0,void 0,E)}e.defer=a;function r(R){return(E,z=null,F)=>{let I=!1,A;return A=R(te=>{if(!I)return A?A.dispose():I=!0,E.call(z,te)},null,F),I&&A.dispose(),A}}e.once=r;function i(R,E,z){return c((F,I=null,A)=>R(te=>F.call(I,E(te)),null,A),z)}e.map=i;function s(R,E,z){return c((F,I=null,A)=>R(te=>{E(te),F.call(I,te)},null,A),z)}e.forEach=s;function o(R,E,z){return c((F,I=null,A)=>R(te=>E(te)&&F.call(I,te),null,A),z)}e.filter=o;function l(R){return R}e.signal=l;function n(...R){return(E,z=null,F)=>{let I=bA(...R.map(A=>A(te=>E.call(z,te))));return d(I,F)}}e.any=n;function u(R,E,z,F){let I=z;return i(R,A=>(I=E(I,A),I),F)}e.reduce=u;function c(R,E){let z,F={onWillAddFirstListener(){z=R(I.fire,I)},onDidRemoveLastListener(){z?.dispose()}};E||t(F);let I=new V(F);return E?.add(I),I.event}function d(R,E){return E instanceof Array?E.push(R):E&&E.add(R),R}function f(R,E,z=100,F=!1,I=!1,A,te){let J,Re,Ye,it=0,M,G={leakWarningThreshold:A,onWillAddFirstListener(){J=R(le=>{it++,Re=E(Re,le),F&&!Ye&&(K.fire(Re),Re=void 0),M=()=>{let ue=Re;Re=void 0,Ye=void 0,(!F||it>1)&&K.fire(ue),it=0},typeof z=="number"?(clearTimeout(Ye),Ye=setTimeout(M,z)):Ye===void 0&&(Ye=0,queueMicrotask(M))})},onWillRemoveListener(){I&&it>0&&M?.()},onDidRemoveLastListener(){M=void 0,J.dispose()}};te||t(G);let K=new V(G);return te?.add(K),K.event}e.debounce=f;function h(R,E=0,z){return e.debounce(R,(F,I)=>F?(F.push(I),F):[I],E,void 0,!0,void 0,z)}e.accumulate=h;function m(R,E=(F,I)=>F===I,z){let F=!0,I;return o(R,A=>{let te=F||!E(A,I);return F=!1,I=A,te},z)}e.latch=m;function _(R,E,z){return[e.filter(R,E,z),e.filter(R,F=>!E(F),z)]}e.split=_;function y(R,E=!1,z=[],F){let I=z.slice(),A=R(Re=>{I?I.push(Re):J.fire(Re)});F&&F.add(A);let te=()=>{I?.forEach(Re=>J.fire(Re)),I=null},J=new V({onWillAddFirstListener(){A||(A=R(Re=>J.fire(Re)),F&&F.add(A))},onDidAddFirstListener(){I&&(E?setTimeout(te):te())},onDidRemoveLastListener(){A&&A.dispose(),A=null}});return F&&F.add(J),J.event}e.buffer=y;function p(R,E){return(z,F,I)=>{let A=E(new v);return R(function(te){let J=A.evaluate(te);J!==g&&z.call(F,J)},void 0,I)}}e.chain=p;let g=Symbol("HaltChainable");class v{constructor(){this.steps=[]}map(E){return this.steps.push(E),this}forEach(E){return this.steps.push(z=>(E(z),z)),this}filter(E){return this.steps.push(z=>E(z)?z:g),this}reduce(E,z){let F=z;return this.steps.push(I=>(F=E(F,I),F)),this}latch(E=(z,F)=>z===F){let z=!0,F;return this.steps.push(I=>{let A=z||!E(I,F);return z=!1,F=I,A?I:g}),this}evaluate(E){for(let z of this.steps)if(E=z(E),E===g)break;return E}}function C(R,E,z=F=>F){let F=(...J)=>te.fire(z(...J)),I=()=>R.on(E,F),A=()=>R.removeListener(E,F),te=new V({onWillAddFirstListener:I,onDidRemoveLastListener:A});return te.event}e.fromNodeEventEmitter=C;function x(R,E,z=F=>F){let F=(...J)=>te.fire(z(...J)),I=()=>R.addEventListener(E,F),A=()=>R.removeEventListener(E,F),te=new V({onWillAddFirstListener:I,onDidRemoveLastListener:A});return te.event}e.fromDOMEventEmitter=x;function k(R){return new Promise(E=>r(R)(E))}e.toPromise=k;function T(R){let E=new V;return R.then(z=>{E.fire(z)},()=>{E.fire(void 0)}).finally(()=>{E.dispose()}),E.event}e.fromPromise=T;function U(R,E){return R(z=>E.fire(z))}e.forward=U;function w(R,E,z){return E(z),R(F=>E(F))}e.runAndSubscribe=w;class N{constructor(E,z){this._observable=E,this._counter=0,this._hasChanged=!1;let F={onWillAddFirstListener:()=>{E.addObserver(this)},onDidRemoveLastListener:()=>{E.removeObserver(this)}};z||t(F),this.emitter=new V(F),z&&z.add(this.emitter)}beginUpdate(E){this._counter++}handlePossibleChange(E){}handleChange(E,z){this._hasChanged=!0}endUpdate(E){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function H(R,E){return new N(R,E).emitter.event}e.fromObservable=H;function ee(R){return(E,z,F)=>{let I=0,A=!1,te={beginUpdate(){I++},endUpdate(){I--,I===0&&(R.reportChanges(),A&&(A=!1,E.call(z)))},handlePossibleChange(){},handleChange(){A=!0}};R.addObserver(te),R.reportChanges();let J={dispose(){R.removeObserver(te)}};return F instanceof Ps?F.add(J):Array.isArray(F)&&F.push(J),J}}e.fromObservableLight=ee})(ta||={});var dv=class fv{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${fv._idPool++}`,fv.all.add(this)}start(t){this._stopWatch=new IA,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};dv.all=new Set,dv._idPool=0;var DA=dv,Mb=-1,VR=class $R{constructor(t,a,r=($R._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=a,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,a){let r=this.threshold;if(r<=0||a<r)return;this._stacks||(this._stacks=new Map);let i=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[s,o]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${a} listeners already. MOST frequent listener (${o}):`;console.warn(l),console.warn(s);let n=new TA(l,s);this._errorHandler(n)}return()=>{let s=this._stacks.get(t.value)||0;this._stacks.set(t.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,a=0;for(let[r,i]of this._stacks)(!t||a<i)&&(t=[r,i],a=i);return t}};VR._idPool=1;var MA=VR,hv=class WR{constructor(t){this.value=t}static create(){let t=new Error;return new WR(t.stack??"")}print(){console.warn(this.value.split(`
34
+ `).slice(2).join(`
35
+ `))}},TA=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},AA=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},BA=0,nh=class{constructor(e){this.value=e,this.id=BA++}},OA=2,PA=(e,t)=>{if(e instanceof nh)t(e);else for(let a=0;a<e.length;a++){let r=e[a];r&&t(r)}},uh;if(EA){let e=[];setInterval(()=>{e.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(e.join(`
36
+ `)),e.length=0)},3e3),uh=new FinalizationRegistry(t=>{typeof t=="string"&&e.push(t)})}var V=class{constructor(e){this._size=0,this._options=e,this._leakageMon=Mb>0||this._options?.leakWarningThreshold?new MA(e?.onListenerError??lh,this._options?.leakWarningThreshold??Mb):void 0,this._perfMon=this._options?._profName?new DA(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(Db){let e=this._listeners;queueMicrotask(()=>{PA(e,t=>t.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,a)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let n=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],u=new AA(`${l}. HINT: Stack shows most frequent listener (${n[1]}-times)`,n[0]);return(this._options?.onListenerError||lh)(u),pe.None}if(this._disposed)return pe.None;t&&(e=e.bind(t));let r=new nh(e),i,s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=hv.create(),i=this._leakageMon.check(r.stack,this._size+1)),Db&&(r.stack=s??hv.create()),this._listeners?this._listeners instanceof nh?(this._deliveryQueue??=new NA,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=Ke(()=>{uh?.unregister(o),i?.(),this._removeListener(r)});if(a instanceof Ps?a.add(o):Array.isArray(a)&&a.push(o),uh){let l=new Error().stack.split(`
37
+ `).slice(2,3).join(`
38
+ `).trim(),n=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(l);uh.register(o,n?.[2]??l,o)}return o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,a=t.indexOf(e);if(a===-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--,t[a]=void 0;let r=this._deliveryQueue.current===this;if(this._size*OA<=t.length){let i=0;for(let s=0;s<t.length;s++)t[s]?t[i++]=t[s]:r&&(this._deliveryQueue.end--,i<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=i}}_deliver(e,t){if(!e)return;let a=this._options?.onListenerError||lh;if(!a){e.value(t);return}try{e.value(t)}catch(r){a(r)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof nh)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},NA=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,a){this.i=0,this.end=a,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},mv=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new V,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new V,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,a){if(this.getZoomLevel(a)===t)return;let r=this.getWindowId(a);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,a){this.mapWindowIdToZoomFactor.set(this.getWindowId(a),t)}setFullscreen(t,a){if(this.isFullscreen(a)===t)return;let r=this.getWindowId(a);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};mv.INSTANCE=new mv;var Fv=mv;function HA(e,t,a){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",a)}var HH=Fv.INSTANCE.onDidChangeZoomLevel;function zA(e){return Fv.INSTANCE.getZoomFactor(e)}var zH=Fv.INSTANCE.onDidChangeFullscreen,sn=typeof navigator=="object"?navigator.userAgent:"",pv=sn.indexOf("Firefox")>=0,ch=sn.indexOf("AppleWebKit")>=0,qv=sn.indexOf("Chrome")>=0,GR=!qv&&sn.indexOf("Safari")>=0,UH=sn.indexOf("Electron/")>=0,FH=sn.indexOf("Android")>=0,dh=!1;if(typeof rr.matchMedia=="function"){let e=rr.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=rr.matchMedia("(display-mode: fullscreen)");dh=e.matches,HA(rr,e,({matches:a})=>{dh&&t.matches||(dh=a)})}function UA(){return dh}var tn="en",vh=!1,Sh=!1,lc=!1,FA=!1,KR=!1,XR=!1,qA=!1,VA=!1,$A=!1,WA=!1,ah,fh=tn,Tb=tn,GA,Di,Ti=globalThis,ar;typeof Ti.vscode<"u"&&typeof Ti.vscode.process<"u"?ar=Ti.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(ar=process);var YR=typeof ar?.versions?.electron=="string",KA=YR&&ar?.type==="renderer";if(typeof ar=="object"){vh=ar.platform==="win32",Sh=ar.platform==="darwin",lc=ar.platform==="linux",FA=lc&&!!ar.env.SNAP&&!!ar.env.SNAP_REVISION,qA=YR,$A=!!ar.env.CI||!!ar.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ah=tn,fh=tn;let e=ar.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);ah=t.userLocale,Tb=t.osLocale,fh=t.resolvedLanguage||tn,GA=t.languagePack?.translationsConfigFile}catch{}KR=!0}else typeof navigator=="object"&&!KA?(Di=navigator.userAgent,vh=Di.indexOf("Windows")>=0,Sh=Di.indexOf("Macintosh")>=0,VA=(Di.indexOf("Macintosh")>=0||Di.indexOf("iPad")>=0||Di.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,lc=Di.indexOf("Linux")>=0,WA=Di?.indexOf("Mobi")>=0,XR=!0,fh=globalThis._VSCODE_NLS_LANGUAGE||tn,ah=navigator.language.toLowerCase(),Tb=ah):console.error("Unable to resolve platform.");var U_=0;Sh?U_=1:vh?U_=3:lc&&(U_=2);var jR=vh,ti=Sh,XA=lc,F_=KR,YA=XR&&typeof Ti.importScripts=="function",qH=YA?Ti.origin:void 0,ai=Di,Ds=fh,jA;(e=>{function t(){return Ds}e.value=t;function a(){return Ds.length===2?Ds==="en":Ds.length>=3?Ds[0]==="e"&&Ds[1]==="n"&&Ds[2]==="-":!1}e.isDefaultVariant=a;function r(){return Ds==="en"}e.isDefault=r})(jA||={});var ZA=typeof Ti.postMessage=="function"&&!Ti.importScripts,QA=(()=>{if(ZA){let e=[];Ti.addEventListener("message",a=>{if(a.data&&a.data.vscodeScheduleAsyncWork)for(let r=0,i=e.length;r<i;r++){let s=e[r];if(s.id===a.data.vscodeScheduleAsyncWork){e.splice(r,1),s.callback();return}}});let t=0;return a=>{let r=++t;e.push({id:r,callback:a}),Ti.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})(),JA=!!(ai&&ai.indexOf("Chrome")>=0),VH=!!(ai&&ai.indexOf("Firefox")>=0),$H=!!(!JA&&ai&&ai.indexOf("Safari")>=0),WH=!!(ai&&ai.indexOf("Edg/")>=0),GH=!!(ai&&ai.indexOf("Android")>=0),Ms=typeof navigator=="object"?navigator:{},KH={clipboard:{writeText:F_||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(Ms&&Ms.clipboard&&Ms.clipboard.writeText),readText:F_||!!(Ms&&Ms.clipboard&&Ms.clipboard.readText)},keyboard:F_||UA()?0:Ms.keyboard||GR?1:2,touch:"ontouchstart"in rr||Ms.maxTouchPoints>0,pointerEvents:rr.PointerEvent&&("ontouchstart"in rr||navigator.maxTouchPoints>0)},Vv=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},q_=new Vv,Ab=new Vv,Bb=new Vv,eB=new Array(230),ZR;(e=>{function t(l){return q_.keyCodeToStr(l)}e.toString=t;function a(l){return q_.strToKeyCode(l)}e.fromString=a;function r(l){return Ab.keyCodeToStr(l)}e.toUserSettingsUS=r;function i(l){return Bb.keyCodeToStr(l)}e.toUserSettingsGeneral=i;function s(l){return Ab.strToKeyCode(l)||Bb.strToKeyCode(l)}e.fromUserSettings=s;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 q_.keyCodeToStr(l)}e.toElectronAccelerator=o})(ZR||={});var tB=class QR{constructor(t,a,r,i,s){this.ctrlKey=t,this.shiftKey=a,this.altKey=r,this.metaKey=i,this.keyCode=s}equals(t){return t instanceof QR&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",a=this.shiftKey?"1":"0",r=this.altKey?"1":"0",i=this.metaKey?"1":"0";return`K${t}${a}${r}${i}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new aB([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},aB=class{constructor(e){if(e.length===0)throw hA("chords");this.chords=e}getHashCode(){let e="";for(let t=0,a=this.chords.length;t<a;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function rB(e){if(e.charCode){let a=String.fromCharCode(e.charCode).toUpperCase();return ZR.fromString(a)}let t=e.keyCode;if(t===3)return 7;if(pv)switch(t){case 59:return 85;case 60:if(XA)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(ti)return 57;break}else if(ch&&(ti&&t===93||!ti&&t===92))return 57;return eB[t]||0}var iB=ti?256:2048,sB=512,oB=1024,lB=ti?2048:256,gv=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.("AltGraph"),this.keyCode=rB(t),this.code=t.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(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=iB),this.altKey&&(t|=sB),this.shiftKey&&(t|=oB),this.metaKey&&(t|=lB),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new tB(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Ob=new WeakMap;function nB(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,a=e.parent.location;if(t.origin!=="null"&&a.origin!=="null"&&t.origin!==a.origin)return null}catch{return null}return e.parent}var uB=class{static getSameOriginWindowChain(e){let t=Ob.get(e);if(!t){t=[],Ob.set(e,t);let a=e,r;do r=nB(a),r?t.push({window:new WeakRef(a),iframeElement:a.frameElement||null}):t.push({window:new WeakRef(a),iframeElement:null}),a=r;while(a)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let a=0,r=0,i=this.getSameOriginWindowChain(e);for(let s of i){let o=s.window.deref();if(a+=o?.scrollY??0,r+=o?.scrollX??0,o===t||!s.iframeElement)break;let l=s.iframeElement.getBoundingClientRect();a+=l.top,r+=l.left}return{top:a,left:r}}},tc=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let a=uB.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=a.left,this.posy-=a.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Pb=class{constructor(e,t=0,a=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=a,this.deltaX=t;let r=!1;if(qv){let i=navigator.userAgent.match(/Chrome\/(\d+)/);r=(i?parseInt(i[1]):123)<=122}if(e){let i=e,s=e,o=e.view?.devicePixelRatio||1;if(typeof i.wheelDeltaY<"u")r?this.deltaY=i.wheelDeltaY/(120*o):this.deltaY=i.wheelDeltaY/120;else if(typeof s.VERTICAL_AXIS<"u"&&s.axis===s.VERTICAL_AXIS)this.deltaY=-s.detail/3;else if(e.type==="wheel"){let l=e;l.deltaMode===l.DOM_DELTA_LINE?pv&&!ti?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof i.wheelDeltaX<"u")GR&&jR?this.deltaX=-(i.wheelDeltaX/120):r?this.deltaX=i.wheelDeltaX/(120*o):this.deltaX=i.wheelDeltaX/120;else if(typeof s.HORIZONTAL_AXIS<"u"&&s.axis===s.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let l=e;l.deltaMode===l.DOM_DELTA_LINE?pv&&!ti?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*o):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},JR=Object.freeze(function(e,t){let a=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(a)}}}),cB;(e=>{function t(a){return a===e.None||a===e.Cancelled||a instanceof dB?!0:!a||typeof a!="object"?!1:typeof a.isCancellationRequested=="boolean"&&typeof a.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ta.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:JR})})(cB||={});var dB=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?JR:(this._emitter||(this._emitter=new V),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};var $v=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new lv("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new lv("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},fB=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,a=globalThis){if(this.isDisposed)throw new lv("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=a.setInterval(()=>{e()},t);this.disposable=Ke(()=>{a.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},hB,V_;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?V_=(e,t)=>{QA(()=>{if(a)return;let r=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,r-Date.now())}}))});let a=!1;return{dispose(){a||(a=!0)}}}:V_=(e,t,a)=>{let r=e.requestIdleCallback(t,typeof a=="number"?{timeout:a}:void 0),i=!1;return{dispose(){i||(i=!0,e.cancelIdleCallback(r))}}},hB=e=>V_(globalThis,e)})();var mB;(e=>{async function t(r){let i,s=await Promise.all(r.map(o=>o.then(l=>l,l=>{i||(i=l)})));if(typeof i<"u")throw i;return s}e.settled=t;function a(r){return new Promise(async(i,s)=>{try{await r(i,s)}catch(o){s(o)}})}e.withAsyncBody=a})(mB||={});var Nb=class Sr{static fromArray(t){return new Sr(a=>{a.emitMany(t)})}static fromPromise(t){return new Sr(async a=>{a.emitMany(await t)})}static fromPromises(t){return new Sr(async a=>{await Promise.all(t.map(async r=>a.emitOne(await r)))})}static merge(t){return new Sr(async a=>{await Promise.all(t.map(async r=>{for await(let i of r)a.emitOne(i)}))})}constructor(t,a){this._state=0,this._results=[],this._error=null,this._onReturn=a,this._onStateChanged=new V,queueMicrotask(async()=>{let r={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{await Promise.resolve(t(r)),this.resolve()}catch(i){this.reject(i)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await ta.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,a){return new Sr(async r=>{for await(let i of t)r.emitOne(a(i))})}map(t){return Sr.map(this,t)}static filter(t,a){return new Sr(async r=>{for await(let i of t)a(i)&&r.emitOne(i)})}filter(t){return Sr.filter(this,t)}static coalesce(t){return Sr.filter(t,a=>!!a)}coalesce(){return Sr.coalesce(this)}static async toPromise(t){let a=[];for await(let r of t)a.push(r);return a}toPromise(){return Sr.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Nb.EMPTY=Nb.fromArray([]);function pB(e){return 55296<=e&&e<=56319}function Hb(e){return 56320<=e&&e<=57343}function gB(e,t){return(e-55296<<10)+(t-56320)+65536}function _B(e){return Wv(e,0)}function Wv(e,t){switch(typeof e){case"object":return e===null?Mi(349,t):Array.isArray(e)?SB(e,t):yB(e,t);case"string":return eI(e,t);case"boolean":return vB(e,t);case"number":return Mi(e,t);case"undefined":return Mi(937,t);default:return Mi(617,t)}}function Mi(e,t){return(t<<5)-t+e|0}function vB(e,t){return Mi(e?433:863,t)}function eI(e,t){t=Mi(149417,t);for(let a=0,r=e.length;a<r;a++)t=Mi(e.charCodeAt(a),t);return t}function SB(e,t){return t=Mi(104579,t),e.reduce((a,r)=>Wv(r,a),t)}function yB(e,t){return t=Mi(181387,t),Object.keys(e).sort().reduce((a,r)=>(a=eI(r,a),Wv(e[r],a)),t)}function $_(e,t,a=32){let r=a-t,i=~((1<<r)-1);return(e<<t|(i&e)>>>r)>>>0}function zb(e,t=0,a=e.byteLength,r=0){for(let i=0;i<a;i++)e[t+i]=r}function CB(e,t,a="0"){for(;e.length<t;)e=a+e;return e}function Xu(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(a=>a.toString(16).padStart(2,"0")).join(""):CB((e>>>0).toString(16),t/4)}var LB=class tI{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let a=t.length;if(a===0)return;let r=this._buff,i=this._buffLen,s=this._leftoverHighSurrogate,o,l;for(s!==0?(o=s,l=-1,s=0):(o=t.charCodeAt(0),l=0);;){let n=o;if(pB(o))if(l+1<a){let u=t.charCodeAt(l+1);Hb(u)?(l++,n=gB(o,u)):n=65533}else{s=o;break}else Hb(o)&&(n=65533);if(i=this._push(r,i,n),l++,l<a)o=t.charCodeAt(l);else break}this._buffLen=i,this._leftoverHighSurrogate=s}_push(t,a,r){return r<128?t[a++]=r:r<2048?(t[a++]=192|(r&1984)>>>6,t[a++]=128|(r&63)>>>0):r<65536?(t[a++]=224|(r&61440)>>>12,t[a++]=128|(r&4032)>>>6,t[a++]=128|(r&63)>>>0):(t[a++]=240|(r&1835008)>>>18,t[a++]=128|(r&258048)>>>12,t[a++]=128|(r&4032)>>>6,t[a++]=128|(r&63)>>>0),a>=64&&(this._step(),a-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),a}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Xu(this._h0)+Xu(this._h1)+Xu(this._h2)+Xu(this._h3)+Xu(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,zb(this._buff,this._buffLen),this._buffLen>56&&(this._step(),zb(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=tI._bigBlock32,a=this._buffDV;for(let d=0;d<64;d+=4)t.setUint32(d,a.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)t.setUint32(d,$_(t.getUint32(d-12,!1)^t.getUint32(d-32,!1)^t.getUint32(d-56,!1)^t.getUint32(d-64,!1),1),!1);let r=this._h0,i=this._h1,s=this._h2,o=this._h3,l=this._h4,n,u,c;for(let d=0;d<80;d++)d<20?(n=i&s|~i&o,u=1518500249):d<40?(n=i^s^o,u=1859775393):d<60?(n=i&s|i&o|s&o,u=2400959708):(n=i^s^o,u=3395469782),c=$_(r,5)+n+l+u+t.getUint32(d*4,!1)&4294967295,l=o,o=s,s=$_(i,30),i=r,r=c;this._h0=this._h0+r&4294967295,this._h1=this._h1+i&4294967295,this._h2=this._h2+s&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+l&4294967295}};LB._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:XH,getWindow:Mr,getDocument:YH,getWindows:jH,getWindowsCount:ZH,getWindowId:Ub,getWindowById:QH,hasWindow:JH,onDidRegisterWindow:xB,onWillUnregisterWindow:ez,onDidUnregisterWindow:tz}=(function(){let e=new Map,t={window:rr,disposables:new Ps};e.set(rr.vscodeWindowId,t);let a=new V,r=new V,i=new V;function s(o,l){return(typeof o=="number"?e.get(o):void 0)??(l?t:void 0)}return{onDidRegisterWindow:a.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(o){if(e.has(o.vscodeWindowId))return pe.None;let l=new Ps,n={window:o,disposables:l.add(new Ps)};return e.set(o.vscodeWindowId,n),l.add(Ke(()=>{e.delete(o.vscodeWindowId),r.fire(o)})),l.add(de(o,zt.BEFORE_UNLOAD,()=>{i.fire(o)})),a.fire(n),l},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:s,getWindow(o){let l=o;if(l?.ownerDocument?.defaultView)return l.ownerDocument.defaultView.window;let n=o;return n?.view?n.view.window:rr},getDocument(o){return Mr(o).document}}})(),wB=class{constructor(e,t,a,r){this._node=e,this._type=t,this._handler=a,this._options=r||!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 de(e,t,a,r){return new wB(e,t,a,r)}function bB(e,t){return function(a){return t(new tc(e,a))}}function RB(e){return function(t){return e(new gv(t))}}var Fb=function(e,t,a,r){let i=a;return t==="click"||t==="mousedown"||t==="contextmenu"?i=bB(Mr(e),a):(t==="keydown"||t==="keypress"||t==="keyup")&&(i=RB(a)),de(e,t,i,r)},IB,yh,EB=class extends fB{constructor(e){super(),this.defaultTarget=e&&Mr(e)}cancelAndSet(e,t,a){return super.cancelAndSet(e,t,a??this.defaultTarget)}},W_=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){lh(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,a=new Map,r=new Map,i=s=>{a.set(s,!1);let o=e.get(s)??[];for(t.set(s,o),e.set(s,[]),r.set(s,!0);o.length>0;)o.sort(W_.sort),o.shift().execute();r.set(s,!1)};yh=(s,o,l=0)=>{let n=Ub(s),u=new W_(o,l),c=e.get(n);return c||(c=[],e.set(n,c)),c.push(u),a.get(n)||(a.set(n,!0),s.requestAnimationFrame(()=>i(n))),u},IB=(s,o,l)=>{let n=Ub(s);if(r.get(n)){let u=new W_(o,l),c=t.get(n);return c||(c=[],t.set(n,c)),c.push(u),u}else return yh(s,o,l)}})();var qb=class hh{constructor(t,a){this.width=t,this.height=a}with(t=this.width,a=this.height){return t!==this.width||a!==this.height?new hh(t,a):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof hh?t:new hh(t.width,t.height)}static equals(t,a){return t===a?!0:!t||!a?!1:t.width===a.width&&t.height===a.height}};qb.None=new qb(0,0);function kB(e){let t=e.getBoundingClientRect(),a=Mr(e);return{left:t.left+a.scrollX,top:t.top+a.scrollY,width:t.width,height:t.height}}var az=new class{constructor(){this.mutationObservers=new Map}observe(e,t,a){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=_B(a),s=r.get(i);if(s)s.users+=1;else{let o=new V,l=new MutationObserver(u=>o.fire(u));l.observe(e,a);let n=s={users:1,observer:l,onDidMutate:o.event};t.add(Ke(()=>{n.users-=1,n.users===0&&(o.dispose(),l.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,s)}return s.onDidMutate}},zt={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:ch?"webkitAnimationStart":"animationstart",ANIMATION_END:ch?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:ch?"webkitAnimationIteration":"animationiteration"},DB=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function aI(e,t,a,...r){let i=DB.exec(t);if(!i)throw new Error("Bad use of emmet");let s=i[1]||"div",o;return e!=="http://www.w3.org/1999/xhtml"?o=document.createElementNS(e,s):o=document.createElement(s),i[3]&&(o.id=i[3]),i[4]&&(o.className=i[4].replace(/\./g," ").trim()),a&&Object.entries(a).forEach(([l,n])=>{typeof n>"u"||(/^on\w+$/.test(l)?o[l]=n:l==="selected"?n&&o.setAttribute(l,"true"):o.setAttribute(l,n))}),o.append(...r),o}function MB(e,t,...a){return aI("http://www.w3.org/1999/xhtml",e,t,...a)}MB.SVG=function(e,t,...a){return aI("http://www.w3.org/2000/svg",e,t,...a)};var TB=class{constructor(e){this.domNode=e,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(e){let t=Pa(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Pa(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Pa(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Pa(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Pa(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Pa(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Pa(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Pa(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Pa(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Pa(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Pa(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Pa(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Pa(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Pa(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Pa(e){return typeof e=="number"?`${e}px`:e}function nc(e){return new TB(e)}var rI=class{constructor(){this._hooks=new Ps,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let a=this._onStopCallback;this._onStopCallback=null,e&&a&&a(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,a,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let s=e;try{e.setPointerCapture(t),this._hooks.add(Ke(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=Mr(e)}this._hooks.add(de(s,zt.POINTER_MOVE,o=>{if(o.buttons!==a){this.stopMonitoring(!0);return}o.preventDefault(),this._pointerMoveCallback(o)})),this._hooks.add(de(s,zt.POINTER_UP,o=>this.stopMonitoring(!0)))}};function AB(e,t,a){let r=null,i=null;if(typeof a.value=="function"?(r="value",i=a.value,i.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof a.get=="function"&&(r="get",i=a.get),!i)throw new Error("not supported");let s=`$memoize$${t}`;a[r]=function(...o){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,o)}),this[s]}}var ei;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(ei||={});var ac=class ca extends pe{constructor(){super(),this.dispatched=!1,this.targets=new kb,this.ignoreTargets=new kb,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ta.runAndSubscribe(xB,({window:t,disposables:a})=>{a.add(de(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),a.add(de(t.document,"touchend",r=>this.onTouchEnd(t,r))),a.add(de(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:rr,disposables:this._store}))}static addTarget(t){if(!ca.isTouchDevice())return pe.None;ca.INSTANCE||(ca.INSTANCE=Eb(new ca));let a=ca.INSTANCE.targets.push(t);return Ke(a)}static ignoreTarget(t){if(!ca.isTouchDevice())return pe.None;ca.INSTANCE||(ca.INSTANCE=Eb(new ca));let a=ca.INSTANCE.ignoreTargets.push(t);return Ke(a)}static isTouchDevice(){return"ontouchstart"in rr||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let a=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,i=t.targetTouches.length;r<i;r++){let s=t.targetTouches.item(r);this.activeTouches[s.identifier]={id:s.identifier,initialTarget:s.target,initialTimeStamp:a,initialPageX:s.pageX,initialPageY:s.pageY,rollingTimestamps:[a],rollingPageX:[s.pageX],rollingPageY:[s.pageY]};let o=this.newGestureEvent(ei.Start,s.target);o.pageX=s.pageX,o.pageY=s.pageY,this.dispatchEvent(o)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,a){let r=Date.now(),i=Object.keys(this.activeTouches).length;for(let s=0,o=a.changedTouches.length;s<o;s++){let l=a.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("move of an UNKNOWN touch",l);continue}let n=this.activeTouches[l.identifier],u=Date.now()-n.initialTimeStamp;if(u<ca.HOLD_DELAY&&Math.abs(n.initialPageX-er(n.rollingPageX))<30&&Math.abs(n.initialPageY-er(n.rollingPageY))<30){let c=this.newGestureEvent(ei.Tap,n.initialTarget);c.pageX=er(n.rollingPageX),c.pageY=er(n.rollingPageY),this.dispatchEvent(c)}else if(u>=ca.HOLD_DELAY&&Math.abs(n.initialPageX-er(n.rollingPageX))<30&&Math.abs(n.initialPageY-er(n.rollingPageY))<30){let c=this.newGestureEvent(ei.Contextmenu,n.initialTarget);c.pageX=er(n.rollingPageX),c.pageY=er(n.rollingPageY),this.dispatchEvent(c)}else if(i===1){let c=er(n.rollingPageX),d=er(n.rollingPageY),f=er(n.rollingTimestamps)-n.rollingTimestamps[0],h=c-n.rollingPageX[0],m=d-n.rollingPageY[0],_=[...this.targets].filter(y=>n.initialTarget instanceof Node&&y.contains(n.initialTarget));this.inertia(t,_,r,Math.abs(h)/f,h>0?1:-1,c,Math.abs(m)/f,m>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(ei.End,n.initialTarget)),delete this.activeTouches[l.identifier]}this.dispatched&&(a.preventDefault(),a.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,a){let r=document.createEvent("CustomEvent");return r.initEvent(t,!1,!0),r.initialTarget=a,r.tapCount=0,r}dispatchEvent(t){if(t.type===ei.Tap){let a=new Date().getTime(),r=0;a-this._lastSetTapCountTime>ca.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=a,t.tapCount=r}else(t.type===ei.Change||t.type===ei.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let a=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let i=0,s=t.initialTarget;for(;s&&s!==r;)i++,s=s.parentElement;a.push([i,r])}a.sort((r,i)=>r[0]-i[0]);for(let[r,i]of a)i.dispatchEvent(t),this.dispatched=!0}}inertia(t,a,r,i,s,o,l,n,u){this.handle=yh(t,()=>{let c=Date.now(),d=c-r,f=0,h=0,m=!0;i+=ca.SCROLL_FRICTION*d,l+=ca.SCROLL_FRICTION*d,i>0&&(m=!1,f=s*i*d),l>0&&(m=!1,h=n*l*d);let _=this.newGestureEvent(ei.Change);_.translationX=f,_.translationY=h,a.forEach(y=>y.dispatchEvent(_)),m||this.inertia(t,a,c,i,s,o+f,l,n,u+h)})}onTouchMove(t){let a=Date.now();for(let r=0,i=t.changedTouches.length;r<i;r++){let s=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("end of an UNKNOWN touch",s);continue}let o=this.activeTouches[s.identifier],l=this.newGestureEvent(ei.Change,o.initialTarget);l.translationX=s.pageX-er(o.rollingPageX),l.translationY=s.pageY-er(o.rollingPageY),l.pageX=s.pageX,l.pageY=s.pageY,this.dispatchEvent(l),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(s.pageX),o.rollingPageY.push(s.pageY),o.rollingTimestamps.push(a)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};ac.SCROLL_FRICTION=-.005,ac.HOLD_DELAY=700,ac.CLEAR_TAP_COUNT_TIME=400,ct([AB],ac,"isTouchDevice",1);var BB=ac,Gv=class extends pe{onclick(e,t){this._register(de(e,zt.CLICK,a=>t(new tc(Mr(e),a))))}onmousedown(e,t){this._register(de(e,zt.MOUSE_DOWN,a=>t(new tc(Mr(e),a))))}onmouseover(e,t){this._register(de(e,zt.MOUSE_OVER,a=>t(new tc(Mr(e),a))))}onmouseleave(e,t){this._register(de(e,zt.MOUSE_LEAVE,a=>t(new tc(Mr(e),a))))}onkeydown(e,t){this._register(de(e,zt.KEY_DOWN,a=>t(new gv(a))))}onkeyup(e,t){this._register(de(e,zt.KEY_UP,a=>t(new gv(a))))}oninput(e,t){this._register(de(e,zt.INPUT,t))}onblur(e,t){this._register(de(e,zt.BLUR,t))}onfocus(e,t){this._register(de(e,zt.FOCUS,t))}onchange(e,t){this._register(de(e,zt.CHANGE,t))}ignoreGesture(e){return BB.ignoreTarget(e)}},Vb=11,OB=class extends Gv{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=Vb+"px",this.domNode.style.height=Vb+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new rI),this._register(Fb(this.bgDomNode,zt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Fb(this.domNode,zt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new EB),this._pointerdownScheduleRepeatTimer=this._register(new $v)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Mr(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,a=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},PB=class _v{constructor(t,a,r,i,s,o,l){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(a=a|0,r=r|0,i=i|0,s=s|0,o=o|0,l=l|0),this.rawScrollLeft=i,this.rawScrollTop=l,a<0&&(a=0),i+a>r&&(i=r-a),i<0&&(i=0),s<0&&(s=0),l+s>o&&(l=o-s),l<0&&(l=0),this.width=a,this.scrollWidth=r,this.scrollLeft=i,this.height=s,this.scrollHeight=o,this.scrollTop=l}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,a){return new _v(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,a?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,a?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new _v(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,a){let r=this.width!==t.width,i=this.scrollWidth!==t.scrollWidth,s=this.scrollLeft!==t.scrollLeft,o=this.height!==t.height,l=this.scrollHeight!==t.scrollHeight,n=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:a,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:i,scrollLeftChanged:s,heightChanged:o,scrollHeightChanged:l,scrollTopChanged:n}}},NB=class extends pe{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new V),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new PB(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let a=this._state.withScrollDimensions(e,t);this._setState(a,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let a=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===a.scrollLeft&&this._smoothScrolling.to.scrollTop===a.scrollTop)return;let r;t?r=new Wb(this._smoothScrolling.from,a,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,a,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let a=this._state.withScrollPosition(e);this._smoothScrolling=Wb.start(this._state,a,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 e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let a=this._state;a.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(a,t)))}},$b=class{constructor(e,t,a){this.scrollLeft=e,this.scrollTop=t,this.isDone=a}};function G_(e,t){let a=t-e;return function(r){return e+a*UB(r)}}function HB(e,t,a){return function(r){return r<a?e(r/a):t((r-a)/(1-a))}}var Wb=class vv{constructor(t,a,r,i){this.from=t,this.to=a,this.duration=i,this.startTime=r,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(t,a,r){if(Math.abs(t-a)>2.5*r){let i,s;return t<a?(i=t+.75*r,s=a-.75*r):(i=t-.75*r,s=a+.75*r),HB(G_(t,i),G_(s,a),.33)}return G_(t,a)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let a=(t-this.startTime)/this.duration;if(a<1){let r=this.scrollLeft(a),i=this.scrollTop(a);return new $b(r,i,!1)}return new $b(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,a,r){return vv.start(t,a,r)}static start(t,a,r){r=r+10;let i=Date.now()-10;return new vv(t,a,i,r)}};function zB(e){return Math.pow(e,3)}function UB(e){return 1-zB(1-e)}var FB=class extends pe{constructor(e,t,a){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=a,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new $v)}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(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},qB=140,iI=class extends Gv{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 FB(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new rI),this._shouldRender=!0,this.domNode=nc(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(de(this.domNode.domNode,zt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new OB(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,a,r){this.slider=nc(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof a=="number"&&this.slider.setWidth(a),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(de(this.slider.domNode,zt.POINTER_DOWN,i=>{i.button===0&&(i.preventDefault(),this._sliderPointerDown(i))})),this.onclick(this.slider.domNode,i=>{i.leftButton&&i.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 t=this.domNode.domNode.getClientRects()[0].top,a=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);a<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,a;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,a=e.offsetY;else{let i=kB(this.domNode.domNode);t=e.pageX-i.left,a=e.pageY-i.top}let r=this._pointerDownRelativePosition(t,a);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),a=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{let s=this._sliderOrthogonalPointerPosition(i),o=Math.abs(s-a);if(jR&&o>qB){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let l=this._sliderPointerPosition(i)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(l))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},sI=class Sv{constructor(t,a,r,i,s,o){this._scrollbarSize=Math.round(a),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=i,this._scrollSize=s,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Sv(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let a=Math.round(t);return this._visibleSize!==a?(this._visibleSize=a,this._refreshComputedValues(),!0):!1}setScrollSize(t){let a=Math.round(t);return this._scrollSize!==a?(this._scrollSize=a,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let a=Math.round(t);return this._scrollPosition!==a?(this._scrollPosition=a,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,a,r,i,s){let o=Math.max(0,r-t),l=Math.max(0,o-2*a),n=i>0&&i>r;if(!n)return{computedAvailableSize:Math.round(o),computedIsNeeded:n,computedSliderSize:Math.round(l),computedSliderRatio:0,computedSliderPosition:0};let u=Math.round(Math.max(20,Math.floor(r*l/i))),c=(l-u)/(i-r),d=s*c;return{computedAvailableSize:Math.round(o),computedIsNeeded:n,computedSliderSize:Math.round(u),computedSliderRatio:c,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){let t=Sv._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.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(t){if(!this._computedIsNeeded)return 0;let a=t-this._arrowSize-this._computedSliderSize/2;return Math.round(a/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let a=t-this._arrowSize,r=this._scrollPosition;return a<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let a=this._computedSliderPosition+t;return Math.round(a/this._computedSliderRatio)}},VB=class extends iI{constructor(e,t,a){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:a,scrollbarState:new sI(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),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,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}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}},$B=class extends iI{constructor(e,t,a){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:a,scrollbarState:new sI(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},WB=500,Gb=50,Kb=!0,GB=class{constructor(e,t,a){this.timestamp=e,this.deltaX=t,this.deltaY=a,this.score=0}},yv=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,a=0,r=1,i=this._rear;do{let s=i===this._front?t:Math.pow(2,-r);if(t-=s,a+=this._memory[i].score*s,i===this._front)break;i=(this._capacity+i-1)%this._capacity,r++}while(!0);return a<=.5}acceptStandardWheelEvent(t){if(qv){let a=Mr(t.browserEvent),r=zA(a);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,a,r){let i=null,s=new GB(t,a,r);this._front===-1&&this._rear===-1?(this._memory[0]=s,this._front=0,this._rear=0):(i=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]=s),s.score=this._computeScore(s,i)}_computeScore(t,a){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(r+=.25),a){let i=Math.abs(t.deltaX),s=Math.abs(t.deltaY),o=Math.abs(a.deltaX),l=Math.abs(a.deltaY),n=Math.max(Math.min(i,o),1),u=Math.max(Math.min(s,l),1),c=Math.max(i,o),d=Math.max(s,l);c%n===0&&d%u===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};yv.INSTANCE=new yv;var KB=yv,XB=class extends Gv{constructor(e,t,a){super(),this._onScroll=this._register(new V),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new V),this.onWillScroll=this._onWillScroll.event,this._options=jB(t),this._scrollable=a,this._register(this._scrollable.onScroll(i=>{this._onWillScroll.fire(i),this._onDidScroll(i),this._onScroll.fire(i)}));let r={onMouseWheel:i=>this._onMouseWheel(i),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new $B(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new VB(this._scrollable,this._options,r)),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(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=nc(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=nc(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=nc(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,i=>this._onMouseOver(i)),this.onmouseleave(this._listenOnDomNode,i=>this._onMouseLeave(i)),this._hideTimeout=this._register(new $v),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Ao(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,ti&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Pb(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Ao(this._mouseWheelToDispose),e)){let t=a=>{this._onMouseWheel(new Pb(a))};this._mouseWheelToDispose.push(de(this._listenOnDomNode,zt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=KB.INSTANCE;Kb&&t.acceptStandardWheelEvent(e);let a=!1;if(e.deltaY||e.deltaX){let i=e.deltaY*this._options.mouseWheelScrollSensitivity,s=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&s+i===0?s=i=0:Math.abs(i)>=Math.abs(s)?s=0:i=0),this._options.flipAxes&&([i,s]=[s,i]);let o=!ti&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||o)&&!s&&(s=i,i=0),e.browserEvent&&e.browserEvent.altKey&&(s=s*this._options.fastScrollSensitivity,i=i*this._options.fastScrollSensitivity);let l=this._scrollable.getFutureScrollPosition(),n={};if(i){let u=Gb*i,c=l.scrollTop-(u<0?Math.floor(u):Math.ceil(u));this._verticalScrollbar.writeScrollPosition(n,c)}if(s){let u=Gb*s,c=l.scrollLeft-(u<0?Math.floor(u):Math.ceil(u));this._horizontalScrollbar.writeScrollPosition(n,c)}n=this._scrollable.validateScrollPosition(n),(l.scrollLeft!==n.scrollLeft||l.scrollTop!==n.scrollTop)&&(Kb&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(n):this._scrollable.setScrollPositionNow(n),a=!0)}let r=a;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||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 e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,a=e.scrollLeft>0,r=a?" left":"",i=t?" top":"",s=a||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${i}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){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(),WB)}},YB=class extends XB{constructor(e,t,a){super(e,t,a)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function jB(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,ti&&(t.className+=" mac"),t}var Cv=class extends pe{constructor(e,t,a,r,i,s,o,l){super(),this._bufferService=a,this._optionsService=o,this._renderService=l,this._onRequestScrollLines=this._register(new V),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let n=this._register(new NB({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:u=>yh(r.window,u)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{n.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new YB(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},n)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(u=>{this._scrollableElement.updateOptions({handleMouseWheel:!(u&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(ta.runAndSubscribe(s.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=s.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Ke(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Ke(()=>this._styleElement.remove())),this._register(ta.runAndSubscribe(s.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${s.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${s.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${s.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
39
+ `)})),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(u=>this._handleScroll(u)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.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 t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),a=t-this._bufferService.buffer.ydisp;a!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(a)),this._isHandlingScroll=!1}};Cv=ct([X(2,ya),X(3,Ai),X(4,DR),X(5,rn),X(6,Ca),X(7,Bi)],Cv);var Lv=class extends pe{constructor(e,t,a,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=a,this._decorationService=r,this._renderService=i,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(s=>this._removeDecoration(s))),this._register(Ke(()=>{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){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let a=e.options.x??0;return a&&a>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let a=this._decorationElements.get(e);a||(a=this._createElement(e),e.element=a,this._decorationElements.set(e,a),this._container.appendChild(a),e.onDispose(()=>{this._decorationElements.delete(e),a.remove()})),a.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(a.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,a.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,a.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,a.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(a)}}_refreshXPosition(e,t=e.element){if(!t)return;let a=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=a?`${a*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=a?`${a*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};Lv=ct([X(1,ya),X(2,Ai),X(3,mc),X(4,Bi)],Lv);var ZB=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 t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,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,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,a){return t>=e.startBufferLine-this._linePadding[a||"full"]&&t<=e.endBufferLine+this._linePadding[a||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Qr={full:0,left:0,center:0,right:0},Ts={full:0,left:0,center:0,right:0},Yu={full:0,left:0,center:0,right:0},Ch=class extends pe{constructor(e,t,a,r,i,s,o,l){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=a,this._decorationService=r,this._renderService=i,this._optionsService=s,this._themeService=o,this._coreBrowserService=l,this._colorZoneStore=new ZB,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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(Ke(()=>this._canvas?.remove()));let n=this._canvas.getContext("2d");if(n)this._ctx=n;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(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Ts.full=this._canvas.width,Ts.left=e,Ts.center=t,Ts.right=e,this._refreshDrawHeightConstants(),Yu.full=1,Yu.left=1,Yu.center=1+Ts.left,Yu.right=1+Ts.left+Ts.center}_refreshDrawHeightConstants(){Qr.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Qr.left=t,Qr.center=t,Qr.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Qr.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Qr.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Qr.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Qr.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 t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);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(Yu[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Qr[e.position||"full"]/2),Ts[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Qr[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Ch=ct([X(2,ya),X(3,mc),X(4,Bi),X(5,Ca),X(6,rn),X(7,Ai)],Ch);var B;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
40
+ `,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL="\x7F"))(B||={});var mh;(e=>(e.PAD="\x80",e.HOP="\x81",e.BPH="\x82",e.NBH="\x83",e.IND="\x84",e.NEL="\x85",e.SSA="\x86",e.ESA="\x87",e.HTS="\x88",e.HTJ="\x89",e.VTS="\x8A",e.PLD="\x8B",e.PLU="\x8C",e.RI="\x8D",e.SS2="\x8E",e.SS3="\x8F",e.DCS="\x90",e.PU1="\x91",e.PU2="\x92",e.STS="\x93",e.CCH="\x94",e.MW="\x95",e.SPA="\x96",e.EPA="\x97",e.SOS="\x98",e.SGCI="\x99",e.SCI="\x9A",e.CSI="\x9B",e.ST="\x9C",e.OSC="\x9D",e.PM="\x9E",e.APC="\x9F"))(mh||={});var oI;(e=>e.ST=`${B.ESC}\\`)(oI||={});var xv=class{constructor(e,t,a,r,i,s){this._textarea=e,this._compositionView=t,this._bufferService=a,this._optionsService=r,this._coreService=i,this._renderService=s,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 t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let a;t.start+=this._dataAlreadySent.length,this._isComposing?a=this._textarea.value.substring(t.start,this._compositionPosition.start):a=this._textarea.value.substring(t.start),a.length>0&&this._coreService.triggerDataEvent(a,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,a=t.replace(e,"");this._dataAlreadySent=a,t.length>e.length?this._coreService.triggerDataEvent(a,!0):t.length<e.length?this._coreService.triggerDataEvent(`${B.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,i=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let s=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(s.width,1)+"px",this._textarea.style.height=Math.max(s.height,1)+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};xv=ct([X(2,ya),X(3,Ca),X(4,Oo),X(5,Bi)],xv);var Ut=0,Ft=0,qt=0,ut=0,Xb={css:"#00000000",rgba:0},Ct;(e=>{function t(i,s,o,l){return l!==void 0?`#${Eo(i)}${Eo(s)}${Eo(o)}${Eo(l)}`:`#${Eo(i)}${Eo(s)}${Eo(o)}`}e.toCss=t;function a(i,s,o,l=255){return(i<<24|s<<16|o<<8|l)>>>0}e.toRgba=a;function r(i,s,o,l){return{css:e.toCss(i,s,o,l),rgba:e.toRgba(i,s,o,l)}}e.toColor=r})(Ct||={});var Ge;(e=>{function t(n,u){if(ut=(u.rgba&255)/255,ut===1)return{css:u.css,rgba:u.rgba};let c=u.rgba>>24&255,d=u.rgba>>16&255,f=u.rgba>>8&255,h=n.rgba>>24&255,m=n.rgba>>16&255,_=n.rgba>>8&255;Ut=h+Math.round((c-h)*ut),Ft=m+Math.round((d-m)*ut),qt=_+Math.round((f-_)*ut);let y=Ct.toCss(Ut,Ft,qt),p=Ct.toRgba(Ut,Ft,qt);return{css:y,rgba:p}}e.blend=t;function a(n){return(n.rgba&255)===255}e.isOpaque=a;function r(n,u,c){let d=ph.ensureContrastRatio(n.rgba,u.rgba,c);if(d)return Ct.toColor(d>>24&255,d>>16&255,d>>8&255)}e.ensureContrastRatio=r;function i(n){let u=(n.rgba|255)>>>0;return[Ut,Ft,qt]=ph.toChannels(u),{css:Ct.toCss(Ut,Ft,qt),rgba:u}}e.opaque=i;function s(n,u){return ut=Math.round(u*255),[Ut,Ft,qt]=ph.toChannels(n.rgba),{css:Ct.toCss(Ut,Ft,qt,ut),rgba:Ct.toRgba(Ut,Ft,qt,ut)}}e.opacity=s;function o(n,u){return ut=n.rgba&255,s(n,ut*u/255)}e.multiplyOpacity=o;function l(n){return[n.rgba>>24&255,n.rgba>>16&255,n.rgba>>8&255]}e.toColorRGB=l})(Ge||={});var at;(e=>{let t,a;try{let i=document.createElement("canvas");i.width=1,i.height=1;let s=i.getContext("2d",{willReadFrequently:!0});s&&(t=s,t.globalCompositeOperation="copy",a=t.createLinearGradient(0,0,1,1))}catch{}function r(i){if(i.match(/#[\da-f]{3,8}/i))switch(i.length){case 4:return Ut=parseInt(i.slice(1,2).repeat(2),16),Ft=parseInt(i.slice(2,3).repeat(2),16),qt=parseInt(i.slice(3,4).repeat(2),16),Ct.toColor(Ut,Ft,qt);case 5:return Ut=parseInt(i.slice(1,2).repeat(2),16),Ft=parseInt(i.slice(2,3).repeat(2),16),qt=parseInt(i.slice(3,4).repeat(2),16),ut=parseInt(i.slice(4,5).repeat(2),16),Ct.toColor(Ut,Ft,qt,ut);case 7:return{css:i,rgba:(parseInt(i.slice(1),16)<<8|255)>>>0};case 9:return{css:i,rgba:parseInt(i.slice(1),16)>>>0}}let s=i.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return Ut=parseInt(s[1]),Ft=parseInt(s[2]),qt=parseInt(s[3]),ut=Math.round((s[5]===void 0?1:parseFloat(s[5]))*255),Ct.toColor(Ut,Ft,qt,ut);if(!t||!a)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=a,t.fillStyle=i,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Ut,Ft,qt,ut]=t.getImageData(0,0,1,1).data,ut!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ct.toRgba(Ut,Ft,qt,ut),css:i}}e.toColor=r})(at||={});var Sa;(e=>{function t(r){return a(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function a(r,i,s){let o=r/255,l=i/255,n=s/255,u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),c=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),d=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4);return u*.2126+c*.7152+d*.0722}e.relativeLuminance2=a})(Sa||={});var ph;(e=>{function t(o,l){if(ut=(l&255)/255,ut===1)return l;let n=l>>24&255,u=l>>16&255,c=l>>8&255,d=o>>24&255,f=o>>16&255,h=o>>8&255;return Ut=d+Math.round((n-d)*ut),Ft=f+Math.round((u-f)*ut),qt=h+Math.round((c-h)*ut),Ct.toRgba(Ut,Ft,qt)}e.blend=t;function a(o,l,n){let u=Sa.relativeLuminance(o>>8),c=Sa.relativeLuminance(l>>8);if(ki(u,c)<n){if(c<u){let h=r(o,l,n),m=ki(u,Sa.relativeLuminance(h>>8));if(m<n){let _=i(o,l,n),y=ki(u,Sa.relativeLuminance(_>>8));return m>y?h:_}return h}let d=i(o,l,n),f=ki(u,Sa.relativeLuminance(d>>8));if(f<n){let h=r(o,l,n),m=ki(u,Sa.relativeLuminance(h>>8));return f>m?d:h}return d}}e.ensureContrastRatio=a;function r(o,l,n){let u=o>>24&255,c=o>>16&255,d=o>>8&255,f=l>>24&255,h=l>>16&255,m=l>>8&255,_=ki(Sa.relativeLuminance2(f,h,m),Sa.relativeLuminance2(u,c,d));for(;_<n&&(f>0||h>0||m>0);)f-=Math.max(0,Math.ceil(f*.1)),h-=Math.max(0,Math.ceil(h*.1)),m-=Math.max(0,Math.ceil(m*.1)),_=ki(Sa.relativeLuminance2(f,h,m),Sa.relativeLuminance2(u,c,d));return(f<<24|h<<16|m<<8|255)>>>0}e.reduceLuminance=r;function i(o,l,n){let u=o>>24&255,c=o>>16&255,d=o>>8&255,f=l>>24&255,h=l>>16&255,m=l>>8&255,_=ki(Sa.relativeLuminance2(f,h,m),Sa.relativeLuminance2(u,c,d));for(;_<n&&(f<255||h<255||m<255);)f=Math.min(255,f+Math.ceil((255-f)*.1)),h=Math.min(255,h+Math.ceil((255-h)*.1)),m=Math.min(255,m+Math.ceil((255-m)*.1)),_=ki(Sa.relativeLuminance2(f,h,m),Sa.relativeLuminance2(u,c,d));return(f<<24|h<<16|m<<8|255)>>>0}e.increaseLuminance=i;function s(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}e.toChannels=s})(ph||={});function Eo(e){let t=e.toString(16);return t.length<2?"0"+t:t}function ki(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var QB=class extends hc{constructor(e,t,a){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=a}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()]}},Lh=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Cr}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let a=[],r=t.translateToString(!0),i=0,s=0,o=0,l=t.getFg(0),n=t.getBg(0);for(let u=0;u<t.getTrimmedLength();u++)if(t.loadCell(u,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==l||this._workCell.bg!==n){if(u-i>1){let c=this._getJoinedRanges(r,o,s,t,i);for(let d=0;d<c.length;d++)a.push(c[d])}i=u,o=s,l=this._workCell.fg,n=this._workCell.bg}s+=this._workCell.getChars().length||Os.length}if(this._bufferService.cols-i>1){let u=this._getJoinedRanges(r,o,s,t,i);for(let c=0;c<u.length;c++)a.push(u[c])}return a}_getJoinedRanges(e,t,a,r,i){let s=e.substring(t,a),o=[];try{o=this._characterJoiners[0].handler(s)}catch(l){console.error(l)}for(let l=1;l<this._characterJoiners.length;l++)try{let n=this._characterJoiners[l].handler(s);for(let u=0;u<n.length;u++)Lh._mergeRanges(o,n[u])}catch(n){console.error(n)}return this._stringRangesToCellRanges(o,r,i),o}_stringRangesToCellRanges(e,t,a){let r=0,i=!1,s=0,o=e[r];if(o){for(let l=a;l<this._bufferService.cols;l++){let n=t.getWidth(l),u=t.getString(l).length||Os.length;if(n!==0){if(!i&&o[0]<=s&&(o[0]=l,i=!0),o[1]<=s){if(o[1]=l,o=e[++r],!o)break;o[0]<=s?(o[0]=l,i=!0):i=!1}s+=u}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let a=!1;for(let r=0;r<e.length;r++){let i=e[r];if(a){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),a=!0);continue}}return a?e[e.length-1][1]=t[1]:e.push(t),e}};Lh=ct([X(0,ya)],Lh);function JB(e){return 57508<=e&&e<=57558}function eO(e){return 9472<=e&&e<=9631}function tO(e){return JB(e)||eO(e)}function aO(){return{css:{canvas:rh(),cell:rh()},device:{canvas:rh(),cell:rh(),char:{width:0,height:0,left:0,top:0}}}}function rh(){return{width:0,height:0}}var wv=class{constructor(e,t,a,r,i,s,o){this._document=e,this._characterJoinerService=t,this._optionsService=a,this._coreBrowserService=r,this._coreService=i,this._decorationService=s,this._themeService=o,this._workCell=new Cr,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,a){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=a}createRow(e,t,a,r,i,s,o,l,n,u,c){let d=[],f=this._characterJoinerService.getJoinedCharacters(t),h=this._themeService.colors,m=e.getNoBgTrimmedLength();a&&m<s+1&&(m=s+1);let _,y=0,p="",g=0,v=0,C=0,x=0,k=!1,T=0,U=!1,w=0,N=0,H=[],ee=u!==-1&&c!==-1;for(let R=0;R<m;R++){e.loadCell(R,this._workCell);let E=this._workCell.getWidth();if(E===0)continue;let z=!1,F=R>=N,I=R,A=this._workCell;if(f.length>0&&R===f[0][0]&&F){let ke=f.shift(),mt=this._isCellInSelection(ke[0],t);for(g=ke[0]+1;g<ke[1];g++)F&&=mt===this._isCellInSelection(g,t);F&&=!a||s<ke[0]||s>=ke[1],F?(z=!0,A=new QB(this._workCell,e.translateToString(!0,ke[0],ke[1]),ke[1]-ke[0]),I=ke[1]-1,E=A.getWidth()):N=ke[1]}let te=this._isCellInSelection(R,t),J=a&&R===s,Re=ee&&R>=u&&R<=c,Ye=!1;this._decorationService.forEachDecorationAtCell(R,t,void 0,ke=>{Ye=!0});let it=A.getChars()||Os;if(it===" "&&(A.isUnderline()||A.isOverline())&&(it="\xA0"),w=E*l-n.get(it,A.isBold(),A.isItalic()),!_)_=this._document.createElement("span");else if(y&&(te&&U||!te&&!U&&A.bg===v)&&(te&&U&&h.selectionForeground||A.fg===C)&&A.extended.ext===x&&Re===k&&w===T&&!J&&!z&&!Ye&&F){A.isInvisible()?p+=Os:p+=it,y++;continue}else y&&(_.textContent=p),_=this._document.createElement("span"),y=0,p="";if(v=A.bg,C=A.fg,x=A.extended.ext,k=Re,T=w,U=te,z&&s>=R&&s<=I&&(s=R),!this._coreService.isCursorHidden&&J&&this._coreService.isCursorInitialized){if(H.push("xterm-cursor"),this._coreBrowserService.isFocused)o&&H.push("xterm-cursor-blink"),H.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(i)switch(i){case"outline":H.push("xterm-cursor-outline");break;case"block":H.push("xterm-cursor-block");break;case"bar":H.push("xterm-cursor-bar");break;case"underline":H.push("xterm-cursor-underline");break;default:break}}if(A.isBold()&&H.push("xterm-bold"),A.isItalic()&&H.push("xterm-italic"),A.isDim()&&H.push("xterm-dim"),A.isInvisible()?p=Os:p=A.getChars()||Os,A.isUnderline()&&(H.push(`xterm-underline-${A.extended.underlineStyle}`),p===" "&&(p="\xA0"),!A.isUnderlineColorDefault()))if(A.isUnderlineColorRGB())_.style.textDecorationColor=`rgb(${hc.toColorRGB(A.getUnderlineColor()).join(",")})`;else{let ke=A.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&A.isBold()&&ke<8&&(ke+=8),_.style.textDecorationColor=h.ansi[ke].css}A.isOverline()&&(H.push("xterm-overline"),p===" "&&(p="\xA0")),A.isStrikethrough()&&H.push("xterm-strikethrough"),Re&&(_.style.textDecoration="underline");let M=A.getFgColor(),G=A.getFgColorMode(),K=A.getBgColor(),le=A.getBgColorMode(),ue=!!A.isInverse();if(ue){let ke=M;M=K,K=ke;let mt=G;G=le,le=mt}let be,xt,Tt=!1;this._decorationService.forEachDecorationAtCell(R,t,void 0,ke=>{ke.options.layer!=="top"&&Tt||(ke.backgroundColorRGB&&(le=50331648,K=ke.backgroundColorRGB.rgba>>8&16777215,be=ke.backgroundColorRGB),ke.foregroundColorRGB&&(G=50331648,M=ke.foregroundColorRGB.rgba>>8&16777215,xt=ke.foregroundColorRGB),Tt=ke.options.layer==="top")}),!Tt&&te&&(be=this._coreBrowserService.isFocused?h.selectionBackgroundOpaque:h.selectionInactiveBackgroundOpaque,K=be.rgba>>8&16777215,le=50331648,Tt=!0,h.selectionForeground&&(G=50331648,M=h.selectionForeground.rgba>>8&16777215,xt=h.selectionForeground)),Tt&&H.push("xterm-decoration-top");let Ua;switch(le){case 16777216:case 33554432:Ua=h.ansi[K],H.push(`xterm-bg-${K}`);break;case 50331648:Ua=Ct.toColor(K>>16,K>>8&255,K&255),this._addStyle(_,`background-color:#${Yb((K>>>0).toString(16),"0",6)}`);break;default:ue?(Ua=h.foreground,H.push("xterm-bg-257")):Ua=h.background}switch(be||A.isDim()&&(be=Ge.multiplyOpacity(Ua,.5)),G){case 16777216:case 33554432:A.isBold()&&M<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(M+=8),this._applyMinimumContrast(_,Ua,h.ansi[M],A,be,void 0)||H.push(`xterm-fg-${M}`);break;case 50331648:let ke=Ct.toColor(M>>16&255,M>>8&255,M&255);this._applyMinimumContrast(_,Ua,ke,A,be,xt)||this._addStyle(_,`color:#${Yb(M.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(_,Ua,h.foreground,A,be,xt)||ue&&H.push("xterm-fg-257")}H.length&&(_.className=H.join(" "),H.length=0),!J&&!z&&!Ye&&F?y++:_.textContent=p,w!==this.defaultSpacing&&(_.style.letterSpacing=`${w}px`),d.push(_),R=I}return _&&y&&(_.textContent=p),d}_applyMinimumContrast(e,t,a,r,i,s){if(this._optionsService.rawOptions.minimumContrastRatio===1||tO(r.getCode()))return!1;let o=this._getContrastCache(r),l;if(!i&&!s&&(l=o.getColor(t.rgba,a.rgba)),l===void 0){let n=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);l=Ge.ensureContrastRatio(i||t,s||a,n),o.setColor((i||t).rgba,(s||a).rgba,l??null)}return l?(this._addStyle(e,`color:${l.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let a=this._selectionStart,r=this._selectionEnd;return!a||!r?!1:this._columnSelectMode?a[0]<=r[0]?e>=a[0]&&t>=a[1]&&e<r[0]&&t<=r[1]:e<a[0]&&t>=a[1]&&e>=r[0]&&t<=r[1]:t>a[1]&&t<r[1]||a[1]===r[1]&&t===a[1]&&e>=a[0]&&e<r[0]||a[1]<r[1]&&t===r[1]&&e<r[0]||a[1]<r[1]&&t===a[1]&&e>=a[0]}};wv=ct([X(1,AR),X(2,Ca),X(3,Ai),X(4,Oo),X(5,mc),X(6,rn)],wv);function Yb(e,t,a){for(;e.length<a;)e=t+e;return e}var rO=class{constructor(e,t){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 a=e.createElement("span");a.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let i=e.createElement("span");i.classList.add("xterm-char-measure-element"),i.style.fontStyle="italic";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold",s.style.fontStyle="italic",this._measureElements=[a,r,i,s],this._container.appendChild(a),this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(s),t.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,t,a,r){e===this._font&&t===this._fontSize&&a===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=a,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${a}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${a}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,a){let r=0;if(!t&&!a&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let o=this._measure(e,0);return o>0&&(this._flat[r]=o),o}let i=e;t&&(i+="B"),a&&(i+="I");let s=this._holey.get(i);if(s===void 0){let o=0;t&&(o|=1),a&&(o|=2),s=this._measure(e,o),s>0&&this._holey.set(i,s)}return s}_measure(e,t){let a=this._measureElements[t];return a.textContent=e.repeat(32),a.offsetWidth/32}},iO=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,t,a,r=!1){if(this.selectionStart=t,this.selectionEnd=a,!t||!a||t[0]===a[0]&&t[1]===a[1]){this.clear();return}let i=e.buffers.active.ydisp,s=t[1]-i,o=a[1]-i,l=Math.max(s,0),n=Math.min(o,e.rows-1);if(l>=e.rows||n<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=s,this.viewportEndRow=o,this.viewportCappedStartRow=l,this.viewportCappedEndRow=n,this.startCol=t[0],this.endCol=a[0]}isCellSelected(e,t,a){return this.hasSelection?(a-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&a>=this.viewportCappedStartRow&&t<this.endCol&&a<=this.viewportCappedEndRow:t<this.startCol&&a>=this.viewportCappedStartRow&&t>=this.endCol&&a<=this.viewportCappedEndRow:a>this.viewportStartRow&&a<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&a===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&a===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&a===this.viewportStartRow&&t>=this.startCol):!1}};function sO(){return new iO}var K_="xterm-dom-renderer-owner-",vr="xterm-rows",ih="xterm-fg-",jb="xterm-bg-",ju="xterm-focus",sh="xterm-selection",oO=1,bv=class extends pe{constructor(e,t,a,r,i,s,o,l,n,u,c,d,f,h){super(),this._terminal=e,this._document=t,this._element=a,this._screenElement=r,this._viewportElement=i,this._helperContainer=s,this._linkifier2=o,this._charSizeService=n,this._optionsService=u,this._bufferService=c,this._coreService=d,this._coreBrowserService=f,this._themeService=h,this._terminalClass=oO++,this._rowElements=[],this._selectionRenderModel=sO(),this.onRequestRedraw=this._register(new V).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(vr),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(sh),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=aO(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(m=>this._injectCss(m))),this._injectCss(this._themeService.colors),this._rowFactory=l.createInstance(wv,document),this._element.classList.add(K_+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(m=>this._handleLinkHover(m))),this._register(this._linkifier2.onHideLinkUnderline(m=>this._handleLinkLeave(m))),this._register(Ke(()=>{this._element.classList.remove(K_+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new rO(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 a of this._rowElements)a.style.width=`${this.dimensions.css.canvas.width}px`,a.style.height=`${this.dimensions.css.cell.height}px`,a.style.lineHeight=`${this.dimensions.css.cell.height}px`,a.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${vr} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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 t=`${this._terminalSelector} .${vr} { 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}`;t+=`${this._terminalSelector} .${vr} .xterm-dim { color: ${Ge.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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 a=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${a} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${vr}.${ju} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${vr}.${ju} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${vr}.${ju} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${sh} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${sh} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${sh} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[s,o]of e.ansi.entries())t+=`${this._terminalSelector} .${ih}${s} { color: ${o.css}; }${this._terminalSelector} .${ih}${s}.xterm-dim { color: ${Ge.multiplyOpacity(o,.5).css}; }${this._terminalSelector} .${jb}${s} { background-color: ${o.css}; }`;t+=`${this._terminalSelector} .${ih}257 { color: ${Ge.opaque(e.background).css}; }${this._terminalSelector} .${ih}257.xterm-dim { color: ${Ge.multiplyOpacity(Ge.opaque(e.background),.5).css}; }${this._terminalSelector} .${jb}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_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,t){for(let a=this._rowElements.length;a<=t;a++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(ju),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(ju),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,a){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,a),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,a),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,s=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,l=this._document.createDocumentFragment();if(a){let n=e[0]>t[0];l.appendChild(this._createSelectionElement(s,n?t[0]:e[0],n?e[0]:t[0],o-s+1))}else{let n=r===s?e[0]:0,u=s===i?t[0]:this._bufferService.cols;l.appendChild(this._createSelectionElement(s,n,u));let c=o-s-1;if(l.appendChild(this._createSelectionElement(s+1,0,this._bufferService.cols,c)),s!==o){let d=i===o?t[0]:this._bufferService.cols;l.appendChild(this._createSelectionElement(o,0,d))}}this._selectionContainer.appendChild(l)}_createSelectionElement(e,t,a,r=1){let i=this._document.createElement("div"),s=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(a-t);return s+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-s),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${s}px`,i.style.width=`${o}px`,i}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,t){let a=this._bufferService.buffer,r=a.ybase+a.y,i=Math.min(a.x,this._bufferService.cols-1),s=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,l=this._optionsService.rawOptions.cursorInactiveStyle;for(let n=e;n<=t;n++){let u=n+a.ydisp,c=this._rowElements[n],d=a.lines.get(u);if(!c||!d)break;c.replaceChildren(...this._rowFactory.createRow(d,u,u===r,o,l,i,s,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${K_}${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,t,a,r,i,s){a<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;a=Math.max(Math.min(a,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let l=this._bufferService.buffer,n=l.ybase+l.y,u=Math.min(l.x,i-1),c=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let h=a;h<=r;++h){let m=h+l.ydisp,_=this._rowElements[h],y=l.lines.get(m);if(!_||!y)break;_.replaceChildren(...this._rowFactory.createRow(y,m,m===n,d,f,u,c,this.dimensions.css.cell.width,this._widthCache,s?h===a?e:0:-1,s?(h===r?t:i)-1:-1))}}};bv=ct([X(7,zv),X(8,Ih),X(9,Ca),X(10,ya),X(11,Oo),X(12,Ai),X(13,rn)],bv);var Rv=class extends pe{constructor(e,t,a){super(),this._optionsService=a,this.width=0,this.height=0,this._onCharSizeChange=this._register(new V),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new nO(this._optionsService))}catch{this._measureStrategy=this._register(new lO(e,t,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())}};Rv=ct([X(2,Ca)],Rv);var lI=class extends pe{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},lO=class extends lI{constructor(e,t,a){super(),this._document=e,this._parentElement=t,this._optionsService=a,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}},nO=class extends lI{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))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}},uO=class extends pe{constructor(e,t,a){super(),this._textarea=e,this._window=t,this.mainDocument=a,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new cO(this._window)),this._onDprChange=this._register(new V),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new V),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(ta.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(de(this._textarea,"focus",()=>this._isFocused=!0)),this._register(de(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}},cO=class extends pe{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new an),this._onDprChange=this._register(new V),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Ke(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=de(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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)}},dO=class extends pe{constructor(){super(),this.linkProviders=[],this._register(Ke(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Kv(e,t,a){let r=a.getBoundingClientRect(),i=e.getComputedStyle(a),s=parseInt(i.getPropertyValue("padding-left")),o=parseInt(i.getPropertyValue("padding-top"));return[t.clientX-r.left-s,t.clientY-r.top-o]}function fO(e,t,a,r,i,s,o,l,n){if(!s)return;let u=Kv(e,t,a);if(u)return u[0]=Math.ceil((u[0]+(n?o/2:0))/o),u[1]=Math.ceil(u[1]/l),u[0]=Math.min(Math.max(u[0],1),r+(n?1:0)),u[1]=Math.min(Math.max(u[1],1),i),u}var Iv=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,a,r,i){return fO(window,e,t,a,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let a=Kv(window,e,t);if(this._charSizeService.hasValidSize)return a[0]=Math.min(Math.max(a[0],0),this._renderService.dimensions.css.canvas.width-1),a[1]=Math.min(Math.max(a[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(a[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(a[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(a[0]),y:Math.floor(a[1])}}};Iv=ct([X(0,Bi),X(1,Ih)],Iv);var hO=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,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,t,a){this._rowCount=a,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t,!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),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},nI={};jT(nI,{getSafariVersion:()=>pO,isChromeOS:()=>fI,isFirefox:()=>uI,isIpad:()=>gO,isIphone:()=>_O,isLegacyEdge:()=>mO,isLinux:()=>Xv,isMac:()=>xh,isNode:()=>Dh,isSafari:()=>cI,isWindows:()=>dI});var Dh=typeof process<"u"&&"title"in process,pc=Dh?"node":navigator.userAgent,gc=Dh?"node":navigator.platform,uI=pc.includes("Firefox"),mO=pc.includes("Edge"),cI=/^((?!chrome|android).)*safari/i.test(pc);function pO(){if(!cI)return 0;let e=pc.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var xh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(gc),gO=gc==="iPad",_O=gc==="iPhone",dI=["Windows","Win16","Win32","WinCE"].includes(gc),Xv=gc.indexOf("Linux")>=0,fI=/\bCrOS\b/.test(pc),hI=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let t=0,a=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),a=Math.max(t,a),i=e.timeRemaining(),a*1.5>i){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},vO=class extends hI{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},SO=class extends hI{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},wh=!Dh&&"requestIdleCallback"in window?SO:vO,yO=class{constructor(){this._queue=new wh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Ev=class extends pe{constructor(e,t,a,r,i,s,o,l,n){super(),this._rowCount=e,this._optionsService=a,this._charSizeService=r,this._coreService=i,this._coreBrowserService=l,this._renderer=this._register(new an),this._pausedResizeTask=new yO,this._observerDisposable=this._register(new an),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 V),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new V),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new V),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new V),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new hO((u,c)=>this._renderRows(u,c),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new CO(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Ke(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(s.onDecorationRegistered(()=>this._fullRefresh())),this._register(s.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(n.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(u=>this._registerIntersectionObserver(u,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let a=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});a.observe(t),this._observerDisposable.value=Ke(()=>a.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,t,a=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),a||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),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:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(t=>this.refreshRows(t.start,t.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(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,a){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=a,this._renderer.value?.handleSelectionChanged(e,t,a)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};Ev=ct([X(2,Ca),X(3,Ih),X(4,Oo),X(5,mc),X(6,ya),X(7,Ai),X(8,rn)],Ev);var CO=class{constructor(e,t,a){this._coreBrowserService=e,this._coreService=t,this._onTimeout=a,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,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 e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function LO(e,t,a,r){let i=a.buffer.x,s=a.buffer.y;if(!a.buffer.hasScrollback)return bO(i,s,e,t,a,r)+Mh(s,t,a,r)+RO(i,s,e,t,a,r);let o;if(s===t)return o=i>e?"D":"C",dc(Math.abs(i-e),cc(o,r));o=s>t?"D":"C";let l=Math.abs(s-t),n=wO(s>t?e:i,a)+(l-1)*a.cols+1+xO(s>t?i:e,a);return dc(n,cc(o,r))}function xO(e,t){return e-1}function wO(e,t){return t.cols-e}function bO(e,t,a,r,i,s){return Mh(t,r,i,s).length===0?"":dc(pI(e,t,e,t-Bo(t,i),!1,i).length,cc("D",s))}function Mh(e,t,a,r){let i=e-Bo(e,a),s=t-Bo(t,a),o=Math.abs(i-s)-IO(e,t,a);return dc(o,cc(mI(e,t),r))}function RO(e,t,a,r,i,s){let o;Mh(t,r,i,s).length>0?o=r-Bo(r,i):o=t;let l=r,n=EO(e,t,a,r,i,s);return dc(pI(e,o,a,l,n==="C",i).length,cc(n,s))}function IO(e,t,a){let r=0,i=e-Bo(e,a),s=t-Bo(t,a);for(let o=0;o<Math.abs(i-s);o++){let l=mI(e,t)==="A"?-1:1;a.buffer.lines.get(i+l*o)?.isWrapped&&r++}return r}function Bo(e,t){let a=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)a++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return a}function EO(e,t,a,r,i,s){let o;return Mh(a,r,i,s).length>0?o=r-Bo(r,i):o=t,e<a&&o<=r||e>=a&&o<r?"C":"D"}function mI(e,t){return e>t?"A":"B"}function pI(e,t,a,r,i,s){let o=e,l=t,n="";for(;(o!==a||l!==r)&&l>=0&&l<s.buffer.lines.length;)o+=i?1:-1,i&&o>s.cols-1?(n+=s.buffer.translateBufferLineToString(l,!1,e,o),o=0,e=0,l++):!i&&o<0&&(n+=s.buffer.translateBufferLineToString(l,!1,0,e+1),o=s.cols-1,e=o,l--);return n+s.buffer.translateBufferLineToString(l,!1,e,o)}function cc(e,t){let a=t?"O":"[";return B.ESC+a+e}function dc(e,t){e=Math.floor(e);let a="";for(let r=0;r<e;r++)a+=t;return a}var kO=class{constructor(e){this._bufferService=e,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 e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function Zb(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var X_=50,DO=15,MO=50,TO=500,AO="\xA0",BO=new RegExp(AO,"g"),kv=class extends pe{constructor(e,t,a,r,i,s,o,l,n){super(),this._element=e,this._screenElement=t,this._linkifier=a,this._bufferService=r,this._coreService=i,this._mouseService=s,this._optionsService=o,this._renderService=l,this._coreBrowserService=n,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Cr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new V),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new V),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new V),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new V),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=u=>this._handleMouseMove(u),this._mouseUpListener=u=>this._handleMouseUp(u),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(u=>this._handleTrim(u)),this._register(this._bufferService.buffers.onBufferActivate(u=>this._handleBufferActivate(u))),this.enable(),this._model=new kO(this._bufferService),this._activeSelectionMode=0,this._register(Ke(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(u=>{u.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,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let a=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let i=e[0]<t[0]?e[0]:t[0],s=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let l=a.translateBufferLineToString(o,!0,i,s);r.push(l)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(a.translateBufferLineToString(e[1],!0,e[0],i));for(let s=e[1]+1;s<=t[1]-1;s++){let o=a.lines.get(s),l=a.translateBufferLineToString(s,!0);o?.isWrapped?r[r.length-1]+=l:r.push(l)}if(e[1]!==t[1]){let s=a.lines.get(t[1]),o=a.translateBufferLineToString(t[1],!0,0,t[0]);s&&s.isWrapped?r[r.length-1]+=o:r.push(o)}}return r.map(i=>i.replace(BO," ")).join(dI?`\r
41
+ `:`
42
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Xv&&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 t=this._getMouseBufferCoords(e),a=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!a||!r||!t?!1:this._areCoordsInSelection(t,a,r)}isCellInSelection(e,t){let a=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!a||!r?!1:this._areCoordsInSelection([e,t],a,r)}_areCoordsInSelection(e,t,a){return e[1]>t[1]&&e[1]<a[1]||t[1]===a[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<a[0]||t[1]<a[1]&&e[1]===a[1]&&e[0]<a[0]||t[1]<a[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let a=this._linkifier.currentLink?.link?.range;if(a)return this._model.selectionStart=[a.start.x-1,a.start.y-1],this._model.selectionStartLength=Zb(a,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Kv(this._coreBrowserService.window,e,this._screenElement)[1],a=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=a?0:(t>a&&(t-=a),t=Math.min(Math.max(t,-X_),X_),t/=X_,t/Math.abs(t)+Math.round(t*(DO-1)))}shouldForceSelection(e){return xh?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(),MO)}_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 t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(xh&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=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 a=this._bufferService.buffer;if(this._model.selectionEnd[1]<a.lines.length){let r=a.lines.get(this._model.selectionEnd[1]);r&&r.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[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 t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<TO&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let a=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(a&&a[0]!==void 0&&a[1]!==void 0){let r=LO(a[0]-1,a[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,a=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!a){this._oldHasSelection&&this._fireOnSelectionChange(e,t,a);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,a)}_fireOnSelectionChange(e,t,a){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=a,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let a=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?a--:i>1&&t!==r&&(a+=i-1)}return a}setSelection(e,t,a){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=a,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,a=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,s=i.lines.get(e[1]);if(!s)return;let o=i.translateBufferLineToString(e[1],!1),l=this._convertViewportColToCharacterIndex(s,e[0]),n=l,u=e[0]-l,c=0,d=0,f=0,h=0;if(o.charAt(l)===" "){for(;l>0&&o.charAt(l-1)===" ";)l--;for(;n<o.length&&o.charAt(n+1)===" ";)n++}else{let y=e[0],p=e[0];s.getWidth(y)===0&&(c++,y--),s.getWidth(p)===2&&(d++,p++);let g=s.getString(p).length;for(g>1&&(h+=g-1,n+=g-1);y>0&&l>0&&!this._isCharWordSeparator(s.loadCell(y-1,this._workCell));){s.loadCell(y-1,this._workCell);let v=this._workCell.getChars().length;this._workCell.getWidth()===0?(c++,y--):v>1&&(f+=v-1,l-=v-1),l--,y--}for(;p<s.length&&n+1<o.length&&!this._isCharWordSeparator(s.loadCell(p+1,this._workCell));){s.loadCell(p+1,this._workCell);let v=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,p++):v>1&&(h+=v-1,n+=v-1),n++,p++}}n++;let m=l+u-c+f,_=Math.min(this._bufferService.cols,n-l+c+d-f-h);if(!(!t&&o.slice(l,n).trim()==="")){if(a&&m===0&&s.getCodePoint(0)!==32){let y=i.lines.get(e[1]-1);if(y&&s.isWrapped&&y.getCodePoint(this._bufferService.cols-1)!==32){let p=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(p){let g=this._bufferService.cols-p.start;m-=g,_+=g}}}if(r&&m+_===this._bufferService.cols&&s.getCodePoint(this._bufferService.cols-1)!==32){let y=i.lines.get(e[1]+1);if(y?.isWrapped&&y.getCodePoint(0)!==32){let p=this._getWordAt([0,e[1]+1],!1,!1,!0);p&&(_+=p.length)}}return{start:m,length:_}}}_selectWordAt(e,t){let a=this._getWordAt(e,t);if(a){for(;a.start<0;)a.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[a.start,e[1]],this._model.selectionStartLength=a.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let a=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,a--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,a++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,a]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),a={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=Zb(a,this._bufferService.cols)}};kv=ct([X(3,ya),X(4,Oo),X(5,Uv),X(6,Ca),X(7,Bi),X(8,Ai)],kv);var Qb=class{constructor(){this._data={}}set(e,t,a){this._data[e]||(this._data[e]={}),this._data[e][t]=a}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},Jb=class{constructor(){this._color=new Qb,this._css=new Qb}setCss(e,t,a){this._css.set(e,t,a)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,a){this._color.set(e,t,a)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},kt=Object.freeze((()=>{let e=[at.toColor("#2e3436"),at.toColor("#cc0000"),at.toColor("#4e9a06"),at.toColor("#c4a000"),at.toColor("#3465a4"),at.toColor("#75507b"),at.toColor("#06989a"),at.toColor("#d3d7cf"),at.toColor("#555753"),at.toColor("#ef2929"),at.toColor("#8ae234"),at.toColor("#fce94f"),at.toColor("#729fcf"),at.toColor("#ad7fa8"),at.toColor("#34e2e2"),at.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let a=0;a<216;a++){let r=t[a/36%6|0],i=t[a/6%6|0],s=t[a%6];e.push({css:Ct.toCss(r,i,s),rgba:Ct.toRgba(r,i,s)})}for(let a=0;a<24;a++){let r=8+a*10;e.push({css:Ct.toCss(r,r,r),rgba:Ct.toRgba(r,r,r)})}return e})()),ko=at.toColor("#ffffff"),rc=at.toColor("#000000"),eR=at.toColor("#ffffff"),tR=rc,Zu={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},OO=ko,Dv=class extends pe{constructor(e){super(),this._optionsService=e,this._contrastCache=new Jb,this._halfContrastCache=new Jb,this._onChangeColors=this._register(new V),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:ko,background:rc,cursor:eR,cursorAccent:tR,selectionForeground:void 0,selectionBackgroundTransparent:Zu,selectionBackgroundOpaque:Ge.blend(rc,Zu),selectionInactiveBackgroundTransparent:Zu,selectionInactiveBackgroundOpaque:Ge.blend(rc,Zu),scrollbarSliderBackground:Ge.opacity(ko,.2),scrollbarSliderHoverBackground:Ge.opacity(ko,.4),scrollbarSliderActiveBackground:Ge.opacity(ko,.5),overviewRulerBorder:ko,ansi:kt.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 t=this._colors;if(t.foreground=ze(e.foreground,ko),t.background=ze(e.background,rc),t.cursor=Ge.blend(t.background,ze(e.cursor,eR)),t.cursorAccent=Ge.blend(t.background,ze(e.cursorAccent,tR)),t.selectionBackgroundTransparent=ze(e.selectionBackground,Zu),t.selectionBackgroundOpaque=Ge.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=ze(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Ge.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?ze(e.selectionForeground,Xb):void 0,t.selectionForeground===Xb&&(t.selectionForeground=void 0),Ge.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Ge.opacity(t.selectionBackgroundTransparent,.3)),Ge.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Ge.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=ze(e.scrollbarSliderBackground,Ge.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=ze(e.scrollbarSliderHoverBackground,Ge.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=ze(e.scrollbarSliderActiveBackground,Ge.opacity(t.foreground,.5)),t.overviewRulerBorder=ze(e.overviewRulerBorder,OO),t.ansi=kt.slice(),t.ansi[0]=ze(e.black,kt[0]),t.ansi[1]=ze(e.red,kt[1]),t.ansi[2]=ze(e.green,kt[2]),t.ansi[3]=ze(e.yellow,kt[3]),t.ansi[4]=ze(e.blue,kt[4]),t.ansi[5]=ze(e.magenta,kt[5]),t.ansi[6]=ze(e.cyan,kt[6]),t.ansi[7]=ze(e.white,kt[7]),t.ansi[8]=ze(e.brightBlack,kt[8]),t.ansi[9]=ze(e.brightRed,kt[9]),t.ansi[10]=ze(e.brightGreen,kt[10]),t.ansi[11]=ze(e.brightYellow,kt[11]),t.ansi[12]=ze(e.brightBlue,kt[12]),t.ansi[13]=ze(e.brightMagenta,kt[13]),t.ansi[14]=ze(e.brightCyan,kt[14]),t.ansi[15]=ze(e.brightWhite,kt[15]),e.extendedAnsi){let a=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<a;r++)t.ansi[r+16]=ze(e.extendedAnsi[r],kt[r+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 t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];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()}}};Dv=ct([X(0,Ca)],Dv);function ze(e,t){if(e!==void 0)try{return at.toColor(e)}catch{}return t}var PO=class{constructor(...e){this._entries=new Map;for(let[t,a]of e)this.set(t,a)}set(e,t){let a=this._entries.get(e);return this._entries.set(e,t),a}forEach(e){for(let[t,a]of this._entries.entries())e(t,a)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},NO=class{constructor(){this._services=new PO,this._services.set(zv,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let a=rA(e).sort((s,o)=>s.index-o.index),r=[];for(let s of a){let o=this._services.get(s.id);if(!o)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${s.id._id}.`);r.push(o)}let i=a.length>0?a[0].index:t.length;if(t.length!==i)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},HO={trace:0,debug:1,info:2,warn:3,error:4,off:5},zO="xterm.js: ",Mv=class extends pe{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),UO=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=HO[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,a){this._evalLazyOptionalParams(a),e.call(console,(this._optionsService.options.logger?"":zO)+t,...a)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};Mv=ct([X(0,Ca)],Mv);var UO,aR=class extends pe{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new V),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new V),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new V),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 t=new Array(e);for(let a=0;a<Math.min(e,this.length);a++)t[a]=this._array[this._getCyclicIndex(a)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}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,t,...a){if(t){for(let r=e;r<this._length-t;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let r=this._length-1;r>=e;r--)this._array[this._getCyclicIndex(r+a.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<a.length;r++)this._array[this._getCyclicIndex(e+r)]=a[r];if(a.length&&this.onInsertEmitter.fire({index:e,amount:a.length}),this._length+a.length>this._maxLength){let r=this._length+a.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=a.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,a){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+a<0)throw new Error("Cannot shift elements in list beyond index 0");if(a>0){for(let i=t-1;i>=0;i--)this.set(e+i+a,this.get(e+i));let r=e+t+a-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+a,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},_e=3,yt=Object.freeze(new hc),oh=0,Y_=2,ic=class gI{constructor(t,a,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*_e);let i=a||Cr.fromCharData([0,RR,1,0]);for(let s=0;s<t;++s)this.setCell(s,i);this.length=t}get(t){let a=this._data[t*_e+0],r=a&2097151;return[this._data[t*_e+1],a&2097152?this._combined[t]:r?Bs(r):"",a>>22,a&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,a){this._data[t*_e+1]=a[0],a[1].length>1?(this._combined[t]=a[1],this._data[t*_e+0]=t|2097152|a[2]<<22):this._data[t*_e+0]=a[1].charCodeAt(0)|a[2]<<22}getWidth(t){return this._data[t*_e+0]>>22}hasWidth(t){return this._data[t*_e+0]&12582912}getFg(t){return this._data[t*_e+1]}getBg(t){return this._data[t*_e+2]}hasContent(t){return this._data[t*_e+0]&4194303}getCodePoint(t){let a=this._data[t*_e+0];return a&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):a&2097151}isCombined(t){return this._data[t*_e+0]&2097152}getString(t){let a=this._data[t*_e+0];return a&2097152?this._combined[t]:a&2097151?Bs(a&2097151):""}isProtected(t){return this._data[t*_e+2]&536870912}loadCell(t,a){return oh=t*_e,a.content=this._data[oh+0],a.fg=this._data[oh+1],a.bg=this._data[oh+2],a.content&2097152&&(a.combinedData=this._combined[t]),a.bg&268435456&&(a.extended=this._extendedAttrs[t]),a}setCell(t,a){a.content&2097152&&(this._combined[t]=a.combinedData),a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*_e+0]=a.content,this._data[t*_e+1]=a.fg,this._data[t*_e+2]=a.bg}setCellFromCodepoint(t,a,r,i){i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*_e+0]=a|r<<22,this._data[t*_e+1]=i.fg,this._data[t*_e+2]=i.bg}addCodepointToCell(t,a,r){let i=this._data[t*_e+0];i&2097152?this._combined[t]+=Bs(a):i&2097151?(this._combined[t]=Bs(i&2097151)+Bs(a),i&=-2097152,i|=2097152):i=a|1<<22,r&&(i&=-12582913,i|=r<<22),this._data[t*_e+0]=i}insertCells(t,a,r){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),a<this.length-t){let i=new Cr;for(let s=this.length-t-a-1;s>=0;--s)this.setCell(t+a+s,this.loadCell(t+s,i));for(let s=0;s<a;++s)this.setCell(t+s,r)}else for(let i=t;i<this.length;++i)this.setCell(i,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,a,r){if(t%=this.length,a<this.length-t){let i=new Cr;for(let s=0;s<this.length-t-a;++s)this.setCell(t+s,this.loadCell(t+a+s,i));for(let s=this.length-a;s<this.length;++s)this.setCell(s,r)}else for(let i=t;i<this.length;++i)this.setCell(i,r);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,r)}replaceCells(t,a,r,i=!1){if(i){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),a<this.length&&this.getWidth(a-1)===2&&!this.isProtected(a)&&this.setCellFromCodepoint(a,0,1,r);t<a&&t<this.length;)this.isProtected(t)||this.setCell(t,r),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a,0,1,r);t<a&&t<this.length;)this.setCell(t++,r)}resize(t,a){if(t===this.length)return this._data.length*4*Y_<this._data.buffer.byteLength;let r=t*_e;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let i=new Uint32Array(r);i.set(this._data),this._data=i}for(let i=this.length;i<t;++i)this.setCell(i,a)}else{this._data=this._data.subarray(0,r);let i=Object.keys(this._combined);for(let o=0;o<i.length;o++){let l=parseInt(i[o],10);l>=t&&delete this._combined[l]}let s=Object.keys(this._extendedAttrs);for(let o=0;o<s.length;o++){let l=parseInt(s[o],10);l>=t&&delete this._extendedAttrs[l]}}return this.length=t,r*4*Y_<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Y_<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,a=!1){if(a){for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,t);return}this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let a in t._combined)this._combined[a]=t._combined[a];this._extendedAttrs={};for(let a in t._extendedAttrs)this._extendedAttrs[a]=t._extendedAttrs[a];this.isWrapped=t.isWrapped}clone(){let t=new gI(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let a in this._combined)t._combined[a]=this._combined[a];for(let a in this._extendedAttrs)t._extendedAttrs[a]=this._extendedAttrs[a];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*_e+0]&4194303)return t+(this._data[t*_e+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*_e+0]&4194303||this._data[t*_e+2]&50331648)return t+(this._data[t*_e+0]>>22);return 0}copyCellsFrom(t,a,r,i,s){let o=t._data;if(s)for(let n=i-1;n>=0;n--){for(let u=0;u<_e;u++)this._data[(r+n)*_e+u]=o[(a+n)*_e+u];o[(a+n)*_e+2]&268435456&&(this._extendedAttrs[r+n]=t._extendedAttrs[a+n])}else for(let n=0;n<i;n++){for(let u=0;u<_e;u++)this._data[(r+n)*_e+u]=o[(a+n)*_e+u];o[(a+n)*_e+2]&268435456&&(this._extendedAttrs[r+n]=t._extendedAttrs[a+n])}let l=Object.keys(t._combined);for(let n=0;n<l.length;n++){let u=parseInt(l[n],10);u>=a&&(this._combined[u-a+r]=t._combined[u])}}translateToString(t,a,r,i){a=a??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),i&&(i.length=0);let s="";for(;a<r;){let o=this._data[a*_e+0],l=o&2097151,n=o&2097152?this._combined[a]:l?Bs(l):Os;if(s+=n,i)for(let u=0;u<n.length;++u)i.push(a);a+=o>>22||1}return i&&i.push(a),s}};function FO(e,t,a,r,i,s){let o=[];for(let l=0;l<e.length-1;l++){let n=l,u=e.get(++n);if(!u.isWrapped)continue;let c=[e.get(l)];for(;n<e.length&&u.isWrapped;)c.push(u),u=e.get(++n);if(!s&&r>=l&&r<n){l+=c.length-1;continue}let d=0,f=fc(c,d,t),h=1,m=0;for(;h<c.length;){let y=fc(c,h,t),p=y-m,g=a-f,v=Math.min(p,g);c[d].copyCellsFrom(c[h],m,f,v,!1),f+=v,f===a&&(d++,f=0),m+=v,m===y&&(h++,m=0),f===0&&d!==0&&c[d-1].getWidth(a-1)===2&&(c[d].copyCellsFrom(c[d-1],a-1,f++,1,!1),c[d-1].setCell(a-1,i))}c[d].replaceCells(f,a,i);let _=0;for(let y=c.length-1;y>0&&(y>d||c[y].getTrimmedLength()===0);y--)_++;_>0&&(o.push(l+c.length-_),o.push(_)),l+=c.length-1}return o}function qO(e,t){let a=[],r=0,i=t[r],s=0;for(let o=0;o<e.length;o++)if(i===o){let l=t[++r];e.onDeleteEmitter.fire({index:o-s,amount:l}),o+=l-1,s+=l,i=t[++r]}else a.push(o);return{layout:a,countRemoved:s}}function VO(e,t){let a=[];for(let r=0;r<t.length;r++)a.push(e.get(t[r]));for(let r=0;r<a.length;r++)e.set(r,a[r]);e.length=t.length}function $O(e,t,a){let r=[],i=e.map((n,u)=>fc(e,u,t)).reduce((n,u)=>n+u),s=0,o=0,l=0;for(;l<i;){if(i-l<a){r.push(i-l);break}s+=a;let n=fc(e,o,t);s>n&&(s-=n,o++);let u=e[o].getWidth(s-1)===2;u&&s--;let c=u?a-1:a;r.push(c),l+=c}return r}function fc(e,t,a){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(a-1)&&e[t].getWidth(a-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?a-1:a}var _I=class vI{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=vI._nextId++,this._onDispose=this.register(new V),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Ao(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};_I._nextId=1;var WO=_I,Mt={},Do=Mt.B;Mt[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"};Mt.A={"#":"\xA3"};Mt.B=void 0;Mt[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"};Mt.C=Mt[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"};Mt.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"};Mt.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"};Mt.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"};Mt.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"};Mt.E=Mt[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"};Mt.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"};Mt.H=Mt[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"};Mt["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"};var rR=4294967295,iR=class{constructor(e,t,a){this._hasScrollback=e,this._optionsService=t,this._bufferService=a,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=yt.clone(),this.savedCharset=Do,this.markers=[],this._nullCell=Cr.fromCharData([0,RR,1,0]),this._whitespaceCell=Cr.fromCharData([0,Os,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new wh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new aR(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new _h),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new _h),this._whitespaceCell}getBlankLine(e,t){return new ic(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>rR?rR:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=yt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new aR(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let a=this.getNullCell(yt),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let o=0;o<this.lines.length;o++)r+=+this.lines.get(o).resize(e,a);let s=0;if(this._rows<t)for(let o=this._rows;o<t;o++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new ic(e,a)):this.ybase>0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new ic(e,a)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let o=this.lines.length-i;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=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),s&&(this.y+=s),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let s=0;s<this.lines.length;s++)r+=+this.lines.get(s).resize(e,a);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let a=this._optionsService.rawOptions.reflowCursorLine,r=FO(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(yt),a);if(r.length>0){let i=qO(this.lines,r);VO(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved)}}_reflowLargerAdjustViewport(e,t,a){let r=this.getNullCell(yt),i=a;for(;i-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new ic(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-a,0)}_reflowSmaller(e,t){let a=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(yt),i=[],s=0;for(let o=this.lines.length-1;o>=0;o--){let l=this.lines.get(o);if(!l||!l.isWrapped&&l.getTrimmedLength()<=e)continue;let n=[l];for(;l.isWrapped&&o>0;)l=this.lines.get(--o),n.unshift(l);if(!a){let v=this.ybase+this.y;if(v>=o&&v<o+n.length)continue}let u=n[n.length-1].getTrimmedLength(),c=$O(n,this._cols,e),d=c.length-n.length,f;this.ybase===0&&this.y!==this.lines.length-1?f=Math.max(0,this.y-this.lines.maxLength+d):f=Math.max(0,this.lines.length-this.lines.maxLength+d);let h=[];for(let v=0;v<d;v++){let C=this.getBlankLine(yt,!0);h.push(C)}h.length>0&&(i.push({start:o+n.length+s,newLines:h}),s+=h.length),n.push(...h);let m=c.length-1,_=c[m];_===0&&(m--,_=c[m]);let y=n.length-d-1,p=u;for(;y>=0;){let v=Math.min(p,_);if(n[m]===void 0)break;if(n[m].copyCellsFrom(n[y],p-v,_-v,v,!0),_-=v,_===0&&(m--,_=c[m]),p-=v,p===0){y--;let C=Math.max(y,0);p=fc(n,C,this._cols)}}for(let v=0;v<n.length;v++)c[v]<e&&n[v].setCell(c[v],r);let g=d-f;for(;g-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+s)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+t-1)}if(i.length>0){let o=[],l=[];for(let _=0;_<this.lines.length;_++)l.push(this.lines.get(_));let n=this.lines.length,u=n-1,c=0,d=i[c];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);let f=0;for(let _=Math.min(this.lines.maxLength-1,n+s-1);_>=0;_--)if(d&&d.start>u+f){for(let y=d.newLines.length-1;y>=0;y--)this.lines.set(_--,d.newLines[y]);_++,o.push({index:u+1,amount:d.newLines.length}),f+=d.newLines.length,d=i[++c]}else this.lines.set(_,l[u--]);let h=0;for(let _=o.length-1;_>=0;_--)o[_].index+=h,this.lines.onInsertEmitter.fire(o[_]),h+=o[_].amount;let m=Math.max(0,n+s-this.lines.maxLength);m>0&&this.lines.onTrimEmitter.fire(m)}}translateBufferLineToString(e,t,a=0,r){let i=this.lines.get(e);return i?i.translateToString(t,a,r):""}getWrappedRangeForLine(e){let t=e,a=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;a+1<this.lines.length&&this.lines.get(a+1).isWrapped;)a++;return{first:t,last:a}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new WO(e);return this.markers.push(t),t.register(this.lines.onTrim(a=>{t.line-=a,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(a=>{t.line>=a.index&&(t.line+=a.amount)})),t.register(this.lines.onDelete(a=>{t.line>=a.index&&t.line<a.index+a.amount&&t.dispose(),t.line>a.index&&(t.line-=a.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},GO=class extends pe{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new V),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 iR(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new iR(!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,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},SI=2,yI=1,Tv=class extends pe{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new V),this.onResize=this._onResize.event,this._onScroll=this._register(new V),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,SI),this.rows=Math.max(e.rawOptions.rows||0,yI),this.buffers=this._register(new GO(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let a=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:a,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let a=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=a.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=a.ybase+a.scrollTop,s=a.ybase+a.scrollBottom;if(a.scrollTop===0){let o=a.lines.isFull;s===a.lines.length-1?o?a.lines.recycle().copyFrom(r):a.lines.push(r.clone()):a.lines.splice(s+1,0,r.clone()),o?this.isUserScrolling&&(a.ydisp=Math.max(a.ydisp-1,0)):(a.ybase++,this.isUserScrolling||a.ydisp++)}else{let o=s-i+1;a.lines.shiftElements(i+1,o-1,-1),a.lines.set(s,r.clone())}this.isUserScrolling||(a.ydisp=a.ybase),this._onScroll.fire(a.ydisp)}scrollLines(e,t){let a=this.buffer;if(e<0){if(a.ydisp===0)return;this.isUserScrolling=!0}else e+a.ydisp>=a.ybase&&(this.isUserScrolling=!1);let r=a.ydisp;a.ydisp=Math.max(Math.min(a.ydisp+e,a.ybase),0),r!==a.ydisp&&(t||this._onScroll.fire(a.ydisp))}};Tv=ct([X(0,Ca)],Tv);var en={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:xh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},KO=["normal","bold","100","200","300","400","500","600","700","800","900"],XO=class extends pe{constructor(e){super(),this._onOptionChange=this._register(new V),this.onOptionChange=this._onOptionChange.event;let t={...en};for(let a in e)if(a in t)try{let r=e[a];t[a]=this._sanitizeAndValidateOption(a,r)}catch(r){console.error(r)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(Ke(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(a=>{a===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(a=>{e.indexOf(a)!==-1&&t()})}_setupOptions(){let e=a=>{if(!(a in en))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},t=(a,r)=>{if(!(a in en))throw new Error(`No option with key "${a}"`);r=this._sanitizeAndValidateOption(a,r),this.rawOptions[a]!==r&&(this.rawOptions[a]=r,this._onOptionChange.fire(a))};for(let a in this.rawOptions){let r={get:e.bind(this,a),set:t.bind(this,a)};Object.defineProperty(this.options,a,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=en[e]),!YO(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=en[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=KO.includes(t)?t:en[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function YO(e){return e==="block"||e==="underline"||e==="bar"}function sc(e,t=5){if(typeof e!="object")return e;let a=Array.isArray(e)?[]:{};for(let r in e)a[r]=t<=1?e[r]:e[r]&&sc(e[r],t-1);return a}var sR=Object.freeze({insertMode:!1}),oR=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Av=class extends pe{constructor(e,t,a){super(),this._bufferService=e,this._logService=t,this._optionsService=a,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new V),this.onData=this._onData.event,this._onUserInput=this._register(new V),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new V),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new V),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=sc(sR),this.decPrivateModes=sc(oR)}reset(){this.modes=sc(sR),this.decPrivateModes=sc(oR)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let a=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&a.ybase!==a.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(r=>r.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(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};Av=ct([X(0,ya),X(1,MR),X(2,Ca)],Av);var lR={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function j_(e,t){let a=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(a|=64,a|=e.action):(a|=e.button&3,e.button&4&&(a|=64),e.button&8&&(a|=128),e.action===32?a|=32:e.action===0&&!t&&(a|=3)),a}var Z_=String.fromCharCode,nR={DEFAULT:e=>{let t=[j_(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Z_(t[0])}${Z_(t[1])}${Z_(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${j_(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${j_(e,!0)};${e.x};${e.y}${t}`}},Bv=class extends pe{constructor(e,t,a){super(),this._bufferService=e,this._coreService=t,this._optionsService=a,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new V),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(lR))this.addProtocol(r,lR[r]);for(let r of Object.keys(nR))this.addEncoding(r,nR[r]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,a){if(e.deltaY===0||e.shiftKey||t===void 0||a===void 0)return 0;let r=t/a,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=r+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,a){if(a){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Bv=ct([X(0,ya),X(1,Oo),X(2,Ca)],Bv);var Q_=[[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]],jO=[[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]],Dt;function ZO(e,t){let a=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=a;)if(i=a+r>>1,e>t[i][1])a=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var QO=class{constructor(){if(this.version="6",!Dt){Dt=new Uint8Array(65536),Dt.fill(1),Dt[0]=0,Dt.fill(0,1,32),Dt.fill(0,127,160),Dt.fill(2,4352,4448),Dt[9001]=2,Dt[9002]=2,Dt.fill(2,11904,42192),Dt[12351]=1,Dt.fill(2,44032,55204),Dt.fill(2,63744,64256),Dt.fill(2,65040,65050),Dt.fill(2,65072,65136),Dt.fill(2,65280,65377),Dt.fill(2,65504,65511);for(let e=0;e<Q_.length;++e)Dt.fill(0,Q_[e][0],Q_[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Dt[e]:ZO(e,jO)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let a=this.wcwidth(e),r=a===0&&t!==0;if(r){let i=Mo.extractWidth(t);i===0?r=!1:i>a&&(a=i)}return Mo.createPropertyValue(0,a,r)}},Mo=class gh{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new V,this.onChange=this._onChange.event;let t=new QO;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,a,r=!1){return(t&16777215)<<3|(a&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let a=0,r=0,i=t.length;for(let s=0;s<i;++s){let o=t.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=i)return a+this.wcwidth(o);let u=t.charCodeAt(s);56320<=u&&u<=57343?o=(o-55296)*1024+u-56320+65536:a+=this.wcwidth(u)}let l=this.charProperties(o,r),n=gh.extractWidth(l);gh.extractShouldJoin(l)&&(n-=gh.extractWidth(r)),a+=n,r=l}return a}charProperties(t,a){return this._activeProvider.charProperties(t,a)}},JO=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,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function uR(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),a=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);a&&t&&(a.isWrapped=t[3]!==0&&t[3]!==32)}var Qu=2147483647,eP=256,CI=class Ov{constructor(t=32,a=32){if(this.maxLength=t,this.maxSubParamsLength=a,a>eP)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(a),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let a=new Ov;if(!t.length)return a;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let i=t[r];if(Array.isArray(i))for(let s=0;s<i.length;++s)a.addSubParam(i[s]);else a.addParam(i)}return a}clone(){let t=new Ov(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let a=0;a<this.length;++a){t.push(this.params[a]);let r=this._subParamsIdx[a]>>8,i=this._subParamsIdx[a]&255;i-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,i))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Qu?Qu:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Qu?Qu:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let a=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;return r-a>0?this._subParams.subarray(a,r):null}getSubParamsAll(){let t={};for(let a=0;a<this.length;++a){let r=this._subParamsIdx[a]>>8,i=this._subParamsIdx[a]&255;i-r>0&&(t[a]=this._subParams.slice(r,i))}return t}addDigit(t){let a;if(this._rejectDigits||!(a=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,i=r[a-1];r[a-1]=~i?Math.min(i*10+t,Qu):t}},Ju=[],tP=class{constructor(){this._state=0,this._active=Ju,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let a=this._handlers[e];return a.push(t),{dispose:()=>{let r=a.indexOf(t);r!==-1&&a.splice(r,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=Ju}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=Ju,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Ju,!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,t,a){if(!this._active.length)this._handlerFb(this._id,"PUT",Rh(e,t,a));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,a)}start(){this.reset(),this._state=1}put(e,t,a){if(this._state!==3){if(this._state===1)for(;t<a;){let r=e[t++];if(r===59){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r-48}this._state===2&&a-t>0&&this._put(e,t,a)}}end(e,t=!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 a=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,a=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&a===!1){for(;r>=0&&(a=this._active[r].end(e),a!==!0);r--)if(a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,a;r--}for(;r>=0;r--)if(a=this._active[r].end(!1),a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,a}this._active=Ju,this._id=-1,this._state=0}}},tr=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,a){this._hitLimit||(this._data+=Rh(e,t,a),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(a=>(this._data="",this._hitLimit=!1,a));return this._data="",this._hitLimit=!1,t}},ec=[],aP=class{constructor(){this._handlers=Object.create(null),this._active=ec,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=ec}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let a=this._handlers[e];return a.push(t),{dispose:()=>{let r=a.indexOf(t);r!==-1&&a.splice(r,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=ec,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||ec,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let a=this._active.length-1;a>=0;a--)this._active[a].hook(t)}put(e,t,a){if(!this._active.length)this._handlerFb(this._ident,"PUT",Rh(e,t,a));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,a)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let a=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,a=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&a===!1){for(;r>=0&&(a=this._active[r].unhook(e),a!==!0);r--)if(a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,a;r--}for(;r>=0;r--)if(a=this._active[r].unhook(!1),a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,a}this._active=ec,this._ident=0}},oc=new CI;oc.addParam(0);var cR=class{constructor(e){this._handler=e,this._data="",this._params=oc,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():oc,this._data="",this._hitLimit=!1}put(e,t,a){this._hitLimit||(this._data+=Rh(e,t,a),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(a=>(this._params=oc,this._data="",this._hitLimit=!1,a));return this._params=oc,this._data="",this._hitLimit=!1,t}},rP=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,a,r){this.table[t<<8|e]=a<<4|r}addMany(e,t,a,r){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=a<<4|r}},yr=160,iP=(function(){let e=new rP(4095),t=Array.apply(null,Array(256)).map((l,n)=>n),a=(l,n)=>t.slice(l,n),r=a(32,127),i=a(0,24);i.push(25),i.push.apply(i,a(28,32));let s=a(0,14),o;e.setDefault(1,0),e.addMany(r,0,2,0);for(o in s)e.addMany([24,26,153,154],o,3,0),e.addMany(a(128,144),o,3,0),e.addMany(a(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(a(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(a(64,127),3,7,0),e.addMany(a(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(a(48,60),4,8,4),e.addMany(a(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(a(32,64),6,0,6),e.add(127,6,0,6),e.addMany(a(64,127),6,0,0),e.addMany(a(32,48),3,9,5),e.addMany(a(32,48),5,9,5),e.addMany(a(48,64),5,0,6),e.addMany(a(64,127),5,7,0),e.addMany(a(32,48),4,9,5),e.addMany(a(32,48),1,9,2),e.addMany(a(32,48),2,9,2),e.addMany(a(48,127),2,10,0),e.addMany(a(48,80),1,10,0),e.addMany(a(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(a(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(a(28,32),9,0,9),e.addMany(a(32,48),9,9,12),e.addMany(a(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(a(32,128),11,0,11),e.addMany(a(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(a(28,32),10,0,10),e.addMany(a(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(a(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(a(28,32),12,0,12),e.addMany(a(32,48),12,9,12),e.addMany(a(48,64),12,0,11),e.addMany(a(64,127),12,12,13),e.addMany(a(64,127),10,12,13),e.addMany(a(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(yr,0,2,0),e.add(yr,8,5,8),e.add(yr,6,0,6),e.add(yr,11,0,11),e.add(yr,13,13,13),e})(),sP=class extends pe{constructor(e=iP){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 CI,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,a,r)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,a)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Ke(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new tP),this._dcsParser=this._register(new aP),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let a=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(a=e.prefix.charCodeAt(0),a&&60>a||a>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 i=0;i<e.intermediates.length;++i){let s=e.intermediates.charCodeAt(i);if(32>s||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");a<<=8,a|=s}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return a<<=8,a|=r,a}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let a=this._identifier(e,[48,126]);this._escHandlers[a]===void 0&&(this._escHandlers[a]=[]);let r=this._escHandlers[a];return r.push(t),{dispose:()=>{let i=r.indexOf(t);i!==-1&&r.splice(i,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,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let a=this._identifier(e);this._csiHandlers[a]===void 0&&(this._csiHandlers[a]=[]);let r=this._csiHandlers[a];return r.push(t),{dispose:()=>{let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}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,t,a,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=a,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,a){let r=0,i=0,s=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,s=this._parseStack.chunkPos+1;else{if(a===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let l=this._parseStack.handlers,n=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(a===!1&&n>-1){for(;n>=0&&(o=l[n](this._params),o!==!0);n--)if(o instanceof Promise)return this._parseStack.handlerPos=n,o}this._parseStack.handlers=[];break;case 4:if(a===!1&&n>-1){for(;n>=0&&(o=l[n](),o!==!0);n--)if(o instanceof Promise)return this._parseStack.handlerPos=n,o}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(r!==24&&r!==26,a),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],o=this._oscParser.end(r!==24&&r!==26,a),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,s=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let l=s;l<t;++l){switch(r=e[l],i=this._transitions.table[this.currentState<<8|(r<160?r:yr)],i>>4){case 2:for(let f=l+1;;++f){if(f>=t||(r=e[f])<32||r>126&&r<yr){this._printHandler(e,l,f),l=f-1;break}if(++f>=t||(r=e[f])<32||r>126&&r<yr){this._printHandler(e,l,f),l=f-1;break}if(++f>=t||(r=e[f])<32||r>126&&r<yr){this._printHandler(e,l,f),l=f-1;break}if(++f>=t||(r=e[f])<32||r>126&&r<yr){this._printHandler(e,l,f),l=f-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:l,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let n=this._csiHandlers[this._collect<<8|r],u=n?n.length-1:-1;for(;u>=0&&(o=n[u](this._params),o!==!0);u--)if(o instanceof Promise)return this._preserveStack(3,n,u,i,l),o;u<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++l<t&&(r=e[l])>47&&r<60);l--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let c=this._escHandlers[this._collect<<8|r],d=c?c.length-1:-1;for(;d>=0&&(o=c[d](),o!==!0);d--)if(o instanceof Promise)return this._preserveStack(4,c,d,i,l),o;d<0&&this._escHandlerFb(this._collect<<8|r),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|r,this._params);break;case 13:for(let f=l+1;;++f)if(f>=t||(r=e[f])===24||r===26||r===27||r>127&&r<yr){this._dcsParser.put(e,l,f),l=f-1;break}break;case 14:if(o=this._dcsParser.unhook(r!==24&&r!==26),o)return this._preserveStack(6,[],0,i,l),o;r===27&&(i|=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 f=l+1;;f++)if(f>=t||(r=e[f])<32||r>127&&r<yr){this._oscParser.put(e,l,f),l=f-1;break}break;case 6:if(o=this._oscParser.end(r!==24&&r!==26),o)return this._preserveStack(5,[],0,i,l),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=i&15}}},oP=/^([\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})$/,lP=/^[\da-f]+$/;function dR(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let a=oP.exec(t);if(a){let r=a[1]?15:a[4]?255:a[7]?4095:65535;return[Math.round(parseInt(a[1]||a[4]||a[7]||a[10],16)/r*255),Math.round(parseInt(a[2]||a[5]||a[8]||a[11],16)/r*255),Math.round(parseInt(a[3]||a[6]||a[9]||a[12],16)/r*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),lP.exec(t)&&[3,6,9,12].includes(t.length))){let a=t.length/3,r=[0,0,0];for(let i=0;i<3;++i){let s=parseInt(t.slice(a*i,a*i+a),16);r[i]=a===1?s<<4:a===2?s:a===3?s>>4:s>>8}return r}}function J_(e,t){let a=e.toString(16),r=a.length<2?"0"+a:a;switch(t){case 4:return a[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function nP(e,t=16){let[a,r,i]=e;return`rgb:${J_(a,t)}/${J_(r,t)}/${J_(i,t)}`}var uP={"(":0,")":1,"*":2,"+":3,"-":1,".":2},As=131072,fR=10;function hR(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var mR=5e3,pR=0,cP=class extends pe{constructor(e,t,a,r,i,s,o,l,n=new sP){super(),this._bufferService=e,this._charsetService=t,this._coreService=a,this._logService=r,this._optionsService=i,this._oscLinkService=s,this._coreMouseService=o,this._unicodeService=l,this._parser=n,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new tA,this._utf8Decoder=new aA,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=yt.clone(),this._eraseAttrDataInternal=yt.clone(),this._onRequestBell=this._register(new V),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new V),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new V),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new V),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new V),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new V),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new V),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new V),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new V),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new V),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new V),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new V),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new V),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 Pv(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(u=>this._activeBuffer=u.activeBuffer)),this._parser.setCsiHandlerFallback((u,c)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(u),params:c.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,c,d)=>{this._logService.debug("Unknown OSC code: ",{identifier:u,action:c,data:d})}),this._parser.setDcsHandlerFallback((u,c,d)=>{c==="HOOK"&&(d=d.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(u),action:c,payload:d})}),this._parser.setPrintHandler((u,c,d)=>this.print(u,c,d)),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(B.BEL,()=>this.bell()),this._parser.setExecuteHandler(B.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(B.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(B.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(B.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(B.BS,()=>this.backspace()),this._parser.setExecuteHandler(B.HT,()=>this.tab()),this._parser.setExecuteHandler(B.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(B.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(mh.IND,()=>this.index()),this._parser.setExecuteHandler(mh.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(mh.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new tr(u=>(this.setTitle(u),this.setIconName(u),!0))),this._parser.registerOscHandler(1,new tr(u=>this.setIconName(u))),this._parser.registerOscHandler(2,new tr(u=>this.setTitle(u))),this._parser.registerOscHandler(4,new tr(u=>this.setOrReportIndexedColor(u))),this._parser.registerOscHandler(8,new tr(u=>this.setHyperlink(u))),this._parser.registerOscHandler(10,new tr(u=>this.setOrReportFgColor(u))),this._parser.registerOscHandler(11,new tr(u=>this.setOrReportBgColor(u))),this._parser.registerOscHandler(12,new tr(u=>this.setOrReportCursorColor(u))),this._parser.registerOscHandler(104,new tr(u=>this.restoreIndexedColor(u))),this._parser.registerOscHandler(110,new tr(u=>this.restoreFgColor(u))),this._parser.registerOscHandler(111,new tr(u=>this.restoreBgColor(u))),this._parser.registerOscHandler(112,new tr(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 Mt)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 cR((u,c)=>this.requestStatusString(u,c)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,a,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=a,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,a)=>setTimeout(()=>a("#SLOW_TIMEOUT"),mR))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${mR} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let a,r=this._activeBuffer.x,i=this._activeBuffer.y,s=0,o=this._parseStack.paused;if(o){if(a=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(a),a;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>As&&(s=this._parseStack.position+As)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,u=>String.fromCharCode(u)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(u=>u.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<As&&(this._parseBuffer=new Uint32Array(Math.min(e.length,As))),o||this._dirtyRowTracker.clearRange(),e.length>As)for(let u=s;u<e.length;u+=As){let c=u+As<e.length?u+As:e.length,d=typeof e=="string"?this._stringDecoder.decode(e.substring(u,c),this._parseBuffer):this._utf8Decoder.decode(e.subarray(u,c),this._parseBuffer);if(a=this._parser.parse(this._parseBuffer,d))return this._preserveStack(r,i,d,u),this._logSlowResolvingAsync(a),a}else if(!o){let u=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(a=this._parser.parse(this._parseBuffer,u))return this._preserveStack(r,i,u,0),this._logSlowResolvingAsync(a),a}(this._activeBuffer.x!==r||this._activeBuffer.y!==i)&&this._onCursorMove.fire();let l=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),n=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);n<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(n,this._bufferService.rows-1),end:Math.min(l,this._bufferService.rows-1)})}print(e,t,a){let r,i,s=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,l=this._bufferService.cols,n=this._coreService.decPrivateModes.wraparound,u=this._coreService.modes.insertMode,c=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&a-t>0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,c);let f=this._parser.precedingJoinState;for(let h=t;h<a;++h){if(r=e[h],r<127&&s){let p=s[String.fromCharCode(r)];p&&(r=p.charCodeAt(0))}let m=this._unicodeService.charProperties(r,f);i=Mo.extractWidth(m);let _=Mo.extractShouldJoin(m),y=_?Mo.extractWidth(f):0;if(f=m,o&&this._onA11yChar.fire(Bs(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-y>l){if(n){let p=d,g=this._activeBuffer.x-y;for(this._activeBuffer.x=y,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),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),y>0&&d instanceof ic&&d.copyCellsFrom(p,g,0,y,!1);g<l;)p.setCellFromCodepoint(g++,0,1,c)}else if(this._activeBuffer.x=l-1,i===2)continue}if(_&&this._activeBuffer.x){let p=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-p,r,i);for(let g=i-y;--g>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,c);continue}if(u&&(d.insertCells(this._activeBuffer.x,i-y,this._activeBuffer.getNullCell(c)),d.getWidth(l-1)===2&&d.setCellFromCodepoint(l-1,0,1,c)),d.setCellFromCodepoint(this._activeBuffer.x++,r,i,c),i>0)for(;--i;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,c)}this._parser.precedingJoinState=f,this._activeBuffer.x<l&&a-t>0&&d.getWidth(this._activeBuffer.x)===0&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,c),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,a=>hR(a.params[0],this._optionsService.rawOptions.windowOptions)?t(a):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new cR(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new tr(t))}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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.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 e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,a,r=!1,i=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);s.replaceCells(t,a,this._activeBuffer.getNullCell(this._eraseAttrData()),i),r&&(s.isWrapped=!1)}_resetBufferLine(e,t=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a&&(a.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),a.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let a;switch(e.params[0]){case 0:for(a=this._activeBuffer.y,this._dirtyRowTracker.markDirty(a),this._eraseInBufferLine(a++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);a<this._bufferService.rows;a++)this._resetBufferLine(a,t);this._dirtyRowTracker.markDirty(a);break;case 1:for(a=this._activeBuffer.y,this._dirtyRowTracker.markDirty(a),this._eraseInBufferLine(a,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(a+1).isWrapped=!1);a--;)this._resetBufferLine(a,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(a=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,a-1);a--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+a)?.getTrimmedLength(););for(;a>=0;a--)this._bufferService.scroll(this._eraseAttrData())}else{for(a=this._bufferService.rows,this._dirtyRowTracker.markDirty(a-1);a--;)this._resetBufferLine(a,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let r=this._activeBuffer.lines.length-this._bufferService.rows;r>0&&(this._activeBuffer.lines.trimStart(r),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-r,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-r,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let a=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(a,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let a=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(a,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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(e){let t=e.params[0]||1;for(;t--;)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(yt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let a=this._activeBuffer.scrollTop;a<=this._activeBuffer.scrollBottom;++a){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+a);r.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let a=this._activeBuffer.scrollTop;a<=this._activeBuffer.scrollBottom;++a){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+a);r.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let a=this._activeBuffer.scrollTop;a<=this._activeBuffer.scrollBottom;++a){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+a);r.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let a=this._activeBuffer.scrollTop;a<=this._activeBuffer.scrollBottom;++a){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+a);r.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let a=e.params[0]||1,r=Mo.extractWidth(t),i=this._activeBuffer.x-r,s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(s.length*a),l=0;for(let u=0;u<s.length;){let c=s.codePointAt(u)||0;o[l++]=c,u+=c>65535?2:1}let n=l;for(let u=1;u<a;++u)o.copyWithin(n,0,l),n+=l;return this.print(o,0,n),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(B.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(B.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(B.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(B.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(B.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Do),this._charsetService.setgCharset(1,Do),this._charsetService.setgCharset(2,Do),this._charsetService.setgCharset(3,Do);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(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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(),e.params[t]===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(e,t){let a;(_=>(_[_.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",_[_.SET=1]="SET",_[_.RESET=2]="RESET",_[_.PERMANENTLY_SET=3]="PERMANENTLY_SET",_[_.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(a||={});let r=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:s}=this._coreMouseService,o=this._coreService,{buffers:l,cols:n}=this._bufferService,{active:u,alt:c}=l,d=this._optionsService.rawOptions,f=(_,y)=>(o.triggerDataEvent(`${B.ESC}[${t?"":"?"}${_};${y}$y`),!0),h=_=>_?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,h(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,h(d.convertEol)):f(m,0):m===1?f(m,h(r.applicationCursorKeys)):m===3?f(m,d.windowOptions.setWinLines?n===80?2:n===132?1:0:0):m===6?f(m,h(r.origin)):m===7?f(m,h(r.wraparound)):m===8?f(m,3):m===9?f(m,h(i==="X10")):m===12?f(m,h(d.cursorBlink)):m===25?f(m,h(!o.isCursorHidden)):m===45?f(m,h(r.reverseWraparound)):m===66?f(m,h(r.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,h(i==="VT200")):m===1002?f(m,h(i==="DRAG")):m===1003?f(m,h(i==="ANY")):m===1004?f(m,h(r.sendFocus)):m===1005?f(m,4):m===1006?f(m,h(s==="SGR")):m===1015?f(m,4):m===1016?f(m,h(s==="SGR_PIXELS")):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,h(u===c)):m===2004?f(m,h(r.bracketedPasteMode)):m===2026?f(m,h(r.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,a,r,i){return t===2?(e|=50331648,e&=-16777216,e|=hc.fromColorRGB([a,r,i])):t===5&&(e&=-50331904,e|=33554432|a&255),e}_extractColor(e,t,a){let r=[0,0,-1,0,0,0],i=0,s=0;do{if(r[s+i]=e.params[t+s],e.hasSubParams(t+s)){let o=e.getSubParams(t+s),l=0;do r[1]===5&&(i=1),r[s+l+1+i]=o[l];while(++l<o.length&&l+s+1+i<r.length);break}if(r[1]===5&&s+i>=2||r[1]===2&&s+i>=5)break;r[1]&&(i=1)}while(++s+t<e.length&&s+i<r.length);for(let o=2;o<r.length;++o)r[o]===-1&&(r[o]=0);switch(r[0]){case 38:a.fg=this._updateAttrColor(a.fg,r[1],r[3],r[4],r[5]);break;case 48:a.bg=this._updateAttrColor(a.bg,r[1],r[3],r[4],r[5]);break;case 58:a.extended=a.extended.clone(),a.extended.underlineColor=this._updateAttrColor(a.extended.underlineColor,r[1],r[3],r[4],r[5])}return s}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=yt.fg,e.bg=yt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,a,r=this._curAttrData;for(let i=0;i<t;i++)a=e.params[i],a>=30&&a<=37?(r.fg&=-50331904,r.fg|=16777216|a-30):a>=40&&a<=47?(r.bg&=-50331904,r.bg|=16777216|a-40):a>=90&&a<=97?(r.fg&=-50331904,r.fg|=16777216|a-90|8):a>=100&&a<=107?(r.bg&=-50331904,r.bg|=16777216|a-100|8):a===0?this._processSGR0(r):a===1?r.fg|=134217728:a===3?r.bg|=67108864:a===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):a===5?r.fg|=536870912:a===7?r.fg|=67108864:a===8?r.fg|=1073741824:a===9?r.fg|=2147483648:a===2?r.bg|=134217728:a===21?this._processUnderline(2,r):a===22?(r.fg&=-134217729,r.bg&=-134217729):a===23?r.bg&=-67108865:a===24?(r.fg&=-268435457,this._processUnderline(0,r)):a===25?r.fg&=-536870913:a===27?r.fg&=-67108865:a===28?r.fg&=-1073741825:a===29?r.fg&=2147483647:a===39?(r.fg&=-67108864,r.fg|=yt.fg&16777215):a===49?(r.bg&=-67108864,r.bg|=yt.bg&16777215):a===38||a===48||a===58?i+=this._extractColor(e,i,r):a===53?r.bg|=1073741824:a===55?r.bg&=-1073741825:a===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):a===100?(r.fg&=-67108864,r.fg|=yt.fg&16777215,r.bg&=-67108864,r.bg|=yt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",a);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${B.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,a=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${B.ESC}[${t};${a}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,a=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${B.ESC}[?${t};${a}R`);break;case 15:break;case 25:break;case 26:break;case 53:break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=yt.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){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 a=t%2===1;this._coreService.decPrivateModes.cursorBlink=a}return!0}setScrollRegion(e){let t=e.params[0]||1,a;return(e.length<2||(a=e.params[1])>this._bufferService.rows||a===0)&&(a=this._bufferService.rows),a>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=a-1,this._setCursor(0,0)),!0}windowOptions(e){if(!hR(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${B.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>fR&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>fR&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],a=e.split(";");for(;a.length>1;){let r=a.shift(),i=a.shift();if(/^\d+$/.exec(r)){let s=parseInt(r);if(gR(s))if(i==="?")t.push({type:0,index:s});else{let o=dR(i);o&&t.push({type:1,index:s,color:o})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let a=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(a,r):a.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let a=e.split(":"),r,i=a.findIndex(s=>s.startsWith("id="));return i!==-1&&(r=a[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let a=e.split(";");for(let r=0;r<a.length&&!(t>=this._specialColors.length);++r,++t)if(a[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let i=dR(a[r]);i&&this._onColor.fire([{type:1,index:this._specialColors[t],color:i}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],a=e.split(";");for(let r=0;r<a.length;++r)if(/^\d+$/.exec(a[r])){let i=parseInt(a[r]);gR(i)&&t.push({type:2,index:i})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,Do),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(uP[e[0]],Mt[e[1]]||Do),!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 e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=yt.clone(),this._eraseAttrDataInternal=yt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Cr;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let a=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(a);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let a=o=>(this._coreService.triggerDataEvent(`${B.ESC}${o}${B.ESC}\\`),!0),r=this._bufferService.buffer,i=this._optionsService.rawOptions;return a(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-(i.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Pv=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(pR=e,e=t,t=pR),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Pv=ct([X(0,ya)],Pv);function gR(e){return 0<=e&&e<256}var dP=5e7,_R=12,fP=50,hP=class extends pe{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 V),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){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 a;for(;a=this._writeBuffer.shift();){this._action(a);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>dP)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(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let a=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],i=this._action(r,t);if(i){let o=l=>performance.now()-a>=_R?setTimeout(()=>this._innerWrite(0,l)):this._innerWrite(a,l);i.catch(l=>(queueMicrotask(()=>{throw l}),Promise.resolve(!1))).then(o);return}let s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-a>=_R)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>fP&&(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()}},Nv=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let l=t.addMarker(t.ybase+t.y),n={data:e,id:this._nextId++,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(n,l)),this._dataByLinkId.set(n.id,n),n.id}let a=e,r=this._getEntryIdKey(a),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let s=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(a),data:a,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(o,s)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let a=this._dataByLinkId.get(e);if(a&&a.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);a.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(a,r))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let a=e.lines.indexOf(t);a!==-1&&(e.lines.splice(a,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Nv=ct([X(0,ya)],Nv);var vR=!1,mP=class extends pe{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new an),this._onBinary=this._register(new V),this.onBinary=this._onBinary.event,this._onData=this._register(new V),this.onData=this._onData.event,this._onLineFeed=this._register(new V),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new V),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new V),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new V),this._instantiationService=new NO,this.optionsService=this._register(new XO(e)),this._instantiationService.setService(Ca,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Tv)),this._instantiationService.setService(ya,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Mv)),this._instantiationService.setService(MR,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Av)),this._instantiationService.setService(Oo,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Bv)),this._instantiationService.setService(DR,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Mo)),this._instantiationService.setService(oA,this.unicodeService),this._charsetService=this._instantiationService.createInstance(JO),this._instantiationService.setService(sA,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Nv),this._instantiationService.setService(TR,this._oscLinkService),this._inputHandler=this._register(new cP(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(ta.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(ta.forward(this._bufferService.onResize,this._onResize)),this._register(ta.forward(this.coreService.onData,this._onData)),this._register(ta.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 hP((t,a)=>this._inputHandler.parse(t,a))),this._register(ta.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new V),this._onScroll.event(e=>{this._onScrollApi?.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 t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!vR&&(this._logService.warn("writeSync is unreliable and will be removed soon."),vR=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,SI),t=Math.max(t,yI),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.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(uR.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(uR(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Ke(()=>{for(let t of e)t.dispose()})}}},pP={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 gP(e,t,a,r){let i={type:0,cancel:!1,key:void 0},s=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?i.key=B.ESC+"OA":i.key=B.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?i.key=B.ESC+"OD":i.key=B.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?i.key=B.ESC+"OC":i.key=B.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?i.key=B.ESC+"OB":i.key=B.ESC+"[B");break;case 8:i.key=e.ctrlKey?"\b":B.DEL,e.altKey&&(i.key=B.ESC+i.key);break;case 9:if(e.shiftKey){i.key=B.ESC+"[Z";break}i.key=B.HT,i.cancel=!0;break;case 13:i.key=e.altKey?B.ESC+B.CR:B.CR,i.cancel=!0;break;case 27:i.key=B.ESC,e.altKey&&(i.key=B.ESC+B.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;s?i.key=B.ESC+"[1;"+(s+1)+"D":t?i.key=B.ESC+"OD":i.key=B.ESC+"[D";break;case 39:if(e.metaKey)break;s?i.key=B.ESC+"[1;"+(s+1)+"C":t?i.key=B.ESC+"OC":i.key=B.ESC+"[C";break;case 38:if(e.metaKey)break;s?i.key=B.ESC+"[1;"+(s+1)+"A":t?i.key=B.ESC+"OA":i.key=B.ESC+"[A";break;case 40:if(e.metaKey)break;s?i.key=B.ESC+"[1;"+(s+1)+"B":t?i.key=B.ESC+"OB":i.key=B.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=B.ESC+"[2~");break;case 46:s?i.key=B.ESC+"[3;"+(s+1)+"~":i.key=B.ESC+"[3~";break;case 36:s?i.key=B.ESC+"[1;"+(s+1)+"H":t?i.key=B.ESC+"OH":i.key=B.ESC+"[H";break;case 35:s?i.key=B.ESC+"[1;"+(s+1)+"F":t?i.key=B.ESC+"OF":i.key=B.ESC+"[F";break;case 33:e.shiftKey?i.type=2:e.ctrlKey?i.key=B.ESC+"[5;"+(s+1)+"~":i.key=B.ESC+"[5~";break;case 34:e.shiftKey?i.type=3:e.ctrlKey?i.key=B.ESC+"[6;"+(s+1)+"~":i.key=B.ESC+"[6~";break;case 112:s?i.key=B.ESC+"[1;"+(s+1)+"P":i.key=B.ESC+"OP";break;case 113:s?i.key=B.ESC+"[1;"+(s+1)+"Q":i.key=B.ESC+"OQ";break;case 114:s?i.key=B.ESC+"[1;"+(s+1)+"R":i.key=B.ESC+"OR";break;case 115:s?i.key=B.ESC+"[1;"+(s+1)+"S":i.key=B.ESC+"OS";break;case 116:s?i.key=B.ESC+"[15;"+(s+1)+"~":i.key=B.ESC+"[15~";break;case 117:s?i.key=B.ESC+"[17;"+(s+1)+"~":i.key=B.ESC+"[17~";break;case 118:s?i.key=B.ESC+"[18;"+(s+1)+"~":i.key=B.ESC+"[18~";break;case 119:s?i.key=B.ESC+"[19;"+(s+1)+"~":i.key=B.ESC+"[19~";break;case 120:s?i.key=B.ESC+"[20;"+(s+1)+"~":i.key=B.ESC+"[20~";break;case 121:s?i.key=B.ESC+"[21;"+(s+1)+"~":i.key=B.ESC+"[21~";break;case 122:s?i.key=B.ESC+"[23;"+(s+1)+"~":i.key=B.ESC+"[23~";break;case 123:s?i.key=B.ESC+"[24;"+(s+1)+"~":i.key=B.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=B.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=B.DEL:e.keyCode===219?i.key=B.ESC:e.keyCode===220?i.key=B.FS:e.keyCode===221&&(i.key=B.GS);else if((!a||r)&&e.altKey&&!e.metaKey){let o=pP[e.keyCode]?.[e.shiftKey?1:0];if(o)i.key=B.ESC+o;else if(e.keyCode>=65&&e.keyCode<=90){let l=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(l);e.shiftKey&&(n=n.toUpperCase()),i.key=B.ESC+n}else if(e.keyCode===32)i.key=B.ESC+(e.ctrlKey?B.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let l=e.code.slice(3,4);e.shiftKey||(l=l.toLowerCase()),i.key=B.ESC+l,i.cancel=!0}}else a&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(i.key=B.US),e.key==="@"&&(i.key=B.NUL));break}return i}var ht=0,_P=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new wh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new wh,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((i,s)=>this._getKey(i)-this._getKey(s)),t=0,a=0,r=new Array(this._array.length+this._insertedValues.length);for(let i=0;i<r.length;i++)a>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[a])?(r[i]=e[t],t++):r[i]=this._array[a++];this._array=r,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 t=this._getKey(e);if(t===void 0||(ht=this._search(t),ht===-1)||this._getKey(this._array[ht])!==t)return!1;do if(this._array[ht]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(ht),!0;while(++ht<this._array.length&&this._getKey(this._array[ht])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((i,s)=>i-s),t=0,a=new Array(this._array.length-e.length),r=0;for(let i=0;i<this._array.length;i++)e[t]===i?t++:a[r++]=this._array[i];this._array=a,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&&(ht=this._search(e),!(ht<0||ht>=this._array.length)&&this._getKey(this._array[ht])===e))do yield this._array[ht];while(++ht<this._array.length&&this._getKey(this._array[ht])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ht=this._search(e),!(ht<0||ht>=this._array.length)&&this._getKey(this._array[ht])===e))do t(this._array[ht]);while(++ht<this._array.length&&this._getKey(this._array[ht])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,a=this._array.length-1;for(;a>=t;){let r=t+a>>1,i=this._getKey(this._array[r]);if(i>e)a=r-1;else if(i<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},ev=0,SR=0,vP=class extends pe{constructor(){super(),this._decorations=new _P(e=>e?.marker.line),this._onDecorationRegistered=this._register(new V),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new V),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Ke(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new SP(e);if(t){let a=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),a.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,a){let r=0,i=0;for(let s of this._decorations.getKeyIterator(t))r=s.options.x??0,i=r+(s.options.width??1),e>=r&&e<i&&(!a||(s.options.layer??"bottom")===a)&&(yield s)}forEachDecorationAtCell(e,t,a,r){this._decorations.forEachByKey(t,i=>{ev=i.options.x??0,SR=ev+(i.options.width??1),e>=ev&&e<SR&&(!a||(i.options.layer??"bottom")===a)&&r(i)})}},SP=class extends Ps{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new V),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new V),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=at.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=at.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},yP=1e3,CP=class{constructor(e,t=yP){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,a){this._rowCount=a,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let i=r-this._lastRefreshMs,s=this._debounceThresholdMS-i;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},s)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},yR=20,CR=!1,bh=class extends pe{constructor(e,t,a,r){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=i.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let s=0;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);if(this._topBoundaryFocusListener=s=>this._handleBoundaryFocus(s,0),this._bottomBoundaryFocusListener=s=>this._handleBoundaryFocus(s,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=i.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new CP(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");CR?(this._accessibilityContainer.classList.add("debug"),this._rowContainer.classList.add("debug"),this._debugRootContainer=i.createElement("div"),this._debugRootContainer.classList.add("xterm"),this._debugRootContainer.appendChild(i.createTextNode("------start a11y------")),this._debugRootContainer.appendChild(this._accessibilityContainer),this._debugRootContainer.appendChild(i.createTextNode("------end a11y------")),this._terminal.element.insertAdjacentElement("afterend",this._debugRootContainer)):this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(s=>this._handleResize(s.rows))),this._register(this._terminal.onRender(s=>this._refreshRows(s.start,s.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(s=>this._handleChar(s))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
43
+ `))),this._register(this._terminal.onA11yTab(s=>this._handleTab(s))),this._register(this._terminal.onKey(s=>this._handleKey(s.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(de(i,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Ke(()=>{CR?this._debugRootContainer.remove():this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<yR+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
44
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===yR+1&&(this._liveRegion.textContent+=av.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let a=this._terminal.buffer,r=a.lines.length.toString();for(let i=e;i<=t;i++){let s=a.lines.get(a.ydisp+i),o=[],l=s?.translateToString(!0,void 0,void 0,o)||"",n=(a.ydisp+i+1).toString(),u=this._rowElements[i];u&&(l.length===0?(u.textContent="\xA0",this._rowColumns.set(u,[0,1])):(u.textContent=l,this._rowColumns.set(u,o)),u.setAttribute("aria-posinset",n),u.setAttribute("aria-setsize",r),this._alignRowWidth(u))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let a=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],i=a.getAttribute("aria-posinset"),s=t===0?"1":`${this._terminal.buffer.lines.length}`;if(i===s||e.relatedTarget!==r)return;let o,l;if(t===0?(o=a,l=this._rowElements.pop(),this._rowContainer.removeChild(l)):(o=this._rowElements.shift(),l=a,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),l.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let n=this._createAccessibilityTreeNode();this._rowElements.unshift(n),this._rowContainer.insertAdjacentElement("afterbegin",n)}else{let n=this._createAccessibilityTreeNode();this._rowElements.push(n),this._rowContainer.appendChild(n)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===a.node&&t.offset>a.offset)&&([t,a]=[a,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(a.node))return;let i=({node:l,offset:n})=>{let u=l instanceof Text?l.parentNode:l,c=parseInt(u?.getAttribute("aria-posinset"),10)-1;if(isNaN(c))return console.warn("row is invalid. Race condition?"),null;let d=this._rowColumns.get(u);if(!d)return console.warn("columns is null. Race condition?"),null;let f=n<d.length?d[n]:d.slice(-1)[0]+1;return f>=this._terminal.cols&&(++c,f=0),{row:c,column:f}},s=i(t),o=i(a);if(!(!s||!o)){if(s.row>o.row||s.row===o.row&&s.column>=o.column)throw new Error("invalid range");this._terminal.select(s.column,s.row,(o.row-s.row)*this._terminal.cols-s.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_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 e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,a=this._rowColumns.get(e)?.slice(-1)?.[0];if(!a)return;let r=a*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};bh=ct([X(1,zv),X(2,Ai),X(3,Bi)],bh);var Hv=class extends pe{constructor(e,t,a,r,i){super(),this._element=e,this._mouseService=t,this._renderService=a,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new V),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new V),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Ke(()=>{Ao(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(de(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(de(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(de(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(de(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let a=e.composedPath();for(let r=0;r<a.length;r++){let i=a[r];if(i.classList.contains("xterm"))break;if(i.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(r=>{r?.forEach(i=>{i.link.dispose&&i.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let a=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(a=this._checkLinkProviderResult(r,e,a)):i.provideLinks(e.y,s=>{if(this._isMouseOut)return;let o=s?.map(l=>({link:l}));this._activeProviderReplies?.set(r,o),a=this._checkLinkProviderResult(r,e,a),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let a=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let s=0;s<i.length;s++){let o=i[s],l=o.link.range.start.y<e?0:o.link.range.start.x,n=o.link.range.end.y>e?this._bufferService.cols:o.link.range.end.x;for(let u=l;u<=n;u++){if(a.has(u)){i.splice(s--,1);break}a.add(u)}}}}_checkLinkProviderResult(e,t,a){if(!this._activeProviderReplies)return a;let r=this._activeProviderReplies.get(e),i=!1;for(let s=0;s<e;s++)(!this._activeProviderReplies.has(s)||this._activeProviderReplies.get(s))&&(i=!0);if(!i&&r){let s=r.find(o=>this._linkAtPosition(o.link,t));s&&(a=!0,this._handleNewLink(s))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!a)for(let s=0;s<this._activeProviderReplies.size;s++){let o=this._activeProviderReplies.get(s)?.find(l=>this._linkAtPosition(l.link,t));if(o){a=!0,this._handleNewLink(o);break}}return a}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&LP(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Ao(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:a=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==a&&(this._currentLink.state.decorations.pointerCursor=a,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",a))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:a=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==a&&(this._currentLink.state.decorations.underline=a,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,a))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(a=>{if(!this._currentLink)return;let r=a.start===0?0:a.start+1+this._bufferService.buffer.ydisp,i=this._bufferService.buffer.ydisp+1+a.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=i&&(this._clearCurrentLink(r,i),this._lastMouseEvent)){let s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._askForLink(s,!1)}})))}_linkHover(e,t,a){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(a,t.text)}_fireUnderlineEvent(e,t){let a=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(a.start.x-1,a.start.y-r-1,a.end.x,a.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,a){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(a,t.text)}_linkAtPosition(e,t){let a=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return a<=i&&i<=r}_positionFromMouseEvent(e,t,a){let r=a.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,a,r,i){return{x1:e,y1:t,x2:a,y2:r,cols:this._bufferService.cols,fg:i}}};Hv=ct([X(1,Uv),X(2,Bi),X(3,ya),X(4,BR)],Hv);function LP(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var xP=class extends mP{constructor(e={}){super(e),this._linkifier=this._register(new an),this.browser=nI,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new an),this._onCursorMove=this._register(new V),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new V),this.onKey=this._onKey.event,this._onRender=this._register(new V),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new V),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new V),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new V),this.onBell=this._onBell.event,this._onFocus=this._register(new V),this._onBlur=this._register(new V),this._onA11yCharEmitter=this._register(new V),this._onA11yTabEmitter=this._register(new V),this._onWillOpen=this._register(new V),this._setup(),this._decorationService=this._instantiationService.createInstance(vP),this._instantiationService.setService(mc,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(dO),this._instantiationService.setService(BR,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(iv)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(ta.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(ta.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(ta.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(ta.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Ke(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.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 t of e){let a,r="";switch(t.index){case 256:a="foreground",r="10";break;case 257:a="background",r="11";break;case 258:a="cursor",r="12";break;default:a="ansi",r="4;"+t.index}switch(t.type){case 0:let i=Ge.toColorRGB(a==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[a]);this.coreService.triggerDataEvent(`${B.ESC}]${r};${nP(i)}${oI.ST}`);break;case 1:if(a==="ansi")this._themeService.modifyColors(s=>s.ansi[t.index]=Ct.toColor(...t.color));else{let s=a;this._themeService.modifyColors(o=>o[s]=Ct.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.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(bh,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(B.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(B.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,t=this.buffer.lines.get(e);if(!t)return;let a=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(a),s=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,l=a*this._renderService.dimensions.css.cell.width;this.textarea.style.left=l+"px",this.textarea.style.top=o+"px",this.textarea.style.width=s+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(de(this.element,"copy",t=>{this.hasSelection()&&JT(t,this._selectionService)}));let e=t=>eA(t,this.textarea,this.coreService,this.optionsService);this._register(de(this.textarea,"paste",e)),this._register(de(this.element,"paste",e)),uI?this._register(de(this.element,"mousedown",t=>{t.button===2&&Lb(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(de(this.element,"contextmenu",t=>{Lb(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Xv&&this._register(de(this.element,"auxclick",t=>{t.button===1&&bR(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(de(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(de(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(de(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(de(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(de(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(de(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(de(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){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"),this.element?.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 t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(de(this.screenElement,"mousemove",i=>this.updateCursorStyle(i))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let a=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",tv.get()),fI||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",()=>a.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(uO,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Ai,this._coreBrowserService),this._register(de(this.textarea,"focus",i=>this._handleTextAreaFocus(i))),this._register(de(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Rv,this._document,this._helperContainer),this._instantiationService.setService(Ih,this._charSizeService),this._themeService=this._instantiationService.createInstance(Dv),this._instantiationService.setService(rn,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Lh),this._instantiationService.setService(AR,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Ev,this.rows,this.screenElement)),this._instantiationService.setService(Bi,this._renderService),this._register(this._renderService.onRenderedViewportChange(i=>this._onRender.fire(i))),this.onResize(i=>this._renderService.resize(i.cols,i.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(xv,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Iv),this._instantiationService.setService(Uv,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(Hv,this.screenElement));this.element.appendChild(t);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(Cv,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(i=>{super.scrollLines(i,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(kv,this.element,this.screenElement,r)),this._instantiationService.setService(nA,this._selectionService),this._register(this._selectionService.onRequestScrollLines(i=>this.scrollLines(i.amount,i.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(i=>this._renderService.handleSelectionChanged(i.start,i.end,i.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(i=>{this.textarea.value=i,this.textarea.focus(),this.textarea.select()})),this._register(ta.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(Lv,this.screenElement)),this._register(de(this.element,"mousedown",i=>this._selectionService.handleMouseDown(i))),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(bh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",i=>this._handleScreenReaderModeOptionChange(i))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ch,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",i=>{!this._overviewRulerRenderer&&i&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ch,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(bv,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function a(s){let o=e._mouseService.getMouseReportCoords(s,e.screenElement);if(!o)return!1;let l,n;switch(s.overrideType||s.type){case"mousemove":n=32,s.buttons===void 0?(l=3,s.button!==void 0&&(l=s.button<3?s.button:3)):l=s.buttons&1?0:s.buttons&4?1:s.buttons&2?2:3;break;case"mouseup":n=0,l=s.button<3?s.button:3;break;case"mousedown":n=1,l=s.button<3?s.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(s)===!1)return!1;let u=s.deltaY;if(u===0||e.coreMouseService.consumeWheelEvent(s,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;n=u<0?0:1,l=4;break;default:return!1}return n===void 0||l===void 0||l>4?!1:e.coreMouseService.triggerMouseEvent({col:o.col,row:o.row,x:o.x,y:o.y,button:l,action:n,ctrl:s.ctrlKey,alt:s.altKey,shift:s.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:s=>(a(s),s.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(s)),wheel:s=>(a(s),this.cancel(s,!0)),mousedrag:s=>{s.buttons&&a(s)},mousemove:s=>{s.buttons||a(s)}};this._register(this.coreMouseService.onProtocolChange(s=>{s?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(s)),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()),s&8?r.mousemove||(t.addEventListener("mousemove",i.mousemove),r.mousemove=i.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),s&16?r.wheel||(t.addEventListener("wheel",i.wheel,{passive:!1}),r.wheel=i.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),s&2?r.mouseup||(r.mouseup=i.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),s&4?r.mousedrag||(r.mousedrag=i.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(de(t,"mousedown",s=>{if(s.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(s)))return a(s),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(s)})),this._register(de(t,"wheel",s=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(s)===!1)return!1;if(!this.buffer.hasScrollback){if(s.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(s,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(s,!0);let o=B.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(s.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(o,!0),this.cancel(s,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.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,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){wR(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 t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}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,t,a){this._selectionService.setSelection(e,t,a)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let a=gP(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),a.type===3||a.type===2){let r=this.rows-1;return this.scrollLines(a.type===2?-r:r),this.cancel(e,!0)}if(a.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(a.cancel&&this.cancel(e,!0),!a.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((a.key===B.ETX||a.key===B.CR)&&(this.textarea.value=""),this._onKey.fire({key:a.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(a.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let a=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?a:a&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(wP(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!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 t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.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(yt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(B.ESC+"[I"):this.coreService.triggerDataEvent(B.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),a=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${B.ESC}[4;${a};${t}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),i=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${B.ESC}[6;${i};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function wP(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var bP=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let a={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(a),t.dispose=()=>this._wrappedAddonDispose(a),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let a=0;a<this._addons.length;a++)if(this._addons[a]===e){t=a;break}if(t===-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(t,1)}},RP=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Cr)}translateToString(e,t,a){return this._line.translateToString(e,t,a)}},LR=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new RP(t)}getNullCell(){return new Cr}},IP=class extends pe{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new V),this.onBufferChange=this._onBufferChange.event,this._normal=new LR(this._core.buffers.normal,"normal"),this._alternate=new LR(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)}},EP=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,a=>t(a.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(a,r)=>t(a,r.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},kP=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}},DP=["cols","rows"],Jr=0,LI=class extends pe{constructor(e){super(),this._core=this._register(new xP(e)),this._addonManager=this._register(new bP),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],a=(r,i)=>{this._checkReadonlyOptions(r),this._core.options[r]=i};for(let r in this._core.options){let i={get:t.bind(this,r),set:a.bind(this,r)};Object.defineProperty(this._publicOptions,r,i)}}_checkReadonlyOptions(e){if(DP.includes(e))throw new Error(`Option "${e}" 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 EP(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new kP(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 IP(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,a){this._verifyIntegers(e,t,a),this._core.select(e,t,a)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
45
+ `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return tv.get()},set promptLabel(e){tv.set(e)},get tooMuchOutput(){return av.get()},set tooMuchOutput(e){av.set(e)}}}_verifyIntegers(...e){for(Jr of e)if(Jr===1/0||isNaN(Jr)||Jr%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Jr of e)if(Jr&&(Jr===1/0||isNaN(Jr)||Jr%1!==0||Jr<0))throw new Error("This API only accepts positive integers")}};var _c=P(ye(),1);var xI=P(ye(),1);var wI="adoc.theme",Th=new Set,Ah=document.documentElement,MP=Ah.dataset.theme==="light"||Ah.dataset.theme==="system"?Ah.dataset.theme:"dark",bI=Et(wI,void 0),Bh=()=>bI??MP;function RI(){Ah.dataset.theme=Bh()}var II=window.matchMedia("(prefers-color-scheme: dark)");II.addEventListener("change",()=>Th.forEach(e=>e()));RI();var Ns={get:Bh,set(e){bI=e,ua(wI,e),RI(),Th.forEach(t=>t())},dark:()=>Bh()==="system"?II.matches:Bh()==="dark",subscribe(e){return Th.add(e),()=>Th.delete(e)}};function EI(){return(0,xI.useSyncExternalStore)(Ns.subscribe,Ns.get)}function kI(e){let t=document.createElement("span");t.style.display="none",document.body.appendChild(t);let a={};for(let r of e)t.style.color=`var(--adoc-${r})`,a[r]=getComputedStyle(t).color;return t.remove(),a}var Yv=P(W(),1),TP=["surface","text","text-muted","primary","border","surface-element","error","success","warning","secondary","accent","info"];function DI(){let e=kI(TP),t={black:e["surface-element"],red:e.error,green:e.success,yellow:e.warning,blue:e.secondary,magenta:e.accent,cyan:e.info,white:e["text-muted"]};return{background:e.surface,foreground:e.text,cursor:e.primary,cursorAccent:e.surface,selectionBackground:e.border,...t,brightBlack:e["text-muted"],brightRed:e.error,brightGreen:e.success,brightYellow:e.warning,brightBlue:e.secondary,brightMagenta:e.accent,brightCyan:e.info,brightWhite:e.text}}var AP='"D2Coding", "Symbols Nerd Font Mono", ui-monospace, monospace',MI;function BP(){return MI??=Promise.all(['13px "D2Coding"','bold 13px "D2Coding"','13px "Symbols Nerd Font Mono"'].map(e=>document.fonts.load(e,"a\uAC00\uE0B0"))).catch(()=>{}),MI}function OP(e){let t=atob(e),a=new Uint8Array(t.length);for(let r=0;r<t.length;r++)a[r]=t.charCodeAt(r);return a}function TI({claim:e,onPhase:t}){let{connection:a}=Aa(),r=(0,_c.useRef)(null),i=(0,_c.useRef)("observe");return(0,_c.useEffect)(()=>{let s=r.current;if(!s)return;let o=()=>{let u=new LI({fontSize:13,fontFamily:AP,cursorBlink:!0,allowProposedApi:!0,scrollback:0,theme:DI()}),c=new Sb;u.loadAddon(c),u.open(s),c.fit();let d=Ns.subscribe(()=>{u.options.theme=DI()}),f=I=>{i.current=I,xs({type:"terminal.open",mode:I,cols:u.cols,rows:u.rows})},h=Date.now(),m=gw(I=>{I.type==="terminal.frame"&&typeof I.bytes=="string"?(h=Date.now(),I.full&&u.reset(),u.write(OP(I.bytes))):I.type==="terminal.mode"?(i.current=I.mode==="control"?"control":"observe",t(i.current)):I.type==="terminal.closed"&&t("closed")}),_=u.onData(I=>{i.current==="control"&&xs({type:"terminal.input",data:I})});u.attachCustomKeyEventHandler(I=>I.key!=="Enter"||!I.shiftKey||I.ctrlKey||I.altKey||I.metaKey?!0:(I.type==="keydown"&&i.current==="control"&&xs({type:"terminal.input",data:"\x1B\r"}),!1));let y=s.querySelector("textarea"),p=()=>{i.current!=="control"&&f("control")};y?.addEventListener("focus",p),window.addEventListener("pointerdown",p,!0),window.addEventListener("keydown",p,!0),window.addEventListener("focus",p);let g=window.setInterval(()=>{i.current==="observe"&&Date.now()-h>3e3&&f("observe")},1e3),v=()=>{c.fit(),f("control")};window.addEventListener("adoc:panel-resized",v);let C=0,x,k=I=>{I.preventDefault(),I.stopPropagation(),p(),C+=I.deltaMode===1?-I.deltaY*10/3:-I.deltaY/10,x===void 0&&(x=window.requestAnimationFrame(()=>{let A=Math.trunc(C);C-=A,x=void 0,A&&xs({type:"terminal.scroll",lines:A})}))};s.addEventListener("wheel",k,{passive:!1,capture:!0});let T=["left","middle","right"],U,w="",N=I=>{let A=s.querySelector(".xterm-screen")?.getBoundingClientRect();if(!(!A||I.clientX<A.left||I.clientY<A.top||I.clientX>=A.right||I.clientY>=A.bottom))return{column:Math.floor((I.clientX-A.left)/A.width*u.cols),row:Math.floor((I.clientY-A.top)/A.height*u.rows)}},H=(I,A,te)=>{let J=N(A);if(!J||i.current!=="control")return;let Re=`${I}:${J.column}:${J.row}`;I==="drag"&&Re===w||(w=Re,xs({type:"terminal.mouse",action:I,button:te,...J}))},ee=I=>{U=T[I.button]??"left",p(),H("down",I,U)},R=I=>{U&&H("drag",I,U)},E=I=>{U&&(H("up",I,U),U=void 0)};s.addEventListener("mousedown",ee,!0),window.addEventListener("mousemove",R,!0),window.addEventListener("mouseup",E,!0);let z,F=new ResizeObserver(()=>{window.clearTimeout(z),z=window.setTimeout(()=>{c.fit(),xs({type:"terminal.resize",cols:u.cols,rows:u.rows})},120)});return F.observe(s),f(document.hasFocus()?"control":"observe"),()=>{m(),d(),_.dispose(),F.disconnect(),y?.removeEventListener("focus",p),window.removeEventListener("pointerdown",p,!0),window.removeEventListener("keydown",p,!0),window.removeEventListener("focus",p),window.clearInterval(g),window.removeEventListener("adoc:panel-resized",v),s.removeEventListener("wheel",k,{capture:!0}),s.removeEventListener("mousedown",ee,!0),window.removeEventListener("mousemove",R,!0),window.removeEventListener("mouseup",E,!0),xs({type:"terminal.close"}),u.dispose()}},l,n=!1;return BP().then(()=>{n||(l=o())}),()=>{n=!0,l?.()}},[e.pane,e.herdrSession,a]),(0,Yv.jsx)("div",{className:"terminal-panel","data-testid":"terminal-panel",children:(0,Yv.jsx)("div",{className:"terminal-host",ref:r})})}var Xe=P(W(),1);function AI({width:e,dockLeft:t}){let{messages:a,agent:r}=Aa(),[i,s]=(0,jv.useState)(!1),[o,l]=(0,jv.useState)("connecting"),n=r?.claim&&!r.claim.gone?r.claim:void 0;return(0,Xe.jsxs)("aside",{className:`message-dock${i?" collapsed":""}`,style:i?void 0:{width:e},"data-testid":"message-dock",children:[(0,Xe.jsxs)("div",{className:"dock-header",children:[n?(0,Xe.jsx)(Is,{}):(0,Xe.jsx)(Nu,{}),(0,Xe.jsx)("span",{className:"agent-name",children:r?.name??"agent"}),!i&&(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)("span",{className:"where",title:n?`${n.agent??"pane"} in herdr session ${n.herdrSession}`:"Transport of the messages",children:n?`${n.pane} \xB7 ${n.agent??"pane"}`:`via ${r?.transport??"\u2026"}`}),n?.status&&(0,Xe.jsx)("span",{className:`agent-status ${n.status}`,children:n.status}),(0,Xe.jsx)("span",{className:"spacer"}),n&&(0,Xe.jsx)("span",{className:`terminal-phase ${o}`,title:o==="control"?"This tab controls the terminal":o==="observe"?"Another tab controls the terminal; click it to take over":o,children:o==="control"?(0,Xe.jsx)(Hu,{}):(0,Xe.jsx)(Bu,{})})]}),(0,Xe.jsx)("span",{className:"adoc-chip","data-testid":"pending-count",title:"Messages not delivered yet",children:a.length}),(0,Xe.jsx)("button",{className:"quiet",onClick:()=>s(!i),title:i?"Open the panel":"Fold the panel",children:i===t?(0,Xe.jsx)(Mu,{}):(0,Xe.jsx)(Tu,{})})]}),!i&&(0,Xe.jsxs)(Xe.Fragment,{children:[n?(0,Xe.jsx)(TI,{claim:n,onPhase:l}):(0,Xe.jsx)(vb,{messages:a}),r?.claim?.gone&&(0,Xe.jsxs)("p",{className:"dock-note adoc-block adoc-tone-error",children:["The claimed pane ",r.claim.pane," closed; messages are held until an agent claims the workspace again."]})]})]})}var Po=P(W(),1);function BI(){let e=Ba();return e?(0,Po.jsxs)("nav",{className:"plugin-tab-bar","data-testid":"plugin-tab-bar",children:[e.plugins.length===0&&(0,Po.jsx)("span",{className:"muted",children:"No plugin is declared in .adoc/adoc.yaml."}),e.plugins.map(t=>(0,Po.jsxs)(Vf,{to:`/p/${t.key}`,onClick:()=>window.dispatchEvent(new CustomEvent("adoc:hold-list")),className:({isActive:a})=>`plugin-tab${a?" active":""}${t.error?" failed":""}`,title:t.error??t.description,children:[t.key,(0,Po.jsx)("span",{className:"count",children:t.error?"!":t.documents})]},t.key))]}):(0,Po.jsx)("nav",{className:"plugin-tab-bar"})}var Zv=P(W(),1),OI={system:"light",light:"dark",dark:"system"},PP={system:Fu,light:Gu,dark:qu};function PI(){let e=EI(),t=PP[e];return(0,Zv.jsx)("button",{className:"theme-toggle",onClick:()=>Ns.set(OI[e]),title:`Colours: ${e} (click for ${OI[e]})`,"data-testid":"theme-toggle",children:(0,Zv.jsx)(t,{})})}var Oh=P(W(),1);function NI({count:e,onOpen:t}){return e===0?null:(0,Oh.jsxs)("button",{className:"warning-link",onClick:t,"data-testid":"warning-link",children:[(0,Oh.jsx)(Es,{}),e," ",e===1?"warning":"warnings"]})}var La=P(W(),1);function HI({entries:e,onClose:t}){return(0,La.jsx)("div",{className:"overlay",onClick:t,children:(0,La.jsxs)("div",{className:"warning-panel floating",onClick:a=>a.stopPropagation(),"data-testid":"warning-panel",children:[(0,La.jsxs)("div",{className:"panel-header",children:[(0,La.jsx)("h2",{children:"Warnings and errors"}),(0,La.jsx)("button",{className:"quiet",onClick:t,title:"Close",children:(0,La.jsx)(Dr,{})})]}),e.length===0?(0,La.jsx)("p",{className:"muted",children:"Nothing to report."}):(0,La.jsx)("ul",{className:"warning-list",children:e.map((a,r)=>(0,La.jsxs)("li",{className:`adoc-block ${a.level==="error"?"adoc-tone-error":"adoc-tone-warning"}`,children:[(0,La.jsx)("span",{className:"level",children:a.level}),(0,La.jsx)("span",{className:"kind",children:a.kind}),(0,La.jsx)("span",{className:"message",children:a.message}),a.path&&(0,La.jsx)("span",{className:"path",children:a.path})]},r))})]})})}var rt=P(W(),1);function zI(){return(0,rt.jsx)(bw,{children:(0,rt.jsx)(HP,{})})}function NP(){let e=vt(),t=e.pathname+e.hash;(0,Oi.useEffect)(()=>Wf(t),[t]),(0,Oi.useEffect)(()=>{let a=0,r=()=>{Date.now()-a<2e3||(a=Date.now(),Wf(location.pathname+location.hash))};return window.addEventListener("click",r,!0),window.addEventListener("keydown",r,!0),window.addEventListener("focus",r),()=>{window.removeEventListener("click",r,!0),window.removeEventListener("keydown",r,!0),window.removeEventListener("focus",r)}},[])}function HP(){let e=Ba(),t=Qf();NP();let[a,r]=(0,Oi.useState)(!1),[i,s]=(0,Oi.useState)(()=>Et("adoc.dock-width",420)),[o,l]=(0,Oi.useState)(()=>Et("adoc.dock-left",!1)),n=()=>{l(!o),ua("adoc.dock-left",!o||void 0)},u=(0,Oi.useCallback)(c=>{s(c),ua("adoc.dock-width",c)},[]);return(0,rt.jsxs)("div",{className:"app-shell",children:[(0,rt.jsxs)("header",{className:"top-bar",children:[(0,rt.jsxs)(_r,{to:"/",className:"workspace-name",children:[(0,rt.jsx)("span",{className:"product",children:"adoc"}),e?.name??"\u2026"]}),(0,rt.jsx)(BI,{}),(0,rt.jsxs)("div",{className:"top-bar-right",children:[(0,rt.jsx)(NI,{count:e?.check.length??0,onOpen:()=>r(!0)}),(0,rt.jsx)(Iw,{}),e&&(0,rt.jsx)(ub,{git:e.git}),(0,rt.jsx)(nb,{}),(0,rt.jsx)(PI,{})]})]}),(0,rt.jsxs)("div",{className:`shell-body${o?" dock-left":""}`,children:[(0,rt.jsxs)("div",{className:"shell-column",children:[(0,rt.jsx)("main",{className:"shell-main",children:(0,rt.jsx)(b_,{})}),(0,rt.jsx)(_b,{drafts:t})]}),(0,rt.jsx)(cb,{width:i,onWidth:u,dockLeft:o,onSwap:n}),(0,rt.jsx)(AI,{width:i,dockLeft:o})]}),a&&(0,rt.jsx)(HI,{entries:e?.check??[],onClose:()=>r(!1)})]})}var Us=P(ye(),1);var ra=P(ye(),1);var on=P(W(),1);function Qv({text:e,onDismiss:t}){return(0,on.jsxs)("div",{className:"action-notice adoc-block adoc-tone-warning",role:"alert","data-testid":"action-notice",children:[(0,on.jsx)("span",{children:e}),(0,on.jsx)("button",{className:"quiet",onClick:t,title:"Dismiss",children:(0,on.jsx)(Dr,{})})]})}var Lt=P(ye(),1);var Jv="adoc.open-comments",vc={get(e){return Et(Jv,{})[e]},set(e,t){let a=Et(Jv,{});t&&t.text?a[e]=t:delete a[e],ua(Jv,a)}};var No=P(ye(),1),ri=P(W(),1);function UI({question:e,onConfirm:t,onCancel:a}){let[r,i]=(0,No.useState)(!1),s=(0,No.useRef)(null),o=(0,No.useRef)(a);return o.current=a,(0,No.useEffect)(()=>{s.current?.focus();let l=n=>{n.key==="Escape"&&o.current()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]),(0,ri.jsx)("div",{className:"action-confirm-backdrop",onMouseDown:l=>l.target===l.currentTarget&&a(),children:(0,ri.jsxs)("div",{className:"action-confirm-dialog adoc-block adoc-tone-primary",role:"dialog","aria-modal":"true","data-testid":"action-confirm-dialog",children:[(0,ri.jsx)("p",{children:e}),(0,ri.jsxs)("label",{className:"adoc-muted",children:[(0,ri.jsx)("input",{type:"checkbox",checked:r,onChange:l=>i(l.target.checked)})," Don't ask again"]}),(0,ri.jsxs)("div",{className:"action-confirm-buttons",children:[(0,ri.jsx)("button",{className:"quiet",onClick:a,children:"Cancel"}),(0,ri.jsx)("button",{className:"primary",ref:s,onClick:()=>t(r),children:"Confirm"})]})]})})}var eS=P(W(),1);function FI({top:e,left:t,anchor:a,onOpen:r}){return(0,eS.jsx)("button",{className:"anchor-comment-button floating",style:{top:e,left:t},title:`Comment on #${a}`,"data-testid":"anchor-comment-button",onMouseDown:i=>i.preventDefault(),onClick:r,children:(0,eS.jsx)(zu,{})})}var ln=P(ye(),1);var Tr=P(W(),1);function qI({subject:e,comment:t,initialText:a,onDone:r}){let[i,s]=(0,ln.useState)(a??""),o=(0,ln.useRef)(null);(0,ln.useEffect)(()=>o.current?.focus(),[]);let l=c=>{s(c),vc.set(et(e),{...t,text:c})},n=()=>{vc.set(et(e),void 0),r()},u=()=>{i.trim()&&(_a.add({...t,text:i}),n())};return(0,Tr.jsxs)("div",{className:"draft-comment-input","data-testid":"draft-comment-input",children:[(0,Tr.jsxs)("div",{className:"composer-target",children:["draft \xB7 ",(0,Tr.jsx)("code",{children:et(t.target)}),t.source&&(0,Tr.jsxs)("span",{className:"muted",children:[" \xB7 ",t.source]})]}),t.quote&&(0,Tr.jsx)("blockquote",{className:"composer-quote",children:t.quote}),(0,Tr.jsx)("textarea",{ref:o,value:i,rows:2,placeholder:"Comment on this part",onChange:c=>l(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.ctrlKey||c.metaKey)&&(c.preventDefault(),u()),c.key==="Escape"&&n()}}),(0,Tr.jsxs)("div",{className:"composer-actions",children:[(0,Tr.jsx)("button",{type:"button",className:"quiet",onClick:n,children:"Cancel"}),(0,Tr.jsx)("button",{type:"button",className:"primary",disabled:!i.trim(),onClick:u,children:"Add"})]})]})}var tS=P(W(),1);function VI({subject:e,request:t,onClose:a}){let r={target:t.target};t.quote&&(r.quote=t.quote),t.source&&(r.source=t.source);let i={subject:e,comment:r,onDone:a};return t.text&&(i.initialText=t.text),(0,tS.jsx)("div",{className:"comment-popover floating",style:{top:t.top,left:t.left},"data-testid":"comment-popover",onMouseUp:s=>s.stopPropagation(),children:(0,tS.jsx)(qI,{...i})})}var Sc=P(ye(),1);var Na=P(W(),1);function $I({subject:e,content:t,container:a,html:r,onEdit:i}){let s=Qf().filter(c=>et(c.target)===et(e)||c.target.level==="anchor"&&e.level==="document"&&c.target.key===e.key),[o,l]=(0,Sc.useState)([]),[n,u]=(0,Sc.useState)();return(0,Sc.useLayoutEffect)(()=>{if(!t||!a)return;let c=a.getBoundingClientRect();l(s.map(d=>{let f=null;d.source&&(f=t.querySelector(`[data-adoc-source="${CSS.escape(d.source)}"]`)),!f&&d.target.level==="anchor"&&(f=t.querySelector(`[data-adoc-anchor="${CSS.escape(d.target.anchor)}"]`));let h=(f??t).getBoundingClientRect();return{draft:d,top:h.top-c.top+2}}))},[s.map(c=>c.id).join(","),r,t,a]),(0,Na.jsx)("div",{className:"draft-marker-column","data-testid":"draft-marker-column",children:o.map(({draft:c,top:d})=>(0,Na.jsxs)("div",{className:"draft-marker",style:{top:d},onMouseEnter:()=>u(c.id),onMouseLeave:()=>u(void 0),children:[(0,Na.jsx)(Au,{}),n===c.id&&(0,Na.jsxs)("div",{className:"draft-card floating",children:[(0,Na.jsx)("div",{className:"draft-card-target",children:c.target.level==="anchor"?`#${c.target.anchor}`:et(e)}),c.quote&&(0,Na.jsx)("blockquote",{children:c.quote}),(0,Na.jsx)("div",{children:c.text}),(0,Na.jsxs)("div",{className:"draft-card-actions",children:[(0,Na.jsx)("button",{className:"quiet",title:"Edit",onClick:()=>i(c),children:(0,Na.jsx)(Ei,{})}),(0,Na.jsx)("button",{className:"quiet",title:"Remove",onClick:()=>_a.remove(c.id),children:(0,Na.jsx)(Dr,{})})]})]})]},c.id))})}var WI,zP=0;async function GI(e){let t=[...e.querySelectorAll("pre.adoc-mermaid:not(.drawn)")];if(!t.length)return;WI??=import("./chunks/mermaid.core-SMXJOLYJ.js").then(r=>r.default);let a=await WI;a.initialize({startOnLoad:!1,securityLevel:"strict",theme:Ns.dark()?"dark":"default",fontFamily:"Pretendard Variable, sans-serif"});for(let r of t)if(r.isConnected)try{let{svg:i}=await a.render(`adoc-mermaid-${++zP}`,r.textContent??"");r.innerHTML=i,r.classList.add("drawn")}catch(i){r.classList.add("drawn","failed"),r.insertAdjacentHTML("afterend",'<div class="adoc-muted adoc-mermaid-error"></div>'),r.nextElementSibling.textContent=`Mermaid could not draw this diagram: ${i.message}`}}var $t=P(W(),1);function KI({top:e,left:t,target:a,info:r}){return(0,$t.jsxs)("div",{className:"reference-tooltip floating",style:{top:e,left:t},"data-testid":"reference-tooltip",children:[(0,$t.jsx)("div",{className:"tooltip-key",children:a}),!r&&(0,$t.jsx)("div",{className:"muted",children:"Loading\u2026"}),r&&!r.found&&(0,$t.jsxs)("div",{className:"error",children:[r.key," does not exist."]}),r?.found&&r.summary&&(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsxs)("div",{className:"tooltip-title",children:[r.summary.title," ",(0,$t.jsx)("span",{className:"status",children:r.summary.status}),r.archived&&(0,$t.jsx)("span",{className:"adoc-chip adoc-tone-accent",children:"archived"})]}),r.summary.fields&&Object.keys(r.summary.fields).length>0&&(0,$t.jsx)("table",{children:(0,$t.jsx)("tbody",{children:Object.entries(r.summary.fields).map(([i,s])=>(0,$t.jsxs)("tr",{children:[(0,$t.jsx)("th",{children:i}),(0,$t.jsx)("td",{children:String(s)})]},i))})})]}),r?.found&&r.error&&(0,$t.jsxs)("div",{className:"error",children:["summary failed: ",r.error]})]})}var ii=P(W(),1),aS="application/x-adoc-drag",rS="adoc.confirm-off";function Ph({subject:e,html:t,onAction:a}){let r=et(e),i=Zr(),s=(0,Lt.useRef)(null),o=(0,Lt.useRef)(null),l=(0,Lt.useRef)(!1),n=(0,Lt.useRef)(new Map),[u,c]=(0,Lt.useState)(t),[d,f]=(0,Lt.useState)(),[h,m]=(0,Lt.useState)(),[_,y]=(0,Lt.useState)(),[p,g]=(0,Lt.useState)(),[,v]=(0,Lt.useState)(0),C=vt();(0,Lt.useEffect)(()=>{!d&&t!==u&&c(t)},[t,d,u]),(0,Lt.useLayoutEffect)(()=>{let M=o.current;if(!M)return;M.innerHTML=u,GI(M),n.current.clear();let G=decodeURIComponent(C.hash.slice(1));if(G){let ue=M.querySelector(`[data-adoc-anchor="${CSS.escape(G)}"]`);ue&&(ue.scrollIntoView({block:"center"}),ue.classList.add("adoc-flash"),window.setTimeout(()=>ue.classList.remove("adoc-flash"),1600))}let K=vc.get(r);if(K&&!d){let ue=K.target.level==="anchor"?M.querySelector(`[data-adoc-anchor="${CSS.escape(K.target.anchor)}"]`):null,be=s.current.getBoundingClientRect(),xt=(ue??M).getBoundingClientRect(),Tt={target:K.target,text:K.text,top:xt.bottom-be.top+6,left:Math.max(0,Math.min(xt.left-be.left,be.width-380))};K.quote&&(Tt.quote=K.quote),K.source&&(Tt.source=K.source),f(Tt)}let le=[...new Set([...M.querySelectorAll("[data-adoc-ref]")].map(ue=>ue.getAttribute("data-adoc-ref")))];le.length&&nt.references(le).then(({references:ue})=>{for(let be of ue)n.current.set(be.target,be);for(let be of M.querySelectorAll("[data-adoc-ref]"))be.classList.toggle("adoc-ref-broken",n.current.get(be.getAttribute("data-adoc-ref"))?.found===!1);v(be=>be+1)},()=>{})},[u,C.hash]);let x=M=>{let G=s.current.getBoundingClientRect();return{top:M.top-G.top,left:M.left-G.left,bottom:M.bottom-G.top,width:G.width}},k=async M=>{if(l.current)return{status:"busy"};l.current=!0;try{return await a?.({event:M})}finally{l.current=!1}},T=M=>`${e.level==="document"?Ro(e.key):"skill"} ${M.name}`,U=(M,G)=>{M&&!Et(rS,[]).includes(T(G))?g({question:M,event:G}):k(G)},w=M=>{p&&(M&&ua(rS,[...new Set([...Et(rS,[]),T(p.event)])]),g(void 0),k(p.event))},N=M=>M.closest("[data-adoc-anchor]")?.getAttribute("data-adoc-anchor")??void 0,H=M=>{let G=M.target,K=G.closest("[data-adoc-ref]");if(K){M.preventDefault();let ue=K.getAttribute("data-adoc-ref").split("#")[0];i(`/p/${Ro(ue)}/${ue}`);return}let le=G.closest('[data-adoc-kind="click"]');if(le){M.preventDefault();let ue={kind:"click",name:le.getAttribute("data-adoc-action"),value:le.getAttribute("data-adoc-value")??""},be=N(le);be&&(ue.anchor=be),U(le.getAttribute("data-adoc-confirm"),ue)}},ee=(0,Lt.useRef)(()=>{});ee.current=M=>{let G={kind:"toggle",name:M.getAttribute("data-adoc-action"),value:M.getAttribute("data-adoc-value")??"",checked:M.checked};M.checked=!M.checked;let K=N(M);K&&(G.anchor=K),U(M.getAttribute("data-adoc-confirm"),G)},(0,Lt.useEffect)(()=>{let M=o.current;if(!M)return;let G=K=>{let le=K.target;le.getAttribute?.("data-adoc-kind")==="toggle"&&ee.current(le)};return M.addEventListener("change",G),()=>M.removeEventListener("change",G)},[]);let R=(0,Lt.useRef)(()=>{});R.current=M=>{let G=M.detail;if(typeof G?.name!="string")return;let K={kind:"client",name:G.name,value:typeof G.value=="string"?G.value:""},le=N(M.target);le&&(K.anchor=le),k(K).then(ue=>G.reply?.(ue??{status:"failed",error:"the document is not shown"}))},(0,Lt.useEffect)(()=>{let M=o.current;if(!M)return;let G=le=>R.current(le),K=le=>{let ue=le.detail?.text;typeof ue=="string"&&ue.trim()&&_a.putOwnDraft("element",e,ue)};return M.addEventListener("adoc-action",G),M.addEventListener("adoc-draft",K),()=>{M.removeEventListener("adoc-action",G),M.removeEventListener("adoc-draft",K)}},[]);let E=M=>{let G=M.target,K=G.closest("[data-adoc-anchor]");if(K&&o.current?.contains(K)){let ue=x(K.getBoundingClientRect()),be=K.closest("[data-adoc-source]")??K.querySelector("[data-adoc-source]"),xt={anchor:K.getAttribute("data-adoc-anchor"),top:ue.top,left:ue.width-30},Tt=be?.getAttribute("data-adoc-source");Tt&&(xt.source=Tt),m(xt)}let le=G.closest("[data-adoc-ref]");if(le){let ue=x(le.getBoundingClientRect());y({target:le.getAttribute("data-adoc-ref"),top:ue.bottom+4,left:Math.max(0,ue.left)})}},z=M=>{let G=M.target.closest("[data-adoc-ref]");G&&!G.contains(M.relatedTarget)&&y(void 0)},F=()=>{window.setTimeout(()=>{if(d)return;let M=window.getSelection();if(!M||M.isCollapsed||!M.rangeCount)return;let G=M.toString().trim(),K=M.getRangeAt(0);if(!G||!o.current?.contains(K.commonAncestorContainer))return;let le=K.commonAncestorContainer instanceof Element?K.commonAncestorContainer:K.commonAncestorContainer.parentElement,ue=K.startContainer instanceof Element?K.startContainer:K.startContainer.parentElement,be=N(le),xt=ue.closest("[data-adoc-source]")?.getAttribute("data-adoc-source")??void 0,Tt=x(K.getBoundingClientRect()),Ua={target:be&&e.level==="document"?{level:"anchor",key:e.key,anchor:be}:e,quote:G,top:Tt.bottom+6,left:Math.min(Math.max(0,Tt.left),Tt.width-380)};xt&&(Ua.source=xt),f(Ua)},0)},I=()=>{if(!h||e.level!=="document")return;let M={target:{level:"anchor",key:e.key,anchor:h.anchor},top:h.top+28,left:Math.max(0,h.left-360)};h.source&&(M.source=h.source),f(M)},A=M=>{let G=M.target.level==="anchor"?o.current?.querySelector(`[data-adoc-anchor="${CSS.escape(M.target.anchor)}"]`):null,K=s.current.getBoundingClientRect(),le=(G??o.current).getBoundingClientRect(),ue={target:M.target,text:M.text,top:le.bottom-K.top+6,left:Math.max(0,Math.min(le.left-K.left,K.width-380))};M.quote&&(ue.quote=M.quote),M.source&&(ue.source=M.source),_a.remove(M.id),f(ue)},te=M=>M.target.closest("[data-adoc-drop]");return(0,ii.jsxs)("div",{className:"document-body",ref:s,onMouseLeave:()=>m(void 0),children:[t!==u&&(0,ii.jsx)("div",{className:"pending-update adoc-block adoc-tone-info","data-testid":"pending-update",children:"This document changed. The new version appears when you close the comment."}),(0,ii.jsx)("div",{className:"rendered",translate:"yes",ref:o,"data-testid":"document-body",onClick:H,onMouseOver:E,onMouseOut:z,onMouseUp:F,onDragStart:M=>{let G=M.target.closest('[data-adoc-kind="drag"]');G&&(M.dataTransfer.setData(aS,JSON.stringify({name:G.getAttribute("data-adoc-action"),value:G.getAttribute("data-adoc-value")??"",anchor:N(G),confirm:G.getAttribute("data-adoc-confirm")})),M.dataTransfer.effectAllowed="move")},onDragOver:M=>{let G=te(M);!G||!M.dataTransfer.types.includes(aS)||(M.preventDefault(),G.classList.add("adoc-drop-over"))},onDragLeave:M=>{let G=te(M);G&&!G.contains(M.relatedTarget)&&G.classList.remove("adoc-drop-over")},onDrop:M=>{let G=te(M);if(!G)return;M.preventDefault(),G.classList.remove("adoc-drop-over");let K=JSON.parse(M.dataTransfer.getData(aS)||"{}");if(!K.name||K.name!==G.getAttribute("data-adoc-drop"))return;let le={kind:"drag",name:K.name,value:K.value??"",to:G.getAttribute("data-adoc-drop-value")??""};K.anchor&&(le.anchor=K.anchor),U(K.confirm,le)}}),(0,ii.jsx)($I,{subject:e,content:o.current,container:s.current,html:u,onEdit:A}),h&&!d&&(0,ii.jsx)(FI,{top:h.top,left:h.left,anchor:h.anchor,onOpen:I}),_&&(0,ii.jsx)(KI,{top:_.top,left:_.left,target:_.target,info:n.current.get(_.target)}),p&&(0,ii.jsx)(UI,{question:p.question,onConfirm:w,onCancel:()=>g(void 0)}),d&&(0,ii.jsx)(VI,{subject:e,request:d,onClose:()=>{f(void 0),window.getSelection()?.removeAllRanges()}})]})}var Pi=P(ye(),1);var Lr=P(W(),1);function Nh({target:e,load:t,onSave:a,note:r,onClose:i}){let[s,o]=(0,Pi.useState)(),[l,n]=(0,Pi.useState)(""),[u,c]=(0,Pi.useState)("editing"),[d,f]=(0,Pi.useState)(),h=(0,Pi.useRef)(null);(0,Pi.useEffect)(()=>{t().then(_=>{o(_),n(_.text),requestAnimationFrame(()=>h.current?.focus())},_=>f(_.message))},[et(e)]);let m=async()=>{if(!s||u==="saving")return;c("saving");let _=_a.ownDraft("edit",e)?.base??s.text,y=await a(l,_,s.version);if(y.status==="refused"){c("refused"),f(y.reason);return}o({...s,text:l,version:y.version}),y.diff?_a.putOwnDraft("edit",e,`I edited ${s.file}:
46
+
47
+ \`\`\`diff
48
+ ${y.diff}
49
+ \`\`\`${r?`
50
+
51
+ ${r}`:""}`,_):_a.removeOwnDraft("edit",e),c("editing"),f(y.diff?"Saved; the diff waits in the composer.":"Saved; the text is back to what the agent saw last.")};return(0,Lr.jsxs)("div",{className:"document-editor","data-testid":"document-editor",children:[(0,Lr.jsxs)("div",{className:"editor-toolbar",children:[(0,Lr.jsx)("span",{className:"path",children:s?.file??et(e)}),d&&(0,Lr.jsx)("span",{className:`editor-notice${u==="refused"?" error":""}`,children:d}),(0,Lr.jsx)("span",{className:"spacer"}),(0,Lr.jsxs)("button",{className:"primary",onClick:()=>{m()},disabled:!s||u==="saving"||l===s.text,title:"Save (Ctrl+S)","data-testid":"editor-save",children:[(0,Lr.jsx)(Wu,{}),u==="saving"?"saving\u2026":"save"]}),(0,Lr.jsx)("button",{className:"quiet",onClick:i,title:"Close the editor","data-testid":"editor-close",children:(0,Lr.jsx)(Dr,{})})]}),(0,Lr.jsx)("textarea",{ref:h,className:"editor-text",value:l,spellCheck:!1,disabled:!s,onChange:_=>n(_.target.value),onKeyDown:_=>{_.key==="s"&&(_.ctrlKey||_.metaKey)&&(_.preventDefault(),m()),_.key==="Escape"&&i()}})]})}var yc=P(W(),1);function XI({versions:e,base:t,onPick:a}){return e.length===0?null:(0,yc.jsxs)("select",{className:"change-base-picker",value:t??"",onChange:r=>r.target.value&&a(r.target.value),"data-testid":"change-base-picker",title:"Compare with this version",children:[!t&&(0,yc.jsx)("option",{value:"",children:"compare with\u2026"}),e.map(r=>(0,yc.jsxs)("option",{value:r.version,children:["since ",new Date(r.seenAt).toLocaleTimeString()," \xB7 ",r.version.slice(0,7)]},r.version))]})}var Cc=P(W(),1);function YI({state:e,on:t,onToggle:a}){return e==="none"?null:e==="unavailable"?(0,Cc.jsx)("span",{className:"adoc-chip change-toggle unavailable","data-testid":"change-toggle",children:"changes unavailable (older than this server run)"}):(0,Cc.jsxs)("button",{className:`adoc-chip change-toggle${t?" on":""}`,onClick:a,"data-testid":"change-toggle",title:"Changes since the version this browser showed last",children:[(0,Cc.jsx)(Pu,{}),t?"showing changes":"show changes"]})}var aa=P(W(),1);function jI({view:e,changeState:t,changesOn:a,onToggleChanges:r,versions:i,base:s,onPickBase:o,onArchive:l,editing:n,onEdit:u}){return(0,aa.jsxs)("div",{className:"document-header","data-testid":"document-header",children:[(0,aa.jsx)("div",{className:"header-key",children:e.key}),(0,aa.jsx)("h1",{className:"header-title",children:e.summary?.title??e.key}),(0,aa.jsxs)("div",{className:"header-meta",children:[e.summary?(0,aa.jsx)("span",{className:"status",children:e.summary.status}):(0,aa.jsxs)("span",{className:"adoc-chip adoc-tone-error",children:["summary failed: ",e.summaryError]}),e.archived&&(0,aa.jsx)("span",{className:"adoc-chip adoc-tone-accent",children:"archived"}),(0,aa.jsx)("span",{className:"path",children:e.path}),(0,aa.jsx)(YI,{state:t,on:a,onToggle:r}),(0,aa.jsx)(XI,{versions:i,base:i.some(c=>c.version===s)?s:void 0,onPick:o}),!n&&(0,aa.jsxs)("button",{className:"quiet",onClick:u,title:"Edit the whole file; the diff goes to the agent with your next message","data-testid":"edit-button",children:[(0,aa.jsx)(Ei,{}),"edit"]}),(0,aa.jsxs)("button",{className:"quiet",onClick:()=>l(e.archived?"unarchive":"archive"),title:e.archived?"Ask the agent to restore this document":"Ask the agent to archive this document","data-testid":"archive-button",children:[e.archived?(0,aa.jsx)(ku,{}):(0,aa.jsx)(Io,{}),e.archived?"unarchive":"archive"]})]})]})}var xa=P(W(),1);function ZI({documentKey:e}){let{changed:t}=Aa(),[a,r]=(0,ra.useState)({phase:"loading"}),[i,s]=(0,ra.useState)(),[o,l]=(0,ra.useState)(!1),n=(0,ra.useRef)(void 0),[u,c]=(0,ra.useState)([]),d=(0,ra.useCallback)(()=>{let H=bu.get(e);nt.document(e,H).then(ee=>{H&&H!==ee.version?(n.current=H,l(!0)):bu.set(e,ee.version),r({phase:"showing",view:ee}),nt.versions(e).then(R=>c(R.versions.filter(E=>!E.current)),()=>c([]))},ee=>r(ee instanceof Ru&&ee.status===404?{phase:"missing"}:{phase:"failed",error:ee.message}))},[e]),f=(0,ra.useRef)(0),h=(0,ra.useRef)(!1);(0,ra.useEffect)(d,[d]),(0,ra.useEffect)(()=>{!t.keys.includes(e)&&!t.keys.includes("*")||(f.current?h.current=!0:d())},[t.tick]);let m=async()=>{if(a.phase==="showing"){if(o)bu.set(e,a.view.version),l(!1);else if(n.current){let H=await nt.document(e,n.current);r({phase:"showing",view:H}),l(!0)}}},_=async H=>{n.current=H;let ee=await nt.document(e,H);r({phase:"showing",view:ee}),l(!0)},y=(0,ra.useRef)(void 0);a.phase==="showing"&&(y.current??=a.view.version),(0,ra.useEffect)(()=>{a.phase==="showing"&&(y.current=a.view.version)},[a]);let p=async H=>{f.current+=1;try{let ee=await H();return ee.status==="applied"&&ee.version&&(bu.set(e,ee.version),y.current=ee.version),ee}finally{f.current-=1,!f.current&&h.current&&(h.current=!1,d())}},[g,v]=(0,ra.useState)(!1),C=(H,ee,R)=>p(()=>nt.editFile(e,{version:R,text:H,since:ee})),x=async H=>{if(!y.current)return;let ee=y.current,R=await p(()=>nt.sendAction({...H,key:e,version:ee}));return R.status==="refused"?(s(`Refused: ${R.reason}`),d()):R.status==="failed"?(s(`The action failed: ${R.error}`),d()):s(void 0),R};if(a.phase==="loading")return(0,xa.jsx)("section",{className:"document-detail-pane pane-placeholder",children:"Loading\u2026"});if(a.phase==="missing")return(0,xa.jsxs)("section",{className:"document-detail-pane pane-placeholder",children:[e," no longer exists."]});if(a.phase==="failed")return(0,xa.jsx)("section",{className:"document-detail-pane pane-placeholder error",children:a.error});let{view:k}=a,T=k.changes,U=n.current?T&&!T.available?"unavailable":"available":"none",w=o&&T?.available===!0,N=w?T.html:k.html;return(0,xa.jsxs)("section",{className:"document-detail-pane main-scroll","data-testid":"document-detail-pane",children:[(0,xa.jsx)(jI,{view:k,changeState:U,changesOn:w,onToggleChanges:()=>{m()},versions:u,base:n.current,onPickBase:H=>{_(H)},onArchive:H=>{x({event:{kind:"click",name:H,value:""}})},editing:g,onEdit:()=>v(!0)}),i&&(0,xa.jsx)(Qv,{text:i,onDismiss:()=>s(void 0)}),w&&T.error&&(0,xa.jsx)(Qv,{text:`renderChanges failed: ${T.error}`,onDismiss:()=>{}}),g?(0,xa.jsx)(Nh,{target:{level:"document",key:e},load:()=>nt.file(e),onSave:C,onClose:()=>v(!1)}):N!==void 0?(0,xa.jsx)(Ph,{subject:{level:"document",key:e},html:N,onAction:x}):(0,xa.jsx)("div",{className:"document-body parse-error","data-testid":"render-error",children:(0,xa.jsxs)("div",{className:"adoc-block adoc-tone-error",children:[(0,xa.jsxs)("strong",{children:[k.pluginKey," could not render this document."]}),(0,xa.jsx)("pre",{children:k.renderError})]})})]})}var zs=P(ye(),1);var Hh=P(ye(),1),Hs=6e4,UP=1e4,FP=5*Hs;function QI(e,t){let a=t-Date.parse(e);return a<Hs?"just now":a<60*Hs?`${Math.floor(a/Hs)} min ago`:a<1440*Hs?`${Math.floor(a/(60*Hs))} h ago`:a<720*60*Hs?`${Math.floor(a/(1440*Hs))} d ago`:`on ${new Date(e).toLocaleDateString()}`}function JI(e,t){return t-Date.parse(e)<FP}function eE(){let[e,t]=(0,Hh.useState)(Date.now);return(0,Hh.useEffect)(()=>{let a=window.setInterval(()=>t(Date.now()),UP);return()=>window.clearInterval(a)},[]),e}var tE=P(ye(),1);var xr=P(W(),1);function aE({entry:e,selected:t,now:a}){let[r,i]=(0,tE.useState)(),s=e.summary?e.summary.title:e.key,o=l=>{let n=l.currentTarget;if(n.scrollWidth<=n.clientWidth)return;let u=n.getBoundingClientRect();i({top:u.top,left:u.left,width:u.width})};return(0,xr.jsxs)(_r,{to:`/p/${Ro(e.key)}/${e.key}`,className:`document-row${t?" selected":""}${e.error?" parse-error":""}`,"data-key":e.key,children:[(0,xr.jsxs)("div",{className:"row-meta",children:[e.summary?(0,xr.jsx)("span",{className:"status",children:e.summary.status}):(0,xr.jsx)("span",{className:"error",children:"ERROR"}),(0,xr.jsx)("span",{className:`row-updated${JI(e.updatedAt,a)?" recent":""}`,title:`updated ${new Date(e.updatedAt).toLocaleString()}`,children:QI(e.updatedAt,a)})]}),(0,xr.jsx)("div",{className:"row-title",onMouseEnter:o,onMouseLeave:()=>i(void 0),children:s}),r&&(0,xr.jsx)("div",{className:"row-title-tooltip floating",style:{top:r.top,left:r.left,width:r.width},"data-testid":"row-title-tooltip",children:s}),(0,xr.jsx)("div",{className:"row-meta",children:e.summary?(0,xr.jsx)("span",{className:"row-key",children:e.key}):(0,xr.jsx)("span",{className:"error",children:e.error})})]})}var iS=P(W(),1),iE=[{value:"updated",label:"last update"},{value:"key",label:"key"},{value:"title",label:"title"},{value:"status",label:"status"}],sS=e=>iE.some(t=>t.value===e),rE=e=>e.summary?.title??e.key,zh=(e,t)=>e.key.localeCompare(t.key),qP={updated:(e,t)=>t.updatedAt.localeCompare(e.updatedAt)||zh(e,t),key:zh,title:(e,t)=>rE(e).localeCompare(rE(t))||zh(e,t),status:(e,t)=>(e.summary?.status??"").localeCompare(t.summary?.status??"")||zh(e,t)};function sE(e,t){return[...e].sort(qP[t])}function oE({sort:e,onPick:t}){return(0,iS.jsx)("select",{className:"document-sort-picker",value:e,onChange:a=>sS(a.target.value)&&t(a.target.value),"data-testid":"document-sort-picker",title:"Order of the documents",children:iE.map(a=>(0,iS.jsx)("option",{value:a.value,children:a.label},a.value))})}var Wt=P(W(),1),lE="adoc.list-sort";function nE({pluginKey:e,selected:t,pinned:a,onPin:r,unpinned:i,held:s,openTop:o}){let l=Zr(),n=Ba()?.plugins.find(x=>x.key===e)?.skill,{revision:u}=Aa(),[c,d]=(0,zs.useState)({phase:"loading"}),[f,h]=(0,zs.useState)(()=>{let x=Et(lE,"updated");return sS(x)?x:"updated"}),m=eE(),[_,y]=(0,zs.useState)(!1);(0,zs.useEffect)(()=>y(!1),[e]);let p=x=>{h(x),ua(lE,x)};(0,zs.useEffect)(()=>{let x=!1;return nt.documents(e).then(k=>!x&&d(k.error?{phase:"plugin-error",error:k.error}:{phase:"showing",pluginKey:e,documents:k.documents}),k=>!x&&d({phase:"plugin-error",error:k.message})),()=>{x=!0}},[e,u]);let g=c.phase==="showing"&&c.pluginKey===e?c.documents.filter(x=>x.archived===_):[],v=sE(g,f),C=o&&!_?v[0]?.key:void 0;return(0,zs.useEffect)(()=>{C&&l(`/p/${e}/${C}`,{replace:!0})},[C,e,l]),(0,Wt.jsxs)("aside",{className:`document-list-pane foldable${i?" unpinned":""}${s?" held":""}`,"data-testid":"document-list-pane",children:[(0,Wt.jsx)("div",{className:"pane-rail fold-closed",children:e}),(0,Wt.jsxs)("div",{className:"pane-title fold-open",children:[(0,Wt.jsxs)("span",{className:"pane-title-name",children:[_?`${e} \xB7 ARCHIVE`:e,n&&(0,Wt.jsx)("span",{className:"title-separator",children:"|"}),n&&(0,Wt.jsx)(_r,{className:"skill-link",to:`/p/${e}/skill`,title:`The agent skill of ${e}: how the agent works with these documents`,"data-testid":"skill-link",children:"SKILL.md"})]}),(0,Wt.jsxs)("span",{className:"pane-title-controls",children:[(0,Wt.jsx)(oE,{sort:f,onPick:p}),(0,Wt.jsx)("button",{className:`quiet${_?" active":""}`,onClick:()=>y(!_),title:_?"Back to the documents":"Show only archived documents","data-testid":"list-archive",children:(0,Wt.jsx)(Io,{})}),r&&(0,Wt.jsx)(th,{pinned:a,onPin:r,what:"list",testId:"list-pin"})]})]}),(0,Wt.jsxs)("div",{className:"document-rows main-scroll fold-open",children:[c.phase==="loading"&&(0,Wt.jsx)("p",{className:"muted",children:"Loading\u2026"}),c.phase==="plugin-error"&&(0,Wt.jsxs)("p",{className:"error",children:["Plugin ",e," failed to load: ",c.error]}),c.phase==="showing"&&g.length===0&&(0,Wt.jsx)("p",{className:"muted",children:_?`No archived ${e} documents.`:`No ${e} documents yet.`}),c.phase==="showing"&&v.map(x=>(0,Wt.jsx)(aE,{entry:x,selected:x.key===t,now:m},x.key))]})]})}var Ho=P(ye(),1);var Ha=P(W(),1);function Uh({name:e}){let[t,a]=(0,Ho.useState)({phase:"loading"}),[r,i]=(0,Ho.useState)(!1),s=(0,Ho.useCallback)(()=>{nt.skill(e).then(l=>a({phase:"showing",skill:l}),()=>a({phase:"missing"}))},[e]);if((0,Ho.useEffect)(()=>{a({phase:"loading"}),i(!1),s()},[s]),t.phase==="loading")return(0,Ha.jsx)("div",{className:"pane-placeholder",children:"Loading\u2026"});if(t.phase==="missing")return(0,Ha.jsxs)("div",{className:"pane-placeholder",children:["No skill is named ",e,"."]});let{skill:o}=t;return(0,Ha.jsxs)("section",{className:"document-detail-pane main-scroll","data-testid":"skill-view",children:[(0,Ha.jsxs)("div",{className:"document-header",children:[(0,Ha.jsxs)("div",{className:"header-key",children:["SKILL.md \xB7 ",o.scope," scope"]}),(0,Ha.jsx)("h1",{className:"header-title",children:o.name}),(0,Ha.jsxs)("div",{className:"header-meta",children:[(0,Ha.jsx)("span",{className:"muted",children:o.description}),!r&&(0,Ha.jsxs)("button",{className:"quiet",onClick:()=>i(!0),title:"Edit the SKILL.md; the diff goes to the agent with your next message","data-testid":"edit-button",children:[(0,Ha.jsx)(Ei,{}),"edit"]})]})]}),r?(0,Ha.jsx)(Nh,{target:{level:"skill",name:e},load:()=>nt.skillFile(e),onSave:(l,n,u)=>nt.editSkillFile(e,{version:u,text:l,since:n}),note:"Run adoc skill update so that the agents get the new skill.",onClose:()=>{i(!1),s()}}):(0,Ha.jsx)(Ph,{subject:{level:"skill",name:e},html:o.html})]})}var Ni=P(W(),1);function Fh({view:e}){let{pluginKey:t,documentKey:a}=Cs(),r=Ba()?.plugins.find(d=>d.key===t)?.skill,[i,s]=eh("adoc.list-pinned"),o=!!a||e==="skill",l=o&&!i,[n,u]=(0,Us.useState)(!1);(0,Us.useEffect)(()=>{let d=()=>u(!0);return window.addEventListener("adoc:hold-list",d),()=>window.removeEventListener("adoc:hold-list",d)},[]),(0,Us.useEffect)(()=>{if(!n)return;let d=f=>{f.target?.closest?.(".plugin-tab-bar, .document-list-pane")||u(!1)};return window.addEventListener("pointermove",d),()=>window.removeEventListener("pointermove",d)},[n]);let c=(0,Us.useRef)(null);return(0,Us.useEffect)(()=>{let d=c.current,f=d?.closest(".shell-column");if(!d||!f)return;let h=new ResizeObserver(()=>f.style.setProperty("--adoc-main-inset",`${d.offsetWidth}px`));return h.observe(d),()=>{h.disconnect(),f.style.removeProperty("--adoc-main-inset")}},[]),(0,Ni.jsxs)("div",{className:`plugin-route${l?" list-unpinned":""}`,children:[(0,Ni.jsx)("div",{className:"document-list-slot",ref:c,children:(0,Ni.jsx)(nE,{pluginKey:t,selected:a,pinned:i,onPin:o?s:void 0,unpinned:l,held:n,openTop:!o})}),e==="skill"?r?(0,Ni.jsx)(Uh,{name:r}):(0,Ni.jsxs)("div",{className:"pane-placeholder",children:[t," has no agent skill."]}):a?(0,Ni.jsx)(ZI,{documentKey:a},a):(0,Ni.jsx)("div",{className:"pane-placeholder",children:"Choose a document."})]})}var qh=P(ye(),1);var za=P(W(),1);function uE(){let e=Ba(),[t,a]=(0,qh.useState)([]);return(0,qh.useEffect)(()=>{nt.skills().then(r=>a(r.skills.filter(i=>!i.pluginKey)),()=>a([]))},[]),e?(0,za.jsxs)("div",{className:"workspace-home main-scroll","data-testid":"workspace-home",children:[(0,za.jsx)("h1",{children:e.name}),(0,za.jsx)("p",{className:"root",children:e.root}),t.length>0&&(0,za.jsx)("p",{className:"home-skills",children:t.map(r=>(0,za.jsxs)(_r,{className:"skill-link",to:`/skills/${r.name}`,title:r.description,children:[r.name," SKILL.md"]},r.name))}),(0,za.jsx)("div",{className:"plugin-cards",children:e.plugins.map(r=>(0,za.jsxs)(_r,{to:`/p/${r.key}`,className:`plugin-card adoc-block${r.error?" failed":""}`,children:[(0,za.jsx)("div",{className:"plugin-card-key",children:r.key}),(0,za.jsxs)("div",{className:"plugin-card-count",children:[r.documents," documents"]}),(0,za.jsx)("div",{className:"plugin-card-description",children:r.error?`Failed to load: ${r.error}`:r.description}),r.layout&&(0,za.jsx)("div",{className:"muted small mono",children:r.layout})]},r.key))})]}):(0,za.jsx)("div",{className:"pane-placeholder",children:"Loading\u2026"})}var Lc=P(W(),1);function VP(){return(0,Lc.jsx)(Uh,{name:Cs().skillName})}var dE=B_([{path:"/",Component:zI,children:[{index:!0,Component:uE},{path:"p/:pluginKey",Component:Fh},{path:"p/:pluginKey/skill",element:(0,Lc.jsx)(Fh,{view:"skill"})},{path:"p/:pluginKey/:documentKey",Component:Fh},{path:"skills/:skillName",Component:VP}]}]),$P=e=>{dE.navigate(e)};(0,cE.createRoot)(document.getElementById("root")).render((0,Lc.jsx)(Sw,{onNavigate:$P,children:(0,Lc.jsx)(w_,{router:dE})}));
52
+ /*! Bundled license information:
53
+
54
+ scheduler/cjs/scheduler.production.js:
55
+ (**
56
+ * @license React
57
+ * scheduler.production.js
58
+ *
59
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
60
+ *
61
+ * This source code is licensed under the MIT license found in the
62
+ * LICENSE file in the root directory of this source tree.
63
+ *)
64
+
65
+ react/cjs/react.production.js:
66
+ (**
67
+ * @license React
68
+ * react.production.js
69
+ *
70
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
71
+ *
72
+ * This source code is licensed under the MIT license found in the
73
+ * LICENSE file in the root directory of this source tree.
74
+ *)
75
+
76
+ react-dom/cjs/react-dom.production.js:
77
+ (**
78
+ * @license React
79
+ * react-dom.production.js
80
+ *
81
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
82
+ *
83
+ * This source code is licensed under the MIT license found in the
84
+ * LICENSE file in the root directory of this source tree.
85
+ *)
86
+
87
+ react-dom/cjs/react-dom-client.production.js:
88
+ (**
89
+ * @license React
90
+ * react-dom-client.production.js
91
+ *
92
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
93
+ *
94
+ * This source code is licensed under the MIT license found in the
95
+ * LICENSE file in the root directory of this source tree.
96
+ *)
97
+
98
+ react/cjs/react-jsx-runtime.production.js:
99
+ (**
100
+ * @license React
101
+ * react-jsx-runtime.production.js
102
+ *
103
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
104
+ *
105
+ * This source code is licensed under the MIT license found in the
106
+ * LICENSE file in the root directory of this source tree.
107
+ *)
108
+
109
+ react-router/dist/production/lib/router/url.js:
110
+ react-router/dist/production/lib/router/history.js:
111
+ react-router/dist/production/lib/router/utils.js:
112
+ react-router/dist/production/lib/router/instrumentation.js:
113
+ react-router/dist/production/lib/router/matcher.js:
114
+ react-router/dist/production/lib/router/matcher-route-pattern.preload.js:
115
+ react-router/dist/production/lib/router/navigation.js:
116
+ react-router/dist/production/lib/router/router.js:
117
+ react-router/dist/production/lib/context.js:
118
+ react-router/dist/production/lib/errors.js:
119
+ react-router/dist/production/lib/hooks.js:
120
+ react-router/dist/production/lib/server-runtime/warnings.js:
121
+ react-router/dist/production/lib/components.js:
122
+ react-router/dist/production/lib/dom/dom.js:
123
+ react-router/dist/production/lib/dom/ssr/invariant.js:
124
+ react-router/dist/production/lib/dom/ssr/markup.js:
125
+ react-router/dist/production/lib/dom/ssr/single-fetch.js:
126
+ react-router/dist/production/lib/dom/ssr/routeModules.js:
127
+ react-router/dist/production/lib/dom/ssr/links.js:
128
+ react-router/dist/production/lib/dom/ssr/components.js:
129
+ react-router/dist/production/lib/dom/lib.js:
130
+ react-router/dist/production/index.js:
131
+ (**
132
+ * react-router v8.4.0
133
+ *
134
+ * Copyright (c) Remix Software Inc.
135
+ *
136
+ * This source code is licensed under the MIT license found in the
137
+ * LICENSE.md file in the root directory of this source tree.
138
+ *
139
+ * @license MIT
140
+ *)
141
+
142
+ lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs:
143
+ lucide-react/dist/esm/shared/src/utils/toLucideIconData.mjs:
144
+ lucide-react/dist/esm/shared/src/utils/toCamelCase.mjs:
145
+ lucide-react/dist/esm/shared/src/utils/toPascalCase.mjs:
146
+ lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs:
147
+ lucide-react/dist/esm/shared/src/build/defaultAttributes.mjs:
148
+ lucide-react/dist/esm/shared/src/build/buildLucideIconNode.mjs:
149
+ lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.mjs:
150
+ lucide-react/dist/esm/shared/src/utils/hasA11yProp.mjs:
151
+ lucide-react/dist/esm/context.mjs:
152
+ lucide-react/dist/esm/Icon.mjs:
153
+ lucide-react/dist/esm/createLucideIcon.mjs:
154
+ lucide-react/dist/esm/icons/archive-restore.mjs:
155
+ lucide-react/dist/esm/icons/archive.mjs:
156
+ lucide-react/dist/esm/icons/arrow-left-right.mjs:
157
+ lucide-react/dist/esm/icons/bot.mjs:
158
+ lucide-react/dist/esm/icons/chevron-right.mjs:
159
+ lucide-react/dist/esm/icons/chevron-left.mjs:
160
+ lucide-react/dist/esm/icons/circle.mjs:
161
+ lucide-react/dist/esm/icons/eye.mjs:
162
+ lucide-react/dist/esm/icons/git-branch.mjs:
163
+ lucide-react/dist/esm/icons/git-compare.mjs:
164
+ lucide-react/dist/esm/icons/inbox.mjs:
165
+ lucide-react/dist/esm/icons/keyboard.mjs:
166
+ lucide-react/dist/esm/icons/message-square-plus.mjs:
167
+ lucide-react/dist/esm/icons/message-square.mjs:
168
+ lucide-react/dist/esm/icons/monitor.mjs:
169
+ lucide-react/dist/esm/icons/moon.mjs:
170
+ lucide-react/dist/esm/icons/pencil.mjs:
171
+ lucide-react/dist/esm/icons/pin.mjs:
172
+ lucide-react/dist/esm/icons/pin-off.mjs:
173
+ lucide-react/dist/esm/icons/save.mjs:
174
+ lucide-react/dist/esm/icons/send-horizontal.mjs:
175
+ lucide-react/dist/esm/icons/square-terminal.mjs:
176
+ lucide-react/dist/esm/icons/sun.mjs:
177
+ lucide-react/dist/esm/icons/triangle-alert.mjs:
178
+ lucide-react/dist/esm/icons/x.mjs:
179
+ lucide-react/dist/esm/lucide-react.mjs:
180
+ (**
181
+ * @license lucide-react v1.50.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ *)
186
+
187
+ @xterm/addon-fit/lib/addon-fit.mjs:
188
+ @xterm/xterm/lib/xterm.mjs:
189
+ (**
190
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
191
+ * @license MIT
192
+ *
193
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
194
+ * @license MIT
195
+ *
196
+ * Originally forked from (with the author's permission):
197
+ * Fabrice Bellard's javascript vt100 for jslinux:
198
+ * http://bellard.org/jslinux/
199
+ * Copyright (c) 2011 Fabrice Bellard
200
+ *)
201
+ */