@perses-dev/logs-table-plugin 0.3.0 → 0.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/__mf/js/{LogsTable.f8cdc769.js → LogsTable.5f90fc7a.js} +3 -3
  2. package/__mf/js/async/10.bcca0993.js +1 -0
  3. package/__mf/js/async/121.0b393209.js +2 -0
  4. package/__mf/js/async/141.32e969e2.js +1 -0
  5. package/__mf/js/async/192.fc13839d.js +1 -0
  6. package/__mf/js/async/2.9fe1a207.js +1 -0
  7. package/__mf/js/async/205.68d26c79.js +1 -0
  8. package/__mf/js/async/235.b7fd9fbd.js +1 -0
  9. package/__mf/js/async/274.2b0ee3e5.js +2 -0
  10. package/__mf/js/async/356.2f0b1efb.js +1 -0
  11. package/__mf/js/async/358.d7e737b5.js +111 -0
  12. package/__mf/js/async/392.ed78da9c.js +2 -0
  13. package/__mf/js/async/413.22923ee3.js +1 -0
  14. package/__mf/js/async/432.481e486b.js +1 -0
  15. package/__mf/js/async/458.84b877ba.js +1 -0
  16. package/__mf/js/async/470.3af71569.js +2 -0
  17. package/__mf/js/async/522.0ab2b630.js +1 -0
  18. package/__mf/js/async/587.7956e241.js +1 -0
  19. package/__mf/js/async/597.a6830f1c.js +2 -0
  20. package/__mf/js/async/608.79199272.js +1 -0
  21. package/__mf/js/async/612.265f875c.js +3 -0
  22. package/__mf/js/async/616.04a2fde6.js +1 -0
  23. package/__mf/js/async/634.f0773d52.js +2 -0
  24. package/__mf/js/async/663.0b1c854a.js +1 -0
  25. package/__mf/js/async/705.d5f9313a.js +22 -0
  26. package/__mf/js/async/72.be3fbcf8.js +7 -0
  27. package/__mf/js/async/72.be3fbcf8.js.LICENSE.txt +102 -0
  28. package/__mf/js/async/77.8b8e4afd.js +1 -0
  29. package/__mf/js/async/802.f980a2b2.js +1 -0
  30. package/__mf/js/async/923.60207cc2.js +1 -0
  31. package/__mf/js/async/941.1064117a.js +2 -0
  32. package/__mf/js/async/968.21668c0c.js +1 -0
  33. package/__mf/js/async/985.5af87994.js +37 -0
  34. package/__mf/js/async/__federation_expose_LogsTable.c8f94043.js +1 -0
  35. package/__mf/js/async/lib-router.edb1af73.js +2 -0
  36. package/__mf/js/{main.4253925a.js → main.e5de84d3.js} +3 -3
  37. package/lib/LogsTable.d.ts +2 -2
  38. package/lib/LogsTable.d.ts.map +1 -1
  39. package/lib/LogsTable.js +5 -5
  40. package/lib/LogsTable.js.map +1 -1
  41. package/lib/LogsTableComponent.d.ts +2 -2
  42. package/lib/LogsTableComponent.d.ts.map +1 -1
  43. package/lib/LogsTableComponent.js +4 -4
  44. package/lib/LogsTableComponent.js.map +1 -1
  45. package/lib/LogsTableCsvExportAction.d.ts +2 -2
  46. package/lib/LogsTableCsvExportAction.d.ts.map +1 -1
  47. package/lib/LogsTableCsvExportAction.js +7 -7
  48. package/lib/LogsTableCsvExportAction.js.map +1 -1
  49. package/lib/LogsTableExportAction.d.ts +1 -1
  50. package/lib/LogsTableExportAction.d.ts.map +1 -1
  51. package/lib/LogsTableExportAction.js +5 -5
  52. package/lib/LogsTableExportAction.js.map +1 -1
  53. package/lib/LogsTableItemSelectionActionsEditor.d.ts +2 -2
  54. package/lib/LogsTableItemSelectionActionsEditor.d.ts.map +1 -1
  55. package/lib/LogsTableItemSelectionActionsEditor.js +2 -2
  56. package/lib/LogsTableItemSelectionActionsEditor.js.map +1 -1
  57. package/lib/LogsTablePanel.d.ts +2 -2
  58. package/lib/LogsTablePanel.d.ts.map +1 -1
  59. package/lib/LogsTablePanel.js +3 -3
  60. package/lib/LogsTablePanel.js.map +1 -1
  61. package/lib/LogsTableSettingsEditor.d.ts +3 -3
  62. package/lib/LogsTableSettingsEditor.d.ts.map +1 -1
  63. package/lib/LogsTableSettingsEditor.js +3 -3
  64. package/lib/LogsTableSettingsEditor.js.map +1 -1
  65. package/lib/bootstrap.js +2 -2
  66. package/lib/components/EmptyLogsState.d.ts.map +1 -1
  67. package/lib/components/EmptyLogsState.js +2 -2
  68. package/lib/components/EmptyLogsState.js.map +1 -1
  69. package/lib/components/LogRow/LogDetailsTable.d.ts +2 -2
  70. package/lib/components/LogRow/LogDetailsTable.d.ts.map +1 -1
  71. package/lib/components/LogRow/LogDetailsTable.js +4 -4
  72. package/lib/components/LogRow/LogDetailsTable.js.map +1 -1
  73. package/lib/components/LogRow/LogRow.d.ts +3 -2
  74. package/lib/components/LogRow/LogRow.d.ts.map +1 -1
  75. package/lib/components/LogRow/LogRow.js +15 -15
  76. package/lib/components/LogRow/LogRow.js.map +1 -1
  77. package/lib/components/LogRow/LogTimestamp.js +1 -1
  78. package/lib/components/LogRow/LogsStyles.d.ts.map +1 -1
  79. package/lib/components/LogRow/LogsStyles.js +2 -2
  80. package/lib/components/LogRow/LogsStyles.js.map +1 -1
  81. package/lib/components/LogRow/index.js +2 -2
  82. package/lib/components/LogRow/index.js.map +1 -1
  83. package/lib/components/LogsList.d.ts +2 -2
  84. package/lib/components/LogsList.d.ts.map +1 -1
  85. package/lib/components/LogsList.js +5 -5
  86. package/lib/components/LogsList.js.map +1 -1
  87. package/lib/components/VirtualizedLogsList.d.ts +2 -2
  88. package/lib/components/VirtualizedLogsList.d.ts.map +1 -1
  89. package/lib/components/VirtualizedLogsList.js +18 -13
  90. package/lib/components/VirtualizedLogsList.js.map +1 -1
  91. package/lib/components/hooks/useExpandedRows.js +1 -1
  92. package/lib/components/hooks/useSeverity.d.ts +1 -1
  93. package/lib/components/hooks/useSeverity.d.ts.map +1 -1
  94. package/lib/components/hooks/useSeverity.js +2 -2
  95. package/lib/components/hooks/useSeverity.js.map +1 -1
  96. package/lib/components/utils.d.ts +1 -1
  97. package/lib/components/utils.d.ts.map +1 -1
  98. package/lib/components/utils.js.map +1 -1
  99. package/lib/getPluginModule.d.ts +1 -1
  100. package/lib/getPluginModule.d.ts.map +1 -1
  101. package/lib/getPluginModule.js +3 -1
  102. package/lib/getPluginModule.js.map +1 -1
  103. package/lib/index-federation.js +1 -1
  104. package/lib/index.js +3 -3
  105. package/lib/index.js.map +1 -1
  106. package/lib/model.d.ts +3 -3
  107. package/lib/model.d.ts.map +1 -1
  108. package/lib/model.js.map +1 -1
  109. package/lib/setup-tests.d.ts +1 -1
  110. package/lib/setup-tests.d.ts.map +1 -1
  111. package/lib/setup-tests.js +2 -2
  112. package/lib/setup-tests.js.map +1 -1
  113. package/lib/test/mock-query-results.d.ts +1 -1
  114. package/lib/test/mock-query-results.d.ts.map +1 -1
  115. package/lib/test/mock-query-results.js.map +1 -1
  116. package/lib/utils/ansi.js +2 -2
  117. package/lib/utils/copyHelpers.d.ts +1 -1
  118. package/lib/utils/copyHelpers.d.ts.map +1 -1
  119. package/lib/utils/copyHelpers.js +1 -1
  120. package/lib/utils/copyHelpers.js.map +1 -1
  121. package/mf-manifest.json +43 -86
  122. package/mf-stats.json +43 -94
  123. package/package.json +11 -11
  124. package/__mf/js/async/1603.89bfb1ad.js +0 -2
  125. package/__mf/js/async/1616.c3be409a.js +0 -1
  126. package/__mf/js/async/2043.dba84aa4.js +0 -2
  127. package/__mf/js/async/2043.dba84aa4.js.LICENSE.txt +0 -24
  128. package/__mf/js/async/2546.6b3aab40.js +0 -3
  129. package/__mf/js/async/2842.610cb74b.js +0 -1
  130. package/__mf/js/async/304.21c30c64.js +0 -37
  131. package/__mf/js/async/3332.ab0338e8.js +0 -7
  132. package/__mf/js/async/3332.ab0338e8.js.LICENSE.txt +0 -39
  133. package/__mf/js/async/392.5cb44640.js +0 -2
  134. package/__mf/js/async/4077.32e3919d.js +0 -1
  135. package/__mf/js/async/4121.d4c9b3e3.js +0 -2
  136. package/__mf/js/async/4869.80345aa7.js +0 -1
  137. package/__mf/js/async/5002.1d6e3559.js +0 -1
  138. package/__mf/js/async/5071.be3352f1.js +0 -1
  139. package/__mf/js/async/5587.9e49a823.js +0 -1
  140. package/__mf/js/async/6274.fe68ed99.js +0 -2
  141. package/__mf/js/async/6458.de33906b.js +0 -1
  142. package/__mf/js/async/7177.8dd90707.js +0 -1
  143. package/__mf/js/async/7192.017cbe40.js +0 -1
  144. package/__mf/js/async/7250.05494519.js +0 -1
  145. package/__mf/js/async/7413.c2661694.js +0 -1
  146. package/__mf/js/async/7445.009cf084.js +0 -110
  147. package/__mf/js/async/7968.ec249f6f.js +0 -1
  148. package/__mf/js/async/7978.026a8b19.js +0 -1
  149. package/__mf/js/async/8356.f736e620.js +0 -1
  150. package/__mf/js/async/8470.f0bbed7d.js +0 -2
  151. package/__mf/js/async/8542.aa0c5fe3.js +0 -1
  152. package/__mf/js/async/8608.618e49dc.js +0 -1
  153. package/__mf/js/async/8634.231e1601.js +0 -2
  154. package/__mf/js/async/873.4fd8a061.js +0 -1
  155. package/__mf/js/async/8964.3e308de6.js +0 -2
  156. package/__mf/js/async/8964.3e308de6.js.LICENSE.txt +0 -37
  157. package/__mf/js/async/9126.a313fc37.js +0 -22
  158. package/__mf/js/async/9235.b68f4586.js +0 -1
  159. package/__mf/js/async/9293.ee3265d4.js +0 -2
  160. package/__mf/js/async/941.ad1062bb.js +0 -2
  161. package/__mf/js/async/9588.b214b983.js +0 -1
  162. package/__mf/js/async/__federation_expose_LogsTable.e6a243de.js +0 -1
  163. package/__mf/js/async/lib-router.c5e3aef3.js +0 -2
  164. package/lib/cjs/LogsTable.js +0 -58
  165. package/lib/cjs/LogsTableComponent.js +0 -47
  166. package/lib/cjs/LogsTableCsvExportAction.js +0 -124
  167. package/lib/cjs/LogsTableExportAction.js +0 -80
  168. package/lib/cjs/LogsTableItemSelectionActionsEditor.js +0 -44
  169. package/lib/cjs/LogsTablePanel.js +0 -42
  170. package/lib/cjs/LogsTableSettingsEditor.js +0 -57
  171. package/lib/cjs/bootstrap.js +0 -26
  172. package/lib/cjs/components/EmptyLogsState.js +0 -49
  173. package/lib/cjs/components/LogRow/LogDetailsTable.js +0 -126
  174. package/lib/cjs/components/LogRow/LogRow.js +0 -421
  175. package/lib/cjs/components/LogRow/LogTimestamp.js +0 -44
  176. package/lib/cjs/components/LogRow/LogsStyles.js +0 -87
  177. package/lib/cjs/components/LogRow/index.js +0 -37
  178. package/lib/cjs/components/LogsList.js +0 -44
  179. package/lib/cjs/components/VirtualizedLogsList.js +0 -547
  180. package/lib/cjs/components/hooks/useExpandedRows.js +0 -45
  181. package/lib/cjs/components/hooks/useSeverity.js +0 -47
  182. package/lib/cjs/components/utils.js +0 -78
  183. package/lib/cjs/env.d.js +0 -14
  184. package/lib/cjs/getPluginModule.js +0 -39
  185. package/lib/cjs/index-federation.js +0 -55
  186. package/lib/cjs/index.js +0 -38
  187. package/lib/cjs/model.js +0 -16
  188. package/lib/cjs/setup-tests.js +0 -19
  189. package/lib/cjs/test/mock-query-results.js +0 -133
  190. package/lib/cjs/utils/ansi.js +0 -60
  191. package/lib/cjs/utils/copyHelpers.js +0 -72
  192. /package/__mf/css/async/{3332.85c2cbf6.css → 72.85c2cbf6.css} +0 -0
  193. /package/__mf/js/async/{4121.d4c9b3e3.js.LICENSE.txt → 121.0b393209.js.LICENSE.txt} +0 -0
  194. /package/__mf/js/async/{6274.fe68ed99.js.LICENSE.txt → 274.2b0ee3e5.js.LICENSE.txt} +0 -0
  195. /package/__mf/js/async/{7445.009cf084.js.LICENSE.txt → 358.d7e737b5.js.LICENSE.txt} +0 -0
  196. /package/__mf/js/async/{392.5cb44640.js.LICENSE.txt → 392.ed78da9c.js.LICENSE.txt} +0 -0
  197. /package/__mf/js/async/{8470.f0bbed7d.js.LICENSE.txt → 470.3af71569.js.LICENSE.txt} +0 -0
  198. /package/__mf/js/async/{1603.89bfb1ad.js.LICENSE.txt → 597.a6830f1c.js.LICENSE.txt} +0 -0
  199. /package/__mf/js/async/{8634.231e1601.js.LICENSE.txt → 634.f0773d52.js.LICENSE.txt} +0 -0
  200. /package/__mf/js/async/{9126.a313fc37.js.LICENSE.txt → 705.d5f9313a.js.LICENSE.txt} +0 -0
  201. /package/__mf/js/async/{941.ad1062bb.js.LICENSE.txt → 941.1064117a.js.LICENSE.txt} +0 -0
  202. /package/__mf/js/async/{lib-router.c5e3aef3.js.LICENSE.txt → lib-router.edb1af73.js.LICENSE.txt} +0 -0
@@ -0,0 +1,7 @@
1
+ /*! For license information please see 72.be3fbcf8.js.LICENSE.txt */
2
+ (self.chunk_LogsTable_0_4_0_beta_1=self.chunk_LogsTable_0_4_0_beta_1||[]).push([["72"],{70158(e,t,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.bindAll=void 0;var r=n(96844);function o(e){if(void 0!==e)return"boolean"==typeof e?{capture:e}:e}t.bindAll=function(e,t,n){var a=t.map(function(t){var a=null==n?t:i(i({},t),{options:i(i({},o(n)),o(t.options))});return(0,r.bind)(e,a)});return function(){a.forEach(function(e){return e()})}}},96844(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bind=void 0,t.bind=function(e,t){var n=t.type,i=t.listener,r=t.options;return e.addEventListener(n,i,r),function(){e.removeEventListener(n,i,r)}}},96907(e,t,n){"use strict";t.bindAll=t.bind=void 0;var i=n(96844);Object.defineProperty(t,"bind",{enumerable:!0,get:function(){return i.bind}});var r=n(70158);Object.defineProperty(t,"bindAll",{enumerable:!0,get:function(){return r.bindAll}})},1416(e,t,n){e.exports=n(99138)(n(41433),"DataView")},9073(e,t,n){var i=n(82316),r=n(76458),o=n(2149),a=n(44297),s=n(33121);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}l.prototype.clear=i,l.prototype.delete=r,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},72707(e,t,n){var i=n(39714),r=n(33812),o=n(14727),a=n(8379),s=n(8291);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}l.prototype.clear=i,l.prototype.delete=r,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},91955(e,t,n){e.exports=n(99138)(n(41433),"Map")},90369(e,t,n){var i=n(72092),r=n(49626),o=n(79925),a=n(26809),s=n(94385);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}l.prototype.clear=i,l.prototype.delete=r,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},42616(e,t,n){e.exports=n(99138)(n(41433),"Promise")},60157(e,t,n){e.exports=n(99138)(n(41433),"Set")},61527(e,t,n){var i=n(90369),r=n(79912),o=n(23767);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new i;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=o,e.exports=a},86469(e,t,n){var i=n(72707),r=n(71848),o=n(17406),a=n(58569),s=n(43109),l=n(73389);function u(e){var t=this.__data__=new i(e);this.size=t.size}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=s,u.prototype.set=l,e.exports=u},32781(e,t,n){e.exports=n(41433).Symbol},28944(e,t,n){e.exports=n(41433).Uint8Array},78499(e,t,n){e.exports=n(99138)(n(41433),"WeakMap")},96701(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},61414(e){e.exports=function(e,t){for(var n=-1,i=null==e?0:e.length,r=0,o=[];++n<i;){var a=e[n];t(a,n,e)&&(o[r++]=a)}return o}},31163(e,t,n){var i=n(36204),r=n(21256),o=n(6397),a=n(30492),s=n(42845),l=n(47995),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&r(e),h=!n&&!c&&a(e),d=!n&&!c&&!h&&l(e),p=n||c||h||d,f=p?i(e.length,String):[],g=f.length;for(var m in e)(t||u.call(e,m))&&!(p&&("length"==m||h&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,g)))&&f.push(m);return f}},78740(e){e.exports=function(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}},57260(e){e.exports=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}},61617(e,t,n){var i=n(14772),r=n(39316);e.exports=function(e,t,n){(void 0===n||r(e[t],n))&&(void 0!==n||t in e)||i(e,t,n)}},82863(e,t,n){var i=n(14772),r=n(39316),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&r(a,n)&&(void 0!==n||t in e)||i(e,t,n)}},58301(e,t,n){var i=n(39316);e.exports=function(e,t){for(var n=e.length;n--;)if(i(e[n][0],t))return n;return -1}},14772(e,t,n){var i=n(18559);e.exports=function(e,t,n){"__proto__"==t&&i?i(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},23508(e,t,n){var i=n(58953),r=Object.create;e.exports=function(){function e(){}return function(t){if(!i(t))return{};if(r)return r(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}()},61469(e,t,n){e.exports=n(15409)()},74403(e,t,n){var i=n(78740),r=n(6397);e.exports=function(e,t,n){var o=t(e);return r(e)?o:i(o,n(e))}},87148(e,t,n){var i=n(32781),r=n(17903),o=n(71738),a=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?r(e):o(e)}},79250(e,t,n){var i=n(87148),r=n(22934);e.exports=function(e){return r(e)&&"[object Arguments]"==i(e)}},22122(e,t,n){var i=n(42032),r=n(22934);e.exports=function e(t,n,o,a,s){return t===n||(null!=t&&null!=n&&(r(t)||r(n))?i(t,n,o,a,e,s):t!=t&&n!=n)}},42032(e,t,n){var i=n(86469),r=n(44075),o=n(64622),a=n(62677),s=n(31201),l=n(6397),u=n(30492),c=n(47995),h="[object Arguments]",d="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,v){var y=l(e),x=l(t),b=y?d:s(e),w=x?d:s(t);b=b==h?p:b,w=w==h?p:w;var S=b==p,_=w==p,M=b==w;if(M&&u(e)){if(!u(t))return!1;y=!0,S=!1}if(M&&!S)return v||(v=new i),y||c(e)?r(e,t,n,g,m,v):o(e,t,b,n,g,m,v);if(!(1&n)){var C=S&&f.call(e,"__wrapped__"),A=_&&f.call(t,"__wrapped__");if(C||A){var k=C?e.value():e,T=A?t.value():t;return v||(v=new i),m(k,T,n,g,v)}}return!!M&&(v||(v=new i),a(e,t,n,g,m,v))}},16567(e,t,n){var i=n(18446),r=n(18092),o=n(58953),a=n(81485),s=/^\[object .+?Constructor\]$/,l=Object.prototype,u=Function.prototype.toString,c=l.hasOwnProperty,h=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||r(e))&&(i(e)?h:s).test(a(e))}},97129(e,t,n){var i=n(87148),r=n(3330),o=n(22934),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&r(e.length)&&!!a[i(e)]}},81452(e,t,n){var i=n(67499),r=n(9566),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!i(e))return r(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},41491(e,t,n){var i=n(58953),r=n(67499),o=n(68201),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!i(e))return o(e);var t=r(e),n=[];for(var s in e)"constructor"==s&&(t||!a.call(e,s))||n.push(s);return n}},99702(e,t,n){var i=n(86469),r=n(61617),o=n(61469),a=n(80708),s=n(58953),l=n(15405),u=n(29874);e.exports=function e(t,n,c,h,d){t!==n&&o(n,function(o,l){if(d||(d=new i),s(o))a(t,n,l,c,e,h,d);else{var p=h?h(u(t,l),o,l+"",t,n,d):void 0;void 0===p&&(p=o),r(t,l,p)}},l)}},80708(e,t,n){var i=n(61617),r=n(87030),o=n(76733),a=n(68835),s=n(19181),l=n(21256),u=n(6397),c=n(75569),h=n(30492),d=n(18446),p=n(58953),f=n(54679),g=n(47995),m=n(29874),v=n(47264);e.exports=function(e,t,n,y,x,b,w){var S=m(e,n),_=m(t,n),M=w.get(_);if(M)return void i(e,n,M);var C=b?b(S,_,n+"",e,t,w):void 0,A=void 0===C;if(A){var k=u(_),T=!k&&h(_),D=!k&&!T&&g(_);C=_,k||T||D?u(S)?C=S:c(S)?C=a(S):T?(A=!1,C=r(_,!0)):D?(A=!1,C=o(_,!0)):C=[]:f(_)||l(_)?(C=S,l(S)?C=v(S):(!p(S)||d(S))&&(C=s(_))):A=!1}A&&(w.set(_,C),x(C,_,y,b,w),w.delete(_)),i(e,n,C)}},71506(e,t,n){var i=n(74796),r=n(25265),o=n(26805);e.exports=function(e,t){return o(r(e,t,i),e+"")}},7310(e,t,n){var i=n(53122),r=n(18559),o=n(74796);e.exports=r?function(e,t){return r(e,"toString",{configurable:!0,enumerable:!1,value:i(t),writable:!0})}:o},36204(e){e.exports=function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}},68812(e,t,n){var i=n(62140),r=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(r,""):e}},30041(e){e.exports=function(e){return function(t){return e(t)}}},79151(e){e.exports=function(e,t){return e.has(t)}},57177(e,t,n){var i=n(28944);e.exports=function(e){var t=new e.constructor(e.byteLength);return new i(t).set(new i(e)),t}},87030(e,t,n){e=n.nmd(e);var i=n(41433),r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,a=o&&o.exports===r?i.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,i=s?s(n):new e.constructor(n);return e.copy(i),i}},76733(e,t,n){var i=n(57177);e.exports=function(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},68835(e){e.exports=function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}},42083(e,t,n){var i=n(82863),r=n(14772);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var u=t[s],c=o?o(n[u],e[u],u,n,e):void 0;void 0===c&&(c=e[u]),a?r(n,u,c):i(n,u,c)}return n}},38109(e,t,n){e.exports=n(41433)["__core-js_shared__"]},54171(e,t,n){var i=n(71506),r=n(66220);e.exports=function(e){return i(function(t,n){var i=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&r(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++i<o;){var l=n[i];l&&e(t,l,i,a)}return t})}},15409(e){e.exports=function(e){return function(t,n,i){for(var r=-1,o=Object(t),a=i(t),s=a.length;s--;){var l=a[e?s:++r];if(!1===n(o[l],l,o))break}return t}}},18559(e,t,n){var i=n(99138);e.exports=function(){try{var e=i(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},44075(e,t,n){var i=n(61527),r=n(57260),o=n(79151);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,h=t.length;if(c!=h&&!(u&&h>c))return!1;var d=l.get(e),p=l.get(t);if(d&&p)return d==t&&p==e;var f=-1,g=!0,m=2&n?new i:void 0;for(l.set(e,t),l.set(t,e);++f<c;){var v=e[f],y=t[f];if(a)var x=u?a(y,v,f,t,e,l):a(v,y,f,e,t,l);if(void 0!==x){if(x)continue;g=!1;break}if(m){if(!r(t,function(e,t){if(!o(m,t)&&(v===e||s(v,e,n,a,l)))return m.push(t)})){g=!1;break}}else if(!(v===y||s(v,y,n,a,l))){g=!1;break}}return l.delete(e),l.delete(t),g}},64622(e,t,n){var i=n(32781),r=n(28944),o=n(39316),a=n(44075),s=n(90953),l=n(15851),u=i?i.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,i,u,h,d){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!h(new r(e),new r(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var f=1&i;if(p||(p=l),e.size!=t.size&&!f)break;var g=d.get(e);if(g)return g==t;i|=2,d.set(e,t);var m=a(p(e),p(t),i,u,h,d);return d.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},62677(e,t,n){var i=n(90966),r=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,u=i(e),c=u.length;if(c!=i(t).length&&!l)return!1;for(var h=c;h--;){var d=u[h];if(!(l?d in t:r.call(t,d)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=l;++h<c;){var v=e[d=u[h]],y=t[d];if(o)var x=l?o(y,v,d,t,e,s):o(v,y,d,e,t,s);if(!(void 0===x?v===y||a(v,y,n,o,s):x)){g=!1;break}m||(m="constructor"==d)}if(g&&!m){var b=e.constructor,w=t.constructor;b!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(g=!1)}return s.delete(e),s.delete(t),g}},75380(e,t,n){e.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},90966(e,t,n){var i=n(74403),r=n(88876),o=n(31178);e.exports=function(e){return i(e,o,r)}},15535(e,t,n){var i=n(95662);e.exports=function(e,t){var n=e.__data__;return i(t)?n["string"==typeof t?"string":"hash"]:n.map}},99138(e,t,n){var i=n(16567),r=n(6772);e.exports=function(e,t){var n=r(e,t);return i(n)?n:void 0}},13347(e,t,n){e.exports=n(51019)(Object.getPrototypeOf,Object)},17903(e,t,n){var i=n(32781),r=Object.prototype,o=r.hasOwnProperty,a=r.toString,s=i?i.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var i=!0}catch(e){}var r=a.call(e);return i&&(t?e[s]=n:delete e[s]),r}},88876(e,t,n){var i=n(61414),r=n(53629),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;e.exports=a?function(e){return null==e?[]:i(a(e=Object(e)),function(t){return o.call(e,t)})}:r},31201(e,t,n){var i=n(1416),r=n(91955),o=n(42616),a=n(60157),s=n(78499),l=n(87148),u=n(81485),c="[object Map]",h="[object Promise]",d="[object Set]",p="[object WeakMap]",f="[object DataView]",g=u(i),m=u(r),v=u(o),y=u(a),x=u(s),b=l;(i&&b(new i(new ArrayBuffer(1)))!=f||r&&b(new r)!=c||o&&b(o.resolve())!=h||a&&b(new a)!=d||s&&b(new s)!=p)&&(b=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,i=n?u(n):"";if(i)switch(i){case g:return f;case m:return c;case v:return h;case y:return d;case x:return p}return t}),e.exports=b},6772(e){e.exports=function(e,t){return null==e?void 0:e[t]}},82316(e,t,n){var i=n(4558);e.exports=function(){this.__data__=i?i(null):{},this.size=0}},76458(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t}},2149(e,t,n){var i=n(4558),r=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(i){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return r.call(t,e)?t[e]:void 0}},44297(e,t,n){var i=n(4558),r=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return i?void 0!==t[e]:r.call(t,e)}},33121(e,t,n){var i=n(4558);e.exports=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=i&&void 0===t?"__lodash_hash_undefined__":t,this}},19181(e,t,n){var i=n(23508),r=n(13347),o=n(67499);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:i(r(e))}},42845(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var i=typeof e;return!!(n=null==n?0x1fffffffffffff:n)&&("number"==i||"symbol"!=i&&t.test(e))&&e>-1&&e%1==0&&e<n}},66220(e,t,n){var i=n(39316),r=n(18330),o=n(42845),a=n(58953);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return("number"==s?!!(r(n)&&o(t,n.length)):"string"==s&&t in n)&&i(n[t],e)}},95662(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},18092(e,t,n){var i,r=n(38109),o=(i=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";e.exports=function(e){return!!o&&o in e}},67499(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},39714(e){e.exports=function(){this.__data__=[],this.size=0}},33812(e,t,n){var i=n(58301),r=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=i(t,e);return!(n<0)&&(n==t.length-1?t.pop():r.call(t,n,1),--this.size,!0)}},14727(e,t,n){var i=n(58301);e.exports=function(e){var t=this.__data__,n=i(t,e);return n<0?void 0:t[n][1]}},8379(e,t,n){var i=n(58301);e.exports=function(e){return i(this.__data__,e)>-1}},8291(e,t,n){var i=n(58301);e.exports=function(e,t){var n=this.__data__,r=i(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}},72092(e,t,n){var i=n(9073),r=n(72707),o=n(91955);e.exports=function(){this.size=0,this.__data__={hash:new i,map:new(o||r),string:new i}}},49626(e,t,n){var i=n(15535);e.exports=function(e){var t=i(this,e).delete(e);return this.size-=!!t,t}},79925(e,t,n){var i=n(15535);e.exports=function(e){return i(this,e).get(e)}},26809(e,t,n){var i=n(15535);e.exports=function(e){return i(this,e).has(e)}},94385(e,t,n){var i=n(15535);e.exports=function(e,t){var n=i(this,e),r=n.size;return n.set(e,t),this.size+=+(n.size!=r),this}},90953(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}},4558(e,t,n){e.exports=n(99138)(Object,"create")},9566(e,t,n){e.exports=n(51019)(Object.keys,Object)},68201(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},23685(e,t,n){e=n.nmd(e);var i=n(75380),r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,a=o&&o.exports===r&&i.process,s=function(){try{var e=o&&o.require&&o.require("util").types;if(e)return e;return a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},71738(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},51019(e){e.exports=function(e,t){return function(n){return e(t(n))}}},25265(e,t,n){var i=n(96701),r=Math.max;e.exports=function(e,t,n){return t=r(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=r(o.length-t,0),l=Array(s);++a<s;)l[a]=o[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=o[a];return u[t]=n(l),i(e,this,u)}}},41433(e,t,n){var i=n(75380),r="object"==typeof self&&self&&self.Object===Object&&self;e.exports=i||r||Function("return this")()},29874(e){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},79912(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},23767(e){e.exports=function(e){return this.__data__.has(e)}},15851(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},26805(e,t,n){var i=n(7310);e.exports=n(23983)(i)},23983(e){var t=Date.now;e.exports=function(e){var n=0,i=0;return function(){var r=t(),o=16-(r-i);if(i=r,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},71848(e,t,n){var i=n(72707);e.exports=function(){this.__data__=new i,this.size=0}},17406(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},58569(e){e.exports=function(e){return this.__data__.get(e)}},43109(e){e.exports=function(e){return this.__data__.has(e)}},73389(e,t,n){var i=n(72707),r=n(91955),o=n(90369);e.exports=function(e,t){var n=this.__data__;if(n instanceof i){var a=n.__data__;if(!r||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},81485(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},62140(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},53122(e){e.exports=function(e){return function(){return e}}},46177(e,t,n){var i=n(58953),r=n(43664),o=n(95378),a=Math.max,s=Math.min;e.exports=function(e,t,n){var l,u,c,h,d,p,f=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=l,i=u;return l=u=void 0,f=t,h=e.apply(i,n)}function x(e){var n=e-p,i=e-f;return void 0===p||n>=t||n<0||m&&i>=c}function b(){var e,n,i,o=r();if(x(o))return w(o);d=setTimeout(b,(e=o-p,n=o-f,i=t-e,m?s(i,c-n):i))}function w(e){return(d=void 0,v&&l)?y(e):(l=u=void 0,h)}function S(){var e,n=r(),i=x(n);if(l=arguments,u=this,p=n,i){if(void 0===d)return f=e=p,d=setTimeout(b,t),g?y(e):h;if(m)return clearTimeout(d),d=setTimeout(b,t),y(p)}return void 0===d&&(d=setTimeout(b,t)),h}return t=o(t)||0,i(n)&&(g=!!n.leading,c=(m="maxWait"in n)?a(o(n.maxWait)||0,t):c,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==d&&clearTimeout(d),f=0,l=p=u=d=void 0},S.flush=function(){return void 0===d?h:w(r())},S}},39316(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},74796(e){e.exports=function(e){return e}},21256(e,t,n){var i=n(79250),r=n(22934),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable;e.exports=i(function(){return arguments}())?i:function(e){return r(e)&&a.call(e,"callee")&&!s.call(e,"callee")}},6397(e){e.exports=Array.isArray},18330(e,t,n){var i=n(18446),r=n(3330);e.exports=function(e){return null!=e&&r(e.length)&&!i(e)}},75569(e,t,n){var i=n(18330),r=n(22934);e.exports=function(e){return r(e)&&i(e)}},30492(e,t,n){e=n.nmd(e);var i=n(41433),r=n(80659),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?i.Buffer:void 0,l=s?s.isBuffer:void 0;e.exports=l||r},18264(e,t,n){var i=n(22122);e.exports=function(e,t){return i(e,t)}},18446(e,t,n){var i=n(87148),r=n(58953);e.exports=function(e){if(!r(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},3330(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}},58953(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},22934(e){e.exports=function(e){return null!=e&&"object"==typeof e}},54679(e,t,n){var i=n(87148),r=n(13347),o=n(22934),a=Object.prototype,s=Function.prototype.toString,l=a.hasOwnProperty,u=s.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=i(e))return!1;var t=r(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==u}},75414(e,t,n){var i=n(87148),r=n(22934);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==i(e)}},47995(e,t,n){var i=n(97129),r=n(30041),o=n(23685),a=o&&o.isTypedArray;e.exports=a?r(a):i},31178(e,t,n){var i=n(31163),r=n(81452),o=n(18330);e.exports=function(e){return o(e)?i(e):r(e)}},15405(e,t,n){var i=n(31163),r=n(41491),o=n(18330);e.exports=function(e){return o(e)?i(e,!0):r(e)}},25632(e,t,n){var i=n(99702);e.exports=n(54171)(function(e,t,n){i(e,t,n)})},43664(e,t,n){var i=n(41433);e.exports=function(){return i.Date.now()}},53629(e){e.exports=function(){return[]}},80659(e){e.exports=function(){return!1}},95378(e,t,n){var i=n(68812),r=n(58953),o=n(75414),a=0/0,s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return a;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var n=l.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):s.test(e)?a:+e}},47264(e,t,n){var i=n(42083),r=n(15405);e.exports=function(e){return i(e,r(e))}},24300(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z","Calendar")},29618(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z","Circle")},98029(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z","Delete")},53064(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z","Drag")},26684(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M17.9,17.39C17.64,16.59 16.89,16 16,16H15V13A1,1 0 0,0 14,12H8V10H10A1,1 0 0,0 11,9V7H13A2,2 0 0,0 15,5V4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15V16A2,2 0 0,0 11,18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z","Earth")},78536(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z","EyeOffOutline")},1355(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z","EyeOutline")},98599(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z","Magnify")},4491(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z","Pin")},16979(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M16.59,5.41L15.17,4L12,7.17L8.83,4L7.41,5.41L12,10M7.41,18.59L8.83,20L12,16.83L15.17,20L16.58,18.59L12,14L7.41,18.59Z","UnfoldLessHorizontal")},9323(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z","UnfoldMoreHorizontal")},12933(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M16,5V18H21V5M4,18H9V5H4M10,18H15V5H10V18Z","ViewColumn")},77440(e,t,n){!function(e,t){"use strict";var n=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(t);function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var r={error:null},o=function(e){function t(){for(var t,n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return(t=e.call.apply(e,[this].concat(i))||this).state=r,t.resetErrorBoundary=function(){for(var e,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];null==t.props.onReset||(e=t.props).onReset.apply(e,i),t.reset()},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var o=t.prototype;return o.reset=function(){this.setState(r)},o.componentDidCatch=function(e,t){var n,i;null==(n=(i=this.props).onError)||n.call(i,e,t)},o.componentDidUpdate=function(e,t){var n,i,r,o,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(void 0===(n=e.resetKeys)&&(n=[]),void 0===(i=s)&&(i=[]),n.length!==i.length||n.some(function(e,t){return!Object.is(e,i[t])}))&&(null==(r=(o=this.props).onResetKeysChange)||r.call(o,e.resetKeys,s),this.reset())},o.render=function(){var e=this.state.error,t=this.props,i=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(n.isValidElement(o))return o;if("function"==typeof i)return i(a);if(r)return n.createElement(r,a);else throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(n.Component);e.ErrorBoundary=o,e.useErrorHandler=function(e){var t=n.useState(null),i=t[0],r=t[1];if(null!=e)throw e;if(null!=i)throw i;return r},e.withErrorBoundary=function(e,t){var i=function(i){return n.createElement(o,t,n.createElement(e,i))};return i.displayName="withErrorBoundary("+(e.displayName||e.name||"Unknown")+")",i},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(70451))},23420(e){function t(){}t.prototype={on:function(e,t,n){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var i=this;function r(){i.off(e,r),t.apply(n,arguments)}return r._=t,this.on(e,r,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,r=n.length;i<r;i++)n[i].fn.apply(n[i].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),i=n[e],r=[];if(i&&t)for(var o=0,a=i.length;o<a;o++)i[o].fn!==t&&i[o].fn._!==t&&r.push(i[o]);return r.length?n[e]=r:delete n[e],this}},e.exports=t,e.exports.TinyEmitter=t},42915(e){"use strict";var t;t=function(){function e(){return!0}function t(){return!1}function n(){}return function i(){var r=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:function(e){return"object"==typeof e&&null!==e&&e.constructor===Object}},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],o={name:"any",test:e},a=[],s=[],l={types:r,conversions:s,ignore:a};function u(e){var t=N(l.types,function(t){return t.name===e});if(t)return t;if("any"===e)return o;var n=N(l.types,function(t){return t.name.toLowerCase()===e.toLowerCase()});throw TypeError('Unknown type "'+e+'"'+(n?'. Did you mean "'+n.name+'"?':""))}function c(e){return e===o?999:l.types.indexOf(e)}function h(e){var t=N(l.types,function(t){return t.test(e)});if(t)return t.name;throw TypeError("Value has unknown type. Value: "+e)}function d(e){return e.map(function(e){var t=e.types.map(y);return(e.restParam?"...":"")+t.join("|")}).join(",")}function p(e){var t=R(e);return!!t&&t.restParam}function f(e){return e.types.some(function(e){return null!=e.conversion})}function g(t){if(!t||0===t.types.length)return e;if(1===t.types.length)return u(t.types[0].name).test;if(2===t.types.length){var n=u(t.types[0].name).test,i=u(t.types[1].name).test;return function(e){return n(e)||i(e)}}var r=t.types.map(function(e){return u(e.name).test});return function(e){for(var t=0;t<r.length;t++)if(r[t](e))return!0;return!1}}function m(e,t){return t<e.params.length?e.params[t]:p(e.params)?R(e.params):null}function v(e,t,n){var i=m(e,t);return(i?n?i.types.filter(x):i.types:[]).map(y)}function y(e){return e.name}function x(e){return null===e.conversion||void 0===e.conversion}function b(e,t){var n=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return Object.keys(t)}(B(e,function(e){return v(e,t,!1)}));return -1!==n.indexOf("any")?["any"]:n}function w(e,t,n){var i,r,o,a=e||"unnamed",s=n;for(o=0;o<t.length;o++){var l=s.filter(function(e){var n=g(m(e,o));return(o<e.params.length||p(e.params))&&n(t[o])});if(0===l.length){if((r=b(s,o)).length>0){var u=h(t[o]);return(i=TypeError("Unexpected type of argument in function "+a+" (expected: "+r.join(" or ")+", actual: "+u+", index: "+o+")")).data={category:"wrongType",fn:a,index:o,actual:u,expected:r},i}}else s=l}var c=s.map(function(e){return p(e.params)?1/0:e.params.length});if(t.length<Math.min.apply(null,c))return(i=TypeError("Too few arguments in function "+a+" (expected: "+(r=b(s,o)).join(" or ")+", index: "+t.length+")")).data={category:"tooFewArgs",fn:a,index:t.length,expected:r},i;var d=Math.max.apply(null,c);return t.length>d?(i=TypeError("Too many arguments in function "+a+" (expected: "+d+", actual: "+t.length+")")).data={category:"tooManyArgs",fn:a,index:t.length,expectedLength:d}:(i=TypeError('Arguments of type "'+t.join(", ")+'" do not match any of the defined signatures of function '+a+".")).data={category:"mismatch",actual:t.map(h)},i}function S(e){for(var t=999,n=0;n<e.types.length;n++)x(e.types[n])&&(t=Math.min(t,e.types[n].typeIndex));return t}function _(e){for(var t=999,n=0;n<e.types.length;n++)x(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function M(e,t){var n,i,r=Math.min(e.params.length,t.params.length);if(0!=(i=e.params.some(f)-t.params.some(f)))return i;for(n=0;n<r;n++)if(0!=(i=f(e.params[n])-f(t.params[n])))return i;for(n=0;n<r;n++)if(0!==(i=function(e,t){var n;return 0!=(n=e.restParam-t.restParam)||0!=(n=f(e)-f(t))||0!=(n=S(e)-S(t))?n:_(e)-_(t)}(e.params[n],t.params[n])))return i;return e.params.length-t.params.length}function C(e){var t,n,i,r,o=[],a=[];switch(e.types.forEach(function(e){e.conversion&&(o.push(u(e.conversion.from).test),a.push(e.conversion.convert))}),a.length){case 0:return function(e){return e};case 1:return t=o[0],i=a[0],function(e){return t(e)?i(e):e};case 2:return t=o[0],n=o[1],i=a[0],r=a[1],function(e){return t(e)?i(e):n(e)?r(e):e};default:return function(e){for(var t=0;t<a.length;t++)if(o[t](e))return a[t](e);return e}}}function A(e,t){return function e(n,i,r){if(!(i<n.length))return[r.map(function(e,t){return{types:e,restParam:t===n.length-1&&p(n)}})];var o,a=n[i],s=t?a.types.filter(x):a.types;if(a.restParam){var l=s.filter(x);o=l.length<s.length?[l,s]:[s]}else o=s.map(function(e){return[e]});return B(o,function(t){return e(n,i+1,r.concat([t]))})}(e,0,[])}function k(e,i){if(0===Object.keys(i).length)throw SyntaxError("No signatures provided");var r,o=[];Object.keys(i).map(function(e){var t,n,r;return t=i[e],n=l.conversions,r=[],(""!==e.trim()&&(r=e.split(",").map(I).map(function(e,t,i){var r,o,a,s,l,h,d,p,f=(r=n,o=l=((s=0===e.indexOf("..."))?e.length>3?e.slice(3):"any":e).split("|").map(I).filter(O).filter(D),a={},r.forEach(function(e){-1!==o.indexOf(e.from)||-1===o.indexOf(e.to)||a[e.from]||(a[e.from]=e)}),h=Object.keys(a).map(function(e){return a[e]}),d=l.map(function(e){var t=u(e);return{name:e,typeIndex:c(t),test:t.test,conversion:null,conversionIndex:-1}}),p=h.map(function(e){var t=u(e.from);return{name:e.from,typeIndex:c(t),test:t.test,conversion:e,conversionIndex:n.indexOf(e)}}),{types:d.concat(p),restParam:s});if(f.restParam&&t!==i.length-1)throw SyntaxError('Unexpected rest parameter "'+e+'": only allowed for the last parameter');return f})),r.some(E))?null:{params:r,fn:t}}).filter(P).forEach(function(e){var t=N(o,function(t){return function(e,t){for(var n=Math.max(e.params.length,t.params.length),i=0;i<n;i++)if(!function(e,t){for(var n,i=0;i<e.length;i++)if(n=e[i],-1!==t.indexOf(n))return!0;return!1}(v(e,i,!0),v(t,i,!0)))return!1;var r=e.params.length,o=t.params.length,a=p(e.params),s=p(t.params);return a?s?r===o:o>=r:s?r>=o:r===o}(t,e)});if(t)throw TypeError('Conflicting signatures "'+d(t.params)+'" and "'+d(e.params)+'".');o.push(e)});var a=B(o,function(e){return(e?A(e.params,!1):[]).map(function(t){return{params:t,fn:e.fn}})}).filter(P);a.sort(M);var s=a[0]&&a[0].params.length<=2&&!p(a[0].params),h=a[1]&&a[1].params.length<=2&&!p(a[1].params),m=a[2]&&a[2].params.length<=2&&!p(a[2].params),y=a[3]&&a[3].params.length<=2&&!p(a[3].params),x=a[4]&&a[4].params.length<=2&&!p(a[4].params),b=a[5]&&a[5].params.length<=2&&!p(a[5].params),w=a.map(function(e){return function(e){var t,n,i;if(p(e)){var r,o=(t=(r=e).slice(0,r.length-1).map(g)).length,a=g(R(e)),s=function(e){for(var t=o;t<e.length;t++)if(!a(e[t]))return!1;return!0};return function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return s(e)&&e.length>=o+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=g(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=g(e[0]),i=g(e[1]),function(e){return n(e[0])&&i(e[1])&&2===e.length}):(t=e.map(g),function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length})}(e.params)}),S=s?g(a[0].params[0]):t,_=h?g(a[1].params[0]):t,k=m?g(a[2].params[0]):t,T=y?g(a[3].params[0]):t,F=x?g(a[4].params[0]):t,z=b?g(a[5].params[0]):t,V=s?g(a[0].params[1]):t,j=h?g(a[1].params[1]):t,H=m?g(a[2].params[1]):t,W=y?g(a[3].params[1]):t,G=x?g(a[4].params[1]):t,$=b?g(a[5].params[1]):t,U=a.map(function(e){return function(e,t){var n=t;if(e.some(f)){var i=p(e),r=e.map(C);n=function(){for(var e=[],n=i?arguments.length-1:arguments.length,o=0;o<n;o++)e[o]=r[o](arguments[o]);return i&&(e[n]=arguments[n].map(r[n])),t.apply(this,e)}}var o=n;if(p(e)){var a=e.length-1;o=function(){return n.apply(this,L(arguments,0,a).concat([L(arguments,a)]))}}return o}(e.params,e.fn)}),q=s?U[0]:n,Y=h?U[1]:n,Z=m?U[2]:n,X=y?U[3]:n,K=x?U[4]:n,Q=b?U[5]:n,J=s?a[0].params.length:-1,ee=h?a[1].params.length:-1,et=m?a[2].params.length:-1,en=y?a[3].params.length:-1,ei=x?a[4].params.length:-1,er=b?a[5].params.length:-1,eo=6*!!(s&&h&&m&&y&&x&&b),ea=a.length,es=function(){for(var t=eo;t<ea;t++)if(w[t](arguments))return U[t].apply(this,arguments);return l.onMismatch(e,arguments,a)},el=function e(t,n){return arguments.length===J&&S(t)&&V(n)?q.apply(e,arguments):arguments.length===ee&&_(t)&&j(n)?Y.apply(e,arguments):arguments.length===et&&k(t)&&H(n)?Z.apply(e,arguments):arguments.length===en&&T(t)&&W(n)?X.apply(e,arguments):arguments.length===ei&&F(t)&&G(n)?K.apply(e,arguments):arguments.length===er&&z(t)&&$(n)?Q.apply(e,arguments):es.apply(e,arguments)};try{Object.defineProperty(el,"name",{value:e})}catch(e){}return r={},a.forEach(function(e){e.params.some(f)||A(e.params,!0).forEach(function(t){r[d(t)]=e.fn})}),el.signatures=r,el}function T(e,t,n){throw w(e,t,n)}function D(e){return -1===l.ignore.indexOf(e)}function I(e){return e.trim()}function O(e){return!!e}function P(e){return null!==e}function E(e){return 0===e.types.length}function R(e){return e[e.length-1]}function L(e,t,n){return Array.prototype.slice.call(e,t,n)}function N(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function B(e,t){return Array.prototype.concat.apply([],e.map(t))}function F(e){for(var t="",n=0;n<e.length;n++){var i=e[n];if(("object"==typeof i.signatures||"string"==typeof i.signature)&&""!==i.name){if(""===t)t=i.name;else if(t!==i.name){var r=Error("Function names do not match (expected: "+t+", actual: "+i.name+")");throw r.data={actual:i.name,expected:t},r}}}return t}function z(e){var t,n={};function i(e,i){if(n.hasOwnProperty(e)&&i!==n[e])throw(t=Error('Signature "'+e+'" is defined twice')).data={signature:e},t}for(var r=0;r<e.length;r++){var o=e[r];if("object"==typeof o.signatures)for(var a in o.signatures)o.signatures.hasOwnProperty(a)&&(i(a,o.signatures[a]),n[a]=o.signatures[a]);else if("string"==typeof o.signature)i(o.signature,o),n[o.signature]=o;else throw(t=TypeError("Function is no typed-function (index: "+r+")")).data={index:r},t}return n}return(l=k("typed",{"string, Object":k,Object:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return k(F(t),e)},"...Function":function(e){return k(F(e),z(e))},"string, ...Function":function(e,t){return k(e,z(t))}})).create=i,l.types=r,l.conversions=s,l.ignore=a,l.onMismatch=T,l.throwMismatchError=T,l.createError=w,l.convert=function(e,t){var n=h(e);if(t===n)return e;for(var i=0;i<l.conversions.length;i++){var r=l.conversions[i];if(r.from===n&&r.to===t)return r.convert(e)}throw Error("Cannot convert from "+n+" to "+t)},l.find=function(e,t){if(!e.signatures)throw TypeError("Function is no typed-function");if("string"==typeof t){n=t.split(",");for(var n,i=0;i<n.length;i++)n[i]=n[i].trim()}else if(Array.isArray(t))n=t;else throw TypeError("String array or a comma separated string expected");var r=n.join(","),o=e.signatures[r];if(o)return o;throw TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+n.join(", ")+"))")},l.addType=function(e,t){if(!e||"string"!=typeof e.name||"function"!=typeof e.test)throw TypeError("Object with properties {name: string, test: function} expected");if(!1!==t){for(var n=0;n<l.types.length;n++)if("Object"===l.types[n].name)return void l.types.splice(n,0,e)}l.types.push(e)},l.addConversion=function(e){if(!e||"string"!=typeof e.from||"string"!=typeof e.to||"function"!=typeof e.convert)throw TypeError("Object with properties {from: string, to: string, convert: function} expected");l.conversions.push(e)},l}()},"function"==typeof define&&define.amd?define([],t):e.exports=t()},19891(e,t,n){"use strict";let i,r;n.r(t),n.d(t,{generateChartsTheme:()=>on,DensitySelector:()=>h7,applyMergeIndexedColumnsTransform:()=>oa,interpolateSelectionIndividual:()=>oe,DragButton:()=>d6,TimeRangeSelector:()=>J9,getFormatterStats:()=>n$,OptionsEditorGrid:()=>h5,TOOLTIP_MAX_HEIGHT:()=>eer,useMousePosition:()=>eeg,TextOverlay:()=>Yt,isValidLegendSize:()=>nF,isValidLegendMode:()=>nB,isDateUnit:()=>ri,parseVariables:()=>rM,UnitSelector:()=>eeq,PERCENT_UNIT_CONFIG:()=>iF,RepeatGrid:()=>etm,PERCENT_GROUP_CONFIG:()=>iN,YAxisLabel:()=>eeX,replaceVariablesForDisplay:()=>rk,TOOLTIP_MIN_WIDTH:()=>een,useId:()=>ry,getTitleAction:()=>nO,getYBuffer:()=>eeB,PINNED_CROSSHAIR_SERIES_NAME:()=>nC,getPixelXFromGrid:()=>eeC,getFormattedAxisLabel:()=>r1,clearHighlightedSeries:()=>rh,FALLBACK_CHART_WIDTH:()=>eel,restoreChart:()=>rc,FormatControls:()=>eeZ,transformData:()=>ol,getTimeSeriesValues:()=>l3,DEFAULT_LEGEND:()=>nz,OptionsEditorControl:()=>h2,formatDecimal:()=>iU,DiscardChangesConfirmationDialog:()=>hU,formatTime:()=>n1,SelectionProvider:()=>th,TimeChartTooltip:()=>eeW,legendModes:()=>nR,EMPTY_TOOLTIP_DATA:()=>eef,isThroughputUnit:()=>rt,applyJoinTransform:()=>or,TextField:()=>h_,SeriesInfo:()=>eex,getClosestTimestamp:()=>rg,DropIndicator:()=>de,applyMergeColumnsTransform:()=>oo,isTemperatureUnit:()=>rr,limitDecimalPlaces:()=>nY,useSnackbar:()=>nS,dateFormatOptionsWithTimeZone:()=>rQ,calculateBarYBounds:()=>eeD,DEFAULT_COLUMN_HEIGHT:()=>40,parseVariablesAndFormat:()=>rC,getCommonTimeScale:()=>l4,isBytesUnit:()=>i8,ModeSelector:()=>q7,OptionsEditorColumn:()=>hY,DECIMAL_UNIT_CONFIG:()=>i$,DEFAULT_PINNED_CROSSHAIR:()=>nA,TEMPERATURE_GROUP_CONFIG:()=>ij,NoDataOverlay:()=>Yn,getResourceExtendedDisplayName:()=>l9,InterpolationFormat:()=>rx,ErrorBoundary:()=>LP.ErrorBoundary,hasDataFieldPatterns:()=>rz,CURRENCY_UNIT_CONFIG:()=>iR,ToolbarIconButton:()=>ee$,DEFAULT_TOOLTIP_CONFIG:()=>eem,TRANSFORM_TEXT:()=>ro,calculateBarBandwidth:()=>eek,ItemActionsProvider:()=>to,isWithinPercentageRange:()=>eeN,OPTIMIZED_MODE_SERIES_LIMIT:()=>1e3,legendPositions:()=>nE,TIME_GROUP_CONFIG:()=>nX,defaultCursorData:()=>eep,createTimezoneAwareAxisFormatter:()=>LD,RefreshIntervalPicker:()=>etg,legendSizes:()=>nL,BITS_GROUP_CONFIG:()=>iC,TOOLTIP_LABELS_MAX_WIDTH:()=>eeo,applyValueMapping:()=>oi,UNIT_GROUP_CONFIG:()=>iQ,batchDispatchNearbySeriesActions:()=>rp,DEFAULT_COLUMN_WIDTH:()=>150,getGMTOffset:()=>r0,getPointInGrid:()=>rd,InfoTooltip:()=>hJ,AlignSelector:()=>e_,JSONEditor:()=>q4,CURRENCY_GROUP_CONFIG:()=>iE,TooltipHeader:()=>eeH,SeriesMarker:()=>eee,FontSizeSelector:()=>LR,THROUGHPUT_UNIT_CONFIG:()=>iZ,DEFAULT_COLUMN_MAX_WIDTH:()=>1e3,TOOLTIP_PADDING:()=>ees,TimeZoneContext:()=>l7,TimeZoneProvider:()=>ue,useDeepMemo:()=>r4,TransformsEditor:()=>etf,combineSx:()=>rv,getFormatterFromCache:()=>nG,applyMergeSeriesTransform:()=>os,Legend:()=>hN,Dialog:()=>h$,getFormattedMultipleYAxes:()=>rs,replaceVariables:()=>rA,DECIMAL_GROUP_CONFIG:()=>iG,getResourceDisplayName:()=>l8,SnackbarProvider:()=>nw,formatBytes:()=>iI,getUnitConfig:()=>i1,LoadingOverlay:()=>Yi,formatWithTimeZone:()=>rJ,legacyCheckforNearbySeries:()=>eeR,replaceVariable:()=>rS,UNIT_CONFIG:()=>iJ,testChartsTheme:()=>eeQ,TOOLTIP_ADJUST_Y_POS_MULTIPLIER:()=>eea,interpolate:()=>rw,THROUGHPUT_GROUP_CONFIG:()=>iq,BYTES_UNIT_CONFIG:()=>iD,useChartsTheme:()=>ti,calculateBarSegmentBounds:()=>eeT,checkCrosshairPinnedStatus:()=>rf,mockChartsContext:()=>eeJ,checkforNearbyTimeSeries:()=>eeE,TOOLTIP_DATE_FORMAT:()=>eed,hasDecimalPlaces:()=>nq,isCurrencyUnit:()=>rn,DEFAULT_COLUMN_MIN_WIDTH:()=>60,handleMoveUp:()=>d3,ContentWithLegend:()=>hF,OptionsEditorGroup:()=>h3,isUnitWithDecimalPlaces:()=>i7,SeriesLabelsStack:()=>eet,getDateAndTime:()=>r2,getTableCellLayout:()=>cf,ChartsThemeContext:()=>tt,TooltipContent:()=>eeF,isValidTraceId:()=>l6,formatCurrency:()=>iL,ValueMappingsEditor:()=>etb,BYTES_GROUP_CONFIG:()=>iT,interpolateSelectionBatch:()=>ot,isLegendItemVisuallySelected:()=>us,getFormattedAxis:()=>ra,getClosestTimestampInFullDataset:()=>rm,ChartsProvider:()=>te,TimeZoneSelector:()=>J7,LinkEditorForm:()=>q8,SortSelector:()=>Yo,formatValue:()=>i0,persesColumnsToTanstackColumns:()=>cg,NEARBY_SERIES_DESCRIPTION:()=>eeu,calculateVisualYForSeries:()=>eeA,hasIndexedPatterns:()=>rF,ColorPicker:()=>e6,useItemActions:()=>tl,getUnitGroup:()=>i2,formatThroughput:()=>iX,getTheme:()=>eti,shouldShortenValues:()=>nU,MIN_STEP_INTERVAL_MS:()=>l5,buildRelativeTimeOption:()=>nD,useSelection:()=>tf,TEMPERATURE_UNIT_CONFIG:()=>iH,SortSelectorButtons:()=>Ya,formatBits:()=>ik,getTimeZoneOptions:()=>nI,DYNAMIC_NEARBY_SERIES_MULTIPLIER:()=>eeO,isUnitWithShortValues:()=>re,getTooltipStyles:()=>eeM,interpolateHeaders:()=>r9,ErrorAlert:()=>LO,OptionsColorPicker:()=>un,getUnitGroupConfig:()=>i5,TOOLTIP_BG_COLOR_FALLBACK:()=>eeh,TOOLTIP_MAX_WIDTH:()=>eei,DragAndDropElement:()=>d2,extractFieldNames:()=>rV,isBitsUnit:()=>i9,SHOW_FEWER_SERIES_LIMIT:()=>eeP,TIME_UNIT_CONFIG:()=>nK,INCREASE_NEARBY_SERIES_MULTIPLIER:()=>eeI,isPercentUnit:()=>i4,getLegendSize:()=>nH,getSubmitText:()=>nP,handleMoveDown:()=>d4,PIN_TOOLTIP_HELP_TEXT:()=>eev,Table:()=>hO,typography:()=>ett,formatPercent:()=>iz,assembleTransform:()=>ee_,formatTemperature:()=>iW,useTimeZone:()=>ut,createRegexFromString:()=>r8,hasBatchPatterns:()=>rB,PersesTimeToIntlTime:()=>nQ,parseFormat:()=>rR,FormActions:()=>LL,getNearbySeriesData:()=>eeL,useMemoized:()=>r3,isValidLegendPosition:()=>nN,getLegendMode:()=>nj,EMPHASIZED_SERIES_DESCRIPTION:()=>eec,replaceDataFields:()=>rL,Drawer:()=>pg,getLegendPosition:()=>nV,BITS_UNIT_CONFIG:()=>iA,EChart:()=>Lk,isTimeUnit:()=>i3,useChartsContext:()=>tn,interpolateQueryParams:()=>r7,UNPIN_TOOLTIP_HELP_TEXT:()=>eey,DateTimeRangePicker:()=>J8,SettingsAutocomplete:()=>h8,ThresholdsEditor:()=>Yp,isDecimalUnit:()=>i6,enableDataZoom:()=>ru,replaceDataFieldsBatch:()=>rN,useDragAndDropMonitor:()=>d1,useLocalStorage:()=>rl,isRegexPattern:()=>r6});var o,a,s,l,u,c,h,d,p,f,g,m,v,y,x,b,w,S,_,M,C,A,k,T,D,I,O,P,E,R,L,N,B,F,z,V,j,H,W,G,$,U,q,Y,Z,X,K,Q,J,ee,et,en,ei,er,eo,ea,es,el,eu,ec,eh,ed,ep,ef,eg,em,ev,ey,ex={};n.r(ex),n.d(ex,{Arc:()=>_C,BezierCurve:()=>_S,BoundingRect:()=>mr,Circle:()=>SX,CompoundPath:()=>_A,Ellipse:()=>SJ,Group:()=>SI,Image:()=>yB,IncrementalDisplayable:()=>_N,Line:()=>_v,LinearGradient:()=>_T,OrientedBoundingRect:()=>_R,Path:()=>yO,Point:()=>g4,Polygon:()=>_c,Polyline:()=>_p,RadialGradient:()=>_D,Rect:()=>y$,Ring:()=>_a,Sector:()=>_i,Text:()=>y4,applyTransform:()=>_0,clipPointsByRect:()=>_5,clipRectByRect:()=>_3,createIcon:()=>_4,extendPath:()=>_H,extendShape:()=>_V,getShapeClass:()=>_G,getTransform:()=>_J,groupTransition:()=>_2,initProps:()=>xG,isElementRemoved:()=>x$,lineLineIntersect:()=>_8,linePolygonIntersect:()=>_6,makeImage:()=>_U,makePath:()=>_$,mergePath:()=>_Y,registerShape:()=>_W,removeElement:()=>xU,removeElementWithFadeOut:()=>xY,resizePath:()=>_Z,setTooltipConfig:()=>_9,subPixelOptimize:()=>_Q,subPixelOptimizeLine:()=>_X,subPixelOptimizeRect:()=>_K,transformDirection:()=>_1,traverseElements:()=>Me,updateProps:()=>xW});var eb=n(62540),ew=n(12138),eS=n(7013);function e_({onChange:e,value:t="left",...n}){let i=t=>{e(t)};return(0,eb.jsxs)(ew.A,{"aria-label":"Alignement",...n,children:[(0,eb.jsx)(eS.A,{onClick:()=>i("left"),variant:"left"===t?"contained":"outlined",children:"Left"},"left"),(0,eb.jsx)(eS.A,{onClick:()=>i("center"),variant:"center"===t?"contained":"outlined",children:"Center"},"center"),(0,eb.jsx)(eS.A,{onClick:()=>i("right"),variant:"right"===t?"contained":"outlined",children:"Right"},"right")]})}var eM=n(315),eC=n(47095),eA=n(93648),ek=n(29618),eT=n(98029),eD=n(70451),eI=n.n(eD);function eO(){return(eO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function eP(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)t.indexOf(n=o[i])>=0||(r[n]=e[n]);return r}function eE(e){var t=(0,eD.useRef)(e),n=(0,eD.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var eR,eL=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},eN=function(e){return"touches"in e},eB=function(e){return e&&e.ownerDocument.defaultView||self},eF=function(e,t,n){var i=e.getBoundingClientRect(),r=eN(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:eL((r.pageX-(i.left+eB(e).pageXOffset))/i.width),top:eL((r.pageY-(i.top+eB(e).pageYOffset))/i.height)}},ez=function(e){eN(e)||e.preventDefault()},eV=eI().memo(function(e){var t=e.onMove,n=e.onKey,i=e.onEnd,r=eP(e,["onMove","onKey","onEnd"]),o=(0,eD.useRef)(null),a=eE(t),s=eE(n),l=eE(i),u=(0,eD.useRef)(null),c=(0,eD.useRef)(!1),h=(0,eD.useMemo)(function(){var e=function(e){ez(e),(eN(e)?e.touches.length>0:e.buttons>0)&&o.current?a(eF(o.current,e,u.current)):(n(!1),l())},t=function(){n(!1),l()};function n(n){var i=c.current,r=eB(o.current),a=n?r.addEventListener:r.removeEventListener;a(i?"touchmove":"mousemove",e),a(i?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,i=o.current;if(i&&(ez(t),(!c.current||eN(t))&&i)){if(eN(t)){c.current=!0;var r=t.changedTouches||[];r.length&&(u.current=r[0].identifier)}i.focus(),a(eF(i,t,u.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},function(e){var t=e.which||e.keyCode;t>=37&&t<=40&&l()},n]},[s,a,l]),d=h[0],p=h[1],f=h[2],g=h[3];return(0,eD.useEffect)(function(){return g},[g]),eI().createElement("div",eO({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:o,onKeyDown:p,onKeyUp:f,tabIndex:0,role:"slider"}))}),ej=function(e){return e.filter(Boolean).join(" ")},eH=function(e){var t=e.color,n=e.left,i=e.top,r=ej(["react-colorful__pointer",e.className]);return eI().createElement("div",{className:r,style:{top:100*(void 0===i?.5:i)+"%",left:100*n+"%"}},eI().createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},eW=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},eG=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?eW(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?eW(parseInt(e.substring(6,8),16)/255,2):1}},e$=function(e){var t=e.s,n=e.v,i=e.a,r=(200-t)*n/100;return{h:eW(e.h),s:eW(r>0&&r<200?t*n/100/(r<=100?r:200-r)*100:0),l:eW(r/2),a:eW(i,2)}},eU=function(e){var t=e$(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},eq=function(e){var t=e.h,n=e.s,i=e.v,r=e.a;t=t/360*6,n/=100,i/=100;var o=Math.floor(t),a=i*(1-n),s=i*(1-(t-o)*n),l=i*(1-(1-t+o)*n),u=o%6;return{r:eW(255*[i,s,a,a,l,i][u]),g:eW(255*[l,i,i,s,a,a][u]),b:eW(255*[a,a,l,i,i,s][u]),a:eW(r,2)}},eY=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},eZ=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=r<1?eY(eW(255*r)):"";return"#"+eY(t)+eY(n)+eY(i)+o},eX=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=Math.max(t,n,i),a=o-Math.min(t,n,i),s=a?o===t?(n-i)/a:o===n?2+(i-t)/a:4+(t-n)/a:0;return{h:eW(60*(s<0?s+6:s)),s:eW(o?a/o*100:0),v:eW(o/255*100),a:r}},eK=eI().memo(function(e){var t=e.hue,n=e.onChange,i=e.onChangeEnd,r=ej(["react-colorful__hue",e.className]);return eI().createElement("div",{className:r},eI().createElement(eV,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:eL(t+360*e.left,0,360)})},onEnd:i,"aria-label":"Hue","aria-valuenow":eW(t),"aria-valuemax":"360","aria-valuemin":"0"},eI().createElement(eH,{className:"react-colorful__hue-pointer",left:t/360,color:eU({h:t,s:100,v:100,a:1})})))}),eQ=eI().memo(function(e){var t=e.hsva,n=e.onChange,i=e.onChangeEnd,r={backgroundColor:eU({h:t.h,s:100,v:100,a:1})};return eI().createElement("div",{className:"react-colorful__saturation",style:r},eI().createElement(eV,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:eL(t.s+100*e.left,0,100),v:eL(t.v-100*e.top,0,100)})},onEnd:i,"aria-label":"Color","aria-valuetext":"Saturation "+eW(t.s)+"%, Brightness "+eW(t.v)+"%"},eI().createElement(eH,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:eU(t)})))}),eJ=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},e0="u">typeof window?eD.useLayoutEffect:eD.useEffect,e1=new Map,e2=function(e){e0(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!e1.has(t)){var i=t.createElement("style");i.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',e1.set(t,i);var r=eR||n.nc;r&&i.setAttribute("nonce",r),t.head.appendChild(i)}},[])},e5=function(e){var t,n,i,r,o,a,s,l=e.className,u=e.colorModel,c=e.color,h=void 0===c?u.defaultColor:c,d=e.onChange,p=e.onChangeEnd,f=eP(e,["className","colorModel","color","onChange","onChangeEnd"]),g=(0,eD.useRef)(null);e2(g);var m=(t=eE(d),n=eE(p),r=(i=(0,eD.useState)(function(){return u.toHsva(h)}))[0],o=i[1],a=(0,eD.useRef)({color:h,hsva:r}),s=(0,eD.useRef)(!1),(0,eD.useEffect)(function(){if(!u.equal(h,a.current.color)){var e=u.toHsva(h);a.current={hsva:e,color:h},o(e),s.current=!1}},[h,u]),(0,eD.useEffect)(function(){var e;eJ(r,a.current.hsva)||u.equal(e=u.fromHsva(r),a.current.color)||(a.current={hsva:r,color:e},t(e),s.current=!0)},[r,u,t]),[r,(0,eD.useCallback)(function(e){o(function(t){return Object.assign({},t,e)})},[]),(0,eD.useCallback)(function(){s.current&&(s.current=!1,n(a.current.color))},[n])]),v=m[0],y=m[1],x=m[2],b=ej(["react-colorful",l]);return eI().createElement("div",eO({},f,{ref:g,className:b}),eI().createElement(eQ,{hsva:v,onChange:y,onChangeEnd:x}),eI().createElement(eK,{hue:v.h,onChange:y,onChangeEnd:x,className:"react-colorful__last-control"}))},e3={defaultColor:"000",toHsva:function(e){return eX(eG(e))},fromHsva:function(e){return eZ(eq({h:e.h,s:e.s,v:e.v,a:1}))},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||eJ(eG(e),eG(t))}},e4=function(e){return eI().createElement(e5,eO({},e,{colorModel:e3}))};let e6=({color:e,onChange:t,onClear:n,palette:i})=>{let[r,o]=(0,eD.useState)(e),a=e=>{o(e),t?.(e)};return(0,eb.jsxs)(eM.A,{spacing:1,children:[(0,eb.jsx)(e4,{color:e,onChange:a,style:{width:"100%"}}),(0,eb.jsx)(eM.A,{direction:"row",flexWrap:"wrap",justifyContent:"space-evenly",width:"200px",children:i&&i.map((e,t)=>(0,eb.jsx)(eC.A,{size:"small","aria-label":`change color to ${e}`,sx:{color:e},onClick:()=>a(e),children:(0,eb.jsx)(ek,{})},t))}),(0,eb.jsxs)(eM.A,{direction:"row",gap:1,alignItems:"center",children:[(0,eb.jsx)(eA.A,{inputProps:{"aria-label":"enter hex color"},fullWidth:!0,value:r,onChange:e=>{let n=e.target.value.replace(/([^0-9A-F]+)/gi,"").substring(0,8);o(`#${n}`),e8(e.target.value)&&t?.(e.target.value)}}),n&&(0,eb.jsx)(eC.A,{onClick:n,children:(0,eb.jsx)(eT,{})})]})]})},e8=(e,t)=>{let n=/^#?([0-9A-F]{3,8})$/i.exec(e),i=n&&n[1]?n[1].length:0;return 3===i||6===i||!!t&&4===i||!!t&&8===i};var e9=n(91823),e7=n(77308);function te(e){let{children:t,chartsTheme:n,enablePinning:i=!1,enableSyncGrouping:r=!0}=e,[o,a]=(0,eD.useState)(null),s=(0,eD.useMemo)(()=>({chartsTheme:n,enablePinning:i,lastTooltipPinnedCoords:o,enableSyncGrouping:r,setLastTooltipPinnedCoords:a}),[n,i,r,o,a]);return(0,eb.jsx)(tt.Provider,{value:s,children:t})}let tt=(0,eD.createContext)(void 0);function tn(){let e=(0,eD.useContext)(tt);if(void 0===e)throw Error("No ChartsThemeContext found. Did you forget a Provider?");return e}function ti(){return tn().chartsTheme}let tr=(0,eD.createContext)(void 0);function to({children:e}){let[t,n]=(0,eD.useState)(new Map),i=(0,eD.useCallback)((e,t,i)=>{n(n=>{let r=new Map(n),o=r.get(e)||{loading:!1};if(void 0!==i){let n=new Map(o.itemStatuses||new Map),a=n.get(i)||{loading:!1};n.set(i,{...a,...t}),r.set(e,{...o,itemStatuses:n})}else r.set(e,{...o,...t});return r})},[]),r=(0,eD.useCallback)(e=>{n(t=>{if(void 0===e)return new Map;if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),o=(0,eD.useMemo)(()=>({actionStatuses:t,setActionStatus:i,clearActionStatus:r}),[t,i,r]);return(0,eb.jsx)(tr.Provider,{value:o,children:e})}let ta=()=>{},ts={actionStatuses:new Map,setActionStatus:ta,clearActionStatus:ta,hasContext:!1};function tl(){let e=(0,eD.useContext)(tr);return(0,eD.useMemo)(()=>e?{...e,hasContext:!0}:ts,[e])}let tu=(0,eD.createContext)(void 0),tc=(e,t)=>t;function th({children:e}){let[t,n]=(0,eD.useState)(new Map),i=(0,eD.useRef)(tc),r=(0,eD.useCallback)(e=>{i.current=e},[]),o=(0,eD.useCallback)(e=>{let t=new Map;e.forEach(({item:e,id:n})=>t.set(n,e)),n(t)},[]),a=(0,eD.useCallback)((e,t)=>{n(n=>{let i=new Map(n);return i.has(t)?i.delete(t):i.set(t,e),i})},[]),s=(0,eD.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),l=(0,eD.useCallback)(()=>n(new Map),[]),u=(0,eD.useCallback)((e,n)=>t.has(i.current(e,n)),[t]),c=(0,eD.useMemo)(()=>({selectionMap:t,setSelection:o,toggleSelection:a,removeFromSelection:s,clearSelection:l,isSelected:u,registerGetId:r}),[t,o,a,s,l,u,r]);return(0,eb.jsx)(tu.Provider,{value:c,children:e})}let td=()=>{},tp={selectionMap:new Map,setSelection:td,toggleSelection:td,removeFromSelection:td,clearSelection:td,isSelected:()=>!1,hasContext:!1};function tf(e){let t=(0,eD.useContext)(tu);return(0,eD.useEffect)(()=>{t&&e?.getId&&t.registerGetId(e.getId)},[t,e?.getId]),(0,eD.useMemo)(()=>{if(!t)return tp;let{registerGetId:e,...n}=t;return{...n,hasContext:!0}},[t])}var tg=n(20231);let tm=function(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=function e(t){var n,i,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(i=e(t[n]))&&(r&&(r+=" "),r+=i);else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}(e))&&(i&&(i+=" "),i+=t);return i},tv={data:""},ty=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,tx=/\/\*[^]*?\*\/| +/g,tb=/\n+/g,tw=(e,t)=>{let n="",i="",r="";for(let o in e){let a=e[o];"@"==o[0]?"i"==o[1]?n=o+" "+a+";":i+="f"==o[1]?tw(a,o):o+"{"+tw(a,"k"==o[1]?"":t)+"}":"object"==typeof a?i+=tw(a,t?t.replace(/([^,])+/g,e=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):o):null!=a&&(o="-"==o[1]?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=tw.p?tw.p(o,a):o+":"+a+";")}return n+(t&&r?t+"{"+r+"}":r)+i},tS={},t_=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+t_(e[n]);return t}return e};function tM(e){let t,n,i=this||{},r=e.call?e(i.p):e;return((e,t,n,i,r)=>{var o;let a=t_(e),s=tS[a]||(tS[a]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(a));if(!tS[s]){let t=a!==e?e:(e=>{let t,n,i=[{}];for(;t=ty.exec(e.replace(tx,""));)t[4]?i.shift():t[3]?(n=t[3].replace(tb," ").trim(),i.unshift(i[0][n]=i[0][n]||{})):i[0][t[1]]=t[2].replace(tb," ").trim();return i[0]})(e);tS[s]=tw(r?{["@keyframes "+s]:t}:t,n?"":"."+s)}let l=n&&tS.g;return n&&(tS.g=tS[s]),o=tS[s],l?t.data=t.data.replace(l,o):-1===t.data.indexOf(o)&&(t.data=i?o+t.data:t.data+o),s})(r.unshift?r.raw?(t=[].slice.call(arguments,1),n=i.p,r.reduce((e,i,r)=>{let o=t[r];if(o&&o.call){let e=o(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":tw(e,""):!1===e?"":e}return e+i+(null==o?"":o)},"")):r.reduce((e,t)=>Object.assign(e,t&&t.call?t(i.p):t),{}):r,(e=>{if("object"==typeof window){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||tv})(i.target),i.g,i.o,i.k)}function tC(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function tA(e,t,n){return t&&tC(e.prototype,t),n&&tC(e,n),e}function tk(){return(tk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function tT(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function tD(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}function tI(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}tM.bind({g:1}),tM.bind({k:1});var tO=function(){return""},tP=eI().createContext({enqueueSnackbar:tO,closeSnackbar:tO}),tE="@media (max-width:599.95px)",tR="@media (min-width:600px)",tL=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},tN=function(e){return""+tL(e.vertical)+tL(e.horizontal)},tB=function(e){return!!e||0===e},tF="unmounted",tz="exited",tV="entering",tj="entered",tH="exiting",tW=function(e){function t(t){var n,i=e.call(this,t)||this,r=t.appear;return i.appearStatus=null,t.in?r?(n=tz,i.appearStatus=tV):n=tj:n=t.unmountOnExit||t.mountOnEnter?tF:tz,i.state={status:n},i.nextCallback=null,i}tT(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===tF?{status:tz}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==tV&&n!==tj&&(t=tV):(n===tV||n===tj)&&(t=tH)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=e,n=e;return null!=e&&"number"!=typeof e&&"string"!=typeof e&&(n=e.exit,t=e.enter),{exit:n,enter:t}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===tV?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===tz&&this.setState({status:tF})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.getTimeouts();e||n?(this.props.onEnter&&this.props.onEnter(this.node,e),this.safeSetState({status:tV},function(){t.props.onEntering&&t.props.onEntering(t.node,e),t.onTransitionEnd(i.enter,function(){t.safeSetState({status:tj},function(){t.props.onEntered&&t.props.onEntered(t.node,e)})})})):this.safeSetState({status:tj},function(){t.props.onEntered&&t.props.onEntered(t.node,e)})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts();t?(this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:tH},function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:tz},function(){e.props.onExited&&e.props.onExited(e.node)})})})):this.safeSetState({status:tz},function(){e.props.onExited&&e.props.onExited(e.node)})},n.cancelNextCallback=function(){null!==this.nextCallback&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(){n&&(n=!1,t.nextCallback=null,e())},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=null==e&&!this.props.addEndListener;!this.node||n?setTimeout(this.nextCallback,0):(this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),null!=e&&setTimeout(this.nextCallback,e))},n.render=function(){var e=this.state.status;if(e===tF)return null;var t=this.props;return(0,t.children)(e,tD(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},tA(t,[{key:"node",get:function(){var e,t=null==(e=this.props.nodeRef)?void 0:e.current;if(!t)throw Error("notistack - Custom snackbar is not refForwarding");return t}}]),t}(eI().Component);function tG(){}function t$(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function tU(e,t){return(0,eD.useMemo)(function(){return null==e&&null==t?null:function(n){t$(e,n),t$(t,n)}},[e,t])}function tq(e){var t=e.timeout,n=e.style,i=void 0===n?{}:n,r=e.mode;return{duration:"object"==typeof t?t[r]||0:t,easing:i.transitionTimingFunction,delay:i.transitionDelay}}tW.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:tG,onEntering:tG,onEntered:tG,onExit:tG,onExiting:tG,onExited:tG};var tY=function(e){e.scrollTop=e.scrollTop},tZ=function(e){return Math.round(e)+"ms"};function tX(e,t){void 0===e&&(e=["all"]);var n=t||{},i=n.duration,r=void 0===i?300:i,o=n.easing,a=void 0===o?"cubic-bezier(0.4, 0, 0.2, 1)":o,s=n.delay,l=void 0===s?0:s;return(Array.isArray(e)?e:[e]).map(function(e){return e+" "+("string"==typeof r?r:tZ(r))+" "+a+" "+("string"==typeof l?l:tZ(l))}).join(",")}function tK(e){return(e&&e.ownerDocument||document).defaultView||window}function tQ(e,t){if(t){var n=function(e,t){var n,i=t.getBoundingClientRect(),r=tK(t);if(t.fakeTransform)n=t.fakeTransform;else{var o=r.getComputedStyle(t);n=o.getPropertyValue("-webkit-transform")||o.getPropertyValue("transform")}var a=0,s=0;if(n&&"none"!==n&&"string"==typeof n){var l=n.split("(")[1].split(")")[0].split(",");a=parseInt(l[4],10),s=parseInt(l[5],10)}switch(e){case"left":return"translateX("+(r.innerWidth+a-i.left)+"px)";case"right":return"translateX(-"+(i.left+i.width-a)+"px)";case"up":return"translateY("+(r.innerHeight+s-i.top)+"px)";default:return"translateY(-"+(i.top+i.height-s)+"px)"}}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}}var tJ=(0,eD.forwardRef)(function(e,t){var n=e.children,i=e.direction,r=void 0===i?"down":i,o=e.in,a=e.style,s=e.timeout,l=void 0===s?0:s,u=e.onEnter,c=e.onEntered,h=e.onExit,d=e.onExited,p=tD(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),f=(0,eD.useRef)(null),g=tU(n.ref,f),m=tU(g,t),v=(0,eD.useCallback)(function(){f.current&&tQ(r,f.current)},[r]);return(0,eD.useEffect)(function(){if(!o&&"down"!==r&&"right"!==r){var e=function(e,t){var n;function i(){for(var i=this,r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];clearTimeout(n),n=setTimeout(function(){e.apply(i,o)},t)}return void 0===t&&(t=166),i.clear=function(){clearTimeout(n)},i}(function(){f.current&&tQ(r,f.current)}),t=tK(f.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}},[r,o]),(0,eD.useEffect)(function(){o||v()},[o,v]),(0,eD.createElement)(tW,Object.assign({appear:!0,nodeRef:f,onEnter:function(e,t){tQ(r,e),tY(e),u&&u(e,t)},onEntered:c,onEntering:function(e){var t=(null==a?void 0:a.transitionTimingFunction)||"cubic-bezier(0.0, 0, 0.2, 1)",n=tq({timeout:l,mode:"enter",style:tk({},a,{transitionTimingFunction:t})});e.style.webkitTransition=tX("-webkit-transform",n),e.style.transition=tX("transform",n),e.style.webkitTransform="none",e.style.transform="none"},onExit:function(e){var t=(null==a?void 0:a.transitionTimingFunction)||"cubic-bezier(0.4, 0, 0.6, 1)",n=tq({timeout:l,mode:"exit",style:tk({},a,{transitionTimingFunction:t})});e.style.webkitTransition=tX("-webkit-transform",n),e.style.transition=tX("transform",n),tQ(r,e),h&&h(e)},onExited:function(e){e.style.webkitTransition="",e.style.transition="",d&&d(e)},in:o,timeout:l},p),function(e,t){return(0,eD.cloneElement)(n,tk({ref:m,style:tk({visibility:"exited"!==e||o?void 0:"hidden"},a,{},n.props.style)},t))})});tJ.displayName="Slide";var t0=function(e){return eI().createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},e))},t1={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:eI().createElement(function(){return eI().createElement(t0,null,eI().createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41\n 10.59L10 14.17L17.59 6.58L19 8L10 17Z"}))},null),warning:eI().createElement(function(){return eI().createElement(t0,null,eI().createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},null),error:eI().createElement(function(){return eI().createElement(t0,null,eI().createElement("path",{d:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,\n 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,\n 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"}))},null),info:eI().createElement(function(){return eI().createElement(t0,null,eI().createElement("path",{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,\n 0 22,12A10,10 0 0,0 12,2Z"}))},null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:tJ,transitionDuration:{enter:225,exit:195}},t2=function(e,t){var n=function(e){return"number"==typeof e||null===e};return n(e)?e:n(t)?t:t1.autoHideDuration},t5=function(e,t){var n=function(e,t){return t.some(function(t){return typeof e===t})};return n(e,["string","number"])?e:n(e,["object"])?tk({},t1.transitionDuration,{},n(t,["object"])&&t,{},e):n(t,["string","number"])?t:n(t,["object"])?tk({},t1.transitionDuration,{},t):t1.transitionDuration};function t3(e){return Object.entries(e).reduce(function(e,t){var n,i=t[0],r=t[1];return tk({},e,((n={})[i]=tM(r),n))},{})}var t4="notistack-CollapseWrapper",t6=t3({root:{height:0},entered:{height:"auto"}}),t8=(0,eD.forwardRef)(function(e,t){var n=e.children,i=e.in,r=e.onExited,o=(0,eD.useRef)(null),a=(0,eD.useRef)(null),s=tU(t,a),l=function(){return o.current?o.current.clientHeight:0};return(0,eD.createElement)(tW,{in:i,unmountOnExit:!0,onEnter:function(e){e.style.height="0px"},onEntered:function(e){e.style.height="auto"},onEntering:function(e){var t=l(),n=tq({timeout:175,mode:"enter"}),i=n.duration,r=n.easing;e.style.transitionDuration="string"==typeof i?i:i+"ms",e.style.height=t+"px",e.style.transitionTimingFunction=r||""},onExit:function(e){e.style.height=l()+"px"},onExited:r,onExiting:function(e){tY(e);var t=tq({timeout:175,mode:"exit"}),n=t.duration,i=t.easing;e.style.transitionDuration="string"==typeof n?n:n+"ms",e.style.height="0px",e.style.transitionTimingFunction=i||""},nodeRef:a,timeout:175},function(e,t){return(0,eD.createElement)("div",Object.assign({ref:s,className:tm(t6.root,"entered"===e&&t6.entered),style:tk({pointerEvents:"all",overflow:"hidden",minHeight:"0px",transition:tX("height")},"entered"===e&&{overflow:"visible"},{},"exited"===e&&!i&&{visibility:"hidden"})},t),(0,eD.createElement)("div",{ref:o,className:t4,style:{display:"flex",width:"100%"}},n))})});t8.displayName="Collapse";var t9={right:"left",left:"right",bottom:"up",top:"down"},t7=function(e){void 0===e&&(e={});var t={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(e).filter(function(e){return!t[e]}).reduce(function(t,n){var i;return tk({},t,((i={})[n]=e[n],i))},{})},ne=function(){};function nt(e,t){return e.reduce(function(e,n){return null==n?e:function(){for(var i=arguments.length,r=Array(i),o=0;o<i;o++)r[o]=arguments[o];var a=[].concat(r);t&&-1===a.indexOf(t)&&a.push(t),e.apply(this,a),n.apply(this,a)}},ne)}var nn="u">typeof window?eD.useLayoutEffect:eD.useEffect;function ni(e){var t=(0,eD.useRef)(e);return nn(function(){t.current=e}),(0,eD.useCallback)(function(){return t.current.apply(void 0,arguments)},[])}var nr=(0,eD.forwardRef)(function(e,t){var n=e.children,i=e.className,r=e.autoHideDuration,o=e.disableWindowBlurListener,a=void 0!==o&&o,s=e.onClose,l=e.id,u=e.open,c=e.SnackbarProps,h=void 0===c?{}:c,d=(0,eD.useRef)(),p=ni(function(){s&&s.apply(void 0,arguments)}),f=ni(function(e){s&&null!=e&&(d.current&&clearTimeout(d.current),d.current=setTimeout(function(){p(null,"timeout",l)},e))});(0,eD.useEffect)(function(){return u&&f(r),function(){d.current&&clearTimeout(d.current)}},[u,r,f]);var g=function(){d.current&&clearTimeout(d.current)},m=(0,eD.useCallback)(function(){null!=r&&f(.5*r)},[r,f]);return(0,eD.useEffect)(function(){if(!a&&u)return window.addEventListener("focus",m),window.addEventListener("blur",g),function(){window.removeEventListener("focus",m),window.removeEventListener("blur",g)}},[a,m,u]),(0,eD.createElement)("div",Object.assign({ref:t},h,{className:tm("notistack-Snackbar",i),onMouseEnter:function(e){h.onMouseEnter&&h.onMouseEnter(e),g()},onMouseLeave:function(e){h.onMouseLeave&&h.onMouseLeave(e),m()}}),n)});nr.displayName="Snackbar";var no=t3({root:((ak={display:"flex",flexWrap:"wrap",flexGrow:1})[tR]={flexGrow:"initial",minWidth:"288px"},ak)}),na=(0,eD.forwardRef)(function(e,t){var n=e.className,i=tD(e,["className"]);return eI().createElement("div",Object.assign({ref:t,className:tm(no.root,n)},i))});na.displayName="SnackbarContent";var ns=t3({root:{backgroundColor:"#313131",fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},lessPadding:{paddingLeft:"20px"},default:{backgroundColor:"#313131"},success:{backgroundColor:"#43a047"},error:{backgroundColor:"#d32f2f"},warning:{backgroundColor:"#ff9800"},info:{backgroundColor:"#2196f3"},message:{display:"flex",alignItems:"center",padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:"16px",marginRight:"-8px"}}),nl="notistack-snackbar",nu=(0,eD.forwardRef)(function(e,t){var n=e.id,i=e.message,r=e.action,o=e.iconVariant,a=e.variant,s=e.hideIconVariant,l=e.style,u=e.className,c=o[a],h=r;return"function"==typeof h&&(h=h(n)),eI().createElement(na,{ref:t,role:"alert","aria-describedby":nl,style:l,className:tm("notistack-MuiContent","notistack-MuiContent-"+a,ns.root,ns[a],u,!s&&c&&ns.lessPadding)},eI().createElement("div",{id:nl,className:ns.message},s?null:c,i),h&&eI().createElement("div",{className:ns.action},h))});nu.displayName="MaterialDesignContent";var nc=(0,eD.memo)(nu),nh=t3({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),nd=function(e){var t,n=(0,eD.useRef)(),i=(0,eD.useState)(!0),r=i[0],o=i[1],a=nt([e.snack.onClose,e.onClose]),s=(0,eD.useCallback)(function(){n.current=setTimeout(function(){o(function(e){return!e})},125)},[]);(0,eD.useEffect)(function(){return function(){n.current&&clearTimeout(n.current)}},[]);var l=e.snack,u=e.classes,c=e.Component,h=(0,eD.useMemo)(function(){return t7(u)},[u]),d=l.open,p=l.SnackbarProps,f=l.TransitionComponent,g=l.TransitionProps,m=l.transitionDuration,v=l.disableWindowBlurListener,y=l.content,x=tD(l,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),b=tk({direction:"center"!==(t=x.anchorOrigin).horizontal?t9[t.horizontal]:t9[t.vertical],timeout:m},g),w=y;"function"==typeof w&&(w=w(x.id,x.message));var S=["onEnter","onEntered","onExit","onExited"].reduce(function(t,n){var i;return tk({},t,((i={})[n]=nt([e.snack[n],e[n]],x.id),i))},{});return eI().createElement(t8,{in:r,onExited:S.onExited},eI().createElement(nr,{open:d,id:x.id,disableWindowBlurListener:v,autoHideDuration:x.autoHideDuration,className:tm(nh.wrappedRoot,h.root,h["anchorOrigin"+tN(x.anchorOrigin)]),SnackbarProps:p,onClose:a},eI().createElement(f,Object.assign({},b,{appear:!0,in:d,onExit:S.onExit,onExited:s,onEnter:S.onEnter,onEntered:nt([S.onEntered,function(){e.snack.requestClose&&a(null,"instructed",e.snack.id)}],x.id)}),w||eI().createElement(void 0===c?nc:c,Object.assign({},x)))))},np=20,nf=6,ng=2,nm="."+t4,nv=t3({root:((aT={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:tX(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"})[nm]={padding:nf+"px 0px",transition:"padding 300ms ease 0ms"},aT.maxWidth="calc(100% - "+2*np+"px)",aT[tE]={width:"100%",maxWidth:"calc(100% - 32px)"},aT),rootDense:((aD={})[nm]={padding:ng+"px 0px"},aD),top:{top:np-nf+"px",flexDirection:"column"},bottom:{bottom:np-nf+"px",flexDirection:"column-reverse"},left:((aI={left:np+"px"})[tR]={alignItems:"flex-start"},aI[tE]={left:"16px"},aI),right:((aO={right:np+"px"})[tR]={alignItems:"flex-end"},aO[tE]={right:"16px"},aO),center:((aP={left:"50%",transform:"translateX(-50%)"})[tR]={alignItems:"center"},aP)}),ny=(0,eD.memo)(function(e){var t=e.classes,n=void 0===t?{}:t,i=e.anchorOrigin,r=e.dense,o=e.children,a=tm("notistack-SnackbarContainer",nv[i.vertical],nv[i.horizontal],nv.root,n.containerRoot,n["containerAnchorOrigin"+tN(i)],r&&nv.rootDense);return eI().createElement("div",{className:a},o)}),nx=function(e){return!("string"==typeof e||(0,eD.isValidElement)(e))},nb=function(e){function t(t){var n;return(n=e.call(this,t)||this).enqueueSnackbar=function(e,t){if(void 0===t&&(t={}),null==e)throw Error("enqueueSnackbar called with invalid argument");var i,r=nx(e)?e:t,o=nx(e)?e.message:e,a=r.key,s=r.preventDuplicate,l=tD(r,["key","preventDuplicate"]),u=tB(a),c=u?a:new Date().getTime()+Math.random(),h=(i=n.props,function(e,t){return(void 0===t&&(t=!1),t)?tk({},t1[e],{},i[e],{},l[e]):"autoHideDuration"===e?t2(l.autoHideDuration,i.autoHideDuration):"transitionDuration"===e?t5(l.transitionDuration,i.transitionDuration):l[e]||i[e]||t1[e]}),d=tk({id:c},l,{message:o,open:!0,entered:!1,requestClose:!1,persist:h("persist"),action:h("action"),content:h("content"),variant:h("variant"),anchorOrigin:h("anchorOrigin"),disableWindowBlurListener:h("disableWindowBlurListener"),autoHideDuration:h("autoHideDuration"),hideIconVariant:h("hideIconVariant"),TransitionComponent:h("TransitionComponent"),transitionDuration:h("transitionDuration"),TransitionProps:h("TransitionProps",!0),iconVariant:h("iconVariant",!0),style:h("style",!0),SnackbarProps:h("SnackbarProps",!0),className:tm(n.props.className,l.className)});return d.persist&&(d.autoHideDuration=void 0),n.setState(function(e){if(void 0===s&&n.props.preventDuplicate||s){var t=function(e){return u?e.id===c:e.message===o},i=e.queue.findIndex(t)>-1,r=e.snacks.findIndex(t)>-1;if(i||r)return e}return n.handleDisplaySnack(tk({},e,{queue:[].concat(e.queue,[d])}))}),c},n.handleDisplaySnack=function(e){return e.snacks.length>=n.maxSnack?n.handleDismissOldest(e):n.processQueue(e)},n.processQueue=function(e){var t=e.queue,n=e.snacks;return t.length>0?tk({},e,{snacks:[].concat(n,[t[0]]),queue:t.slice(1,t.length)}):e},n.handleDismissOldest=function(e){if(e.snacks.some(function(e){return!e.open||e.requestClose}))return e;var t=!1,i=!1;e.snacks.reduce(function(e,t){return e+(t.open&&t.persist?1:0)},0)===n.maxSnack&&(i=!0);var r=e.snacks.map(function(e){return t||e.persist&&!i?tk({},e):(t=!0,e.entered)?(e.onClose&&e.onClose(null,"maxsnack",e.id),n.props.onClose&&n.props.onClose(null,"maxsnack",e.id),tk({},e,{open:!1})):tk({},e,{requestClose:!0})});return tk({},e,{snacks:r})},n.handleEnteredSnack=function(e,t,i){if(!tB(i))throw Error("handleEnteredSnack Cannot be called with undefined key");n.setState(function(e){return{snacks:e.snacks.map(function(e){return e.id===i?tk({},e,{entered:!0}):tk({},e)})}})},n.handleCloseSnack=function(e,t,i){n.props.onClose&&n.props.onClose(e,t,i);var r=void 0===i;n.setState(function(e){var t=e.snacks,n=e.queue;return{snacks:t.map(function(e){return r||e.id===i?e.entered?tk({},e,{open:!1}):tk({},e,{requestClose:!0}):tk({},e)}),queue:n.filter(function(e){return e.id!==i})}})},n.closeSnackbar=function(e){var t=n.state.snacks.find(function(t){return t.id===e});tB(e)&&t&&t.onClose&&t.onClose(null,"instructed",e),n.handleCloseSnack(null,"instructed",e)},n.handleExitedSnack=function(e,t){if(!tB(t))throw Error("handleExitedSnack Cannot be called with undefined key");n.setState(function(e){var i=n.processQueue(tk({},e,{snacks:e.snacks.filter(function(e){return e.id!==t})}));return 0===i.queue.length?i:n.handleDismissOldest(i)})},n.enqueueSnackbar,n.closeSnackbar,n.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:n.enqueueSnackbar.bind(tI(n)),closeSnackbar:n.closeSnackbar.bind(tI(n))}},n}return tT(t,e),t.prototype.render=function(){var e=this,t=this.state.contextValue,n=this.props,i=n.domRoot,r=n.children,o=n.dense,a=void 0!==o&&o,s=n.Components,l=void 0===s?{}:s,u=n.classes,c=this.state.snacks.reduce(function(e,t){var n,i=tN(t.anchorOrigin),r=e[i]||[];return tk({},e,((n={})[i]=[].concat(r,[t]),n))},{}),h=Object.keys(c).map(function(t){var n=c[t],i=n[0];return eI().createElement(ny,{key:t,dense:a,anchorOrigin:i.anchorOrigin,classes:u},n.map(function(t){return eI().createElement(nd,{key:t.id,snack:t,classes:u,Component:l[t.variant],onClose:e.handleCloseSnack,onEnter:e.props.onEnter,onExit:e.props.onExit,onExited:nt([e.handleExitedSnack,e.props.onExited],t.id),onEntered:nt([e.handleEnteredSnack,e.props.onEntered],t.id)})}))});return eI().createElement(tP.Provider,{value:t},r,i?(0,tg.createPortal)(h,i):h)},tA(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||t1.maxSnack}}]),t}(eD.Component);function nw({children:e,...t}){return(0,eb.jsx)(nb,{...t,Components:{error:(0,e7.A)(nc)(()=>({"&.notistack-MuiContent-error":{whiteSpace:"pre-wrap"}}))},children:e})}function nS(){let{enqueueSnackbar:e,closeSnackbar:t}=(0,eD.useContext)(tP),n=n_(e,"error"),i=n_(e,"info"),r=n_(e,"warning"),o=n_(e,"success"),a=(0,eD.useCallback)((e,t)=>n(e instanceof Error?e.message:`An unexpected error occurred: ${e}`,t),[n]);return{enqueueSnackbar:e,closeSnackbar:t,errorSnackbar:n,infoSnackbar:i,warningSnackbar:r,successSnackbar:o,exceptionSnackbar:a}}function n_(e,t){return(0,eD.useCallback)((n,i)=>e(n,{...i,variant:t}),[e,t])}var nM=n(25632);let nC="Pinned Crosshair",nA={name:nC,type:"line",markLine:{data:[],lineStyle:{type:"dashed",width:2},emphasis:{lineStyle:{width:2,opacity:1}},blur:{lineStyle:{width:2,opacity:1}}}};var nk=n(42636),nT=n(94461);function nD(e){return{value:{pastDuration:e},display:`Last ${(0,nT.formatDuration)((0,nk.parseDurationString)(e),{delimiter:", "})}`}}function nI(){return["local","UTC",...Intl.supportedValuesOf?.("timeZone")??[]].filter((e,t,n)=>n.indexOf(e)===t).map(e=>({value:e,display:"local"===e?"Local":e.replace(/_/g," ")}))}function nO(e,t){return"read"===e?"View":t&&"create"===e?"Add":t||"create"!==e?"update"===e?"Edit":"":"Create"}function nP(e,t){return t&&"create"===e?"Add":t&&"update"===e?"Apply":t?"":"Save"}let nE=["bottom","right"],nR=["list","table"],nL=["small","medium"];function nN(e){return nE.includes(e)}function nB(e){return nR.includes(e)}function nF(e){return nL.includes(e)}let nz={position:"bottom",mode:"list",size:"medium"};function nV(e){return void 0===e?nz.position:nN(e)?e:nz.position}function nj(e){return e&&nB(e)?e:nz.mode}function nH(e){return e&&nF(e)?e:nz.size}let nW=new Map([["time",new Map],["decimal",new Map],["bits",new Map],["bytes",new Map],["currency",new Map],["percent",new Map],["temperature",new Map],["throughput",new Map]]);function nG(e,t,n,i="en-US"){let r=`${e.filter(e=>![void 0,null,"",NaN].includes(e)).join("|")}|${i}`,o=nW.get(t);if(!o)throw Error("No formatter found for the input type");let a=o.get(r);if(a)return a.format;let s=Intl.NumberFormat(i,n);return o?.set(`${r}`,s),s.format}let n$=()=>({countCacheItems:e=>"all"!==e?nW.get(e)?.size??0:Array.from(nW.values()).reduce((e,t)=>e+(t?.size??0),0),getKeys:e=>[...nW.get(e)?.keys()||[]]});function nU(e){return!1!==e}function nq(e){return"number"==typeof e}function nY(e){return e&&(e<0?e=0:e>20&&(e=20)),e}let nZ="Time",nX={label:"Time",decimalPlaces:!0},nK={nanoseconds:{group:nZ,label:"Nanoseconds"},microseconds:{group:nZ,label:"Microseconds"},milliseconds:{group:nZ,label:"Milliseconds"},seconds:{group:nZ,label:"Seconds"},minutes:{group:nZ,label:"Minutes"},hours:{group:nZ,label:"Hours"},days:{group:nZ,label:"Days"},weeks:{group:nZ,label:"Weeks"},months:{group:nZ,label:"Months"},years:{group:nZ,label:"Years"}};var nQ=((aC={}).nanoseconds="nanosecond",aC.microseconds="microsecond",aC.milliseconds="millisecond",aC.seconds="second",aC.minutes="minute",aC.hours="hour",aC.days="day",aC.weeks="week",aC.months="month",aC.years="year",aC);let nJ={years:31536e3,months:2592e3,weeks:604800,days:86400,hours:3600,minutes:60,seconds:1,milliseconds:.001,microseconds:1e-6,nanoseconds:1e-9},n0=["years","months","weeks","days","hours","minutes","seconds","milliseconds","microseconds","nanoseconds"];function n1(e,{unit:t,decimalPlaces:n}){var i;if(0===e)return"0s";let r=function(e,t){let n=e*nJ[t],i=n0[0]||"years",r=i,o=n/nJ[i];for(r of n0)if((o=n/nJ[r])>=1)break;return{value:o,unit:r}}(e,t??"seconds"),o={style:"unit",unit:nQ[r.unit],unitDisplay:"months"===(i=r.unit)||"years"===i?"long":"narrow"};return nq(n)?(o.minimumFractionDigits=nY(n),o.maximumFractionDigits=nY(n)):o.maximumSignificantDigits=3,nG([o.style,o.unit,o.unitDisplay,o.maximumSignificantDigits,n,t??"seconds"],"time",o,"en-US")(r.value)}var n2="u">typeof globalThis?globalThis:"u">typeof window?window:void 0!==n.g?n.g:"u">typeof self?self:{};function n5(){if(aN)return aL;aN=1;let e=[{key:"ZiB",factor:11805916207174113e5},{key:"ZB",factor:1e21},{key:"YiB",factor:12089258196146292e8},{key:"YB",factor:1e24},{key:"TiB",factor:0x10000000000},{key:"TB",factor:1e12},{key:"PiB",factor:0x4000000000000},{key:"PB",factor:1e15},{key:"MiB",factor:1048576},{key:"MB",factor:1e6},{key:"KiB",factor:1024},{key:"KB",factor:1e3},{key:"GiB",factor:0x40000000},{key:"GB",factor:1e9},{key:"EiB",factor:0x1000000000000000},{key:"EB",factor:1e18},{key:"B",factor:1}];function t(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}return aL={unformat:function(n,i){let r,o=n6(),a=o.currentDelimiters(),s=o.currentCurrency().symbol,l=o.currentOrdinal(),u=o.getZeroFormat(),c=o.currentAbbreviations();if("string"==typeof n)if(function(e,t){if(!(e.indexOf(":")&&":"!==t.thousands))return!1;let n=e.split(":");if(3!==n.length)return!1;let i=+n[0],r=+n[1],o=+n[2];return!isNaN(i)&&!isNaN(r)&&!isNaN(o)}(n,a)){let e,t,i;t=+(e=n.split(":"))[0],i=+e[1],r=+e[2]+60*i+3600*t}else r=function(n,i,r="",o,a,s){if(""!==n)return n===a?0:function n(i,r,o,a,s,l,u){if(!isNaN(+i))return+i;let c="",h=i.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(h!==i)return -1*n(h,r,o,a,s,l);for(let t=0;t<e.length;t++){let u=e[t];if((c=i.replace(RegExp(`([0-9 ])(${u.key})$`),"$1"))!==i)return n(c,r,o,a,s,l)*u.factor}if((c=i.replace("%",""))!==i)return n(c,r,o,a,s,l)/100;let d=parseFloat(i);if(isNaN(d))return;let p=a(d);if(p&&"."!==p&&(c=i.replace(RegExp(`${t(p)}$`),""))!==i)return n(c,r,o,a,s,l);let f={};Object.keys(l).forEach(e=>{f[l[e]]=e});let g=Object.keys(f).sort().reverse(),m=g.length;for(let e=0;e<m;e++){let t=g[e],u=f[t];if((c=i.replace(t,""))!==i){let e;switch(u){case"thousand":e=1e3;break;case"million":e=1e6;break;case"billion":e=1e9;break;case"trillion":e=1e12}return n(c,r,o,a,s,l)*e}}}(n.replace(r,"").replace(RegExp(`([0-9])${t(i.thousands)}([0-9])`,"g"),"$1$2").replace(i.decimal,"."),i,r,o,a,s)}(n,a,s,l,u,c);else{if("number"!=typeof n)return;r=n}if(void 0!==r)return r}}}function n3(){if(aF)return aB;aF=1;let e=n5(),t=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,n={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:(e,t)=>"byte"===t.output,message:"`base` must be provided only when the output is `byte`",mandatory:e=>"byte"===e.output},characteristic:{type:"number",restriction:e=>e>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",lowPrecision:{type:"boolean",restriction:(e,t)=>!0===t.average,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:e=>e>=0,message:"value must be positive"},{restriction:(e,t)=>!t.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:e=>e>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(e,t)=>"percent"===t.output,message:"`prefixSymbol` can be provided only when the output is `percent`"}},i={languageTag:{type:"string",mandatory:!0,restriction:e=>e.match(t),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:{type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function r(t){return void 0!==e.unformat(t)}function o(e,t,i,r=!1){let a=Object.keys(e).map(r=>{if(!t[r])return console.error(`${i} Invalid key: ${r}`),!1;let a=e[r],s=t[r];if("string"==typeof s&&(s={type:s}),"format"===s.type){if(!o(a,n,`[Validate ${r}]`,!0))return!1}else if(typeof a!==s.type)return console.error(`${i} ${r} type mismatched: "${s.type}" expected, "${typeof a}" provided`),!1;if(s.restrictions&&s.restrictions.length){let t=s.restrictions.length;for(let n=0;n<t;n++){let{restriction:t,message:o}=s.restrictions[n];if(!t(a,e))return console.error(`${i} ${r} invalid value: ${o}`),!1}}return s.restriction&&!s.restriction(a,e)?(console.error(`${i} ${r} invalid value: ${s.message}`),!1):s.validValues&&-1===s.validValues.indexOf(a)?(console.error(`${i} ${r} invalid value: must be among ${JSON.stringify(s.validValues)}, "${a}" provided`),!1):(!s.children||!!o(a,s.children,`[Validate ${r}]`))&&!0});return r||a.push(...Object.keys(t).map(n=>{let r=t[n];if("string"==typeof r&&(r={type:r}),r.mandatory){let t=r.mandatory;if("function"==typeof t&&(t=t(e)),t&&void 0===e[n])return console.error(`${i} Missing mandatory key "${n}"`),!1}return!0})),a.reduce((e,t)=>e&&t,!0)}function a(e){return o(e,n,"[Validate format]")}return aB={validate:function(e,t){let n=r(e),i=a(t);return n&&i},validateFormat:a,validateInput:r,validateLanguage:function(e){return o(e,i,"[Validate language]")}}}var n4=function(e,t={}){var n,i,r,o,a,s;let l,u,c,h,d;if("string"!=typeof e)return e;i=e=(l=(n=e).match(/^{([^}]*)}/))?(t.prefix=l[1],n.slice(l[0].length)):n,function(e,t){if(-1!==e.indexOf("$")){t.output="currency";return}if(-1!==e.indexOf("%")){t.output="percent";return}if(-1!==e.indexOf("bd")){t.output="byte",t.base="general";return}if(-1!==e.indexOf("b")){t.output="byte",t.base="binary";return}if(-1!==e.indexOf("d")){t.output="byte",t.base="decimal";return}if(-1!==e.indexOf(":")){t.output="time";return}-1!==e.indexOf("o")&&(t.output="ordinal")}(e=(u=i.match(/{([^}]*)}$/))?(t.postfix=u[1],i.slice(0,-u[0].length)):i,t),(c=e.match(/[1-9]+[0-9]*/))&&(t.totalLength=+c[0]),(h=e.split(".")[0].match(/0+/))&&(t.characteristic=h[0].length),-1!==(r=e).indexOf(".")&&(t.optionalCharacteristic=-1===r.split(".")[0].indexOf("0")),-1!==e.indexOf("a")&&(t.average=!0),-1!==(o=e).indexOf("K")?t.forceAverage="thousand":-1!==o.indexOf("M")?t.forceAverage="million":-1!==o.indexOf("B")?t.forceAverage="billion":-1!==o.indexOf("T")&&(t.forceAverage="trillion");let p=e.split(".")[1];if(p){let e=p.match(/0+/);e&&(t.mantissa=e[0].length)}return(a=e).match(/\[\.]/)?t.optionalMantissa=!0:a.match(/\./)&&(t.optionalMantissa=!1),(d=e.split(".")[1])&&(t.trimMantissa=-1!==d.indexOf("[")),-1!==e.indexOf(",")&&(t.thousandSeparated=!0),-1!==e.indexOf(" ")&&(t.spaceSeparated=!0,t.spaceSeparatedCurrency=!0,(t.average||t.forceAverage)&&(t.spaceSeparatedAbbreviation=!0)),(s=e).match(/^\+?\([^)]*\)$/)&&(t.negative="parenthesis"),s.match(/^\+?-/)&&(t.negative="sign"),e.match(/^\+/)&&(t.forceSign=!0),t};function n6(){let e;if(aV)return az;aV=1;let t=aR?aE:(aR=1,aE={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(e){let t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),n=n3(),i={},r={},o=null,a={};function s(){return r[e]}return i.languages=()=>Object.assign({},r),i.currentLanguage=()=>e,i.currentBytes=()=>s().bytes||{},i.currentCurrency=()=>s().currency,i.currentAbbreviations=()=>s().abbreviations,i.currentDelimiters=()=>s().delimiters,i.currentOrdinal=()=>s().ordinal,i.currentDefaults=()=>Object.assign({},s().defaults,a),i.currentOrdinalDefaultFormat=()=>Object.assign({},i.currentDefaults(),s().ordinalFormat),i.currentByteDefaultFormat=()=>Object.assign({},i.currentDefaults(),s().byteFormat),i.currentPercentageDefaultFormat=()=>Object.assign({},i.currentDefaults(),s().percentageFormat),i.currentCurrencyDefaultFormat=()=>Object.assign({},i.currentDefaults(),s().currencyFormat),i.currentTimeDefaultFormat=()=>Object.assign({},i.currentDefaults(),s().timeFormat),i.setDefaults=e=>{e=n4(e),n.validateFormat(e)&&(a=e)},i.getZeroFormat=()=>o,i.setZeroFormat=e=>o="string"==typeof e?e:null,i.hasZeroFormat=()=>null!==o,i.languageData=e=>{if(e){if(r[e])return r[e];throw Error(`Unknown tag "${e}"`)}return s()},i.registerLanguage=(t,i=!1)=>{if(!n.validateLanguage(t))throw Error("Invalid language data");r[t.languageTag]=t,i&&(e=t.languageTag)},i.setLanguage=(n,i=t.languageTag)=>{if(!r[n]){let t=n.split("-")[0],o=Object.keys(r).find(e=>e.split("-")[0]===t);return r[o]?void(e=o):void(e=i)}e=n},i.registerLanguage(t),e=t.languageTag,az=i}var n8={exports:{}};(function(e){var t,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,r=Math.floor,o="[BigNumber Error] ",a=o+"Number primitive has more than 15 significant digits: ",s=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13];function l(e){var t=0|e;return e>0||e===t?t:t-1}function u(e){for(var t,n,i=1,r=e.length,o=e[0]+"";i<r;){for(n=14-(t=e[i++]+"").length;n--;t="0"+t);o+=t}for(r=o.length;48===o.charCodeAt(--r););return o.slice(0,r+1||1)}function c(e,t){var n,i,r=e.c,o=t.c,a=e.s,s=t.s,l=e.e,u=t.e;if(!a||!s)return null;if(n=r&&!r[0],i=o&&!o[0],n||i)return n?i?0:-s:a;if(a!=s)return a;if(n=a<0,i=l==u,!r||!o)return i?0:!r^n?1:-1;if(!i)return l>u^n?1:-1;for(a=0,s=(l=r.length)<(u=o.length)?l:u;a<s;a++)if(r[a]!=o[a])return r[a]>o[a]^n?1:-1;return l==u?0:l>u^n?1:-1}function h(e,t,n,i){if(e<t||e>n||e!==r(e))throw Error(o+(i||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function d(e){var t=e.c.length-1;return l(e.e/14)==t&&e.c[t]%2!=0}function p(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function f(e,t,n){var i,r;if(t<0){for(r=n+".";++t;r+=n);e=r+e}else if(i=e.length,++t>i){for(r=n,t-=i;--t;r+=n);e+=r}else t<i&&(e=e.slice(0,t)+"."+e.slice(t));return e}(t=function e(t){var g,m,v,y,x,b,w,S,_,M=F.prototype={constructor:F,toString:null,valueOf:null},C=new F(1),A=20,k=4,T=-7,D=21,I=-1e7,O=1e7,P=!1,E=1,R=0,L={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},N="0123456789abcdefghijklmnopqrstuvwxyz",B=!0;function F(e,t){var i,o,s,l,u,c,d,p,f=this;if(!(f instanceof F))return new F(e,t);if(null==t){if(e&&!0===e._isBigNumber){f.s=e.s,!e.c||e.e>O?f.c=f.e=null:e.e<I?f.c=[f.e=0]:(f.e=e.e,f.c=e.c.slice());return}if((c="number"==typeof e)&&0*e==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,u=e;u>=10;u/=10,l++);l>O?f.c=f.e=null:(f.e=l,f.c=[e]);return}p=String(e)}else{if(!n.test(p=String(e)))return _(f,p,c);f.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(l=p.indexOf("."))>-1&&(p=p.replace(".","")),(u=p.search(/e/i))>0?(l<0&&(l=u),l+=+p.slice(u+1),p=p.substring(0,u)):l<0&&(l=p.length)}else{if(h(t,2,N.length,"Base"),10==t&&B)return H(f=new F(e),A+f.e+1,k);if(p=String(e),c="number"==typeof e){if(0*e!=0)return _(f,p,c,t);if(f.s=1/e<0?(p=p.slice(1),-1):1,F.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(a+e)}else f.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(i=N.slice(0,t),l=u=0,d=p.length;u<d;u++)if(0>i.indexOf(o=p.charAt(u))){if("."==o){if(u>l){l=d;continue}}else if(!s&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){s=!0,u=-1,l=0;continue}return _(f,String(e),c,t)}c=!1,(l=(p=S(p,t,10,f.s)).indexOf("."))>-1?p=p.replace(".",""):l=p.length}for(u=0;48===p.charCodeAt(u);u++);for(d=p.length;48===p.charCodeAt(--d););if(p=p.slice(u,++d)){if(d-=u,c&&F.DEBUG&&d>15&&(e>0x1fffffffffffff||e!==r(e)))throw Error(a+f.s*e);if((l=l-u-1)>O)f.c=f.e=null;else if(l<I)f.c=[f.e=0];else{if(f.e=l,f.c=[],u=(l+1)%14,l<0&&(u+=14),u<d){for(u&&f.c.push(+p.slice(0,u)),d-=14;u<d;)f.c.push(+p.slice(u,u+=14));u=14-(p=p.slice(u)).length}else u-=d;for(;u--;p+="0");f.c.push(+p)}}else f.c=[f.e=0]}function z(e,t,n,i){var r,o,a,s,l;if(null==n?n=k:h(n,0,8),!e.c)return e.toString();if(r=e.c[0],a=e.e,null==t)l=u(e.c),l=1==i||2==i&&(a<=T||a>=D)?p(l,a):f(l,a,"0");else if(o=(e=H(new F(e),t,n)).e,s=(l=u(e.c)).length,1==i||2==i&&(t<=o||o<=T)){for(;s<t;l+="0",s++);l=p(l,o)}else if(t-=a,l=f(l,o,"0"),o+1>s){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=o-s)>0)for(o+1==s&&(l+=".");t--;l+="0");return e.s<0&&r?"-"+l:l}function V(e,t){for(var n,i,r=1,o=new F(e[0]);r<e.length;r++)(i=new F(e[r])).s&&(n=c(o,i))!==t&&(0!==n||o.s!==t)||(o=i);return o}function j(e,t,n){for(var i=1,r=t.length;!t[--r];t.pop());for(r=t[0];r>=10;r/=10,i++);return(n=i+14*n-1)>O?e.c=e.e=null:n<I?e.c=[e.e=0]:(e.e=n,e.c=t),e}function H(e,t,n,o){var a,l,u,c,h,d,p,f=e.c;if(f){e:{for(a=1,c=f[0];c>=10;c/=10,a++);if((l=t-a)<0)l+=14,u=t,p=r((h=f[d=0])/s[a-u-1]%10);else if((d=i((l+1)/14))>=f.length)if(o){for(;f.length<=d;f.push(0));h=p=0,a=1,l%=14,u=l-14+1}else break e;else{for(a=1,h=c=f[d];c>=10;c/=10,a++);l%=14,p=(u=l-14+a)<0?0:r(h/s[a-u-1]%10)}if(o=o||t<0||null!=f[d+1]||(u<0?h:h%s[a-u-1]),o=n<4?(p||o)&&(0==n||n==(e.s<0?3:2)):p>5||5==p&&(4==n||o||6==n&&(l>0?u>0?h/s[a-u]:0:f[d-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,o?(t-=e.e+1,f[0]=s[(14-t%14)%14],e.e=-t||0):f[0]=e.e=0,e;if(0==l?(f.length=d,c=1,d--):(f.length=d+1,c=s[14-l],f[d]=u>0?r(h/s[a-u]%s[u])*c:0),o)for(;;)if(0==d){for(l=1,u=f[0];u>=10;u/=10,l++);for(u=f[0]+=c,c=1;u>=10;u/=10,c++);l!=c&&(e.e++,1e14==f[0]&&(f[0]=1));break}else{if(f[d]+=c,1e14!=f[d])break;f[d--]=0,c=1}for(l=f.length;0===f[--l];f.pop());}e.e>O?e.c=e.e=null:e.e<I&&(e.c=[e.e=0])}return e}function W(e){var t,n=e.e;return null===n?e.toString():(t=u(e.c),t=n<=T||n>=D?p(t,n):f(t,n,"0"),e.s<0?"-"+t:t)}return F.clone=e,F.ROUND_UP=0,F.ROUND_DOWN=1,F.ROUND_CEIL=2,F.ROUND_FLOOR=3,F.ROUND_HALF_UP=4,F.ROUND_HALF_DOWN=5,F.ROUND_HALF_EVEN=6,F.ROUND_HALF_CEIL=7,F.ROUND_HALF_FLOOR=8,F.EUCLID=9,F.config=F.set=function(e){var t,n;if(null!=e)if("object"==typeof e){if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(h(n=e[t],0,1e9,t),A=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(h(n=e[t],0,8,t),k=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(h(n[0],-1e9,0,t),h(n[1],0,1e9,t),T=n[0],D=n[1]):(h(n,-1e9,1e9,t),T=-(D=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)h(n[0],-1e9,-1,t),h(n[1],1,1e9,t),I=n[0],O=n[1];else if(h(n,-1e9,1e9,t),n)I=-(O=n<0?-n:n);else throw Error(o+t+" cannot be zero: "+n);if(e.hasOwnProperty(t="CRYPTO"))if(!!(n=e[t])===n)if(n)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))P=n;else throw P=!n,Error(o+"crypto unavailable");else P=n;else throw Error(o+t+" not true or false: "+n);if(e.hasOwnProperty(t="MODULO_MODE")&&(h(n=e[t],0,9,t),E=n),e.hasOwnProperty(t="POW_PRECISION")&&(h(n=e[t],0,1e9,t),R=n),e.hasOwnProperty(t="FORMAT"))if("object"==typeof(n=e[t]))L=n;else throw Error(o+t+" not an object: "+n);if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(o+t+" invalid: "+n);B="0123456789"==n.slice(0,10),N=n}}else throw Error(o+"Object expected: "+e);return{DECIMAL_PLACES:A,ROUNDING_MODE:k,EXPONENTIAL_AT:[T,D],RANGE:[I,O],CRYPTO:P,MODULO_MODE:E,POW_PRECISION:R,FORMAT:L,ALPHABET:N}},F.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!F.DEBUG)return!0;var t,n,i=e.c,a=e.e,s=e.s;e:if("[object Array]"==({}).toString.call(i)){if((1===s||-1===s)&&a>=-1e9&&a<=1e9&&a===r(a)){if(0===i[0]){if(0===a&&1===i.length)return!0;break e}if((t=(a+1)%14)<1&&(t+=14),String(i[0]).length==t){for(t=0;t<i.length;t++)if((n=i[t])<0||n>=1e14||n!==r(n))break e;if(0!==n)return!0}}}else if(null===i&&null===a&&(null===s||1===s||-1===s))return!0;throw Error(o+"Invalid BigNumber: "+e)},F.maximum=F.max=function(){return V(arguments,-1)},F.minimum=F.min=function(){return V(arguments,1)},g=0x20000000000000*Math.random()&2097151?function(){return r(0x20000000000000*Math.random())}:function(){return(0x40000000*Math.random()|0)*8388608+(8388608*Math.random()|0)},F.random=function(e){var t,n,a,l,u,c=0,d=[],p=new F(C);if(null==e?e=A:h(e,0,1e9),l=i(e/14),P)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(l*=2));c<l;)(u=131072*t[c]+(t[c+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[c]=n[0],t[c+1]=n[1]):(d.push(u%1e14),c+=2);c=l/2}else if(crypto.randomBytes){for(t=crypto.randomBytes(l*=7);c<l;)(u=(31&t[c])*0x1000000000000+0x10000000000*t[c+1]+0x100000000*t[c+2]+0x1000000*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])>=9e15?crypto.randomBytes(7).copy(t,c):(d.push(u%1e14),c+=7);c=l/7}else throw P=!1,Error(o+"crypto unavailable");if(!P)for(;c<l;)(u=g())<9e15&&(d[c++]=u%1e14);for(l=d[--c],e%=14,l&&e&&(u=s[14-e],d[c]=r(l/u)*u);0===d[c];d.pop(),c--);if(c<0)d=[a=0];else{for(a=-1;0===d[0];d.splice(0,1),a-=14);for(c=1,u=d[0];u>=10;u/=10,c++);c<14&&(a-=14-c)}return p.e=a,p.c=d,p},F.sum=function(){for(var e=1,t=arguments,n=new F(t[0]);e<t.length;)n=n.plus(t[e++]);return n},S=function(){var e="0123456789";function t(e,t,n,i){for(var r,o,a=[0],s=0,l=e.length;s<l;){for(o=a.length;o--;a[o]*=t);for(a[0]+=i.indexOf(e.charAt(s++)),r=0;r<a.length;r++)a[r]>n-1&&(null==a[r+1]&&(a[r+1]=0),a[r+1]+=a[r]/n|0,a[r]%=n)}return a.reverse()}return function(n,i,r,o,a){var s,l,c,h,d,p,g,m,v=n.indexOf("."),y=A,x=k;for(v>=0&&(h=R,R=0,n=n.replace(".",""),p=(m=new F(i)).pow(n.length-v),R=h,m.c=t(f(u(p.c),p.e,"0"),10,r,e),m.e=m.c.length),c=h=(g=t(n,i,r,a?(s=N,e):(s=e,N))).length;0==g[--h];g.pop());if(!g[0])return s.charAt(0);if(v<0?--c:(p.c=g,p.e=c,p.s=o,g=(p=w(p,m,y,x,r)).c,d=p.r,c=p.e),v=g[l=c+y+1],h=r/2,d=d||l<0||null!=g[l+1],d=x<4?(null!=v||d)&&(0==x||x==(p.s<0?3:2)):v>h||v==h&&(4==x||d||6==x&&1&g[l-1]||x==(p.s<0?8:7)),l<1||!g[0])n=d?f(s.charAt(1),-y,s.charAt(0)):s.charAt(0);else{if(g.length=l,d)for(--r;++g[--l]>r;)g[l]=0,l||(++c,g=[1].concat(g));for(h=g.length;!g[--h];);for(v=0,n="";v<=h;n+=s.charAt(g[v++]));n=f(n,c,s.charAt(0))}return n}}(),w=function(){function e(e,t,n){var i,r,o,a,s=0,l=e.length,u=t%1e7,c=t/1e7|0;for(e=e.slice();l--;)i=c*(o=e[l]%1e7)+(a=e[l]/1e7|0)*u,s=((r=u*o+i%1e7*1e7+s)/n|0)+(i/1e7|0)+c*a,e[l]=r%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,i){var r,o;if(n!=i)o=n>i?1:-1;else for(r=o=0;r<n;r++)if(e[r]!=t[r]){o=e[r]>t[r]?1:-1;break}return o}function n(e,t,n,i){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*i+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(i,o,a,s,u){var c,h,d,p,f,g,m,v,y,x,b,w,S,_,M,C,A,k=i.s==o.s?1:-1,T=i.c,D=o.c;if(!T||!T[0]||!D||!D[0])return new F(!i.s||!o.s||(T?D&&T[0]==D[0]:!D)?NaN:T&&0==T[0]||!D?0*k:k/0);for(y=(v=new F(k)).c=[],k=a+(h=i.e-o.e)+1,u||(u=1e14,h=l(i.e/14)-l(o.e/14),k=k/14|0),d=0;D[d]==(T[d]||0);d++);if(D[d]>(T[d]||0)&&h--,k<0)y.push(1),p=!0;else{for(_=T.length,C=D.length,d=0,k+=2,(f=r(u/(D[0]+1)))>1&&(D=e(D,f,u),T=e(T,f,u),C=D.length,_=T.length),S=C,b=(x=T.slice(0,C)).length;b<C;x[b++]=0);A=[0].concat(A=D.slice()),M=D[0],D[1]>=u/2&&M++;do{if(f=0,(c=t(D,x,C,b))<0){if(w=x[0],C!=b&&(w=w*u+(x[1]||0)),(f=r(w/M))>1)for(f>=u&&(f=u-1),m=(g=e(D,f,u)).length,b=x.length;1==t(g,x,m,b);)f--,n(g,C<m?A:D,m,u),m=g.length,c=1;else 0==f&&(c=f=1),m=(g=D.slice()).length;if(m<b&&(g=[0].concat(g)),n(x,g,b,u),b=x.length,-1==c)for(;1>t(D,x,C,b);)f++,n(x,C<b?A:D,b,u),b=x.length}else 0===c&&(f++,x=[0]);y[d++]=f,x[0]?x[b++]=T[S]||0:(x=[T[S]],b=1)}while((S++<_||null!=x[0])&&k--);p=null!=x[0],y[0]||y.splice(0,1)}if(1e14==u){for(d=1,k=y[0];k>=10;k/=10,d++);H(v,a+(v.e=d+14*h-1)+1,s,p)}else v.e=h,v.r=+p;return v}}(),m=/^(-?)0([xbo])(?=\w[\w.]*$)/i,v=/^([^.]+)\.$/,y=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,b=/^\s*\+(?=[\w.])|^\s+|\s+$/g,_=function(e,t,n,i){var r,a=n?t:t.replace(b,"");if(x.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!n&&(a=a.replace(m,function(e,t,n){return r="x"==(n=n.toLowerCase())?16:"b"==n?2:8,i&&i!=r?e:t}),i&&(r=i,a=a.replace(v,"$1").replace(y,"0.$1")),t!=a))return new F(a,r);if(F.DEBUG)throw Error(o+"Not a"+(i?" base "+i:"")+" number: "+t);e.s=null}e.c=e.e=null},M.absoluteValue=M.abs=function(){var e=new F(this);return e.s<0&&(e.s=1),e},M.comparedTo=function(e,t){return c(this,new F(e,t))},M.decimalPlaces=M.dp=function(e,t){var n,i,r;if(null!=e)return h(e,0,1e9),null==t?t=k:h(t,0,8),H(new F(this),e+this.e+1,t);if(!(n=this.c))return null;if(i=((r=n.length-1)-l(this.e/14))*14,r=n[r])for(;r%10==0;r/=10,i--);return i<0&&(i=0),i},M.dividedBy=M.div=function(e,t){return w(this,new F(e,t),A,k)},M.dividedToIntegerBy=M.idiv=function(e,t){return w(this,new F(e,t),0,1)},M.exponentiatedBy=M.pow=function(e,t){var n,a,s,l,u,c,h,p,f,g=this;if((e=new F(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+W(e));if(null!=t&&(t=new F(t)),c=e.e>14,!g.c||!g.c[0]||1==g.c[0]&&!g.e&&1==g.c.length||!e.c||!e.c[0])return f=new F(Math.pow(+W(g),c?e.s*(2-d(e)):+W(e))),t?f.mod(t):f;if(h=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new F(NaN);(a=!h&&g.isInteger()&&t.isInteger())&&(g=g.mod(t))}else{if(e.e>9&&(g.e>0||g.e<-1||(0==g.e?g.c[0]>1||c&&g.c[1]>=24e7:g.c[0]<8e13||c&&g.c[0]<=9999975e7)))return l=g.s<0&&d(e)?-0:0,g.e>-1&&(l=1/l),new F(h?1/l:l);R&&(l=i(R/14+2))}for(c?(n=new F(.5),h&&(e.s=1),p=d(e)):p=(s=Math.abs(+W(e)))%2,f=new F(C);;){if(p){if(!(f=f.times(g)).c)break;l?f.c.length>l&&(f.c.length=l):a&&(f=f.mod(t))}if(s){if(0===(s=r(s/2)))break;p=s%2}else if(H(e=e.times(n),e.e+1,1),e.e>14)p=d(e);else{if(0==(s=+W(e)))break;p=s%2}g=g.times(g),l?g.c&&g.c.length>l&&(g.c.length=l):a&&(g=g.mod(t))}return a?f:(h&&(f=C.div(f)),t?f.mod(t):l?H(f,R,k,u):f)},M.integerValue=function(e){var t=new F(this);return null==e?e=k:h(e,0,8),H(t,t.e+1,e)},M.isEqualTo=M.eq=function(e,t){return 0===c(this,new F(e,t))},M.isFinite=function(){return!!this.c},M.isGreaterThan=M.gt=function(e,t){return c(this,new F(e,t))>0},M.isGreaterThanOrEqualTo=M.gte=function(e,t){return 1===(t=c(this,new F(e,t)))||0===t},M.isInteger=function(){return!!this.c&&l(this.e/14)>this.c.length-2},M.isLessThan=M.lt=function(e,t){return 0>c(this,new F(e,t))},M.isLessThanOrEqualTo=M.lte=function(e,t){return -1===(t=c(this,new F(e,t)))||0===t},M.isNaN=function(){return!this.s},M.isNegative=function(){return this.s<0},M.isPositive=function(){return this.s>0},M.isZero=function(){return!!this.c&&0==this.c[0]},M.minus=function(e,t){var n,i,r,o,a=this.s;if(t=(e=new F(e,t)).s,!a||!t)return new F(NaN);if(a!=t)return e.s=-t,this.plus(e);var s=this.e/14,u=e.e/14,c=this.c,h=e.c;if(!s||!u){if(!c||!h)return c?(e.s=-t,e):new F(h?this:NaN);if(!c[0]||!h[0])return h[0]?(e.s=-t,e):new F(c[0]?this:3==k?-0:0)}if(s=l(s),u=l(u),c=c.slice(),a=s-u){for((o=a<0)?(a=-a,r=c):(u=s,r=h),r.reverse(),t=a;t--;r.push(0));r.reverse()}else for(i=(o=(a=c.length)<(t=h.length))?a:t,a=t=0;t<i;t++)if(c[t]!=h[t]){o=c[t]<h[t];break}if(o&&(r=c,c=h,h=r,e.s=-e.s),(t=(i=h.length)-(n=c.length))>0)for(;t--;c[n++]=0);for(t=1e14-1;i>a;){if(c[--i]<h[i]){for(n=i;n&&!c[--n];c[n]=t);--c[n],c[i]+=1e14}c[i]-=h[i]}for(;0==c[0];c.splice(0,1),--u);return c[0]?j(e,c,u):(e.s=3==k?-1:1,e.c=[e.e=0],e)},M.modulo=M.mod=function(e,t){var n,i;return(e=new F(e,t),this.c&&e.s&&(!e.c||e.c[0]))?e.c&&(!this.c||this.c[0])?(9==E?(i=e.s,e.s=1,n=w(this,e,0,3),e.s=i,n.s*=i):n=w(this,e,0,E),(e=this.minus(n.times(e))).c[0]||1!=E||(e.s=this.s),e):new F(this):new F(NaN)},M.multipliedBy=M.times=function(e,t){var n,i,r,o,a,s,u,c,h,d,p,f,g,m=this.c,v=(e=new F(e,t)).c;if(!m||!v||!m[0]||!v[0])return this.s&&e.s&&(!m||m[0]||v)&&(!v||v[0]||m)?(e.s*=this.s,m&&v?(e.c=[0],e.e=0):e.c=e.e=null):e.c=e.e=e.s=null,e;for(i=l(this.e/14)+l(e.e/14),e.s*=this.s,(u=m.length)<(d=v.length)&&(g=m,m=v,v=g,r=u,u=d,d=r),r=u+d,g=[];r--;g.push(0));for(r=d;--r>=0;){for(n=0,p=v[r]%1e7,f=v[r]/1e7|0,o=r+(a=u);o>r;)s=f*(c=m[--a]%1e7)+(h=m[a]/1e7|0)*p,n=((c=p*c+s%1e7*1e7+g[o]+n)/1e14|0)+(s/1e7|0)+f*h,g[o--]=c%1e14;g[o]=n}return n?++i:g.splice(0,1),j(e,g,i)},M.negated=function(){var e=new F(this);return e.s=-e.s||null,e},M.plus=function(e,t){var n,i=this.s;if(t=(e=new F(e,t)).s,!i||!t)return new F(NaN);if(i!=t)return e.s=-t,this.minus(e);var r=this.e/14,o=e.e/14,a=this.c,s=e.c;if(!r||!o){if(!a||!s)return new F(i/0);if(!a[0]||!s[0])return s[0]?e:new F(a[0]?this:0*i)}if(r=l(r),o=l(o),a=a.slice(),i=r-o){for(i>0?(o=r,n=s):(i=-i,n=a),n.reverse();i--;n.push(0));n.reverse()}for((i=a.length)-(t=s.length)<0&&(n=s,s=a,a=n,t=i),i=0;t;)i=(a[--t]=a[t]+s[t]+i)/1e14|0,a[t]=1e14===a[t]?0:a[t]%1e14;return i&&(a=[i].concat(a),++o),j(e,a,o)},M.precision=M.sd=function(e,t){var n,i,r;if(null!=e&&!!e!==e)return h(e,1,1e9),null==t?t=k:h(t,0,8),H(new F(this),e,t);if(!(n=this.c))return null;if(i=14*(r=n.length-1)+1,r=n[r]){for(;r%10==0;r/=10,i--);for(r=n[0];r>=10;r/=10,i++);}return e&&this.e+1>i&&(i=this.e+1),i},M.shiftedBy=function(e){return h(e,-0x1fffffffffffff,0x1fffffffffffff),this.times("1e"+e)},M.squareRoot=M.sqrt=function(){var e,t,n,i,r,o=this.c,a=this.s,s=this.e,c=A+4,h=new F("0.5");if(1!==a||!o||!o[0])return new F(!a||a<0&&(!o||o[0])?NaN:o?this:1/0);if(0==(a=Math.sqrt(+W(this)))||a==1/0?(((t=u(o)).length+s)%2==0&&(t+="0"),a=Math.sqrt(+t),s=l((s+1)/2)-(s<0||s%2),n=new F(t=a==1/0?"5e"+s:(t=a.toExponential()).slice(0,t.indexOf("e")+1)+s)):n=new F(a+""),n.c[0]){for((a=(s=n.e)+c)<3&&(a=0);;)if(r=n,n=h.times(r.plus(w(this,r,c,1))),u(r.c).slice(0,a)===(t=u(n.c)).slice(0,a)){if(n.e<s&&--a,"9999"!=(t=t.slice(a-3,a+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(H(n,n.e+A+2,1),e=!n.times(n).eq(this));break}if(!i&&(H(r,r.e+A+2,0),r.times(r).eq(this))){n=r;break}c+=4,a+=4,i=1}}return H(n,n.e+A+1,k,e)},M.toExponential=function(e,t){return null!=e&&(h(e,0,1e9),e++),z(this,e,t,1)},M.toFixed=function(e,t){return null!=e&&(h(e,0,1e9),e=e+this.e+1),z(this,e,t)},M.toFormat=function(e,t,n){var i;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=L;else if("object"!=typeof n)throw Error(o+"Argument not an object: "+n);if(i=this.toFixed(e,t),this.c){var r,a=i.split("."),s=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||"",c=a[0],h=a[1],d=this.s<0,p=d?c.slice(1):c,f=p.length;if(l&&(r=s,s=l,l=r,f-=r),s>0&&f>0){for(r=f%s||s,c=p.substr(0,r);r<f;r+=s)c+=u+p.substr(r,s);l>0&&(c+=u+p.slice(r)),d&&(c="-"+c)}i=h?c+(n.decimalSeparator||"")+((l=+n.fractionGroupSize)?h.replace(RegExp("\\d{"+l+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):h):c}return(n.prefix||"")+i+(n.suffix||"")},M.toFraction=function(e){var t,n,i,r,a,l,c,h,d,p,f,g,m=this.c;if(null!=e&&(!(c=new F(e)).isInteger()&&(c.c||1!==c.s)||c.lt(C)))throw Error(o+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+W(c));if(!m)return new F(this);for(t=new F(C),d=n=new F(C),i=h=new F(C),g=u(m),a=t.e=g.length-this.e-1,t.c[0]=s[(l=a%14)<0?14+l:l],e=!e||c.comparedTo(t)>0?a>0?t:d:c,l=O,O=1/0,c=new F(g),h.c[0]=0;p=w(c,t,0,1),1!=(r=n.plus(p.times(i))).comparedTo(e);)n=i,i=r,d=h.plus(p.times(r=d)),h=r,t=c.minus(p.times(r=t)),c=r;return r=w(e.minus(n),i,0,1),h=h.plus(r.times(d)),n=n.plus(r.times(i)),h.s=d.s=this.s,a*=2,f=1>w(d,i,a,k).minus(this).abs().comparedTo(w(h,n,a,k).minus(this).abs())?[d,i]:[h,n],O=l,f},M.toNumber=function(){return+W(this)},M.toPrecision=function(e,t){return null!=e&&h(e,1,1e9),z(this,e,t,2)},M.toString=function(e){var t,n=this,i=n.s,r=n.e;return null===r?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=r<=T||r>=D?p(u(n.c),r):f(u(n.c),r,"0"):10===e&&B?t=f(u((n=H(new F(n),A+r+1,k)).c),n.e,"0"):(h(e,2,N.length,"Base"),t=S(f(u(n.c),r,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},M.valueOf=M.toJSON=function(){return W(this)},M._isBigNumber=!0,null!=t&&F.set(t),F}()).default=t.BigNumber=t,n8.exports?n8.exports=t:(e||(e="u">typeof self&&self?self:window),e.BigNumber=t)})(n2);var n9=n8.exports;let n7=n6(),ie=n3(),it={trillion:1e12,billion:1e9,million:1e6,thousand:1e3},ii={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:ir,decimalSuffixes:io}=n7.currentBytes(),ia={scale:1024,suffixes:io,marker:"bd"},is={scale:1024,suffixes:ir,marker:"b"},il={scale:1e3,suffixes:io,marker:"d"};function iu(e,t,n){let i=t[0],r=Math.abs(e);if(r>=n){for(let o=1;o<t.length;++o){let a=Math.pow(n,o),s=Math.pow(n,o+1);if(r>=a&&r<s){i=t[o],e/=a;break}}i===t[0]&&(e/=Math.pow(n,t.length-1),i=t[t.length-1])}return{value:e,suffix:i}}function ic(e){let t="";for(let n=0;n<e;n++)t+="0";return t}function ih({instance:e,providedFormat:t,state:n=n7,decimalSeparator:i,defaults:r=n.currentDefaults()}){var o,a,s,l,u;let c,h,d,p,f,g,m,v=e._value;if(0===v&&n.hasZeroFormat())return n.getZeroFormat();if(!isFinite(v))return v.toString();let y=Object.assign({},ii,r,t),x=y.totalLength,b=x?0:y.characteristic,w=y.optionalCharacteristic,S=y.forceAverage,_=y.lowPrecision,M=!!x||!!S||y.average,C=x?-1:M&&void 0===t.mantissa?0:y.mantissa,A=!x&&(void 0===t.optionalMantissa?-1===C:y.optionalMantissa),k=y.trimMantissa,T=y.thousandSeparated,D=y.spaceSeparated,I=y.negative,O=y.forceSign,P=y.exponential,E=y.roundingFunction,R="";if(M){let e=function({value:e,forceAverage:t,lowPrecision:n=!0,abbreviations:i,spaceSeparated:r=!1,totalLength:o=0,roundingFunction:a=Math.round}){let s="",l=Math.abs(e),u=-1;if(t&&i[t]&&it[t]?(s=i[t],e/=it[t]):l>=it.trillion||n&&1===a(l/it.trillion)?(s=i.trillion,e/=it.trillion):l<it.trillion&&l>=it.billion||n&&1===a(l/it.billion)?(s=i.billion,e/=it.billion):l<it.billion&&l>=it.million||n&&1===a(l/it.million)?(s=i.million,e/=it.million):(l<it.million&&l>=it.thousand||n&&1===a(l/it.thousand))&&(s=i.thousand,e/=it.thousand),s&&(s=(r?" ":"")+s),o){let t=e<0,n=e.toString().split(".")[0];u=Math.max(o-(t?n.length-1:n.length),0)}return{value:e,abbreviation:s,mantissaPrecision:u}}({value:v,forceAverage:S,lowPrecision:_,abbreviations:n.currentAbbreviations(),spaceSeparated:D,roundingFunction:E,totalLength:x});v=e.value,R+=e.abbreviation,x&&(C=e.mantissaPrecision)}if(P){let e=function({value:e,characteristicPrecision:t}){let[n,i]=e.toExponential().split("e"),r=+n;return t&&1<t&&(r*=Math.pow(10,t-1),i-=t-1,i=i>=0?`+${i}`:i),{value:r,abbreviation:`e${i}`}}({value:v,characteristicPrecision:b});v=e.value,R=e.abbreviation+R}let L=function(e,t,n,i,r,o){if(-1===i)return e;let a=function(e,t,n=Math.round){return -1!==e.toString().indexOf("e")?function(e,t){let n=e.toString(),[i,r]=n.split("e"),[o,a=""]=i.split(".");if(+r>0)n=o+a+ic(r-a.length);else{let e=".";e=0>+o?`-0${e}`:`0${e}`;let i=(ic(-r-1)+Math.abs(o)+a).substr(0,t);i.length<t&&(i+=ic(t-i.length)),n=e+i}return+r>0&&t>0&&(n+=`.${ic(t)}`),n}(e,t):new n9(n(+`${e}e+${t}`)/Math.pow(10,t)).toFixed(t)}(t,i,o),[s,l=""]=a.toString().split(".");if(l.match(/^0+$/)&&(n||r))return s;let u=l.match(/0+$/);return r&&u?`${s}.${l.toString().slice(0,u.index)}`:a.toString()}(v.toString(),v,A,C,k,E);return o=L=function(e,t,n,i){let r=e,[o,a]=r.toString().split(".");if(o.match(/^-?0$/)&&n)return a?`${o.replace("0","")}.${a}`:o.replace("0","");let s=t<0&&0===o.indexOf("-");if(s&&(o=o.slice(1),r=r.slice(1)),o.length<i){let e=i-o.length;for(let t=0;t<e;t++)r=`0${r}`}return s&&(r=`-${r}`),r.toString()}(L,v,w,b),a=v,s=i,h=(c=n.currentDelimiters()).thousands,s=s||c.decimal,d=c.thousandsSize||3,f=(p=o.toString()).split(".")[0],g=p.split(".")[1],m=a<0&&0===f.indexOf("-"),T&&(m&&(f=f.slice(1)),(function(e,t){let n=[],i=0;for(let r=e;r>0;r--)i===t&&(n.unshift(r),i=0),i++;return n})(f.length,d).forEach((e,t)=>{f=f.slice(0,e+t)+h+f.slice(e+t)}),m&&(f=`-${f}`)),L=p=g?f+s+g:f,(M||P)&&(L+=R),(O||v<0)&&(l=L,L=0===(u=v)?l:0==+l?l.replace("-",""):u>0?`+${l}`:"sign"===I?l:`(${l.replace("-","")})`),L}function id(e,t){if(!e)return t;let n=Object.keys(e);return 1===n.length&&"output"===n[0]?t:e}function ip(e,t,n){let i=new n9(e._value),r=t;return n.isNumbro(t)&&(r=t._value),r=new n9(r),e._value=i.minus(r).toNumber(),e}let ig=n6(),im=n3(),iv={loadLanguagesInNode:e=>{e.forEach(e=>{let t;try{t=function(e){throw Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(`../languages/${e}`)}catch(t){console.error(`Unable to load "${e}". No matching language file found.`)}t&&i_.registerLanguage(t)})}},iy=n5(),ix={format:(...e)=>(function(e,t={},n){if("string"==typeof t&&(t=n4(t)),!ie.validateFormat(t))return"ERROR: invalid format";let i=t.prefix||"",r=t.postfix||"",o=function(e,t,n){var i,r,o;switch(t.output){case"currency":let a,s,l,u,c,h,d,p,f,g;return i=t=id(t,n7.currentCurrencyDefaultFormat()),a=n7.currentCurrency(),l=Object.assign({},ii,s=Object.assign({},i)),c="",h=!!l.totalLength||!!l.forceAverage||l.average,d=s.currencyPosition||a.position,p=s.currencySymbol||a.symbol,f=void 0!==l.spaceSeparatedCurrency?l.spaceSeparatedCurrency:l.spaceSeparated,void 0===s.lowPrecision&&(s.lowPrecision=!1),f&&(c=" "),"infix"===d&&(u=c+p+c),g=ih({instance:e,providedFormat:s,state:n7,decimalSeparator:u}),"prefix"===d&&(g=e._value<0&&"sign"===l.negative?`-${c}${p}${g.slice(1)}`:e._value>0&&l.forceSign?`+${c}${p}${g.slice(1)}`:p+c+g),d&&"postfix"!==d||(g=g+(c=!l.spaceSeparatedAbbreviation&&h?"":c)+p),g;case"percent":let m,v,y;return r=t=id(t,n7.currentPercentageDefaultFormat()),m=r.prefixSymbol,v=ih({instance:n(100*e._value),providedFormat:r,state:n7}),y=Object.assign({},ii,r),m?`%${y.spaceSeparated?" ":""}${v}`:`${v}${y.spaceSeparated?" ":""}%`;case"byte":return function(e,t,n,i){let r=t.base||"binary",o=Object.assign({},ii,t),{binarySuffixes:a,decimalSuffixes:s}=n.currentBytes(),l={general:{scale:1024,suffixes:s||io,marker:"bd"},binary:{scale:1024,suffixes:a||ir,marker:"b"},decimal:{scale:1e3,suffixes:s||io,marker:"d"}}[r],{value:u,suffix:c}=iu(e._value,l.suffixes,l.scale),h=ih({instance:i(u),providedFormat:t,state:n,defaults:n.currentByteDefaultFormat()});return`${h}${o.spaceSeparated?" ":""}${c}`}(e,t=id(t,n7.currentByteDefaultFormat()),n7,n);case"time":let x,b,w;return t=id(t,n7.currentTimeDefaultFormat()),x=Math.floor(e._value/60/60),b=Math.floor((e._value-60*x*60)/60),w=Math.round(e._value-60*x*60-60*b),`${x}:${b<10?"0":""}${b}:${w<10?"0":""}${w}`;case"ordinal":let S,_,M,C;return o=t=id(t,n7.currentOrdinalDefaultFormat()),S=n7.currentOrdinal(),_=Object.assign({},ii,o),M=ih({instance:e,providedFormat:o,state:n7}),C=S(e._value),`${M}${_.spaceSeparated?" ":""}${C}`;default:return ih({instance:e,providedFormat:t,numbro:n})}}(e,t,n);return(o=i+o)+r})(...e,i_),getByteUnit:(...e)=>(function(e){return iu(e._value,ia.suffixes,ia.scale).suffix})(...e),getBinaryByteUnit:(...e)=>(function(e){return iu(e._value,is.suffixes,is.scale).suffix})(...e),getDecimalByteUnit:(...e)=>(function(e){return iu(e._value,il.suffixes,il.scale).suffix})(...e),formatOrDefault:id},ib={add:(e,t)=>{let n,i;return n=new n9(e._value),i=t,i_.isNumbro(t)&&(i=t._value),i=new n9(i),e._value=n.plus(i).toNumber(),e},subtract:(e,t)=>ip(e,t,i_),multiply:(e,t)=>{let n,i;return n=new n9(e._value),i=t,i_.isNumbro(t)&&(i=t._value),i=new n9(i),e._value=n.times(i).toNumber(),e},divide:(e,t)=>{let n,i;return n=new n9(e._value),i=t,i_.isNumbro(t)&&(i=t._value),i=new n9(i),e._value=n.dividedBy(i).toNumber(),e},set:(e,t)=>{let n;return n=t,i_.isNumbro(t)&&(n=t._value),e._value=n,e},difference:(e,t)=>{let n;return ip(n=i_(e._value),t,i_),Math.abs(n._value)},BigNumber:n9};class iw{constructor(e){this._value=e}clone(){return i_(this._value)}format(e={}){return ix.format(this,e)}formatCurrency(e){return"string"==typeof e&&(e=n4(e)),(e=ix.formatOrDefault(e,ig.currentCurrencyDefaultFormat())).output="currency",ix.format(this,e)}formatTime(e={}){return e.output="time",ix.format(this,e)}binaryByteUnits(){return ix.getBinaryByteUnit(this)}decimalByteUnits(){return ix.getDecimalByteUnit(this)}byteUnits(){return ix.getByteUnit(this)}difference(e){return ib.difference(this,e)}add(e){return ib.add(this,e)}subtract(e){return ib.subtract(this,e)}multiply(e){return ib.multiply(this,e)}divide(e){return ib.divide(this,e)}set(e){return ib.set(this,iS(e))}value(){return this._value}valueOf(){return this._value}}function iS(e){let t=e;return i_.isNumbro(e)?t=e._value:"string"==typeof e?t=i_.unformat(e):isNaN(e)&&(t=NaN),t}function i_(e){return new iw(iS(e))}i_.version="2.5.0",i_.isNumbro=function(e){return e instanceof iw},i_.language=ig.currentLanguage,i_.registerLanguage=ig.registerLanguage,i_.setLanguage=ig.setLanguage,i_.languages=ig.languages,i_.languageData=ig.languageData,i_.zeroFormat=ig.setZeroFormat,i_.defaultFormat=ig.currentDefaults,i_.setDefaults=ig.setDefaults,i_.defaultCurrencyFormat=ig.currentCurrencyDefaultFormat,i_.validate=im.validate,i_.loadLanguagesInNode=iv.loadLanguagesInNode,i_.unformat=iy.unformat,i_.BigNumber=ib.BigNumber;var iM=i_&&i_.__esModule&&Object.prototype.hasOwnProperty.call(i_,"default")?i_.default:i_;let iC={label:"Bits",decimalPlaces:!0,shortValues:!0},iA={bits:{group:"Bits",label:"Bits (IEC)"},decbits:{group:"Bits",label:"Bits (SI)"}};function ik(e,{unit:t="bits",shortValues:n,decimalPlaces:i}){let r="decbits"===t;if(!nU(n)||Math.abs(e)<(r?1e3:1024)){let r={style:"decimal",useGrouping:!0};nq(i)?(r.minimumFractionDigits=nY(i),r.maximumFractionDigits=nY(i)):nU(n)&&(r.maximumSignificantDigits=3);let o=[r.style,r.useGrouping,r.maximumSignificantDigits,i,n,t];return`${nG(o,"bits",r,"en-US")(e)} bits`}return iM(e).format({output:"byte",base:r?"decimal":"binary",spaceSeparated:!0,mantissa:nq(i)?i:2,trimMantissa:!nq(i),optionalMantissa:!nq(i)}).replace(/KB/g,"Kb").replace(/MB/g,"Mb").replace(/GB/g,"Gb").replace(/TB/g,"Tb").replace(/PB/g,"Pb").replace(/EB/g,"Eb").replace(/KiB/g,"Kib").replace(/MiB/g,"Mib").replace(/GiB/g,"Gib").replace(/TiB/g,"Tib").replace(/PiB/g,"Pib").replace(/EiB/g,"Eib")}let iT={label:"Bytes",decimalPlaces:!0,shortValues:!0},iD={bytes:{group:"Bytes",label:"Bytes (IEC)"},decbytes:{group:"Bytes",label:"Bytes (SI)"}};function iI(e,{unit:t="bytes",shortValues:n,decimalPlaces:i}){let r="decbytes"===t;if(!nU(n)||Math.abs(e)<(r?1e3:1024)){let r={style:"unit",unit:"byte",unitDisplay:"long",useGrouping:!0};return nq(i)?(r.minimumFractionDigits=nY(i),r.maximumFractionDigits=nY(i)):nU(n)&&(r.maximumSignificantDigits=3),nG([r.style,r.unit,r.unitDisplay,r.useGrouping,r.maximumSignificantDigits,i,n,t],"bytes",r,"en-US")(e)}return iM(e).format({output:"byte",base:r?"decimal":"binary",spaceSeparated:!0,mantissa:nq(i)?i:2,trimMantissa:!nq(i),optionalMantissa:!nq(i)})}var iO=n(40224);let iP="Currency",iE={label:"Currency",decimalPlaces:!0},iR={aud:{group:iP,label:"Australian Dollar (A$)"},cad:{group:iP,label:"Canadian Dollar (CA$)"},chf:{group:iP,label:"Swiss Franc (CHF)"},cny:{group:iP,label:"Renminbi (CN\xa5)"},eur:{group:iP,label:"Euro (€)"},gbp:{group:iP,label:"Pound (\xa3)"},hkd:{group:iP,label:"Hong Kong Dollar (HK$)"},inr:{group:iP,label:"Indian Rupee (₹)"},jpy:{group:iP,label:"Yen (\xa5)"},krw:{group:iP,label:"South Korean Won (₩)"},nok:{group:iP,label:"Norwegian Krone (NOK)"},nzd:{group:iP,label:"New Zealand Dollar (NZ$)"},sek:{group:iP,label:"Swedish Krona (SEK)"},sgd:{group:iP,label:"Singapore Dollar (S$)"},usd:{group:iP,label:"US Dollar ($)"}};function iL(e,{unit:t,decimalPlaces:n}){let i={style:"currency",currency:(0,iO.toUpper)(t),currencyDisplay:"symbol"};return nq(n)?(i.minimumFractionDigits=nY(n),i.maximumFractionDigits=nY(n)):i.maximumSignificantDigits=3,nG([i.style,i.currency,i.currencyDisplay,i.maximumSignificantDigits,n,t],"currency",i,"en-US")(e)}let iN={label:"percent",decimalPlaces:!0},iB="Percent",iF={percent:{group:iB,label:"Percent (0-100)"},"percent-decimal":{group:iB,label:"Percent (0.0-1.0)"},"%":{disableSelectorOption:!0,group:iB,label:"%"}};function iz(e,{unit:t,decimalPlaces:n}){let i={style:"percent",useGrouping:!0};return nq(n)?(i.minimumFractionDigits=nY(n),i.maximumFractionDigits=nY(n)):i.maximumSignificantDigits=3,"percent"===t&&(e/=100),nG([i.style,i.useGrouping,i.maximumSignificantDigits,n,t],"percent",i,"en-US")(e)}let iV="Temperature",ij={label:iV,decimalPlaces:!0},iH={celsius:{group:iV,label:"Celsius (\xb0C)"},fahrenheit:{group:iV,label:"Fahrenheit (\xb0F)"}},iW=(e,{unit:t,decimalPlaces:n})=>{let i={unit:t,style:"unit"};nq(n)?(i.minimumFractionDigits=nY(n),i.maximumFractionDigits=nY(n)):i.maximumSignificantDigits=3;let r="celsius"===t?"en-GB":"en-US";return nG([i.style,i.unit,i.maximumSignificantDigits,n,r],"temperature",i,r)(e)},iG={label:"Decimal",decimalPlaces:!0,shortValues:!0},i$={decimal:{group:"Decimal",label:"Decimal"}};function iU(e,{shortValues:t,decimalPlaces:n}){let i={style:"decimal",useGrouping:!0};return nU(t)&&(i.notation="compact"),nq(n)?(i.minimumFractionDigits=nY(n),i.maximumFractionDigits=nY(n)):nU(t)&&(i.maximumSignificantDigits=3),nG([i.style,i.useGrouping,i.notation,i.maximumSignificantDigits,n],"decimal",i,"en-US")(e)}let iq={label:"Throughput",decimalPlaces:!0},iY="Throughput",iZ={"bits/sec":{group:iY,label:"Bits/sec (IEC)"},"decbits/sec":{group:iY,label:"Bits/sec (SI)"},"bytes/sec":{group:iY,label:"Bytes/sec (IEC)"},"decbytes/sec":{group:iY,label:"Bytes/sec (SI)"},"counts/sec":{group:iY,label:"Counts/sec"},"events/sec":{group:iY,label:"Events/sec"},"messages/sec":{group:iY,label:"Messages/sec"},"ops/sec":{group:iY,label:"Ops/sec"},"packets/sec":{group:iY,label:"Packets/sec"},"reads/sec":{group:iY,label:"Reads/sec"},"requests/sec":{group:iY,label:"Requests/sec"},"records/sec":{group:iY,label:"Records/sec"},"rows/sec":{group:iY,label:"Rows/sec"},"writes/sec":{group:iY,label:"Writes/sec"}};function iX(e,{unit:t,shortValues:n,decimalPlaces:i}){if("bits/sec"===t){let t=1024>Math.abs(e)?"sec":"s";return ik(e,{unit:"bits",shortValues:n,decimalPlaces:i})+"/"+t}if("decbits/sec"===t){let t=1e3>Math.abs(e)?"sec":"s";return ik(e,{unit:"decbits",shortValues:n,decimalPlaces:i})+"/"+t}if("decbytes/sec"===t){let t=1e3>Math.abs(e)?"sec":"s";return iI(e,{unit:"decbytes",shortValues:n,decimalPlaces:i})+"/"+t}if("bytes/sec"===t){let t=1024>Math.abs(e)?"sec":"s";return iI(e,{unit:"bytes",shortValues:n,decimalPlaces:i})+"/"+t}let r={style:"decimal",useGrouping:!0};nU(n)&&(r.notation="compact"),nq(i)?(r.minimumFractionDigits=nY(i),r.maximumFractionDigits=nY(i)):nU(n)&&(r.maximumSignificantDigits=3);let o=[r.style,r.useGrouping,r.notation,r.maximumSignificantDigits,i,n,t];return`${nG(o,"throughput",r,"en-US")(e)} ${t}`}let iK="Date",iQ={Time:nX,Percent:iN,Decimal:iG,Bytes:iT,Bits:iC,Throughput:iq,Currency:iE,Temperature:ij,Date:{label:"Date & Time"}},iJ={...nK,...iF,...i$,...iD,...iA,...iZ,...iR,...iH,"datetime-iso":{group:iK,label:"DateTime (GMT)"},"datetime-us":{group:iK,label:"DateTime (US-East)"},"datetime-local":{group:iK,label:"DateTime (Browser Local)"},"date-iso":{group:iK,label:"Date (GMT)"},"date-us":{group:iK,label:"Date (US-East)"},"date-local":{group:iK,label:"Date (Browser Local)"},"time-local":{group:iK,label:"Time (Browser Local)"},"time-iso":{group:iK,label:"Time (GMT)"},"time-us":{group:iK,label:"Time (US-East)"},"relative-time":{group:iK,label:"Relative Time"},"unix-timestamp":{group:iK,label:"Unix Timestamp (s)"},"unix-timestamp-ms":{group:iK,label:"Unix Timestamp (ms)"}};function i0(e,t){if(!t)return e.toString();if(i8(t))return iI(e,t);if(i9(t))return ik(e,t);if(i6(t))return iU(e,t);if(i4(t))return iz(e,t);if(i3(t))return n1(e,t);if(rt(t))return iX(e,t);if(rn(t))return iL(e,t);if(ri(t))return function(e,t={}){let n=Intl.DateTimeFormat().resolvedOptions().timeZone,{unit:i="datetime-local",locale:r=(()=>{if("u">typeof navigator){if(navigator.language)return navigator.language;if(navigator.languages&&navigator.languages.length>0){let e=navigator.languages[0];if(e)return e}let e=navigator;if(e.userLanguage)return e.userLanguage;if(e.browserLanguage)return e.browserLanguage;if(e.systemLanguage)return e.systemLanguage}return Intl.DateTimeFormat().resolvedOptions().locale||"en-US"})(),timeZone:o=n,referenceTime:a=Date.now()}=t;if("unix-timestamp"===i)return(e>1e12?Math.floor(e/1e3):e).toString();if("unix-timestamp-ms"===i)return Math.floor(e<1e11?1e3*e:e).toString();let s=function(e){if(e<0)if(Math.abs(e)>1e10)return new Date(e);else return new Date(1e3*e);if(e>=25e10&&e<=26e10){let t=new Date(1e3*e);if(t.getUTCFullYear()>=9999)return t}return new Date(e<1e10?1e3*e:e)}(e);if("relative-time"===i){let e=new Date(a),t=s.getTime()-e.getTime();for(let{unit:e,ms:n}of[{unit:"year",ms:31536e6},{unit:"month",ms:2592e6},{unit:"week",ms:6048e5},{unit:"day",ms:864e5},{unit:"hour",ms:36e5},{unit:"minute",ms:6e4},{unit:"second",ms:1e3}]){let i=Math.round(t/n);if(Math.abs(i)>=1)return new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(i,e)}return new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(0,"second")}let l={timeZone:o};switch(i){case"datetime-iso":return s.toISOString();case"datetime-us":return l.timeZone="America/New_York",l.year="numeric",l.month="2-digit",l.day="2-digit",l.hour="2-digit",l.minute="2-digit",l.second="2-digit",l.hour12=!0,new Intl.DateTimeFormat("en-US",l).format(s);case"datetime-local":l.year="numeric",l.month="2-digit",l.day="2-digit",l.hour="2-digit",l.minute="2-digit",l.second="2-digit",l.hour12=!1;break;case"date-iso":return s.toISOString().split("T")[0];case"date-us":return l.timeZone="America/New_York",l.year="numeric",l.month="2-digit",l.day="2-digit",new Intl.DateTimeFormat("en-US",l).format(s);case"date-local":l.year="numeric",l.month="2-digit",l.day="2-digit";break;case"time-local":l.hour="2-digit",l.minute="2-digit",l.second="2-digit",l.hour12=!1;break;case"time-iso":return s.toISOString().split("T")[1].replace("Z","");case"time-us":return l.timeZone="America/New_York",l.hour="2-digit",l.minute="2-digit",l.second="2-digit",l.hour12=!0,new Intl.DateTimeFormat("en-US",l).format(s);default:throw Error(`Unknown date unit: ${i}`)}return new Intl.DateTimeFormat(r,l).format(s)}(e,t);if(rr(t))return iW(e,t);throw Error(`Unknown unit options ${t}`)}function i1(e){return iJ[e.unit??"decimal"]}function i2(e){return i1(e).group??"Decimal"}function i5(e){return iQ[i1(e).group??"Decimal"]}function i3(e){return"Time"===i2(e)}function i4(e){return"Percent"===i2(e)}function i6(e){return"Decimal"===i2(e)}function i8(e){return"Bytes"===i2(e)}function i9(e){return"Bits"===i2(e)}function i7(e){return!!i5(e).decimalPlaces}function re(e){return!!i5(e).shortValues}function rt(e){return"Throughput"===i2(e)}function rn(e){return"Currency"===i2(e)}function ri(e){return"Date"===i2(e)}function rr(e){return"Temperature"===i2(e)}let ro={JoinByColumnValue:"Join by column value",MergeColumns:"Merge columns",MergeIndexedColumns:"Merge indexed columns",MergeSeries:"Merge series",ExtractColumnFields:"Extract column fields"};function ra(e,t){return[nM({type:"value",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>i0(e,t)}},e)]}function rs(e,t,n,i){let r=[],o=nM({type:"value",position:"left",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>i0(e,t),overflow:"truncate"}},e);r.push(o);let a=0;return n.forEach((t,n)=>{let o,s,l={type:"value",position:"right",offset:a,boundaryGap:[0,"10%"],axisLabel:{formatter:e=>i0(e,t)},splitLine:{show:!1},show:e?.show};r.push(l),i&&(a+=(o=i0(i[n]??1e3,t),((s=document.createElement("canvas").getContext("2d"))?(s.font="12px sans-serif",s.measureText(o).width):6*o.length)+10))}),r}function rl(e,t){let{value:n,setValueAndStore:i}=function(e,t,n){let[i,r]=(0,eD.useState)(()=>{try{let n=e.getItem(t);if(null!==n)return JSON.parse(n)}catch{}return e.setItem(t,JSON.stringify(n)),n}),o=(0,eD.useCallback)(n=>{r(n),e.setItem(t,JSON.stringify(n))},[r,e,t]);return{value:i,setValue:r,setValueAndStore:o}}(window.localStorage,e,t);return[n,i]}function ru(e){let t=e._model;void 0!==t&&void 0!==t.option.toolbox&&t.option.toolbox.length>0&&"normal"===t.option.toolbox[0].feature.dataZoom.iconStatus.zoom&&e.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:!0})}function rc(e){e.dispatchAction({type:"restore"})}function rh(e){void 0!==e.dispatchAction&&(e.dispatchAction({type:"unselect"}),e.dispatchAction({type:"downplay"}))}function rd(e,t,n){if(void 0===n)return null;let i=[e,t];return n.containPixel("grid",i)?n.convertFromPixel("grid",i):null}function rp(e,t,n,i,r,o){let a=o.length>0?o[o.length-1]:r[r.length-1];void 0!==a&&e.dispatchAction({type:"select",seriesIndex:a.seriesIndex,dataIndex:a.dataIndex,escapeConnect:!0}),e.dispatchAction({type:"downplay"}),i.length>0&&e.dispatchAction({type:"downplay",seriesIndex:i}),n.length>0?e.dispatchAction({type:"highlight",seriesIndex:n,notBlur:!1,escapeConnect:!0}):(e.dispatchAction({type:"highlight",seriesIndex:t,notBlur:!0,escapeConnect:!0}),e.dispatchAction({type:"toggleSelect"}))}function rf(e){return e[e.length-1]?.name===nC}function rg(e,t){if(void 0===e||void 0===t)return null;let n=null,i=1/0;for(let[r]of e){let e=Math.abs(r-t);e<i&&(n=r,i=e)}return n}function rm(e,t){if(void 0===t)return null;let n=e.length,i=null;for(let r=0;r<n;r++){let o=n>0?e[r]:null;if(!o)break;i=rg(o.values,t)}return i}function rv(...e){return e.flatMap(e=>void 0===e?[]:Array.isArray(e)?e:[e])}function ry(e){void 0===globalThis.useIdValue&&(globalThis.useIdValue=0);let t=(0,eD.useRef)(void 0);return void 0===t.current&&(t.current=`${e}-${globalThis.useIdValue++}`),t.current}var rx=((aA={}).CSV="csv",aA.DISTRIBUTED="distributed",aA.DOUBLEQUOTE="doublequote",aA.GLOB="glob",aA.JSON="json",aA.LUCENE="lucene",aA.PERCENTENCODE="percentencode",aA.PIPE="pipe",aA.PROMETHEUS="prometheus",aA.RAW="raw",aA.REGEX="regex",aA.SINGLEQUOTE="singlequote",aA.SQLSTRING="sqlstring",aA.TEXT="text",aA.QUERYPARAM="queryparam",aA.REGEX_LITERAL="regexliteral",aA);function rb(e){if(!e)return;let t=e.toLowerCase();return Object.values(rx).find(e=>e===t)||void 0}function rw(e,t,n){switch(n){case"csv":case"raw":return e.join(",");case"distributed":{let[n,...i]=e;return`${[n,...i.map(e=>`${t}=${e}`)].join(",")}`}case"doublequote":return e.map(e=>`"${e}"`).join(",");case"glob":return`{${e.join(",")}}`;case"json":return JSON.stringify(e.map(e=>{try{return JSON.parse(e)}catch{return e}}));case"lucene":return`(${e.map(e=>`"${e}"`).join(" OR ")})`;case"percentencode":return encodeURIComponent(e.join(","));case"pipe":return e.join("|");case"regex":{let t=e.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"));return`(${t.join("|")})`}case"regexliteral":{let t=e.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\\\$&"));return`(${t.join("|")})`}case"singlequote":return e.map(e=>`'${e}'`).join(",");case"sqlstring":return e.map(e=>`'${e.replace(/'/g,"''")}'`).join(",");case"text":return e.join(" + ");case"queryparam":return e.map(e=>`${t}=${encodeURIComponent(e)}`).join("&");default:return`(${e.join("|")})`}}function rS(e,t,n,i){let r="$"+t,o="${"+t+(i?":"+i:"")+"}",a="";return Array.isArray(n)&&(a=rw(n,t,i||"prometheus")),"string"==typeof n&&(a=rw([n],t,i||"raw")),(e=e.replaceAll(r,a)).replaceAll(o,a)}let r_=/\$(\w+)|\${(\w+)(?:\.([^:^}]+))?(?::([^}]+))?}/gm;function rM(e){let t,n=new Set;for(;null!==(t=r_.exec(e));)t&&(t[1]?n.add(t[1]):t[2]&&n.add(t[2]));return Array.from(n.values())}function rC(e){let t,n=new Map;for(;null!==(t=r_.exec(e));)if(t){let e;t[4]&&(e=t[4]),t[1]?n.set(t[1],rb(e)):t[2]&&n.set(t[2],rb(e))}return n}function rA(e,t){let n=rC(e),i=Array.from(n.keys()),r=e;return i.sort((e,t)=>t.length-e.length).forEach(e=>{let i=t[e];i&&void 0!==i.value&&(r=rS(r,e,i?.value,n.get(e)))}),r}function rk(e,t){let n={};for(let[e,i]of Object.entries(t))n[e]=void 0===i.displayValue?i:{...i,value:i.displayValue};return rA(e,n)}let rT=/\$\{__data\.fields(?:\[(?:"|')([^"']+)(?:"|')\]|\.([a-zA-Z_][a-zA-Z0-9_]*))(?::([a-z]+))?\}/g,rD=/\$\{__data\[(\d+)\]\.fields\[(?:"|')([^"']+)(?:"|')\]\}/g,rI=/\$\{__data\.index\}/g,rO=/\$\{__data\.count\}/g,rP=/("|')?\$\{__data(?::([a-z]+))?\}("|')?/g;function rE(e,t){if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];return null==n?"":"object"==typeof n?JSON.stringify(n):String(n)}if(t.includes(".")){let n=t.split("."),i=e;for(let e of n){if(null==i||"object"!=typeof i)return"";i=i[e]}return null==i?"":"object"==typeof i?JSON.stringify(i):String(i)}return""}function rR(e){if(!e)return;let t=e.toLowerCase();return Object.values(rx).find(e=>e===t)}function rL(e,t,n={}){let{urlEncode:i=!0,index:r,count:o}=n,a=e,s=[];return void 0!==r&&(a=a.replaceAll(rI,String(r))),void 0!==o&&(a=a.replaceAll(rO,String(o))),a=a.replaceAll(rP,(e,n,i,r)=>{let o=rR(i)??rx.RAW;return o===rx.JSON?JSON.stringify(t):rw(Object.values(t).map(e=>JSON.stringify(e)),"",o)}),rT.lastIndex=0,{text:a=a.replaceAll(rT,(e,n,r,o)=>{let a=n??r??"",l=rE(t,a);""===l&&void 0===t[a]&&s.push(`Field "${a}" not found in data`);let u=rR(o);if(u)return rw([l],a,u);if(i){if(u===rx.RAW)return l;if(u!==rx.QUERYPARAM&&u!==rx.PERCENTENCODE)return encodeURIComponent(l)}return l}),errors:s.length>0?s:void 0}}function rN(e,t,n={}){let{urlEncode:i=!0}=n,r=e,o=[];return r=r.replaceAll(rO,String(t.length)),rD.lastIndex=0,rT.lastIndex=0,{text:r=(r=(r=r.replaceAll(rP,(e,n,i,r)=>{let o=rR(i)??rx.RAW,a=rw(Object.values(t).map(e=>JSON.stringify(e)),"",o);return n&&r?a:`${n??""}${a}${r??""}`})).replaceAll(rD,(e,n,r)=>{let a=parseInt(n,10);if(a<0||a>=t.length)return o.push(`Index ${a} out of bounds (0-${t.length-1})`),e;let s=rE(t[a],r);return""===s&&void 0===t[a][r]&&o.push(`Field "${r}" not found in data at index ${a}`),i?encodeURIComponent(s):s})).replaceAll(rT,(e,n,i,r)=>{let o=n??i??"";return rw(t.map(e=>rE(e,o)),o,rR(r)||rx.CSV)}),errors:o.length>0?o:void 0}}function rB(e){return rD.lastIndex=0,rD.test(e)||/\$\{__data\.fields(?:\[["'][^"']+["']\]|\.[a-zA-Z_][a-zA-Z0-9_]*):[a-z]+\}/.test(e)}function rF(e){return rD.lastIndex=0,rD.test(e)}function rz(e){return rT.lastIndex=0,rD.lastIndex=0,rT.test(e)||rD.test(e)}function rV(e){let t,n=new Set;for(rT.lastIndex=0,rD.lastIndex=0;null!==(t=rT.exec(e));)n.add(t[1]??t[2]);for(;null!==(t=rD.exec(e));)n.add(t[2]);return Array.from(n)}Symbol.for("constructDateFrom");let rj={},rH={};function rW(e,t){try{let n=(rj[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];if(n in rH)return rH[n];return r$(n,n.split(":"))}catch{if(e in rH)return rH[e];let t=e?.match(rG);if(t)return r$(e,t.slice(1));return NaN}}let rG=/([+-]\d\d):?(\d\d)?/;function r$(e,t){let n=+(t[0]||0),i=+(t[1]||0),r=(t[2]||0)/60;return rH[e]=60*n+i>0?60*n+i+r:60*n-i-r}class rU extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(rW(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),rZ(this,e)):this.setTime(Date.now())}static tz(e,...t){return t.length?new rU(...t,e):new rU(Date.now(),e)}withTimeZone(e){return new rU(+this,e)}getTimezoneOffset(){let e=-rW(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),rY(this),+this}[Symbol.for("constructDateFrom")](e){return new rU(+new Date(e),this.timeZone)}}let rq=/^(get|set)(?!UTC)/;function rY(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-(60*rW(e.timeZone,e))))}function rZ(e,t){var n;let i=Array.isArray(t)?Date.UTC((n=t)[0],n.length>1?n[1]:0,n.length>2?n[2]:1,...n.slice(3)):+e.internal,r=rW(e.timeZone,e),o=r>0?Math.floor(r):Math.ceil(r),a=new Date(+e);a.setUTCHours(a.getUTCHours()-1);let s=-new Date(+e).getTimezoneOffset(),l=-new Date(+a).getTimezoneOffset(),u=s;if(s-l&&s!==o&&Date.prototype.getHours.apply(e)!==(Array.isArray(t)?t[3]||0:e.internal.getUTCHours())){let t=new Date(+e),n=s-o;n&&t.setUTCMinutes(t.getUTCMinutes()+n);let i=rW(e.timeZone,t);(i>0?Math.floor(i):Math.ceil(i))===o&&(u=l)}let c=u-o;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);let h=new Date(+e);h.setUTCSeconds(0);let d=s>0?h.getSeconds():(h.getSeconds()-60)%60,p=Math.round(-(60*rW(e.timeZone,e)))%60;(p||d)&&Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+d);let f=rW(e.timeZone,e),g=f>0?Math.floor(f):Math.ceil(f),m=-new Date(+e).getTimezoneOffset()-g-c,v=g-o,y=v>0&&rX(e)-i==60*v*1e3&&rX(e,i-60*g*1e3)!==i;if(g!==o&&m&&!y){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+m);let t=rW(e.timeZone,e),n=g-(t>0?Math.floor(t):Math.ceil(t));n&&m<0&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n)}rY(e);let x=(t?i:i+1e3*p)-e.internal;x&&18e5>Math.abs(x)&&(Date.prototype.setTime.call(e,+e+x),rY(e))}function rX(e,t){let n=new Date(t??+e);return n.setUTCSeconds(n.getUTCSeconds()-Math.round(-(60*rW(e.timeZone,n)))),+n}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!rq.test(e))return;let t=e.replace(rq,"$1UTC");rU.prototype[t]&&(e.startsWith("get")?rU.prototype[e]=function(){return this.internal[t]()}:(rU.prototype[e]=function(){var e;return Date.prototype[t].apply(this.internal,arguments),e=this,Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),rZ(e),+this},rU.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),rY(this),+this}))});class rK extends rU{static tz(e,...t){return t.length?new rK(...t,e):new rK(Date.now(),e)}toISOString(){let[e,t,n]=this.tzComponents(),i=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,i]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${i}`}toTimeString(){let e=this.internal.toUTCString().split(" ")[4],[t,n,i]=this.tzComponents();return`${e} GMT${t}${n}${i} (${function(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset(),t=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[e>0?"-":"+",t,n]}withTimeZone(e){return new rK(+this,e)}[Symbol.for("constructDateFrom")](e){return new rK(+new Date(e),this.timeZone)}}function rQ(e,t){if(t){let n=t.toLowerCase();if("local"!==n&&"browser"!==n)return{...e,timeZone:"utc"===n?"UTC":t}}return e}function rJ(e,t,n){let i,r=n?.toLowerCase();if(!n||"local"===r||"browser"===r)return(0,nT.format)(e,t);return(0,nT.format)(e,t,{in:(i="utc"===r?"UTC":n,e=>rK.tz(i,+new Date(e)))})}function r0(e){let t=e?.toLowerCase(),n=e;e&&"local"!==t&&"browser"!==t?"utc"===t&&(n="UTC"):n=Intl.DateTimeFormat().resolvedOptions().timeZone;try{let e=new Intl.DateTimeFormat("en-US",{timeZone:n,timeZoneName:"shortOffset"}).formatToParts(new Date).find(e=>"timeZoneName"===e.type),t=e?.value??"";if("GMT"===t)return"GMT+0";return t}catch{return"GMT+0"}}function r1(e){return e>15768e7?"{yyyy}":e>63072e6?"{MMM} {yyyy}":e>432e6&&e<1577664e4?"{MM}/{dd}":e>1728e5&&e<=432e6?"{MM}/{dd} {HH}:{mm}":{year:"{yearStyle|{yyyy}}\n{monthStyle|{MMM}}",month:"{MMM}",day:"{MM}/{dd}"}}let r2=(e,t)=>{if(!e)return{formattedDate:"",formattedTime:""};let n=new Date(e);return{formattedDate:t?t(n,"MMM dd, yyyy"):(0,nT.format)(n,"MMM dd, yyyy"),formattedTime:t?t(n,"HH:mm:ss"):(0,nT.format)(n,"HH:mm:ss")}};var r5=n(18264);function r3(e,t){let n=(0,eD.useRef)(),i=!0;for(let e=0;e<t.length;e++)if(n.current?.deps[e]!==t[e]){i=!1;break}return(void 0===n.current||!1===i)&&(n.current={value:e(),deps:t}),n.current.value}function r4(e,t){let n=(0,eD.useRef)();return(void 0===n.current||!1===r5(t,n.current.deps))&&(n.current={value:e(),deps:t}),n.current.value}function r6(e){return!!e?.startsWith("/")}function r8(e){if(!e)throw Error("Input string cannot be empty");if(!r6(e))return RegExp(`^${e}$`);let t=e.match(/^\/(.+)\/([gimy]*)$/);if(!t)throw Error(`Invalid regular expression format: ${e}`);let[,n="",i=""]=t;try{return new RegExp(n,i)}catch(e){throw Error(`Failed to create RegExp ${e}`)}}function r9(e,t){let n={};for(let[i,r]of Object.entries(e))n[i]=rA(r,t);return n}function r7(e,t){let n={};for(let[i,r]of Object.entries(e))Array.isArray(r)?n[i]=r.map(e=>rA(e,t)):n[i]=function e(t,n){if(Array.isArray(t))return t.map(t=>e(t,n));for(let[e,i]of rC(t)){let r,o=n[e];if(!o)continue;let a=o.options??[],s=a.map(e=>e.value),l=Array.isArray(o.value),u=void 0!==o.customAllValue;if(l)r=o.value;else if(u)try{let e=r8(o.customAllValue),t=a.filter(t=>e.test(t.value)).map(e=>e.value);r=t.length>0?t:s}catch{r=s}if(r&&(!i||i===rx.QUERYPARAM)){let o="$"+e,a=i?"${"+e+":"+i+"}":"${"+e+"}";return r.map(e=>{let i=t;return rA(i=(i=i.replaceAll(a,e)).replaceAll(o,e),n)})}}return rA(t,n)}(r,t);return n}function oe(e,t,n,i,r){let o=rL(e,t,{index:n,count:i}),a=o.text,s=[];return o.errors&&s.push(...o.errors.map(e=>e.replace("in data","in selection data"))),r&&(a=rA(a,r)),{text:a,errors:s.length>0?s:void 0}}function ot(e,t,n){let i=rN(e,t),r=i.text,o=[];return i.errors&&o.push(...i.errors.map(e=>e.replace("in data","in selection data"))),n&&(r=rA(r,n)),{text:r,errors:o.length>0?o:void 0}}function on(e,t){let n=e.palette.text?.primary??"#222";return nM({echartsTheme:{title:{show:!1},textStyle:{color:n,fontFamily:e.typography.fontFamily,fontSize:12},grid:{top:5,right:20,bottom:0,left:20,containLabel:!0},color:["#56B4E9","#009E73","#0072B2","#CC79A7","#F0E442","#E69F00","#D55E00"],categoryAxis:{show:!0,axisLabel:{show:!0,color:n,margin:15},axisTick:{show:!1,length:6,lineStyle:{color:e.palette.grey[600]}},axisLine:{show:!0,lineStyle:{color:e.palette.grey[600]}},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.4}},splitArea:{show:!1,areaStyle:{color:[e.palette.grey[300]]}}},timeAxis:{show:!0,axisLabel:{show:!0,color:n,margin:15},axisTick:{show:!1,length:6,lineStyle:{color:e.palette.grey[600]}},axisLine:{show:!0,lineStyle:{color:e.palette.grey[600]}},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.4}},splitArea:{show:!1,areaStyle:{color:[e.palette.grey[300]]}}},valueAxis:{show:!0,axisLabel:{color:n,margin:12},axisLine:{show:!1},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.6}}},legend:{orient:"horizontal",textStyle:{color:n},pageTextStyle:{color:e.palette.grey[600]},pageIconColor:e?.palette?.action?.active,pageIconInactiveColor:e?.palette?.action?.disabled},toolbox:{show:!0,top:10,right:10,iconStyle:{borderColor:n}},tooltip:{backgroundColor:e.palette.designSystem?.grey[800],borderColor:e.palette.designSystem?.grey[800],textStyle:{color:"#fff",fontSize:11}},axisPointer:{lineStyle:{color:e.palette.grey[500]}},markLine:{symbol:"none",symbolSize:0,itemStyle:{color:e.palette.grey[500]},lineStyle:{type:"dashed",width:1}},line:{showSymbol:!1,symbol:"circle",symbolSize:4,smooth:!1,lineStyle:{width:1},emphasis:{lineStyle:{width:1.5}}},bar:{barMaxWidth:150,itemStyle:{borderWidth:0,borderRadius:0,borderColor:e.palette.grey[300]},label:{show:!1,color:n}},gauge:{detail:{fontSize:18,fontWeight:600,valueAnimation:!1},splitLine:{distance:0,length:4,lineStyle:{width:1}},splitNumber:12}},noDataOption:{title:{show:!0,textStyle:{color:n,fontSize:16,fontWeight:400},text:"No data",left:"center",top:"center"},xAxis:{show:!1},yAxis:{show:!1}},sparkline:{width:2,color:"#1976d2"},container:{padding:{default:parseInt(e.spacing(1.5),10)}},thresholds:{defaultColor:e.palette.success.main,palette:["#FFCC00",e.palette.warning.main,e.palette.error.main]}},t)}function oi(e,t=[]){if(!t.length)return{value:e};let n={value:e};return t.forEach(t=>{switch(t.kind){case"Value":{let i=t.spec;String(i.value)===String(e)&&(n.value=i.result.value||n.value,n.color=i.result.color);break}case"Range":{let i=t.spec;if(void 0===i.from&&void 0===i.to)break;let r=void 0!==i.from?i.from:-1/0,o=void 0!==i.to?i.to:1/0;e>=r&&e<=o&&(n.value=i.result.value||n.value,n.color=i.result.color);break}case"Regex":{let i=t.spec,r=e.toString();if(!i.pattern)break;let o=r8(i.pattern);r.match(o)&&null!==i.result.value&&(n.value=r.replace(o,i.result.value.toString()||"")||n.value,n.color=i.result.color);break}case"Misc":{let i=t.spec;(function(e,t){switch(e){case"empty":return""===t;case"null":return null==t;case"NaN":return Number.isNaN(t);case"true":return!0===t;case"false":return!1===t;default:return!1}})(i.value,e)&&(n.value=i.result.value||n.value,n.color=i.result.color)}}}),n}function or(e,t){if(0===t.length)return e;let n={};for(let i of e){let e=Object.keys(i).filter(e=>t.includes(e)).map(e=>i[e]).join("|"),r=n[e];r?n[e]={...r,...i}:n[e]={...i}}return Object.values(n)}function oo(e,t,n){let i=[];for(let r of e){let e=Object.keys(r).filter(e=>t.includes(e)),o={};for(let t of e)o[t]=r[t],delete r[t];for(let t of e)i.push({...r,[n]:o[t]});0===e.length&&i.push(r)}return i}function oa(e,t){let n=[];for(let i of e){let e=Object.keys(i).filter(e=>RegExp("^(("+t+" #\\d+)|("+t+"))$").test(e)),r={};for(let t of e)r[t]=i[t],delete i[t];for(let o of e)n.push({...i,[t]:r[o]});0===e.length&&n.push(i)}return n}function os(e){let t=[...e],n=Array.from(new Set(e.flatMap(Object.keys).map(e=>e.replace(/ #\d+/,"")).filter(e=>"value"!==e)));for(let e of n)t=oa(t,e);return or(t,n)}function ol(e,t){let n=e;for(let e of t??[])if(!e.spec.disabled)switch(e.kind){case"JoinByColumnValue":e.spec.columns&&e.spec.columns.length>0&&(n=or(n,e.spec.columns));break;case"MergeIndexedColumns":e.spec.column&&(n=oa(n,e.spec.column));break;case"MergeColumns":e.spec.columns&&e.spec.columns.length>0&&e.spec.name&&(n=oo(n,e.spec.columns,e.spec.name));break;case"MergeSeries":n=os(n)}return n.map(e=>Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{}))}var ou=n(68102);function oc(e){return"number"==typeof e}function oh(e){return!!e&&"object"==typeof e&&"function"==typeof e.constructor&&(!0===e.isBigNumber&&"object"==typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function od(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function op(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function of(e){return e&&!0===e.constructor.prototype.isUnit||!1}function og(e){return"string"==typeof e}var om=Array.isArray;function ov(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function oy(e){return Array.isArray(e)||ov(e)}function ox(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function ob(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function ow(e){return e&&!0===e.constructor.prototype.isRange||!1}function oS(e){return e&&!0===e.constructor.prototype.isIndex||!1}function o_(e){return"boolean"==typeof e}function oM(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function oC(e){return e&&!0===e.constructor.prototype.isHelp||!1}function oA(e){return"function"==typeof e}function ok(e){return e instanceof Date}function oT(e){return e instanceof RegExp}function oD(e){return!!(e&&"object"==typeof e&&e.constructor===Object&&!od(e)&&!op(e))}function oI(e){return null===e}function oO(e){return void 0===e}function oP(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function oE(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function oR(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function oL(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function oN(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function oB(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function oF(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function oz(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function oV(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function oj(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function oH(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function oW(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function oG(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function o$(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function oU(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function oq(e){return e&&!0===e.constructor.prototype.isChain||!1}function oY(e){var t=typeof e;return"object"===t?null===e?"null":Array.isArray(e)?"Array":e instanceof Date?"Date":e instanceof RegExp?"RegExp":oh(e)?"BigNumber":od(e)?"Complex":op(e)?"Fraction":ov(e)?"Matrix":of(e)?"Unit":oS(e)?"Index":ow(e)?"Range":oM(e)?"ResultSet":oj(e)?e.type:oq(e)?"Chain":oC(e)?"Help":"Object":"function"===t?"Function":t}function oZ(e){var t=typeof e;if("number"===t||"string"===t||"boolean"===t||null==e)return e;if("function"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map(function(e){return oZ(e)});if(e instanceof Date)return new Date(e.valueOf());if(oh(e))return e;if(e instanceof RegExp)throw TypeError("Cannot clone "+e);return oX(e,oZ)}function oX(e,t){var n={};for(var i in e)oJ(e,i)&&(n[i]=t(e[i]));return n}function oK(e,t){var n,i,r;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(i=0,r=e.length;i<r;i++)if(!oK(e[i],t[i]))return!1;return!0}if("function"==typeof e)return e===t;if(!(e instanceof Object))return e===t;if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!oK(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}function oQ(e,t,n){var i,r=!0;Object.defineProperty(e,t,{get:function(){return r&&(i=n(),r=!1),i},set:function(e){i=e,r=!1},configurable:!0,enumerable:!0})}function oJ(e,t){return e&&Object.hasOwnProperty.call(e,t)}function o0(e){return Object.keys(e).map(t=>e[t])}var o1=n(23420);function o2(e,t,n,i){function r(i){var r=function(e,t){for(var n={},i=0;i<t.length;i++){var r=t[i],o=e[r];void 0!==o&&(n[r]=o)}return n}(i,t.map(o3));return function(e,t,n){if(!t.filter(e=>{var t;return!((t=e)&&"?"===t[0])}).every(e=>void 0!==n[e])){var i=t.filter(e=>void 0===n[e]);throw Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(e=>'"'.concat(e,'"')).join(", "),"."))}}(e,t,i),n(r)}return r.isFactory=!0,r.fn=e,r.dependencies=t.slice().sort(),i&&(r.meta=i),r}function o5(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function o3(e){return e&&"?"===e[0]?e.slice(1):e}function o4(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}function o6(e,t,n){var i="";if(n){if(n<1)throw Error("size must be in greater than 0");if(!o4(n))throw Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!o4(e))throw Error("Value must be an integer");e<0&&(e+=2**n),i="i".concat(n)}var r="";return e<0&&(e=-e,r="-"),"".concat(r).concat({2:"0b",8:"0o",16:"0x"}[t]).concat(e.toString(t)).concat(i)}function o8(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var n,i,r="auto";if(t&&(t.notation&&(r=t.notation),oc(t)?n=t:oc(t.precision)&&(n=t.precision),t.wordSize)&&"number"!=typeof(i=t.wordSize))throw Error('Option "wordSize" must be a number');switch(r){case"fixed":return o7(e,n);case"exponential":return ae(e,n);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=at(o9(e),t),i=n.exponent,r=n.coefficients,o=i%3==0?i:i<0?i-3-i%3:i-i%3;if(oc(t))for(;t>r.length||i-o+1>r.length;)r.push(0);else for(var a=Math.abs(i-o)-(r.length-1),s=0;s<a;s++)r.push(0);for(var l=Math.abs(i-o),u=1;l>0;)u++,l--;var c=r.slice(u).join(""),h=oc(t)&&c.length||c.match(/[1-9]/)?"."+c:"",d=r.slice(0,u).join("")+h+"e"+(i>=0?"+":"")+o.toString();return n.sign+d}(e,n);case"bin":return o6(e,2,i);case"oct":return o6(e,8,i);case"hex":return o6(e,16,i);case"auto":return(function(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var i=n&&void 0!==n.lowerExp?n.lowerExp:-3,r=n&&void 0!==n.upperExp?n.upperExp:5,o=o9(e),a=t?at(o,t):o;if(a.exponent<i||a.exponent>=r)return ae(e,t);var s=a.coefficients,l=a.exponent;s.length<t&&(s=s.concat(an(t-s.length))),s=s.concat(an(l-s.length+1+(s.length<t?t-s.length:0))),s=an(-l).concat(s);var u=l>0?l:0;return u<s.length-1&&s.splice(u+1,0,"."),a.sign+s.join("")})(e,n,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function o9(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw SyntaxError("Invalid number "+e);var n=t[1],i=t[2],r=parseFloat(t[4]||"0"),o=i.indexOf(".");r+=-1!==o?o-1:i.length-1;var a=i.replace(".","").replace(/^0*/,function(e){return r-=e.length,""}).replace(/0*$/,"").split("").map(function(e){return parseInt(e)});return 0===a.length&&(a.push(0),r++),{sign:n,coefficients:a,exponent:r}}function o7(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=o9(e),i="number"==typeof t?at(n,n.exponent+1+t):n,r=i.coefficients,o=i.exponent+1,a=o+(t||0);return r.length<a&&(r=r.concat(an(a-r.length))),o<0&&(r=an(-o+1).concat(r),o=1),o<r.length&&r.splice(o,0,0===o?"0.":"."),i.sign+r.join("")}function ae(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=o9(e),i=t?at(n,t):n,r=i.coefficients,o=i.exponent;r.length<t&&(r=r.concat(an(t-r.length)));var a=r.shift();return i.sign+a+(r.length>0?"."+r.join(""):"")+"e"+(o>=0?"+":"")+o}function at(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},i=n.coefficients;t<=0;)i.unshift(0),n.exponent++,t++;if(i.length>t&&i.splice(t,i.length-t)[0]>=5){var r=t-1;for(i[r]++;10===i[r];)i.pop(),0===r&&(i.unshift(0),n.exponent++,r++),r--,i[r]++}return n}function an(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}var ai=Number.EPSILON||2220446049250313e-31;function ar(e,t,n){if(null==n)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var i=Math.abs(e-t);return i<ai||i<=Math.max(Math.abs(e),Math.abs(t))*n}return!1}function ao(e,t,n){var i=new e.constructor(2),r="";if(n){if(n<1)throw Error("size must be in greater than 0");if(!o4(n))throw Error("size must be an integer");if(e.greaterThan(i.pow(n-1).sub(1))||e.lessThan(i.pow(n-1).mul(-1)))throw Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(n))),r="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(r);case 8:return"".concat(e.toOctal()).concat(r);case 16:return"".concat(e.toHexadecimal()).concat(r);default:throw Error("Base ".concat(t," not supported "))}}function aa(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function as(e,t){var n=function(e,t){var n;if("number"==typeof e)return o8(e,t);if(oh(e))return function(e,t){if("function"==typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var n="auto";if(void 0!==t&&(t.notation&&(n=t.notation),"number"==typeof t?h=t:t.precision&&(h=t.precision),t.wordSize)&&"number"!=typeof(d=t.wordSize))throw Error('Option "wordSize" must be a number');switch(n){case"fixed":return i=e,r=h,i.toFixed(r);case"exponential":return aa(e,h);case"engineering":return o=e,a=h,l=(s=o.e)%3==0?s:s<0?s-3-s%3:s-s%3,-1!==(c=(u=o.mul(Math.pow(10,-l))).toPrecision(a)).indexOf("e")&&(c=u.toString()),c+"e"+(s>=0?"+":"")+l.toString();case"bin":return ao(e,2,d);case"oct":return ao(e,8,d);case"hex":return ao(e,16,d);case"auto":var i,r,o,a,s,l,u,c,h,d,p=t&&void 0!==t.lowerExp?t.lowerExp:-3,f=t&&void 0!==t.upperExp?t.upperExp:5;if(e.isZero())return"0";var g=e.toSignificantDigits(h),m=g.e;return(m>=p&&m<f?g.toFixed():aa(e,h)).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}(e,t);if((n=e)&&"object"==typeof n&&"number"==typeof n.s&&"number"==typeof n.n&&"number"==typeof n.d)if(!t||"decimal"!==t.fraction)return e.s*e.n+"/"+e.d;else return e.toString();if(Array.isArray(e))return function e(t,n){if(!Array.isArray(t))return as(t,n);for(var i="[",r=t.length,o=0;o<r;o++)0!==o&&(i+=", "),i+=e(t[o],n);return i+"]"}(e,t);if(og(e))return'"'+e+'"';if("function"==typeof e)return e.syntax?String(e.syntax):"function";if(e&&"object"==typeof e)if("function"==typeof e.format)return e.format(t);else return e&&e.toString(t)!==({}).toString()?e.toString(t):"{"+Object.keys(e).map(n=>'"'+n+'": '+as(e[n],t)).join(", ")+"}";return String(e)}(e,t);return t&&"object"==typeof t&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function al(e,t,n){if(!(this instanceof al))throw SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=Error().stack}function au(e,t,n){if(!(this instanceof au))throw SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=Error().stack}function ac(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function ah(e,t){if(0===t.length){if(Array.isArray(e))throw new al(e.length,0)}else!function e(t,n,i){var r,o=t.length;if(o!==n[i])throw new al(o,n[i]);if(i<n.length-1){var a=i+1;for(r=0;r<o;r++){if(!Array.isArray(t[r]))throw new al(n.length-1,n.length,"<");e(t[r],n,a)}}else for(r=0;r<o;r++)if(Array.isArray(t[r]))throw new al(n.length+1,n.length,">")}(e,t,0)}function ad(e,t){if(!oc(e)||!o4(e))throw TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new au(e,t)}function ap(e,t,n){if(!Array.isArray(e)||!Array.isArray(t))throw TypeError("Array expected");if(0===t.length)throw Error("Resizing to scalar is not supported");return t.forEach(function(e){if(!oc(e)||!o4(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+as(t)+")")}),function e(t,n,i,r){var o,a,s=t.length,l=n[i],u=Math.min(s,l);if(t.length=l,i<n.length-1){var c=i+1;for(o=0;o<u;o++)Array.isArray(a=t[o])||(a=[a],t[o]=a),e(a,n,c,r);for(o=u;o<l;o++)a=[],t[o]=a,e(a,n,c,r)}else{for(o=0;o<u;o++)for(;Array.isArray(t[o]);)t[o]=t[o][0];for(o=u;o<l;o++)t[o]=r}}(e,t,0,void 0!==n?n:0),e}function af(e,t){var n=ag(e),i=e.slice(),r=e.indexOf(-1);if(e.indexOf(-1,r+1)>=0)throw Error("More than one wildcard in sizes");if(r>=0)if(t%n==0)i[r]=-t/n;else throw Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);return i}function ag(e){return e.reduce((e,t)=>e*t,1)}function am(e,t,n,i){var r=i||ac(e);if(n)for(var o=0;o<n;o++)e=[e],r.unshift(1);for(e=function e(t,n,i){var r,o;if(Array.isArray(t)){var a=i+1;for(r=0,o=t.length;r<o;r++)t[r]=e(t[r],n,a)}else for(var s=i;s<n;s++)t=[t];return t}(e,t,0);r.length<t;)r.push(1);return e}function av(e,t){for(var n,i=0,r=0;r<e.length;r++){var o=e[r],a=Array.isArray(o);if(0===r&&a&&(i=o.length),a&&o.length!==i)return;var s=a?av(o,t):t(o);if(void 0===n)n=s;else if(n!==s)return"mixed"}return n}function ay(e,t){return -1!==e.indexOf(t)}function ax(e,t,n,i){if(!(this instanceof ax))throw SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=i,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(null!=i?"-"+i:"")+" expected)",this.stack=Error().stack}al.prototype=RangeError(),al.prototype.constructor=RangeError,al.prototype.name="DimensionError",al.prototype.isDimensionError=!0,au.prototype=RangeError(),au.prototype.constructor=RangeError,au.prototype.name="IndexError",au.prototype.isIndexError=!0,ax.prototype=Error(),ax.prototype.constructor=Error,ax.prototype.name="ArgumentsError",ax.prototype.isArgumentsError=!0;var ab={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null},aw=["Matrix","Array"],aS=["number","BigNumber","Fraction"];function a_(e,t,n){var i;void 0!==e[t]&&(i=e[t],-1===n.indexOf(i))&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+n.map(e=>JSON.stringify(e)).join(", ")+".")}function aM(e,t){var n,i,r,o=(0,ou.A)({},ab,t);if("function"!=typeof Object.create)throw Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var a=((n={isNumber:oc,isComplex:od,isBigNumber:oh,isFraction:op,isUnit:of,isString:og,isArray:om,isMatrix:ov,isCollection:oy,isDenseMatrix:ox,isSparseMatrix:ob,isRange:ow,isIndex:oS,isBoolean:o_,isResultSet:oM,isHelp:oC,isFunction:oA,isDate:ok,isRegExp:oT,isObject:oD,isNull:oI,isUndefined:oO,isAccessorNode:oP,isArrayNode:oE,isAssignmentNode:oR,isBlockNode:oL,isConditionalNode:oN,isConstantNode:oB,isFunctionAssignmentNode:oF,isFunctionNode:oz,isIndexNode:oV,isNode:oj,isObjectNode:oH,isOperatorNode:oW,isParenthesisNode:oG,isRangeNode:o$,isSymbolNode:oU,isChain:oq}).on=(i=new o1).on.bind(i),n.off=i.off.bind(i),n.once=i.once.bind(i),n.emit=i.emit.bind(i),n);a.config=function(e,t){function n(n){if(!n)return oX(e,oZ);var i=oX(e,oZ);a_(n,"matrix",aw),a_(n,"number",aS),function e(t,n){if(Array.isArray(n))throw TypeError("Arrays are not supported by deepExtend");for(var i in n)if(oJ(n,i)&&!(i in Object.prototype)&&!(i in Function.prototype))if(n[i]&&n[i].constructor===Object)void 0===t[i]&&(t[i]={}),t[i]&&t[i].constructor===Object?e(t[i],n[i]):t[i]=n[i];else if(Array.isArray(n[i]))throw TypeError("Arrays are not supported by deepExtend");else t[i]=n[i];return t}(e,n);var r=oX(e,oZ);return t("config",r,i,oX(n,oZ)),r}return n.MATRIX_OPTIONS=aw,n.NUMBER_OPTIONS=aS,Object.keys(ab).forEach(t=>{Object.defineProperty(n,t,{get:()=>e[t],enumerable:!0,configurable:!0})}),n}(o,a.emit),a.expression={transform:{},mathWithTransform:{config:a.config}};var s={},l=function(e,t,n){function i(e,n){n&&"function"==typeof n.transform?(t.expression.transform[e]=n.transform,oJ(a,e)||(t.expression.mathWithTransform[e]=n.transform)):(delete t.expression.transform[e],oJ(a,e)||(t.expression.mathWithTransform[e]=n))}function r(e){return"function"==typeof e&&"object"==typeof e.signatures}function o(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction}var a={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(s,l){var u=arguments.length;if(1!==u&&2!==u)throw new ax("import",u,1,2);l||(l={});var c={};for(var h in!function e(t,n,i){if(Array.isArray(n))n.forEach(n=>e(t,n));else if("object"==typeof n)for(var r in n)oJ(n,r)&&e(t,n[r],r);else if(o5(n)||void 0!==i){var a=o5(n)?o(n)?n.fn+".transform":n.fn:i;if(oJ(t,a)&&t[a]!==n&&!l.silent)throw Error('Cannot import "'+a+'" twice');t[a]=n}else if(!l.silent)throw TypeError("Factory, Object, or Array expected")}(c,s),c)if(oJ(c,h)){var d,p=c[h];if(o5(p))!function(i,s){var l,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.fn;if(ay(u,"."))throw Error("Factory name should not contain a nested path. Name: "+JSON.stringify(u));var c=o(i)?t.expression.transform:t,h=u in t.expression.transform,d=oJ(c,u)?c[u]:void 0,p=function(){var n={};i.dependencies.map(o3).forEach(e=>{if(ay(e,"."))throw Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?n.math=t:"mathWithTransform"===e?n.mathWithTransform=t.expression.mathWithTransform:"classes"===e?n.classes=t:n[e]=t[e]});var o=i(n);if(o&&"function"==typeof o.transform)throw Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(void 0===d||s.override)return o;if(r(d)&&r(o))return e(d,o);if(s.silent)return d;throw Error('Cannot import "'+u+'": already exists')};i.meta&&!1===i.meta.lazy?c[u]=p():oQ(c,u,p),d&&h?function(e){delete t.expression.transform[e],oJ(a,e)?delete t.expression.mathWithTransform[e]:t.expression.mathWithTransform[e]=t[e]}(u):!o(i)&&(-1!==(l=i).fn.indexOf(".")||oJ(a,l.fn)||l.meta&&l.meta.isClass)||oQ(t.expression.mathWithTransform,u,()=>c[u]),n[u]=i,t.emit("import",u,p)}(p,l);else{if("function"==typeof(d=p)||"number"==typeof d||"string"==typeof d||"boolean"==typeof d||null===d||of(d)||od(d)||oh(d)||op(d)||ov(d)||Array.isArray(d))!function(o,a,s){var l;if(s.wrap&&"function"==typeof a&&(a=function(e){var n=function(){for(var n=[],i=0,r=arguments.length;i<r;i++){var o=arguments[i];n[i]=o&&o.valueOf()}return e.apply(t,n)};return e.transform&&(n.transform=e.transform),n}(a)),"function"==typeof(l=a)&&"string"==typeof l.signature&&(a=e(o,{[a.signature]:a})),r(t[o])&&r(a)){a=s.override?e(o,a.signatures):e(t[o],a),t[o]=a,delete n[o],i(o,a),t.emit("import",o,function(){return a});return}if(void 0===t[o]||s.override){t[o]=a,delete n[o],i(o,a),t.emit("import",o,function(){return a});return}if(!s.silent)throw Error('Cannot import "'+o+'": already exists')}(h,p,l);else if(!l.silent)throw TypeError("Factory, Object, or Array expected")}}}}(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return a.typed.apply(a.typed,t)},a,s);return a.import=l,a.on("config",()=>{o0(s).forEach(e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&l(e,{override:!0})})}),a.create=aM.bind(null,e),a.factory=o2,a.import(o0((function e(t,n){for(var i in t)if(oJ(t,i)){var r=t[i];"object"==typeof r&&null!==r?e(r,n):n[i]=r}}(e,r={}),r))),a.ArgumentsError=ax,a.DimensionError=al,a.IndexError=au,a}var aC,aA,ak,aT,aD,aI,aO,aP,aE,aR,aL,aN,aB,aF,az,aV,aj,aH,aW="0123456789abcdef",aG="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",a$="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",aU={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},aq=!0,aY="[DecimalError] ",aZ=aY+"Invalid argument: ",aX=aY+"Precision limit exceeded",aK=aY+"crypto unavailable",aQ="[object Decimal]",aJ=Math.floor,a0=Math.pow,a1=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,a2=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,a5=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,a3=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,a4=aG.length-1,a6=a$.length-1,a8={toStringTag:aQ};function a9(e){var t,n,i,r=e.length-1,o="",a=e[0];if(r>0){for(o+=a,t=1;t<r;t++)(n=7-(i=e[t]+"").length)&&(o+=su(n)),o+=i;(n=7-(i=(a=e[t])+"").length)&&(o+=su(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function a7(e,t,n){if(e!==~~e||e<t||e>n)throw Error(aZ+e)}function se(e,t,n,i){var r,o,a,s;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=7,r=0):(r=Math.ceil((t+1)/7),t%=7),o=a0(10,7-t),s=e[r]%o|0,null==i?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),a=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):a=(n<4&&s+1==o||n>3&&s+1==o/2)&&(e[r+1]/o/100|0)==a0(10,t-2)-1||(s==o/2||0==s)&&(e[r+1]/o/100|0)==0:t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),a=(i||n<4)&&9999==s||!i&&n>3&&4999==s):a=((i||n<4)&&s+1==o||!i&&n>3&&s+1==o/2)&&(e[r+1]/o/1e3|0)==a0(10,t-3)-1,a}function st(e,t,n){for(var i,r,o=[0],a=0,s=e.length;a<s;){for(r=o.length;r--;)o[r]*=t;for(o[0]+=aW.indexOf(e.charAt(a++)),i=0;i<o.length;i++)o[i]>n-1&&(void 0===o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/n|0,o[i]%=n)}return o.reverse()}a8.absoluteValue=a8.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),si(e)},a8.ceil=function(){return si(new this.constructor(this),this.e+1,2)},a8.clampedTo=a8.clamp=function(e,t){var n=this.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(aZ+t);return 0>this.cmp(e)?e:this.cmp(t)>0?t:new n(this)},a8.comparedTo=a8.cmp=function(e){var t,n,i,r,o=this.d,a=(e=new this.constructor(e)).d,s=this.s,l=e.s;if(!o||!a)return s&&l?s!==l?s:o===a?0:!o^s<0?1:-1:NaN;if(!o[0]||!a[0])return o[0]?s:a[0]?-l:0;if(s!==l)return s;if(this.e!==e.e)return this.e>e.e^s<0?1:-1;for(t=0,n=(i=o.length)<(r=a.length)?i:r;t<n;++t)if(o[t]!==a[t])return o[t]>a[t]^s<0?1:-1;return i===r?0:i>r^s<0?1:-1},a8.cosine=a8.cos=function(){var e,t,n=this,i=n.constructor;return n.d?n.d[0]?(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+7,i.rounding=1,n=function(e,t){var n,i,r;if(t.isZero())return t;(i=t.d.length)<32?r=(1/sy(4,n=Math.ceil(i/3))).toString():(n=16,r="2.3283064365386962890625e-10"),e.precision+=n,t=sv(e,1,t.times(r),new e(1));for(var o=n;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=n,t}(i,sx(i,n)),i.precision=e,i.rounding=t,si(2==aH||3==aH?n.neg():n,e,t,!0)):new i(1):new i(NaN)},a8.cubeRoot=a8.cbrt=function(){var e,t,n,i,r,o,a,s,l,u,c=this.constructor;if(!this.isFinite()||this.isZero())return new c(this);for(aq=!1,(o=this.s*a0(this.s*this,1/3))&&Math.abs(o)!=1/0?i=new c(o.toString()):(n=a9(this.d),(o=((e=this.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=a0(n,1/3),e=aJ((e+1)/3)-(e%3==(e<0?-1:2)),(i=new c(n=o==1/0?"5e"+e:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=this.s),a=(e=c.precision)+3;;)if(i=sn((u=(l=(s=i).times(s).times(s)).plus(this)).plus(this).times(s),u.plus(l),a+2,1),a9(s.d).slice(0,a)===(n=a9(i.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(r||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(si(i,e+1,1),t=!i.times(i).times(i).eq(this));break}if(!r&&(si(s,e+1,0),s.times(s).times(s).eq(this))){i=s;break}a+=4,r=1}return aq=!0,si(i,e,c.rounding,t)},a8.decimalPlaces=a8.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=((e=t.length-1)-aJ(this.e/7))*7,e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},a8.dividedBy=a8.div=function(e){return sn(this,new this.constructor(e))},a8.dividedToIntegerBy=a8.divToInt=function(e){var t=this.constructor;return si(sn(this,new t(e),0,1,1),t.precision,t.rounding)},a8.equals=a8.eq=function(e){return 0===this.cmp(e)},a8.floor=function(){return si(new this.constructor(this),this.e+1,3)},a8.greaterThan=a8.gt=function(e){return this.cmp(e)>0},a8.greaterThanOrEqualTo=a8.gte=function(e){var t=this.cmp(e);return 1==t||0===t},a8.hyperbolicCosine=a8.cosh=function(){var e,t,n,i,r,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;n=a.precision,i=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(r=o.d.length)<32?t=(1/sy(4,e=Math.ceil(r/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=sv(a,1,o.times(t),new a(1),!0);for(var l,u=e,c=new a(8);u--;)l=o.times(o),o=s.minus(l.times(c.minus(l.times(c))));return si(o,a.precision=n,a.rounding=i,!0)},a8.hyperbolicSine=a8.sinh=function(){var e,t,n,i,r=this,o=r.constructor;if(!r.isFinite()||r.isZero())return new o(r);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(r.e,r.sd())+4,o.rounding=1,(i=r.d.length)<3)r=sv(o,2,r,r,!0);else{e=(e=1.4*Math.sqrt(i))>16?16:0|e,r=sv(o,2,r=r.times(1/sy(5,e)),r,!0);for(var a,s=new o(5),l=new o(16),u=new o(20);e--;)a=r.times(r),r=r.times(s.plus(a.times(l.times(a).plus(u))))}return o.precision=t,o.rounding=n,si(r,t,n,!0)},a8.hyperbolicTangent=a8.tanh=function(){var e,t,n=this.constructor;return this.isFinite()?this.isZero()?new n(this):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,sn(this.sinh(),this.cosh(),n.precision=e,n.rounding=t)):new n(this.s)},a8.inverseCosine=a8.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),i=t.precision,r=t.rounding;return -1!==n?0===n?e.isNeg()?ss(t,i,r):new t(0):new t(NaN):e.isZero()?ss(t,i+4,r).times(.5):(t.precision=i+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=i,t.rounding=r,e.times(2))},a8.inverseHyperbolicCosine=a8.acosh=function(){var e,t,n=this,i=n.constructor;return n.lte(1)?new i(n.eq(1)?0:NaN):n.isFinite()?(e=i.precision,t=i.rounding,i.precision=e+Math.max(Math.abs(n.e),n.sd())+4,i.rounding=1,aq=!1,n=n.times(n).minus(1).sqrt().plus(n),aq=!0,i.precision=e,i.rounding=t,n.ln()):new i(n)},a8.inverseHyperbolicSine=a8.asinh=function(){var e,t,n=this,i=n.constructor;return!n.isFinite()||n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,i.rounding=1,aq=!1,n=n.times(n).plus(1).sqrt().plus(n),aq=!0,i.precision=e,i.rounding=t,n.ln())},a8.inverseHyperbolicTangent=a8.atanh=function(){var e,t,n,i,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=o.precision,t=o.rounding,Math.max(i=r.sd(),e)<-(2*r.e)-1)?si(new o(r),e,t,!0):(o.precision=n=i-r.e,r=sn(r.plus(1),new o(1).minus(r),n+e,1),o.precision=e+4,o.rounding=1,r=r.ln(),o.precision=e,o.rounding=t,r.times(.5)):new o(NaN)},a8.inverseSine=a8.asin=function(){var e,t,n,i,r=this,o=r.constructor;return r.isZero()?new o(r):(t=r.abs().cmp(1),n=o.precision,i=o.rounding,-1!==t)?0===t?((e=ss(o,n+4,i).times(.5)).s=r.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,r=r.div(new o(1).minus(r.times(r)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=i,r.times(2))},a8.inverseTangent=a8.atan=function(){var e,t,n,i,r,o,a,s,l,u=this,c=u.constructor,h=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);else if(u.abs().eq(1)&&h+4<=a6)return(a=ss(c,h+4,d).times(.25)).s=u.s,a}else{if(!u.s)return new c(NaN);if(h+4<=a6)return(a=ss(c,h+4,d).times(.5)).s=u.s,a}for(c.precision=s=h+10,c.rounding=1,e=n=Math.min(28,s/7+2|0);e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(aq=!1,t=Math.ceil(s/7),i=1,l=u.times(u),a=new c(u),r=u;-1!==e;)if(r=r.times(l),o=a.minus(r.div(i+=2)),r=r.times(l),void 0!==(a=o.plus(r.div(i+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return n&&(a=a.times(2<<n-1)),aq=!0,si(a,c.precision=h,c.rounding=d,!0)},a8.isFinite=function(){return!!this.d},a8.isInteger=a8.isInt=function(){return!!this.d&&aJ(this.e/7)>this.d.length-2},a8.isNaN=function(){return!this.s},a8.isNegative=a8.isNeg=function(){return this.s<0},a8.isPositive=a8.isPos=function(){return this.s>0},a8.isZero=function(){return!!this.d&&0===this.d[0]},a8.lessThan=a8.lt=function(e){return 0>this.cmp(e)},a8.lessThanOrEqualTo=a8.lte=function(e){return 1>this.cmp(e)},a8.logarithm=a8.log=function(e){var t,n,i,r,o,a,s,l=this.constructor,u=l.precision,c=l.rounding;if(null==e)e=new l(10),t=!0;else{if(n=(e=new l(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=this.d,this.s<0||!n||!n[0]||this.eq(1))return new l(n&&!n[0]?-1/0:1!=this.s?NaN:n?0:1/0);if(t)if(n.length>1)r=!0;else{for(i=n[0];i%10==0;)i/=10;r=1!==i}if(aq=!1,se((s=sn(o=sf(this,a=u+5),t?sa(l,a+10):sf(e,a),a,1)).d,i=u,c))do if(a+=10,s=sn(o=sf(this,a),t?sa(l,a+10):sf(e,a),a,1),!r){+a9(s.d).slice(i+1,i+15)+1==1e14&&(s=si(s,u+1,0));break}while(se(s.d,i+=10,c));return aq=!0,si(s,u,c)},a8.minus=a8.sub=function(e){var t,n,i,r,o,a,s,l,u,c,h,d,p=this.constructor;if(e=new p(e),!this.d||!e.d)return this.s&&e.s?this.d?e.s=-e.s:e=new p(e.d||this.s!==e.s?this:NaN):e=new p(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.plus(e);if(u=this.d,d=e.d,s=p.precision,l=p.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else{if(!u[0])return new p(3===l?-0:0);e=new p(this)}return aq?si(e,s,l):e}if(n=aJ(e.e/7),c=aJ(this.e/7),u=u.slice(),o=c-n){for((h=o<0)?(t=u,o=-o,a=d.length):(t=d,n=c,a=u.length),o>(i=Math.max(Math.ceil(s/7),a)+2)&&(o=i,t.length=1),t.reverse(),i=o;i--;)t.push(0);t.reverse()}else{for((h=(i=u.length)<(a=d.length))&&(a=i),i=0;i<a;i++)if(u[i]!=d[i]){h=u[i]<d[i];break}o=0}for(h&&(t=u,u=d,d=t,e.s=-e.s),a=u.length,i=d.length-a;i>0;--i)u[a++]=0;for(i=d.length;i>o;){if(u[--i]<d[i]){for(r=i;r&&0===u[--r];)u[r]=1e7-1;--u[r],u[i]+=1e7}u[i]-=d[i]}for(;0===u[--a];)u.pop();for(;0===u[0];u.shift())--n;return u[0]?(e.d=u,e.e=so(u,n),aq?si(e,s,l):e):new p(3===l?-0:0)},a8.modulo=a8.mod=function(e){var t,n=this.constructor;return(e=new n(e),this.d&&e.s&&(!e.d||e.d[0]))?e.d&&(!this.d||this.d[0])?(aq=!1,9==n.modulo?(t=sn(this,e.abs(),0,3,1),t.s*=e.s):t=sn(this,e,0,n.modulo,1),t=t.times(e),aq=!0,this.minus(t)):si(new n(this),n.precision,n.rounding):new n(NaN)},a8.naturalExponential=a8.exp=function(){return sp(this)},a8.naturalLogarithm=a8.ln=function(){return sf(this)},a8.negated=a8.neg=function(){var e=new this.constructor(this);return e.s=-e.s,si(e)},a8.plus=a8.add=function(e){var t,n,i,r,o,a,s,l,u,c,h=this.constructor;if(e=new h(e),!this.d||!e.d)return this.s&&e.s?this.d||(e=new h(e.d||this.s===e.s?this:NaN)):e=new h(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.minus(e);if(u=this.d,c=e.d,s=h.precision,l=h.rounding,!u[0]||!c[0])return c[0]||(e=new h(this)),aq?si(e,s,l):e;if(o=aJ(this.e/7),i=aJ(e.e/7),u=u.slice(),r=o-i){for(r<0?(n=u,r=-r,a=c.length):(n=c,i=o,a=u.length),r>(a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(r=a,n.length=1),n.reverse();r--;)n.push(0);n.reverse()}for((a=u.length)-(r=c.length)<0&&(r=a,n=c,c=u,u=n),t=0;r;)t=(u[--r]=u[r]+c[r]+t)/1e7|0,u[r]%=1e7;for(t&&(u.unshift(t),++i),a=u.length;0==u[--a];)u.pop();return e.d=u,e.e=so(u,i),aq?si(e,s,l):e},a8.precision=a8.sd=function(e){var t;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(aZ+e);return this.d?(t=sl(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},a8.round=function(){var e=this.constructor;return si(new e(this),this.e+1,e.rounding)},a8.sine=a8.sin=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+7,i.rounding=1,n=function(e,t){var n,i=t.d.length;if(i<3)return t.isZero()?t:sv(e,2,t,t);n=(n=1.4*Math.sqrt(i))>16?16:0|n,t=sv(e,2,t=t.times(1/sy(5,n)),t);for(var r,o=new e(5),a=new e(16),s=new e(20);n--;)r=t.times(t),t=t.times(o.plus(r.times(a.times(r).minus(s))));return t}(i,sx(i,n)),i.precision=e,i.rounding=t,si(aH>2?n.neg():n,e,t,!0)):new i(NaN)},a8.squareRoot=a8.sqrt=function(){var e,t,n,i,r,o,a=this.d,s=this.e,l=this.s,u=this.constructor;if(1!==l||!a||!a[0])return new u(!l||l<0&&(!a||a[0])?NaN:a?this:1/0);for(aq=!1,0==(l=Math.sqrt(+this))||l==1/0?(((t=a9(a)).length+s)%2==0&&(t+="0"),l=Math.sqrt(t),s=aJ((s+1)/2)-(s<0||s%2),i=new u(t=l==1/0?"5e"+s:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+s)):i=new u(l.toString()),n=(s=u.precision)+3;;)if(i=(o=i).plus(sn(this,o,n+2,1)).times(.5),a9(o.d).slice(0,n)===(t=a9(i.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(r||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(si(i,s+1,1),e=!i.times(i).eq(this));break}if(!r&&(si(o,s+1,0),o.times(o).eq(this))){i=o;break}n+=4,r=1}return aq=!0,si(i,s,u.rounding,e)},a8.tangent=a8.tan=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+10,i.rounding=1,(n=n.sin()).s=1,n=sn(n,new i(1).minus(n.times(n)).sqrt(),e+10,0),i.precision=e,i.rounding=t,si(2==aH||4==aH?n.neg():n,e,t,!0)):new i(NaN)},a8.times=a8.mul=function(e){var t,n,i,r,o,a,s,l,u,c=this.constructor,h=this.d,d=(e=new c(e)).d;if(e.s*=this.s,!h||!h[0]||!d||!d[0])return new c(!e.s||h&&!h[0]&&!d||d&&!d[0]&&!h?NaN:!h||!d?e.s/0:0*e.s);for(n=aJ(this.e/7)+aJ(e.e/7),(l=h.length)<(u=d.length)&&(o=h,h=d,d=o,a=l,l=u,u=a),o=[],i=a=l+u;i--;)o.push(0);for(i=u;--i>=0;){for(t=0,r=l+i;r>i;)s=o[r]+d[i]*h[r-i-1]+t,o[r--]=s%1e7|0,t=s/1e7|0;o[r]=(o[r]+t)%1e7|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=so(o,n),aq?si(e,c.precision,c.rounding):e},a8.toBinary=function(e,t){return sb(this,2,e,t)},a8.toDecimalPlaces=a8.toDP=function(e,t){var n=this,i=n.constructor;return(n=new i(n),void 0===e)?n:(a7(e,0,1e9),void 0===t?t=i.rounding:a7(t,0,8),si(n,e+n.e+1,t))},a8.toExponential=function(e,t){var n,i=this,r=i.constructor;return void 0===e?n=sr(i,!0):(a7(e,0,1e9),void 0===t?t=r.rounding:a7(t,0,8),n=sr(i=si(new r(i),e+1,t),!0,e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},a8.toFixed=function(e,t){var n,i,r=this.constructor;return void 0===e?n=sr(this):(a7(e,0,1e9),void 0===t?t=r.rounding:a7(t,0,8),n=sr(i=si(new r(this),e+this.e+1,t),!1,e+i.e+1)),this.isNeg()&&!this.isZero()?"-"+n:n},a8.toFraction=function(e){var t,n,i,r,o,a,s,l,u,c,h,d,p=this.d,f=this.constructor;if(!p)return new f(this);if(u=n=new f(1),i=l=new f(0),a=(o=(t=new f(i)).e=sl(p)-this.e-1)%7,t.d[0]=a0(10,a<0?7+a:a),null==e)e=o>0?t:u;else{if(!(s=new f(e)).isInt()||s.lt(u))throw Error(aZ+s);e=s.gt(t)?o>0?t:u:s}for(aq=!1,s=new f(a9(p)),c=f.precision,f.precision=o=7*p.length*2;h=sn(s,t,0,1,1),1!=(r=n.plus(h.times(i))).cmp(e);)n=i,i=r,r=u,u=l.plus(h.times(r)),l=r,r=t,t=s.minus(h.times(r)),s=r;return r=sn(e.minus(n),i,0,1,1),l=l.plus(r.times(u)),n=n.plus(r.times(i)),l.s=u.s=this.s,d=1>sn(u,i,o,1).minus(this).abs().cmp(sn(l,n,o,1).minus(this).abs())?[u,i]:[l,n],f.precision=c,aq=!0,d},a8.toHexadecimal=a8.toHex=function(e,t){return sb(this,16,e,t)},a8.toNearest=function(e,t){var n=this,i=n.constructor;if(n=new i(n),null==e){if(!n.d)return n;e=new i(1),t=i.rounding}else{if(e=new i(e),void 0===t?t=i.rounding:a7(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(aq=!1,n=sn(n,e,0,t,1).times(e),aq=!0,si(n)):(e.s=n.s,n=e),n},a8.toNumber=function(){return+this},a8.toOctal=function(e,t){return sb(this,8,e,t)},a8.toPower=a8.pow=function(e){var t,n,i,r,o,a,s=this,l=s.constructor,u=+(e=new l(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new l(a0(+s,u));if((s=new l(s)).eq(1))return s;if(i=l.precision,o=l.rounding,e.eq(1))return si(s,i,o);if((t=aJ(e.e/7))>=e.d.length-1&&(n=u<0?-u:u)<=0x1fffffffffffff)return r=sc(l,s,n,i),e.s<0?new l(1).div(r):si(r,i,o);if((a=s.s)<0){if(t<e.d.length-1)return new l(NaN);if((1&e.d[t])==0&&(a=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=a,s}return(t=0!=(n=a0(+s,u))&&isFinite(n)?new l(n+"").e:aJ(u*(Math.log("0."+a9(s.d))/Math.LN10+s.e+1)))>l.maxE+1||t<l.minE-1?new l(t>0?a/0:0):(aq=!1,l.rounding=s.s=1,n=Math.min(12,(t+"").length),(r=sp(e.times(sf(s,i+n)),i)).d&&se((r=si(r,i+5,1)).d,i,o)&&(t=i+10,+a9((r=si(sp(e.times(sf(s,t+n)),t),t+5,1)).d).slice(i+1,i+15)+1==1e14&&(r=si(r,i+1,0))),r.s=a,aq=!0,l.rounding=o,si(r,i,o))},a8.toPrecision=function(e,t){var n,i=this,r=i.constructor;return void 0===e?n=sr(i,i.e<=r.toExpNeg||i.e>=r.toExpPos):(a7(e,1,1e9),void 0===t?t=r.rounding:a7(t,0,8),n=sr(i=si(new r(i),e,t),e<=i.e||i.e<=r.toExpNeg,e)),i.isNeg()&&!i.isZero()?"-"+n:n},a8.toSignificantDigits=a8.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(a7(e,1,1e9),void 0===t?t=n.rounding:a7(t,0,8)),si(new n(this),e,t)},a8.toString=function(){var e=this.constructor,t=sr(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()&&!this.isZero()?"-"+t:t},a8.truncated=a8.trunc=function(){return si(new this.constructor(this),this.e+1,1)},a8.valueOf=a8.toJSON=function(){var e=this.constructor,t=sr(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()?"-"+t:t};var sn=function(){function e(e,t,n){var i,r=0,o=e.length;for(e=e.slice();o--;)i=e[o]*t+r,e[o]=i%n|0,r=i/n|0;return r&&e.unshift(r),e}function t(e,t,n,i){var r,o;if(n!=i)o=n>i?1:-1;else for(r=o=0;r<n;r++)if(e[r]!=t[r]){o=e[r]>t[r]?1:-1;break}return o}function n(e,t,n,i){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*i+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(i,r,o,a,s,l){var u,c,h,d,p,f,g,m,v,y,x,b,w,S,_,M,C,A,k,T,D=i.constructor,I=i.s==r.s?1:-1,O=i.d,P=r.d;if(!O||!O[0]||!P||!P[0])return new D(!i.s||!r.s||(O?P&&O[0]==P[0]:!P)?NaN:O&&0==O[0]||!P?0*I:I/0);for(l?(p=1,c=i.e-r.e):(l=1e7,p=7,c=aJ(i.e/p)-aJ(r.e/p)),k=P.length,C=O.length,y=(v=new D(I)).d=[],h=0;P[h]==(O[h]||0);h++);if(P[h]>(O[h]||0)&&c--,null==o?(S=o=D.precision,a=D.rounding):S=s?o+(i.e-r.e)+1:o,S<0)y.push(1),f=!0;else{if(S=S/p+2|0,h=0,1==k){for(d=0,P=P[0],S++;(h<C||d)&&S--;h++)_=d*l+(O[h]||0),y[h]=_/P|0,d=_%P|0;f=d||h<C}else{for((d=l/(P[0]+1)|0)>1&&(P=e(P,d,l),O=e(O,d,l),k=P.length,C=O.length),M=k,b=(x=O.slice(0,k)).length;b<k;)x[b++]=0;(T=P.slice()).unshift(0),A=P[0],P[1]>=l/2&&++A;do d=0,(u=t(P,x,k,b))<0?(w=x[0],k!=b&&(w=w*l+(x[1]||0)),(d=w/A|0)>1?(d>=l&&(d=l-1),m=(g=e(P,d,l)).length,b=x.length,1==(u=t(g,x,m,b))&&(d--,n(g,k<m?T:P,m,l))):(0==d&&(u=d=1),g=P.slice()),(m=g.length)<b&&g.unshift(0),n(x,g,b,l),-1==u&&(b=x.length,(u=t(P,x,k,b))<1&&(d++,n(x,k<b?T:P,b,l))),b=x.length):0===u&&(d++,x=[0]),y[h++]=d,u&&x[0]?x[b++]=O[M]||0:(x=[O[M]],b=1);while((M++<C||void 0!==x[0])&&S--);f=void 0!==x[0]}y[0]||y.shift()}if(1==p)v.e=c,aj=f;else{for(h=1,d=y[0];d>=10;d/=10)h++;v.e=h+c*p-1,si(v,s?o+v.e+1:o,a,f)}return v}}();function si(e,t,n,i){var r,o,a,s,l,u,c,h,d,p=e.constructor;e:if(null!=t){if(!(h=e.d))return e;for(r=1,s=h[0];s>=10;s/=10)r++;if((o=t-r)<0)o+=7,a=t,l=(c=h[d=0])/a0(10,r-a-1)%10|0;else if((d=Math.ceil((o+1)/7))>=(s=h.length))if(i){for(;s++<=d;)h.push(0);c=l=0,r=1,o%=7,a=o-7+1}else break e;else{for(r=1,c=s=h[d];s>=10;s/=10)r++;o%=7,l=(a=o-7+r)<0?0:c/a0(10,r-a-1)%10|0}if(i=i||t<0||void 0!==h[d+1]||(a<0?c:c%a0(10,r-a-1)),u=n<4?(l||i)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||i||6==n&&(o>0?a>0?c/a0(10,r-a):0:h[d-1])%10&1||n==(e.s<0?8:7)),t<1||!h[0])return h.length=0,u?(t-=e.e+1,h[0]=a0(10,(7-t%7)%7),e.e=-t||0):h[0]=e.e=0,e;if(0==o?(h.length=d,s=1,d--):(h.length=d+1,s=a0(10,7-o),h[d]=a>0?(c/a0(10,r-a)%a0(10,a)|0)*s:0),u)for(;;)if(0==d){for(o=1,a=h[0];a>=10;a/=10)o++;for(a=h[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(e.e++,1e7==h[0]&&(h[0]=1));break}else{if(h[d]+=s,1e7!=h[d])break;h[d--]=0,s=1}for(o=h.length;0===h[--o];)h.pop()}return aq&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function sr(e,t,n){if(!e.isFinite())return sg(e);var i,r=e.e,o=a9(e.d),a=o.length;return t?(n&&(i=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+su(i):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):r<0?(o="0."+su(-r-1)+o,n&&(i=n-a)>0&&(o+=su(i))):r>=a?(o+=su(r+1-a),n&&(i=n-r-1)>0&&(o=o+"."+su(i))):((i=r+1)<a&&(o=o.slice(0,i)+"."+o.slice(i)),n&&(i=n-a)>0&&(r+1===a&&(o+="."),o+=su(i))),o}function so(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function sa(e,t,n){if(t>a4)throw aq=!0,n&&(e.precision=n),Error(aX);return si(new e(aG),t,1,!0)}function ss(e,t,n){if(t>a6)throw Error(aX);return si(new e(a$),t,n,!0)}function sl(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function su(e){for(var t="";e--;)t+="0";return t}function sc(e,t,n,i){var r,o=new e(1),a=Math.ceil(i/7+4);for(aq=!1;;){if(n%2&&sw((o=o.times(t)).d,a)&&(r=!0),0===(n=aJ(n/2))){n=o.d.length-1,r&&0===o.d[n]&&++o.d[n];break}sw((t=t.times(t)).d,a)}return aq=!0,o}function sh(e){return 1&e.d[e.d.length-1]}function sd(e,t,n){for(var i,r,o=new e(t[0]),a=0;++a<t.length;){if(!(r=new e(t[a])).s){o=r;break}((i=o.cmp(r))===n||0===i&&o.s===n)&&(o=r)}return o}function sp(e,t){var n,i,r,o,a,s,l,u=0,c=0,h=0,d=e.constructor,p=d.rounding,f=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?!e.d[0]?1:e.s<0?0:1/0:e.s?e.s<0?0:e:0/0);for(null==t?(aq=!1,l=f):l=t,s=new d(.03125);e.e>-2;)e=e.times(s),h+=5;for(l+=i=Math.log(a0(2,h))/Math.LN10*2+5|0,n=o=a=new d(1),d.precision=l;;){if(o=si(o.times(e),l,1),n=n.times(++c),a9((s=a.plus(sn(o,n,l,1))).d).slice(0,l)===a9(a.d).slice(0,l)){for(r=h;r--;)a=si(a.times(a),l,1);if(null!=t)return d.precision=f,a;if(!(u<3&&se(a.d,l-i,p,u)))return si(a,d.precision=f,p,aq=!0);d.precision=l+=10,n=o=s=new d(1),c=0,u++}a=s}}function sf(e,t){var n,i,r,o,a,s,l,u,c,h,d,p=1,f=e,g=f.d,m=f.constructor,v=m.rounding,y=m.precision;if(f.s<0||!g||!g[0]||!f.e&&1==g[0]&&1==g.length)return new m(g&&!g[0]?-1/0:1!=f.s?NaN:g?0:f);if(null==t?(aq=!1,c=y):c=t,m.precision=c+=10,i=(n=a9(g)).charAt(0),!(15e14>Math.abs(o=f.e)))return u=sa(m,c+2,y).times(o+""),f=sf(new m(i+"."+n.slice(1)),c-10).plus(u),m.precision=y,null==t?si(f,y,v,aq=!0):f;for(;i<7&&1!=i||1==i&&n.charAt(1)>3;)i=(n=a9((f=f.times(e)).d)).charAt(0),p++;for(o=f.e,i>1?(f=new m("0."+n),o++):f=new m(i+"."+n.slice(1)),h=f,l=a=f=sn(f.minus(1),f.plus(1),c,1),d=si(f.times(f),c,1),r=3;;){if(a=si(a.times(d),c,1),a9((u=l.plus(sn(a,new m(r),c,1))).d).slice(0,c)===a9(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(sa(m,c+2,y).times(o+""))),l=sn(l,new m(p),c,1),null!=t)return m.precision=y,l;if(!se(l.d,c-10,v,s))return si(l,m.precision=y,v,aq=!0);m.precision=c+=10,u=a=f=sn(h.minus(1),h.plus(1),c,1),d=si(f.times(f),c,1),r=s=1}l=u,r+=2}}function sg(e){return String(e.s*e.s/0)}function sm(e,t){var n,i,r;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(i=t.search(/e/i))>0?(n<0&&(n=i),n+=+t.slice(i+1),t=t.substring(0,i)):n<0&&(n=t.length),i=0;48===t.charCodeAt(i);i++);for(r=t.length;48===t.charCodeAt(r-1);--r);if(t=t.slice(i,r)){if(r-=i,e.e=n=n-i-1,e.d=[],i=(n+1)%7,n<0&&(i+=7),i<r){for(i&&e.d.push(+t.slice(0,i)),r-=7;i<r;)e.d.push(+t.slice(i,i+=7));i=7-(t=t.slice(i)).length}else i-=r;for(;i--;)t+="0";e.d.push(+t),aq&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function sv(e,t,n,i,r){var o,a,s,l,u=e.precision,c=Math.ceil(u/7);for(aq=!1,l=n.times(n),s=new e(i);;){if(a=sn(s.times(l),new e(t++*t++),u,1),s=r?i.plus(a):i.minus(a),i=sn(a.times(l),new e(t++*t++),u,1),void 0!==(a=s.plus(i)).d[c]){for(o=c;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=i,i=a,a=o}return aq=!0,a.d.length=c+1,a}function sy(e,t){for(var n=e;--t;)n*=e;return n}function sx(e,t){var n,i=t.s<0,r=ss(e,e.precision,1),o=r.times(.5);if((t=t.abs()).lte(o))return aH=i?4:1,t;if((n=t.divToInt(r)).isZero())aH=i?3:2;else{if((t=t.minus(n.times(r))).lte(o))return aH=sh(n)?i?2:3:i?4:1,t;aH=sh(n)?i?1:4:i?3:2}return t.minus(r).abs()}function sb(e,t,n,i){var r,o,a,s,l,u,c,h,d,p=e.constructor,f=void 0!==n;if(f?(a7(n,1,1e9),void 0===i?i=p.rounding:a7(i,0,8)):(n=p.precision,i=p.rounding),e.isFinite()){for(a=(c=sr(e)).indexOf("."),f?(r=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):r=t,a>=0&&(c=c.replace(".",""),(d=new p(1)).e=c.length-a,d.d=st(sr(d),10,r),d.e=d.d.length),o=l=(h=st(c,10,r)).length;0==h[--l];)h.pop();if(h[0]){if(a<0?o--:((e=new p(e)).d=h,e.e=o,h=(e=sn(e,d,n,i,0,r)).d,o=e.e,u=aj),a=h[n],s=r/2,u=u||void 0!==h[n+1],u=i<4?(void 0!==a||u)&&(0===i||i===(e.s<0?3:2)):a>s||a===s&&(4===i||u||6===i&&1&h[n-1]||i===(e.s<0?8:7)),h.length=n,u)for(;++h[--n]>r-1;)h[n]=0,n||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(a=0,c="";a<l;a++)c+=aW.charAt(h[a]);if(f){if(l>1)if(16==t||8==t){for(a=16==t?4:3,--l;l%a;l++)c+="0";for(l=(h=st(c,r,t)).length;!h[l-1];--l);for(a=1,c="1.";a<l;a++)c+=aW.charAt(h[a])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}else c=f?"0p+0":"0";c=(16==t?"0x":2==t?"0b":8==t?"0o":"")+c}else c=sg(e);return e.s<0?"-"+c:c}function sw(e,t){if(e.length>t)return e.length=t,!0}function sS(e){return new this(e).abs()}function s_(e){return new this(e).acos()}function sM(e){return new this(e).acosh()}function sC(e,t){return new this(e).plus(t)}function sA(e){return new this(e).asin()}function sk(e){return new this(e).asinh()}function sT(e){return new this(e).atan()}function sD(e){return new this(e).atanh()}function sI(e,t){e=new this(e),t=new this(t);var n,i=this.precision,r=this.rounding,o=i+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?ss(this,i,r):new this(0)).s=e.s:!e.d||t.isZero()?(n=ss(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(sn(e,t,o,1)),t=ss(this,o,1),this.precision=i,this.rounding=r,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(sn(e,t,o,1)):(n=ss(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function sO(e){return new this(e).cbrt()}function sP(e){return si(e=new this(e),e.e+1,2)}function sE(e,t,n){return new this(e).clamp(t,n)}function sR(e){if(!e||"object"!=typeof e)throw Error(aY+"Object expected");var t,n,i,r=!0===e.defaults,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,9e15,"maxE",0,9e15,"minE",-9e15,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(n=o[t],r&&(this[n]=aU[n]),void 0!==(i=e[n]))if(aJ(i)===i&&i>=o[t+1]&&i<=o[t+2])this[n]=i;else throw Error(aZ+n+": "+i);if(n="crypto",r&&(this[n]=aU[n]),void 0!==(i=e[n]))if(!0===i||!1===i||0===i||1===i)if(i)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(aK);else this[n]=!1;else throw Error(aZ+n+": "+i);return this}function sL(e){return new this(e).cos()}function sN(e){return new this(e).cosh()}function sB(e,t){return new this(e).div(t)}function sF(e){return new this(e).exp()}function sz(e){return si(e=new this(e),e.e+1,3)}function sV(){var e,t,n=new this(0);for(e=0,aq=!1;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return aq=!0,new this(1/0);n=t}return aq=!0,n.sqrt()}function sj(e){return e instanceof s9||e&&e.toStringTag===aQ||!1}function sH(e){return new this(e).ln()}function sW(e,t){return new this(e).log(t)}function sG(e){return new this(e).log(2)}function s$(e){return new this(e).log(10)}function sU(){return sd(this,arguments,-1)}function sq(){return sd(this,arguments,1)}function sY(e,t){return new this(e).mod(t)}function sZ(e,t){return new this(e).mul(t)}function sX(e,t){return new this(e).pow(t)}function sK(e){var t,n,i,r,o=0,a=new this(1),s=[];if(void 0===e?e=this.precision:a7(e,1,1e9),i=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(i));o<i;)(r=t[o])>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=r%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(i*=4);o<i;)(r=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((127&t[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,o):(s.push(r%1e7),o+=4);o=i/4}else throw Error(aK);else for(;o<i;)s[o++]=1e7*Math.random()|0;for(i=s[--o],e%=7,i&&e&&(r=a0(10,7-e),s[o]=(i/r|0)*r);0===s[o];o--)s.pop();if(o<0)n=0,s=[0];else{for(n=-1;0===s[0];n-=7)s.shift();for(i=1,r=s[0];r>=10;r/=10)i++;i<7&&(n-=7-i)}return a.e=n,a.d=s,a}function sQ(e){return si(e=new this(e),e.e+1,this.rounding)}function sJ(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function s0(e){return new this(e).sin()}function s1(e){return new this(e).sinh()}function s2(e){return new this(e).sqrt()}function s5(e,t){return new this(e).sub(t)}function s3(){var e=0,t=arguments,n=new this(t[0]);for(aq=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return aq=!0,si(n,this.precision,this.rounding)}function s4(e){return new this(e).tan()}function s6(e){return new this(e).tanh()}function s8(e){return si(e=new this(e),e.e+1,1)}a8[Symbol.for("nodejs.util.inspect.custom")]=a8.toString,a8[Symbol.toStringTag]="Decimal";var s9=a8.constructor=function e(t){var n,i,r;function o(e){var t,n,i;if(!(this instanceof o))return new o(e);if(this.constructor=o,sj(e)){this.s=e.s,aq?!e.d||e.e>o.maxE?(this.e=NaN,this.d=null):e.e<o.minE?(this.e=0,this.d=[0]):(this.e=e.e,this.d=e.d.slice()):(this.e=e.e,this.d=e.d?e.d.slice():e.d);return}if("number"==(i=typeof e)){if(0===e){this.s=1/e<0?-1:1,this.e=0,this.d=[0];return}if(e<0?(e=-e,this.s=-1):this.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;aq?t>o.maxE?(this.e=NaN,this.d=null):t<o.minE?(this.e=0,this.d=[0]):(this.e=t,this.d=[e]):(this.e=t,this.d=[e]);return}if(0*e!=0){e||(this.s=NaN),this.e=NaN,this.d=null;return}return sm(this,e.toString())}if("string"===i)return 45===(n=e.charCodeAt(0))?(e=e.slice(1),this.s=-1):(43===n&&(e=e.slice(1)),this.s=1),a3.test(e)?sm(this,e):function(e,t){var n,i,r,o,a,s,l,u,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),a3.test(t))return sm(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(a2.test(t))n=16,t=t.toLowerCase();else if(a1.test(t))n=2;else if(a5.test(t))n=8;else throw Error(aZ+t);for((o=t.search(/p/i))>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),a=(o=t.indexOf("."))>=0,i=e.constructor,a&&(o=(s=(t=t.replace(".","")).length)-o,r=sc(i,new i(n),o,2*o)),o=c=(u=st(t,n,1e7)).length-1;0===u[o];--o)u.pop();return o<0?new i(0*e.s):(e.e=so(u,c),e.d=u,aq=!1,a&&(e=sn(e,r,4*s)),l&&(e=e.times(54>Math.abs(l)?a0(2,l):s9.pow(2,l))),aq=!0,e)}(this,e);if("bigint"===i)return e<0?(e=-e,this.s=-1):this.s=1,sm(this,e.toString());throw Error(aZ+e)}if(o.prototype=a8,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=sR,o.clone=e,o.isDecimal=sj,o.abs=sS,o.acos=s_,o.acosh=sM,o.add=sC,o.asin=sA,o.asinh=sk,o.atan=sT,o.atanh=sD,o.atan2=sI,o.cbrt=sO,o.ceil=sP,o.clamp=sE,o.cos=sL,o.cosh=sN,o.div=sB,o.exp=sF,o.floor=sz,o.hypot=sV,o.ln=sH,o.log=sW,o.log10=s$,o.log2=sG,o.max=sU,o.min=sq,o.mod=sY,o.mul=sZ,o.pow=sX,o.random=sK,o.round=sQ,o.sign=sJ,o.sin=s0,o.sinh=s1,o.sqrt=s2,o.sub=s5,o.sum=s3,o.tan=s4,o.tanh=s6,o.trunc=s8,void 0===t&&(t={}),t&&!0!==t.defaults)for(n=0,r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"];n<r.length;)t.hasOwnProperty(i=r[n++])||(t[i]=this[i]);return o.config(t),o}(aU);aG=new s9(aG),a$=new s9(a$);var s7={createBigNumberClass:o2("BigNumber",["?on","config"],e=>{var{on:t,config:n}=e,i=s9.clone({precision:n.precision,modulo:s9.EUCLID});return i.prototype=Object.create(i.prototype),i.prototype.type="BigNumber",i.prototype.isBigNumber=!0,i.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},i.fromJSON=function(e){return new i(e.value)},t&&t("config",function(e,t){e.precision!==t.precision&&i.config({precision:e.precision})}),i},{isClass:!0})},le={createMatrixClass:o2("Matrix",[],()=>{function e(){if(!(this instanceof e))throw SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,n){throw Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,n){throw Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0})},lt={MatrixDependencies:le,createDenseMatrixClass:o2("DenseMatrix",["Matrix"],e=>{var{Matrix:t}=e;function n(e,t){if(!(this instanceof n))throw SyntaxError("Constructor must be called with the new operator");if(t&&!og(t))throw Error("Invalid datatype: "+t);if(ov(e))"DenseMatrix"===e.type?(this._data=oZ(e._data),this._size=oZ(e._size)):(this._data=e.toArray(),this._size=e.size()),this._datatype=t||e._datatype;else if(e&&om(e.data)&&om(e.size))this._data=e.data,this._size=e.size,ah(this._data,this._size),this._datatype=t||e.datatype;else if(om(e))this._data=function e(t){for(var n=0,i=t.length;n<i;n++){var r=t[n];om(r)?t[n]=e(r):r&&!0===r.isMatrix&&(t[n]=e(r.valueOf()))}return t}(e),this._size=ac(this._data),ah(this._data,this._size),this._datatype=t;else if(e)throw TypeError("Unsupported type of data ("+oY(e)+")");else this._data=[],this._size=[0],this._datatype=t}function i(e,t,n){if(0===t.length){for(var i=e._data;om(i);)i=i[0];return i}return e._size=t.slice(0),e._data=ap(e._data,e._size,n),e}function r(e,t,n){for(var r=e._size.slice(0),o=!1;r.length<t.length;)r.push(0),o=!0;for(var a=0,s=t.length;a<s;a++)t[a]>r[a]&&(r[a]=t[a],o=!0);o&&i(e,r,n)}return n.prototype=new t,n.prototype.createDenseMatrix=function(e,t){return new n(e,t)},n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return av(this._data,oY)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(e,t){return new n(e,t)},n.prototype.subset=function(e,t,i){switch(arguments.length){case 1:return function(e,t){if(!oS(t))throw TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var i=t.size();if(i.length!==e._size.length)throw new al(i.length,e._size.length);for(var r=t.min(),o=t.max(),a=0,s=e._size.length;a<s;a++)ad(r[a],e._size[a]),ad(o[a],e._size[a]);return new n(function e(t,n,i,r){var o=r===i-1,a=n.dimension(r);return o?a.map(function(e){return ad(e,t.length),t[e]}).valueOf():a.map(function(o){return ad(o,t.length),e(t[o],n,i,r+1)}).valueOf()}(e._data,t,i.length,0),e._datatype)}(this,e);case 2:case 3:return function(e,t,n,i){if(!t||!0!==t.isIndex)throw TypeError("Invalid index");var o,a=t.size(),s=t.isScalar();if(ov(n)?(o=n.size(),n=n.valueOf()):o=ac(n),s){if(0!==o.length)throw TypeError("Scalar expected");e.set(t.min(),n,i)}else{if(a.length<e._size.length)throw new al(a.length,e._size.length,"<");if(o.length<a.length){for(var l=0,u=0;1===a[l]&&1===o[l];)l++;for(;1===a[l];)u++,l++;n=am(n,a.length,u,o)}if(!oK(a,o))throw new al(a,o,">");r(e,t.max().map(function(e){return e+1}),i);var c=a.length;!function e(t,n,i,r,o){var a=o===r-1,s=n.dimension(o);a?s.forEach(function(e,n){ad(e),t[e]=i[n[0]]}):s.forEach(function(a,s){ad(a),e(t[a],n,i[s[0]],r,o+1)})}(e._data,t,n,c,0)}return e}(this,e,t,i);default:throw SyntaxError("Wrong number of arguments")}},n.prototype.get=function(e){if(!om(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new al(e.length,this._size.length);for(var t=0;t<e.length;t++)ad(e[t],this._size[t]);for(var n=this._data,i=0,r=e.length;i<r;i++){var o=e[i];ad(o,n.length),n=n[o]}return n},n.prototype.set=function(e,t,n){if(!om(e))throw TypeError("Array expected");if(e.length<this._size.length)throw new al(e.length,this._size.length,"<");r(this,e.map(function(e){return e+1}),n);var i,o,a,s=this._data;for(i=0,o=e.length-1;i<o;i++)ad(a=e[i],s.length),s=s[a];return ad(a=e[e.length-1],s.length),s[a]=t,this},n.prototype.resize=function(e,t,n){if(!oy(e))throw TypeError("Array or Matrix expected");var r=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);return i(n?this.clone():this,r,t)},n.prototype.reshape=function(e,t){var n=t?this.clone():this;n._data=function(e,t){var n=function(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function e(n){Array.isArray(n)?n.forEach(e):t.push(n)}),t}(e),i=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw TypeError("Array expected");if(0===t.length)throw new al(0,i,"!=");var r=ag(t=af(t,i));if(i!==r)throw new al(r,i,"!=");try{return function(e,t){for(var n,i=e,r=t.length-1;r>0;r--){var o=t[r];n=[];for(var a=i.length/o,s=0;s<a;s++)n.push(i.slice(s*o,(s+1)*o));i=n}return i}(n,t)}catch(e){if(e instanceof al)throw new al(r,i,"!=");throw e}}(n._data,e);var i=n._size.reduce((e,t)=>e*t);return n._size=af(e,i),n},n.prototype.clone=function(){return new n({data:oZ(this._data),size:oZ(this._size),datatype:this._datatype})},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(e){var t=this,i=function n(i,r){return om(i)?i.map(function(e,t){return n(e,r.concat(t))}):e(i,r,t)}(this._data,[]),r=void 0!==this._datatype?av(i,oY):void 0;return new n(i,r)},n.prototype.forEach=function(e){var t=this;!function n(i,r){om(i)?i.forEach(function(e,t){n(e,r.concat(t))}):e(i,r,t)}(this._data,[])},n.prototype[Symbol.iterator]=function*(){var e=function* e(t,n){if(om(t))for(var i=0;i<t.length;i++)yield*e(t[i],n.concat(i));else yield{value:t,index:n}};yield*e(this._data,[])},n.prototype.rows=function(){var e=[];if(2!==this.size().length)throw TypeError("Rows can only be returned for a 2D matrix.");for(var t of this._data)e.push(new n([t],this._datatype));return e},n.prototype.columns=function(){var e=this,t=[],i=this.size();if(2!==i.length)throw TypeError("Rows can only be returned for a 2D matrix.");for(var r=this._data,o=function(i){var o=r.map(e=>[e[i]]);t.push(new n(o,e._datatype))},a=0;a<i[1];a++)o(a);return t},n.prototype.toArray=function(){return oZ(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(e){return as(this._data,e)},n.prototype.toString=function(){return as(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(e){if(e){if(oh(e)&&(e=e.toNumber()),!oc(e)||!o4(e))throw TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,i=e<0?-e:0,r=Math.min(this._size[0]-i,this._size[1]-t),o=[],a=0;a<r;a++)o[a]=this._data[a+i][a+t];return new n({data:o,size:[r],datatype:this._datatype})},n.diagonal=function(e,t,i,r){if(!om(e))throw TypeError("Array expected, size parameter");if(2!==e.length)throw Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(oh(e)&&(e=e.toNumber()),!oc(e)||!o4(e)||e<1)throw Error("Size values must be positive integers");return e}),i){if(oh(i)&&(i=i.toNumber()),!oc(i)||!o4(i))throw TypeError("The parameter k must be an integer number")}else i=0;var o,a=i>0?i:0,s=i<0?-i:0,l=e[0],u=e[1],c=Math.min(l-s,u-a);if(om(t)){if(t.length!==c)throw Error("Invalid value array length");o=function(e){return t[e]}}else if(ov(t)){var h=t.size();if(1!==h.length||h[0]!==c)throw Error("Invalid matrix length");o=function(e){return t.get([e])}}else o=function(){return t};r||(r=oh(o(0))?o(0).mul(0):0);var d=[];if(e.length>0){d=ap(d,e,r);for(var p=0;p<c;p++)d[p+s][p+a]=o(p)}return new n({data:d,size:[l,u]})},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(e,t){if(!oc(e)||!o4(e)||!oc(t)||!o4(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return ad(e,this._size[0]),ad(t,this._size[0]),n._swapRows(e,t,this._data),this},n._swapRows=function(e,t,n){var i=n[e];n[e]=n[t],n[t]=i},n},{isClass:!0})};let ln=Math.cosh||function(e){return 1e-9>Math.abs(e)?1-e:(Math.exp(e)+Math.exp(-e))*.5},li=Math.sinh||function(e){return 1e-9>Math.abs(e)?e:(Math.exp(e)-Math.exp(-e))*.5},lr=function(e,t){return((e=Math.abs(e))<(t=Math.abs(t))&&([e,t]=[t,e]),e<1e8)?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},lo=function(){throw SyntaxError("Invalid Param")};function la(e,t){let n=Math.abs(e),i=Math.abs(t);return 0===e?Math.log(i):0===t?Math.log(n):n<3e3&&i<3e3?.5*Math.log(e*e+t*t):.5*Math.log((e*=.5)*e+(t*=.5)*t)+Math.LN2}let ls={re:0,im:0},ll=function(e,t){if(null==e)ls.re=ls.im=0;else if(void 0!==t)ls.re=e,ls.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)ls.re=e.re,ls.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return lu.INFINITY;ls.re=e.abs*Math.cos(e.arg),ls.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return lu.INFINITY;ls.re=e.r*Math.cos(e.phi),ls.im=e.r*Math.sin(e.phi)}else 2===e.length?(ls.re=e[0],ls.im=e[1]):lo();break;case"string":ls.im=ls.re=0;let n=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,r=0;null===n&&lo();for(let e=0;e<n.length;e++){let t=n[e];" "===t||" "===t||"\n"===t||("+"===t?i++:"-"===t?r++:("i"===t||"I"===t?(i+r===0&&lo()," "===n[e+1]||isNaN(n[e+1])?ls.im+=parseFloat((r%2?"-":"")+"1"):(ls.im+=parseFloat((r%2?"-":"")+n[e+1]),e++)):((i+r===0||isNaN(t))&&lo(),"i"===n[e+1]||"I"===n[e+1]?(ls.im+=parseFloat((r%2?"-":"")+t),e++):ls.re+=parseFloat((r%2?"-":"")+t)),i=r=0))}i+r>0&&lo();break;case"number":ls.im=0,ls.re=e;break;default:lo()}return isNaN(ls.re)||isNaN(ls.im),ls};function lu(e,t){if(!(this instanceof lu))return new lu(e,t);let n=ll(e,t);this.re=n.re,this.im=n.im}lu.prototype={re:0,im:0,sign:function(){let e=lr(this.re,this.im);return new lu(this.re/e,this.im/e)},add:function(e,t){let n=ll(e,t),i=this.isInfinite(),r=!(isFinite(n.re)&&isFinite(n.im));return i||r?i&&r?lu.NAN:lu.INFINITY:new lu(this.re+n.re,this.im+n.im)},sub:function(e,t){let n=ll(e,t),i=this.isInfinite(),r=!(isFinite(n.re)&&isFinite(n.im));return i||r?i&&r?lu.NAN:lu.INFINITY:new lu(this.re-n.re,this.im-n.im)},mul:function(e,t){let n=ll(e,t),i=this.isInfinite(),r=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,a=0===n.re&&0===n.im;return i&&a||r&&o?lu.NAN:i||r?lu.INFINITY:0===n.im&&0===this.im?new lu(this.re*n.re,0):new lu(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){let n=ll(e,t),i=this.isInfinite(),r=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,a=0===n.re&&0===n.im;if(o&&a||i&&r)return lu.NAN;if(a||i)return lu.INFINITY;if(o||r)return lu.ZERO;if(0===n.im)return new lu(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){let e=n.re/n.im,t=n.re*e+n.im;return new lu((this.re*e+this.im)/t,(this.im*e-this.re)/t)}{let e=n.im/n.re,t=n.im*e+n.re;return new lu((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){let n=ll(e,t),i=0===this.re&&0===this.im;if(0===n.re&&0===n.im)return lu.ONE;if(0===n.im){if(0===this.im&&this.re>0)return new lu(Math.pow(this.re,n.re),0);else if(0===this.re)switch((n.re%4+4)%4){case 0:return new lu(Math.pow(this.im,n.re),0);case 1:return new lu(0,Math.pow(this.im,n.re));case 2:return new lu(-Math.pow(this.im,n.re),0);case 3:return new lu(0,-Math.pow(this.im,n.re))}}if(i&&n.re>0)return lu.ZERO;let r=Math.atan2(this.im,this.re),o=la(this.re,this.im),a=Math.exp(n.re*o-n.im*r),s=n.im*o+n.re*r;return new lu(a*Math.cos(s),a*Math.sin(s))},sqrt:function(){let e=this.re,t=this.im;if(0===t)if(e>=0)return new lu(Math.sqrt(e),0);else return new lu(0,Math.sqrt(-e));let n=Math.sqrt(.5*(lr(e,t)+Math.abs(e))),i=Math.abs(t)/(2*n);return e>=0?new lu(n,t<0?-i:i):new lu(i,t<0?-n:n)},exp:function(){let e=Math.exp(this.re);return 0===this.im?new lu(e,0):new lu(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){let e,t=this.re,n=this.im;return new lu(Math.expm1(t)*Math.cos(n)+-2*(e=Math.sin(.5*n))*e,Math.exp(t)*Math.sin(n))},log:function(){let e=this.re,t=this.im;return 0===t&&e>0?new lu(Math.log(e),0):new lu(la(e,t),Math.atan2(t,e))},abs:function(){return lr(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let e=this.re,t=this.im;return new lu(Math.sin(e)*ln(t),Math.cos(e)*li(t))},cos:function(){let e=this.re,t=this.im;return new lu(Math.cos(e)*ln(t),-Math.sin(e)*li(t))},tan:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)+ln(t);return new lu(Math.sin(e)/n,li(t)/n)},cot:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)-ln(t);return new lu(-Math.sin(e)/n,li(t)/n)},sec:function(){let e=this.re,t=this.im,n=.5*ln(2*t)+.5*Math.cos(2*e);return new lu(Math.cos(e)*ln(t)/n,Math.sin(e)*li(t)/n)},csc:function(){let e=this.re,t=this.im,n=.5*ln(2*t)-.5*Math.cos(2*e);return new lu(Math.sin(e)*ln(t)/n,-Math.cos(e)*li(t)/n)},asin:function(){let e=this.re,t=this.im,n=new lu(t*t-e*e+1,-2*e*t).sqrt(),i=new lu(n.re-t,n.im+e).log();return new lu(i.im,-i.re)},acos:function(){let e=this.re,t=this.im,n=new lu(t*t-e*e+1,-2*e*t).sqrt(),i=new lu(n.re-t,n.im+e).log();return new lu(Math.PI/2-i.im,i.re)},atan:function(){let e=this.re,t=this.im;if(0===e){if(1===t)return new lu(0,1/0);if(-1===t)return new lu(0,-1/0)}let n=e*e+(1-t)*(1-t),i=new lu((1-t*t-e*e)/n,-2*e/n).log();return new lu(-.5*i.im,.5*i.re)},acot:function(){let e=this.re,t=this.im;if(0===t)return new lu(Math.atan2(1,e),0);let n=e*e+t*t;return 0!==n?new lu(e/n,-t/n).atan():new lu(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new lu(0,1/0);let n=e*e+t*t;return 0!==n?new lu(e/n,-t/n).acos():new lu(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new lu(Math.PI/2,1/0);let n=e*e+t*t;return 0!==n?new lu(e/n,-t/n).asin():new lu(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){let e=this.re,t=this.im;return new lu(li(e)*Math.cos(t),ln(e)*Math.sin(t))},cosh:function(){let e=this.re,t=this.im;return new lu(ln(e)*Math.cos(t),li(e)*Math.sin(t))},tanh:function(){let e=2*this.re,t=2*this.im,n=ln(e)+Math.cos(t);return new lu(li(e)/n,Math.sin(t)/n)},coth:function(){let e=2*this.re,t=2*this.im,n=ln(e)-Math.cos(t);return new lu(li(e)/n,-Math.sin(t)/n)},csch:function(){let e=this.re,t=this.im,n=Math.cos(2*t)-ln(2*e);return new lu(-2*li(e)*Math.cos(t)/n,2*ln(e)*Math.sin(t)/n)},sech:function(){let e=this.re,t=this.im,n=Math.cos(2*t)+ln(2*e);return new lu(2*ln(e)*Math.cos(t)/n,-2*li(e)*Math.sin(t)/n)},asinh:function(){let e=this.re,t=this.im;if(0===t){if(0===e)return new lu(0,0);let t=Math.abs(e),n=Math.log(t+Math.sqrt(t*t+1));return new lu(e<0?-n:n,0)}let n=new lu(e*e-t*t+1,2*e*t).sqrt();return new lu(e+n.re,t+n.im).log()},acosh:function(){let e=this.re,t=this.im;if(0===t){if(e>1)return new lu(Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1)),0);if(e<-1){let t=Math.sqrt(e*e-1);return new lu(Math.log(-e+t),Math.PI)}return new lu(0,Math.acos(e))}let n=new lu(e-1,t).sqrt(),i=new lu(e+1,t).sqrt();return new lu(e+n.re*i.re-n.im*i.im,t+n.re*i.im+n.im*i.re).log()},atanh:function(){let e=this.re,t=this.im;if(0===t)return 0===e?new lu(0,0):1===e?new lu(1/0,0):-1===e?new lu(-1/0,0):-1<e&&e<1?new lu(.5*Math.log((1+e)/(1-e)),0):e>1?new lu(.5*Math.log((e+1)/(e-1)),-Math.PI/2):new lu(.5*Math.log(-((1+e)/(1-e))),Math.PI/2);let n=1-e,i=1+e,r=n*n+t*t;if(0===r)return new lu(-1!==e?e/0:0,0!==t?t/0:0);let o=(i*n-t*t)/r,a=(t*n+i*t)/r;return new lu(la(o,a)/2,Math.atan2(a,o)/2)},acoth:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new lu(0,Math.PI/2);let n=e*e+t*t;return 0!==n?new lu(e/n,-t/n).atanh():new lu(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){let e=this.re,t=this.im;if(0===t){if(0===e)return new lu(1/0,0);let t=1/e;return new lu(Math.log(t+Math.sqrt(t*t+1)),0)}let n=e*e+t*t;return 0!==n?new lu(e/n,-t/n).asinh():new lu(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){let e=this.re,t=this.im;if(this.isZero())return lu.INFINITY;let n=e*e+t*t;return 0!==n?new lu(e/n,-t/n).acosh():new lu(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return lu.INFINITY;if(this.isInfinite())return lu.ZERO;let e=this.re,t=this.im,n=e*e+t*t;return new lu(e/n,-t/n)},conjugate:function(){return new lu(this.re,-this.im)},neg:function(){return new lu(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new lu(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new lu(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new lu(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){let n=ll(e,t);return Math.abs(n.re-this.re)<=lu.EPSILON&&Math.abs(n.im-this.im)<=lu.EPSILON},clone:function(){return new lu(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<lu.EPSILON&&(e=0),Math.abs(t)<lu.EPSILON&&(t=0),0===t)?n+e:(0!==e?(n+=e,n+=" ",t<0?(t=-t,n+="-"):n+="+",n+=" "):t<0&&(t=-t,n+="-"),1!==t&&(n+=t),n+"i")},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},lu.ZERO=new lu(0,0),lu.ONE=new lu(1,0),lu.I=new lu(0,1),lu.PI=new lu(Math.PI,0),lu.E=new lu(Math.E,0),lu.INFINITY=new lu(1/0,1/0),lu.NAN=new lu(NaN,NaN),lu.EPSILON=1e-15;var lc=o2("Complex",[],()=>(lu.prototype.type="Complex",lu.prototype.isComplex=!0,lu.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},lu.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},lu.prototype.format=function(e){var t=this.im,n=this.re,i=o8(this.re,e),r=o8(this.im,e),o=oc(e)?e:e?e.precision:null;if(null!==o){var a=Math.pow(10,-o);Math.abs(n/t)<a&&(n=0),Math.abs(t/n)<a&&(t=0)}return 0===t?i:0===n?1===t?"i":-1===t?"-i":r+"i":t<0?-1===t?i+" - i":i+" - "+r.substring(1)+"i":1===t?i+" + i":i+" + "+r+"i"},lu.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if("object"==typeof t)return lu(t);throw TypeError("Input has to be an object with r and phi keys.");case 2:var n=arguments[0],i=arguments[1];if(oc(n)){if(of(i)&&i.hasBase("ANGLE")&&(i=i.toNumber("rad")),oc(i))return new lu({r:n,phi:i});throw TypeError("Phi is not a number nor an angle unit.")}throw TypeError("Radius r is not a number.");default:throw SyntaxError("Wrong number of arguments in function fromPolar")}},lu.prototype.valueOf=lu.prototype.toString,lu.fromJSON=function(e){return new lu(e)},lu.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},lu),{isClass:!0}),lh={s:1,n:0,d:1};function ld(e,t){if(isNaN(e=parseInt(e,10)))throw lx();return e*t}function lp(e,t){if(0===t)throw ly();var n=Object.create(lv.prototype);n.s=e<0?-1:1;var i=lm(e=e<0?-e:e,t);return n.n=e/i,n.d=t/i,n}function lf(e){for(var t={},n=e,i=2,r=4;r<=n;){for(;n%i==0;)n/=i,t[i]=(t[i]||0)+1;r+=1+2*i++}return n!==e?n>1&&(t[n]=(t[n]||0)+1):t[e]=(t[e]||0)+1,t}var lg=function(e,t){var n,i=0,r=1,o=1,a=0,s=0,l=0,u=1,c=1,h=0,d=1,p=1,f=1;if(null==e);else if(void 0!==t){if(o=(i=e)*(r=t),i%1!=0||r%1!=0)throw lb()}else switch(typeof e){case"object":if("d"in e&&"n"in e)i=e.n,r=e.d,"s"in e&&(i*=e.s);else if(0 in e)i=e[0],1 in e&&(r=e[1]);else throw lx();o=i*r;break;case"number":if(e<0&&(o=e,e=-e),e%1==0)i=e;else if(e>0){for(e>=1&&(c=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=c);d<=1e7&&f<=1e7;){if(e===(n=(h+p)/(d+f))){d+f<=1e7?(i=h+p,r=d+f):f>d?(i=p,r=f):(i=h,r=d);break}e>n?(h+=p,d+=f):(p+=h,f+=d),d>1e7?(i=p,r=f):(i=h,r=d)}i*=c}else(isNaN(e)||isNaN(t))&&(r=i=NaN);break;case"string":if(null===(d=e.match(/\d+|./g)))throw lx();if("-"===d[h]?(o=-1,h++):"+"===d[h]&&h++,d.length===h+1?s=ld(d[h++],o):"."===d[h+1]||"."===d[h]?("."!==d[h]&&(a=ld(d[h++],o)),(++h+1===d.length||"("===d[h+1]&&")"===d[h+3]||"'"===d[h+1]&&"'"===d[h+3])&&(s=ld(d[h],o),u=Math.pow(10,d[h].length),h++),("("===d[h]&&")"===d[h+2]||"'"===d[h]&&"'"===d[h+2])&&(l=ld(d[h+1],o),c=Math.pow(10,d[h+1].length)-1,h+=3)):"/"===d[h+1]||":"===d[h+1]?(s=ld(d[h],o),u=ld(d[h+2],1),h+=3):"/"===d[h+3]&&" "===d[h+1]&&(a=ld(d[h],o),s=ld(d[h+2],o),u=ld(d[h+4],1),h+=5),d.length<=h){o=i=l+(r=u*c)*a+c*s;break}default:throw lx()}if(0===r)throw ly();lh.s=o<0?-1:1,lh.n=Math.abs(i),lh.d=Math.abs(r)};function lm(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function lv(e,t){if(lg(e,t),!(this instanceof lv))return lp(lh.s*lh.n,lh.d);e=lm(lh.d,lh.n),this.s=lh.s,this.n=lh.n/e,this.d=lh.d/e}var ly=function(){return Error("Division by Zero")},lx=function(){return Error("Invalid argument")},lb=function(){return Error("Parameters must be integer")};lv.prototype={s:1,n:0,d:1,abs:function(){return lp(this.n,this.d)},neg:function(){return lp(-this.s*this.n,this.d)},add:function(e,t){return lg(e,t),lp(this.s*this.n*lh.d+lh.s*this.d*lh.n,this.d*lh.d)},sub:function(e,t){return lg(e,t),lp(this.s*this.n*lh.d-lh.s*this.d*lh.n,this.d*lh.d)},mul:function(e,t){return lg(e,t),lp(this.s*lh.s*this.n*lh.n,this.d*lh.d)},div:function(e,t){return lg(e,t),lp(this.s*lh.s*this.n*lh.d,this.d*lh.n)},clone:function(){return lp(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new lv(NaN);if(void 0===e)return lp(this.s*this.n%this.d,1);if(lg(e,t),0===lh.n&&0===this.d)throw ly();return lp(this.s*(lh.d*this.n)%(lh.n*this.d),lh.d*this.d)},gcd:function(e,t){return lg(e,t),lp(lm(lh.n,this.n)*lm(lh.d,this.d),lh.d*this.d)},lcm:function(e,t){return(lg(e,t),0===lh.n&&0===this.n)?lp(0,1):lp(lh.n*this.n,lm(lh.n,this.n)*lm(lh.d,this.d))},ceil:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new lv(NaN):lp(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new lv(NaN):lp(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new lv(NaN):lp(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return lg(e,t),lp(this.s*Math.round(this.n*lh.d/(this.d*lh.n))*lh.n,lh.d)},inverse:function(){return lp(this.s*this.d,this.n)},pow:function(e,t){if(lg(e,t),1===lh.d)if(lh.s<0)return lp(Math.pow(this.s*this.d,lh.n),Math.pow(this.n,lh.n));else return lp(Math.pow(this.s*this.n,lh.n),Math.pow(this.d,lh.n));if(this.s<0)return null;var n=lf(this.n),i=lf(this.d),r=1,o=1;for(var a in n)if("1"!==a){if("0"===a){r=0;break}if(n[a]*=lh.n,n[a]%lh.d!=0)return null;n[a]/=lh.d,r*=Math.pow(a,n[a])}for(var a in i)if("1"!==a){if(i[a]*=lh.n,i[a]%lh.d!=0)return null;i[a]/=lh.d,o*=Math.pow(a,i[a])}return lh.s<0?lp(o,r):lp(r,o)},equals:function(e,t){return lg(e,t),this.s*this.n*lh.d==lh.s*lh.n*this.d},compare:function(e,t){lg(e,t);var n=this.s*this.n*lh.d-lh.s*lh.n*this.d;return(0<n)-(n<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;e=e||.001;for(var t=this.abs(),n=t.toContinued(),i=1;i<n.length;i++){for(var r=lp(n[i-1],1),o=i-2;o>=0;o--)r=r.inverse().add(n[o]);if(Math.abs(r.sub(t).valueOf())<e)return r.mul(this.s)}return this},divisible:function(e,t){return lg(e,t),!(!(lh.n*this.d)||this.n*lh.d%(lh.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,n="",i=this.n,r=this.d;return this.s<0&&(n+="-"),1===r?n+=i:(e&&(t=Math.floor(i/r))>0&&(n+=t,n+=" ",i%=r),n+=i,n+="/",n+=r),n},toLatex:function(e){var t,n="",i=this.n,r=this.d;return this.s<0&&(n+="-"),1===r?n+=i:(e&&(t=Math.floor(i/r))>0&&(n+=t,i%=r),n+="\\frac{",n+=i,n+="}{",n+=r,n+="}"),n},toContinued:function(){var e,t=this.n,n=this.d,i=[];if(isNaN(t)||isNaN(n))return i;do i.push(Math.floor(t/n)),e=t%n,t=n,n=e;while(1!==t);return i},toString:function(e){var t=this.n,n=this.d;if(isNaN(t)||isNaN(n))return"NaN";e=e||15;var i=function(e){for(;e%2==0;e/=2);for(;e%5==0;e/=5);if(1===e)return 0;for(var t=10%e,n=1;1!==t;n++)if(t=10*t%e,n>2e3)return 0;return n}(n),r=function(e,t){for(var n=1,i=function(e,t,n){for(var i=1;t>0;e=e*e%n,t>>=1)1&t&&(i=i*e%n);return i}(10,t,e),r=0;r<300;r++){if(n===i)return r;n=10*n%e,i=10*i%e}return 0}(n,i),o=this.s<0?"-":"";if(o+=t/n|0,t%=n,(t*=10)&&(o+="."),i){for(var a=r;a--;)o+=t/n|0,t%=n,t*=10;o+="(";for(var a=i;a--;)o+=t/n|0,t%=n,t*=10;o+=")"}else for(var a=e;t&&a--;)o+=t/n|0,t%=n,t*=10;return o}};var lw=o2("Fraction",[],()=>(lv.prototype.type="Fraction",lv.prototype.isFraction=!0,lv.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},lv.fromJSON=function(e){return new lv(e)},lv),{isClass:!0}),lS=n(42915);function l_(e,t){return!!e&&"object"==typeof e&&(!!oJ(lC,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function lM(e){return"object"==typeof e&&e&&e.constructor===Object}var lC={length:!0,name:!0},lA={toString:!0,valueOf:!0,toLocaleString:!0};class lk{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){var t,n,i=this.wrappedObject;if(lM(i)&&l_(i,e))return i[e];if("function"==typeof i[e]&&(t=i,n=e,!(null==t||"function"!=typeof t[n]||oJ(t,n)&&Object.getPrototypeOf&&n in Object.getPrototypeOf(t))&&(oJ(lA,n)||!(n in Object.prototype)&&!(n in Function.prototype))))throw Error('Cannot access method "'+e+'" as a property');throw Error('No access to property "'+e+'"')}set(e,t){return!function(e,t,n){if(lM(e)&&l_(e,t))return e[t]=n;throw Error('No access to property "'+t+'"')}(this.wrappedObject,e,t),this}has(e){return e in this.wrappedObject}}function lT(e){return!!e&&(e instanceof Map||e instanceof lk||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}var lD=function(){return lD=lS.create,lS};function lI(e){throw Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function lO(e){throw Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function lP(e){throw Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var lE={BigNumberDependencies:s7,ComplexDependencies:{createComplexClass:lc},DenseMatrixDependencies:lt,FractionDependencies:{createFractionClass:lw},createTyped:o2("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],function(e){var{BigNumber:t,Complex:n,DenseMatrix:i,Fraction:r}=e,o=lD();return o.types=[{name:"number",test:oc},{name:"Complex",test:od},{name:"BigNumber",test:oh},{name:"Fraction",test:op},{name:"Unit",test:of},{name:"string",test:og},{name:"Chain",test:oq},{name:"Array",test:om},{name:"Matrix",test:ov},{name:"DenseMatrix",test:ox},{name:"SparseMatrix",test:ob},{name:"Range",test:ow},{name:"Index",test:oS},{name:"boolean",test:o_},{name:"ResultSet",test:oM},{name:"Help",test:oC},{name:"function",test:oA},{name:"Date",test:ok},{name:"RegExp",test:oT},{name:"null",test:oI},{name:"undefined",test:oO},{name:"AccessorNode",test:oP},{name:"ArrayNode",test:oE},{name:"AssignmentNode",test:oR},{name:"BlockNode",test:oL},{name:"ConditionalNode",test:oN},{name:"ConstantNode",test:oB},{name:"FunctionNode",test:oz},{name:"FunctionAssignmentNode",test:oF},{name:"IndexNode",test:oV},{name:"Node",test:oj},{name:"ObjectNode",test:oH},{name:"OperatorNode",test:oW},{name:"ParenthesisNode",test:oG},{name:"RangeNode",test:o$},{name:"SymbolNode",test:oU},{name:"Map",test:lT},{name:"Object",test:oD}],o.conversions=[{from:"number",to:"BigNumber",convert:function(e){if(t||lI(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return n||lO(e),new n(e,0)}},{from:"number",to:"string",convert:function(e){return e+""}},{from:"BigNumber",to:"Complex",convert:function(e){return n||lO(e),new n(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return n||lO(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){r||lP(e);var t=new r(e);if(t.valueOf()!==e)throw TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){var t=Number(e);if(isNaN(t))throw Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||lI(e);try{return new t(e)}catch(t){throw Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){r||lP(e);try{return new r(e)}catch(t){throw Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){n||lO(e);try{return new n(e)}catch(t){throw Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||lI(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return r||lP(e),new r(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return i||function(){throw Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new i(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}],o})},lR="equalScalar",lL=o2(lR,["typed","config"],e=>{var{typed:t,config:n}=e;return t(lR,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return ar(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||function(e,t,n){if(null==n)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var i=e.minus(t).abs();if(i.isZero())return!0;var r=e.constructor.max(e.abs(),t.abs());return i.lte(r.times(n))}return!1}(e,t,n.epsilon)},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){var i;return i=n.epsilon,ar(e.re,t.re,i)&&ar(e.im,t.im,i)},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw Error("Cannot compare units with different base");return this(e.value,t.value)}})});o2(lR,["typed","config"],e=>{var{typed:t,config:n}=e;return t(lR,{"number, number":function(e,t){return ar(e,t,n.epsilon)}})});var lN={typedDependencies:lE,createEqualScalar:lL},lB=o2("SparseMatrix",["typed","equalScalar","Matrix"],e=>{var{typed:t,equalScalar:n,Matrix:i}=e;function r(e,t){if(!(this instanceof r))throw SyntaxError("Constructor must be called with the new operator");if(t&&!og(t))throw Error("Invalid datatype: "+t);if(ov(e)){var n,i,a;n=this,i=e,a=t,"SparseMatrix"===i.type?(n._values=i._values?oZ(i._values):void 0,n._index=oZ(i._index),n._ptr=oZ(i._ptr),n._size=oZ(i._size),n._datatype=a||i._datatype):o(n,i.valueOf(),a||i._datatype)}else if(e&&om(e.index)&&om(e.ptr)&&om(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(om(e))o(this,e,t);else if(e)throw TypeError("Unsupported type of data ("+oY(e)+")");else this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}function o(e,i,r){e._values=[],e._index=[],e._ptr=[],e._datatype=r;var o=i.length,a=0,s=n,l=0;if(og(r)&&(s=t.find(n,[r,r])||n,l=t.convert(0,r)),o>0){var u=0;do{e._ptr.push(e._index.length);for(var c=0;c<o;c++){var h=i[c];if(om(h)){if(0===u&&a<h.length&&(a=h.length),u<h.length){var d=h[u];s(d,l)||(e._values.push(d),e._index.push(c))}}else 0===u&&a<1&&(a=1),s(h,l)||(e._values.push(h),e._index.push(c))}u++}while(u<a)}e._ptr.push(e._index.length),e._size=[o,a]}function a(e,t,n,i){if(n-t==0)return n;for(var r=t;r<n;r++)if(i[r]===e)return r;return t}function s(e,t,n,i,r,o,a){r.splice(e,0,i),o.splice(e,0,t);for(var s=n+1;s<a.length;s++)a[s]++}function l(e,i,r,o){var a,s,l,u=o||0,c=n,h=0;og(e._datatype)&&(c=t.find(n,[e._datatype,e._datatype])||n,h=t.convert(0,e._datatype),u=t.convert(u,e._datatype));var d=!c(u,h),p=e._size[0],f=e._size[1];if(r>f){for(s=f;s<r;s++)if(e._ptr[s]=e._values.length,d)for(a=0;a<p;a++)e._values.push(u),e._index.push(a);e._ptr[r]=e._values.length}else r<f&&(e._ptr.splice(r+1,f-r),e._values.splice(e._ptr[r],e._values.length),e._index.splice(e._ptr[r],e._index.length));if(f=r,i>p){if(d){var g=0;for(s=0;s<f;s++){e._ptr[s]=e._ptr[s]+g,l=e._ptr[s+1]+g;var m=0;for(a=p;a<i;a++,m++)e._values.splice(l+m,0,u),e._index.splice(l+m,0,a),g++}e._ptr[f]=e._values.length}}else if(i<p){var v=0;for(s=0;s<f;s++){e._ptr[s]=e._ptr[s]-v;var y=e._ptr[s],x=e._ptr[s+1]-v;for(l=y;l<x;l++)(a=e._index[l])>i-1&&(e._values.splice(l,1),e._index.splice(l,1),v++)}e._ptr[s]=e._values.length}return e._size[0]=i,e._size[1]=r,e}function u(e,t,n,i,r){var o,a,s=i[0],l=i[1],u=[];for(o=0;o<s;o++)for(a=0,u[o]=[];a<l;a++)u[o][a]=0;for(a=0;a<l;a++)for(var c=n[a],h=n[a+1],d=c;d<h;d++)u[o=t[d]][a]=e?r?oZ(e[d]):e[d]:1;return u}return r.prototype=new i,r.prototype.createSparseMatrix=function(e,t){return new r(e,t)},r.prototype.type="SparseMatrix",r.prototype.isSparseMatrix=!0,r.prototype.getDataType=function(){return av(this._values,oY)},r.prototype.storage=function(){return"sparse"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(e,t){return new r(e,t)},r.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},r.prototype.subset=function(e,t,n){if(!this._values)throw Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,t){if(!oS(t))throw TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var n,i,o,a,s=t.size();if(s.length!==e._size.length)throw new al(s.length,e._size.length);var l=t.min(),u=t.max();for(n=0,i=e._size.length;n<i;n++)ad(l[n],e._size[n]),ad(u[n],e._size[n]);var c=e._values,h=e._index,d=e._ptr,p=t.dimension(0),f=t.dimension(1),g=[],m=[];p.forEach(function(e,t){m[e]=t[0],g[e]=!0});var v=c?[]:void 0,y=[],x=[];return f.forEach(function(e){for(x.push(y.length),o=d[e],a=d[e+1];o<a;o++)!0===g[n=h[o]]&&(y.push(m[n]),v&&v.push(c[o]))}),x.push(y.length),new r({values:v,index:y,ptr:x,size:s,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,n,i){if(!t||!0!==t.isIndex)throw TypeError("Invalid index");var r,o=t.size(),a=t.isScalar();if(ov(n)?(r=n.size(),n=n.toArray()):r=ac(n),a){if(0!==r.length)throw TypeError("Scalar expected");e.set(t.min(),n,i)}else{if(1!==o.length&&2!==o.length)throw new al(o.length,e._size.length,"<");if(r.length<o.length){for(var s=0,l=0;1===o[s]&&1===r[s];)s++;for(;1===o[s];)l++,s++;n=am(n,o.length,l,r)}if(!oK(o,r))throw new al(o,r,">");if(1===o.length)t.dimension(0).forEach(function(t,r){ad(t),e.set([t,0],n[r[0]],i)});else{var u=t.dimension(0),c=t.dimension(1);u.forEach(function(t,r){ad(t),c.forEach(function(o,a){ad(o),e.set([t,o],n[r[0]][a[0]],i)})})}}return e}(this,e,t,n);default:throw SyntaxError("Wrong number of arguments")}},r.prototype.get=function(e){if(!om(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new al(e.length,this._size.length);if(!this._values)throw Error("Cannot invoke get on a Pattern only matrix");var t=e[0],n=e[1];ad(t,this._size[0]),ad(n,this._size[1]);var i=a(t,this._ptr[n],this._ptr[n+1],this._index);return i<this._ptr[n+1]&&this._index[i]===t?this._values[i]:0},r.prototype.set=function(e,i,r){if(!om(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new al(e.length,this._size.length);if(!this._values)throw Error("Cannot invoke set on a Pattern only matrix");var o=e[0],u=e[1],c=this._size[0],h=this._size[1],d=n,p=0;og(this._datatype)&&(d=t.find(n,[this._datatype,this._datatype])||n,p=t.convert(0,this._datatype)),(o>c-1||u>h-1)&&(l(this,Math.max(o+1,c),Math.max(u+1,h),r),c=this._size[0],h=this._size[1]),ad(o,c),ad(u,h);var f=a(o,this._ptr[u],this._ptr[u+1],this._index);return f<this._ptr[u+1]&&this._index[f]===o?d(i,p)?function(e,t,n,i,r){n.splice(e,1),i.splice(e,1);for(var o=t+1;o<r.length;o++)r[o]--}(f,u,this._values,this._index,this._ptr):this._values[f]=i:s(f,o,u,i,this._values,this._index,this._ptr),this},r.prototype.resize=function(e,t,n){if(!oy(e))throw TypeError("Array or Matrix expected");var i=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);if(2!==i.length)throw Error("Only two dimensions matrix are supported");return i.forEach(function(e){if(!oc(e)||!o4(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+as(i)+")")}),l(n?this.clone():this,i[0],i[1],t)},r.prototype.reshape=function(e,t){if(!om(e))throw TypeError("Array expected");if(2!==e.length)throw Error("Sparse matrices can only be reshaped in two dimensions");e.forEach(function(t){if(!oc(t)||!o4(t)||t<=-2||0===t)throw TypeError("Invalid size, must contain positive integers or -1 (size: "+as(e)+")")});var n=this._size[0]*this._size[1],i=(e=af(e,n))[0]*e[1];if(n!==i)throw Error("Reshaping sparse matrix will result in the wrong number of elements");var r=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return r;for(var o=[],l=0;l<r._ptr.length;l++)for(var u=0;u<r._ptr[l+1]-r._ptr[l];u++)o.push(l);for(var c=r._values.slice(),h=r._index.slice(),d=0;d<r._index.length;d++){var p=h[d],f=o[d],g=p*r._size[1]+f;o[d]=g%e[1],h[d]=Math.floor(g/e[1])}r._values.length=0,r._index.length=0,r._ptr.length=e[1]+1,r._size=e.slice();for(var m=0;m<r._ptr.length;m++)r._ptr[m]=0;for(var v=0;v<c.length;v++){var y=h[v],x=o[v],b=c[v];s(a(y,r._ptr[x],r._ptr[x+1],r._index),y,x,b,r._values,r._index,r._ptr)}return r},r.prototype.clone=function(){return new r({values:this._values?oZ(this._values):void 0,index:oZ(this._index),ptr:oZ(this._ptr),size:oZ(this._size),datatype:this._datatype})},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(e,i){if(!this._values)throw Error("Cannot invoke map on a Pattern only matrix");var o=this;return function(e,i,o,a,s){var l=[],u=[],c=[],h=n,d=0;og(e._datatype)&&(h=t.find(n,[e._datatype,e._datatype])||n,d=t.convert(0,e._datatype));for(var p=function(e,t,n){e=a(e,t,n),h(e,d)||(l.push(e),u.push(t))},f=0;f<=o;f++){c.push(l.length);var g=e._ptr[f],m=e._ptr[f+1];if(s)for(var v=g;v<m;v++){var y=e._index[v];y>=0&&y<=i&&p(e._values[v],y-0,f-0)}else{for(var x={},b=g;b<m;b++)x[e._index[b]]=e._values[b];for(var w=0;w<=i;w++)p(w in x?x[w]:0,w-0,f-0)}}return c.push(l.length),new r({values:l,index:u,ptr:c,size:[i-0+1,o-0+1]})}(this,this._size[0]-1,this._size[1]-1,function(t,n,i){return e(t,[n,i],o)},i)},r.prototype.forEach=function(e,t){if(!this._values)throw Error("Cannot invoke forEach on a Pattern only matrix");for(var n=this._size[0],i=this._size[1],r=0;r<i;r++){var o=this._ptr[r],a=this._ptr[r+1];if(t)for(var s=o;s<a;s++){var l=this._index[s];e(this._values[s],[l,r],this)}else{for(var u={},c=o;c<a;c++)u[this._index[c]]=this._values[c];for(var h=0;h<n;h++)e(h in u?u[h]:0,[h,r],this)}}},r.prototype[Symbol.iterator]=function*(){if(!this._values)throw Error("Cannot iterate a Pattern only matrix");for(var e=this._size[1],t=0;t<e;t++)for(var n=this._ptr[t],i=this._ptr[t+1],r=n;r<i;r++){var o=this._index[r];yield{value:this._values[r],index:[o,t]}}},r.prototype.toArray=function(){return u(this._values,this._index,this._ptr,this._size,!0)},r.prototype.valueOf=function(){return u(this._values,this._index,this._ptr,this._size,!1)},r.prototype.format=function(e){for(var t=this._size[0],n=this._size[1],i=this.density(),r="Sparse Matrix ["+as(t,e)+" x "+as(n,e)+"] density: "+as(i,e)+"\n",o=0;o<n;o++)for(var a=this._ptr[o],s=this._ptr[o+1],l=a;l<s;l++)r+="\n ("+as(this._index[l],e)+", "+as(o,e)+") ==> "+(this._values?as(this._values[l],e):"X");return r},r.prototype.toString=function(){return as(this.toArray())},r.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},r.prototype.diagonal=function(e){if(e){if(oh(e)&&(e=e.toNumber()),!oc(e)||!o4(e))throw TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,n=e<0?-e:0,i=this._size[0],o=this._size[1],a=Math.min(i-n,o-t),s=[],l=[],u=[];u[0]=0;for(var c=t;c<o&&s.length<a;c++)for(var h=this._ptr[c],d=this._ptr[c+1],p=h;p<d;p++){var f=this._index[p];if(f===c-t+n){s.push(this._values[p]),l[s.length-1]=f-n;break}}return u.push(s.length),new r({values:s,index:l,ptr:u,size:[a,1]})},r.fromJSON=function(e){return new r(e)},r.diagonal=function(e,i,o,a,s){if(!om(e))throw TypeError("Array expected, size parameter");if(2!==e.length)throw Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(oh(e)&&(e=e.toNumber()),!oc(e)||!o4(e)||e<1)throw Error("Size values must be positive integers");return e}),o){if(oh(o)&&(o=o.toNumber()),!oc(o)||!o4(o))throw TypeError("The parameter k must be an integer number")}else o=0;var l,u=n,c=0;og(s)&&(u=t.find(n,[s,s])||n,c=t.convert(0,s));var h=o>0?o:0,d=o<0?-o:0,p=e[0],f=e[1],g=Math.min(p-d,f-h);if(om(i)){if(i.length!==g)throw Error("Invalid value array length");l=function(e){return i[e]}}else if(ov(i)){var m=i.size();if(1!==m.length||m[0]!==g)throw Error("Invalid matrix length");l=function(e){return i.get([e])}}else l=function(){return i};for(var v=[],y=[],x=[],b=0;b<f;b++){x.push(v.length);var w=b-h;if(w>=0&&w<g){var S=l(w);u(S,c)||(y.push(w+d),v.push(S))}}return x.push(v.length),new r({values:v,index:y,ptr:x,size:[p,f]})},r.prototype.swapRows=function(e,t){if(!oc(e)||!o4(e)||!oc(t)||!o4(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return ad(e,this._size[0]),ad(t,this._size[0]),r._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},r._forEachRow=function(e,t,n,i,r){for(var o=i[e],a=i[e+1],s=o;s<a;s++)r(n[s],t[s])},r._swapRows=function(e,t,n,i,r,o){for(var s=0;s<n;s++){var l=o[s],u=o[s+1],c=a(e,l,u,r),h=a(t,l,u,r);if(c<u&&h<u&&r[c]===e&&r[h]===t){if(i){var d=i[c];i[c]=i[h],i[h]=d}continue}if(c<u&&r[c]===e&&(h>=u||r[h]!==t)){var p=i?i[c]:void 0;r.splice(h,0,t),i&&i.splice(h,0,p),r.splice(h<=c?c+1:c,1),i&&i.splice(h<=c?c+1:c,1);continue}if(h<u&&r[h]===t&&(c>=u||r[c]!==e)){var f=i?i[h]:void 0;r.splice(c,0,e),i&&i.splice(c,0,f),r.splice(c<=h?h+1:h,1),i&&i.splice(c<=h?h+1:h,1)}}},r},{isClass:!0}),lF="matrix",lz={DenseMatrixDependencies:lt,MatrixDependencies:le,SparseMatrixDependencies:{MatrixDependencies:le,equalScalarDependencies:lN,typedDependencies:lE,createSparseMatrixClass:lB},typedDependencies:lE,createMatrix:o2(lF,["typed","Matrix","DenseMatrix","SparseMatrix"],e=>{var{typed:t,Matrix:n,DenseMatrix:i,SparseMatrix:r}=e;return t(lF,{"":function(){return o([])},string:function(e){return o([],e)},"string, string":function(e,t){return o([],e,t)},Array:function(e){return o(e)},Matrix:function(e){return o(e,e.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(e,t,n){if("dense"===t||"default"===t||void 0===t)return new i(e,n);if("sparse"===t)return new r(e,n);throw TypeError("Unknown matrix type "+JSON.stringify(t)+".")}})},lV="zeros",lj=o2(lV,["typed","config","matrix","BigNumber"],e=>{var{typed:t,config:n,matrix:i,BigNumber:r}=e;return t(lV,{"":function(){return"Array"===n.matrix?o([]):o([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return o(e,t)}return"Array"===n.matrix?o(e):o(e,"default")},Array:o,Matrix:function(e){var t=e.storage();return o(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return o(e.valueOf(),t)}});function o(e,t){var n,o=(n=!1,e.forEach(function(e,t,i){oh(e)&&(n=!0,i[t]=e.toNumber())}),n)?new r(0):0;if(e.forEach(function(e){if("number"!=typeof e||!o4(e)||e<0)throw Error("Parameters in function zeros must be positive integers")}),t){var a=i(t);return e.length>0?a.resize(e,o):a}var s=[];return e.length>0?ap(s,e,o):s}}),lH=o2("algorithm11",["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return function(e,i,r,o){var a,s=e._values,l=e._index,u=e._ptr,c=e._size,h=e._datatype;if(!s)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=c[0],p=c[1],f=n,g=0,m=r;"string"==typeof h&&(a=h,f=t.find(n,[a,a]),g=t.convert(0,a),i=t.convert(i,a),m=t.find(r,[a,a]));for(var v=[],y=[],x=[],b=0;b<p;b++){x[b]=y.length;for(var w=u[b],S=u[b+1],_=w;_<S;_++){var M=l[_],C=o?m(i,s[_]):m(s[_],i);f(C,g)||(y.push(M),v.push(C))}}return x[p]=y.length,e.createSparseMatrix({values:v,index:y,ptr:x,size:[d,p],datatype:a})}}),lW=o2("algorithm12",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:n}=e;return function(e,i,r,o){var a,s=e._values,l=e._index,u=e._ptr,c=e._size,h=e._datatype;if(!s)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=c[0],p=c[1],f=r;"string"==typeof h&&(a=h,i=t.convert(i,a),f=t.find(r,[a,a]));for(var g=[],m=[],v=[],y=0;y<p;y++){for(var x=y+1,b=u[y],w=u[y+1],S=b;S<w;S++){var _=l[S];m[_]=s[S],v[_]=x}for(var M=0;M<d;M++)0===y&&(g[M]=[]),v[M]===x?g[M][y]=o?f(i,m[M]):f(m[M],i):g[M][y]=o?f(i,0):f(0,i)}return new n({data:g,size:[d,p],datatype:a})}}),lG=o2("algorithm14",["typed"],e=>{var{typed:t}=e;return function(e,n,i,r){var o,a=e._data,s=e._size,l=e._datatype,u=i;"string"==typeof l&&(o=l,n=t.convert(n,o),u=t.find(i,[o,o]));var c=s.length>0?function e(t,n,i,r,o,a,s){var l=[];if(n===i.length-1)for(var u=0;u<r;u++)l[u]=s?t(a,o[u]):t(o[u],a);else for(var c=0;c<r;c++)l[c]=e(t,n+1,i,i[n+1],o[c],a,s);return l}(u,0,s,s[0],a,n,r):[];return e.createDenseMatrix({data:c,size:oZ(s),datatype:o})}});function l$(e,t){var n;if(!o4(e)||!o4(t))throw Error("Parameters in function gcd must be integer numbers");for(;0!==t;)n=e%t,e=t,t=n;return e<0?-e:e}function lU(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!o4(t)||t<0||t>15)throw Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(o7(e,t))}l$.signature="number, number";var lq="Number of decimals in function round must be an integer",lY="round",lZ=o2(lY,["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],e=>{var{typed:t,matrix:n,equalScalar:i,zeros:r,BigNumber:o,DenseMatrix:a}=e,s=lH({typed:t,equalScalar:i}),l=lW({typed:t,DenseMatrix:a}),u=lG({typed:t});return t(lY,{number:lU,"number, number":lU,"number, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(lq);return new o(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw TypeError(lq);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(lq);var n=t.toNumber();return e.round(n)},BigNumber:function(e){return e.toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(lq);return e.toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw TypeError(lq);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(lq);return e.round(t.toNumber())},"Array | Matrix":function(e){return function e(t,n,i){return t&&"function"==typeof t.map?t.map(function(t){return e(t,n,i)}):n(t)}(e,this,!0)},"SparseMatrix, number | BigNumber":function(e,t){return s(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return u(e,t,this,!1)},"Array, number | BigNumber":function(e,t){return u(n(e),t,this,!1).valueOf()},"number | Complex | BigNumber | Fraction, SparseMatrix":function(e,t){return i(e,0)?r(t.size(),t.storage()):l(t,e,this,!0)},"number | Complex | BigNumber | Fraction, DenseMatrix":function(e,t){return i(e,0)?r(t.size(),t.storage()):u(t,e,this,!0)},"number | Complex | BigNumber | Fraction, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})}),lX=o2("algorithm01",["typed"],e=>{var{typed:t}=e;return function(e,n,i,r){var o,a,s=e._data,l=e._size,u=e._datatype,c=n._values,h=n._index,d=n._ptr,p=n._size,f=n._datatype;if(l.length!==p.length)throw new al(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!c)throw Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g=l[0],m=l[1],v="string"==typeof u&&u===f?u:void 0,y=v?t.find(i,[v,v]):i,x=[];for(o=0;o<g;o++)x[o]=[];var b=[],w=[];for(a=0;a<m;a++){for(var S=a+1,_=d[a],M=d[a+1],C=_;C<M;C++)b[o=h[C]]=r?y(c[C],s[o][a]):y(s[o][a],c[C]),w[o]=S;for(o=0;o<g;o++)w[o]===S?x[o][a]=b[o]:x[o][a]=s[o][a]}return e.createDenseMatrix({data:x,size:[g,m],datatype:v})}}),lK=o2("algorithm04",["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return function(e,i,r){var o,a,s,l,u,c,h=e._values,d=e._index,p=e._ptr,f=e._size,g=e._datatype,m=i._values,v=i._index,y=i._ptr,x=i._size,b=i._datatype;if(f.length!==x.length)throw new al(f.length,x.length);if(f[0]!==x[0]||f[1]!==x[1])throw RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+x+")");var w=f[0],S=f[1],_=n,M=0,C=r;"string"==typeof g&&g===b&&(o=g,_=t.find(n,[o,o]),M=t.convert(0,o),C=t.find(r,[o,o]));var A=h&&m?[]:void 0,k=[],T=[],D=h&&m?[]:void 0,I=h&&m?[]:void 0,O=[],P=[];for(s=0;s<S;s++){T[s]=k.length;var E=s+1;for(u=p[s],c=p[s+1],l=u;l<c;l++)a=d[l],k.push(a),O[a]=E,D&&(D[a]=h[l]);for(u=y[s],c=y[s+1],l=u;l<c;l++)if(O[a=v[l]]===E){if(D){var R=C(D[a],m[l]);_(R,M)?O[a]=null:D[a]=R}}else k.push(a),P[a]=E,I&&(I[a]=m[l]);if(D&&I)for(l=T[s];l<k.length;)O[a=k[l]]===E?(A[l]=D[a],l++):P[a]===E?(A[l]=I[a],l++):k.splice(l,1)}return T[S]=k.length,e.createSparseMatrix({values:A,index:k,ptr:T,size:[w,S],datatype:o})}}),lQ=o2("algorithm10",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:n}=e;return function(e,i,r,o){var a,s=e._values,l=e._index,u=e._ptr,c=e._size,h=e._datatype;if(!s)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=c[0],p=c[1],f=r;"string"==typeof h&&(a=h,i=t.convert(i,a),f=t.find(r,[a,a]));for(var g=[],m=[],v=[],y=0;y<p;y++){for(var x=y+1,b=u[y],w=u[y+1],S=b;S<w;S++){var _=l[S];m[_]=s[S],v[_]=x}for(var M=0;M<d;M++)0===y&&(g[M]=[]),v[M]===x?g[M][y]=o?f(i,m[M]):f(m[M],i):g[M][y]=i}return new n({data:g,size:[d,p],datatype:a})}}),lJ=o2("algorithm13",["typed"],e=>{var{typed:t}=e;return function(e,n,i){var r,o=e._data,a=e._size,s=e._datatype,l=n._data,u=n._size,c=n._datatype,h=[];if(a.length!==u.length)throw new al(a.length,u.length);for(var d=0;d<a.length;d++){if(a[d]!==u[d])throw RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+u+")");h[d]=a[d]}var p=i;"string"==typeof s&&s===c&&(r=s,p=t.find(i,[r,r]));var f=h.length>0?function e(t,n,i,r,o,a){var s=[];if(n===i.length-1)for(var l=0;l<r;l++)s[l]=t(o[l],a[l]);else for(var u=0;u<r;u++)s[u]=e(t,n+1,i,i[n+1],o[u],a[u]);return s}(p,0,h,h[0],o,l):[];return e.createDenseMatrix({data:f,size:h,datatype:r})}}),l0=o2("gcd",["typed","matrix","equalScalar","BigNumber","DenseMatrix"],e=>{var{typed:t,matrix:n,equalScalar:i,BigNumber:r,DenseMatrix:o}=e,a=lX({typed:t}),s=lK({typed:t,equalScalar:i}),l=lQ({typed:t,DenseMatrix:o}),u=lJ({typed:t}),c=lG({typed:t});return t("gcd",{"number, number":l$,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw Error("Parameters in function gcd must be integer numbers");for(var n=new r(0);!t.isZero();){var i=e.mod(t);e=t,t=i}return e.lt(n)?e.neg():e},"Fraction, Fraction":function(e,t){return e.gcd(t)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return l(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return l(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return c(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return c(n(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return c(n(t),e,this,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,n){for(var i=this(e,t),r=0;r<n.length;r++)i=this(i,n[r]);return i}})});let{round:l1}=aM({roundDependencies:{BigNumberDependencies:s7,DenseMatrixDependencies:lt,equalScalarDependencies:lN,matrixDependencies:lz,typedDependencies:lE,zerosDependencies:{BigNumberDependencies:s7,matrixDependencies:lz,typedDependencies:lE,createZeros:lj},createRound:lZ}}),{gcd:l2}=aM({gcdDependencies:{BigNumberDependencies:s7,DenseMatrixDependencies:lt,equalScalarDependencies:lN,matrixDependencies:lz,typedDependencies:lE,createGcd:l0}}),l5=10;function l3(e,t){let n=t.startMs,i=e.values,r=[];for(let e of i){for(;n<e[0];)r.push([n,null]),n+=t.stepMs;r.push([n,e[1]]),n+=t.stepMs}for(;n<=t.endMs;)r.push([n,null]),n+=t.stepMs;return r}function l4(e){let t,n,i=[];for(let t of e)if(t&&"timeRange"in t){if(void 0===t||void 0===t.timeRange||void 0===t.stepMs)continue;if(i.push(t.stepMs),void 0===n){n=t.timeRange;continue}t.timeRange.start<n.start&&(n.start=t.timeRange.start),t.timeRange.end>n.end&&(n.end=t.timeRange.end)}else if(t&&"values"in t){for(let e=0;e<t.values.length;e++){let i=t.values[e];if(void 0===i)continue;let[r]=i,o=new Date(r),a=new Date(r);if(void 0===n){n={start:o,end:a};continue}o<n.start&&(n.start=o),a>n.end&&(n.end=a)}if(void 0===n)return;let e=n.start.valueOf(),i=n.end.valueOf(),r=i-e;return{startMs:e,endMs:i,rangeMs:r,stepMs:l5}}if(void 0===n)return;if(1===i.length)t=i[0];else{let e=l2(...i);t=e<l5?l5:e}let r=n.start.valueOf(),o=n.end.valueOf();return{startMs:r,endMs:o,stepMs:t,rangeMs:o-r}}function l6(e){return/^[0-9a-fA-F]+$/.test(e)}function l8(e){return e.spec?.spec?.display?.name?e.spec.spec.display.name:e.spec?.display?.name?e.spec.display.name:e.metadata.name}function l9(e){return e.spec?.spec?.display?.name?`${e.spec.spec.display.name} (ID: ${e.metadata.name})`:e.spec?.display?.name?`${e.spec.display.name} (ID: ${e.metadata.name})`:e.metadata.name}let l7=(0,eD.createContext)(void 0);function ue(e){let{children:t,timeZone:n}=e;return(0,eb.jsx)(l7.Provider,{value:n,children:t})}function ut(){let e=(0,eD.useContext)(l7);return{timeZone:e??"local",formatWithUserTimeZone:(t,n)=>rJ(t,n,e),dateFormatOptionsWithUserTimeZone:t=>rQ(t,e)}}function un({label:e,color:t,size:n="small",onColorChange:i,onClear:r}){let[o,a]=(0,eD.useState)(null),s=!!o,{thresholds:{defaultColor:l,palette:u}}=ti();return(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(ui,{size:n,"aria-label":`change ${e} color`,isSelected:s,iconColor:t,onClick:e=>{a(e.currentTarget)},children:(0,eb.jsx)(ek,{})}),(0,eb.jsx)(e9.Ay,{"data-testid":"options color picker",open:s,anchorEl:o,onClose:()=>{a(null)},slotProps:{paper:{sx:{padding:e=>e.spacing(2)}}},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},children:(0,eb.jsx)(e6,{color:t,palette:[l,...u],onChange:i,onClear:r})})]})}let ui=(0,e7.A)(eC.A,{shouldForwardProp:e=>"isSelected"!==e&&"iconColor"!==e})(({iconColor:e,isSelected:t})=>({backgroundColor:t&&e?`${e}3F`:"undefined",color:e}));var ur=n(56599),uo=n(74628),ua=n(38662);function us(e,t){return"ALL"!==t&&!!t[e.id]}var ul=n(11750),uu=n(81023),uc=n(59238),uh=n(23434),ud=n(72052),up=n(83926),uf=n(1337),ug=n(54382),um=n(29424),uv=n(67214),uy=n(29009),ux=n(46733);function ub(e){return(0,ux.Ay)("MuiListItemButton",e)}let uw=(0,uy.A)("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),uS=(0,e7.A)(uf.A,{shouldForwardProp:e=>(0,up.A)(e)||"classes"===e,name:"MuiListItemButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})((0,uh.A)(({theme:e})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${uw.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,uc.X4)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${uw.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,uc.X4)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${uw.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,uc.X4)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,uc.X4)(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${uw.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${uw.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),u_=eD.forwardRef(function(e,t){let n=(0,ud.b)({props:e,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:r=!1,component:o="div",children:a,dense:s=!1,disableGutters:l=!1,divider:u=!1,focusVisibleClassName:c,selected:h=!1,className:d,...p}=n,f=eD.useContext(uv.A),g=eD.useMemo(()=>({dense:s||f.dense||!1,alignItems:i,disableGutters:l}),[i,f.dense,s,l]),m=eD.useRef(null);(0,ug.A)(()=>{r&&m.current&&m.current.focus()},[r]);let v={...n,alignItems:i,dense:g.dense,disableGutters:l,divider:u,selected:h},y=(e=>{let{alignItems:t,classes:n,dense:i,disabled:r,disableGutters:o,divider:a,selected:s}=e,l=(0,uu.A)({root:["root",i&&"dense",!o&&"gutters",a&&"divider",r&&"disabled","flex-start"===t&&"alignItemsFlexStart",s&&"selected"]},ub,n);return{...n,...l}})(v),x=(0,um.A)(m,t);return(0,eb.jsx)(uv.A.Provider,{value:g,children:(0,eb.jsx)(uS,{ref:x,href:p.href||p.to,component:(p.href||p.to)&&"div"===o?"button":o,focusVisibleClassName:(0,ul.A)(y.focusVisible,c),ownerState:v,className:(0,ul.A)(y.root,d),...p,classes:y,children:a})})});var uM=n(14045);let uC=(0,eD.memo)(function({color:e,sx:t,...n}){return(0,eb.jsx)(uo.A,{...n,sx:rv({height:4,width:16,margin:e=>e.spacing(.5)},t),style:{backgroundColor:e}})}),uA=(0,eD.forwardRef)(function({item:e,sx:t,truncateLabel:n,onClick:i,isVisuallySelected:r,onMouseOver:o,onMouseOut:a,index:s,...l},u){let[c,h]=(0,eD.useState)(n);return(0,eb.jsxs)(u_,{...l,role:"listitem",sx:rv({padding:0,cursor:"pointer"},t),dense:!0,onClick:t=>{i(t,e.id),e.onClick?.(t)},onMouseOver:t=>o?.(t,{id:e.id,index:s}),onMouseOut:t=>a?.(t,{id:e.id,index:s}),selected:r,ref:u,children:[(0,eb.jsx)(uo.A,{sx:{display:"flex",alignItems:"center"},children:(0,eb.jsx)(uC,{color:e.color})}),(0,eb.jsx)(uM.A,{primary:e.label,primaryTypographyProps:{noWrap:c},onMouseOver:function(){n&&h(!1)},onMouseOut:function(){n&&h(!0)}})]})}),uk=(0,eD.memo)(uA);function uT({height:e,items:t,selectedItems:n,onLegendItemClick:i,onItemMouseOver:r,onItemMouseOut:o}){return(0,eb.jsx)(uo.A,{component:"ul",sx:{width:"100%",height:e,padding:[0,1,0,0],overflowY:"scroll",margin:0},children:t.map((e,t)=>(0,eb.jsx)(uk,{item:e,index:t,isVisuallySelected:us(e,n),onMouseOver:r,onMouseOut:o,onClick:i,sx:{width:"auto",float:"left",paddingRight:1.5}},e.id))})}var uD=n(74649);function uI({items:e,height:t,width:n,selectedItems:i,onLegendItemClick:r,onItemMouseOver:o,onItemMouseOut:a}){let s=e.length>5;return(0,eb.jsx)(uD.aY,{style:{height:t,width:n},data:e,itemContent:(e,t)=>(0,eb.jsx)(uk,{item:t,index:e,truncateLabel:s,isVisuallySelected:us(t,i),onClick:r,onMouseOver:o,onMouseOut:a,sx:{width:"100%",wordBreak:"break-word",overflow:"hidden"}},t.id),role:"list"})}function uO(e,t){return"function"==typeof e?e(t):e}function uP(e,t){return n=>{t.setState(t=>({...t,[e]:uO(n,t[e])}))}}function uE(e){return e instanceof Function}function uR(e,t,n){let i,r=[];return o=>{let a,s;n.key&&n.debug&&(a=Date.now());let l=e(o);if(!(l.length!==r.length||l.some((e,t)=>r[t]!==e)))return i;if(r=l,n.key&&n.debug&&(s=Date.now()),i=t(...l),null==n||null==n.onChange||n.onChange(i),n.key&&n.debug&&null!=n&&n.debug()){let e=Math.round((Date.now()-a)*100)/100,t=Math.round((Date.now()-s)*100)/100,i=t/16,r=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${r(t,5)} /${r(e,5)} ms`,`
3
+ font-size: .6rem;
4
+ font-weight: bold;
5
+ color: hsl(${Math.max(0,Math.min(120-120*i,120))}deg 100% 31%);`,null==n?void 0:n.key)}return i}}function uL(e,t,n,i){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:i}}let uN="debugHeaders";function uB(e,t,n){var i;let r={id:null!=(i=n.id)?i:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(r),e},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(r,e)}),r}function uF(e,t,n,i){var r,o;let a=0,s=function(e,t){void 0===t&&(t=1),a=Math.max(a,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;null!=(n=e.columns)&&n.length&&s(e.columns,t+1)},0)};s(e);let l=[],u=(e,t)=>{let r={depth:t,id:[i,`${t}`].filter(Boolean).join("_"),headers:[]},o=[];e.forEach(e=>{let a,s=[...o].reverse()[0],l=e.column.depth===r.depth,u=!1;if(l&&e.column.parent?a=e.column.parent:(a=e.column,u=!0),s&&(null==s?void 0:s.column)===a)s.subHeaders.push(e);else{let r=uB(n,a,{id:[i,t,a.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${o.filter(e=>e.column===a).length}`:void 0,depth:t,index:o.length});r.subHeaders.push(e),o.push(r)}r.headers.push(e),e.headerGroup=r}),l.push(r),t>0&&u(o,t-1)};u(t.map((e,t)=>uB(n,e,{depth:a,index:t})),a-1),l.reverse();let c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,i=[0];return e.subHeaders&&e.subHeaders.length?(i=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:r}=e;t+=n,i.push(r)})):t=1,n+=Math.min(...i),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(null!=(r=null==(o=l[0])?void 0:o.headers)?r:[]),l}let uz=(e,t,n,i,r,o,a)=>{let s={id:t,index:i,original:n,depth:r,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];let n=e.getColumn(t);if(null!=n&&n.accessorFn)return s._valuesCache[t]=n.accessorFn(s.original,i),s._valuesCache[t]},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];let n=e.getColumn(t);if(null!=n&&n.accessorFn)return n.columnDef.getUniqueValues?s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,i):s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t]},renderValue:t=>{var n;return null!=(n=s.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=o?o:[],getLeafRows:()=>{var e,t;let n,i;return e=s.subRows,t=e=>e.subRows,n=[],(i=e=>{e.forEach(e=>{n.push(e);let r=t(e);null!=r&&r.length&&i(r)})})(e),n},getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:uR(()=>[e.getAllLeafColumns()],t=>t.map(t=>{var n;let i;return n=t.id,i={id:`${s.id}_${t.id}`,row:s,column:t,getValue:()=>s.getValue(n),renderValue:()=>{var t;return null!=(t=i.getValue())?t:e.options.renderFallbackValue},getContext:uR(()=>[e,t,s,i],(e,t,n,i)=>({table:e,column:t,row:n,cell:i,getValue:i.getValue,renderValue:i.renderValue}),uL(e.options,"debugCells","cell.getContext"))},e._features.forEach(n=>{null==n.createCell||n.createCell(i,t,s,e)},{}),i}),uL(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:uR(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),uL(e.options,"debugRows","getAllCellsByColumnId"))};for(let t=0;t<e._features.length;t++){let n=e._features[t];null==n||null==n.createRow||n.createRow(s,e)}return s},uV=(e,t,n)=>{var i,r;let o=null==n||null==(i=n.toString())?void 0:i.toLowerCase();return!!(null==(r=e.getValue(t))||null==(r=r.toString())||null==(r=r.toLowerCase())?void 0:r.includes(o))};uV.autoRemove=e=>uX(e);let uj=(e,t,n)=>{var i;return!!(null==(i=e.getValue(t))||null==(i=i.toString())?void 0:i.includes(n))};uj.autoRemove=e=>uX(e);let uH=(e,t,n)=>{var i;return(null==(i=e.getValue(t))||null==(i=i.toString())?void 0:i.toLowerCase())===(null==n?void 0:n.toLowerCase())};uH.autoRemove=e=>uX(e);let uW=(e,t,n)=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)};uW.autoRemove=e=>uX(e);let uG=(e,t,n)=>!n.some(n=>{var i;return!(null!=(i=e.getValue(t))&&i.includes(n))});uG.autoRemove=e=>uX(e)||!(null!=e&&e.length);let u$=(e,t,n)=>n.some(n=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)});u$.autoRemove=e=>uX(e)||!(null!=e&&e.length);let uU=(e,t,n)=>e.getValue(t)===n;uU.autoRemove=e=>uX(e);let uq=(e,t,n)=>e.getValue(t)==n;uq.autoRemove=e=>uX(e);let uY=(e,t,n)=>{let[i,r]=n,o=e.getValue(t);return o>=i&&o<=r};uY.resolveFilterValue=e=>{let[t,n]=e,i="number"!=typeof t?parseFloat(t):t,r="number"!=typeof n?parseFloat(n):n,o=null===t||Number.isNaN(i)?-1/0:i,a=null===n||Number.isNaN(r)?1/0:r;if(o>a){let e=o;o=a,a=e}return[o,a]},uY.autoRemove=e=>uX(e)||uX(e[0])&&uX(e[1]);let uZ={includesString:uV,includesStringSensitive:uj,equalsString:uH,arrIncludes:uW,arrIncludesAll:uG,arrIncludesSome:u$,equals:uU,weakEquals:uq,inNumberRange:uY};function uX(e){return null==e||""===e}function uK(e,t,n){return!!e&&!!e.autoRemove&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}let uQ={sum:(e,t,n)=>n.reduce((t,n)=>{let i=n.getValue(e);return t+("number"==typeof i?i:0)},0),min:(e,t,n)=>{let i;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(i>n||void 0===i&&n>=n)&&(i=n)}),i},max:(e,t,n)=>{let i;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(i<n||void 0===i&&n>=n)&&(i=n)}),i},extent:(e,t,n)=>{let i,r;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(void 0===i?n>=n&&(i=r=n):(i>n&&(i=n),r<n&&(r=n)))}),[i,r]},mean:(e,t)=>{let n=0,i=0;if(t.forEach(t=>{let r=t.getValue(e);null!=r&&(r*=1)>=r&&(++n,i+=r)}),n)return i/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!(Array.isArray(n)&&n.every(e=>"number"==typeof e)))return;if(1===n.length)return n[0];let i=Math.floor(n.length/2),r=n.sort((e,t)=>e-t);return n.length%2!=0?r[i]:(r[i-1]+r[i])/2},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},uJ=()=>({left:[],right:[]}),u0={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},u1=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),u2=null;function u5(e){return"touchstart"===e.type}function u3(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}let u4=()=>({pageIndex:0,pageSize:10}),u6=()=>({top:[],bottom:[]}),u8=(e,t,n,i,r)=>{var o;let a=r.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),a.getCanSelect()&&(e[t]=!0)):delete e[t],i&&null!=(o=a.subRows)&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(t=>u8(e,t.id,n,i,r))};function u9(e,t){let n=e.getState().rowSelection,i=[],r={},o=function(e,t){return e.map(e=>{var t;let a=u7(e,n);if(a&&(i.push(e),r[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:o(e.subRows)}),a)return e}).filter(Boolean)};return{rows:o(t.rows),flatRows:i,rowsById:r}}function u7(e,t){var n;return null!=(n=t[e.id])&&n}function ce(e,t,n){var i;if(!(null!=(i=e.subRows)&&i.length))return!1;let r=!0,o=!1;return e.subRows.forEach(e=>{if((!o||r)&&(e.getCanSelect()&&(u7(e,t)?o=!0:r=!1),e.subRows&&e.subRows.length)){let n=ce(e,t);"all"===n?o=!0:("some"===n&&(o=!0),r=!1)}}),r?"all":!!o&&"some"}let ct=/([0-9]+)/gm;function cn(e,t){return e===t?0:e>t?1:-1}function ci(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function cr(e,t){let n=e.split(ct).filter(Boolean),i=t.split(ct).filter(Boolean);for(;n.length&&i.length;){let e=n.shift(),t=i.shift(),r=parseInt(e,10),o=parseInt(t,10),a=[r,o].sort();if(isNaN(a[0])){if(e>t)return 1;if(t>e)return -1;continue}if(isNaN(a[1]))return isNaN(r)?-1:1;if(r>o)return 1;if(o>r)return -1}return n.length-i.length}let co={alphanumeric:(e,t,n)=>cr(ci(e.getValue(n)).toLowerCase(),ci(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>cr(ci(e.getValue(n)),ci(t.getValue(n))),text:(e,t,n)=>cn(ci(e.getValue(n)).toLowerCase(),ci(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>cn(ci(e.getValue(n)),ci(t.getValue(n))),datetime:(e,t,n)=>{let i=e.getValue(n),r=t.getValue(n);return i>r?1:i<r?-1:0},basic:(e,t,n)=>cn(e.getValue(n),t.getValue(n))},ca=[{createTable:e=>{e.getHeaderGroups=uR(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,r)=>{var o,a;let s=null!=(o=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?o:[],l=null!=(a=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?a:[];return uF(t,[...s,...n.filter(e=>!(null!=i&&i.includes(e.id))&&!(null!=r&&r.includes(e.id))),...l],e)},uL(e.options,uN,"getHeaderGroups")),e.getCenterHeaderGroups=uR(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,r)=>uF(t,n=n.filter(e=>!(null!=i&&i.includes(e.id))&&!(null!=r&&r.includes(e.id))),e,"center"),uL(e.options,uN,"getCenterHeaderGroups")),e.getLeftHeaderGroups=uR(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,i)=>{var r;return uF(t,null!=(r=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?r:[],e,"left")},uL(e.options,uN,"getLeftHeaderGroups")),e.getRightHeaderGroups=uR(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,i)=>{var r;return uF(t,null!=(r=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?r:[],e,"right")},uL(e.options,uN,"getRightHeaderGroups")),e.getFooterGroups=uR(()=>[e.getHeaderGroups()],e=>[...e].reverse(),uL(e.options,uN,"getFooterGroups")),e.getLeftFooterGroups=uR(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),uL(e.options,uN,"getLeftFooterGroups")),e.getCenterFooterGroups=uR(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),uL(e.options,uN,"getCenterFooterGroups")),e.getRightFooterGroups=uR(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),uL(e.options,uN,"getRightFooterGroups")),e.getFlatHeaders=uR(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),uL(e.options,uN,"getFlatHeaders")),e.getLeftFlatHeaders=uR(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),uL(e.options,uN,"getLeftFlatHeaders")),e.getCenterFlatHeaders=uR(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),uL(e.options,uN,"getCenterFlatHeaders")),e.getRightFlatHeaders=uR(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),uL(e.options,uN,"getRightFlatHeaders")),e.getCenterLeafHeaders=uR(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),uL(e.options,uN,"getCenterLeafHeaders")),e.getLeftLeafHeaders=uR(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),uL(e.options,uN,"getLeftLeafHeaders")),e.getRightLeafHeaders=uR(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),uL(e.options,uN,"getRightLeafHeaders")),e.getLeafHeaders=uR(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var i,r,o,a,s,l;return[...null!=(i=null==(r=e[0])?void 0:r.headers)?i:[],...null!=(o=null==(a=t[0])?void 0:a.headers)?o:[],...null!=(s=null==(l=n[0])?void 0:l.headers)?s:[]].map(e=>e.getLeafHeaders()).flat()},uL(e.options,uN,"getLeafHeaders"))}},{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:uP("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()}))},e.getIsVisible=()=>{var n,i;let r=e.columns;return null==(n=r.length?r.some(e=>e.getIsVisible()):null==(i=t.getState().columnVisibility)?void 0:i[e.id])||n},e.getCanHide=()=>{var n,i;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(i=t.options.enableHiding)||i)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=uR(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),uL(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=uR(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],uL(t.options,"debugRows","getVisibleCells"))},createTable:e=>{let t=(t,n)=>uR(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),uL(e.options,"debugColumns",t));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(null!=e.getIsVisible&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>null==e.getIsVisible?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}},{getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:uP("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=uR(e=>[u3(t,e)],t=>t.findIndex(t=>t.id===e.id),uL(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var i;return(null==(i=u3(t,n)[0])?void 0:i.id)===e.id},e.getIsLastColumn=n=>{var i;let r=u3(t,n);return(null==(i=r[r.length-1])?void 0:i.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=uR(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>i=>{let r=[];if(null!=e&&e.length){let t=[...e],n=[...i];for(;n.length&&t.length;){let e=t.shift(),i=n.findIndex(t=>t.id===e);i>-1&&r.push(n.splice(i,1)[0])}r=[...r,...n]}else r=i;var o=r;if(!(null!=t&&t.length)||!n)return o;let a=o.filter(e=>!t.includes(e.id));return"remove"===n?a:[...t.map(e=>o.find(t=>t.id===e)).filter(Boolean),...a]},uL(e.options,"debugTable","_getOrderColumnsFn"))}},{getInitialState:e=>({columnPinning:uJ(),...e}),getDefaultOptions:e=>({onColumnPinningChange:uP("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{let i=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,r,o,a,s,l;return"right"===n?{left:(null!=(o=null==e?void 0:e.left)?o:[]).filter(e=>!(null!=i&&i.includes(e))),right:[...(null!=(a=null==e?void 0:e.right)?a:[]).filter(e=>!(null!=i&&i.includes(e))),...i]}:"left"===n?{left:[...(null!=(s=null==e?void 0:e.left)?s:[]).filter(e=>!(null!=i&&i.includes(e))),...i],right:(null!=(l=null==e?void 0:e.right)?l:[]).filter(e=>!(null!=i&&i.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=i&&i.includes(e))),right:(null!=(r=null==e?void 0:e.right)?r:[]).filter(e=>!(null!=i&&i.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,i,r;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(i=null!=(r=t.options.enableColumnPinning)?r:t.options.enablePinning)||i)}),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:i,right:r}=t.getState().columnPinning,o=n.some(e=>null==i?void 0:i.includes(e)),a=n.some(e=>null==r?void 0:r.includes(e));return o?"left":!!a&&"right"},e.getPinnedIndex=()=>{var n,i;let r=e.getIsPinned();return r?null!=(n=null==(i=t.getState().columnPinning)||null==(i=i[r])?void 0:i.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=uR(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let i=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!i.includes(e.column.id))},uL(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=uR(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"left"})),uL(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=uR(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"right"})),uL(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,i;return e.setColumnPinning(t?uJ():null!=(n=null==(i=e.initialState)?void 0:i.columnPinning)?n:uJ())},e.getIsSomeColumnsPinned=t=>{var n,i,r;let o=e.getState().columnPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(i=o.left)?void 0:i.length)||(null==(r=o.right)?void 0:r.length))},e.getLeftLeafColumns=uR(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),uL(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=uR(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),uL(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=uR(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let i=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!i.includes(e.id))},uL(e.options,"debugColumns","getCenterLeafColumns"))}},{createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},{getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:uP("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0],i=null==n?void 0:n.getValue(e.id);return"string"==typeof i?uZ.includesString:"number"==typeof i?uZ.inNumberRange:"boolean"==typeof i||null!==i&&"object"==typeof i?uZ.equals:Array.isArray(i)?uZ.arrIncludes:uZ.weakEquals},e.getFilterFn=()=>{var n,i;return uE(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(i=t.options.filterFns)?void 0:i[e.columnDef.filterFn])?n:uZ[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,i,r;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(i=t.options.enableColumnFilters)||i)&&(null==(r=t.options.enableFilters)||r)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find(t=>t.id===e.id))?void 0:n.value},e.getFilterIndex=()=>{var n,i;return null!=(n=null==(i=t.getState().columnFilters)?void 0:i.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{var i,r;let o=e.getFilterFn(),a=null==t?void 0:t.find(t=>t.id===e.id),s=uO(n,a?a.value:void 0);if(uK(o,s,e))return null!=(i=null==t?void 0:t.filter(t=>t.id!==e.id))?i:[];let l={id:e.id,value:s};return a?null!=(r=null==t?void 0:t.map(t=>t.id===e.id?l:t))?r:[]:null!=t&&t.length?[...t,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange(e=>{var i;return null==(i=uO(t,e))?void 0:i.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&uK(t.getFilterFn(),e.value,t))&&!0})})},e.resetColumnFilters=t=>{var n,i;e.setColumnFilters(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel)?e.getPreFilteredRowModel():e._getFilteredRowModel()}},{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},{getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:uP("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;let i=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof i||"number"==typeof i}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,i,r,o;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(i=t.options.enableGlobalFilter)||i)&&(null==(r=t.options.enableFilters)||r)&&(null==(o=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||o)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>uZ.includesString,e.getGlobalFilterFn=()=>{var t,n;let{globalFilterFn:i}=e.options;return uE(i)?i:"auto"===i?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[i])?t:uZ[i]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:uP("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),i=!1;for(let t of n){let n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return co.datetime;if("string"==typeof n&&(i=!0,n.split(ct).length>1))return co.alphanumeric}return i?co.text:co.basic},e.getAutoSortDir=()=>{let n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,i;if(!e)throw Error();return uE(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(i=t.options.sortingFns)?void 0:i[e.columnDef.sortingFn])?n:co[e.columnDef.sortingFn]},e.toggleSorting=(n,i)=>{let r=e.getNextSortingOrder(),o=null!=n;t.setSorting(a=>{let s,l=null==a?void 0:a.find(t=>t.id===e.id),u=null==a?void 0:a.findIndex(t=>t.id===e.id),c=[],h=o?n:"desc"===r;if("toggle"!=(s=null!=a&&a.length&&e.getCanMultiSort()&&i?l?"toggle":"add":null!=a&&a.length&&u!==a.length-1?"replace":l?"toggle":"replace")||o||r||(s="remove"),"add"===s){var d;(c=[...a,{id:e.id,desc:h}]).splice(0,c.length-(null!=(d=t.options.maxMultiSortColCount)?d:Number.MAX_SAFE_INTEGER))}else c="toggle"===s?a.map(t=>t.id===e.id?{...t,desc:h}:t):"remove"===s?a.filter(t=>t.id!==e.id):[{id:e.id,desc:h}];return c})},e.getFirstSortDir=()=>{var n,i;return(null!=(n=null!=(i=e.columnDef.sortDescFirst)?i:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var i,r;let o=e.getFirstSortDir(),a=e.getIsSorted();return a?(a===o||null!=(i=t.options.enableSortingRemoval)&&!i||!!n&&null!=(r=t.options.enableMultiRemove)&&!r)&&("desc"===a?"asc":"desc"):o},e.getCanSort=()=>{var n,i;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(i=t.options.enableSorting)||i)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,i;return null!=(n=null!=(i=e.columnDef.enableMultiSort)?i:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;let i=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!i&&(i.desc?"desc":"asc")},e.getSortIndex=()=>{var n,i;return null!=(n=null==(i=t.getState().sorting)?void 0:i.findIndex(t=>t.id===e.id))?n:-1},e.clearSorting=()=>{t.setSorting(t=>null!=t&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return i=>{n&&(null==i.persist||i.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(i))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,i;e.setSorting(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel)?e.getPreSortedRowModel():e._getSortedRowModel()}},{getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:uP("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>null!=t&&t.includes(e.id)?t.filter(t=>t!==e.id):[...null!=t?t:[],e.id])},e.getCanGroup=()=>{var n,i;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(i=t.options.enableGrouping)||i)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0],i=null==n?void 0:n.getValue(e.id);return"number"==typeof i?uQ.sum:"[object Date]"===Object.prototype.toString.call(i)?uQ.extent:void 0},e.getAggregationFn=()=>{var n,i;if(!e)throw Error();return uE(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(i=t.options.aggregationFns)?void 0:i[e.columnDef.aggregationFn])?n:uQ[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,i;e.setGrouping(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel)?e.getPreGroupedRowModel():e._getGroupedRowModel()},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let i=t.getColumn(n);return null!=i&&i.columnDef.getGroupingValue?(e._groupingValuesCache[n]=i.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,i)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!(null!=(t=n.subRows)&&t.length)}}},{getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:uP("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var i,r;if(!t)return void e._queue(()=>{t=!0});if(null!=(i=null!=(r=e.options.autoResetAll)?r:e.options.autoResetExpanded)?i:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,i;e.setExpanded(t?{}:null!=(n=null==(i=e.initialState)?void 0:i.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return"boolean"==typeof t?!0===t:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(".");t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel)?e.getPreExpandedRowModel():e._getExpandedRowModel()},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(i=>{var r;let o=!0===i||!!(null!=i&&i[e.id]),a={};if(!0===i?Object.keys(t.getRowModel().rowsById).forEach(e=>{a[e]=!0}):a=i,n=null!=(r=n)?r:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){let{[e.id]:t,...n}=a;return n}return i})},e.getIsExpanded=()=>{var n;let i=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===i||(null==i?void 0:i[e.id]))},e.getCanExpand=()=>{var n,i,r;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(i=t.options.enableExpanding)||i)&&!!(null!=(r=e.subRows)&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,i=e;for(;n&&i.parentId;)n=(i=t.getRow(i.parentId,!0)).getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},{getInitialState:e=>({...e,pagination:{...u4(),...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:uP("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var i,r;if(!t)return void e._queue(()=>{t=!0});if(null!=(i=null!=(r=e.options.autoResetAll)?r:e.options.autoResetPageIndex)?i:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange(e=>uO(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?u4():null!=(n=e.initialState.pagination)?n:u4())},e.setPageIndex=t=>{e.setPagination(n=>{let i=uO(t,n.pageIndex);return i=Math.max(0,Math.min(i,void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1)),{...n,pageIndex:i}})},e.resetPageIndex=t=>{var n,i;e.setPageIndex(t?0:null!=(n=null==(i=e.initialState)||null==(i=i.pagination)?void 0:i.pageIndex)?n:0)},e.resetPageSize=t=>{var n,i;e.setPageSize(t?10:null!=(n=null==(i=e.initialState)||null==(i=i.pagination)?void 0:i.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,uO(t,e.pageSize)),i=Math.floor(e.pageSize*e.pageIndex/n);return{...e,pageIndex:i,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{var i;let r=uO(t,null!=(i=e.options.pageCount)?i:-1);return"number"==typeof r&&(r=Math.max(-1,r)),{...n,pageCount:r}}),e.getPageOptions=uR(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},uL(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return -1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel)?e.getPrePaginationRowModel():e._getPaginationRowModel(),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},{getInitialState:e=>({rowPinning:u6(),...e}),getDefaultOptions:e=>({onRowPinningChange:uP("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,i,r)=>{let o=i?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],a=new Set([...r?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],e.id,...o]);t.setRowPinning(e=>{var t,i,r,o,s,l;return"bottom"===n?{top:(null!=(r=null==e?void 0:e.top)?r:[]).filter(e=>!(null!=a&&a.has(e))),bottom:[...(null!=(o=null==e?void 0:e.bottom)?o:[]).filter(e=>!(null!=a&&a.has(e))),...Array.from(a)]}:"top"===n?{top:[...(null!=(s=null==e?void 0:e.top)?s:[]).filter(e=>!(null!=a&&a.has(e))),...Array.from(a)],bottom:(null!=(l=null==e?void 0:e.bottom)?l:[]).filter(e=>!(null!=a&&a.has(e)))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter(e=>!(null!=a&&a.has(e))),bottom:(null!=(i=null==e?void 0:e.bottom)?i:[]).filter(e=>!(null!=a&&a.has(e)))}})},e.getCanPin=()=>{var n;let{enableRowPinning:i,enablePinning:r}=t.options;return"function"==typeof i?i(e):null==(n=null!=i?i:r)||n},e.getIsPinned=()=>{let n=[e.id],{top:i,bottom:r}=t.getState().rowPinning,o=n.some(e=>null==i?void 0:i.includes(e)),a=n.some(e=>null==r?void 0:r.includes(e));return o?"top":!!a&&"bottom"},e.getPinnedIndex=()=>{var n,i;let r=e.getIsPinned();if(!r)return -1;let o=null==(n="top"===r?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(i=null==o?void 0:o.indexOf(e.id))?i:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,i;return e.setRowPinning(t?u6():null!=(n=null==(i=e.initialState)?void 0:i.rowPinning)?n:u6())},e.getIsSomeRowsPinned=t=>{var n,i,r;let o=e.getState().rowPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(i=o.top)?void 0:i.length)||(null==(r=o.bottom)?void 0:r.length))},e._getPinnedRows=(t,n,i)=>{var r;return(null==(r=e.options.keepPinnedRows)||r?(null!=n?n:[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(null!=n?n:[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:i}))},e.getTopRows=uR(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),uL(e.options,"debugRows","getTopRows")),e.getBottomRows=uR(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),uL(e.options,"debugRows","getBottomRows")),e.getCenterRows=uR(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let i=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!i.has(e.id))},uL(e.options,"debugRows","getCenterRows"))}},{getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:uP("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();let i={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(e=>{e.getCanSelect()&&(i[e.id]=!0)}):r.forEach(e=>{delete i[e.id]}),i})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let i=void 0!==t?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(t=>{u8(r,t.id,i,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=uR(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?u9(e,n):{rows:[],flatRows:[],rowsById:{}},uL(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=uR(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?u9(e,n):{rows:[],flatRows:[],rowsById:{}},uL(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=uR(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?u9(e,n):{rows:[],flatRows:[],rowsById:{}},uL(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),i=!!(t.length&&Object.keys(n).length);return i&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(i=!1),i},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),i=!!t.length;return i&&t.some(e=>!n[e.id])&&(i=!1),i},e.getIsSomeRowsSelected=()=>{var t;let n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,i)=>{let r=e.getIsSelected();t.setRowSelection(o=>{var a;if(n=void 0!==n?n:!r,e.getCanSelect()&&r===n)return o;let s={...o};return u8(s,e.id,n,null==(a=null==i?void 0:i.selectChildren)||a,t),s})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return u7(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return"some"===ce(e,n)},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return"all"===ce(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{var i;t&&e.toggleSelected(null==(i=n.target)?void 0:i.checked)}}}},{getDefaultColumnDef:()=>u0,getInitialState:e=>({columnSizing:{},columnSizingInfo:u1(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:uP("columnSizing",e),onColumnSizingInfoChange:uP("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,i,r;let o=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:u0.minSize,null!=(i=null!=o?o:e.columnDef.size)?i:u0.size),null!=(r=e.columnDef.maxSize)?r:u0.maxSize)},e.getStart=uR(e=>[e,u3(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),uL(t.options,"debugColumns","getStart")),e.getAfter=uR(e=>[e,u3(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),uL(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...i}=t;return i})},e.getCanResize=()=>{var n,i;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(i=t.options.enableColumnResizing)||i)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{if(e.subHeaders.length)e.subHeaders.forEach(n);else{var i;t+=null!=(i=e.column.getSize())?i:0}};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let i=t.getColumn(e.column.id),r=null==i?void 0:i.getCanResize();return o=>{if(!i||!r||(null==o.persist||o.persist(),u5(o)&&o.touches&&o.touches.length>1))return;let a=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[i.id,i.getSize()]],l=u5(o)?Math.round(o.touches[0].clientX):o.clientX,u={},c=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var i,r;let o="rtl"===t.options.columnResizeDirection?-1:1,a=(n-(null!=(i=null==e?void 0:e.startOffset)?i:0))*o,s=Math.max(a/(null!=(r=null==e?void 0:e.startSize)?r:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;u[t]=Math.round(100*Math.max(n+n*s,0))/100}),{...e,deltaOffset:a,deltaPercentage:s}}),("onChange"===t.options.columnResizeMode||"end"===e)&&t.setColumnSizing(e=>({...e,...u})))},h=e=>{c("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d=n||("u">typeof document?document:null),p={moveHandler:e=>c("move",e.clientX),upHandler:e=>{null==d||d.removeEventListener("mousemove",p.moveHandler),null==d||d.removeEventListener("mouseup",p.upHandler),h(e.clientX)}},f={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),c("move",e.touches[0].clientX),!1),upHandler:e=>{var t;null==d||d.removeEventListener("touchmove",f.moveHandler),null==d||d.removeEventListener("touchend",f.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),h(null==(t=e.touches[0])?void 0:t.clientX)}},g=!!function(){if("boolean"==typeof u2)return u2;let e=!1;try{let t=()=>{};window.addEventListener("test",t,{get passive(){return e=!0,!1}}),window.removeEventListener("test",t)}catch(t){e=!1}return u2=e}()&&{passive:!1};u5(o)?(null==d||d.addEventListener("touchmove",f.moveHandler,g),null==d||d.addEventListener("touchend",f.upHandler,g)):(null==d||d.addEventListener("mousemove",p.moveHandler,g),null==d||d.addEventListener("mouseup",p.upHandler,g)),t.setColumnSizingInfo(e=>({...e,startOffset:l,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:i.id}))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?u1():null!=(n=e.initialState.columnSizingInfo)?n:u1())},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0}}}];function cs(e){let t=[],n=e=>{var i;t.push(e),null!=(i=e.subRows)&&i.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}let cl={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},cu=RegExp(Object.keys(cl).join("|"),"g"),cc={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function ch(e,t,n){let i;return(e=cd(e,n),(t=cd(t,n)).length>e.length)?cc.NO_MATCH:e===t?cc.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase())===(t=t.toLowerCase())?cc.EQUAL:e.startsWith(t)?cc.STARTS_WITH:e.includes(` ${t}`)?cc.WORD_STARTS_WITH:e.includes(t)?cc.CONTAINS:1===t.length?cc.NO_MATCH:(i="",e.split(" ").forEach(e=>{e.split("-").forEach(e=>{i+=e.substr(0,1)})}),i).includes(t)?cc.ACRONYM:function(e,t){var n;let i,r=0,o=0;function a(e,t,n){for(let i=n,o=t.length;i<o;i++)if(t[i]===e)return r+=1,i+1;return -1}let s=a(t[0],e,0);if(s<0)return cc.NO_MATCH;o=s;for(let n=1,i=t.length;n<i;n++)if(!((o=a(t[n],e,o))>-1))return cc.NO_MATCH;return n=o-s,i=r/t.length,cc.MATCHES+1/n*i}(e,t)}function cd(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(cu,e=>cl[e])),e}let cp={maxRanking:1/0,minRanking:-1/0};function cf(e,t,{isHeader:n,isLastColumn:i,isFirstColumn:r,defaultColumnHeight:o}={}){var a,s;let l=e.spacing(1),u=e.spacing(1.25),c=e.spacing(2),h=r?c:u,d=i?c:u,p=e.typography.body1.lineHeight,f=e.typography.body1.fontSize;"compact"===t&&(l=e.spacing(.5),u=e.spacing(.5),c=e.spacing(1),h=r?c:u,d=i?c:u,p=e.typography.body2.lineHeight,f=e.typography.body2.fontSize),"comfortable"===t&&(l=e.spacing(2),u=e.spacing(1.5),c=e.spacing(2),h=r?c:u,d=i?c:u,p=e.typography.body1.lineHeight,f=e.typography.body1.fontSize);let g=n||!o||"auto"===o?(a=p,s=l,("string"==typeof a?parseInt(a,10):a??0)+2*("string"==typeof s?parseInt(s,10):s)):o;return{padding:`${l} ${d} ${l} ${h}`,height:g,fontSize:f,lineHeight:p}}function cg(e,t){return e.map(({width:e,align:n,headerDescription:i,cellDescription:r,enableSorting:o,dataLink:a,enableResizing:s,...l})=>{var u,c,h,d,p,f,g;let m=s??t?.enableResizing??!1,v="auto"===e||void 0===e?(u=m,c=t?.minWidth,h=t?.maxWidth,u?{size:150,minSize:c??60,maxSize:h??1e3}:{size:0,minSize:0,maxSize:0}):(d=m,p=e,f=t?.minWidth,g=t?.maxWidth,d?{size:p,minSize:f??60,maxSize:g??1e3}:{size:p});return{...l,...v,enableSorting:!!o,enableResizing:m,meta:{align:n,headerDescription:i,cellDescription:r,dataLink:a}}})}var cm=n(42927);function cv({color:e,density:t,...n}){let i="compact"===t;return(0,eb.jsx)(cm.A,{size:i?"small":"medium",...n,focusRipple:!1,tabIndex:-1,sx:{color:e,padding:e=>e.spacing(i?.25:.5),position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)","&.Mui-checked":{color:e},"&.Mui-focusVisible":{background:e?(0,uc.X4)(e,.5):void 0},"& .MuiSvgIcon-root":{fontSize:i?16:18}}})}var cy=n(3399),cx=n(76746),cb=n(63079),cw=n(76795),cS=n(45271);function c_(e){return(0,ux.Ay)("MuiToolbar",e)}(0,uy.A)("MuiToolbar",["root","gutters","regular","dense"]);let cM=(0,e7.A)("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})((0,uh.A)(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),cC=eD.forwardRef(function(e,t){let n=(0,ud.b)({props:e,name:"MuiToolbar"}),{className:i,component:r="div",disableGutters:o=!1,variant:a="regular",...s}=n,l={...n,component:r,disableGutters:o,variant:a},u=(e=>{let{classes:t,disableGutters:n,variant:i}=e;return(0,uu.A)({root:["root",!n&&"gutters",i]},c_,t)})(l);return(0,eb.jsx)(cM,{as:r,className:(0,ul.A)(u.root,i),ref:t,ownerState:l,...s})});var cA=n(35216),ck=n(96913),cT=n(70776),cD=n(22402);let cI=(0,cD.A)((0,eb.jsx)("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),cO=(0,cD.A)((0,eb.jsx)("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),cP=eD.forwardRef(function(e,t){let{backIconButtonProps:n,count:i,disabled:r=!1,getItemAriaLabel:o,nextIconButtonProps:a,onPageChange:s,page:l,rowsPerPage:u,showFirstButton:c,showLastButton:h,slots:d={},slotProps:p={},...f}=e,g=(0,cA.I)(),m=d.firstButton??eC.A,v=d.lastButton??eC.A,y=d.nextButton??eC.A,x=d.previousButton??eC.A,b=d.firstButtonIcon??cO,w=d.lastButtonIcon??cI,S=d.nextButtonIcon??cT.A,_=d.previousButtonIcon??ck.A,M=g?v:m,C=g?y:x,A=g?x:y,k=g?m:v,T=g?p.lastButton:p.firstButton,D=g?p.nextButton:p.previousButton,I=g?p.previousButton:p.nextButton,O=g?p.firstButton:p.lastButton;return(0,eb.jsxs)("div",{ref:t,...f,children:[c&&(0,eb.jsx)(M,{onClick:e=>{s(e,0)},disabled:r||0===l,"aria-label":o("first",l),title:o("first",l),...T,children:g?(0,eb.jsx)(w,{...p.lastButtonIcon}):(0,eb.jsx)(b,{...p.firstButtonIcon})}),(0,eb.jsx)(C,{onClick:e=>{s(e,l-1)},disabled:r||0===l,color:"inherit","aria-label":o("previous",l),title:o("previous",l),...D??n,children:g?(0,eb.jsx)(S,{...p.nextButtonIcon}):(0,eb.jsx)(_,{...p.previousButtonIcon})}),(0,eb.jsx)(A,{onClick:e=>{s(e,l+1)},disabled:r||-1!==i&&l>=Math.ceil(i/u)-1,color:"inherit","aria-label":o("next",l),title:o("next",l),...I??a,children:g?(0,eb.jsx)(_,{...p.previousButtonIcon}):(0,eb.jsx)(S,{...p.nextButtonIcon})}),h&&(0,eb.jsx)(k,{onClick:e=>{s(e,Math.max(0,Math.ceil(i/u)-1))},disabled:r||l>=Math.ceil(i/u)-1,"aria-label":o("last",l),title:o("last",l),...O,children:g?(0,eb.jsx)(b,{...p.firstButtonIcon}):(0,eb.jsx)(w,{...p.lastButtonIcon})})]})});var cE=n(63392);function cR(e){return(0,ux.Ay)("MuiTablePagination",e)}let cL=(0,uy.A)("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var cN=n(73397);let cB=(0,e7.A)(cS.A,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})((0,uh.A)(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),cF=(0,e7.A)(cC,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${cL.actions}`]:t.actions,...t.toolbar})})((0,uh.A)(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${cL.actions}`]:{flexShrink:0,marginLeft:20}}))),cz=(0,e7.A)("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),cV=(0,e7.A)("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})((0,uh.A)(({theme:e})=>({...e.typography.body2,flexShrink:0}))),cj=(0,e7.A)(cw.A,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${cL.selectIcon}`]:t.selectIcon,[`& .${cL.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${cL.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),cH=(0,e7.A)(cb.A,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),cW=(0,e7.A)("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})((0,uh.A)(({theme:e})=>({...e.typography.body2,flexShrink:0})));function cG({from:e,to:t,count:n}){return`${e}–${t} of ${-1!==n?n:`more than ${t}`}`}function c$(e){return`Go to ${e} page`}let cU=eD.forwardRef(function(e,t){let n,i=(0,ud.b)({props:e,name:"MuiTablePagination"}),{ActionsComponent:r=cP,backIconButtonProps:o,colSpan:a,component:s=cS.A,count:l,disabled:u=!1,getItemAriaLabel:c=c$,labelDisplayedRows:h=cG,labelRowsPerPage:d="Rows per page:",nextIconButtonProps:p,onPageChange:f,onRowsPerPageChange:g,page:m,rowsPerPage:v,rowsPerPageOptions:y=[10,25,50,100],SelectProps:x={},showFirstButton:b=!1,showLastButton:w=!1,slotProps:S={},slots:_={},...M}=i,C=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},cR,t)})(i),A=S?.select??x,k=A.native?"option":cH;(s===cS.A||"td"===s)&&(n=a||1e3);let T=(0,cE.A)(A.id),D=(0,cE.A)(A.labelId),I={slots:_,slotProps:S},[O,P]=(0,cN.A)("root",{ref:t,className:C.root,elementType:cB,externalForwardedProps:{...I,component:s,...M},ownerState:i,additionalProps:{colSpan:n}}),[E,L]=(0,cN.A)("toolbar",{className:C.toolbar,elementType:cF,externalForwardedProps:I,ownerState:i}),[N,B]=(0,cN.A)("spacer",{className:C.spacer,elementType:cz,externalForwardedProps:I,ownerState:i}),[F,z]=(0,cN.A)("selectLabel",{className:C.selectLabel,elementType:cV,externalForwardedProps:I,ownerState:i,additionalProps:{id:D}}),[V,j]=(0,cN.A)("select",{className:C.select,elementType:cj,externalForwardedProps:I,ownerState:i}),[H,W]=(0,cN.A)("menuItem",{className:C.menuItem,elementType:k,externalForwardedProps:I,ownerState:i}),[G,$]=(0,cN.A)("displayedRows",{className:C.displayedRows,elementType:cW,externalForwardedProps:I,ownerState:i});return(0,eb.jsx)(O,{...P,children:(0,eb.jsxs)(E,{...L,children:[(0,eb.jsx)(N,{...B}),y.length>1&&(0,eb.jsx)(F,{...z,children:d}),y.length>1&&(0,eb.jsx)(V,{variant:"standard",...!A.variant&&{input:R||(R=(0,eb.jsx)(cx.Ay,{}))},value:v,onChange:g,id:T,labelId:D,...A,classes:{...A.classes,root:(0,ul.A)(C.input,C.selectRoot,(A.classes||{}).root),select:(0,ul.A)(C.select,(A.classes||{}).select),icon:(0,ul.A)(C.selectIcon,(A.classes||{}).icon)},disabled:u,...j,children:y.map(e=>(0,eD.createElement)(H,{...W,key:e.label?e.label:e,value:e.value?e.value:e},e.label?e.label:e))}),(0,eb.jsx)(G,{...$,children:h({from:0===l?0:m*v+1,to:-1===l?(m+1)*v:-1===v?l:Math.min(l,(m+1)*v),count:-1===l?-1:l,page:m})}),(0,eb.jsx)(r,{className:C.actions,backIconButtonProps:o,count:l,nextIconButtonProps:p,onPageChange:f,page:m,rowsPerPage:v,showFirstButton:b,showLastButton:w,slotProps:S.actions,slots:_.actions,getItemAriaLabel:c,disabled:u})]})})}),cq={row:0,column:0},cY=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"];var cZ=n(91394);let cX=(0,e7.A)(cZ.A)(({theme:e})=>({tableLayout:"fixed",borderCollapse:"separate",backgroundColor:e.palette.background.default})),cK={compact:"small",standard:"medium",comfortable:"medium"},cQ=(0,eD.forwardRef)(function({density:e,...t},n){return(0,eb.jsx)(cX,{...t,tabIndex:-1,size:cK[e],ref:n,sx:{width:"100%"}})});var cJ=n(5139);let c0=(0,eD.forwardRef)(function(e,t){return(0,eb.jsx)(cJ.A,{...e,ref:t})});var c1=n(57438);let c2=(0,e7.A)(cS.A)(({theme:e})=>({padding:0,backgroundColor:"inherit","&.MuiTableCell-head":{backgroundColor:e.palette.background.default},"&:focus-visible":{outline:`solid 1px ${e.palette.primary.main}`,outlineOffset:"-1px",borderRadius:0}}));function c5({children:e,density:t,variant:n,width:i,defaultColumnHeight:r,focusState:o="none",onFocusTrigger:a,isFirstColumn:s,isLastColumn:l,description:u,align:c,color:h,backgroundColor:d,dataLink:p,adjacentCellsValuesMap:f,...g}){let m=(0,ur.A)(),v=(0,eD.useRef)(),y="head"===n;(0,eD.useEffect)(()=>{"trigger-focus"===o&&v.current&&v.current.focus()},[o]);let x=e=>{a?.(e)},b=(0,eD.useMemo)(()=>{if(p){if(f&&rz(p.url)){let{text:e}=rL(p.url,f,{urlEncode:!0});return{...p,url:e}}return p}},[p,f]);return(0,eb.jsx)(c2,{...g,tabIndex:"none"!==o?0:-1,onFocus:e=>{let t=e.currentTarget?.querySelector('a[href], button, input, textarea, select, details,[role="button"]');t&&t.focus()},onClick:x,onKeyUp:x,style:{width:i},sx:{position:"relative",borderBottom:y?`solid 1px ${m.palette.grey[100]}`:`solid 1px ${m.palette.grey[50]}`,"&:hover #original-cell":{position:"absolute",top:0,left:0,zIndex:10,width:"fit-content",minWidth:"100%",whiteSpace:"nowrap",overflow:"visible",backgroundColor:`${d??m.palette.background.default} !important`,outline:`solid 1px ${m.palette.info.main}`,outlineOffset:"-1px"}},ref:v,children:(0,eb.jsx)(uo.A,{id:"original-cell",sx:{...cf(m,t,{isHeader:y,isLastColumn:l,isFirstColumn:s,defaultColumnHeight:r}),position:"relative",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexDirection:"inherit"},style:{backgroundColor:d??"inherit",color:h??"inherit"},title:u,"aria-label":u,textAlign:c,children:b?(0,eb.jsx)(c1.A,{href:b.url,target:b.targetBlank?"_blank":"_self",rel:b.targetBlank?"noopener noreferrer":void 0,children:e}):e})})}var c3=n(91644);function c4(e){return(0,ux.Ay)("MuiTableFooter",e)}(0,uy.A)("MuiTableFooter",["root"]);let c6=(0,e7.A)("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-footer-group"}),c8={variant:"footer"},c9="tfoot",c7=eD.forwardRef(function(e,t){let n=(0,ud.b)({props:e,name:"MuiTableFooter"}),{className:i,component:r=c9,...o}=n,a={...n,component:r},s=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"]},c4,t)})(a);return(0,eb.jsx)(c3.A.Provider,{value:c8,children:(0,eb.jsx)(c6,{as:r,className:(0,ul.A)(s.root,i),ref:t,role:r===c9?null:"rowgroup",ownerState:a,...o})})}),he=(0,eD.forwardRef)(function(e,t){return(0,eb.jsx)(c7,{...e,ref:t})});var ht=n(70561);let hn=(0,eD.forwardRef)(function(e,t){return(0,eb.jsx)(ht.A,{...e,ref:t})});var hi=n(88091);let hr=(0,cD.A)((0,eb.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");var ho=n(24726);function ha(e){return(0,ux.Ay)("MuiTableSortLabel",e)}let hs=(0,uy.A)("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc","directionDesc","directionAsc"]),hl=(0,e7.A)(uf.A,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.active&&t.active]}})((0,uh.A)(({theme:e})=>({cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(e.vars||e).palette.text.secondary},"&:hover":{color:(e.vars||e).palette.text.secondary,[`& .${hs.icon}`]:{opacity:.5}},[`&.${hs.active}`]:{color:(e.vars||e).palette.text.primary,[`& .${hs.icon}`]:{opacity:1,color:(e.vars||e).palette.text.secondary}}}))),hu=(0,e7.A)("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,t[`iconDirection${(0,ho.A)(n.direction)}`]]}})((0,uh.A)(({theme:e})=>({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none",variants:[{props:{direction:"desc"},style:{transform:"rotate(0deg)"}},{props:{direction:"asc"},style:{transform:"rotate(180deg)"}}]}))),hc=eD.forwardRef(function(e,t){let n=(0,ud.b)({props:e,name:"MuiTableSortLabel"}),{active:i=!1,children:r,className:o,direction:a="asc",hideSortIcon:s=!1,IconComponent:l=hr,slots:u={},slotProps:c={},...h}=n,d={...n,active:i,direction:a,hideSortIcon:s,IconComponent:l},p=(e=>{let{classes:t,direction:n,active:i}=e,r={root:["root",i&&"active",`direction${(0,ho.A)(n)}`],icon:["icon",`iconDirection${(0,ho.A)(n)}`]};return(0,uu.A)(r,ha,t)})(d),f={slots:u,slotProps:c},[g,m]=(0,cN.A)("root",{elementType:hl,externalForwardedProps:f,ownerState:d,className:(0,ul.A)(p.root,o),ref:t}),[v,y]=(0,cN.A)("icon",{elementType:hu,externalForwardedProps:f,ownerState:d,className:p.icon});return(0,eb.jsxs)(g,{disableRipple:!0,component:"span",...m,...h,children:[r,s&&!i?null:(0,eb.jsx)(v,{as:l,...y})]})});var hh=n(6227);function hd({onSort:e,sortDirection:t,nextSortDirection:n,children:i,resizeConfig:r,...o}){let a=!!e,s=(0,eb.jsx)(hi.A,{noWrap:!0,variant:"inherit",component:"div",color:"inherit",children:i}),l=!!t;return(0,eb.jsxs)(c5,{...o,children:[a?(0,eb.jsx)(hc,{onClick:e,direction:l?t:n,active:l,sx:{verticalAlign:"unset",maxWidth:"100%","&:focus-visible":{[`& .${hs.icon}`]:{opacity:l?1:.5}}},children:s}):s,r&&(0,eb.jsx)(uo.A,{onMouseDown:e=>{2===e.detail?r.resetSizeHandler():r.resizeHandler(e)},onTouchStart:r.resizeHandler,sx:{position:"absolute",height:"100%",top:0,right:"4px",cursor:"col-resize"},children:(0,eb.jsx)(hh.A,{flexItem:!0,orientation:"vertical",sx:e=>({backgroundColor:r.isResizing?e.palette.action.active:e.palette.divider,borderRadius:"2px",borderWidth:"2px",height:"100%",touchAction:"none",transform:"translateX(4px)",userSelect:"none"})})})]})}let hp=(0,eD.forwardRef)(function(e,t){return(0,eb.jsx)(cy.A,{...e,ref:t,sx:{backgroundColor:e=>e.palette.background.default,"&:hover":{backgroundColor:e=>(0,uc.X4)(e.palette.primary.main,e.palette.action.hoverOpacity)}}})});var hf=n(2582),hg=n(65211),hm=n(30145),hv=n(7800),hy=n(98599),hx=n(16979),hb=n(9323),hw=n(12933),hS=n(46177);let h_=(0,eD.forwardRef)(function({debounceMs:e=250,value:t,onChange:n,...i},r){let[o,a]=(0,eD.useState)(t),s=(0,eD.useCallback)(e=>{n?.(e)},[n]),l=(0,eD.useMemo)(()=>hS(s,e),[e,s]);return(0,eb.jsx)(eA.A,{ref:r,value:o,onChange:function(e){a(e.target.value),l(e.target.value)},...i})});function hM({isSearchEnabled:e,globalFilter:t,onGlobalFilterChange:n,isColumnFilterEnabled:i,columns:r,width:o,columnFilterMenuMaxHeight:a=400,isExpandAllEnabled:s,isAllExpanded:l,onExpandAllChange:u}){let[c,h]=(0,eD.useState)(null),d=!!c,[p,f]=(0,eD.useState)(0),g=(0,eD.useCallback)(()=>{n(""),f(e=>e+1)},[n]);return e||i||s?(0,eb.jsxs)(eM.A,{direction:"row",gap:1,alignItems:"center",justifyContent:"flex-end",width:o,padding:"0.5rem",sx:{backgroundColor:e=>e.palette.background.default},children:[e&&(0,eb.jsx)(h_,{placeholder:"Search...",value:t,onChange:n,variant:"standard",slotProps:{htmlInput:{"aria-label":"search table"},input:{startAdornment:(0,eb.jsx)(hf.A,{position:"start",children:(0,eb.jsx)(hy,{fontSize:"small"})}),endAdornment:""!==t&&(0,eb.jsx)(hf.A,{position:"end",children:(0,eb.jsx)(eC.A,{onClick:g,children:(0,eb.jsx)(hv,{fontSize:"small"})})})}},sx:{flexGrow:1}},p),s&&(0,eb.jsx)(hg.A,{title:l?"Collapse all":"Expand all",children:(0,eb.jsx)(eC.A,{onClick:u,color:"info","aria-label":l?"collapse all rows":"expand all rows",children:l?(0,eb.jsx)(hx,{}):(0,eb.jsx)(hb,{})})}),i&&(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(eC.A,{onClick:e=>h(e.currentTarget),"aria-haspopup":"listbox","aria-expanded":d,color:"info",children:(0,eb.jsx)(hw,{})}),(0,eb.jsx)(hm.A,{anchorEl:c,open:d,onClose:()=>h(null),slotProps:{list:{dense:!0}},sx:{maxHeight:a},children:r.map(e=>{let t=e.columnDef.header,n="string"==typeof t?t:e.id;return(0,eb.jsxs)(cb.A,{disabled:!e.getCanHide(),onClick:e.getCanHide()?e.getToggleVisibilityHandler():void 0,dense:!0,children:[(0,eb.jsx)(cm.A,{checked:e.getIsVisible(),disabled:!e.getCanHide(),size:"small",disableRipple:!0,sx:{p:0,mr:1}}),(0,eb.jsx)(uM.A,{primary:n})]},e.id)})})]})]}):null}h_.displayName="TextField";var hC=n(347);let hA=(0,eD.forwardRef)(function(e,t){return(0,eb.jsx)(hC.A,{...e,tabIndex:-1,ref:t,sx:rv({flexGrow:1},e.sx)})});function hk({width:e,height:t,density:n,defaultColumnWidth:i,defaultColumnHeight:r,onRowClick:o,onRowMouseOver:a,onRowMouseOut:s,rows:l,columns:u,headers:c,columnSizing:h,columnSizingInfo:d,cellConfigs:p,pagination:f,onPaginationChange:g,rowCount:m,toolbarConfig:v}){let y=(0,eD.useRef)(null),x=(0,eD.useRef)({startIndex:0,endIndex:0}),b=function({visibleRange:e,virtualTable:t,maxRows:n,maxColumns:i}){return function({maxRows:e,maxColumns:t,onActiveCellChange:n}){let[i,r]=(0,eD.useState)(cq),[o,a]=(0,eD.useState)(!1);return{activeCell:i,isActive:o,onTableKeyDown:(0,eD.useCallback)(i=>{let o=i.key;(cY.includes(o)||"Home"===o||"End"===o||"PageDown"===o||"PageUp"===o)&&r(r=>{let a=r.row,s=r.column;"ArrowRight"===o&&s<t-1?(i.preventDefault(),s+=1):"ArrowLeft"===o&&s>0?(i.preventDefault(),s-=1):"ArrowDown"===o&&a<e-1?(i.preventDefault(),a+=1):"ArrowUp"===o&&a>0?(i.preventDefault(),a-=1):"Home"===o?(i.preventDefault(),a=0,s=0):"End"===o&&(i.preventDefault(),a=e-1,s=t-1);let l={column:s,row:a},u=n?.(i,r,l)||l;return u.row===r.row&&u.column===r.column?r:u})},[t,e,n]),onCellFocus:e=>{e.column===i.column&&e.row===i.row&&o||(a(!0),r(e))},onTableBlur:(0,eD.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||(a(!1),r(cq))},[])}}({maxRows:n,maxColumns:i,onActiveCellChange:(i,r,o)=>{let a=i.key,s=o&&(r.column!==o.column||r.row!==o.row),l=o?.row??r.row;if("ArrowDown"===a&&s)(l-1<e.current.startIndex||l-1>e.current.endIndex)&&t.current?.scrollToIndex({index:l-1,align:"end"});else if("ArrowUp"===a&&s)(l-1<e.current.startIndex||l-1>e.current.endIndex)&&t.current?.scrollToIndex({index:l-1,align:"start"});else if(s&&("Home"===a||"End"===a))t.current?.scrollToIndex({index:Math.max(l-1,0),align:"start"});else if("PageDown"===a){i.preventDefault();let o=r.row;return o=Math.min(n-1,e.current.endIndex+1),t.current?.scrollToIndex({index:o-1,align:"start"}),{row:o,column:r.column}}else if("PageUp"===a){let n=r.row;return n=Math.max(0,e.current.startIndex-1),t.current?.scrollToIndex({index:n-1,align:"end"}),{row:n,column:r.column}}return o}})}({visibleRange:x,virtualTable:y,maxRows:l.length+1,maxColumns:u.length}),w=e=>e.row===b.activeCell.row&&e.column===b.activeCell.column?b.isActive?"trigger-focus":"focus-next":"none",S=(0,eD.useMemo)(()=>({Scroller:hA,Table:t=>(0,eb.jsx)(cQ,{...t,width:e,density:n,onKeyDown:b.onTableKeyDown,onBlur:b.onTableBlur}),TableHead:hn,TableFoot:he,TableRow:({item:e,...t})=>{let i=l[t["data-index"]];if(!i)return null;let r={id:i.id,index:i.index};return(0,eb.jsx)(hp,{...t,onClick:e=>o(e,i.id),density:n,onMouseOver:e=>{a?.(e,r)},onMouseOut:e=>{s?.(e,r)}})},TableBody:c0}),[n,b.onTableKeyDown,b.onTableBlur,o,s,a,l,e]),_=(e,t)=>{f&&g&&g({...f,pageIndex:t})},M=e=>{f&&g&&g({pageIndex:0,pageSize:parseInt(e.target.value,10)})},C=(0,eD.useMemo)(()=>{let e={};return c.forEach(t=>{t.headers.filter(e=>e.column.getCanResize()).forEach(t=>{e[`--header-${t.id}-size`]=t.getSize(),e[`--col-${t.column.id}-size`]=t.column.getSize()})}),e},[d,h,c]);return(0,eb.jsxs)(uo.A,{style:{width:e,height:t,...C},children:[(0,eb.jsx)(hM,{...v,width:e}),(0,eb.jsx)(uD.Sd,{ref:y,totalCount:l.length,components:S,rangeChanged:e=>{x.current=e},fixedHeaderContent:()=>(0,eb.jsx)(eb.Fragment,{children:c.map(e=>(0,eb.jsx)(hp,{density:n,children:e.headers.map((e,t,o)=>{var a,s,l,u,c;let h,d=e.column,p={row:0,column:t},f=d.getIsSorted(),g=d.getNextSortingOrder();return(0,eb.jsx)(hd,{onSort:d.getCanSort()?d.getToggleSortingHandler():void 0,sortDirection:"string"==typeof f?f:void 0,nextSortDirection:"string"==typeof g?g:void 0,width:e.column.getCanResize()?`calc(var(--header-${e?.id}-size) * 1px)`:d.getSize()||i,defaultColumnHeight:r,align:d.columnDef.meta?.align,variant:"head",density:n,description:d.columnDef.meta?.headerDescription,focusState:w(p),onFocusTrigger:()=>b.onCellFocus(p),isFirstColumn:0===t,isLastColumn:t===o.length-1,resizeConfig:e.column.getCanResize()?{resizeHandler:e.getResizeHandler(),resetSizeHandler:e.column.resetSize,isResizing:e.column.getIsResizing()}:void 0,children:(a=d.columnDef.header,s=e.getContext(),a?"function"==typeof(u=l=a)&&(h=Object.getPrototypeOf(u)).prototype&&h.prototype.isReactComponent||"function"==typeof l||"object"==typeof(c=l)&&"symbol"==typeof c.$$typeof&&["react.memo","react.forward_ref"].includes(c.$$typeof.description)?eD.createElement(a,s):a:null)},e.id)})},e.id))}),fixedFooterContent:f?()=>(0,eb.jsx)(cy.A,{sx:{backgroundColor:e=>e.palette.background.default},children:(0,eb.jsx)(cU,{colSpan:u.length,count:m,page:f.pageIndex,rowsPerPage:f.pageSize,onPageChange:_,onRowsPerPageChange:M})}):void 0,itemContent:e=>{let t=l[e];return t?(0,eb.jsx)(eb.Fragment,{children:t.getVisibleCells().map((o,a,s)=>{let l,u={row:e+1,column:a},c=o.getContext(),h=p?.[c.cell.id],d=o.column.columnDef.cell,f="function"==typeof d?d(c):null,g=o.column.columnDef.meta?.cellDescription;"function"==typeof g?l=g(c):g&&"string"==typeof f&&(l=f);let m=Object.entries(t.original)?.filter(([e,t])=>["string","number"].includes(typeof t)).reduce((e,[t,n])=>({...e,[t]:String(n)}),{});return(0,eb.jsx)(c5,{"data-testid":o.id,title:l||h?.text||f,width:o.column.getCanResize()?`calc(var(--col-${o.column.id}-size) * 1px)`:o.column.getSize()||i,defaultColumnHeight:r,align:o.column.columnDef.meta?.align,density:n,focusState:w(u),onFocusTrigger:()=>b.onCellFocus(u),isFirstColumn:0===a,isLastColumn:a===s.length-1,description:l,color:h?.textColor??void 0,backgroundColor:h?.backgroundColor??void 0,dataLink:o.column.columnDef.meta?.dataLink,adjacentCellsValuesMap:m,children:h?.text||f},o.id)})}):null}})]})}let hT=(e,t)=>`${t}`,hD={},hI=[];function hO({data:e,columns:t,cellConfigs:n,density:i="standard",defaultColumnWidth:r=150,defaultColumnHeight:o="auto",checkboxSelection:a,onRowSelectionChange:s,onSortingChange:l,getCheckboxColor:u,getRowId:c=hT,rowSelection:h=hD,sorting:d=hI,getItemActions:p,hasItemActions:f,pagination:g,onPaginationChange:m,rowSelectionVariant:v="standard",getSubRows:y,hiddenColumns:x,tableToolbarConfig:b,columnResizeMode:w="onChange",defaultColumnConfig:S,..._}){let M=(0,ur.A)(),C=!!y,[A,k]=(0,eD.useState)({}),{globalFilter:T,setGlobalFilter:D,fuzzySearchOptions:I}=function(e,t,n,i){let[r,o]=(0,eD.useState)(""),[a,s]=(0,eD.useState)(n),l=(0,eD.useCallback)(e=>{o(t=>(t?t&&!e&&i(a):(s(n),i(!0)),e))},[n,a,i]);return{globalFilter:r,setGlobalFilter:l,fuzzySearchOptions:{filterFns:{fuzzy:(e,n,i,r)=>{let o=function(e,t,n){var i;if((n=n||{}).threshold=null!=(i=n.threshold)?i:cc.MATCHES,!n.accessors){let i=ch(e,t,n);return{rankedValue:e,rank:i,accessorIndex:-1,accessorThreshold:n.threshold,passed:i>=n.threshold}}let r=function(e,t){let n=[];for(let i=0,r=t.length;i<r;i++){let r=t[i],o="function"==typeof r?cp:{...cp,...r},a=function(e,t){let n=t;"object"==typeof t&&(n=t.accessor);let i=n(e);return null==i?[]:Array.isArray(i)?i:[String(i)]}(e,r);for(let e=0,t=a.length;e<t;e++)n.push({itemValue:a[e],attributes:o})}return n}(e,n.accessors),o={rankedValue:e,rank:cc.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let e=0;e<r.length;e++){let i=r[e],a=ch(i.itemValue,t,n),{minRanking:s,maxRanking:l,threshold:u=n.threshold}=i.attributes;a<s&&a>=cc.MATCHES?a=s:a>l&&(a=l),(a=Math.min(a,l))>=u&&a>o.rank&&(o.rank=a,o.passed=!0,o.accessorIndex=e,o.accessorThreshold=u,o.rankedValue=i.itemValue)}return o}(e.getValue(n),i,{threshold:cc[t]});return r({itemRank:o}),o.passed}},globalFilterFn:e?"fuzzy":void 0,getFilteredRowModel:e?e=>uR(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,i)=>{var r,o,a,s,l,u,c,h,d,p;let f,g,m,v,y,x,b,w,S,_;if(!t.rows.length||!(null!=n&&n.length)&&!i){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}let M=[],C=[];(null!=n?n:[]).forEach(t=>{var n;let i=e.getColumn(t.id);if(!i)return;let r=i.getFilterFn();r&&M.push({id:t.id,filterFn:r,resolvedValue:null!=(n=null==r.resolveFilterValue?void 0:r.resolveFilterValue(t.value))?n:t.value})});let A=(null!=n?n:[]).map(e=>e.id),k=e.getGlobalFilterFn(),T=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());i&&k&&T.length&&(A.push("__global__"),T.forEach(e=>{var t;C.push({id:e.id,filterFn:k,resolvedValue:null!=(t=null==k.resolveFilterValue?void 0:k.resolveFilterValue(i))?t:i})}));for(let e=0;e<t.flatRows.length;e++){let n=t.flatRows[e];if(n.columnFilters={},M.length)for(let e=0;e<M.length;e++){let t=(f=M[e]).id;n.columnFilters[t]=f.filterFn(n,t,f.resolvedValue,e=>{n.columnFiltersMeta[t]=e})}if(C.length){for(let e=0;e<C.length;e++){let t=(g=C[e]).id;if(g.filterFn(n,t,g.resolvedValue,e=>{n.columnFiltersMeta[t]=e})){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return r=t.rows,o=e=>{for(let t=0;t<A.length;t++)if(!1===e.columnFilters[A[t]])return!1;return!0},e.options.filterFromLeafRows?(a=r,s=o,m=[],v={},y=null!=(u=(l=e).options.maxLeafRowFilterDepth)?u:100,{rows:(x=function(e,t){void 0===t&&(t=0);let n=[];for(let r=0;r<e.length;r++){var i;let o=e[r],a=uz(l,o.id,o.original,o.index,o.depth,void 0,o.parentId);if(a.columnFilters=o.columnFilters,null!=(i=o.subRows)&&i.length&&t<y){if(a.subRows=x(o.subRows,t+1),s(o=a)&&!a.subRows.length||s(o)||a.subRows.length){n.push(o),v[o.id]=o,m.push(o);continue}}else s(o=a)&&(n.push(o),v[o.id]=o,m.push(o))}return n})(a),flatRows:m,rowsById:v}):(c=r,h=o,b=[],w={},S=null!=(p=(d=e).options.maxLeafRowFilterDepth)?p:100,{rows:(_=function(e,t){void 0===t&&(t=0);let n=[];for(let r=0;r<e.length;r++){let o=e[r];if(h(o)){var i;if(null!=(i=o.subRows)&&i.length&&t<S){let e=uz(d,o.id,o.original,o.index,o.depth,void 0,o.parentId);e.subRows=_(o.subRows,t+1),o=e}n.push(o),b.push(o),w[o.id]=o}}return n})(c),flatRows:b,rowsById:w})},uL(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex())):void 0,filterFromLeafRows:e,onGlobalFilterChange:l}}}(b?.isSearchEnabled,b?.fuzzyMatchThreshold??"CONTAINS",A,k),[O,P]=(0,eD.useState)(x?.reduce((e,t)=>({...e,[t]:!1}),{})??{}),E=(0,eD.useCallback)((e,t,n)=>{"standard"===v||n?t.toggleSelected():t.getIsSelected()&&!e.getIsAllRowsSelected()?e.toggleAllRowsSelected():s?.({[t.id]:!0})},[s,v]),R=(0,eD.useCallback)((e,t,n)=>{let i=e.nativeEvent&&(e.nativeEvent instanceof MouseEvent||e.nativeEvent instanceof KeyboardEvent)?e.nativeEvent:void 0;E(t,n,!!i?.metaKey||!!i?.shiftKey)},[E]),L=(0,eD.useMemo)(()=>({id:"itemActions",header:"Actions",cell:({row:e})=>(0,eb.jsx)(eM.A,{direction:"row",alignItems:"center",children:p?.({id:e.id,data:e.original})}),enableSorting:!1,enableResizing:!1}),[p]),N=(0,eD.useMemo)(()=>({id:"checkboxRowSelect",size:28,header:({table:e})=>(0,eb.jsx)(cv,{checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler(),color:M.palette.text.primary,density:i}),cell:({row:e,table:t})=>(0,eb.jsx)(cv,{checked:e.getIsSelected(),indeterminate:e.getIsSomeSelected(),onChange:n=>{R(n,t,e)},color:u?.(e.original),density:i}),enableSorting:!1,enableResizing:!1}),[M.palette.text.primary,i,u,R]),B=function(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=eD.useState(()=>({current:function(e){var t,n;let i=[...ca,...null!=(t=e._features)?t:[]],r={_features:i},o=r._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(r)),{}),a={...null!=(n=e.initialState)?n:{}};r._features.forEach(e=>{var t;a=null!=(t=null==e.getInitialState?void 0:e.getInitialState(a))?t:a});let s=[],l=!1,u={_features:i,options:{...o,...e},initialState:a,_queue:e=>{s.push(e),l||(l=!0,Promise.resolve().then(()=>{for(;s.length;)s.shift()();l=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{r.setState(r.initialState)},setOptions:e=>{var t;t=uO(e,r.options),r.options=r.options.mergeOptions?r.options.mergeOptions(o,t):{...o,...t}},getState:()=>r.options.state,setState:e=>{null==r.options.onStateChange||r.options.onStateChange(e)},_getRowId:(e,t,n)=>{var i;return null!=(i=null==r.options.getRowId?void 0:r.options.getRowId(e,t,n))?i:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?r.getPrePaginationRowModel():r.getRowModel()).rowsById[e];if(!n&&!(n=r.getCoreRowModel().rowsById[e]))throw Error();return n},_getDefaultColumnDef:uR(()=>[r.options.defaultColumn],e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...r._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},uL(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:uR(()=>[r._getColumnDefs()],e=>{let t=function(e,n,i){return void 0===i&&(i=0),e.map(e=>{let o=function(e,t,n,i){var r,o;let a,s={...e._getDefaultColumnDef(),...t},l=s.accessorKey,u=null!=(r=null!=(o=s.id)?o:l?"function"==typeof String.prototype.replaceAll?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)?r:"string"==typeof s.header?s.header:void 0;if(s.accessorFn?a=s.accessorFn:l&&(a=l.includes(".")?e=>{let t=e;for(let e of l.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[s.accessorKey]),!u)throw Error();let c={id:`${String(u)}`,accessorFn:a,parent:i,depth:n,columnDef:s,columns:[],getFlatColumns:uR(()=>[!0],()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},uL(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:uR(()=>[e._getOrderColumnsFn()],e=>{var t;return null!=(t=c.columns)&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},uL(e.options,"debugColumns","column.getLeafColumns"))};for(let t of e._features)null==t.createColumn||t.createColumn(c,e);return c}(r,e,i,n);return o.columns=e.columns?t(e.columns,o,i+1):[],o})};return t(e)},uL(e,"debugColumns","getAllColumns")),getAllFlatColumns:uR(()=>[r.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),uL(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:uR(()=>[r.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),uL(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:uR(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),uL(e,"debugColumns","getAllLeafColumns")),getColumn:e=>r._getAllFlatColumnsById()[e]};Object.assign(r,u);for(let e=0;e<r._features.length;e++){let t=r._features[e];null==t||null==t.createTable||t.createTable(r)}return r}(t)})),[i,r]=eD.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...i,...e.state},onStateChange:t=>{r(t),null==e.onStateChange||e.onStateChange(t)}})),n.current}({data:e,columns:(0,eD.useMemo)(()=>{let e=cg(t,S);return f&&e.unshift(L),a&&e.unshift(N),e},[t,S,f,a,L,N]),getRowId:c,getCoreRowModel:e=>uR(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},i=function(t,r,o){void 0===r&&(r=0);let a=[];for(let l=0;l<t.length;l++){let u=uz(e,e._getRowId(t[l],l,o),t[l],l,r,void 0,null==o?void 0:o.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var s;u.originalSubRows=e.options.getSubRows(t[l],l),null!=(s=u.originalSubRows)&&s.length&&(u.subRows=i(u.originalSubRows,r+1,u))}}return a};return n.rows=i(t),n},uL(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex())),getSortedRowModel:e=>uR(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(null!=t&&t.length))return n;let i=e.getState().sorting,r=[],o=i.filter(t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()}),a={};o.forEach(t=>{let n=e.getColumn(t.id);n&&(a[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});let s=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let i=0;i<o.length;i+=1){var n;let r=o[i],s=a[r.id],l=s.sortUndefined,u=null!=(n=null==r?void 0:r.desc)&&n,c=0;if(l){let n=e.getValue(r.id),i=t.getValue(r.id),o=void 0===n,a=void 0===i;if(o||a){if("first"===l)return o?-1:1;if("last"===l)return o?1:-1;c=o&&a?0:o?l:-l}}if(0===c&&(c=s.sortingFn(e,t,r.id)),0!==c)return u&&(c*=-1),s.invertSorting&&(c*=-1),c}return e.index-t.index}),t.forEach(e=>{var t;r.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))}),t};return{rows:s(n.rows),flatRows:r,rowsById:n.rowsById}},uL(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex())),getPaginationRowModel:g?e=>uR(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{let i;if(!n.rows.length)return n;let{pageSize:r,pageIndex:o}=t,{rows:a,flatRows:s,rowsById:l}=n,u=r*o;a=a.slice(u,u+r),(i=e.options.paginateExpandedRows?{rows:a,flatRows:s,rowsById:l}:cs({rows:a,flatRows:s,rowsById:l})).flatRows=[];let c=e=>{i.flatRows.push(e),e.subRows.length&&e.subRows.forEach(c)};return i.rows.forEach(c),i},uL(e.options,"debugTable","getPaginationRowModel")):void 0,manualPagination:!g,enableRowSelection:!!a,onRowSelectionChange:e=>{let t="function"==typeof e?e(h):e;s?.(t)},onSortingChange:e=>{let t="function"==typeof e?e(d):e;l?.(t)},onColumnVisibilityChange:P,getSubRows:y,getExpandedRowModel:C?e=>uR(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(e,t,n)=>t.rows.length&&(!0===e||Object.keys(null!=e?e:{}).length)&&n?cs(t):t,uL(e.options,"debugTable","getExpandedRowModel")):void 0,...I,sortDescFirst:!0,columnResizeMode:w,onExpandedChange:k,state:{rowSelection:h,sorting:d,globalFilter:b?.isSearchEnabled?T:void 0,columnVisibility:O,...g?{pagination:g}:{},expanded:A}}),F=(0,eD.useCallback)((e,t)=>{let n=B.getRow(t);E(B,n,e.metaKey||e.shiftKey)},[E,B]);return(0,eb.jsx)(hk,{..._,density:i,defaultColumnWidth:r,defaultColumnHeight:o,onRowClick:F,rows:B.getRowModel().rows,columns:B.getVisibleFlatColumns(),columnSizing:B.getState().columnSizing,columnSizingInfo:B.getState().columnSizingInfo,headers:B.getHeaderGroups(),cellConfigs:n,pagination:g,onPaginationChange:m,rowCount:B.getRowCount(),toolbarConfig:{isSearchEnabled:b?.isSearchEnabled,globalFilter:T,onGlobalFilterChange:D,isColumnFilterEnabled:b?.isColumnFilterEnabled,columns:B.getAllColumns(),columnFilterMenuMaxHeight:b?.columnFilterMenuMaxHeight,isExpandAllEnabled:C,isAllExpanded:B.getIsAllRowsExpanded(),onExpandAllChange:B.getToggleAllRowsExpandedHandler()}})}let hP=[{accessorKey:"label",header:"Name",enableSorting:!0,enableResizing:!0,cell:({getValue:e})=>(0,eb.jsx)("span",{title:e(),children:e()})}],hE=e=>e.id,hR=e=>e.color;function hL({items:e,selectedItems:t,onSelectedItemsChange:n,onItemMouseOver:i,onItemMouseOut:r,height:o,width:a,columns:s=[],sorting:l,onSortingChange:u}){let c=(0,eD.useMemo)(()=>"string"!=typeof t?t:e.reduce((e,t,n)=>(e[hE(t,n)]=!0,e),{}),[t,e]),h=(0,eD.useMemo)(()=>{let e=Math.max(a-(s?.reduce((e,t)=>e+("number"==typeof t.width?t.width:150),0)??0)-45,60*hP.length)/hP.length;return[...hP.map(t=>({...t,width:e})),...s]},[s,a]);return(0,eb.jsx)(hO,{height:o,width:a,rowSelection:c,onRowSelectionChange:n,onRowMouseOver:i,onRowMouseOut:r,sorting:l,onSortingChange:u,data:e,columns:h,density:"compact",defaultColumnWidth:"auto",getRowId:hE,getCheckboxColor:hR,checkboxSelection:!0,rowSelectionVariant:"legend"})}function hN({width:e,height:t,options:n,data:i,selectedItems:r,onSelectedItemsChange:o,onItemMouseOver:a,onItemMouseOut:s,tableProps:l}){let u,c=(e,t)=>{let n=e.metaKey||e.shiftKey;o((0,ua.jM)(r,e=>{if("ALL"===e)return{[t]:!0};let i=!!e[t];return n?(i?delete e[t]:e[t]=!0,e):i?"ALL":{[t]:!0}}))},h=nj(n.mode),d=i.length>=500,p={height:t,items:i,selectedItems:r,onLegendItemClick:c,onItemMouseOver:a,onItemMouseOut:s};return(u="table"===h?(0,eb.jsx)(hL,{...p,onSelectedItemsChange:o,width:e,...l}):"right"===n.position||d?(0,eb.jsx)(uI,{...p,width:e,onLegendItemClick:c}):(0,eb.jsx)(uT,{...p,onLegendItemClick:c}),"right"===n.position)?(0,eb.jsx)(uo.A,{style:{width:e,height:t},sx:{position:"absolute",top:0,right:0,backgroundColor:e=>`${e.palette.background.default}`},children:u}):(0,eb.jsx)(uo.A,{style:{width:e,height:t},sx:{position:"absolute",bottom:0,backgroundColor:e=>`${e.palette.background.default}`},children:u})}let hB={medium:{bottom:6,right:250},small:{bottom:4,right:150}};function hF({children:e,legendProps:t,width:n,height:i,spacing:r=0,legendSize:o,minChildrenWidth:a=100,minChildrenHeight:s=100}){let{content:l,legend:u,margin:c}=function({width:e,height:t,legendProps:n,legendSize:i,minChildrenHeight:r,minChildrenWidth:o,spacing:a,theme:s}){let l,u,c=n?.options,h={legend:{show:!1,width:0,height:0},content:{width:e,height:t},margin:{right:0,bottom:0}};if(!c)return h;let{position:d}=c;if("list"===nj(c.mode))l="right"===d?200:e,u=40,"right"===d?u=t:t>=300&&(u=100);else{let r=cf(s,"compact"),o=(n?.tableProps?.columns||[]).reduce((e,t)=>("number"==typeof t.width&&(e+=t.width),e),0);l="right"===d?hB[i].right+o:e;let a=Math.min(hB[i].bottom,n.data.length+1);u="bottom"===d?a*r.height:t}let p="right"===d?e-l-a:e,f="bottom"===d?t-u-a:t;return"right"===d&&p<o||"bottom"===d&&f<r?h:{legend:{width:l,height:u,show:!0},content:{width:p,height:f},margin:{right:"right"===d?a:0,bottom:"bottom"===d?a:0}}}({width:n,height:i,legendProps:t,minChildrenHeight:s,minChildrenWidth:a,spacing:r,theme:(0,ur.A)(),legendSize:nH(o)});return(0,eb.jsxs)(uo.A,{style:{width:n,height:i},sx:{position:"relative",overflow:"hidden"},children:[(0,eb.jsx)(uo.A,{style:{width:l.width,height:l.height},sx:{marginRight:`${c.right}px`,marginBottom:`${c.bottom}px`},children:"function"==typeof e?e({width:l.width,height:l.height}):e}),t&&u.show&&(0,eb.jsx)(hN,{...t,height:u.height,width:u.width})]})}var hz=n(91467),hV=n(66834),hj=n(92890),hH=n(39750);let hW=(0,e7.A)("form")({overflowY:"auto",display:"flex",flexDirection:"column"}),hG=e=>({position:"absolute",top:e.spacing(.5),right:e.spacing(.5)}),h$=({children:e,...t})=>(0,eb.jsx)(hj.A,{...t,children:e});h$.Header=({children:e,onClose:t,...n})=>(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(hz.A,{style:{textOverflow:"ellipsis",overflow:"hidden"},...n,children:e}),t&&(0,eb.jsx)(eC.A,{"aria-label":"Close",onClick:t,sx:hG,children:(0,eb.jsx)(hv,{})})]}),h$.Form=hW,h$.Content=({children:e,sx:t,...n})=>(0,eb.jsx)(hV.A,{dividers:!0,...n,sx:rv({minWidth:"500px",textWrap:"balance"},t),children:e}),h$.PrimaryButton=({children:e,...t})=>(0,eb.jsx)(eS.A,{variant:"contained",type:"submit",...t,children:e}),h$.SecondaryButton=({children:e,...t})=>(0,eb.jsx)(eS.A,{variant:"outlined",color:"secondary",...t,children:e}),h$.Actions=hH.A;let hU=e=>{let{description:t,isOpen:n,onCancel:i,onDiscardChanges:r}=e;return(0,eb.jsxs)(h$,{open:n,"aria-labelledby":"discard-dialog",children:[(0,eb.jsx)(h$.Header,{children:"Discard Changes"}),(0,eb.jsx)(h$.Content,{children:t}),(0,eb.jsxs)(h$.Actions,{children:[(0,eb.jsx)(eS.A,{variant:"contained",onClick:r,children:"Discard Changes"}),(0,eb.jsx)(eS.A,{variant:"outlined",color:"secondary",onClick:i,children:"Cancel"})]})]})};var hq=n(66395);let hY=({children:e})=>(0,eb.jsx)(hq.Ay,{item:!0,xs:4,children:(0,eb.jsx)(eM.A,{spacing:3,children:e})});var hZ=n(67987),hX=n(9799),hK=n(17366),hQ=n(32751);let hJ=({id:e,title:t,description:n,placement:i,children:r,enterDelay:o,enterNextDelay:a})=>{let s=(0,eb.jsx)("span",{children:r});return(0,eb.jsx)(h1,{arrow:!0,id:e,placement:i??"top",title:(0,eb.jsx)(h0,{title:t,description:n}),enterDelay:o??500,enterNextDelay:a??500,children:s})},h0=({title:e,description:t})=>(0,eb.jsxs)(eb.Fragment,{children:[e&&(0,eb.jsx)(hi.A,{variant:"body2",sx:e=>({color:e.palette.text.primary,fontWeight:e.typography.fontWeightMedium}),children:e}),(0,eb.jsx)(hi.A,{variant:"caption",sx:e=>({color:e.palette.text.primary,whiteSpace:"pre-line"}),children:t})]}),h1=(0,e7.A)(({className:e,...t})=>(0,eb.jsx)(hg.A,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${hQ.A.tooltip}`]:{backgroundColor:e.palette.background.tooltip,color:e.palette.text.primary,maxWidth:"300px",padding:e.spacing(1),boxShadow:e.shadows[1]},[`& .${hQ.A.arrow}`]:{color:e.palette.background.tooltip}})),h2=({label:e,control:t,description:n})=>{let i=ry("EditorSectionControl"),r=`${i}-control`,o=`${i}-label`;return(0,eb.jsx)(hZ.A,{children:(0,eb.jsxs)(eM.A,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,eb.jsxs)(eM.A,{direction:"row",alignItems:"center",justifyContent:"center",children:[(0,eb.jsx)(hX.A,{id:o,htmlFor:r,children:e}),n&&(0,eb.jsx)(hJ,{description:n,enterDelay:100,children:(0,eb.jsx)(eC.A,{size:"small",sx:e=>({borderRadius:e.shape.borderRadius,padding:"4x",margin:"0 2px"}),children:(0,eb.jsx)(hK,{"aria-describedby":"info-tooltip","aria-hidden":!1,fontSize:"inherit",sx:{color:e=>e.palette.grey[700]}})})})]}),(0,eb.jsxs)(uo.A,{sx:{width:"180px",textAlign:"right"},children:[" ",eI().cloneElement(t,{id:r,"aria-labelledby":o})]})]})})},h5=({children:e})=>(0,eb.jsx)(hq.Ay,{container:!0,spacing:8,children:e}),h3=({title:e,children:t,icon:n})=>(0,eb.jsxs)(uo.A,{children:[(0,eb.jsxs)(uo.A,{display:"flex",borderBottom:1,borderColor:"grey.300",marginBottom:e=>e.spacing(1),children:[(0,eb.jsx)(hi.A,{variant:"overline",component:"h4",children:e}),n&&(0,eb.jsx)(uo.A,{sx:{marginLeft:"auto"},children:n})]}),(0,eb.jsx)(eM.A,{spacing:1,children:t})]});var h4=n(31271),h6=n(81227);function h8({options:e,renderInput:t=e=>(0,eb.jsx)(eA.A,{...e}),id:n,"aria-labelledby":i,...r}){let o=e=>e.label??e.id;return(0,eb.jsx)(h4.A,{isOptionEqualToValue:(e,t)=>e.id===t.id,getOptionDisabled:e=>!!e.disabled,getOptionLabel:o,options:e,renderInput:e=>t({...e,inputProps:{...e.inputProps,id:n,"aria-labelledby":i}}),renderOption:({key:e,...t},n)=>(0,eb.jsx)("li",{...t,children:(0,eb.jsxs)("div",{children:[(0,eb.jsx)(hi.A,{variant:"body1",component:"div",children:o(n)}),n.description&&(0,eb.jsx)(hi.A,{variant:"body2",component:"div",sx:{color:e=>e.palette.text.secondary},children:n.description})]})},e),filterOptions:(0,h6.Z)({stringify:e=>`${o(e)} ${e.description||""}`}),...r})}let h9=[{id:"compact",label:"Compact"},{id:"standard",label:"Standard"},{id:"comfortable",label:"Comfortable"}];function h7({onChange:e,value:t="standard"}){return(0,eb.jsx)(h2,{label:"Density",control:(0,eb.jsx)(h8,{value:h9.find(e=>e.id===t),options:h9,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function de(){return(0,eb.jsxs)(eM.A,{direction:"row",alignItems:"center",children:[(0,eb.jsx)(uo.A,{sx:{content:'""',width:8,height:8,boxSizing:"border-box",position:"absolute",backgroundColor:e=>e.palette.background.default,border:e=>`2px solid ${e.palette.info.main}`,borderRadius:"50%"}}),(0,eb.jsx)(uo.A,{sx:{content:'""',height:2,background:e=>e.palette.info.main,width:"100%"}})]})}function dt(e){return(dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dn(e,t,n){var i;return(i=function(e,t){if("object"!=dt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=dt(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==dt(i)?i:i+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function di(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function dr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?di(Object(n),!0).forEach(function(t){dn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):di(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var da={top:function(e,t){return Math.abs(t.y-e.top)},right:function(e,t){return Math.abs(e.right-t.x)},bottom:function(e,t){return Math.abs(e.bottom-t.y)},left:function(e,t){return Math.abs(t.x-e.left)}},ds=Symbol("closestEdge");function dl(e){var t;return null!=(t=e[ds])?t:null}function du(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function dc(e,t){if(e){if("string"==typeof e)return du(e,t);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?du(e,t):void 0}}function dh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return s}}(e,t)||dc(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dd(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){t.forEach(function(e){return e()})}}var dp=n(96907),df="data-pdnd-honey-pot";function dg(e){return e instanceof Element&&e.hasAttribute(df)}function dm(e){var t=dh(document.elementsFromPoint(e.x,e.y),2),n=t[0],i=t[1];return n?dg(n)?null!=i?i:null:n:null}var dv={inset:"unset",border:"none",padding:0,margin:0,overflow:"visible",color:"inherit",background:"transparent"};function dy(e){var t=null;return function(){if(!t){for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];t={result:e.apply(this,i)}}return t.result}}var dx=dy(function(){return"u">typeof HTMLElement&&"function"==typeof HTMLElement.prototype.showPopover});function db(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function dw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?db(Object(n),!0).forEach(function(t){dn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):db(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dS(e){var t,n,i,r,o={x:Math.min((r={x:Math.max((i={x:(n={x:Math.floor((t=e.client).x),y:Math.floor(t.y)}).x-1,y:n.y-1}).x,0),y:Math.max(i.y,0)}).x,window.innerWidth-2),y:Math.min(r.y,window.innerHeight-2)};return DOMRect.fromRect({x:o.x,y:o.y,width:2,height:2})}function d_(e){var t=e.clientRect;return{left:"".concat(t.left,"px"),top:"".concat(t.top,"px"),width:"".concat(t.width,"px"),height:"".concat(t.height,"px")}}function dM(e){return function(e){if(Array.isArray(e))return du(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||dc(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var dC=dy(function(){return navigator.userAgent.includes("Firefox")}),dA=dy(function(){var e=navigator.userAgent;return e.includes("AppleWebKit")&&!e.includes("Chrome")}),dk={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};if(!("u"<typeof window)&&dA()){var dT=dD();(0,dp.bindAll)(window,[{type:"dragstart",listener:function(){dT.enterCount=0,dT.isOverWindow=!0}},{type:"drop",listener:dI},{type:"dragend",listener:dI},{type:"dragenter",listener:function(e){dT.isOverWindow||0!==dT.enterCount||(e[dk.isEnteringWindow]=!0),dT.isOverWindow=!0,dT.enterCount++}},{type:"dragleave",listener:function(e){dT.enterCount--,dT.isOverWindow&&0===dT.enterCount&&(e[dk.isLeavingWindow]=!0,dT.isOverWindow=!1)}}],{capture:!0})}function dD(){return{enterCount:0,isOverWindow:!1}}function dI(){dT=dD()}function dO(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var dP=(p=function(e){return e()},f=[],g=null,(m=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];f=t,g||(g=requestAnimationFrame(function(){g=null,p.apply(void 0,f)}))}).cancel=function(){g&&(cancelAnimationFrame(g),g=null)},m),dE=(v=null,{schedule:function(e){v={frameId:requestAnimationFrame(function(){v=null,e()}),fn:e}},flush:function(){v&&(cancelAnimationFrame(v.frameId),v.fn(),v=null)}}),dR={isActive:!1};function dL(){return!dR.isActive}function dN(e){var t,n=e.event,i=null==(t=e.current[0])?void 0:t.dropEffect;null!=i&&n.dataTransfer&&(n.dataTransfer.dropEffect=i)}var dB=function(e){var t=e.event,n=e.dragType,i=e.getDropTargetsOver,r=e.dispatchEvent;if(dL()){var o,a,s=function(e){var t=e.event,n=e.dragType,i=e.getDropTargetsOver,r=dO(t);if("external"===n.startedFrom)return{input:r,dropTargets:[]};var o=i({input:r,source:n.payload,target:t.target,current:[]});return{input:r,dropTargets:o}}({event:t,dragType:n,getDropTargetsOver:i});dR.isActive=!0;var l={current:s};dN({event:t,current:s.dropTargets});var u=function(e){var t=e.source,n=e.initial,i=e.dispatchEvent,r={dropTargets:[]};function o(e){i(e),r={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var i=e.nativeSetDragImage,a={current:n,previous:r,initial:n};o({eventName:"onGenerateDragPreview",payload:{source:t,location:a,nativeSetDragImage:i}}),dE.schedule(function(){o({eventName:"onDragStart",payload:{source:t,location:a}})})},dragUpdate:function(e){var i=e.current;dE.flush(),dP.cancel(),o({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:r,current:i}}})},drag:function(e){var i=e.current;dP(function(){dE.flush(),o({eventName:"onDrag",payload:{source:t,location:{initial:n,previous:r,current:i}}})})},drop:function(e){var i=e.current,a=e.updatedSourcePayload;dE.flush(),dP.cancel(),o({eventName:"onDrop",payload:{source:null!=a?a:t,location:{current:i,previous:r,initial:n}}})}}}({source:n.payload,dispatchEvent:r,initial:s}),c=(0,dp.bindAll)(window,[{type:"dragover",listener:function(e){d(e),u.drag({current:l.current})}},{type:"dragenter",listener:d},{type:"dragleave",listener:function(e){(function(e){var t=e.dragLeave,n=t.type,i=t.relatedTarget;return"dragleave"===n&&(dA()?!!dA()&&t.hasOwnProperty(dk.isLeavingWindow):null==i||(dC()?"nodeName"in i&&i.ownerDocument!==document:i instanceof HTMLIFrameElement))})({dragLeave:e})&&(h({input:l.current.input,dropTargets:[]}),"external"===n.startedFrom&&p())}},{type:"drop",listener:function(e){(l.current={dropTargets:l.current.dropTargets,input:dO(e)},l.current.dropTargets.length)?(e.preventDefault(),dN({event:e,current:l.current.dropTargets}),u.drop({current:l.current,updatedSourcePayload:"external"===n.type?n.getDropPayload(e):null}),f()):p()}},{type:"dragend",listener:function(e){l.current={dropTargets:l.current.dropTargets,input:dO(e)},p()}}].concat(dM([{type:"pointermove",listener:(a=0,function(){a<20?a++:o()})},{type:"pointerdown",listener:o=p}])),{capture:!0});u.start({nativeSetDragImage:t.dataTransfer?t.dataTransfer.setDragImage.bind(t.dataTransfer):null})}function h(e){var t=function(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var i=0;i<t.length;i++)if(t[i].element!==n[i].element)return!0;return!1}({current:l.current.dropTargets,next:e.dropTargets});l.current=e,t&&u.dragUpdate({current:l.current})}function d(e){var t=dO(e),r=i({target:dg(e.target)?dm({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:l.current.dropTargets});r.length&&(e.preventDefault(),dN({event:e,current:r})),h({dropTargets:r,input:t})}function p(){l.current.dropTargets.length&&h({dropTargets:[],input:l.current.input}),u.drop({current:l.current,updatedSourcePayload:null}),f()}function f(){dR.isActive=!1,c()}},dF=new Map;function dz(e,t){var n=t.attribute,i=t.value;return e.setAttribute(n,i),function(){return e.removeAttribute(n)}}function dV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function dj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dV(Object(n),!0).forEach(function(t){dn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dH(e,t){var n="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e){if(e){if("string"==typeof e)return dW(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?dW(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function dW(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function dG(e){return e.slice(0).reverse()}function d$(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function dU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}var dq=dy(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),dY="text/plain",dZ=new WeakMap,dX=(y=null,{bindEvents:function(){return y=null,(0,dp.bind)(window,{type:"pointermove",listener:function(e){y={x:e.clientX,y:e.clientY}},options:{capture:!0}})},getOnPostDispatch:function(){var e=null;return function(t){var n=t.eventName,i=t.payload;if("onDragStart"===n){var r,o,a,s=i.location.initial.input,l=null!=y?y:{x:s.clientX,y:s.clientY};(r=document.createElement("div")).setAttribute(df,"true"),dx()&&r.setAttribute("popover","manual"),o=dS({client:l}),Object.assign(r.style,dw(dw({position:"fixed"},dx()?dv:{zIndex:0x7fffffff}),{},{backgroundColor:"transparent",padding:0,margin:0,boxSizing:"border-box",pointerEvents:"auto"},d_({clientRect:o}))),document.body.appendChild(r),dx()&&r.showPopover(),a=(0,dp.bind)(window,{type:"pointermove",listener:function(e){o=dS({client:{x:e.clientX,y:e.clientY}}),Object.assign(r.style,d_({clientRect:o}))},options:{capture:!0}}),e=function(e){var t,n,i,s=e.current;if(a(),n=(t={client:s,clientRect:o}).client,i=t.clientRect,n.x>=i.x&&n.x<=i.x+i.width&&n.y>=i.y&&n.y<=i.y+i.height)return void r.remove();function l(){u(),r.remove()}var u=(0,dp.bindAll)(window,[{type:"pointerdown",listener:l},{type:"pointermove",listener:l},{type:"focusin",listener:l},{type:"focusout",listener:l},{type:"dragstart",listener:l},{type:"dragenter",listener:l},{type:"dragover",listener:l}],{capture:!0})}}if("onDrop"===n){var u,c=i.location.current.input;null==(u=e)||u({current:{x:c.clientX,y:c.clientY}}),e=null,y=null}}}}),dK=function(e){var t=e.typeKey,n=e.mount,i=e.dispatchEventToSource,r=e.onPostDispatch,o=e.defaultDropEffect,a=function(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}return{dispatchEvent:function(i){var r=i.eventName,o=i.payload;if("onGenerateDragPreview"===r){t={canMonitorArgs:{initial:o.location.initial,source:o.source},active:new Set};var a,s=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return d$(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?d$(e,void 0):void 0}}(e))){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,r=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw r}}}}(e);try{for(s.s();!(a=s.n()).done;){var l=a.value;n(l)}}catch(e){s.e(e)}finally{s.f()}}if(t){for(var u=Array.from(t.active),c=0;c<u.length;c++){var h,d=u[c];t.active.has(d)&&(null==(h=d[r])||h.call(d,o))}"onDrop"===r&&(t.active.clear(),t=null)}},monitorForConsumers:function(i){var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dU(Object(n),!0).forEach(function(t){dn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},i);return e.add(r),n(r),dy(function(){e.delete(r),t&&t.active.delete(r)})}}}(),s=function(e){var t=e.typeKey,n=e.defaultDropEffect,i=new WeakMap,r="data-drop-target-for-".concat(t),o="[".concat(r,"]");function a(e){var t,n=e.eventName,r=e.payload,o=dH(r.location.current.dropTargets);try{for(o.s();!(t=o.n()).done;){var a,s=t.value,l=i.get(s.element),u=dj(dj({},r),{},{self:s});null==l||null==(a=l[n])||a.call(l,u)}}catch(e){o.e(e)}finally{o.f()}}var s={onGenerateDragPreview:a,onDrag:a,onDragStart:a,onDrop:a,onDropTargetChange:function(e){var t,n=e.payload,r=new Set(n.location.current.dropTargets.map(function(e){return e.element})),o=new Set,a=dH(n.location.previous.dropTargets);try{for(a.s();!(t=a.n()).done;){var s,l,u=t.value;o.add(u.element);var c=i.get(u.element),h=r.has(u.element),d=dj(dj({},n),{},{self:u});null==c||null==(s=c.onDropTargetChange)||s.call(c,d),h||null==c||null==(l=c.onDragLeave)||l.call(c,d)}}catch(e){a.e(e)}finally{a.f()}var p,f=dH(n.location.current.dropTargets);try{for(f.s();!(p=f.n()).done;){var g,m,v=p.value;if(!o.has(v.element)){var y=dj(dj({},n),{},{self:v}),x=i.get(v.element);null==x||null==(g=x.onDropTargetChange)||g.call(x,y),null==x||null==(m=x.onDragEnter)||m.call(x,y)}}}catch(e){f.e(e)}finally{f.f()}}};return{dropTargetForConsumers:function(e){return dy(dd(dz(e.element,{attribute:r,value:"true"}),(i.set(e.element,e),function(){return i.delete(e.element)})))},getIsOver:function(e){var t=e.source,r=e.target,a=e.input,s=e.current,l=function e(t){var r,a,s,l,u=t.source,c=t.target,h=t.input,d=t.result,p=void 0===d?[]:d;if(null==c)return p;if(!(c instanceof Element))return c instanceof Node?e({source:u,target:c.parentElement,input:h,result:p}):p;var f=c.closest(o);if(null==f)return p;var g=i.get(f);if(null==g)return p;var m={input:h,source:u,element:g.element};if(g.canDrop&&!g.canDrop(m))return e({source:u,target:g.element.parentElement,input:h,result:p});var v=null!=(r=null==(a=g.getData)?void 0:a.call(g,m))?r:{},y=null!=(s=null==(l=g.getDropEffect)?void 0:l.call(g,m))?s:n,x={data:v,element:g.element,dropEffect:y,isActiveDueToStickiness:!1};return e({source:u,target:g.element.parentElement,input:h,result:[].concat(dM(p),[x])})}({source:t,target:r,input:a});if(l.length>=s.length)return l;for(var u=dG(s),c=dG(l),h=[],d=0;d<u.length;d++){var p,f=u[d],g=c[d];if(null!=g){h.push(g);continue}var m=h[d-1],v=u[d-1];if((null==m?void 0:m.element)!==(null==v?void 0:v.element))break;var y=i.get(f.element);if(!y)break;var x={input:a,source:t,element:y.element};if(y.canDrop&&!y.canDrop(x)||!(null!=(p=y.getIsSticky)&&p.call(y,x)))break;h.push(dj(dj({},f),{},{isActiveDueToStickiness:!0}))}return dG(h)},dispatchEvent:function(e){s[e.eventName](e)}}}({typeKey:t,defaultDropEffect:o});function l(e){null==i||i(e),s.dispatchEvent(e),a.dispatchEvent(e),null==r||r(e)}function u(e){dB({event:e.event,dragType:e.dragType,getDropTargetsOver:s.getIsOver,dispatchEvent:l})}return{registerUsage:function(){var e,i;return i=function(e){var t=e.typeKey,n=e.mount,i=dF.get(t);if(i)return i.usageCount++,i;var r={typeKey:t,unmount:n(),usageCount:1};return dF.set(t,r),r}(e={typeKey:t,mount:function(){return n({canStart:dL,start:u})}}),function(){i.usageCount--,i.usageCount>0||(i.unmount(),dF.delete(e.typeKey))}},dropTarget:s.dropTargetForConsumers,monitor:a.monitorForConsumers}}({typeKey:"element",defaultDropEffect:"move",mount:function(e){return dd(dX.bindEvents(),(0,dp.bind)(document,{type:"dragstart",listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n,i,r,o,a,s,l=t.target;if(l instanceof HTMLElement){var u=dZ.get(l);if(u){var c=dO(t),h={element:u.element,dragHandle:null!=(n=u.dragHandle)?n:null,input:c};if(u.canDrag&&!u.canDrag(h))return void t.preventDefault();if(u.dragHandle){var d=dm({x:c.clientX,y:c.clientY});if(!u.dragHandle.contains(d))return void t.preventDefault()}var p=null!=(i=null==(r=u.getInitialDataForExternal)?void 0:r.call(u,h))?i:null;if(p)for(var f=0,g=Object.entries(p);f<g.length;f++){var m=dh(g[f],2),v=m[0],y=m[1];t.dataTransfer.setData(v,null!=y?y:"")}!dq()||t.dataTransfer.types.includes(dY)||t.dataTransfer.types.includes("text/uri-list")||t.dataTransfer.setData(dY,"pdnd:android-fallback"),t.dataTransfer.setData("application/vnd.pdnd","");var x={element:u.element,dragHandle:null!=(o=u.dragHandle)?o:null,data:null!=(a=null==(s=u.getInitialData)?void 0:s.call(u,h))?a:{}};e.start({event:t,dragType:{type:"element",payload:x,startedFrom:"internal"}})}}}}}))},dispatchEventToSource:function(e){var t,n,i=e.eventName,r=e.payload;null==(t=dZ.get(r.source.element))||null==(n=t[i])||n.call(t,r)},onPostDispatch:dX.getOnPostDispatch()}),dQ=dK.dropTarget,dJ=dK.monitor;let d0={type:"idle"};function d1({elements:e,accessKey:t,axis:n="vertical",onChange:i}){return(0,eD.useEffect)(()=>dJ({onDrop({location:r,source:o}){var a,s;let l=r.current.dropTargets[0];if(!l)return;let u=o.data,c=l.data,h=e.findIndex(e=>e[t]===u[t]),d=e.findIndex(e=>e[t]===c[t]);d<0||h<0||i(function(e){var t=e.list,n=e.startIndex,i=e.finishIndex;if(-1===n||-1===i)return Array.from(t);var r=Array.from(t),o=dh(r.splice(n,1),1)[0];return r.splice(i,0,o),r}({list:(a={list:e,startIndex:h,indexOfTarget:d,closestEdgeOfTarget:dl(c),axis:n}).list,startIndex:s=a.startIndex,finishIndex:function(e){var t=e.startIndex,n=e.closestEdgeOfTarget,i=e.indexOfTarget,r=e.axis;if(-1===t||-1===i||t===i)return t;if(null==n)return i;var o="vertical"===r&&"bottom"===n||"horizontal"===r&&"right"===n;return t<i?o?i:i-1:o?i+1:i}({closestEdgeOfTarget:a.closestEdgeOfTarget,startIndex:s,indexOfTarget:a.indexOfTarget,axis:a.axis})}))}}),[t,n,e,i])}function d2({children:e,data:t}){let n=(0,eD.useRef)(null),[i,r]=(0,eD.useState)(d0);return(0,eD.useEffect)(()=>{let e=n.current;if(e){var i;return dd((i={element:e,getInitialData:()=>t,onDragStart(){r({type:"is-dragging"})},onDrop(){r(d0)}},dy(dd(dK.registerUsage(),(dZ.set(i.element,i),function(){dZ.delete(i.element)}),dz(i.element,{attribute:"draggable",value:"true"})))),dQ({element:e,canDrop:({source:t})=>t.element!==e,getData:({input:n})=>{var i,r,o,a,s,l,u,c,h;return a=(i={element:e,input:n,allowedEdges:["top","bottom"]}).element,s=i.input,l=i.allowedEdges,u={x:s.clientX,y:s.clientY},c=a.getBoundingClientRect(),h=null!=(r=null==(o=l.map(function(e){return{edge:e,value:da[e](c,u)}}).sort(function(e,t){return e.value-t.value})[0])?void 0:o.edge)?r:null,dr(dr({},t),{},dn({},ds,h))},getIsSticky:()=>!0,onDragEnter({self:e}){r({type:"is-dragging-over",closestEdge:dl(e.data)})},onDrag({self:e}){let t=dl(e.data);r(e=>"is-dragging-over"===e.type&&e.closestEdge===t?e:{type:"is-dragging-over",closestEdge:t})},onDragLeave(){r(d0)},onDrop(){r(d0)}}))}},[t]),(0,eb.jsxs)(eM.A,{ref:n,spacing:1,style:{opacity:"is-dragging"===i.type?.5:"unset"},children:["is-dragging-over"===i.type&&"top"===i.closestEdge?(0,eb.jsx)(de,{}):null,e,"is-dragging-over"===i.type&&"bottom"===i.closestEdge?(0,eb.jsx)(de,{}):null]})}var d5=n(53064);function d3(e,t){let n=t.indexOf(e);if(0===n)return t;let i=[...t];return i.splice(n,1),i.splice(n-1,0,e),i}function d4(e,t){let n=t.indexOf(e);if(n===t.length-1)return t;let i=[...t];return i.splice(n,1),i.splice(n+1,0,e),i}let d6=(0,eD.forwardRef)(function({onMoveUp:e,onMoveDown:t,onMoveLeft:n,onMoveRight:i,menuSx:r,...o},a){let[s,l]=(0,eD.useState)(null),u=!!s;function c(e){l(null),e?.()}return(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(eC.A,{...o,ref:a,"aria-label":"move","aria-haspopup":!0,"aria-expanded":u,size:"small",onClick:function(e){l(e.currentTarget)},children:(0,eb.jsx)(d5,{})}),(e||t||n||i)&&(0,eb.jsxs)(hm.A,{id:"drag-button-menu",MenuListProps:{"aria-labelledby":"drag-button-menu"},anchorEl:s,open:u,onClose:()=>c(void 0),sx:r,children:[e&&(0,eb.jsx)(cb.A,{onClick:()=>c(e),children:"Move Up"}),t&&(0,eb.jsx)(cb.A,{onClick:()=>c(t),children:"Move Down"}),n&&(0,eb.jsx)(cb.A,{onClick:()=>c(n),children:"Move Left"}),i&&(0,eb.jsx)(cb.A,{onClick:()=>c(i),children:"Move Right"}),i&&(0,eb.jsx)(cb.A,{onClick:()=>c(i),children:"Move Right"})]})]})});var d8=n(8072),d9=n(10972),d7=n(46477),pe=n(30443),pt=n(55403),pn=n(32494),pi=n(63025);function pr(e,t,n){let i=function(e,t,n){let i,r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),a=(0,pi.A)(t);if(t.fakeTransform)i=t.fakeTransform;else{let e=a.getComputedStyle(t);i=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("transform")}let s=0,l=0;if(i&&"none"!==i&&"string"==typeof i){let e=i.split("(")[1].split(")")[0].split(",");s=parseInt(e[4],10),l=parseInt(e[5],10)}return"left"===e?o?`translateX(${o.right+s-r.left}px)`:`translateX(${a.innerWidth+s-r.left}px)`:"right"===e?o?`translateX(-${r.right-o.left-s}px)`:`translateX(-${r.left+r.width-s}px)`:"up"===e?o?`translateY(${o.bottom+l-r.top}px)`:`translateY(${a.innerHeight+l-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}(e,t,"function"==typeof n?n():n);i&&(t.style.webkitTransform=i,t.style.transform=i)}let po=eD.forwardRef(function(e,t){let n=(0,ur.A)(),i={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:s,container:l,direction:u="down",easing:c=i,in:h,onEnter:d,onEntered:p,onEntering:f,onExit:g,onExited:m,onExiting:v,style:y,timeout:x=r,TransitionComponent:b=d7.Ay,...w}=e,S=eD.useRef(null),_=(0,um.A)((0,pe.A)(s),S,t),M=e=>t=>{e&&(void 0===t?e(S.current):e(S.current,t))},C=M((e,t)=>{pr(u,e,l),(0,pn.q)(e),d&&d(e,t)}),A=M((e,t)=>{let i=(0,pn.c)({timeout:x,style:y,easing:c},{mode:"enter"});e.style.webkitTransition=n.transitions.create("-webkit-transform",{...i}),e.style.transition=n.transitions.create("transform",{...i}),e.style.webkitTransform="none",e.style.transform="none",f&&f(e,t)}),k=M(p),T=M(v),D=M(e=>{let t=(0,pn.c)({timeout:x,style:y,easing:c},{mode:"exit"});e.style.webkitTransition=n.transitions.create("-webkit-transform",t),e.style.transition=n.transitions.create("transform",t),pr(u,e,l),g&&g(e)}),I=M(e=>{e.style.webkitTransition="",e.style.transition="",m&&m(e)}),O=eD.useCallback(()=>{S.current&&pr(u,S.current,l)},[u,l]);return eD.useEffect(()=>{if(h||"down"===u||"right"===u)return;let e=(0,pt.A)(()=>{S.current&&pr(u,S.current,l)}),t=(0,pi.A)(S.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[u,h,l]),eD.useEffect(()=>{h||O()},[h,O]),(0,eb.jsx)(b,{nodeRef:S,onEnter:C,onEntered:k,onEntering:A,onExit:D,onExited:I,onExiting:T,addEndListener:e=>{o&&o(S.current,e)},appear:a,in:h,timeout:x,...w,children:(e,{ownerState:t,...n})=>eD.cloneElement(s,{ref:_,style:{visibility:"exited"!==e||h?void 0:"hidden",...y,...s.props.style},...n})})});var pa=n(11502);function ps(e){return(0,ux.Ay)("MuiDrawer",e)}(0,uy.A)("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);var pl=n(64606);let pu=(e,t)=>{let{ownerState:n}=e;return[t.root,("permanent"===n.variant||"persistent"===n.variant)&&t.docked,t.modal]},pc=(0,e7.A)(d9.A,{name:"MuiDrawer",slot:"Root",overridesResolver:pu})((0,uh.A)(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),ph=(0,e7.A)("div",{shouldForwardProp:up.A,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:pu})({flex:"0 0 auto"}),pd=(0,e7.A)(pa.A,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`paperAnchor${(0,ho.A)(n.anchor)}`],"temporary"!==n.variant&&t[`paperAnchorDocked${(0,ho.A)(n.anchor)}`]]}})((0,uh.A)(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:e})=>"left"===e.anchor&&"temporary"!==e.variant,style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"top"===e.anchor&&"temporary"!==e.variant,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"right"===e.anchor&&"temporary"!==e.variant,style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"bottom"===e.anchor&&"temporary"!==e.variant,style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),pp={left:"right",right:"left",top:"down",bottom:"up"},pf=eD.forwardRef(function(e,t){let n=(0,ud.b)({props:e,name:"MuiDrawer"}),i=(0,ur.A)(),r=(0,cA.I)(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:a="left",BackdropProps:s,children:l,className:u,elevation:c=16,hideBackdrop:h=!1,ModalProps:{BackdropProps:d,...p}={},onClose:f,open:g=!1,PaperProps:m={},SlideProps:v,TransitionComponent:y,transitionDuration:x=o,variant:b="temporary",slots:w={},slotProps:S={},..._}=n,M=eD.useRef(!1);eD.useEffect(()=>{M.current=!0},[]);let C=function({direction:e},t){return"rtl"===e&&["left","right"].includes(t)?pp[t]:t}({direction:r?"rtl":"ltr"},a),A={...n,anchor:a,elevation:c,open:g,variant:b,..._},k=(e=>{let{classes:t,anchor:n,variant:i}=e,r={root:["root",`anchor${(0,ho.A)(n)}`],docked:[("permanent"===i||"persistent"===i)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${(0,ho.A)(n)}`,"temporary"!==i&&`paperAnchorDocked${(0,ho.A)(n)}`]};return(0,uu.A)(r,ps,t)})(A),T={slots:{transition:y,...w},slotProps:{paper:m,transition:v,...S,backdrop:(0,pl.A)(S.backdrop||{...s,...d},{transitionDuration:x})}},[D,I]=(0,cN.A)("root",{ref:t,elementType:pc,className:(0,ul.A)(k.root,k.modal,u),shouldForwardComponentProp:!0,ownerState:A,externalForwardedProps:{...T,..._,...p},additionalProps:{open:g,onClose:f,hideBackdrop:h,slots:{backdrop:T.slots.backdrop},slotProps:{backdrop:T.slotProps.backdrop}}}),[O,P]=(0,cN.A)("paper",{elementType:pd,shouldForwardComponentProp:!0,className:(0,ul.A)(k.paper,m.className),ownerState:A,externalForwardedProps:T,additionalProps:{elevation:"temporary"===b?c:0,square:!0}}),[E,R]=(0,cN.A)("docked",{elementType:ph,ref:t,className:(0,ul.A)(k.root,k.docked,u),ownerState:A,externalForwardedProps:T,additionalProps:_}),[L,N]=(0,cN.A)("transition",{elementType:po,ownerState:A,externalForwardedProps:T,additionalProps:{in:g,direction:pp[C],timeout:x,appear:M.current}}),B=(0,eb.jsx)(O,{...P,children:l});if("permanent"===b)return(0,eb.jsx)(E,{...R,children:B});let F=(0,eb.jsx)(L,{...N,children:B});return"persistent"===b?(0,eb.jsx)(E,{...R,children:F}):(0,eb.jsx)(D,{...I,children:F})}),pg=({anchor:e="right",isOpen:t,onClose:n,PaperProps:i,children:r,...o})=>{let a=(0,d8.A)("(max-width:1080px)");return(0,eb.jsx)(pf,{...o,open:t,onClose:n,anchor:e,PaperProps:{...i,sx:rv({width:a?"100%":"1080px",overflow:"hidden"},i?.sx)},"aria-hidden":!t,children:r})};var pm="12px sans-serif",pv=function(e){var t={};if("u"<typeof JSON)return t;for(var n=0;n<e.length;n++){var i=String.fromCharCode(n+32),r=(e.charCodeAt(n)-20)/100;t[i]=r}return t}("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N"),py={createCanvas:function(){return"u">typeof document&&document.createElement("canvas")},measureText:function(e,t){if(!x){var n=py.createCanvas();x=n&&n.getContext("2d")}if(x)return b!==t&&(b=x.font=t||pm),x.measureText(e);e=e||"",t=t||pm;var i=/(\d+)px/.exec(t),r=i&&+i[1]||12,o=0;if(t.indexOf("mono")>=0)o=r*e.length;else for(var a=0;a<e.length;a++){var s=pv[e[a]];o+=null==s?r:s*r}return{width:o}},loadImage:function(e,t,n){var i=new Image;return i.onload=t,i.onerror=n,i.src=e,i}},px=pj(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(e,t){return e["[object "+t+"]"]=!0,e},{}),pb=pj(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(e,t){return e["[object "+t+"Array]"]=!0,e},{}),pw=Object.prototype.toString,pS=Array.prototype,p_=pS.forEach,pM=pS.filter,pC=pS.slice,pA=pS.map,pk=(function(){}).constructor,pT=pk?pk.prototype:null,pD="__proto__",pI=2311;function pO(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];"u">typeof console&&console.error.apply(console,e)}function pP(e){if(null==e||"object"!=typeof e)return e;var t=e,n=pw.call(e);if("[object Array]"===n){if(!e[p7]){t=[];for(var i=0,r=e.length;i<r;i++)t[i]=pP(e[i])}}else if(pb[n]){if(!e[p7]){var o=e.constructor;if(o.from)t=o.from(e);else{t=new o(e.length);for(var i=0,r=e.length;i<r;i++)t[i]=e[i]}}}else if(!px[n]&&!e[p7]&&!p0(e))for(var a in t={},e)e.hasOwnProperty(a)&&a!==pD&&(t[a]=pP(e[a]));return t}function pE(e,t,n){if(!pK(t)||!pK(e))return n?pP(t):e;for(var i in t)if(t.hasOwnProperty(i)&&i!==pD){var r=e[i],o=t[i];!(pK(o)&&pK(r))||pU(o)||pU(r)||p0(o)||p0(r)||pQ(o)||pQ(r)||o[p7]||r[p7]?!n&&i in e||(e[i]=pP(t[i])):pE(r,o,n)}return e}function pR(e,t){if(Object.assign)Object.assign(e,t);else for(var n in t)t.hasOwnProperty(n)&&n!==pD&&(e[n]=t[n]);return e}function pL(e,t,n){for(var i=pW(t),r=0;r<i.length;r++){var o=i[r];(n?null!=t[o]:null==e[o])&&(e[o]=t[o])}return e}function pN(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n}return -1}function pB(e,t,n){if(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(t),r=0;r<i.length;r++){var o=i[r];"constructor"!==o&&(n?null!=t[o]:null==e[o])&&(e[o]=t[o])}else pL(e,t,n)}function pF(e){return!!e&&"string"!=typeof e&&"number"==typeof e.length}function pz(e,t,n){if(e&&t)if(e.forEach&&e.forEach===p_)e.forEach(t,n);else if(e.length===+e.length)for(var i=0,r=e.length;i<r;i++)t.call(n,e[i],i,e);else for(var o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o,e)}function pV(e,t,n){if(!e)return[];if(!t)return p4(e);if(e.map&&e.map===pA)return e.map(t,n);for(var i=[],r=0,o=e.length;r<o;r++)i.push(t.call(n,e[r],r,e));return i}function pj(e,t,n,i){if(e&&t){for(var r=0,o=e.length;r<o;r++)n=t.call(i,n,e[r],r,e);return n}}function pH(e,t,n){if(!e)return[];if(!t)return p4(e);if(e.filter&&e.filter===pM)return e.filter(t,n);for(var i=[],r=0,o=e.length;r<o;r++)t.call(n,e[r],r,e)&&i.push(e[r]);return i}function pW(e){if(!e)return[];if(Object.keys)return Object.keys(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}py.createCanvas;var pG=pT&&pq(pT.bind)?pT.call.bind(pT.bind):function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return function(){return e.apply(t,n.concat(pC.call(arguments)))}};function p$(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(this,t.concat(pC.call(arguments)))}}function pU(e){return Array.isArray?Array.isArray(e):"[object Array]"===pw.call(e)}function pq(e){return"function"==typeof e}function pY(e){return"string"==typeof e}function pZ(e){return"[object String]"===pw.call(e)}function pX(e){return"number"==typeof e}function pK(e){var t=typeof e;return"function"===t||!!e&&"object"===t}function pQ(e){return!!px[pw.call(e)]}function pJ(e){return!!pb[pw.call(e)]}function p0(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}function p1(e){return null!=e.colorStops}function p2(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,i=e.length;n<i;n++)if(null!=e[n])return e[n]}function p5(e,t){return null!=e?e:t}function p3(e,t,n){return null!=e?e:null!=t?t:n}function p4(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return pC.apply(e,t)}function p6(e){if("number"==typeof e)return[e,e,e,e];var t=e.length;return 2===t?[e[0],e[1],e[0],e[1]]:3===t?[e[0],e[1],e[2],e[1]]:e}function p8(e,t){if(!e)throw Error(t)}function p9(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var p7="__ec_primitive__",fe=function(){function e(){this.data={}}return e.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],t},e.prototype.has=function(e){return this.data.hasOwnProperty(e)},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){return this.data[e]=t,this},e.prototype.keys=function(){return pW(this.data)},e.prototype.forEach=function(e){var t=this.data;for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},e}(),ft="function"==typeof Map,fn=function(){function e(t){var n=pU(t);this.data=ft?new Map:new fe;var i=this;function r(e,t){n?i.set(e,t):i.set(t,e)}t instanceof e?t.each(r):t&&pz(t,r)}return e.prototype.hasKey=function(e){return this.data.has(e)},e.prototype.get=function(e){return this.data.get(e)},e.prototype.set=function(e,t){return this.data.set(e,t),t},e.prototype.each=function(e,t){this.data.forEach(function(n,i){e.call(t,n,i)})},e.prototype.keys=function(){var e=this.data.keys();return ft?Array.from(e):e},e.prototype.removeKey=function(e){this.data.delete(e)},e}();function fi(e){return new fn(e)}function fr(e,t){var n;if(Object.create)n=Object.create(e);else{var i=function(){};i.prototype=e,n=new i}return t&&pR(n,t),n}function fo(e){var t=e.style;t.webkitUserSelect="none",t.userSelect="none",t.webkitTapHighlightColor="rgba(0,0,0,0)",t["-webkit-touch-callout"]="none"}function fa(e,t){return e.hasOwnProperty(t)}function fs(){}var fl=180/Math.PI;function fu(e,t,n,i){var r=t[0],o=t[1],a=n[0],s=n[1],l=o-r,u=s-a;if(0===l)return 0===u?a:(a+s)/2;if(i){if(l>0){if(e<=r)return a;else if(e>=o)return s}else if(e>=r)return a;else if(e<=o)return s}else{if(e===r)return a;if(e===o)return s}return(e-r)/l*u+a}function fc(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return pY(e)?e.replace(/^\s+|\s+$/g,"").match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e}function fh(e,t,n){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),n?e:+e}function fd(e){return e.sort(function(e,t){return e-t}),e}function fp(e){if(isNaN(e*=1))return 0;if(e>1e-14){for(var t,n,i,r,o,a=1,s=0;s<15;s++,a*=10)if(Math.round(e*a)/a===e)return s}return i=(n=(t=e.toString().toLowerCase()).indexOf("e"))>0?+t.slice(n+1):0,r=n>0?n:t.length,Math.max(0,((o=t.indexOf("."))<0?0:r-1-o)-i)}function ff(e,t){var n=Math.log,i=Math.LN10,r=Math.min(Math.max(-Math.floor(n(e[1]-e[0])/i)+Math.round(n(Math.abs(t[1]-t[0]))/i),0),20);return isFinite(r)?r:20}function fg(e){var t=2*Math.PI;return(e%t+t)%t}function fm(e){return e>-1e-4&&e<1e-4}var fv=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function fy(e){if(e instanceof Date)return e;if(pY(e)){var t=fv.exec(e);if(!t)return new Date(NaN);if(!t[8])return new Date(+t[1],(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0);var n=+t[4]||0;return"Z"!==t[8].toUpperCase()&&(n-=t[8].slice(0,3)),new Date(Date.UTC(+t[1],(t[2]||1)-1,+t[3]||1,n,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0))}return null==e?new Date(NaN):new Date(Math.round(e))}function fx(e){if(0===e)return 0;var t=Math.floor(Math.log(e)/Math.LN10);return e/Math.pow(10,t)>=10&&t++,t}function fb(e,t){var n=fx(e),i=Math.pow(10,n),r=e/i;return e=(t?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*i,n>=-20?+e.toFixed(n<0?-n:0):e}function fw(e){e.sort(function(e,t){return!function e(t,n,i){return t.interval[i]<n.interval[i]||t.interval[i]===n.interval[i]&&(t.close[i]-n.close[i]==(i?-1:1)||!i&&e(t,n,1))}(e,t,0)?1:-1});for(var t=-1/0,n=1,i=0;i<e.length;){for(var r=e[i].interval,o=e[i].close,a=0;a<2;a++)r[a]<=t&&(r[a]=t,o[a]=a?1:1-n),t=r[a],n=o[a];r[0]===r[1]&&o[0]*o[1]!=1?e.splice(i,1):i++}return e}function fS(e){var t=parseFloat(e);return t==e&&(0!==t||!pY(e)||0>=e.indexOf("x"))?t:NaN}function f_(){return Math.round(9*Math.random())}function fM(e,t){return null==e?t:null==t?e:e*t/function e(t,n){return 0===n?t:e(n,t%n)}(e,t)}var fC=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},fA=new function(){this.browser=new fC,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="u">typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(fA.wxa=!0,fA.touchEventsSupported=!0):"u"<typeof document&&"u">typeof self?fA.worker=!0:"u"<typeof navigator||0===navigator.userAgent.indexOf("Node.js")?(fA.node=!0,fA.svgSupported=!0):(o=navigator.userAgent,s=(a=fA).browser,l=o.match(/Firefox\/([\d.]+)/),u=o.match(/MSIE\s([\d.]+)/)||o.match(/Trident\/.+?rv:(([\d.]+))/),c=o.match(/Edge?\/([\d.]+)/),h=/micromessenger/i.test(o),l&&(s.firefox=!0,s.version=l[1]),u&&(s.ie=!0,s.version=u[1]),c&&(s.edge=!0,s.version=c[1],s.newEdge=+c[1].split(".")[0]>18),h&&(s.weChat=!0),a.svgSupported="u">typeof SVGRect,a.touchEventsSupported="ontouchstart"in window&&!s.ie&&!s.edge,a.pointerEventsSupported="onpointerdown"in window&&(s.edge||s.ie&&+s.version>=11),a.domSupported="u">typeof document,d=document.documentElement.style,a.transform3dSupported=(s.ie&&"transition"in d||s.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in d)&&!("OTransition"in d),a.transformSupported=a.transform3dSupported||s.ie&&+s.version>=9);var fk="series\0",fT="\0_ec_\0";function fD(e){return e instanceof Array?e:null==e?[]:[e]}function fI(e,t,n){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var i=0,r=n.length;i<r;i++){var o=n[i];!e.emphasis[t].hasOwnProperty(o)&&e[t].hasOwnProperty(o)&&(e.emphasis[t][o]=e[t][o])}}}var fO=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function fP(e){return!pK(e)||pU(e)||e instanceof Date?e:e.value}function fE(e,t,n){var i=fL(t[e],null),r=fL(n[e],null);return null!=i&&null!=r&&i===r}function fR(e){return fL(e,"")}function fL(e,t){return null==e?t:pY(e)?e:pX(e)||pZ(e)?e+"":t}function fN(e){var t=e.name;return!!(t&&t.indexOf(fk))}function fB(e){return e&&null!=e.id&&0===fR(e.id).indexOf(fT)}function fF(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?pU(t.dataIndex)?pV(t.dataIndex,function(t){return e.indexOfRawIndex(t)}):e.indexOfRawIndex(t.dataIndex):null!=t.name?pU(t.name)?pV(t.name,function(t){return e.indexOfName(t)}):e.indexOfName(t.name):void 0}function fz(){var e="__ec_inner_"+fV++;return function(t){return t[e]||(t[e]={})}}var fV=f_();function fj(e,t,n){var i=fH(t,n),r=i.mainTypeSpecified,o=i.queryOptionMap,a=i.others,s=n?n.defaultMainType:null;return!r&&s&&o.set(s,{}),o.each(function(t,i){var r=f$(e,i,t,{useDefault:s===i,enableAll:!n||null==n.enableAll||n.enableAll,enableNone:!n||null==n.enableNone||n.enableNone});a[i+"Models"]=r.models,a[i+"Model"]=r.models[0]}),a}function fH(e,t){if(pY(e)){var n,i={};i[e+"Index"]=0,n=i}else n=e;var r=fi(),o={},a=!1;return pz(n,function(e,n){if("dataIndex"===n||"dataIndexInside"===n){o[n]=e;return}var i=n.match(/^(\w+)(Index|Id|Name)$/)||[],s=i[1],l=(i[2]||"").toLowerCase();!s||!l||t&&t.includeMainTypes&&0>pN(t.includeMainTypes,s)||(a=a||!!s,(r.get(s)||r.set(s,{}))[l]=e)}),{mainTypeSpecified:a,queryOptionMap:r,others:o}}var fW={useDefault:!0,enableAll:!1,enableNone:!1},fG={useDefault:!1,enableAll:!0,enableNone:!0};function f$(e,t,n,i){i=i||fW;var r=n.index,o=n.id,a=n.name,s={models:null,specified:null!=r||null!=o||null!=a};if(!s.specified){var l=void 0;return s.models=i.useDefault&&(l=e.getComponent(t))?[l]:[],s}return"none"===r||!1===r?(p8(i.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[]):("all"===r&&(p8(i.enableAll,'`"all"` is not a valid value on index option.'),r=o=a=null),s.models=e.queryComponents({mainType:t,index:r,id:o,name:a})),s}function fU(e,t,n){e.setAttribute?e.setAttribute(t,n):e[t]=n}function fq(e,t,n,i,r){var o=null==t||"auto"===t;if(null==i)return i;if(pX(i)){var a,s=(i-(a=n||0))*r+a;return fh(s,o?Math.max(fp(n||0),fp(i)):t)}if(pY(i))return r<1?n:i;for(var l=[],u=Math.max(n?n.length:0,i.length),c=0;c<u;++c){var h=e.getDimensionInfo(c);if(h&&"ordinal"===h.type)l[c]=(r<1&&n?n:i)[c];else{var d=n&&n[c]?n[c]:0,p=i[c],s=(p-d)*r+d;l[c]=fh(s,o?Math.max(fp(d),fp(p)):t)}}return l}var fY=fi(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),fZ="original",fX="arrayRows",fK="objectRows",fQ="keyedColumns",fJ="typedArray",f0="unknown",f1="column",f2=fz();function f5(e,t,n){var i,r,o={},a=f4(t);if(!a||!e)return o;var s=[],l=[],u=f2(t.ecModel).datasetMap,c=a.uid+"_"+n.seriesLayoutBy;pz(e=e.slice(),function(t,n){var a=pK(t)?t:e[n]={name:t};"ordinal"===a.type&&null==i&&(i=n,r=p(a)),o[a.name]=[]});var h=u.get(c)||u.set(c,{categoryWayDim:r,valueWayDim:0});function d(e,t,n){for(var i=0;i<n;i++)e.push(t+i)}function p(e){var t=e.dimsDef;return t?t.length:1}return pz(e,function(e,t){var n=e.name,r=p(e);if(null==i){var a=h.valueWayDim;d(o[n],a,r),d(l,a,r),h.valueWayDim+=r}else if(i===t)d(o[n],0,r),d(s,0,r);else{var a=h.categoryWayDim;d(o[n],a,r),d(l,a,r),h.categoryWayDim+=r}}),s.length&&(o.itemName=s),l.length&&(o.seriesName=l),o}function f3(e,t,n){var i,r={};if(!f4(e))return r;var o=t.sourceFormat,a=t.dimensionsDefine;(o===fK||o===fQ)&&pz(a,function(e,t){(pK(e)?e.name:e)==="name"&&(i=t)});var s=function(){for(var e={},r={},s=[],l=0,u=Math.min(5,n);l<u;l++){var c=f8(t.data,o,t.seriesLayoutBy,a,t.startIndex,l);s.push(c);var h=3===c;if(h&&null==e.v&&l!==i&&(e.v=l),null!=e.n&&e.n!==e.v&&(h||3!==s[e.n])||(e.n=l),d(e)&&3!==s[e.n])return e;h||(2===c&&null==r.v&&l!==i&&(r.v=l),(null==r.n||r.n===r.v)&&(r.n=l))}function d(e){return null!=e.v&&null!=e.n}return d(e)?e:d(r)?r:null}();if(s){r.value=[s.v];var l=null!=i?i:s.n;r.itemName=[l],r.seriesName=[l]}return r}function f4(e){if(!e.get("data",!0))return f$(e.ecModel,"dataset",{index:e.get("datasetIndex",!0),id:e.get("datasetId",!0)},fW).models[0]}function f6(e,t){return f8(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)}function f8(e,t,n,i,r,o){var a,s,l;if(pJ(e))return 3;if(i){var u=i[o];pK(u)?(s=u.name,l=u.type):pY(u)&&(s=u)}if(null!=l)return"ordinal"===l?1:3;if(t===fX)if("row"===n){for(var c=e[o],h=0;h<(c||[]).length&&h<5;h++)if(null!=(a=g(c[r+h])))return a}else for(var h=0;h<e.length&&h<5;h++){var d=e[r+h];if(d&&null!=(a=g(d[o])))return a}else if(t===fK){if(!s)return 3;for(var h=0;h<e.length&&h<5;h++){var p=e[h];if(p&&null!=(a=g(p[s])))return a}}else if(t===fQ){if(!s)return 3;var c=e[s];if(!c||pJ(c))return 3;for(var h=0;h<c.length&&h<5;h++)if(null!=(a=g(c[h])))return a}else if(t===fZ)for(var h=0;h<e.length&&h<5;h++){var p=e[h],f=fP(p);if(!pU(f))return 3;if(null!=(a=g(f[o])))return a}function g(e){var t=pY(e);return null!=e&&isFinite(e)&&""!==e?t?2:3:t&&"-"!==e?1:void 0}return 3}var f9=function(e){this.data=e.data||(e.sourceFormat===fQ?{}:[]),this.sourceFormat=e.sourceFormat||f0,this.seriesLayoutBy=e.seriesLayoutBy||f1,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;n<t.length;n++){var i=t[n];null==i.type&&1===f6(this,n)&&(i.type="ordinal")}};function f7(e){return e instanceof f9}function ge(e,t,n){n=n||gn(e);var i=t.seriesLayoutBy,r=function(e,t,n,i,r){if(!e)return{dimensionsDefine:gi(r),startIndex:a,dimensionsDetectedCount:o};if(t===fX){var o,a;"auto"===i||null==i?gr(function(e){null!=e&&"-"!==e&&(pY(e)?null==a&&(a=1):a=0)},n,e,10):a=pX(i)?i:+!!i,r||1!==a||(r=[],gr(function(e,t){r[t]=null!=e?e+"":""},n,e,1/0)),o=r?r.length:"row"===n?e.length:e[0]?e[0].length:null}else if(t===fK)r||(r=function(e){for(var t,n=0;n<e.length&&!(t=e[n++]););if(t)return pW(t)}(e));else if(t===fQ)r||(r=[],pz(e,function(e,t){r.push(t)}));else if(t===fZ){var s=fP(e[0]);o=pU(s)&&s.length||1}return{startIndex:a,dimensionsDefine:gi(r),dimensionsDetectedCount:o}}(e,n,i,t.sourceHeader,t.dimensions);return new f9({data:e,sourceFormat:n,seriesLayoutBy:i,dimensionsDefine:r.dimensionsDefine,startIndex:r.startIndex,dimensionsDetectedCount:r.dimensionsDetectedCount,metaRawOption:pP(t)})}function gt(e){return new f9({data:e,sourceFormat:pJ(e)?fJ:fZ})}function gn(e){var t=f0;if(pJ(e))t=fJ;else if(pU(e)){0===e.length&&(t=fX);for(var n=0,i=e.length;n<i;n++){var r=e[n];if(null!=r){if(pU(r)||pJ(r)){t=fX;break}else if(pK(r)){t=fK;break}}}}else if(pK(e)){for(var o in e)if(fa(e,o)&&pF(e[o])){t=fQ;break}}return t}function gi(e){if(e){var t=fi();return pV(e,function(e,n){var i={name:(e=pK(e)?e:{name:e}).name,displayName:e.displayName,type:e.type};if(null==i.name)return i;i.name+="",null==i.displayName&&(i.displayName=i.name);var r=t.get(i.name);return r?i.name+="-"+r.count++:t.set(i.name,{count:1}),i})}}function gr(e,t,n,i){if("row"===t)for(var r=0;r<n.length&&r<i;r++)e(n[r]?n[r][0]:null,r);else for(var o=n[0]||[],r=0;r<o.length&&r<i;r++)e(o[r],r)}function go(e){var t=e.sourceFormat;return t===fK||t===fQ}var ga=fz(),gs={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},gl=function(){function e(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return e.prototype.isDimensionOmitted=function(){return this._dimOmitted},e.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=gh(this.source)))},e.prototype.getSourceDimensionIndex=function(e){return p5(this._dimNameMap.get(e),-1)},e.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},e.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=go(this.source),n=!(e>30),i="",r=[],o=0,a=0;o<e;o++){var s=void 0,l=void 0,u=void 0,c=this.dimensions[a];if(c&&c.storeDimIndex===o)s=t?c.name:null,l=c.type,u=c.ordinalMeta,a++;else{var h=this.getSourceDimension(o);h&&(s=t?h.name:null,l=h.type)}r.push({property:s,type:l,ordinalMeta:u}),!t||null==s||c&&c.isCalculationCoord||(i+=n?s.replace(/\`/g,"`1").replace(/\$/g,"`2"):s),i+="$",i+=gs[l]||"f",u&&(i+=u.uid),i+="$"}var d=this.source;return{dimensions:r,hash:[d.seriesLayoutBy,d.startIndex,i].join("$$")}},e.prototype.makeOutputDimensionNames=function(){for(var e=[],t=0,n=0;t<this._fullDimCount;t++){var i=void 0,r=this.dimensions[n];if(r&&r.storeDimIndex===t)r.isCalculationCoord||(i=r.name),n++;else{var o=this.getSourceDimension(t);o&&(i=o.name)}e.push(i)}return e},e.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},e}();function gu(e){return e instanceof gl}function gc(e){for(var t=fi(),n=0;n<(e||[]).length;n++){var i=e[n],r=pK(i)?i.name:i;null!=r&&null==t.get(r)&&t.set(r,n)}return t}function gh(e){var t=ga(e);return t.dimNameMap||(t.dimNameMap=gc(e.dimensionsDefine))}function gd(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function gp(e,t){return gd(e,t)?e.getCalculationInfo("stackResultDimension"):t}function gf(){var e=fz();return function(t){var n=e(t),i=t.pipelineContext,r=!!n.large,o=!!n.progressiveRender,a=n.large=!!(i&&i.large),s=n.progressiveRender=!!(i&&i.progressiveRender);return(r!==a||o!==s)&&"reset"}}var gg="u">typeof Float32Array,gm=gg?Float32Array:Array;function gv(e){return pU(e)?gg?new Float32Array(e):e:new gm(e)}var gy="__ec_stack_";function gx(e){return e.get("stack")||gy+e.seriesIndex}function gb(e){return e.dim+e.index}function gw(e,t){var n=[];return t.eachSeriesByType(e,function(e){gC(e)&&n.push(e)}),n}function gS(e){var t=function(e){var t={};pz(e,function(e){var n=e.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var i=e.getData(),r=n.dim+"_"+n.index,o=i.getDimensionIndex(i.mapDimension(n.dim)),a=i.getStore(),s=0,l=a.count();s<l;++s){var u=a.get(o,s);t[r]?t[r].push(u):t[r]=[u]}});var n={};for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if(r){r.sort(function(e,t){return e-t});for(var o=null,a=1;a<r.length;++a){var s=r[a]-r[a-1];s>0&&(o=null===o?s:Math.min(o,s))}n[i]=o}}return n}(e),n=[];return pz(e,function(e){var i,r=e.coordinateSystem.getBaseAxis(),o=r.getExtent();if("category"===r.type)i=r.getBandWidth();else if("value"===r.type||"time"===r.type){var a=t[r.dim+"_"+r.index],s=Math.abs(o[1]-o[0]),l=r.scale.getExtent(),u=Math.abs(l[1]-l[0]);i=a?s/u*a:s}else{var c=e.getData();i=Math.abs(o[1]-o[0])/c.count()}var h=fc(e.get("barWidth"),i),d=fc(e.get("barMaxWidth"),i),p=fc(e.get("barMinWidth")||(gA(e)?.5:1),i),f=e.get("barGap"),g=e.get("barCategoryGap");n.push({bandWidth:i,barWidth:h,barMaxWidth:d,barMinWidth:p,barGap:f,barCategoryGap:g,axisKey:gb(r),stackId:gx(e)})}),g_(n)}function g_(e){var t={};pz(e,function(e,n){var i=e.axisKey,r=e.bandWidth,o=t[i]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=o.stacks;t[i]=o;var s=e.stackId;!a[s]&&o.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var u=e.barMaxWidth;u&&(a[s].maxWidth=u);var c=e.barMinWidth;c&&(a[s].minWidth=c);var h=e.barGap;null!=h&&(o.gap=h);var d=e.barCategoryGap;null!=d&&(o.categoryGap=d)});var n={};return pz(t,function(e,t){n[t]={};var i,r=e.stacks,o=e.bandWidth,a=e.categoryGap;null==a&&(a=Math.max(35-4*pW(r).length,15)+"%");var s=fc(a,o),l=fc(e.gap,1),u=e.remainedWidth,c=e.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),pz(r,function(e){var t=e.maxWidth,n=e.minWidth;if(e.width){var i=e.width;t&&(i=Math.min(i,t)),n&&(i=Math.max(i,n)),e.width=i,u-=i+l*i,c--}else{var i=h;t&&t<i&&(i=Math.min(t,u)),n&&n>i&&(i=n),i!==h&&(e.width=i,u-=i+l*i,c--)}}),h=Math.max(h=(u-s)/(c+(c-1)*l),0);var d=0;pz(r,function(e,t){e.width||(e.width=h),i=e,d+=e.width*(1+l)}),i&&(d-=i.width*l);var p=-d/2;pz(r,function(e,i){n[t][i]=n[t][i]||{bandWidth:o,offset:p,width:e.width},p+=e.width*(1+l)})}),n}function gM(e,t){var n=gw(e,t),i=gS(n);pz(n,function(e){var t=e.getData(),n=e.coordinateSystem.getBaseAxis(),r=gx(e),o=i[gb(n)][r],a=o.offset,s=o.width;t.setLayout({bandWidth:o.bandWidth,offset:a,size:s})})}function gC(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function gA(e){return e.pipelineContext&&e.pipelineContext.large}var gk={average:function(e){for(var t=0,n=0,i=0;i<e.length;i++)!isNaN(e[i])&&(t+=e[i],n++);return 0===n?NaN:t/n},sum:function(e){for(var t=0,n=0;n<e.length;n++)t+=e[n]||0;return t},max:function(e){for(var t=-1/0,n=0;n<e.length;n++)e[n]>t&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n<e.length;n++)e[n]<t&&(t=e[n]);return isFinite(t)?t:NaN},minmax:function(e){for(var t=-1/0,n=-1/0,i=0;i<e.length;i++){var r=e[i],o=Math.abs(r);o>t&&(t=o,n=r)}return isFinite(n)?n:NaN},nearest:function(e){return e[0]}},gT=function(e){return Math.round(e.length/2)};function gD(e){return{seriesType:e,reset:function(e,t,n){var i=e.getData(),r=e.get("sampling"),o=e.coordinateSystem,a=i.count();if(a>10&&"cartesian2d"===o.type&&r){var s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),c=n.getDevicePixelRatio(),h=Math.round(a/(Math.abs(u[1]-u[0])*(c||1)));if(isFinite(h)&&h>1){"lttb"===r&&e.setData(i.lttbDownSample(i.mapDimension(l.dim),1/h));var d=void 0;pY(r)?d=gk[r]:pq(r)&&(d=r),d&&e.setData(i.downSample(i.mapDimension(l.dim),1/h,d,gT))}}}}}var gI=function(e,t){return(gI=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function gO(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}gI(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var gP="___EC__COMPONENT__CONTAINER___",gE="___EC__EXTENDED_CLASS___";function gR(e){var t={main:"",sub:""};if(e){var n=e.split(".");t.main=n[0]||"",t.sub=n[1]||""}return t}function gL(e,t){e.$constructor=e,e.extend=function(e){var t,n,i=this;if(pq(t=i)&&/^class\s/.test(Function.prototype.toString.call(t)))n=function(e){function t(){return e.apply(this,arguments)||this}return gO(t,e),t}(i);else{var r=n=function(){(e.$constructor||i).apply(this,arguments)},o=r.prototype;function a(){}for(var s in a.prototype=this.prototype,r.prototype=new a,o)o.hasOwnProperty(s)&&(r.prototype[s]=o[s]);r.prototype.constructor=r,r.superClass=this}return pR(n.prototype,e),n[gE]=!0,n.extend=this.extend,n.superCall=gF,n.superApply=gz,n.superClass=i,n}}function gN(e,t){e.extend=t.extend}var gB=Math.round(10*Math.random());function gF(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return this.superClass.prototype[t].apply(e,n)}function gz(e,t,n){return this.superClass.prototype[t].apply(e,n)}function gV(e){var t={};e.registerClass=function(e){var n=e.type||e.prototype.type;if(n){p8(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(n),'componentType "'+n+'" illegal'),e.prototype.type=n;var i,r,o=gR(n);o.sub?o.sub!==gP&&(((r=t[(i=o).main])&&r[gP]||((r=t[i.main]={})[gP]=!0),r)[o.sub]=e):t[o.main]=e}return e},e.getClass=function(e,n,i){var r=t[e];if(r&&r[gP]&&(r=n?r[n]:null),i&&!r)throw Error(n?"Component "+e+"."+(n||"")+" is used but not imported.":e+".type should be specified.");return r},e.getClassesByMainType=function(e){var n=gR(e),i=[],r=t[n.main];return r&&r[gP]?pz(r,function(e,t){t!==gP&&i.push(e)}):i.push(r),i},e.hasClass=function(e){return!!t[gR(e).main]},e.getAllClassMainTypes=function(){var e=[];return pz(t,function(t,n){e.push(n)}),e},e.hasSubTypes=function(e){var n=t[gR(e).main];return n&&n[gP]}}function gj(e,t){for(var n=0;n<e.length;n++)e[n][1]||(e[n][1]=e[n][0]);return t=t||!1,function(n,i,r){for(var o={},a=0;a<e.length;a++){var s=e[a][1];if(!(i&&pN(i,s)>=0||r&&0>pN(r,s))){var l=n.getShallow(s,t);null!=l&&(o[e[a][0]]=l)}}return o}}var gH=gj([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),gW=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return gH(this,e,t)},e}(),gG=function(e,t){return(gG=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function g$(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}gG(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var gU=function(e){this.value=e},gq=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new gU(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),gY=function(){function e(e){this._list=new gq,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,i=this._map,r=null;if(null==i[e]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}a?a.value=t:a=new gU(t),a.key=e,n.insertEntry(a),i[e]=a}return r},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(null!=t)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),gZ=new gY(50);function gX(e,t,n,i,r){if(!e)return t;if("string"!=typeof e)return e;if(t&&t.__zrImageSrc===e||!n)return t;var o=gZ.get(e),a={hostEl:n,cb:i,cbPayload:r};return o?gQ(t=o.image)||o.pending.push(a):((t=py.loadImage(e,gK,gK)).__zrImageSrc=e,gZ.put(e,t.__cachedImgObj={image:t,pending:[a]})),t}function gK(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var n=e.pending[t],i=n.cb;i&&i(this,n.cbPayload),n.hostEl.dirty()}e.pending.length=0}function gQ(e){return e&&e.width&&e.height}function gJ(){return[1,0,0,1,0,0]}function g0(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function g1(e,t,n){var i=t[0]*n[0]+t[2]*n[1],r=t[1]*n[0]+t[3]*n[1],o=t[0]*n[2]+t[2]*n[3],a=t[1]*n[2]+t[3]*n[3],s=t[0]*n[4]+t[2]*n[5]+t[4],l=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=i,e[1]=r,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e}function g2(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e}function g5(e,t,n,i){void 0===i&&(i=[0,0]);var r=t[0],o=t[2],a=t[4],s=t[1],l=t[3],u=t[5],c=Math.sin(n),h=Math.cos(n);return e[0]=r*h+s*c,e[1]=-r*c+s*h,e[2]=o*h+l*c,e[3]=-o*c+h*l,e[4]=h*(a-i[0])+c*(u-i[1])+i[0],e[5]=h*(u-i[1])-c*(a-i[0])+i[1],e}function g3(e,t){var n=t[0],i=t[2],r=t[4],o=t[1],a=t[3],s=t[5],l=n*a-o*i;return l?(l=1/l,e[0]=a*l,e[1]=-o*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-a*r)*l,e[5]=(o*r-n*s)*l,e):null}let g4=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.scale=function(e){this.x*=e,this.y*=e},e.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},e.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},e.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},e.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},e.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},e.set=function(e,t,n){e.x=t,e.y=n},e.copy=function(e,t){e.x=t.x,e.y=t.y},e.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},e.lenSquare=function(e){return e.x*e.x+e.y*e.y},e.dot=function(e,t){return e.x*t.x+e.y*t.y},e.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},e.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},e.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},e.scaleAndAdd=function(e,t,n,i){e.x=t.x+n.x*i,e.y=t.y+n.y*i},e.lerp=function(e,t,n,i){var r=1-i;e.x=r*t.x+i*n.x,e.y=r*t.y+i*n.y},e}();var g6=Math.min,g8=Math.max,g9=new g4,g7=new g4,me=new g4,mt=new g4,mn=new g4,mi=new g4;let mr=function(){function e(e,t,n,i){n<0&&(e+=n,n=-n),i<0&&(t+=i,i=-i),this.x=e,this.y=t,this.width=n,this.height=i}return e.prototype.union=function(e){var t=g6(e.x,this.x),n=g6(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=g8(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=g8(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(e){var t,n,i,r=e.width/this.width,o=e.height/this.height,a=gJ();return g2(a,a,[-this.x,-this.y]),n=(t=[r,o])[0],i=t[1],a[0]=a[0]*n,a[1]=a[1]*i,a[2]=a[2]*n,a[3]=a[3]*i,a[4]=a[4]*n,a[5]=a[5]*i,g2(a,a,[e.x,e.y]),a},e.prototype.intersect=function(t,n){if(!t)return!1;t instanceof e||(t=e.create(t));var i=this.x,r=this.x+this.width,o=this.y,a=this.y+this.height,s=t.x,l=t.x+t.width,u=t.y,c=t.y+t.height,h=!(r<s||l<i||a<u||c<o);if(n){var d=1/0,p=0,f=Math.abs(r-s),g=Math.abs(l-i),m=Math.abs(a-u),v=Math.abs(c-o),y=Math.min(f,g),x=Math.min(m,v);r<s||l<i?y>p&&(p=y,f<g?g4.set(mi,-f,0):g4.set(mi,g,0)):y<d&&(d=y,f<g?g4.set(mn,f,0):g4.set(mn,-g,0)),a<u||c<o?x>p&&(p=x,m<v?g4.set(mi,0,-m):g4.set(mi,0,v)):y<d&&(d=y,m<v?g4.set(mn,0,m):g4.set(mn,0,-v))}return n&&g4.copy(n,h?mn:mi),h},e.prototype.contain=function(e,t){return e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return 0===this.width||0===this.height},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},e.applyTransform=function(t,n,i){if(!i){t!==n&&e.copy(t,n);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var r=i[0],o=i[3],a=i[4],s=i[5];t.x=n.x*r+a,t.y=n.y*o+s,t.width=n.width*r,t.height=n.height*o,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}g9.x=me.x=n.x,g9.y=mt.y=n.y,g7.x=mt.x=n.x+n.width,g7.y=me.y=n.y+n.height,g9.transform(i),mt.transform(i),g7.transform(i),me.transform(i),t.x=g6(g9.x,g7.x,me.x,mt.x),t.y=g6(g9.y,g7.y,me.y,mt.y);var l=g8(g9.x,g7.x,me.x,mt.x),u=g8(g9.y,g7.y,me.y,mt.y);t.width=l-t.x,t.height=u-t.y},e}();var mo={};function ma(e,t){var n=mo[t=t||pm];n||(n=mo[t]=new gY(500));var i=n.get(e);return null==i&&(i=py.measureText(e,t).width,n.put(e,i)),i}function ms(e,t,n,i){var r=ma(e,t),o=mh(t);return new mr(mu(0,r,n),mc(0,o,i),r,o)}function ml(e,t,n,i){var r=((e||"")+"").split("\n");if(1===r.length)return ms(r[0],t,n,i);for(var o=new mr(0,0,0,0),a=0;a<r.length;a++){var s=ms(r[a],t,n,i);0===a?o.copy(s):o.union(s)}return o}function mu(e,t,n){return"right"===n?e-=t:"center"===n&&(e-=t/2),e}function mc(e,t,n){return"middle"===n?e-=t/2:"bottom"===n&&(e-=t),e}function mh(e){return ma("国",e)}function md(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function mp(e,t,n){var i=t.position||"inside",r=null!=t.distance?t.distance:5,o=n.height,a=n.width,s=o/2,l=n.x,u=n.y,c="left",h="top";if(i instanceof Array)l+=md(i[0],n.width),u+=md(i[1],n.height),c=null,h=null;else switch(i){case"left":l-=r,u+=s,c="right",h="middle";break;case"right":l+=r+a,u+=s,h="middle";break;case"top":l+=a/2,u-=r,c="center",h="bottom";break;case"bottom":l+=a/2,u+=o+r,c="center";break;case"inside":l+=a/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=r,u+=s,h="middle";break;case"insideRight":l+=a-r,u+=s,c="right",h="middle";break;case"insideTop":l+=a/2,u+=r,c="center";break;case"insideBottom":l+=a/2,u+=o-r,c="center",h="bottom";break;case"insideTopLeft":l+=r,u+=r;break;case"insideTopRight":l+=a-r,u+=r,c="right";break;case"insideBottomLeft":l+=r,u+=o-r,h="bottom";break;case"insideBottomRight":l+=a-r,u+=o-r,c="right",h="bottom"}return(e=e||{}).x=l,e.y=u,e.align=c,e.verticalAlign=h,e}var mf=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function mg(e,t,n,i){var r=pR({},i=i||{});r.font=t,n=p5(n,"..."),r.maxIterations=p5(i.maxIterations,2);var o=r.minChar=p5(i.minChar,0);r.cnCharWidth=ma("国",t);var a=r.ascCharWidth=ma("a",t);r.placeholder=p5(i.placeholder,"");for(var s=e=Math.max(0,e-1),l=0;l<o&&s>=a;l++)s-=a;var u=ma(n,t);return u>s&&(n="",u=0),s=e-u,r.ellipsis=n,r.ellipsisWidth=u,r.contentWidth=s,r.containerWidth=e,r}function mm(e,t){var n=t.containerWidth,i=t.font,r=t.contentWidth;if(!n)return"";var o=ma(e,i);if(o<=n)return e;for(var a=0;;a++){if(o<=r||a>=t.maxIterations){e+=t.ellipsis;break}var s=0===a?function(e,t,n,i){for(var r=0,o=0,a=e.length;o<a&&r<t;o++){var s=e.charCodeAt(o);r+=0<=s&&s<=127?n:i}return o}(e,r,t.ascCharWidth,t.cnCharWidth):o>0?Math.floor(e.length*r/o):0;o=ma(e=e.substr(0,s),i)}return""===e&&(e=t.placeholder),e}var mv=function(){},my=function(e){this.tokens=[],e&&(this.tokens=e)},mx=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]};function mb(e,t,n,i,r){var o,a,s=""===t,l=r&&n.rich[r]||{},u=e.lines,c=l.font||n.font,h=!1;if(i){var d=l.padding,p=d?d[1]+d[3]:0;if(null!=l.width&&"auto"!==l.width){var f=md(l.width,i.width)+p;u.length>0&&f+i.accumWidth>i.width&&(o=t.split("\n"),h=!0),i.accumWidth=f}else{var g=mS(t,c,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+p,a=g.linesWidths,o=g.lines}}else o=t.split("\n");for(var m=0;m<o.length;m++){var v=o[m],y=new mv;if(y.styleName=r,y.text=v,y.isLineHolder=!v&&!s,"number"==typeof l.width?y.width=l.width:y.width=a?a[m]:ma(v,c),m||h)u.push(new my([y]));else{var x=(u[u.length-1]||(u[0]=new my)).tokens,b=x.length;1===b&&x[0].isLineHolder?x[0]=y:(v||!b||s)&&x.push(y)}}}var mw=pj(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function mS(e,t,n,i,r){for(var o=[],a=[],s="",l="",u=0,c=0,h=0;h<e.length;h++){var d=e.charAt(h);if("\n"===d){l&&(s+=l,c+=u),o.push(s),a.push(c),s="",l="",u=0,c=0;continue}var p=ma(d,t),f=!i&&!function(e){var t;return(!((t=e.charCodeAt(0))>=32)||!(t<=591))&&(!(t>=880)||!(t<=4351))&&(!(t>=4608)||!(t<=5119))&&(!(t>=7680)||!(t<=8303))||!!mw[e]}(d);if(o.length?c+p>n:r+c+p>n){c?(s||l)&&(f?(s||(s=l,l="",c=u=0),o.push(s),a.push(c-u),l+=d,u+=p,s="",c=u):(l&&(s+=l,l="",u=0),o.push(s),a.push(c),s=d,c=p)):f?(o.push(l),a.push(u),l=d,u=p):(o.push(d),a.push(p));continue}c+=p,f?(l+=d,u+=p):(l&&(s+=l,l="",u=0),s+=d)}return o.length||s||(s=e,l="",u=0),l&&(s+=l),s&&(o.push(s),a.push(c)),1===o.length&&(c+=r),{accumWidth:c,lines:o,linesWidths:a}}function m_(e,t){return null==e&&(e=0),null==t&&(t=0),[e,t]}function mM(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function mC(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function mA(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function mk(e,t){var n,i=Math.sqrt((n=t)[0]*n[0]+n[1]*n[1]);return 0===i?(e[0]=0,e[1]=0):(e[0]=t[0]/i,e[1]=t[1]/i),e}function mT(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var mD=function(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])};function mI(e,t,n,i){return e[0]=t[0]+i*(n[0]-t[0]),e[1]=t[1]+i*(n[1]-t[1]),e}function mO(e,t,n){var i=t[0],r=t[1];return e[0]=n[0]*i+n[2]*r+n[4],e[1]=n[1]*i+n[3]*r+n[5],e}function mP(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function mE(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}function mR(e){return e>5e-5||e<-5e-5}var mL=[],mN=[],mB=gJ(),mF=Math.abs,mz=function(){var e;function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},t.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},t.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},t.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},t.prototype.needLocalTransform=function(){return mR(this.rotation)||mR(this.x)||mR(this.y)||mR(this.scaleX-1)||mR(this.scaleY-1)||mR(this.skewX)||mR(this.skewY)},t.prototype.updateTransform=function(){var e,t=this.parent&&this.parent.transform,n=this.needLocalTransform(),i=this.transform;if(!(n||t)){i&&(g0(i),this.invTransform=null);return}i=i||gJ(),n?this.getLocalTransform(i):g0(i),t&&(n?g1(i,t,i):((e=i)[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5])),this.transform=i,this._resolveGlobalScaleRatio(i)},t.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(null!=t&&1!==t){this.getGlobalScale(mL);var n=mL[0]<0?-1:1,i=mL[1]<0?-1:1,r=((mL[0]-n)*t+n)/mL[0]||0,o=((mL[1]-i)*t+i)/mL[1]||0;e[0]*=r,e[1]*=r,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||gJ(),g3(this.invTransform,e)},t.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},t.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],i=Math.atan2(e[1],e[0]),r=Math.PI/2+i-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(r),t=Math.sqrt(t),this.skewX=r,this.skewY=0,this.rotation=-i,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||gJ(),g1(mN,e.invTransform,t),t=mN);var n=this.originX,i=this.originY;(n||i)&&(mB[4]=n,mB[5]=i,g1(mN,t,mB),mN[4]-=n,mN[5]-=i,t=mN),this.setLocalTransform(t)}},t.prototype.getGlobalScale=function(e){var t=this.transform;return(e=e||[],t)?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1])):(e[0]=1,e[1]=1),e},t.prototype.transformCoordToLocal=function(e,t){var n=[e,t],i=this.invTransform;return i&&mO(n,n,i),n},t.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],i=this.transform;return i&&mO(n,n,i),n},t.prototype.getLineScale=function(){var e=this.transform;return e&&mF(e[0]-1)>1e-10&&mF(e[3]-1)>1e-10?Math.sqrt(mF(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){for(var t=this,n=e,i=0;i<mV.length;i++){var r=mV[i];t[r]=n[r]}},t.getLocalTransform=function(e,t){t=t||[];var n=e.originX||0,i=e.originY||0,r=e.scaleX,o=e.scaleY,a=e.anchorX,s=e.anchorY,l=e.rotation||0,u=e.x,c=e.y,h=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(n||i||a||s){var p=n+a,f=i+s;t[4]=-p*r-h*f*o,t[5]=-f*o-d*p*r}else t[4]=t[5]=0;return t[0]=r,t[3]=o,t[1]=d*r,t[2]=h*o,l&&g5(t,t,l),t[4]+=n+u,t[5]+=i+c,t},t.initDefaultProps=void((e=t.prototype).scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0),t}(),mV=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"],mj={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin(2*Math.PI*(e-t)/.4)))},elasticOut:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin(2*Math.PI*(e-t)/.4)+1)},elasticInOut:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),(e*=2)<1)?-.5*(n*Math.pow(2,10*(e-=1))*Math.sin(2*Math.PI*(e-t)/.4)):n*Math.pow(2,-10*(e-=1))*Math.sin(2*Math.PI*(e-t)/.4)*.5+1},backIn:function(e){return e*e*(2.70158*e-1.70158)},backOut:function(e){return--e*e*(2.70158*e+1.70158)+1},backInOut:function(e){return(e*=2)<1?e*e*(3.5949095*e-2.5949095)*.5:.5*((e-=2)*e*(3.5949095*e+2.5949095)+2)},bounceIn:function(e){return 1-mj.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*mj.bounceIn(2*e):.5*mj.bounceOut(2*e-1)+.5}},mH=Math.pow,mW=Math.sqrt,mG=mW(3),m$=1/3,mU=m_(),mq=m_(),mY=m_();function mZ(e){return e>-1e-8&&e<1e-8}function mX(e){return e>1e-8||e<-1e-8}function mK(e,t,n,i,r){var o=1-r;return o*o*(o*e+3*r*t)+r*r*(r*i+3*o*n)}function mQ(e,t,n,i,r){var o=1-r;return 3*(((t-e)*o+2*(n-t)*r)*o+(i-n)*r*r)}function mJ(e,t,n,i,r,o){var a=i+3*(t-n)-e,s=3*(n-2*t+e),l=3*(t-e),u=e-r,c=s*s-3*a*l,h=s*l-9*a*u,d=l*l-3*s*u,p=0;if(mZ(c)&&mZ(h))if(mZ(s))o[0]=0;else{var f=-l/s;f>=0&&f<=1&&(o[p++]=f)}else{var g=h*h-4*c*d;if(mZ(g)){var m=h/c,f=-s/a+m,v=-m/2;f>=0&&f<=1&&(o[p++]=f),v>=0&&v<=1&&(o[p++]=v)}else if(g>0){var y=mW(g),x=c*s+1.5*a*(-h+y),b=c*s+1.5*a*(-h-y),f=(-s-((x=x<0?-mH(-x,m$):mH(x,m$))+(b=b<0?-mH(-b,m$):mH(b,m$))))/(3*a);f>=0&&f<=1&&(o[p++]=f)}else{var w=Math.acos((2*c*s-3*a*h)/(2*mW(c*c*c)))/3,S=mW(c),_=Math.cos(w),f=(-s-2*S*_)/(3*a),v=(-s+S*(_+mG*Math.sin(w)))/(3*a),M=(-s+S*(_-mG*Math.sin(w)))/(3*a);f>=0&&f<=1&&(o[p++]=f),v>=0&&v<=1&&(o[p++]=v),M>=0&&M<=1&&(o[p++]=M)}}return p}function m0(e,t,n,i,r){var o=6*n-12*t+6*e,a=9*t+3*i-3*e-9*n,s=3*t-3*e,l=0;if(mZ(a)){if(mX(o)){var u=-s/o;u>=0&&u<=1&&(r[l++]=u)}}else{var c=o*o-4*a*s;if(mZ(c))r[0]=-o/(2*a);else if(c>0){var h=mW(c),u=(-o+h)/(2*a),d=(-o-h)/(2*a);u>=0&&u<=1&&(r[l++]=u),d>=0&&d<=1&&(r[l++]=d)}}return l}function m1(e,t,n,i,r,o){var a=(t-e)*r+e,s=(n-t)*r+t,l=(i-n)*r+n,u=(s-a)*r+a,c=(l-s)*r+s,h=(c-u)*r+u;o[0]=e,o[1]=a,o[2]=u,o[3]=h,o[4]=h,o[5]=c,o[6]=l,o[7]=i}function m2(e,t,n,i){var r=1-i;return r*(r*e+2*i*t)+i*i*n}function m5(e,t,n,i){return 2*((1-i)*(t-e)+i*(n-t))}function m3(e,t,n){var i=e+n-2*t;return 0===i?.5:(e-t)/i}function m4(e,t,n,i,r){var o=(t-e)*i+e,a=(n-t)*i+t,s=(a-o)*i+o;r[0]=e,r[1]=o,r[2]=s,r[3]=s,r[4]=a,r[5]=n}var m6=/cubic-bezier\(([0-9,\.e ]+)\)/;function m8(e){var t=e&&m6.exec(e);if(t){var n=t[1].split(","),i=+p9(n[0]),r=+p9(n[1]),o=+p9(n[2]),a=+p9(n[3]);if(isNaN(i+r+o+a))return;var s=[];return function(e){return e<=0?0:e>=1?1:mJ(0,i,o,1,e,s)&&mK(0,r,a,1,s[0])}}}var m9=function(){function e(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||fs,this.ondestroy=e.ondestroy||fs,this.onrestart=e.onrestart||fs,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var n=this._life,i=e-this._startTime-this._pausedTime,r=i/n;r<0&&(r=0),r=Math.min(r,1);var o=this.easingFunc,a=o?o(r):r;if(this.onframe(a),1===r)if(!this.loop)return!0;else this._startTime=e-i%n,this._pausedTime=0,this.onrestart();return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=pq(e)?e:mj[e]||m8(e)},e}(),m7={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function ve(e){return(e=Math.round(e))<0?0:e>255?255:e}function vt(e){return e<0?0:e>1?1:e}function vn(e){return e.length&&"%"===e.charAt(e.length-1)?ve(parseFloat(e)/100*255):ve(parseInt(e,10))}function vi(e){return e.length&&"%"===e.charAt(e.length-1)?vt(parseFloat(e)/100):vt(parseFloat(e))}function vr(e,t,n){return(n<0?n+=1:n>1&&(n-=1),6*n<1)?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function vo(e,t,n,i,r){return e[0]=t,e[1]=n,e[2]=i,e[3]=r,e}function va(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var vs=new gY(20),vl=null;function vu(e,t){vl&&va(vl,t),vl=vs.put(e,vl||t.slice())}function vc(e,t){if(e){t=t||[];var n=vs.get(e);if(n)return va(t,n);var i=(e+="").replace(/ /g,"").toLowerCase();if(i in m7)return va(t,m7[i]),vu(e,t),t;var r=i.length;if("#"===i.charAt(0)){if(4===r||5===r){var o=parseInt(i.slice(1,4),16);return o>=0&&o<=4095?(vo(t,(3840&o)>>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,5===r?parseInt(i.slice(4),16)/15:1),vu(e,t),t):void vo(t,0,0,0,1)}if(7===r||9===r){var o=parseInt(i.slice(1,7),16);return o>=0&&o<=0xffffff?(vo(t,(0xff0000&o)>>16,(65280&o)>>8,255&o,9===r?parseInt(i.slice(7),16)/255:1),vu(e,t),t):void vo(t,0,0,0,1)}return}var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===r){var l=i.substr(0,a),u=i.substr(a+1,s-(a+1)).split(","),c=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?vo(t,+u[0],+u[1],+u[2],1):vo(t,0,0,0,1);c=vi(u.pop());case"rgb":if(u.length>=3)return vo(t,vn(u[0]),vn(u[1]),vn(u[2]),3===u.length?c:vi(u[3])),vu(e,t),t;return void vo(t,0,0,0,1);case"hsla":if(4!==u.length)return void vo(t,0,0,0,1);return u[3]=vi(u[3]),vh(u,t),vu(e,t),t;case"hsl":if(3!==u.length)return void vo(t,0,0,0,1);return vh(u,t),vu(e,t),t;default:return}}vo(t,0,0,0,1)}}function vh(e,t){var n=(parseFloat(e[0])%360+360)%360/360,i=vi(e[1]),r=vi(e[2]),o=r<=.5?r*(i+1):r+i-r*i,a=2*r-o;return vo(t=t||[],ve(255*vr(a,o,n+1/3)),ve(255*vr(a,o,n)),ve(255*vr(a,o,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}function vd(e,t){var n=vc(e);if(n){for(var i=0;i<3;i++)t<0?n[i]=n[i]*(1-t)|0:n[i]=(255-n[i])*t+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return vm(n,4===n.length?"rgba":"rgb")}}function vp(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var i,r,o,a,s=e*(t.length-1),l=Math.floor(s),u=Math.ceil(s),c=t[l],h=t[u],d=s-l;return n[0]=ve((i=c[0],i+(h[0]-i)*d)),n[1]=ve((r=c[1],r+(h[1]-r)*d)),n[2]=ve((o=c[2],o+(h[2]-o)*d)),n[3]=vt((a=c[3],a+(h[3]-a)*d)),n}}function vf(e,t,n,i){var r,o=vc(e);if(e)return o=function(e){if(e){var t,n,i=e[0]/255,r=e[1]/255,o=e[2]/255,a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a,u=(s+a)/2;if(0===l)t=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var c=((s-i)/6+l/2)/l,h=((s-r)/6+l/2)/l,d=((s-o)/6+l/2)/l;i===s?t=d-h:r===s?t=1/3+c-d:o===s&&(t=2/3+h-c),t<0&&(t+=1),t>1&&(t-=1)}var p=[360*t,n,u];return null!=e[3]&&p.push(e[3]),p}}(o),null!=t&&(o[0]=(r=Math.round(r=t))<0?0:r>360?360:r),null!=n&&(o[1]=vi(n)),null!=i&&(o[2]=vi(i)),vm(vh(o),"rgba")}function vg(e,t){var n=vc(e);if(n&&null!=t)return n[3]=vt(t),vm(n,"rgba")}function vm(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return("rgba"===t||"hsva"===t||"hsla"===t)&&(n+=","+e[3]),t+"("+n+")"}}function vv(e,t){var n=vc(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var vy=new gY(100);function vx(e){if(pY(e)){var t=vy.get(e);return t||(t=vd(e,-.1),vy.put(e,t)),t}if(p1(e)){var n=pR({},e);return n.colorStops=pV(e.colorStops,function(e){return{offset:e.offset,color:vd(e.color,-.1)}}),n}return e}fA.hasGlobalWindow&&pq(window.btoa);var vb=Array.prototype.slice;function vw(e,t,n,i){for(var r,o=t.length,a=0;a<o;a++)e[a]=(r=t[a],(n[a]-r)*i+r);return e}function vS(e,t,n,i){for(var r=t.length,o=0;o<r;o++)e[o]=t[o]+n[o]*i;return e}function v_(e,t,n,i){for(var r=t.length,o=r&&t[0].length,a=0;a<r;a++){e[a]||(e[a]=[]);for(var s=0;s<o;s++)e[a][s]=t[a][s]+n[a][s]*i}return e}function vM(e){if(pF(e)){var t=e.length;if(pF(e[0])){for(var n=[],i=0;i<t;i++)n.push(vb.call(e[i]));return n}return vb.call(e)}return e}function vC(e){return e[0]=Math.floor(e[0])||0,e[1]=Math.floor(e[1])||0,e[2]=Math.floor(e[2])||0,e[3]=null==e[3]?1:e[3],"rgba("+e.join(",")+")"}function vA(e){return 4===e||5===e}function vk(e){return 1===e||2===e}var vT=[0,0,0,0],vD=function(){function e(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return e.prototype.isFinished=function(){return this._finished},e.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},e.prototype.needsAnimate=function(){return this.keyframes.length>=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var i=this.keyframes,r=i.length,o=!1,a=6,s=t;if(pF(t)){var l=pF(t&&t[0])?2:1;a=l,(1!==l||pX(t[0]))&&(2!==l||pX(t[0][0]))||(o=!0)}else if(pX(t)&&t==t)a=0;else if(pY(t))if(isNaN(+t)){var u=vc(t);u&&(s=u,a=3)}else a=0;else if(p1(t)){var c=pR({},s);(c.colorStops=pV(t.colorStops,function(e){return{offset:e.offset,color:vc(e.color)}}),"linear"===t.type)?a=4:"radial"===t.type&&(a=5),s=c}0===r?this.valType=a:(a!==this.valType||6===a)&&(o=!0),this.discrete=this.discrete||o;var h={time:e,value:s,rawValue:t,percent:0};return n&&(h.easing=n,h.easingFunc=pq(n)?n:mj[n]||m8(n)),i.push(h),h},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(e,t){return e.time-t.time});for(var i=this.valType,r=n.length,o=n[r-1],a=this.discrete,s=vk(i),l=vA(i),u=0;u<r;u++){var c=n[u],h=c.value,d=o.value;c.percent=c.time/e,!a&&(s&&u!==r-1?function(e,t,n){if(e.push&&t.push){var i=e.length,r=t.length;if(i!==r)if(i>r)e.length=r;else for(var o=i;o<r;o++)e.push(1===n?t[o]:vb.call(t[o]));for(var a=e[0]&&e[0].length,o=0;o<e.length;o++)if(1===n)isNaN(e[o])&&(e[o]=t[o]);else for(var s=0;s<a;s++)isNaN(e[o][s])&&(e[o][s]=t[o][s])}}(h,d,i):l&&function(e,t){for(var n=e.length,i=t.length,r=n>i?t:e,o=Math.min(n,i),a=r[o-1]||{color:[0,0,0,0],offset:0},s=o;s<Math.max(n,i);s++)r.push({offset:a.offset,color:a.color.slice()})}(h.colorStops,d.colorStops))}if(!a&&5!==i&&t&&this.needsAnimate()&&t.needsAnimate()&&i===t.valType&&!t._finished){this._additiveTrack=t;for(var p=n[0].value,u=0;u<r;u++)0===i?n[u].additiveValue=n[u].value-p:3===i?n[u].additiveValue=vS([],n[u].value,p,-1):vk(i)&&(n[u].additiveValue=1===i?vS([],n[u].value,p,-1):v_([],n[u].value,p,-1))}},e.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n,i,r,o=null!=this._additiveTrack,a=o?"additiveValue":"value",s=this.valType,l=this.keyframes,u=l.length,c=this.propName,h=3===s,d=this._lastFr,p=Math.min;if(1===u)i=r=l[0];else{if(t<0)n=0;else if(t<this._lastFrP){for(n=p(d+1,u-1);n>=0&&!(l[n].percent<=t);n--);n=p(n,u-2)}else{for(n=d;n<u&&!(l[n].percent>t);n++);n=p(n-1,u-2)}r=l[n+1],i=l[n]}if(i&&r){this._lastFr=n,this._lastFrP=t;var f=r.percent-i.percent,g=0===f?1:p((t-i.percent)/f,1);r.easingFunc&&(g=r.easingFunc(g));var m=o?this._additiveValue:h?vT:e[c];if((vk(s)||h)&&!m&&(m=this._additiveValue=[]),this.discrete)e[c]=g<1?i.rawValue:r.rawValue;else if(vk(s))1===s?vw(m,i[a],r[a],g):function(e,t,n,i){for(var r=t.length,o=r&&t[0].length,a=0;a<r;a++){e[a]||(e[a]=[]);for(var s,l=0;l<o;l++)e[a][l]=(s=t[a][l],(n[a][l]-s)*i+s)}}(m,i[a],r[a],g);else if(vA(s)){var v,y,x,b,w,S=i[a],_=r[a],M=4===s;(e[c]={type:M?"linear":"radial",x:(v=S.x,(_.x-v)*g+v),y:(y=S.y,(_.y-y)*g+y),colorStops:pV(S.colorStops,function(e,t){var n,i=_.colorStops[t];return{offset:(n=e.offset,(i.offset-n)*g+n),color:vC(vw([],e.color,i.color,g))}}),global:_.global},M)?(e[c].x2=(x=S.x2,(_.x2-x)*g+x),e[c].y2=(b=S.y2,(_.y2-b)*g+b)):e[c].r=(w=S.r,(_.r-w)*g+w)}else if(h)vw(m,i[a],r[a],g),o||(e[c]=vC(m));else{var C,A=(C=i[a],(r[a]-C)*g+C);o?this._additiveValue=A:e[c]=A}o&&this._addToTarget(e)}}},e.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,i=this._additiveValue;0===t?e[n]=e[n]+i:3===t?(vc(e[n],vT),vS(vT,vT,i,1),e[n]=vC(vT)):1===t?vS(e[n],e[n],i,1):2===t&&v_(e[n],e[n],i,1)},e}(),vI=function(){function e(e,t,n,i){(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&i)?pO("Can' use additive animation on looped animation."):(this._additiveAnimators=i,this._allowDiscrete=n)}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,pW(t),n)},e.prototype.whenWithKeys=function(e,t,n,i){for(var r=this._tracks,o=0;o<n.length;o++){var a=n[o],s=r[a];if(!s){s=r[a]=new vD(a);var l=void 0,u=this._getAdditiveTrack(a);if(u){var c=u.keyframes,h=c[c.length-1];l=h&&h.value,3===u.valType&&l&&(l=vC(l))}else l=this._target[a];if(null==l)continue;e>0&&s.addKeyframe(0,vM(l),i),this._trackKeys.push(a)}s.addKeyframe(e,vM(t[a]),i)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n<t;n++)e[n].call(this)},e.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var n=0;n<t.length;n++)t[n].call(this)},e.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,n=0;n<t.length;n++)e[t[n]].setFinished()},e.prototype._getAdditiveTrack=function(e){var t,n=this._additiveAnimators;if(n)for(var i=0;i<n.length;i++){var r=n[i].getTrack(e);r&&(t=r)}return t},e.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,n=[],i=this._maxTime||0,r=0;r<this._trackKeys.length;r++){var o=this._trackKeys[r],a=this._tracks[o],s=this._getAdditiveTrack(o),l=a.keyframes,u=l.length;if(a.prepare(i,s),a.needsAnimate())if(!this._allowDiscrete&&a.discrete){var c=l[u-1];c&&(t._target[a.propName]=c.rawValue),a.setFinished()}else n.push(a)}if(n.length||this._force){var h=new m9({life:i,loop:this._loop,delay:this._delay||0,onframe:function(e){t._started=2;var i=t._additiveAnimators;if(i){for(var r=!1,o=0;o<i.length;o++)if(i[o]._clip){r=!0;break}r||(t._additiveAnimators=null)}for(var o=0;o<n.length;o++)n[o].step(t._target,e);var a=t._onframeCbs;if(a)for(var o=0;o<a.length;o++)a[o](t._target,e)},ondestroy:function(){t._doneCallback()}});this._clip=h,this.animation&&this.animation.addClip(h),e&&h.setEasing(e)}else this._doneCallback();return this}},e.prototype.stop=function(e){if(this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},e.prototype.delay=function(e){return this._delay=e,this},e.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},e.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},e.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},e.prototype.getClip=function(){return this._clip},e.prototype.getTrack=function(e){return this._tracks[e]},e.prototype.getTracks=function(){var e=this;return pV(this._trackKeys,function(t){return e._tracks[t]})},e.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var n=this._tracks,i=this._trackKeys,r=0;r<e.length;r++){var o=n[e[r]];o&&!o.isFinished()&&(t?o.step(this._target,1):1===this._started&&o.step(this._target,0),o.setFinished())}for(var a=!0,r=0;r<i.length;r++)if(!n[i[r]].isFinished()){a=!1;break}return a&&this._abortedCallback(),a},e.prototype.saveTo=function(e,t,n){if(e){t=t||this._trackKeys;for(var i=0;i<t.length;i++){var r=t[i],o=this._tracks[r];if(!(!o||o.isFinished())){var a=o.keyframes,s=a[n?0:a.length-1];s&&(e[r]=vM(s.rawValue))}}}},e.prototype.__changeFinalValue=function(e,t){t=t||pW(e);for(var n=0;n<t.length;n++){var i=t[n],r=this._tracks[i];if(r){var o=r.keyframes;if(o.length>1){var a=o.pop();r.addKeyframe(a.time,e[i]),r.prepare(this._maxTime,r.getAdditiveTrack())}}}},e}(),vO=function(){function e(e){e&&(this._$eventProcessor=e)}return e.prototype.on=function(e,t,n,i){this._$handlers||(this._$handlers={});var r=this._$handlers;if("function"==typeof t&&(i=n,n=t,t=null),!n||!e)return this;var o=this._$eventProcessor;null!=t&&o&&o.normalizeQuery&&(t=o.normalizeQuery(t)),r[e]||(r[e]=[]);for(var a=0;a<r[e].length;a++)if(r[e][a].h===n)return this;var s={h:n,query:t,ctx:i||this,callAtLast:n.zrEventfulCallAtLast},l=r[e].length-1,u=r[e][l];return u&&u.callAtLast?r[e].splice(l,0,s):r[e].push(s),this},e.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},e.prototype.off=function(e,t){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(t){if(n[e]){for(var i=[],r=0,o=n[e].length;r<o;r++)n[e][r].h!==t&&i.push(n[e][r]);n[e]=i}n[e]&&0===n[e].length&&delete n[e]}else delete n[e];return this},e.prototype.trigger=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!this._$handlers)return this;var i=this._$handlers[e],r=this._$eventProcessor;if(i)for(var o=t.length,a=i.length,s=0;s<a;s++){var l=i[s];if(!r||!r.filter||null==l.query||r.filter(e,l.query))switch(o){case 0:l.h.call(l.ctx);break;case 1:l.h.call(l.ctx,t[0]);break;case 2:l.h.call(l.ctx,t[0],t[1]);break;default:l.h.apply(l.ctx,t)}}return r&&r.afterTrigger&&r.afterTrigger(e),this},e.prototype.triggerWithContext=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!this._$handlers)return this;var i=this._$handlers[e],r=this._$eventProcessor;if(i)for(var o=t.length,a=t[o-1],s=i.length,l=0;l<s;l++){var u=i[l];if(!r||!r.filter||null==u.query||r.filter(e,u.query))switch(o){case 0:u.h.call(a);break;case 1:u.h.call(a,t[0]);break;case 2:u.h.call(a,t[0],t[1]);break;default:u.h.apply(a,t.slice(1,o-1))}}return r&&r.afterTrigger&&r.afterTrigger(e),this},e}(),vP=1;fA.hasGlobalWindow&&(vP=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var vE=vP,vR="#333",vL="#ccc",vN="__zr_normal__",vB=mV.concat(["ignore"]),vF=pj(mV,function(e,t){return e[t]=!0,e},{ignore:!1}),vz={},vV=new mr(0,0,0,0),vj=function(){function e(e){this.id=pI++,this.animators=[],this.currentStates=[],this.states={},this._init(e)}return e.prototype._init=function(e){this.attr(e)},e.prototype.drift=function(e,t,n){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,r=t.innerTransformable,o=void 0,a=void 0,s=!1;r.parent=i?this:null;var l=!1;if(r.copyTransform(t),null!=n.position){n.layoutRect?vV.copy(n.layoutRect):vV.copy(this.getBoundingRect()),i||vV.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(vz,n,vV):mp(vz,n,vV),r.x=vz.x,r.y=vz.y,o=vz.align,a=vz.verticalAlign;var u=n.origin;if(u&&null!=n.rotation){var c=void 0,h=void 0;"center"===u?(c=.5*vV.width,h=.5*vV.height):(c=md(u[0],vV.width),h=md(u[1],vV.height)),l=!0,r.originX=-r.x+c+(i?0:vV.x),r.originY=-r.y+h+(i?0:vV.y)}}null!=n.rotation&&(r.rotation=n.rotation);var d=n.offset;d&&(r.x+=d[0],r.y+=d[1],l||(r.originX=-d[0],r.originY=-d[1]));var p=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,f=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),g=void 0,m=void 0,v=void 0;p&&this.canBeInsideText()?(g=n.insideFill,m=n.insideStroke,(null==g||"auto"===g)&&(g=this.getInsideTextFill()),(null==m||"auto"===m)&&(m=this.getInsideTextStroke(g),v=!0)):(g=n.outsideFill,m=n.outsideStroke,(null==g||"auto"===g)&&(g=this.getOutsideFill()),(null==m||"auto"===m)&&(m=this.getOutsideStroke(g),v=!0)),((g=g||"#000")!==f.fill||m!==f.stroke||v!==f.autoStroke||o!==f.align||a!==f.verticalAlign)&&(s=!0,f.fill=g,f.stroke=m,f.autoStroke=v,f.align=o,f.verticalAlign=a,t.setDefaultTextStyle(f)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(e){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?vL:vR},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof t&&vc(t);n||(n=[255,255,255,1]);for(var i=n[3],r=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+255*!r*(1-i);return n[3]=1,vm(n,"rgba")},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){"textConfig"===e?this.setTextConfig(t):"textContent"===e?this.setTextContent(t):"clipPath"===e?this.setClipPath(t):"extra"===e?(this.extra=this.extra||{},pR(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if("string"==typeof e)this.attrKV(e,t);else if(pK(e))for(var n=pW(e),i=0;i<n.length;i++){var r=n[i];this.attrKV(r,e[r])}return this.markRedraw(),this},e.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,n=0;n<this.animators.length;n++){var i=this.animators[n],r=i.__fromStateTransition;if(!i.getLoop()&&(!r||r===vN)){var o=i.targetName,a=o?t[o]:t;i.saveTo(a)}}},e.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||(t=this._normalState={}),e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,vB)},e.prototype._savePrimaryToNormal=function(e,t,n){for(var i=0;i<n.length;i++){var r=n[i];null==e[r]||r in t||(t[r]=this[r])}},e.prototype.hasState=function(){return this.currentStates.length>0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(vN,!1,e)},e.prototype.useState=function(e,t,n,i){var r,o=e===vN;if(this.hasState()||!o){var a=this.currentStates,s=this.stateTransition;if(!(pN(a,e)>=0)||!t&&1!==a.length){if(this.stateProxy&&!o&&(r=this.stateProxy(e)),r||(r=this.states&&this.states[e]),!r&&!o)return void pO("State "+e+" not exists.");o||this.saveCurrentToNormalState(r);var l=!!(r&&r.hoverLayer||i);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,r,this._normalState,t,!n&&!this.__inHover&&s&&s.duration>0,s);var u=this._textContent,c=this._textGuide;return u&&u.useState(e,t,n,l),c&&c.useState(e,t,n,l),o?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),r}}},e.prototype.useStates=function(e,t,n){if(e.length){var i=[],r=this.currentStates,o=e.length,a=o===r.length;if(a){for(var s=0;s<o;s++)if(e[s]!==r[s]){a=!1;break}}if(!a){for(var s=0;s<o;s++){var l=e[s],u=void 0;this.stateProxy&&(u=this.stateProxy(l,e)),u||(u=this.states[l]),u&&i.push(u)}var c=i[o-1],h=!!(c&&c.hoverLayer||n);h&&this._toggleHoverLayerFlag(!0);var d=this._mergeStates(i),p=this.stateTransition;this.saveCurrentToNormalState(d),this._applyStateObj(e.join(","),d,this._normalState,!1,!t&&!this.__inHover&&p&&p.duration>0,p);var f=this._textContent,g=this._textGuide;f&&f.useStates(e,t,h),g&&g.useStates(e,t,h),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}}else this.clearStates()},e.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},e.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},e.prototype.removeState=function(e){var t=pN(this.currentStates,e);if(t>=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var i=this.currentStates.slice(),r=pN(i,e),o=pN(i,t)>=0;r>=0?o?i.splice(r,1):i[r]=t:n&&!o&&i.push(t),this.useStates(i)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t,n={},i=0;i<e.length;i++){var r=e[i];pR(n,r),r.textConfig&&pR(t=t||{},r.textConfig)}return t&&(n.textConfig=t),n},e.prototype._applyStateObj=function(e,t,n,i,r,o){var a=!(t&&i);t&&t.textConfig?(this.textConfig=pR({},i?this.textConfig:n.textConfig),pR(this.textConfig,t.textConfig)):a&&n.textConfig&&(this.textConfig=n.textConfig);for(var s={},l=!1,u=0;u<vB.length;u++){var c=vB[u],h=r&&vF[c];t&&null!=t[c]?h?(l=!0,s[c]=t[c]):this[c]=t[c]:a&&null!=n[c]&&(h?(l=!0,s[c]=n[c]):this[c]=n[c])}if(!r)for(var u=0;u<this.animators.length;u++){var d=this.animators[u],p=d.targetName;d.getLoop()||d.__changeFinalValue(p?(t||n)[p]:t||n)}l&&this._transitionState(e,s,o)},e.prototype._attachComponent=function(e){if((!e.__zr||e.__hostTarget)&&e!==this){var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this}},e.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},e.prototype.getClipPath=function(){return this._clipPath},e.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},e.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},e.prototype.getTextContent=function(){return this._textContent},e.prototype.setTextContent=function(e){var t=this._textContent;t!==e&&(t&&t!==e&&this.removeTextContent(),e.innerTransformable=new mz,this._attachComponent(e),this._textContent=e,this.markRedraw())},e.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),pR(this.textConfig,e),this.markRedraw()},e.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},e.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},e.prototype.getTextGuideLine=function(){return this._textGuide},e.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},e.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},e.prototype.markRedraw=function(){this.__dirty|=1;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},e.prototype.dirty=function(){this.markRedraw()},e.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var t=this._textContent,n=this._textGuide;t&&(t.__inHover=e),n&&(n.__inHover=e)},e.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.addAnimator(t[n]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},e.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.removeAnimator(t[n]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},e.prototype.animate=function(e,t,n){var i=new vI(e?this[e]:this,t,n);return e&&(i.targetName=e),this.addAnimator(i,e),i},e.prototype.addAnimator=function(e,t){var n=this.__zr,i=this;e.during(function(){i.updateDuringAnimation(t)}).done(function(){var t=i.animators,n=pN(t,e);n>=0&&t.splice(n,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,i=n.length,r=[],o=0;o<i;o++){var a=n[o];e&&e!==a.scope?r.push(a):a.stop(t)}return this.animators=r,this},e.prototype.animateTo=function(e,t,n){vH(this,e,t,n)},e.prototype.animateFrom=function(e,t,n){vH(this,e,t,n,!0)},e.prototype._transitionState=function(e,t,n,i){for(var r=vH(this,t,n,i),o=0;o<r.length;o++)r[o].__fromStateTransition=e},e.prototype.getBoundingRect=function(){return null},e.prototype.getPaintRect=function(){return null},e.initDefaultProps=function(){var t=e.prototype;function n(e,n,i,r){Object.defineProperty(t,e,{get:function(){return this[n]||o(this,this[n]=[]),this[n]},set:function(e){this[i]=e[0],this[r]=e[1],this[n]=e,o(this,e)}});function o(e,t){Object.defineProperty(t,0,{get:function(){return e[i]},set:function(t){e[i]=t}}),Object.defineProperty(t,1,{get:function(){return e[r]},set:function(t){e[r]=t}})}}t.type="element",t.name="",t.ignore=t.silent=t.isGroup=t.draggable=t.dragging=t.ignoreClip=t.__inHover=!1,t.__dirty=1,Object.defineProperty&&(n("position","_legacyPos","x","y"),n("scale","_legacyScale","scaleX","scaleY"),n("origin","_legacyOrigin","originX","originY"))}(),e}();function vH(e,t,n,i,r){var o=[];!function e(t,n,i,r,o,a,s,l){for(var u=pW(r),c=o.duration,h=o.delay,d=o.additive,p=o.setToFinal,f=!pK(a),g=t.animators,m=[],v=0;v<u.length;v++){var y=u[v],x=r[y];if(null!=x&&null!=i[y]&&(f||a[y]))if(!pK(x)||pF(x)||p1(x))m.push(y);else{if(n){l||(i[y]=x,t.updateDuringAnimation(n));continue}e(t,y,i[y],x,o,a&&a[y],s,l)}else l||(i[y]=x,t.updateDuringAnimation(n),m.push(y))}var b=m.length;if(!d&&b)for(var w=0;w<g.length;w++){var S=g[w];if(S.targetName===n&&S.stopTracks(m)){var _=pN(g,S);g.splice(_,1)}}if(o.force||(b=(m=pH(m,function(e){var t,n;return!((t=r[e])===(n=i[e])||pF(t)&&pF(n)&&function(e,t){var n=e.length;if(n!==t.length)return!1;for(var i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}(t,n))})).length),b>0||o.force&&!s.length){var M=void 0,C=void 0,A=void 0;if(l){C={},p&&(M={});for(var w=0;w<b;w++){var y=m[w];C[y]=i[y],p?M[y]=r[y]:i[y]=r[y]}}else if(p){A={};for(var w=0;w<b;w++){var y=m[w];A[y]=vM(i[y]),function(e,t,n){if(pF(t[n]))if(pF(e[n])||(e[n]=[]),pJ(t[n])){var i=t[n].length;e[n].length!==i&&(e[n]=new t[n].constructor(i),vW(e[n],t[n],i))}else{var r=t[n],o=e[n],a=r.length;if(pF(r[0]))for(var s=r[0].length,l=0;l<a;l++)o[l]?vW(o[l],r[l],s):o[l]=Array.prototype.slice.call(r[l]);else vW(o,r,a);o.length=r.length}else e[n]=t[n]}(i,r,y)}}var S=new vI(i,!1,!1,d?pH(g,function(e){return e.targetName===n}):null);S.targetName=n,o.scope&&(S.scope=o.scope),p&&M&&S.whenWithKeys(0,M,m),A&&S.whenWithKeys(0,A,m),S.whenWithKeys(null==c?500:c,l?C:r,m).delay(h||0),t.addAnimator(S,n),s.push(S)}}(e,"",e,t,n=n||{},i,o,r);var a=o.length,s=!1,l=n.done,u=n.aborted,c=function(){s=!0,--a<=0&&(s?l&&l():u&&u())},h=function(){--a<=0&&(s?l&&l():u&&u())};!a&&l&&l(),o.length>0&&n.during&&o[0].during(function(e,t){n.during(t)});for(var d=0;d<o.length;d++){var p=o[d];c&&p.done(c),h&&p.aborted(h),n.force&&p.duration(n.duration),p.start(n.easing)}return o}function vW(e,t,n){for(var i=0;i<n;i++)e[i]=t[i]}pB(vj,vO),pB(vj,mz);var vG="__zr_style_"+Math.round(10*Math.random()),v$={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},vU={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};v$[vG]=!0;var vq=["z","z2","invisible"],vY=["invisible"],vZ=function(e){var t;function n(t){return e.call(this,t)||this}return g$(n,e),n.prototype._init=function(t){for(var n=pW(t),i=0;i<n.length;i++){var r=n[i];"style"===r?this.useStyle(t[r]):e.prototype.attrKV.call(this,r,t[r])}this.style||this.useStyle({})},n.prototype.beforeBrush=function(){},n.prototype.afterBrush=function(){},n.prototype.innerBeforeBrush=function(){},n.prototype.innerAfterBrush=function(){},n.prototype.shouldBePainted=function(e,t,n,i){var r,o,a,s=this.transform;if(this.ignore||this.invisible||0===this.style.opacity||this.culling&&(r=this,o=e,a=t,vX.copy(r.getBoundingRect()),r.transform&&vX.applyTransform(r.transform),vK.width=o,vK.height=a,!vX.intersect(vK))||s&&!s[0]&&!s[3])return!1;if(n&&this.__clipPaths){for(var l=0;l<this.__clipPaths.length;++l)if(this.__clipPaths[l].isZeroArea())return!1}if(i&&this.parent)for(var u=this.parent;u;){if(u.ignore)return!1;u=u.parent}return!0},n.prototype.contain=function(e,t){return this.rectContain(e,t)},n.prototype.traverse=function(e,t){e.call(t,this)},n.prototype.rectContain=function(e,t){var n=this.transformCoordToLocal(e,t);return this.getBoundingRect().contain(n[0],n[1])},n.prototype.getPaintRect=function(){var e=this._paintRect;if(!this._paintRect||this.__dirty){var t=this.transform,n=this.getBoundingRect(),i=this.style,r=i.shadowBlur||0,o=i.shadowOffsetX||0,a=i.shadowOffsetY||0;e=this._paintRect||(this._paintRect=new mr(0,0,0,0)),t?mr.applyTransform(e,n,t):e.copy(n),(r||o||a)&&(e.width+=2*r+Math.abs(o),e.height+=2*r+Math.abs(a),e.x=Math.min(e.x,e.x+o-r),e.y=Math.min(e.y,e.y+a-r));var s=this.dirtyRectTolerance;e.isZero()||(e.x=Math.floor(e.x-s),e.y=Math.floor(e.y-s),e.width=Math.ceil(e.width+1+2*s),e.height=Math.ceil(e.height+1+2*s))}return e},n.prototype.setPrevPaintRect=function(e){e?(this._prevPaintRect=this._prevPaintRect||new mr(0,0,0,0),this._prevPaintRect.copy(e)):this._prevPaintRect=null},n.prototype.getPrevPaintRect=function(){return this._prevPaintRect},n.prototype.animateStyle=function(e){return this.animate("style",e)},n.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():this.markRedraw()},n.prototype.attrKV=function(t,n){"style"!==t?e.prototype.attrKV.call(this,t,n):this.style?this.setStyle(n):this.useStyle(n)},n.prototype.setStyle=function(e,t){return"string"==typeof e?this.style[e]=t:pR(this.style,e),this.dirtyStyle(),this},n.prototype.dirtyStyle=function(e){e||this.markRedraw(),this.__dirty|=2,this._rect&&(this._rect=null)},n.prototype.dirty=function(){this.dirtyStyle()},n.prototype.styleChanged=function(){return!!(2&this.__dirty)},n.prototype.styleUpdated=function(){this.__dirty&=-3},n.prototype.createStyle=function(e){return fr(v$,e)},n.prototype.useStyle=function(e){e[vG]||(e=this.createStyle(e)),this.__inHover?this.__hoverStyle=e:this.style=e,this.dirtyStyle()},n.prototype.isStyleObject=function(e){return e[vG]},n.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(t,n,vq)},n.prototype._applyStateObj=function(t,n,i,r,o,a){e.prototype._applyStateObj.call(this,t,n,i,r,o,a);var s,l=!(n&&r);if(n&&n.style?o?r?s=n.style:(s=this._mergeStyle(this.createStyle(),i.style),this._mergeStyle(s,n.style)):(s=this._mergeStyle(this.createStyle(),r?this.style:i.style),this._mergeStyle(s,n.style)):l&&(s=i.style),s)if(o){var u=this.style;if(this.style=this.createStyle(l?{}:u),l)for(var c=pW(u),h=0;h<c.length;h++){var d=c[h];d in s&&(s[d]=s[d],this.style[d]=u[d])}for(var p=pW(s),h=0;h<p.length;h++){var d=p[h];this.style[d]=this.style[d]}this._transitionState(t,{style:s},a,this.getAnimationStyleProps())}else this.useStyle(s);for(var f=this.__inHover?vY:vq,h=0;h<f.length;h++){var d=f[h];n&&null!=n[d]?this[d]=n[d]:l&&null!=i[d]&&(this[d]=i[d])}},n.prototype._mergeStates=function(t){for(var n,i=e.prototype._mergeStates.call(this,t),r=0;r<t.length;r++){var o=t[r];o.style&&(n=n||{},this._mergeStyle(n,o.style))}return n&&(i.style=n),i},n.prototype._mergeStyle=function(e,t){return pR(e,t),e},n.prototype.getAnimationStyleProps=function(){return vU},n.initDefaultProps=void((t=n.prototype).type="displayable",t.invisible=!1,t.z=0,t.z2=0,t.zlevel=0,t.culling=!1,t.cursor="pointer",t.rectHover=!1,t.incremental=!1,t._rect=null,t.dirtyRectTolerance=0,t.__dirty=3),n}(vj),vX=new mr(0,0,0,0),vK=new mr(0,0,0,0),vQ=Math.min,vJ=Math.max,v0=Math.sin,v1=Math.cos,v2=2*Math.PI,v5=m_(),v3=m_(),v4=m_();function v6(e,t,n,i,r,o){r[0]=vQ(e,n),r[1]=vQ(t,i),o[0]=vJ(e,n),o[1]=vJ(t,i)}var v8=[],v9=[],v7={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},ye=[],yt=[],yn=[],yi=[],yr=[],yo=[],ya=Math.min,ys=Math.max,yl=Math.cos,yu=Math.sin,yc=Math.abs,yh=Math.PI,yd=2*yh,yp="u">typeof Float32Array,yf=[];function yg(e){return Math.round(e/yh*1e8)/1e8%2*yh}function ym(e,t){var n=yg(e[0]);n<0&&(n+=yd);var i=n-e[0],r=e[1];r+=i,!t&&r-n>=yd?r=n+yd:t&&n-r>=yd?r=n-yd:!t&&n>r?r=n+(yd-yg(n-r)):t&&n<r&&(r=n-(yd-yg(r-n))),e[0]=n,e[1]=r}var yv=function(){var e;function t(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(e,t,n){(n=n||0)>0&&(this._ux=yc(n/vE/e)||0,this._uy=yc(n/vE/t)||0)},t.prototype.setDPR=function(e){this.dpr=e},t.prototype.setContext=function(e){this._ctx=e},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(v7.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},t.prototype.lineTo=function(e,t){var n=yc(e-this._xi),i=yc(t-this._yi),r=n>this._ux||i>this._uy;if(this.addData(v7.L,e,t),this._ctx&&r&&this._ctx.lineTo(e,t),r)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(e,t,n,i,r,o){return this._drawPendingPt(),this.addData(v7.C,e,t,n,i,r,o),this._ctx&&this._ctx.bezierCurveTo(e,t,n,i,r,o),this._xi=r,this._yi=o,this},t.prototype.quadraticCurveTo=function(e,t,n,i){return this._drawPendingPt(),this.addData(v7.Q,e,t,n,i),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(e,t,n,i,r,o){this._drawPendingPt(),yf[0]=i,yf[1]=r,ym(yf,o),i=yf[0];var a=(r=yf[1])-i;return this.addData(v7.A,e,t,n,n,i,a,0,+!o),this._ctx&&this._ctx.arc(e,t,n,i,r,o),this._xi=yl(r)*n+e,this._yi=yu(r)*n+t,this},t.prototype.arcTo=function(e,t,n,i,r){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,i,r),this},t.prototype.rect=function(e,t,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,i),this.addData(v7.R,e,t,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(v7.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},t.prototype.fill=function(e){e&&e.fill(),this.toStatic()},t.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(e){var t=e.length;!(this.data&&this.data.length===t)&&yp&&(this.data=new Float32Array(t));for(var n=0;n<t;n++)this.data[n]=e[n];this._len=t},t.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var t=e.length,n=0,i=this._len,r=0;r<t;r++)n+=e[r].len();yp&&this.data instanceof Float32Array&&(this.data=new Float32Array(i+n));for(var r=0;r<t;r++)for(var o=e[r].data,a=0;a<o.length;a++)this.data[i++]=o[a];this._len=i},t.prototype.addData=function(e,t,n,i,r,o,a,s,l){if(this._saveData){var u=this.data;this._len+arguments.length>u.length&&(this._expandData(),u=this.data);for(var c=0;c<arguments.length;c++)u[this._len++]=arguments[c]}},t.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,yp&&this._len>11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){yn[0]=yn[1]=yr[0]=yr[1]=Number.MAX_VALUE,yi[0]=yi[1]=yo[0]=yo[1]=-Number.MAX_VALUE;var e,t=this.data,n=0,i=0,r=0,o=0;for(e=0;e<this._len;){var a=t[e++],s=1===e;switch(s&&(n=t[e],i=t[e+1],r=n,o=i),a){case v7.M:n=r=t[e++],i=o=t[e++],yr[0]=r,yr[1]=o,yo[0]=r,yo[1]=o;break;case v7.L:v6(n,i,t[e],t[e+1],yr,yo),n=t[e++],i=t[e++];break;case v7.C:!function(e,t,n,i,r,o,a,s,l,u){var c=m0(e,n,r,a,v8);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var h=0;h<c;h++){var d=mK(e,n,r,a,v8[h]);l[0]=vQ(d,l[0]),u[0]=vJ(d,u[0])}c=m0(t,i,o,s,v9);for(var h=0;h<c;h++){var p=mK(t,i,o,s,v9[h]);l[1]=vQ(p,l[1]),u[1]=vJ(p,u[1])}l[0]=vQ(e,l[0]),u[0]=vJ(e,u[0]),l[0]=vQ(a,l[0]),u[0]=vJ(a,u[0]),l[1]=vQ(t,l[1]),u[1]=vJ(t,u[1]),l[1]=vQ(s,l[1]),u[1]=vJ(s,u[1])}(n,i,t[e++],t[e++],t[e++],t[e++],t[e],t[e+1],yr,yo),n=t[e++],i=t[e++];break;case v7.Q:!function(e,t,n,i,r,o,a,s){var l=vJ(vQ(m3(e,n,r),1),0),u=vJ(vQ(m3(t,i,o),1),0),c=m2(e,n,r,l),h=m2(t,i,o,u);a[0]=vQ(e,r,c),a[1]=vQ(t,o,h),s[0]=vJ(e,r,c),s[1]=vJ(t,o,h)}(n,i,t[e++],t[e++],t[e],t[e+1],yr,yo),n=t[e++],i=t[e++];break;case v7.A:var l=t[e++],u=t[e++],c=t[e++],h=t[e++],d=t[e++],p=t[e++]+d;e+=1;var f=!t[e++];s&&(r=yl(d)*c+l,o=yu(d)*h+u),function(e,t,n,i,r,o,a,s,l){var u=Math.abs(r-o);if(u%v2<1e-4&&u>1e-4){s[0]=e-n,s[1]=t-i,l[0]=e+n,l[1]=t+i;return}if(v5[0]=v1(r)*n+e,v5[1]=v0(r)*i+t,v3[0]=v1(o)*n+e,v3[1]=v0(o)*i+t,mP(s,v5,v3),mE(l,v5,v3),(r%=v2)<0&&(r+=v2),(o%=v2)<0&&(o+=v2),r>o&&!a?o+=v2:r<o&&a&&(r+=v2),a){var c=o;o=r,r=c}for(var h=0;h<o;h+=Math.PI/2)h>r&&(v4[0]=v1(h)*n+e,v4[1]=v0(h)*i+t,mP(s,v4,s),mE(l,v4,l))}(l,u,c,h,d,p,f,yr,yo),n=yl(p)*c+l,i=yu(p)*h+u;break;case v7.R:v6(r=n=t[e++],o=i=t[e++],r+t[e++],o+t[e++],yr,yo);break;case v7.Z:n=r,i=o}mP(yn,yn,yr),mE(yi,yi,yo)}return 0===e&&(yn[0]=yn[1]=yi[0]=yi[1]=0),new mr(yn[0],yn[1],yi[0]-yn[0],yi[1]-yn[1])},t.prototype._calculateLength=function(){var e=this.data,t=this._len,n=this._ux,i=this._uy,r=0,o=0,a=0,s=0;this._pathSegLen||(this._pathSegLen=[]);for(var l=this._pathSegLen,u=0,c=0,h=0;h<t;){var d=e[h++],p=1===h;p&&(r=e[h],o=e[h+1],a=r,s=o);var f=-1;switch(d){case v7.M:r=a=e[h++],o=s=e[h++];break;case v7.L:var g=e[h++],m=e[h++],v=g-r,y=m-o;(yc(v)>n||yc(y)>i||h===t-1)&&(f=Math.sqrt(v*v+y*y),r=g,o=m);break;case v7.C:var x=e[h++],b=e[h++],g=e[h++],m=e[h++],w=e[h++],S=e[h++];f=function(e,t,n,i,r,o,a,s){for(var l=e,u=t,c=0,h=1;h<=10;h++){var d=.1*h,p=mK(e,n,r,a,d),f=mK(t,i,o,s,d),g=p-l,m=f-u;c+=Math.sqrt(g*g+m*m),l=p,u=f}return c}(r,o,x,b,g,m,w,S),r=w,o=S;break;case v7.Q:var x=e[h++],b=e[h++],g=e[h++],m=e[h++];f=function(e,t,n,i,r,o){for(var a=e,s=t,l=0,u=1;u<=10;u++){var c=.1*u,h=m2(e,n,r,c),d=m2(t,i,o,c),p=h-a,f=d-s;l+=Math.sqrt(p*p+f*f),a=h,s=d}return l}(r,o,x,b,g,m),r=g,o=m;break;case v7.A:var _=e[h++],M=e[h++],C=e[h++],A=e[h++],k=e[h++],T=e[h++],D=T+k;h+=1,p&&(a=yl(k)*C+_,s=yu(k)*A+M),f=ys(C,A)*ya(yd,Math.abs(T)),r=yl(D)*C+_,o=yu(D)*A+M;break;case v7.R:a=r=e[h++],s=o=e[h++],f=2*e[h++]+2*e[h++];break;case v7.Z:var v=a-r,y=s-o;f=Math.sqrt(v*v+y*y),r=a,o=s}f>=0&&(l[c++]=f,u+=f)}return this._pathLen=u,u},t.prototype.rebuildPath=function(e,t){var n,i,r,o,a,s,l,u,c,h,d=this.data,p=this._ux,f=this._uy,g=this._len,m=t<1,v=0,y=0,x=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=t*this._pathLen))t:for(var b=0;b<g;){var w=d[b++],S=1===b;switch(S&&(r=d[b],o=d[b+1],n=r,i=o),w!==v7.L&&x>0&&(e.lineTo(c,h),x=0),w){case v7.M:n=r=d[b++],i=o=d[b++],e.moveTo(r,o);break;case v7.L:a=d[b++],s=d[b++];var _=yc(a-r),M=yc(s-o);if(_>p||M>f){if(m){var C=l[y++];if(v+C>u){var A=(u-v)/C;e.lineTo(r*(1-A)+a*A,o*(1-A)+s*A);break t}v+=C}e.lineTo(a,s),r=a,o=s,x=0}else{var k=_*_+M*M;k>x&&(c=a,h=s,x=k)}break;case v7.C:var T=d[b++],D=d[b++],I=d[b++],O=d[b++],P=d[b++],E=d[b++];if(m){var C=l[y++];if(v+C>u){var A=(u-v)/C;m1(r,T,I,P,A,ye),m1(o,D,O,E,A,yt),e.bezierCurveTo(ye[1],yt[1],ye[2],yt[2],ye[3],yt[3]);break t}v+=C}e.bezierCurveTo(T,D,I,O,P,E),r=P,o=E;break;case v7.Q:var T=d[b++],D=d[b++],I=d[b++],O=d[b++];if(m){var C=l[y++];if(v+C>u){var A=(u-v)/C;m4(r,T,I,A,ye),m4(o,D,O,A,yt),e.quadraticCurveTo(ye[1],yt[1],ye[2],yt[2]);break t}v+=C}e.quadraticCurveTo(T,D,I,O),r=I,o=O;break;case v7.A:var R=d[b++],L=d[b++],N=d[b++],B=d[b++],F=d[b++],z=d[b++],V=d[b++],j=!d[b++],H=N>B?N:B,W=yc(N-B)>.001,G=F+z,$=!1;if(m){var C=l[y++];v+C>u&&(G=F+z*(u-v)/C,$=!0),v+=C}if(W&&e.ellipse?e.ellipse(R,L,N,B,V,F,G,j):e.arc(R,L,H,F,G,j),$)break t;S&&(n=yl(F)*N+R,i=yu(F)*B+L),r=yl(G)*N+R,o=yu(G)*B+L;break;case v7.R:n=r=d[b],i=o=d[b+1],a=d[b++],s=d[b++];var U=d[b++],q=d[b++];if(m){var C=l[y++];if(v+C>u){var Y=u-v;e.moveTo(a,s),e.lineTo(a+ya(Y,U),s),(Y-=U)>0&&e.lineTo(a+U,s+ya(Y,q)),(Y-=q)>0&&e.lineTo(a+ys(U-Y,0),s+q),(Y-=U)>0&&e.lineTo(a,s+ys(q-Y,0));break t}v+=C}e.rect(a,s,U,q);break;case v7.Z:if(m){var C=l[y++];if(v+C>u){var A=(u-v)/C;e.lineTo(r*(1-A)+n*A,o*(1-A)+i*A);break t}v+=C}e.closePath(),r=n,o=i}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.CMD=v7,t.initDefaultProps=void((e=t.prototype)._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0),t}();function yy(e,t,n,i,r,o,a){if(0===r)return!1;var s=0,l=e;if(a>t+r&&a>i+r||a<t-r&&a<i-r||o>e+r&&o>n+r||o<e-r&&o<n-r)return!1;if(e===n)return Math.abs(o-e)<=r/2;s=(t-i)/(e-n);var u=s*o-a+(l=(e*i-n*t)/(e-n));return u*u/(s*s+1)<=r/2*r/2}var yx=2*Math.PI;function yb(e){return(e%=yx)<0&&(e+=yx),e}var yw=2*Math.PI;function yS(e,t,n,i,r,o){if(o>t&&o>i||o<t&&o<i||i===t)return 0;var a=(o-t)/(i-t),s=i<t?1:-1;(1===a||0===a)&&(s=i<t?.5:-.5);var l=a*(n-e)+e;return l===r?1/0:l>r?s:0}var y_=yv.CMD,yM=2*Math.PI,yC=[-1,-1,-1],yA=[-1,-1];function yk(e,t,n,i,r){for(var o,a,s=e.data,l=e.len(),u=0,c=0,h=0,d=0,p=0,f=0;f<l;){var g,m,v,y,x,b,w,S,_,M,C,A,k,T,D=s[f++],I=1===f;switch(D===y_.M&&f>1&&!n&&(u+=yS(c,h,d,p,i,r)),I&&(c=s[f],h=s[f+1],d=c,p=h),D){case y_.M:d=s[f++],p=s[f++],c=d,h=p;break;case y_.L:if(n){if(yy(c,h,s[f],s[f+1],t,i,r))return!0}else u+=yS(c,h,s[f],s[f+1],i,r)||0;c=s[f++],h=s[f++];break;case y_.C:if(n){if(g=c,m=h,v=s[f++],y=s[f++],x=s[f++],b=s[f++],w=s[f],S=s[f+1],0!==t&&(!(r>m+t)||!(r>y+t)||!(r>b+t)||!(r>S+t))&&(!(r<m-t)||!(r<y-t)||!(r<b-t)||!(r<S-t))&&(!(i>g+t)||!(i>v+t)||!(i>x+t)||!(i>w+t))&&(!(i<g-t)||!(i<v-t)||!(i<x-t)||!(i<w-t))&&function(e,t,n,i,r,o,a,s,l,u){var c,h,d,p,f,g=.005,m=1/0;mU[0]=l,mU[1]=u;for(var v=0;v<1;v+=.05)mq[0]=mK(e,n,r,a,v),mq[1]=mK(t,i,o,s,v),(p=mD(mU,mq))<m&&(c=v,m=p);m=1/0;for(var y=0;y<32&&!(g<1e-4);y++)h=c-g,d=c+g,mq[0]=mK(e,n,r,a,h),mq[1]=mK(t,i,o,s,h),p=mD(mq,mU),h>=0&&p<m?(c=h,m=p):(mY[0]=mK(e,n,r,a,d),mY[1]=mK(t,i,o,s,d),f=mD(mY,mU),d<=1&&f<m?(c=d,m=f):g*=.5);return mW(m)}(g,m,v,y,x,b,w,S,i,r)<=t/2)return!0}else u+=function(e,t,n,i,r,o,a,s,l,u){if(u>t&&u>i&&u>o&&u>s||u<t&&u<i&&u<o&&u<s)return 0;var c=mJ(t,i,o,s,u,yC);if(0===c)return 0;for(var h=0,d=-1,p=void 0,f=void 0,g=0;g<c;g++){var m=yC[g],v=0===m||1===m?.5:1;mK(e,n,r,a,m)<l||(d<0&&(d=m0(t,i,o,s,yA),yA[1]<yA[0]&&d>1&&function(){var e=yA[0];yA[0]=yA[1],yA[1]=e}(),p=mK(t,i,o,s,yA[0]),d>1&&(f=mK(t,i,o,s,yA[1]))),2===d?m<yA[0]?h+=p<t?v:-v:m<yA[1]?h+=f<p?v:-v:h+=s<f?v:-v:m<yA[0]?h+=p<t?v:-v:h+=s<p?v:-v)}return h}(c,h,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],i,r)||0;c=s[f++],h=s[f++];break;case y_.Q:if(n){if(_=c,M=h,C=s[f++],A=s[f++],k=s[f],T=s[f+1],0!==t&&(!(r>M+t)||!(r>A+t)||!(r>T+t))&&(!(r<M-t)||!(r<A-t)||!(r<T-t))&&(!(i>_+t)||!(i>C+t)||!(i>k+t))&&(!(i<_-t)||!(i<C-t)||!(i<k-t))&&function(e,t,n,i,r,o,a,s){var l,u=.005,c=1/0;mU[0]=a,mU[1]=s;for(var h=0;h<1;h+=.05){mq[0]=m2(e,n,r,h),mq[1]=m2(t,i,o,h);var d=mD(mU,mq);d<c&&(l=h,c=d)}c=1/0;for(var p=0;p<32&&!(u<1e-4);p++){var f=l-u,g=l+u;mq[0]=m2(e,n,r,f),mq[1]=m2(t,i,o,f);var d=mD(mq,mU);if(f>=0&&d<c)l=f,c=d;else{mY[0]=m2(e,n,r,g),mY[1]=m2(t,i,o,g);var m=mD(mY,mU);g<=1&&m<c?(l=g,c=m):u*=.5}}return mW(c)}(_,M,C,A,k,T,i,r)<=t/2)return!0}else u+=function(e,t,n,i,r,o,a,s){if(s>t&&s>i&&s>o||s<t&&s<i&&s<o)return 0;var l=function(e,t,n,i,r){var o=e-2*t+n,a=2*(t-e),s=e-i,l=0;if(mZ(o)){if(mX(a)){var u=-s/a;u>=0&&u<=1&&(r[l++]=u)}}else{var c=a*a-4*o*s;if(mZ(c)){var u=-a/(2*o);u>=0&&u<=1&&(r[l++]=u)}else if(c>0){var h=mW(c),u=(-a+h)/(2*o),d=(-a-h)/(2*o);u>=0&&u<=1&&(r[l++]=u),d>=0&&d<=1&&(r[l++]=d)}}return l}(t,i,o,s,yC);if(0===l)return 0;var u=m3(t,i,o);if(u>=0&&u<=1){for(var c=0,h=m2(t,i,o,u),d=0;d<l;d++){var p=0===yC[d]||1===yC[d]?.5:1,f=m2(e,n,r,yC[d]);f<a||(yC[d]<u?c+=h<t?p:-p:c+=o<h?p:-p)}return c}var p=0===yC[0]||1===yC[0]?.5:1,f=m2(e,n,r,yC[0]);return f<a?0:o<t?p:-p}(c,h,s[f++],s[f++],s[f],s[f+1],i,r)||0;c=s[f++],h=s[f++];break;case y_.A:var O=s[f++],P=s[f++],E=s[f++],R=s[f++],L=s[f++],N=s[f++];f+=1;var B=!!(1-s[f++]);o=Math.cos(L)*E+O,a=Math.sin(L)*R+P,I?(d=o,p=a):u+=yS(c,h,o,a,i,r);var F=(i-O)*R/E+O;if(n){if(function(e,t,n,i,r,o,a,s,l){if(0===a)return!1;var u=Math.sqrt((s-=e)*s+(l-=t)*l);if(u-a>n||u+a<n)return!1;if(Math.abs(i-r)%yw<1e-4)return!0;if(o){var c=i;i=yb(r),r=yb(c)}else i=yb(i),r=yb(r);i>r&&(r+=yw);var h=Math.atan2(l,s);return h<0&&(h+=yw),h>=i&&h<=r||h+yw>=i&&h+yw<=r}(O,P,R,L,L+N,B,t,F,r))return!0}else u+=function(e,t,n,i,r,o,a,s){if((s-=t)>n||s<-n)return 0;var l=Math.sqrt(n*n-s*s);yC[0]=-l,yC[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=yM-1e-4){i=0,r=yM;var c=o?1:-1;return a>=yC[0]+e&&a<=yC[1]+e?c:0}if(i>r){var h=i;i=r,r=h}i<0&&(i+=yM,r+=yM);for(var d=0,p=0;p<2;p++){var f=yC[p];if(f+e>a){var g=Math.atan2(s,f),c=o?1:-1;g<0&&(g=yM+g),(g>=i&&g<=r||g+yM>=i&&g+yM<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),d+=c)}}return d}(O,P,R,L,L+N,B,F,r);c=Math.cos(L+N)*E+O,h=Math.sin(L+N)*R+P;break;case y_.R:d=c=s[f++],p=h=s[f++];var z=s[f++],V=s[f++];if(o=d+z,a=p+V,n){if(yy(d,p,o,p,t,i,r)||yy(o,p,o,a,t,i,r)||yy(o,a,d,a,t,i,r)||yy(d,a,d,p,t,i,r))return!0}else u+=yS(o,p,o,a,i,r),u+=yS(d,a,d,p,i,r);break;case y_.Z:if(n){if(yy(c,h,d,p,t,i,r))return!0}else u+=yS(c,h,d,p,i,r);c=d,h=p}}return n||1e-4>Math.abs(h-p)||(u+=yS(c,h,d,p,i,r)||0),0!==u}var yT=pL({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},v$),yD={style:pL({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},vU.style)},yI=mV.concat(["invisible","culling","z","z2","zlevel","parent"]);let yO=function(e){var t;function n(t){return e.call(this,t)||this}return g$(n,e),n.prototype.update=function(){var t=this;e.prototype.update.call(this);var i=this.style;if(i.decal){var r=this._decalEl=this._decalEl||new n;r.buildPath===n.prototype.buildPath&&(r.buildPath=function(e){t.buildPath(e,t.shape)}),r.silent=!0;var o=r.style;for(var a in i)o[a]!==i[a]&&(o[a]=i[a]);o.fill=i.fill?i.decal:null,o.decal=null,o.shadowColor=null,i.strokeFirst&&(o.stroke=null);for(var s=0;s<yI.length;++s)r[yI[s]]=this[yI[s]];r.__dirty|=1}else this._decalEl&&(this._decalEl=null)},n.prototype.getDecalElement=function(){return this._decalEl},n.prototype._init=function(t){var n=pW(t);this.shape=this.getDefaultShape();var i=this.getDefaultStyle();i&&this.useStyle(i);for(var r=0;r<n.length;r++){var o=n[r],a=t[o];"style"===o?this.style?pR(this.style,a):this.useStyle(a):"shape"===o?pR(this.shape,a):e.prototype.attrKV.call(this,o,a)}this.style||this.useStyle({})},n.prototype.getDefaultStyle=function(){return null},n.prototype.getDefaultShape=function(){return{}},n.prototype.canBeInsideText=function(){return this.hasFill()},n.prototype.getInsideTextFill=function(){var e=this.style.fill;if("none"!==e){if(pY(e)){var t=vv(e,0);return t>.5?vR:t>.2?"#eee":vL}else if(e)return vL}return vR},n.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(pY(t)){var n=this.__zr;if(!!(n&&n.isDarkMode())==.4>vv(e,0))return t}},n.prototype.buildPath=function(e,t,n){},n.prototype.pathUpdated=function(){this.__dirty&=-5},n.prototype.getUpdatedPathProxy=function(e){return this.path||this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},n.prototype.createPathProxy=function(){this.path=new yv(!1)},n.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return null!=t&&"none"!==t&&e.lineWidth>0},n.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},n.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var r=this.path;(i||4&this.__dirty)&&(r.beginPath(),this.buildPath(r,this.shape,!1),this.pathUpdated()),e=r.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=e.clone());if(this.__dirty||n){o.copy(e);var a=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return e},n.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),i=this.getBoundingRect(),r=this.style;if(e=n[0],t=n[1],i.contain(e,t)){var o=this.path;if(this.hasStroke()){var a=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),yk(o,a/s,!0,e,t)))return!0}if(this.hasFill())return yk(o,0,!1,e,t)}return!1},n.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},n.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},n.prototype.animateShape=function(e){return this.animate("shape",e)},n.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():"shape"===e?this.dirtyShape():this.markRedraw()},n.prototype.attrKV=function(t,n){"shape"===t?this.setShape(n):e.prototype.attrKV.call(this,t,n)},n.prototype.setShape=function(e,t){var n=this.shape;return n||(n=this.shape={}),"string"==typeof e?n[e]=t:pR(n,e),this.dirtyShape(),this},n.prototype.shapeChanged=function(){return!!(4&this.__dirty)},n.prototype.createStyle=function(e){return fr(yT,e)},n.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=pR({},this.shape))},n.prototype._applyStateObj=function(t,n,i,r,o,a){e.prototype._applyStateObj.call(this,t,n,i,r,o,a);var s,l=!(n&&r);if(n&&n.shape?o?r?s=n.shape:(s=pR({},i.shape),pR(s,n.shape)):(s=pR({},r?this.shape:i.shape),pR(s,n.shape)):l&&(s=i.shape),s)if(o){this.shape=pR({},this.shape);for(var u={},c=pW(s),h=0;h<c.length;h++){var d=c[h];"object"==typeof s[d]?this.shape[d]=s[d]:u[d]=s[d]}this._transitionState(t,{shape:u},a)}else this.shape=s,this.dirtyShape()},n.prototype._mergeStates=function(t){for(var n,i=e.prototype._mergeStates.call(this,t),r=0;r<t.length;r++){var o=t[r];o.shape&&(n=n||{},this._mergeStyle(n,o.shape))}return n&&(i.shape=n),i},n.prototype.getAnimationStyleProps=function(){return yD},n.prototype.isZeroArea=function(){return!1},n.extend=function(e){var t=function(t){function n(n){var i=t.call(this,n)||this;return e.init&&e.init.call(i,n),i}return g$(n,t),n.prototype.getDefaultStyle=function(){return pP(e.style)},n.prototype.getDefaultShape=function(){return pP(e.shape)},n}(n);for(var i in e)"function"==typeof e[i]&&(t.prototype[i]=e[i]);return t},n.initDefaultProps=void((t=n.prototype).type="path",t.strokeContainThreshold=5,t.segmentIgnoreThreshold=0,t.subPixelOptimize=!1,t.autoBatch=!1,t.__dirty=7),n}(vZ);var yP=pL({strokeFirst:!0,font:pm,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},yT),yE=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g$(t,e),t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return null!=t&&"none"!==t&&e.lineWidth>0},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.createStyle=function(e){return fr(yP,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var t=e.text;null!=t?t+="":t="";var n=ml(t,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var i=e.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},t.initDefaultProps=void(t.prototype.dirtyRectTolerance=10),t}(vZ);yE.prototype.type="tspan";var yR=pL({x:0,y:0},v$),yL={style:pL({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},vU.style)},yN=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g$(t,e),t.prototype.createStyle=function(e){return fr(yR,e)},t.prototype._getSize=function(e){var t,n=this.style,i=n[e];if(null!=i)return i;var r=(t=n.image)&&"string"!=typeof t&&t.width&&t.height?n.image:this.__image;if(!r)return 0;var o="width"===e?"height":"width",a=n[o];return null==a?r[e]:r[e]/r[o]*a},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return yL},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new mr(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(vZ);yN.prototype.type="image";let yB=yN;var yF=Math.round;function yz(e,t,n){if(t){var i=t.x1,r=t.x2,o=t.y1,a=t.y2;e.x1=i,e.x2=r,e.y1=o,e.y2=a;var s=n&&n.lineWidth;return s&&(yF(2*i)===yF(2*r)&&(e.x1=e.x2=yj(i,s,!0)),yF(2*o)===yF(2*a)&&(e.y1=e.y2=yj(o,s,!0))),e}}function yV(e,t,n){if(t){var i=t.x,r=t.y,o=t.width,a=t.height;e.x=i,e.y=r,e.width=o,e.height=a;var s=n&&n.lineWidth;return s&&(e.x=yj(i,s,!0),e.y=yj(r,s,!0),e.width=Math.max(yj(i+o,s,!1)-e.x,+(0!==o)),e.height=Math.max(yj(r+a,s,!1)-e.y,+(0!==a))),e}}function yj(e,t,n){if(!t)return e;var i=yF(2*e);return(i+yF(t))%2==0?i/2:(i+(n?1:-1))/2}var yH=function(){this.x=0,this.y=0,this.width=0,this.height=0},yW={},yG=function(e){function t(t){return e.call(this,t)||this}return g$(t,e),t.prototype.getDefaultShape=function(){return new yH},t.prototype.buildPath=function(e,t){if(this.subPixelOptimize){var n,i,r,o,a,s,l,u,c,h,d,p,f,g,m,v=yV(yW,t,this.style);p=v.x,f=v.y,g=v.width,m=v.height,v.r=t.r,t=v}else p=t.x,f=t.y,g=t.width,m=t.height;t.r?(l=(n=t).x,u=n.y,c=n.width,h=n.height,d=n.r,c<0&&(l+=c,c=-c),h<0&&(u+=h,h=-h),"number"==typeof d?i=r=o=a=d:d instanceof Array?1===d.length?i=r=o=a=d[0]:2===d.length?(i=o=d[0],r=a=d[1]):3===d.length?(i=d[0],r=a=d[1],o=d[2]):(i=d[0],r=d[1],o=d[2],a=d[3]):i=r=o=a=0,i+r>c&&(s=i+r,i*=c/s,r*=c/s),o+a>c&&(s=o+a,o*=c/s,a*=c/s),r+o>h&&(s=r+o,r*=h/s,o*=h/s),i+a>h&&(s=i+a,i*=h/s,a*=h/s),e.moveTo(l+i,u),e.lineTo(l+c-r,u),0!==r&&e.arc(l+c-r,u+r,r,-Math.PI/2,0),e.lineTo(l+c,u+h-o),0!==o&&e.arc(l+c-o,u+h-o,o,0,Math.PI/2),e.lineTo(l+a,u+h),0!==a&&e.arc(l+a,u+h-a,a,Math.PI/2,Math.PI),e.lineTo(l,u+i),0!==i&&e.arc(l+i,u+i,i,Math.PI,1.5*Math.PI)):e.rect(p,f,g,m)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(yO);yG.prototype.type="rect";let y$=yG;var yU={fill:"#000"},yq={style:pL({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},vU.style)},yY=function(e){function t(t){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=yU,n.attr(t),n}return g$(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t<this._children.length;t++){var n=this._children[t];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},t.prototype.updateTransform=function(){var t=this.innerTransformable;t?(t.updateTransform(),t.transform&&(this.transform=t.transform)):e.prototype.updateTransform.call(this)},t.prototype.getLocalTransform=function(t){var n=this.innerTransformable;return n?n.getLocalTransform(t):e.prototype.getLocalTransform.call(this,t)},t.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),e.prototype.getComputedTransform.call(this)},t.prototype._updateSubTexts=function(){var e;this._childCursor=0,yJ(e=this.style),pz(e.rich,yJ),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=t},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},t.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var e=new mr(0,0,0,0),t=this._children,n=[],i=null,r=0;r<t.length;r++){var o=t[r],a=o.getBoundingRect(),s=o.getLocalTransform(n);s?(e.copy(a),e.applyTransform(s),(i=i||e.clone()).union(e)):(i=i||a.clone()).union(a)}this._rect=i||e}return this._rect},t.prototype.setDefaultTextStyle=function(e){this._defaultStyle=e||yU},t.prototype.setTextContent=function(e){},t.prototype._mergeStyle=function(e,t){if(!t)return e;var n=t.rich,i=e.rich||n&&{};return pR(e,t),n&&i?(this._mergeRich(i,n),e.rich=i):i&&(e.rich=i),e},t.prototype._mergeRich=function(e,t){for(var n=pW(t),i=0;i<n.length;i++){var r=n[i];e[r]=e[r]||{},pR(e[r],t[r])}},t.prototype.getAnimationStyleProps=function(){return yq},t.prototype._getOrCreateChild=function(e){var t=this._children[this._childCursor];return t&&t instanceof e||(t=new e),this._children[this._childCursor++]=t,t.__zr=this.__zr,t.parent=this,t},t.prototype._updatePlainTexts=function(){var e=this.style,t=e.font||pm,n=e.padding,i=function(e,t){null!=e&&(e+="");var n,i=t.overflow,r=t.padding,o=t.font,a=mh(o),s=p5(t.lineHeight,a),l=!!t.backgroundColor,u="truncate"===t.lineOverflow,c=t.width,h=(n=null!=c&&("break"===i||"breakAll"===i)?e?mS(e,t.font,c,"breakAll"===i,0).lines:[]:e?e.split("\n"):[]).length*s,d=p5(t.height,h);if(h>d&&u){var p=Math.floor(d/s);n=n.slice(0,p)}if(e&&"truncate"===i&&null!=c)for(var f=mg(c,o,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),g=0;g<n.length;g++)n[g]=mm(n[g],f);for(var m=d,v=0,g=0;g<n.length;g++)v=Math.max(ma(n[g],o),v);null==c&&(c=v);var y=v;return r&&(m+=r[0]+r[2],y+=r[1]+r[3],c+=r[1]+r[3]),l&&(y=c),{lines:n,height:d,outerWidth:y,outerHeight:m,lineHeight:s,calculatedLineHeight:a,contentWidth:v,contentHeight:h,width:c}}(y5(e),e),r=y3(e),o=!!e.backgroundColor,a=i.outerHeight,s=i.outerWidth,l=i.contentWidth,u=i.lines,c=i.lineHeight,h=this._defaultStyle,d=e.x||0,p=e.y||0,f=e.align||h.align||"left",g=e.verticalAlign||h.verticalAlign||"top",m=d,v=mc(p,i.contentHeight,g);if(r||n){var y=mu(d,s,f),x=mc(p,a,g);r&&this._renderBackground(e,e,y,x,s,a)}v+=c/2,n&&(m=y2(d,f,n),"top"===g?v+=n[0]:"bottom"===g&&(v-=n[2]));for(var b=0,w=!1,S=y1("fill"in e?e.fill:(w=!0,h.fill)),_=y0("stroke"in e?e.stroke:o||h.autoStroke&&!w?null:(b=2,h.stroke)),M=e.textShadowBlur>0,C=null!=e.width&&("truncate"===e.overflow||"break"===e.overflow||"breakAll"===e.overflow),A=i.calculatedLineHeight,k=0;k<u.length;k++){var T=this._getOrCreateChild(yE),D=T.createStyle();T.useStyle(D),D.text=u[k],D.x=m,D.y=v,f&&(D.textAlign=f),D.textBaseline="middle",D.opacity=e.opacity,D.strokeFirst=!0,M&&(D.shadowBlur=e.textShadowBlur||0,D.shadowColor=e.textShadowColor||"transparent",D.shadowOffsetX=e.textShadowOffsetX||0,D.shadowOffsetY=e.textShadowOffsetY||0),D.stroke=_,D.fill=S,_&&(D.lineWidth=e.lineWidth||b,D.lineDash=e.lineDash,D.lineDashOffset=e.lineDashOffset||0),D.font=t,yQ(D,e),v+=c,C&&T.setBoundingRect(new mr(mu(D.x,e.width,D.textAlign),mc(D.y,A,D.textBaseline),l,A))}},t.prototype._updateRichTexts=function(){var e=this.style,t=function(e,t){var n,i=new mx;if(null!=e&&(e+=""),!e)return i;for(var r=t.width,o=t.height,a=t.overflow,s=("break"===a||"breakAll"===a)&&null!=r?{width:r,accumWidth:0,breakAll:"breakAll"===a}:null,l=mf.lastIndex=0;null!=(n=mf.exec(e));){var u=n.index;u>l&&mb(i,e.substring(l,u),t,s),mb(i,n[2],t,s,n[1]),l=mf.lastIndex}l<e.length&&mb(i,e.substring(l,e.length),t,s);var c=[],h=0,d=0,p=t.padding,f="truncate"===a,g="truncate"===t.lineOverflow;function m(e,t,n){e.width=t,e.lineHeight=n,h+=n,d=Math.max(d,t)}n:for(var v=0;v<i.lines.length;v++){for(var y=i.lines[v],x=0,b=0,w=0;w<y.tokens.length;w++){var S=y.tokens[w],_=S.styleName&&t.rich[S.styleName]||{},M=S.textPadding=_.padding,C=M?M[1]+M[3]:0,A=S.font=_.font||t.font;S.contentHeight=mh(A);var k=p5(_.height,S.contentHeight);if(S.innerHeight=k,M&&(k+=M[0]+M[2]),S.height=k,S.lineHeight=p3(_.lineHeight,t.lineHeight,k),S.align=_&&_.align||t.align,S.verticalAlign=_&&_.verticalAlign||"middle",g&&null!=o&&h+S.lineHeight>o){w>0?(y.tokens=y.tokens.slice(0,w),m(y,b,x),i.lines=i.lines.slice(0,v+1)):i.lines=i.lines.slice(0,v);break n}var T=_.width,D=null==T||"auto"===T;if("string"==typeof T&&"%"===T.charAt(T.length-1))S.percentWidth=T,c.push(S),S.contentWidth=ma(S.text,A);else{if(D){var I=_.backgroundColor,O=I&&I.image;O&&gQ(O=function(e){if("string"!=typeof e)return e;var t=gZ.get(e);return t&&t.image}(O))&&(S.width=Math.max(S.width,O.width*k/O.height))}var P=f&&null!=r?r-b:null;null!=P&&P<S.width?!D||P<C?(S.text="",S.width=S.contentWidth=0):(S.text=function(e,t,n,i,r){if(!t)return"";var o=(e+"").split("\n");r=mg(t,n,i,r);for(var a=0,s=o.length;a<s;a++)o[a]=mm(o[a],r);return o.join("\n")}(S.text,P-C,A,t.ellipsis,{minChar:t.truncateMinChar}),S.width=S.contentWidth=ma(S.text,A)):S.contentWidth=ma(S.text,A)}S.width+=C,b+=S.width,_&&(x=Math.max(x,S.lineHeight))}m(y,b,x)}i.outerWidth=i.width=p5(r,d),i.outerHeight=i.height=p5(o,h),i.contentHeight=h,i.contentWidth=d,p&&(i.outerWidth+=p[1]+p[3],i.outerHeight+=p[0]+p[2]);for(var v=0;v<c.length;v++){var S=c[v],E=S.percentWidth;S.width=parseInt(E,10)/100*i.width}return i}(y5(e),e),n=t.width,i=t.outerWidth,r=t.outerHeight,o=e.padding,a=e.x||0,s=e.y||0,l=this._defaultStyle,u=e.align||l.align,c=e.verticalAlign||l.verticalAlign,h=mu(a,i,u),d=mc(s,r,c),p=h,f=d;o&&(p+=o[3],f+=o[0]);var g=p+n;y3(e)&&this._renderBackground(e,e,h,d,i,r);for(var m=!!e.backgroundColor,v=0;v<t.lines.length;v++){for(var y=t.lines[v],x=y.tokens,b=x.length,w=y.lineHeight,S=y.width,_=0,M=p,C=g,A=b-1,k=void 0;_<b&&(!(k=x[_]).align||"left"===k.align);)this._placeToken(k,e,w,f,M,"left",m),S-=k.width,M+=k.width,_++;for(;A>=0&&"right"===(k=x[A]).align;)this._placeToken(k,e,w,f,C,"right",m),S-=k.width,C-=k.width,A--;for(M+=(n-(M-p)-(g-C)-S)/2;_<=A;)k=x[_],this._placeToken(k,e,w,f,M+k.width/2,"center",m),M+=k.width,_++;f+=w}},t.prototype._placeToken=function(e,t,n,i,r,o,a){var s=t.rich[e.styleName]||{};s.text=e.text;var l=e.verticalAlign,u=i+n/2;"top"===l?u=i+e.height/2:"bottom"===l&&(u=i+n-e.height/2),!e.isLineHolder&&y3(s)&&this._renderBackground(s,t,"right"===o?r-e.width:"center"===o?r-e.width/2:r,u-e.height/2,e.width,e.height);var c=!!s.backgroundColor,h=e.textPadding;h&&(r=y2(r,o,h),u-=e.height/2-h[0]-e.innerHeight/2);var d=this._getOrCreateChild(yE),p=d.createStyle();d.useStyle(p);var f=this._defaultStyle,g=!1,m=0,v=y1("fill"in s?s.fill:"fill"in t?t.fill:(g=!0,f.fill)),y=y0("stroke"in s?s.stroke:"stroke"in t?t.stroke:c||a||f.autoStroke&&!g?null:(m=2,f.stroke)),x=s.textShadowBlur>0||t.textShadowBlur>0;p.text=e.text,p.x=r,p.y=u,x&&(p.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,p.shadowColor=s.textShadowColor||t.textShadowColor||"transparent",p.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),p.textAlign=o,p.textBaseline="middle",p.font=e.font||pm,p.opacity=p3(s.opacity,t.opacity,1),yQ(p,s),y&&(p.lineWidth=p3(s.lineWidth,t.lineWidth,m),p.lineDash=p5(s.lineDash,t.lineDash),p.lineDashOffset=t.lineDashOffset||0,p.stroke=y),v&&(p.fill=v);var b=e.contentWidth,w=e.contentHeight;d.setBoundingRect(new mr(mu(p.x,b,p.textAlign),mc(p.y,w,p.textBaseline),b,w))},t.prototype._renderBackground=function(e,t,n,i,r,o){var a,s,l=e.backgroundColor,u=e.borderWidth,c=e.borderColor,h=l&&l.image,d=l&&!h,p=e.borderRadius,f=this;if(d||e.lineHeight||u&&c){(a=this._getOrCreateChild(y$)).useStyle(a.createStyle()),a.style.fill=null;var g=a.shape;g.x=n,g.y=i,g.width=r,g.height=o,g.r=p,a.dirtyShape()}if(d){var m=a.style;m.fill=l||null,m.fillOpacity=p5(e.fillOpacity,1)}else if(h){(s=this._getOrCreateChild(yB)).onload=function(){f.dirtyStyle()};var v=s.style;v.image=l.image,v.x=n,v.y=i,v.width=r,v.height=o}if(u&&c){var m=a.style;m.lineWidth=u,m.stroke=c,m.strokeOpacity=p5(e.strokeOpacity,1),m.lineDash=e.borderDash,m.lineDashOffset=e.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(m.strokeFirst=!0,m.lineWidth*=2)}var y=(a||s).style;y.shadowBlur=e.shadowBlur||0,y.shadowColor=e.shadowColor||"transparent",y.shadowOffsetX=e.shadowOffsetX||0,y.shadowOffsetY=e.shadowOffsetY||0,y.opacity=p3(e.opacity,t.opacity,1)},t.makeFont=function(e){var t,n,i="";return(null!=(t=e).fontSize||t.fontFamily||t.fontWeight)&&(i=[e.fontStyle,e.fontWeight,"string"==typeof(n=e.fontSize)&&(-1!==n.indexOf("px")||-1!==n.indexOf("rem")||-1!==n.indexOf("em"))?n:isNaN(+n)?"12px":n+"px",e.fontFamily||"sans-serif"].join(" ")),i&&p9(i)||e.textFont||e.font},t}(vZ),yZ={left:!0,right:1,center:1},yX={top:1,bottom:1,middle:1},yK=["fontStyle","fontWeight","fontSize","fontFamily"];function yQ(e,t){for(var n=0;n<yK.length;n++){var i=yK[n],r=t[i];null!=r&&(e[i]=r)}}function yJ(e){if(e){e.font=yY.makeFont(e);var t=e.align;"middle"===t&&(t="center"),e.align=null==t||yZ[t]?t:"left";var n=e.verticalAlign;"center"===n&&(n="middle"),e.verticalAlign=null==n||yX[n]?n:"top",e.padding&&(e.padding=p6(e.padding))}}function y0(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function y1(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function y2(e,t,n){return"right"===t?e-n[1]:"center"===t?e+n[3]/2-n[1]/2:e+n[3]}function y5(e){var t=e.text;return null!=t&&(t+=""),t}function y3(e){return!!(e.backgroundColor||e.lineHeight||e.borderWidth&&e.borderColor)}let y4=yY;var y6=fz(),y8=function(e,t,n,i){if(i){var r=y6(i);r.dataIndex=n,r.dataType=t,r.seriesIndex=e,r.ssrType="chart","group"===i.type&&i.traverse(function(i){var r=y6(i);r.seriesIndex=e,r.dataIndex=n,r.dataType=t,r.ssrType="chart"})}},y9=1,y7={},xe=fz(),xt=fz(),xn=["emphasis","blur","select"],xi=["normal","emphasis","blur","select"],xr="highlight",xo="downplay",xa="select",xs="unselect",xl="toggleSelect";function xu(e){return null!=e&&"none"!==e}function xc(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function xh(e){xc(e,"emphasis",2)}function xd(e){2===e.hoverState&&xc(e,"normal",0)}function xp(e){xc(e,"blur",1)}function xf(e){1===e.hoverState&&xc(e,"normal",0)}function xg(e){e.selected=!0}function xm(e){e.selected=!1}function xv(e,t,n){t(e,n),e.isGroup&&e.traverse(function(e){t(e,n)})}function xy(e,t){switch(t){case"emphasis":e.hoverState=2;break;case"normal":e.hoverState=0;break;case"blur":e.hoverState=1;break;case"select":e.selected=!0}}function xx(e,t){var n,i,r,o,a,s=this.states[e];if(this.style){if("emphasis"===e)return function(e,t,n){var i=t&&pN(t,"select")>=0,r=!1;if(e instanceof yO){var o=xe(e),a=i&&o.selectFill||o.normalFill,s=i&&o.selectStroke||o.normalStroke;if(xu(a)||xu(s)){var l=(n=n||{}).style||{};"inherit"===l.fill?(r=!0,n=pR({},n),(l=pR({},l)).fill=a):!xu(l.fill)&&xu(a)?(r=!0,n=pR({},n),(l=pR({},l)).fill=vx(a)):!xu(l.stroke)&&xu(s)&&(r||(n=pR({},n),l=pR({},l)),l.stroke=vx(s)),n.style=l}}if(n&&null==n.z2){r||(n=pR({},n));var u=e.z2EmphasisLift;n.z2=e.z2+(null!=u?u:10)}return n}(this,t,s);else if("blur"===e)return n=s,i=pN(this.currentStates,e)>=0,r=this.style.opacity,o=i?null:function(e,t,n,i){for(var r=e.style,o={},a=0;a<t.length;a++){var s=t[a],l=r[s];o[s]=null==l?i&&i[s]:l}for(var a=0;a<e.animators.length;a++){var u=e.animators[a];u.__fromStateTransition&&0>u.__fromStateTransition.indexOf(n)&&"style"===u.targetName&&u.saveTo(o,t)}return o}(this,["opacity"],e,{opacity:1}),null==(a=(n=n||{}).style||{}).opacity&&(n=pR({},n),a=pR({opacity:i?r:.1*o.opacity},a),n.style=a),n;else if("select"===e){var l=s;if(l&&null==l.z2){l=pR({},l);var u=this.z2SelectLift;l.z2=this.z2+(null!=u?u:9)}return l}}return s}function xb(e){e.stateProxy=xx;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=xx),n&&(n.stateProxy=xx)}function xw(e,t){xC(e,t)||e.__highByOuter||xv(e,xh)}function xS(e,t){xC(e,t)||e.__highByOuter||xv(e,xd)}function x_(e,t){e.__highByOuter|=1<<(t||0),xv(e,xh)}function xM(e,t){(e.__highByOuter&=~(1<<(t||0)))||xv(e,xd)}function xC(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function xA(e){var t=e.getModel(),n=[],i=[];t.eachComponent(function(t,r){var o=xt(r),a="series"===t,s=a?e.getViewOfSeriesModel(r):e.getViewOfComponentModel(r);a||i.push(s),o.isBlured&&(s.group.traverse(function(e){xf(e)}),a&&n.push(r)),o.isBlured=!1}),pz(i,function(e){e&&e.toggleBlurSeries&&e.toggleBlurSeries(n,!1,t)})}function xk(e,t,n,i){var r=i.getModel();function o(e,t){for(var n=0;n<t.length;n++){var i=e.getItemGraphicEl(t[n]);i&&xv(i,xf)}}if((n=n||"coordinateSystem",null!=e)&&t&&"none"!==t){var a=r.getSeriesByIndex(e),s=a.coordinateSystem;s&&s.master&&(s=s.master);var l=[];r.eachSeries(function(e){var r=a===e,u=e.coordinateSystem;u&&u.master&&(u=u.master);var c=u&&s?u===s:r;if(!("series"===n&&!r||"coordinateSystem"===n&&!c||"series"===t&&r)){if(i.getViewOfSeriesModel(e).group.traverse(function(e){e.__highByOuter&&r&&"self"===t||xp(e)}),pF(t))o(e.getData(),t);else if(pK(t))for(var h=pW(t),d=0;d<h.length;d++)o(e.getData(h[d]),t[h[d]]);l.push(e),xt(e).isBlured=!0}}),r.eachComponent(function(e,t){if("series"!==e){var n=i.getViewOfComponentModel(t);n&&n.toggleBlurSeries&&n.toggleBlurSeries(l,!0,r)}})}}function xT(e,t,n){if(null!=e&&null!=t){var i=n.getModel().getComponent(e,t);if(i){xt(i).isBlured=!0;var r=n.getViewOfComponentModel(i);r&&r.focusBlurEnabled&&r.group.traverse(function(e){xp(e)})}}}function xD(e,t,n,i){var r,o={focusSelf:!1,dispatchers:null};if(null==e||"series"===e||null==t||null==n)return o;var a=i.getModel().getComponent(e,t);if(!a)return o;var s=i.getViewOfComponentModel(a);if(!s||!s.findHighDownDispatchers)return o;for(var l=s.findHighDownDispatchers(n),u=0;u<l.length;u++)if("self"===y6(l[u]).focus){r=!0;break}return{focusSelf:r,dispatchers:l}}function xI(e){pz(e.getAllData(),function(t){var n=t.data,i=t.type;n.eachItemGraphicEl(function(t,n){e.isSelected(n,i)?xv(t,xg):xv(t,xm)})})}function xO(e,t,n){var i,r,o,a;xN(e,!0),xv(e,xb),i=e,r=t,o=n,a=y6(i),null!=r?(a.focus=r,a.blurScope=o):a.focus&&(a.focus=null)}function xP(e,t,n,i){i?xN(e,!1):xO(e,t,n)}var xE=["emphasis","blur","select"],xR={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function xL(e,t,n,i){n=n||"itemStyle";for(var r=0;r<xE.length;r++){var o=xE[r],a=t.getModel([o,n]);e.ensureState(o).style=i?i(a):a[xR[n]]()}}function xN(e,t){var n=!1===t;e.highDownSilentOnTouch&&(e.__highDownSilentOnTouch=e.highDownSilentOnTouch),(!n||e.__highDownDispatcher)&&(e.__highByOuter=e.__highByOuter||0,e.__highDownDispatcher=!n)}function xB(e){return!!(e&&e.__highDownDispatcher)}function xF(e){var t=e.type;return t===xa||t===xs||t===xl}function xz(e){var t=e.type;return t===xr||t===xo}var xV=fz();function xj(e,t,n,i,r){if(t&&t.ecModel){var o,a=t.ecModel.getUpdatePayload();o=a&&a.animation}var s=t&&t.isAnimationEnabled(),l="update"===e;if(!s)return null;var u=void 0,c=void 0,h=void 0;return i?(u=p5(i.duration,200),c=p5(i.easing,"cubicOut"),h=0):(u=t.getShallow(l?"animationDurationUpdate":"animationDuration"),c=t.getShallow(l?"animationEasingUpdate":"animationEasing"),h=t.getShallow(l?"animationDelayUpdate":"animationDelay")),o&&(null!=o.duration&&(u=o.duration),null!=o.easing&&(c=o.easing),null!=o.delay&&(h=o.delay)),pq(h)&&(h=h(n,r)),pq(u)&&(u=u(n)),{duration:u||0,delay:h,easing:c}}function xH(e,t,n,i,r,o,a){var s,l=!1;pq(r)?(a=o,o=r,r=null):pK(r)&&(o=r.cb,a=r.during,l=r.isFrom,s=r.removeOpt,r=r.dataIndex);var u="leave"===e;u||t.stopAnimation("leave");var c=xj(e,i,r,u?s||{}:null,i&&i.getAnimationDelayParams?i.getAnimationDelayParams(t,r):null);if(c&&c.duration>0){var h={duration:c.duration,delay:c.delay||0,easing:c.easing,done:o,force:!!o||!!a,setToFinal:!u,scope:e,during:a};l?t.animateFrom(n,h):t.animateTo(n,h)}else t.stopAnimation(),l||t.attr(n),a&&a(1),o&&o()}function xW(e,t,n,i,r,o){xH("update",e,t,n,i,r,o)}function xG(e,t,n,i,r,o){xH("enter",e,t,n,i,r,o)}function x$(e){if(!e.__zr)return!0;for(var t=0;t<e.animators.length;t++)if("leave"===e.animators[t].scope)return!0;return!1}function xU(e,t,n,i,r,o){x$(e)||xH("leave",e,t,n,i,r,o)}function xq(e,t,n,i){e.removeTextContent(),e.removeTextGuideLine(),xU(e,{style:{opacity:0}},t,n,i)}function xY(e,t,n){function i(){e.parent&&e.parent.remove(e)}e.isGroup?e.traverse(function(e){e.isGroup||xq(e,t,n,i)}):xq(e,t,n,i)}function xZ(e){xV(e).oldStyle=e.style}var xX={};function xK(e,t){for(var n=0;n<xn.length;n++){var i=xn[n],r=t[i],o=e.ensureState(i);o.style=o.style||{},o.style.text=r}var a=e.currentStates.slice();e.clearStates(!0),e.setStyle({text:t.normal}),e.useStates(a,!0)}function xQ(e,t,n){var i,r=e.labelFetcher,o=e.labelDataIndex,a=e.labelDimIndex,s=t.normal;r&&(i=r.getFormattedLabel(o,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==i&&(i=pq(e.defaultText)?e.defaultText(o,e,n):e.defaultText);for(var l={normal:i},u=0;u<xn.length;u++){var c=xn[u],h=t[c];l[c]=p5(r?r.getFormattedLabel(o,c,null,a,h&&h.get("formatter")):null,i)}return l}function xJ(e,t,n,i){n=n||xX;for(var r=e instanceof y4,o=!1,a=0;a<xi.length;a++){var s=t[xi[a]];if(s&&s.getShallow("show")){o=!0;break}}var l=r?e:e.getTextContent();if(o){!r&&(l||(l=new y4,e.setTextContent(l)),e.stateProxy&&(l.stateProxy=e.stateProxy));var u=xQ(n,t),c=t.normal,h=!!c.getShallow("show"),d=x1(c,i&&i.normal,n,!1,!r);d.text=u.normal,r||e.setTextConfig(x2(c,n,!1));for(var a=0;a<xn.length;a++){var p=xn[a],s=t[p];if(s){var f=l.ensureState(p),g=!!p5(s.getShallow("show"),h);g!==h&&(f.ignore=!g),f.style=x1(s,i&&i[p],n,!0,!r),f.style.text=u[p],r||(e.ensureState(p).textConfig=x2(s,n,!0))}}l.silent=!!c.getShallow("silent"),null!=l.style.x&&(d.x=l.style.x),null!=l.style.y&&(d.y=l.style.y),l.ignore=!h,l.useStyle(d),l.dirty(),n.enableTextSetter&&(x9(l).setLabelText=function(e){var i=xQ(n,t,e);xK(l,i)})}else l&&(l.ignore=!0);e.dirty()}function x0(e,t){t=t||"label";for(var n={normal:e.getModel(t)},i=0;i<xn.length;i++){var r=xn[i];n[r]=e.getModel([r,t])}return n}function x1(e,t,n,i,r){var o={};return function(e,t,n,i,r){n=n||xX;var o,a=t.ecModel,s=a&&a.option.textStyle,l=function(e){for(var t;e&&e!==e.ecModel;){var n=(e.option||xX).rich;if(n){t=t||{};for(var i=pW(n),r=0;r<i.length;r++)t[i[r]]=1}e=e.parentModel}return t}(t);if(l){for(var u in o={},l)if(l.hasOwnProperty(u)){var c=t.getModel(["rich",u]);x6(o[u]={},c,s,n,i,r,!1,!0)}}o&&(e.rich=o);var h=t.get("overflow");h&&(e.overflow=h);var d=t.get("minMargin");null!=d&&(e.margin=d),x6(e,t,s,n,i,r,!0,!1)}(o,e,n,i,r),t&&pR(o,t),o}function x2(e,t,n){t=t||{};var i,r={},o=e.getShallow("rotate"),a=p5(e.getShallow("distance"),n?null:5),s=e.getShallow("offset");return"outside"===(i=e.getShallow("position")||(n?null:"inside"))&&(i=t.defaultOutsidePosition||"top"),null!=i&&(r.position=i),null!=s&&(r.offset=s),null!=o&&(r.rotation=o*=Math.PI/180),null!=a&&(r.distance=a),r.outsideFill="inherit"===e.get("color")?t.inheritColor||null:"auto",r}var x5=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],x3=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],x4=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function x6(e,t,n,i,r,o,a,s){n=!r&&n||xX;var l=i&&i.inheritColor,u=t.getShallow("color"),c=t.getShallow("textBorderColor"),h=p5(t.getShallow("opacity"),n.opacity);("inherit"===u||"auto"===u)&&(u=l||null),("inherit"===c||"auto"===c)&&(c=l||null),o||(u=u||n.color,c=c||n.textBorderColor),null!=u&&(e.fill=u),null!=c&&(e.stroke=c);var d=p5(t.getShallow("textBorderWidth"),n.textBorderWidth);null!=d&&(e.lineWidth=d);var p=p5(t.getShallow("textBorderType"),n.textBorderType);null!=p&&(e.lineDash=p);var f=p5(t.getShallow("textBorderDashOffset"),n.textBorderDashOffset);null!=f&&(e.lineDashOffset=f),r||null!=h||s||(h=i&&i.defaultOpacity),null!=h&&(e.opacity=h),r||o||null!=e.fill||!i.inheritColor||(e.fill=i.inheritColor);for(var g=0;g<x5.length;g++){var m=x5[g],v=p5(t.getShallow(m),n[m]);null!=v&&(e[m]=v)}for(var g=0;g<x3.length;g++){var m=x3[g],v=t.getShallow(m);null!=v&&(e[m]=v)}if(null==e.verticalAlign){var y=t.getShallow("baseline");null!=y&&(e.verticalAlign=y)}if(!a||!i.disableBox){for(var g=0;g<x4.length;g++){var m=x4[g],v=t.getShallow(m);null!=v&&(e[m]=v)}var x=t.getShallow("borderType");null!=x&&(e.borderDash=x),("auto"===e.backgroundColor||"inherit"===e.backgroundColor)&&l&&(e.backgroundColor=l),("auto"===e.borderColor||"inherit"===e.borderColor)&&l&&(e.borderColor=l)}}function x8(e,t){var n=t&&t.getModel("textStyle");return p9([e.fontStyle||n&&n.getShallow("fontStyle")||"",e.fontWeight||n&&n.getShallow("fontWeight")||"",(e.fontSize||n&&n.getShallow("fontSize")||12)+"px",e.fontFamily||n&&n.getShallow("fontFamily")||"sans-serif"].join(" "))}var x9=fz();function x7(e,t,n,i){if(e){var r=x9(e);r.prevValue=r.value,r.value=n;var o=t.normal;r.valueAnimation=o.get("valueAnimation"),r.valueAnimation&&(r.precision=o.get("precision"),r.defaultInterpolatedText=i,r.statesModels=t)}}var be=["textStyle","color"],bt=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],bn=new y4,bi=function(){function e(){}return e.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(be):null)},e.prototype.getFont=function(){return x8({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},e.prototype.getTextRect=function(e){for(var t={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n<bt.length;n++)t[bt[n]]=this.getShallow(bt[n]);return bn.useStyle(t),bn.update(),bn.getBoundingRect()},e}(),br=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],bo=gj(br),ba=function(){function e(){}return e.prototype.getLineStyle=function(e){return bo(this,e)},e}(),bs=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],bl=gj(bs),bu=function(){function e(){}return e.prototype.getItemStyle=function(e,t){return bl(this,e,t)},e}(),bc=function(){function e(e,t,n){this.parentModel=t,this.ecModel=n,this.option=e}return e.prototype.init=function(e,t,n){for(var i=[],r=3;r<arguments.length;r++)i[r-3]=arguments[r]},e.prototype.mergeOption=function(e,t){pE(this.option,e,!0)},e.prototype.get=function(e,t){return null==e?this.option:this._doGet(this.parsePath(e),!t&&this.parentModel)},e.prototype.getShallow=function(e,t){var n=this.option,i=null==n?n:n[e];if(null==i&&!t){var r=this.parentModel;r&&(i=r.getShallow(e))}return i},e.prototype.getModel=function(t,n){var i=null!=t,r=i?this.parsePath(t):null;return new e(i?this._doGet(r):this.option,n=n||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(r)),this.ecModel)},e.prototype.isEmpty=function(){return null==this.option},e.prototype.restoreData=function(){},e.prototype.clone=function(){return new this.constructor(pP(this.option))},e.prototype.parsePath=function(e){return"string"==typeof e?e.split("."):e},e.prototype.resolveParentPath=function(e){return e},e.prototype.isAnimationEnabled=function(){if(!fA.node&&this.option){if(null!=this.option.animation)return!!this.option.animation;else if(this.parentModel)return this.parentModel.isAnimationEnabled()}},e.prototype._doGet=function(e,t){var n=this.option;if(!e)return n;for(var i=0;i<e.length&&(!e[i]||null!=(n=n&&"object"==typeof n?n[e[i]]:null));i++);return null==n&&t&&(n=t._doGet(this.resolveParentPath(e),t.parentModel)),n},e}();gL(bc),w=["__\0is_clz",gB++].join("_"),bc.prototype[w]=!0,bc.isInstance=function(e){return!!(e&&e[w])},pB(bc,ba),pB(bc,bu),pB(bc,gW),pB(bc,bi);var bh=Math.round(10*Math.random());function bd(e){return[e||"",bh++].join("_")}function bp(e,t){return pE(pE({},e,!0),t,!0)}var bf=Math.log(2);function bg(e,t,n,i,r,o){var a=i+"-"+r,s=e.length;if(o.hasOwnProperty(a))return o[a];if(1===t){var l=Math.round(Math.log((1<<s)-1&~r)/bf);return e[n][l]}for(var u=i|1<<n,c=n+1;i&1<<c;)c++;for(var h=0,d=0,p=0;d<s;d++){var f=1<<d;!(f&r)&&(h+=(p%2?-1:1)*e[n][d]*bg(e,t-1,c,u,r|f,o),p++)}return o[a]=h,h}function bm(e,t){var n=[[e[0],e[1],1,0,0,0,-t[0]*e[0],-t[0]*e[1]],[0,0,0,e[0],e[1],1,-t[1]*e[0],-t[1]*e[1]],[e[2],e[3],1,0,0,0,-t[2]*e[2],-t[2]*e[3]],[0,0,0,e[2],e[3],1,-t[3]*e[2],-t[3]*e[3]],[e[4],e[5],1,0,0,0,-t[4]*e[4],-t[4]*e[5]],[0,0,0,e[4],e[5],1,-t[5]*e[4],-t[5]*e[5]],[e[6],e[7],1,0,0,0,-t[6]*e[6],-t[6]*e[7]],[0,0,0,e[6],e[7],1,-t[7]*e[6],-t[7]*e[7]]],i={},r=bg(n,8,0,0,0,i);if(0!==r){for(var o=[],a=0;a<8;a++)for(var s=0;s<8;s++)null==o[s]&&(o[s]=0),o[s]+=((a+s)%2?-1:1)*bg(n,7,+(0===a),1<<a,1<<s,i)/r*t[a];return function(e,t,n){var i=t*o[6]+n*o[7]+1;e[0]=(t*o[0]+n*o[1]+o[2])/i,e[1]=(t*o[3]+n*o[4]+o[5])/i}}}var bv="___zrEVENTSAVED",by=[];function bx(e,t,n,i,r){if(t.getBoundingClientRect&&fA.domSupported&&!bb(t)){var o=t[bv]||(t[bv]={}),a=function(e,t,n){for(var i=n?"invTrans":"trans",r=t[i],o=t.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var c=e[u].getBoundingClientRect(),h=2*u,d=c.left,p=c.top;a.push(d,p),l=l&&o&&d===o[h]&&p===o[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&r?r:(t.srcCoords=a,t[i]=n?bm(s,a):bm(a,s))}(function(e,t){var n=t.markers;if(n)return n;n=t.markers=[];for(var i=["left","right"],r=["top","bottom"],o=0;o<4;o++){var a=document.createElement("div"),s=a.style,l=o%2,u=(o>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),e.appendChild(a),n.push(a)}return n}(t,o),o,r);if(a)return a(e,n,i),!0}return!1}function bb(e){return"CANVAS"===e.nodeName.toUpperCase()}var bw=/([&<>"'])/g,bS={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function b_(e){return null==e?"":(e+"").replace(bw,function(e,t){return bS[t]})}var bM={},bC={},bA=fA.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage||"EN").toUpperCase().indexOf("ZH")>-1?"ZH":"EN";function bk(e,t){bC[e=e.toUpperCase()]=new bc(t),bM[e]=t}bk("EN",{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),bk("ZH",{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var bT={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},bD="{yyyy}-{MM}-{dd}",bI={year:"{yyyy}",month:"{yyyy}-{MM}",day:bD,hour:bD+" "+bT.hour,minute:bD+" "+bT.minute,second:bD+" "+bT.second,millisecond:bT.none},bO=["year","month","day","hour","minute","second","millisecond"],bP=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function bE(e,t){return e+="","0000".substr(0,t-e.length)+e}function bR(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function bL(e,t,n,i){var r=fy(e),o=r[bF(n)](),a=r[bz(n)]()+1,s=Math.floor((a-1)/3)+1,l=r[bV(n)](),u=r["get"+(n?"UTC":"")+"Day"](),c=r[bj(n)](),h=(c-1)%12+1,d=r[bH(n)](),p=r[bW(n)](),f=r[bG(n)](),g=(i instanceof bc?i:bC[i||bA]||bC.EN).getModel("time"),m=g.get("month"),v=g.get("monthAbbr"),y=g.get("dayOfWeek"),x=g.get("dayOfWeekAbbr");return(t||"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,bE(o%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,m[a-1]).replace(/{MMM}/g,v[a-1]).replace(/{MM}/g,bE(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,bE(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,y[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,bE(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,bE(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,bE(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,bE(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,bE(f,3)).replace(/{S}/g,f+"")}function bN(e,t){var n=fy(e),i=n[bz(t)]()+1,r=n[bV(t)](),o=n[bj(t)](),a=n[bH(t)](),s=n[bW(t)](),l=0===n[bG(t)](),u=l&&0===s,c=u&&0===a,h=c&&0===o,d=h&&1===r;if(d&&1===i)return"year";if(d)return"month";if(h)return"day";if(c)return"hour";if(u)return"minute";else if(l)return"second";else return"millisecond"}function bB(e,t,n){var i=pX(e)?fy(e):e;switch(t=t||bN(e,n)){case"year":return i[bF(n)]();case"half-year":return+(i[bz(n)]()>=6);case"quarter":return Math.floor((i[bz(n)]()+1)/4);case"month":return i[bz(n)]();case"day":return i[bV(n)]();case"half-day":return i[bj(n)]()/24;case"hour":return i[bj(n)]();case"minute":return i[bH(n)]();case"second":return i[bW(n)]();case"millisecond":return i[bG(n)]()}}function bF(e){return e?"getUTCFullYear":"getFullYear"}function bz(e){return e?"getUTCMonth":"getMonth"}function bV(e){return e?"getUTCDate":"getDate"}function bj(e){return e?"getUTCHours":"getHours"}function bH(e){return e?"getUTCMinutes":"getMinutes"}function bW(e){return e?"getUTCSeconds":"getSeconds"}function bG(e){return e?"getUTCMilliseconds":"getMilliseconds"}function b$(e){return e?"setUTCMonth":"setMonth"}function bU(e){return e?"setUTCDate":"setDate"}function bq(e){return e?"setUTCHours":"setHours"}function bY(e){return e?"setUTCMinutes":"setMinutes"}function bZ(e){return e?"setUTCSeconds":"setSeconds"}function bX(e){return e?"setUTCMilliseconds":"setMilliseconds"}function bK(e){if(isNaN(fS(e)))return pY(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function bQ(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}function bJ(e,t,n){function i(e){return e&&p9(e)?e:"-"}function r(e){return!!(null!=e&&!isNaN(e)&&isFinite(e))}var o="time"===t,a=e instanceof Date;if(o||a){var s=o?fy(e):e;if(!isNaN(+s))return bL(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===t)return pZ(e)?i(e):pX(e)&&r(e)?e+"":"-";var l=fS(e);return r(l)?bK(l):pZ(e)?i(e):"boolean"==typeof e?e+"":"-"}var b0=["a","b","c","d","e","f","g"],b1=function(e,t){return"{"+e+(null==t?"":t)+"}"};function b2(e,t,n){pU(t)||(t=[t]);var i=t.length;if(!i)return"";for(var r=t[0].$vars||[],o=0;o<r.length;o++){var a=b0[o];e=e.replace(b1(a),b1(a,0))}for(var s=0;s<i;s++)for(var l=0;l<r.length;l++){var u=t[s][r[l]];e=e.replace(b1(b0[l],s),n?b_(u):u)}return e}function b5(e,t){return t=t||"transparent",pY(e)?e:pK(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function b3(e,t){if("_blank"===t||"blank"===t){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}var b4=["left","right","top","bottom","width","height"],b6=[["width","left","right"],["height","top","bottom"]];function b8(e,t,n,i,r){var o=0,a=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;t.eachChild(function(l,u){var c,h,d=l.getBoundingRect(),p=t.childAt(u+1),f=p&&p.getBoundingRect();if("horizontal"===e){var g=d.width+(f?-f.x+d.x:0);(c=o+g)>i||l.newline?(o=0,c=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(f?-f.y+d.y:0);(h=a+m)>r||l.newline?(o+=s+n,a=0,h=m,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),"horizontal"===e?o=c+n:a=h+n)})}function b9(e,t,n){n=p6(n||0);var i=t.width,r=t.height,o=fc(e.left,i),a=fc(e.top,r),s=fc(e.right,i),l=fc(e.bottom,r),u=fc(e.width,i),c=fc(e.height,r),h=n[2]+n[0],d=n[1]+n[3],p=e.aspect;switch(isNaN(u)&&(u=i-s-d-o),isNaN(c)&&(c=r-l-h-a),null!=p&&(isNaN(u)&&isNaN(c)&&(p>i/r?u=.8*i:c=.8*r),isNaN(u)&&(u=p*c),isNaN(c)&&(c=u/p)),isNaN(o)&&(o=i-s-u-d),isNaN(a)&&(a=r-l-c-h),e.left||e.right){case"center":o=i/2-u/2-n[3];break;case"right":o=i-u-d}switch(e.top||e.bottom){case"middle":case"center":a=r/2-c/2-n[0];break;case"bottom":a=r-c-h}o=o||0,a=a||0,isNaN(u)&&(u=i-d-o-(s||0)),isNaN(c)&&(c=r-h-a-(l||0));var f=new mr(o+n[3],a+n[0],u,c);return f.margin=n,f}function b7(e,t,n,i,r,o){var a,s=!r||!r.hv||r.hv[0],l=!r||!r.hv||r.hv[1],u=r&&r.boundingMode||"all";if((o=o||e).x=e.x,o.y=e.y,!s&&!l)return!1;if("raw"===u)a="group"===e.type?new mr(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(a=e.getBoundingRect(),e.needLocalTransform()){var c=e.getLocalTransform();(a=a.clone()).applyTransform(c)}var h=b9(pL({width:a.width,height:a.height},t),n,i),d=s?h.x-a.x:0,p=l?h.y-a.y:0;return"raw"===u?(o.x=d,o.y=p):(o.x+=d,o.y+=p),o===e&&e.markRedraw(),!0}function we(e){var t=e.layoutMode||e.constructor.layoutMode;return pK(t)?t:t?{type:t}:null}function wt(e,t,n){var i=n&&n.ignoreSize;pU(i)||(i=[i,i]);var r=a(b6[0],0),o=a(b6[1],1);function a(n,r){var o={},a=0,u={},c=0;if(pz(n,function(t){u[t]=e[t]}),pz(n,function(e){s(t,e)&&(o[e]=u[e]=t[e]),l(o,e)&&a++,l(u,e)&&c++}),i[r])return l(t,n[1])?u[n[2]]=null:l(t,n[2])&&(u[n[1]]=null),u;if(2===c||!a)return u;if(a>=2)return o;for(var h=0;h<n.length;h++){var d=n[h];if(!s(o,d)&&s(e,d)){o[d]=e[d];break}}return o}function s(e,t){return e.hasOwnProperty(t)}function l(e,t){return null!=e[t]&&"auto"!==e[t]}function u(e,t,n){pz(e,function(e){t[e]=n[e]})}u(b6[0],e,r),u(b6[1],e,o)}function wn(e){var t,n;return t={},(n=e)&&t&&pz(b4,function(e){n.hasOwnProperty(e)&&(t[e]=n[e])}),t}p$(b8,"vertical"),p$(b8,"horizontal");var wi=fz(),wr=function(e){var t;function n(t,n,i){var r=e.call(this,t,n,i)||this;return r.uid=bd("ec_cpt_model"),r}return gO(n,e),n.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},n.prototype.mergeDefaultAndTheme=function(e,t){var n=we(this),i=n?wn(e):{};pE(e,t.getTheme().get(this.mainType)),pE(e,this.getDefaultOption()),n&&wt(e,i,n)},n.prototype.mergeOption=function(e,t){pE(this.option,e,!0);var n=we(this);n&&wt(this.option,e,n)},n.prototype.optionUpdated=function(e,t){},n.prototype.getDefaultOption=function(){var e=this.constructor;if(!(e&&e[gE]))return e.defaultOption;var t=wi(this);if(!t.defaultOption){for(var n=[],i=e;i;){var r=i.prototype.defaultOption;r&&n.push(r),i=i.superClass}for(var o={},a=n.length-1;a>=0;a--)o=pE(o,n[a],!0);t.defaultOption=o}return t.defaultOption},n.prototype.getReferringComponents=function(e,t){return f$(this.ecModel,e,{index:this.get(e+"Index",!0),id:this.get(e+"Id",!0)},t)},n.prototype.getBoxLayoutParams=function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}},n.prototype.getZLevelKey=function(){return""},n.prototype.setZLevel=function(e){this.option.zlevel=e},n.protoInitialize=void((t=n.prototype).type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0),n}(bc);gN(wr,bc),gV(wr),S={},wr.registerSubTypeDefaulter=function(e,t){S[gR(e).main]=t},wr.determineSubType=function(e,t){var n=t.type;if(!n){var i=gR(e).main;wr.hasSubTypes(e)&&S[i]&&(n=S[i](t))}return n};var wo=function(e){var t=[];return pz(wr.getClassesByMainType(e),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=pV(t,function(e){return gR(e).main}),"dataset"!==e&&0>=pN(t,"dataset")&&t.unshift("dataset"),t};function wa(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}wr.topologicalTravel=function(e,t,n,i){if(e.length){var r,o,a,s=(o={},a=[],pz(r=t,function(e){var t,n,i,s=wa(o,e),l=(t=s.originalDeps=wo(e),n=r,i=[],pz(t,function(e){pN(n,e)>=0&&i.push(e)}),i);s.entryCount=l.length,0===s.entryCount&&a.push(e),pz(l,function(t){0>pN(s.predecessor,t)&&s.predecessor.push(t);var n=wa(o,t);0>pN(n.successor,t)&&n.successor.push(e)})}),{graph:o,noEntryList:a}),l=s.graph,u=s.noEntryList,c={};for(pz(e,function(e){c[e]=!0});u.length;){var h=u.pop(),d=l[h],p=!!c[h];p&&(n.call(i,h,d.originalDeps.slice()),delete c[h]),pz(d.successor,p?g:f)}pz(c,function(){throw Error("")})}function f(e){l[e].entryCount--,0===l[e].entryCount&&u.push(e)}function g(e){c[e]=!0,f(e)}};var ws=fz();fz();var wl=function(){function e(){}return e.prototype.getColorFromPalette=function(e,t,n){return function(e,t,n,i,r,o,a){var s=t(o=o||e),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(r))return u[r];var c=null!=a&&i?function(e,t){for(var n=e.length,i=0;i<n;i++)if(e[i].length>t)return e[i];return e[n-1]}(i,a):n;if((c=c||n)&&c.length){var h=c[l];return r&&(u[r]=h),s.paletteIdx=(l+1)%c.length,h}}(this,ws,fD(this.get("color",!0)),this.get("colorLayer",!0),e,t,n)},e.prototype.clearColorPalette=function(){var e,t;e=this,(t=ws)(e).paletteIdx=0,t(e).paletteNameMap={}},e}(),wu=function(){var e;function t(e,t){var n=f7(e)?e:gt(e);this._source=n;var i=this._data=n.data;n.sourceFormat===fJ&&(this._offset=0,this._dimSize=t,this._data=i),z(this,i,n)}return t.prototype.getSource=function(){return this._source},t.prototype.count=function(){return 0},t.prototype.getItem=function(e,t){},t.prototype.appendData=function(e){},t.prototype.clean=function(){},t.protoInitialize=void((e=t.prototype).pure=!1,e.persistent=!0),t.internalField=function(){z=function(e,r,o){var a=o.sourceFormat,s=o.seriesLayoutBy,l=o.startIndex,u=o.dimensionsDefine;pR(e,F[wm(a,s)]),a===fJ?(e.getItem=t,e.count=i,e.fillStorage=n):(e.getItem=pG(function(e,t){return wh[wm(e,t)]}(a,s),null,r,l,u),e.count=pG(function(e,t){return wp[wm(e,t)]}(a,s),null,r,l,u))};var e,t=function(e,t){e-=this._offset,t=t||[];for(var n=this._data,i=this._dimSize,r=i*e,o=0;o<i;o++)t[o]=n[r+o];return t},n=function(e,t,n,i){for(var r=this._data,o=this._dimSize,a=0;a<o;a++){for(var s=i[a],l=null==s[0]?1/0:s[0],u=null==s[1]?-1/0:s[1],c=t-e,h=n[a],d=0;d<c;d++){var p=r[d*o+a];h[e+d]=p,p<l&&(l=p),p>u&&(u=p)}s[0]=l,s[1]=u}},i=function(){return this._data?this._data.length/this._dimSize:0};function r(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}(e={})[fX+"_"+f1]={pure:!0,appendData:r},e[fX+"_row"]={pure:!0,appendData:function(){throw Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[fK]={pure:!0,appendData:r},e[fQ]={pure:!0,appendData:function(e){var t=this._data;pz(e,function(e,n){for(var i=t[n]||(t[n]=[]),r=0;r<(e||[]).length;r++)i.push(e[r])})}},e[fZ]={appendData:r},e[fJ]={persistent:!1,pure:!0,appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},F=e}(),t}(),wc=function(e,t,n,i){return e[i]},wh=((L={})[fX+"_"+f1]=function(e,t,n,i){return e[i+t]},L[fX+"_row"]=function(e,t,n,i,r){i+=t;for(var o=r||[],a=0;a<e.length;a++){var s=e[a];o[a]=s?s[i]:null}return o},L[fK]=wc,L[fQ]=function(e,t,n,i,r){for(var o=r||[],a=0;a<n.length;a++){var s=e[n[a].name];o[a]=s?s[i]:null}return o},L[fZ]=wc,L),wd=function(e,t,n){return e.length},wp=((N={})[fX+"_"+f1]=function(e,t,n){return Math.max(0,e.length-t)},N[fX+"_row"]=function(e,t,n){var i=e[0];return i?Math.max(0,i.length-t):0},N[fK]=wd,N[fQ]=function(e,t,n){var i=e[n[0].name];return i?i.length:0},N[fZ]=wd,N),wf=function(e,t,n){return e[t]},wg=((B={})[fX]=wf,B[fK]=function(e,t,n){return e[n]},B[fQ]=wf,B[fZ]=function(e,t,n){var i=fP(e);return i instanceof Array?i[t]:i},B[fJ]=wf,B);function wm(e,t){return e===fX?e+"_"+t:e}function wv(e,t,n){if(e){var i=e.getRawDataItem(t);if(null!=i){var r=e.getStore(),o=r.getSource().sourceFormat;if(null!=n){var a=e.getDimensionIndex(n),s=r.getDimensionProperty(a);return wg[o](i,a,s)}var l=i;return o===fZ&&(l=fP(i)),l}}}var wy=/\{@(.+?)\}/g,wb=function(){function e(){}return e.prototype.getDataParams=function(e,t){var n=this.getData(t),i=this.getRawValue(e,t),r=n.getRawIndex(e),o=n.getName(e),a=n.getRawDataItem(e),s=n.getItemVisual(e,"style"),l=s&&s[n.getItemVisual(e,"drawType")||"fill"],u=s&&s.stroke,c=this.mainType,h="series"===c,d=n.userOutput&&n.userOutput.get();return{componentType:c,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:h?this.subType:null,seriesIndex:this.seriesIndex,seriesId:h?this.id:null,seriesName:h?this.name:null,name:o,dataIndex:r,data:a,dataType:t,value:i,color:l,borderColor:u,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},e.prototype.getFormattedLabel=function(e,t,n,i,r,o){t=t||"normal";var a=this.getData(n),s=this.getDataParams(e,n);return(o&&(s.value=o.interpolatedValue),null!=i&&pU(s.value)&&(s.value=s.value[i]),r||(r=a.getItemModel(e).get("normal"===t?["label","formatter"]:[t,"label","formatter"])),pq(r))?(s.status=t,s.dimensionIndex=i,r(s)):pY(r)?b2(r,s).replace(wy,function(t,n){var i=n.length,r=n;"["===r.charAt(0)&&"]"===r.charAt(i-1)&&(r=+r.slice(1,i-1));var s=wv(a,e,r);if(o&&pU(o.interpolatedValue)){var l=a.getDimensionIndex(r);l>=0&&(s=o.interpolatedValue[l])}return null!=s?s+"":""}):void 0},e.prototype.getRawValue=function(e,t){return wv(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function ww(e){var t,n;return pK(e)?e.type&&(n=e):t=e,{text:t,frag:n}}function wS(e){return new w_(e)}var w_=function(){function e(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t,n,i,r,o=this._upstream,a=e&&e.skip;if(this._dirty&&o){var s=this.context;s.data=s.outputData=o.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!a&&(i=this._plan(this.context));var l=((t=this._modBy)>=1||(t=1),t),u=this._modDataCount||0,c=((n=e&&e.modBy)>=1||(n=1),n),h=e&&e.modDataCount||0;(l!==c||u!==h)&&(i="reset"),(this._dirty||"reset"===i)&&(this._dirty=!1,r=this._doReset(a)),this._modBy=c,this._modDataCount=h;var d=e&&e.step;if(o?this._dueEnd=o._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,f=Math.min(null!=d?this._dueIndex+d:1/0,this._dueEnd);if(!a&&(r||p<f)){var g=this._progress;if(pU(g))for(var m=0;m<g.length;m++)this._doProgress(g[m],p,f,c,h);else this._doProgress(g,p,f,c,h)}this._dueIndex=f;var v=null!=this._settedOutputEnd?this._settedOutputEnd:f;this._outputDueEnd=v}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()},e.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},e.prototype._doProgress=function(e,t,n,i,r){wM.reset(t,n,i,r),this._callingProgress=e,this._callingProgress({start:t,end:n,count:n-t,next:wM.next},this.context)},e.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null,!e&&this._reset&&((t=this._reset(this.context))&&t.progress&&(n=t.forceFirstProgress,t=t.progress),pU(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var t,n,i=this._downstream;return i&&i.dirty(),n},e.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},e.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},e.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},e.prototype.getUpstream=function(){return this._upstream},e.prototype.getDownstream=function(){return this._downstream},e.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},e}(),wM=function(){var e,t,n,i,r,o={reset:function(l,u,c,h){t=l,e=u,n=c,r=Math.ceil((i=h)/n),o.next=n>1&&i>0?s:a}};return o;function a(){return t<e?t++:null}function s(){var o=t%r*n+Math.ceil(t/r),a=t>=e?null:o<i?o:t;return t++,a}}();function wC(e){throw Error(e)}function wA(e,t){var n=t&&t.type;return"ordinal"===n?e:("time"!==n||pX(e)||null==e||"-"===e||(e=+fy(e)),null==e||""===e?NaN:+e)}fi({number:function(e){return parseFloat(e)},time:function(e){return+fy(e)},trim:function(e){return pY(e)?p9(e):e}});var wk={lt:function(e,t){return e<t},lte:function(e,t){return e<=t},gt:function(e,t){return e>t},gte:function(e,t){return e>=t}};(function(e,t){pX(t)||wC(""),this._opFn=wk[e],this._rvalFloat=fS(t)}).prototype.evaluate=function(e){return pX(e)?this._opFn(e,this._rvalFloat):this._opFn(fS(e),this._rvalFloat)};var wT=function(){function e(e,t){var n="desc"===e;this._resultLT=n?1:-1,null==t&&(t=n?"min":"max"),this._incomparable="min"===t?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=pX(e)?e:fS(e),i=pX(t)?t:fS(t),r=isNaN(n),o=isNaN(i);if(r&&(n=this._incomparable),o&&(i=this._incomparable),r&&o){var a=pY(e),s=pY(t);a&&(n=s?e:0),s&&(i=a?t:0)}return n<i?this._resultLT:n>i?-this._resultLT:0},e}();(function(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=fS(t)}).prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n!==this._rvalTypeof&&("number"===n||"number"===this._rvalTypeof)&&(t=fS(e)===this._rvalFloat)}return this._isEQ?t:!t};var wD=function(){function e(){}return e.prototype.getRawData=function(){throw Error("not supported")},e.prototype.getRawDataItem=function(e){throw Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(e){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(e,t){},e.prototype.retrieveValueFromItem=function(e,t){},e.prototype.convertValue=function(e,t){return wA(e,t)},e}();function wI(e){return wL(e.sourceFormat)||wC(""),e.data}function wO(e){var t=e.sourceFormat,n=e.data;if(wL(t)||wC(""),t===fX){for(var i=[],r=0,o=n.length;r<o;r++)i.push(n[r].slice());return i}if(t===fK){for(var i=[],r=0,o=n.length;r<o;r++)i.push(pR({},n[r]));return i}}function wP(e,t,n){if(null!=n){if(pX(n)||!isNaN(n)&&!fa(t,n))return e[n];else if(fa(t,n))return t[n]}}function wE(e){return pP(e)}var wR=fi();function wL(e){return e===fX||e===fK}var wN="undefined",wB=typeof Uint32Array===wN?Array:Uint32Array,wF=typeof Uint16Array===wN?Array:Uint16Array,wz=typeof Int32Array===wN?Array:Int32Array,wV=typeof Float64Array===wN?Array:Float64Array,wj={float:wV,int:wz,ordinal:Array,number:Array,time:wV};function wH(e){return e>65535?wB:wF}function wW(){return[1/0,-1/0]}function wG(e,t,n,i,r){var o=wj[n||"float"];if(r){var a=e[t],s=a&&a.length;if(s!==i){for(var l=new o(i),u=0;u<s;u++)l[u]=a[u];e[t]=l}}else e[t]=new o(i)}var w$=function(){function e(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=fi()}return e.prototype.initData=function(e,t,n){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var i=e.getSource(),r=this.defaultDimValueGetter=V[i.sourceFormat];this._dimValueGetter=n||r,this._rawExtent=[],go(i),this._dimensions=pV(t,function(e){return{type:e.type,property:e.property}}),this._initDataFromProvider(0,e.count())},e.prototype.getProvider=function(){return this._provider},e.prototype.getSource=function(){return this._provider.getSource()},e.prototype.ensureCalculationDimension=function(e,t){var n=this._calcDimNameToIdx,i=this._dimensions,r=n.get(e);if(null!=r){if(i[r].type===t)return r}else r=i.length;return i[r]={type:t},n.set(e,r),this._chunks[r]=new wj[t||"float"](this._rawCount),this._rawExtent[r]=wW(),r},e.prototype.collectOrdinalMeta=function(e,t){var n=this._chunks[e],i=this._dimensions[e],r=this._rawExtent,o=i.ordinalOffset||0,a=n.length;0===o&&(r[e]=wW());for(var s=r[e],l=o;l<a;l++){var u=n[l]=t.parseAndCollect(n[l]);isNaN(u)||(s[0]=Math.min(u,s[0]),s[1]=Math.max(u,s[1]))}i.ordinalMeta=t,i.ordinalOffset=a,i.type="ordinal"},e.prototype.getOrdinalMeta=function(e){return this._dimensions[e].ordinalMeta},e.prototype.getDimensionProperty=function(e){var t=this._dimensions[e];return t&&t.property},e.prototype.appendData=function(e){var t=this._provider,n=this.count();t.appendData(e);var i=t.count();return t.persistent||(i+=n),n<i&&this._initDataFromProvider(n,i,!0),[n,i]},e.prototype.appendValues=function(e,t){for(var n=this._chunks,i=this._dimensions,r=i.length,o=this._rawExtent,a=this.count(),s=a+Math.max(e.length,t||0),l=0;l<r;l++){var u=i[l];wG(n,l,u.type,s,!0)}for(var c=[],h=a;h<s;h++)for(var d=h-a,p=0;p<r;p++){var u=i[p],f=V.arrayRows.call(this,e[d]||c,u.property,d,p);n[p][h]=f;var g=o[p];f<g[0]&&(g[0]=f),f>g[1]&&(g[1]=f)}return this._rawCount=this._count=s,{start:a,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var i=this._provider,r=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=pV(o,function(e){return e.property}),u=0;u<a;u++){var c=o[u];s[u]||(s[u]=wW()),wG(r,u,c.type,t,n)}if(i.fillStorage)i.fillStorage(e,t,r,s);else for(var h=[],d=e;d<t;d++){h=i.getItem(d,h);for(var p=0;p<a;p++){var f=r[p],g=this._dimValueGetter(h,l[p],d,p);f[d]=g;var m=s[p];g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var n=this._chunks[e];return n?n[this.getRawIndex(t)]:NaN},e.prototype.getValues=function(e,t){var n=[],i=[];if(null==t){t=e,e=[];for(var r=0;r<this._dimensions.length;r++)i.push(r)}else i=e;for(var r=0,o=i.length;r<o;r++)n.push(this.get(i[r],t));return n},e.prototype.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var n=this._chunks[e];return n?n[t]:NaN},e.prototype.getSum=function(e){var t=this._chunks[e],n=0;if(t)for(var i=0,r=this.count();i<r;i++){var o=this.get(e,i);isNaN(o)||(n+=o)}return n},e.prototype.getMedian=function(e){var t=[];this.each([e],function(e){isNaN(e)||t.push(e)});var n=t.sort(function(e,t){return e-t}),i=this.count();return 0===i?0:i%2==1?n[(i-1)/2]:(n[i/2]+n[i/2-1])/2},e.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return -1;if(!this._indices)return e;var t=this._indices,n=t[e];if(null!=n&&n<this._count&&n===e)return e;for(var i=0,r=this._count-1;i<=r;){var o=(i+r)/2|0;if(t[o]<e)i=o+1;else{if(!(t[o]>e))return o;r=o-1}}return -1},e.prototype.indicesOfNearest=function(e,t,n){var i=this._chunks[e],r=[];if(!i)return r;null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();l<u;l++){var c=t-i[this.getRawIndex(l)],h=Math.abs(c);h<=n&&((h<o||h===o&&c>=0&&a<0)&&(o=h,a=c,s=0),c===a&&(r[s++]=l))}return r.length=s,r},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,i=this._count;if(n===Array){e=new n(i);for(var r=0;r<i;r++)e[r]=t[r]}else e=new n(t.buffer,0,i)}else{var n=wH(this._rawCount);e=new n(this.count());for(var r=0;r<e.length;r++)e[r]=r}return e},e.prototype.filter=function(e,t){if(!this._count)return this;for(var n=this.clone(),i=n.count(),r=new(wH(n._rawCount))(i),o=[],a=e.length,s=0,l=e[0],u=n._chunks,c=0;c<i;c++){var h=void 0,d=n.getRawIndex(c);if(0===a)h=t(c);else if(1===a)h=t(u[l][d],c);else{for(var p=0;p<a;p++)o[p]=u[e[p]][d];o[p]=c,h=t.apply(null,o)}h&&(r[s++]=d)}return s<i&&(n._indices=r),n._count=s,n._extent=[],n._updateGetRawIdx(),n},e.prototype.selectRange=function(e){var t=this.clone(),n=t._count;if(!n)return this;var i=pW(e),r=i.length;if(!r)return this;var o=t.count(),a=new(wH(t._rawCount))(o),s=0,l=i[0],u=e[l][0],c=e[l][1],h=t._chunks,d=!1;if(!t._indices){var p=0;if(1===r){for(var f=h[i[0]],g=0;g<n;g++){var m=f[g];(m>=u&&m<=c||isNaN(m))&&(a[s++]=p),p++}d=!0}else if(2===r){for(var f=h[i[0]],v=h[i[1]],y=e[i[1]][0],x=e[i[1]][1],g=0;g<n;g++){var m=f[g],b=v[g];(m>=u&&m<=c||isNaN(m))&&(b>=y&&b<=x||isNaN(b))&&(a[s++]=p),p++}d=!0}}if(!d)if(1===r)for(var g=0;g<o;g++){var w=t.getRawIndex(g),m=h[i[0]][w];(m>=u&&m<=c||isNaN(m))&&(a[s++]=w)}else for(var g=0;g<o;g++){for(var S=!0,w=t.getRawIndex(g),_=0;_<r;_++){var M=i[_],m=h[M][w];(m<e[M][0]||m>e[M][1])&&(S=!1)}S&&(a[s++]=t.getRawIndex(g))}return s<o&&(t._indices=a),t._count=s,t._extent=[],t._updateGetRawIdx(),t},e.prototype.map=function(e,t){var n=this.clone(e);return this._updateDims(n,e,t),n},e.prototype.modify=function(e,t){this._updateDims(this,e,t)},e.prototype._updateDims=function(e,t,n){for(var i=e._chunks,r=[],o=t.length,a=e.count(),s=[],l=e._rawExtent,u=0;u<t.length;u++)l[t[u]]=wW();for(var c=0;c<a;c++){for(var h=e.getRawIndex(c),d=0;d<o;d++)s[d]=i[t[d]][h];s[o]=c;var p=n&&n.apply(null,s);if(null!=p){"object"!=typeof p&&(r[0]=p,p=r);for(var u=0;u<p.length;u++){var f=t[u],g=p[u],m=l[f],v=i[f];v&&(v[h]=g),g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}}},e.prototype.lttbDownSample=function(e,t){var n,i,r,o=this.clone([e],!0),a=o._chunks[e],s=this.count(),l=0,u=Math.floor(1/t),c=this.getRawIndex(0),h=new(wH(this._rawCount))(Math.min((Math.ceil(s/u)+2)*2,s));h[l++]=c;for(var d=1;d<s-1;d+=u){for(var p=Math.min(d+u,s-1),f=Math.min(d+2*u,s),g=(f+p)/2,m=0,v=p;v<f;v++){var y=this.getRawIndex(v),x=a[y];isNaN(x)||(m+=x)}m/=f-p;var b=d,w=Math.min(d+u,s),S=d-1,_=a[c];n=-1,r=b;for(var M=-1,C=0,v=b;v<w;v++){var y=this.getRawIndex(v),x=a[y];if(isNaN(x)){C++,M<0&&(M=y);continue}(i=Math.abs((S-g)*(x-_)-(S-v)*(m-_)))>n&&(n=i,r=y)}C>0&&C<w-b&&(h[l++]=Math.min(M,r),r=Math.max(M,r)),h[l++]=r,c=r}return h[l++]=this.getRawIndex(s-1),o._count=l,o._indices=h,o.getRawIndex=this._getRawIdx,o},e.prototype.downSample=function(e,t,n,i){for(var r=this.clone([e],!0),o=r._chunks,a=[],s=Math.floor(1/t),l=o[e],u=this.count(),c=r._rawExtent[e]=wW(),h=new(wH(this._rawCount))(Math.ceil(u/s)),d=0,p=0;p<u;p+=s){s>u-p&&(a.length=s=u-p);for(var f=0;f<s;f++){var g=this.getRawIndex(p+f);a[f]=l[g]}var m=n(a),v=this.getRawIndex(Math.min(p+i(a,m)||0,u-1));l[v]=m,m<c[0]&&(c[0]=m),m>c[1]&&(c[1]=m),h[d++]=v}return r._count=d,r._indices=h,r._updateGetRawIdx(),r},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,i=this._chunks,r=0,o=this.count();r<o;r++){var a=this.getRawIndex(r);switch(n){case 0:t(r);break;case 1:t(i[e[0]][a],r);break;case 2:t(i[e[0]][a],i[e[1]][a],r);break;default:for(var s=0,l=[];s<n;s++)l[s]=i[e[s]][a];l[s]=r,t.apply(null,l)}}},e.prototype.getDataExtent=function(e){var t,n=this._chunks[e],i=wW();if(!n)return i;var r=this.count();if(!this._indices)return this._rawExtent[e].slice();if(t=this._extent[e])return t.slice();for(var o=(t=i)[0],a=t[1],s=0;s<r;s++){var l=n[this.getRawIndex(s)];l<o&&(o=l),l>a&&(a=l)}return t=[o,a],this._extent[e]=t,t},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],i=this._chunks,r=0;r<i.length;r++)n.push(i[r][t]);return n},e.prototype.clone=function(t,n){var i=new e,r=this._chunks,o=t&&pj(t,function(e,t){return e[t]=!0,e},{});if(o)for(var a=0;a<r.length;a++)i._chunks[a]=o[a]?function(e){var t=e.constructor;return t===Array?e.slice():new t(e)}(r[a]):r[a];else i._chunks=r;return this._copyCommonProps(i),n||(i._indices=this._cloneIndices()),i._updateGetRawIdx(),i},e.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=pP(this._extent),e._rawExtent=pP(this._rawExtent)},e.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,t=void 0;if(e===Array){var n=this._indices.length;t=new e(n);for(var i=0;i<n;i++)t[i]=this._indices[i]}else t=new e(this._indices);return t}return null},e.prototype._getRawIdxIdentity=function(e){return e},e.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,i){return wA(e[i],this._dimensions[i])}V={arrayRows:e,objectRows:function(e,t,n,i){return wA(e[t],this._dimensions[i])},keyedColumns:e,original:function(e,t,n,i){var r=e&&(null==e.value?e:e.value);return wA(r instanceof Array?r[i]:r,this._dimensions[i])},typedArray:function(e,t,n,i){return e[i]}}}(),e}(),wU=function(){function e(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e,t,n=this._sourceHost,i=this._getUpstreamSourceManagers(),r=!!i.length;if(wY(n)){var o=void 0,a=void 0,s=void 0;if(r){var l=i[0];l.prepareSource(),o=(s=l.getSource()).data,a=s.sourceFormat,t=[l._getVersionSign()]}else a=pJ(o=n.get("data",!0))?fJ:fZ,t=[];var u=this._getSourceMetaRawOption()||{},c=s&&s.metaRawOption||{},h=p5(u.seriesLayoutBy,c.seriesLayoutBy)||null,d=p5(u.sourceHeader,c.sourceHeader),p=p5(u.dimensions,c.dimensions);e=h!==c.seriesLayoutBy||!!d!=!!c.sourceHeader||p?[ge(o,{seriesLayoutBy:h,sourceHeader:d,dimensions:p},a)]:[]}else if(r){var f=this._applyTransform(i);e=f.sourceList,t=f.upstreamSignList}else e=[ge(n.get("source",!0),this._getSourceMetaRawOption(),null)],t=[];this._setLocalSource(e,t)},e.prototype._applyTransform=function(e){var t,n,i=this._sourceHost,r=i.get("transform",!0),o=i.get("fromTransformResult",!0);null!=o&&1!==e.length&&wZ("");var a=[],s=[];return(pz(e,function(e){e.prepareSource();var t=e.getSource(o||0);null==o||t||wZ(""),a.push(t),s.push(e._getVersionSign())}),r)?n=function(e,t,n){var i=fD(e),r=i.length;r||wC("");for(var o=0;o<r;o++)t=function(e,t){t.length||wC(""),pK(e)||wC("");var n=e.type,i=wR.get(n);i||wC("");var r=pV(t,function(e){return function(e,t){var n=new wD,i=e.data,r=n.sourceFormat=e.sourceFormat,o=e.startIndex;e.seriesLayoutBy!==f1&&wC("");var a=[],s={},l=e.dimensionsDefine;if(l)pz(l,function(e,t){var n=e.name,i={index:t,name:n,displayName:e.displayName};a.push(i),null!=n&&(fa(s,n)&&wC(""),s[n]=i)});else for(var u=0;u<e.dimensionsDetectedCount||0;u++)a.push({index:u});var c=wh[wm(r,f1)];t.__isBuiltIn&&(n.getRawDataItem=function(e){return c(i,o,a,e)},n.getRawData=pG(wI,null,e)),n.cloneRawData=pG(wO,null,e),n.count=pG(wp[wm(r,f1)],null,i,o,a);var h=wg[r];n.retrieveValue=function(e,t){return d(c(i,o,a,e),t)};var d=n.retrieveValueFromItem=function(e,t){if(null!=e){var n=a[t];if(n)return h(e,t,n.name)}};return n.getDimensionInfo=pG(wP,null,a,s),n.cloneAllDimensionInfo=pG(wE,null,a),n}(e,i)});return pV(fD(i.transform({upstream:r[0],upstreamList:r,config:pP(e.config)})),function(e,n){pK(e)||wC(""),e.data||wC(""),wL(gn(e.data))||wC("");var i,r=t[0];if(r&&0===n&&!e.dimensions){var o=r.startIndex;o&&(e.data=r.data.slice(0,o).concat(e.data)),i={seriesLayoutBy:f1,sourceHeader:o,dimensions:r.metaRawOption.dimensions}}else i={seriesLayoutBy:f1,sourceHeader:0,dimensions:e.dimensions};return ge(e.data,i,null)})}(i[o],t),o!==r-1&&(t.length=Math.max(t.length,1));return t}(r,a,{datasetIndex:i.componentIndex}):null!=o&&(n=[new f9({data:(t=a[0]).data,sourceFormat:t.sourceFormat,seriesLayoutBy:t.seriesLayoutBy,dimensionsDefine:pP(t.dimensionsDefine),startIndex:t.startIndex,dimensionsDetectedCount:t.dimensionsDetectedCount})]),{sourceList:n,upstreamSignList:s}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t<e.length;t++){var n=e[t];if(n._isDirty()||this._upstreamSignList[t]!==n._getVersionSign())return!0}},e.prototype.getSource=function(e){e=e||0;var t=this._sourceList[e];if(!t){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(e)}return t},e.prototype.getSharedDataStore=function(e){var t=e.makeStoreSchema();return this._innerGetDataStore(t.dimensions,e.source,t.hash)},e.prototype._innerGetDataStore=function(e,t,n){var i=this._storeList,r=i[0];r||(r=i[0]={});var o=r[n];if(!o){var a=this._getUpstreamSourceManagers()[0];wY(this._sourceHost)&&a?o=a._innerGetDataStore(e,t,n):(o=new w$).initData(new wu(t,e.length),e),r[n]=o}return o},e.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(wY(e)){var t=f4(e);return t?[t.getSourceManager()]:[]}return pV(e.get("transform",!0)||e.get("fromTransformResult",!0)?f$(e.ecModel,"dataset",{index:e.get("fromDatasetIndex",!0),id:e.get("fromDatasetId",!0)},fW).models:[],function(e){return e.getSourceManager()})},e.prototype._getSourceMetaRawOption=function(){var e,t,n,i=this._sourceHost;return wY(i)?(e=i.get("seriesLayoutBy",!0),t=i.get("sourceHeader",!0),n=i.get("dimensions",!0)):this._getUpstreamSourceManagers().length||(e=i.get("seriesLayoutBy",!0),t=i.get("sourceHeader",!0),n=i.get("dimensions",!0)),{seriesLayoutBy:e,sourceHeader:t,dimensions:n}},e}();function wq(e){e.option.transform&&(e.option.transform[p7]=!0)}function wY(e){return"series"===e.mainType}function wZ(e){throw Error(e)}var wX="line-height:1";function wK(e,t){var n=e.color||"#6e7079",i=e.fontSize||12,r=e.fontWeight||"400",o=e.color||"#464646",a=e.fontSize||14,s=e.fontWeight||"900";return"html"===t?{nameStyle:"font-size:"+b_(i+"")+"px;color:"+b_(n)+";font-weight:"+b_(r+""),valueStyle:"font-size:"+b_(a+"")+"px;color:"+b_(o)+";font-weight:"+b_(s+"")}:{nameStyle:{fontSize:i,fill:n,fontWeight:r},valueStyle:{fontSize:a,fill:o,fontWeight:s}}}var wQ=[0,10,20,30],wJ=["","\n","\n\n","\n\n\n"];function w0(e,t){return t.type=e,t}function w1(e){return"section"===e.type}function w2(e,t,n,i){var r,o=t.noHeader,a={html:wQ[r=function e(t){if(w1(t)){var n=0,i=t.blocks.length,r=i>1||i>0&&!t.noHeader;return pz(t.blocks,function(t){var i=e(t);i>=n&&(n=i+ +(r&&(!i||w1(t)&&!t.noHeader)))}),n}return 0}(t)],richText:wJ[r]},s=[],l=t.blocks||[];p8(!l||pU(l)),l=l||[];var u=e.orderMode;if(t.sortBlocks&&u){l=l.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(fa(c,u)){var h=new wT(c[u],null);l.sort(function(e,t){return h.evaluate(e.sortParam,t.sortParam)})}else"seriesDesc"===u&&l.reverse()}pz(l,function(n,r){var o=t.valueFormatter,l=(w1(n)?w2:w5)(o?pR(pR({},e),{valueFormatter:o}):e,n,r>0?a.html:0,i);null!=l&&s.push(l)});var d="richText"===e.renderMode?s.join(a.richText):w4(s.join(""),o?n:a.html);if(o)return d;var p=bJ(t.header,"ordinal",e.useUTC),f=wK(i,e.renderMode).nameStyle;return"richText"===e.renderMode?w6(e,p,f)+a.richText+d:w4('<div style="'+f+";"+wX+';">'+b_(p)+"</div>"+d,n)}function w5(e,t,n,i){var r=e.renderMode,o=t.noName,a=t.noValue,s=!t.markerType,l=t.name,u=e.useUTC,c=t.valueFormatter||e.valueFormatter||function(e){return pV(e=pU(e)?e:[e],function(e,t){return bJ(e,pU(w)?w[t]:w,u)})};if(!o||!a){var h,d,p,f,g,m,v,y,x=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",r),b=o?"":bJ(l,"ordinal",u),w=t.valueType,S=a?[]:c(t.value,t.dataIndex),_=!s||!o,M=!s&&o,C=wK(i,r),A=C.nameStyle,k=C.valueStyle;return"richText"===r?(s?"":x)+(o?"":w6(e,b,A))+(a?"":(h=e,d=S,p=_,f=M,g=[k],p&&g.push({padding:[0,0,0,f?10:20],align:"right"}),h.markupStyleCreator.wrapRichTextStyle(pU(d)?d.join(" "):d,g))):w4((s?"":x)+(o?"":'<span style="'+A+";"+(s?"":"margin-left:2px")+'">'+b_(b)+"</span>")+(a?"":(m=S,v=_,y=M,'<span style="'+(v?"float:right;margin-left:"+(y?"10px":"20px"):"")+";"+k+'">'+pV(m=pU(m)?m:[m],function(e){return b_(e)}).join("&nbsp;&nbsp;")+"</span>")),n)}}function w3(e,t,n,i,r,o){if(e)return(w1(e)?w2:w5)({useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,o)}function w4(e,t){return'<div style="margin: '+t+"px 0 0;"+wX+';">'+e+'<div style="clear:both"></div></div>'}function w6(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function w8(e,t){var n=e.get("padding");return null!=n?n:"richText"===t?[8,10]:10}var w9=function(){function e(){this.richTextStyles={},this._nextStyleNameId=f_()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var i,r,o,a,s,l,u="richText"===n?this._generateStyleName():null,c=(a=(o=pY(i={color:t,type:e,renderMode:n,markerId:u})?{color:i,extraCssText:r}:i||{}).color,s=o.type,r=o.extraCssText,l=o.renderMode||"html",a?"html"===l?"subItem"===s?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+b_(a)+";"+(r||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+b_(a)+";"+(r||"")+'"></span>':{renderMode:l,content:"{"+(o.markerId||"markerX")+"|} ",style:"subItem"===s?{width:4,height:4,borderRadius:2,backgroundColor:a}:{width:10,height:10,borderRadius:5,backgroundColor:a}}:"");return pY(c)?c:(this.richTextStyles[u]=c.style,c.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};pU(t)?pz(t,function(e){return pR(n,e)}):pR(n,t);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},e}(),w7=fz();function Se(e,t){return e.getName(t)||e.getId(t)}var St=function(e){var t;function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return gO(n,e),n.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=wS({count:Si,reset:Sr}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(w7(this).sourceManager=new wU(this)).prepareSource();var i=this.getInitialData(e,n);Sa(i,this),this.dataTask.context.data=i,w7(this).dataBeforeProcessed=i,Sn(this),this._initSelectedMapFromData(i)},n.prototype.mergeDefaultAndTheme=function(e,t){var n=we(this),i=n?wn(e):{},r=this.subType;wr.hasClass(r)&&(r+="Series"),pE(e,t.getTheme().get(this.subType)),pE(e,this.getDefaultOption()),fI(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&wt(e,i,n)},n.prototype.mergeOption=function(e,t){e=pE(this.option,e,!0),this.fillDataTextStyle(e.data);var n=we(this);n&&wt(this.option,e,n);var i=w7(this).sourceManager;i.dirty(),i.prepareSource();var r=this.getInitialData(e,t);Sa(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,w7(this).dataBeforeProcessed=r,Sn(this),this._initSelectedMapFromData(r)},n.prototype.fillDataTextStyle=function(e){if(e&&!pJ(e))for(var t=["show"],n=0;n<e.length;n++)e[n]&&e[n].label&&fI(e[n],"label",t)},n.prototype.getInitialData=function(e,t){},n.prototype.appendData=function(e){this.getRawData().appendData(e.data)},n.prototype.getData=function(e){var t=Sl(this);if(!t)return w7(this).data;var n=t.context.data;return null==e?n:n.getLinkedData(e)},n.prototype.getAllData=function(){var e=this.getData();return e&&e.getLinkedDataAll?e.getLinkedDataAll():[{data:e}]},n.prototype.setData=function(e){var t=Sl(this);if(t){var n=t.context;n.outputData=e,t!==this.dataTask&&(n.data=e)}w7(this).data=e},n.prototype.getEncode=function(){var e=this.get("encode",!0);if(e)return fi(e)},n.prototype.getSourceManager=function(){return w7(this).sourceManager},n.prototype.getSource=function(){return this.getSourceManager().getSource()},n.prototype.getRawData=function(){return w7(this).dataBeforeProcessed},n.prototype.getColorBy=function(){return this.get("colorBy")||"series"},n.prototype.isColorBySeries=function(){return"series"===this.getColorBy()},n.prototype.getBaseAxis=function(){var e=this.coordinateSystem;return e&&e.getBaseAxis&&e.getBaseAxis()},n.prototype.formatTooltip=function(e,t,n){return function(e){var t,n,i,r,o=e.series,a=e.dataIndex,s=e.multipleSeries,l=o.getData(),u=l.mapDimensionsAll("defaultedTooltip"),c=u.length,h=o.getRawValue(a),d=pU(h),p=b5(o.getData().getItemVisual(a,"style")[o.visualDrawType]);if(c>1||d&&!c){var f=function(e,t,n,i,r){var o=t.getData(),a=pj(e,function(e,t,n){var i=o.getDimensionInfo(n);return e||i&&!1!==i.tooltip&&null!=i.displayName},!1),s=[],l=[],u=[];function c(e,t){var n=o.getDimensionInfo(t);n&&!1!==n.otherDims.tooltip&&(a?u.push(w0("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:e,valueType:n.type})):(s.push(e),l.push(n.type)))}return i.length?pz(i,function(e){c(wv(o,n,e),e)}):pz(e,c),{inlineValues:s,inlineValueTypes:l,blocks:u}}(h,o,a,u,p);t=f.inlineValues,n=f.inlineValueTypes,i=f.blocks,r=f.inlineValues[0]}else if(c){var g=l.getDimensionInfo(u[0]);r=t=wv(l,a,u[0]),n=g.type}else r=t=d?h[0]:h;var m=fN(o),v=m&&o.name||"",y=l.getName(a),x=s?v:y;return w0("section",{header:v,noHeader:s||!m,sortParam:r,blocks:[w0("nameValue",{markerType:"item",markerColor:p,name:x,noName:!p9(x),value:t,valueType:n,dataIndex:a})].concat(i||[])})}({series:this,dataIndex:e,multipleSeries:t})},n.prototype.isAnimationEnabled=function(){var e=this.ecModel;if(fA.node&&!(e&&e.ssr))return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),!!t},n.prototype.restoreData=function(){this.dataTask.dirty()},n.prototype.getColorFromPalette=function(e,t,n){var i=this.ecModel,r=wl.prototype.getColorFromPalette.call(this,e,t,n);return r||(r=i.getColorFromPalette(e,t,n)),r},n.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},n.prototype.getProgressive=function(){return this.get("progressive")},n.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},n.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},n.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,r=this.getData(t);if("series"===i||"all"===n){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var o=0;o<e.length;o++){var a=Se(r,e[o]);n[a]=!1,this._selectedDataIndicesMap[a]=-1}}},n.prototype.toggleSelect=function(e,t){for(var n=[],i=0;i<e.length;i++)n[0]=e[i],this.isSelected(e[i],t)?this.unselect(n,t):this.select(n,t)},n.prototype.getSelectedDataIndices=function(){if("all"===this.option.selectedMap)return[].slice.call(this.getData().getIndices());for(var e=this._selectedDataIndicesMap,t=pW(e),n=[],i=0;i<t.length;i++){var r=e[t[i]];r>=0&&n.push(r)}return n},n.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(t);return("all"===n||n[Se(i,e)])&&!i.getItemModel(e).get(["select","disabled"])},n.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var e=this.option.universalTransition;return!!e&&(!0===e||e&&e.enabled)},n.prototype._innerSelect=function(e,t){var n,i,r=this.option,o=r.selectedMode,a=t.length;if(o&&a){if("series"===o)r.selectedMap="all";else if("multiple"===o){pK(r.selectedMap)||(r.selectedMap={});for(var s=r.selectedMap,l=0;l<a;l++){var u=t[l],c=Se(e,u);s[c]=!0,this._selectedDataIndicesMap[c]=e.getRawIndex(u)}}else if("single"===o||!0===o){var h=t[a-1],c=Se(e,h);(n={})[c]=!0,r.selectedMap=n,this._selectedDataIndicesMap=((i={})[c]=e.getRawIndex(h),i)}}},n.prototype._initSelectedMapFromData=function(e){if(!this.option.selectedMap){var t=[];e.hasItemOption&&e.each(function(n){var i=e.getRawDataItem(n);i&&i.selected&&t.push(n)}),t.length>0&&this._innerSelect(e,t)}},n.registerClass=function(e){return wr.registerClass(e)},n.protoInitialize=void((t=n.prototype).type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"),n}(wr);function Sn(e){var t,n,i,r=e.name;fN(e)||(e.name=(n=(t=e.getRawData()).mapDimensionsAll("seriesName"),i=[],pz(n,function(e){var n=t.getDimensionInfo(e);n.displayName&&i.push(n.displayName)}),i.join(" ")||r))}function Si(e){return e.model.getRawData().count()}function Sr(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),So}function So(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function Sa(e,t){pz(function(e,t){for(var n=new e.constructor(e.length+t.length),i=0;i<e.length;i++)n[i]=e[i];for(var r=e.length,i=0;i<t.length;i++)n[i+r]=t[i];return n}(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(n){e.wrapMethod(n,p$(Ss,t))})}function Ss(e,t){var n=Sl(e);return n&&n.setOutputEnd((t||this).count()),t}function Sl(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(e.uid))}return i}}function Su(e){return null==e?0:e.length||1}function Sc(e){return e}pB(St,wb),pB(St,wl),gN(St,wr);var Sh=function(){function e(e,t,n,i,r,o){this._old=e,this._new=t,this._oldKeyGetter=n||Sc,this._newKeyGetter=i||Sc,this.context=r,this._diffModeMultiple="multiple"===o}return e.prototype.add=function(e){return this._add=e,this},e.prototype.update=function(e){return this._update=e,this},e.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},e.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},e.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},e.prototype.remove=function(e){return this._remove=e,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},i=Array(e.length),r=Array(t.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(t,n,r,"_newKeyGetter");for(var o=0;o<e.length;o++){var a=i[o],s=n[a],l=Su(s);if(l>1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,o)}else 1===l?(n[a]=null,this._update&&this._update(s,o)):this._remove&&this._remove(o)}this._performRestAdd(r,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},i={},r=[],o=[];this._initIndexMap(e,n,r,"_oldKeyGetter"),this._initIndexMap(t,i,o,"_newKeyGetter");for(var a=0;a<r.length;a++){var s=r[a],l=n[s],u=i[s],c=Su(l),h=Su(u);if(c>1&&1===h)this._updateManyToOne&&this._updateManyToOne(u,l),i[s]=null;else if(1===c&&h>1)this._updateOneToMany&&this._updateOneToMany(u,l),i[s]=null;else if(1===c&&1===h)this._update&&this._update(u,l),i[s]=null;else if(c>1&&h>1)this._updateManyToMany&&this._updateManyToMany(u,l),i[s]=null;else if(c>1)for(var d=0;d<c;d++)this._remove&&this._remove(l[d]);else this._remove&&this._remove(l)}this._performRestAdd(o,i)},e.prototype._performRestAdd=function(e,t){for(var n=0;n<e.length;n++){var i=e[n],r=t[i],o=Su(r);if(o>1)for(var a=0;a<o;a++)this._add&&this._add(r[a]);else 1===o&&this._add&&this._add(r);t[i]=null}},e.prototype._initIndexMap=function(e,t,n,i){for(var r=this._diffModeMultiple,o=0;o<e.length;o++){var a="_ec_"+this[i](e[o],o);if(r||(n[o]=a),t){var s=t[a],l=Su(s);0===l?(t[a]=o,r&&n.push(a)):1===l?t[a]=[s,o]:s.push(o)}}},e}(),Sd=function(){function e(e,t){this._encode=e,this._schema=t}return e.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},e.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},e}();function Sp(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}let Sf=function(e){this.otherDims={},null!=e&&pR(this,e)};var Sg=pK,Sm="u"<typeof Int32Array?Array:Int32Array,Sv=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],Sy=["_approximateExtent"],Sx=function(){function e(e,t){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var n,i=!1;gu(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,n=e),n=n||["x","y"];for(var r={},o=[],a={},s=!1,l={},u=0;u<n.length;u++){var c=n[u],h=pY(c)?new Sf({name:c}):c instanceof Sf?c:new Sf(c),d=h.name;h.type=h.type||"float",h.coordDim||(h.coordDim=d,h.coordDimIndex=0);var p=h.otherDims=h.otherDims||{};o.push(d),r[d]=h,null!=l[d]&&(s=!0),h.createInvertedIndices&&(a[d]=[]),0===p.itemName&&(this._nameDimIdx=u),0===p.itemId&&(this._idDimIdx=u),i&&(h.storeDimIndex=u)}if(this.dimensions=o,this._dimInfos=r,this._initGetDimensionInfo(s),this.hostModel=t,this._invertedIndicesMap=a,this._dimOmitted){var f=this._dimIdxToName=fi();pz(o,function(e){f.set(r[e].storeDimIndex,e)})}}return e.prototype.getDimension=function(e){var t=this._recognizeDimIndex(e);if(null==t)return e;if(t=e,!this._dimOmitted)return this.dimensions[t];var n=this._dimIdxToName.get(t);if(null!=n)return n;var i=this._schema.getSourceDimension(t);if(i)return i.name},e.prototype.getDimensionIndex=function(e){var t=this._recognizeDimIndex(e);if(null!=t)return t;if(null==e)return -1;var n=this._getDimInfo(e);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},e.prototype._recognizeDimIndex=function(e){if(pX(e)||null!=e&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||0>this._schema.getSourceDimensionIndex(e)))return+e},e.prototype._getStoreDimIndex=function(e){return this.getDimensionIndex(e)},e.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},e.prototype._initGetDimensionInfo=function(e){var t=this._dimInfos;this._getDimInfo=e?function(e){return t.hasOwnProperty(e)?t[e]:void 0}:function(e){return t[e]}},e.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},e.prototype.mapDimension=function(e,t){var n=this._dimSummary;if(null==t)return n.encodeFirstDimNotExtra[e];var i=n.encode[e];return i?i[t]:null},e.prototype.mapDimensionsAll=function(e){return(this._dimSummary.encode[e]||[]).slice()},e.prototype.getStore=function(){return this._store},e.prototype.initData=function(e,t,n){var i,r,o,a,s,l,u,c,h,d,p,f,g,m=this;if(e instanceof w$&&(g=e),!g){var v=this.dimensions,y=f7(e)||pF(e)?new wu(e,v.length):e;g=new w$;var x=pV(v,function(e){return{type:m._dimInfos[e].type,property:e}});g.initData(y,x,n)}this._store=g,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,g.count()),this._dimSummary=(i=this,r=this._schema,a=(o={}).encode={},s=fi(),l=[],u=[],c={},pz(i.dimensions,function(e){var t=i.getDimensionInfo(e),n=t.coordDim;if(n){var r,o=t.coordDimIndex;Sp(a,n)[o]=e,t.isExtraCoord||(s.set(n,1),"ordinal"!==(r=t.type)&&"time"!==r&&(l[0]=e),Sp(c,n)[o]=i.getDimensionIndex(t.name)),t.defaultTooltip&&u.push(e)}fY.each(function(e,n){var i=Sp(a,n),r=t.otherDims[n];null!=r&&!1!==r&&(i[r]=t.name)})}),h=[],d={},s.each(function(e,t){var n=a[t];d[t]=n[0],h=h.concat(n)}),o.dataDimsOnCoord=h,o.dataDimIndicesOnCoord=pV(h,function(e){return i.getDimensionInfo(e).storeDimIndex}),o.encodeFirstDimNotExtra=d,(p=a.label)&&p.length&&(l=p.slice()),(f=a.tooltip)&&f.length?u=f.slice():u.length||(u=l.slice()),a.defaultedLabel=l,a.defaultedTooltip=u,o.userOutput=new Sd(c,r),o),this.userOutput=this._dimSummary.userOutput},e.prototype.appendData=function(e){var t=this._store.appendData(e);this._doInit(t[0],t[1])},e.prototype.appendValues=function(e,t){var n=this._store.appendValues(e,t.length),i=n.start,r=n.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),t)for(var a=i;a<r;a++){var s=a-i;this._nameList[a]=t[s],o&&q(this,a)}},e.prototype._updateOrdinalMeta=function(){for(var e=this._store,t=this.dimensions,n=0;n<t.length;n++){var i=this._dimInfos[t[n]];i.ordinalMeta&&e.collectOrdinalMeta(i.storeDimIndex,i.ordinalMeta)}},e.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return null==this._idDimIdx&&e.getSource().sourceFormat!==fJ&&!e.fillStorage},e.prototype._doInit=function(e,t){if(!(e>=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,r=this._idList;if(n.getSource().sourceFormat===fZ&&!n.pure)for(var o=[],a=e;a<t;a++){var s,l=n.getItem(a,o);if(!(!this.hasItemOption&&pK(s=l))||s instanceof Array||(this.hasItemOption=!0),l){var u=l.name;null==i[a]&&null!=u&&(i[a]=fL(u,null));var c=l.id;null==r[a]&&null!=c&&(r[a]=fL(c,null))}}if(this._shouldMakeIdFromName())for(var a=e;a<t;a++)q(this,a);j(this)}},e.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},e.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},e.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},e.prototype.setCalculationInfo=function(e,t){Sg(e)?pR(this._calculationInfo,e):this._calculationInfo[e]=t},e.prototype.getName=function(e){var t=this.getRawIndex(e),n=this._nameList[t];return null==n&&null!=this._nameDimIdx&&(n=W(this,this._nameDimIdx,t)),null==n&&(n=""),n},e.prototype._getCategory=function(e,t){var n=this._store.get(e,t),i=this._store.getOrdinalMeta(e);return i?i.categories[n]:n},e.prototype.getId=function(e){return H(this,this.getRawIndex(e))},e.prototype.count=function(){return this._store.count()},e.prototype.get=function(e,t){var n=this._store,i=this._dimInfos[e];if(i)return n.get(i.storeDimIndex,t)},e.prototype.getByRawIndex=function(e,t){var n=this._store,i=this._dimInfos[e];if(i)return n.getByRawIndex(i.storeDimIndex,t)},e.prototype.getIndices=function(){return this._store.getIndices()},e.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},e.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},e.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},e.prototype.getValues=function(e,t){var n=this,i=this._store;return pU(e)?i.getValues(pV(e,function(e){return n._getStoreDimIndex(e)}),t):i.getValues(e)},e.prototype.hasValue=function(e){for(var t=this._dimSummary.dataDimIndicesOnCoord,n=0,i=t.length;n<i;n++)if(isNaN(this._store.get(t[n],e)))return!1;return!0},e.prototype.indexOfName=function(e){for(var t=0,n=this._store.count();t<n;t++)if(this.getName(t)===e)return t;return -1},e.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},e.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},e.prototype.rawIndexOf=function(e,t){var n=(e&&this._invertedIndicesMap[e])[t];return null==n||isNaN(n)?-1:n},e.prototype.indicesOfNearest=function(e,t,n){return this._store.indicesOfNearest(this._getStoreDimIndex(e),t,n)},e.prototype.each=function(e,t,n){pq(e)&&(n=t,t=e,e=[]);var i=n||this,r=pV(G(e),this._getStoreDimIndex,this);this._store.each(r,i?pG(t,i):t)},e.prototype.filterSelf=function(e,t,n){pq(e)&&(n=t,t=e,e=[]);var i=n||this,r=pV(G(e),this._getStoreDimIndex,this);return this._store=this._store.filter(r,i?pG(t,i):t),this},e.prototype.selectRange=function(e){var t=this,n={},i=pW(e),r=[];return pz(i,function(i){var o=t._getStoreDimIndex(i);n[o]=e[i],r.push(o)}),this._store=this._store.selectRange(n),this},e.prototype.mapArray=function(e,t,n){pq(e)&&(n=t,t=e,e=[]),n=n||this;var i=[];return this.each(e,function(){i.push(t&&t.apply(this,arguments))},n),i},e.prototype.map=function(e,t,n,i){var r=n||i||this,o=pV(G(e),this._getStoreDimIndex,this),a=U(this);return a._store=this._store.map(o,r?pG(t,r):t),a},e.prototype.modify=function(e,t,n,i){var r=n||i||this,o=pV(G(e),this._getStoreDimIndex,this);this._store.modify(o,r?pG(t,r):t)},e.prototype.downSample=function(e,t,n,i){var r=U(this);return r._store=this._store.downSample(this._getStoreDimIndex(e),t,n,i),r},e.prototype.lttbDownSample=function(e,t){var n=U(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(e),t),n},e.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},e.prototype.getItemModel=function(e){var t=this.hostModel;return new bc(this.getRawDataItem(e),t,t&&t.ecModel)},e.prototype.diff=function(e){var t=this;return new Sh(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(t){return H(e,t)},function(e){return H(t,e)})},e.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},e.prototype.setVisual=function(e,t){this._visual=this._visual||{},Sg(e)?pR(this._visual,e):this._visual[e]=t},e.prototype.getItemVisual=function(e,t){var n=this._itemVisuals[e],i=n&&n[t];return null==i?this.getVisual(t):i},e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,i=n[e];i||(i=n[e]={});var r=i[t];return null==r&&(pU(r=this.getVisual(t))?r=r.slice():Sg(r)&&(r=pR({},r)),i[t]=r),r},e.prototype.setItemVisual=function(e,t,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,Sg(t)?pR(i,t):i[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){Sg(e)?pR(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?pR(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){y8(this.hostModel&&this.hostModel.seriesIndex,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){pz(this._graphicEls,function(n,i){n&&e&&e.call(t,n,i)})},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:pV(this.dimensions,this._getDimInfo,this),this.hostModel)),$(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];pq(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(p4(arguments)))})},e.internalField=void(j=function(e){var t=e._invertedIndicesMap;pz(t,function(n,i){var r=e._dimInfos[i],o=r.ordinalMeta,a=e._store;if(o){n=t[i]=new Sm(o.categories.length);for(var s=0;s<n.length;s++)n[s]=-1;for(var s=0;s<a.count();s++)n[a.get(r.storeDimIndex,s)]=s}})},W=function(e,t,n){return fL(e._getCategory(t,n),null)},H=function(e,t){var n=e._idList[t];return null==n&&null!=e._idDimIdx&&(n=W(e,e._idDimIdx,t)),null==n&&(n="e\0\0"+t),n},G=function(e){return pU(e)||(e=null!=e?[e]:[]),e},U=function(t){var n=new e(t._schema?t._schema:pV(t.dimensions,t._getDimInfo,t),t.hostModel);return $(n,t),n},$=function(e,t){pz(Sv.concat(t.__wrappedMethods||[]),function(n){t.hasOwnProperty(n)&&(e[n]=t[n])}),e.__wrappedMethods=t.__wrappedMethods,pz(Sy,function(n){e[n]=pP(t[n])}),e._calculationInfo=pR({},t._calculationInfo)},q=function(e,t){var n=e._nameList,i=e._idList,r=e._nameDimIdx,o=e._idDimIdx,a=n[t],s=i[t];if(null==a&&null!=r&&(n[t]=a=W(e,r,t)),null==s&&null!=o&&(i[t]=s=W(e,o,t)),null==s&&null!=a){var l=e._nameRepeatCount,u=l[a]=(l[a]||0)+1;s=a,u>1&&(s+="__ec__"+u),i[t]=s}}),e}();function Sb(e,t){f7(e)||(e=gt(e));var n,i,r,o,a,s=(t=t||{}).coordDimensions||[],l=t.dimensionsDefine||e.dimensionsDefine||[],u=fi(),c=[],h=(n=e,i=s,r=l,o=t.dimensionsCount,a=Math.max(n.dimensionsDetectedCount||1,i.length,r.length,o||0),pz(i,function(e){var t;pK(e)&&(t=e.dimsDef)&&(a=Math.max(a,t.length))}),a),d=t.canOmitUnusedDimensions&&h>30,p=l===e.dimensionsDefine,f=p?gh(e):gc(l),g=t.encodeDefine;!g&&t.encodeDefaulter&&(g=t.encodeDefaulter(e,h));for(var m=fi(g),v=new wz(h),y=0;y<v.length;y++)v[y]=-1;function x(e){var t=v[e];if(t<0){var n=l[e],i=pK(n)?n:{name:n},r=new Sf,o=i.name;null!=o&&null!=f.get(o)&&(r.name=r.displayName=o),null!=i.type&&(r.type=i.type),null!=i.displayName&&(r.displayName=i.displayName);var a=c.length;return v[e]=a,r.storeDimIndex=e,c.push(r),r}return c[t]}if(!d)for(var y=0;y<h;y++)x(y);m.each(function(e,t){var n=fD(e).slice();if(1===n.length&&!pY(n[0])&&n[0]<0)return void m.set(t,!1);var i=m.set(t,[]);pz(n,function(e,n){var r=pY(e)?f.get(e):e;null!=r&&r<h&&(i[n]=r,w(x(r),t,n))})});var b=0;function w(e,t,n){null!=fY.get(t)?e.otherDims[t]=n:(e.coordDim=t,e.coordDimIndex=n,u.set(t,!0))}pz(s,function(e){if(pY(e))r=e,i={};else{var t,n,i,r=(i=e).name,o=i.ordinalMeta;i.ordinalMeta=null,(i=pR({},i)).ordinalMeta=o,t=i.dimsDef,n=i.otherDims,i.name=i.coordDim=i.coordDimIndex=i.dimsDef=i.otherDims=null}var a=m.get(r);if(!1!==a){if(!(a=fD(a)).length)for(var s=0;s<(t&&t.length||1);s++){for(;b<h&&null!=x(b).coordDim;)b++;b<h&&a.push(b++)}pz(a,function(e,o){var a=x(e);if(p&&null!=i.type&&(a.type=i.type),w(pL(a,i),r,o),null==a.name&&t){var s=t[o];pK(s)||(s={name:s}),a.name=a.displayName=s.name,a.defaultTooltip=s.defaultTooltip}n&&pL(a.otherDims,n)})}});var S=t.generateCoord,_=t.generateCoordCount,M=null!=_;_=S?_||1:0;var C=S||"value";function A(e){null==e.name&&(e.name=e.coordDim)}if(d)pz(c,function(e){A(e)}),c.sort(function(e,t){return e.storeDimIndex-t.storeDimIndex});else for(var k=0;k<h;k++){var T=x(k);null==T.coordDim&&(T.coordDim=function(e,t,n){if(n||t.hasKey(e)){for(var i=0;t.hasKey(e+i);)i++;e+=i}return t.set(e,!0),e}(C,u,M),T.coordDimIndex=0,(!S||_<=0)&&(T.isExtraCoord=!0),_--),A(T),null==T.type&&(1===f6(e,k)||T.isExtraCoord&&(null!=T.otherDims.itemName||null!=T.otherDims.seriesName))&&(T.type="ordinal")}return function(e){for(var t=fi(),n=0;n<e.length;n++){var i=e[n],r=i.name,o=t.get(r)||0;o>0&&(i.name=r+(o-1)),o++,t.set(r,o)}}(c),new gl({source:e,dimensions:c,fullDimensionCount:h,dimensionOmitted:d})}var Sw={},SS=function(){function e(){this._coordinateSystems=[]}return e.prototype.create=function(e,t){var n=[];pz(Sw,function(i,r){var o=i.create(e,t);n=n.concat(o||[])}),this._coordinateSystems=n},e.prototype.update=function(e,t){pz(this._coordinateSystems,function(n){n.update&&n.update(e,t)})},e.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},e.register=function(e,t){Sw[e]=t},e.get=function(e){return Sw[e]},e}(),S_=function(e){this.coordSysDims=[],this.axisMap=fi(),this.categoryAxisMap=fi(),this.coordSysName=e},SM={cartesian2d:function(e,t,n,i){var r=e.getReferringComponents("xAxis",fW).models[0],o=e.getReferringComponents("yAxis",fW).models[0];t.coordSysDims=["x","y"],n.set("x",r),n.set("y",o),SC(r)&&(i.set("x",r),t.firstCategoryDimIndex=0),SC(o)&&(i.set("y",o),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,n,i){var r=e.getReferringComponents("singleAxis",fW).models[0];t.coordSysDims=["single"],n.set("single",r),SC(r)&&(i.set("single",r),t.firstCategoryDimIndex=0)},polar:function(e,t,n,i){var r=e.getReferringComponents("polar",fW).models[0],o=r.findAxisModel("radiusAxis"),a=r.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),SC(o)&&(i.set("radius",o),t.firstCategoryDimIndex=0),SC(a)&&(i.set("angle",a),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},geo:function(e,t,n,i){t.coordSysDims=["lng","lat"]},parallel:function(e,t,n,i){var r=e.ecModel,o=r.getComponent("parallel",e.get("parallelIndex")),a=t.coordSysDims=o.dimensions.slice();pz(o.parallelAxisIndex,function(e,o){var s=r.getComponent("parallelAxis",e),l=a[o];n.set(l,s),SC(s)&&(i.set(l,s),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=o))})}};function SC(e){return"category"===e.get("type")}let SA=function(e,t,n){n=n||{};var i,r,o,a,s,l,u,c,h=t.getSourceManager(),d=!1;e?(d=!0,c=gt(e)):d=(c=h.getSource()).sourceFormat===fZ;var p=function(e){var t=e.get("coordinateSystem"),n=new S_(t),i=SM[t];if(i)return i(e,n,n.axisMap,n.categoryAxisMap),n}(t),f=(r=t.get("coordinateSystem"),o=SS.get(r),p&&p.coordSysDims&&(i=pV(p.coordSysDims,function(e){var t,n={name:e},i=p.axisMap.get(e);return i&&(n.type="category"===(t=i.get("type"))?"ordinal":"time"===t?"time":"float"),n})),i||(i=o&&(o.getDimensionsInfo?o.getDimensionsInfo():o.dimensions.slice())||["x","y"]),i),g=n.useEncodeDefaulter,m=pq(g)?g:g?p$(f5,f,t):null,v=Sb(c,{coordDimensions:f,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:m,canOmitUnusedDimensions:!d}),y=(a=v.dimensions,s=n.createInvertedIndices,p&&pz(a,function(e,t){var n=e.coordDim,i=p.categoryAxisMap.get(n);i&&(null==l&&(l=t),e.ordinalMeta=i.getOrdinalMeta(),s&&(e.createInvertedIndices=!0)),null!=e.otherDims.itemName&&(u=!0)}),u||null==l||(a[l].otherDims.itemName=0),l),x=d?null:h.getSharedDataStore(v),b=function(e,t,n){var i,r,o,a,s,l,u,c=(n=n||{}).byIndex,h=n.stackedCoordDimension;gu(t.schema)?(i=(r=t.schema).dimensions,o=t.store):i=t;var d=!!(e&&e.get("stack"));if(pz(i,function(e,t){pY(e)&&(i[t]=e={name:e}),d&&!e.isExtraCoord&&(c||a||!e.ordinalMeta||(a=e),s||"ordinal"===e.type||"time"===e.type||h&&h!==e.coordDim||(s=e))}),!s||c||a||(c=!0),s){l="__\0ecstackresult_"+e.id,u="__\0ecstackedover_"+e.id,a&&(a.createInvertedIndices=!0);var p=s.coordDim,f=s.type,g=0;pz(i,function(e){e.coordDim===p&&g++});var m={name:l,coordDim:p,coordDimIndex:g,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},v={name:u,coordDim:u,coordDimIndex:g+1,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};r?(o&&(m.storeDimIndex=o.ensureCalculationDimension(u,f),v.storeDimIndex=o.ensureCalculationDimension(l,f)),r.appendCalculationDimension(m),r.appendCalculationDimension(v)):(i.push(m),i.push(v))}return{stackedDimension:s&&s.name,stackedByDimension:a&&a.name,isStackedByIndex:c,stackedOverDimension:u,stackResultDimension:l}}(t,{schema:v,store:x}),w=new Sx(v,t);w.setCalculationInfo(b);var S=null!=y&&function(e){if(e.sourceFormat===fZ)return!pU(fP(function(e){for(var t=0;t<e.length&&null==e[t];)t++;return e[t]}(e.data||[])))}(c)?function(e,t,n,i){return i===y?n:this.defaultDimValueGetter(e,t,n,i)}:null;return w.hasItemOption=!1,w.initData(d?c:x,null,S),w};var Sk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.getInitialData=function(e,t){return SA(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,t,n){var i=this.coordinateSystem;if(i&&i.clampData){var r=i.clampData(e),o=i.dataToPoint(r);if(n)pz(i.getAxes(),function(e,n){if("category"===e.type&&null!=t){var i=e.getTicksCoords(),a=e.getTickModel().get("alignWithLabel"),s=r[n],l="x1"===t[n]||"y1"===t[n];if(l&&!a&&(s+=1),!(i.length<2)){if(2===i.length){o[n]=e.toGlobalCoord(e.getExtent()[+!!l]);return}for(var u=void 0,c=void 0,h=1,d=0;d<i.length;d++){var p=i[d].coord,f=d===i.length-1?i[d-1].tickValue+h:i[d].tickValue;if(f===s){c=p;break}if(f<s)u=p;else if(null!=u&&f>s){c=(p+u)/2;break}1===d&&(h=f-i[0].tickValue)}null==c&&(u?u&&(c=i[i.length-1].coord):c=i[0].coord),o[n]=e.toGlobalCoord(c)}}});else{var a=this.getData(),s=a.getLayout("offset"),l=a.getLayout("size"),u=+!i.getBaseAxis().isHorizontal();o[u]+=s+l/2}return o}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},t}(St);St.registerClass(Sk);var ST=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.getInitialData=function(){return SA(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},t.prototype.getProgressiveThreshold=function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=bp(Sk.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(Sk),SD=function(e){function t(t){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(t),n}return g$(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(e){return this._children[e]},t.prototype.childOfName=function(e){for(var t=this._children,n=0;n<t.length;n++)if(t[n].name===e)return t[n]},t.prototype.childCount=function(){return this._children.length},t.prototype.add=function(e){return e&&e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),this},t.prototype.addBefore=function(e,t){if(e&&e!==this&&e.parent!==this&&t&&t.parent===this){var n=this._children,i=n.indexOf(t);i>=0&&(n.splice(i,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=pN(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,i=n[t];if(e&&e!==this&&e.parent!==this&&e!==i){n[t]=e,i.parent=null;var r=this.__zr;r&&i.removeSelfFromZr(r),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,i=pN(n,e);return i<0||(n.splice(i,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh()),this},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;n<e.length;n++){var i=e[n];t&&i.removeSelfFromZr(t),i.parent=null}return e.length=0,this},t.prototype.eachChild=function(e,t){for(var n=this._children,i=0;i<n.length;i++){var r=n[i];e.call(t,r,i)}return this},t.prototype.traverse=function(e,t){for(var n=0;n<this._children.length;n++){var i=this._children[n],r=e.call(t,i);i.isGroup&&!r&&i.traverse(e,t)}return this},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].addSelfToZr(t)},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].removeSelfFromZr(t)},t.prototype.getBoundingRect=function(e){for(var t=new mr(0,0,0,0),n=e||this._children,i=[],r=null,o=0;o<n.length;o++){var a=n[o];if(!a.ignore&&!a.invisible){var s=a.getBoundingRect(),l=a.getLocalTransform(i);l?(mr.applyTransform(t,s,l),(r=r||t.clone()).union(t)):(r=r||s.clone()).union(s)}}return r||t},t}(vj);SD.prototype.type="group";let SI=SD;var SO=yv.CMD,SP=[[],[],[]],SE=Math.sqrt,SR=Math.atan2,SL=Math.sqrt,SN=Math.sin,SB=Math.cos,SF=Math.PI;function Sz(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function SV(e,t){return(e[0]*t[0]+e[1]*t[1])/(Sz(e)*Sz(t))}function Sj(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(SV(e,t))}function SH(e,t,n,i,r,o,a,s,l,u,c){var h=SF/180*l,d=SB(h)*(e-n)/2+SN(h)*(t-i)/2,p=-1*SN(h)*(e-n)/2+SB(h)*(t-i)/2,f=d*d/(a*a)+p*p/(s*s);f>1&&(a*=SL(f),s*=SL(f));var g=(r===o?-1:1)*SL((a*a*(s*s)-a*a*(p*p)-s*s*(d*d))/(a*a*(p*p)+s*s*(d*d)))||0,m=g*a*p/s,v=-(g*s)*d/a,y=(e+n)/2+SB(h)*m-SN(h)*v,x=(t+i)/2+SN(h)*m+SB(h)*v,b=Sj([1,0],[(d-m)/a,(p-v)/s]),w=[(d-m)/a,(p-v)/s],S=[(-1*d-m)/a,(-1*p-v)/s],_=Sj(w,S);if(-1>=SV(w,S)&&(_=SF),SV(w,S)>=1&&(_=0),_<0){var M=Math.round(_/SF*1e6)/1e6;_=2*SF+M%2*SF}c.addData(u,y,x,a,s,b,_,h,o)}var SW=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,SG=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g,S$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g$(t,e),t.prototype.applyTransform=function(e){},t}(yO);function SU(e){return null!=e.setData}function Sq(e,t){var n=function(e){var t,n=new yv;if(!e)return n;var i=0,r=0,o=0,a=0,s=yv.CMD,l=e.match(SW);if(!l)return n;for(var u=0;u<l.length;u++){for(var c=l[u],h=c.charAt(0),d=void 0,p=c.match(SG)||[],f=p.length,g=0;g<f;g++)p[g]=parseFloat(p[g]);for(var m=0;m<f;){var v=void 0,y=void 0,x=void 0,b=void 0,w=void 0,S=void 0,_=void 0,M=i,C=r,A=void 0,k=void 0;switch(h){case"l":i+=p[m++],r+=p[m++],d=s.L,n.addData(d,i,r);break;case"L":i=p[m++],r=p[m++],d=s.L,n.addData(d,i,r);break;case"m":i+=p[m++],r+=p[m++],d=s.M,n.addData(d,i,r),o=i,a=r,h="l";break;case"M":i=p[m++],r=p[m++],d=s.M,n.addData(d,i,r),o=i,a=r,h="L";break;case"h":i+=p[m++],d=s.L,n.addData(d,i,r);break;case"H":i=p[m++],d=s.L,n.addData(d,i,r);break;case"v":r+=p[m++],d=s.L,n.addData(d,i,r);break;case"V":r=p[m++],d=s.L,n.addData(d,i,r);break;case"C":d=s.C,n.addData(d,p[m++],p[m++],p[m++],p[m++],p[m++],p[m++]),i=p[m-2],r=p[m-1];break;case"c":d=s.C,n.addData(d,p[m++]+i,p[m++]+r,p[m++]+i,p[m++]+r,p[m++]+i,p[m++]+r),i+=p[m-2],r+=p[m-1];break;case"S":v=i,y=r,A=n.len(),k=n.data,t===s.C&&(v+=i-k[A-4],y+=r-k[A-3]),d=s.C,M=p[m++],C=p[m++],i=p[m++],r=p[m++],n.addData(d,v,y,M,C,i,r);break;case"s":v=i,y=r,A=n.len(),k=n.data,t===s.C&&(v+=i-k[A-4],y+=r-k[A-3]),d=s.C,M=i+p[m++],C=r+p[m++],i+=p[m++],r+=p[m++],n.addData(d,v,y,M,C,i,r);break;case"Q":M=p[m++],C=p[m++],i=p[m++],r=p[m++],d=s.Q,n.addData(d,M,C,i,r);break;case"q":M=p[m++]+i,C=p[m++]+r,i+=p[m++],r+=p[m++],d=s.Q,n.addData(d,M,C,i,r);break;case"T":v=i,y=r,A=n.len(),k=n.data,t===s.Q&&(v+=i-k[A-4],y+=r-k[A-3]),i=p[m++],r=p[m++],d=s.Q,n.addData(d,v,y,i,r);break;case"t":v=i,y=r,A=n.len(),k=n.data,t===s.Q&&(v+=i-k[A-4],y+=r-k[A-3]),i+=p[m++],r+=p[m++],d=s.Q,n.addData(d,v,y,i,r);break;case"A":x=p[m++],b=p[m++],w=p[m++],S=p[m++],_=p[m++],M=i,C=r,i=p[m++],SH(M,C,i,r=p[m++],S,_,x,b,w,d=s.A,n);break;case"a":x=p[m++],b=p[m++],w=p[m++],S=p[m++],_=p[m++],M=i,C=r,i+=p[m++],SH(M,C,i,r+=p[m++],S,_,x,b,w,d=s.A,n)}}("z"===h||"Z"===h)&&(d=s.Z,n.addData(d),i=o,r=a),t=d}return n.toStatic(),n}(e),i=pR({},t);return i.buildPath=function(e){if(SU(e)){e.setData(n.data);var t=e.getContext();t&&e.rebuildPath(t,1)}else{var t=e;n.rebuildPath(t,1)}},i.applyTransform=function(e){!function(e,t){if(t){var n,i,r,o,a,s,l=e.data,u=e.len(),c=SO.M,h=SO.C,d=SO.L,p=SO.R,f=SO.A,g=SO.Q;for(r=0,o=0;r<u;){switch(n=l[r++],o=r,i=0,n){case c:case d:i=1;break;case h:i=3;break;case g:i=2;break;case f:var m=t[4],v=t[5],y=SE(t[0]*t[0]+t[1]*t[1]),x=SE(t[2]*t[2]+t[3]*t[3]),b=SR(-t[1]/x,t[0]/y);l[r]*=y,l[r++]+=m,l[r]*=x,l[r++]+=v,l[r++]*=y,l[r++]*=x,l[r++]+=b,l[r++]+=b,r+=2,o=r;break;case p:s[0]=l[r++],s[1]=l[r++],mO(s,s,t),l[o++]=s[0],l[o++]=s[1],s[0]+=l[r++],s[1]+=l[r++],mO(s,s,t),l[o++]=s[0],l[o++]=s[1]}for(a=0;a<i;a++){var w=SP[a];w[0]=l[r++],w[1]=l[r++],mO(w,w,t),l[o++]=w[0],l[o++]=w[1]}}e.increaseVersion()}}(n,e),this.dirtyShape()},i}var SY=function(){this.cx=0,this.cy=0,this.r=0},SZ=function(e){function t(t){return e.call(this,t)||this}return g$(t,e),t.prototype.getDefaultShape=function(){return new SY},t.prototype.buildPath=function(e,t){e.moveTo(t.cx+t.r,t.cy),e.arc(t.cx,t.cy,t.r,0,2*Math.PI)},t}(yO);SZ.prototype.type="circle";let SX=SZ;var SK=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},SQ=function(e){function t(t){return e.call(this,t)||this}return g$(t,e),t.prototype.getDefaultShape=function(){return new SK},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=t.rx,o=t.ry,a=.5522848*r,s=.5522848*o;e.moveTo(n-r,i),e.bezierCurveTo(n-r,i-s,n-a,i-o,n,i-o),e.bezierCurveTo(n+a,i-o,n+r,i-s,n+r,i),e.bezierCurveTo(n+r,i+s,n+a,i+o,n,i+o),e.bezierCurveTo(n-a,i+o,n-r,i+s,n-r,i),e.closePath()},t}(yO);SQ.prototype.type="ellipse";let SJ=SQ;var S0=Math.PI,S1=2*S0,S2=Math.sin,S5=Math.cos,S3=Math.acos,S4=Math.atan2,S6=Math.abs,S8=Math.sqrt,S9=Math.max,S7=Math.min;function _e(e,t,n,i,r,o,a){var s=e-n,l=t-i,u=(a?o:-o)/S8(s*s+l*l),c=u*l,h=-u*s,d=e+c,p=t+h,f=n+c,g=i+h,m=(d+f)/2,v=(p+g)/2,y=f-d,x=g-p,b=y*y+x*x,w=r-o,S=d*g-f*p,_=(x<0?-1:1)*S8(S9(0,w*w*b-S*S)),M=(S*x-y*_)/b,C=(-S*y-x*_)/b,A=(S*x+y*_)/b,k=(-S*y+x*_)/b,T=M-m,D=C-v,I=A-m,O=k-v;return T*T+D*D>I*I+O*O&&(M=A,C=k),{cx:M,cy:C,x0:-c,y0:-h,x1:M*(r/w-1),y1:C*(r/w-1)}}var _t=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},_n=function(e){function t(t){return e.call(this,t)||this}return g$(t,e),t.prototype.getDefaultShape=function(){return new _t},t.prototype.buildPath=function(e,t){!function(e,t){var n,i=S9(t.r,0),r=S9(t.r0||0,0),o=i>0,a=r>0;if(o||a){if(o||(i=r,r=0),r>i){var s=i;i=r,r=s}var l=t.startAngle,u=t.endAngle;if(!(isNaN(l)||isNaN(u))){var c=t.cx,h=t.cy,d=!!t.clockwise,p=S6(u-l),f=p>S1&&p%S1;if(f>1e-4&&(p=f),i>1e-4)if(p>S1-1e-4)e.moveTo(c+i*S5(l),h+i*S2(l)),e.arc(c,h,i,l,u,!d),r>1e-4&&(e.moveTo(c+r*S5(u),h+r*S2(u)),e.arc(c,h,r,u,l,d));else{var g=void 0,m=void 0,v=void 0,y=void 0,x=void 0,b=void 0,w=void 0,S=void 0,_=void 0,M=void 0,C=void 0,A=void 0,k=void 0,T=void 0,D=void 0,I=void 0,O=i*S5(l),P=i*S2(l),E=r*S5(u),R=r*S2(u),L=p>1e-4;if(L){var N=t.cornerRadius;N&&(g=(n=function(e){var t;if(pU(e)){var n=e.length;if(!n)return e;t=1===n?[e[0],e[0],0,0]:2===n?[e[0],e[0],e[1],e[1]]:3===n?e.concat(e[2]):e}else t=[e,e,e,e];return t}(N))[0],m=n[1],v=n[2],y=n[3]);var B=S6(i-r)/2;if(x=S7(B,v),b=S7(B,y),w=S7(B,g),S=S7(B,m),C=_=S9(x,b),A=M=S9(w,S),(_>1e-4||M>1e-4)&&(k=i*S5(u),T=i*S2(u),D=r*S5(l),I=r*S2(l),p<S0)){var F=function(e,t,n,i,r,o,a,s){var l=n-e,u=i-t,c=a-r,h=s-o,d=h*l-c*u;if(!(d*d<1e-4))return d=(c*(t-o)-h*(e-r))/d,[e+d*l,t+d*u]}(O,P,D,I,k,T,E,R);if(F){var z=O-F[0],V=P-F[1],j=k-F[0],H=T-F[1],W=1/S2(S3((z*j+V*H)/(S8(z*z+V*V)*S8(j*j+H*H)))/2),G=S8(F[0]*F[0]+F[1]*F[1]);C=S7(_,(i-G)/(W+1)),A=S7(M,(r-G)/(W-1))}}}if(L)if(C>1e-4){var $=S7(v,C),U=S7(y,C),q=_e(D,I,O,P,i,$,d),Y=_e(k,T,E,R,i,U,d);e.moveTo(c+q.cx+q.x0,h+q.cy+q.y0),C<_&&$===U?e.arc(c+q.cx,h+q.cy,C,S4(q.y0,q.x0),S4(Y.y0,Y.x0),!d):($>0&&e.arc(c+q.cx,h+q.cy,$,S4(q.y0,q.x0),S4(q.y1,q.x1),!d),e.arc(c,h,i,S4(q.cy+q.y1,q.cx+q.x1),S4(Y.cy+Y.y1,Y.cx+Y.x1),!d),U>0&&e.arc(c+Y.cx,h+Y.cy,U,S4(Y.y1,Y.x1),S4(Y.y0,Y.x0),!d))}else e.moveTo(c+O,h+P),e.arc(c,h,i,l,u,!d);else e.moveTo(c+O,h+P);if(r>1e-4&&L)if(A>1e-4){var $=S7(g,A),U=S7(m,A),q=_e(E,R,k,T,r,-U,d),Y=_e(O,P,D,I,r,-$,d);e.lineTo(c+q.cx+q.x0,h+q.cy+q.y0),A<M&&$===U?e.arc(c+q.cx,h+q.cy,A,S4(q.y0,q.x0),S4(Y.y0,Y.x0),!d):(U>0&&e.arc(c+q.cx,h+q.cy,U,S4(q.y0,q.x0),S4(q.y1,q.x1),!d),e.arc(c,h,r,S4(q.cy+q.y1,q.cx+q.x1),S4(Y.cy+Y.y1,Y.cx+Y.x1),d),$>0&&e.arc(c+Y.cx,h+Y.cy,$,S4(Y.y1,Y.x1),S4(Y.y0,Y.x0),!d))}else e.lineTo(c+E,h+R),e.arc(c,h,r,u,l,d);else e.lineTo(c+E,h+R)}else e.moveTo(c,h);e.closePath()}}}(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(yO);_n.prototype.type="sector";let _i=_n;var _r=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},_o=function(e){function t(t){return e.call(this,t)||this}return g$(t,e),t.prototype.getDefaultShape=function(){return new _r},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=2*Math.PI;e.moveTo(n+t.r,i),e.arc(n,i,t.r,0,r,!1),e.moveTo(n+t.r0,i),e.arc(n,i,t.r0,0,r,!0)},t}(yO);_o.prototype.type="ring";let _a=_o;function _s(e,t,n){var i=t.smooth,r=t.points;if(r&&r.length>=2){if(i){var o=function(e,t,n,i){var r,o,a,s,l=[],u=[],c=[],h=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=e.length;d<p;d++)mP(a,a,e[d]),mE(s,s,e[d]);mP(a,a,i[0]),mE(s,s,i[1])}for(var d=0,p=e.length;d<p;d++){var f,g=e[d];if(n)r=e[d?d-1:p-1],o=e[(d+1)%p];else if(0===d||d===p-1){l.push([(f=e[d])[0],f[1]]);continue}else r=e[d-1],o=e[d+1];mC(u,o,r),mA(u,u,t);var m=mT(g,r),v=mT(g,o),y=m+v;0!==y&&(m/=y,v/=y),mA(c,u,-m),mA(h,u,v);var x=mM([],g,c),b=mM([],g,h);i&&(mE(x,x,a),mP(x,x,s),mE(b,b,a),mP(b,b,s)),l.push(x),l.push(b)}return n&&l.push(l.shift()),l}(r,i,n,t.smoothConstraint);e.moveTo(r[0][0],r[0][1]);for(var a=r.length,s=0;s<(n?a:a-1);s++){var l=o[2*s],u=o[2*s+1],c=r[(s+1)%a];e.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{e.moveTo(r[0][0],r[0][1]);for(var s=1,h=r.length;s<h;s++)e.lineTo(r[s][0],r[s][1])}n&&e.closePath()}}var _l=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},_u=function(e){function t(t){return e.call(this,t)||this}return g$(t,e),t.prototype.getDefaultShape=function(){return new _l},t.prototype.buildPath=function(e,t){_s(e,t,!0)},t}(yO);_u.prototype.type="polygon";let _c=_u;var _h=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},_d=function(e){function t(t){return e.call(this,t)||this}return g$(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new _h},t.prototype.buildPath=function(e,t){_s(e,t,!1)},t}(yO);_d.prototype.type="polyline";let _p=_d;var _f={},_g=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},_m=function(e){function t(t){return e.call(this,t)||this}return g$(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new _g},t.prototype.buildPath=function(e,t){if(this.subPixelOptimize){var n,i,r,o,a=yz(_f,t,this.style);n=a.x1,i=a.y1,r=a.x2,o=a.y2}else n=t.x1,i=t.y1,r=t.x2,o=t.y2;var s=t.percent;0!==s&&(e.moveTo(n,i),s<1&&(r=n*(1-s)+r*s,o=i*(1-s)+o*s),e.lineTo(r,o))},t.prototype.pointAt=function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]},t}(yO);_m.prototype.type="line";let _v=_m;var _y=[],_x=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function _b(e,t,n){var i=e.cpx2,r=e.cpy2;return null!=i||null!=r?[(n?mQ:mK)(e.x1,e.cpx1,e.cpx2,e.x2,t),(n?mQ:mK)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(n?m5:m2)(e.x1,e.cpx1,e.x2,t),(n?m5:m2)(e.y1,e.cpy1,e.y2,t)]}var _w=function(e){function t(t){return e.call(this,t)||this}return g$(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new _x},t.prototype.buildPath=function(e,t){var n=t.x1,i=t.y1,r=t.x2,o=t.y2,a=t.cpx1,s=t.cpy1,l=t.cpx2,u=t.cpy2,c=t.percent;0!==c&&(e.moveTo(n,i),null==l||null==u?(c<1&&(m4(n,a,r,c,_y),a=_y[1],r=_y[2],m4(i,s,o,c,_y),s=_y[1],o=_y[2]),e.quadraticCurveTo(a,s,r,o)):(c<1&&(m1(n,a,l,r,c,_y),a=_y[1],l=_y[2],r=_y[3],m1(i,s,u,o,c,_y),s=_y[1],u=_y[2],o=_y[3]),e.bezierCurveTo(a,s,l,u,r,o)))},t.prototype.pointAt=function(e){return _b(this.shape,e,!1)},t.prototype.tangentAt=function(e){var t=_b(this.shape,e,!0);return mk(t,t)},t}(yO);_w.prototype.type="bezier-curve";let _S=_w;var __=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},_M=function(e){function t(t){return e.call(this,t)||this}return g$(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new __},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=Math.max(t.r,0),o=t.startAngle,a=t.endAngle,s=t.clockwise,l=Math.cos(o),u=Math.sin(o);e.moveTo(l*r+n,u*r+i),e.arc(n,i,r,o,a,!s)},t}(yO);_M.prototype.type="arc";let _C=_M,_A=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="compound",t}return g$(t,e),t.prototype._updatePathDirty=function(){for(var e=this.shape.paths,t=this.shapeChanged(),n=0;n<e.length;n++)t=t||e[n].shapeChanged();t&&this.dirtyShape()},t.prototype.beforeBrush=function(){this._updatePathDirty();for(var e=this.shape.paths||[],t=this.getGlobalScale(),n=0;n<e.length;n++)e[n].path||e[n].createPathProxy(),e[n].path.setScale(t[0],t[1],e[n].segmentIgnoreThreshold)},t.prototype.buildPath=function(e,t){for(var n=t.paths||[],i=0;i<n.length;i++)n[i].buildPath(e,n[i].shape,!0)},t.prototype.afterBrush=function(){for(var e=this.shape.paths||[],t=0;t<e.length;t++)e[t].pathUpdated()},t.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),yO.prototype.getBoundingRect.call(this)},t}(yO);var _k=function(){function e(e){this.colorStops=e||[]}return e.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},e}();let _T=function(e){function t(t,n,i,r,o,a){var s=e.call(this,o)||this;return s.x=null==t?0:t,s.y=null==n?0:n,s.x2=null==i?1:i,s.y2=null==r?0:r,s.type="linear",s.global=a||!1,s}return g$(t,e),t}(_k),_D=function(e){function t(t,n,i,r,o){var a=e.call(this,r)||this;return a.x=null==t?.5:t,a.y=null==n?.5:n,a.r=null==i?.5:i,a.type="radial",a.global=o||!1,a}return g$(t,e),t}(_k);var _I=[0,0],_O=[0,0],_P=new g4,_E=new g4;let _R=function(){function e(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new g4;for(var n=0;n<2;n++)this._axes[n]=new g4;e&&this.fromBoundingRect(e,t)}return e.prototype.fromBoundingRect=function(e,t){var n=this._corners,i=this._axes,r=e.x,o=e.y,a=r+e.width,s=o+e.height;if(n[0].set(r,o),n[1].set(a,o),n[2].set(a,s),n[3].set(r,s),t)for(var l=0;l<4;l++)n[l].transform(t);g4.sub(i[0],n[1],n[0]),g4.sub(i[1],n[3],n[0]),i[0].normalize(),i[1].normalize();for(var l=0;l<2;l++)this._origin[l]=i[l].dot(n[0])},e.prototype.intersect=function(e,t){var n=!0,i=!t;return(_P.set(1/0,1/0),_E.set(0,0),!this._intersectCheckOneSide(this,e,_P,_E,i,1)&&(n=!1,i)||!this._intersectCheckOneSide(e,this,_P,_E,i,-1)&&(n=!1,i))?n:(i||g4.copy(t,n?_P:_E),n)},e.prototype._intersectCheckOneSide=function(e,t,n,i,r,o){for(var a=!0,s=0;s<2;s++){var l=this._axes[s];if(this._getProjMinMaxOnAxis(s,e._corners,_I),this._getProjMinMaxOnAxis(s,t._corners,_O),_I[1]<_O[0]||_I[0]>_O[1]){if(a=!1,r)return a;var u=Math.abs(_O[0]-_I[1]),c=Math.abs(_I[0]-_O[1]);Math.min(u,c)>i.len()&&(u<c?g4.scale(i,l,-u*o):g4.scale(i,l,c*o))}else if(n){var u=Math.abs(_O[0]-_I[1]),c=Math.abs(_I[0]-_O[1]);Math.min(u,c)<n.len()&&(u<c?g4.scale(n,l,u*o):g4.scale(n,l,-c*o))}}return a},e.prototype._getProjMinMaxOnAxis=function(e,t,n){for(var i=this._axes[e],r=this._origin,o=t[0].dot(i)+r[e],a=o,s=o,l=1;l<t.length;l++){var u=t[l].dot(i)+r[e];a=Math.min(u,a),s=Math.max(u,s)}n[0]=a,n[1]=s},e}();var _L=[];let _N=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.notClear=!0,t.incremental=!0,t._displayables=[],t._temporaryDisplayables=[],t._cursor=0,t}return g$(t,e),t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.useStyle=function(){this.style={}},t.prototype.getCursor=function(){return this._cursor},t.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},t.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},t.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},t.prototype.addDisplayable=function(e,t){t?this._temporaryDisplayables.push(e):this._displayables.push(e),this.markRedraw()},t.prototype.addDisplayables=function(e,t){t=t||!1;for(var n=0;n<e.length;n++)this.addDisplayable(e[n],t)},t.prototype.getDisplayables=function(){return this._displayables},t.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},t.prototype.eachPendingDisplayable=function(e){for(var t=this._cursor;t<this._displayables.length;t++)e&&e(this._displayables[t]);for(var t=0;t<this._temporaryDisplayables.length;t++)e&&e(this._temporaryDisplayables[t])},t.prototype.update=function(){this.updateTransform();for(var e=this._cursor;e<this._displayables.length;e++){var t=this._displayables[e];t.parent=this,t.update(),t.parent=null}for(var e=0;e<this._temporaryDisplayables.length;e++){var t=this._temporaryDisplayables[e];t.parent=this,t.update(),t.parent=null}},t.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new mr(1/0,1/0,-1/0,-1/0),t=0;t<this._displayables.length;t++){var n=this._displayables[t],i=n.getBoundingRect().clone();n.needLocalTransform()&&i.applyTransform(n.getLocalTransform(_L)),e.union(i)}this._rect=e}return this._rect},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t);if(this.getBoundingRect().contain(n[0],n[1])){for(var i=0;i<this._displayables.length;i++)if(this._displayables[i].contain(e,t))return!0}return!1},t}(vZ);var _B=Math.max,_F=Math.min,_z={};function _V(e){return yO.extend(e)}var _j=function(e,t){var n=Sq(e,t),i=S$;function r(e){var t=i.call(this,e)||this;return t.applyTransform=n.applyTransform,t.buildPath=n.buildPath,t}return g$(r,i),r};function _H(e,t){return _j(e,t)}function _W(e,t){_z[e]=t}function _G(e){if(_z.hasOwnProperty(e))return _z[e]}function _$(e,t,n,i){var r=new S$(Sq(e,t));return n&&("center"===i&&(n=_q(n,r.getBoundingRect())),_Z(r,n)),r}function _U(e,t,n){var i=new yB({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if("center"===n){var r={width:e.width,height:e.height};i.setStyle(_q(t,r))}}});return i}function _q(e,t){var n,i=t.width/t.height,r=e.height*i;return n=r<=e.width?e.height:(r=e.width)/i,{x:e.x+e.width/2-r/2,y:e.y+e.height/2-n/2,width:r,height:n}}var _Y=function(e,t){for(var n=[],i=e.length,r=0;r<i;r++){var o=e[r];n.push(o.getUpdatedPathProxy(!0))}var a=new yO(t);return a.createPathProxy(),a.buildPath=function(e){if(SU(e)){e.appendPath(n);var t=e.getContext();t&&e.rebuildPath(t,1)}},a};function _Z(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function _X(e,t){return yz(e,e,{lineWidth:t}),e}function _K(e){return yV(e.shape,e.shape,e.style),e}var _Q=yj;function _J(e,t){for(var n=g0([]);e&&e!==t;)g1(n,e.getLocalTransform(),n),e=e.parent;return n}function _0(e,t,n){return t&&!pF(t)&&(t=mz.getLocalTransform(t)),n&&(t=g3([],t)),mO([],e,t)}function _1(e,t,n){var i=0===t[4]||0===t[5]||0===t[0]?1:Math.abs(2*t[4]/t[0]),r=0===t[4]||0===t[5]||0===t[2]?1:Math.abs(2*t[4]/t[2]),o=["left"===e?-i:"right"===e?i:0,"top"===e?-r:"bottom"===e?r:0];return Math.abs((o=_0(o,t,n))[0])>Math.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function _2(e,t,n){if(e&&t){var i,r=(i={},e.traverse(function(e){!e.isGroup&&e.anid&&(i[e.anid]=e)}),i);t.traverse(function(e){if(!e.isGroup&&e.anid){var t=r[e.anid];if(t){var i=o(e);e.attr(o(t)),xW(e,i,n,y6(e).dataIndex)}}})}function o(e){var t={x:e.x,y:e.y,rotation:e.rotation};return null!=e.shape&&(t.shape=pR({},e.shape)),t}}function _5(e,t){return pV(e,function(e){var n=e[0];n=_F(n=_B(n,t.x),t.x+t.width);var i=e[1];return[n,i=_F(i=_B(i,t.y),t.y+t.height)]})}function _3(e,t){var n=_B(e.x,t.x),i=_F(e.x+e.width,t.x+t.width),r=_B(e.y,t.y),o=_F(e.y+e.height,t.y+t.height);if(i>=n&&o>=r)return{x:n,y:r,width:i-n,height:o-r}}function _4(e,t,n){var i=pR({rectHover:!0},t),r=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(r.image=e.slice(8),pL(r,n),new yB(i)):_$(e.replace("path://",""),i,n,"center")}function _6(e,t,n,i,r){for(var o=0,a=r[r.length-1];o<r.length;o++){var s=r[o];if(_8(e,t,n,i,s[0],s[1],a[0],a[1]))return!0;a=s}}function _8(e,t,n,i,r,o,a,s){var l,u=n-e,c=i-t,h=a-r,d=s-o,p=h*c-u*d;if((l=p)<=1e-6&&l>=-1e-6)return!1;var f=e-r,g=t-o,m=(f*c-u*g)/p;if(m<0||m>1)return!1;var v=(f*d-h*g)/p;return!(v<0)&&!(v>1)}function _9(e){var t=e.itemTooltipOption,n=e.componentModel,i=e.itemName,r=pY(t)?{formatter:t}:t,o=n.mainType,a=n.componentIndex,s={componentType:o,name:i,$vars:["name"]};s[o+"Index"]=a;var l=e.formatterParamsExtra;l&&pz(pW(l),function(e){fa(s,e)||(s[e]=l[e],s.$vars.push(e))});var u=y6(e.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:i,option:pL({content:i,formatterParams:s},r)}}function _7(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function Me(e,t){if(e)if(pU(e))for(var n=0;n<e.length;n++)_7(e[n],t);else _7(e,t)}_z.circle=SX,_z.ellipse=SJ,_z.sector=_i,_z.ring=_a,_z.polygon=_c,_z.polyline=_p,_z.rect=y$,_z.line=_v,_z.bezierCurve=_S,_z.arc=_C;var Mt="\0__throttleOriginMethod",Mn="\0__throttleRate",Mi="\0__throttleType";function Mr(e,t,n){var i,r,o,a,s,l=0,u=0,c=null;function h(){u=new Date().getTime(),c=null,e.apply(o,a||[])}t=t||0;var d=function(){for(var e=[],d=0;d<arguments.length;d++)e[d]=arguments[d];i=new Date().getTime(),o=this,a=e;var p=s||t,f=s||n;s=null,r=i-(f?l:u)-p,clearTimeout(c),f?c=setTimeout(h,p):r>=0?h():c=setTimeout(h,-r),l=i};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(e){s=e},d}function Mo(e,t,n,i){var r=e[t];if(r){var o=r[Mt]||r,a=r[Mi];if(r[Mn]!==n||a!==i){if(null==n||!i)return e[t]=o;(r=e[t]=Mr(o,n,"debounce"===i))[Mt]=o,r[Mi]=i,r[Mn]=n}return r}}function Ma(e,t){var n=e[t];n&&n[Mt]&&(n.clear&&n.clear(),e[t]=n[Mt])}function Ms(e,t,n,i,r){var o=e.getArea(),a=o.x,s=o.y,l=o.width,u=o.height,c=n.get(["lineStyle","width"])||2;a-=c/2,s-=c/2,l+=c,u+=c,l=Math.ceil(l),a!==Math.floor(a)&&(a=Math.floor(a),l++);var h=new y$({shape:{x:a,y:s,width:l,height:u}});if(t){var d=e.getBaseAxis(),p=d.isHorizontal(),f=d.inverse;p?(f&&(h.shape.x+=l),h.shape.width=0):(f||(h.shape.y+=u),h.shape.height=0);var g=pq(r)?function(e){r(e,h)}:null;xG(h,{shape:{width:l,height:u,x:a,y:s}},n,null,i,g)}return h}function Ml(e,t,n){var i=e.getArea(),r=fh(i.r0,1),o=fh(i.r,1),a=new _i({shape:{cx:fh(e.cx,1),cy:fh(e.cy,1),r0:r,r:o,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}});return t&&("angle"===e.getBaseAxis().dim?a.shape.endAngle=i.startAngle:a.shape.r=r,xG(a,{shape:{endAngle:i.endAngle,r:o}},n)),a}function Mu(e,t,n,i,r){if(e){if("polar"===e.type)return Ml(e,t,n);else if("cartesian2d"===e.type)return Ms(e,t,n,i,r)}return null}var Mc=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},Mh=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return gO(t,e),t.prototype.getDefaultShape=function(){return new Mc},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=Math.max(t.r0||0,0),o=Math.max(t.r,0),a=(o-r)*.5,s=r+a,l=t.startAngle,u=t.endAngle,c=t.clockwise,h=2*Math.PI,d=c?u-l<h:l-u<h;d||(l=u-(c?h:-h));var p=Math.cos(l),f=Math.sin(l),g=Math.cos(u),m=Math.sin(u);d?(e.moveTo(p*r+n,f*r+i),e.arc(p*s+n,f*s+i,a,-Math.PI+l,l,!c)):e.moveTo(p*o+n,f*o+i),e.arc(n,i,o,l,u,!c),e.arc(g*s+n,m*s+i,a,u-2*Math.PI,u-Math.PI,!c),0!==r&&e.arc(n,i,r,u,l,c)},t}(yO),Md=fz(),Mp=gf(),Mf=function(){function e(){this.group=new SI,this.uid=bd("viewChart"),this.renderTask=wS({plan:Mv,reset:My}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){},e.prototype.highlight=function(e,t,n,i){var r=e.getData(i&&i.dataType);r&&Mm(r,i,"emphasis")},e.prototype.downplay=function(e,t,n,i){var r=e.getData(i&&i.dataType);r&&Mm(r,i,"normal")},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateLayout=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateVisual=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.eachRendered=function(e){Me(this.group,e)},e.markUpdateMethod=function(e,t){Md(e).updateMethod=t},e.protoInitialize=void(e.prototype.type="chart"),e}();function Mg(e,t,n){e&&xB(e)&&("emphasis"===t?x_:xM)(e,n)}function Mm(e,t,n){var i,r,o=fF(e,t),a=t&&null!=t.highlightKey?(null==(r=y7[i=t.highlightKey])&&y9<=32&&(r=y7[i]=y9++),r):null;null!=o?pz(fD(o),function(t){Mg(e.getItemGraphicEl(t),n,a)}):e.eachItemGraphicEl(function(e){Mg(e,n,a)})}function Mv(e){return Mp(e.model)}function My(e){var t=e.model,n=e.ecModel,i=e.api,r=e.payload,o=t.pipelineContext.progressiveRender,a=e.view,s=r&&Md(r).updateMethod,l=o?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](t,n,i,r),Mx[l]}gL(Mf,["dispose"]),gV(Mf);var Mx={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}};function Mb(e,t){return e.type===t}function Mw(e,t){var n=e.mapDimensionsAll("defaultedLabel"),i=n.length;if(1===i){var r=wv(e,t,n[0]);return null!=r?r+"":null}if(i){for(var o=[],a=0;a<n.length;a++)o.push(wv(e,t,n[a]));return o.join(" ")}}function MS(e,t){var n=e.mapDimensionsAll("defaultedLabel");if(!pU(t))return t+"";for(var i=[],r=0;r<n.length;r++){var o=e.getDimensionIndex(n[r]);o>=0&&i.push(t[o])}return i.join(" ")}function M_(e,t,n){return t*Math.sin(e)*(n?-1:1)}function MM(e,t,n){return t*Math.cos(e)*(n?1:-1)}function MC(e,t,n){var i=e.get("borderRadius");if(null==i)return n?{cornerRadius:0}:null;pU(i)||(i=[i,i,i,i]);var r=Math.abs(t.r||0-t.r0||0);return{cornerRadius:pV(i,function(e){return md(e,r)})}}var MA=Math.max,Mk=Math.min,MT=function(e){function t(){var n=e.call(this)||this;return n.type=t.type,n._isFirstFrame=!0,n}return gO(t,e),t.prototype.render=function(e,t,n,i){this._model=e,this._removeOnRenderedListener(n),this._updateDrawMode(e);var r=e.get("coordinateSystem");("cartesian2d"===r||"polar"===r)&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,i))},t.prototype.incrementalPrepareRender=function(e){this._clear(),this._updateDrawMode(e),this._updateLargeClip(e)},t.prototype.incrementalRender=function(e,t){this._progressiveEls=[],this._incrementalRenderLarge(e,t)},t.prototype.eachRendered=function(e){Me(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;(null==this._isLargeDraw||t!==this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e,t,n,i){var r,o=this.group,a=e.getData(),s=this._data,l=e.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?r=u.isHorizontal():"polar"===l.type&&(r="angle"===u.dim);var c=e.isAnimationEnabled()?e:null,h=function(e,t){var n=e.get("realtimeSort",!0),i=t.getBaseAxis();if(n&&"category"===i.type&&"cartesian2d"===t.type)return{baseAxis:i,otherAxis:t.getOtherAxis(i)}}(e,l);h&&this._enableRealtimeSort(h,a,n);var d=e.get("clip",!0)||h,p=function(e,t){var n=e.getArea&&e.getArea();if(Mb(e,"cartesian2d")){var i=e.getBaseAxis();if("category"!==i.type||!i.onBand){var r=t.getLayout("bandWidth");i.isHorizontal()?(n.x-=r,n.width+=2*r):(n.y-=r,n.height+=2*r)}}return n}(l,a);o.removeClipPath();var f=e.get("roundCap",!0),g=e.get("showBackground",!0),m=e.getModel("backgroundStyle"),v=m.get("borderRadius")||0,y=[],x=this._backgroundEls,b=i&&i.isInitSort,w=i&&"changeAxisOrder"===i.type;function S(e){var t,n,i,o=MN[l.type](a,e),s=(t=l,n=r,i=o,new("polar"===t.type?_i:y$)({shape:MW(n,i,t),silent:!0,z2:0}));return s.useStyle(m.getItemStyle()),"cartesian2d"===l.type?s.setShape("r",v):s.setShape("cornerRadius",v),y[e]=s,s}a.diff(s).add(function(t){var n=a.getItemModel(t),i=MN[l.type](a,t,n);if(g&&S(t),a.hasValue(t)&&ML[l.type](i)){var s=!1;d&&(s=MD[l.type](p,i));var m=MI[l.type](e,a,t,i,r,c,u.model,!1,f);h&&(m.forceLabelAnimation=!0),MF(m,a,t,n,i,e,r,"polar"===l.type),b?m.attr({shape:i}):h?MO(h,c,m,i,t,r,!1,!1):xG(m,{shape:i},e,t),a.setItemGraphicEl(t,m),o.add(m),m.ignore=s}}).update(function(t,n){var i=a.getItemModel(t),_=MN[l.type](a,t,i);if(g){var M=void 0;0===x.length?M=S(n):((M=x[n]).useStyle(m.getItemStyle()),"cartesian2d"===l.type?M.setShape("r",v):M.setShape("cornerRadius",v),y[t]=M);var C=MN[l.type](a,t);xW(M,{shape:MW(r,C,l)},c,t)}var A=s.getItemGraphicEl(n);if(!a.hasValue(t)||!ML[l.type](_))return void o.remove(A);var k=!1;if(d&&(k=MD[l.type](p,_))&&o.remove(A),A?xZ(A):A=MI[l.type](e,a,t,_,r,c,u.model,!!A,f),h&&(A.forceLabelAnimation=!0),w){var T=A.getTextContent();if(T){var D=x9(T);null!=D.prevValue&&(D.prevValue=D.value)}}else MF(A,a,t,i,_,e,r,"polar"===l.type);b?A.attr({shape:_}):h?MO(h,c,A,_,t,r,!0,w):xW(A,{shape:_},e,t,null),a.setItemGraphicEl(t,A),A.ignore=k,o.add(A)}).remove(function(t){var n=s.getItemGraphicEl(t);n&&xY(n,e,t)}).execute();var _=this._backgroundGroup||(this._backgroundGroup=new SI);_.removeAll();for(var M=0;M<y.length;++M)_.add(y[M]);o.add(_),this._backgroundEls=y,this._data=a},t.prototype._renderLarge=function(e,t,n){this._clear(),Mj(e,this.group),this._updateLargeClip(e)},t.prototype._incrementalRenderLarge=function(e,t){this._removeBackground(),Mj(t,this.group,this._progressiveEls,!0)},t.prototype._updateLargeClip=function(e){var t=e.get("clip",!0)&&Mu(e.coordinateSystem,!1,e),n=this.group;t?n.setClipPath(t):n.removeClipPath()},t.prototype._enableRealtimeSort=function(e,t,n){var i=this;if(t.count()){var r=e.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(t,e,n),this._isFirstFrame=!1;else{var o=function(e){var n=t.getItemGraphicEl(e),i=n&&n.shape;return i&&Math.abs(r.isHorizontal()?i.height:i.width)||0};this._onRendered=function(){i._updateSortWithinSameData(t,o,r,n)},n.getZr().on("rendered",this._onRendered)}}},t.prototype._dataSort=function(e,t,n){var i=[];return e.each(e.mapDimension(t.dim),function(e,t){var r=n(t);r=null==r?NaN:r,i.push({dataIndex:t,mappedValue:r,ordinalNumber:e})}),i.sort(function(e,t){return t.mappedValue-e.mappedValue}),{ordinalNumbers:pV(i,function(e){return e.ordinalNumber})}},t.prototype._isOrderChangedWithinSameData=function(e,t,n){for(var i=n.scale,r=e.mapDimension(n.dim),o=Number.MAX_VALUE,a=0,s=i.getOrdinalMeta().categories.length;a<s;++a){var l=e.rawIndexOf(r,i.getRawOrdinalNumber(a)),u=l<0?5e-324:t(e.indexOfRawIndex(l));if(u>o)return!0;o=u}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,i=n.getExtent(),r=Math.max(0,i[0]),o=Math.min(i[1],n.getOrdinalMeta().categories.length-1);r<=o;++r)if(e.ordinalNumbers[r]!==n.getRawOrdinalNumber(r))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,i){if(this._isOrderChangedWithinSameData(e,t,n)){var r=this._dataSort(e,n,t);this._isOrderDifferentInView(r,n)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:r}))}},t.prototype._dispatchInitSort=function(e,t,n){var i=t.baseAxis,r=this._dataSort(e,i,function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)});n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:r})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&(e.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(t){xY(t,e,y6(t).dataIndex)})):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(Mf),MD={cartesian2d:function(e,t){var n=t.width<0?-1:1,i=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height);var r=e.x+e.width,o=e.y+e.height,a=MA(t.x,e.x),s=Mk(t.x+t.width,r),l=MA(t.y,e.y),u=Mk(t.y+t.height,o),c=s<a,h=u<l;return t.x=c&&a>r?s:a,t.y=h&&l>o?u:l,t.width=c?0:s-a,t.height=h?0:u-l,n<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height),c||h},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var i=t.r;t.r=t.r0,t.r0=i}var r=Mk(t.r,e.r),o=MA(t.r0,e.r0);t.r=r,t.r0=o;var a=r-o<0;if(n<0){var i=t.r;t.r=t.r0,t.r0=i}return a}},MI={cartesian2d:function(e,t,n,i,r,o,a,s,l){var u=new y$({shape:pR({},i),z2:1});return u.__dataIndex=n,u.name="item",o&&(u.shape[r?"height":"width"]=0),u},polar:function(e,t,n,i,r,o,a,s,l){var u,c,h=!r&&l?Mh:_i,d=new h({shape:i,z2:1});if(d.name="item",u=MB(r),c=h===Mh,d.calculateTextPosition=function(e,t,n){var i=t.position;if(!i||i instanceof Array)return mp(e,t,n);var r=u(i),o=null!=t.distance?t.distance:5,a=this.shape,s=a.cx,l=a.cy,h=a.r,d=a.r0,p=(h+d)/2,f=a.startAngle,g=a.endAngle,m=(f+g)/2,v=c?Math.abs(h-d)/2:0,y=Math.cos,x=Math.sin,b=s+h*y(f),w=l+h*x(f),S="left",_="top";switch(r){case"startArc":b=s+(d-o)*y(m),w=l+(d-o)*x(m),S="center",_="top";break;case"insideStartArc":b=s+(d+o)*y(m),w=l+(d+o)*x(m),S="center",_="bottom";break;case"startAngle":b=s+p*y(f)+M_(f,o+v,!1),w=l+p*x(f)+MM(f,o+v,!1),S="right",_="middle";break;case"insideStartAngle":b=s+p*y(f)+M_(f,-o+v,!1),w=l+p*x(f)+MM(f,-o+v,!1),S="left",_="middle";break;case"middle":b=s+p*y(m),w=l+p*x(m),S="center",_="middle";break;case"endArc":b=s+(h+o)*y(m),w=l+(h+o)*x(m),S="center",_="bottom";break;case"insideEndArc":b=s+(h-o)*y(m),w=l+(h-o)*x(m),S="center",_="top";break;case"endAngle":b=s+p*y(g)+M_(g,o+v,!0),w=l+p*x(g)+MM(g,o+v,!0),S="left",_="middle";break;case"insideEndAngle":b=s+p*y(g)+M_(g,-o+v,!0),w=l+p*x(g)+MM(g,-o+v,!0),S="right",_="middle";break;default:return mp(e,t,n)}return(e=e||{}).x=b,e.y=w,e.align=S,e.verticalAlign=_,e},o){var p=d.shape,f=r?"r":"endAngle",g={};p[f]=r?i.r0:i.startAngle,g[f]=i[f],(s?xW:xG)(d,{shape:g},o)}return d}};function MO(e,t,n,i,r,o,a,s){var l,u;o?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(a?xW:xG)(n,{shape:l},t,r,null),(a?xW:xG)(n,{shape:u},t?e.baseAxis.model:null,r)}function MP(e,t){for(var n=0;n<t.length;n++)if(!isFinite(e[t[n]]))return!0;return!1}var ME=["x","y","width","height"],MR=["cx","cy","r","startAngle","endAngle"],ML={cartesian2d:function(e){return!MP(e,ME)},polar:function(e){return!MP(e,MR)}},MN={cartesian2d:function(e,t,n){var i,r,o,a=e.getItemLayout(t),s=n?(i=n,r=a,(o=i.get(["itemStyle","borderColor"]))&&"none"!==o?Math.min(i.get(["itemStyle","borderWidth"])||0,isNaN(r.width)?Number.MAX_VALUE:Math.abs(r.width),isNaN(r.height)?Number.MAX_VALUE:Math.abs(r.height)):0):0,l=a.width>0?1:-1,u=a.height>0?1:-1;return{x:a.x+l*s/2,y:a.y+u*s/2,width:a.width-l*s,height:a.height-u*s}},polar:function(e,t,n){var i=e.getItemLayout(t);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function MB(e){var t;return t=e?"Arc":"Angle",function(e){switch(e){case"start":case"insideStart":case"end":case"insideEnd":return e+t;default:return e}}}function MF(e,t,n,i,r,o,a,s){var l=t.getItemVisual(n,"style");if(s){if(!o.get("roundCap")){var u=e.shape,c=MC(i.getModel("itemStyle"),u,!0);pR(u,c),e.setShape(u)}}else{var h=i.get(["itemStyle","borderRadius"])||0;e.setShape("r",h)}e.useStyle(l);var d=i.getShallow("cursor");d&&e.attr("cursor",d);var p=s?a?r.r>=r.r0?"endArc":"startArc":r.endAngle>=r.startAngle?"endAngle":"startAngle":a?r.height>=0?"bottom":"top":r.width>=0?"right":"left",f=x0(i);xJ(e,f,{labelFetcher:o,labelDataIndex:n,defaultText:Mw(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var g=e.getTextContent();if(s&&g){var m=i.get(["label","position"]);e.textConfig.inside="middle"===m||null,function(e,t,n,i){if(pX(i))return e.setTextConfig({rotation:i});if(pU(t))return e.setTextConfig({rotation:0});var r,o=e.shape,a=o.clockwise?o.startAngle:o.endAngle,s=o.clockwise?o.endAngle:o.startAngle,l=n(t);switch(l){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":r=(a+s)/2;break;case"startAngle":case"insideStartAngle":r=a;break;case"endAngle":case"insideEndAngle":r=s;break;default:e.setTextConfig({rotation:0});return}var u=1.5*Math.PI-r;"middle"===l&&u>Math.PI/2&&u<1.5*Math.PI&&(u-=Math.PI),e.setTextConfig({rotation:u})}(e,"outside"===m?p:m,MB(a),i.get(["label","rotate"]))}x7(g,f,o.getRawValue(n),function(e){return MS(t,e)});var v=i.getModel(["emphasis"]);xP(e,v.get("focus"),v.get("blurScope"),v.get("disabled")),xL(e,i),null!=r.startAngle&&null!=r.endAngle&&r.startAngle===r.endAngle&&(e.style.fill="none",e.style.stroke="none",pz(e.states,function(e){e.style&&(e.style.fill=e.style.stroke="none")}))}var Mz=function(){},MV=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return gO(t,e),t.prototype.getDefaultShape=function(){return new Mz},t.prototype.buildPath=function(e,t){for(var n=t.points,i=this.baseDimIdx,r=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l<n.length;l+=3)a[i]=s,a[r]=n[l+2],o[i]=n[l+i],o[r]=n[l+r],e.rect(o[0],o[1],a[0],a[1])},t}(yO);function Mj(e,t,n,i){var r=e.getData(),o=+!!r.getLayout("valueAxisHorizontal"),a=r.getLayout("largeDataIndices"),s=r.getLayout("size"),l=e.getModel("backgroundStyle"),u=r.getLayout("largeBackgroundPoints");if(u){var c=new MV({shape:{points:u},incremental:!!i,silent:!0,z2:0});c.baseDimIdx=o,c.largeDataIndices=a,c.barWidth=s,c.useStyle(l.getItemStyle()),t.add(c),n&&n.push(c)}var h=new MV({shape:{points:r.getLayout("largePoints")},incremental:!!i,ignoreCoarsePointer:!0,z2:1});h.baseDimIdx=o,h.largeDataIndices=a,h.barWidth=s,t.add(h),h.useStyle(r.getVisual("style")),y6(h).seriesIndex=e.seriesIndex,e.get("silent")||(h.on("mousedown",MH),h.on("mousemove",MH)),n&&n.push(h)}var MH=Mr(function(e){var t=function(e,t,n){for(var i=e.baseDimIdx,r=1-i,o=e.shape.points,a=e.largeDataIndices,s=[],l=[],u=e.barWidth,c=0,h=o.length/3;c<h;c++){var d=3*c;if(l[i]=u,l[r]=o[d+2],s[i]=o[d+i],s[r]=o[d+r],l[r]<0&&(s[r]+=l[r],l[r]=-l[r]),t>=s[0]&&t<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[c]}return -1}(this,e.offsetX,e.offsetY);y6(this).dataIndex=t>=0?t:null},30,!1);function MW(e,t,n){if(Mb(n,"cartesian2d")){var i=n.getArea();return{x:e?t.x:i.x,y:e?i.y:t.y,width:e?t.width:i.width,height:e?i.height:t.height}}var i=n.getArea();return{cx:i.cx,cy:i.cy,r0:e?i.r0:t.r0,r:e?i.r:t.r,startAngle:e?t.startAngle:0,endAngle:e?t.endAngle:2*Math.PI}}var MG=yO.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,i=t.cy,r=t.width/2,o=t.height/2;e.moveTo(n,i-o),e.lineTo(n+r,i+o),e.lineTo(n-r,i+o),e.closePath()}}),M$=yO.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,i=t.cy,r=t.width/2,o=t.height/2;e.moveTo(n,i-o),e.lineTo(n+r,i),e.lineTo(n,i+o),e.lineTo(n-r,i),e.closePath()}}),MU=yO.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.x,i=t.y,r=t.width/5*3,o=Math.max(r,t.height),a=r/2,s=a*a/(o-a),l=i-o+a+s,u=Math.asin(s/a),c=Math.cos(u)*a,h=Math.sin(u),d=Math.cos(u),p=.6*a,f=.7*a;e.moveTo(n-c,l+s),e.arc(n,l,a,Math.PI-u,2*Math.PI+u),e.bezierCurveTo(n+c-h*p,l+s+d*p,n,i-f,n,i),e.bezierCurveTo(n,i-f,n-c+h*p,l+s+d*p,n-c,l+s),e.closePath()}}),Mq=yO.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.height,i=t.width,r=t.x,o=t.y,a=i/3*2;e.moveTo(r,o),e.lineTo(r+a,o+n),e.lineTo(r,o+n/4*3),e.lineTo(r-a,o+n),e.lineTo(r,o),e.closePath()}}),MY={line:function(e,t,n,i,r){r.x1=e,r.y1=t+i/2,r.x2=e+n,r.y2=t+i/2},rect:function(e,t,n,i,r){r.x=e,r.y=t,r.width=n,r.height=i},roundRect:function(e,t,n,i,r){r.x=e,r.y=t,r.width=n,r.height=i,r.r=Math.min(n,i)/4},square:function(e,t,n,i,r){var o=Math.min(n,i);r.x=e,r.y=t,r.width=o,r.height=o},circle:function(e,t,n,i,r){r.cx=e+n/2,r.cy=t+i/2,r.r=Math.min(n,i)/2},diamond:function(e,t,n,i,r){r.cx=e+n/2,r.cy=t+i/2,r.width=n,r.height=i},pin:function(e,t,n,i,r){r.x=e+n/2,r.y=t+i/2,r.width=n,r.height=i},arrow:function(e,t,n,i,r){r.x=e+n/2,r.y=t+i/2,r.width=n,r.height=i},triangle:function(e,t,n,i,r){r.cx=e+n/2,r.cy=t+i/2,r.width=n,r.height=i}},MZ={};pz({line:_v,rect:y$,roundRect:y$,square:y$,circle:SX,diamond:M$,pin:MU,arrow:Mq,triangle:MG},function(e,t){MZ[t]=new e});var MX=yO.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var i=mp(e,t,n),r=this.shape;return r&&"pin"===r.symbolType&&"inside"===t.position&&(i.y=n.y+.4*n.height),i},buildPath:function(e,t,n){var i=t.symbolType;if("none"!==i){var r=MZ[i];r||(r=MZ[i="rect"]),MY[i](t.x,t.y,t.width,t.height,r.shape),r.buildPath(e,r.shape,n)}}});function MK(e,t){if("image"!==this.type){var n=this.style;this.__isEmptyBrush?(n.stroke=e,n.fill=t||"#fff",n.lineWidth=2):"line"===this.shape.symbolType?n.stroke=e:n.fill=e,this.markRedraw()}}function MQ(e,t,n,i,r,o,a){var s,l=0===e.indexOf("empty");return l&&(e=e.substr(5,1).toLowerCase()+e.substr(6)),(s=0===e.indexOf("image://")?_U(e.slice(8),new mr(t,n,i,r),a?"center":"cover"):0===e.indexOf("path://")?_$(e.slice(7),{},new mr(t,n,i,r),a?"center":"cover"):new MX({shape:{symbolType:e,x:t,y:n,width:i,height:r}})).__isEmptyBrush=l,s.setColor=MK,o&&s.setColor(o),s}function MJ(e){return pU(e)||(e=[+e,+e]),[e[0]||0,e[1]||0]}function M0(e,t){if(null!=e)return pU(e)||(e=[e,e]),[fc(e[0],t[0])||0,fc(p5(e[1],e[0]),t[1])||0]}var M1=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return gO(t,e),t.prototype.getInitialData=function(e){return SA(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new SI,n=MQ("line",0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);t.add(n),n.setStyle(e.lineStyle);var i=this.getData().getVisual("symbol"),r=this.getData().getVisual("symbolRotate"),o="none"===i?"circle":i,a=.8*e.itemHeight,s=MQ(o,(e.itemWidth-a)/2,(e.itemHeight-a)/2,a,a,e.itemStyle.fill);return t.add(s),s.setStyle(e.itemStyle),s.rotation=("inherit"===e.iconRotate?r:e.iconRotate||0)*Math.PI/180,s.setOrigin([e.itemWidth/2,e.itemHeight/2]),o.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),t},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(St),M2=function(e){function t(t,n,i,r){var o=e.call(this)||this;return o.updateData(t,n,i,r),o}return gO(t,e),t.prototype._createSymbol=function(e,t,n,i,r){this.removeAll();var o=MQ(e,-1,-1,2,2,null,r);o.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),o.drift=M5,this._symbolType=e,this.add(o)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){x_(this.childAt(0))},t.prototype.downplay=function(){xM(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?"move":n.cursor},t.prototype.updateData=function(e,n,i,r){this.silent=!1;var o=e.getItemVisual(n,"symbol")||"circle",a=e.hostModel,s=t.getSymbolSize(e,n),l=o!==this._symbolType,u=r&&r.disableAnimation;if(l){var c=e.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,e,n,s,c)}else{var h=this.childAt(0);h.silent=!1;var d={scaleX:s[0]/2,scaleY:s[1]/2};u?h.attr(d):xW(h,d,a,n),xZ(h)}if(this._updateCommon(e,n,s,i,r),l){var h=this.childAt(0);if(!u){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,xG(h,d,a,n)}}u&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(e,t,n,i,r){var o,a,s,l,u,c,h,d,p,f=this.childAt(0),g=e.hostModel;if(i&&(o=i.emphasisItemStyle,a=i.blurItemStyle,s=i.selectItemStyle,l=i.focus,u=i.blurScope,h=i.labelStatesModels,d=i.hoverScale,p=i.cursorStyle,c=i.emphasisDisabled),!i||e.hasItemOption){var m=i&&i.itemModel?i.itemModel:e.getItemModel(t),v=m.getModel("emphasis");o=v.getModel("itemStyle").getItemStyle(),s=m.getModel(["select","itemStyle"]).getItemStyle(),a=m.getModel(["blur","itemStyle"]).getItemStyle(),l=v.get("focus"),u=v.get("blurScope"),c=v.get("disabled"),h=x0(m),d=v.getShallow("scale"),p=m.getShallow("cursor")}var y=e.getItemVisual(t,"symbolRotate");f.attr("rotation",(y||0)*Math.PI/180||0);var x=M0(e.getItemVisual(t,"symbolOffset"),n);x&&(f.x=x[0],f.y=x[1]),p&&f.attr("cursor",p);var b=e.getItemVisual(t,"style"),w=b.fill;if(f instanceof yB){var S=f.style;f.useStyle(pR({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},b))}else f.__isEmptyBrush?f.useStyle(pR({},b)):f.useStyle(b),f.style.decal=null,f.setColor(w,r&&r.symbolInnerColor),f.style.strokeNoScale=!0;var _=e.getItemVisual(t,"liftZ"),M=this._z2;null!=_?null==M&&(this._z2=f.z2,f.z2+=_):null!=M&&(f.z2=M,this._z2=null);var C=r&&r.useNameLabel;xJ(f,h,{labelFetcher:g,labelDataIndex:t,defaultText:function(t){return C?e.getName(t):Mw(e,t)},inheritColor:w,defaultOpacity:b.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var A=f.ensureState("emphasis");A.style=o,f.ensureState("select").style=s,f.ensureState("blur").style=a;var k=null==d||!0===d?Math.max(1.1,3/this._sizeY):isFinite(d)&&d>0?+d:1;A.scaleX=this._sizeX*k,A.scaleY=this._sizeY*k,this.setSymbolScale(1),xP(this,l,u,c)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var i=this.childAt(0),r=y6(this).dataIndex,o=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&xU(a,{style:{opacity:0}},t,{dataIndex:r,removeOpt:o,cb:function(){i.removeTextContent()}})}else i.removeTextContent();xU(i,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:r,cb:e,removeOpt:o})},t.getSymbolSize=function(e,t){return MJ(e.getItemVisual(t,"symbolSize"))},t}(SI);function M5(e,t){this.parent.drift(e,t)}function M3(e,t,n,i){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(n,"symbol")}function M4(e){return null==e||pK(e)||(e={isIgnore:e}),e||{}}function M6(e){var t=e.hostModel,n=t.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:x0(t),cursorStyle:t.get("cursor")}}var M8=function(){function e(e){this.group=new SI,this._SymbolCtor=e||M2}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=M4(t);var n=this.group,i=e.hostModel,r=this._data,o=this._SymbolCtor,a=t.disableAnimation,s=M6(e),l={disableAnimation:a},u=t.getSymbolPoint||function(t){return e.getItemLayout(t)};r||n.removeAll(),e.diff(r).add(function(i){var r=u(i);if(M3(e,r,i,t)){var a=new o(e,i,s,l);a.setPosition(r),e.setItemGraphicEl(i,a),n.add(a)}}).update(function(c,h){var d=r.getItemGraphicEl(h),p=u(c);if(!M3(e,p,c,t))return void n.remove(d);var f=e.getItemVisual(c,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)n.remove(d),(d=new o(e,c,s,l)).setPosition(p);else{d.updateData(e,c,s,l);var m={x:p[0],y:p[1]};a?d.attr(m):xW(d,m,i)}n.add(d),e.setItemGraphicEl(c,d)}).remove(function(e){var t=r.getItemGraphicEl(e);t&&t.fadeOut(function(){n.remove(t)},i)}).execute(),this._getSymbolPoint=u,this._data=e},e.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(t,n){var i=e._getSymbolPoint(n);t.setPosition(i),t.markRedraw()})},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=M6(e),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){function i(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=M4(n);for(var r=e.start;r<e.end;r++){var o=t.getItemLayout(r);if(M3(t,o,r,n)){var a=new this._SymbolCtor(t,r,this._seriesScope);a.traverse(i),a.setPosition(o),this.group.add(a),t.setItemGraphicEl(r,a),this._progressiveEls.push(a)}}},e.prototype.eachRendered=function(e){Me(this._progressiveEls||this.group,e)},e.prototype.remove=function(e){var t=this.group,n=this._data;n&&e?n.eachItemGraphicEl(function(e){e.fadeOut(function(){t.remove(e)},n.hostModel)}):t.removeAll()},e}();function M9(e,t,n){var i,r,o,a,s=e.getBaseAxis(),l=e.getOtherAxis(s),u=(i=l,r=n,o=0,a=i.scale.getExtent(),"start"===r?o=a[0]:"end"===r?o=a[1]:pX(r)&&!isNaN(r)?o=r:a[0]>0?o=a[0]:a[1]<0&&(o=a[1]),o),c=s.dim,h=l.dim,d=t.mapDimension(h),p=t.mapDimension(c),f=+("x"===h||"radius"===h),g=pV(e.dimensions,function(e){return t.mapDimension(e)}),m=!1,v=t.getCalculationInfo("stackResultDimension");return gd(t,g[0])&&(m=!0,g[0]=v),gd(t,g[1])&&(m=!0,g[1]=v),{dataDimsForPoint:g,valueStart:u,valueAxisDim:h,baseAxisDim:c,stacked:!!m,valueDim:d,baseDim:p,baseDataOffset:f,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}}function M7(e,t,n,i){var r=NaN;e.stacked&&(r=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=e.valueStart);var o=e.baseDataOffset,a=[];return a[o]=n.get(e.baseDim,i),a[1-o]=r,t.dataToPoint(a)}var Ce=Math.min,Ct=Math.max;function Cn(e,t){return isNaN(e)||isNaN(t)}function Ci(e,t,n,i,r,o,a,s,l){for(var u,c,h,d,p,f,g=n,m=0;m<i;m++){var v=t[2*g],y=t[2*g+1];if(g>=r||g<0)break;if(Cn(v,y)){if(l){g+=o;continue}break}if(g===n)e[o>0?"moveTo":"lineTo"](v,y),h=v,d=y;else{var x=v-u,b=y-c;if(x*x+b*b<.5){g+=o;continue}if(a>0){for(var w=g+o,S=t[2*w],_=t[2*w+1];S===v&&_===y&&m<i;)m++,w+=o,g+=o,S=t[2*w],_=t[2*w+1],v=t[2*g],y=t[2*g+1],x=v-u,b=y-c;var M=m+1;if(l)for(;Cn(S,_)&&M<i;)M++,w+=o,S=t[2*w],_=t[2*w+1];var C=.5,A=0,k=0,T=void 0,D=void 0;if(M>=i||Cn(S,_))p=v,f=y;else{A=S-u,k=_-c;var I=v-u,O=S-v,P=y-c,E=_-y,R=void 0,L=void 0;if("x"===s){R=Math.abs(I),L=Math.abs(O);var N=A>0?1:-1;p=v-N*R*a,f=y,T=v+N*L*a,D=y}else if("y"===s){R=Math.abs(P),L=Math.abs(E);var B=k>0?1:-1;p=v,f=y-B*R*a,T=v,D=y+B*L*a}else R=Math.sqrt(I*I+P*P),p=v-A*a*(1-(C=(L=Math.sqrt(O*O+E*E))/(L+R))),f=y-k*a*(1-C),T=v+A*a*C,D=y+k*a*C,T=Ce(T,Ct(S,v)),D=Ce(D,Ct(_,y)),T=Ct(T,Ce(S,v)),D=Ct(D,Ce(_,y)),A=T-v,k=D-y,p=v-A*R/L,f=y-k*R/L,p=Ce(p,Ct(u,v)),f=Ce(f,Ct(c,y)),p=Ct(p,Ce(u,v)),f=Ct(f,Ce(c,y)),A=v-p,k=y-f,T=v+A*L/R,D=y+k*L/R}e.bezierCurveTo(h,d,p,f,v,y),h=T,d=D}else e.lineTo(v,y)}u=v,c=y,g+=o}return m}var Cr=function(){this.smooth=0,this.smoothConstraint=!0},Co=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polyline",n}return gO(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new Cr},t.prototype.buildPath=function(e,t){var n=t.points,i=0,r=n.length/2;if(t.connectNulls){for(;r>0&&Cn(n[2*r-2],n[2*r-1]);r--);for(;i<r&&Cn(n[2*i],n[2*i+1]);i++);}for(;i<r;)i+=Ci(e,n,i,r,r,1,t.smooth,t.smoothMonotone,t.connectNulls)+1},t.prototype.getPointOn=function(e,t){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n,i,r=this.path.data,o=yv.CMD,a="x"===t,s=[],l=0;l<r.length;){var u=r[l++],c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,g=void 0,m=void 0;switch(u){case o.M:n=r[l++],i=r[l++];break;case o.L:if(c=r[l++],h=r[l++],(m=a?(e-n)/(c-n):(e-i)/(h-i))<=1&&m>=0){var v=a?(h-i)*m+i:(c-n)*m+n;return a?[e,v]:[v,e]}n=c,i=h;break;case o.C:c=r[l++],h=r[l++],d=r[l++],p=r[l++],f=r[l++],g=r[l++];var y=a?mJ(n,c,d,f,e,s):mJ(i,h,p,g,e,s);if(y>0)for(var x=0;x<y;x++){var b=s[x];if(b<=1&&b>=0){var v=a?mK(i,h,p,g,b):mK(n,c,d,f,b);return a?[e,v]:[v,e]}}n=f,i=g}}},t}(yO),Ca=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t}(Cr),Cs=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polygon",n}return gO(t,e),t.prototype.getDefaultShape=function(){return new Ca},t.prototype.buildPath=function(e,t){var n=t.points,i=t.stackedOnPoints,r=0,o=n.length/2,a=t.smoothMonotone;if(t.connectNulls){for(;o>0&&Cn(n[2*o-2],n[2*o-1]);o--);for(;r<o&&Cn(n[2*r],n[2*r+1]);r++);}for(;r<o;){var s=Ci(e,n,r,o,o,1,t.smooth,a,t.connectNulls);Ci(e,i,r+s-1,s,o,-1,t.stackedOnSmooth,a,t.connectNulls),r+=s+1,e.closePath()}},t}(yO);function Cl(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return;return!0}}function Cu(e){for(var t=1/0,n=1/0,i=-1/0,r=-1/0,o=0;o<e.length;){var a=e[o++],s=e[o++];isNaN(a)||(t=Math.min(a,t),i=Math.max(a,i)),isNaN(s)||(n=Math.min(s,n),r=Math.max(s,r))}return[[t,n],[i,r]]}function Cc(e,t){var n=Cu(e),i=n[0],r=n[1],o=Cu(t),a=o[0],s=o[1];return Math.max(Math.abs(i[0]-a[0]),Math.abs(i[1]-a[1]),Math.abs(r[0]-s[0]),Math.abs(r[1]-s[1]))}function Ch(e){return pX(e)?e:.5*!!e}function Cd(e,t,n,i){var r=t.getBaseAxis(),o=+("x"!==r.dim&&"radius"!==r.dim),a=[],s=0,l=[],u=[],c=[],h=[];if(i){for(s=0;s<e.length;s+=2)isNaN(e[s])||isNaN(e[s+1])||h.push(e[s],e[s+1]);e=h}for(s=0;s<e.length-2;s+=2)switch(c[0]=e[s+2],c[1]=e[s+3],u[0]=e[s],u[1]=e[s+1],a.push(u[0],u[1]),n){case"end":l[o]=c[o],l[1-o]=u[1-o],a.push(l[0],l[1]);break;case"middle":var d=(u[o]+c[o])/2,p=[];l[o]=p[o]=d,l[1-o]=u[1-o],p[1-o]=c[1-o],a.push(l[0],l[1]),a.push(p[0],p[1]);break;default:l[o]=u[o],l[1-o]=c[1-o],a.push(l[0],l[1])}return a.push(e[s++],e[s++]),a}function Cp(e,t){return[e[2*t],e[2*t+1]]}function Cf(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t<xn.length;t++)if(e.get([xn[t],"endLabel","show"]))return!0;return!1}function Cg(e,t,n,i){if(!Mb(t,"cartesian2d"))return Ml(t,n,i);var r=i.getModel("endLabel"),o=r.get("valueAnimation"),a=i.getData(),s={lastFrameIndex:0},l=Cf(i)?function(n,i){e._endLabelOnDuring(n,i,a,s,o,r,t)}:null,u=t.getBaseAxis().isHorizontal(),c=Ms(t,n,i,function(){var t=e._endLabel;t&&n&&null!=s.originalX&&t.attr({x:s.originalX,y:s.originalY})},l);if(!i.get("clip",!0)){var h=c.shape,d=Math.max(h.width,h.height);u?(h.y-=d,h.height+=2*d):(h.x-=d,h.width+=2*d)}return l&&l(1,c),c}var Cm=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t.prototype.init=function(){var e=new SI,t=new M8;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},t.prototype.render=function(e,t,n){var i,r=this,o=e.coordinateSystem,a=this.group,s=e.getData(),l=e.getModel("lineStyle"),u=e.getModel("areaStyle"),c=s.getLayout("points")||[],h="polar"===o.type,d=this._coordSys,p=this._symbolDraw,f=this._polyline,g=this._polygon,m=this._lineGroup,v=!t.ssr&&e.get("animation"),y=!u.isEmpty(),x=u.get("origin"),b=M9(o,s,x),w=y&&function(e,t,n){if(!n.valueDim)return[];for(var i=t.count(),r=gv(2*i),o=0;o<i;o++){var a=M7(n,e,t,o);r[2*o]=a[0],r[2*o+1]=a[1]}return r}(o,s,b),S=e.get("showSymbol"),_=e.get("connectNulls"),M=S&&!h&&function(e,t,n){var i=e.get("showAllSymbol"),r="auto"===i;if(!i||r){var o=n.getAxesByScale("ordinal")[0];if(o&&!(r&&function(e,t){var n=e.getExtent(),i=Math.abs(n[1]-n[0])/e.scale.count();isNaN(i)&&(i=0);for(var r=t.count(),o=Math.max(1,Math.round(r/5)),a=0;a<r;a+=o)if(1.5*M2.getSymbolSize(t,a)[+!!e.isHorizontal()]>i)return!1;return!0}(o,t))){var a=t.mapDimension(o.dim),s={};return pz(o.getViewLabels(),function(e){s[o.scale.getRawOrdinalNumber(e.tickValue)]=1}),function(e){return!s.hasOwnProperty(t.get(a,e))}}}}(e,s,o),C=this._data;C&&C.eachItemGraphicEl(function(e,t){e.__temp&&(a.remove(e),C.setItemGraphicEl(t,null))}),S||p.remove(),a.add(m);var A=!h&&e.get("step");o&&o.getArea&&e.get("clip",!0)&&(null!=(i=o.getArea()).width?(i.x-=.1,i.y-=.1,i.width+=.2,i.height+=.2):i.r0&&(i.r0-=.5,i.r+=.5)),this._clipShapeForSymbol=i;var k=function(e,t,n){var i,r,o=e.getVisual("visualMeta");if(o&&o.length&&e.count()){if("cartesian2d"!==t.type)return;for(var a=o.length-1;a>=0;a--){var s=e.getDimensionInfo(o[a].dimension);if("x"===(i=s&&s.coordDim)||"y"===i){r=o[a];break}}if(!r)return;var l=t.getAxis(i),u=pV(r.stops,function(e){return{coord:l.toGlobalCoord(l.dataToCoord(e.value)),color:e.color}}),c=u.length,h=r.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var d=function(e,t){var n,i,r=[],o=e.length;function a(e,t,n){var i=e.coord,r=function(e,t){if(t&&t.length&&e>=0&&e<=1){var n,i,r,o,a=e*(t.length-1),s=Math.floor(a),l=Math.ceil(a),u=vc(t[s]),c=vc(t[l]),h=a-s;return vm([ve((n=u[0],n+(c[0]-n)*h)),ve((i=u[1],i+(c[1]-i)*h)),ve((r=u[2],r+(c[2]-r)*h)),vt((o=u[3],o+(c[3]-o)*h))],"rgba")}}((n-i)/(t.coord-i),[e.color,t.color]);return{coord:n,color:r}}for(var s=0;s<o;s++){var l=e[s],u=l.coord;if(u<0)n=l;else if(u>t){i?r.push(a(i,l,t)):n&&r.push(a(n,l,0),a(n,l,t));break}else n&&(r.push(a(n,l,0)),n=null),r.push(l),i=l}return r}(u,"x"===i?n.getWidth():n.getHeight()),p=d.length;if(!p&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var f=d[0].coord-10,g=d[p-1].coord+10,m=g-f;if(m<.001)return"transparent";pz(d,function(e){e.offset=(e.coord-f)/m}),d.push({offset:p?d[p-1].offset:.5,color:h[1]||"transparent"}),d.unshift({offset:p?d[0].offset:.5,color:h[0]||"transparent"});var v=new _T(0,0,0,0,d,!0);return v[i]=f,v[i+"2"]=g,v}}(s,o,n)||s.getVisual("style")[s.getVisual("drawType")];if(f&&d.type===o.type&&A===this._step){y&&!g?g=this._newPolygon(c,w):g&&!y&&(m.remove(g),g=this._polygon=null),h||this._initOrUpdateEndLabel(e,o,b5(k));var T=m.getClipPath();T?xG(T,{shape:Cg(this,o,!1,e).shape},e):m.setClipPath(Cg(this,o,!0,e)),S&&p.updateData(s,{isIgnore:M,clipShape:i,disableAnimation:!0,getSymbolPoint:function(e){return[c[2*e],c[2*e+1]]}}),Cl(this._stackedOnPoints,w)&&Cl(this._points,c)||(v?this._doUpdateAnimation(s,w,o,n,A,x,_):(A&&(c=Cd(c,o,A,_),w&&(w=Cd(w,o,A,_))),f.setShape({points:c}),g&&g.setShape({points:c,stackedOnPoints:w})))}else S&&p.updateData(s,{isIgnore:M,clipShape:i,disableAnimation:!0,getSymbolPoint:function(e){return[c[2*e],c[2*e+1]]}}),v&&this._initSymbolLabelAnimation(s,o,i),A&&(c=Cd(c,o,A,_),w&&(w=Cd(w,o,A,_))),f=this._newPolyline(c),y?g=this._newPolygon(c,w):g&&(m.remove(g),g=this._polygon=null),h||this._initOrUpdateEndLabel(e,o,b5(k)),m.setClipPath(Cg(this,o,!0,e));var D=e.getModel("emphasis"),I=D.get("focus"),O=D.get("blurScope"),P=D.get("disabled");f.useStyle(pL(l.getLineStyle(),{fill:"none",stroke:k,lineJoin:"bevel"})),xL(f,e,"lineStyle"),f.style.lineWidth>0&&"bolder"===e.get(["emphasis","lineStyle","width"])&&(f.getState("emphasis").style.lineWidth=+f.style.lineWidth+1),y6(f).seriesIndex=e.seriesIndex,xP(f,I,O,P);var E=Ch(e.get("smooth")),R=e.get("smoothMonotone");if(f.setShape({smooth:E,smoothMonotone:R,connectNulls:_}),g){var L=s.getCalculationInfo("stackedOnSeries"),N=0;g.useStyle(pL(u.getAreaStyle(),{fill:k,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),L&&(N=Ch(L.get("smooth"))),g.setShape({smooth:E,stackedOnSmooth:N,smoothMonotone:R,connectNulls:_}),xL(g,e,"areaStyle"),y6(g).seriesIndex=e.seriesIndex,xP(g,I,O,P)}var B=function(e){r._changePolyState(e)};s.eachItemGraphicEl(function(e){e&&(e.onHoverStateChange=B)}),this._polyline.onHoverStateChange=B,this._data=s,this._coordSys=o,this._stackedOnPoints=w,this._points=c,this._step=A,this._valueOrigin=x,e.get("triggerLineEvent")&&(this.packEventData(e,f),g&&this.packEventData(e,g))},t.prototype.packEventData=function(e,t){y6(t).eventData={componentType:"series",componentSubType:"line",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"line"}},t.prototype.highlight=function(e,t,n,i){var r=e.getData(),o=fF(r,i);if(this._changePolyState("emphasis"),o instanceof Array||null==o||!(o>=0))Mf.prototype.highlight.call(this,e,t,n,i);else{var a=r.getLayout("points"),s=r.getItemGraphicEl(o);if(!s){var l=a[2*o],u=a[2*o+1];if(isNaN(l)||isNaN(u)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var c=e.get("zlevel")||0,h=e.get("z")||0;(s=new M2(r,o)).x=l,s.y=u,s.setZ(c,h);var d=s.getSymbolPath().getTextContent();d&&(d.zlevel=c,d.z=h,d.z2=this._polyline.z2+1),s.__temp=!0,r.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}},t.prototype.downplay=function(e,t,n,i){var r=e.getData(),o=fF(r,i);if(this._changePolyState("normal"),null!=o&&o>=0){var a=r.getItemGraphicEl(o);a&&(a.__temp?(r.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else Mf.prototype.downplay.call(this,e,t,n,i)},t.prototype._changePolyState=function(e){var t=this._polygon;xy(this._polyline,e),t&&xy(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new Co({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new Cs({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var i,r,o=t.getBaseAxis(),a=o.inverse;"cartesian2d"===t.type?(i=o.isHorizontal(),r=!1):"polar"===t.type&&(i="angle"===o.dim,r=!0);var s=e.hostModel,l=s.get("animationDuration");pq(l)&&(l=l(null));var u=s.get("animationDelay")||0,c=pq(u)?u(null):u;e.eachItemGraphicEl(function(e,o){if(e){var s=[e.x,e.y],h=void 0,d=void 0,p=void 0;if(n)if(r){var f=t.pointToCoord(s);i?(h=n.startAngle,d=n.endAngle,p=-f[1]/180*Math.PI):(h=n.r0,d=n.r,p=f[0])}else i?(h=n.x,d=n.x+n.width,p=e.x):(h=n.y+n.height,d=n.y,p=e.y);var g=d===h?0:(p-h)/(d-h);a&&(g=1-g);var m=pq(u)?u(o):l*g+c,v=e.getSymbolPath(),y=v.getTextContent();e.attr({scaleX:0,scaleY:0}),e.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:m}),y&&y.animateFrom({style:{opacity:0}},{duration:300,delay:m}),v.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,t,n){var i=e.getModel("endLabel");if(Cf(e)){var r,o,a,s=e.getData(),l=this._polyline,u=s.getLayout("points");if(!u){l.removeTextContent(),this._endLabel=null;return}var c=this._endLabel;c||((c=this._endLabel=new y4({z2:200})).ignoreClip=!0,l.setTextContent(this._endLabel),l.disableLabelAnimation=!0);var h=function(e){for(var t,n,i=e.length/2;i>0&&(t=e[2*i-2],n=e[2*i-1],isNaN(t)||isNaN(n));i--);return i-1}(u);h>=0&&(xJ(l,x0(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:h,defaultText:function(e,t,n){return null!=n?MS(s,n):Mw(s,e)},enableTextSetter:!0},(o=(r=t.getBaseAxis()).isHorizontal(),a=r.inverse,{normal:{align:i.get("align")||(o?a?"right":"left":"center"),verticalAlign:i.get("verticalAlign")||(o?"middle":a?"top":"bottom")}})),l.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,t,n,i,r,o,a){var s=this._endLabel,l=this._polyline;if(s){e<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var u=n.getLayout("points"),c=n.hostModel,h=c.get("connectNulls"),d=o.get("precision"),p=o.get("distance")||0,f=a.getBaseAxis(),g=f.isHorizontal(),m=f.inverse,v=t.shape,y=m?g?v.x:v.y+v.height:g?v.x+v.width:v.y,x=(g?p:0)*(m?-1:1),b=(g?0:-p)*(m?-1:1),w=g?"x":"y",S=function(e,t,n){for(var i,r,o=e.length/2,a=+("x"!==n),s=0,l=-1,u=0;u<o;u++)if(!(isNaN(r=e[2*u+a])||isNaN(e[2*u+1-a]))){if(0===u){i=r;continue}if(i<=t&&r>=t||i>=t&&r<=t){l=u;break}s=u,i=r}return{range:[s,l],t:(t-i)/(r-i)}}(u,y,w),_=S.range,M=_[1]-_[0],C=void 0;if(M>=1){if(M>1&&!h){var A=Cp(u,_[0]);s.attr({x:A[0]+x,y:A[1]+b}),r&&(C=c.getRawValue(_[0]))}else{var A=l.getPointOn(y,w);A&&s.attr({x:A[0]+x,y:A[1]+b});var k=c.getRawValue(_[0]),T=c.getRawValue(_[1]);r&&(C=fq(n,d,k,T,S.t))}i.lastFrameIndex=_[0]}else{var D=1===e||i.lastFrameIndex>0?_[0]:0,A=Cp(u,D);r&&(C=c.getRawValue(D)),s.attr({x:A[0]+x,y:A[1]+b})}if(r){var I=x9(s);"function"==typeof I.setLabelText&&I.setLabelText(C)}}},t.prototype._doUpdateAnimation=function(e,t,n,i,r,o,a){var s=this._polyline,l=this._polygon,u=e.hostModel,c=function(e,t,n,i,r,o){for(var a,s=(a=[],t.diff(e).add(function(e){a.push({cmd:"+",idx:e})}).update(function(e,t){a.push({cmd:"=",idx:t,idx1:e})}).remove(function(e){a.push({cmd:"-",idx:e})}).execute(),a),l=[],u=[],c=[],h=[],d=[],p=[],f=[],g=M9(r,t,o),m=e.getLayout("points")||[],v=t.getLayout("points")||[],y=0;y<s.length;y++){var x=s[y],b=!0,w=void 0,S=void 0;switch(x.cmd){case"=":w=2*x.idx,S=2*x.idx1;var _=m[w],M=m[w+1],C=v[S],A=v[S+1];(isNaN(_)||isNaN(M))&&(_=C,M=A),l.push(_,M),u.push(C,A),c.push(n[w],n[w+1]),h.push(i[S],i[S+1]),f.push(t.getRawIndex(x.idx1));break;case"+":var k=x.idx,T=g.dataDimsForPoint,D=r.dataToPoint([t.get(T[0],k),t.get(T[1],k)]);S=2*k,l.push(D[0],D[1]),u.push(v[S],v[S+1]);var I=M7(g,r,t,k);c.push(I[0],I[1]),h.push(i[S],i[S+1]),f.push(t.getRawIndex(k));break;case"-":b=!1}b&&(d.push(x),p.push(p.length))}p.sort(function(e,t){return f[e]-f[t]});for(var O=l.length,P=gv(O),E=gv(O),R=gv(O),L=gv(O),N=[],y=0;y<p.length;y++){var B=p[y],F=2*y,z=2*B;P[F]=l[z],P[F+1]=l[z+1],E[F]=u[z],E[F+1]=u[z+1],R[F]=c[z],R[F+1]=c[z+1],L[F]=h[z],L[F+1]=h[z+1],N[y]=d[B]}return{current:P,next:E,stackedOnCurrent:R,stackedOnNext:L,status:N}}(this._data,e,this._stackedOnPoints,t,this._coordSys,this._valueOrigin),h=c.current,d=c.stackedOnCurrent,p=c.next,f=c.stackedOnNext;if(r&&(h=Cd(c.current,n,r,a),d=Cd(c.stackedOnCurrent,n,r,a),p=Cd(c.next,n,r,a),f=Cd(c.stackedOnNext,n,r,a)),Cc(h,p)>3e3||l&&Cc(d,f)>3e3){s.stopAnimation(),s.setShape({points:p}),l&&(l.stopAnimation(),l.setShape({points:p,stackedOnPoints:f}));return}s.shape.__points=c.current,s.shape.points=h;var g={shape:{points:p}};c.current!==h&&(g.shape.__points=c.next),s.stopAnimation(),xW(s,g,u),l&&(l.setShape({points:h,stackedOnPoints:d}),l.stopAnimation(),xW(l,{shape:{stackedOnPoints:f}},u),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var m=[],v=c.status,y=0;y<v.length;y++)if("="===v[y].cmd){var x=e.getItemGraphicEl(v[y].idx1);x&&m.push({el:x,ptIdx:y})}s.animators&&s.animators.length&&s.animators[0].during(function(){l&&l.dirtyShape();for(var e=s.shape.__points,t=0;t<m.length;t++){var n=m[t].el,i=2*m[t].ptIdx;n.x=e[i],n.y=e[i+1],n.markRedraw()}})},t.prototype.remove=function(e){var t=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl(function(e,i){e.__temp&&(t.remove(e),n.setItemGraphicEl(i,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},t.type="line",t}(Mf);function Cv(e,t){return{seriesType:e,plan:gf(),reset:function(e){var n=e.getData(),i=e.coordinateSystem,r=e.pipelineContext,o=t||r.large;if(i){var a=pV(i.dimensions,function(e){return n.mapDimension(e)}).slice(0,2),s=a.length,l=n.getCalculationInfo("stackResultDimension");gd(n,a[0])&&(a[0]=l),gd(n,a[1])&&(a[1]=l);var u=n.getStore(),c=n.getDimensionIndex(a[0]),h=n.getDimensionIndex(a[1]);return s&&{progress:function(e,t){for(var n=e.end-e.start,r=o&&gv(n*s),a=[],l=[],d=e.start,p=0;d<e.end;d++){var f=void 0;if(1===s){var g=u.get(c,d);f=i.dataToPoint(g,null,l)}else a[0]=u.get(c,d),a[1]=u.get(h,d),f=i.dataToPoint(a,null,l);o?(r[p++]=f[0],r[p++]=f[1]):t.setItemLayout(d,f.slice())}o&&t.setLayout("points",r)}}}}}}var Cy=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},Cx=function(e){function t(t){var n=e.call(this,t)||this;return n.type="pointer",n}return gO(t,e),t.prototype.getDefaultShape=function(){return new Cy},t.prototype.buildPath=function(e,t){var n=Math.cos,i=Math.sin,r=t.r,o=t.width,a=t.angle,s=t.x-n(a)*o*(o>=r/3?1:2),l=t.y-i(a)*o*(o>=r/3?1:2);a=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+n(a)*o,t.y+i(a)*o),e.lineTo(t.x+n(t.angle)*r,t.y+i(t.angle)*r),e.lineTo(t.x-n(a)*o,t.y-i(a)*o),e.lineTo(s,l)},t}(yO);function Cb(e,t){var n=null==e?"":e+"";return t&&(pY(t)?n=t.replace("{value}",n):pq(t)&&(n=t(e))),n}var Cw=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.render=function(e,t,n){this.group.removeAll();var i,r,o=e.get(["axisLine","lineStyle","color"]),a=(i=e.get("center"),r=Math.min(n.getWidth(),n.getHeight()),{cx:fc(i[0],n.getWidth()),cy:fc(i[1],n.getHeight()),r:fc(e.get("radius"),r/2)});this._renderMain(e,t,n,o,a),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,i,r){var o=this.group,a=e.get("clockwise"),s=-e.get("startAngle")/180*Math.PI,l=-e.get("endAngle")/180*Math.PI,u=e.getModel("axisLine"),c=u.get("roundCap")?Mh:_i,h=u.get("show"),d=u.getModel("lineStyle"),p=d.get("width"),f=[s,l];ym(f,!a),s=f[0];for(var g=(l=f[1])-s,m=s,v=[],y=0;h&&y<i.length;y++){var x=new c({shape:{startAngle:m,endAngle:l=s+g*Math.min(Math.max(i[y][0],0),1),cx:r.cx,cy:r.cy,clockwise:a,r0:r.r-p,r:r.r},silent:!0});x.setStyle({fill:i[y][1]}),x.setStyle(d.getLineStyle(["color","width"])),v.push(x),m=l}v.reverse(),pz(v,function(e){return o.add(e)});var b=function(e){var t;if(e<=0)return i[0][1];for(t=0;t<i.length;t++)if(i[t][0]>=e&&(0===t?0:i[t-1][0])<e)return i[t][1];return i[t-1][1]};this._renderTicks(e,t,n,b,r,s,l,a,p),this._renderTitleAndDetail(e,t,n,b,r),this._renderAnchor(e,r),this._renderPointer(e,t,n,b,r,s,l,a,p)},t.prototype._renderTicks=function(e,t,n,i,r,o,a,s,l){for(var u,c,h=this.group,d=r.cx,p=r.cy,f=r.r,g=+e.get("min"),m=+e.get("max"),v=e.getModel("splitLine"),y=e.getModel("axisTick"),x=e.getModel("axisLabel"),b=e.get("splitNumber"),w=y.get("splitNumber"),S=fc(v.get("length"),f),_=fc(y.get("length"),f),M=o,C=(a-o)/b,A=C/w,k=v.getModel("lineStyle").getLineStyle(),T=y.getModel("lineStyle").getLineStyle(),D=v.get("distance"),I=0;I<=b;I++){if(u=Math.cos(M),c=Math.sin(M),v.get("show")){var O=D?D+l:l,P=new _v({shape:{x1:u*(f-O)+d,y1:c*(f-O)+p,x2:u*(f-S-O)+d,y2:c*(f-S-O)+p},style:k,silent:!0});"auto"===k.stroke&&P.setStyle({stroke:i(I/b)}),h.add(P)}if(x.get("show")){var O=x.get("distance")+D,E=Cb(fh(I/b*(m-g)+g),x.get("formatter")),R=i(I/b),L=u*(f-S-O)+d,N=c*(f-S-O)+p,B=x.get("rotate"),F=0;"radial"===B?(F=-M+2*Math.PI)>Math.PI/2&&(F+=Math.PI):"tangential"===B?F=-M-Math.PI/2:pX(B)&&(F=B*Math.PI/180),0===F?h.add(new y4({style:x1(x,{text:E,x:L,y:N,verticalAlign:c<-.8?"top":c>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:R}),silent:!0})):h.add(new y4({style:x1(x,{text:E,x:L,y:N,verticalAlign:"middle",align:"center"},{inheritColor:R}),silent:!0,originX:L,originY:N,rotation:F}))}if(y.get("show")&&I!==b){var O=y.get("distance");O=O?O+l:l;for(var z=0;z<=w;z++){var V=new _v({shape:{x1:(u=Math.cos(M))*(f-O)+d,y1:(c=Math.sin(M))*(f-O)+p,x2:u*(f-_-O)+d,y2:c*(f-_-O)+p},silent:!0,style:T});"auto"===T.stroke&&V.setStyle({stroke:i((I+z/w)/b)}),h.add(V),M+=A}M-=A}else M+=C}},t.prototype._renderPointer=function(e,t,n,i,r,o,a,s,l){var u=this.group,c=this._data,h=this._progressEls,d=[],p=e.get(["pointer","show"]),f=e.getModel("progress"),g=f.get("show"),m=e.getData(),v=m.mapDimension("value"),y=+e.get("min"),x=+e.get("max"),b=[y,x],w=[o,a];function S(t,n){var i,o=m.getItemModel(t).getModel("pointer"),a=fc(o.get("width"),r.r),s=fc(o.get("length"),r.r),l=e.get(["pointer","icon"]),u=o.get("offsetCenter"),c=fc(u[0],r.r),h=fc(u[1],r.r),d=o.get("keepAspect");return(i=l?MQ(l,c-a/2,h-s,a,s,null,d):new Cx({shape:{angle:-Math.PI/2,width:a,r:s,x:c,y:h}})).rotation=-(n+Math.PI/2),i.x=r.cx,i.y=r.cy,i}function _(e,t){var n=f.get("roundCap")?Mh:_i,i=f.get("overlap"),a=i?f.get("width"):l/m.count(),u=i?r.r-a:r.r-(e+1)*a,c=i?r.r:r.r-e*a,h=new n({shape:{startAngle:o,endAngle:t,cx:r.cx,cy:r.cy,clockwise:s,r0:u,r:c}});return i&&(h.z2=x-m.get(v,e)%x),h}(g||p)&&(m.diff(c).add(function(t){var n=m.get(v,t);if(p){var i=S(t,o);xG(i,{rotation:-((isNaN(+n)?w[0]:fu(n,b,w,!0))+Math.PI/2)},e),u.add(i),m.setItemGraphicEl(t,i)}if(g){var r=_(t,o);xG(r,{shape:{endAngle:fu(n,b,w,f.get("clip"))}},e),u.add(r),y8(e.seriesIndex,m.dataType,t,r),d[t]=r}}).update(function(t,n){var i=m.get(v,t);if(p){var r=c.getItemGraphicEl(n),a=r?r.rotation:o,s=S(t,a);s.rotation=a,xW(s,{rotation:-((isNaN(+i)?w[0]:fu(i,b,w,!0))+Math.PI/2)},e),u.add(s),m.setItemGraphicEl(t,s)}if(g){var l=h[n],y=_(t,l?l.shape.endAngle:o);xW(y,{shape:{endAngle:fu(i,b,w,f.get("clip"))}},e),u.add(y),y8(e.seriesIndex,m.dataType,t,y),d[t]=y}}).execute(),m.each(function(e){var t=m.getItemModel(e),n=t.getModel("emphasis"),r=n.get("focus"),o=n.get("blurScope"),a=n.get("disabled");if(p){var s=m.getItemGraphicEl(e),l=m.getItemVisual(e,"style"),u=l.fill;if(s instanceof yB){var c=s.style;s.useStyle(pR({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(u);s.setStyle(t.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",i(fu(m.get(v,e),b,[0,1],!0))),s.z2EmphasisLift=0,xL(s,t),xP(s,r,o,a)}if(g){var h=d[e];h.useStyle(m.getItemVisual(e,"style")),h.setStyle(t.getModel(["progress","itemStyle"]).getItemStyle()),h.z2EmphasisLift=0,xL(h,t),xP(h,r,o,a)}}),this._progressEls=d)},t.prototype._renderAnchor=function(e,t){var n=e.getModel("anchor");if(n.get("show")){var i=n.get("size"),r=n.get("icon"),o=n.get("offsetCenter"),a=n.get("keepAspect"),s=MQ(r,t.cx-i/2+fc(o[0],t.r),t.cy-i/2+fc(o[1],t.r),i,i,null,a);s.z2=+!!n.get("showAbove"),s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,i,r){var o=this,a=e.getData(),s=a.mapDimension("value"),l=+e.get("min"),u=+e.get("max"),c=new SI,h=[],d=[],p=e.isAnimationEnabled(),f=e.get(["pointer","showAbove"]);a.diff(this._data).add(function(e){h[e]=new y4({silent:!0}),d[e]=new y4({silent:!0})}).update(function(e,t){h[e]=o._titleEls[t],d[e]=o._detailEls[t]}).execute(),a.each(function(t){var n=a.getItemModel(t),o=a.get(s,t),g=new SI,m=i(fu(o,[l,u],[0,1],!0)),v=n.getModel("title");if(v.get("show")){var y=v.get("offsetCenter"),x=r.cx+fc(y[0],r.r),b=r.cy+fc(y[1],r.r),w=h[t];w.attr({z2:2*!f,style:x1(v,{x:x,y:b,text:a.getName(t),align:"center",verticalAlign:"middle"},{inheritColor:m})}),g.add(w)}var S=n.getModel("detail");if(S.get("show")){var _=S.get("offsetCenter"),M=r.cx+fc(_[0],r.r),C=r.cy+fc(_[1],r.r),A=fc(S.get("width"),r.r),k=fc(S.get("height"),r.r),T=e.get(["progress","show"])?a.getItemVisual(t,"style").fill:m,w=d[t],D=S.get("formatter");w.attr({z2:2*!f,style:x1(S,{x:M,y:C,text:Cb(o,D),width:isNaN(A)?null:A,height:isNaN(k)?null:k,align:"center",verticalAlign:"middle"},{inheritColor:T})}),x7(w,{normal:S},o,function(e){return Cb(e,D)}),p&&function(e,t,n,i,r){var o=x9(e);if(o.valueAnimation&&o.prevValue!==o.value){var a=o.defaultInterpolatedText,s=p5(o.interpolatedValue,o.prevValue),l=o.value;e.percent=0,(null==o.prevValue?xG:xW)(e,{percent:1},i,t,null,function(i){var u=fq(n,o.precision,s,l,i);o.interpolatedValue=1===i?null:u,xK(e,xQ({labelDataIndex:t,labelFetcher:r,defaultText:a?a(u):u+""},o.statesModels,u))})}}(w,t,a,e,{getFormattedLabel:function(e,t,n,i,r,a){return Cb(a?a.interpolatedValue:o,D)}}),g.add(w)}c.add(g)}),this.group.add(c),this._titleEls=h,this._detailEls=d},t.type="gauge",t}(Mf);function CS(e,t,n){t=pU(t)&&{coordDimensions:t}||pR({encodeDefine:e.getEncode()},t);var i=e.getSource(),r=new Sx(Sb(i,t).dimensions,e);return r.initData(i,n),r}var C_=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="itemStyle",n}return gO(t,e),t.prototype.getInitialData=function(e,t){return CS(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(St);function CM(e,t,n,i,r){var o=e+t;n.isSilent(o)||i.eachComponent({mainType:"series",subType:"pie"},function(e){for(var t=e.seriesIndex,i=e.option.selectedMap,a=r.selected,s=0;s<a.length;s++)if(a[s].seriesIndex===t){var l=e.getData(),u=fF(l,r.fromActionPayload);n.trigger(o,{type:o,seriesId:e.id,name:pU(u)?l.getName(u[0]):l.getName(u),selected:pY(i)?i:pR({},i)})}})}var CC=2*Math.PI,CA=Math.PI/180;function Ck(e,t){return b9(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function CT(e,t){var n,i,r=Ck(e,t),o=e.get("center"),a=e.get("radius");pU(a)||(a=[0,a]);var s=fc(r.width,t.getWidth()),l=fc(r.height,t.getHeight()),u=Math.min(s,l),c=fc(a[0],u/2),h=fc(a[1],u/2),d=e.coordinateSystem;if(d){var p=d.dataToPoint(o);n=p[0]||0,i=p[1]||0}else pU(o)||(o=[o,o]),n=fc(o[0],s)+r.x,i=fc(o[1],l)+r.y;return{cx:n,cy:i,r0:c,r:h}}function CD(e,t,n){t.eachSeriesByType(e,function(e){var t=e.getData(),i=t.mapDimension("value"),r=Ck(e,n),o=CT(e,n),a=o.cx,s=o.cy,l=o.r,u=o.r0,c=-e.get("startAngle")*CA,h=e.get("endAngle"),d=e.get("padAngle")*CA;h="auto"===h?c-CC:-h*CA;var p=e.get("minAngle")*CA+d,f=0;t.each(i,function(e){!isNaN(e)&&f++});var g=t.getSum(i),m=Math.PI/(g||f)*2,v=e.get("clockwise"),y=e.get("roseType"),x=e.get("stillShowZeroSum"),b=t.getDataExtent(i);b[0]=0;var w=v?1:-1,S=[c,h],_=w*d/2;ym(S,!v),c=S[0];var M=Math.abs((h=S[1])-c),C=M,A=0,k=c;if(t.setLayout({viewRect:r,r:l}),t.each(i,function(e,n){if(isNaN(e))return void t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:a,cy:s,r0:u,r:y?NaN:l});(i="area"!==y?0===g&&x?m:e*m:M/f)<p?(i=p,C-=p):A+=e;var i,r=k+w*i,o=0,c=0;d>i?c=o=k+w*i/2:(o=k+_,c=r-_),t.setItemLayout(n,{angle:i,startAngle:o,endAngle:c,clockwise:v,cx:a,cy:s,r0:u,r:y?fu(e,b,[u,l]):l}),k=r}),C<CC&&f)if(C<=.001){var T=M/f;t.each(i,function(e,n){if(!isNaN(e)){var i=t.getItemLayout(n);i.angle=T;var r=0,o=0;T<d?o=r=c+w*(n+.5)*T:(r=c+w*n*T+_,o=c+w*(n+1)*T-_),i.startAngle=r,i.endAngle=o}})}else m=C/A,k=c,t.each(i,function(e,n){if(!isNaN(e)){var i=t.getItemLayout(n),r=i.angle===p?p:e*m,o=0,a=0;r<d?a=o=k+w*r/2:(o=k+_,a=k+w*r-_),i.startAngle=o,i.endAngle=a,k+=w*r}})})}function CI(e,t,n,i,r,o,a,s){var l=n-e,u=i-t,c=Math.sqrt(l*l+u*u),h=((r-e)*(l/=c)+(o-t)*(u/=c))/c;s&&(h=Math.min(Math.max(h,0),1)),h*=c;var d=a[0]=e+h*l,p=a[1]=t+h*u;return Math.sqrt((d-r)*(d-r)+(p-o)*(p-o))}yv.CMD;var CO=new g4,CP=new g4,CE=new g4,CR=new g4,CL=new g4,CN=[],CB=new g4;function CF(e,t,n,i){var r="normal"===n,o=r?e:e.ensureState(n);o.ignore=t;var a=i.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=i.getModel("lineStyle").getLineStyle();r?e.useStyle(s):o.style=s}function Cz(e,t){var n=t.smooth,i=t.points;if(i)if(e.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var r=mT(i[0],i[1]),o=mT(i[1],i[2]);if(!r||!o){e.lineTo(i[1][0],i[1][1]),e.lineTo(i[2][0],i[2][1]);return}var a=Math.min(r,o)*n,s=mI([],i[1],i[0],a/r),l=mI([],i[1],i[2],a/o),u=mI([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var c=1;c<i.length;c++)e.lineTo(i[c][0],i[c][1])}var CV=Math.PI/180;function Cj(e,t,n,i,r,o,a,s,l,u){if(!(e.length<2)){for(var c=e.length,h=0;h<c;h++)if("outer"===e[h].position&&"labelLine"===e[h].labelAlignTo){var d=e[h].label.x-u;e[h].linePoints[1][0]+=d,e[h].label.x=u}(function(e,t,n,i,r){var o,a,s,l=e.length;if(!(l<2)){e.sort(function(e,t){return e.rect.y-t.rect.y});for(var u=0,c=!1,h=[],d=0,p=0;p<l;p++){var f=e[p],g=f.rect;(o=g.y-u)<0&&(g.y-=o,f.label.y-=o,c=!0);var m=Math.max(-o,0);h.push(m),d+=m,u=g.y+g[t]}d>0&&r&&w(-d/l,0,l);var v=e[0],y=e[l-1];return x(),a<0&&S(-a,.8),s<0&&S(s,.8),x(),b(a,s,1),b(s,a,-1),x(),a<0&&_(-a),s<0&&_(s),c}function x(){a=v.rect.y-n,s=i-y.rect.y-y.rect[t]}function b(e,t,n){if(e<0){var i=Math.min(t,-e);if(i>0){w(i*n,0,l);var r=i+e;r<0&&S(-r*n,1)}else S(-e*n,1)}}function w(t,n,i){0!==t&&(c=!0);for(var r=n;r<i;r++){var o=e[r],a=o.rect;a.y+=t,o.label.y+=t}}function S(n,i){for(var r=[],o=0,a=1;a<l;a++){var s=e[a-1].rect,u=Math.max(e[a].rect.y-s.y-s[t],0);r.push(u),o+=u}if(o){var c=Math.min(Math.abs(n)/o,i);if(n>0)for(var a=0;a<l-1;a++){var h=r[a]*c;w(h,0,a+1)}else for(var a=l-1;a>0;a--){var h=r[a-1]*c;w(-h,a,l)}}}function _(e){for(var t=e<0?-1:1,n=Math.ceil((e=Math.abs(e))/(l-1)),i=0;i<l-1;i++)if(t>0?w(n,0,i+1):w(-n,l-i-1,l),(e-=n)<=0)return}})(e,"height",l,l+a,void 0)&&function(e){for(var o={list:[],maxY:0},a={list:[],maxY:0},s=0;s<e.length;s++)if("none"===e[s].labelAlignTo){var l=e[s],u=l.label.y>n?a:o,c=Math.abs(l.label.y-n);if(c>=u.maxY){var h=l.label.x-t-l.len2*r,d=i+l.len;u.rB=Math.abs(h)<d?Math.sqrt(c*c/(1-h*h/d/d)):d,u.maxY=c}u.list.push(l)}p(o),p(a)}(e)}function p(e){for(var o=e.rB,a=o*o,s=0;s<e.list.length;s++){var l=e.list[s],u=Math.abs(l.label.y-n),c=i+l.len,h=t+(Math.sqrt(c*c*(1-Math.abs(u*u/a)))+l.len2)*r,d=h-l.label.x,p=l.targetTextWidth-d*r;CH(l,p,!0),l.label.x=h}}}function CH(e,t,n){if(void 0===n&&(n=!1),null==e.labelStyleWidth){var i=e.label,r=i.style,o=e.rect,a=r.backgroundColor,s=r.padding,l=s?s[1]+s[3]:0,u=r.overflow,c=o.width+(a?0:l);if(t<c||n){var h=o.height;if(u&&u.match("break")){i.setStyle("backgroundColor",null),i.setStyle("width",t-l);var d=i.getBoundingRect();i.setStyle("width",Math.ceil(d.width)),i.setStyle("backgroundColor",a)}else{var p=t-l,f=t<c?p:n?p>e.unconstrainedWidth?null:p:null;i.setStyle("width",f)}var g=i.getBoundingRect();o.width=g.width;var m=(i.style.margin||0)+2.1;o.height=g.height+m,o.y-=(o.height-h)/2}}}function CW(e){return"center"===e.position}var CG=function(e){function t(t,n,i){var r=e.call(this)||this;r.z2=2;var o=new y4;return r.setTextContent(o),r.updateData(t,n,i,!0),r}return gO(t,e),t.prototype.updateData=function(e,t,n,i){var r=e.hostModel,o=e.getItemModel(t),a=o.getModel("emphasis"),s=e.getItemLayout(t),l=pR(MC(o.getModel("itemStyle"),s,!0),s);if(isNaN(l.startAngle))return void this.setShape(l);if(i){this.setShape(l);var u=r.getShallow("animationType");r.ecModel.ssr?(xG(this,{scaleX:0,scaleY:0},r,{dataIndex:t,isFrom:!0}),this.originX=l.cx,this.originY=l.cy):"scale"===u?(this.shape.r=s.r0,xG(this,{shape:{r:s.r}},r,t)):null!=n?(this.setShape({startAngle:n,endAngle:n}),xG(this,{shape:{startAngle:s.startAngle,endAngle:s.endAngle}},r,t)):(this.shape.endAngle=s.startAngle,xW(this,{shape:{endAngle:s.endAngle}},r,t))}else xZ(this),xW(this,{shape:l},r,t);this.useStyle(e.getItemVisual(t,"style")),xL(this,o);var c=(s.startAngle+s.endAngle)/2,h=r.get("selectedOffset"),d=Math.cos(c)*h,p=Math.sin(c)*h,f=o.getShallow("cursor");f&&this.attr("cursor",f),this._updateLabel(r,e,t),this.ensureState("emphasis").shape=pR({r:s.r+(a.get("scale")&&a.get("scaleSize")||0)},MC(a.getModel("itemStyle"),s)),pR(this.ensureState("select"),{x:d,y:p,shape:MC(o.getModel(["select","itemStyle"]),s)}),pR(this.ensureState("blur"),{shape:MC(o.getModel(["blur","itemStyle"]),s)});var g=this.getTextGuideLine(),m=this.getTextContent();g&&pR(g.ensureState("select"),{x:d,y:p}),pR(m.ensureState("select"),{x:d,y:p}),xP(this,a.get("focus"),a.get("blurScope"),a.get("disabled"))},t.prototype._updateLabel=function(e,t,n){var i=t.getItemModel(n),r=i.getModel("labelLine"),o=t.getItemVisual(n,"style"),a=o&&o.fill,s=o&&o.opacity;xJ(this,x0(i),{labelFetcher:t.hostModel,labelDataIndex:n,inheritColor:a,defaultOpacity:s,defaultText:e.getFormattedLabel(n,"normal")||t.getName(n)});var l=this.getTextContent();this.setTextConfig({position:null,rotation:null}),l.attr({z2:10});var u=e.get(["label","position"]);if("outside"!==u&&"outer"!==u)this.removeTextGuideLine();else{var c=this.getTextGuideLine();c||(c=new _p,this.setTextGuideLine(c)),function(e,t,n){var i=e.getTextGuideLine(),r=e.getTextContent();if(!r){i&&e.removeTextGuideLine();return}for(var o=t.normal,a=o.get("show"),s=r.ignore,l=0;l<xi.length;l++){var u=xi[l],c=t[u],h="normal"===u;if(c){var d=c.get("show");if((h?s:p5(r.states[u]&&r.states[u].ignore,s))||!p5(d,a)){var p=h?i:i&&i.states[u];p&&(p.ignore=!0),i&&CF(i,!0,u,c);continue}!i&&(i=new _p,e.setTextGuideLine(i),h||!s&&a||CF(i,!0,"normal",t.normal),e.stateProxy&&(i.stateProxy=e.stateProxy)),CF(i,!1,u,c)}}if(i){pL(i.style,n),i.style.fill=null;var f=o.get("showAbove");(e.textGuideLineConfig=e.textGuideLineConfig||{}).showAbove=f||!1,i.buildPath=Cz}}(this,function(e,t){t=t||"labelLine";for(var n={normal:e.getModel(t)},i=0;i<xn.length;i++){var r=xn[i];n[r]=e.getModel([r,t])}return n}(i),{stroke:a,opacity:p3(r.get(["lineStyle","opacity"]),s,1)})}},t}(_i),C$=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return gO(t,e),t.prototype.render=function(e,t,n,i){var r,o=e.getData(),a=this._data,s=this.group;if(!a&&o.count()>0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u<o.count();++u)l=o.getItemLayout(u);l&&(r=l.startAngle)}if(this._emptyCircleSector&&s.remove(this._emptyCircleSector),0===o.count()&&e.get("showEmptyCircle")){var c=new _i({shape:CT(e,n)});c.useStyle(e.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=c,s.add(c)}o.diff(a).add(function(e){var t=new CG(o,e,r);o.setItemGraphicEl(e,t),s.add(t)}).update(function(e,t){var n=a.getItemGraphicEl(t);n.updateData(o,e,r),n.off("click"),s.add(n),o.setItemGraphicEl(e,n)}).remove(function(t){xY(a.getItemGraphicEl(t),e,t)}).execute(),function(e){var t,n,i=e.getData(),r=[],o=!1,a=(e.get("minShowLabelAngle")||0)*CV,s=i.getLayout("viewRect"),l=i.getLayout("r"),u=s.width,c=s.x,h=s.y,d=s.height;function p(e){e.ignore=!0}i.each(function(e){var s,h,d,f,g=i.getItemGraphicEl(e),m=g.shape,v=g.getTextContent(),y=g.getTextGuideLine(),x=i.getItemModel(e),b=x.getModel("label"),w=b.get("position")||x.get(["emphasis","label","position"]),S=b.get("distanceToLabelLine"),_=b.get("alignTo"),M=fc(b.get("edgeDistance"),u),C=b.get("bleedMargin"),A=x.getModel("labelLine"),k=A.get("length");k=fc(k,u);var T=A.get("length2");if(T=fc(T,u),Math.abs(m.endAngle-m.startAngle)<a){pz(v.states,p),v.ignore=!0,y&&(pz(y.states,p),y.ignore=!0);return}if(function(e){if(!e.ignore)return!0;for(var t in e.states)if(!1===e.states[t].ignore)return!0;return!1}(v)){var D=(m.startAngle+m.endAngle)/2,I=Math.cos(D),O=Math.sin(D);t=m.cx,n=m.cy;var P="inside"===w||"inner"===w;if("center"===w)s=m.cx,h=m.cy,f="center";else{var E=(P?(m.r+m.r0)/2*I:m.r*I)+t,R=(P?(m.r+m.r0)/2*O:m.r*O)+n;if(s=E+3*I,h=R+3*O,!P){var L=E+I*(k+l-m.r),N=R+O*(k+l-m.r),B=L+(I<0?-1:1)*T;s="edge"===_?I<0?c+M:c+u-M:B+(I<0?-S:S),h=N,d=[[E,R],[L,N],[B,N]]}f=P?"center":"edge"===_?I>0?"right":"left":I>0?"left":"right"}var F=Math.PI,z=0,V=b.get("rotate");if(pX(V))z=F/180*V;else if("center"===w)z=0;else if("radial"===V||!0===V)z=I<0?-D+F:-D;else if("tangential"===V&&"outside"!==w&&"outer"!==w){var j=Math.atan2(I,O);j<0&&(j=2*F+j),O>0&&(j=F+j),z=j-F}if(o=!!z,v.x=s,v.y=h,v.rotation=z,v.setStyle({verticalAlign:"middle"}),P){v.setStyle({align:f});var H=v.states.select;H&&(H.x+=v.x,H.y+=v.y)}else{var W=v.getBoundingRect().clone();W.applyTransform(v.getComputedTransform());var G=(v.style.margin||0)+2.1;W.y-=G/2,W.height+=G,r.push({label:v,labelLine:y,position:w,len:k,len2:T,minTurnAngle:A.get("minTurnAngle"),maxSurfaceAngle:A.get("maxSurfaceAngle"),surfaceNormal:new g4(I,O),linePoints:d,textAlign:f,labelDistance:S,labelAlignTo:_,edgeDistance:M,bleedMargin:C,rect:W,unconstrainedWidth:W.width,labelStyleWidth:v.style.width})}g.setTextConfig({inside:P})}}),!o&&e.get("avoidLabelOverlap")&&function(e,t,n,i,r,o,a,s){for(var l=[],u=[],c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0;d<e.length;d++){var p=e[d].label;CW(e[d])||(p.x<t?(c=Math.min(c,p.x),l.push(e[d])):(h=Math.max(h,p.x),u.push(e[d])))}for(var d=0;d<e.length;d++){var f=e[d];if(!CW(f)&&f.linePoints){if(null!=f.labelStyleWidth)continue;var p=f.label,g=f.linePoints,m=void 0;m="edge"===f.labelAlignTo?p.x<t?g[2][0]-f.labelDistance-a-f.edgeDistance:a+r-f.edgeDistance-g[2][0]-f.labelDistance:"labelLine"===f.labelAlignTo?p.x<t?c-a-f.bleedMargin:a+r-h-f.bleedMargin:p.x<t?p.x-a-f.bleedMargin:a+r-p.x-f.bleedMargin,f.targetTextWidth=m,CH(f,m)}}Cj(u,t,n,i,1,r,o,a,s,h),Cj(l,t,n,i,-1,r,o,a,s,c);for(var d=0;d<e.length;d++){var f=e[d];if(!CW(f)&&f.linePoints){var p=f.label,g=f.linePoints,v="edge"===f.labelAlignTo,y=p.style.padding,x=y?y[1]+y[3]:0,b=p.style.backgroundColor?0:x,w=f.rect.width+b,S=g[1][0]-g[2][0];v?p.x<t?g[2][0]=a+f.edgeDistance+w+f.labelDistance:g[2][0]=a+r-f.edgeDistance-w-f.labelDistance:(p.x<t?g[2][0]=p.x+f.labelDistance:g[2][0]=p.x-f.labelDistance,g[1][0]=g[2][0]+S),g[1][1]=g[2][1]=p.y}}}(r,t,n,l,u,d,c,h);for(var f=0;f<r.length;f++){var g=r[f],m=g.label,v=g.labelLine,y=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:g.textAlign}),y&&(pz(m.states,p),m.ignore=!0);var x=m.states.select;x&&(x.x+=m.x,x.y+=m.y)}if(v){var b=g.linePoints;y||!b?(pz(v.states,p),v.ignore=!0):(!function(e,t){if(t<=180&&t>0){t=t/180*Math.PI,CO.fromArray(e[0]),CP.fromArray(e[1]),CE.fromArray(e[2]),g4.sub(CR,CO,CP),g4.sub(CL,CE,CP);var n=CR.len(),i=CL.len();if(!(n<.001)&&!(i<.001)&&(CR.scale(1/n),CL.scale(1/i),Math.cos(t)<CR.dot(CL))){var r=CI(CP.x,CP.y,CE.x,CE.y,CO.x,CO.y,CN,!1);CB.fromArray(CN),CB.scaleAndAdd(CL,r/Math.tan(Math.PI-t));var o=CE.x!==CP.x?(CB.x-CP.x)/(CE.x-CP.x):(CB.y-CP.y)/(CE.y-CP.y);if(isNaN(o))return;o<0?g4.copy(CB,CP):o>1&&g4.copy(CB,CE),CB.toArray(e[1])}}}(b,g.minTurnAngle),function(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,CO.fromArray(e[0]),CP.fromArray(e[1]),CE.fromArray(e[2]),g4.sub(CR,CP,CO),g4.sub(CL,CE,CP);var i=CR.len(),r=CL.len();if(!(i<.001)&&!(r<.001)&&(CR.scale(1/i),CL.scale(1/r),CR.dot(t)<Math.cos(n))){var o=CI(CP.x,CP.y,CE.x,CE.y,CO.x,CO.y,CN,!1);CB.fromArray(CN);var a=Math.PI/2,s=a+Math.acos(CL.dot(t))-n;if(s>=a)g4.copy(CB,CE);else{CB.scaleAndAdd(CL,o/Math.tan(Math.PI/2-s));var l=CE.x!==CP.x?(CB.x-CP.x)/(CE.x-CP.x):(CB.y-CP.y)/(CE.y-CP.y);if(isNaN(l))return;l<0?g4.copy(CB,CP):l>1&&g4.copy(CB,CE)}CB.toArray(e[1])}}}(b,g.surfaceNormal,g.maxSurfaceAngle),v.setShape({points:b}),m.__hostTarget.textGuideLineConfig={anchor:new g4(b[0][0],b[0][1])})}}}(e),"expansion"!==e.get("animationTypeUpdate")&&(this._data=o)},t.prototype.dispose=function(){},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var i=e[0]-n.cx,r=e[1]-n.cy,o=Math.sqrt(i*i+r*r);return o<=n.r&&o>=n.r0}},t.type="pie",t}(Mf),CU=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),Cq=fz(),CY=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new CU(pG(this.getData,this),pG(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return CS(this,{coordDimensions:["value"],encodeDefaulter:p$(f3,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),i=Cq(n),r=i.seats;if(!r){var o=[];n.each(n.mapDimension("value"),function(e){o.push(e)}),r=i.seats=function(e,t){var n=pj(e,function(e,t){return e+(isNaN(t)?0:t)},0);if(0===n)return[];for(var i=Math.pow(10,t),r=pV(e,function(e){return(isNaN(e)?0:e)/n*i*100}),o=100*i,a=pV(r,function(e){return Math.floor(e)}),s=pj(a,function(e,t){return e+t},0),l=pV(r,function(e,t){return e-a[t]});s<o;){for(var u=-1/0,c=null,h=0,d=l.length;h<d;++h)l[h]>u&&(u=l[h],c=h);++a[c],l[c]=0,++s}return pV(a,function(e){return e/i})}(o,n.hostModel.get("percentPrecision"))}var a=e.prototype.getDataParams.call(this,t);return a.percent=r[t]||0,a.$vars.push("percent"),a},t.prototype._defaultLabelLine=function(e){fI(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(St),CZ=function(e,t){this.target=e,this.topTarget=t&&t.topTarget},CX=function(){function e(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return e.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new CZ(t,e),"dragstart",e.event))},e.prototype._drag=function(e){var t=this._draggingTarget;if(t){var n=e.offsetX,i=e.offsetY,r=n-this._x,o=i-this._y;this._x=n,this._y=i,t.drift(r,o,e),this.handler.dispatchToElement(new CZ(t,e),"drag",e.event);var a=this.handler.findHover(n,i,t).target,s=this._dropTarget;this._dropTarget=a,t!==a&&(s&&a!==s&&this.handler.dispatchToElement(new CZ(s,e),"dragleave",e.event),a&&a!==s&&this.handler.dispatchToElement(new CZ(a,e),"dragenter",e.event))}},e.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new CZ(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new CZ(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},e}(),CK=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,CQ=[],CJ=fA.browser.firefox&&39>+fA.browser.version.split(".")[0];function C0(e,t,n,i){return n=n||{},i?C1(e,t,n):CJ&&null!=t.layerX&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):null!=t.offsetX?(n.zrX=t.offsetX,n.zrY=t.offsetY):C1(e,t,n),n}function C1(e,t,n){if(fA.domSupported&&e.getBoundingClientRect){var i=t.clientX,r=t.clientY;if(bb(e)){var o=e.getBoundingClientRect();n.zrX=i-o.left,n.zrY=r-o.top;return}if(bx(CQ,e,i,r)){n.zrX=CQ[0],n.zrY=CQ[1];return}}n.zrX=n.zrY=0}function C2(e){return e||window.event}function C5(e,t,n){if(null!=(t=C2(t)).zrX)return t;var i=t.type;if(i&&i.indexOf("touch")>=0){var r="touchend"!==i?t.targetTouches[0]:t.changedTouches[0];r&&C0(e,r,t,n)}else{C0(e,t,t,n);var o=function(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,i=e.deltaY;return null==n||null==i?t:3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}(t);t.zrDelta=o?o/120:-(t.detail||0)/3}var a=t.button;return null==t.which&&void 0!==a&&CK.test(t.type)&&(t.which=1&a?1:2&a?3:4&a?2:0),t}function C3(e,t,n,i){e.addEventListener(t,n,i)}var C4=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function C6(e){return 2===e.which||3===e.which}var C8=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var i=e.touches;if(i){for(var r={points:[],touches:[],target:t,event:e},o=0,a=i.length;o<a;o++){var s=i[o],l=C0(n,s,{});r.points.push([l.zrX,l.zrY]),r.touches.push(s)}this._track.push(r)}},e.prototype._recognize=function(e){for(var t in C7)if(C7.hasOwnProperty(t)){var n=C7[t](this._track,e);if(n)return n}},e}();function C9(e){var t=e[1][0]-e[0][0],n=e[1][1]-e[0][1];return Math.sqrt(t*t+n*n)}var C7={pinch:function(e,t){var n=e.length;if(n){var i=(e[n-1]||{}).points,r=(e[n-2]||{}).points||i;if(r&&r.length>1&&i&&i.length>1){var o=C9(i)/C9(r);isFinite(o)||(o=1),t.pinchScale=o;var a=[(i[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return t.pinchX=a[0],t.pinchY=a[1],{type:"pinch",target:e[0].target,event:t}}}}},Ae="silent";function At(){C4(this.event)}var An=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handler=null,t}return g$(t,e),t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(vO),Ai=function(e,t){this.x=e,this.y=t},Ar=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Ao=new mr(0,0,0,0),Aa=function(e){function t(t,n,i,r,o){var a=e.call(this)||this;return a._hovered=new Ai(0,0),a.storage=t,a.painter=n,a.painterRoot=r,a._pointerSize=o,i=i||new An,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new CX(a),a}return g$(t,e),t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(pz(Ar,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,i=Al(this,t,n),r=this._hovered,o=r.target;o&&!o.__zr&&(o=(r=this.findHover(r.x,r.y)).target);var a=this._hovered=i?new Ai(t,n):this.findHover(t,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(r,"mouseout",e),this.dispatchToElement(a,"mousemove",e),s&&s!==o&&this.dispatchToElement(a,"mouseover",e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new Ai(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){var i=(e=e||{}).target;if(!i||!i.silent){for(var r,o="on"+t,a={type:t,event:n,target:(r=e).target,topTarget:r.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:At};i&&(i[o]&&(a.cancelBubble=!!i[o].call(i,a)),i.trigger(t,a),i=i.__hostTarget?i.__hostTarget:i.parent,!a.cancelBubble););!a.cancelBubble&&(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(e){"function"==typeof e[o]&&e[o].call(e,a),e.trigger&&e.trigger(t,a)}))}},t.prototype.findHover=function(e,t,n){var i=this.storage.getDisplayList(),r=new Ai(e,t);if(As(i,r,e,t,n),this._pointerSize&&!r.target){for(var o=[],a=this._pointerSize,s=a/2,l=new mr(e-s,t-s,a,a),u=i.length-1;u>=0;u--){var c=i[u];c===n||c.ignore||c.ignoreCoarsePointer||c.parent&&c.parent.ignoreCoarsePointer||(Ao.copy(c.getBoundingRect()),c.transform&&Ao.applyTransform(c.transform),Ao.intersect(l)&&o.push(c))}if(o.length){for(var h=Math.PI/12,d=2*Math.PI,p=0;p<s;p+=4)for(var f=0;f<d;f+=h)if(As(o,r,e+p*Math.cos(f),t+p*Math.sin(f),n),r.target)return r}}return r},t.prototype.processGesture=function(e,t){this._gestureMgr||(this._gestureMgr=new C8);var n=this._gestureMgr;"start"===t&&n.clear();var i=n.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&n.clear(),i){var r=i.type;e.gestureEvent=r;var o=new Ai;o.target=i.target,this.dispatchToElement(o,r,i.event)}},t}(vO);function As(e,t,n,i,r){for(var o=e.length-1;o>=0;o--){var a=e[o],s=void 0;if(a!==r&&!a.ignore&&(s=function(e,t,n){if(e[e.rectHover?"rectContain":"contain"](t,n)){for(var i=e,r=void 0,o=!1;i;){if(i.ignoreClip&&(o=!0),!o){var a=i.getClipPath();if(a&&!a.contain(t,n))return!1}i.silent&&(r=!0),i=i.__hostTarget||i.parent}return!r||Ae}return!1}(a,n,i))&&(t.topTarget||(t.topTarget=a),s!==Ae)){t.target=a;break}}}function Al(e,t,n){var i=e.painter;return t<0||t>i.getWidth()||n<0||n>i.getHeight()}function Au(e,t,n,i){var r=t+1;if(r===n)return 1;if(0>i(e[r++],e[t])){for(;r<n&&0>i(e[r],e[r-1]);)r++;var o=e,a=t,s=r;for(s--;a<s;){var l=o[a];o[a++]=o[s],o[s--]=l}}else for(;r<n&&i(e[r],e[r-1])>=0;)r++;return r-t}function Ac(e,t,n,i,r){for(i===t&&i++;i<n;i++){for(var o,a=e[i],s=t,l=i;s<l;)0>r(a,e[o=s+l>>>1])?l=o:s=o+1;var u=i-s;switch(u){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;u>0;)e[s+u]=e[s+u-1],u--}e[s]=a}}function Ah(e,t,n,i,r,o){var a=0,s=0,l=1;if(o(e,t[n+r])>0){for(s=i-r;l<s&&o(e,t[n+r+l])>0;)a=l,(l=(l<<1)+1)<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}else{for(s=r+1;l<s&&0>=o(e,t[n+r-l]);)a=l,(l=(l<<1)+1)<=0&&(l=s);l>s&&(l=s);var u=a;a=r-l,l=r-u}for(a++;a<l;){var c=a+(l-a>>>1);o(e,t[n+c])>0?a=c+1:l=c}return l}function Ad(e,t,n,i,r,o){var a=0,s=0,l=1;if(0>o(e,t[n+r])){for(s=r+1;l<s&&0>o(e,t[n+r-l]);)a=l,(l=(l<<1)+1)<=0&&(l=s);l>s&&(l=s);var u=a;a=r-l,l=r-u}else{for(s=i-r;l<s&&o(e,t[n+r+l])>=0;)a=l,(l=(l<<1)+1)<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}for(a++;a<l;){var c=a+(l-a>>>1);0>o(e,t[n+c])?l=c:a=c+1}return l}function Ap(e,t,n,i){n||(n=0),i||(i=e.length);var r=i-n;if(!(r<2)){var o=0;if(r<32){o=Au(e,n,i,t),Ac(e,n,i,n+o,t);return}var a=function(e,t){var n,i,r=7,o=0,a=[];function s(s){var l=n[s],u=i[s],c=n[s+1],h=i[s+1];i[s]=u+h,s===o-3&&(n[s+1]=n[s+2],i[s+1]=i[s+2]),o--;var d=Ad(e[c],e,l,u,0,t);l+=d,0==(u-=d)||0!==(h=Ah(e[l+u-1],e,c,h,h-1,t))&&(u<=h?function(n,i,o,s){var l,u,c,h=0;for(h=0;h<i;h++)a[h]=e[n+h];var d=0,p=o,f=n;if(e[f++]=e[p++],0==--s){for(h=0;h<i;h++)e[f+h]=a[d+h];return}if(1===i){for(h=0;h<s;h++)e[f+h]=e[p+h];e[f+s]=a[d];return}for(var g=r;;){l=0,u=0,c=!1;do if(0>t(e[p],a[d])){if(e[f++]=e[p++],u++,l=0,0==--s){c=!0;break}}else if(e[f++]=a[d++],l++,u=0,1==--i){c=!0;break}while((l|u)<g);if(c)break;do{if(0!==(l=Ad(e[p],a,d,i,0,t))){for(h=0;h<l;h++)e[f+h]=a[d+h];if(f+=l,d+=l,(i-=l)<=1){c=!0;break}}if(e[f++]=e[p++],0==--s){c=!0;break}if(0!==(u=Ah(a[d],e,p,s,0,t))){for(h=0;h<u;h++)e[f+h]=e[p+h];if(f+=u,p+=u,0==(s-=u)){c=!0;break}}if(e[f++]=a[d++],1==--i){c=!0;break}g--}while(l>=7||u>=7);if(c)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(h=0;h<s;h++)e[f+h]=e[p+h];e[f+s]=a[d]}else if(0===i)throw Error();else for(h=0;h<i;h++)e[f+h]=a[d+h]}(l,u,c,h):function(n,i,o,s){var l=0;for(l=0;l<s;l++)a[l]=e[o+l];var u=n+i-1,c=s-1,h=o+s-1,d=0,p=0;if(e[h--]=e[u--],0==--i){for(l=0,d=h-(s-1);l<s;l++)e[d+l]=a[l];return}if(1===s){for(h-=i,u-=i,p=h+1,d=u+1,l=i-1;l>=0;l--)e[p+l]=e[d+l];e[h]=a[c];return}for(var f=r;;){var g=0,m=0,v=!1;do if(0>t(a[c],e[u])){if(e[h--]=e[u--],g++,m=0,0==--i){v=!0;break}}else if(e[h--]=a[c--],m++,g=0,1==--s){v=!0;break}while((g|m)<f);if(v)break;do{if(0!=(g=i-Ad(a[c],e,n,i,i-1,t))){for(h-=g,u-=g,i-=g,p=h+1,d=u+1,l=g-1;l>=0;l--)e[p+l]=e[d+l];if(0===i){v=!0;break}}if(e[h--]=a[c--],1==--s){v=!0;break}if(0!=(m=s-Ah(e[u],a,0,s,s-1,t))){for(h-=m,c-=m,s-=m,p=h+1,d=c+1,l=0;l<m;l++)e[p+l]=a[d+l];if(s<=1){v=!0;break}}if(e[h--]=e[u--],0==--i){v=!0;break}f--}while(g>=7||m>=7);if(v)break;f<0&&(f=0),f+=2}if((r=f)<1&&(r=1),1===s){for(h-=i,u-=i,p=h+1,d=u+1,l=i-1;l>=0;l--)e[p+l]=e[d+l];e[h]=a[c]}else if(0===s)throw Error();else for(l=0,d=h-(s-1);l<s;l++)e[d+l]=a[l]}(l,u,c,h))}return n=[],i=[],{mergeRuns:function(){for(;o>1;){var e=o-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]<i[e+1]&&e--;else if(i[e]>i[e+1])break;s(e)}},forceMergeRuns:function(){for(;o>1;){var e=o-2;e>0&&i[e-1]<i[e+1]&&e--,s(e)}},pushRun:function(e,t){n[o]=e,i[o]=t,o+=1}}}(e,t),s=function(e){for(var t=0;e>=32;)t|=1&e,e>>=1;return e+t}(r);do{if((o=Au(e,n,i,t))<s){var l=r;l>s&&(l=s),Ac(e,n,n+l,n+o,t),o=l}a.pushRun(n,o),a.mergeRuns(),r-=o,n+=o}while(0!==r);a.forceMergeRuns()}}pz(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(e){Aa.prototype[e]=function(t){var n,i,r=t.zrX,o=t.zrY,a=Al(this,r,o);if("mouseup"===e&&a||(i=(n=this.findHover(r,o)).target),"mousedown"===e)this._downEl=i,this._downPoint=[t.zrX,t.zrY],this._upEl=i;else if("mouseup"===e)this._upEl=i;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||mT(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,e,t)}});var Af=!1;function Ag(){Af||(Af=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Am(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Av=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Am}return e.prototype.traverse=function(e,t){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(e,t)},e.prototype.getDisplayList=function(e,t){t=t||!1;var n=this._displayList;return(e||!n.length)&&this.updateDisplayList(t),n},e.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var t=this._roots,n=this._displayList,i=0,r=t.length;i<r;i++)this._updateAndAddDisplayable(t[i],null,e);n.length=this._displayListLen,Ap(n,Am)},e.prototype._updateAndAddDisplayable=function(e,t,n){if(!e.ignore||n){e.beforeUpdate(),e.update(),e.afterUpdate();var i=e.getClipPath();if(e.ignoreClip)t=null;else if(i){t=t?t.slice():[];for(var r=i,o=e;r;)r.parent=o,r.updateTransform(),t.push(r),o=r,r=r.getClipPath()}if(e.childrenRef){for(var a=e.childrenRef(),s=0;s<a.length;s++){var l=a[s];e.__dirty&&(l.__dirty|=1),this._updateAndAddDisplayable(l,t,n)}e.__dirty=0}else t&&t.length?e.__clipPaths=t:e.__clipPaths&&e.__clipPaths.length>0&&(e.__clipPaths=[]),isNaN(e.z)&&(Ag(),e.z=0),isNaN(e.z2)&&(Ag(),e.z2=0),isNaN(e.zlevel)&&(Ag(),e.zlevel=0),this._displayList[this._displayListLen++]=e;var u=e.getDecalElement&&e.getDecalElement();u&&this._updateAndAddDisplayable(u,t,n);var c=e.getTextGuideLine();c&&this._updateAndAddDisplayable(c,t,n);var h=e.getTextContent();h&&this._updateAndAddDisplayable(h,t,n)}},e.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},e.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,n=e.length;t<n;t++)this.delRoot(e[t]);return}var i=pN(this._roots,e);i>=0&&this._roots.splice(i,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}();function Ay(){return new Date().getTime()}Y=fA.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var Ax=function(e){function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,n.stage=(t=t||{}).stage||{},n}return g$(t,e),t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=Ay()-this._pausedTime,n=t-this._time,i=this._head;i;){var r=i.next;i.step(t,n)&&(i.ondestroy(),this.removeClip(i)),i=r}this._time=t,!e&&(this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0,Y(function t(){e._running&&(Y(t),e._paused||e.update())})},t.prototype.start=function(){this._running||(this._time=Ay(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Ay(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Ay()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return null==this._head},t.prototype.animate=function(e,t){t=t||{},this.start();var n=new vI(e,t.loop);return this.addAnimator(n),n},t}(vO),Ab=fA.domSupported,Aw=(M={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},C=pV(_=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],function(e){var t=e.replace("mouse","pointer");return M.hasOwnProperty(t)?t:e}),{mouse:_,touch:["touchstart","touchend","touchmove"],pointer:C}),AS=["mousemove","mouseup"],A_=["pointermove","pointerup"],AM=!1;function AC(e){var t=e.pointerType;return"pen"===t||"touch"===t}function AA(e){e&&(e.zrByTouch=!0)}function Ak(e,t){for(var n=t,i=!1;n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return i}var AT=function(e,t){this.stopPropagation=fs,this.stopImmediatePropagation=fs,this.preventDefault=fs,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY},AD={mousedown:function(e){e=C5(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=C5(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=C5(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){Ak(this,(e=C5(this.dom,e)).toElement||e.relatedTarget)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){AM=!0,e=C5(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){AM||(e=C5(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){AA(e=C5(this.dom,e)),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),AD.mousemove.call(this,e),AD.mousedown.call(this,e)},touchmove:function(e){AA(e=C5(this.dom,e)),this.handler.processGesture(e,"change"),AD.mousemove.call(this,e)},touchend:function(e){AA(e=C5(this.dom,e)),this.handler.processGesture(e,"end"),AD.mouseup.call(this,e),new Date-this.__lastTouchMoment<300&&AD.click.call(this,e)},pointerdown:function(e){AD.mousedown.call(this,e)},pointermove:function(e){AC(e)||AD.mousemove.call(this,e)},pointerup:function(e){AD.mouseup.call(this,e)},pointerout:function(e){AC(e)||AD.mouseout.call(this,e)}};pz(["click","dblclick","contextmenu"],function(e){AD[e]=function(t){t=C5(this.dom,t),this.trigger(e,t)}});var AI={pointermove:function(e){AC(e)||AI.mousemove.call(this,e)},pointerup:function(e){AI.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function AO(e,t,n,i){e.mounted[t]=n,e.listenerOpts[t]=i,C3(e.domTarget,t,n,i)}function AP(e){var t,n,i,r=e.mounted;for(var o in r)r.hasOwnProperty(o)&&(t=e.domTarget,n=r[o],i=e.listenerOpts[o],t.removeEventListener(o,n,i));e.mounted={}}var AE=function(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t},AR=function(e){function t(t,n){var i,r,o=e.call(this)||this;return o.__pointerCapturing=!1,o.dom=t,o.painterRoot=n,o._localHandlerScope=new AE(t,AD),Ab&&(o._globalHandlerScope=new AE(document,AI)),r=(i=o._localHandlerScope).domHandlers,fA.pointerEventsSupported?pz(Aw.pointer,function(e){AO(i,e,function(t){r[e].call(o,t)})}):(fA.touchEventsSupported&&pz(Aw.touch,function(e){AO(i,e,function(t){r[e].call(o,t),i.touching=!0,null!=i.touchTimer&&(clearTimeout(i.touchTimer),i.touchTimer=null),i.touchTimer=setTimeout(function(){i.touching=!1,i.touchTimer=null},700)})}),pz(Aw.mouse,function(e){AO(i,e,function(t){t=C2(t),i.touching||r[e].call(o,t)})})),o}return g$(t,e),t.prototype.dispose=function(){AP(this._localHandlerScope),Ab&&AP(this._globalHandlerScope)},t.prototype.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||"default")},t.prototype.__togglePointerCapture=function(e){if(this.__mayPointerCapture=null,Ab&&this.__pointerCapturing^e){this.__pointerCapturing=e;var t=this._globalHandlerScope;e?function(e,t){fA.pointerEventsSupported?pz(A_,n):fA.touchEventsSupported||pz(AS,n);function n(n){AO(t,n,function(i){if(!Ak(e,(i=C2(i)).target)){var r;r=i,i=C5(e.dom,new AT(e,r),!0),t.domHandlers[n].call(e,i)}},{capture:!0})}}(this,t):AP(t)}},t}(vO),AL={},AN={},AB=function(){function e(e,t,n){var i,r=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,n=n||{},this.dom=t,this.id=e;var o=new Av,a=n.renderer||"canvas";AL[a]||(a=pW(AL)[0]),n.useDirtyRect=null!=n.useDirtyRect&&n.useDirtyRect;var s=new AL[a](t,o,n,e),l=n.ssr||s.ssrOnly;this.storage=o,this.painter=s;var u=fA.node||fA.worker||l?null:new AR(s.getViewportRoot(),s.root),c=n.useCoarsePointer;(null==c||"auto"===c?fA.touchEventsSupported:!!c)&&(i=p5(n.pointerSize,44)),this.handler=new Aa(o,s,u,s.root,i),this.animation=new Ax({stage:{update:l?null:function(){return r._flush(!0)}}}),l||this.animation.start()}return e.prototype.add=function(e){!this._disposed&&e&&(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},e.prototype.remove=function(e){!this._disposed&&e&&(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},e.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},e.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=function(e){if(!e)return!1;if("string"==typeof e)return .4>vv(e,1);if(e.colorStops){for(var t=e.colorStops,n=0,i=t.length,r=0;r<i;r++)n+=vv(t[r].color,1);return(n/=i)<.4}return!1}(e))},e.prototype.getBackgroundColor=function(){return this._backgroundColor},e.prototype.setDarkMode=function(e){this._darkMode=e},e.prototype.isDarkMode=function(){return this._darkMode},e.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},e.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},e.prototype.flush=function(){this._disposed||this._flush(!1)},e.prototype._flush=function(e){var t,n=Ay();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var i=Ay();t?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:i-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){!this._disposed&&(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},e.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof SI&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},e.prototype.dispose=function(){if(!this._disposed){var e;this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,e=this.id,delete AN[e]}},e}();function AF(e,t){var n=new AB(pI++,e,t);return AN[n.id]=n,n}var Az="";"u">typeof navigator&&(Az=navigator.platform||"");var AV="rgba(0, 0, 0, 0.2)";let Aj={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:AV,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:AV,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:AV,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:AV,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:AV,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:AV,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Az.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var AH=fi(),AW="\0_ec_inner",AG=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t.prototype.init=function(e,t,n,i,r,o){i=i||{},this.option=null,this._theme=new bc(i),this._locale=new bc(r),this._optionManager=o},t.prototype.setOption=function(e,t,n){var i=Aq(t);this._optionManager.setOption(e,n,i),this._resetOption(null,i)},t.prototype.resetOption=function(e,t){return this._resetOption(e,Aq(t))},t.prototype._resetOption=function(e,t){var n=!1,i=this._optionManager;if(!e||"recreate"===e){var r=i.mountOption("recreate"===e);this.option&&"recreate"!==e?(this.restoreData(),this._mergeOption(r,t)):K(this,r),n=!0}if(("timeline"===e||"media"===e)&&this.restoreData(),!e||"recreate"===e||"timeline"===e){var o=i.getTimelineOption(this);o&&(n=!0,this._mergeOption(o,t))}if(!e||"recreate"===e||"media"===e){var a=i.getMediaOption(this);a.length&&pz(a,function(e){n=!0,this._mergeOption(e,t)},this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,t){var n=this.option,i=this._componentsMap,r=this._componentsCount,o=[],a=fi(),s=t&&t.replaceMergeMainTypeMap;f2(this).datasetMap=fi(),pz(e,function(e,t){null!=e&&(wr.hasClass(t)?t&&(o.push(t),a.set(t,!0)):n[t]=null==n[t]?pP(e):pE(n[t],e,!0))}),s&&s.each(function(e,t){wr.hasClass(t)&&!a.get(t)&&(o.push(t),a.set(t,!0))}),wr.topologicalTravel(o,wr.getAllClassMainTypes(),function(t){var o,a,l,u,c,h,d,p,f,g,m,v,y,x,b,w,S,_,M,C,A=function(e,t,n){var i=AH.get(t);if(!i)return n;var r=i(e);return r?n.concat(r):n}(this,t,fD(e[t])),k=i.get(t),T=k?s&&s.get(t)?"replaceMerge":"normalMerge":"replaceAll",D=(y=k,x=A,b="normalMerge"===T,w="replaceMerge"===T,S="replaceAll"===T,y=y||[],x=(x||[]).slice(),_=fi(),pz(x,function(e,t){if(!pK(e)){x[t]=null;return}}),M=function(e,t,n){var i=[];if("replaceAll"===n)return i;for(var r=0;r<e.length;r++){var o=e[r];o&&null!=o.id&&t.set(o.id,r),i.push({existing:"replaceMerge"===n||fB(o)?null:o,newOption:null,keyInfo:null,brandNew:null})}return i}(y,_,T),(b||w)&&(o=M,a=y,l=_,pz(u=x,function(e,t){if(e&&null!=e.id){var n=fR(e.id),i=l.get(n);if(null!=i){var r=o[i];p8(!r.newOption,'Duplicated option on id "'+n+'".'),r.newOption=e,r.existing=a[i],u[t]=null}}})),b&&(c=M,pz(h=x,function(e,t){if(e&&null!=e.name)for(var n=0;n<c.length;n++){var i=c[n].existing;if(!c[n].newOption&&i&&(null==i.id||null==e.id)&&!fB(e)&&!fB(i)&&fE("name",i,e)){c[n].newOption=e,h[t]=null;return}}})),b||w?(d=M,p=x,f=w,pz(p,function(e){if(e){for(var t,n=0;(t=d[n])&&(t.newOption||fB(t.existing)||t.existing&&null!=e.id&&!fE("id",e,t.existing));)n++;t?(t.newOption=e,t.brandNew=f):d.push({newOption:e,brandNew:f,existing:null,keyInfo:null}),n++}})):S&&(g=M,pz(x,function(e){g.push({newOption:e,brandNew:!0,existing:null,keyInfo:null})})),m=M,v=fi(),pz(m,function(e){var t=e.existing;t&&v.set(t.id,e)}),pz(m,function(e){var t=e.newOption;p8(!t||null==t.id||!v.get(t.id)||v.get(t.id)===e,"id duplicates: "+(t&&t.id)),t&&null!=t.id&&v.set(t.id,e),e.keyInfo||(e.keyInfo={})}),pz(m,function(e,t){var n=e.existing,i=e.newOption,r=e.keyInfo;if(pK(i)){if(r.name=null!=i.name?fR(i.name):n?n.name:fk+t,n)r.id=fR(n.id);else if(null!=i.id)r.id=fR(i.id);else{var o=0;do r.id="\0"+r.name+"\0"+o++;while(v.get(r.id))}v.set(r.id,e)}}),M);pz(D,function(e){var n,i,r,o,a=e.newOption;pK(a)&&(e.keyInfo.mainType=t,e.keyInfo.subType=(n=t,i=a,r=e.existing,o=wr,i.type?i.type:r?r.subType:o.determineSubType(n,i)))}),n[t]=null,i.set(t,null),r.set(t,0);var I=[],O=[],P=0;pz(D,function(e,n){var i=e.existing,r=e.newOption;if(r){var o="series"===t,a=wr.getClass(t,e.keyInfo.subType,!o);if(!a)return;if("tooltip"===t){if(C)return;C=!0}if(i&&i.constructor===a)i.name=e.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1);else{var s=pR({componentIndex:n},e.keyInfo);pR(i=new a(r,this,this,s),s),e.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(I.push(i.option),O.push(i),P++):(I.push(void 0),O.push(void 0))},this),n[t]=I,i.set(t,O),r.set(t,P),"series"===t&&Z(this)},this),this._seriesIndices||Z(this)},t.prototype.getOption=function(){var e=pP(this.option);return pz(e,function(t,n){if(wr.hasClass(n)){for(var i=fD(t),r=i.length,o=!1,a=r-1;a>=0;a--)i[a]&&!fB(i[a])?o=!0:(i[a]=null,!o&&r--);i.length=r,e[n]=i}}),delete e[AW],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var i=n[t||0];if(i)return i;if(null==t){for(var r=0;r<n.length;r++)if(n[r])return n[r]}}},t.prototype.queryComponents=function(e){var t,n=e.mainType;if(!n)return[];var i=e.index,r=e.id,o=e.name,a=this._componentsMap.get(n);return a&&a.length?(null!=i?(t=[],pz(fD(i),function(e){a[e]&&t.push(a[e])})):t=null!=r?A$("id",r,a):null!=o?A$("name",o,a):pH(a,function(e){return!!e}),AU(t,e)):[]},t.prototype.findComponents=function(e){var t,n,i,r,o,a=e.query,s=e.mainType,l=(t=a,n=s+"Index",i=s+"Id",r=s+"Name",t&&(null!=t[n]||null!=t[i]||null!=t[r])?{mainType:s,index:t[n],id:t[i],name:t[r]}:null);return o=AU(l?this.queryComponents(l):pH(this._componentsMap.get(s),function(e){return!!e}),e),e.filter?pH(o,e.filter):o},t.prototype.eachComponent=function(e,t,n){var i=this._componentsMap;if(pq(e))i.each(function(n,i){for(var r=0;n&&r<n.length;r++){var o=n[r];o&&e.call(t,i,o,o.componentIndex)}});else for(var r=pY(e)?i.get(e):pK(e)?this.findComponents(e):null,o=0;r&&o<r.length;o++){var a=r[o];a&&t.call(n,a,a.componentIndex)}},t.prototype.getSeriesByName=function(e){var t=fL(e,null);return pH(this._componentsMap.get("series"),function(e){return!!e&&null!=t&&e.name===t})},t.prototype.getSeriesByIndex=function(e){return this._componentsMap.get("series")[e]},t.prototype.getSeriesByType=function(e){return pH(this._componentsMap.get("series"),function(t){return!!t&&t.subType===e})},t.prototype.getSeries=function(){return pH(this._componentsMap.get("series"),function(e){return!!e})},t.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},t.prototype.eachSeries=function(e,t){X(this),pz(this._seriesIndices,function(n){var i=this._componentsMap.get("series")[n];e.call(t,i,n)},this)},t.prototype.eachRawSeries=function(e,t){pz(this._componentsMap.get("series"),function(n){n&&e.call(t,n,n.componentIndex)})},t.prototype.eachSeriesByType=function(e,t,n){X(this),pz(this._seriesIndices,function(i){var r=this._componentsMap.get("series")[i];r.subType===e&&t.call(n,r,i)},this)},t.prototype.eachRawSeriesByType=function(e,t,n){return pz(this.getSeriesByType(e),t,n)},t.prototype.isSeriesFiltered=function(e){return X(this),null==this._seriesIndicesMap.get(e.componentIndex)},t.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},t.prototype.filterSeries=function(e,t){X(this);var n=[];pz(this._seriesIndices,function(i){var r=this._componentsMap.get("series")[i];e.call(t,r,i)&&n.push(i)},this),this._seriesIndices=n,this._seriesIndicesMap=fi(n)},t.prototype.restoreData=function(e){Z(this);var t=this._componentsMap,n=[];t.each(function(e,t){wr.hasClass(t)&&n.push(t)}),wr.topologicalTravel(n,wr.getAllClassMainTypes(),function(n){pz(t.get(n),function(t){t&&("series"!==n||!function(e,t){if(t){var n=t.seriesIndex,i=t.seriesId,r=t.seriesName;return null!=n&&e.componentIndex!==n||null!=i&&e.id!==i||null!=r&&e.name!==r}}(t,e))&&t.restoreData()})})},t.internalField=void(Z=function(e){var t=e._seriesIndices=[];pz(e._componentsMap.get("series"),function(e){e&&t.push(e.componentIndex)}),e._seriesIndicesMap=fi(t)},X=function(e){},K=function(e,t){e.option={},e.option[AW]=1,e._componentsMap=fi({series:[]}),e._componentsCount=fi();var n,i,r,o=t.aria;pK(o)&&null==o.enabled&&(o.enabled=!0),n=t,i=e._theme.option,r=n.color&&!n.colorLayer,pz(i,function(e,t){("colorLayer"!==t||!r)&&(wr.hasClass(t)||("object"==typeof e?n[t]=n[t]?pE(n[t],e,!1):pP(e):null==n[t]&&(n[t]=e)))}),pE(t,Aj,!1),e._mergeOption(t,null)}),t}(bc);function A$(e,t,n){if(pU(t)){var i=fi();return pz(t,function(e){null!=e&&null!=fL(e,null)&&i.set(e,!0)}),pH(n,function(t){return t&&i.get(t[e])})}var r=fL(t,null);return pH(n,function(t){return t&&null!=r&&t[e]===r})}function AU(e,t){return t.hasOwnProperty("subType")?pH(e,function(e){return e&&e.subType===t.subType}):e}function Aq(e){var t=fi();return e&&pz(fD(e.replaceMerge),function(e){t.set(e,!0)}),{replaceMergeMainTypeMap:t}}pB(AG,wl);var AY=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"];let AZ=function(e){pz(AY,function(t){this[t]=pG(e[t],e)},this)};var AX=/^(min|max)?(.+)$/,AK=function(){function e(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return e.prototype.setOption=function(e,t,n){e&&(pz(fD(e.series),function(e){e&&e.data&&pJ(e.data)&&(e.data[p7]=!0)}),pz(fD(e.dataset),function(e){e&&e.source&&pJ(e.source)&&(e.source[p7]=!0)})),e=pP(e);var i=this._optionBackup,r=function(e,t,n){var i,r,o=[],a=e.baseOption,s=e.timeline,l=e.options,u=e.media,c=!!e.media,h=!!(l||s||a&&a.timeline);function d(e){pz(t,function(t){t(e,n)})}return a?(r=a).timeline||(r.timeline=s):((h||c)&&(e.options=e.media=null),r=e),c&&pU(u)&&pz(u,function(e){e&&e.option&&(e.query?o.push(e):i||(i=e))}),d(r),pz(l,function(e){return d(e)}),pz(o,function(e){return d(e.option)}),{baseOption:r,timelineOptions:l||[],mediaDefault:i,mediaList:o}}(e,t,!i);this._newBaseOption=r.baseOption,i?(r.timelineOptions.length&&(i.timelineOptions=r.timelineOptions),r.mediaList.length&&(i.mediaList=r.mediaList),r.mediaDefault&&(i.mediaDefault=r.mediaDefault)):this._optionBackup=r},e.prototype.mountOption=function(e){var t=this._optionBackup;return this._timelineOptions=t.timelineOptions,this._mediaList=t.mediaList,this._mediaDefault=t.mediaDefault,this._currentMediaIndices=[],pP(e?t.baseOption:this._newBaseOption)},e.prototype.getTimelineOption=function(e){var t,n=this._timelineOptions;if(n.length){var i=e.getComponent("timeline");i&&(t=pP(n[i.getCurrentIndex()]))}return t},e.prototype.getMediaOption=function(e){var t,n,i=this._api.getWidth(),r=this._api.getHeight(),o=this._mediaList,a=this._mediaDefault,s=[],l=[];if(!o.length&&!a)return l;for(var u=0,c=o.length;u<c;u++)(function(e,t,n){var i={width:t,height:n,aspectratio:t/n},r=!0;return pz(e,function(e,t){var n=t.match(AX);if(n&&n[1]&&n[2]){var o,a,s,l=n[1];o=i[n[2].toLowerCase()],a=e,("min"===(s=l)?o>=a:"max"===s?o<=a:o===a)||(r=!1)}}),r})(o[u].query,i,r)&&s.push(u);return!s.length&&a&&(s=[-1]),s.length&&(t=s,n=this._currentMediaIndices,t.join(",")!==n.join(","))&&(l=pV(s,function(e){return pP(-1===e?a.option:o[e].option)})),this._currentMediaIndices=s,l},e}(),AQ=pK,AJ=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function A0(e){var t=e&&e.itemStyle;if(t)for(var n=0,i=AJ.length;n<i;n++){var r=AJ[n],o=t.normal,a=t.emphasis;o&&o[r]&&(e[r]=e[r]||{},e[r].normal?pE(e[r].normal,o[r]):e[r].normal=o[r],o[r]=null),a&&a[r]&&(e[r]=e[r]||{},e[r].emphasis?pE(e[r].emphasis,a[r]):e[r].emphasis=a[r],a[r]=null)}}function A1(e,t,n){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var i=e[t].normal,r=e[t].emphasis;i&&(n?(e[t].normal=e[t].emphasis=null,pL(e[t],i)):e[t]=i),r&&(e.emphasis=e.emphasis||{},e.emphasis[t]=r,r.focus&&(e.emphasis.focus=r.focus),r.blurScope&&(e.emphasis.blurScope=r.blurScope))}}function A2(e){A1(e,"itemStyle"),A1(e,"lineStyle"),A1(e,"areaStyle"),A1(e,"label"),A1(e,"labelLine"),A1(e,"upperLabel"),A1(e,"edgeLabel")}function A5(e,t){var n=AQ(e)&&e[t],i=AQ(n)&&n.textStyle;if(i)for(var r=0,o=fO.length;r<o;r++){var a=fO[r];i.hasOwnProperty(a)&&(n[a]=i[a])}}function A3(e){e&&(A2(e),A5(e,"label"),e.emphasis&&A5(e.emphasis,"label"))}function A4(e){return pU(e)?e:e?[e]:[]}function A6(e){return(pU(e)?e[0]:e)||{}}function A8(e){e&&pz(A9,function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])})}var A9=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],A7=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],ke=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function kt(e){var t=e&&e.itemStyle;if(t)for(var n=0;n<ke.length;n++){var i=ke[n][1],r=ke[n][0];null!=t[i]&&(t[r]=t[i])}}function kn(e){e&&"edge"===e.alignTo&&null!=e.margin&&null==e.edgeDistance&&(e.edgeDistance=e.margin)}function ki(e){e&&e.downplay&&!e.blur&&(e.blur=e.downplay)}function kr(e,t){var n;pz(A4(e.series),function(e){AQ(e)&&function(e){if(AQ(e)){A0(e),A2(e),A5(e,"label"),A5(e,"upperLabel"),A5(e,"edgeLabel"),e.emphasis&&(A5(e.emphasis,"label"),A5(e.emphasis,"upperLabel"),A5(e.emphasis,"edgeLabel"));var t=e.markPoint;t&&(A0(t),A3(t));var n=e.markLine;n&&(A0(n),A3(n));var i=e.markArea;i&&A3(i);var r=e.data;if("graph"===e.type){r=r||e.nodes;var o=e.links||e.edges;if(o&&!pJ(o))for(var a=0;a<o.length;a++)A3(o[a]);pz(e.categories,function(e){A2(e)})}if(r&&!pJ(r))for(var a=0;a<r.length;a++)A3(r[a]);if((t=e.markPoint)&&t.data)for(var s=t.data,a=0;a<s.length;a++)A3(s[a]);if((n=e.markLine)&&n.data)for(var l=n.data,a=0;a<l.length;a++)pU(l[a])?(A3(l[a][0]),A3(l[a][1])):A3(l[a]);"gauge"===e.type?(A5(e,"axisLabel"),A5(e,"title"),A5(e,"detail")):"treemap"===e.type?(A1(e.breadcrumb,"itemStyle"),pz(e.levels,function(e){A2(e)})):"tree"===e.type&&A2(e.leaves)}}(e)}),n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"],t&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),pz(n,function(t){pz(A4(e[t]),function(e){e&&(A5(e,"axisLabel"),A5(e.axisPointer,"label"))})}),pz(A4(e.parallel),function(e){var t=e&&e.parallelAxisDefault;A5(t,"axisLabel"),A5(t&&t.axisPointer,"label")}),pz(A4(e.calendar),function(e){A1(e,"itemStyle"),A5(e,"dayLabel"),A5(e,"monthLabel"),A5(e,"yearLabel")}),pz(A4(e.radar),function(e){A5(e,"name"),e.name&&null==e.axisName&&(e.axisName=e.name,delete e.name),null!=e.nameGap&&null==e.axisNameGap&&(e.axisNameGap=e.nameGap,delete e.nameGap)}),pz(A4(e.geo),function(e){AQ(e)&&(A3(e),pz(A4(e.regions),function(e){A3(e)}))}),pz(A4(e.timeline),function(e){A3(e),A1(e,"label"),A1(e,"itemStyle"),A1(e,"controlStyle",!0);var t=e.data;pU(t)&&pz(t,function(e){pK(e)&&(A1(e,"label"),A1(e,"itemStyle"))})}),pz(A4(e.toolbox),function(e){A1(e,"iconStyle"),pz(e.feature,function(e){A1(e,"iconStyle")})}),A5(A6(e.axisPointer),"label"),A5(A6(e.tooltip).axisPointer,"label"),e.series=fD(e.series),pz(e.series,function(e){if(pK(e)){var t=e.type;if("line"===t)null!=e.clipOverflow&&(e.clip=e.clipOverflow);else if("pie"===t||"gauge"===t){null!=e.clockWise&&(e.clockwise=e.clockWise),kn(e.label);var n=e.data;if(n&&!pJ(n))for(var i=0;i<n.length;i++)kn(n[i]);null!=e.hoverOffset&&(e.emphasis=e.emphasis||{},e.emphasis.scaleSize=null)}else if("gauge"===t){var r=function(e,t){for(var n=t.split(","),i=e,r=0;r<n.length&&null!=(i=i&&i[n[r]]);r++);return i}(e,"pointer.color");null!=r&&function(e,t,n){for(var i,r=t.split(","),o=e,a=0;a<r.length-1;a++)null==o[i=r[a]]&&(o[i]={}),o=o[i];null==o[r[a]]&&(o[r[a]]=n)}(e,"itemStyle.color",r)}else if("bar"===t){kt(e),kt(e.backgroundStyle),kt(e.emphasis);var n=e.data;if(n&&!pJ(n))for(var i=0;i<n.length;i++)"object"==typeof n[i]&&(kt(n[i]),kt(n[i]&&n[i].emphasis))}else if("sunburst"===t){var o=e.highlightPolicy;o&&(e.emphasis=e.emphasis||{},e.emphasis.focus||(e.emphasis.focus=o)),ki(e),function e(t,n){if(t)for(var i=0;i<t.length;i++)n(t[i]),t[i]&&e(t[i].children,n)}(e.data,ki)}else"graph"===t||"sankey"===t?e&&null!=e.focusNodeAdjacency&&(e.emphasis=e.emphasis||{},null==e.emphasis.focus&&(e.emphasis.focus="adjacency")):"map"===t&&(e.mapType&&!e.map&&(e.map=e.mapType),e.mapLocation&&pL(e,e.mapLocation));null!=e.hoverAnimation&&(e.emphasis=e.emphasis||{},e.emphasis&&null==e.emphasis.scale&&(e.emphasis.scale=e.hoverAnimation)),A8(e)}}),e.dataRange&&(e.visualMap=e.dataRange),pz(A7,function(t){var n=e[t];n&&(pU(n)||(n=[n]),pz(n,function(e){A8(e)}))})}function ko(e){pz(e,function(t,n){var i=[],r=[NaN,NaN],o=[t.stackResultDimension,t.stackedOverDimension],a=t.data,s=t.isStackedByIndex,l=t.seriesModel.get("stackStrategy")||"samesign";a.modify(o,function(o,u,c){var h,d,p=a.get(t.stackedDimension,c);if(isNaN(p))return r;s?d=a.getRawIndex(c):h=a.get(t.stackedByDimension,c);for(var f=NaN,g=n-1;g>=0;g--){var m=e[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,h)),d>=0){var v=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&v>0||"negative"===l&&v<0||"samesign"===l&&p>=0&&v>0||"samesign"===l&&p<=0&&v<0){p=function(e,t){var n=Math.max(fp(e),fp(t)),i=e+t;return n>20?i:fh(i,n)}(p,v),f=v;break}}}return i[0]=p,i[1]=f,i})})}var ka=function(){function e(){this.group=new SI,this.uid=bd("viewComponent")}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){},e.prototype.updateLayout=function(e,t,n,i){},e.prototype.updateVisual=function(e,t,n,i){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}();gL(ka),gV(ka);var ks=fz(),kl={itemStyle:gj(bs,!0),lineStyle:gj(br,!0)},ku={lineStyle:"stroke",itemStyle:"fill"};function kc(e,t){var n=e.visualStyleMapper||kl[t];return n||(console.warn("Unknown style type '"+t+"'."),kl.itemStyle)}function kh(e,t){var n=e.visualDrawType||ku[t];return n||(console.warn("Unknown style type '"+t+"'."),"fill")}var kd=new bc,kp=Math.PI,kf=function(){function e(e,t,n,i){this._stageTaskMap=fi(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(e){var t=e.overallTask;t&&t.dirty()})},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),i=n.context,r=!t&&n.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,o=i&&i.modDataCount,a=null!=o?Math.ceil(o/r):null;return{step:r,modBy:a,modDataCount:o}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),i=e.getData().count(),r=n.progressiveEnabled&&t.incrementalPrepareRender&&i>=n.threshold,o=e.get("large")&&i>=e.get("largeThreshold"),a="mod"===e.get("progressiveChunkMode")?i:null;e.pipelineContext=n.context={progressiveRender:r,modDataCount:a,large:o}},e.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=fi();e.eachSeries(function(e){var i=e.getProgressive(),r=e.uid;n.set(r,{id:r,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:i&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),t._pipe(e,e.dataTask)})},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;pz(this._allHandlers,function(i){var r=e.get(i.uid)||e.set(i.uid,{});p8(!(i.reset&&i.overallReset),""),i.reset&&this._createSeriesStageTask(i,r,t,n),i.overallReset&&this._createOverallStageTask(i,r,t,n)},this)},e.prototype.prepareView=function(e,t,n,i){var r=e.renderTask,o=r.context;o.model=t,o.ecModel=n,o.api=i,r.__block=!e.incrementalPrepareRender,this._pipe(t,r)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,i){i=i||{};var r=!1,o=this;function a(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}pz(e,function(e,s){if(!i.visualType||i.visualType===e.visualType){var l=o._stageTaskMap.get(e.uid),u=l.seriesTaskMap,c=l.overallTask;if(c){var h,d=c.agentStubMap;d.each(function(e){a(i,e)&&(e.dirty(),h=!0)}),h&&c.dirty(),o.updatePayload(c,n);var p=o.getPerformArgs(c,i.block);d.each(function(e){e.perform(p)}),c.perform(p)&&(r=!0)}else u&&u.each(function(s,l){a(i,s)&&s.dirty();var u=o.getPerformArgs(s,i.block);u.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),o.updatePayload(s,n),s.perform(u)&&(r=!0)})}}),this.unfinished=r||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(e){t=e.dataTask.perform()||t}),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},e.prototype.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,i){var r=this,o=t.seriesTaskMap,a=t.seriesTaskMap=fi(),s=e.seriesType,l=e.getTargetSeries;function u(t){var s=t.uid,l=a.set(s,o&&o.get(s)||wS({plan:kx,reset:kb,count:k_}));l.context={model:t,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:r},r._pipe(t,l)}e.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,i).each(u)},e.prototype._createOverallStageTask=function(e,t,n,i){var r=this,o=t.overallTask=t.overallTask||wS({reset:kg});o.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:r};var a=o.agentStubMap,s=o.agentStubMap=fi(),l=e.seriesType,u=e.getTargetSeries,c=!0,h=!1;function d(e){var t=e.uid,n=s.set(t,a&&a.get(t)||(h=!0,wS({reset:km,onDirty:ky})));n.context={model:e,overallProgress:c},n.agent=o,n.__block=c,r._pipe(e,n)}p8(!e.createOnAllSeries,""),l?n.eachRawSeriesByType(l,d):u?u(n,i).each(d):(c=!1,pz(n.getSeries(),d)),h&&o.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,i=this._pipelineMap.get(n);i.head||(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},e.wrapStageHandler=function(e,t){return pq(e)&&(e={overallReset:e,seriesType:function(e){Q=null;try{e(kM,kC)}catch(e){}return Q}(e)}),e.uid=bd("stageHandler"),t&&(e.visualType=t),e},e}();function kg(e){e.overallReset(e.ecModel,e.api,e.payload)}function km(e){return e.overallProgress&&kv}function kv(){this.agent.dirty(),this.getDownstream().dirty()}function ky(){this.agent&&this.agent.dirty()}function kx(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function kb(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=fD(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?pV(t,function(e,t){return kS(t)}):kw}var kw=kS(0);function kS(e){return function(t,n){var i=n.data,r=n.resetDefines[e];if(r&&r.dataEach)for(var o=t.start;o<t.end;o++)r.dataEach(i,o);else r&&r.progress&&r.progress(t,i)}}function k_(e){return e.data.count()}var kM={},kC={};function kA(e,t){for(var n in t.prototype)e[n]=fs}kA(kM,AG),kA(kC,AZ),kM.eachSeriesByType=kM.eachRawSeriesByType=function(e){Q=e},kM.eachComponent=function(e){"series"===e.mainType&&e.subType&&(Q=e.subType)};var kk=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],kT="#B9B8CE",kD="#100C2A",kI=function(){return{axisLine:{lineStyle:{color:kT}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},kO=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],kP={darkMode:!0,color:kO,backgroundColor:kD,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:kT}},textStyle:{color:kT},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:kT}},dataZoom:{borderColor:"#71708A",textStyle:{color:kT},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:kT}},timeline:{lineStyle:{color:kT},label:{color:kT},controlStyle:{color:kT,borderColor:kT}},calendar:{itemStyle:{color:kD},dayLabel:{color:kT},monthLabel:{color:kT},yearLabel:{color:kT}},timeAxis:kI(),logAxis:kI(),valueAxis:kI(),categoryAxis:kI(),line:{symbol:"circle"},graph:{color:kO},gauge:{title:{color:kT},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:kT},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};kP.categoryAxis.splitLine.show=!1;var kE=function(){function e(){}return e.prototype.normalizeQuery=function(e){var t={},n={},i={};if(pY(e)){var r=gR(e);t.mainType=r.main||null,t.subType=r.sub||null}else{var o=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};pz(e,function(e,r){for(var s=!1,l=0;l<o.length;l++){var u=o[l],c=r.lastIndexOf(u);if(c>0&&c===r.length-u.length){var h=r.slice(0,c);"data"!==h&&(t.mainType=h,t[u.toLowerCase()]=e,s=!0)}}a.hasOwnProperty(r)&&(n[r]=e,s=!0),s||(i[r]=e)})}return{cptQuery:t,dataQuery:n,otherQuery:i}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,r=n.packedEvent,o=n.model,a=n.view;if(!o||!a)return!0;var s=t.cptQuery,l=t.dataQuery;return u(s,o,"mainType")&&u(s,o,"subType")&&u(s,o,"index","componentIndex")&&u(s,o,"name")&&u(s,o,"id")&&u(l,r,"name")&&u(l,r,"dataIndex")&&u(l,r,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(e,t.otherQuery,i,r));function u(e,t,n,i){return null==e[n]||t[i||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),kR=["symbol","symbolSize","symbolRotate","symbolOffset"],kL=kR.concat(["symbolKeepAspect"]);function kN(e,t,n){switch(n){case"color":return e.getItemVisual(t,"style")[e.getVisual("drawType")];case"opacity":return e.getItemVisual(t,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getItemVisual(t,n)}}function kB(e,t){switch(t){case"color":return e.getVisual("style")[e.getVisual("drawType")];case"opacity":return e.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getVisual(t)}}function kF(e,t,n){for(var i;e&&(!t(e)||(i=e,!n));)e=e.__hostTarget||e.parent;return i}var kz=Math.round(9*Math.random()),kV="function"==typeof Object.defineProperty,kj=function(){function e(){this._id="__ec_inner_"+kz++}return e.prototype.get=function(e){return this._guard(e)[this._id]},e.prototype.set=function(e,t){var n=this._guard(e);return kV?Object.defineProperty(n,this._id,{value:t,enumerable:!1,configurable:!0}):n[this._id]=t,this},e.prototype.delete=function(e){return!!this.has(e)&&(delete this._guard(e)[this._id],!0)},e.prototype.has=function(e){return!!this._guard(e)[this._id]},e.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},e}();function kH(e){return isFinite(e)}function kW(e,t,n){for(var i,r,o,a,s,l,u,c,h,d,p="radial"===t.type?(o=Math.min(i=n.width,r=n.height),a=null==t.x?.5:t.x,s=null==t.y?.5:t.y,l=null==t.r?.5:t.r,t.global||(a=a*i+n.x,s=s*r+n.y,l*=o),a=kH(a)?a:.5,s=kH(s)?s:.5,l=l>=0&&kH(l)?l:.5,e.createRadialGradient(a,s,0,a,s,l)):(u=null==t.x?0:t.x,c=null==t.x2?1:t.x2,h=null==t.y?0:t.y,d=null==t.y2?0:t.y2,t.global||(u=u*n.width+n.x,c=c*n.width+n.x,h=h*n.height+n.y,d=d*n.height+n.y),u=kH(u)?u:0,c=kH(c)?c:1,h=kH(h)?h:0,d=kH(d)?d:0,e.createLinearGradient(u,h,c,d)),f=t.colorStops,g=0;g<f.length;g++)p.addColorStop(f[g].offset,f[g].color);return p}function kG(e){return parseInt(e,10)}function k$(e,t,n){var i=["width","height"][t],r=["clientWidth","clientHeight"][t],o=["paddingLeft","paddingTop"][t],a=["paddingRight","paddingBottom"][t];if(null!=n[i]&&"auto"!==n[i])return parseFloat(n[i]);var s=document.defaultView.getComputedStyle(e);return(e[r]||kG(s[i])||kG(e.style[i]))-(kG(s[o])||0)-(kG(s[a])||0)|0}function kU(e){var t,n,i=e.style,r=i.lineDash&&i.lineWidth>0&&(t=i.lineDash,n=i.lineWidth,t&&"solid"!==t&&n>0?"dashed"===t?[4*n,2*n]:"dotted"===t?[n]:pX(t)?[t]:pU(t)?t:null:null),o=i.lineDashOffset;if(r){var a=i.strokeNoScale&&e.getLineScale?e.getLineScale():1;a&&1!==a&&(r=pV(r,function(e){return e/a}),o/=a)}return[r,o]}var kq=new yv(!0);function kY(e){var t=e.stroke;return null!=t&&"none"!==t&&e.lineWidth>0}function kZ(e){return"string"==typeof e&&"none"!==e}function kX(e){var t=e.fill;return null!=t&&"none"!==t}function kK(e,t){if(null!=t.fillOpacity&&1!==t.fillOpacity){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function kQ(e,t){if(null!=t.strokeOpacity&&1!==t.strokeOpacity){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function kJ(e,t,n){var i=gX(t.image,t.__image,n);if(gQ(i)){var r=e.createPattern(i,t.repeat||"repeat");if("function"==typeof DOMMatrix&&r&&r.setTransform){var o=new DOMMatrix;o.translateSelf(t.x||0,t.y||0),o.rotateSelf(0,0,(t.rotation||0)*fl),o.scaleSelf(t.scaleX||1,t.scaleY||1),r.setTransform(o)}return r}}var k0=["shadowBlur","shadowOffsetX","shadowOffsetY"],k1=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function k2(e,t,n,i,r){var o=!1;if(!i&&t===(n=n||{}))return!1;if(i||t.opacity!==n.opacity){k4(e,r),o=!0;var a=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(a)?v$.opacity:a}(i||t.blend!==n.blend)&&(o||(k4(e,r),o=!0),e.globalCompositeOperation=t.blend||v$.blend);for(var s=0;s<k0.length;s++){var l=k0[s];(i||t[l]!==n[l])&&(o||(k4(e,r),o=!0),e[l]=e.dpr*(t[l]||0))}return(i||t.shadowColor!==n.shadowColor)&&(o||(k4(e,r),o=!0),e.shadowColor=t.shadowColor||v$.shadowColor),o}function k5(e,t,n,i,r){var o=k6(t,r.inHover),a=i?null:n&&k6(n,r.inHover)||{};if(o===a)return!1;var s=k2(e,o,a,i,r);if((i||o.fill!==a.fill)&&(s||(k4(e,r),s=!0),kZ(o.fill)&&(e.fillStyle=o.fill)),(i||o.stroke!==a.stroke)&&(s||(k4(e,r),s=!0),kZ(o.stroke)&&(e.strokeStyle=o.stroke)),(i||o.opacity!==a.opacity)&&(s||(k4(e,r),s=!0),e.globalAlpha=null==o.opacity?1:o.opacity),t.hasStroke()){var l=o.lineWidth/(o.strokeNoScale&&t.getLineScale?t.getLineScale():1);e.lineWidth!==l&&(s||(k4(e,r),s=!0),e.lineWidth=l)}for(var u=0;u<k1.length;u++){var c=k1[u],h=c[0];(i||o[h]!==a[h])&&(s||(k4(e,r),s=!0),e[h]=o[h]||c[1])}return s}function k3(e,t){var n=t.transform,i=e.dpr||1;n?e.setTransform(i*n[0],i*n[1],i*n[2],i*n[3],i*n[4],i*n[5]):e.setTransform(i,0,0,i,0,0)}function k4(e,t){t.batchFill&&e.fill(),t.batchStroke&&e.stroke(),t.batchFill="",t.batchStroke=""}function k6(e,t){return t&&e.__hoverStyle||e.style}function k8(e,t){k9(e,t,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function k9(e,t,n,i){var r,o=t.transform;if(!t.shouldBePainted(n.viewWidth,n.viewHeight,!1,!1)){t.__dirty&=-2,t.__isRendered=!1;return}var a=t.__clipPaths,s=n.prevElClipPaths,l=!1,u=!1;if(!s||function(e,t){if(e===t||!e&&!t)return!1;if(!e||!t||e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}(a,s)){if(s&&s.length&&(k4(e,n),e.restore(),u=l=!0,n.prevElClipPaths=null,n.allClipped=!1,n.prevEl=null),a&&a.length){k4(e,n),e.save();for(var c=!1,h=0;h<a.length;h++){var d=a[h];c=c||d.isZeroArea(),k3(e,d),e.beginPath(),d.buildPath(e,d.shape),e.clip()}n.allClipped=c,l=!0}n.prevElClipPaths=a}if(n.allClipped){t.__isRendered=!1;return}t.beforeBrush&&t.beforeBrush(),t.innerBeforeBrush();var p=n.prevEl;p||(u=l=!0);var f=t instanceof yO&&t.autoBatch&&(v=kX(m=t.style),y=kY(m),!(m.lineDash||!(v^y)||v&&"string"!=typeof m.fill||y&&"string"!=typeof m.stroke||m.strokePercent<1||m.strokeOpacity<1||m.fillOpacity<1));!l&&(x=p.transform,o&&x?o[0]===x[0]&&o[1]===x[1]&&o[2]===x[2]&&o[3]===x[3]&&o[4]===x[4]&&o[5]===x[5]:+(!o&&!x))?f||k4(e,n):(k4(e,n),k3(e,t));var g=k6(t,n.inHover);if(t instanceof yO)1!==n.lastDrawType&&(u=!0,n.lastDrawType=1),k5(e,t,p,u,n),f&&(n.batchFill||n.batchStroke)||e.beginPath(),function(e,t,n,i){var r,o,a,s=kY(n),l=kX(n),u=n.strokePercent,c=u<1,h=!t.path;(!t.silent||c)&&h&&t.createPathProxy();var d=t.path||kq,p=t.__dirty;if(!i){var f=n.fill,g=n.stroke,m=l&&!!f.colorStops,v=s&&!!g.colorStops,y=l&&!!f.image,x=s&&!!g.image,b=void 0,w=void 0,S=void 0,_=void 0,M=void 0;(m||v)&&(M=t.getBoundingRect()),m&&(b=p?kW(e,f,M):t.__canvasFillGradient,t.__canvasFillGradient=b),v&&(w=p?kW(e,g,M):t.__canvasStrokeGradient,t.__canvasStrokeGradient=w),y&&(S=p||!t.__canvasFillPattern?kJ(e,f,t):t.__canvasFillPattern,t.__canvasFillPattern=S),x&&(_=p||!t.__canvasStrokePattern?kJ(e,g,t):t.__canvasStrokePattern,t.__canvasStrokePattern=S),m?e.fillStyle=b:y&&(S?e.fillStyle=S:l=!1),v?e.strokeStyle=w:x&&(_?e.strokeStyle=_:s=!1)}var C=t.getGlobalScale();d.setScale(C[0],C[1],t.segmentIgnoreThreshold),e.setLineDash&&n.lineDash&&(o=(r=kU(t))[0],a=r[1]);var A=!0;(h||4&p)&&(d.setDPR(e.dpr),c?d.setContext(null):(d.setContext(e),A=!1),d.reset(),t.buildPath(d,t.shape,i),d.toStatic(),t.pathUpdated()),A&&d.rebuildPath(e,c?u:1),o&&(e.setLineDash(o),e.lineDashOffset=a),!i&&(n.strokeFirst?(s&&kQ(e,n),l&&kK(e,n)):(l&&kK(e,n),s&&kQ(e,n))),o&&e.setLineDash([])}(e,t,g,f),f&&(n.batchFill=g.fill||"",n.batchStroke=g.stroke||"");else if(t instanceof yE){3!==n.lastDrawType&&(u=!0,n.lastDrawType=3),k5(e,t,p,u,n);var m,v,y,x,b,w=g.text;if(null!=w&&(w+=""),w){e.font=g.font||pm,e.textAlign=g.textAlign,e.textBaseline=g.textBaseline;var S=void 0,_=void 0;e.setLineDash&&g.lineDash&&(S=(b=kU(t))[0],_=b[1]),S&&(e.setLineDash(S),e.lineDashOffset=_),g.strokeFirst?(kY(g)&&e.strokeText(w,g.x,g.y),kX(g)&&e.fillText(w,g.x,g.y)):(kX(g)&&e.fillText(w,g.x,g.y),kY(g)&&e.strokeText(w,g.x,g.y)),S&&e.setLineDash([])}}else t instanceof yB?(2!==n.lastDrawType&&(u=!0,n.lastDrawType=2),r=u,k2(e,k6(t,n.inHover),p&&k6(p,n.inHover),r,n),function(e,t,n){var i=t.__image=gX(n.image,t.__image,t,t.onload);if(i&&gQ(i)){var r=n.x||0,o=n.y||0,a=t.getWidth(),s=t.getHeight(),l=i.width/i.height;if(null==a&&null!=s?a=s*l:null==s&&null!=a?s=a/l:null==a&&null==s&&(a=i.width,s=i.height),n.sWidth&&n.sHeight){var u=n.sx||0,c=n.sy||0;e.drawImage(i,u,c,n.sWidth,n.sHeight,r,o,a,s)}else if(n.sx&&n.sy){var u=n.sx,c=n.sy,h=a-u,d=s-c;e.drawImage(i,u,c,h,d,r,o,a,s)}else e.drawImage(i,r,o,a,s)}}(e,t,g)):t.getTemporalDisplayables&&(4!==n.lastDrawType&&(u=!0,n.lastDrawType=4),function(e,t,n){var i,r,o=t.getDisplayables(),a=t.getTemporalDisplayables();e.save();var s={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:n.viewWidth,viewHeight:n.viewHeight,inHover:n.inHover};for(i=t.getCursor(),r=o.length;i<r;i++){var l=o[i];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),k9(e,l,s,i===r-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),s.prevEl=l}for(var u=0,c=a.length;u<c;u++){var l=a[u];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),k9(e,l,s,u===c-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),s.prevEl=l}t.clearTemporalDisplayables(),t.notClear=!0,e.restore()}(e,t,n));f&&i&&k4(e,n),t.innerAfterBrush(),t.afterBrush&&t.afterBrush(),n.prevEl=t,t.__dirty=0,t.__isRendered=!0}var k7=new kj,Te=new gY(100),Tt=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function Tn(e,t){if("none"===e)return null;var n=t.getDevicePixelRatio(),i=t.getZr(),r="svg"===i.painter.type;e.dirty&&k7.delete(e);var o=k7.get(e);if(o)return o;var a=pL(e,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});"none"===a.backgroundColor&&(a.backgroundColor=null);var s={repeat:"repeat"};return function(e){for(var t,o,s=[n],l=!0,u=0;u<Tt.length;++u){var c=a[Tt[u]];if(null!=c&&!pU(c)&&!pY(c)&&!pX(c)&&"boolean"!=typeof c){l=!1;break}s.push(c)}if(l){t=s.join(",")+(r?"-svg":"");var h=Te.get(t);h&&(r?e.svgElement=h:e.image=h)}var d=function e(t){if(!t||0===t.length)return[[0,0]];if(pX(t)){var n=Math.ceil(t);return[[n,n]]}for(var i=!0,r=0;r<t.length;++r)if(!pX(t[r])){i=!1;break}if(i)return e([t]);for(var o=[],r=0;r<t.length;++r)if(pX(t[r])){var n=Math.ceil(t[r]);o.push([n,n])}else{var n=pV(t[r],function(e){return Math.ceil(e)});n.length%2==1?o.push(n.concat(n)):o.push(n)}return o}(a.dashArrayX),p=function(e){if(!e||"object"==typeof e&&0===e.length)return[0,0];if(pX(e)){var t=Math.ceil(e);return[t,t]}var n=pV(e,function(e){return Math.ceil(e)});return e.length%2?n.concat(n):n}(a.dashArrayY),f=function e(t){if(!t||0===t.length)return[["rect"]];if(pY(t))return[[t]];for(var n=!0,i=0;i<t.length;++i)if(!pY(t[i])){n=!1;break}if(n)return e([t]);for(var r=[],i=0;i<t.length;++i)pY(t[i])?r.push([t[i]]):r.push(t[i]);return r}(a.symbol),g=pV(d,function(e){return Ti(e)}),m=Ti(p),v=!r&&py.createCanvas(),y=r&&{tag:"g",attrs:{},key:"dcl",children:[]},x=function(){for(var e=1,t=0,n=g.length;t<n;++t)e=fM(e,g[t]);for(var i=1,t=0,n=f.length;t<n;++t)i=fM(i,f[t].length);e*=i;var r=m*g.length*f.length;return{width:Math.max(1,Math.min(e,a.maxTileWidth)),height:Math.max(1,Math.min(r,a.maxTileHeight))}}();v&&(v.width=x.width*n,v.height=x.height*n,o=v.getContext("2d")),function(){o&&(o.clearRect(0,0,v.width,v.height),a.backgroundColor&&(o.fillStyle=a.backgroundColor,o.fillRect(0,0,v.width,v.height)));for(var e=0,t=0;t<p.length;++t)e+=p[t];if(!(e<=0))for(var s=-m,l=0,u=0,c=0;s<x.height;){if(l%2==0){for(var h=u/2%f.length,g=0,b=0,w=0;g<2*x.width;){for(var S=0,t=0;t<d[c].length;++t)S+=d[c][t];if(S<=0)break;if(b%2==0){var _=(1-a.symbolSize)*.5,M=g+d[c][b]*_,C=s+p[l]*_,A=d[c][b]*a.symbolSize,k=p[l]*a.symbolSize,T=w/2%f[h].length;!function(e,t,s,l,u){var c=r?1:n,h=MQ(u,e*c,t*c,s*c,l*c,a.color,a.symbolKeepAspect);if(r){var d=i.painter.renderOneToVNode(h);d&&y.children.push(d)}else k8(o,h)}(M,C,A,k,f[h][T])}g+=d[c][b],++w,++b===d[c].length&&(b=0)}++c===d.length&&(c=0)}s+=p[l],++u,++l===p.length&&(l=0)}}(),l&&Te.put(t,v||y),e.image=v,e.svgElement=y,e.svgWidth=x.width,e.svgHeight=x.height}(s),s.rotation=a.rotation,s.scaleX=s.scaleY=r?1:1/n,k7.set(e,s),e.dirty=!1,s}function Ti(e){for(var t=0,n=0;n<e.length;++n)t+=e[n];return e.length%2==1?2*t:t}var Tr=new vO,To={},Ta="__flagInMainProcess",Ts="__pendingUpdate",Tl="__needsUpdateStatus",Tu=/^[a-zA-Z0-9_]+$/,Tc="__connectUpdateStatus";function Th(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.isDisposed()?void this.id:Tp(this,e,t)}}function Td(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Tp(this,e,t)}}function Tp(e,t,n){return n[0]=n[0]&&n[0].toLowerCase(),vO.prototype[t].apply(e,n)}var Tf=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t}(vO),Tg=Tf.prototype;Tg.on=Td("on"),Tg.off=Td("off");var Tm=function(e){function t(t,n,i){var r=e.call(this,new kE)||this;r._chartsViews=[],r._chartsMap={},r._componentsViews=[],r._componentsMap={},r._pendingActions=[],i=i||{},pY(n)&&(n=TM[n]),r._dom=t,i.ssr;var o=r._zr=AF(t,{renderer:i.renderer||"canvas",devicePixelRatio:i.devicePixelRatio,width:i.width,height:i.height,ssr:i.ssr,useDirtyRect:p5(i.useDirtyRect,!1),useCoarsePointer:p5(i.useCoarsePointer,"auto"),pointerSize:i.pointerSize});r._ssr=i.ssr,r._throttledZrFlush=Mr(pG(o.flush,o),17),(n=pP(n))&&kr(n,!0),r._theme=n,r._locale=function(e){if(!pY(e))return pE(pP(e),pP(bM.EN),!1);var t=bM[e.toUpperCase()]||{};return"ZH"===e||"EN"===e?pP(t):pE(pP(t),pP(bM.EN),!1)}(i.locale||bA),r._coordSysMgr=new SS;var a=r._api=ep(r);function s(e,t){return e.__prio-t.__prio}return Ap(T_,s),Ap(Tw,s),r._scheduler=new kf(r,a,Tw,T_),r._messageCenter=new Tf,r._initEvents(),r.resize=pG(r.resize,r),o.animation.on("frame",r._onframe,r),el(o,r),eu(o,r),r[p7]=!0,r}return gO(t,e),t.prototype._onframe=function(){if(!this._disposed){em(this);var e=this._scheduler;if(this[Ts]){var t=this[Ts].silent;this[Ta]=!0;try{J(this),en.update.call(this,null,this[Ts].updateParams)}catch(e){throw this[Ta]=!1,this[Ts]=null,e}this._zr.flush(),this[Ta]=!1,this[Ts]=null,ea.call(this,t),es.call(this,t)}else if(e.unfinished){var n=1,i=this._model,r=this._api;e.unfinished=!1;do{var o=+new Date;e.performSeriesTasks(i),e.performDataProcessorTasks(i),er(this,i),e.performVisualTasks(i),ed(this,this._model,r,"remain",{}),n-=new Date-o}while(n>0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(!this[Ta]){if(this._disposed)return void this.id;if(pK(t)&&(n=t.lazyUpdate,i=t.silent,r=t.replaceMerge,o=t.transition,t=t.notMerge),this[Ta]=!0,!this._model||t){var i,r,o,a=new AK(this._api),s=this._theme,l=this._model=new AG;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(e,{replaceMerge:r},TS);var u={seriesTransition:o,optionChanged:!0};if(n)this[Ts]={silent:i,updateParams:u},this[Ta]=!1,this.getZr().wakeUp();else{try{J(this),en.update.call(this,null,u)}catch(e){throw this[Ts]=null,this[Ta]=!1,e}this._ssr||this._zr.flush(),this[Ts]=null,this[Ta]=!1,ea.call(this,i),es.call(this,i)}}},t.prototype.setTheme=function(){},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||fA.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){return e=e||{},this._zr.painter.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get("backgroundColor"),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){return e=e||{},this._zr.painter.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){if(fA.svgSupported){var e=this._zr;return pz(e.storage.getDisplayList(),function(e){e.stopAnimation(null,!0)}),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(this._disposed)return void this.id;var t=(e=e||{}).excludeComponents,n=this._model,i=[],r=this;pz(t,function(e){n.eachComponent({mainType:e},function(e){var t=r._componentsMap[e.__viewId];t.group.ignore||(i.push(t),t.group.ignore=!0)})});var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return pz(i,function(e){e.group.ignore=!1}),o},t.prototype.getConnectedDataURL=function(e){if(this._disposed)return void this.id;var t="svg"===e.type,n=this.group,i=Math.min,r=Math.max,o=1/0;if(!Tk[n])return this.getDataURL(e);var a=o,s=o,l=-o,u=-o,c=[],h=e&&e.pixelRatio||this.getDevicePixelRatio();pz(TA,function(o,h){if(o.group===n){var d=t?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(pP(e)),p=o.getDom().getBoundingClientRect();a=i(p.left,a),s=i(p.top,s),l=r(p.right,l),u=r(p.bottom,u),c.push({dom:d,left:p.left,top:p.top})}}),a*=h,s*=h,l*=h,u*=h;var d=l-a,p=u-s,f=py.createCanvas(),g=AF(f,{renderer:t?"svg":"canvas"});if(g.resize({width:d,height:p}),!t)return e.connectedBackgroundColor&&g.add(new y$({shape:{x:0,y:0,width:d,height:p},style:{fill:e.connectedBackgroundColor}})),pz(c,function(e){var t=new yB({style:{x:e.left*h-a,y:e.top*h-s,image:e.dom}});g.add(t)}),g.refreshImmediately(),f.toDataURL("image/"+(e&&e.type||"png"));var m="";return pz(c,function(e){var t=e.left-a,n=e.top-s;m+='<g transform="translate('+t+","+n+')">'+e.dom+"</g>"}),g.painter.getSvgRoot().innerHTML=m,e.connectedBackgroundColor&&g.painter.setBackgroundColor(e.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()},t.prototype.convertToPixel=function(e,t){return ei(this,"convertToPixel",e,t)},t.prototype.convertFromPixel=function(e,t){return ei(this,"convertFromPixel",e,t)},t.prototype.containPixel=function(e,t){var n;return this._disposed?void this.id:(pz(fj(this._model,e),function(e,i){i.indexOf("Models")>=0&&pz(e,function(e){var r=e.coordinateSystem;if(r&&r.containPoint)n=n||!!r.containPoint(t);else if("seriesModels"===i){var o=this._chartsMap[e.__viewId];o&&o.containPoint&&(n=n||o.containPoint(t,e))}},this)},this),!!n)},t.prototype.getVisual=function(e,t){var n=fj(this._model,e,{defaultMainType:"series"}),i=n.seriesModel.getData(),r=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=r?kN(i,r,t):kB(i,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e,t,n,i=this;pz(Ty,function(e){var t=function(t){var n,r=i.getModel(),o=t.target;if("globalout"===e?n={}:o&&kF(o,function(e){var t=y6(e);if(t&&null!=t.dataIndex){var i=t.dataModel||r.getSeriesByIndex(t.seriesIndex);return n=i&&i.getDataParams(t.dataIndex,t.dataType,o)||{},!0}if(t.eventData)return n=pR({},t.eventData),!0},!0),n){var a=n.componentType,s=n.componentIndex;("markLine"===a||"markPoint"===a||"markArea"===a)&&(a="series",s=n.seriesIndex);var l=a&&null!=s&&r.getComponent(a,s),u=l&&i["series"===l.mainType?"_chartsMap":"_componentsMap"][l.__viewId];n.event=t,n.type=e,i._$eventProcessor.eventInfo={targetEl:o,packedEvent:n,model:l,view:u},i.trigger(e,n)}};t.zrEventfulCallAtLast=!0,i._zr.on(e,t,i)}),pz(Tb,function(e,t){i._messageCenter.on(t,function(e){this.trigger(t,e)},i)}),pz(["selectchanged"],function(e){i._messageCenter.on(e,function(t){this.trigger(e,t)},i)}),e=this._messageCenter,t=this,n=this._api,e.on("selectchanged",function(e){var i=n.getModel();e.isFromClick?(CM("map","selectchanged",t,i,e),CM("pie","selectchanged",t,i,e)):"select"===e.fromAction?(CM("map","selected",t,i,e),CM("pie","selected",t,i,e)):"unselect"===e.fromAction&&(CM("map","unselected",t,i,e),CM("pie","unselected",t,i,e))})},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed)return void this.id;this._disposed=!0,this.getDom()&&fU(this.getDom(),TI,"");var e=this._api,t=this._model;pz(this._componentsViews,function(n){n.dispose(t,e)}),pz(this._chartsViews,function(n){n.dispose(t,e)}),this._zr.dispose(),this._dom=this._model=this._chartsMap=this._componentsMap=this._chartsViews=this._componentsViews=this._scheduler=this._api=this._zr=this._throttledZrFlush=this._theme=this._coordSysMgr=this._messageCenter=null,delete TA[this.id]},t.prototype.resize=function(e){if(!this[Ta]){if(this._disposed)return void this.id;this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption("media"),i=e&&e.silent;this[Ts]&&(null==i&&(i=this[Ts].silent),n=!0,this[Ts]=null),this[Ta]=!0;try{n&&J(this),en.update.call(this,{type:"resize",animation:pR({duration:0},e&&e.animation)})}catch(e){throw this[Ta]=!1,e}this[Ta]=!1,ea.call(this,i),es.call(this,i)}}},t.prototype.showLoading=function(e,t){if(this._disposed)return void this.id;if(pK(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),TC[e]){var n=TC[e](this._api,t),i=this._zr;this._loadingFX=n,i.add(n)}},t.prototype.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},t.prototype.makeActionFromEvent=function(e){var t=pR({},e);return t.type=Tb[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed)return void this.id;if((pK(t)||(t={silent:!!t}),Tx[e.type])&&this._model){if(this[Ta])return void this._pendingActions.push(e);var n=t.silent;eo.call(this,e,n);var i=t.flush;i?this._zr.flush():!1!==i&&fA.browser.weChat&&this._throttledZrFlush(),ea.call(this,n),es.call(this,n)}},t.prototype.updateLabelLayout=function(){Tr.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed)return void this.id;var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){function e(e){e.clearColorPalette(),e.eachSeries(function(e){e.clearColorPalette()})}function t(e){for(var t=[],n=e.currentStates,i=0;i<n.length;i++){var r=n[i];"emphasis"!==r&&"blur"!==r&&"select"!==r&&t.push(r)}e.selected&&e.states.select&&t.push("select"),2===e.hoverState&&e.states.emphasis?t.push("emphasis"):1===e.hoverState&&e.states.blur&&t.push("blur"),e.useStates(t)}function n(e,t){if(!e.preventAutoZ){var n=e.get("z")||0,i=e.get("zlevel")||0;t.eachRendered(function(e){return function e(t,n,i,r){var o=t.getTextContent(),a=t.getTextGuideLine();if(t.isGroup)for(var s=t.childrenRef(),l=0;l<s.length;l++)r=Math.max(e(s[l],n,i,r),r);else t.z=n,t.zlevel=i,r=Math.max(t.z2,r);if(o&&(o.z=n,o.zlevel=i,isFinite(r)&&(o.z2=r+2)),a){var u=t.textGuideLineConfig;a.z=n,a.zlevel=i,isFinite(r)&&(a.z2=r+(u&&u.showAbove?1:-1))}return r}(e,n,i,-1/0),!0})}}function i(e,t){t.eachRendered(function(e){if(!x$(e)){var t=e.getTextContent(),n=e.getTextGuideLine();e.stateTransition&&(e.stateTransition=null),t&&t.stateTransition&&(t.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),e.hasState()?(e.prevStates=e.currentStates,e.clearStates()):e.prevStates&&(e.prevStates=null)}})}function r(e,n){var i=e.getModel("stateAnimation"),r=e.isAnimationEnabled(),o=i.get("duration"),a=o>0?{duration:o,delay:i.get("delay"),easing:i.get("easing")}:null;n.eachRendered(function(e){if(e.states&&e.states.emphasis&&!x$(e)){if(e instanceof yO&&((n=xe(e)).normalFill=e.style.fill,n.normalStroke=e.style.stroke,n.selectFill=(i=e.states.select||{}).style&&i.style.fill||null,n.selectStroke=i.style&&i.style.stroke||null),e.__dirty){var n,i,o=e.prevStates;o&&e.useStates(o)}if(r){e.stateTransition=a;var s=e.getTextContent(),l=e.getTextGuideLine();s&&(s.stateTransition=a),l&&(l.stateTransition=a)}e.__dirty&&t(e)}})}J=function(e){var t=e._scheduler;t.restorePipelines(e._model),t.prepareStageTasks(),ee(e,!0),ee(e,!1),t.plan()},ee=function(e,t){for(var n=e._model,i=e._scheduler,r=t?e._componentsViews:e._chartsViews,o=t?e._componentsMap:e._chartsMap,a=e._zr,s=e._api,l=0;l<r.length;l++)r[l].__alive=!1;function u(e){var l=e.__requireNewView;e.__requireNewView=!1;var u="_ec_"+e.id+"_"+e.type,c=!l&&o[u];if(!c){var h=gR(e.type);(c=new(t?ka.getClass(h.main,h.sub):Mf.getClass(h.sub))).init(n,s),o[u]=c,r.push(c),a.add(c.group)}e.__viewId=c.__id=u,c.__alive=!0,c.__model=e,c.group.__ecComponentInfo={mainType:e.mainType,index:e.componentIndex},t||i.prepareView(c,e,n,s)}t?n.eachComponent(function(e,t){"series"!==e&&u(t)}):n.eachSeries(u);for(var l=0;l<r.length;){var c=r[l];c.__alive?l++:(t||c.renderTask.dispose(),a.remove(c.group),c.dispose(n,s),r.splice(l,1),o[c.__id]===c&&delete o[c.__id],c.__id=c.group.__ecComponentInfo=null)}},et=function(e,t,n,i,r){var o,a=e._model;if(a.setUpdatePayload(n),!i)return void pz([].concat(e._componentsViews).concat(e._chartsViews),c);var s={};s[i+"Id"]=n[i+"Id"],s[i+"Index"]=n[i+"Index"],s[i+"Name"]=n[i+"Name"];var l={mainType:i,query:s};r&&(l.subType=r);var u=n.excludeSeriesId;function c(i){i&&i.__alive&&i[t]&&i[t](i.__model,a,e._api,n)}null!=u&&(o=fi(),pz(fD(u),function(e){var t=fL(e,null);null!=t&&o.set(t,!0)})),a&&a.eachComponent(l,function(t){if(!(o&&null!=o.get(t.id))){if(xz(n))if(t instanceof St)n.type!==xr||n.notBlur||t.get(["emphasis","disabled"])||function(e,t,n){var i=e.seriesIndex,r=e.getData(t.dataType);if(r){var o=fF(r,t);o=(pU(o)?o[0]:o)||0;var a=r.getItemGraphicEl(o);if(!a)for(var s=r.count(),l=0;!a&&l<s;)a=r.getItemGraphicEl(l++);if(a){var u=y6(a);xk(i,u.focus,u.blurScope,n)}else{var c=e.get(["emphasis","focus"]),h=e.get(["emphasis","blurScope"]);null!=c&&xk(i,c,h,n)}}}(t,n,e._api);else{var i=xD(t.mainType,t.componentIndex,n.name,e._api),r=i.focusSelf,a=i.dispatchers;n.type===xr&&r&&!n.notBlur&&xT(t.mainType,t.componentIndex,e._api),a&&pz(a,function(e){n.type===xr?x_(e):xM(e)})}else if(xF(n)&&t instanceof St){if(e._api,xF(n)){var s=n.dataType,l=fF(t.getData(s),n);pU(l)||(l=[l]),t[n.type===xl?"toggleSelect":n.type===xa?"select":"unselect"](l,s)}xI(t),eg(e)}}},e),a&&a.eachComponent(l,function(t){o&&null!=o.get(t.id)||c(e["series"===i?"_chartsMap":"_componentsMap"][t.__viewId])},e)},en={prepareAndUpdate:function(e){J(this),en.update.call(this,e,{optionChanged:null!=e.newOption})},update:function(t,n){var i=this._model,r=this._api,o=this._zr,a=this._coordSysMgr,s=this._scheduler;if(i){i.setUpdatePayload(t),s.restoreData(i,t),s.performSeriesTasks(i),a.create(i,r),s.performDataProcessorTasks(i,t),er(this,i),a.update(i,r),e(i),s.performVisualTasks(i,t),ec(this,i,r,t,n);var l=i.get("backgroundColor")||"transparent",u=i.get("darkMode");o.setBackgroundColor(l),null!=u&&"auto"!==u&&o.setDarkMode(u),Tr.trigger("afterupdate",i,r)}},updateTransform:function(t){var n=this,i=this._model,r=this._api;if(i){i.setUpdatePayload(t);var o=[];i.eachComponent(function(e,a){if("series"!==e){var s=n.getViewOfComponentModel(a);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(a,i,r,t);l&&l.update&&o.push(s)}else o.push(s)}});var a=fi();i.eachSeries(function(e){var o=n._chartsMap[e.__viewId];if(o.updateTransform){var s=o.updateTransform(e,i,r,t);s&&s.update&&a.set(e.uid,1)}else a.set(e.uid,1)}),e(i),this._scheduler.performVisualTasks(i,t,{setDirty:!0,dirtyMap:a}),ed(this,i,r,t,{},a),Tr.trigger("afterupdate",i,r)}},updateView:function(t){var n=this._model;n&&(n.setUpdatePayload(t),Mf.markUpdateMethod(t,"updateView"),e(n),this._scheduler.performVisualTasks(n,t,{setDirty:!0}),ec(this,n,this._api,t,{}),Tr.trigger("afterupdate",n,this._api))},updateVisual:function(t){var n=this,i=this._model;i&&(i.setUpdatePayload(t),i.eachSeries(function(e){e.getData().clearAllVisual()}),Mf.markUpdateMethod(t,"updateVisual"),e(i),this._scheduler.performVisualTasks(i,t,{visualType:"visual",setDirty:!0}),i.eachComponent(function(e,r){if("series"!==e){var o=n.getViewOfComponentModel(r);o&&o.__alive&&o.updateVisual(r,i,n._api,t)}}),i.eachSeries(function(e){n._chartsMap[e.__viewId].updateVisual(e,i,n._api,t)}),Tr.trigger("afterupdate",i,this._api))},updateLayout:function(e){en.update.call(this,e)}},ei=function(e,t,n,i){if(e._disposed)return void e.id;for(var r,o=e._model,a=e._coordSysMgr.getCoordinateSystems(),s=fj(o,n),l=0;l<a.length;l++){var u=a[l];if(u[t]&&null!=(r=u[t](o,s,i)))return r}},er=function(e,t){var n=e._chartsMap,i=e._scheduler;t.eachSeries(function(e){i.updateStreamModes(e,n[e.__viewId])})},eo=function(e,t){var n,i=this,r=this.getModel(),o=e.type,a=e.escapeConnect,s=Tx[o],l=s.actionInfo,u=(l.update||"update").split(":"),c=u.pop(),h=null!=u[0]&&gR(u[0]);this[Ta]=!0;var d=[e],p=!1;e.batch&&(p=!0,d=pV(e.batch,function(t){return(t=pL(pR({},t),e)).batch=null,t}));var f=[],g=xF(e),m=xz(e);if(m&&xA(this._api),pz(d,function(t){if((n=(n=s.action(t,i._model,i._api))||pR({},t)).type=l.event||n.type,f.push(n),m){var r=fH(e),o=r.queryOptionMap;et(i,c,t,r.mainTypeSpecified?o.keys()[0]:"series"),eg(i)}else g?(et(i,c,t,"series"),eg(i)):h&&et(i,c,t,h.main,h.sub)}),"none"!==c&&!m&&!g&&!h)try{this[Ts]?(J(this),en.update.call(this,e),this[Ts]=null):en[c].call(this,e)}catch(e){throw this[Ta]=!1,e}if(n=p?{type:l.event||o,escapeConnect:a,batch:f}:f[0],this[Ta]=!1,!t){var v=this._messageCenter;if(v.trigger(n.type,n),g){var y,x={type:"selectchanged",escapeConnect:a,selected:(y=[],r.eachSeries(function(e){pz(e.getAllData(),function(t){t.data;var n=t.type,i=e.getSelectedDataIndices();if(i.length>0){var r={dataIndex:i,seriesIndex:e.seriesIndex};null!=n&&(r.dataType=n),y.push(r)}})}),y),isFromClick:e.isFromClick||!1,fromAction:e.type,fromActionPayload:e};v.trigger(x.type,x)}}},ea=function(e){for(var t=this._pendingActions;t.length;){var n=t.shift();eo.call(this,n,e)}},es=function(e){e||this.trigger("updated")},el=function(e,t){e.on("rendered",function(n){t.trigger("rendered",n),!e.animation.isFinished()||t[Ts]||t._scheduler.unfinished||t._pendingActions.length||t.trigger("finished")})},eu=function(e,t){e.on("mouseover",function(e){var n,i,r,o,a,s=kF(e.target,xB);s&&(n=t._api,o=(r=xD((i=y6(s)).componentMainType,i.componentIndex,i.componentHighDownName,n)).dispatchers,a=r.focusSelf,o?(a&&xT(i.componentMainType,i.componentIndex,n),pz(o,function(t){return xw(t,e)})):(xk(i.seriesIndex,i.focus,i.blurScope,n),"self"===i.focus&&xT(i.componentMainType,i.componentIndex,n),xw(s,e)),eg(t))}).on("mouseout",function(e){var n,i,r,o=kF(e.target,xB);o&&(xA(n=t._api),(r=xD((i=y6(o)).componentMainType,i.componentIndex,i.componentHighDownName,n).dispatchers)?pz(r,function(t){return xS(t,e)}):xS(o,e),eg(t))}).on("click",function(e){var n=kF(e.target,function(e){return null!=y6(e).dataIndex},!0);if(n){var i=n.selected?"unselect":"select",r=y6(n);t._api.dispatchAction({type:i,dataType:r.dataType,dataIndexInside:r.dataIndex,seriesIndex:r.seriesIndex,isFromClick:!0})}})},ec=function(e,t,n,i,r){!function(e){var t=[],n=[],i=!1;if(e.eachComponent(function(e,r){var o=r.get("zlevel")||0,a=r.get("z")||0,s=r.getZLevelKey();i=i||!!s,("series"===e?n:t).push({zlevel:o,z:a,idx:r.componentIndex,type:e,key:s})}),i){var r,o,a=t.concat(n);Ap(a,function(e,t){return e.zlevel===t.zlevel?e.z-t.z:e.zlevel-t.zlevel}),pz(a,function(t){var n=e.getComponent(t.type,t.idx),i=t.zlevel,a=t.key;null!=r&&(i=Math.max(r,i)),a?(i===r&&a!==o&&i++,o=a):o&&(i===r&&i++,o=""),r=i,n.setZLevel(i)})}}(t),eh(e,t,n,i,r),pz(e._chartsViews,function(e){e.__alive=!1}),ed(e,t,n,i,r),pz(e._chartsViews,function(e){e.__alive||e.remove(t,n)})},eh=function(e,t,o,a,s,l){pz(l||e._componentsViews,function(e){var s=e.__model;i(s,e),e.render(s,t,o,a),n(s,e),r(s,e)})},ed=function(e,t,o,a,s,l){var u,c,h,d,p=e._scheduler;s=pR(s||{},{updatedSeries:t.getSeries()}),Tr.trigger("series:beforeupdate",t,o,s);var f=!1;t.eachSeries(function(t){var n,r,o,s=e._chartsMap[t.__viewId];s.__alive=!0;var u=s.renderTask;p.updatePayload(u,a),i(t,s),l&&l.get(t.uid)&&u.dirty(),u.perform(p.getPerformArgs(u))&&(f=!0),s.group.silent=!!t.get("silent"),n=t,r=s,o=n.get("blendMode")||null,r.eachRendered(function(e){e.isGroup||(e.style.blend=o)}),xI(t)}),p.unfinished=f||p.unfinished,Tr.trigger("series:layoutlabels",t,o,s),Tr.trigger("series:transition",t,o,s),t.eachSeries(function(t){var i=e._chartsMap[t.__viewId];n(t,i),r(t,i)}),u=e,c=t,h=u._zr.storage,d=0,h.traverse(function(e){!e.isGroup&&d++}),!(d>c.get("hoverLayerThreshold"))||fA.node||fA.worker||c.eachSeries(function(e){if(!e.preventUsingHoverLayer){var t=u._chartsMap[e.__viewId];t.__alive&&t.eachRendered(function(e){e.states.emphasis&&(e.states.emphasis.hoverLayer=!0)})}}),Tr.trigger("series:afterupdate",t,o,s)},eg=function(e){e[Tl]=!0,e.getZr().wakeUp()},em=function(e){e[Tl]&&(e.getZr().storage.traverse(function(e){x$(e)||t(e)}),e[Tl]=!1)},ep=function(e){return new(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return gO(n,t),n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(null!=n)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){x_(t,n),eg(e)},n.prototype.leaveEmphasis=function(t,n){xM(t,n),eg(e)},n.prototype.enterBlur=function(t){xv(t,xp),eg(e)},n.prototype.leaveBlur=function(t){xv(t,xf),eg(e)},n.prototype.enterSelect=function(t){xv(t,xg),eg(e)},n.prototype.leaveSelect=function(t){xv(t,xm),eg(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n}(AZ))(e)},ef=function(e){function t(e,t){for(var n=0;n<e.length;n++)e[n][Tc]=t}pz(Tb,function(n,i){e._messageCenter.on(i,function(n){if(Tk[e.group]&&0!==e[Tc]&&(!n||!n.escapeConnect)){var i=e.makeActionFromEvent(n),r=[];pz(TA,function(t){t!==e&&t.group===e.group&&r.push(t)}),t(r,0),pz(r,function(e){1!==e[Tc]&&e.dispatchAction(i)}),t(r,2)}})})}}(),t}(vO),Tv=Tm.prototype;Tv.on=Th("on"),Tv.off=Th("off"),Tv.one=function(e,t,n){var i=this;this.on.call(this,e,function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];t&&t.apply&&t.apply(this,r),i.off(e,n)},n)};var Ty=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"],Tx={},Tb={},Tw=[],TS=[],T_=[],TM={},TC={},TA={},Tk={},TT=new Date-0,TD=new Date-0,TI="_echarts_instance_";function TO(e){0>pN(TS,e)&&TS.push(e)}function TP(e,t){TB(Tw,e,t,2e3)}function TE(e,t){Tr.on(e,t)}function TR(e,t,n){pq(t)&&(n=t,t="");var i=pK(e)?e.type:[e,e={event:t}][0];e.event=(e.event||i).toLowerCase(),Tb[t=e.event]||(p8(Tu.test(i)&&Tu.test(t)),Tx[i]||(Tx[i]={action:n,actionInfo:e}),Tb[t]=i)}function TL(e,t){TB(T_,e,t,3e3,"visual")}var TN=[];function TB(e,t,n,i,r){if((pq(t)||pK(t))&&(n=t,t=i),!(pN(TN,n)>=0)){TN.push(n);var o=kf.wrapStageHandler(n,r);o.__prio=t,o.__raw=n,e.push(o)}}TL(2e3,{createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",r=e.getModel(i),o=kc(e,i)(r),a=r.getShallow("decal");a&&(n.setVisual("decal",a),a.dirty=!0);var s=kh(e,i),l=o[s],u=pq(l)?l:null,c="auto"===o.fill||"auto"===o.stroke;if(!o[s]||u||c){var h=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[s]||(o[s]=h,n.setVisual("colorFromPalette",!0)),o.fill="auto"===o.fill||pq(o.fill)?h:o.fill,o.stroke="auto"===o.stroke||pq(o.stroke)?h:o.stroke}if(n.setVisual("style",o),n.setVisual("drawType",s),!t.isSeriesFiltered(e)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(t,n){var i=e.getDataParams(n),r=pR({},o);r[s]=u(i),t.setItemVisual(n,"style",r)}}}}),TL(4500,{createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",r=kc(e,i),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[i]){kd.option=n[i];var a=r(kd);pR(e.ensureUniqueItemVisual(t,"style"),a),kd.option.decal&&(e.setItemVisual(t,"decal",kd.option.decal),kd.option.decal.dirty=!0),o in a&&e.setItemVisual(t,"colorFromPalette",!1)}}:null}}}}),TL(4500,{performRawSeries:!0,overallReset:function(e){var t=fi();e.eachSeries(function(e){var n=e.getColorBy();if(!e.isColorBySeries()){var i=e.type+"-"+n,r=t.get(i);r||(r={},t.set(i,r)),ks(e).scope=r}}),e.eachSeries(function(t){if(!(t.isColorBySeries()||e.isSeriesFiltered(t))){var n=t.getRawData(),i={},r=t.getData(),o=ks(t).scope,a=t.visualStyleAccessPath||"itemStyle",s=kh(t,a);r.each(function(e){i[r.getRawIndex(e)]=e}),n.each(function(e){var a=i[e];if(r.getItemVisual(a,"colorFromPalette")){var l=r.ensureUniqueItemVisual(a,"style"),u=n.getName(e)||e+"",c=n.count();l[s]=t.getColorFromPalette(u,o,c)}})}})}}),TL(2e3,{createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual("legendIcon",e.legendIcon),e.hasSymbolVisual){for(var i={},r={},o=!1,a=0;a<kR.length;a++){var s=kR[a],l=e.get(s);pq(l)?(o=!0,r[s]=l):i[s]=l}if(i.symbol=i.symbol||e.defaultSymbol,n.setVisual(pR({legendIcon:e.legendIcon||i.symbol,symbolKeepAspect:e.get("symbolKeepAspect")},i)),!t.isSeriesFiltered(e)){var u=pW(r);return{dataEach:o?function(t,n){for(var i=e.getRawValue(n),o=e.getDataParams(n),a=0;a<u.length;a++){var s=u[a];t.setItemVisual(n,s,r[s](i,o))}}:null}}}}}),TL(4500,{createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(e.hasSymbolVisual&&!t.isSeriesFiltered(e))return{dataEach:e.getData().hasItemOption?function(e,t){for(var n=e.getItemModel(t),i=0;i<kL.length;i++){var r=kL[i],o=n.getShallow(r,!0);null!=o&&e.setItemVisual(t,r,o)}}:null}}}),TL(7e3,function(e,t){e.eachRawSeries(function(n){if(!e.isSeriesFiltered(n)){var i=n.getData();i.hasItemVisual()&&i.each(function(e){var n=i.getItemVisual(e,"decal");n&&(i.ensureUniqueItemVisual(e,"style").decal=Tn(n,t))});var r=i.getVisual("decal");r&&(i.getVisual("style").decal=Tn(r,t))}})}),TO(kr),TP(900,function(e){var t=fi();e.eachSeries(function(e){var n=e.get("stack");if(n){var i=t.get(n)||t.set(n,[]),r=e.getData(),o={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:e};if(!o.stackedDimension||!(o.isStackedByIndex||o.stackedByDimension))return;i.length&&r.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(o)}}),t.each(ko)}),TC.default=function(e,t){pL(t=t||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n,i=new SI,r=new y$({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});i.add(r);var o=new y4({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new y$({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});return i.add(a),t.showSpinner&&((n=new _C({shape:{startAngle:-kp/2,endAngle:-kp/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*kp/2}).start("circularInOut"),n.animateShape(!0).when(1e3,{startAngle:3*kp/2}).delay(300).start("circularInOut"),i.add(n)),i.resize=function(){var i=o.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&i?10:0)-i)/2-(t.showSpinner&&i?0:5+i/2)+(t.showSpinner?0:i/2)+(i?0:s),u=e.getHeight()/2;t.showSpinner&&n.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),r.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},i.resize(),i},TR({type:xr,event:xr,update:xr},fs),TR({type:xo,event:xo,update:xo},fs),TR({type:xa,event:xa,update:xa},fs),TR({type:xs,event:xs,update:xs},fs),TR({type:xl,event:xl,update:xl},fs),TM.light={color:kk,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],kk]},TM.dark=kP;var TF=[],Tz={registerPreprocessor:TO,registerProcessor:TP,registerPostInit:function(e){TE("afterinit",e)},registerPostUpdate:function(e){TE("afterupdate",e)},registerUpdateLifecycle:TE,registerAction:TR,registerCoordinateSystem:function(e,t){SS.register(e,t)},registerLayout:function(e,t){TB(T_,e,t,1e3,"layout")},registerVisual:TL,registerTransform:function(e){var t=(e=pP(e)).type;t||wC("");var n=t.split(":");2!==n.length&&wC("");var i=!1;"echarts"===n[0]&&(t=n[1],i=!0),e.__isBuiltIn=i,wR.set(t,e)},registerLoading:function(e,t){TC[e]=t},registerMap:function(e,t,n){var i=To.registerMap;i&&i(e,t,n)},registerImpl:function(e,t){To[e]=t},PRIORITY:{PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:2e3,CHART:3e3,POST_CHART_LAYOUT:4600,COMPONENT:4e3,BRUSH:5e3,CHART_ITEM:4500,ARIA:6e3,DECAL:7e3}},ComponentModel:wr,ComponentView:ka,SeriesModel:St,ChartView:Mf,registerComponentModel:function(e){wr.registerClass(e)},registerComponentView:function(e){ka.registerClass(e)},registerSeriesModel:function(e){St.registerClass(e)},registerChartView:function(e){Mf.registerClass(e)},registerSubTypeDefaulter:function(e,t){wr.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){AL[e]=t}};function TV(e){pU(e)?pz(e,function(e){TV(e)}):pN(TF,e)>=0||(TF.push(e),pq(e)&&(e={install:e}),e.install(Tz))}var Tj=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return gO(t,e),t.prototype.getInitialData=function(e,t){return SA(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?5e3:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?1e4:this.get("progressiveThreshold"):e},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},t}(St),TH=function(){},TW=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return gO(t,e),t.prototype.getDefaultShape=function(){return new TH},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(e,t){var n,i=t.points,r=t.size,o=this.symbolProxy,a=o.shape,s=e.getContext?e.getContext():e,l=s&&r[0]<4,u=this.softClipShape;if(l){this._ctx=s;return}for(this._ctx=null,n=this._off;n<i.length;){var c=i[n++],h=i[n++];!(isNaN(c)||isNaN(h))&&(!u||u.contain(c,h))&&(a.x=c-r[0]/2,a.y=h-r[1]/2,a.width=r[0],a.height=r[1],o.buildPath(e,a,!0))}this.incremental&&(this._off=n,this.notClear=!0)},t.prototype.afterBrush=function(){var e,t=this.shape,n=t.points,i=t.size,r=this._ctx,o=this.softClipShape;if(r){for(e=this._off;e<n.length;){var a=n[e++],s=n[e++];!(isNaN(a)||isNaN(s))&&(!o||o.contain(a,s))&&r.fillRect(a-i[0]/2,s-i[1]/2,i[0],i[1])}this.incremental&&(this._off=e,this.notClear=!0)}},t.prototype.findDataIndex=function(e,t){for(var n=this.shape,i=n.points,r=n.size,o=Math.max(r[0],4),a=Math.max(r[1],4),s=i.length/2-1;s>=0;s--){var l=2*s,u=i[l]-o/2,c=i[l+1]-a/2;if(e>=u&&t>=c&&e<=u+o&&t<=c+a)return s}return -1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),i=this.getBoundingRect();return(e=n[0],t=n[1],i.contain(e,t))?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,i=t.size,r=i[0],o=i[1],a=1/0,s=1/0,l=-1/0,u=-1/0,c=0;c<n.length;){var h=n[c++],d=n[c++];a=Math.min(h,a),l=Math.max(h,l),s=Math.min(d,s),u=Math.max(d,u)}e=this._rect=new mr(a-r/2,s-o/2,l-a+r,u-s+o)}return e},t}(yO),TG=function(){function e(){this.group=new SI}return e.prototype.updateData=function(e,t){this._clear();var n=this._create();n.setShape({points:e.getLayout("points")}),this._setCommon(n,e,t)},e.prototype.updateLayout=function(e){var t=e.getLayout("points");this.group.eachChild(function(e){if(null!=e.startIndex){var n=(e.endIndex-e.startIndex)*2,i=4*e.startIndex*2;t=new Float32Array(t.buffer,i,n)}e.setShape("points",t),e.reset()})},e.prototype.incrementalPrepareUpdate=function(e){this._clear()},e.prototype.incrementalUpdate=function(e,t,n){var i=this._newAdded[0],r=t.getLayout("points"),o=i&&i.shape.points;if(o&&o.length<2e4){var a=o.length,s=new Float32Array(a+r.length);s.set(o),s.set(r,a),i.endIndex=e.end,i.setShape({points:s})}else{this._newAdded=[];var l=this._create();l.startIndex=e.start,l.endIndex=e.end,l.incremental=!0,l.setShape({points:r}),this._setCommon(l,t,n)}},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new TW({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},e.prototype._setCommon=function(e,t,n){var i=t.hostModel;n=n||{};var r=t.getVisual("symbolSize");e.setShape("size",r instanceof Array?r:[r,r]),e.softClipShape=n.clipShape||null,e.symbolProxy=MQ(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<4;e.useStyle(i.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var a=t.getVisual("style"),s=a&&a.fill;s&&e.setColor(s);var l=y6(e);l.seriesIndex=i.seriesIndex,e.on("mousemove",function(t){l.dataIndex=null;var n=e.hoverDataIdx;n>=0&&(l.dataIndex=n+(e.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),T$=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.render=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).updateData(i,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).incrementalPrepareUpdate(i),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var i=e.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var r=Cv("").reset(e,t,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},t.prototype.eachRendered=function(e){this._symbolDraw&&this._symbolDraw.eachRendered(e)},t.prototype._getClipShape=function(e){if(e.get("clip",!0)){var t=e.coordinateSystem;return t&&t.getArea&&t.getArea(.1)}},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,i=t.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new TG:new M8,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(Mf),TU=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t}(wr),Tq=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}(),TY=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",fW).models[0]},t.type="cartesian2dAxis",t}(wr);pB(TY,Tq);var TZ={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},TX=pE({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},TZ),TK=pE({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},TZ),TQ=pE({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},TK),TJ=pL({logBase:10},TK);let T0={category:TX,value:TK,time:TQ,log:TJ};var T1=0,T2=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++T1}return e.createByAxisModel=function(t){var n=t.option,i=n.data,r=i&&pV(i,T5);return new e({categories:r,needCollect:!r,deduplication:!1!==n.dedplication})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!pY(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return null==(t=i.get(e))&&(n?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||(this._map=fi(this.categories))},e}();function T5(e){return pK(e)&&null!=e.value?e.value:e+""}var T3={value:1,category:1,time:1,log:1};function T4(e,t,n,i){pz(T3,function(r,o){var a=pE(pE({},T0[o],!0),i,!0),s=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t+"Axis."+o,n}return gO(n,e),n.prototype.mergeDefaultAndTheme=function(e,t){var n=we(this),i=n?wn(e):{};pE(e,t.getTheme().get(o+"Axis")),pE(e,this.getDefaultOption()),e.type=T6(e),n&&wt(e,i,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=T2.createByAxisModel(this))},n.prototype.getCategories=function(e){var t=this.option;if("category"===t.type)return e?t.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=t+"Axis."+o,n.defaultOption=a,n}(n);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",T6)}function T6(e){return e.type||(e.data?"category":"value")}var T8=function(){function e(e){this._setting=e||{},this._extent=[1/0,-1/0]}return e.prototype.getSetting=function(e){return this._setting[e]},e.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1])},e.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t)},e.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}();function T9(e){return"interval"===e.type||"log"===e.type}function T7(e){var t=Math.pow(10,fx(e)),n=e/t;return n?2===n?n=3:3===n?n=5:n*=2:n=1,fh(n*t)}gV(T8);function De(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function Dt(e,t){return e>=t[0]&&e<=t[1]}function Dn(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function Di(e,t){return e*(t[1]-t[0])+t[0]}var Dr=function(e){function t(t){var n=e.call(this,t)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new T2({})),pU(i)&&(i=new T2({categories:pV(i,function(e){return pK(e)?e.value:e})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return gO(t,e),t.prototype.parse=function(e){return null==e?NaN:pY(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return Dt(e=this.parse(e),this._extent)&&null!=this._ordinalMeta.categories[e]},t.prototype.normalize=function(e){return Dn(e=this._getTickNumber(this.parse(e)),this._extent)},t.prototype.scale=function(e){return e=Math.round(Di(e,this._extent)),this.getRawOrdinalNumber(e)},t.prototype.getTicks=function(){for(var e=[],t=this._extent,n=t[0];n<=t[1];)e.push({value:n}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(null==e){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],r=0,o=this._ordinalMeta.categories.length,a=Math.min(o,t.length);r<a;++r){var s=t[r];n[r]=s,i[s]=r}for(var l=0;r<o;++r){for(;null!=i[l];)l++;n.push(l),i[l]=r}},t.prototype._getTickNumber=function(e){var t=this._ticksByOrdinalNumber;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getRawOrdinalNumber=function(e){var t=this._ordinalNumbersByTick;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getLabel=function(e){if(!this.isBlank()){var t=this.getRawOrdinalNumber(e.value),n=this._ordinalMeta.categories[t];return null==n?"":n+""}},t.prototype.count=function(){return this._extent[1]-this._extent[0]+1},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.isInExtentRange=function(e){return e=this._getTickNumber(e),this._extent[0]<=e&&this._extent[1]>=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t}(T8);T8.registerClass(Dr);var Do=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return gO(t,e),t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return Dt(e,this._extent)},t.prototype.normalize=function(e){return Dn(e,this._extent)},t.prototype.scale=function(e){return Di(e,this._extent)},t.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(t)||(n[1]=parseFloat(t))},t.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1]),this.setExtent(t[0],t[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=fp(e)+2},t.prototype.getTicks=function(e){var t=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!t)return o;n[0]<i[0]&&(e?o.push({value:fh(i[0]-t,r)}):o.push({value:n[0]}));for(var a=i[0];a<=i[1]&&(o.push({value:a}),(a=fh(a+t,r))!==o[o.length-1].value);)if(o.length>1e4)return[];var s=o.length?o[o.length-1].value:i[1];return n[1]>s&&(e?o.push({value:fh(s+t,r)}):o.push({value:n[1]})),o},t.prototype.getMinorTicks=function(e){for(var t=this.getTicks(!0),n=[],i=this.getExtent(),r=1;r<t.length;r++){for(var o=t[r],a=t[r-1],s=0,l=[],u=(o.value-a.value)/e;s<e-1;){var c=fh(a.value+(s+1)*u);c>i[0]&&c<i[1]&&l.push(c),s++}n.push(l)}return n},t.prototype.getLabel=function(e,t){if(null==e)return"";var n=t&&t.precision;return null==n?n=fp(e.value)||0:"auto"===n&&(n=this._intervalPrecision),bK(fh(e.value,n,!0))},t.prototype.calcNiceTicks=function(e,t,n){e=e||5;var i=this._extent,r=i[1]-i[0];if(isFinite(r)){r<0&&(r=-r,i.reverse());var o,a,s,l,u,c,h=(s=e,u=(l={}).interval=fb((i[1]-i[0])/s,!0),null!=t&&u<t&&(u=l.interval=t),null!=n&&u>n&&(u=l.interval=n),c=l.intervalPrecision=fp(u)+2,o=l.niceTickExtent=[fh(Math.ceil(i[0]/u)*u,c),fh(Math.floor(i[1]/u)*u,c)],a=i,isFinite(o[0])||(o[0]=a[0]),isFinite(o[1])||(o[1]=a[1]),De(o,0,a),De(o,1,a),o[0]>o[1]&&(o[0]=o[1]),l);this._intervalPrecision=h.intervalPrecision,this._interval=h.interval,this._niceExtent=h.niceTickExtent}},t.prototype.calcNiceExtent=function(e){var t=this._extent;if(t[0]===t[1])if(0!==t[0]){var n=Math.abs(t[0]);e.fixMax||(t[1]+=n/2),t[0]-=n/2}else t[1]=1;isFinite(t[1]-t[0])||(t[0]=0,t[1]=1),this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval);var i=this._interval;e.fixMin||(t[0]=fh(Math.floor(t[0]/i)*i)),e.fixMax||(t[1]=fh(Math.ceil(t[1]/i)*i))},t.prototype.setNiceExtent=function(e,t){this._niceExtent=[e,t]},t.type="interval",t}(T8);T8.registerClass(Do);var Da=function(e,t,n,i){for(;n<i;){var r=n+i>>>1;e[r][1]<t?n=r+1:i=r}return n},Ds=function(e){function t(t){var n=e.call(this,t)||this;return n.type="time",n}return gO(t,e),t.prototype.getLabel=function(e){var t=this.getSetting("useUTC");return bL(e.value,bI[function(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(bR(this._minLevelUnit))]||bI.second,t,this.getSetting("locale"))},t.prototype.getFormattedLabel=function(e,t,n){var i=this.getSetting("useUTC");return function(e,t,n,i,r){var o=null;if(pY(n))o=n;else if(pq(n))o=n(e.value,t,{level:e.level});else{var a=pR({},bT);if(e.level>0)for(var s=0;s<bO.length;++s)a[bO[s]]="{primary|"+a[bO[s]]+"}";var l=n?!1===n.inherit?n:pL(n,a):a,u=bN(e.value,r);if(l[u])o=l[u];else if(l.inherit){for(var c=bP.indexOf(u),s=c-1;s>=0;--s)if(l[u]){o=l[u];break}o=o||a.none}if(pU(o)){var h=null==e.level?0:e.level>=0?e.level:o.length+e.level;h=Math.min(h,o.length-1),o=o[h]}}return bL(new Date(e.value),o,r,i)}(e,t,n,this.getSetting("locale"),i)},t.prototype.getTicks=function(){var e=this._interval,t=this._extent,n=[];if(!e)return n;n.push({value:t[0],level:0});var i=this.getSetting("useUTC"),r=function(e,t,n,i){for(var r=0,o=[],a=[],s=0,l=0,u=0;u<bP.length&&r++<1e4;++u){var c,h=bR(bP[u]);if((c=bP[u])===bR(c)&&(!function(e,r,o){var a=[],s=!r.length;if(!function(e,t,n,i){var r=fy(t),o=fy(n),a=function(e){return bB(r,e,i)===bB(o,e,i)},s=function(){return a("year")},l=function(){return s()&&a("month")},u=function(){return l()&&a("day")},c=function(){return u()&&a("hour")},h=function(){return c()&&a("minute")},d=function(){return h()&&a("second")};switch(e){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return h();case"second":return d();case"millisecond":return d()&&a("millisecond")}}(bR(e),i[0],i[1],n)){s&&(r=[{value:function(e,t,n){var i=new Date(e);switch(bR(t)){case"year":case"month":i[b$(n)](0);case"day":i[bU(n)](1);case"hour":i[bq(n)](0);case"minute":i[bY(n)](0);case"second":i[bZ(n)](0),i[bX(n)](0)}return i.getTime()}(new Date(i[0]),e,n)},{value:i[1]}]);for(var l=0;l<r.length-1;l++){var u=r[l].value,c=r[l+1].value;if(u!==c){var h,d,p,f=void 0,g=void 0,m=void 0;switch(e){case"year":f=Math.max(1,Math.round(t/864e5/365)),g=bF(n),m=n?"setUTCFullYear":"setFullYear";break;case"half-year":case"quarter":case"month":f=(h=t/2592e6)>6?6:h>3?3:h>2?2:1,g=bz(n),m=b$(n);break;case"week":case"half-week":case"day":f=(d=t/864e5)>16?16:d>7.5?7:d>3.5?4:d>1.5?2:1,g=bV(n),m=bU(n);break;case"half-day":case"quarter-day":case"hour":f=(p=t/36e5)>12?12:p>6?6:p>3.5?4:p>2?2:1,g=bj(n),m=bq(n);break;case"minute":f=Du(t,!0),g=bH(n),m=bY(n);break;case"second":f=Du(t,!1),g=bW(n),m=bZ(n);break;case"millisecond":f=fb(t,!0),g=bG(n),m=bX(n)}!function(e,t,n,r,o,a){for(var s=new Date(t),l=t,u=s[r]();l<n&&l<=i[1];)a.push({value:l}),u+=e,s[o](u),l=s.getTime();a.push({value:l,notAdd:!0})}(f,u,c,g,m,a),"year"===e&&o.length>1&&0===l&&o.unshift({value:o[0].value-f})}}for(var l=0;l<a.length;l++)o.push(a[l])}}(bP[u],o[o.length-1]||[],a),h!==(bP[u+1]?bR(bP[u+1]):null))){if(a.length){l=s,a.sort(function(e,t){return e.value-t.value});for(var d=[],p=0;p<a.length;++p){var f=a[p].value;(0===p||a[p-1].value!==f)&&(d.push(a[p]),f>=i[0]&&f<=i[1]&&s++)}var g=(i[1]-i[0])/t;if(s>1.5*g&&l>g/1.5||(o.push(d),s>g||e===bP[u]))break}a=[]}}for(var m=pH(pV(o,function(e){return pH(e,function(e){return e.value>=i[0]&&e.value<=i[1]&&!e.notAdd})}),function(e){return e.length>0}),v=[],y=m.length-1,u=0;u<m.length;++u)for(var x=m[u],b=0;b<x.length;++b)v.push({value:x[b].value,level:y-u});v.sort(function(e,t){return e.value-t.value});for(var w=[],u=0;u<v.length;++u)(0===u||v[u].value!==v[u-1].value)&&w.push(v[u]);return w}(this._minLevelUnit,this._approxInterval,i,t);return(n=n.concat(r)).push({value:t[1],level:0}),n},t.prototype.calcNiceExtent=function(e){var t=this._extent;if(t[0]===t[1]&&(t[0]-=864e5,t[1]+=864e5),t[1]===-1/0&&t[0]===1/0){var n=new Date;t[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),t[0]=t[1]-864e5}this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval)},t.prototype.calcNiceTicks=function(e,t,n){e=e||10;var i=this._extent,r=i[1]-i[0];this._approxInterval=r/e,null!=t&&this._approxInterval<t&&(this._approxInterval=t),null!=n&&this._approxInterval>n&&(this._approxInterval=n);var o=Dl.length,a=Math.min(Da(Dl,this._approxInterval,0,o),o-1);this._interval=Dl[a][1],this._minLevelUnit=Dl[Math.max(a-1,0)][0]},t.prototype.parse=function(e){return pX(e)?e:+fy(e)},t.prototype.contain=function(e){return Dt(this.parse(e),this._extent)},t.prototype.normalize=function(e){return Dn(this.parse(e),this._extent)},t.prototype.scale=function(e){return Di(e,this._extent)},t.type="time",t}(Do),Dl=[["second",1e3],["minute",6e4],["hour",36e5],["quarter-day",216e5],["half-day",432e5],["day",10368e4],["half-week",3024e5],["week",6048e5],["month",26784e5],["quarter",8208e6],["half-year",15768e6],["year",31536e6]];function Du(e,t){return(e/=t?6e4:1e3)>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}T8.registerClass(Ds);var Dc=T8.prototype,Dh=Do.prototype,Dd=Math.floor,Dp=Math.ceil,Df=Math.pow,Dg=Math.log,Dm=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new Do,t._interval=0,t}return gO(t,e),t.prototype.getTicks=function(e){var t=this._originalScale,n=this._extent,i=t.getExtent();return pV(Dh.getTicks.call(this,e),function(e){var t=e.value,r=fh(Df(this.base,t));return r=t===n[0]&&this._fixMin?fh(r,fp(i[0])):r,{value:r=t===n[1]&&this._fixMax?fh(r,fp(i[1])):r}},this)},t.prototype.setExtent=function(e,t){var n=Dg(this.base);e=Dg(Math.max(0,e))/n,t=Dg(Math.max(0,t))/n,Dh.setExtent.call(this,e,t)},t.prototype.getExtent=function(){var e,t,n=this.base,i=Dc.getExtent.call(this);i[0]=Df(n,i[0]),i[1]=Df(n,i[1]);var r=this._originalScale.getExtent();return this._fixMin&&(i[0]=(e=i[0],fh(e,fp(r[0])))),this._fixMax&&(i[1]=(t=i[1],fh(t,fp(r[1])))),i},t.prototype.unionExtent=function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=Dg(e[0])/Dg(t),e[1]=Dg(e[1])/Dg(t),Dc.unionExtent.call(this,e)},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.calcNiceTicks=function(e){e=e||10;var t=this._extent,n=t[1]-t[0];if(n!==1/0&&!(n<=0)){var i=Math.pow(10,fx(n));for(e/n*i<=.5&&(i*=10);!isNaN(i)&&1>Math.abs(i)&&Math.abs(i)>0;)i*=10;var r=[fh(Dp(t[0]/i)*i),fh(Dd(t[1]/i)*i)];this._interval=i,this._niceExtent=r}},t.prototype.calcNiceExtent=function(e){Dh.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return Dt(e=Dg(e)/Dg(this.base),this._extent)},t.prototype.normalize=function(e){return Dn(e=Dg(e)/Dg(this.base),this._extent)},t.prototype.scale=function(e){return e=Di(e,this._extent),Df(this.base,e)},t.type="log",t}(T8),Dv=Dm.prototype;Dv.getMinorTicks=Dh.getMinorTicks,Dv.getLabel=Dh.getLabel,T8.registerClass(Dm);var Dy=function(){function e(e,t,n){this._prepareParams(e,t,n)}return e.prototype._prepareParams=function(e,t,n){n[1]<n[0]&&(n=[NaN,NaN]),this._dataMin=n[0],this._dataMax=n[1];var i=this._isOrdinal="ordinal"===e.type;this._needCrossZero="interval"===e.type&&t.getNeedCrossZero&&t.getNeedCrossZero();var r=this._modelMinRaw=t.get("min",!0);pq(r)?this._modelMinNum=DS(e,r({min:n[0],max:n[1]})):"dataMin"!==r&&(this._modelMinNum=DS(e,r));var o=this._modelMaxRaw=t.get("max",!0);if(pq(o)?this._modelMaxNum=DS(e,o({min:n[0],max:n[1]})):"dataMax"!==o&&(this._modelMaxNum=DS(e,o)),i)this._axisDataLen=t.getCategories().length;else{var a=t.get("boundaryGap"),s=pU(a)?a:[a||0,a||0];"boolean"==typeof s[0]||"boolean"==typeof s[1]?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[md(s[0],1),md(s[1],1)]}},e.prototype.calculate=function(){var e,t,n=this._isOrdinal,i=this._dataMin,r=this._dataMax,o=this._axisDataLen,a=this._boundaryGapInner,s=n?null:r-i||Math.abs(i),l="dataMin"===this._modelMinRaw?i:this._modelMinNum,u="dataMax"===this._modelMaxRaw?r:this._modelMaxNum,c=null!=l,h=null!=u;null==l&&(l=n?o?0:NaN:i-a[0]*s),null==u&&(u=n?o?o-1:NaN:r+a[1]*s),null!=l&&isFinite(l)||(l=NaN),null!=u&&isFinite(u)||(u=NaN);var d=(e=l)!=e||(t=u)!=t||n&&!o;this._needCrossZero&&(l>0&&u>0&&!c&&(l=0),l<0&&u<0&&!h&&(u=0));var p=this._determinedMin,f=this._determinedMax;return null!=p&&(l=p,c=!0),null!=f&&(u=f,h=!0),{min:l,max:u,minFixed:c,maxFixed:h,isBlank:d}},e.prototype.modifyDataMinMax=function(e,t){this[Db[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){this[Dx[e]]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),Dx={min:"_determinedMin",max:"_determinedMax"},Db={min:"_dataMin",max:"_dataMax"};function Dw(e,t,n){var i=e.rawExtentInfo;return i||(i=new Dy(e,t,n),e.rawExtentInfo=i),i}function DS(e,t){return null==t?null:t!=t?NaN:e.parse(t)}function D_(e,t){var n=e.type,i=Dw(e,t,e.getExtent()).calculate();e.setBlank(i.isBlank);var r=i.min,o=i.max,a=t.ecModel;if(a&&"time"===n){var s=gw("bar",a),l=!1;if(pz(s,function(e){l=l||e.getBaseAxis()===t.axis}),l){var u=function(e,t,n,i){var r=n.axis.getExtent(),o=r[1]-r[0],a=function(e,t){if(e&&t)return e[gb(t)]}(i,n.axis);if(void 0===a)return{min:e,max:t};var s=1/0;pz(a,function(e){s=Math.min(e.offset,s)});var l=-1/0;pz(a,function(e){l=Math.max(e.offset+e.width,l)});var u=(s=Math.abs(s))+(l=Math.abs(l)),c=t-e,h=c/(1-(s+l)/o)-c;return t+=l/u*h,{min:e-=s/u*h,max:t}}(r,o,t,gS(s));r=u.min,o=u.max}}return{extent:[r,o],fixMin:i.minFixed,fixMax:i.maxFixed}}function DM(e,t){var n=D_(e,t),i=n.extent,r=t.get("splitNumber");e instanceof Dm&&(e.base=t.get("logBase"));var o=e.type,a=t.get("interval"),s="interval"===o||"time"===o;e.setExtent(i[0],i[1]),e.calcNiceExtent({splitNumber:r,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:s?t.get("minInterval"):null,maxInterval:s?t.get("maxInterval"):null}),null!=a&&e.setInterval&&e.setInterval(a)}function DC(e){var t=e.getLabelModel().get("formatter"),n="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?function(n,i){return e.scale.getFormattedLabel(n,i,t)}:pY(t)?function(n){var i=e.scale.getLabel(n);return t.replace("{value}",null!=i?i:"")}:pq(t)?function(i,r){return null!=n&&(r=i.value-n),t(DA(e,i),r,null!=i.level?{level:i.level}:null)}:function(t){return e.scale.getLabel(t)}}function DA(e,t){return"category"===e.type?e.scale.getLabel(t):t.value}function Dk(e){var t=e.get("interval");return null==t?"auto":t}function DT(e){return"category"===e.type&&0===Dk(e.getLabelModel())}function DD(e,t){var n={};return pz(e.mapDimensionsAll(t),function(t){n[gp(e,t)]=!0}),pW(n)}var DI=function(){function e(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return pV(this._dimList,function(e){return this._axes[e]},this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),pH(this.getAxes(),function(t){return t.scale.type===e})},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),DO=["x","y"];function DP(e){return"interval"===e.type||"time"===e.type}var DE=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=DO,t}return gO(t,e),t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,t=this.getAxis("y").scale;if(DP(e)&&DP(t)){var n=e.getExtent(),i=t.getExtent(),r=this.dataToPoint([n[0],i[0]]),o=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){var l=(o[0]-r[0])/a,u=(o[1]-r[1])/s,c=r[0]-n[0]*l,h=r[1]-i[0]*u,d=this._transform=[l,0,0,u,c,h];this._invTransform=g3([],d)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(e){var t=this.getAxis("x"),n=this.getAxis("y");return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),i=this.dataToPoint(t),r=this.getArea(),o=new mr(n[0],n[1],i[0]-n[0],i[1]-n[1]);return r.intersect(o)},t.prototype.dataToPoint=function(e,t,n){n=n||[];var i=e[0],r=e[1];if(this._transform&&null!=i&&isFinite(i)&&null!=r&&isFinite(r))return mO(n,e,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(i,t)),n[1]=a.toGlobalCoord(a.dataToCoord(r,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,r=n.getExtent(),o=i.getExtent(),a=n.parse(e[0]),s=i.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),a),Math.max(r[0],r[1])),t[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),t},t.prototype.pointToData=function(e,t){var n=[];if(this._invTransform)return mO(n,e,this._invTransform);var i=this.getAxis("x"),r=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(e[0]),t),n[1]=r.coordToData(r.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis("x"===e.dim?"y":"x")},t.prototype.getArea=function(e){e=e||0;var t=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(t[0],t[1])-e,r=Math.min(n[0],n[1])-e,o=Math.max(t[0],t[1])-i+e,a=Math.max(n[0],n[1])-r+e;return new mr(i,r,o,a)},t}(DI),DR=fz();function DL(e,t){var n,i,r,o,a=DN(e,"labels"),s=Dk(t),l=DB(a,s);return l||(pq(s)?r=DV(e,s):(o="auto"===s?null!=(i=DR(n=e).autoInterval)?i:DR(n).autoInterval=n.calculateCategoryInterval():s,r=Dz(e,o)),DF(a,s,{labels:r,labelCategoryInterval:o}))}function DN(e,t){return DR(e)[t]||(DR(e)[t]=[])}function DB(e,t){for(var n=0;n<e.length;n++)if(e[n].key===t)return e[n].value}function DF(e,t,n){return e.push({key:t,value:n}),n}function Dz(e,t,n){var i=DC(e),r=e.scale,o=r.getExtent(),a=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=o[0],c=r.count();0!==u&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=DT(e),d=a.get("showMinLabel")||h,p=a.get("showMaxLabel")||h;d&&u!==o[0]&&g(o[0]);for(var f=u;f<=o[1];f+=l)g(f);function g(e){var t={value:e};s.push(n?e:{formattedLabel:i(t),rawLabel:r.getLabel(t),tickValue:e})}return p&&f-l!==o[1]&&g(o[1]),s}function DV(e,t,n){var i=e.scale,r=DC(e),o=[];return pz(i.getTicks(),function(e){var a=i.getLabel(e),s=e.value;t(e.value,a)&&o.push(n?s:{formattedLabel:r(e),rawLabel:a,tickValue:s})}),o}var Dj=[0,1];function DH(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}var DW=function(e){function t(t,n,i,r,o){var a=e.call(this,t,n,i)||this;return a.index=0,a.type=r||"value",a.position=o||"bottom",a}return gO(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e[+("x"!==this.dim)]),t)},t.prototype.setCategorySortInfo=function(e){if("category"!==this.type)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]);return e>=n&&e<=i},e.prototype.containData=function(e){return this.scale.contain(e)},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return ff(e||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&"ordinal"===i.type&&DH(n=n.slice(),i.count()),fu(e,Dj,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&DH(n=n.slice(),i.count());var r=fu(e,n,Dj,t);return this.scale.scale(r)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){var t=(e=e||{}).tickModel||this.getTickModel(),n=("category"===this.type?function(e,t){var n,i,r=DN(e,"ticks"),o=Dk(t),a=DB(r,o);if(a)return a;if((!t.get("show")||e.scale.isBlank())&&(n=[]),pq(o))n=DV(e,o,!0);else if("auto"===o){var s=DL(e,e.getLabelModel());i=s.labelCategoryInterval,n=pV(s.labels,function(e){return e.tickValue})}else n=Dz(e,i=o,!0);return DF(r,o,{ticks:n,tickCategoryInterval:i})}(this,t):{ticks:pV(this.scale.getTicks(),function(e){return e.value})}).ticks,i=pV(n,function(e){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(e):e),tickValue:e}},this);return function(e,t,n,i){var r,o,a=t.length;if(e.onBand&&!n&&a){var s=e.getExtent();if(1===a)t[0].coord=s[0],r=t[1]={coord:s[1]};else{var l=t[a-1].tickValue-t[0].tickValue,u=(t[a-1].coord-t[0].coord)/l;pz(t,function(e){e.coord-=u/2}),o=1+e.scale.getExtent()[1]-t[a-1].tickValue,r={coord:t[a-1].coord+u*o},t.push(r)}var c=s[0]>s[1];h(t[0].coord,s[0])&&(i?t[0].coord=s[0]:t.shift()),i&&h(s[0],t[0].coord)&&t.unshift({coord:s[0]}),h(s[1],r.coord)&&(i?r.coord=s[1]:t.pop()),i&&h(r.coord,s[1])&&t.push({coord:s[1]})}function h(e,t){return e=fh(e),t=fh(t),c?e>t:e<t}}(this,i,t.get("alignWithLabel"),e.clamp),i},e.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var e=this.model.getModel("minorTick").get("splitNumber");return e>0&&e<100||(e=5),pV(this.scale.getMinorTicks(e),function(e){return pV(e,function(e){return{coord:this.dataToCoord(e),tickValue:e}},this)},this)},e.prototype.getViewLabels=function(){var e,t,n,i,r,o;return("category"===this.type?(e=this,t=e.getLabelModel(),n=DL(e,t),!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n):(i=this,r=i.scale.getTicks(),o=DC(i),{labels:pV(r,function(e,t){return{level:e.level,formattedLabel:o(e,t),rawLabel:i.scale.getLabel(e),tickValue:e.value}})})).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),n=t[1]-t[0]+ +!!this.onBand;return 0===n&&(n=1),Math.abs(Math.abs(e[1]-e[0]))/n},e.prototype.calculateCategoryInterval=function(){return function(e){var t,n,i=(n=(t=e).getLabelModel(),{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:n.get("rotate")||0,font:n.getFont()}),r=DC(e),o=(i.axisRotate-i.labelRotate)/180*Math.PI,a=e.scale,s=a.getExtent(),l=a.count();if(s[1]-s[0]<1)return 0;var u=1;l>40&&(u=Math.max(1,Math.floor(l/40)));for(var c=s[0],h=e.dataToCoord(c+1)-e.dataToCoord(c),d=Math.abs(h*Math.cos(o)),p=Math.abs(h*Math.sin(o)),f=0,g=0;c<=s[1];c+=u){var m=0,v=0,y=ml(r({value:c}),i.font,"center","top");m=1.3*y.width,v=1.3*y.height,f=Math.max(f,m,7),g=Math.max(g,v,7)}var x=f/d,b=g/p;isNaN(x)&&(x=1/0),isNaN(b)&&(b=1/0);var w=Math.max(0,Math.floor(Math.min(x,b))),S=DR(e.model),_=e.getExtent(),M=S.lastAutoInterval,C=S.lastTickCount;return null!=M&&null!=C&&1>=Math.abs(M-w)&&1>=Math.abs(C-l)&&M>w&&S.axisExtent0===_[0]&&S.axisExtent1===_[1]?w=M:(S.lastTickCount=l,S.lastAutoInterval=w,S.axisExtent0=_[0],S.axisExtent1=_[1]),w}(this)},e}());function DG(e,t,n){n=n||{};var i=e.coordinateSystem,r=t.axis,o={},a=r.getAxesOnZeroOf()[0],s=r.position,l=a?"onZero":s,u=r.dim,c=i.getRect(),h=[c.x,c.x+c.width,c.y,c.y+c.height],d={left:0,right:1,top:0,bottom:1,onZero:2},p=t.get("offset")||0,f="x"===u?[h[2]-p,h[3]+p]:[h[0]-p,h[1]+p];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));f[d.onZero]=Math.max(Math.min(g,f[1]),f[0])}o.position=["y"===u?f[d[l]]:h[0],"x"===u?f[d[l]]:h[3]],o.rotation=Math.PI/2*("x"!==u),o.labelDirection=o.tickDirection=o.nameDirection=({top:-1,bottom:1,left:-1,right:1})[s],o.labelOffset=a?f[d[s]]-f[d.onZero]:0,t.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),p2(n.labelInside,t.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var m=t.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-m:m,o.z2=1,o}function D$(e){return"cartesian2d"===e.get("coordinateSystem")}function DU(e){var t={xAxisModel:null,yAxisModel:null};return pz(t,function(n,i){var r=i.replace(/Model$/,""),o=e.getReferringComponents(r,fW).models[0];t[i]=o}),t}var Dq=Math.log,DY=function(){function e(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=DO,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;function i(e){var t,n=pW(e),i=n.length;if(i){for(var r=[],o=i-1;o>=0;o--){var a=e[+n[o]],s=a.model,l=a.scale;T9(l)&&s.get("alignTicks")&&null==s.get("interval")?r.push(a):(DM(l,s),T9(l)&&(t=a))}r.length&&(t||DM((t=r.pop()).scale,t.model),pz(r,function(e){!function(e,t,n){var i=Do.prototype,r=i.getTicks.call(n),o=i.getTicks.call(n,!0),a=r.length-1,s=i.getInterval.call(n),l=D_(e,t),u=l.extent,c=l.fixMin,h=l.fixMax;if("log"===e.type){var d=Dq(e.base);u=[Dq(u[0])/d,Dq(u[1])/d]}e.setExtent(u[0],u[1]),e.calcNiceExtent({splitNumber:a,fixMin:c,fixMax:h});var p=i.getExtent.call(e);c&&(u[0]=p[0]),h&&(u[1]=p[1]);var f=i.getInterval.call(e),g=u[0],m=u[1];if(c&&h)f=(m-g)/a;else if(c)for(m=u[0]+f*a;m<u[1]&&isFinite(m)&&isFinite(u[1]);)f=T7(f),m=u[0]+f*a;else if(h)for(g=u[1]-f*a;g>u[0]&&isFinite(g)&&isFinite(u[0]);)f=T7(f),g=u[1]-f*a;else{e.getTicks().length-1>a&&(f=T7(f));var v=f*a;(g=fh((m=Math.ceil(u[1]/f)*f)-v))<0&&u[0]>=0?(g=0,m=fh(v)):m>0&&u[1]<=0&&(m=0,g=-fh(v))}var y=(r[0].value-o[0].value)/s,x=(r[a].value-o[a].value)/s;i.setExtent.call(e,g+f*y,m+f*x),i.setInterval.call(e,f),(y||x)&&i.setNiceExtent.call(e,g+f,m-f)}(e.scale,e.model,t.scale)}))}}this._updateScale(e,this.model),i(n.x),i(n.y);var r={};pz(n.x,function(e){DX(n,"y",e,r)}),pz(n.y,function(e){DX(n,"x",e,r)}),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var i=e.getBoxLayoutParams(),r=!n&&e.get("containLabel"),o=b9(i,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var a=this._axesList;function s(){pz(a,function(e){var t,n,i,r,a=e.isHorizontal(),s=a?[0,o.width]:[0,o.height],l=+!!e.inverse;e.setExtent(s[l],s[1-l]),t=e,n=a?o.x:o.y,r=(i=t.getExtent())[0]+i[1],t.toGlobalCoord="x"===t.dim?function(e){return e+n}:function(e){return r-e+n},t.toLocalCoord="x"===t.dim?function(e){return e-n}:function(e){return r-e+n}})}s(),r&&(pz(a,function(e){if(!e.model.get(["axisLabel","inside"])){var t=function(e){var t,n,i,r=e.model,o=e.scale;if(!(!r.get(["axisLabel","show"])||o.isBlank())){var a=o.getExtent();n=o instanceof Dr?o.count():(t=o.getTicks()).length;var s=e.getLabelModel(),l=DC(e),u=1;n>40&&(u=Math.ceil(n/40));for(var c=0;c<n;c+=u){var h=l(t?t[c]:{value:a[0]+c},c),d=function(e,t){var n=t*Math.PI/180,i=e.width,r=e.height,o=i*Math.abs(Math.cos(n))+Math.abs(r*Math.sin(n)),a=i*Math.abs(Math.sin(n))+Math.abs(r*Math.cos(n));return new mr(e.x,e.y,o,a)}(s.getTextRect(h),s.get("rotate")||0);i?i.union(d):i=d}return i}}(e);if(t){var n=e.isHorizontal()?"height":"width",i=e.model.get(["axisLabel","margin"]);o[n]-=t[n]+i,"top"===e.position?o.y+=t.height+i:"left"===e.position&&(o.x+=t.width+i)}}}),s()),pz(this._coordsList,function(e){e.calcAffineTransform()})},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(null!=n)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(null!=e&&null!=t){var n="x"+e+"y"+t;return this._coordsMap[n]}pK(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,r=this._coordsList;i<r.length;i++)if(r[i].getAxis("x").index===e||r[i].getAxis("y").index===t)return r[i]},e.prototype.getCartesians=function(){return this._coordsList.slice()},e.prototype.convertToPixel=function(e,t,n){var i=this._findConvertTarget(t);return i.cartesian?i.cartesian.dataToPoint(n):i.axis?i.axis.toGlobalCoord(i.axis.dataToCoord(n)):null},e.prototype.convertFromPixel=function(e,t,n){var i=this._findConvertTarget(t);return i.cartesian?i.cartesian.pointToData(n):i.axis?i.axis.coordToData(i.axis.toLocalCoord(n)):null},e.prototype._findConvertTarget=function(e){var t,n,i=e.seriesModel,r=e.xAxisModel||i&&i.getReferringComponents("xAxis",fW).models[0],o=e.yAxisModel||i&&i.getReferringComponents("yAxis",fW).models[0],a=e.gridModel,s=this._coordsList;return i?0>pN(s,t=i.coordinateSystem)&&(t=null):r&&o?t=this.getCartesian(r.componentIndex,o.componentIndex):r?n=this.getAxis("x",r.componentIndex):o?n=this.getAxis("y",o.componentIndex):a&&a.coordinateSystem===this&&(t=this._coordsList[0]),{cartesian:t,axis:n}},e.prototype.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},e.prototype._initCartesian=function(e,t,n){var i=this,r=this,o={left:!1,right:!1,top:!1,bottom:!1},a={x:{},y:{}},s={x:0,y:0};if(t.eachComponent("xAxis",l("x"),this),t.eachComponent("yAxis",l("y"),this),!s.x||!s.y){this._axesMap={},this._axesList=[];return}function l(t){return function(n,i){if(DZ(n,e)){var l=n.get("position");"x"===t?"top"!==l&&"bottom"!==l&&(l=o.bottom?"top":"bottom"):"left"!==l&&"right"!==l&&(l=o.left?"right":"left"),o[l]=!0;var u=new DW(t,function(e,t){if(t=t||e.get("type"))switch(t){case"category":return new Dr({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new Ds({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(T8.getClass(t)||Do)}}(n),[0,0],n.get("type"),l),c="category"===u.type;u.onBand=c&&n.get("boundaryGap"),u.inverse=n.get("inverse"),n.axis=u,u.model=n,u.grid=r,u.index=i,r._axesList.push(u),a[t][i]=u,s[t]++}}}this._axesMap=a,pz(a.x,function(t,n){pz(a.y,function(r,o){var a="x"+n+"y"+o,s=new DE(a);s.master=i,s.model=e,i._coordsMap[a]=s,i._coordsList.push(s),s.addAxis(t),s.addAxis(r)})})},e.prototype._updateScale=function(e,t){function n(e,t){pz(DD(e,t.dim),function(n){t.scale.unionExtentFromData(e,n)})}pz(this._axesList,function(e){if(e.scale.setExtent(1/0,-1/0),"category"===e.type){var t=e.model.get("categorySortInfo");e.scale.setSortInfo(t)}}),e.eachSeries(function(e){if(D$(e)){var i=DU(e),r=i.xAxisModel,o=i.yAxisModel;if(DZ(r,t)&&DZ(o,t)){var a=this.getCartesian(r.componentIndex,o.componentIndex),s=e.getData(),l=a.getAxis("x"),u=a.getAxis("y");n(s,l),n(s,u)}}},this)},e.prototype.getTooltipAxes=function(e){var t=[],n=[];return pz(this.getCartesians(),function(i){var r=null!=e&&"auto"!==e?i.getAxis(e):i.getBaseAxis(),o=i.getOtherAxis(r);0>pN(t,r)&&t.push(r),0>pN(n,o)&&n.push(o)}),{baseAxes:t,otherAxes:n}},e.create=function(t,n){var i=[];return t.eachComponent("grid",function(r,o){var a=new e(r,t,n);a.name="grid_"+o,a.resize(r,n,!0),r.coordinateSystem=a,i.push(a)}),t.eachSeries(function(e){if(D$(e)){var t=DU(e),n=t.xAxisModel,i=t.yAxisModel;e.coordinateSystem=n.getCoordSysModel().coordinateSystem.getCartesian(n.componentIndex,i.componentIndex)}}),i},e.dimensions=DO,e}();function DZ(e,t){return e.getCoordSysModel()===t}function DX(e,t,n,i){n.getAxesOnZeroOf=function(){return r?[r]:[]};var r,o=e[t],a=n.model,s=a.get(["axisLine","onZero"]),l=a.get(["axisLine","onZeroAxisIndex"]);if(s){if(null!=l)DK(o[l])&&(r=o[l]);else for(var u in o)if(o.hasOwnProperty(u)&&DK(o[u])&&!i[c(o[u])]){r=o[u];break}r&&(i[c(r)]=!0)}function c(e){return e.dim+"_"+e.index}}function DK(e){var t,n,i;return e&&"category"!==e.type&&"time"!==e.type&&(n=(t=e.scale.getExtent())[0],i=t[1],!(n>0&&i>0||n<0&&i<0))}var DQ=Math.PI,DJ=function(){function e(e,t){this.group=new SI,this.opt=t,this.axisModel=e,pL(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new SI({x:t.position[0],y:t.position[1],rotation:t.rotation});n.updateTransform(),this._transformGroup=n}return e.prototype.hasBuilder=function(e){return!!D0[e]},e.prototype.add=function(e){D0[e](this.opt,this.axisModel,this.group,this._transformGroup)},e.prototype.getGroup=function(){return this.group},e.innerTextLayout=function(e,t,n){var i,r,o=fg(t-e);return fm(o)?(r=n>0?"top":"bottom",i="center"):fm(o-DQ)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=o>0&&o<DQ?n>0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:i,textVerticalAlign:r}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},e}(),D0={axisLine:function(e,t,n,i){var r=t.get(["axisLine","show"]);if("auto"===r&&e.handleAutoShown&&(r=e.handleAutoShown("axisLine")),r){var o=t.axis.getExtent(),a=i.transform,s=[o[0],0],l=[o[1],0],u=s[0]>l[0];a&&(mO(s,s,a),mO(l,l,a));var c=pR({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new _v({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});_X(h.shape,h.style.lineWidth),h.anid="line",n.add(h);var d=t.get(["axisLine","symbol"]);if(null!=d){var p=t.get(["axisLine","symbolSize"]);pY(d)&&(d=[d,d]),(pY(p)||pX(p))&&(p=[p,p]);var f=M0(t.get(["axisLine","symbolOffset"])||0,p),g=p[0],m=p[1];pz([{rotate:e.rotation+Math.PI/2,offset:f[0],r:0},{rotate:e.rotation-Math.PI/2,offset:f[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(t,i){if("none"!==d[i]&&null!=d[i]){var r=MQ(d[i],-g/2,-m/2,g,m,c.stroke,!0),o=t.r+t.offset,a=u?l:s;r.attr({rotation:t.rotate,x:a[0]+o*Math.cos(e.rotation),y:a[1]-o*Math.sin(e.rotation),silent:!0,z2:11}),n.add(r)}})}}},axisTickLabel:function(e,t,n,i){var r=function(e,t,n,i){var r=n.axis,o=n.getModel("axisTick"),a=o.get("show");if("auto"===a&&i.handleAutoShown&&(a=i.handleAutoShown("axisTick")),!(!a||r.scale.isBlank())){for(var s=o.getModel("lineStyle"),l=i.tickDirection*o.get("length"),u=D3(r.getTicksCoords(),t.transform,l,pL(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;c<u.length;c++)e.add(u[c]);return u}}(n,i,t,e),o=function(e,t,n,i){var r=n.axis;if(!(!p2(i.axisLabelShow,n.get(["axisLabel","show"]))||r.scale.isBlank())){var o=n.getModel("axisLabel"),a=o.get("margin"),s=r.getViewLabels(),l=(p2(i.labelRotate,o.get("rotate"))||0)*DQ/180,u=DJ.innerTextLayout(i.rotation,l,i.labelDirection),c=n.getCategories&&n.getCategories(!0),h=[],d=DJ.isLabelSilent(n),p=n.get("triggerEvent");return pz(s,function(l,f){var g="ordinal"===r.scale.type?r.scale.getRawOrdinalNumber(l.tickValue):l.tickValue,m=l.formattedLabel,v=l.rawLabel,y=o;if(c&&c[g]){var x=c[g];pK(x)&&x.textStyle&&(y=new bc(x.textStyle,o,n.ecModel))}var b=y.getTextColor()||n.get(["axisLine","lineStyle","color"]),w=r.dataToCoord(g),S=y.getShallow("align",!0)||u.textAlign,_=p5(y.getShallow("alignMinLabel",!0),S),M=p5(y.getShallow("alignMaxLabel",!0),S),C=y.getShallow("verticalAlign",!0)||y.getShallow("baseline",!0)||u.textVerticalAlign,A=p5(y.getShallow("verticalAlignMinLabel",!0),C),k=p5(y.getShallow("verticalAlignMaxLabel",!0),C),T=new y4({x:w,y:i.labelOffset+i.labelDirection*a,rotation:u.rotation,silent:d,z2:10+(l.level||0),style:x1(y,{text:m,align:0===f?_:f===s.length-1?M:S,verticalAlign:0===f?A:f===s.length-1?k:C,fill:pq(b)?b("category"===r.type?v:"value"===r.type?g+"":g,f):b})});if(T.anid="label_"+g,p){var D=DJ.makeAxisEventDataBase(n);D.targetType="axisLabel",D.value=v,D.tickIndex=f,"category"===r.type&&(D.dataIndex=g),y6(T).eventData=D}t.add(T),T.updateTransform(),h.push(T),e.add(T),T.decomposeTransform()}),h}}(n,i,t,e);(function(e,t,n){if(!DT(e.axis)){var i=e.get(["axisLabel","showMinLabel"]),r=e.get(["axisLabel","showMaxLabel"]);n=n||[];var o=(t=t||[])[0],a=t[1],s=t[t.length-1],l=t[t.length-2],u=n[0],c=n[1],h=n[n.length-1],d=n[n.length-2];!1===i?(D1(o),D1(u)):D2(o,a)&&(i?(D1(a),D1(c)):(D1(o),D1(u))),!1===r?(D1(s),D1(h)):D2(l,s)&&(r?(D1(l),D1(d)):(D1(s),D1(h)))}})(t,o,r),function(e,t,n,i){var r=n.axis,o=n.getModel("minorTick");if(!(!o.get("show")||r.scale.isBlank())){var a=r.getMinorTicksCoords();if(a.length)for(var s=o.getModel("lineStyle"),l=i*o.get("length"),u=pL(s.getLineStyle(),pL(n.getModel("axisTick").getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])})),c=0;c<a.length;c++)for(var h=D3(a[c],t.transform,l,u,"minorticks_"+c),d=0;d<h.length;d++)e.add(h[d])}}(n,i,t,e.tickDirection),t.get(["axisLabel","hideOverlap"])&&function(e){var t=[];e.sort(function(e,t){return t.priority-e.priority});var n=new mr(0,0,0,0);function i(e){if(!e.ignore){var t=e.ensureState("emphasis");null==t.ignore&&(t.ignore=!1)}e.ignore=!0}for(var r=0;r<e.length;r++){var o=e[r],a=o.axisAligned,s=o.localRect,l=o.transform,u=o.label,c=o.labelLine;n.copy(o.rect),n.width-=.1,n.height-=.1,n.x+=.05,n.y+=.05;for(var h=o.obb,d=!1,p=0;p<t.length;p++){var f=t[p];if(n.intersect(f.rect)&&(a&&f.axisAligned||(f.obb||(f.obb=new _R(f.localRect,f.transform)),h||(h=new _R(s,l)),h.intersect(f.obb)))){d=!0;break}}d?(i(u),c&&i(c)):(u.attr("ignore",o.defaultAttr.ignore),c&&c.attr("ignore",o.defaultAttr.labelGuideIgnore),t.push(o))}}(function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];if(!i.defaultAttr.ignore){var r=i.label,o=r.getComputedTransform(),a=r.getBoundingRect(),s=!o||o[1]<1e-5&&o[2]<1e-5,l=r.style.margin||0,u=a.clone();u.applyTransform(o),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var c=s?new _R(a,o):null;t.push({label:r,labelLine:i.labelLine,rect:u,localRect:a,obb:c,priority:i.priority,defaultAttr:i.defaultAttr,layoutOption:i.computedLayoutOption,axisAligned:s,transform:o})}}return t}(pV(o,function(e){return{label:e,priority:e.z2,defaultAttr:{ignore:e.ignore}}})))},axisName:function(e,t,n,i){var r,o,a=p2(e.axisName,t.get("name"));if(a){var s,l,u,c,h,d,p,f,g,m=t.get("nameLocation"),v=e.nameDirection,y=t.getModel("nameTextStyle"),x=t.get("nameGap")||0,b=t.axis.getExtent(),w=b[0]>b[1]?-1:1,S=["start"===m?b[0]-w*x:"end"===m?b[1]+w*x:(b[0]+b[1])/2,D5(m)?e.labelOffset+v*x:0],_=t.get("nameRotate");null!=_&&(_=_*DQ/180),D5(m)?r=DJ.innerTextLayout(e.rotation,null!=_?_:e.rotation,v):(s=e.rotation,l=m,u=_||0,c=b,p=fg(u-s),f=c[0]>c[1],g="start"===l&&!f||"start"!==l&&f,fm(p-DQ/2)?(d=g?"bottom":"top",h="center"):fm(p-1.5*DQ)?(d=g?"top":"bottom",h="center"):(d="middle",h=p<1.5*DQ&&p>DQ/2?g?"left":"right":g?"right":"left"),r={rotation:p,textAlign:h,textVerticalAlign:d},null!=(o=e.axisNameAvailableWidth)&&(isFinite(o=Math.abs(o/Math.sin(r.rotation)))||(o=null)));var M=y.getFont(),C=t.get("nameTruncate",!0)||{},A=C.ellipsis,k=p2(e.nameTruncateMaxWidth,C.maxWidth,o),T=new y4({x:S[0],y:S[1],rotation:r.rotation,silent:DJ.isLabelSilent(t),style:x1(y,{text:a,font:M,overflow:"truncate",width:k,ellipsis:A,fill:y.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:y.get("align")||r.textAlign,verticalAlign:y.get("verticalAlign")||r.textVerticalAlign}),z2:1});if(_9({el:T,componentModel:t,itemName:a}),T.__fullText=a,T.anid="name",t.get("triggerEvent")){var D=DJ.makeAxisEventDataBase(t);D.targetType="axisName",D.name=a,y6(T).eventData=D}i.add(T),T.updateTransform(),n.add(T),T.decomposeTransform()}}};function D1(e){e&&(e.ignore=!0)}function D2(e,t){var n=e&&e.getBoundingRect().clone(),i=t&&t.getBoundingRect().clone();if(n&&i){var r=g0([]);return g5(r,r,-e.rotation),n.applyTransform(g1([],r,e.getLocalTransform())),i.applyTransform(g1([],r,t.getLocalTransform())),n.intersect(i)}}function D5(e){return"middle"===e||"center"===e}function D3(e,t,n,i,r){for(var o=[],a=[],s=[],l=0;l<e.length;l++){var u=e[l].coord;a[0]=u,a[1]=0,s[0]=u,s[1]=n,t&&(mO(a,a,t),mO(s,s,t));var c=new _v({shape:{x1:a[0],y1:a[1],x2:s[0],y2:s[1]},style:i,z2:2,autoBatch:!0,silent:!0});_X(c.shape,c.style.lineWidth),c.anid=r+"_"+e[l].tickValue,o.push(c)}return o}function D4(e,t){return"all"===e||pU(e)&&pN(e,t)>=0||e===t}function D6(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[D9(e)]}function D8(e){return!!e.get(["handle","show"])}function D9(e){return e.type+"||"+e.id}var D7={},Ie=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.render=function(t,n,i,r){this.axisPointerClass&&function(e){var t=D6(e);if(t){var n=t.axisPointerModel,i=t.axis.scale,r=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=i.parse(a));var s=D8(n);null==o&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),a<l[0]&&(a=l[0]),r.value=a,s&&(r.status=t.axis.scale.isBlank()?"hide":"show")}}(t),e.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(t,i,!0)},t.prototype.updateAxisPointer=function(e,t,n,i){this._doUpdateAxisPointerClass(e,n,!1)},t.prototype.remove=function(e,t){var n=this._axisPointer;n&&n.remove(t)},t.prototype.dispose=function(t,n){this._disposeAxisPointer(n),e.prototype.dispose.apply(this,arguments)},t.prototype._doUpdateAxisPointerClass=function(e,n,i){var r=t.getAxisPointerClass(this.axisPointerClass);if(r){var o,a=(o=D6(e))&&o.axisPointerModel;a?(this._axisPointer||(this._axisPointer=new r)).render(e,a,n,i):this._disposeAxisPointer(n)}},t.prototype._disposeAxisPointer=function(e){this._axisPointer&&this._axisPointer.dispose(e),this._axisPointer=null},t.registerAxisPointerClass=function(e,t){D7[e]=t},t.getAxisPointerClass=function(e){return e&&D7[e]},t.type="axis",t}(ka),It=fz(),In=["axisLine","axisTickLabel","axisName"],Ii=["splitArea","splitLine","minorSplitLine"],Ir=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="CartesianAxisPointer",n}return gO(t,e),t.prototype.render=function(t,n,i,r){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new SI,this.group.add(this._axisGroup),t.get("show")){var a=t.getCoordSysModel(),s=DG(a,t),l=new DJ(t,pR({handleAutoShown:function(e){for(var n=a.coordinateSystem.getCartesians(),i=0;i<n.length;i++)if(T9(n[i].getOtherAxis(t.axis).scale))return!0;return!1}},s));pz(In,l.add,l),this._axisGroup.add(l.getGroup()),pz(Ii,function(e){t.get([e,"show"])&&Io[e](this,this._axisGroup,t,a)},this),r&&"changeAxisOrder"===r.type&&r.isInitSort||_2(o,this._axisGroup,t),e.prototype.render.call(this,t,n,i,r)}},t.prototype.remove=function(){It(this).splitAreaColors=null},t.type="cartesianAxis",t}(Ie),Io={splitLine:function(e,t,n,i){var r=n.axis;if(!r.scale.isBlank()){var o=n.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color");s=pU(s)?s:[s];for(var l=i.coordinateSystem.getRect(),u=r.isHorizontal(),c=0,h=r.getTicksCoords({tickModel:o}),d=[],p=[],f=a.getLineStyle(),g=0;g<h.length;g++){var m=r.toGlobalCoord(h[g].coord);u?(d[0]=m,d[1]=l.y,p[0]=m,p[1]=l.y+l.height):(d[0]=l.x,d[1]=m,p[0]=l.x+l.width,p[1]=m);var v=c++%s.length,y=new _v({anid:null!=h[g].tickValue?"line_"+h[g].tickValue:null,autoBatch:!0,shape:{x1:d[0],y1:d[1],x2:p[0],y2:p[1]},style:pL({stroke:s[v]},f),silent:!0});_X(y.shape,f.lineWidth),t.add(y)}}},minorSplitLine:function(e,t,n,i){var r=n.axis,o=n.getModel("minorSplitLine").getModel("lineStyle"),a=i.coordinateSystem.getRect(),s=r.isHorizontal(),l=r.getMinorTicksCoords();if(l.length)for(var u=[],c=[],h=o.getLineStyle(),d=0;d<l.length;d++)for(var p=0;p<l[d].length;p++){var f=r.toGlobalCoord(l[d][p].coord);s?(u[0]=f,u[1]=a.y,c[0]=f,c[1]=a.y+a.height):(u[0]=a.x,u[1]=f,c[0]=a.x+a.width,c[1]=f);var g=new _v({anid:"minor_line_"+l[d][p].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:c[0],y2:c[1]},style:h,silent:!0});_X(g.shape,h.lineWidth),t.add(g)}},splitArea:function(e,t,n,i){!function(e,t,n,i){var r=n.axis;if(!r.scale.isBlank()){var o=n.getModel("splitArea"),a=o.getModel("areaStyle"),s=a.get("color"),l=i.coordinateSystem.getRect(),u=r.getTicksCoords({tickModel:o,clamp:!0});if(u.length){var c=s.length,h=It(e).splitAreaColors,d=fi(),p=0;if(h)for(var f=0;f<u.length;f++){var g=h.get(u[f].tickValue);if(null!=g){p=(g+(c-1)*f)%c;break}}var m=r.toGlobalCoord(u[0].coord),v=a.getAreaStyle();s=pU(s)?s:[s];for(var f=1;f<u.length;f++){var y=r.toGlobalCoord(u[f].coord),x=void 0,b=void 0,w=void 0,S=void 0;r.isHorizontal()?(x=m,b=l.y,w=y-x,S=l.height,m=x+w):(x=l.x,b=m,w=l.width,S=y-b,m=b+S);var _=u[f-1].tickValue;null!=_&&d.set(_,p),t.add(new y$({anid:null!=_?"area_"+_:null,shape:{x:x,y:b,width:w,height:S},style:pL({fill:s[p]},v),autoBatch:!0,silent:!0})),p=(p+1)%c}It(e).splitAreaColors=d}}}(e,t,n,i)}},Ia=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.type="xAxis",t}(Ir),Is=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=Ia.type,t}return gO(t,e),t.type="yAxis",t}(Ir),Il=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="grid",t}return gO(t,e),t.prototype.render=function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new y$({shape:e.coordinateSystem.getRect(),style:pL({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))},t.type="grid",t}(ka),Iu={offset:0};function Ic(e){e.registerComponentView(Il),e.registerComponentModel(TU),e.registerCoordinateSystem("cartesian2d",DY),T4(e,"x",TY,Iu),T4(e,"y",TY,Iu),e.registerComponentView(Ia),e.registerComponentView(Is),e.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}var Ih={color:"fill",borderColor:"stroke"},Id={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Ip=fz(),If=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(e,t){return SA(null,this)},t.prototype.getDataParams=function(t,n,i){var r=e.prototype.getDataParams.call(this,t,n);return i&&(r.info=Ip(i).info),r},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(St);function Ig(e,t){return t=t||[0,0],pV(["x","y"],function(n,i){var r=this.getAxis(n),o=t[i],a=e[i]/2;return"category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(o-a)-r.dataToCoord(o+a))},this)}function Im(e,t){return t=t||[0,0],pV([0,1],function(n){var i=t[n],r=e[n]/2,o=[],a=[];return o[n]=i-r,a[n]=i+r,o[1-n]=a[1-n]=t[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(a)[n])},this)}function Iv(e,t){var n=this.getAxis(),i=t instanceof Array?t[0]:t,r=(e instanceof Array?e[0]:e)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-r)-n.dataToCoord(i+r))}function Iy(e,t){return t=t||[0,0],pV(["Radius","Angle"],function(n,i){var r=this["get"+n+"Axis"](),o=t[i],a=e[i]/2,s="category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(o-a)-r.dataToCoord(o+a));return"Angle"===n&&(s=s*Math.PI/180),s},this)}function Ix(e,t){t&&(t.font=t.textFont||t.font,fa(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),fa(t,"textAlign")&&(e.align=t.textAlign),fa(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),fa(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),fa(t,"textWidth")&&(e.width=t.textWidth),fa(t,"textHeight")&&(e.height=t.textHeight),fa(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),fa(t,"textPadding")&&(e.padding=t.textPadding),fa(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),fa(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),fa(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),fa(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),fa(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),fa(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),fa(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function Ib(e,t,n){e.textPosition=e.textPosition||n.position||"inside",null!=n.offset&&(e.textOffset=n.offset),null!=n.rotation&&(e.textRotation=n.rotation),null!=n.distance&&(e.textDistance=n.distance);var i=e.textPosition.indexOf("inside")>=0,r=e.fill||"#000";Iw(e,t);var o=null==e.textFill;return i?o&&(e.textFill=n.insideFill||"#fff",!e.textStroke&&n.insideStroke&&(e.textStroke=n.insideStroke),e.textStroke||(e.textStroke=r),null==e.textStrokeWidth&&(e.textStrokeWidth=2)):(o&&(e.textFill=e.fill||n.outsideFill||"#000"),!e.textStroke&&n.outsideStroke&&(e.textStroke=n.outsideStroke)),e.text=t.text,e.rich=t.rich,pz(t.rich,function(e){Iw(e,e)}),e}function Iw(e,t){t&&(fa(t,"fill")&&(e.textFill=t.fill),fa(t,"stroke")&&(e.textStroke=t.fill),fa(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),fa(t,"font")&&(e.font=t.font),fa(t,"fontStyle")&&(e.fontStyle=t.fontStyle),fa(t,"fontWeight")&&(e.fontWeight=t.fontWeight),fa(t,"fontSize")&&(e.fontSize=t.fontSize),fa(t,"fontFamily")&&(e.fontFamily=t.fontFamily),fa(t,"align")&&(e.textAlign=t.align),fa(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),fa(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),fa(t,"width")&&(e.textWidth=t.width),fa(t,"height")&&(e.textHeight=t.height),fa(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),fa(t,"padding")&&(e.textPadding=t.padding),fa(t,"borderColor")&&(e.textBorderColor=t.borderColor),fa(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),fa(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),fa(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),fa(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),fa(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),fa(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),fa(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),fa(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),fa(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),fa(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var IS={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},I_=pW(IS);pj(mV,function(e,t){return e[t]=1,e},{}),mV.join(", ");var IM=["","style","shape","extra"],IC=fz();function IA(e,t,n,i,r){var o=e+"Animation",a=xj(e,i,r)||{},s=IC(t).userDuring;return a.duration>0&&(a.during=s?pG(IO,{el:t,userDuring:s}):null,a.setToFinal=!0,a.scope=e),pR(a,n[o]),a}function Ik(e,t,n,i){if(e){var r=e.parent,o=IC(e).leaveToProps;if(o){var a=IA("update",e,t,n,0);a.done=function(){r.remove(e),i&&i()},e.animateTo(o,a)}else r.remove(e),i&&i()}}function IT(e){return"all"===e}var ID={},II={setTransform:function(e,t){return ID.el[e]=t,this},getTransform:function(e){return ID.el[e]},setShape:function(e,t){var n=ID.el;return(n.shape||(n.shape={}))[e]=t,n.dirtyShape&&n.dirtyShape(),this},getShape:function(e){var t=ID.el.shape;if(t)return t[e]},setStyle:function(e,t){var n=ID.el,i=n.style;return i&&(i[e]=t,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(e){var t=ID.el.style;if(t)return t[e]},setExtra:function(e,t){return(ID.el.extra||(ID.el.extra={}))[e]=t,this},getExtra:function(e){var t=ID.el.extra;if(t)return t[e]}};function IO(){var e=this.el;if(e){var t=IC(e).userDuring,n=this.userDuring;if(t!==n){this.el=this.userDuring=null;return}ID.el=e,n(II)}}function IP(e,t,n,i){var r,o=n[e];if(o){var a=t[e];if(a){var s=n.transition,l=o.transition;if(l)if(r||(r=i[e]={}),IT(l))pR(r,a);else for(var u=fD(l),c=0;c<u.length;c++){var h=u[c],d=a[h];r[h]=d}else if(IT(s)||pN(s,e)>=0){r||(r=i[e]={});for(var p=pW(a),c=0;c<p.length;c++){var f,g,h=p[c],d=a[h];f=o[h],g=d,(pF(f)?f!==g:null!=f&&isFinite(f))&&(r[h]=d)}}}}}function IE(e,t,n){var i=t[e];if(i)for(var r=n[e]={},o=pW(i),a=0;a<o.length;a++){var s=o[a];r[s]=vM(i[s])}}var IR=fz(),IL=["percent","easing","shape","style","extra"],IN="emphasis",IB="normal",IF="blur",Iz="select",IV=[IB,IN,IF,Iz],Ij={normal:["itemStyle"],emphasis:[IN,"itemStyle"],blur:[IF,"itemStyle"],select:[Iz,"itemStyle"]},IH={normal:["label"],emphasis:[IN,"label"],blur:[IF,"label"],select:[Iz,"label"]},IW=["x","y"],IG={normal:{},emphasis:{},blur:{},select:{}},I$={cartesian2d:function(e){var t=e.master.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:pG(Ig,e)}}},geo:function(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:pG(Im,e)}}},single:function(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:pG(Iv,e)}}},polar:function(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),i=t.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:i[1],r0:i[0]},api:{coord:function(i){var r=t.dataToRadius(i[0]),o=n.dataToAngle(i[1]),a=e.coordToPoint([r,o]);return a.push(r,o*Math.PI/180),a},size:pG(Iy,e)}}},calendar:function(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)}}}}};function IU(e){return e instanceof yO}function Iq(e){return e instanceof vZ}var IY=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.render=function(e,t,n,i){this._progressiveEls=null;var r=this._data,o=e.getData(),a=this.group,s=IQ(e,o,t,n);r||a.removeAll(),o.diff(r).add(function(t){IJ(n,null,t,s(t,i),e,a,o)}).remove(function(t){var n=r.getItemGraphicEl(t);n&&Ik(n,Ip(n).option,e)}).update(function(t,l){IJ(n,r.getItemGraphicEl(l),t,s(t,i),e,a,o)}).execute();var l=e.get("clip",!0)?Mu(e.coordinateSystem,!1,e):null;l?a.setClipPath(l):a.removeClipPath(),this._data=o},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll(),this._data=null},t.prototype.incrementalRender=function(e,t,n,i,r){var o=t.getData(),a=IQ(t,o,n,i),s=this._progressiveEls=[];function l(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}for(var u=e.start;u<e.end;u++){var c=IJ(null,null,u,a(u,r),t,this.group,o);c&&(c.traverse(l),s.push(c))}},t.prototype.eachRendered=function(e){Me(this._progressiveEls||this.group,e)},t.prototype.filterForExposedEvent=function(e,t,n,i){var r=t.element;if(null==r||n.name===r)return!0;for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===r)return!0;return!1},t.type="custom",t}(Mf);function IZ(e){var t,n=e.type;if("path"===n){var i=e.shape,r=null!=i.width&&null!=i.height?{x:i.x||0,y:i.y||0,width:i.width,height:i.height}:null,o=I9(i);Ip(t=_$(o,null,r,i.layout||"center")).customPathData=o}else if("image"===n)Ip(t=new yB({})).customImagePath=e.style.image;else if("text"===n)t=new y4({});else if("group"===n)t=new SI;else if("compoundPath"===n)throw Error('"compoundPath" is not supported yet.');else{var a=_G(n);a||wC(""),t=new a}return Ip(t).customGraphicType=n,t.name=e.name,t.z2EmphasisLift=1,t.z2SelectLift=1,t}function IX(e,t,n,i,r,o,a){t.stopAnimation("keyframe"),t.attr(IR(t));var s=r&&r.normal.cfg;s&&t.setTextConfig(s),i&&null==i.transition&&(i.transition=IW);var l=i&&i.style;if(l){"text"===t.type&&(fa(l,"textFill")&&(l.fill=l.textFill),fa(l,"textStroke")&&(l.stroke=l.textStroke));var u=void 0,c=IU(t)?l.decal:null;e&&c&&(c.dirty=!0,u=Tn(c,e)),l.__decalPattern=u}if(Iq(t)&&l){var u=l.__decalPattern;u&&(l.decal=u)}!function(e,t,n,i){var r,o,a=(i=i||{}).dataIndex,s=i.isInit,l=i.clearStyle,u=n.isAnimationEnabled(),c=IC(e),h=t.style;c.userDuring=t.during;var d={},p={};if(function(e,t){for(var n=0;n<I_.length;n++){var i=I_[n],r=IS[i],o=e[i];o&&(t[r[0]]=o[0],t[r[1]]=o[1])}for(var n=0;n<mV.length;n++){var a=mV[n];null!=e[a]&&(t[a]=e[a])}}(t,p),IE("shape",t,p),IE("extra",t,p),!s&&u&&(function(e,t,n){for(var i=t.transition,r=IT(i)?mV:fD(i||[]),o=0;o<r.length;o++){var a=r[o];if("style"!==a&&"shape"!==a&&"extra"!==a){var s=e[a];n[a]=s}}}(e,t,d),IP("shape",e,t,d),IP("extra",e,t,d),function(e,t,n,i){if(n){var r,o=e.style;if(o){var a=n.transition,s=t.transition;if(a&&!IT(a)){var l=fD(a);r||(r=i.style={});for(var u=0;u<l.length;u++){var c=l[u],h=o[c];r[c]=h}}else if(e.getAnimationStyleProps&&(IT(s)||IT(a)||pN(s,"style")>=0)){var d=e.getAnimationStyleProps(),p=d?d.style:null;if(p){r||(r=i.style={});for(var f=pW(n),u=0;u<f.length;u++){var c=f[u];if(p[c]){var h=o[c];r[c]=h}}}}}}}(e,t,h,d)),p.style=h,function(e,t,n){var i=t.style;if(!e.isGroup&&i){if(n){e.useStyle({});for(var r=e.animators,o=0;o<r.length;o++){var a=r[o];"style"===a.targetName&&a.changeTarget(e.style)}}e.setStyle(i)}t&&(t.style=null,t&&e.attr(t),t.style=i)}(e,p,l),r=e,fa(o=t,"silent")&&(r.silent=o.silent),fa(o,"ignore")&&(r.ignore=o.ignore),r instanceof vZ&&fa(o,"invisible")&&(r.invisible=o.invisible),r instanceof yO&&fa(o,"autoBatch")&&(r.autoBatch=o.autoBatch),u)if(s){var f={};pz(IM,function(e){var n=e?t[e]:t;n&&n.enterFrom&&(e&&(f[e]=f[e]||{}),pR(e?f[e]:f,n.enterFrom))});var g=IA("enter",e,t,n,a);g.duration>0&&e.animateFrom(f,g)}else{var m=e,v=t,y=a||0,x=n,b=d;if(b){var w=IA("update",m,v,x,y);w.duration>0&&m.animateFrom(b,w)}}(function(e,t){for(var n=IC(e).leaveToProps,i=0;i<IM.length;i++){var r=IM[i],o=r?t[r]:t;o&&o.leaveTo&&(n||(n=IC(e).leaveToProps={}),r&&(n[r]=n[r]||{}),pR(r?n[r]:n,o.leaveTo))}})(e,t),h?e.dirty():e.markRedraw()}(t,i,o,{dataIndex:n,isInit:a,clearStyle:!0}),function e(t,n,i){if(i.isAnimationEnabled()&&n){if(pU(n))return void pz(n,function(n){e(t,n,i)});var r=n.keyframes,o=n.duration;if(i&&null==o){var a=xj("enter",i,0);o=a&&a.duration}if(r&&o){var s=IR(t);pz(IM,function(e){var i;e&&!t[e]||(r.sort(function(e,t){return e.percent-t.percent}),pz(r,function(r){var a=t.animators,l=e?r[e]:r;if(l){var u=pW(l);if(e||(u=pH(u,function(e){return 0>pN(IL,e)})),u.length){i||((i=t.animate(e,n.loop,!0)).scope="keyframe");for(var c=0;c<a.length;c++)a[c]!==i&&a[c].targetName===i.targetName&&a[c].stopTracks(u);e&&(s[e]=s[e]||{});var h=e?s[e]:s;pz(u,function(n){h[n]=((e?t[e]:t)||{})[n]}),i.whenWithKeys(o*r.percent,l,u,r.easing)}}}),i&&i.delay(n.delay||0).duration(o).start(n.easing))})}}}(t,i.keyframeAnimation,o)}function IK(e,t,n,i,r){var o=t.isGroup?null:t,a=r&&r[e].cfg;if(o){var s=o.ensureState(e);if(!1===i){var l=o.getState(e);l&&(l.style=null)}else s.style=i||null;a&&(s.textConfig=a),xb(o)}}function IQ(e,t,n,i){var r,o,a,s,l=e.get("renderItem"),u=e.coordinateSystem,c={};u&&(c=u.prepareCustoms?u.prepareCustoms(u):I$[u.type](u));for(var h=pL({getWidth:i.getWidth,getHeight:i.getHeight,getZr:i.getZr,getDevicePixelRatio:i.getDevicePixelRatio,value:function(e,n){return null==n&&(n=a),t.getStore().get(t.getDimensionIndex(e||0),n)},style:function(n,i){null==i&&(i=a);var r=t.getItemVisual(i,"style"),o=r&&r.fill,s=r&&r.opacity,l=b(i,IB).getItemStyle();null!=o&&(l.fill=o),null!=s&&(l.opacity=s);var u={inheritColor:pY(o)?o:"#000"},c=w(i,IB),h=x1(c,null,u,!1,!0);h.text=c.getShallow("show")?p5(e.getFormattedLabel(i,IB),Mw(t,i)):null;var d=x2(c,u,!1);return _(n,l),l=Ib(l,h,d),n&&S(l,n),l.legacy=!0,l},ordinalRawValue:function(e,n){null==n&&(n=a),e=e||0;var i=t.getDimensionInfo(e);if(!i){var r=t.getDimensionIndex(e);return r>=0?t.getStore().get(r,n):void 0}var o=t.get(i.name,n),s=i&&i.ordinalMeta;return s?s.categories[o]:o},styleEmphasis:function(n,i){null==i&&(i=a);var r=b(i,IN).getItemStyle(),o=w(i,IN),s=x1(o,null,null,!0,!0);s.text=o.getShallow("show")?p3(e.getFormattedLabel(i,IN),e.getFormattedLabel(i,IB),Mw(t,i)):null;var l=x2(o,null,!0);return _(n,r),r=Ib(r,s,l),n&&S(r,n),r.legacy=!0,r},visual:function(e,n){if(null==n&&(n=a),fa(Ih,e)){var i=t.getItemVisual(n,"style");return i?i[Ih[e]]:null}if(fa(Id,e))return t.getItemVisual(n,e)},barLayout:function(e){if("cartesian2d"===u.type)return function(e){var t=[],n=e.axis,i="axis0";if("category"===n.type){for(var r=n.getBandWidth(),o=0;o<e.count||0;o++)t.push(pL({bandWidth:r,axisKey:i,stackId:gy+o},e));for(var a=g_(t),s=[],o=0;o<e.count;o++){var l=a[i][gy+o];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}}(pL({axis:u.getBaseAxis()},e))},currentSeriesIndices:function(){return n.getCurrentSeriesIndices()},font:function(e){return x8(e,n)}},c.api||{}),d={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:c.coordSys,dataInsideLength:t.count(),encode:(r=e.getData(),o={},pz(r.dimensions,function(e){var t=r.getDimensionInfo(e);if(!t.isExtraCoord){var n=t.coordDim;(o[n]=o[n]||[])[t.coordDimIndex]=r.getDimensionIndex(e)}}),o)},p={},f={},g={},m={},v=0;v<IV.length;v++){var y=IV[v];g[y]=e.getModel(Ij[y]),m[y]=e.getModel(IH[y])}function x(e){return e===a?s||(s=t.getItemModel(e)):t.getItemModel(e)}function b(e,n){return t.hasItemOption?e===a?p[n]||(p[n]=x(e).getModel(Ij[n])):x(e).getModel(Ij[n]):g[n]}function w(e,n){return t.hasItemOption?e===a?f[n]||(f[n]=x(e).getModel(IH[n])):x(e).getModel(IH[n]):m[n]}return function(e,n){return a=e,s=null,p={},f={},l&&l(pL({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:n?n.type:null},d),h)};function S(e,t){for(var n in t)fa(t,n)&&(e[n]=t[n])}function _(e,t){e&&(e.textFill&&(t.textFill=e.textFill),e.textPosition&&(t.textPosition=e.textPosition))}}function IJ(e,t,n,i,r,o,a){if(!i)return void o.remove(t);var s=I0(e,t,n,i,r,o);return s&&a.setItemGraphicEl(n,s),s&&xP(s,i.focus,i.blurScope,i.emphasisDisabled),s}function I0(e,t,n,i,r,o){var a,s=-1,l=t;t&&I1(t,i,r)&&(s=pN(o.childrenRef(),t),t=null);var u=!t,c=t;c?c.clearStates():(c=IZ(i),l&&((a=c).copyTransform(l),Iq(a)&&Iq(l)&&(a.setStyle(l.style),a.z=l.z,a.z2=l.z2,a.zlevel=l.zlevel,a.invisible=l.invisible,a.ignore=l.ignore,IU(a)&&IU(l)&&a.setShape(l.shape)))),!1===i.morph?c.disableMorphing=!0:c.disableMorphing&&(c.disableMorphing=!1),IG.normal.cfg=IG.normal.conOpt=IG.emphasis.cfg=IG.emphasis.conOpt=IG.blur.cfg=IG.blur.conOpt=IG.select.cfg=IG.select.conOpt=null,IG.isLegacy=!1,function(e,t,n,i,r,o){if(!e.isGroup){I2(n,null,o),I2(n,IN,o);var a=o.normal.conOpt,s=o.emphasis.conOpt,l=o.blur.conOpt,u=o.select.conOpt;if(null!=a||null!=s||null!=u||null!=l){var c=e.getTextContent();if(!1===a)c&&e.removeTextContent();else{a=o.normal.conOpt=a||{type:"text"},c?c.clearStates():(c=IZ(a),e.setTextContent(c)),IX(null,c,t,a,null,i,r);for(var h=a&&a.style,d=0;d<IV.length;d++){var p=IV[d];if(p!==IB){var f=o[p].conOpt;IK(p,c,f,I3(a,f,p),null)}}h?c.dirty():c.markRedraw()}}}}(c,n,i,r,u,IG),function(e,t,n,i,r){var o=n.clipPath;if(!1===o)e&&e.getClipPath()&&e.removeClipPath();else if(o){var a=e.getClipPath();a&&I1(a,o,i)&&(a=null),a||(a=IZ(o),e.setClipPath(a)),IX(null,a,t,o,null,i,r)}}(c,n,i,r,u),IX(e,c,n,i,IG,r,u),fa(i,"info")&&(Ip(c).info=i.info);for(var h=0;h<IV.length;h++){var d=IV[h];if(d!==IB){var p=I5(i,d),f=I3(i,p,d);IK(d,c,p,f,IG)}}var g=c;if(!g.isGroup){var m=r.currentZ,v=r.currentZLevel;g.z=m,g.zlevel=v;var y=i.z2;null!=y&&(g.z2=y||0);for(var x=0;x<IV.length;x++)!function(e,t,n){var i=n===IB,r=i?t:I5(t,n),o=r?r.z2:null;null!=o&&((i?e:e.ensureState(n)).z2=o||0)}(g,i,IV[x])}return"group"===i.type&&function(e,t,n,i,r){var o=i.children,a=o?o.length:0,s=i.$mergeChildren,l="byName"===s||i.diffChildrenByName,u=!1===s;if(a||l||u){if(l){return new Sh((f={api:e,oldChildren:t.children()||[],newChildren:o||[],dataIndex:n,seriesModel:r,group:t}).oldChildren,f.newChildren,I4,I4,f).add(I6).update(I6).remove(I8).execute()}u&&t.removeAll();for(var c=0;c<a;c++){var h=o[c],d=t.childAt(c);h?(null==h.ignore&&(h.ignore=!1),I0(e,d,n,h,r,t)):d.ignore=!0}for(var p=t.childCount()-1;p>=c;p--){var f,g,m,v,y=t.childAt(p);g=t,m=y,v=r,m&&Ik(m,Ip(g).option,v)}}}(e,c,n,i,r),s>=0?o.replaceAt(c,s):o.add(c),c}function I1(e,t,n){var i,r=Ip(e),o=t.type,a=t.shape,s=t.style;return n.isUniversalTransitionEnabled()||null!=o&&o!==r.customGraphicType||"path"===o&&(i=a)&&(fa(i,"pathData")||fa(i,"d"))&&I9(a)!==r.customPathData||"image"===o&&fa(s,"image")&&s.image!==r.customImagePath}function I2(e,t,n){var i,r,o=t?I5(e,t):e,a=t?I3(e,o,IN):e.style,s=e.type,l=o?o.textConfig:null,u=e.textContent,c=u?t?I5(u,t):u:null;if(a&&(n.isLegacy||(i=!!l,r=!!c,a&&(a.legacy||!1!==a.legacy&&!i&&!r&&"tspan"!==s&&("text"===s||fa(a,"text")))))){n.isLegacy=!0;var h=function(e,t,n){var i,r,o;if("text"===t)o=e;else{o={},fa(e,"text")&&(o.text=e.text),fa(e,"rich")&&(o.rich=e.rich),fa(e,"textFill")&&(o.fill=e.textFill),fa(e,"textStroke")&&(o.stroke=e.textStroke),fa(e,"fontFamily")&&(o.fontFamily=e.fontFamily),fa(e,"fontSize")&&(o.fontSize=e.fontSize),fa(e,"fontStyle")&&(o.fontStyle=e.fontStyle),fa(e,"fontWeight")&&(o.fontWeight=e.fontWeight),r={type:"text",style:o,silent:!0},i={};var a=fa(e,"textPosition");n?i.position=a?e.textPosition:"inside":a&&(i.position=e.textPosition),fa(e,"textPosition")&&(i.position=e.textPosition),fa(e,"textOffset")&&(i.offset=e.textOffset),fa(e,"textRotation")&&(i.rotation=e.textRotation),fa(e,"textDistance")&&(i.distance=e.textDistance)}return Ix(o,e),pz(o.rich,function(e){Ix(e,e)}),{textConfig:i,textContent:r}}(a,s,!t);!l&&h.textConfig&&(l=h.textConfig),!c&&h.textContent&&(c=h.textContent)}if(!t&&c){var d=c;d.type||(d.type="text")}var p=t?n[t]:n.normal;p.cfg=l,p.conOpt=c}function I5(e,t){return t?e?e[t]:null:e}function I3(e,t,n){var i=t&&t.style;return null==i&&n===IN&&e&&(i=e.styleEmphasis),i}function I4(e,t){var n=e&&e.name;return null!=n?n:"e\0\0"+t}function I6(e,t){var n=this.context,i=null!=e?n.newChildren[e]:null,r=null!=t?n.oldChildren[t]:null;I0(n.api,r,n.dataIndex,i,n.seriesModel,n.group)}function I8(e){var t=this.context,n=t.oldChildren[e];n&&Ik(n,Ip(n).option,t.seriesModel)}function I9(e){return e&&(e.pathData||e.d)}var I7=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=py.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,i,r,o){var a=this._getBrush(),s=this._getGradient(r,"inRange"),l=this._getGradient(r,"outOfRange"),u=this.pointSize+this.blurSize,c=this.canvas,h=c.getContext("2d"),d=e.length;c.width=t,c.height=n;for(var p=0;p<d;++p){var f=e[p],g=f[0],m=f[1],v=i(f[2]);h.globalAlpha=v,h.drawImage(a,g-u,m-u)}if(!c.width||!c.height)return c;for(var y=h.getImageData(0,0,c.width,c.height),x=y.data,b=0,w=x.length,S=this.minOpacity,_=this.maxOpacity-S;b<w;){var v=x[b+3]/256,M=4*Math.floor(255*v);if(v>0){var C=o(v)?s:l;v>0&&(v=v*_+S),x[b++]=C[M],x[b++]=C[M+1],x[b++]=C[M+2],x[b++]=C[M+3]*v*256}else b+=4}return h.putImageData(y,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=py.createCanvas()),t=this.pointSize+this.blurSize,n=2*t;e.width=n,e.height=n;var i=e.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-t,t,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,i=n[t]||(n[t]=new Uint8ClampedArray(1024)),r=[0,0,0,0],o=0,a=0;a<256;a++)e[t](a/255,!0,r),i[o++]=r[0],i[o++]=r[1],i[o++]=r[2],i[o++]=r[3];return i},e}();function Oe(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}var Ot=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.render=function(e,t,n){t.eachComponent("visualMap",function(t){t.eachTargetSeries(function(n){n===e&&(i=t)})}),this._progressiveEls=null,this.group.removeAll();var i,r=e.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):Oe(r)&&this._renderOnGeo(r,e,i,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,i){var r=t.coordinateSystem;r&&(Oe(r)?this.render(t,n,i):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(t,i,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){Me(this._progressiveEls||this.group,e)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,i,r){var o,a,s,l,u=e.coordinateSystem,c=Mb(u,"cartesian2d");if(c){var h=u.getAxis("x"),d=u.getAxis("y");o=h.getBandWidth()+.5,a=d.getBandWidth()+.5,s=h.scale.getExtent(),l=d.scale.getExtent()}for(var p=this.group,f=e.getData(),g=e.getModel(["emphasis","itemStyle"]).getItemStyle(),m=e.getModel(["blur","itemStyle"]).getItemStyle(),v=e.getModel(["select","itemStyle"]).getItemStyle(),y=e.get(["itemStyle","borderRadius"]),x=x0(e),b=e.getModel("emphasis"),w=b.get("focus"),S=b.get("blurScope"),_=b.get("disabled"),M=c?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],C=n;C<i;C++){var A=void 0,k=f.getItemVisual(C,"style");if(c){var T=f.get(M[0],C),D=f.get(M[1],C);if(isNaN(f.get(M[2],C))||isNaN(T)||isNaN(D)||T<s[0]||T>s[1]||D<l[0]||D>l[1])continue;var I=u.dataToPoint([T,D]);A=new y$({shape:{x:I[0]-o/2,y:I[1]-a/2,width:o,height:a},style:k})}else{if(isNaN(f.get(M[1],C)))continue;A=new y$({z2:1,shape:u.dataToRect([f.get(M[0],C)]).contentShape,style:k})}if(f.hasItemOption){var O=f.getItemModel(C),P=O.getModel("emphasis");g=P.getModel("itemStyle").getItemStyle(),m=O.getModel(["blur","itemStyle"]).getItemStyle(),v=O.getModel(["select","itemStyle"]).getItemStyle(),y=O.get(["itemStyle","borderRadius"]),w=P.get("focus"),S=P.get("blurScope"),_=P.get("disabled"),x=x0(O)}A.shape.r=y;var E=e.getRawValue(C),R="-";E&&null!=E[2]&&(R=E[2]+""),xJ(A,x,{labelFetcher:e,labelDataIndex:C,defaultOpacity:k.opacity,defaultText:R}),A.ensureState("emphasis").style=g,A.ensureState("blur").style=m,A.ensureState("select").style=v,xP(A,w,S,_),A.incremental=r,r&&(A.states.emphasis.hoverLayer=!0),p.add(A),f.setItemGraphicEl(C,A),this._progressiveEls&&this._progressiveEls.push(A)}},t.prototype._renderOnGeo=function(e,t,n,i){var r,o,a,s,l,u,c,h=n.targetVisuals.inRange,d=n.targetVisuals.outOfRange,p=t.getData(),f=this._hmLayer||this._hmLayer||new I7;f.blurSize=t.get("blurSize"),f.pointSize=t.get("pointSize"),f.minOpacity=t.get("minOpacity"),f.maxOpacity=t.get("maxOpacity");var g=e.getViewRect().clone(),m=e.getRoamTransform();g.applyTransform(m);var v=Math.max(g.x,0),y=Math.max(g.y,0),x=Math.min(g.width+g.x,i.getWidth()),b=Math.min(g.height+g.y,i.getHeight()),w=x-v,S=b-y,_=[p.mapDimension("lng"),p.mapDimension("lat"),p.mapDimension("value")],M=p.mapArray(_,function(t,n,i){var r=e.dataToPoint([t,n]);return r[0]-=v,r[1]-=y,r.push(i),r}),C=n.getExtent(),A="visualMap.continuous"===n.type?(r=n.option.range,o=C[1]-C[0],r=[(r[0]-C[0])/o,(r[1]-C[0])/o],function(e){return e>=r[0]&&e<=r[1]}):(a=n.getPieceList(),s=n.option.selected,l=C[1]-C[0],u=(a=pV(a,function(e){return{interval:[(e.interval[0]-C[0])/l,(e.interval[1]-C[0])/l]}})).length,c=0,function(e){var t;for(t=c;t<u;t++){var n=a[t].interval;if(n[0]<=e&&e<=n[1]){c=t;break}}if(t===u)for(t=c-1;t>=0;t--){var n=a[t].interval;if(n[0]<=e&&e<=n[1]){c=t;break}}return t>=0&&t<u&&s[t]});f.update(M,w,S,h.color.getNormalizer(),{inRange:h.color.getColorMapper(),outOfRange:d.color.getColorMapper()},A);var k=new yB({style:{width:w,height:S,x:v,y:y,image:f.canvas},silent:!0});this.group.add(k)},t.type="heatmap",t}(Mf),On=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.getInitialData=function(e,t){return SA(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var e=SS.get(this.get("coordinateSystem"));if(e&&e.dimensions)return"lng"===e.dimensions[0]&&"lat"===e.dimensions[1]},t.type="series.heatmap",t.dependencies=["grid","geo","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},t}(St),Oi=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return gO(t,e),t.prototype.init=function(t,n,i){e.prototype.init.call(this,t,n,i),this._sourceManager=new wU(this),wq(this)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),wq(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type="dataset",t.defaultOption={seriesLayoutBy:f1},t}(wr),Or=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return gO(t,e),t.type="dataset",t}(ka),Oo=["x","y","radius","angle","single"],Oa=["cartesian2d","polar","singleAxis"];function Os(e){return e+"Axis"}function Ol(e){var t=e.ecModel,n={infoList:[],infoMap:fi()};return e.eachTargetAxis(function(e,i){var r=t.getComponent(Os(e),i);if(r){var o=r.getCoordSysModel();if(o){var a=o.uid,s=n.infoMap.get(a);s||(s={model:o,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(r)}}}),n}var Ou=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),Oc=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return gO(t,e),t.prototype.init=function(e,t,n){var i=Oh(e);this.settledOption=i,this.mergeDefaultAndTheme(e,n),this._doInit(i)},t.prototype.mergeOption=function(e){var t=Oh(e);pE(this.option,e,!0),pE(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;pz([["start","startValue"],["end","endValue"]],function(e,i){"value"===this._rangePropMode[i]&&(t[e[0]]=n[e[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),t=this._targetAxisInfoMap=fi();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||"horizontal",this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each(function(e){e.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return pz(Oo,function(n){var i=this.getReferringComponents(Os(n),fG);if(i.specified){t=!0;var r=new Ou;pz(i.models,function(e){r.add(e.componentIndex)}),e.set(n,r)}},this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,i=!0,r="vertical"===t?"y":"x",o=n.findComponents({mainType:r+"Axis"});if(a(o,r),i){var o=n.findComponents({mainType:"singleAxis",filter:function(e){return e.get("orient",!0)===t}});a(o,"single")}function a(t,n){var r=t[0];if(r){var o=new Ou;if(o.add(r.componentIndex),e.set(n,o),i=!1,"x"===n||"y"===n){var a=r.getReferringComponents("grid",fW).models[0];a&&pz(t,function(e){r.componentIndex!==e.componentIndex&&a===e.getReferringComponents("grid",fW).models[0]&&o.add(e.componentIndex)})}}}i&&pz(Oo,function(t){if(i){var r=n.findComponents({mainType:Os(t),filter:function(e){return"category"===e.get("type",!0)}});if(r[0]){var o=new Ou;o.add(r[0].componentIndex),e.set(t,o),i=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis(function(t){e||(e=t)},this),"y"===e?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get("rangeMode");pz([["start","startValue"],["end","endValue"]],function(i,r){var o=null!=e[i[0]],a=null!=e[i[1]];o&&!a?t[r]="percent":!o&&a?t[r]="value":n?t[r]=n[r]:o&&(t[r]="percent")})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis(function(t,n){null==e&&(e=this.ecModel.getComponent(Os(t),n))},this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each(function(n,i){pz(n.indexList,function(n){e.call(t,i,n)})})},t.prototype.getAxisProxy=function(e,t){var n=this.getAxisModel(e,t);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,t){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(Os(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;pz([["start","startValue"],["end","endValue"]],function(i){(null!=e[i[0]]||null!=e[i[1]])&&(t[i[0]]=n[i[0]]=e[i[0]],t[i[1]]=n[i[1]]=e[i[1]])},this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;pz(["start","startValue","end","endValue"],function(n){t[n]=e[n]})},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,t){if(null!=e||null!=t)return this.getAxisProxy(e,t).getDataValueWindow();var n=this.findRepresentativeAxisProxy();if(n)return n.getDataValueWindow()},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var t,n=this._targetAxisInfoMap.keys(),i=0;i<n.length;i++)for(var r=n[i],o=this._targetAxisInfoMap.get(r),a=0;a<o.indexList.length;a++){var s=this.getAxisProxy(r,o.indexList[a]);if(s.hostedBy(this))return s;t||(t=s)}return t},t.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},t.prototype.getOrient=function(){return this._orient},t.type="dataZoom",t.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],t.defaultOption={z:4,filterMode:"filter",start:0,end:100},t}(wr);function Oh(e){var t={};return pz(["start","end","startValue","endValue","throttle"],function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}var Od=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.type="dataZoom.inside",t.defaultOption=bp(Oc.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(Oc),Op=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.render=function(e,t,n,i){this.dataZoomModel=e,this.ecModel=t,this.api=n},t.type="dataZoom",t}(ka);function Of(e,t,n,i,r,o){e=e||0;var a,s=n[1]-n[0];if(null!=r&&(r=Om(r,[0,s])),null!=o&&(o=Math.max(o,null!=r?r:0)),"all"===i){var l=Math.abs(t[1]-t[0]);l=Om(l,[0,s]),r=o=Om(l,[r,o]),i=0}t[0]=Om(t[0],n),t[1]=Om(t[1],n);var u=Og(t,i);t[i]+=e;var c=r||0,h=n.slice();return u.sign<0?h[0]+=c:h[1]-=c,t[i]=Om(t[i],h),a=Og(t,i),null!=r&&(a.sign!==u.sign||a.span<r)&&(t[1-i]=t[i]+u.sign*r),a=Og(t,i),null!=o&&a.span>o&&(t[1-i]=t[i]+a.sign*o),t}function Og(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function Om(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var Ov="\0_ec_interaction_mutex";function Oy(e){return e[Ov]||(e[Ov]={})}TR({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},fs);var Ox=function(e){function t(t){var n=e.call(this)||this;n._zr=t;var i=pG(n._mousedownHandler,n),r=pG(n._mousemoveHandler,n),o=pG(n._mouseupHandler,n),a=pG(n._mousewheelHandler,n),s=pG(n._pinchHandler,n);return n.enable=function(e,n){this.disable(),this._opt=pL(pP(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==e&&(e=!0),(!0===e||"move"===e||"pan"===e)&&(t.on("mousedown",i),t.on("mousemove",r),t.on("mouseup",o)),(!0===e||"scale"===e||"zoom"===e)&&(t.on("mousewheel",a),t.on("pinch",s))},n.disable=function(){t.off("mousedown",i),t.off("mousemove",r),t.off("mouseup",o),t.off("mousewheel",a),t.off("pinch",s)},n}return gO(t,e),t.prototype.isDragging=function(){return this._dragging},t.prototype.isPinching=function(){return this._pinching},t.prototype.setPointerChecker=function(e){this.pointerChecker=e},t.prototype.dispose=function(){this.disable()},t.prototype._mousedownHandler=function(e){if(!C6(e)){for(var t=e.target;t;){if(t.draggable)return;t=t.__hostTarget||t.parent}var n=e.offsetX,i=e.offsetY;this.pointerChecker&&this.pointerChecker(e,n,i)&&(this._x=n,this._y=i,this._dragging=!0)}},t.prototype._mousemoveHandler=function(e){if(!(!this._dragging||!OS("moveOnMouseMove",e,this._opt)||"pinch"===e.gestureEvent||Oy(this._zr).globalPan)){var t=e.offsetX,n=e.offsetY,i=this._x,r=this._y;this._x=t,this._y=n,this._opt.preventDefaultMouseMove&&C4(e.event),Ow(this,"pan","moveOnMouseMove",e,{dx:t-i,dy:n-r,oldX:i,oldY:r,newX:t,newY:n,isAvailableBehavior:null})}},t.prototype._mouseupHandler=function(e){C6(e)||(this._dragging=!1)},t.prototype._mousewheelHandler=function(e){var t=OS("zoomOnMouseWheel",e,this._opt),n=OS("moveOnMouseWheel",e,this._opt),i=e.wheelDelta,r=Math.abs(i),o=e.offsetX,a=e.offsetY;if(0!==i&&(t||n)){if(t){var s=r>3?1.4:r>1?1.2:1.1;Ob(this,"zoom","zoomOnMouseWheel",e,{scale:i>0?s:1/s,originX:o,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(i);Ob(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:o,originY:a,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){if(!Oy(this._zr).globalPan){var t=e.pinchScale>1?1.1:1/1.1;Ob(this,"zoom",null,e,{scale:t,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})}},t}(vO);function Ob(e,t,n,i,r){e.pointerChecker&&e.pointerChecker(i,r.originX,r.originY)&&(C4(i.event),Ow(e,t,n,i,r))}function Ow(e,t,n,i,r){r.isAvailableBehavior=pG(OS,null,n,i),e.trigger(t,r)}function OS(e,t,n){var i=n[e];return!e||i&&(!pY(i)||t.event[i+"Key"])}var O_=fz();function OM(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function OC(e,t){e.isDisposed()||e.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:t})}function OA(e,t,n,i){return e.coordinateSystem.containPoint([n,i])}var Ok=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return gO(t,e),t.prototype.render=function(t,n,i){var r;(e.prototype.render.apply(this,arguments),t.noTarget())?this._clear():(this.range=t.getPercentRange(),r={pan:pG(OT.pan,this),zoom:pG(OT.zoom,this),scrollMove:pG(OT.scrollMove,this)},O_(i).coordSysRecordMap.each(function(e){var n=e.dataZoomInfoMap.get(t.uid);n&&(n.getRange=r)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){!function(e,t){for(var n=O_(e).coordSysRecordMap,i=n.keys(),r=0;r<i.length;r++){var o=i[r],a=n.get(o),s=a.dataZoomInfoMap;if(s){var l=t.uid;s.get(l)&&(s.removeKey(l),s.keys().length||OM(n,a))}}}(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(Op),OT={zoom:function(e,t,n,i){var r=this.range,o=r.slice(),a=e.axisModels[0];if(a){var s=OI[t](null,[i.originX,i.originY],a,n,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/i.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Of(0,o,[0,100],0,c.minSpan,c.maxSpan),this.range=o,r[0]!==o[0]||r[1]!==o[1])return o}},pan:OD(function(e,t,n,i,r,o){var a=OI[i]([o.oldX,o.oldY],[o.newX,o.newY],t,r,n);return a.signal*(e[1]-e[0])*a.pixel/a.pixelLength}),scrollMove:OD(function(e,t,n,i,r,o){return OI[i]([0,0],[o.scrollDelta,o.scrollDelta],t,r,n).signal*(e[1]-e[0])*o.scrollDelta})};function OD(e){return function(t,n,i,r){var o=this.range,a=o.slice(),s=t.axisModels[0];if(s&&(Of(e(a,s,t,n,i,r),a,[0,100],"all"),this.range=a,o[0]!==a[0]||o[1]!==a[1]))return a}}var OI={grid:function(e,t,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem.getRect();return e=e||[0,0],"x"===o.dim?(a.pixel=t[0]-e[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=t[1]-e[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(e,t,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===n.mainType?(a.pixel=t[0]-e[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=t[1]-e[1],a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=o.inverse?-1:1),a},singleAxis:function(e,t,n,i,r){var o=n.axis,a=r.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===o.orient?(s.pixel=t[0]-e[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}},OO=function(){function e(e,t,n,i){this._dimName=e,this._axisIndex=t,this.ecModel=i,this._dataZoomModel=n}return e.prototype.hostedBy=function(e){return this._dataZoomModel===e},e.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},e.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},e.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(t){if(pN(Oa,t.get("coordinateSystem"))>=0){var n=Os(this._dimName),i=t.getReferringComponents(n,fW).models[0];i&&this._axisIndex===i.componentIndex&&e.push(t)}},this),e},e.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},e.prototype.getMinMaxSpan=function(){return pP(this._minMaxSpan)},e.prototype.calculateDataWindow=function(e){var t,n=this._dataExtent,i=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),o=[0,100],a=[],s=[];pz(["start","end"],function(l,u){var c=e[l],h=e[l+"Value"];"percent"===r[u]?(null==c&&(c=o[u]),h=i.parse(fu(c,o,n))):(t=!0,c=fu(h=null==h?n[u]:i.parse(h),n,o)),s[u]=null==h||isNaN(h)?n[u]:h,a[u]=null==c||isNaN(c)?o[u]:c}),fd(s),fd(a);var l=this._minMaxSpan;function u(e,t,n,r,o){var a=o?"Span":"ValueSpan";Of(0,e,n,"all",l["min"+a],l["max"+a]);for(var s=0;s<2;s++)t[s]=fu(e[s],n,r,!0),o&&(t[s]=i.parse(t[s]))}return t?u(s,a,n,o,!1):u(a,s,o,n,!0),{valueWindow:s,percentWindow:a}},e.prototype.reset=function(e){if(e===this._dataZoomModel){var t,n,i,r,o,a=this.getTargetSeriesModels();this._dataExtent=(t=this,n=this._dimName,i=[1/0,-1/0],pz(a,function(e){var t;t=e.getData(),t&&pz(DD(t,n),function(e){var n=t.getApproximateExtent(e);n[0]<i[0]&&(i[0]=n[0]),n[1]>i[1]&&(i[1]=n[1])})}),[(o=Dw((r=t.getAxisModel()).axis.scale,r,i).calculate()).min,o.max]),this._updateMinMaxSpan();var s=this.calculateDataWindow(e.settledOption);this._valueWindow=s.valueWindow,this._percentWindow=s.percentWindow,this._setAxisModel()}},e.prototype.filterData=function(e,t){if(e===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),r=e.get("filterMode"),o=this._valueWindow;"none"!==r&&pz(i,function(e){var t=e.getData(),i=t.mapDimensionsAll(n);if(i.length){if("weakFilter"===r){var a=t.getStore(),s=pV(i,function(e){return t.getDimensionIndex(e)},t);t.filterSelf(function(e){for(var t,n,r,l=0;l<i.length;l++){var u=a.get(s[l],e),c=!isNaN(u),h=u<o[0],d=u>o[1];if(c&&!h&&!d)return!0;c&&(r=!0),h&&(t=!0),d&&(n=!0)}return r&&t&&n})}else pz(i,function(n){if("empty"===r)e.setData(t=t.map(n,function(e){var t;return(t=e)>=o[0]&&t<=o[1]?e:NaN}));else{var i={};i[n]=o,t.selectRange(i)}});pz(i,function(e){t.setApproximateExtent(o,e)})}})}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;pz(["min","max"],function(i){var r=t.get(i+"Span"),o=t.get(i+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?r=fu(n[0]+o,n,[0,100],!0):null!=r&&(o=fu(r,[0,100],n,!0)-n[0]),e[i+"Span"]=r,e[i+"ValueSpan"]=o},this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var i=ff(n,[0,500]);i=Math.min(i,20);var r=e.axis.scale.rawExtentInfo;0!==t[0]&&r.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==t[1]&&r.setDeterminedMinMax("max",+n[1].toFixed(i)),r.freeze()}},e}();let OP={getTargetSeries:function(e){function t(t){e.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(i,r){var o=e.getComponent(Os(i),r);t(i,r,o,n)})})}t(function(e,t,n,i){n.__dzAxisProxy=null});var n=[];t(function(t,i,r,o){r.__dzAxisProxy||(r.__dzAxisProxy=new OO(t,i,o,e),n.push(r.__dzAxisProxy))});var i=fi();return pz(n,function(e){pz(e.getTargetSeriesModels(),function(e){i.set(e.uid,e)})}),i},overallReset:function(e,t){e.eachComponent("dataZoom",function(e){e.eachTargetAxis(function(t,n){e.getAxisProxy(t,n).reset(e)}),e.eachTargetAxis(function(n,i){e.getAxisProxy(n,i).filterData(e,t)})}),e.eachComponent("dataZoom",function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),i=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}})}};var OE=!1;function OR(e){OE||(OE=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,OP),e.registerAction("dataZoom",function(e,t){pz(function(e,t){var n,i=fi(),r=[],o=fi();e.eachComponent({mainType:"dataZoom",query:t},function(e){o.get(e.uid)||s(e)});do n=!1,e.eachComponent("dataZoom",a);while(n);function a(e){var t;!o.get(e.uid)&&(t=!1,e.eachTargetAxis(function(e,n){var r=i.get(e);r&&r[n]&&(t=!0)}),t)&&(s(e),n=!0)}function s(e){o.set(e.uid,!0),r.push(e),e.eachTargetAxis(function(e,t){(i.get(e)||i.set(e,[]))[t]=!0})}return r}(t,e),function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})}),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function OL(e){OR(e),e.registerComponentModel(Od),e.registerComponentView(Ok),e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(e,t){var n=O_(t),i=n.coordSysRecordMap||(n.coordSysRecordMap=fi());i.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(e){pz(Ol(e).infoList,function(n){var r,o,a,s=n.model.uid,l=i.get(s)||i.set(s,(a=(o={model:r=n.model,containsPoint:p$(OA,r),dispatchAction:p$(OC,t),dataZoomInfoMap:null,controller:null}).controller=new Ox(t.getZr()),pz(["pan","zoom","scrollMove"],function(e){a.on(e,function(t){var n=[];o.dataZoomInfoMap.each(function(i){if(t.isAvailableBehavior(i.model.option)){var r=(i.getRange||{})[e],a=r&&r(i.dzReferCoordSysInfo,o.model.mainType,o.controller,t);!i.model.get("disabled",!0)&&a&&n.push({dataZoomId:i.model.id,start:a[0],end:a[1]})}}),n.length&&o.dispatchAction(n)})}),o));(l.dataZoomInfoMap||(l.dataZoomInfoMap=fi())).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})})}),i.each(function(e){var t,n,r,o,a,s=e.controller,l=e.dataZoomInfoMap;if(l){var u=l.keys()[0];null!=u&&(a=l.get(u))}if(!a)return void OM(i,e);var c=(n="type_",r={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0,l.each(function(e){var i=e.model,a=!i.get("disabled",!0)&&(!i.get("zoomLock",!0)||"move");r[n+a]>r[n+t]&&(t=a),o=o&&i.get("preventDefaultMouseMove",!0)}),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o}});s.enable(c.controlType,c.opt),s.setPointerChecker(e.containsPoint),Mo(e,"dispatchAction",a.model.get("throttle",!0),"fixRate")})})}var ON=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=bp(Oc.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),t}(Oc),OB="horizontal",OF="vertical",Oz=["line","bar","candlestick","scatter"],OV={easing:"cubicOut",duration:100,delay:0},Oj=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return gO(t,e),t.prototype.init=function(e,t){this.api=t,this._onBrush=pG(this._onBrush,this),this._onBrushEnd=pG(this._onBrushEnd,this)},t.prototype.render=function(t,n,i,r){if(e.prototype.render.apply(this,arguments),Mo(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1===t.get("show"))return void this.group.removeAll();if(t.noTarget()){this._clear(),this.group.removeAll();return}r&&"dataZoom"===r.type&&r.from===this.uid||this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){Ma(this,"_dispatchZoomAction");var e=this.api.getZr();e.off("mousemove",this._onBrush),e.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new SI;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get("brushSelect"),i=this._findCoordRect(),r={width:t.getWidth(),height:t.getHeight()},o=this._orient===OB?{right:r.width-i.x-i.width,top:r.height-30-7-7*!!n,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},a=wn(e.option);pz(["right","top","width","height"],function(e){"ph"===a[e]&&(a[e]=o[e])});var s=b9(a,r);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===OF&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),r=i&&i.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==OB||r?n===OB&&r?{scaleY:a?1:-1,scaleX:-1}:n!==OF||r?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});var s=e.getBoundingRect([o]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,i=e.get("brushSelect");n.add(new y$({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var r=new y$({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:pG(this._onClickPanel,this)}),o=this.api.getZr();i?(r.on("mousedown",this._onBrushStart,this),r.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(r)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],e){var t=this._size,n=this._shadowSize||[],i=e.series,r=i.getRawData(),o=i.getShadowDim&&i.getShadowDim(),a=o&&r.getDimensionInfo(o)?i.getShadowDim():e.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(r!==this._shadowData||a!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var u,c=r.getDataExtent(a),h=(c[1]-c[0])*.3;c=[c[0]-h,c[1]+h];var d=[0,t[1]],p=[0,t[0]],f=[[t[0],0],[0,0]],g=[],m=p[1]/(r.count()-1),v=0,y=Math.round(r.count()/t[0]);r.each([a],function(e,t){if(y>0&&t%y){v+=m;return}var n=null==e||isNaN(e)||""===e,i=n?0:fu(e,c,d,!0);n&&!u&&t?(f.push([f[f.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&u&&(f.push([v,0]),g.push([v,0])),f.push([v,i]),g.push([v,i]),v+=m,u=n}),s=this._shadowPolygonPts=f,l=this._shadowPolylinePts=g}this._shadowData=r,this._shadowDim=a,this._shadowSize=[t[0],t[1]];for(var x=this.dataZoomModel,b=0;b<3;b++){var w=function(e){var t=x.getModel(e?"selectedDataBackground":"dataBackground"),n=new SI,i=new _c({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new _p({shape:{points:l},segmentIgnoreThreshold:1,style:t.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(r),n}(1===b);this._displayables.sliderGroup.add(w),this._displayables.dataShadowSegs.push(w)}}}},t.prototype._prepareDataShadowInfo=function(){var e,t=this.dataZoomModel,n=t.get("showDataShadow");if(!1!==n){var i=this.ecModel;return t.eachTargetAxis(function(r,o){pz(t.getAxisProxy(r,o).getTargetSeriesModels(),function(t){if(!e&&!(!0!==n&&0>pN(Oz,t.get("type")))){var a,s=i.getComponent(Os(r),o).axis,l={x:"y",y:"x",radius:"angle",angle:"radius"}[r],u=t.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=t.getData().mapDimension(l),e={thisAxis:s,series:t,thisDim:r,otherDim:l,otherAxisInverse:a}}},this)},this),e}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],i=t.handleLabels=[null,null],r=this._displayables.sliderGroup,o=this._size,a=this.dataZoomModel,s=this.api,l=a.get("borderRadius")||0,u=a.get("brushSelect"),c=t.filler=new y$({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});r.add(c),r.add(new y$({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),pz([0,1],function(t){var o=a.get("handleIcon");!MZ[o]&&0>o.indexOf("path://")&&0>o.indexOf("image://")&&(o="path://"+o);var s=MQ(o,-1,0,2,2,null,!0);s.attr({cursor:OH(this._orient),draggable:!0,drift:pG(this._onDragMove,this,t),ondragend:pG(this._onDragEnd,this),onmouseover:pG(this._showDataInfo,this,!0),onmouseout:pG(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=a.get("handleSize");this._handleHeight=fc(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(a.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=a.getModel(["emphasis","handleStyle"]).getItemStyle(),xO(s);var c=a.get("handleColor");null!=c&&(s.style.fill=c),r.add(n[t]=s);var h=a.getModel("textStyle");e.add(i[t]=new y4({silent:!0,invisible:!0,style:x1(h,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:h.getTextColor(),font:h.getFont()}),z2:10}))},this);var h=c;if(u){var d=fc(a.get("moveHandleSize"),o[1]),p=t.moveHandle=new y$({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:d}}),f=.8*d,g=t.moveHandleIcon=MQ(a.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=o[1]+d/2-.5,p.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(o[1]/2,Math.max(d,10));(h=t.moveZone=new y$({invisible:!0,shape:{y:o[1]-m,height:d+m}})).on("mouseover",function(){s.enterEmphasis(p)}).on("mouseout",function(){s.leaveEmphasis(p)}),r.add(p),r.add(g),r.add(h)}h.attr({draggable:!0,cursor:OH(this._orient),drift:pG(this._onDragMove,this,"all"),ondragstart:pG(this._showDataInfo,this,!0),ondragend:pG(this._onDragEnd,this),onmouseover:pG(this._showDataInfo,this,!0),onmouseout:pG(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[fu(e[0],[0,100],t,!0),fu(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,i=this._handleEnds,r=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];Of(t,i,r,n.get("zoomLock")?"all":e,null!=o.minSpan?fu(o.minSpan,a,r,!0):null,null!=o.maxSpan?fu(o.maxSpan,a,r,!0):null);var s=this._range,l=this._range=fd([fu(i[0],r,a,!0),fu(i[1],r,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,i=fd(n.slice()),r=this._size;pz([0,1],function(e){var i=t.handles[e],o=this._handleHeight;i.attr({scaleX:o/2,scaleY:o/2,x:n[e]+(e?-1:1),y:r[1]/2-o/2})},this),t.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:r[1]});var o={x:i[0],width:i[1]-i[0]};t.moveHandle&&(t.moveHandle.setShape(o),t.moveZone.setShape(o),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr("x",o.x+o.width/2));for(var a=t.dataShadowSegs,s=[0,i[0],i[1],r[0]],l=0;l<a.length;l++){var u=a[l],c=u.getClipPath();c||(c=new y$,u.setClipPath(c)),c.setShape({x:s[l],y:0,width:s[l+1]-s[l],height:r[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,i=n.handleLabels,r=this._orient,o=["",""];if(t.get("showDetail")){var a=t.findRepresentativeAxisProxy();if(a){var s=a.getAxisModel().axis,l=this._range,u=e?a.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:a.getDataValueWindow();o=[this._formatLabel(u[0],s),this._formatLabel(u[1],s)]}}var c=fd(this._handleEnds.slice());function h(e){var t=_J(n.handles[e].parent,this.group),a=_1(0===e?"right":"left",t),s=this._handleWidth/2+5,l=_0([c[e]+(0===e?-s:s),this._size[1]/2],t);i[e].setStyle({x:l[0],y:l[1],verticalAlign:r===OB?"middle":a,align:r===OB?a:"center",text:o[e]})}h.call(this,0),h.call(this,1)},t.prototype._formatLabel=function(e,t){var n=this.dataZoomModel,i=n.get("labelFormatter"),r=n.get("labelPrecision");(null==r||"auto"===r)&&(r=t.getPixelPrecision());var o=null==e||isNaN(e)?"":"category"===t.type||"time"===t.type?t.scale.getLabel({value:Math.round(e)}):e.toFixed(Math.min(r,20));return pq(i)?i(e,o):pY(i)?i.replace("{value}",o):o},t.prototype._showDataInfo=function(e){e=this._dragging||e;var t=this._displayables,n=t.handleLabels;n[0].attr("invisible",!e),n[1].attr("invisible",!e),t.moveHandle&&this.api[e?"enterEmphasis":"leaveEmphasis"](t.moveHandle,1)},t.prototype._onDragMove=function(e,t,n,i){this._dragging=!0,C4(i.event);var r=_0([t,n],this._displayables.sliderGroup.getLocalTransform(),!0),o=this._updateInterval(e,r[0]),a=this.dataZoomModel.get("realtime");this._updateView(!a),o&&a&&this._dispatchZoomAction(!0)},t.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),this.dataZoomModel.get("realtime")||this._dispatchZoomAction(!1)},t.prototype._onClickPanel=function(e){var t=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(n[0]<0)&&!(n[0]>t[0])&&!(n[1]<0)&&!(n[1]>t[1])){var i=this._handleEnds,r=(i[0]+i[1])/2,o=this._updateInterval("all",n[0]-r);this._updateView(),o&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new g4(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr("ignore",!0);var n=t.shape;if(!(new Date-this._brushStartTime<200&&5>Math.abs(n.width))){var i=this._getViewExtent(),r=[0,100];this._range=fd([fu(n.x,i,r,!0),fu(n.x+n.width,i,r,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(C4(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,i=this.dataZoomModel,r=n.brushRect;r||(r=n.brushRect=new y$({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(r)),r.attr("ignore",!1);var o=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(e,t),l=a.transformCoordToLocal(o.x,o.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),r.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?OV:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=Ol(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var i=this.api.getWidth(),r=this.api.getHeight();e={x:.2*i,y:.2*r,width:.6*i,height:.6*r}}return e},t.type="dataZoom.slider",t}(Op);function OH(e){return"vertical"===e?"ns-resize":"ew-resize"}function OW(e){e.registerComponentModel(ON),e.registerComponentView(Oj),OR(e)}var OG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return gO(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;!0===t&&(t=e.selector=["all","inverse"]),pU(t)&&pz(t,function(e,i){var r;pY(e)&&(e={type:e}),t[i]=pE(e,"all"===(r=e.type)?{type:"all",title:n.getLocaleModel().get(["legend","selector","all"])}:"inverse"===r?{type:"inverse",title:n.getLocaleModel().get(["legend","selector","inverse"])}:void 0)})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,n=0;n<e.length;n++){var i=e[n].get("name");if(this.isSelected(i)){this.select(i),t=!0;break}}t||this.select(e[0].get("name"))}},t.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries(function(i){var r,o=i.name;if(n.push(o),i.legendVisualProvider){var a=i.legendVisualProvider.getAllNames();e.isSeriesFiltered(i)||(n=n.concat(a)),a.length?t=t.concat(a):r=!0}else r=!0;r&&fN(i)&&t.push(i.name)}),this._availableNames=n;var i=this.get("data")||t,r=fi(),o=pV(i,function(e){return((pY(e)||pX(e))&&(e={name:e}),r.get(e.name))?null:(r.set(e.name,!0),new bc(e,this,this.ecModel))},this);this._data=pH(o,function(e){return!!e})},t.prototype.getData=function(){return this._data},t.prototype.select=function(e){var t=this.option.selected;"single"===this.get("selectedMode")&&pz(this._data,function(e){t[e.get("name")]=!1}),t[e]=!0},t.prototype.unSelect=function(e){"single"!==this.get("selectedMode")&&(this.option.selected[e]=!1)},t.prototype.toggleSelected=function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?"unSelect":"select"](e)},t.prototype.allSelect=function(){var e=this._data,t=this.option.selected;pz(e,function(e){t[e.get("name",!0)]=!0})},t.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;pz(e,function(e){var n=e.get("name",!0);t.hasOwnProperty(n)||(t[n]=!0),t[n]=!t[n]})},t.prototype.isSelected=function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&pN(this._availableNames,e)>=0},t.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(wr);function O$(e,t){var n=p6(t.get("padding")),i=t.getItemStyle(["color","opacity"]);return i.fill=t.get("backgroundColor"),e=new y$({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get("borderRadius")},style:i,silent:!0,z2:-1})}var OU=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return gO(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new SI),this.group.add(this._selectorGroup=new SI),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var r=e.get("align"),o=e.get("orient");r&&"auto"!==r||(r="right"===e.get("left")&&"vertical"===o?"right":"left");var a=e.get("selector",!0),s=e.get("selectorPosition",!0);a&&(!s||"auto"===s)&&(s="horizontal"===o?"end":"start"),this.renderInner(r,e,t,n,a,o,s);var l=e.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),h=b9(l,u,c),d=this.layoutInner(e,r,h,i,a,s),p=b9(pL({width:d.width,height:d.height},l),u,c);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=O$(d,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,i,r,o,a){var s=this.getContentGroup(),l=fi(),u=t.get("selectedMode"),c=[];n.eachRawSeries(function(e){e.get("legendHoverLink")||c.push(e.id)}),pz(t.getData(),function(r,o){var a=r.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var h=new SI;h.newline=!0,s.add(h);return}var d=n.getSeriesByName(a)[0];if(!l.get(a))if(d){var p=d.getData(),f=p.getVisual("legendLineStyle")||{},g=p.getVisual("legendIcon"),m=p.getVisual("style"),v=this._createItem(d,a,o,r,t,e,f,m,g,u,i);v.on("click",p$(Oq,a,null,i,c)).on("mouseover",p$(OZ,d.name,null,i,c)).on("mouseout",p$(OX,d.name,null,i,c)),n.ssr&&v.eachChild(function(e){var t=y6(e);t.seriesIndex=d.seriesIndex,t.dataIndex=o,t.ssrType="legend"}),l.set(a,!0)}else n.eachRawSeries(function(s){if(!l.get(a)&&s.legendVisualProvider){var h=s.legendVisualProvider;if(h.containName(a)){var d=h.indexOfName(a),p=h.getItemVisual(d,"style"),f=h.getItemVisual(d,"legendIcon"),g=vc(p.fill);g&&0===g[3]&&(g[3]=.2,p=pR(pR({},p),{fill:vm(g,"rgba")}));var m=this._createItem(s,a,o,r,t,e,{},p,f,u,i);m.on("click",p$(Oq,null,a,i,c)).on("mouseover",p$(OZ,null,a,i,c)).on("mouseout",p$(OX,null,a,i,c)),n.ssr&&m.eachChild(function(e){var t=y6(e);t.seriesIndex=s.seriesIndex,t.dataIndex=o,t.ssrType="legend"}),l.set(a,!0)}}},this)},this),r&&this._createSelector(r,t,i,o,a)},t.prototype._createSelector=function(e,t,n,i,r){var o=this.getSelectorGroup();pz(e,function(e){var i=e.type,r=new y4({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});o.add(r),xJ(r,{normal:t.getModel("selectorLabel"),emphasis:t.getModel(["emphasis","selectorLabel"])},{defaultText:e.title}),xO(r)})},t.prototype._createItem=function(e,t,n,i,r,o,a,s,l,u,c){var h=e.visualDrawType,d=r.get("itemWidth"),p=r.get("itemHeight"),f=r.isSelected(t),g=i.get("symbolRotate"),m=i.get("symbolKeepAspect"),v=i.get("icon"),y=function(e,t,n,i,r,o,a){function s(e,t){"auto"===e.lineWidth&&(e.lineWidth=2*(t.lineWidth>0)),pz(e,function(n,i){"inherit"===e[i]&&(e[i]=t[i])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=0===e.lastIndexOf("empty",0)?"fill":"stroke",h=l.getShallow("decal");u.decal=h&&"inherit"!==h?Tn(h,a):i.decal,"inherit"===u.fill&&(u.fill=i[r]),"inherit"===u.stroke&&(u.stroke=i[c]),"inherit"===u.opacity&&(u.opacity=("fill"===r?i:n).opacity),s(u,i);var d=t.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),!o){var f=t.get("inactiveBorderWidth"),g=u[c];u.lineWidth="auto"===f?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}(l=v||l||"roundRect",i,a,s,h,f,c),x=new SI,b=i.getModel("textStyle");if(pq(e.getLegendIcon)&&(!v||"inherit"===v))x.add(e.getLegendIcon({itemWidth:d,itemHeight:p,icon:l,iconRotate:g,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}));else{var w,S,_,M="inherit"===v&&e.getData().getVisual("symbol")?"inherit"===g?e.getData().getVisual("symbolRotate"):g:0;x.add(((_=MQ(S=(w={itemWidth:d,itemHeight:p,icon:l,iconRotate:M,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}).icon||"roundRect",0,0,w.itemWidth,w.itemHeight,w.itemStyle.fill,w.symbolKeepAspect)).setStyle(w.itemStyle),_.rotation=(w.iconRotate||0)*Math.PI/180,_.setOrigin([w.itemWidth/2,w.itemHeight/2]),S.indexOf("empty")>-1&&(_.style.stroke=_.style.fill,_.style.fill="#fff",_.style.lineWidth=2),_))}var C=r.get("formatter"),A=t;pY(C)&&C?A=C.replace("{name}",null!=t?t:""):pq(C)&&(A=C(t));var k=f?b.getTextColor():i.get("inactiveColor");x.add(new y4({style:x1(b,{text:A,x:"left"===o?d+5:-5,y:p/2,fill:k,align:o,verticalAlign:"middle"},{inheritColor:k})}));var T=new y$({shape:x.getBoundingRect(),style:{fill:"transparent"}}),D=i.getModel("tooltip");return D.get("show")&&_9({el:T,componentModel:r,itemName:t,itemTooltipOption:D.option}),x.add(T),x.eachChild(function(e){e.silent=!0}),T.silent=!u,this.getContentGroup().add(x),xO(x),x.__legendDataIndex=n,x},t.prototype.layoutInner=function(e,t,n,i,r,o){var a=this.getContentGroup(),s=this.getSelectorGroup();b8(e.get("orient"),a,e.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),!r)return a.x=u[0],a.y=u[1],this.group.getBoundingRect();b8("horizontal",s,e.get("selectorItemGap",!0));var c=s.getBoundingRect(),h=[-c.x,-c.y],d=e.get("selectorButtonGap",!0),p=e.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===o?h[p]+=l[f]+d:u[p]+=c[f]+d,h[1-p]+=l[g]/2-c[g]/2,s.x=h[0],s.y=h[1],a.x=u[0],a.y=u[1];var v={x:0,y:0};return v[f]=l[f]+d+c[f],v[g]=Math.max(l[g],c[g]),v[m]=Math.min(0,c[m]+h[1-p]),v},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(ka);function Oq(e,t,n,i){OX(e,t,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),OZ(e,t,n,i)}function OY(e){for(var t,n=e.getZr().storage.getDisplayList(),i=0,r=n.length;i<r&&!(t=n[i].states.emphasis);)i++;return t&&t.hoverLayer}function OZ(e,t,n,i){OY(n)||n.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:i})}function OX(e,t,n,i){OY(n)||n.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:i})}function OK(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.filterSeries(function(e){for(var n=0;n<t.length;n++)if(!t[n].isSelected(e.name))return!1;return!0})}function OQ(e,t,n){var i,r={},o="toggleSelected"===e;return n.eachComponent("legend",function(n){o&&null!=i?n[i?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?n[e]():(n[e](t.name),i=n.isSelected(t.name)),pz(n.getData(),function(e){var t=e.get("name");if("\n"!==t&&""!==t){var i=n.isSelected(t);r.hasOwnProperty(t)?r[t]=r[t]&&i:r[t]=i}})}),"allSelect"===e||"inverseSelect"===e?{selected:r}:{name:t.name,selected:r}}function OJ(e){e.registerComponentModel(OG),e.registerComponentView(OU),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,OK),e.registerSubTypeDefaulter("legend",function(){return"plain"}),e.registerAction("legendToggleSelect","legendselectchanged",p$(OQ,"toggleSelected")),e.registerAction("legendAllSelect","legendselectall",p$(OQ,"allSelect")),e.registerAction("legendInverseSelect","legendinverseselect",p$(OQ,"inverseSelect")),e.registerAction("legendSelect","legendselected",p$(OQ,"select")),e.registerAction("legendUnSelect","legendunselected",p$(OQ,"unSelect"))}var O0=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,i){var r=wn(t);e.prototype.init.call(this,t,n,i),O1(this,t,r)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),O1(this,this.option,t)},t.type="legend.scroll",t.defaultOption=bp(OG.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),t}(OG);function O1(e,t,n){var i=e.getOrient(),r=[1,1];r[i.index]=0,wt(t,n,{type:"box",ignoreSize:!!r})}var O2=["width","height"],O5=["x","y"],O3=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!0,n._currentIndex=0,n}return gO(t,e),t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new SI),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new SI)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(t,n,i,r,o,a,s){var l=this;e.prototype.renderInner.call(this,t,n,i,r,o,a,s);var u=this._controllerGroup,c=n.get("pageIconSize",!0),h=pU(c)?c:[c,c];p("pagePrev",0);var d=n.getModel("pageTextStyle");function p(e,t){var i=_4(n.get("pageIcons",!0)[n.getOrient().name][t],{onclick:pG(l._pageGo,l,e+"DataIndex",n,r)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});i.name=e,u.add(i)}u.add(new y4({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1)},t.prototype.layoutInner=function(e,t,n,i,r,o){var a=this.getSelectorGroup(),s=e.getOrient().index,l=O2[s],u=O5[s],c=O2[1-s],h=O5[1-s];r&&b8("horizontal",a,e.get("selectorItemGap",!0));var d=e.get("selectorButtonGap",!0),p=a.getBoundingRect(),f=[-p.x,-p.y],g=pP(n);r&&(g[l]=n[l]-p[l]-d);var m=this._layoutContentAndController(e,i,g,s,l,c,h,u);if(r){if("end"===o)f[s]+=m[l]+d;else{var v=p[l]+d;f[s]-=v,m[u]-=v}m[l]+=p[l]+d,f[1-s]+=m[h]+m[c]/2-p[c]/2,m[c]=Math.max(m[c],p[c]),m[h]=Math.min(m[h],p[h]+f[1-s]),a.x=f[0],a.y=f[1],a.markRedraw()}return m},t.prototype._layoutContentAndController=function(e,t,n,i,r,o,a,s){var l=this.getContentGroup(),u=this._containerGroup,c=this._controllerGroup;b8(e.get("orient"),l,e.get("itemGap"),i?n.width:null,i?null:n.height),b8("horizontal",c,e.get("pageButtonItemGap",!0));var h=l.getBoundingRect(),d=c.getBoundingRect(),p=this._showController=h[r]>n[r],f=[-h.x,-h.y];t||(f[i]=l[s]);var g=[0,0],m=[-d.x,-d.y],v=p5(e.get("pageButtonGap",!0),e.get("itemGap",!0));p&&("end"===e.get("pageButtonPosition",!0)?m[i]+=n[r]-d[r]:g[i]+=d[r]+v),m[1-i]+=h[o]/2-d[o]/2,l.setPosition(f),u.setPosition(g),c.setPosition(m);var y={x:0,y:0};if(y[r]=p?n[r]:h[r],y[o]=Math.max(h[o],d[o]),y[a]=Math.min(0,d[a]+m[1-i]),u.__rectSize=n[r],p){var x={x:0,y:0};x[r]=Math.max(n[r]-d[r]-v,0),x[o]=y[o],u.setClipPath(new y$({shape:x})),u.__rectSize=x[r]}else c.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return null!=b.pageIndex&&xW(l,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),y},t.prototype._pageGo=function(e,t,n){var i=this._getPageInfo(t)[e];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;pz(["pagePrev","pageNext"],function(i){var r=null!=t[i+"DataIndex"],o=n.childOfName(i);o&&(o.setStyle("fill",r?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),o.cursor=r?"pointer":"default")});var i=n.childOfName("pageText"),r=e.get("pageFormatter"),o=t.pageIndex,a=null!=o?o+1:0,s=t.pageCount;i&&r&&i.setStyle("text",pY(r)?r.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):r({current:a,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=e.getOrient().index,o=O2[r],a=O5[r],s=this._findTargetItemIndex(t),l=n.children(),u=l[s],c=l.length,h=+!!c,d={contentPosition:[n.x,n.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var p=y(u);d.contentPosition[r]=-p.s;for(var f=s+1,g=p,m=p,v=null;f<=c;++f)(!(v=y(l[f]))&&m.e>g.s+i||v&&!x(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(var f=s-1,g=p,m=p,v=null;f>=-1;--f)(!(v=y(l[f]))||!x(m,v.s))&&g.i<m.i&&(m=g,null==d.pagePrevDataIndex&&(d.pagePrevDataIndex=g.i),++d.pageCount,++d.pageIndex),g=v;return d;function y(e){if(e){var t=e.getBoundingRect(),n=t[a]+e[a];return{s:n,e:n+t[o],i:e.__legendDataIndex}}}function x(e,t){return e.e>=t&&e.s<=t+i}},t.prototype._findTargetItemIndex=function(e){var t,n;return this._showController?(this.getContentGroup().eachChild(function(i,r){var o=i.__legendDataIndex;null==n&&null!=o&&(n=r),o===e&&(t=r)}),null!=t?t:n):0},t.type="legend.scroll",t}(OU);function O4(e){TV(OJ),e.registerComponentModel(O0),e.registerComponentView(O3),e.registerAction("legendScroll","legendscroll",function(e,t){var n=e.scrollDataIndex;null!=n&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(e){e.setScrollDataIndex(n)})})}var O6=fz();function O8(e,t,n,i){!function e(t,n){if(!(pK(t)&&pK(n)))return t===n;var i=!0;return pz(n,function(n,r){i=i&&e(t[r],n)}),!!i}(O6(n).lastProp,i)&&(O6(n).lastProp=i,t?xW(n,i,e):(n.stopAnimation(),n.attr(i)))}function O9(e,t){e[t.get(["label","show"])?"show":"hide"]()}function O7(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function Pe(e,t,n){var i=t.get("z"),r=t.get("zlevel");e&&e.traverse(function(e){"group"!==e.type&&(null!=i&&(e.z=i),null!=r&&(e.zlevel=r),e.silent=n)})}function Pt(e,t,n,i,r){e=t.scale.parse(e);var o=t.scale.getLabel({value:e},{precision:r.precision}),a=r.formatter;if(a){var s={value:DA(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};pz(i,function(e){var t=n.getSeriesByIndex(e.seriesIndex),i=e.dataIndexInside,r=t&&t.getDataParams(i);r&&s.seriesData.push(r)}),pY(a)?o=a.replace("{value}",o):pq(a)&&(o=a(s))}return o}function Pn(e,t,n){var i=gJ();return g5(i,i,n.rotation),g2(i,i,n.position),_0([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}var Pi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t.prototype.makeElOption=function(e,t,n,i,r){var o,a,s,l,u,c,h,d,p,f,g,m,v,y,x,b,w,S,_,M=n.axis,C=M.grid,A=i.get("type"),k=Pr(C,M).getOtherAxis(M).getGlobalExtent(),T=M.toGlobalCoord(M.dataToCoord(t,!0));if(A&&"none"!==A){var D,I,O,P=(I=i.get("type"),O=i.getModel(I+"Style"),"line"===I?(D=O.getLineStyle()).fill=null:"shadow"===I&&((D=O.getAreaStyle()).stroke=null),D),E=Po[A](M,T,k);E.style=P,e.graphicKey=E.type,e.pointer=E}var R=DG(C.model,n);h=DJ.innerTextLayout(R.rotation,0,R.labelDirection),R.labelMargin=i.get(["label","margin"]),d={position:Pn(n.axis,t,R),align:h.textAlign,verticalAlign:h.textVerticalAlign},p=Pt(i.get("value"),n.axis,n.ecModel,i.get("seriesDataIndices"),{precision:i.get(["label","precision"]),formatter:i.get(["label","formatter"])}),g=p6((f=i.getModel("label")).get("padding")||0),v=ml(p,m=f.getFont()),y=d.position,x=v.width+g[1]+g[3],b=v.height+g[0]+g[2],"right"===(w=d.align)&&(y[0]-=x),"center"===w&&(y[0]-=x/2),"bottom"===(S=d.verticalAlign)&&(y[1]-=b),"middle"===S&&(y[1]-=b/2),o=y,a=x,s=b,u=(l=r).getWidth(),c=l.getHeight(),o[0]=Math.min(o[0]+a,u)-a,o[1]=Math.min(o[1]+s,c)-s,o[0]=Math.max(o[0],0),o[1]=Math.max(o[1],0),(_=f.get("backgroundColor"))&&"auto"!==_||(_=n.get(["axisLine","lineStyle","color"])),e.label={x:y[0],y:y[1],style:x1(f,{text:p,font:m,fill:f.getTextColor(),padding:g,backgroundColor:_}),z2:10}},t.prototype.getHandleTransform=function(e,t,n){var i=DG(t.axis.grid.model,t,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=Pn(t.axis,e,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,i){var r=n.axis,o=r.grid,a=r.getGlobalExtent(!0),s=Pr(o,r).getOtherAxis(r).getGlobalExtent(),l=+("x"!==r.dim),u=[e.x,e.y];u[l]+=t[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var c=(s[1]+s[0])/2,h=[c,c];return h[l]=u[l],{x:u[0],y:u[1],rotation:e.rotation,cursorPoint:h,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},t}(function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,i){var r=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,i||this._lastValue!==r||this._lastStatus!==o){this._lastValue=r,this._lastStatus=o;var a=this._group,s=this._handle;if(!o||"hide"===o){a&&a.hide(),s&&s.hide();return}a&&a.show(),s&&s.show();var l={};this.makeElOption(l,r,e,t,n);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var c=this._moveAnimation=this.determineAnimation(e,t);if(a){var h=p$(O8,t,c);this.updatePointerEl(a,l,h),this.updateLabelEl(a,l,h,t)}else a=this._group=new SI,this.createPointerEl(a,l,e,t),this.createLabelEl(a,l,e,t),n.getZr().add(a);Pe(a,t,!0),this._renderHandle(r)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get("animation"),i=e.axis,r="category"===i.type,o=t.get("snap");if(!o&&!r)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(r&&i.getBandWidth()>a)return!0;if(o){var s=D6(e).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},e.prototype.makeElOption=function(e,t,n,i,r){},e.prototype.createPointerEl=function(e,t,n,i){var r=t.pointer;if(r){var o=O6(e).pointerEl=new ex[r.type](pP(t.pointer));e.add(o)}},e.prototype.createLabelEl=function(e,t,n,i){if(t.label){var r=O6(e).labelEl=new y4(pP(t.label));e.add(r),O9(r,i)}},e.prototype.updatePointerEl=function(e,t,n){var i=O6(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),n(i,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,i){var r=O6(e).labelEl;r&&(r.setStyle(t.label.style),n(r,{x:t.label.x,y:t.label.y}),O9(r,i))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a){r&&i.remove(r),this._handle=null;return}this._handle||(t=!0,r=this._handle=_4(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){C4(e.event)},onmousedown:pG(this._onHandleDragMove,this,0,0),drift:pG(this._onHandleDragMove,this),ondragend:pG(this._onHandleDragEnd,this)}),i.add(r)),Pe(r,n,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");pU(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,Mo(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},e.prototype._moveHandleToValue=function(e,t){O8(this._axisPointerModel,!t&&this._moveAnimation,this._handle,O7(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(O7(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(O7(i)),O6(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,i=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),Ma(this,"_doDispatchAxisPointer")},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}},e}());function Pr(e,t){var n={};return n[t.dim+"AxisIndex"]=t.index,e.getCartesian(n)}var Po={line:function(e,t,n){var i,r,o;return{type:"Line",subPixelOptimize:!0,shape:(i=[t,n[0]],r=[t,n[1]],{x1:i[o=(o=Pa(e))||0],y1:i[1-o],x2:r[o],y2:r[1-o]})}},shadow:function(e,t,n){var i,r,o,a=Math.max(1,e.getBandWidth()),s=n[1]-n[0];return{type:"Rect",shape:(i=[t-a/2,n[0]],r=[a,s],{x:i[o=(o=Pa(e))||0],y:i[1-o],width:r[o],height:r[1-o]})}}};function Pa(e){return+("x"!==e.dim)}var Ps=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t}(wr),Pl=fz();function Pu(e,t,n){if(!fA.node){var i=t.getZr();Pl(i).records||(Pl(i).records={}),function(e,t){Pl(e).initialized||(Pl(e).initialized=!0,n("click",p$(Ph,"click")),n("mousemove",p$(Ph,"mousemove")),n("globalout",Pc));function n(n,i){e.on(n,function(n){var r,o,a,s,l,u,c,h,d=(r=t,o={showTip:[],hideTip:[]},{dispatchAction:a=function(e){var t=o[e.type];t?t.push(e):(e.dispatchAction=a,r.dispatchAction(e))},pendings:o});pz(Pl(e).records,function(e){e&&i(e,n,d.dispatchAction)}),s=d.pendings,l=t,c=s.showTip.length,h=s.hideTip.length,c?u=s.showTip[c-1]:h&&(u=s.hideTip[h-1]),u&&(u.dispatchAction=null,l.dispatchAction(u))})}}(i,t),(Pl(i).records[e]||(Pl(i).records[e]={})).handler=n}}function Pc(e,t,n){e.handler("leave",null,n)}function Ph(e,t,n,i){t.handler(e,n,i)}function Pd(e,t){if(!fA.node){var n=t.getZr();(Pl(n).records||{})[e]&&(Pl(n).records[e]=null)}}var Pp=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.render=function(e,t,n){var i=t.getComponent("tooltip"),r=e.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";Pu("axisPointer",n,function(e,t,n){"none"!==r&&("leave"===e||r.indexOf(e)>=0)&&n({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})})},t.prototype.remove=function(e,t){Pd("axisPointer",t)},t.prototype.dispose=function(e,t){Pd("axisPointer",t)},t.type="axisPointer",t}(ka);function Pf(e,t){var n,i=[],r=e.seriesIndex;if(null==r||!(n=t.getSeriesByIndex(r)))return{point:[]};var o=n.getData(),a=fF(o,e);if(null==a||a<0||pU(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(e.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u).dim,h=u.dim,d=+("x"===c||"radius"===c),p=o.mapDimension(h),f=[];f[d]=o.get(p,a),f[1-d]=o.get(o.getCalculationInfo("stackResultDimension"),a),i=l.dataToPoint(f)||[]}else i=l.dataToPoint(o.getValues(pV(l.dimensions,function(e){return o.mapDimension(e)}),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}var Pg=fz();function Pm(e,t,n){var i=e.currTrigger,r=[e.x,e.y],o=e.dispatchAction||pG(n.dispatchAction,n),a=t.getComponent("axisPointer").coordSysAxesInfo;if(a){Pw(r)&&(r=Pf({seriesIndex:e.seriesIndex,dataIndex:e.dataIndex},t).point);var s,l,u,c,h,d,p,f,g,m,v,y=Pw(r),x=e.axesInfo,b=a.axesInfo,w="leave"===i||Pw(r),S={},_={},M={list:[],map:{}},C={showPointer:p$(Py,_),showTooltip:p$(Px,M)};pz(a.coordSysMap,function(e,t){var n=y||e.containPoint(r);pz(a.coordSysAxesInfo[t],function(e,t){var i=e.axis,o=function(e,t){for(var n=0;n<(e||[]).length;n++){var i=e[n];if(t.axis.dim===i.axisDim&&t.axis.model.componentIndex===i.axisIndex)return i}}(x,e);if(!w&&n&&(!x||o)){var a=o&&o.value;null!=a||y||(a=i.pointToData(r)),null!=a&&Pv(e,a,C,!1,S)}})});var A={};return pz(b,function(e,t){var n=e.linkGroup;n&&!_[t]&&pz(n.axesInfo,function(t,i){var r=_[i];if(t!==e&&r){var o=r.value;n.mapper&&(o=e.axis.scale.parse(n.mapper(o,Pb(t),Pb(e)))),A[e.key]=o}})}),pz(A,function(e,t){Pv(b[t],e,C,!0,S)}),s=_,l=b,u=S.axesInfo=[],pz(l,function(e,t){var n=e.axisPointerModel.option,i=s[t];i?(e.useHandle||(n.status="show"),n.value=i.value,n.seriesDataIndices=(i.payloadBatch||[]).slice()):e.useHandle||(n.status="hide"),"show"===n.status&&u.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:n.value})}),function(e,t,n,i){if(Pw(t)||!e.list.length)return i({type:"hideTip"});var r=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:e.list})}(M,r,e,o),c=b,d=(h=n).getZr(),p="axisPointerLastHighlights",f=Pg(d)[p]||{},g=Pg(d)[p]={},pz(c,function(e,t){var n=e.axisPointerModel.option;"show"===n.status&&e.triggerEmphasis&&pz(n.seriesDataIndices,function(e){g[e.seriesIndex+" | "+e.dataIndex]=e})}),m=[],v=[],pz(f,function(e,t){g[t]||v.push(e)}),pz(g,function(e,t){f[t]||m.push(e)}),v.length&&h.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:v}),m.length&&h.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:m}),S}}function Pv(e,t,n,i,r){var o=e.axis;if(!o.scale.isBlank()&&o.containData(t)){if(!e.involveSeries)return void n.showPointer(e,t);var a,s,l,u,c,h,d,p,f=(a=t,u=(l=(s=e).axis).dim,c=a,h=[],d=Number.MAX_VALUE,p=-1,pz(s.seriesModels,function(e,t){var n,i,r=e.getData().mapDimensionsAll(u);if(e.getAxisTooltipData){var o=e.getAxisTooltipData(r,a,l);i=o.dataIndices,n=o.nestestValue}else{if(!(i=e.getData().indicesOfNearest(r[0],a,"category"===l.type?.5:null)).length)return;n=e.getData().get(r[0],i[0])}if(null!=n&&isFinite(n)){var s=a-n,f=Math.abs(s);f<=d&&((f<d||s>=0&&p<0)&&(d=f,p=s,c=n,h.length=0),pz(i,function(t){h.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:h,snapToValue:c}),g=f.payloadBatch,m=f.snapToValue;g[0]&&null==r.seriesIndex&&pR(r,g[0]),!i&&e.snap&&o.containData(m)&&null!=m&&(t=m),n.showPointer(e,t,g),n.showTooltip(e,f,m)}}function Py(e,t,n,i){e[t.key]={value:n,payloadBatch:i}}function Px(e,t,n,i){var r=n.payloadBatch,o=t.axis,a=o.model,s=t.axisPointerModel;if(t.triggerTooltip&&r.length){var l=t.coordSys.model,u=D9(l),c=e.map[u];c||(c=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(c)),c.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function Pb(e){var t=e.axis.model,n={},i=n.axisDim=e.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=t.componentIndex,n.axisName=n[i+"AxisName"]=t.name,n.axisId=n[i+"AxisId"]=t.id,n}function Pw(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}function PS(e){Ie.registerAxisPointerClass("CartesianAxisPointer",Pi),e.registerComponentModel(Ps),e.registerComponentView(Pp),e.registerPreprocessor(function(e){if(e){e.axisPointer&&0!==e.axisPointer.length||(e.axisPointer={});var t=e.axisPointer.link;t&&!pU(t)&&(e.axisPointer.link=[t])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(e,t){var n,i,r,o,a,s,l,u,c;e.getComponent("axisPointer").coordSysAxesInfo=(i=n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}},r=e,o=t,a=r.getComponent("tooltip"),l=(s=r.getComponent("axisPointer")).get("link",!0)||[],u=[],pz(o.getCoordinateSystems(),function(e){if(e.axisPointerEnabled){var t=D9(e.model),n=i.coordSysAxesInfo[t]={};i.coordSysMap[t]=e;var o=e.model.getModel("tooltip",a);if(pz(e.getAxes(),p$(p,!1,null)),e.getTooltipAxes&&a&&o.get("show")){var c="axis"===o.get("trigger"),h="cross"===o.get(["axisPointer","type"]),d=e.getTooltipAxes(o.get(["axisPointer","axis"]));(c||h)&&pz(d.baseAxes,p$(p,!h||"cross",c)),h&&pz(d.otherAxes,p$(p,"cross",!1))}}function p(t,a,c){var h=c.model.getModel("axisPointer",s),d=h.get("show");if(d&&("auto"!==d||t||D8(h))){null==a&&(a=h.get("triggerTooltip"));var p=(h=t?function(e,t,n,i,r,o){var a=t.getModel("axisPointer"),s={};pz(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(e){s[e]=pP(a.get(e))}),s.snap="category"!==e.type&&!!o,"cross"===a.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===r){var u=a.get(["label","show"]);if(l.show=null==u||u,!o){var c=s.lineStyle=a.get("crossStyle");c&&pL(l,c.textStyle)}}return e.model.getModel("axisPointer",new bc(s,n,i))}(c,o,s,r,t,a):h).get("snap"),f=h.get("triggerEmphasis"),g=D9(c.model),m=a||p||"category"===c.type,v=i.axesInfo[g]={key:g,axis:c,coordSys:e,axisPointerModel:h,triggerTooltip:a,triggerEmphasis:f,involveSeries:m,snap:p,useHandle:D8(h),seriesModels:[],linkGroup:null};n[g]=v,i.seriesInvolved=i.seriesInvolved||m;var y=function(e,t){for(var n=t.model,i=t.dim,r=0;r<e.length;r++){var o=e[r]||{};if(D4(o[i+"AxisId"],n.id)||D4(o[i+"AxisIndex"],n.componentIndex)||D4(o[i+"AxisName"],n.name))return r}}(l,c);if(null!=y){var x=u[y]||(u[y]={axesInfo:{}});x.axesInfo[g]=v,x.mapper=l[y].mapper,v.linkGroup=x}}}}),n.seriesInvolved&&(c=n,e.eachSeries(function(e){var t=e.coordinateSystem,n=e.get(["tooltip","trigger"],!0),i=e.get(["tooltip","show"],!0);t&&"none"!==n&&!1!==n&&"item"!==n&&!1!==i&&!1!==e.get(["axisPointer","show"],!0)&&pz(c.coordSysAxesInfo[D9(t.model)],function(n){var i=n.axis;t.getAxis(i.dim)===i&&(n.seriesModels.push(e),null==n.seriesDataCount&&(n.seriesDataCount=0),n.seriesDataCount+=e.getData().count())})})),n)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},Pm)}var P_=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return gO(t,e),t.type="title",t.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},t}(wr),PM=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get("show")){var i=this.group,r=e.getModel("textStyle"),o=e.getModel("subtextStyle"),a=e.get("textAlign"),s=p5(e.get("textBaseline"),e.get("textVerticalAlign")),l=new y4({style:x1(r,{text:e.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=e.get("subtext"),h=new y4({style:x1(o,{text:c,fill:o.getTextColor(),y:u.height+e.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=e.get("link"),p=e.get("sublink"),f=e.get("triggerEvent",!0);l.silent=!d&&!f,h.silent=!p&&!f,d&&l.on("click",function(){b3(d,"_"+e.get("target"))}),p&&h.on("click",function(){b3(p,"_"+e.get("subtarget"))}),y6(l).eventData=y6(h).eventData=f?{componentType:"title",componentIndex:e.componentIndex}:null,i.add(l),c&&i.add(h);var g=i.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=b9(m,{width:n.getWidth(),height:n.getHeight()},e.get("padding"));a||("middle"===(a=e.get("left")||e.get("right"))&&(a="center"),"right"===a?v.x+=v.width:"center"===a&&(v.x+=v.width/2)),s||("center"===(s=e.get("top")||e.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),i.x=v.x,i.y=v.y,i.markRedraw();var y={align:a,verticalAlign:s};l.setStyle(y),h.setStyle(y),g=i.getBoundingRect();var x=v.margin,b=e.getItemStyle(["color","opacity"]);b.fill=e.get("backgroundColor");var w=new y$({shape:{x:g.x-x[3],y:g.y-x[0],width:g.width+x[1]+x[3],height:g.height+x[0]+x[2],r:e.get("borderRadius")},style:b,subPixelOptimize:!0,silent:!0});i.add(w)}},t.type="title",t}(ka),PC=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.type="dataZoom.select",t}(Oc),PA=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.type="dataZoom.select",t}(Op);function Pk(e){e.registerComponentModel(PC),e.registerComponentView(PA),OR(e)}var PT=function(){},PD={},PI=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;pz(this.option.feature,function(e,n){var i=PD[n];i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(t)),pE(e,i.defaultOption))})},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},t}(wr),PO=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t.prototype.render=function(e,t,n,i){var r=this.group;if(r.removeAll(),e.get("show")){var o,a,s,l,u=+e.get("itemSize"),c="vertical"===e.get("orient"),h=e.get("feature")||{},d=this._features||(this._features={}),p=[];pz(h,function(e,t){p.push(t)}),new Sh(this._featureNames||[],p).add(f).update(f).remove(p$(f,null)).execute(),this._featureNames=p,o=e.getBoxLayoutParams(),a=e.get("padding"),l=b9(o,s={width:n.getWidth(),height:n.getHeight()},a),b8(e.get("orient"),r,e.get("itemGap"),l.width,l.height),b7(r,o,s,a),r.add(O$(r.getBoundingRect(),e)),c||r.eachChild(function(e){var t=e.__title,i=e.ensureState("emphasis"),o=i.textConfig||(i.textConfig={}),a=e.getTextContent(),s=a&&a.ensureState("emphasis");if(s&&!pq(s)&&t){var l=s.style||(s.style={}),c=ml(t,y4.makeFont(l)),h=e.x+r.x,d=e.y+r.y+u,p=!1;d+c.height>n.getHeight()&&(o.position="top",p=!0);var f=p?-5-c.height:u+10;h+c.width/2>n.getWidth()?(o.position=["100%",f],l.align="right"):h-c.width/2<0&&(o.position=[0,f],l.align="left")}})}function f(o,a){var s,l,f,g,m,v,y,x,b,w,S,_=p[o],M=p[a],C=h[_],A=new bc(C,e,e.ecModel);if(i&&null!=i.newTitle&&i.featureName===_&&(C.title=i.newTitle),_&&!M){if(0===_.indexOf("my"))S={onclick:A.option.onclick,featureName:_};else{var k=PD[_];if(!k)return;S=new k}d[_]=S}else if(!(S=d[M]))return;S.uid=bd("toolbox-feature"),S.model=A,S.ecModel=t,S.api=n;var T=S instanceof PT;if(!_&&M){T&&S.dispose&&S.dispose(t,n);return}if(!A.get("show")||T&&S.unusable){T&&S.remove&&S.remove(t,n);return}s=A,l=S,f=_,v=s.getModel("iconStyle"),y=s.getModel(["emphasis","iconStyle"]),x=l instanceof PT&&l.getIcons?l.getIcons():s.get("icon"),b=s.get("title")||{},pY(x)?(g={})[f]=x:g=x,pY(b)?(m={})[f]=b:m=b,w=s.iconPaths={},pz(g,function(i,o){var a=_4(i,{},{x:-u/2,y:-u/2,width:u,height:u});a.setStyle(v.getItemStyle()),a.ensureState("emphasis").style=y.getItemStyle();var h=new y4({style:{text:m[o],align:y.get("textAlign"),borderRadius:y.get("textBorderRadius"),padding:y.get("textPadding"),fill:null,font:x8({fontStyle:y.get("textFontStyle"),fontFamily:y.get("textFontFamily"),fontSize:y.get("textFontSize"),fontWeight:y.get("textFontWeight")},t)},ignore:!0});a.setTextContent(h),_9({el:a,componentModel:e,itemName:o,formatterParamsExtra:{title:m[o]}}),a.__title=m[o],a.on("mouseover",function(){var t=y.getItemStyle(),i=c?null==e.get("right")&&"right"!==e.get("left")?"right":"left":null==e.get("bottom")&&"bottom"!==e.get("top")?"bottom":"top";h.setStyle({fill:y.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:y.get("textBackgroundColor")}),a.setTextConfig({position:y.get("textPosition")||i}),h.ignore=!e.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){"emphasis"!==s.get(["iconStatus",o])&&n.leaveEmphasis(this),h.hide()}),("emphasis"===s.get(["iconStatus",o])?x_:xM)(a),r.add(a),a.on("click",pG(l.onclick,l,t,n,o)),w[o]=a}),A.setIconStatus=function(e,t){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,i[e]&&("emphasis"===t?x_:xM)(i[e])},S instanceof PT&&S.render&&S.render(A,t,n,i)}},t.prototype.updateView=function(e,t,n,i){pz(this._features,function(e){e instanceof PT&&e.updateView&&e.updateView(e.model,t,n,i)})},t.prototype.remove=function(e,t){pz(this._features,function(n){n instanceof PT&&n.remove&&n.remove(e,t)}),this.group.removeAll()},t.prototype.dispose=function(e,t){pz(this._features,function(n){n instanceof PT&&n.dispose&&n.dispose(e,t)})},t.type="toolbox",t}(ka),PP=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t.prototype.onclick=function(e,t){var n=this.model,i=n.get("name")||e.get("title.0.text")||"echarts",r="svg"===t.getZr().painter.getType(),o=r?"svg":n.get("type",!0)||"png",a=t.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=fA.browser;if(pq(MouseEvent)&&(s.newEdge||!s.ie&&!s.edge)){var l=document.createElement("a");l.download=i+"."+o,l.target="_blank",l.href=a;var u=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(u)}else if(window.navigator.msSaveOrOpenBlob||r){var c=a.split(","),h=c[0].indexOf("base64")>-1,d=r?decodeURIComponent(c[1]):c[1];h&&(d=window.atob(d));var p=i+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var f=d.length,g=new Uint8Array(f);f--;)g[f]=d.charCodeAt(f);var m=new Blob([g]);window.navigator.msSaveOrOpenBlob(m,p)}else{var v=document.createElement("iframe");document.body.appendChild(v);var y=v.contentWindow,x=y.document;x.open("image/svg+xml","replace"),x.write(d),x.close(),y.focus(),x.execCommand("SaveAs",!0,p),document.body.removeChild(v)}}else{var b=n.get("lang"),w='<body style="margin:0;"><img src="'+a+'" style="max-width:100%;" title="'+(b&&b[0]||"")+'" /></body>',S=window.open();S.document.write(w),S.document.title=i}},t.getDefaultOption=function(e){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:e.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:e.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},t}(PT),PE="__ec_magicType_stack__",PR=[["line","bar"],["stack"]],PL=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return pz(e.get("type"),function(e){t[e]&&(n[e]=t[e])}),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:e.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var i,r=this.model,o=r.get(["seriesIndex",n]);if(PN[n]){var a={series:[]};pz(PR,function(e){pN(e,n)>=0&&pz(e,function(e){r.setIconStatus(e,"normal")})}),r.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(e){var t=e.subType,i=e.id,o=PN[n](t,i,e,r);o&&(pL(o,e.option),a.series.push(o));var s=e.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",c=e.getReferringComponents(u,fW).models[0].componentIndex;a[u]=a[u]||[];for(var h=0;h<=c;h++)a[u][c]=a[u][c]||{};a[u][c].boundaryGap="bar"===n}}});var s=n;"stack"===n&&(i=pE({stack:r.option.title.tiled,tiled:r.option.title.stack},r.option.title),"emphasis"!==r.get(["iconStatus",n])&&(s="tiled")),t.dispatchAction({type:"changeMagicType",currentType:s,newOption:a,newTitle:i,featureName:"magicType"})}},t}(PT),PN={line:function(e,t,n,i){if("bar"===e)return pE({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(e,t,n,i){if("line"===e)return pE({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(e,t,n,i){var r=n.get("stack")===PE;if("line"===e||"bar"===e)return i.setIconStatus("stack",r?"normal":"emphasis"),pE({id:t,stack:r?"":PE},i.get(["option","stack"])||{},!0)}};TR({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var PB=Array(60).join("-");function PF(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var Pz=RegExp("[ ]+","g"),PV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t.prototype.onclick=function(e,t){setTimeout(function(){t.dispatchAction({type:"hideTip"})});var n,i,r,o,a,s,l=t.getDom(),u=this.model;this._dom&&l.removeChild(this._dom);var c=document.createElement("div");c.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",c.style.backgroundColor=u.get("backgroundColor")||"#fff";var h=document.createElement("h4"),d=u.get("lang")||[];h.innerHTML=d[0]||u.get("title"),h.style.cssText="margin:10px 20px",h.style.color=u.get("textColor");var p=document.createElement("div"),f=document.createElement("textarea");p.style.cssText="overflow:auto";var g=u.get("optionToContent"),m=u.get("contentToOption"),v={value:pH([(o=(s=(n={},i=[],r=[],e.eachRawSeries(function(e){var t=e.coordinateSystem;if(t&&("cartesian2d"===t.type||"polar"===t.type)){var o=t.getBaseAxis();if("category"===o.type){var a=o.dim+"_"+o.index;n[a]||(n[a]={categoryAxis:o,valueAxis:t.getOtherAxis(o),series:[]},r.push({axisDim:o.dim,axisIndex:o.index})),n[a].series.push(e)}else i.push(e)}else i.push(e)}),{seriesGroupByCategoryAxis:n,other:i,meta:r})).seriesGroupByCategoryAxis,a=[],pz(o,function(e,t){var n=e.categoryAxis,i=e.valueAxis.dim,r=[" "].concat(pV(e.series,function(e){return e.name})),o=[n.model.getCategories()];pz(e.series,function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(i),function(e){return e}))});for(var s=[r.join(" ")],l=0;l<o[0].length;l++){for(var u=[],c=0;c<o.length;c++)u.push(o[c][l]);s.push(u.join(" "))}a.push(s.join("\n"))}),a.join("\n\n"+PB+"\n\n")),pV(s.other,function(e){var t=e.getRawData(),n=[e.name],i=[];return t.each(t.dimensions,function(){for(var e=arguments.length,r=arguments[e-1],o=t.getName(r),a=0;a<e-1;a++)i[a]=arguments[a];n.push((o?o+" ":"")+i.join(" "))}),n.join("\n")}).join("\n\n"+PB+"\n\n")],function(e){return!!e.replace(/[\n\t\s]/g,"")}).join("\n\n"+PB+"\n\n"),meta:s.meta};if(pq(g)){var y=g(t.getOption());pY(y)?p.innerHTML=y:p0(y)&&p.appendChild(y)}else{f.readOnly=u.get("readOnly");var x=f.style;x.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",x.color=u.get("textColor"),x.borderColor=u.get("textareaBorderColor"),x.backgroundColor=u.get("textareaColor"),f.value=v.value,p.appendChild(f)}var b=v.meta,w=document.createElement("div");w.style.cssText="position:absolute;bottom:5px;left:0;right:0";var S="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",_=document.createElement("div"),M=document.createElement("div");S+=";background-color:"+u.get("buttonColor")+";color:"+u.get("buttonTextColor");var C=this;function A(){l.removeChild(c),C._dom=null}C3(_,"click",A),C3(M,"click",function(){var e,n,i,r;if(null==m&&null!=g||null!=m&&null==g)return void A();try{pq(m)?e=m(p,t.getOption()):(n=f.value,i=n.split(RegExp("\n*"+PB+"\n*","g")),r={series:[]},pz(i,function(e,t){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf(" ")>=0)return!0}(e)){var n=function(e){for(var t=e.split(/\n+/g),n=PF(t.shift()).split(Pz),i=[],r=pV(n,function(e){return{name:e,data:[]}}),o=0;o<t.length;o++){var a=PF(t[o]).split(Pz);i.push(a.shift());for(var s=0;s<a.length;s++)r[s]&&(r[s].data[o]=a[s])}return{series:r,categories:i}}(e),i=b[t],o=i.axisDim+"Axis";i&&(r[o]=r[o]||[],r[o][i.axisIndex]={data:n.categories},r.series=r.series.concat(n.series))}else{var n=function(e){for(var t=e.split(/\n+/g),n=PF(t.shift()),i=[],r=0;r<t.length;r++){var o=PF(t[r]);if(o){var a=o.split(Pz),s="",l=void 0,u=!1;isNaN(a[0])?(u=!0,s=a[0],a=a.slice(1),i[r]={name:s,value:[]},l=i[r].value):l=i[r]=[];for(var c=0;c<a.length;c++)l.push(+a[c]);1===l.length&&(u?i[r].value=l[0]:i[r]=l[0])}}return{name:n,data:i}}(e);r.series.push(n)}}),e=r)}catch(e){throw A(),Error("Data view format error "+e)}e&&t.dispatchAction({type:"changeDataView",newOption:e}),A()}),_.innerHTML=d[1],M.innerHTML=d[2],M.style.cssText=_.style.cssText=S,u.get("readOnly")||w.appendChild(M),w.appendChild(_),c.appendChild(h),c.appendChild(p),c.appendChild(w),p.style.height=l.clientHeight-80+"px",l.appendChild(c),this._dom=c},t.prototype.remove=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.getDefaultOption=function(e){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:e.getLocaleModel().get(["toolbox","dataView","title"]),lang:e.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"}},t}(PT);TR({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(e,t){var n=[];pz(e.newOption.series,function(e){var i=t.getSeriesByName(e.name)[0];if(i){var r,o=i.get("data");n.push({name:e.name,data:(r=e.data,pV(r,function(e,t){var n=o&&o[t];if(!pK(n)||pU(n))return e;pK(e)&&!pU(e)||(e={value:e});var i=null!=n.name&&null==e.name;return e=pL(e,n),i&&delete e.name,e}))})}else n.push(pR({type:"scatter"},e))}),t.mergeOption(pL({series:n},e.newOption))});var Pj=fz();function PH(e){var t=Pj(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var PW=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t.prototype.onclick=function(e,t){Pj(e).snapshots=null,t.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(e){return{show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:e.getLocaleModel().get(["toolbox","restore","title"])}},t}(PT);TR({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var PG=Math.min,P$=Math.max,PU=Math.pow,Pq="globalPan",PY={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},PZ={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},PX={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},PK=0,PQ=function(e){function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},n._zr=t,n.group=new SI,n._uid="brushController_"+PK++,pz(Eg,function(e,t){this._handlers[t]=pG(e,this)},n),n}return gO(t,e),t.prototype.enableBrush=function(e){return this._brushType&&this._doDisableBrush(),e.brushType&&this._doEnableBrush(e),this},t.prototype._doEnableBrush=function(e){var t,n=this._zr;this._enableGlobalPan||(t=this._uid,Oy(n)[Pq]=t),pz(this._handlers,function(e,t){n.on(t,e)}),this._brushType=e.brushType,this._brushOption=pE(pP(PX),e,!0)},t.prototype._doDisableBrush=function(){var e,t,n=this._zr;e=this._uid,(t=Oy(n))[Pq]===e&&(t[Pq]=null),pz(this._handlers,function(e,t){n.off(t,e)}),this._brushType=this._brushOption=null},t.prototype.setPanels=function(e){if(e&&e.length){var t=this._panels={};pz(e,function(e){t[e.panelId]=pP(e)})}else this._panels=null;return this},t.prototype.mount=function(e){e=e||{},this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({x:e.x||0,y:e.y||0,rotation:e.rotation||0,scaleX:e.scaleX||1,scaleY:e.scaleY||1}),this._transform=t.getLocalTransform(),this},t.prototype.updateCovers=function(e){e=pV(e,function(e){return pE(pP(PX),e,!0)});var t=this._covers,n=this._covers=[],i=this,r=this._creatingCover;return new Sh(t,e,function(e,t){return o(e.__brushOption,t)},o).add(a).update(a).remove(function(e){t[e]!==r&&i.group.remove(t[e])}).execute(),this;function o(e,t){return(null!=e.id?e.id:"\0-brush-index-"+t)+"-"+e.brushType}function a(o,a){var s=e[o];if(null!=a&&t[a]===r)n[o]=t[a];else{var l=n[o]=null!=a?(t[a].__brushOption=s,t[a]):P0(i,PJ(i,s));P5(i,l)}}},t.prototype.unmount=function(){return this.enableBrush(!1),P8(this),this._zr.remove(this.group),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(vO);function PJ(e,t){var n=Ev[t.brushType].createCover(e,t);return n.__brushOption=t,P2(n,t),e.group.add(n),n}function P0(e,t){var n=P3(t);return n.endCreating&&(n.endCreating(e,t),P2(t,t.__brushOption)),t}function P1(e,t){var n=t.__brushOption;P3(t).updateCoverShape(e,t,n.range,n)}function P2(e,t){var n=t.z;null==n&&(n=1e4),e.traverse(function(e){e.z=n,e.z2=n})}function P5(e,t){P3(t).updateCommon(e,t),P1(e,t)}function P3(e){return Ev[e.__brushOption.brushType]}function P4(e,t,n){var i,r=e._panels;if(!r)return!0;var o=e._transform;return pz(r,function(e){e.isTargetByCursor(t,n,o)&&(i=e)}),i}function P6(e,t){var n=e._panels;if(!n)return!0;var i=t.__brushOption.panelId;return null==i||n[i]}function P8(e){var t=e._covers,n=t.length;return pz(t,function(t){e.group.remove(t)},e),t.length=0,!!n}function P9(e,t){var n=pV(e._covers,function(e){var t=e.__brushOption,n=pP(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}});e.trigger("brush",{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function P7(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function Ee(e,t,n,i){var r=new SI;return r.add(new y$({name:"main",style:Er(n),silent:!0,draggable:!0,cursor:"move",drift:p$(Es,e,t,r,["n","s","w","e"]),ondragend:p$(P9,t,{isEnd:!0})})),pz(i,function(n){r.add(new y$({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:p$(Es,e,t,r,n),ondragend:p$(P9,t,{isEnd:!0})}))}),r}function Et(e,t,n,i){var r=i.brushStyle.lineWidth||0,o=P$(r,6),a=n[0][0],s=n[1][0],l=a-r/2,u=s-r/2,c=n[0][1],h=n[1][1],d=c-o+r/2,p=h-o+r/2,f=c-a,g=h-s,m=f+r,v=g+r;Ei(e,t,"main",a,s,f,g),i.transformable&&(Ei(e,t,"w",l,u,o,v),Ei(e,t,"e",d,u,o,v),Ei(e,t,"n",l,u,m,o),Ei(e,t,"s",l,p,m,o),Ei(e,t,"nw",l,u,o,o),Ei(e,t,"ne",d,u,o,o),Ei(e,t,"sw",l,p,o,o),Ei(e,t,"se",d,p,o,o))}function En(e,t){var n=t.__brushOption,i=n.transformable,r=t.childAt(0);r.useStyle(Er(n)),r.attr({silent:!i,cursor:i?"move":"default"}),pz([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(n){var r,o,a,s=t.childOfName(n.join("")),l=1===n.length?Ea(e,n[0]):(("e"===(a=[Ea(r=e,(o=n)[0]),Ea(r,o[1])])[0]||"w"===a[0])&&a.reverse(),a.join(""));s&&s.attr({silent:!i,invisible:!i,cursor:i?PZ[l]+"-resize":null})})}function Ei(e,t,n,i,r,o,a){var s,l,u,c=t.childOfName(n);c&&c.setShape((l=PG((s=Ec(e,t,[[i,r],[i+o,r+a]]))[0][0],s[1][0]),{x:l,y:u=PG(s[0][1],s[1][1]),width:P$(s[0][0],s[1][0])-l,height:P$(s[0][1],s[1][1])-u}))}function Er(e){return pL({strokeNoScale:!0},e.brushStyle)}function Eo(e,t,n,i){var r=[PG(e,n),PG(t,i)],o=[P$(e,n),P$(t,i)];return[[r[0],o[0]],[r[1],o[1]]]}function Ea(e,t){return({left:"w",right:"e",top:"n",bottom:"s"})[_1({w:"left",e:"right",n:"top",s:"bottom"}[t],_J(e.group))]}function Es(e,t,n,i,r,o){var a=n.__brushOption,s=e.toRectRange(a.range),l=Eu(t,r,o);pz(i,function(e){var t=PY[e];s[t[0]][t[1]]+=l[t[0]]}),a.range=e.fromRectRange(Eo(s[0][0],s[1][0],s[0][1],s[1][1])),P5(t,n),P9(t,{isEnd:!1})}function El(e,t,n,i){var r=t.__brushOption.range,o=Eu(e,n,i);pz(r,function(e){e[0]+=o[0],e[1]+=o[1]}),P5(e,t),P9(e,{isEnd:!1})}function Eu(e,t,n){var i=e.group,r=i.transformCoordToLocal(t,n),o=i.transformCoordToLocal(0,0);return[r[0]-o[0],r[1]-o[1]]}function Ec(e,t,n){var i=P6(e,t);return i&&!0!==i?i.clipPath(n,e._transform):pP(n)}function Eh(e){var t=e.event;t.preventDefault&&t.preventDefault()}function Ed(e,t,n){return e.childOfName("main").contain(t,n)}function Ep(e,t,n,i){var r,o=e._creatingCover,a=e._creatingPanel,s=e._brushOption;if(e._track.push(n.slice()),function(e){var t=e._track;if(!t.length)return!1;var n=t[t.length-1],i=t[0],r=n[0]-i[0],o=n[1]-i[1];return PU(r*r+o*o,.5)>6}(e)||o){if(a&&!o){"single"===s.brushMode&&P8(e);var l=pP(s);l.brushType=Ef(l.brushType,a),l.panelId=!0===a?null:a.panelId,o=e._creatingCover=PJ(e,l),e._covers.push(o)}if(o){var u=Ev[Ef(e._brushType,a)];o.__brushOption.range=u.getCreatingRange(Ec(e,o,e._track)),i&&(P0(e,o),u.updateCommon(e,o)),P1(e,o),r={isEnd:i}}}else i&&"single"===s.brushMode&&s.removeOnClick&&P4(e,t,n)&&P8(e)&&(r={isEnd:i,removeOnClick:!0});return r}function Ef(e,t){return"auto"===e?t.defaultBrushType:e}var Eg={mousedown:function(e){if(this._dragging)Em(this,e);else if(!e.target||!e.target.draggable){Eh(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=P4(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,n=e.offsetY,i=this.group.transformCoordToLocal(t,n);if(!function(e,t,n){if(!(!e._brushType||(i=e,r=t.offsetX,o=t.offsetY,a=i._zr,r<0||r>a.getWidth()||o<0||o>a.getHeight()))){var i,r,o,a,s=e._zr,l=e._covers,u=P4(e,t,n);if(!e._dragging)for(var c=0;c<l.length;c++){var h=l[c].__brushOption;if(u&&(!0===u||h.panelId===u.panelId)&&Ev[h.brushType].contain(l[c],n[0],n[1]))return}u&&s.setCursorStyle("crosshair")}}(this,e,i),this._dragging){Eh(e);var r=Ep(this,e,i,!1);r&&P9(this,r)}},mouseup:function(e){Em(this,e)}};function Em(e,t){if(e._dragging){Eh(t);var n=t.offsetX,i=t.offsetY,r=e.group.transformCoordToLocal(n,i),o=Ep(e,t,r,!0);e._dragging=!1,e._track=[],e._creatingCover=null,o&&P9(e,o)}}var Ev={lineX:Ey(0),lineY:Ey(1),rect:{createCover:function(e,t){function n(e){return e}return Ee({toRectRange:n,fromRectRange:n},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=P7(e);return Eo(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,i){Et(e,t,n,i)},updateCommon:En,contain:Ed},polygon:{createCover:function(e,t){var n=new SI;return n.add(new _p({name:"main",style:Er(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new _c({name:"main",draggable:!0,drift:p$(El,e,t),ondragend:p$(P9,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,i){t.childAt(0).setShape({points:Ec(e,t,n)})},updateCommon:En,contain:Ed}};function Ey(e){return{createCover:function(t,n){return Ee({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[["w"],["e"]],[["n"],["s"]]][e])},getCreatingRange:function(t){var n=P7(t);return[PG(n[0][e],n[1][e]),P$(n[0][e],n[1][e])]},updateCoverShape:function(t,n,i,r){var o,a=P6(t,n);if(!0!==a&&a.getLinearBrushOtherExtent)o=a.getLinearBrushOtherExtent(e);else{var s=t._zr;o=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[i,o];e&&l.reverse(),Et(t,n,l,r)},updateCommon:En,contain:Ed}}var Ex={axisPointer:1,tooltip:1,brush:1};function Eb(e){return mr.create(e)}var Ew=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],ES=function(){function e(e,t,n){var i=this;this._targetInfoList=[];var r=EM(t,e);pz(EC,function(e,t){(!n||!n.include||pN(n.include,t)>=0)&&e(r,i._targetInfoList)})}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(e,t,n){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var i=ET[e.brushType](0,n,t);e.__rangeOffset={offset:EI[e.brushType](i.values,e.range,[1,1]),xyMinMax:i.xyMinMax}}}),e},e.prototype.matchOutputRanges=function(e,t,n){pz(e,function(e){var i=this.findTargetInfo(e,t);i&&!0!==i&&pz(i.coordSyses,function(i){var r=ET[e.brushType](1,i,e.range,!0);n(e,r.values,i,t)})},this)},e.prototype.setInputRanges=function(e,t){pz(e,function(e){var n=this.findTargetInfo(e,t);if(e.range=e.range||[],n&&!0!==n){e.panelId=n.panelId;var i,r,o,a,s,l=ET[e.brushType](0,n.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?EI[e.brushType](l.values,u.offset,(i=l.xyMinMax,r=u.xyMinMax,o=EP(i),a=EP(r),isNaN((s=[o[0]/a[0],o[1]/a[1]])[0])&&(s[0]=1),isNaN(s[1])&&(s[1]=1),s)):l.values}},this)},e.prototype.makePanelOpts=function(e,t){return pV(this._targetInfoList,function(n){var i,r,o,a,s=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:(i=Eb(i=s),function(e){return _5(e,i)}),isTargetByCursor:(r=n.coordSysModel,o=Eb(s),function(t,n){var i,a;return o.contain(n[0],n[1])&&(a=(i=e.getComponentByElement(t.topTarget))&&i.coordinateSystem,!i||i===r||!!Ex.hasOwnProperty(i.mainType)||!a||a.model===r)}),getLinearBrushOtherExtent:(a=Eb(a=s),function(e){var t=e?a.width:a.height,n=e?a.x:a.y;return[n,n+(t||0)]})}})},e.prototype.controlSeries=function(e,t,n){var i=this.findTargetInfo(e,n);return!0===i||i&&pN(i.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,i=EM(t,e),r=0;r<n.length;r++){var o=n[r],a=e.panelId;if(a){if(o.panelId===a)return o}else for(var s=0;s<EA.length;s++)if(EA[s](i,o))return o}return!0},e}();function E_(e){return e[0]>e[1]&&e.reverse(),e}function EM(e,t){return fj(e,t,{includeMainTypes:Ew})}var EC={grid:function(e,t){var n=e.xAxisModels,i=e.yAxisModels,r=e.gridModels,o=fi(),a={},s={};(n||i||r)&&(pz(n,function(e){var t=e.axis.grid.model;o.set(t.id,t),a[t.id]=!0}),pz(i,function(e){var t=e.axis.grid.model;o.set(t.id,t),s[t.id]=!0}),pz(r,function(e){o.set(e.id,e),a[e.id]=!0,s[e.id]=!0}),o.each(function(e){var r=e.coordinateSystem,o=[];pz(r.getCartesians(),function(e,t){(pN(n,e.getAxis("x").model)>=0||pN(i,e.getAxis("y").model)>=0)&&o.push(e)}),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:o[0],coordSyses:o,getPanelRect:Ek.grid,xAxisDeclared:a[e.id],yAxisDeclared:s[e.id]})}))},geo:function(e,t){pz(e.geoModels,function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:Ek.geo})})}},EA=[function(e,t){var n=e.xAxisModel,i=e.yAxisModel,r=e.gridModel;return!r&&n&&(r=n.axis.grid.model),!r&&i&&(r=i.axis.grid.model),r&&r===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],Ek={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(_J(e)),t}},ET={lineX:p$(ED,0),lineY:p$(ED,1),rect:function(e,t,n,i){var r=e?t.pointToData([n[0][0],n[1][0]],i):t.dataToPoint([n[0][0],n[1][0]],i),o=e?t.pointToData([n[0][1],n[1][1]],i):t.dataToPoint([n[0][1],n[1][1]],i),a=[E_([r[0],o[0]]),E_([r[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(e,t,n,i){var r=[[1/0,-1/0],[1/0,-1/0]];return{values:pV(n,function(n){var o=e?t.pointToData(n,i):t.dataToPoint(n,i);return r[0][0]=Math.min(r[0][0],o[0]),r[1][0]=Math.min(r[1][0],o[1]),r[0][1]=Math.max(r[0][1],o[0]),r[1][1]=Math.max(r[1][1],o[1]),o}),xyMinMax:r}}};function ED(e,t,n,i){var r=n.getAxis(["x","y"][e]),o=E_(pV([0,1],function(e){return t?r.coordToData(r.toLocalCoord(i[e]),!0):r.toGlobalCoord(r.dataToCoord(i[e]))})),a=[];return a[e]=o,a[1-e]=[NaN,NaN],{values:o,xyMinMax:a}}var EI={lineX:p$(EO,0),lineY:p$(EO,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return pV(e,function(e,i){return[e[0]-n[0]*t[i][0],e[1]-n[1]*t[i][1]]})}};function EO(e,t,n,i){return[t[0]-i[e]*n[0],t[1]-i[e]*n[1]]}function EP(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var EE=fT+"toolbox-dataZoom_",ER=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gO(t,e),t.prototype.render=function(e,t,n,i){var r,o,a,s,l,u,c,h,d;this._brushController||(this._brushController=new PQ(n.getZr()),this._brushController.on("brush",pG(this._onBrush,this)).mount()),r=e,o=t,a=this,s=i,l=n,u=a._isZoomActive,s&&"takeGlobalCursor"===s.type&&(u="dataZoomSelect"===s.key&&s.dataZoomSelectActive),a._isZoomActive=u,r.setIconStatus("zoom",u?"emphasis":"normal"),c=new ES(EN(r),o,{include:["grid"]}).makePanelOpts(l,function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}),a._brushController.setPanels(c).enableBrush(!!u&&!!c.length&&{brushType:"auto",brushStyle:r.getModel("brushStyle").getItemStyle()}),h=e,d=t,h.setIconStatus("back",PH(d).length>1?"emphasis":"normal")},t.prototype.onclick=function(e,t,n){EL[n].call(this)},t.prototype.remove=function(e,t){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(e,t){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(e.isEnd&&t.length){var n,i,r,o={},a=this.ecModel;this._brushController.updateCovers([]),new ES(EN(this.model),a,{include:["grid"]}).matchOutputRanges(t,a,function(e,t,n){if("cartesian2d"===n.type){var i=e.brushType;"rect"===i?(s("x",n,t[0]),s("y",n,t[1])):s({lineX:"x",lineY:"y"}[i],n,t)}}),n=a,i=o,r=PH(n),pz(i,function(e,t){for(var i=r.length-1;i>=0&&!r[i][t];i--);if(i<0){var o=n.queryComponents({mainType:"dataZoom",subType:"select",id:t})[0];if(o){var a=o.getPercentRange();r[0][t]={dataZoomId:t,start:a[0],end:a[1]}}}}),r.push(i),this._dispatchZoomAction(o)}function s(e,t,n){var i,r,s,l=t.getAxis(e),u=l.model,c=(i=e,r=u,a.eachComponent({mainType:"dataZoom",subType:"select"},function(e){e.getAxisModel(i,r.componentIndex)&&(s=e)}),s),h=c.findRepresentativeAxisProxy(u).getMinMaxSpan();(null!=h.minValueSpan||null!=h.maxValueSpan)&&(n=Of(0,n.slice(),l.scale.getExtent(),0,h.minValueSpan,h.maxValueSpan)),c&&(o[c.id]={dataZoomId:c.id,startValue:n[0],endValue:n[1]})}},t.prototype._dispatchZoomAction=function(e){var t=[];pz(e,function(e,n){t.push(pP(e))}),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:e.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},t}(PT),EL={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){var e,t,n;this._dispatchZoomAction((t=(e=PH(this.ecModel))[e.length-1],e.length>1&&e.pop(),n={},pz(t,function(t,i){for(var r=e.length-1;r>=0;r--)if(t=e[r][i]){n[i]=t;break}}),n))}};function EN(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return null==t.xAxisIndex&&null==t.xAxisId&&(t.xAxisIndex="all"),null==t.yAxisIndex&&null==t.yAxisId&&(t.yAxisIndex="all"),t}A=function(e){var t=e.getComponent("toolbox",0),n=["feature","dataZoom"];if(t&&null!=t.get(n)){var i=t.getModel(n),r=[],o=fj(e,EN(i));return pz(o.xAxisModels,function(e){return a(e,"xAxis","xAxisIndex")}),pz(o.yAxisModels,function(e){return a(e,"yAxis","yAxisIndex")}),r}function a(e,t,n){var o=e.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:EE+t+o};a[n]=o,r.push(a)}},p8(null==AH.get("dataZoom")&&A),AH.set("dataZoom",A);var EB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},t}(wr);function EF(e){var t=e.get("confine");return null!=t?!!t:"richText"===e.get("renderMode")}function Ez(e){if(fA.domSupported){for(var t=document.documentElement.style,n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n]}}var EV=Ez(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function Ej(e,t){if(!e)return t;t=bQ(t,!0);var n=e.indexOf(t);return(e=-1===n?t:"-"+e.slice(0,n)+"-"+t).toLowerCase()}var EH=Ej(Ez(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),EW=Ej(EV,"transform"),EG="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(fA.transform3dSupported?"will-change:transform;":"");function E$(e,t,n){var i=e.toFixed(0)+"px",r=t.toFixed(0)+"px";if(!fA.transformSupported)return n?"top:"+r+";left:"+i+";":[["top",r],["left",i]];var o=fA.transform3dSupported,a="translate"+(o?"3d":"")+"("+i+","+r+(o?",0":"")+")";return n?"top:0;left:0;"+EW+":"+a+";":[["top",0],["left",0],[EV,a]]}function EU(e,t,n,i,r){var o=t&&t.painter;if(n){var a=o&&o.getViewportRoot();a&&bx(by,a,i,r,!0)&&bx(e,n,by[0],by[1])}else{e[0]=i,e[1]=r;var s=o&&o.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var Eq=function(){function e(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,fA.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=e.getZr(),r=t.appendTo,o=r&&(pY(r)?document.querySelector(r):p0(r)?r:pq(r)&&r(e.getDom()));EU(this._styleCoord,i,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var a=this;n.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},n.onmousemove=function(e){if(e=e||window.event,!a._enterable){var t=i.handler;C5(i.painter.getViewportRoot(),e,!0),t.dispatch("mousemove",e)}},n.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return e.prototype.update=function(e){if(!this._container){var t,n,i=this._api.getDom(),r=(t="position",(n=i.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(i))?t?n[t]:n:null),o=i.style;"absolute"!==o.position&&"absolute"!==r&&(o.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n,i,r,o,a,s,l,u,c,h,d,p,f,g,m,v,y,x,b,w,S,_=this.el,M=_.style,C=this._styleCoord;_.innerHTML?M.cssText=EG+(n=!this._firstShow,i=this._longHide,r=[],o=e.get("transitionDuration"),a=e.get("backgroundColor"),s=e.get("shadowBlur"),l=e.get("shadowColor"),u=e.get("shadowOffsetX"),c=e.get("shadowOffsetY"),h=e.getModel("textStyle"),d=w8(e,"html"),p=u+"px "+c+"px "+s+"px "+l,r.push("box-shadow:"+p),n&&o&&r.push((g="opacity"+(f=" "+o/2+"s cubic-bezier(0.23,1,0.32,1)")+",visibility"+f,i||(f=" "+o+"s cubic-bezier(0.23,1,0.32,1)",g+=fA.transformSupported?","+EW+f:",left"+f+",top"+f),EH+":"+g)),a&&r.push("background-color:"+a),pz(["width","color","radius"],function(t){var n="border-"+t,i=bQ(n),o=e.get(i);null!=o&&r.push(n+":"+o+("color"===t?"":"px"))}),r.push((m=[],v=h.get("fontSize"),(y=h.getTextColor())&&m.push("color:"+y),m.push("font:"+h.getFont()),v&&m.push("line-height:"+Math.round(3*v/2)+"px"),x=h.get("textShadowColor"),b=h.get("textShadowBlur")||0,w=h.get("textShadowOffsetX")||0,S=h.get("textShadowOffsetY")||0,x&&b&&m.push("text-shadow:"+w+"px "+S+"px "+b+"px "+x),pz(["decoration","align"],function(e){var t=h.get(e);t&&m.push("text-"+e+":"+t)}),m.join(";"))),null!=d&&r.push("padding:"+p6(d).join("px ")+"px"),r.join(";")+";")+E$(C[0],C[1],!0)+"border-color:"+b5(t)+";"+(e.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):M.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,i,r){var o=this.el;if(null==e){o.innerHTML="";return}var a="";if(pY(r)&&"item"===n.get("trigger")&&!EF(n)&&(a=function(e,t,n){if(!pY(n)||"inside"===n)return"";var i,r,o=e.get("backgroundColor"),a=e.get("borderWidth");t=b5(t);var s=i="left"===(i=n)?"right":"right"===i?"left":"top"===i?"bottom":"top",l=Math.max(1.5*Math.round(a),6),u="",c=EW+":";pN(["left","right"],s)>-1?(u+="top:50%",c+="translateY(-50%) rotate("+(r="left"===s?-225:-45)+"deg)"):(u+="left:50%",c+="translateX(-50%) rotate("+(r="top"===s?225:45)+"deg)");var h=r*Math.PI/180,d=l+a,p=d*Math.abs(Math.cos(h))+d*Math.abs(Math.sin(h));u+=";"+s+":-"+Math.round(((p-Math.SQRT2*a)/2+Math.SQRT2*a-(p-d)/2)*100)/100+"px";var f=t+" solid "+a+"px;";return'<div style="'+["position:absolute;width:"+l+"px;height:"+l+"px;z-index:-1;",u+";"+c+";","border-bottom:"+f,"border-right:"+f,"background-color:"+o+";"].join("")+'"></div>'}(n,i,r)),pY(e))o.innerHTML=e+a;else if(e){o.innerHTML="",pU(e)||(e=[e]);for(var s=0;s<e.length;s++)p0(e[s])&&e[s].parentNode!==o&&o.appendChild(e[s]);if(a&&o.childNodes.length){var l=document.createElement("div");l.innerHTML=a,o.appendChild(l)}}},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el;return[e.offsetWidth,e.offsetHeight]},e.prototype.moveTo=function(e,t){var n=this._styleCoord;if(EU(n,this._zr,this._container,e,t),null!=n[0]&&null!=n[1]){var i=this.el.style;pz(E$(n[0],n[1]),function(e){i[e[0]]=e[1]})}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){var e=this,t=this.el.style;t.visibility="hidden",t.opacity="0",fA.transform3dSupported&&(t.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},e.prototype.hideLater=function(e){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(pG(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this.el.parentNode;e&&e.removeChild(this.el),this.el=this._container=null},e}(),EY=function(){function e(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),EK(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return e.prototype.update=function(e){var t=e.get("alwaysShowContent");t&&this._moveIfResized(),this._alwaysShowContent=t},e.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},e.prototype.setContent=function(e,t,n,i,r){var o=this;pK(e)&&wC(""),this.el&&this._zr.remove(this.el);var a=n.getModel("textStyle");this.el=new y4({style:{rich:t.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:i,textShadowColor:a.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:w8(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),pz(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(e){o.el.style[e]=n.get(e)}),pz(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(e){o.el.style[e]=a.get(e)||0}),this._zr.add(this.el);var s=this;this.el.on("mouseover",function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0}),this.el.on("mouseout",function(){s._enterable&&s._show&&s.hideLater(s._hideDelay),s._inContent=!1})},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el,t=this.el.getBoundingRect(),n=EX(e.style);return[t.width+n.left+n.right,t.height+n.top+n.bottom]},e.prototype.moveTo=function(e,t){var n=this.el;if(n){var i=this._styleCoord;EK(i,this._zr,e,t),e=i[0],t=i[1];var r=n.style,o=EZ(r.borderWidth||0),a=EX(r);n.x=e+o+a.left,n.y=t+o+a.top,n.markRedraw()}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},e.prototype.hideLater=function(e){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(pG(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){this._zr.remove(this.el)},e}();function EZ(e){return Math.max(0,e)}function EX(e){var t=EZ(e.shadowBlur||0),n=EZ(e.shadowOffsetX||0),i=EZ(e.shadowOffsetY||0);return{left:EZ(t-n),right:EZ(t+n),top:EZ(t-i),bottom:EZ(t+i)}}function EK(e,t,n,i){e[0]=n,e[1]=i,e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var EQ=new y$({shape:{x:-1,y:-1,width:2,height:2}}),EJ=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.init=function(e,t){if(!fA.node&&t.getDom()){var n,i=e.getComponent("tooltip"),r=this._renderMode="auto"===(n=i.get("renderMode"))?fA.domSupported?"html":"richText":n||"html";this._tooltipContent="richText"===r?new EY(t):new Eq(t,{appendTo:i.get("appendToBody",!0)?"body":i.get("appendTo",!0)})}},t.prototype.render=function(e,t,n){if(!fA.node&&n.getDom()){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=n;var i=this._tooltipContent;i.update(e),i.setEnterable(e.get("enterable")),this._initGlobalListener(),this._keepShow(),"richText"!==this._renderMode&&e.get("transitionDuration")?Mo(this,"_updatePosition",50,"fixRate"):Ma(this,"_updatePosition")}},t.prototype._initGlobalListener=function(){var e=this._tooltipModel.get("triggerOn");Pu("itemTooltip",this._api,pG(function(t,n,i){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(n,i):"leave"===t&&this._hide(i))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,i=e.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var r=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){n.isDisposed()||r.manuallyShowTip(e,t,n,{x:r._lastX,y:r._lastY,dataByCoordSys:r._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,t,n,i){if(i.from!==this.uid&&!fA.node&&n.getDom()){var r=E1(i,n);this._ticket="";var o=i.dataByCoordSys,a=function(e,t,n){var i,r=fH(e).queryOptionMap,o=r.keys()[0];if(o&&"series"!==o){var a=f$(t,o,r.get(o),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a&&(n.getViewOfComponentModel(a).group.traverse(function(t){var n=y6(t).tooltipConfig;if(n&&n.name===e.name)return i=t,!0}),i))return{componentMainType:o,componentIndex:a.componentIndex,el:i}}}(i,t,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:i.position,positionDefault:"bottom"},r)}else if(i.tooltip&&null!=i.x&&null!=i.y)EQ.x=i.x,EQ.y=i.y,EQ.update(),y6(EQ).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:EQ},r);else if(o)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:o,tooltipOption:i.tooltipOption},r);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(e,t,n,i))return;var l=Pf(i,t),u=l.point[0],c=l.point[1];null!=u&&null!=c&&this._tryShow({offsetX:u,offsetY:c,target:l.el,position:i.position,positionDefault:"bottom"},r)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},r))}},t.prototype.manuallyHideTip=function(e,t,n,i){var r=this._tooltipContent;this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(E1(i,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,i){var r=i.seriesIndex,o=i.dataIndex,a=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=o&&null!=a){var s=t.getSeriesByIndex(r);if(s&&"axis"===E0([s.getData().getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:o,position:i.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var i,r,o=e.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,e);else if(n){if("legend"===y6(n).ssrType)return;this._lastDataByCoordSys=null,kF(n,function(e){return null!=y6(e).dataIndex?(i=e,!0):null!=y6(e).tooltipConfig?(r=e,!0):void 0},!0),i?this._showSeriesItemTooltip(e,i,t):r?this._showComponentItemTooltip(e,r,t):this._hide(t)}else this._lastDataByCoordSys=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get("showDelay");t=pG(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,i=this._tooltipModel,r=[t.offsetX,t.offsetY],o=E0([t.tooltipOption],i),a=this._renderMode,s=[],l=w0("section",{blocks:[],noHeader:!0}),u=[],c=new w9;pz(e,function(e){pz(e.dataByAxis,function(e){var t=n.getComponent(e.axisDim+"Axis",e.axisIndex),r=e.value;if(t&&null!=r){var o=Pt(r,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),h=w0("section",{header:o,noHeader:!p9(o),sortBlocks:!0,blocks:[]});l.blocks.push(h),pz(e.seriesDataIndices,function(l){var d=n.getSeriesByIndex(l.seriesIndex),p=l.dataIndexInside,f=d.getDataParams(p);if(!(f.dataIndex<0)){f.axisDim=e.axisDim,f.axisIndex=e.axisIndex,f.axisType=e.axisType,f.axisId=e.axisId,f.axisValue=DA(t.axis,{value:r}),f.axisValueLabel=o,f.marker=c.makeTooltipMarker("item",b5(f.color),a);var g=ww(d.formatTooltip(p,!0,null)),m=g.frag;if(m){var v=E0([d],i).get("valueFormatter");h.blocks.push(v?pR({valueFormatter:v},m):m)}g.text&&u.push(g.text),s.push(f)}})}})}),l.blocks.reverse(),u.reverse();var h=t.position,d=w3(l,c,a,o.get("order"),n.get("useUTC"),o.get("textStyle"));d&&u.unshift(d);var p="richText"===a?"\n\n":"<br/>",f=u.join(p);this._showOrMove(o,function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(o,h,r[0],r[1],this._tooltipContent,s):this._showTooltipContent(o,f,s,Math.random()+"",r[0],r[1],h,null,c)})},t.prototype._showSeriesItemTooltip=function(e,t,n){var i=this._ecModel,r=y6(t),o=r.seriesIndex,a=i.getSeriesByIndex(o),s=r.dataModel||a,l=r.dataIndex,u=r.dataType,c=s.getData(u),h=this._renderMode,d=e.positionDefault,p=E0([c.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),f=p.get("trigger");if(null==f||"item"===f){var g=s.getDataParams(l,u),m=new w9;g.marker=m.makeTooltipMarker("item",b5(g.color),h);var v=ww(s.formatTooltip(l,!1,u)),y=p.get("order"),x=p.get("valueFormatter"),b=v.frag,w=b?w3(x?pR({valueFormatter:x},b):b,m,h,y,i.get("useUTC"),p.get("textStyle")):v.text,S="item_"+s.name+"_"+l;this._showOrMove(p,function(){this._showTooltipContent(p,w,g,S,e.offsetX,e.offsetY,e.position,e.target,m)}),n({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:o,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var i=y6(t),r=i.tooltipConfig.option||{};if(pY(r)){var o=r;r={content:o,formatter:o}}var a=[r],s=this._ecModel.getComponent(i.componentMainType,i.componentIndex);s&&a.push(s),a.push({formatter:r.content});var l=e.positionDefault,u=E0(a,this._tooltipModel,l?{position:l}:null),c=u.get("content"),h=Math.random()+"",d=new w9;this._showOrMove(u,function(){var n=pP(u.get("formatterParams")||{});this._showTooltipContent(u,c,n,h,e.offsetX,e.offsetY,e.position,t,d)}),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,i,r,o,a,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent;u.setEnterable(e.get("enterable"));var c=e.get("formatter");a=a||e.get("position");var h=t,d=this._getNearestPoint([r,o],n,e.get("trigger"),e.get("borderColor")).color;if(c)if(pY(c)){var p=e.ecModel.get("useUTC"),f=pU(n)?n[0]:n,g=f&&f.axisType&&f.axisType.indexOf("time")>=0;h=c,g&&(h=bL(f.axisValue,h,p)),h=b2(h,n,!0)}else if(pq(c)){var m=pG(function(t,i){t===this._ticket&&(u.setContent(i,l,e,d,a),this._updatePosition(e,a,r,o,u,n,s))},this);this._ticket=i,h=c(n,i,m)}else h=c;u.setContent(h,l,e,d,a),u.show(e,d),this._updatePosition(e,a,r,o,u,n,s)}},t.prototype._getNearestPoint=function(e,t,n,i){return"axis"===n||pU(t)?{color:i||("html"===this._renderMode?"#fff":"none")}:pU(t)?void 0:{color:i||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,i,r,o,a){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=r.getSize(),c=e.get("align"),h=e.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),pq(t)&&(t=t([n,i],o,r.el,d,{viewSize:[s,l],contentSize:u.slice()})),pU(t))n=fc(t[0],s),i=fc(t[1],l);else if(pK(t)){var p=t;p.width=u[0],p.height=u[1];var f=b9(p,{width:s,height:l});n=f.x,i=f.y,c=null,h=null}else if(pY(t)&&a){var g=function(e,t,n,i){var r=n[0],o=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=t.width,c=t.height;switch(e){case"inside":s=t.x+u/2-r/2,l=t.y+c/2-o/2;break;case"top":s=t.x+u/2-r/2,l=t.y-o-a;break;case"bottom":s=t.x+u/2-r/2,l=t.y+c+a;break;case"left":s=t.x-r-a,l=t.y+c/2-o/2;break;case"right":s=t.x+u+a,l=t.y+c/2-o/2}return[s,l]}(t,d,u,e.get("borderWidth"));n=g[0],i=g[1]}else{var m,v,y,x,b,w,S,_,M,C,g=(m=n,v=i,y=r,x=s,b=l,w=c?null:20,S=h?null:20,M=(_=y.getSize())[0],C=_[1],null!=w&&(m+M+w+2>x?m-=M+w:m+=w),null!=S&&(v+C+S>b?v-=C+S:v+=S),[m,v]);n=g[0],i=g[1]}if(c&&(n-=E2(c)?u[0]/2:"right"===c?u[0]:0),h&&(i-=E2(h)?u[1]/2:"bottom"===h?u[1]:0),EF(e)){var A,k,T,D,I,O,P,E,g=(A=n,k=i,T=r,D=s,I=l,P=(O=T.getSize())[0],E=O[1],A=Math.min(A+P,D)-P,k=Math.min(k+E,I)-E,[A=Math.max(A,0),k=Math.max(k,0)]);n=g[0],i=g[1]}r.moveTo(n,i)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,i=this._cbParamsList,r=!!n&&n.length===e.length;return r&&pz(n,function(n,o){var a=n.dataByAxis||[],s=(e[o]||{}).dataByAxis||[];(r=r&&a.length===s.length)&&pz(a,function(e,n){var o=s[n]||{},a=e.seriesDataIndices||[],l=o.seriesDataIndices||[];(r=r&&e.value===o.value&&e.axisType===o.axisType&&e.axisId===o.axisId&&a.length===l.length)&&pz(a,function(e,t){var n=l[t];r=r&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),i&&pz(e.seriesDataIndices,function(e){var n=e.seriesIndex,o=t[n],a=i[n];o&&a&&a.data!==o.data&&(r=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=t,!!r},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,t){!fA.node&&t.getDom()&&(Ma(this,"_updatePosition"),this._tooltipContent.dispose(),Pd("itemTooltip",t))},t.type="tooltip",t}(ka);function E0(e,t,n){var i,r=t.ecModel;n?(i=new bc(n,r,r),i=new bc(t.option,i,r)):i=t;for(var o=e.length-1;o>=0;o--){var a=e[o];a&&(a instanceof bc&&(a=a.get("tooltip",!0)),pY(a)&&(a={formatter:a}),a&&(i=new bc(a,i,r)))}return i}function E1(e,t){return e.dispatchAction||pG(t.dispatchAction,t)}function E2(e){return"center"===e||"middle"===e}var E5={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};let E3=function(e,t,n){var i=pP((E5[e]||{})[t]);return n&&pU(i)?i[i.length-1]:i};var E4=function(){function e(t){var n,i,r=t.mappingMethod,o=t.type,a=this.option=pP(t);this.type=o,this.mappingMethod=r,this._normalizeData=Ro[r];var s=e.visualHandlers[o];this.applyVisual=s.applyVisual,this.getColorMapper=s.getColorMapper,this._normalizedToVisual=s._normalizedToVisual[r],"piecewise"===r?(E6(a),i=(n=a).pieceList,n.hasSpecialVisual=!1,pz(i,function(e,t){e.originIndex=t,null!=e.visual&&(n.hasSpecialVisual=!0)})):"category"===r?a.categories?function(e){var t=e.categories,n=e.categoryMap={},i=e.visual;if(pz(t,function(e,t){n[e]=t}),!pU(i)){var r=[];pK(i)?pz(i,function(e,t){var i=n[t];r[null!=i?i:-1]=e}):r[-1]=i,i=Rr(e,r)}for(var o=t.length-1;o>=0;o--)null==i[o]&&(delete n[t[o]],t.pop())}(a):E6(a,!0):(p8("linear"!==r||a.dataExtent),E6(a))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return pG(this._normalizeData,this)},e.listVisualTypes=function(){return pW(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){pK(e)?pz(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,i){var r,o=pU(t)?[]:pK(t)?{}:(r=!0,null);return e.eachVisual(t,function(e,t){var a=n.call(i,e,t);r?o=a:o[t]=a}),o},e.retrieveVisuals=function(t){var n,i={};return t&&pz(e.visualHandlers,function(e,r){t.hasOwnProperty(r)&&(i[r]=t[r],n=!0)}),n?i:null},e.prepareVisualTypes=function(e){if(pU(e))e=e.slice();else{if(!pK(e))return[];var t=[];pz(e,function(e,n){t.push(n)}),e=t}return e.sort(function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1}),e},e.dependsOn=function(e,t){return"color"===t?!!(e&&0===e.indexOf(t)):e===t},e.findPieceIndex=function(e,t,n){for(var i,r=1/0,o=0,a=t.length;o<a;o++){var s=t[o].value;if(null!=s){if(s===e||pY(s)&&s===e+"")return o;n&&_(s,o)}}for(var o=0,a=t.length;o<a;o++){var l,u,c,h,d,p,f,g,m,v,y,x,b=t[o],w=b.interval,S=b.close;if(w){if(w[0]===-1/0){if(l=S[1],u=e,c=w[1],l?u<=c:u<c)return o}else if(w[1]===1/0){if(h=S[0],d=w[0],p=e,h?d<=p:d<p)return o}else{if(f=S[0],g=w[0],m=e,(f?g<=m:g<m)&&(v=S[1],y=e,x=w[1],v?y<=x:y<x))return o}n&&_(w[0],o),n&&_(w[1],o)}}if(n)return e===1/0?t.length-1:e===-1/0?0:i;function _(t,n){var o=Math.abs(t-e);o<r&&(r=o,i=n)}},e.visualHandlers={color:{applyVisual:E7("color"),getColorMapper:function(){var e=this.option;return pG("category"===e.mappingMethod?function(e,t){return t||(e=this._normalizeData(e)),Re.call(this,e)}:function(t,n,i){var r=!!i;return n||(t=this._normalizeData(t)),i=vp(t,e.parsedVisual,i),r?i:vm(i,"rgba")},this)},_normalizedToVisual:{linear:function(e){return vm(vp(e,this.option.parsedVisual),"rgba")},category:Re,piecewise:function(e,t){var n=Ri.call(this,t);return null==n&&(n=vm(vp(e,this.option.parsedVisual),"rgba")),n},fixed:Rt}},colorHue:E8(function(e,t){return vf(e,t)}),colorSaturation:E8(function(e,t){return vf(e,null,t)}),colorLightness:E8(function(e,t){return vf(e,null,null,t)}),colorAlpha:E8(function(e,t){return vg(e,t)}),decal:{applyVisual:E7("decal"),_normalizedToVisual:{linear:null,category:Re,piecewise:null,fixed:null}},opacity:{applyVisual:E7("opacity"),_normalizedToVisual:Rn([0,1])},liftZ:{applyVisual:E7("liftZ"),_normalizedToVisual:{linear:Rt,category:Rt,piecewise:Rt,fixed:Rt}},symbol:{applyVisual:function(e,t,n){n("symbol",this.mapValueToVisual(e))},_normalizedToVisual:{linear:E9,category:Re,piecewise:function(e,t){var n=Ri.call(this,t);return null==n&&(n=E9.call(this,e)),n},fixed:Rt}},symbolSize:{applyVisual:E7("symbolSize"),_normalizedToVisual:Rn([0,1])}},e}();function E6(e,t){var n=e.visual,i=[];pK(n)?pz(n,function(e){i.push(e)}):null!=n&&i.push(n),t||1!==i.length||({color:1,symbol:1}).hasOwnProperty(e.type)||(i[1]=i[0]),Rr(e,i)}function E8(e){return{applyVisual:function(t,n,i){var r=this.mapValueToVisual(t);i("color",e(n("color"),r))},_normalizedToVisual:Rn([0,1])}}function E9(e){var t=this.option.visual;return t[Math.round(fu(e,[0,1],[0,t.length-1],!0))]||{}}function E7(e){return function(t,n,i){i(e,this.mapValueToVisual(t))}}function Re(e){var t=this.option.visual;return t[this.option.loop&&-1!==e?e%t.length:e]}function Rt(){return this.option.visual[0]}function Rn(e){return{linear:function(t){return fu(t,e,this.option.visual,!0)},category:Re,piecewise:function(t,n){var i=Ri.call(this,n);return null==i&&(i=fu(t,e,this.option.visual,!0)),i},fixed:Rt}}function Ri(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var i=E4.findPieceIndex(e,n),r=n[i];if(r&&r.visual)return r.visual[this.type]}}function Rr(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=pV(t,function(e){return vc(e)||[0,0,0,1]})),t}var Ro={linear:function(e){return fu(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=E4.findPieceIndex(e,t,!0);if(null!=n)return fu(n,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?-1:t},fixed:fs};function Ra(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function Rs(e,t,n){var i={};return pz(t,function(t){var r,o=i[t]=((r=function(){}).prototype.__hidden=r.prototype,new r);pz(e[t],function(e,i){if(E4.isValidType(i)){var r={type:i,visual:e};n&&n(r,t),o[i]=new E4(r),"opacity"===i&&((r=pP(r)).type="colorAlpha",o.__hidden.__alphaForOpacity=new E4(r))}})}),i}var Rl=E4.mapVisual,Ru=E4.eachVisual,Rc=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return gO(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n,i,r=this.option;t||(pz(n=this.replacableOptionKeys,function(t){e.hasOwnProperty(t)&&Ra(e[t])&&(i=!0)}),i&&pz(n,function(t){e.hasOwnProperty(t)&&Ra(e[t])?r[t]=pP(e[t]):delete r[t]})),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=pG(e,this),this.controllerVisuals=Rs(this.option.controller,t,e),this.targetVisuals=Rs(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesIndex,t=[];return null==e||"all"===e?this.ecModel.eachSeries(function(e,n){t.push(n)}):t=fD(e),t},t.prototype.eachTargetSeries=function(e,t){pz(this.getTargetSeriesIndices(),function(n){var i=this.ecModel.getSeriesByIndex(n);i&&e.call(t,i)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var i,r=this.option,o=r.precision,a=this.dataBound,s=r.formatter;n=n||["<",">"],pU(e)&&(e=e.slice(),i=!0);var l=t?e:i?[u(e[0]),u(e[1])]:u(e);if(pY(s))return s.replace("{value}",i?l[0]:l).replace("{value2}",i?l[1]:l);if(pq(s))return i?s(e[0],e[1]):s(e);if(!i)return l;if(e[0]===a[0])return n[0]+" "+l[1];if(e[1]===a[1])return n[1]+" "+l[0];return l[0]+" - "+l[1];function u(e){return e===a[0]?"min":e===a[1]?"max":(+e).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var e=this.option,t=fd([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimensionIndex=function(e){var t=this.option.dimension;if(null!=t)return e.getDimensionIndex(t);for(var n=e.dimensions,i=n.length-1;i>=0;i--){var r=n[i],o=e.getDimensionInfo(r);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},i=t.target||(t.target={}),r=t.controller||(t.controller={});pE(i,n),pE(r,n);var o=this.isCategory();function a(n){pU(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get("gradientColor")}}a.call(this,i),a.call(this,r),(function(e,t,n){var i=e[t],r=e[n];i&&!r&&(r=e[n]={},pz(i,function(e,t){if(E4.isValidType(t)){var n=E3(t,"inactive",o);null!=n&&(r[t]=n,"color"!==t||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}}))}).call(this,i,"inRange","outOfRange"),(function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,i=this.get("inactiveColor"),r=this.getItemSymbol()||"roundRect";pz(this.stateList,function(a){var s=this.itemSize,l=e[a];l||(l=e[a]={color:o?i:[i]}),null==l.symbol&&(l.symbol=t&&pP(t)||(o?r:[r])),null==l.symbolSize&&(l.symbolSize=n&&pP(n)||(o?s[0]:[s[0],s[0]])),l.symbol=Rl(l.symbol,function(e){return"none"===e?r:e});var u=l.symbolSize;if(null!=u){var c=-1/0;Ru(u,function(e){e>c&&(c=e)}),l.symbolSize=Rl(u,function(e){return fu(e,[0,c],[0,s[0]],!0)})}},this)}).call(this,r)},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}(wr),Rh=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(null==t[0]||isNaN(t[0]))&&(t[0]=20),(null==t[1]||isNaN(t[1]))&&(t[1]=140)},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):pU(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),pz(this.stateList,function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=fd((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]<e[0]&&(t[0]=e[0]),t[1]<e[0]&&(t[1]=e[0]),t},t.prototype.getValueState=function(e){var t=this.option.range,n=this.getExtent();return(t[0]<=n[0]||t[0]<=e)&&(t[1]>=n[1]||e<=t[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries(function(n){var i=[],r=n.getData();r.each(this.getDataDimensionIndex(r),function(t,n){e[0]<=t&&t<=e[1]&&i.push(n)},this),t.push({seriesId:n.id,dataIndex:i})},this),t},t.prototype.getVisualMeta=function(e){var t=Rd(this,"outOfRange",this.getExtent()),n=Rd(this,"inRange",this.option.range.slice()),i=[];function r(t,n){i.push({value:t,color:e(t,n)})}for(var o=0,a=0,s=n.length,l=t.length;a<l&&(!n.length||t[a]<=n[0]);a++)t[a]<n[o]&&r(t[a],"outOfRange");for(var u=1;o<s;o++,u=0)u&&i.length&&r(n[o],"outOfRange"),r(n[o],"inRange");for(var u=1;a<l;a++)(!n.length||n[n.length-1]<t[a])&&(u&&(i.length&&r(i[i.length-1].value,"outOfRange"),u=0),r(t[a],"outOfRange"));var c=i.length;return{stops:i,outerColors:[c?i[0].color:"transparent",c?i[c-1].color:"transparent"]}},t.type="visualMap.continuous",t.defaultOption=bp(Rc.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),t}(Rc);function Rd(e,t,n){if(n[0]===n[1])return n.slice();for(var i=(n[1]-n[0])/200,r=n[0],o=[],a=0;a<=200&&r<n[1];a++)o.push(r),r+=i;return o.push(n[1]),o}var Rp=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return gO(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,i){(this.visualMapModel=e,!1===e.get("show"))?this.group.removeAll():this.doRender(e,t,n,i)},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=p6(t.get("padding")||0),i=e.getBoundingRect();e.add(new y$({z2:-1,silent:!0,shape:{x:i.x-n[3],y:i.y-n[0],width:i.width+n[3]+n[1],height:i.height+n[0]+n[2]},style:{fill:t.get("backgroundColor"),stroke:t.get("borderColor"),lineWidth:t.get("borderWidth")}}))},t.prototype.getControllerVisual=function(e,t,n){var i=(n=n||{}).forceState,r=this.visualMapModel,o={};function a(e){return o[e]}function s(e,t){o[e]=t}"color"===t&&(o.color=r.get("contentColor"));var l=r.controllerVisuals[i||r.getValueState(e)];return pz(E4.prepareVisualTypes(l),function(i){var r=l[i];n.convertOpacityToAlpha&&"opacity"===i&&(i="colorAlpha",r=l.__alphaForOpacity),E4.dependsOn(i,t)&&r&&r.applyVisual(e,a,s)}),o[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api;b7(e,t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},t.prototype.doRender=function(e,t,n,i){},t.type="visualMap",t}(ka),Rf=[["left","right","width"],["top","bottom","height"]];function Rg(e,t,n){var i=e.option,r=i.align;if(null!=r&&"auto"!==r)return r;for(var o={width:t.getWidth(),height:t.getHeight()},a=+("horizontal"===i.orient),s=Rf[a],l=[0,null,10],u={},c=0;c<3;c++)u[Rf[1-a][c]]=l[c],u[s[c]]=2===c?n[0]:i[s[c]];var h=[["x","width",3],["y","height",0]][a],d=b9(u,o,i.padding);return s[(d.margin[h[2]]||0)+d[h[0]]+.5*d[h[1]]<.5*o[h[1]]?0:1]}function Rm(e,t){return pz(e||[],function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")}),e}var Rv=Math.min,Ry=Math.max,Rx=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._shapes={},n._dataInterval=[],n._handleEnds=[],n._hoverLinkDataIndices=[],n}return gO(t,e),t.prototype.init=function(t,n){e.prototype.init.call(this,t,n),this._hoverLinkFromSeriesMouseOver=pG(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=pG(this._hideIndicator,this)},t.prototype.doRender=function(e,t,n,i){i&&"selectDataRange"===i.type&&i.from===this.uid||this._buildView()},t.prototype._buildView=function(){this.group.removeAll();var e=this.visualMapModel,t=this.group;this._orient=e.get("orient"),this._useHandle=e.get("calculable"),this._resetInterval(),this._renderBar(t);var n=e.get("text");this._renderEndsText(t,n,0),this._renderEndsText(t,n,1),this._updateView(!0),this.renderBackground(t),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(t)},t.prototype._renderEndsText=function(e,t,n){if(t){var i=t[1-n];i=null!=i?i+"":"";var r=this.visualMapModel,o=r.get("textGap"),a=r.itemSize,s=this._shapes.mainGroup,l=this._applyTransform([a[0]/2,0===n?-o:a[1]+o],s),u=this._applyTransform(0===n?"bottom":"top",s),c=this._orient,h=this.visualMapModel.textStyleModel;this.group.add(new y4({style:x1(h,{x:l[0],y:l[1],verticalAlign:"horizontal"===c?"middle":u,align:"horizontal"===c?u:"center",text:i})}))}},t.prototype._renderBar=function(e){var t=this.visualMapModel,n=this._shapes,i=t.itemSize,r=this._orient,o=this._useHandle,a=Rg(t,this.api,i),s=n.mainGroup=this._createBarGroup(a),l=new SI;s.add(l),l.add(n.outOfRange=Rb()),l.add(n.inRange=Rb(null,o?RS(this._orient):null,pG(this._dragHandle,this,"all",!1),pG(this._dragHandle,this,"all",!0))),l.setClipPath(new y$({shape:{x:0,y:0,width:i[0],height:i[1],r:3}}));var u=t.textStyleModel.getTextRect("国"),c=Ry(u.width,u.height);o&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(t,s,0,i,c,r),this._createHandle(t,s,1,i,c,r)),this._createIndicator(t,s,i,c,r),e.add(s)},t.prototype._createHandle=function(e,t,n,i,r,o){var a=pG(this._dragHandle,this,n,!1),s=pG(this._dragHandle,this,n,!0),l=md(e.get("handleSize"),i[0]),u=MQ(e.get("handleIcon"),-l/2,-l/2,l,l,null,!0),c=RS(this._orient);u.attr({cursor:c,draggable:!0,drift:a,ondragend:s,onmousemove:function(e){C4(e.event)}}),u.x=i[0]/2,u.useStyle(e.getModel("handleStyle").getItemStyle()),u.setStyle({strokeNoScale:!0,strokeFirst:!0}),u.style.lineWidth*=2,u.ensureState("emphasis").style=e.getModel(["emphasis","handleStyle"]).getItemStyle(),xN(u,!0),t.add(u);var h=new y4({cursor:c,draggable:!0,drift:a,onmousemove:function(e){C4(e.event)},ondragend:s,style:x1(this.visualMapModel.textStyleModel,{x:0,y:0,text:""})});h.ensureState("blur").style={opacity:.1},h.stateTransition={duration:200},this.group.add(h);var d=[l,0],p=this._shapes;p.handleThumbs[n]=u,p.handleLabelPoints[n]=d,p.handleLabels[n]=h},t.prototype._createIndicator=function(e,t,n,i,r){var o=md(e.get("indicatorSize"),n[0]),a=MQ(e.get("indicatorIcon"),-o/2,-o/2,o,o,null,!0);a.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var s=e.getModel("indicatorStyle").getItemStyle();if(a instanceof yB){var l=a.style;a.useStyle(pR({image:l.image,x:l.x,y:l.y,width:l.width,height:l.height},s))}else a.useStyle(s);t.add(a);var u=new y4({silent:!0,invisible:!0,style:x1(this.visualMapModel.textStyleModel,{x:0,y:0,text:""})});this.group.add(u);var c=[("horizontal"===r?i/2:6)+n[0]/2,0],h=this._shapes;h.indicator=a,h.indicatorLabel=u,h.indicatorLabelPoint=c,this._firstShowIndicator=!0},t.prototype._dragHandle=function(e,t,n,i){if(this._useHandle){if(this._dragging=!t,!t){var r=this._applyTransform([n,i],this._shapes.mainGroup,!0);this._updateInterval(e,r[1]),this._hideIndicator(),this._updateView()}!this.visualMapModel.get("realtime")===t&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),t?this._hovering||this._clearHoverLinkToSeries():Rw(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},t.prototype._resetInterval=function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),n=e.getExtent(),i=[0,e.itemSize[1]];this._handleEnds=[fu(t[0],n,i,!0),fu(t[1],n,i,!0)]},t.prototype._updateInterval=function(e,t){t=t||0;var n=this.visualMapModel,i=this._handleEnds,r=[0,n.itemSize[1]];Of(t,i,r,e,0);var o=n.getExtent();this._dataInterval=[fu(i[0],r,o,!0),fu(i[1],r,o,!0)]},t.prototype._updateView=function(e){var t=this.visualMapModel,n=t.getExtent(),i=this._shapes,r=[0,t.itemSize[1]],o=e?r:this._handleEnds,a=this._createBarVisual(this._dataInterval,n,o,"inRange"),s=this._createBarVisual(n,n,r,"outOfRange");i.inRange.setStyle({fill:a.barColor}).setShape("points",a.barPoints),i.outOfRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),this._updateHandle(o,a)},t.prototype._createBarVisual=function(e,t,n,i){var r={forceState:i,convertOpacityToAlpha:!0},o=this._makeColorGradient(e,r),a=[this.getControllerVisual(e[0],"symbolSize",r),this.getControllerVisual(e[1],"symbolSize",r)],s=this._createBarPoints(n,a);return{barColor:new _T(0,0,0,1,o),barPoints:s,handlesColor:[o[0].color,o[o.length-1].color]}},t.prototype._makeColorGradient=function(e,t){var n=[],i=(e[1]-e[0])/100;n.push({color:this.getControllerVisual(e[0],"color",t),offset:0});for(var r=1;r<100;r++){var o=e[0]+i*r;if(o>e[1])break;n.push({color:this.getControllerVisual(o,"color",t),offset:r/100})}return n.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),n},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get("inverse");return new SI("horizontal"===t&&!n?{scaleX:"bottom"===e?1:-1,rotation:Math.PI/2}:"horizontal"===t&&n?{scaleX:"bottom"===e?-1:1,rotation:-Math.PI/2}:"vertical"===t&&!n?{scaleX:"left"===e?1:-1,scaleY:-1}:{scaleX:"left"===e?1:-1})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,i=this.visualMapModel,r=n.handleThumbs,o=n.handleLabels,a=i.itemSize,s=i.getExtent();pz([0,1],function(l){var u=r[l];u.setStyle("fill",t.handlesColor[l]),u.y=e[l];var c=fu(e[l],[0,a[1]],s,!0),h=this.getControllerVisual(c,"symbolSize");u.scaleX=u.scaleY=h/a[0],u.x=a[0]-h/2;var d=_0(n.handleLabelPoints[l],_J(u,this.group));o[l].setStyle({x:d[0],y:d[1],text:i.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})},this)}},t.prototype._showIndicator=function(e,t,n,i){var r=this.visualMapModel,o=r.getExtent(),a=r.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0}),h=this.getControllerVisual(e,"symbolSize"),d=fu(e,o,s,!0),p=a[0]-h/2,f={x:u.x,y:u.y};u.y=d,u.x=p;var g=_0(l.indicatorLabelPoint,_J(u,this.group)),m=l.indicatorLabel;m.attr("invisible",!1);var v=this._applyTransform("left",l.mainGroup),y="horizontal"===this._orient;m.setStyle({text:(n||"")+r.formatValueText(t),verticalAlign:y?v:"middle",align:y?"center":v});var x={x:p,y:d,style:{fill:c}},b={style:{x:g[0],y:g[1]}};if(r.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var w={duration:100,easing:"cubicInOut",additive:!0};u.x=f.x,u.y=f.y,u.animateTo(x,w),m.animateTo(b,w)}else u.attr(x),m.attr(b);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var _=0;_<S.length;_++)this.api.enterBlur(S[_])}},t.prototype._enableHoverLinkToSeries=function(){var e=this;this._shapes.mainGroup.on("mousemove",function(t){if(e._hovering=!0,!e._dragging){var n=e.visualMapModel.itemSize,i=e._applyTransform([t.offsetX,t.offsetY],e._shapes.mainGroup,!0,!0);i[1]=Rv(Ry(0,i[1]),n[1]),e._doHoverLinkToSeries(i[1],0<=i[0]&&i[0]<=n[0])}}).on("mouseout",function(){e._hovering=!1,e._dragging||e._clearHoverLinkToSeries()})},t.prototype._enableHoverLinkFromSeries=function(){var e=this.api.getZr();this.visualMapModel.option.hoverLink?(e.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),e.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},t.prototype._doHoverLinkToSeries=function(e,t){var n=this.visualMapModel,i=n.itemSize;if(n.option.hoverLink){var r,o,a,s,l,u=[0,i[1]],c=n.getExtent();e=Rv(Ry(u[0],e),u[1]);var h=(r=n,o=c,a=u,s=6,(l=r.get("hoverLinkDataSize"))&&(s=fu(l,o,a,!0)/2),s),d=[e-h,e+h],p=fu(e,u,c,!0),f=[fu(d[0],u,c,!0),fu(d[1],u,c,!0)];d[0]<u[0]&&(f[0]=-1/0),d[1]>u[1]&&(f[1]=1/0),t&&(f[0]===-1/0?this._showIndicator(p,f[1],"< ",h):f[1]===1/0?this._showIndicator(p,f[0],"> ",h):this._showIndicator(p,p,"≈ ",h));var g=this._hoverLinkDataIndices,m=[];(t||Rw(n))&&(m=this._hoverLinkDataIndices=n.findTargetDataIndices(f));var v=function(e,t){var n={},i={};return r(e||[],n),r(t||[],i,n),[o(n),o(i)];function r(e,t,n){for(var i=0,r=e.length;i<r;i++){var o=fL(e[i].seriesId,null);if(null==o)return;for(var a=fD(e[i].dataIndex),s=n&&n[o],l=0,u=a.length;l<u;l++){var c=a[l];s&&s[c]?s[c]=null:(t[o]||(t[o]={}))[c]=1}}}function o(e,t){var n=[];for(var i in e)if(e.hasOwnProperty(i)&&null!=e[i])if(t)n.push(+i);else{var r=o(e[i],!0);r.length&&n.push({seriesId:i,dataIndex:r})}return n}}(g,m);this._dispatchHighDown("downplay",Rm(v[0],n)),this._dispatchHighDown("highlight",Rm(v[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){if(kF(e.target,function(e){var n=y6(e);if(null!=n.dataIndex)return t=n,!0},!0),t){var t,n=this.ecModel.getSeriesByIndex(t.seriesIndex),i=this.visualMapModel;if(i.isTargetSeries(n)){var r=n.getData(t.dataType),o=r.getStore().get(i.getDataDimensionIndex(r),t.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n<t.length;n++)this.api.leaveBlur(t[n])},t.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",Rm(e,this.visualMapModel)),e.length=0},t.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var e=this.api.getZr();e.off("mouseover",this._hoverLinkFromSeriesMouseOver),e.off("mouseout",this._hideIndicator)},t.prototype._applyTransform=function(e,t,n,i){var r=_J(t,i?null:this.group);return pU(e)?_0(e,r,n):_1(e,r,n)},t.prototype._dispatchHighDown=function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},t.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},t.type="visualMap.continuous",t}(Rp);function Rb(e,t,n,i){return new _c({shape:{points:e},draggable:!!n,cursor:t,drift:n,onmousemove:function(e){C4(e.event)},ondragend:i})}function Rw(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function RS(e){return"vertical"===e?"ns-resize":"ew-resize"}var R_={type:"selectDataRange",event:"dataRangeSelected",update:"update"},RM=function(e,t){t.eachComponent({mainType:"visualMap",query:e},function(t){t.setSelected(e.selected)})},RC=[{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent("visualMap",function(t){var i,r,o,a,s,l=e.pipelineContext;!t.isTargetSeries(e)||l&&l.large||n.push((i=t.stateList,r=t.targetVisuals,o=pG(t.getValueState,t),a=t.getDataDimensionIndex(e.getData()),s={},pz(i,function(e){var t=E4.prepareVisualTypes(r[e]);s[e]=t}),{progress:function(e,t){function n(e){return kN(t,u,e)}function i(e,n){var i=u;switch(e){case"color":t.ensureUniqueItemVisual(i,"style")[t.getVisual("drawType")]=n,t.setItemVisual(i,"colorFromPalette",!1);break;case"opacity":t.ensureUniqueItemVisual(i,"style").opacity=n;break;case"symbol":case"symbolSize":case"liftZ":t.setItemVisual(i,e,n)}}null!=a&&(l=t.getDimensionIndex(a));for(var l,u,c=t.getStore();null!=(u=e.next());){var h=t.getRawDataItem(u);if(!h||!1!==h.visualMap)for(var d=null!=a?c.get(l,u):u,p=o(d),f=r[p],g=s[p],m=0,v=g.length;m<v;m++){var y=g[m];f[y]&&f[y].applyVisual(d,n,i)}}}}))}),n}},{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),i=[];t.eachComponent("visualMap",function(t){if(t.isTargetSeries(e)){var r=t.getVisualMeta(pG(RA,null,e,t))||{stops:[],outerColors:[]},o=t.getDataDimensionIndex(n);o>=0&&(r.dimension=o,i.push(r))}}),e.getData().setVisual("visualMeta",i)}}];function RA(e,t,n,i){for(var r=t.targetVisuals[i],o=E4.prepareVisualTypes(r),a={color:kB(e.getData(),"color")},s=0,l=o.length;s<l;s++){var u=o[s],c=r["opacity"===u?"__alphaForOpacity":u];c&&c.applyVisual(n,h,d)}return a.color;function h(e){return a[e]}function d(e,t){a[e]=t}}function Rk(e){var t=e&&e.visualMap;pU(t)||(t=t?[t]:[]),pz(t,function(e){if(e){RT(e,"splitList")&&!RT(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&pU(t)&&pz(t,function(e){pK(e)&&(RT(e,"start")&&!RT(e,"min")&&(e.min=e.start),RT(e,"end")&&!RT(e,"max")&&(e.max=e.end))})}})}function RT(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var RD=!1;function RI(e){RD||(RD=!0,e.registerSubTypeDefaulter("visualMap",function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}),e.registerAction(R_,RM),pz(RC,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(Rk))}function RO(e){e.registerComponentModel(Rh),e.registerComponentView(Rx),RI(e)}var RP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return gO(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],RE[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var r=this.option.categories;this.resetVisual(function(e,t){"categories"===i?(e.mappingMethod="category",e.categories=pP(r)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=pV(this._pieceList,function(e){return e=pP(e),"inRange"!==t&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},i=E4.listVisualTypes(),r=this.isCategory();function o(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}pz(t.pieces,function(e){pz(i,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),pz(n,function(e,n){var i=!1;pz(this.stateList,function(e){i=i||o(t,e,n)||o(t.target,e,n)},this),i||pz(this.stateList,function(e){(t[e]||(t[e]={}))[n]=E3(n,"inRange"===e?"active":"inactive",r)})},this),e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,i=this._pieceList,r=(t?n:e).selected||{};if(n.selected=r,pz(i,function(e,t){var n=this.getSelectedMapKey(e);r.hasOwnProperty(n)||(r[n]=!0)},this),"single"===n.selectedMode){var o=!1;pz(i,function(e,t){var n=this.getSelectedMapKey(e);r[n]&&(o?r[n]=!1:o=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(e){return"categories"===this._mode?e.value+"":e.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=pP(e)},t.prototype.getValueState=function(e){var t=E4.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(i){var r=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(t,i){E4.findPieceIndex(t,n)===e&&r.push(i)},this),t.push({seriesId:i.id,dataIndex:r})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(!this.isCategory()){var t=[],n=["",""],i=this,r=this._pieceList.slice();if(r.length){var o=r[0].interval[0];o!==-1/0&&r.unshift({interval:[-1/0,o]}),(o=r[r.length-1].interval[1])!==1/0&&r.push({interval:[o,1/0]})}else r.push({interval:[-1/0,1/0]});var a=-1/0;return pz(r,function(e){var t=e.interval;t&&(t[0]>a&&s([a,t[0]],"outOfRange"),s(t.slice()),a=t[1])},this),{stops:t,outerColors:n}}function s(r,o){var a=i.getRepresentValue({interval:r});o||(o=i.getValueState(a));var s=e(a,o);r[0]===-1/0?n[0]=s:r[1]===1/0?n[1]=s:t.push({value:r[0],color:s},{value:r[1],color:s})}},t.type="visualMap.piecewise",t.defaultOption=bp(Rc.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(Rc),RE={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),i=this.getExtent(),r=t.splitNumber;t.splitNumber=r=Math.max(parseInt(r,10),1);for(var o=(i[1]-i[0])/r;+o.toFixed(n)!==o&&n<5;)n++;t.precision=n,o=+o.toFixed(n),t.minOpen&&e.push({interval:[-1/0,i[0]],close:[0,0]});for(var a=0,s=i[0];a<r;s+=o,a++){var l=a===r-1?i[1]:s+o;e.push({interval:[s,l],close:[1,1]})}t.maxOpen&&e.push({interval:[i[1],1/0],close:[0,0]}),fw(e),pz(e,function(e,t){e.index=t,e.text=this.formatValueText(e.interval)},this)},categories:function(e){var t=this.option;pz(t.categories,function(t){e.push({text:this.formatValueText(t,!0),value:t})},this),RR(t,e)},pieces:function(e){var t=this.option;pz(t.pieces,function(t,n){pK(t)||(t={value:t});var i={text:"",index:n};if(null!=t.label&&(i.text=t.label),t.hasOwnProperty("value")){var r=i.value=t.value;i.interval=[r,r],i.close=[1,1]}else{for(var o=i.interval=[],a=i.close=[0,0],s=[1,0,1],l=[-1/0,1/0],u=[],c=0;c<2;c++){for(var h=[["gte","gt","min"],["lte","lt","max"]][c],d=0;d<3&&null==o[c];d++)o[c]=t[h[d]],a[c]=s[d],u[c]=2===d;null==o[c]&&(o[c]=l[c])}u[0]&&o[1]===1/0&&(a[0]=0),u[1]&&o[0]===-1/0&&(a[1]=0),o[0]===o[1]&&a[0]&&a[1]&&(i.value=o[0])}i.visual=E4.retrieveVisuals(t),e.push(i)},this),RR(t,e),fw(e),pz(e,function(e){var t=e.close,n=[["<","≤"][t[1]],[">","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,n)},this)}};function RR(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}var RL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get("textGap"),i=t.textStyleModel,r=i.getFont(),o=i.getTextColor(),a=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,c=p2(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,c,a),pz(l.viewPieceList,function(i){var l=i.piece,u=new SI;u.onclick=pG(this._onItemClick,this,l),this._enableHoverLink(u,i.indexInModelPieceList);var h=t.getRepresentValue(l);if(this._createItemSymbol(u,h,[0,0,s[0],s[1]]),c){var d=this.visualMapModel.getValueState(h);u.add(new y4({style:{x:"right"===a?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:a,font:r,fill:o,opacity:"outOfRange"===d?.5:1}}))}e.add(u)},this),u&&this._renderEndsText(e,u[1],s,c,a),b8(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on("mouseover",function(){return i("highlight")}).on("mouseout",function(){return i("downplay")});var i=function(e){var i=n.visualMapModel;i.option.hoverLink&&n.api.dispatchAction({type:e,batch:Rm(i.findTargetDataIndices(t),i)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return Rg(e,this.api,e.itemSize);var n=t.align;return n&&"auto"!==n||(n="left"),n},t.prototype._renderEndsText=function(e,t,n,i,r){if(t){var o=new SI,a=this.visualMapModel.textStyleModel;o.add(new y4({style:x1(a,{x:i?"right"===r?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?r:"center",text:t})})),e.add(o)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=pV(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get("text"),i=e.get("orient"),r=e.get("inverse");return("horizontal"===i?r:!r)?t.reverse():n&&(n=n.slice().reverse()),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n){e.add(MQ(this.getControllerVisual(t,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(t,"color")))},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,i=n.selectedMode;if(i){var r=pP(n.selected),o=t.getSelectedMapKey(e);"single"===i||!0===i?(r[o]=!0,pz(r,function(e,t){r[t]=t===o})):r[o]=!r[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:r})}},t.type="visualMap.piecewise",t}(Rp);function RN(e){e.registerComponentModel(RP),e.registerComponentView(RL),RI(e)}function RB(e,t){if(!e)return!1;for(var n=pU(e)?e:[e],i=0;i<n.length;i++)if(n[i]&&n[i][t])return!0;return!1}function RF(e){fI(e,"label",["show"])}var Rz=fz(),RV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.createdBySelf=!1,n}return gO(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},t.prototype.isAnimationEnabled=function(){if(fA.node)return!1;var e=this.__hostSeries;return this.getShallow("animation")&&e&&e.isAnimationEnabled()},t.prototype.mergeOption=function(e,t){this._mergeOption(e,t,!1,!1)},t.prototype._mergeOption=function(e,t,n,i){var r=this.mainType;n||t.eachSeries(function(e){var n=e.get(this.mainType,!0),o=Rz(e)[r];if(!n||!n.data){Rz(e)[r]=null;return}o?o._mergeOption(n,t,!0):(i&&RF(n),pz(n.data,function(e){e instanceof Array?(RF(e[0]),RF(e[1])):RF(e)}),pR(o=this.createMarkerModelFromSeries(n,this,t),{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),o.__hostSeries=e),Rz(e)[r]=o},this)},t.prototype.formatTooltip=function(e,t,n){var i=this.getData(),r=this.getRawValue(e),o=i.getName(e);return w0("section",{header:this.name,blocks:[w0("nameValue",{name:o,value:r,noName:!o,noValue:null==r})]})},t.prototype.getData=function(){return this._data},t.prototype.setData=function(e){this._data=e},t.getMarkerModelFromSeries=function(e,t){return Rz(e)[t]},t.type="marker",t.dependencies=["series","grid","polar","geo"],t}(wr);pB(RV,wb.prototype);var Rj=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(RV);function RH(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function RW(e,t,n,i,r,o){var a=[],s=gd(t,i)?t.getCalculationInfo("stackResultDimension"):i,l=RZ(t,s,e),u=t.indicesOfNearest(s,l)[0];a[r]=t.get(n,u),a[o]=t.get(s,u);var c=t.get(i,u),h=fp(t.get(i,u));return(h=Math.min(h,20))>=0&&(a[o]=+a[o].toFixed(h)),[a,c]}var RG={min:p$(RW,"min"),max:p$(RW,"max"),average:p$(RW,"average"),median:p$(RW,"median")};function R$(e,t){if(t){var n,i=e.getData(),r=e.coordinateSystem,o=r&&r.dimensions;if(!(!isNaN(parseFloat((n=t).x))&&!isNaN(parseFloat(n.y)))&&!pU(t.coord)&&pU(o)){var a=RU(t,i,r,e);if((t=pP(t)).type&&RG[t.type]&&a.baseAxis&&a.valueAxis){var s=pN(o,a.baseAxis.dim),l=pN(o,a.valueAxis.dim),u=RG[t.type](i,a.baseDataDim,a.valueDataDim,s,l);t.coord=u[0],t.value=u[1]}else t.coord=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis]}if(null!=t.coord&&pU(o))for(var c=t.coord,h=0;h<2;h++)RG[c[h]]&&(c[h]=RZ(i,i.mapDimension(o[h]),c[h]));else t.coord=[];return t}}function RU(e,t,n,i){var r,o,a,s={};return null!=e.valueIndex||null!=e.valueDim?(s.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,s.valueAxis=n.getAxis((r=i,o=s.valueDataDim,(a=r.getData().getDimensionInfo(o))&&a.coordDim)),s.baseAxis=n.getOtherAxis(s.valueAxis),s.baseDataDim=t.mapDimension(s.baseAxis.dim)):(s.baseAxis=i.getBaseAxis(),s.valueAxis=n.getOtherAxis(s.baseAxis),s.baseDataDim=t.mapDimension(s.baseAxis.dim),s.valueDataDim=t.mapDimension(s.valueAxis.dim)),s}function Rq(e,t){return!e||!e.containData||!t.coord||!!RH(t)||e.containData(t.coord)}function RY(e,t){return e?function(e,n,i,r){return wA(r<2?e.coord&&e.coord[r]:e.value,t[r])}:function(e,n,i,r){return wA(e.value,t[r])}}function RZ(e,t,n){if("average"===n){var i=0,r=0;return e.each(t,function(e,t){!isNaN(e)&&(i+=e,r++)}),i/r}return"median"===n?e.getMedian(t):e.getDataExtent(t)[+("max"===n)]}var RX=fz(),RK=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.init=function(){this.markerGroupMap=fi()},t.prototype.render=function(e,t,n){var i=this,r=this.markerGroupMap;r.each(function(e){RX(e).keep=!1}),t.eachSeries(function(e){var r=RV.getMarkerModelFromSeries(e,i.type);r&&i.renderSeries(e,r,t,n)}),r.each(function(e){RX(e).keep||i.group.remove(e.group)})},t.prototype.markKeep=function(e){RX(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;pz(e,function(e){var i=RV.getMarkerModelFromSeries(e,n.type);i&&i.getData().eachItemGraphicEl(function(e){e&&(t?xv(e,xp):xv(e,xf))})})},t.type="marker",t}(ka),RQ=fz(),RJ=function(e,t,n,i){var r=i[0],o=i[1];if(r&&o){var a=R$(e,r),s=R$(e,o),l=a.coord,u=s.coord;l[0]=p2(l[0],-1/0),l[1]=p2(l[1],-1/0),u[0]=p2(u[0],1/0),u[1]=p2(u[1],1/0);var c=function(e){for(var t=e[0],n=1,i=e.length;n<i;n++)t=pE(t,e[n],void 0);return t}([{},a,s]);return c.coord=[a.coord,s.coord],c.x0=a.x,c.y0=a.y,c.x1=s.x,c.y1=s.y,c}};function R0(e){return!isNaN(e)&&!isFinite(e)}function R1(e,t,n,i){var r=1-e;return R0(t[r])&&R0(n[r])}function R2(e,t){var n=t.coord[0],i=t.coord[1],r={coord:n,x:t.x0,y:t.y0},o={coord:i,x:t.x1,y:t.y1};if(Mb(e,"cartesian2d"))return!!(n&&i&&(R1(1,n,i,e)||R1(0,n,i,e)))||!e||!e.containZone||!r.coord||!o.coord||!!RH(r)||!!RH(o)||e.containZone(r.coord,o.coord);return Rq(e,r)||Rq(e,o)}function R5(e,t,n,i,r){var o,a=i.coordinateSystem,s=e.getItemModel(t),l=fc(s.get(n[0]),r.getWidth()),u=fc(s.get(n[1]),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition){var c=e.getValues(["x0","y0"],t),h=e.getValues(["x1","y1"],t),d=a.clampData(c),p=a.clampData(h),f=[];"x0"===n[0]?f[0]=d[0]>p[0]?h[0]:c[0]:f[0]=d[0]>p[0]?c[0]:h[0],"y0"===n[1]?f[1]=d[1]>p[1]?h[1]:c[1]:f[1]=d[1]>p[1]?c[1]:h[1],o=i.getMarkerPosition(f,n,!0)}else{var g=e.get(n[0],t),m=e.get(n[1],t),v=[g,m];a.clampData&&a.clampData(v,v),o=a.dataToPoint(v,!0)}if(Mb(a,"cartesian2d")){var y=a.getAxis("x"),x=a.getAxis("y"),g=e.get(n[0],t),m=e.get(n[1],t);R0(g)?o[0]=y.toGlobalCoord(y.getExtent()[+("x0"!==n[0])]):R0(m)&&(o[1]=x.toGlobalCoord(x.getExtent()[+("y0"!==n[1])]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var R3=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],R4=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=RV.getMarkerModelFromSeries(e,"markArea");if(t){var i=t.getData();i.each(function(t){var r=pV(R3,function(r){return R5(i,t,r,e,n)});i.setItemLayout(t,r),i.getItemGraphicEl(t).setShape("points",r)})}},this)},t.prototype.renderSeries=function(e,t,n,i){var r=e.coordinateSystem,o=e.id,a=e.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new SI});this.group.add(l.group),this.markKeep(l);var u=function(e,t,n){if(e){var i,r,o=pV(e&&e.dimensions,function(e){var n=t.getData();return pR(pR({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})});i=new Sx(r=pV(["x0","y0","x1","y1"],function(e,t){return{name:e,type:o[t%2].type}}),n)}else i=new Sx(r=[{name:"value",type:"float"}],n);var a=pV(n.get("data"),p$(RJ,t,e,n));e&&(a=pH(a,p$(R2,e)));var s=e?function(e,t,n,i){return wA(e.coord[Math.floor(i/2)][i%2],r[i])}:function(e,t,n,i){return wA(e.value,r[i])};return i.initData(a,null,s),i.hasItemOption=!0,i}(r,e,t);t.setData(u),u.each(function(t){var n=pV(R3,function(n){return R5(u,t,n,e,i)}),o=r.getAxis("x").scale,s=r.getAxis("y").scale,l=o.getExtent(),c=s.getExtent(),h=[o.parse(u.get("x0",t)),o.parse(u.get("x1",t))],d=[s.parse(u.get("y0",t)),s.parse(u.get("y1",t))];fd(h),fd(d);var p=!(l[0]>h[1]||l[1]<h[0]||c[0]>d[1]||c[1]<d[0]);u.setItemLayout(t,{points:n,allClipped:!p});var f=u.getItemModel(t).getModel("itemStyle").getItemStyle(),g=kB(a,"color");!f.fill&&(f.fill=g,pY(f.fill)&&(f.fill=vg(f.fill,.4))),f.stroke||(f.stroke=g),u.setItemVisual(t,"style",f)}),u.diff(RQ(l).data).add(function(e){var t=u.getItemLayout(e);if(!t.allClipped){var n=new _c({shape:{points:t.points}});u.setItemGraphicEl(e,n),l.group.add(n)}}).update(function(e,n){var i=RQ(l).data.getItemGraphicEl(n),r=u.getItemLayout(e);r.allClipped?i&&l.group.remove(i):(i?xW(i,{shape:{points:r.points}},t,e):i=new _c({shape:{points:r.points}}),u.setItemGraphicEl(e,i),l.group.add(i))}).remove(function(e){var t=RQ(l).data.getItemGraphicEl(e);l.group.remove(t)}).execute(),u.eachItemGraphicEl(function(e,n){var i=u.getItemModel(n),r=u.getItemVisual(n,"style");e.useStyle(u.getItemVisual(n,"style")),xJ(e,x0(i),{labelFetcher:t,labelDataIndex:n,defaultText:u.getName(n)||"",inheritColor:pY(r.fill)?vg(r.fill,1):"#000"}),xL(e,i),xP(e,null,null,i.get(["emphasis","disabled"])),y6(e).dataModel=t}),RQ(l).data=u,l.group.silent=t.get("silent")||e.get("silent")},t.type="markArea",t}(RK),R6=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(RV),R8=_v.prototype,R9=_S.prototype,R7=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};function Le(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}gO(function(){return null!==k&&k.apply(this,arguments)||this},k=R7);var Lt=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-line",n}return gO(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new R7},t.prototype.buildPath=function(e,t){Le(t)?R8.buildPath.call(this,e,t):R9.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return Le(this.shape)?R8.pointAt.call(this,e):R9.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=Le(t)?[t.x2-t.x1,t.y2-t.y1]:R9.tangentAt.call(this,e);return mk(n,n)},t}(yO),Ln=["fromSymbol","toSymbol"];function Li(e){return"_"+e+"Type"}function Lr(e,t,n){var i=t.getItemVisual(n,e);if(!i||"none"===i)return i;var r=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=MJ(r),u=M0(a||0,l);return i+l+u+(o||"")+(s||"")}function Lo(e,t,n){var i=t.getItemVisual(n,e);if(i&&"none"!==i){var r=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=MJ(r),u=M0(a||0,l),c=MQ(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return c.__specifiedRotation=null==o||isNaN(o)?void 0:o*Math.PI/180||0,c.name=e,c}}function La(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var n=t[2];n?(e.cpx1=n[0],e.cpy1=n[1]):(e.cpx1=NaN,e.cpy1=NaN)}var Ls=function(e){function t(t,n,i){var r=e.call(this)||this;return r._createLine(t,n,i),r}return gO(t,e),t.prototype._createLine=function(e,t,n){var i,r,o=e.hostModel,a=(i=e.getItemLayout(t),La((r=new Lt({name:"line",subPixelOptimize:!0})).shape,i),r);a.shape.percent=0,xG(a,{shape:{percent:1}},o,t),this.add(a),pz(Ln,function(n){var i=Lo(n,e,t);this.add(i),this[Li(n)]=Lr(n,e,t)},this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var i=e.hostModel,r=this.childOfName("line"),o=e.getItemLayout(t),a={shape:{}};La(a.shape,o),xW(r,a,i,t),pz(Ln,function(n){var i=Lr(n,e,t),r=Li(n);if(this[r]!==i){this.remove(this.childOfName(n));var o=Lo(n,e,t);this.add(o)}this[r]=i},this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var i=e.hostModel,r=this.childOfName("line"),o=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,c=n&&n.focus,h=n&&n.blurScope;if(!n||e.hasItemOption){var d=e.getItemModel(t),p=d.getModel("emphasis");o=p.getModel("lineStyle").getLineStyle(),a=d.getModel(["blur","lineStyle"]).getLineStyle(),s=d.getModel(["select","lineStyle"]).getLineStyle(),u=p.get("disabled"),c=p.get("focus"),h=p.get("blurScope"),l=x0(d)}var f=e.getItemVisual(t,"style"),g=f.stroke;r.useStyle(f),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=o,r.ensureState("blur").style=a,r.ensureState("select").style=s,pz(Ln,function(e){var t=this.childOfName(e);if(t){t.setColor(g),t.style.opacity=f.opacity;for(var n=0;n<xn.length;n++){var i=xn[n],o=r.getState(i);if(o){var a=o.style||{},s=t.ensureState(i),l=s.style||(s.style={});null!=a.stroke&&(l[t.__isEmptyBrush?"stroke":"fill"]=a.stroke),null!=a.opacity&&(l.opacity=a.opacity)}}t.markRedraw()}},this);var m=i.getRawValue(t);xJ(this,l,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,n){return i.getFormattedLabel(t,n,e.dataType)}},inheritColor:g||"#000",defaultOpacity:f.opacity,defaultText:(null==m?e.getName(t):isFinite(m)?fh(m):m)+""});var v=this.getTextContent();if(v){var y=l.normal;v.__align=v.style.align,v.__verticalAlign=v.style.verticalAlign,v.__position=y.get("position")||"middle";var x=y.get("distance");pU(x)||(x=[x,x]),v.__labelDistance=x}this.setTextConfig({position:null,local:!0,inside:!1}),xP(this,c,h,u)},t.prototype.highlight=function(){x_(this)},t.prototype.downplay=function(){xM(this)},t.prototype.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName("line");La(t.shape,e),t.dirty()},t.prototype.beforeUpdate=function(){var e=this.childOfName("fromSymbol"),t=this.childOfName("toSymbol"),n=this.getTextContent();if(e||t||n&&!n.ignore){for(var i=1,r=this.parent;r;)r.scaleX&&(i/=r.scaleX),r=r.parent;var o=this.childOfName("line");if(this.__dirty||o.__dirty){var a=o.shape.percent,s=o.pointAt(0),l=o.pointAt(a),u=mC([],l,s);if(mk(u,u),e&&(e.setPosition(s),S(e,0),e.scaleX=e.scaleY=i*a,e.markRedraw()),t&&(t.setPosition(l),S(t,1),t.scaleX=t.scaleY=i*a,t.markRedraw()),n&&!n.ignore){n.x=n.y=0,n.originX=n.originY=0;var c=void 0,h=void 0,d=n.__labelDistance,p=d[0]*i,f=d[1]*i,g=a/2,m=o.tangentAt(g),v=[m[1],-m[0]],y=o.pointAt(g);v[1]>0&&(v[0]=-v[0],v[1]=-v[1]);var x=m[0]<0?-1:1;if("start"!==n.__position&&"end"!==n.__position){var b=-Math.atan2(m[1],m[0]);l[0]<s[0]&&(b=Math.PI+b),n.rotation=b}var w=void 0;switch(n.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":w=-f,h="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":w=f,h="top";break;default:w=0,h="middle"}switch(n.__position){case"end":n.x=u[0]*p+l[0],n.y=u[1]*f+l[1],c=u[0]>.8?"left":u[0]<-.8?"right":"center",h=u[1]>.8?"top":u[1]<-.8?"bottom":"middle";break;case"start":n.x=-u[0]*p+s[0],n.y=-u[1]*f+s[1],c=u[0]>.8?"right":u[0]<-.8?"left":"center",h=u[1]>.8?"bottom":u[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":n.x=p*x+s[0],n.y=s[1]+w,c=m[0]<0?"right":"left",n.originX=-p*x,n.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":n.x=y[0],n.y=y[1]+w,c="center",n.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":n.x=-p*x+l[0],n.y=l[1]+w,c=m[0]>=0?"right":"left",n.originX=p*x,n.originY=-w}n.scaleX=n.scaleY=i,n.setStyle({verticalAlign:n.__verticalAlign||h,align:n.__align||c})}}}function S(e,t){var n=e.__specifiedRotation;if(null==n){var i=o.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else e.attr("rotation",n)}},t}(SI),Ll=function(){function e(e){this.group=new SI,this._LineCtor=e||Ls}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this.group,i=this._lineData;this._lineData=e,i||n.removeAll();var r=Lu(e);e.diff(i).add(function(n){t._doAdd(e,n,r)}).update(function(n,o){t._doUpdate(i,e,o,n,r)}).remove(function(e){n.remove(i.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=Lu(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){function n(e){var t;e.isGroup||(t=e).animators&&t.animators.length>0||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=e.start;i<e.end;i++)if(Lh(t.getItemLayout(i))){var r=new this._LineCtor(t,i,this._seriesScope);r.traverse(n),this.group.add(r),t.setItemGraphicEl(i,r),this._progressiveEls.push(r)}},e.prototype.remove=function(){this.group.removeAll()},e.prototype.eachRendered=function(e){Me(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,n){if(Lh(e.getItemLayout(t))){var i=new this._LineCtor(e,t,n);e.setItemGraphicEl(t,i),this.group.add(i)}},e.prototype._doUpdate=function(e,t,n,i,r){var o=e.getItemGraphicEl(n);Lh(t.getItemLayout(i))?(o?o.updateData(t,i,r):o=new this._LineCtor(t,i,r),t.setItemGraphicEl(i,o),this.group.add(o)):this.group.remove(o)},e}();function Lu(e){var t=e.hostModel,n=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:x0(t)}}function Lc(e){return isNaN(e[0])||isNaN(e[1])}function Lh(e){return e&&!Lc(e[0])&&!Lc(e[1])}var Ld=fz(),Lp=function(e,t,n,i){var r,o=e.getData();if(pU(i))r=i;else{var a=i.type;if("min"===a||"max"===a||"average"===a||"median"===a||null!=i.xAxis||null!=i.yAxis){var s=void 0,l=void 0;if(null!=i.yAxis||null!=i.xAxis)s=t.getAxis(null!=i.yAxis?"y":"x"),l=p2(i.yAxis,i.xAxis);else{var u=RU(i,o,t,e);s=u.valueAxis;var c=gp(o,u.valueDataDim);l=RZ(o,c,a)}var h=+("x"!==s.dim),d=1-h,p=pP(i),f={coord:[]};p.type=null,p.coord=[],p.coord[d]=-1/0,f.coord[d]=1/0;var g=n.get("precision");g>=0&&pX(l)&&(l=+l.toFixed(Math.min(g,20))),p.coord[h]=f.coord[h]=l,r=[p,f,{type:a,valueIndex:i.valueIndex,value:l}]}else r=[]}var m=[R$(e,r[0]),R$(e,r[1]),pR({},r[2])];return m[2].type=m[2].type||null,pE(m[2],m[0]),pE(m[2],m[1]),m};function Lf(e){return!isNaN(e)&&!isFinite(e)}function Lg(e,t,n,i){var r=1-e,o=i.dimensions[e];return Lf(t[r])&&Lf(n[r])&&t[e]===n[e]&&i.getAxis(o).containData(t[e])}function Lm(e,t){if("cartesian2d"===e.type){var n=t[0].coord,i=t[1].coord;if(n&&i&&(Lg(1,n,i,e)||Lg(0,n,i,e)))return!0}return Rq(e,t[0])&&Rq(e,t[1])}function Lv(e,t,n,i,r){var o,a=i.coordinateSystem,s=e.getItemModel(t),l=fc(s.get("x"),r.getWidth()),u=fc(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)o=i.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=a.dimensions,h=e.get(c[0],t),d=e.get(c[1],t);o=a.dataToPoint([h,d])}if(Mb(a,"cartesian2d")){var p=a.getAxis("x"),f=a.getAxis("y"),c=a.dimensions;Lf(e.get(c[0],t))?o[0]=p.toGlobalCoord(p.getExtent()[+!n]):Lf(e.get(c[1],t))&&(o[1]=f.toGlobalCoord(f.getExtent()[+!n]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];e.setItemLayout(t,o)}var Ly=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=RV.getMarkerModelFromSeries(e,"markLine");if(t){var i=t.getData(),r=Ld(t).from,o=Ld(t).to;r.each(function(t){Lv(r,t,!0,e,n),Lv(o,t,!1,e,n)}),i.each(function(e){i.setItemLayout(e,[r.getItemLayout(e),o.getItemLayout(e)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},t.prototype.renderSeries=function(e,t,n,i){var r,o,a,s,l,u,c,h,d,p=e.coordinateSystem,f=e.id,g=e.getData(),m=this.markerGroupMap,v=m.get(f)||m.set(f,new Ll);this.group.add(v.group);var y=(r=p,o=e,a=t,l=new Sx(s=r?pV(r&&r.dimensions,function(e){return pR(pR({},o.getData().getDimensionInfo(o.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:"value",type:"float"}],a),u=new Sx(s,a),c=new Sx([],a),h=pV(a.get("data"),p$(Lp,o,r,a)),r&&(h=pH(h,p$(Lm,r))),d=RY(!!r,s),l.initData(pV(h,function(e){return e[0]}),null,d),u.initData(pV(h,function(e){return e[1]}),null,d),c.initData(pV(h,function(e){return e[2]})),c.hasItemOption=!0,{from:l,to:u,line:c}),x=y.from,b=y.to,w=y.line;Ld(t).from=x,Ld(t).to=b,t.setData(w);var S=t.get("symbol"),_=t.get("symbolSize"),M=t.get("symbolRotate"),C=t.get("symbolOffset");function A(t,n,r){var o=t.getItemModel(n);Lv(t,n,r,e,i);var a=o.getModel("itemStyle").getItemStyle();null==a.fill&&(a.fill=kB(g,"color")),t.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:p5(o.get("symbolOffset",!0),C[+!r]),symbolRotate:p5(o.get("symbolRotate",!0),M[+!r]),symbolSize:p5(o.get("symbolSize"),_[+!r]),symbol:p5(o.get("symbol",!0),S[+!r]),style:a})}pU(S)||(S=[S,S]),pU(_)||(_=[_,_]),pU(M)||(M=[M,M]),pU(C)||(C=[C,C]),y.from.each(function(e){A(x,e,!0),A(b,e,!1)}),w.each(function(e){var t=w.getItemModel(e).getModel("lineStyle").getLineStyle();w.setItemLayout(e,[x.getItemLayout(e),b.getItemLayout(e)]),null==t.stroke&&(t.stroke=x.getItemVisual(e,"style").fill),w.setItemVisual(e,{fromSymbolKeepAspect:x.getItemVisual(e,"symbolKeepAspect"),fromSymbolOffset:x.getItemVisual(e,"symbolOffset"),fromSymbolRotate:x.getItemVisual(e,"symbolRotate"),fromSymbolSize:x.getItemVisual(e,"symbolSize"),fromSymbol:x.getItemVisual(e,"symbol"),toSymbolKeepAspect:b.getItemVisual(e,"symbolKeepAspect"),toSymbolOffset:b.getItemVisual(e,"symbolOffset"),toSymbolRotate:b.getItemVisual(e,"symbolRotate"),toSymbolSize:b.getItemVisual(e,"symbolSize"),toSymbol:b.getItemVisual(e,"symbol"),style:t})}),v.updateData(w),y.line.eachItemGraphicEl(function(e){y6(e).dataModel=t,e.traverse(function(e){y6(e).dataModel=t})}),this.markKeep(v),v.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(RK),Lx=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markPoint",t.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},t}(RV);function Lb(e,t,n){var i=t.coordinateSystem;e.each(function(r){var o,a=e.getItemModel(r),s=fc(a.get("x"),n.getWidth()),l=fc(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)o=t.getMarkerPosition(e.getValues(e.dimensions,r));else if(i){var u=e.get(i.dimensions[0],r),c=e.get(i.dimensions[1],r);o=i.dataToPoint([u,c])}}else o=[s,l];isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),e.setItemLayout(r,o)})}var Lw=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return gO(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=RV.getMarkerModelFromSeries(e,"markPoint");t&&(Lb(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())},this)},t.prototype.renderSeries=function(e,t,n,i){var r,o,a,s,l,u,c,h=e.coordinateSystem,d=e.id,p=e.getData(),f=this.markerGroupMap,g=f.get(d)||f.set(d,new M8),m=(r=h,o=e,a=t,l=new Sx(s=r?pV(r&&r.dimensions,function(e){return pR(pR({},o.getData().getDimensionInfo(o.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:"value",type:"float"}],a),u=pV(a.get("data"),p$(R$,o)),r&&(u=pH(u,p$(Rq,r))),c=RY(!!r,s),l.initData(u,null,c),l);t.setData(m),Lb(t.getData(),e,i),m.each(function(e){var n=m.getItemModel(e),i=n.getShallow("symbol"),r=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),a=n.getShallow("symbolOffset"),s=n.getShallow("symbolKeepAspect");if(pq(i)||pq(r)||pq(o)||pq(a)){var l=t.getRawValue(e),u=t.getDataParams(e);pq(i)&&(i=i(l,u)),pq(r)&&(r=r(l,u)),pq(o)&&(o=o(l,u)),pq(a)&&(a=a(l,u))}var c=n.getModel("itemStyle").getItemStyle(),h=kB(p,"color");c.fill||(c.fill=h),m.setItemVisual(e,{symbol:i,symbolSize:r,symbolRotate:o,symbolOffset:a,symbolKeepAspect:s,style:c})}),g.updateData(m),this.group.add(g.group),m.eachItemGraphicEl(function(e){e.traverse(function(e){y6(e).dataModel=t})}),this.markKeep(g),g.group.silent=t.get("silent")||e.get("silent")},t.type="markPoint",t}(RK);function LS(e,t,n){var i=py.createCanvas(),r=t.getWidth(),o=t.getHeight(),a=i.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=r+"px",a.height=o+"px",i.setAttribute("data-zr-dom-id",e)),i.width=r*n,i.height=o*n,i}var L_=function(e){function t(t,n,i){var r,o=e.call(this)||this;o.motionBlur=!1,o.lastFrameAlpha=.7,o.dpr=1,o.virtual=!1,o.config={},o.incremental=!1,o.zlevel=0,o.maxRepaintRectCount=5,o.__dirty=!0,o.__firstTimePaint=!0,o.__used=!1,o.__drawIndex=0,o.__startIndex=0,o.__endIndex=0,o.__prevStartIndex=null,o.__prevEndIndex=null,i=i||vE,"string"==typeof t?r=LS(t,n,i):pK(t)&&(t=(r=t).id),o.id=t,o.dom=r;var a=r.style;return a&&(fo(r),r.onselectstart=function(){return!1},a.padding="0",a.margin="0",a.borderWidth="0"),o.painter=n,o.dpr=i,o}return g$(t,e),t.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},t.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},t.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},t.prototype.setUnpainted=function(){this.__firstTimePaint=!0},t.prototype.createBackBuffer=function(){var e=this.dpr;this.domBack=LS("back-"+this.id,this.painter,e),this.ctxBack=this.domBack.getContext("2d"),1!==e&&this.ctxBack.scale(e,e)},t.prototype.createRepaintRects=function(e,t,n,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var r,o=[],a=this.maxRepaintRectCount,s=!1,l=new mr(0,0,0,0);function u(e){if(!(!e.isFinite()||e.isZero()))if(0===o.length){var t=new mr(0,0,0,0);t.copy(e),o.push(t)}else{for(var n=!1,i=1/0,r=0,u=0;u<o.length;++u){var c=o[u];if(c.intersect(e)){var h=new mr(0,0,0,0);h.copy(c),h.union(e),o[u]=h,n=!0;break}if(s){l.copy(e),l.union(c);var d=e.width*e.height,p=c.width*c.height,f=l.width*l.height-d-p;f<i&&(i=f,r=u)}}if(s&&(o[r].union(e),n=!0),!n){var t=new mr(0,0,0,0);t.copy(e),o.push(t)}s||(s=o.length>=a)}}for(var c=this.__startIndex;c<this.__endIndex;++c){var h=e[c];if(h){var d=h.shouldBePainted(n,i,!0,!0),p=h.__isRendered&&(1&h.__dirty||!d)?h.getPrevPaintRect():null;p&&u(p);var f=d&&(1&h.__dirty||!h.__isRendered)?h.getPaintRect():null;f&&u(f)}}for(var c=this.__prevStartIndex;c<this.__prevEndIndex;++c){var h=t[c],d=h&&h.shouldBePainted(n,i,!0,!0);if(h&&(!d||!h.__zr)&&h.__isRendered){var p=h.getPrevPaintRect();p&&u(p)}}do{r=!1;for(var c=0;c<o.length;){if(o[c].isZero()){o.splice(c,1);continue}for(var g=c+1;g<o.length;)o[c].intersect(o[g])?(r=!0,o[c].union(o[g]),o.splice(g,1)):g++;c++}}while(r);return this._paintRects=o,o},t.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},t.prototype.resize=function(e,t){var n=this.dpr,i=this.dom,r=i.style,o=this.domBack;r&&(r.width=e+"px",r.height=t+"px"),i.width=e*n,i.height=t*n,o&&(o.width=e*n,o.height=t*n,1!==n&&this.ctxBack.scale(n,n))},t.prototype.clear=function(e,t,n){var i=this.dom,r=this.ctx,o=i.width,a=i.height;t=t||this.clearColor;var s=this.motionBlur&&!e,l=this.lastFrameAlpha,u=this.dpr,c=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(i,0,0,o/u,a/u));var h=this.domBack;function d(e,n,i,o){if(r.clearRect(e,n,i,o),t&&"transparent"!==t){var a=void 0;p1(t)?(a=(t.global||t.__width===i&&t.__height===o)&&t.__canvasGradient||kW(r,t,{x:0,y:0,width:i,height:o}),t.__canvasGradient=a,t.__width=i,t.__height=o):null!=t.image&&(t.scaleX=t.scaleX||u,t.scaleY=t.scaleY||u,a=kJ(r,t,{dirty:function(){c.setUnpainted(),c.painter.refresh()}})),r.save(),r.fillStyle=a||t,r.fillRect(e,n,i,o),r.restore()}s&&(r.save(),r.globalAlpha=l,r.drawImage(h,e,n,i,o),r.restore())}!n||s?d(0,0,o,a):n.length&&pz(n,function(e){d(e.x*u,e.y*u,e.width*u,e.height*u)})},t}(vO),LM=function(){function e(e,t,n,i){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var r=!e.nodeName||"CANVAS"===e.nodeName.toUpperCase();this._opts=n=pR({},n||{}),this.dpr=n.devicePixelRatio||vE,this._singleCanvas=r,this.root=e,e.style&&(fo(e),e.innerHTML=""),this.storage=t;var o=this._zlevelList;this._prevDisplayList=[];var a=this._layers;if(r){var s=e.width,l=e.height;null!=n.width&&(s=n.width),null!=n.height&&(l=n.height),this.dpr=n.devicePixelRatio||1,e.width=s*this.dpr,e.height=l*this.dpr,this._width=s,this._height=l;var u=new L_(e,this,this.dpr);u.__builtin__=!0,u.initContext(),a[314159]=u,u.zlevel=314159,o.push(314159),this._domRoot=e}else{this._width=k$(e,0,n),this._height=k$(e,1,n);var c,h,d,p=this._domRoot=(c=this._width,h=this._height,(d=document.createElement("div")).style.cssText=["position:relative","width:"+c+"px","height:"+h+"px","padding:0;margin:0;border-width:0"].join(";")+";",d);e.appendChild(p)}}return e.prototype.getType=function(){return"canvas"},e.prototype.isSingleCanvas=function(){return this._singleCanvas},e.prototype.getViewportRoot=function(){return this._domRoot},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.refresh=function(e){var t=this.storage.getDisplayList(!0),n=this._prevDisplayList,i=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,n,e,this._redrawId);for(var r=0;r<i.length;r++){var o=i[r],a=this._layers[o];if(!a.__builtin__&&a.refresh){var s=0===r?this._backgroundColor:null;a.refresh(s)}}return this._opts.useDirtyRect&&(this._prevDisplayList=t.slice()),this},e.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},e.prototype._paintHoverList=function(e){var t,n=e.length,i=this._hoverlayer;if(i&&i.clear(),n){for(var r={inHover:!0,viewWidth:this._width,viewHeight:this._height},o=0;o<n;o++){var a=e[o];a.__inHover&&(i||(i=this._hoverlayer=this.getLayer(1e5)),t||(t=i.ctx).save(),k9(t,a,r,o===n-1))}t&&t.restore()}},e.prototype.getHoverLayer=function(){return this.getLayer(1e5)},e.prototype.paintOne=function(e,t){k8(e,t)},e.prototype._paintList=function(e,t,n,i){if(this._redrawId===i){n=n||!1,this._updateLayerStatus(e);var r=this._doPaintList(e,t,n),o=r.finished,a=r.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),a&&this._paintHoverList(e),o)this.eachLayer(function(e){e.afterBrush&&e.afterBrush()});else{var s=this;Y(function(){s._paintList(e,t,n,i)})}}},e.prototype._compositeManually=function(){var e=this.getLayer(314159).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),this.eachBuiltinLayer(function(i){i.virtual&&e.drawImage(i.dom,0,0,t,n)})},e.prototype._doPaintList=function(e,t,n){for(var i=this,r=[],o=this._opts.useDirtyRect,a=0;a<this._zlevelList.length;a++){var s=this._zlevelList[a],l=this._layers[s];l.__builtin__&&l!==this._hoverlayer&&(l.__dirty||n)&&r.push(l)}for(var u=!0,c=!1,h=this,d=0;d<r.length;d++)!function(a){var s,l=r[a],d=l.ctx,p=o&&l.createRepaintRects(e,t,h._width,h._height),f=n?l.__startIndex:l.__drawIndex,g=!n&&l.incremental&&Date.now,m=g&&Date.now(),v=l.zlevel===h._zlevelList[0]?h._backgroundColor:null;if(l.__startIndex===l.__endIndex)l.clear(!1,v,p);else if(f===l.__startIndex){var y=e[f];y.incremental&&y.notClear&&!n||l.clear(!1,v,p)}-1===f&&(console.error("For some unknown reason. drawIndex is -1"),f=l.__startIndex);var x=function(t){var n={inHover:!1,allClipped:!1,prevEl:null,viewWidth:i._width,viewHeight:i._height};for(s=f;s<l.__endIndex;s++){var r=e[s];if(r.__inHover&&(c=!0),i._doPaintEl(r,l,o,t,n,s===l.__endIndex-1),g&&Date.now()-m>15)break}n.prevElClipPaths&&d.restore()};if(p)if(0===p.length)s=l.__endIndex;else for(var b=h.dpr,w=0;w<p.length;++w){var S=p[w];d.save(),d.beginPath(),d.rect(S.x*b,S.y*b,S.width*b,S.height*b),d.clip(),x(S),d.restore()}else d.save(),x(),d.restore();l.__drawIndex=s,l.__drawIndex<l.__endIndex&&(u=!1)}(d);return fA.wxa&&pz(this._layers,function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()}),{finished:u,needsRefreshHover:c}},e.prototype._doPaintEl=function(e,t,n,i,r,o){var a=t.ctx;if(n){var s=e.getPaintRect();(!i||s&&s.intersect(i))&&(k9(a,e,r,o),e.setPrevPaintRect(s))}else k9(a,e,r,o)},e.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=314159);var n=this._layers[e];return n||((n=new L_("zr_"+e,this,this.dpr)).zlevel=e,n.__builtin__=!0,this._layerConfig[e]?pE(n,this._layerConfig[e],!0):this._layerConfig[e-.01]&&pE(n,this._layerConfig[e-.01],!0),t&&(n.virtual=t),this.insertLayer(e,n),n.initContext()),n},e.prototype.insertLayer=function(e,t){var n=this._layers,i=this._zlevelList,r=i.length,o=this._domRoot,a=null,s=-1;if(!n[e]){if(t&&(t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh&&1)){if(r>0&&e>i[0]){for(s=0;s<r-1&&(!(i[s]<e)||!(i[s+1]>e));s++);a=n[i[s]]}if(i.splice(s+1,0,e),n[e]=t,!t.virtual)if(a){var l=a.dom;l.nextSibling?o.insertBefore(t.dom,l.nextSibling):o.appendChild(t.dom)}else o.firstChild?o.insertBefore(t.dom,o.firstChild):o.appendChild(t.dom);t.painter||(t.painter=this)}}},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,i=0;i<n.length;i++){var r=n[i];e.call(t,this._layers[r],r)}},e.prototype.eachBuiltinLayer=function(e,t){for(var n=this._zlevelList,i=0;i<n.length;i++){var r=n[i],o=this._layers[r];o.__builtin__&&e.call(t,o,r)}},e.prototype.eachOtherLayer=function(e,t){for(var n=this._zlevelList,i=0;i<n.length;i++){var r=n[i],o=this._layers[r];o.__builtin__||e.call(t,o,r)}},e.prototype.getLayers=function(){return this._layers},e.prototype._updateLayerStatus=function(e){function t(e){a&&(a.__endIndex!==e&&(a.__dirty=!0),a.__endIndex=e)}if(this.eachBuiltinLayer(function(e,t){e.__dirty=e.__used=!1}),this._singleCanvas)for(var n,i,r=1;r<e.length;r++){var o=e[r];if(o.zlevel!==e[r-1].zlevel||o.incremental){this._needsManuallyCompositing=!0;break}}var a=null,s=0;for(i=0;i<e.length;i++){var o=e[i],l=o.zlevel,u=void 0;n!==l&&(n=l,s=0),o.incremental?((u=this.getLayer(l+.001,this._needsManuallyCompositing)).incremental=!0,s=1):u=this.getLayer(l+.01*(s>0),this._needsManuallyCompositing),u.__builtin__||pO("ZLevel "+l+" has been used by unkown layer "+u.id),u!==a&&(u.__used=!0,u.__startIndex!==i&&(u.__dirty=!0),u.__startIndex=i,u.incremental?u.__drawIndex=-1:u.__drawIndex=i,t(i),a=u),1&o.__dirty&&!o.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=i))}t(i),this.eachBuiltinLayer(function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)})},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(e){e.clear()},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,pz(this._layers,function(e){e.setUnpainted()})},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?pE(n[e],t,!0):n[e]=t;for(var i=0;i<this._zlevelList.length;i++){var r=this._zlevelList[i];(r===e||r===e+.01)&&pE(this._layers[r],n[e],!0)}}},e.prototype.delLayer=function(e){var t=this._layers,n=this._zlevelList,i=t[e];i&&(i.dom.parentNode.removeChild(i.dom),delete t[e],n.splice(pN(n,e),1))},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var i=this._opts,r=this.root;if(null!=e&&(i.width=e),null!=t&&(i.height=t),e=k$(r,0,i),t=k$(r,1,i),n.style.display="",this._width!==e||t!==this._height){for(var o in n.style.width=e+"px",n.style.height=t+"px",this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,t);this.refresh(!0)}this._width=e,this._height=t}else{if(null==e||null==t)return;this._width=e,this._height=t,this.getLayer(314159).resize(e,t)}return this},e.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},e.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},e.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[314159].dom;var t=new L_("image",this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var n=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var i=t.dom.width,r=t.dom.height;this.eachLayer(function(e){e.__builtin__?n.drawImage(e.dom,0,0,i,r):e.renderToCanvas&&(n.save(),e.renderToCanvas(n),n.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},a=this.storage.getDisplayList(!0),s=0,l=a.length;s<l;s++)k9(n,a[s],o,s===l-1);return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e}();TV([function(e){e.registerComponentModel(Oi),e.registerComponentView(Or)},function(e){TV(OL),TV(OW)},function(e){TV(OJ),TV(O4)},function(e){e.registerChartView(MT),e.registerSeriesModel(ST),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,p$(gM,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,{seriesType:"bar",plan:gf(),reset:function(e){if(gC(e)){var t,n=e.getData(),i=e.coordinateSystem,r=i.getBaseAxis(),o=i.getOtherAxis(r),a=n.getDimensionIndex(n.mapDimension(o.dim)),s=n.getDimensionIndex(n.mapDimension(r.dim)),l=e.get("showBackground",!0),u=n.mapDimension(o.dim),c=n.getCalculationInfo("stackResultDimension"),h=gd(n,u)&&!!n.getCalculationInfo("stackedOnSeries"),d=o.isHorizontal(),p=(t=o).toGlobalCoord(t.dataToCoord(+("log"===t.type))),f=gA(e),g=e.get("barMinHeight")||0,m=c&&n.getDimensionIndex(c),v=n.getLayout("size"),y=n.getLayout("offset");return{progress:function(e,t){for(var n,r=e.count,o=f&&gv(3*r),u=f&&l&&gv(3*r),c=f&&gv(r),x=i.master.getRect(),b=d?x.width:x.height,w=t.getStore(),S=0;null!=(n=e.next());){var _=w.get(h?m:a,n),M=w.get(s,n),C=p,A=void 0;h&&(A=_-w.get(a,n));var k=void 0,T=void 0,D=void 0,I=void 0;if(d){var O=i.dataToPoint([_,M]);if(h){var P=i.dataToPoint([A,M]);C=P[0]}k=C,T=O[1]+y,D=O[0]-C,I=v,Math.abs(D)<g&&(D=(D<0?-1:1)*g)}else{var O=i.dataToPoint([M,_]);if(h){var P=i.dataToPoint([M,A]);C=P[1]}k=O[0]+y,T=C,D=v,Math.abs(I=O[1]-C)<g&&(I=(I<=0?-1:1)*g)}f?(o[S]=k,o[S+1]=T,o[S+2]=d?D:I,u&&(u[S]=d?x.x:k,u[S+1]=d?T:x.y,u[S+2]=b),c[n]=n):t.setItemLayout(n,{x:k,y:T,width:D,height:I}),S+=3}f&&t.setLayout({largePoints:o,largeDataIndices:c,largeBackgroundPoints:u,valueAxisHorizontal:d})}}}}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,gD("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)})})},function(e){e.registerChartView(Cm),e.registerSeriesModel(M1),e.registerLayout(Cv("line",!0)),e.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,gD("line"))},function(e){e.registerChartView(Cw),e.registerSeriesModel(C_)},function(e){var t;e.registerChartView(C$),e.registerSeriesModel(CY),t=e.registerAction,pz([["pieToggleSelect","toggleSelect"],["pieSelect","select"],["pieUnSelect","unselect"]],function(e){t(e[0],function(t,n,i){var r,o;t=pR({},t),i.dispatchAction(pR(t,{type:e[1],seriesIndex:(r=t,o=[],n.eachComponent({mainType:"series",subType:"pie",query:r},function(e){o.push(e.seriesIndex)}),o)}))})}),e.registerLayout(p$(CD,"pie")),e.registerProcessor({seriesType:"pie",reset:function(e,t){var n=t.findComponents({mainType:"legend"});if(n&&n.length){var i=e.getData();i.filterSelf(function(e){for(var t=i.getName(e),r=0;r<n.length;r++)if(!n[r].isSelected(t))return!1;return!0})}}}),e.registerProcessor({seriesType:"pie",reset:function(e,t){var n=e.getData();n.filterSelf(function(e){var t=n.mapDimension("value"),i=n.get(t,e);return!pX(i)||!!isNaN(i)||!(i<0)})}})},function(e){TV(Ic),e.registerSeriesModel(Tj),e.registerChartView(T$),e.registerLayout(Cv("scatter"))},function(e){e.registerChartView(IY),e.registerSeriesModel(If)},function(e){e.registerChartView(Ot),e.registerSeriesModel(On)},function(e){TV(Ic),TV(PS)},function(e){e.registerComponentModel(P_),e.registerComponentView(PM)},function(e){e.registerComponentModel(PI),e.registerComponentView(PO),PD.saveAsImage=PP,PD.magicType=PL,PD.dataView=PV,PD.dataZoom=ER,PD.restore=PW,TV(Pk)},function(e){TV(PS),e.registerComponentModel(EB),e.registerComponentView(EJ),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},fs),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},fs)},function(e){e.registerPainter("canvas",LM)},function(e){TV(RO),TV(RN)},function(e){e.registerComponentModel(Rj),e.registerComponentView(R4),e.registerPreprocessor(function(e){RB(e.series,"markArea")&&(e.markArea=e.markArea||{})})},function(e){e.registerComponentModel(R6),e.registerComponentView(Ly),e.registerPreprocessor(function(e){RB(e.series,"markLine")&&(e.markLine=e.markLine||{})})},function(e){e.registerComponentModel(Lx),e.registerComponentView(Lw),e.registerPreprocessor(function(e){RB(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}]);let LC=["click","dblclick","mousedown","mousemove","mouseup","mouseover","mouseout","globalout","contextmenu"],LA=["datazoom","downplay","highlight"],Lk=(0,eD.memo)(function({option:e,theme:t,renderer:n,sx:i,style:r,onEvents:o,_instance:a,syncGroup:s,onChartInitialized:l}){let u=(0,eD.useRef)(e),c=(0,eD.useRef)(e),h=(0,eD.useRef)(null),d=(0,eD.useRef)(null);return(0,eD.useLayoutEffect)(()=>{if(null!==h.current&&null===d.current&&(d.current=function(e,t,n){var i=!(n&&n.ssr);if(i){var r=function(e){return TA[e.getAttribute?e.getAttribute(TI):e[TI]]}(e);if(r)return r}var o=new Tm(e,t,n);return o.id="ec_"+TT++,TA[o.id]=o,i&&fU(e,TI,o.id),ef(o),Tr.trigger("afterinit",o),o}(h.current,t,{renderer:n??"canvas"}),void 0!==d.current))return d.current.setOption(u.current,!0),l?.(d.current),void 0!==a&&(a.current=d.current),()=>{null!==d.current&&(d.current.dispose(),d.current=null)}},[a,l,t,n]),(0,eD.useEffect)(()=>{d.current&&s&&(d.current.group=s,function(e){if(pU(e)){var t=e;e=null,pz(t,function(t){null!=t.group&&(e=t.group)}),e=e||"g_"+TD++,pz(t,function(t){t.group=e})}Tk[e]=!0}([d.current]))},[s,d]),(0,eD.useEffect)(()=>{void 0===c.current||r5(c.current,e)||d.current&&(d.current.setOption(e,!0),c.current=e)},[e]),(0,eD.useLayoutEffect)(()=>{let e=hS(()=>{d.current&&d.current.resize()},200);return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[]),(0,eD.useEffect)(()=>{let e=d.current;if(e&&void 0!==o)return function(e,t){if(void 0!==t){for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n]??null;i&&function(t,n){var i,r;"function"==typeof n&&((i=t,LC.includes(i))?e.on(t,t=>n(t,e)):(r=t,LA.includes(r))?e.on(t,e=>n(e)):e.on(t,()=>n(null,e)))}(n,i)}}}(e,o),()=>{if(void 0!==e&&!0!==e.isDisposed())for(let t in o)e.off(t)}},[o]),(0,eD.useEffect)(()=>{hS(()=>{d.current&&d.current.resize()},200,{leading:!0})()},[i,r]),(0,eb.jsx)(uo.A,{ref:h,sx:i,style:r})});var LT=n(17157);function LD(e,t){return function(n){let i=new Date(Number(n));return e>15768e7?(0,LT.formatWithTimeZone)(i,"yyyy",t):e>15552e6?(0,LT.formatWithTimeZone)(i,"MMM yyyy",t):e>864e6?(0,LT.formatWithTimeZone)(i,"dd.MM",t):e>1728e5?(0,LT.formatWithTimeZone)(i,"dd.MM HH:mm",t):(0,LT.formatWithTimeZone)(i,"HH:mm",t)}}var LI=n(34007);function LO(e){let{error:t}=e;return(0,eb.jsx)(LI.A,{severity:"error",children:t.message})}var LP=n(77440);let LE=[{id:"default",label:"Default",value:void 0},{id:"12",label:"12",value:12},{id:"14",label:"14",value:14},{id:"16",label:"16",value:16},{id:"20",label:"20",value:20},{id:"24",label:"24",value:24},{id:"28",label:"28",value:28},{id:"32",label:"32",value:32},{id:"36",label:"36",value:36},{id:"40",label:"40",value:40},{id:"48",label:"48",value:48},{id:"56",label:"56",value:56},{id:"64",label:"64",value:64},{id:"72",label:"72",value:72},{id:"96",label:"96",value:96},{id:"128",label:"128",value:128},{id:"160",label:"160",value:160},{id:"192",label:"192",value:192}];function LR({value:e,onChange:t}){return(0,eb.jsx)(h2,{label:"Font Size",control:(0,eb.jsx)(h8,{value:LE.find(t=>t.value===e),options:LE,getOptionLabel:e=>e.label,onChange:(e,{value:n})=>{t(n)},disableClearable:!0})})}function LL({action:e,submitText:t="Save",cancelText:n="Cancel",isReadonly:i,isValid:r,onActionChange:o,onSubmit:a,onDelete:s,onCancel:l,...u}){return(0,eb.jsx)(eM.A,{direction:"row",gap:1,sx:{marginLeft:"auto"},...u,children:"read"===e?(0,eb.jsxs)(eb.Fragment,{children:[o&&(0,eb.jsx)(eS.A,{disabled:i,variant:"contained",onClick:()=>o("update"),children:"Edit"}),s&&(0,eb.jsx)(eS.A,{color:"error",disabled:i,variant:"outlined",onClick:s,children:"Delete"}),l&&(a||s)&&(0,eb.jsx)(hh.A,{orientation:"vertical",flexItem:!0,sx:{borderColor:e=>e.palette.grey["500"],"&.MuiDivider-root":{marginLeft:2,marginRight:1}}}),l&&(0,eb.jsx)(eS.A,{color:"secondary",variant:"outlined",onClick:l,children:n})]}):(0,eb.jsxs)(eb.Fragment,{children:[a&&(0,eb.jsx)(eS.A,{variant:"contained",disabled:!r,onClick:a,children:t}),l&&(0,eb.jsx)(eS.A,{color:"secondary",variant:"outlined",onClick:l,children:n})]})})}let LN=0;class LB{constructor(e,t){this.from=e,this.to=t}}class LF{constructor(e={}){this.id=LN++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=Lj.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}LF.closedBy=new LF({deserialize:e=>e.split(" ")}),LF.openedBy=new LF({deserialize:e=>e.split(" ")}),LF.group=new LF({deserialize:e=>e.split(" ")}),LF.isolate=new LF({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw RangeError("Invalid value for isolate: "+e);return e||"auto"}}),LF.contextHash=new LF({perNode:!0}),LF.lookAhead=new LF({perNode:!0}),LF.mounted=new LF({perNode:!0});class Lz{constructor(e,t,n,i=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=i}static get(e){return e&&e.props&&e.props[LF.mounted.id]}}let LV=Object.create(null);class Lj{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):LV,n=!!e.top|2*!!e.skipped|4*!!e.error|8*(null==e.name),i=new Lj(e.name||"",t,e.id,n);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(i)),n){if(n[0].perNode)throw RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(LF.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return e=>{for(let n=e.prop(LF.group),i=-1;i<(n?n.length:0);i++){let r=t[i<0?e.name:n[i]];if(r)return r}}}}Lj.none=new Lj("",Object.create(null),0,8);class LH{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let i=null;for(let t of e){let e=t(n);if(e){i||(i=Object.assign({},n.props));let t=e[1],r=e[0];r.combine&&r.id in i&&(t=r.combine(i[r.id],t)),i[r.id]=t}}t.push(i?new Lj(n.name,i,n.id,n.flags):n)}return new LH(t)}}let LW=new WeakMap,LG=new WeakMap;(T=ev||(ev={}))[T.ExcludeBuffers=1]="ExcludeBuffers",T[T.IncludeAnonymous=2]="IncludeAnonymous",T[T.IgnoreMounts=4]="IgnoreMounts",T[T.IgnoreOverlays=8]="IgnoreOverlays",T[T.EnterBracketed=16]="EnterBracketed";class L${constructor(e,t,n,i,r){if(this.type=e,this.children=t,this.positions=n,this.length=i,this.props=null,r&&r.length)for(let[e,t]of(this.props=Object.create(null),r))this.props["number"==typeof e?e:e.id]=t}toString(){let e=Lz.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new L3(this.topNode,e)}cursorAt(e,t=0,n=0){let i=new L3(LW.get(this)||this.topNode);return i.moveTo(e,t),LW.set(this,i._tree),i}get topNode(){return new LK(this,0,0,null)}resolve(e,t=0){let n=LZ(LW.get(this)||this.topNode,e,t,!1);return LW.set(this,n),n}resolveInner(e,t=0){let n=LZ(LG.get(this)||this.topNode,e,t,!0);return LG.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let i=e.resolveInner(t,n),r=null;for(let e=i instanceof LK?i:i.context.parent;e;e=e.parent)if(e.index<0){let o=e.parent;(r||(r=[i])).push(o.resolve(t,n)),e=o}else{let o=Lz.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let a=new LK(o.tree,o.overlay[0].from+e.from,-1,e);(r||(r=[i])).push(LZ(a,t,n,!1))}}return r?L2(r):i}(this,e,t)}iterate(e){let{enter:t,leave:n,from:i=0,to:r=this.length}=e,o=e.mode||0,a=(o&ev.IncludeAnonymous)>0;for(let e=this.cursor(o|ev.IncludeAnonymous);;){let o=!1;if(e.from<=r&&e.to>=i&&(!a&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;o=!0}for(;o&&n&&(a||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;o=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:L9(Lj.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new L$(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new L$(Lj.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=1024,reused:o=[],minRepeatType:a=i.types.length}=e,s=Array.isArray(n)?new LU(n,n.length):n,l=i.types,u=0,c=0;function h(e,t,n,r,o,a,s,l,u){let c=[],h=[];for(;e.length>r;)c.push(e.pop()),h.push(t.pop()+n-o);e.push(d(i.types[s],c,h,a-o,l-a,u)),t.push(o-n)}function d(e,t,n,i,r,o,a){if(o){let e=[LF.contextHash,o];a=a?[e].concat(a):[e]}if(r>25){let e=[LF.lookAhead,r];a=a?[e].concat(a):[e]}return new L$(e,t,n,i,a)}let p=[],f=[];for(;s.pos>0;)!function e(t,n,p,f,g,m){let{id:v,start:y,end:x,size:b}=s,w=c,S=u;if(b<0){if(s.next(),-1==b){let e=o[v];p.push(e),f.push(y-t);return}if(-3==b){u=v;return}if(-4==b){c=v;return}else throw RangeError(`Unrecognized record size: ${b}`)}let _=l[v],M,C,A=y-t;if(x-y<=r&&(C=function(e,t){let n=s.fork(),i=0,o=0,l=0,u=n.end-r,c={size:0,start:0,skip:0};i:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){c.size=i,c.start=o,c.skip=l,l+=4,i+=4,n.next();continue}let s=n.pos-e;if(e<0||s<r||n.start<u)break;let h=4*(n.id>=a),d=n.start;for(n.next();n.pos>s;){if(n.size<0)if(-3==n.size||-4==n.size)h+=4;else break i;else n.id>=a&&(h+=4);n.next()}o=d,i+=e,l+=h}return(t<0||i==e)&&(c.size=i,c.start=o,c.skip=l),c.size>4?c:void 0}(s.pos-n,g))){let e=new Uint16Array(C.size-C.skip),n=s.pos-C.size,r=e.length;for(;s.pos>n;)r=function e(t,n,i){let{id:r,start:o,end:l,size:h}=s;if(s.next(),h>=0&&r<a){let a=i;if(h>4){let r=s.pos-(h-4);for(;s.pos>r;)i=e(t,n,i)}n[--i]=a,n[--i]=l-t,n[--i]=o-t,n[--i]=r}else -3==h?u=r:-4==h&&(c=r);return i}(C.start,e,r);M=new Lq(e,x-C.start,i),A=C.start-t}else{let t=s.pos-b;s.next();let n=[],o=[],l=v>=a?v:-1,u=0,c=x;for(;s.pos>t;)l>=0&&s.id==l&&s.size>=0?(s.end<=c-r&&(h(n,o,y,u,s.end,c,l,w,S),u=n.length,c=s.end),s.next()):m>2500?function(e,t,n,o){let a=[],l=0,u=-1;for(;s.pos>t;){let{id:e,start:t,end:n,size:i}=s;if(i>4)s.next();else if(u>-1&&t<u)break;else u<0&&(u=n-r),a.push(e,t,n),l++,s.next()}if(l){let t=new Uint16Array(4*l),r=a[a.length-2];for(let e=a.length-3,n=0;e>=0;e-=3)t[n++]=a[e],t[n++]=a[e+1]-r,t[n++]=a[e+2]-r,t[n++]=n;n.push(new Lq(t,a[2]-r,i)),o.push(r-e)}}(y,t,n,o):e(y,t,n,o,l,m+1);if(l>=0&&u>0&&u<n.length&&h(n,o,y,u,y,c,l,w,S),n.reverse(),o.reverse(),l>-1&&u>0){let e=function(e,t){return(n,i,r)=>{let o=0,a=n.length-1,s,l;if(a>=0&&(s=n[a])instanceof L$){if(!a&&s.type==e&&s.length==r)return s;(l=s.prop(LF.lookAhead))&&(o=i[a]+s.length+l)}return d(e,n,i,r,o,t)}}(_,S);M=L9(_,n,o,0,n.length,0,x-y,e,e)}else M=d(_,n,o,x-y,w-x,S)}p.push(M),f.push(A)}(e.start||0,e.bufferStart||0,p,f,-1,0);let g=null!=(t=e.length)?t:p.length?f[0]+p[0].length:0;return new L$(l[e.topID],p.reverse(),f.reverse(),g)}(e)}}L$.empty=new L$(Lj.none,[],[],0);class LU{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new LU(this.buffer,this.index)}}class Lq{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Lj.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],i=this.set.types[t],r=i.name;if(/\W/.test(r)&&!i.isError&&(r=JSON.stringify(r)),n==(e+=4))return r;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return r+"("+o.join(",")+")"}findChild(e,t,n,i,r){let{buffer:o}=this,a=-1;for(let s=e;s!=t&&(!LY(r,i,o[s+1],o[s+2])||(a=s,!(n>0)));s=o[s+3]);return a}slice(e,t,n){let i=this.buffer,r=new Uint16Array(t-e),o=0;for(let a=e,s=0;a<t;){r[s++]=i[a++],r[s++]=i[a++]-n;let t=r[s++]=i[a++]-n;r[s++]=i[a++]-e,o=Math.max(o,t)}return new Lq(r,o,this.set)}}function LY(e,t,n,i){switch(e){case -2:return n<t;case -1:return i>=t&&n<t;case 0:return n<t&&i>t;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function LZ(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!i&&e instanceof LK&&e.index<0?null:e.parent;if(!t)return e;e=t}let o=i?0:ev.IgnoreOverlays;if(i)for(let i=e,a=i.parent;a;a=(i=a).parent)i instanceof LK&&i.index<0&&(null==(r=a.enter(t,n,o))?void 0:r.from)!=i.from&&(e=a);for(;;){let i=e.enter(t,n,o);if(!i)return e;e=i}}class LX{cursor(e=0){return new L3(this,e)}getChild(e,t=null,n=null){let i=LQ(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return LQ(this,e,t,n)}resolve(e,t=0){return LZ(this,e,t,!1)}resolveInner(e,t=0){return LZ(this,e,t,!0)}matchContext(e){return LJ(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class LK extends LX{constructor(e,t,n,i){super(),this._tree=e,this.from=t,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,i,r=0){for(let o=this;;){for(let{children:a,positions:s}=o._tree,l=t>0?a.length:-1;e!=l;e+=t){let l=a[e],u=s[e]+o.from,c;if(r&ev.EnterBracketed&&l instanceof L$&&(c=Lz.get(l))&&!c.overlay&&c.bracketed&&n>=u&&n<=u+l.length||LY(i,n,u,u+l.length)){if(l instanceof Lq){if(r&ev.ExcludeBuffers)continue;let a=l.findChild(0,l.buffer.length,t,n-u,i);if(a>-1)return new L1(new L0(o,l,e,u),null,a)}else if(r&ev.IncludeAnonymous||!l.type.isAnonymous||L4(l)){let a;if(!(r&ev.IgnoreMounts)&&(a=Lz.get(l))&&!a.overlay)return new LK(a.tree,u,e,o);let s=new LK(l,u,e,o);return r&ev.IncludeAnonymous||!s.type.isAnonymous?s:s.nextChild(t<0?l.children.length-1:0,t,n,i,r)}}}if(r&ev.IncludeAnonymous||!o.type.isAnonymous||(e=o.index>=0?o.index+t:t<0?-1:o._parent._tree.children.length,!(o=o._parent)))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let i;if(!(n&ev.IgnoreOverlays)&&(i=Lz.get(this._tree))&&i.overlay){let r=e-this.from,o=n&ev.EnterBracketed&&i.bracketed;for(let{from:e,to:n}of i.overlay)if((t>0||o?e<=r:e<r)&&(t<0||o?n>=r:n>r))return new LK(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function LQ(e,t,n,i){let r=e.cursor(),o=[];if(!r.firstChild())return o;if(null!=n){for(let e=!1;!e;)if(e=r.type.is(n),!r.nextSibling())return o}for(;;){if(null!=i&&r.type.is(i))return o;if(r.type.is(t)&&o.push(r.node),!r.nextSibling())return null==i?o:[]}}function LJ(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class L0{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class L1 extends LX{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new L1(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&ev.ExcludeBuffers)return null;let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new L1(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new L1(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new L1(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let o=n.buffer[this.index+1];e.push(n.slice(i,r,o)),t.push(0)}return new L$(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function L2(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;i<e.length;i++){let r=e[i];(r.from>n.from||r.to<n.to)&&(n=r,t=i)}let i=n instanceof LK&&n.index<0?null:n.parent,r=e.slice();return i?r[t]=i:r.splice(t,1),new L5(r,n)}class L5{constructor(e,t){this.heads=e,this.node=t}get next(){return L2(this.heads)}}class L3{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~ev.EnterBracketed,e instanceof LK)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return!!e&&(e instanceof LK?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&ev.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ev.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ev.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(i.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=i)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let i=t+e,r=e<0?-1:n._tree.children.length;i!=r;i+=e){let e=n._tree.children[i];if(this.mode&ev.IncludeAnonymous||e instanceof Lq||!e.type.isAnonymous||L4(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)i:for(let i=this.index,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,n=r+1;break i}i=this.stack[--r]}for(let e=n;e<this.stack.length;e++)t=new L1(this.buffer,t,this.stack[e]);return this.bufferNode=new L1(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let i=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return LJ(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let i=e.length-1,r=this.stack.length-1;i>=0;r--){if(r<0)return LJ(this._tree,e,i);let o=n[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function L4(e){return e.children.some(e=>e instanceof Lq||!e.type.isAnonymous||L4(e))}let L6=new WeakMap;function L8(e,t){if(!e.isAnonymous||t instanceof Lq||t.type!=e)return 1;let n=L6.get(t);if(null==n){for(let i of(n=1,t.children)){if(i.type!=e||!(i instanceof L$)){n=1;break}n+=L8(e,i)}L6.set(t,n)}return n}function L9(e,t,n,i,r,o,a,s,l){let u=0;for(let n=i;n<r;n++)u+=L8(e,t[n]);let c=Math.ceil(1.5*u/8),h=[],d=[];return!function t(n,i,r,a,s){for(let u=r;u<a;){let r=u,p=i[u],f=L8(e,n[u]);for(u++;u<a;u++){let t=L8(e,n[u]);if(f+t>=c)break;f+=t}if(u==r+1){if(f>c){let e=n[r];t(e.children,e.positions,0,e.children.length,i[r]+s);continue}h.push(n[r])}else{let t=i[u-1]+n[u-1].length-p;h.push(L9(e,n,i,r,u,p,t,null,l))}d.push(p+s-o)}}(t,n,i,r,0),(s||l)(h,d,a)}class L7{constructor(e,t,n,i,r=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=!!r|2*!!o}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let i=[new L7(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&i.push(n);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,o=e.length?e[0]:null;for(let a=0,s=0,l=0;;a++){let u=a<t.length?t[a]:null,c=u?u.fromA:1e9;if(c-s>=n)for(;o&&o.from<c;){let t=o;if(s>=t.from||c<=t.to||l){let e=Math.max(t.from,s)-l,n=Math.min(t.to,c)-l;t=e>=n?null:new L7(e,n,t.tree,t.offset+l,a>0,!!u)}if(t&&i.push(t),o.to>c)break;o=r<e.length?e[r++]:null}if(!u)break;s=u.toA,l=u.toA-u.toB}return i}}class Ne{startParse(e,t,n){return"string"==typeof e&&(e=new Nt(e)),n=n?n.length?n.map(e=>new LB(e.from,e.to)):[new LB(0,0)]:[new LB(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let e=i.advance();if(e)return e}}}class Nt{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new LF({perNode:!0});class Nn{constructor(e,t,n,i,r,o,a,s,l,u=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=i,this.pos=r,this.score=o,this.buffer=a,this.bufferBase=s,this.curContext=l,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let i=e.parser.context;return new Nn(e,[],t,n,n,0,[],0,i?new Ni(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,i=65535&e,{parser:r}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(i);if(a&&(this.score+=a),0==n){i<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,i,!0),this.reducePos),i<r.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(i,this.reducePos);return}let s=this.stack.length-(n-1)*3-(262144&e?6:0),l=s?this.stack[s-2]:this.p.ranges[0].from;i<r.minRepeatTerm&&l==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let u=this.reducePos-l;u>=2e3&&!(null==(t=this.p.parser.nodeSet.types[i])?void 0:t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=u));let c=s?this.stack[s-1]:0,h=this.bufferBase+this.buffer.length-c;if(i<r.minRepeatTerm||131072&e){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,l,e,h+4,!0)}if(262144&e)this.state=this.stack[s];else{let e=this.stack[s-3];this.state=r.getGoto(e,i,!0)}for(;this.stack.length>s;)this.stack.pop();this.reduceContext(i,l)}storeNode(e,t,n,i=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&0==this.buffer[e-4]&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&(0!=this.buffer[r-4]||this.buffer[r-1]<0)){let e=!1;for(let t=r;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4)}this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=n,this.buffer[r+3]=i}else this.buffer.push(e,t,n,i)}shift(e,t,n,i){if(131072&e)this.pushState(65535&e,this.pos);else if((262144&e)==0){let{parser:r}=this.p;this.pos=i;let o=r.stateFlag(e,1);!o&&(i>n||t<=r.maxNode)&&(this.reducePos=i),this.pushState(e,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=r.maxNode&&this.buffer.push(t,n,i,4)}else this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4)}apply(e,t,n,i){65536&e?this.reduce(e):this.shift(e,t,n,i)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&0==e.buffer[t-4]&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new Nn(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Nr(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if((65536&n)==0)return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let i=0,r;i<t.length;i+=2)(r=t[i+1])!=this.state&&this.p.parser.hasAction(r,e)&&n.push(t[i],r);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let i=t[e+1];n.some((e,t)=>1&t&&e==i)||n.push(t[e],i)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let i=t[e+1];if(i==this.state)continue;let r=this.split();r.pushState(i,this.pos),r.storeNode(0,r.pos,r.pos,4,!0),r.shiftContext(t[e],this.pos),r.reducePos=this.pos,r.score-=200,n.push(r)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((65536&t)==0)return!1;if(!e.validAction(this.state,t)){let n=t>>19,i=65535&t,r=this.stack.length-3*n;if(r<0||0>e.getGoto(this.stack[r],i,!1)){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(i,r)=>{if(!t.includes(i))return t.push(i),e.allActions(i,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-r;if(n>1){let i=65535&t,r=this.stack.length-3*n;if(r>=0&&e.getGoto(this.stack[r],i,!1)>=0)return n<<19|65536|i}}else{let e=n(t,r+1);if(null!=e)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new Ni(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return!(e<=this.lookAhead)&&(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Ni{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Nr{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e>>19;0==t?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],65535&e,!0);this.state=n}}class No{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new No(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new No(this.stack,this.pos,this.index)}}function Na(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let i=0,r=0;i<e.length;){let o=0;for(;;){let t=e.charCodeAt(i++),n=!1;if(126==t){o=65535;break}t>=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,n=!0),o+=r,n)break;o*=46}n?n[r++]=o:n=new t(o)}return n}class Ns{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}let Nl=new Ns;class Nu{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Nl,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,i=this.rangeIndex,r=this.pos+e;for(;r<n.from;){if(!i)return null;let e=this.ranges[--i];r-=n.from-e.to,n=e}for(;t<0?r>n.to:r>=n.to;){if(i==this.ranges.length-1)return null;let e=this.ranges[++i];r+=e.from-n.to,n=e}return r}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,i;if(t>=0&&t<this.chunk.length)n=this.pos+e,i=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(null==t)return -1;if((n=t)>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Nl,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return n}}class Nc{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Nh(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}function Nh(e,t,n,i,r,o){let a=0,s=1<<i,{dialect:l}=n.p.parser;i:for(;(s&e[a])!=0;){let n=e[a+1];for(let i=a+3;i<n;i+=2)if((e[i+1]&s)>0){let n=e[i];if(l.allows(n)&&(-1==t.token.value||t.token.value==n||function(e,t,n,i){let r=Nd(n,i,t);return r<0||Nd(n,i,e)<r}(n,t.token.value,r,o))){t.acceptToken(n);break}}let i=t.next,u=0,c=e[a+2];if(t.next<0&&c>u&&65535==e[n+3*c-3]){a=e[n+3*c-1];continue}for(;u<c;){let r=u+c>>1,o=n+r+(r<<1),s=e[o],l=e[o+1]||65536;if(i<s)c=r;else if(i>=l)u=r+1;else{a=e[o+2],t.advance();continue i}}break}}function Nd(e,t,n){for(let i=t,r;65535!=(r=e[i]);i++)if(r==n)return i-t;return -1}Nc.prototype.contextual=Nc.prototype.fallback=Nc.prototype.extend=!1,(class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?Na(e):e}token(e,t){let n=e.pos,i=0;for(;;){let n=e.next<0,r=e.resolveOffset(1,1);if(Nh(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(!n&&i++,null==r)break;e.reset(r,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}).prototype.contextual=Nc.prototype.fallback=Nc.prototype.extend=!1;let Np="u">typeof process&&process.env&&/\bparse\b/.test(process.env.LOG),Nf=null;function Ng(e,t,n){let i=e.cursor(ev.IncludeAnonymous);for(i.moveTo(t);;)if(!(n<0?i.childBefore(t):i.childAfter(t)))for(;;){if((n<0?i.to<t:i.from>t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}class Nm{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Ng(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Ng(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],i=this.index[t];if(i==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let r=n.children[i],o=this.start[t]+n.positions[i];if(o>e)return this.nextStart=o,null;if(r instanceof L$){if(o==e){if(o<this.safeFrom)return null;let e=o+r.length;if(e<=this.safeTo){let t=r.prop(LF.lookAhead);if(!t||e+t<this.fragment.to)return r}}this.index[t]++,o+r.length>=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}}class Nv{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new Ns)}getActions(e){let t=0,n=null,{parser:i}=e.p,{tokenizers:r}=i,o=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,s=0;for(let i=0;i<r.length;i++){if((1<<i&o)==0)continue;let l=r[i],u=this.tokens[i];if((!n||l.fallback)&&((l.contextual||u.start!=e.pos||u.mask!=o||u.context!=a)&&(this.updateCachedToken(u,l,e),u.mask=o,u.context=a),u.lookAhead>u.end+25&&(s=Math.max(u.lookAhead,s)),0!=u.value)){let i=t;if(u.extended>-1&&(t=this.addActions(e,u.extended,u.end,t)),t=this.addActions(e,u.value,u.end,t),!l.extend&&(n=u,t>i))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),n||e.pos!=this.stream.end||((n=new Ns).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Ns,{pos:n,p:i}=e;return t.start=n,t.end=Math.min(n+1,i.stream.end),t.value=n==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,n){let i=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(i,e),n),e.value>-1){let{parser:t}=n.p;for(let i=0;i<t.specialized.length;i++)if(t.specialized[i]==e.value){let r=t.specializers[i](this.stream.read(e.start,e.end),n);if(r>=0&&n.p.parser.dialect.allows(r>>1)){(1&r)==0?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,n,i){for(let t=0;t<i;t+=3)if(this.actions[t]==e)return i;return this.actions[i++]=e,this.actions[i++]=t,this.actions[i++]=n,i}addActions(e,t,n,i){let{state:r}=e,{parser:o}=e.p,{data:a}=o;for(let e=0;e<2;e++)for(let s=o.stateSlot(r,e?2:1);;s+=3){if(65535==a[s])if(1==a[s+1])s=NS(a,s+2);else{0==i&&2==a[s+1]&&(i=this.putAction(NS(a,s+2),t,n,i));break}a[s]==t&&(i=this.putAction(NS(a,s+1),t,n,i))}return i}}class Ny{constructor(e,t,n,i){this.parser=e,this.input=t,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Nu(t,i),this.tokens=new Nv(e,this.stream),this.topTerm=e.top[1];let{from:r}=i[0];this.stacks=[Nn.start(this,e.top[0],r)],this.fragments=n.length&&this.stream.end-r>4*e.bufferLength?new Nm(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,i=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<n.length;o++){let a=n[o];for(;;){if(this.tokens.mainToken=null,a.pos>i)r.push(a);else{if(this.advanceStack(a,r,n))continue;e||(e=[],t=[]),e.push(a);let i=this.tokens.getMainToken(a);t.push(i.value,i.end)}break}}if(!r.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}(e);if(t)return Np&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw Np&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&e){let n=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,r);if(n)return Np&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort((e,t)=>t.score-e.score);r.length>e;)r.pop();r.some(e=>e.reducePos>i)&&this.recovering--}else if(r.length>1){n:for(let e=0;e<r.length-1;e++){let t=r[e];for(let n=e+1;n<r.length;n++){let i=r[n];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)r.splice(n--,1);else{r.splice(e--,1);continue n}}}r.length>12&&(r.sort((e,t)=>t.score-e.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let e=1;e<r.length;e++)r[e].pos<this.minStackPos&&(this.minStackPos=r[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let i=e.pos,{parser:r}=this,o=Np?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let a=this.fragments.nodeAt(i);a;){let i=this.parser.nodeSet.types[a.type.id]==a.type?r.getGoto(e.state,a.type.id):-1;if(i>-1&&a.length&&(!t||(a.prop(LF.contextHash)||0)==n))return e.useNode(a,i),Np&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(a.type.id)})`),!0;if(!(a instanceof L$)||0==a.children.length||a.positions[0]>0)break;let s=a.children[0];if(s instanceof L$&&0==a.positions[0])a=s;else break}}let a=r.stateSlot(e.state,4);if(a>0)return e.reduce(a),Np&&console.log(o+this.stackID(e)+` (via always-reduce ${r.getName(65535&a)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let a=0;a<s.length;){let l=s[a++],u=s[a++],c=s[a++],h=a==s.length||!n,d=h?e:e.split(),p=this.tokens.mainToken;if(d.apply(l,u,p?p.start:d.pos,c),Np&&console.log(o+this.stackID(d)+` (via ${(65536&l)==0?"shift":`reduce of ${r.getName(65535&l)}`} for ${r.getName(u)} @ ${i}${d==e?"":", split"})`),h)return!0;d.pos>i?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Nx(e,t),!0}}runRecovery(e,t,n){let i=null,r=!1;for(let o=0;o<e.length;o++){let a=e[o],s=t[o<<1],l=t[(o<<1)+1],u=Np?this.stackID(a)+" -> ":"";if(a.deadEnd&&(r||(r=!0,a.restart(),Np&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let c=a.split(),h=u;for(let e=0;e<10&&c.forceReduce()&&(Np&&console.log(h+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));e++)Np&&(h=this.stackID(c)+" -> ");for(let e of a.recoverByInsert(s))Np&&console.log(u+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>a.pos?(l==a.pos&&(l++,s=0),a.recoverByDelete(s,l),Np&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(s)})`),Nx(a,n)):(!i||i.score<c.score)&&(i=c)}return i}stackToTree(e){return e.close(),L$.build({buffer:No.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Nf||(Nf=new WeakMap)).get(e);return t||Nf.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function Nx(e,t){for(let n=0;n<t.length;n++){let i=t[n];if(i.pos==e.pos&&i.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class Nb{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}class Nw extends Ne{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push("");let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),i=[];for(let e=0;e<t.length;e++)i.push([]);function r(e,t,n){i[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=LF[e]);for(let n=1;n<t.length;){let i=t[n++];if(i>=0)r(i,e,t[n++]);else{let o=t[n+-i];for(let a=-i;a>0;a--)r(t[n++],e,o);n++}}}this.nodeSet=new LH(t.map((t,r)=>Lj.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:i[r],top:n.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=Na(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(N_),this.states=Na(e.states,Uint32Array),this.data=Na(e.stateData),this.goto=Na(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new Nc(o,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let i=new Ny(this,e,t,n);for(let r of this.wrappers)i=r(i,e,t,n);return i}getGoto(e,t,n=!1){let i=this.goto;if(t>=i[0])return -1;for(let r=i[t+1];;){let t=i[r++],o=1&t,a=i[r++];if(o&&n)return a;for(let n=r+(t>>1);r<n;r++)if(i[r]==e)return a;if(o)return -1}}hasAction(e,t){let n=this.data;for(let i=0;i<2;i++)for(let r=this.stateSlot(e,i?2:1),o;;r+=3){if(65535==(o=n[r]))if(1==n[r+1])o=n[r=NS(n,r+2)];else if(2==n[r+1])return NS(n,r+2);else break;if(o==t||0==o)return NS(n,r+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),i=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==i;n+=3){if(65535==this.data[n])if(1==this.data[n+1])n=NS(this.data,n+2);else break;i=t(NS(this.data,n+1))}return i}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n])if(1==this.data[n+1])n=NS(this.data,n+2);else break;if((1&this.data[n+2])==0){let e=this.data[n+1];t.some((t,n)=>1&n&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(Nw.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,i)=>{let r=e.specializers.find(e=>e.from==n.external);if(!r)return n;let o=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[i]=N_(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let i of e.split(" ")){let e=t.indexOf(i);e>=0&&(n[e]=!0)}let i=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],r;65535!=(r=this.data[n++]);)(i||(i=new Uint8Array(this.maxTerm+1)))[r]=1;return new Nb(e,n,i)}static deserialize(e){return new Nw(e)}}function NS(e,t){return e[t]|e[t+1]<<16}function N_(e){if(e.external){let t=+!!e.extend;return(n,i)=>e.external(n,i)<<1|t}return e.get}let NM=0;class NC{constructor(e,t,n,i){this.name=e,this.set=t,this.base=n,this.modified=i,this.id=NM++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){if(e instanceof NC&&(t=e),null==t?void 0:t.base)throw Error("Can not derive from a modified tag");let n=new NC("string"==typeof e?e:"?",[],null,[]);if(n.set.push(n),t)for(let e of t.set)n.set.push(e);return n}static defineModifier(e){let t=new Nk(e);return e=>e.modified.indexOf(t)>-1?e:Nk.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let NA=0;class Nk{constructor(e){this.name=e,this.instances=[],this.id=NA++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{var i,r;return n.base==e&&(i=t,r=n.modified,i.length==r.length&&i.every((e,t)=>e==r[t]))});if(n)return n;let i=[],r=new NC(e.name,i,e,t);for(let e of t)e.instances.push(r);let o=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let i=0,r=t.length;i<r;i++)t.push(t[i].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}(t);for(let t of e.set)if(!t.modified.length)for(let e of o)i.push(Nk.get(t,e));return r}}function NT(e){let t=Object.create(null);for(let n in e){let i=e[n];for(let e of(Array.isArray(i)||(i=[i]),n.split(" ")))if(e){let n=[],r=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){r=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!i)throw RangeError("Invalid path: "+e);if(n.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),(t+=i[0].length)==e.length)break;let a=e[t++];if(t==e.length&&"!"==a){r=0;break}if("/"!=a)throw RangeError("Invalid path: "+e);o=e.slice(t)}let a=n.length-1,s=n[a];if(!s)throw RangeError("Invalid path: "+e);let l=new NI(i,r,a>0?n.slice(0,a):null);t[s]=l.sort(t[s])}}return ND.add(t)}let ND=new LF({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let o=new NI(r.tags,r.mode,r.context);n?n.next=o:i=o,n=o}return i}});class NI{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function NO(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:i,all:r=null}=t||{};return{style:e=>{let t=r;for(let i of e)for(let e of i.set){let i=n[e.id];if(i){t=t?t+" "+i:i;break}}return t},scope:i}}NI.empty=new NI([],2,null);class NP{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,r){let{type:o,from:a,to:s}=e;if(a>=n||s<=t)return;o.isTop&&(r=this.highlighters.filter(e=>!e.scope||e.scope(o)));let l=i,u=function(e){let t=e.type.prop(ND);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||NI.empty,c=function(e,t){let n=null;for(let i of e){let e=i.style(t);e&&(n=n?n+" "+e:e)}return n}(r,u.tags);if(c&&(l&&(l+=" "),l+=c,1==u.mode&&(i+=(i?" ":"")+c)),this.startSpan(Math.max(t,a),l),u.opaque)return;let h=e.tree&&e.tree.prop(LF.mounted);if(h&&h.overlay){let o=e.node.enter(h.overlay[0].from+a,1),u=this.highlighters.filter(e=>!e.scope||e.scope(h.tree.type)),c=e.firstChild();for(let d=0,p=a;;d++){let f=d<h.overlay.length?h.overlay[d]:null,g=f?f.from+a:s,m=Math.max(t,p),v=Math.min(n,g);if(m<v&&c)for(;e.from<v&&(this.highlightRange(e,m,v,i,r),this.startSpan(Math.min(v,e.to),l),!(e.to>=g)&&e.nextSibling()););if(!f||g>n)break;(p=f.to+a)>t&&(this.highlightRange(o.cursor(),Math.max(t,f.from+a),Math.min(n,p),"",u),this.startSpan(Math.min(n,p),l))}c&&e.parent()}else if(e.firstChild()){h&&(i="");do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,i,r),this.startSpan(Math.min(n,e.to),l)}while(e.nextSibling());e.parent()}}}let NE=NC.define,NR=NE(),NL=NE(),NN=NE(NL),NB=NE(NL),NF=NE(),Nz=NE(NF),NV=NE(NF),Nj=NE(),NH=NE(Nj),NW=NE(),NG=NE(),N$=NE(),NU=NE(N$),Nq=NE(),NY={comment:NR,lineComment:NE(NR),blockComment:NE(NR),docComment:NE(NR),name:NL,variableName:NE(NL),typeName:NN,tagName:NE(NN),propertyName:NB,attributeName:NE(NB),className:NE(NL),labelName:NE(NL),namespace:NE(NL),macroName:NE(NL),literal:NF,string:Nz,docString:NE(Nz),character:NE(Nz),attributeValue:NE(Nz),number:NV,integer:NE(NV),float:NE(NV),bool:NE(NF),regexp:NE(NF),escape:NE(NF),color:NE(NF),url:NE(NF),keyword:NW,self:NE(NW),null:NE(NW),atom:NE(NW),unit:NE(NW),modifier:NE(NW),operatorKeyword:NE(NW),controlKeyword:NE(NW),definitionKeyword:NE(NW),moduleKeyword:NE(NW),operator:NG,derefOperator:NE(NG),arithmeticOperator:NE(NG),logicOperator:NE(NG),bitwiseOperator:NE(NG),compareOperator:NE(NG),updateOperator:NE(NG),definitionOperator:NE(NG),typeOperator:NE(NG),controlOperator:NE(NG),punctuation:N$,separator:NE(N$),bracket:NU,angleBracket:NE(NU),squareBracket:NE(NU),paren:NE(NU),brace:NE(NU),content:Nj,heading:NH,heading1:NE(NH),heading2:NE(NH),heading3:NE(NH),heading4:NE(NH),heading5:NE(NH),heading6:NE(NH),contentSeparator:NE(Nj),list:NE(Nj),quote:NE(Nj),emphasis:NE(Nj),strong:NE(Nj),link:NE(Nj),monospace:NE(Nj),strikethrough:NE(Nj),inserted:NE(),deleted:NE(),changed:NE(),invalid:NE(),meta:Nq,documentMeta:NE(Nq),annotation:NE(Nq),processingInstruction:NE(Nq),definition:NC.defineModifier("definition"),constant:NC.defineModifier("constant"),function:NC.defineModifier("function"),standard:NC.defineModifier("standard"),local:NC.defineModifier("local"),special:NC.defineModifier("special")};for(let e in NY){let t=NY[e];t instanceof NC&&(t.name=e)}NO([{tag:NY.link,class:"tok-link"},{tag:NY.heading,class:"tok-heading"},{tag:NY.emphasis,class:"tok-emphasis"},{tag:NY.strong,class:"tok-strong"},{tag:NY.keyword,class:"tok-keyword"},{tag:NY.atom,class:"tok-atom"},{tag:NY.bool,class:"tok-bool"},{tag:NY.url,class:"tok-url"},{tag:NY.labelName,class:"tok-labelName"},{tag:NY.inserted,class:"tok-inserted"},{tag:NY.deleted,class:"tok-deleted"},{tag:NY.literal,class:"tok-literal"},{tag:NY.string,class:"tok-string"},{tag:NY.number,class:"tok-number"},{tag:[NY.regexp,NY.escape,NY.special(NY.string)],class:"tok-string2"},{tag:NY.variableName,class:"tok-variableName"},{tag:NY.local(NY.variableName),class:"tok-variableName tok-local"},{tag:NY.definition(NY.variableName),class:"tok-variableName tok-definition"},{tag:NY.special(NY.variableName),class:"tok-variableName2"},{tag:NY.definition(NY.propertyName),class:"tok-propertyName tok-definition"},{tag:NY.typeName,class:"tok-typeName"},{tag:NY.namespace,class:"tok-namespace"},{tag:NY.className,class:"tok-className"},{tag:NY.macroName,class:"tok-macroName"},{tag:NY.propertyName,class:"tok-propertyName"},{tag:NY.operator,class:"tok-operator"},{tag:NY.comment,class:"tok-comment"},{tag:NY.meta,class:"tok-meta"},{tag:NY.invalid,class:"tok-invalid"},{tag:NY.punctuation,class:"tok-punctuation"}]);let NZ=NT({String:NY.string,Number:NY.number,"True False":NY.bool,PropertyName:NY.propertyName,Null:NY.null,", :":NY.separator,"[ ]":NY.squareBracket,"{ }":NY.brace}),NX=Nw.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[NZ],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),NK=[],NQ=[],NJ="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<NJ.length;e++)(e%2?NQ:NK).push(t+=NJ[e]);function N0(e){return e>=127462&&e<=127487}function N1(e,t,n){if(t==e.length)return t;t&&N5(e.charCodeAt(t))&&N3(e.charCodeAt(t-1))&&t--;let i=N2(e,t);for(t+=N4(i);t<e.length;){let r=N2(e,t);if(8205==i||8205==r||n&&function(e){if(e<768)return!1;for(let t=0,n=NK.length;;){let i=t+n>>1;if(e<NK[i])n=i;else{if(!(e>=NQ[i]))return!0;t=i+1}if(t==n)return!1}}(r))t+=N4(r),i=r;else if(N0(r)){let n=0,i=t-2;for(;i>=0&&N0(N2(e,i));)n++,i-=2;if(n%2==0)break;t+=2}else break}return t}function N2(e,t){let n=e.charCodeAt(t);if(!N3(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return N5(i)?(n-55296<<10)+(i-56320)+65536:n}function N5(e){return e>=56320&&e<57344}function N3(e){return e>=55296&&e<56320}function N4(e){return e<65536?1:2}class N6{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Br(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),N9.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Br(this,e,t);let n=[];return this.decompose(e,t,n,0),N9.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new Be(this),r=new Be(e);for(let e=t,o=t;;){if(i.next(e),r.next(e),e=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new Be(this,e)}iterRange(e,t=this.length){return new Bt(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Bn(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(0==e.length)throw RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new N8(e):N9.from(N8.split(e,[])):N6.empty}}class N8 extends N6{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let o=this.text[r],a=i+o.length;if((t?n:a)>=e)return new Bi(i,a,n,o);i=a+1,n++}}decompose(e,t,n,i){var r;let o=e<=0&&t>=this.length?this:new N8((r=this.text,N7(r,[""],e,t)),Math.min(t,this.length)-Math.max(0,e));if(1&i){let e=n.pop(),t=N7(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new N8(t,e.length+o.length));else{let e=t.length>>1;n.push(new N8(t.slice(0,e)),new N8(t.slice(e)))}}else n.push(o)}replace(e,t,n){var i;if(!(n instanceof N8))return super.replace(e,t,n);[e,t]=Br(this,e,t);let r=N7(this.text,N7(n.text,(i=this.text,N7(i,[""],0,e))),t),o=this.length+n.length-(t-e);return r.length<=32?new N8(r,o):N9.from(N8.split(r,[]),o)}sliceString(e,t=this.length,n="\n"){[e,t]=Br(this,e,t);let i="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let a=this.text[o],s=r+a.length;r>e&&o&&(i+=n),e<s&&t>r&&(i+=a.slice(Math.max(0,e-r),t-r)),r=s+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,32==n.length&&(t.push(new N8(n,i)),n=[],i=-1);return i>-1&&t.push(new N8(n,i)),t}}class N9 extends N6{constructor(e,t){for(let n of(super(),this.children=e,this.length=t,this.lines=0,e))this.lines+=n.lines}lineInner(e,t,n,i){for(let r=0;;r++){let o=this.children[r],a=i+o.length,s=n+o.lines-1;if((t?s:a)>=e)return o.lineInner(e,t,n,i);i=a+1,n=s+1}}decompose(e,t,n,i){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let a=this.children[r],s=o+a.length;if(e<=s&&t>=o){let r=i&(o<=e|2*(s>=t));o>=e&&s<=t&&!r?n.push(a):a.decompose(e-o,t-o,n,r)}o=s+1}}replace(e,t,n){if([e,t]=Br(this,e,t),n.lines<this.lines)for(let i=0,r=0;i<this.children.length;i++){let o=this.children[i],a=r+o.length;if(e>=r&&t<=a){let s=o.replace(e-r,t-r,n),l=this.lines-o.lines+s.lines;if(s.lines<l>>4&&s.lines>l>>6){let r=this.children.slice();return r[i]=s,new N9(r,this.length-(t-e)+n.length)}return super.replace(r,a,s)}r=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=Br(this,e,t);let i="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let a=this.children[r],s=o+a.length;o>e&&r&&(i+=n),e<s&&t>o&&(i+=a.sliceString(e-o,t-o,n)),o=s+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof N9))return 0;let n=0,[i,r,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==o||r==a)return n;let s=this.children[i],l=e.children[r];if(s!=l)return n+s.scanIdentical(l,t);n+=s.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new N8(n,t)}let i=Math.max(32,n>>5),r=i<<1,o=i>>1,a=[],s=0,l=-1,u=[];function c(){0!=s&&(a.push(1==u.length?u[0]:N9.from(u,l)),l=-1,s=u.length=0)}for(let t of e)!function e(t){let n;if(t.lines>r&&t instanceof N9)for(let n of t.children)e(n);else t.lines>o&&(s>o||!s)?(c(),a.push(t)):t instanceof N8&&s&&(n=u[u.length-1])instanceof N8&&t.lines+n.lines<=32?(s+=t.lines,l+=t.length+1,u[u.length-1]=new N8(n.text.concat(t.text),n.length+1+t.length)):(s+t.lines>i&&c(),s+=t.lines,l+=t.length+1,u.push(t))}(t);return c(),1==a.length?a[0]:new N9(a,t)}}function N7(e,t,n=0,i=1e9){for(let r=0,o=0,a=!0;o<e.length&&r<=i;o++){let s=e[o],l=r+s.length;l>=n&&(l>i&&(s=s.slice(0,i-r)),r<n&&(s=s.slice(n-r)),a?(t[t.length-1]+=s,a=!1):t.push(s)),r=l+1}return t}N6.empty=new N8([""],0);class Be{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof N8?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],o=r>>1,a=i instanceof N8?i.text.length:i.children.length;if(o==(t>0?a:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(i instanceof N8){let r=i.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=i.children[o+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof N8?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Bt{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Be(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class Bn{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"u">typeof Symbol&&(N6.prototype[Symbol.iterator]=function(){return this.iter()},Be.prototype[Symbol.iterator]=Bt.prototype[Symbol.iterator]=Bn.prototype[Symbol.iterator]=function(){return this});class Bi{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}function Br(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function Bo(e,t,n=!0,i=!0){return function(e,t,n=!0,i=!0){return(n?N1:function(e,t,n){for(;t>1;){let i=N1(e,t-2,n);if(i<t)return i;t--}return 0})(e,t,i)}(e,t,n,i)}function Ba(e,t){let n=e.charCodeAt(t);if(!(n>=55296&&n<56320)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return i>=56320&&i<57344?(n-55296<<10)+(i-56320)+65536:n}function Bs(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function Bl(e){return e<65536?1:2}let Bu=/\r\n?|\n/;var Bc=((D=Bc||(Bc={}))[D.Simple=0]="Simple",D[D.TrackDel=1]="TrackDel",D[D.TrackBefore=2]="TrackBefore",D[D.TrackAfter=3]="TrackAfter",D);class Bh{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,i=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(n,i,r),i+=r):i+=o,n+=r}}iterChangedRanges(e,t=!1){Bg(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];i<0?e.push(n,i):e.push(i,n)}return new Bh(e)}composeDesc(e){return this.empty?e:e.empty?this:Bv(this,e)}mapDesc(e,t=!1){return e.empty?this:Bm(this,e,t)}mapPos(e,t=-1,n=Bc.Simple){let i=0,r=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],s=this.sections[o++],l=i+a;if(s<0){if(l>e)return r+(e-i);r+=a}else{if(n!=Bc.Simple&&l>=e&&(n==Bc.TrackDel&&i<e&&l>e||n==Bc.TrackBefore&&i<e||n==Bc.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!a)return e==i||t<0?r:r+s;r+=s}i=l}if(e>i)throw RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n<this.sections.length&&i<=t;){let r=this.sections[n++],o=this.sections[n++],a=i+r;if(o>=0&&i<=t&&a>=e)return!(i<e)||!(a>t)||"cover";i=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw RangeError("Invalid JSON representation of ChangeDesc");return new Bh(e)}static create(e){return new Bh(e)}}class Bd extends Bh{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError("Applying change set to a document with the wrong length");return Bg(this,(t,n,i,r,o)=>e=e.replace(i,i+(n-t),o),!1),e}mapDesc(e,t=!1){return Bm(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,r=0;i<t.length;i+=2){let o=t[i],a=t[i+1];if(a>=0){t[i]=a,t[i+1]=o;let s=i>>1;for(;n.length<s;)n.push(N6.empty);n.push(o?e.slice(r,r+o):N6.empty)}r+=o}return new Bd(t,n)}compose(e){return this.empty?e:e.empty?this:Bv(this,e,!0)}map(e,t=!1){return e.empty?this:Bm(this,e,t,!0)}iterChanges(e,t=!1){Bg(this,e,t)}get desc(){return Bh.create(this.sections)}filter(e){let t=[],n=[],i=[],r=new By(this);r:for(let o=0,a=0;;){let s=o==e.length?1e9:e[o++];for(;a<s||a==s&&0==r.len;){if(r.done)break r;let e=Math.min(r.len,s-a);Bp(i,e,-1);let o=-1==r.ins?-1:0==r.off?r.ins:0;Bp(t,e,o),o>0&&Bf(n,t,r.text),r.forward(e),a+=e}let l=e[o++];for(;a<l;){if(r.done)break r;let e=Math.min(r.len,l-a);Bp(t,e,-1),Bp(i,e,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(e),a+=e}}return{changes:new Bd(t,n),filtered:Bh.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],i=this.sections[t+1];i<0?e.push(n):0==i?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let i=[],r=[],o=0,a=null;function s(e=!1){if(!e&&!i.length)return;o<t&&Bp(i,t-o,-1);let n=new Bd(i,r);a=a?a.compose(n.map(a)):n,i=[],r=[],o=0}return!function e(l){if(Array.isArray(l))for(let t of l)e(t);else if(l instanceof Bd){if(l.length!=t)throw RangeError(`Mismatched change set length (got ${l.length}, expected ${t})`);s(),a=a?a.compose(l.map(a)):l}else{let{from:e,to:a=e,insert:u}=l;if(e>a||e<0||a>t)throw RangeError(`Invalid change range ${e} to ${a} (in doc of length ${t})`);let c=u?"string"==typeof u?N6.of(u.split(n||Bu)):u:N6.empty,h=c.length;if(e==a&&0==h)return;e<o&&s(),e>o&&Bp(i,e-o,-1),Bp(i,a-e,h),Bf(r,i,c),o=a}}(e),s(!a),a}static empty(e){return new Bd(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;i<e.length;i++){let r=e[i];if("number"==typeof r)t.push(r,-1);else if(!Array.isArray(r)||"number"!=typeof r[0]||r.some((e,t)=>t&&"string"!=typeof e))throw RangeError("Invalid JSON representation of ChangeSet");else if(1==r.length)t.push(r[0],0);else{for(;n.length<i;)n.push(N6.empty);n[i]=N6.of(r.slice(1)),t.push(r[0],n[i].length)}}return new Bd(t,n)}static createSet(e,t){return new Bd(e,t)}}function Bp(e,t,n,i=!1){if(0==t&&n<=0)return;let r=e.length-2;r>=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&0==t&&0==e[r]?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function Bf(e,t,n){if(0==n.length)return;let i=t.length-2>>1;if(i<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<i;)e.push(N6.empty);e.push(n)}}function Bg(e,t,n){let i=e.inserted;for(let r=0,o=0,a=0;a<e.sections.length;){let s=e.sections[a++],l=e.sections[a++];if(l<0)r+=s,o+=s;else{let u=r,c=o,h=N6.empty;for(;u+=s,c+=l,l&&i&&(h=h.append(i[a-2>>1])),!n&&a!=e.sections.length&&!(e.sections[a+1]<0);)s=e.sections[a++],l=e.sections[a++];t(r,u,o,c,h),r=u,o=c}}}function Bm(e,t,n,i=!1){let r=[],o=i?[]:null,a=new By(e),s=new By(t);for(let e=-1;;)if(a.done&&s.len||s.done&&a.len)throw Error("Mismatched change set lengths");else if(-1==a.ins&&-1==s.ins){let e=Math.min(a.len,s.len);Bp(r,e,-1),a.forward(e),s.forward(e)}else if(s.ins>=0&&(a.ins<0||e==a.i||0==a.off&&(s.len<a.len||s.len==a.len&&!n))){let t=s.len;for(Bp(r,s.ins,-1);t;){let n=Math.min(a.len,t);a.ins>=0&&e<a.i&&a.len<=n&&(Bp(r,0,a.ins),o&&Bf(o,r,a.text),e=a.i),a.forward(n),t-=n}s.next()}else if(a.ins>=0){let t=0,n=a.len;for(;n;)if(-1==s.ins){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(0==s.ins&&s.len<n)n-=s.len,s.next();else break;Bp(r,t,e<a.i?a.ins:0),o&&e<a.i&&Bf(o,r,a.text),e=a.i,a.forward(a.len-n)}else if(a.done&&s.done)return o?Bd.createSet(r,o):Bh.create(r);else throw Error("Mismatched change set lengths")}function Bv(e,t,n=!1){let i=[],r=n?[]:null,o=new By(e),a=new By(t);for(let e=!1;;)if(o.done&&a.done)return r?Bd.createSet(i,r):Bh.create(i);else if(0==o.ins)Bp(i,o.len,0,e),o.next();else if(0!=a.len||a.done)if(o.done||a.done)throw Error("Mismatched change set lengths");else{let t=Math.min(o.len2,a.len),n=i.length;if(-1==o.ins){let n=-1==a.ins?-1:a.off?0:a.ins;Bp(i,t,n,e),r&&n&&Bf(r,i,a.text)}else -1==a.ins?(Bp(i,o.off?0:o.len,t,e),r&&Bf(r,i,o.textBit(t))):(Bp(i,o.off?0:o.len,a.off?0:a.ins,e),r&&!a.off&&Bf(r,i,a.text));e=(o.ins>t||a.ins>=0&&a.len>t)&&(e||i.length>n),o.forward2(t),a.forward(t)}else Bp(i,0,a.ins,e),r&&Bf(r,i,a.text),a.next()}class By{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return -2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?N6.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?N6.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Bx{constructor(e,t,n,i){this.from=e,this.to=t,this.flags=n,this.goalColumn=i}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get undirectional(){return(64&this.flags)>0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new Bx(n,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return Bb.range(e,t,void 0,void 0,n);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Bb.range(this.anchor,i,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid JSON representation for SelectionRange");return Bb.range(e.anchor,e.head)}static create(e,t,n,i){return new Bx(e,t,n,i)}}class Bb{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Bb.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new Bb([this.main],0)}addRange(e,t=!0){return Bb.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,Bb.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw RangeError("Invalid JSON representation for EditorSelection");return new Bb(e.ranges.map(e=>Bx.fromJSON(e)),e.main)}static single(e,t=e){return new Bb([Bb.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let r=e[i];if(r.empty?r.from<=n:r.from<n)return Bb.normalized(e.slice(),t);n=r.to}return new Bb(e,t)}static cursor(e,t=0,n,i){return Bx.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n)),i)}static range(e,t,n,i,r){let o=null==i?7:Math.min(6,i);return r||e==t||(r=t<e?1:-1),r&&(o|=r<0?8:16),t<e?Bx.create(t,e,32|o,n):Bx.create(e,t,o,n)}static undirectionalRange(e,t){return Bx.create(e,t,64,void 0)}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let n=1;n<e.length;n++){let i=e[n],r=e[n-1];if(i.empty?i.from<=r.to:i.from<r.to){let o=r.from,a=Math.max(i.to,r.to);n<=t&&t--,e.splice(--n,2,i.anchor>i.head?Bb.range(a,o):Bb.range(o,a))}}return new Bb(e,t)}}function Bw(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let BS=0;class B_{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=BS++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new B_(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(!e.combine?BM:(e,t)=>e===t),!!e.static,e.enables)}of(e){return new BC([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new BC(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new BC(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function BM(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class BC{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=BS++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,o=e[r]>>1,a=2==this.type,s=!1,l=!1,u=[];for(let n of this.dependencies)"doc"==n?s=!0:"selection"==n?l=!0:((null!=(t=e[n.id])?t:1)&1)==0&&u.push(e[n.id]);return{create:e=>(e.values[o]=n(e),1),update(e,t){if(s&&t.docChanged||l&&(t.docChanged||t.selection)||Bk(e,u)){let t=n(e);if(a?!BA(t,e.values[o],i):!i(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let s,l=t.config.address[r];if(null!=l){let r=BB(t,l);if(this.dependencies.every(n=>n instanceof B_?t.facet(n)===e.facet(n):!(n instanceof BD)||t.field(n,!1)==e.field(n,!1))||(a?BA(s=n(e),r,i):i(s=n(e),r)))return e.values[o]=r,0}else s=n(e);return e.values[o]=s,1}}}}function BA(e,t,n){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function Bk(e,t){let n=!1;for(let i of t)1&BN(e,i)&&(n=!0);return n}let BT=B_.define({static:!0});class BD{constructor(e,t,n,i,r){this.id=e,this.createF=t,this.updateF=n,this.compareF=i,this.spec=r,this.provides=void 0}static define(e){let t=new BD(BS++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(BT).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let i=e.values[t],r=this.updateF(i,n);return this.compareF(i,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>{let i=e.facet(BT),r=n.facet(BT),o;return(o=i.find(e=>e.field==this))&&o!=r.find(e=>e.field==this)?(e.values[t]=o.create(e),1):null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}}init(e){return[this,BT.of({field:this,create:e})]}get extension(){return this}}function BI(e){return t=>new BP(t,e)}let BO={highest:BI(0),high:BI(1),default:BI(2),low:BI(3),lowest:BI(4)};class BP{constructor(e,t){this.inner=e,this.prec=t}}class BE{of(e){return new BR(this,e)}reconfigure(e){return BE.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class BR{constructor(e,t){this.compartment=e,this.inner=t}}class BL{constructor(e,t,n,i,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){var i,r,o;let a,s,l=[],u=Object.create(null),c=new Map;for(let n of(i=e,r=t,o=c,a=[[],[],[],[],[]],s=new Map,!function e(t,n){let i=s.get(t);if(null!=i){if(i<=n)return;let e=a[i].indexOf(t);e>-1&&a[i].splice(e,1),t instanceof BR&&o.delete(t.compartment)}if(s.set(t,n),Array.isArray(t))for(let i of t)e(i,n);else if(t instanceof BR){if(o.has(t.compartment))throw RangeError("Duplicate use of compartment in extensions");let i=r.get(t.compartment)||t.inner;o.set(t.compartment,i),e(i,n)}else if(t instanceof BP)e(t.inner,t.prec);else if(t instanceof BD)a[n].push(t),t.provides&&e(t.provides,n);else if(t instanceof BC)a[n].push(t),t.facet.extensions&&e(t.facet.extensions,2);else{let i=t.extension;if(!i)throw Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(i,n)}}(i,2),a.reduce((e,t)=>e.concat(t))))n instanceof BD?l.push(n):(u[n.facet.id]||(u[n.facet.id]=[])).push(n);let h=Object.create(null),d=[],p=[];for(let e of l)h[e.id]=p.length<<1,p.push(t=>e.slot(t));let f=null==n?void 0:n.config.facets;for(let e in u){let t=u[e],i=t[0].facet,r=f&&f[e]||[];if(t.every(e=>0==e.type))if(h[i.id]=d.length<<1|1,BM(r,t))d.push(n.facet(i));else{let e=i.combine(t.map(e=>e.value));d.push(n&&i.compare(e,n.facet(i))?n.facet(i):e)}else{for(let e of t)0==e.type?(h[e.id]=d.length<<1|1,d.push(e.value)):(h[e.id]=p.length<<1,p.push(t=>e.dynamicSlot(t)));h[i.id]=p.length<<1,p.push(e=>(function(e,t,n){let i=n.map(t=>e[t.id]),r=n.map(e=>e.type),o=i.filter(e=>!(1&e)),a=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<i.length;t++){let o=BB(e,i[t]);if(2==r[t])for(let e of o)n.push(e);else n.push(o)}return t.combine(n)}return{create(e){for(let t of i)BN(e,t);return e.values[a]=s(e),1},update(e,n){if(!Bk(e,o))return 0;let i=s(e);return t.compare(i,e.values[a])?0:(e.values[a]=i,1)},reconfigure(e,r){let o=Bk(e,i),l=r.config.facets[t.id],u=r.facet(t);if(l&&!o&&BM(n,l))return e.values[a]=u,0;let c=s(e);return t.compare(c,u)?(e.values[a]=u,0):(e.values[a]=c,1)}}})(e,i,t))}}return new BL(e,c,p.map(e=>e(h)),h,d,u)}}function BN(e,t){if(1&t)return 2;let n=t>>1,i=e.status[n];if(4==i)throw Error("Cyclic dependency between fields and/or facets");if(2&i)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function BB(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let BF=B_.define(),Bz=B_.define({combine:e=>e.some(e=>e),static:!0}),BV=B_.define({combine:e=>e.length?e[0]:void 0,static:!0}),Bj=B_.define(),BH=B_.define(),BW=B_.define(),BG=B_.define({combine:e=>!!e.length&&e[0]});class B${constructor(e,t){this.type=e,this.value=t}static define(){return new BU}}class BU{of(e){return new B$(this,e)}}class Bq{constructor(e){this.map=e}of(e){return new BY(this,e)}}class BY{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new BY(this.type,t)}is(e){return this.type==e}static define(e={}){return new Bq(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let e=i.map(t);e&&n.push(e)}return n}}BY.reconfigure=BY.define(),BY.appendConfig=BY.define();class BZ{constructor(e,t,n,i,r,o){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,n&&Bw(n,t.newLength),r.some(e=>e.type==BZ.time)||(this.annotations=r.concat(BZ.time.of(Date.now())))}static create(e,t,n,i,r,o){return new BZ(e,t,n,i,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(BZ.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function BX(e,t,n){var i;let r,o,a;return n?(r=t.changes,o=Bd.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(o):null==(i=e.selection)?void 0:i.map(r),effects:BY.mapEffects(e.effects,r).concat(BY.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function BK(e,t,n){let i=t.selection,r=BJ(t.annotations);return t.userEvent&&(r=r.concat(BZ.userEvent.of(t.userEvent))),{changes:t.changes instanceof Bd?t.changes:Bd.of(t.changes||[],n,e.facet(BV)),selection:i&&(i instanceof Bb?i:Bb.single(i.anchor,i.head)),effects:BJ(t.effects),annotations:r,scrollIntoView:!!t.scrollIntoView}}BZ.time=B$.define(),BZ.userEvent=B$.define(),BZ.addToHistory=B$.define(),BZ.remote=B$.define();let BQ=[];function BJ(e){return null==e?BQ:Array.isArray(e)?e:[e]}var B0=((I=B0||(B0={}))[I.Word=0]="Word",I[I.Space=1]="Space",I[I.Other=2]="Other",I);let B1=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{i=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class B2{constructor(e,t,n,i,r,o){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)BN(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null==n){if(t)throw RangeError("Field is not present in this state");return}return BN(this,n),BB(this,n)}update(...e){return function e(t,n,i){let r=BK(t,n.length?n[0]:{},t.doc.length);n.length&&!1===n[0].filter&&(i=!1);for(let e=1;e<n.length;e++){!1===n[e].filter&&(i=!1);let o=!!n[e].sequential;r=BX(r,BK(t,n[e],o?r.changes.newLength:t.doc.length),o)}let o=BZ.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return function(e){let t=e.startState,n=t.facet(BW),i=e;for(let r=n.length-1;r>=0;r--){let o=n[r](e);o&&Object.keys(o).length&&(i=BX(i,BK(t,o,e.changes.newLength),!0))}return i==e?e:BZ.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}(i?function(t){let n=t.startState,i=!0;for(let e of n.facet(Bj)){let n=e(t);if(!1===n){i=!1;break}Array.isArray(n)&&(i=!0===i?n:function(e,t){let n=[];for(let i=0,r=0;;){let o,a;if(i<e.length&&(r==t.length||t[r]>=e[i]))o=e[i++],a=e[i++];else{if(!(r<t.length))return n;o=t[r++],a=t[r++]}!n.length||n[n.length-1]<o?n.push(o,a):n[n.length-1]<a&&(n[n.length-1]=a)}}(i,n))}if(!0!==i){let e,r;if(!1===i)r=t.changes.invertedDesc,e=Bd.empty(n.doc.length);else{let n=t.changes.filter(i);e=n.changes,r=n.filtered.mapDesc(n.changes).invertedDesc}t=BZ.create(n,e,t.selection&&t.selection.map(r),BY.mapEffects(t.effects,r),t.annotations,t.scrollIntoView)}let r=n.facet(BH);for(let i=r.length-1;i>=0;i--){let o=r[i](t);t=o instanceof BZ?o:Array.isArray(o)&&1==o.length&&o[0]instanceof BZ?o[0]:e(n,BJ(o),!1)}return t}(o):o)}(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:i,compartments:r}=n;for(let t of e.effects)t.is(BE.reconfigure)?(n&&(r=new Map,n.compartments.forEach((e,t)=>r.set(t,e)),n=null),r.set(t.value.compartment,t.value.extension)):t.is(BY.reconfigure)?(n=null,i=t.value):t.is(BY.appendConfig)&&(n=null,i=BJ(i).concat(t.value));t=n?e.startState.values.slice():new B2(n=BL.resolve(i,r,this),this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values;let o=e.startState.facet(Bz)?e.newSelection:e.newSelection.asSingle();new B2(n,e.newDoc,o,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Bb.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],o=BJ(n.effects);for(let n=1;n<t.ranges.length;n++){let a=e(t.ranges[n]),s=this.changes(a.changes),l=s.map(i);for(let e=0;e<n;e++)r[e]=r[e].map(l);let u=i.mapDesc(s,!0);r.push(a.range.map(u)),i=i.compose(l),o=BY.mapEffects(o,l).concat(BY.mapEffects(BJ(a.effects),u))}return{changes:i,selection:Bb.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof Bd?e:Bd.of(e,this.doc.length,this.facet(B2.lineSeparator))}toText(e){return N6.of(e.split(this.facet(B2.lineSeparator)||Bu))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(BN(this,t),BB(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof BD&&null!=this.config.address[i.id]&&(t[n]=i.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw RangeError("Invalid JSON representation for EditorState");let i=[];if(n){for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let r=n[t],o=e[t];i.push(r.init(e=>r.spec.fromJSON(o,e)))}}return B2.create({doc:e.doc,selection:Bb.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=BL.resolve(e.extensions||[],new Map),n=e.doc instanceof N6?e.doc:N6.of((e.doc||"").split(t.staticFacet(B2.lineSeparator)||Bu)),i=e.selection?e.selection instanceof Bb?e.selection:Bb.single(e.selection.anchor,e.selection.head):Bb.single(0);return Bw(i,n.length),t.staticFacet(Bz)||(i=i.asSingle()),new B2(t,n,i,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(B2.tabSize)}get lineBreak(){return this.facet(B2.lineSeparator)||"\n"}get readOnly(){return this.facet(BG)}phrase(e,...t){for(let t of this.facet(B2.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>t.length?e:t[i-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(BF))for(let o of r(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){var t;let n=this.languageDataAt("wordChars",e);return t=n.length?n[0]:"",e=>{if(!/\S/.test(e))return B0.Space;if(function(e){if(i)return i.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||B1.test(n)))return!0}return!1}(e))return B0.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return B0.Word;return B0.Other}}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-n,a=e-n;for(;o>0;){let e=Bo(t,o,!1);if(r(t.slice(e,o))!=B0.Word)break;o=e}for(;a<i;){let e=Bo(t,a);if(r(t.slice(a,e))!=B0.Word)break;a=e}return o==a?null:Bb.range(o+n,a+n)}}function B5(e,t,n={}){let i={};for(let t of e)for(let e of Object.keys(t)){let r=t[e],o=i[e];if(void 0===o)i[e]=r;else if(o===r||void 0===r);else if(Object.hasOwnProperty.call(n,e))i[e]=n[e](o,r);else throw Error("Config merge conflict for field "+e)}for(let e in t)void 0===i[e]&&(i[e]=t[e]);return i}B2.allowMultipleSelections=Bz,B2.tabSize=B_.define({combine:e=>e.length?e[0]:4}),B2.lineSeparator=BV,B2.readOnly=BG,B2.phrases=B_.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(n=>e[n]==t[n])}}),B2.languageData=BF,B2.changeFilter=Bj,B2.transactionFilter=BH,B2.transactionExtender=BW,BE.reconfigure=BY.define();class B3{eq(e){return this==e}range(e,t=e){return B6.create(e,t,this)}}function B4(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}B3.prototype.startSide=B3.prototype.endSide=0,B3.prototype.point=!1,B3.prototype.mapMode=Bc.TrackDel;class B6{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new B6(e,t,n)}}function B8(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class B9{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let o=i,a=r.length;;){if(o==a)return o;let i=o+a>>1,s=r[i]-e||(n?this.value[i].endSide:this.value[i].startSide)-t;if(i==o)return s>=0?o:a;s>=0?a=i:o=i+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,r);r<o;r++)if(!1===i(this.from[r]+e,this.to[r]+e,this.value[r]))return!1}map(e,t){let n=[],i=[],r=[],o=-1,a=-1;for(let s=0;s<this.value.length;s++){let l=this.value[s],u=this.from[s]+e,c=this.to[s]+e,h,d;if(u==c){let e=t.mapPos(u,l.startSide,l.mapMode);if(null==e||(h=d=e,l.startSide!=l.endSide&&(d=t.mapPos(u,l.endSide))<h))continue}else if((h=t.mapPos(u,l.startSide))>(d=t.mapPos(c,l.endSide))||h==d&&l.startSide>0&&l.endSide<=0)continue;0>(d-h||l.endSide-l.startSide)||(o<0&&(o=h),l.point&&(a=Math.max(a,d-h)),n.push(l),i.push(h-o),r.push(d-o))}return{mapped:n.length?new B9(i,r,n,a):null,pos:o}}}class B7{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new B7(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:r=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(n&&(t=t.slice().sort(B8)),this.isEmpty)return t.length?B7.of(t):this;let a=new Fn(this,null,-1).goto(0),s=0,l=[],u=new Fe;for(;a.value||s<t.length;)if(s<t.length&&(a.from-t[s].from||a.startSide-t[s].value.startSide)>=0){let e=t[s++];u.addInner(e.from,e.to,e.value)||l.push(e)}else 1==a.rangeIndex&&a.chunkIndex<this.chunk.length&&(s==t.length||this.chunkEnd(a.chunkIndex)<t[s].from)&&(!o||i>this.chunkEnd(a.chunkIndex)||r<this.chunkPos[a.chunkIndex])&&u.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||i>a.to||r<a.from||o(a.from,a.to,a.value))&&!u.addInner(a.from,a.to,a.value)&&l.push(B6.create(a.from,a.to,a.value)),a.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?B7.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],i=-1;for(let r=0;r<this.chunk.length;r++){let o=this.chunkPos[r],a=this.chunk[r],s=e.touchesRange(o,o+a.length);if(!1===s)i=Math.max(i,a.maxPoint),t.push(a),n.push(e.mapPos(o));else if(!0===s){let{mapped:r,pos:s}=a.map(o,e);r&&(i=Math.max(i,r.maxPoint),t.push(r),n.push(s))}}let r=this.nextLayer.map(e);return 0==t.length?r:new B7(n,t,r||B7.empty,i)}between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let r=this.chunkPos[i],o=this.chunk[i];if(t>=r&&e<=r+o.length&&!1===o.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return Fi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Fi.from(e).goto(t)}static compare(e,t,n,i,r=-1){let o=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),a=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),s=Ft(o,a,n),l=new Fo(o,s,r),u=new Fo(a,s,r);n.iterGaps((e,t,n)=>Fa(l,e,u,t,n,i)),n.empty&&0==n.length&&Fa(l,0,u,0,0,i)}static eq(e,t,n=0,i){null==i&&(i=0x3b9ac9ff);let r=e.filter(e=>!e.isEmpty&&0>t.indexOf(e)),o=t.filter(t=>!t.isEmpty&&0>e.indexOf(t));if(r.length!=o.length)return!1;if(!r.length)return!0;let a=Ft(r,o),s=new Fo(r,a,0).goto(n),l=new Fo(o,a,0).goto(n);for(;;){if(s.to!=l.to||!Fs(s.active,l.active)||s.point&&(!l.point||!B4(s.point,l.point)))return!1;if(s.to>i)return!0;s.next(),l.next()}}static spans(e,t,n,i,r=-1){let o=new Fo(e,null,r).goto(t),a=t,s=o.openStart;for(;;){let e=Math.min(o.to,n);if(o.point){let n=o.activeForPoint(o.to),r=o.pointFrom<t?n.length+1:o.point.startSide<0?n.length:Math.min(n.length,s);i.point(a,e,o.point,n,r,o.pointRank),s=Math.min(o.openEnd(e),n.length)}else e>a&&(i.span(a,e,o.active,s),s=o.openEnd(e));if(o.to>n)return s+(o.point&&o.to>n?1:0);a=o.to,o.next()}}static of(e,t=!1){let n=new Fe;for(let i of e instanceof B6?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let i=e[n];if(B8(t,i)>0)return e.slice().sort(B8);t=i}return e}(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return B7.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=B7.empty;i=i.nextLayer)t=new B7(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}B7.empty=new B7([],[],null,-1),B7.empty.nextLayer=B7.empty;class Fe{finishChunk(e){this.chunks.push(new B9(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new Fe)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&0>(e-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if(0>(e-this.lastTo||t.value[0].startSide-this.last.endSide))return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(B7.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=B7.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Ft(e,t,n){let i=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&i.set(t.chunk[e],t.chunkPos[e]);let r=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let o=i.get(e.chunk[t]);null==o||(n?n.mapPos(o):o)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(o,o+e.chunk[t].length))||r.add(e.chunk[t])}return r}class Fn{constructor(e,t,n,i=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){0>(this.to-e||this.endSide-t)&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Fi{constructor(e){this.heap=e}static from(e,t=null,n=-1){let i=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&i.push(new Fn(o,t,n,r));return 1==i.length?i[0]:new Fi(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)Fr(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)Fr(this.heap,e);0>(this.to-e||this.value.endSide-t)&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Fr(this.heap,0)}}}function Fr(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1<e.length&&r.compare(e[i+1])>=0&&(r=e[i+1],i++),0>n.compare(r))break;e[i]=n,e[t]=r,t=i}}class Fo{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Fi.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&0>(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t);)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Fl(this.active,e),Fl(this.activeTo,e),Fl(this.activeRank,e),this.minActive=Fc(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t<this.activeRank.length&&(r-this.activeRank[t]||i-this.activeTo[t])>0;)t++;Fu(this.active,t,n),Fu(this.activeTo,t,i),Fu(this.activeRank,t,r),e&&Fu(e,t,this.cursor.from),this.minActive=Fc(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&0>(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&Fl(n,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(e.point)if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}else this.addActive(n),this.cursor.next()}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function Fa(e,t,n,i,r,o){e.goto(t),n.goto(i);let a=i+r,s=i,l=i-t,u=!!o.boundChange;for(let t=!1;;){let i=e.to+l-n.to,r=i||e.endSide-n.endSide,c=r<0?e.to+l:n.to,h=Math.min(c,a);if(e.point||n.point?(e.point&&n.point&&B4(e.point,n.point)&&Fs(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(s,h,e.point,n.point),t=!1):(t&&o.boundChange(s),h>s&&!Fs(e.active,n.active)&&o.compareRange(s,h,e.active,n.active),u&&h<a&&(i||e.openEnd(c)!=n.openEnd(c))&&(t=!0)),c>a)break;s=c,r<=0&&e.next(),r>=0&&n.next()}}function Fs(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!B4(e[n],t[n]))return!1;return!0}function Fl(e,t){for(let n=t,i=e.length-1;n<i;n++)e[n]=e[n+1];e.pop()}function Fu(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function Fc(e,t){let n=-1,i=1e9;for(let r=0;r<t.length;r++)0>(t[r]-i||e[r].endSide-e[n].endSide)&&(n=r,i=t[r]);return n}function Fh(e,t,n=e.length){let i=0;for(let r=0;r<n&&r<e.length;)9==e.charCodeAt(r)?(i+=t-i%t,r++):(i++,r=Bo(e,r));return i}function Fd(e,t,n,i){for(let i=0,r=0;;){if(r>=t)return i;if(i==e.length)break;r+=9==e.charCodeAt(i)?n-r%n:1,i=Bo(e,i)}return!0===i?-1:e.length}let Fp="u"<typeof Symbol?"__ͼ":Symbol.for("ͼ"),Ff="u"<typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),Fg="u">typeof globalThis?globalThis:"u">typeof window?window:{};class Fm{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}for(let t in e)!function e(t,r,o,a){let s=[],l=/^@(\w+)\b/.exec(t[0]),u=l&&"keyframes"==l[1];if(l&&null==r)return o.push(t[0]+";");for(let n in r){let a=r[n];if(/&/.test(n))e(n.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((e,t)=>e.concat(t)),a,o);else if(a&&"object"==typeof a){if(!l)throw RangeError("The value of a property ("+n+") should be a primitive value.");e(i(n),a,s,u)}else null!=a&&s.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+a+";")}(s.length||u)&&o.push((n&&!l&&!a?t.map(n):t).join(", ")+" {"+s.join(" ")+"}")}(i(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=Fg[Fp]||1;return Fg[Fp]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let i=e[Ff],r=n&&n.nonce;i?r&&i.setNonce(r):i=new Fy(e,r),i.mount(Array.isArray(t)?t:[t],e)}}let Fv=new Map;class Fy{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let t=Fv.get(n);if(t)return e[Ff]=t;this.sheet=new i.CSSStyleSheet,Fv.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Ff]=this}mount(e,t){let n=this.sheet,i=0,r=0;for(let t=0;t<e.length;t++){let o=e[t],a=this.modules.indexOf(o);if(a<r&&a>-1&&(this.modules.splice(a,1),r--,a=-1),-1==a){if(this.modules.splice(r++,0,o),n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],i++)}else{for(;r<a;)i+=this.modules[r++].rules.length;i+=o.rules.length,r++}}if(n)0>t.adoptedStyleSheets.indexOf(this.sheet)&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var Fx={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Fb={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Fw="u">typeof navigator&&/Mac/.test(navigator.platform),FS="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),F_=0;F_<10;F_++)Fx[48+F_]=Fx[96+F_]=String(F_);for(var F_=1;F_<=24;F_++)Fx[F_+111]="F"+F_;for(var F_=65;F_<=90;F_++)Fx[F_]=String.fromCharCode(F_+32),Fb[F_]=String.fromCharCode(F_);for(var FM in Fx)Fb.hasOwnProperty(FM)||(Fb[FM]=Fx[FM]);function FC(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];"string"==typeof r?e.setAttribute(i,r):null!=r&&(e[i]=r)}t++}for(;t<arguments.length;t++)!function e(t,n){if("string"==typeof n)t.appendChild(document.createTextNode(n));else if(null==n);else if(null!=n.nodeType)t.appendChild(n);else if(Array.isArray(n))for(var i=0;i<n.length;i++)e(t,n[i]);else throw RangeError("Unsupported child node: "+n)}(e,arguments[t]);return e}let FA="u">typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},Fk="u">typeof document?document:{documentElement:{style:{}}},FT=/Edge\/(\d+)/.exec(FA.userAgent),FD=/MSIE \d/.test(FA.userAgent),FI=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(FA.userAgent),FO=!!(FD||FI||FT),FP=!FO&&/gecko\/(\d+)/i.test(FA.userAgent),FE=!FO&&/Chrome\/(\d+)/.exec(FA.userAgent),FR="webkitFontSmoothing"in Fk.documentElement.style,FL=!FO&&/Apple Computer/.test(FA.vendor),FN=FL&&(/Mobile\/\w+/.test(FA.userAgent)||FA.maxTouchPoints>2);var FB={mac:FN||/Mac/.test(FA.platform),windows:/Win/.test(FA.platform),linux:/Linux|X11/.test(FA.platform),ie:FO,ie_version:FD?Fk.documentMode||6:FI?+FI[1]:FT?+FT[1]:0,gecko:FP,gecko_version:FP?+(/Firefox\/(\d+)/.exec(FA.userAgent)||[0,0])[1]:0,chrome:!!FE,chrome_version:FE?+FE[1]:0,ios:FN,android:/Android\b/.test(FA.userAgent),webkit:FR,webkit_version:FR?+(/\bAppleWebKit\/(\d+)/.exec(FA.userAgent)||[0,0])[1]:0,safari:FL,safari_version:FL?+(/\bVersion\/(\d+(\.\d+)?)/.exec(FA.userAgent)||[0,0])[1]:0,tabSize:null!=Fk.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function FF(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}let Fz=Object.create(null);function FV(e,t,n){if(e==t)return!0;e||(e=Fz),t||(t=Fz);let i=Object.keys(e),r=Object.keys(t);if(i.length-(n&&i.indexOf(n)>-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let o of i)if(o!=n&&(-1==r.indexOf(o)||e[o]!==t[o]))return!1;return!0}function Fj(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,"style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}class FH{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return -1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var FW=((O=FW||(FW={}))[O.Text=0]="Text",O[O.WidgetBefore=1]="WidgetBefore",O[O.WidgetAfter=2]="WidgetAfter",O[O.WidgetRange=3]="WidgetRange",O);class FG extends B3{constructor(e,t,n,i){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=i}get heightRelevant(){return!1}static mark(e){return new F$(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Fq(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,i;if(e.isBlockGap)n=-5e8,i=4e8;else{let{start:r,end:o}=FY(e,t);n=(r?t?-3e8:-1:5e8)-1,i=(o?t?2e8:1:-6e8)+1}return new Fq(e,n,i,t,e.widget||null,!0)}static line(e){return new FU(e)}static set(e,t=!1){return B7.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}FG.none=B7.empty;class F$ extends FG{constructor(e){let{start:t,end:n}=FY(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?FF(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Fz}eq(e){return this==e||e instanceof F$&&this.tagName==e.tagName&&FV(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw RangeError("Mark decorations may not be empty");return super.range(e,t)}}F$.prototype.point=!1;class FU extends FG{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof FU&&this.spec.class==e.spec.class&&FV(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}FU.prototype.mapMode=Bc.TrackBefore,FU.prototype.point=!0;class Fq extends FG{constructor(e,t,n,i,r,o){super(t,n,r,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?Bc.TrackBefore:Bc.TrackAfter:Bc.TrackDel}get type(){return this.startSide!=this.endSide?FW.WidgetRange:this.startSide<=0?FW.WidgetBefore:FW.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){var t,n;return e instanceof Fq&&(t=this.widget,t==(n=e.widget)||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function FY(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return null==n&&(n=e.inclusive),null==i&&(i=e.inclusive),{start:null!=n?n:t,end:null!=i?i:t}}function FZ(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}Fq.prototype.point=!0;class FX extends B3{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(e){return e==this||e instanceof FX&&this.tagName==e.tagName&&FV(this.attributes,e.attributes)}static create(e){return new FX(e.tagName,e.attributes||Fz,null==e.rank?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return B7.of(e,t)}}function FK(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function FQ(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function FJ(e,t){if(!t.anchorNode)return!1;try{return FQ(e,t.anchorNode)}catch(e){return!1}}function F0(e){return 3==e.nodeType?zn(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function F1(e,t,n,i){return!!n&&(F3(e,t,n,i,-1)||F3(e,t,n,i,1))}function F2(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function F5(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function F3(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:F4(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=F2(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType||1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?F4(e):0}}}function F4(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function F6(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function F8(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||1>Math.abs(t.width-e.offsetWidth))&&(n=1),(i>.995&&i<1.005||!isFinite(i)||1>Math.abs(t.height-e.offsetHeight))&&(i=1),{scaleX:n,scaleY:i}}function F9(e,t=!0){let n=e.ownerDocument,i=null,r=null;for(let o=e.parentNode;o;)if(o==n.body||(!t||i)&&r)break;else if(1==o.nodeType)!r&&o.scrollHeight>o.clientHeight&&(r=o),t&&!i&&o.scrollWidth>o.clientWidth&&(i=o),o=o.assignedSlot||o.parentNode;else if(11==o.nodeType)o=o.host;else break;return{x:i,y:r}}FX.prototype.startSide=FX.prototype.endSide=-1;class F7{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?F4(t):0),n,Math.min(e.focusOffset,n?F4(n):0))}set(e,t,n,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=i}}let ze=null;function zt(e){if(e.setActive)return e.setActive();if(ze)return e.focus(ze);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==ze?{get preventScroll(){return ze={preventScroll:!0},!0}}:void 0),!ze){ze=!1;for(let e=0;e<t.length;){let n=t[e++],i=t[e++],r=t[e++];n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}}}function zn(e,t,n=t){let i=r||(r=document.createRange());return i.setEnd(e,n),i.setStart(e,t),i}function zi(e,t,n,i){let r={key:t,code:t,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let o=new KeyboardEvent("keydown",r);o.synthetic=!0,e.dispatchEvent(o);let a=new KeyboardEvent("keyup",r);return a.synthetic=!0,e.dispatchEvent(a),o.defaultPrevented||a.defaultPrevented}function zr(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function zo(e,t){for(let n=e,i=t;;)if(3==n.nodeType&&i>0)return{node:n,offset:i};else if(1==n.nodeType&&i>0){if("false"==n.contentEditable)return null;i=F4(n=n.childNodes[i-1])}else{if(!n.parentNode||F5(n))return null;i=F2(n),n=n.parentNode}}function za(e,t){for(let n=e,i=t;;)if(3==n.nodeType&&i<n.nodeValue.length)return{node:n,offset:i};else if(1==n.nodeType&&i<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[i],i=0}else{if(!n.parentNode||F5(n))return null;i=F2(n)+1,n=n.parentNode}}FB.safari&&FB.safari_version>=26&&(ze=!1);class zs{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new zs(e.parentNode,F2(e),t)}static after(e,t){return new zs(e.parentNode,F2(e)+1,t)}}var zl=((P=zl||(zl={}))[P.LTR=0]="LTR",P[P.RTL=1]="RTL",P);let zu=zl.LTR,zc=zl.RTL;function zh(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}let zd=zh("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),zp=zh("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),zf=Object.create(null),zg=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);zf[t]=n,zf[n]=-t}function zm(e){return e<=247?zd[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?zp[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}let zv=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class zy{get dir(){return this.level%2?zc:zu}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,i){let r=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=t&&a.to>=t){if(a.level==n)return o;(r<0||(0!=i?i<0?a.from<t:a.to>t:e[r].level>a.level))&&(r=o)}}if(r<0)throw RangeError("Index out of range");return r}}let zx=[];function zb(e){return[new zy(0,e,0)]}let zw="",zS=B_.define(),z_=B_.define(),zM=B_.define(),zC=B_.define(),zA=B_.define(),zk=B_.define(),zT=B_.define(),zD=B_.define(),zI=B_.define(),zO=B_.define({combine:e=>e.some(e=>e)}),zP=B_.define({combine:e=>e.some(e=>e)}),zE=B_.define();class zR{constructor(e,t,n,i,r,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=i,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new zR(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new zR(Bb.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}let zL=BY.define({map:(e,t)=>e.map(t)}),zN=BY.define();function zB(e,t,n){let i=e.facet(zC);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}let zF=B_.define({combine:e=>!e.length||e[0]}),zz=0,zV=B_.define({combine:e=>e.filter((t,n)=>{for(let i=0;i<n;i++)if(e[i].plugin==t.plugin)return!1;return!0})});class zj{constructor(e,t,n,i,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=i,this.baseExtensions=r(this),this.extension=this.baseExtensions.concat(zV.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(zV.of({plugin:this,arg:e}))}static define(e,t){let{eventHandlers:n,eventObservers:i,provide:r,decorations:o}=t||{};return new zj(zz++,e,n,i,e=>{let t=[];return o&&t.push(z$.of(t=>{let n=t.plugin(e);return n?o(n):FG.none})),r&&t.push(r(e)),t})}static fromClass(e,t){return zj.define((t,n)=>new e(t,n),t)}}class zH{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(zB(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){zB(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null==(t=this.value)?void 0:t.destroy)try{this.value.destroy()}catch(t){zB(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}let zW=B_.define(),zG=B_.define(),z$=B_.define(),zU=B_.define(),zq=B_.define(),zY=B_.define(),zZ=B_.define();function zX(e,t){let n=e.state.facet(zZ);if(!n.length)return n;let i=n.map(t=>t instanceof Function?t(e):t),r=[];return B7.spans(i,t.from,t.to,{point(){},span(e,n,i,o){let a=e-t.from,s=n-t.from,l=r;for(let e=i.length-1;e>=0;e--,o--){let n=i[e].spec.bidiIsolate,r;if(null==n&&(n=function(e,t,n){for(let i=t;i<n;i++){let t=zm(e.charCodeAt(i));if(1==t)break;if(2==t||4==t)return zc}return zu}(t.text,a,s)),o>0&&l.length&&(r=l[l.length-1]).to==a&&r.direction==n)r.to=s,l=r.inner;else{let e={from:a,to:s,direction:n,inner:[]};l.push(e),l=e.inner}}}}),r}let zK=B_.define();function zQ(e){let t=0,n=0,i=0,r=0;for(let o of e.state.facet(zK)){let a=o(e);a&&(null!=a.left&&(t=Math.max(t,a.left)),null!=a.right&&(n=Math.max(n,a.right)),null!=a.top&&(i=Math.max(i,a.top)),null!=a.bottom&&(r=Math.max(r,a.bottom)))}return{left:t,right:n,top:i,bottom:r}}let zJ=B_.define();class z0{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}join(e){return new z0(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>n.toA)){if(i.toA<n.fromA)break;n=n.join(i),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let i=0,r=0,o=0;;){let a=Math.min(i<e.length?e[i].fromB:1e9,r<t.length?t[r]:1e9);if(1e9==a)break;let s=a+o,l=a,u=s;for(;;)if(r<t.length&&t[r]<=l){let n=t[r+1];r+=2,l=Math.max(l,n);for(let t=i;t<e.length&&e[t].fromB<=l;t++)o=e[t].toA-e[t].toB;u=Math.max(u,n+o)}else if(i<e.length&&e[i].fromB<=l){let t=e[i++];l=Math.max(l,t.toB),u=Math.max(u,t.toA),o=t.toA-t.toB}else break;n.push(new z0(s,u,a,l))}return n}}class z1{constructor(e,t,n){for(let i of(this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Bd.empty(this.startState.doc.length),n))this.changes=this.changes.compose(i.changes);let i=[];this.changes.iterChangedRanges((e,t,n,r)=>i.push(new z0(e,t,n,r))),this.changedRanges=i}static create(e,t,n){return new z1(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}let z2=[];class z5{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return z2}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,4&this.flags){this.flags&=-5;let e=this.domAttrs;e&&function(e,t){for(let n=e.attributes.length-1;n>=0;n--){let i=e.attributes[n].name;null==t[i]&&e.removeAttribute(i)}for(let n in t){let i=t[n];"style"==n?e.style.cssText=i:e.getAttribute(n)!=i&&e.setAttribute(n,i)}}(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=F2(this.dom),i=this.length?e>0:t>0;return new zs(this.parent.dom,n+ +!!i,0==e||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof z6)return e;return null}static get(e){return e.cmTile}}class z3 extends z5{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(2&this.flags)return;super.sync(e);let t=this.dom,n=null,i,r=(null==e?void 0:e.node)==t?e:null,o=0;for(let a of this.children){if(a.sync(e),o+=a.length+a.breakAfter,i=n?n.nextSibling:t.firstChild,r&&i!=a.dom&&(r.written=!0),a.dom.parentNode==t)for(;i&&i!=a.dom;)i=z4(i);else t.insertBefore(a.dom,i);n=a.dom}for(i=n?n.nextSibling:t.firstChild,r&&i&&(r.written=!0);i;)i=z4(i);this.length=o}}function z4(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class z6 extends z3{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=z5.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,i=0,r=0;;)if(i==n.children.length){if(!t.length)return;(n=n.parent).breakAfter&&r++,i=t.pop()}else{let o=n.children[i++];if(o instanceof z8)t.push(i),n=o,i=0;else{let t=r+o.length,n=e(o,r);if(void 0!==n)return n;r=t+o.breakAfter}}}resolveBlock(e,t){let n,i=-1,r,o=-1;if(this.blockTiles((a,s)=>{let l=s+a.length;if(e>=s&&e<=l){if(a.isWidget()&&t>=-1&&t<=1){if(32&a.flags)return!0;16&a.flags&&(n=void 0)}(s<e||e==l&&(t<-1?a.length:a.covers(1)))&&(!n||!a.isWidget()&&n.isWidget())&&(n=a,i=e-s),(l>e||e==s&&(t>1?a.length:a.covers(-1)))&&(!r||!a.isWidget()&&r.isWidget())&&(r=a,o=e-s)}}),!n&&!r)throw Error("No tile at position "+e);return n&&t<0||!r?{tile:n,offset:i}:{tile:r,offset:o}}}class z8 extends z3{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return!!this.children.length&&(e<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(e,t){let n=new z8(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class z9 extends z3{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let i=new z9(t||document.createElement("div"),e);return t&&n||(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let i=null,r=-1,o=null,a=-1;!function e(s,l){for(let u=0,c=0;u<s.children.length&&c<=l;u++){let h=s.children[u],d=c+h.length;d>=l&&(h.isComposite()?e(h,l-c):(!o||o.isHidden&&(t>0||n&&function(e,t){let n=e.coordsIn(0,1),i=t.coordsIn(0,1);return n&&i&&i.top<n.bottom}(o,h)))&&(d>l||32&h.flags)?(o=h,a=l-c):(c<l||16&h.flags&&!h.isHidden)&&(i=h,r=l-c)),c=d}}(this,e);let s=(t<0?i:o)||i||o;return s?{tile:s,offset:s==i?r:a}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=F0(t);return n[n.length-1]||null}(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:i}=n;if(this.dom.contains(e.dom))return e.isText()?new zs(e.dom,Math.min(e.dom.nodeValue.length,i)):e.domPosFor(i,16&e.flags?1:32&e.flags?-1:t);let r=n.tile.parent,o=!1;for(let e of r.children){if(o)return new zs(e.dom,0);e==n.tile&&(o=!0)}}return new zs(this.dom,0)}}class z7 extends z3{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new z7(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class Ve extends z5{constructor(e,t){super(e,t.length),this.text=t}sync(e){2&this.flags||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let i=e,r=e,o=0;0==e&&t<0||e==n&&t>=0?!(FB.chrome||FB.gecko)&&(e?(i--,o=1):r<n&&(r++,o=-1)):t<0?i--:r<n&&r++;let a=zn(this.dom,i,r).getClientRects();if(!a.length)return null;let s=a[(o?o<0:t>=0)?0:a.length-1];return FB.safari&&!o&&0==s.width&&(s=Array.prototype.find.call(a,e=>e.width)||s),o?F6(s,o<0):s||null}static of(e,t){let n=new Ve(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class Vt extends z5{constructor(e,t,n,i){super(e,t,i),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return!(48&this.flags)&&(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;if(n)return F6(this.dom.getBoundingClientRect(),this.length?0==e:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let i=!!(16&this.flags)||!(32&this.flags)&&e>0;for(let r=i?t.length-1:0;n=t[r],e>0?0!=r:r!=t.length-1&&!(n.top<n.bottom);r+=i?-1:1);return F6(n,!i)}}get overrideDOMText(){if(!this.length)return N6.empty;let{root:e}=this;if(!e)return N6.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,n,i,r){return!r&&(r=e.toDOM(t),e.editable||(r.contentEditable="false")),new Vt(r,n,e,i)}}class Vn extends z5{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return N6.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class Vi{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:i,index:r,beforeBreak:o,parents:a}=this;for(;e||t>0;)if(i.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(r==i.children.length){if(!e&&!a.length)break;n&&n.leave(i),o=!!i.breakAfter,({tile:i,index:r}=a.pop()),r++}else{let s=i.children[r],l=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||!1!==n.skip(s,0,s.length)||!s.isComposite)?(o=!!l,r++,e-=s.length):(a.push({tile:i,index:r}),i=s,r=0,n&&s.isComposite()&&n.enter(s))}else if(r==i.length)o=!!i.breakAfter,({tile:i,index:r}=a.pop()),r++;else if(e){let t=Math.min(e,i.length-r);n&&n.skip(i,r,r+t),e-=t,r+=t}else break;return this.tile=i,this.index=r,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class Vr{constructor(e,t,n,i){this.from=e,this.to=t,this.wrapper=n,this.rank=i}}class Vo{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,i){var r;this.flushBuffer();let o=this.ensureMarks(t,n),a=o.lastChild;a&&a.isText()&&!(8&a.flags)&&a.length+e.length<512?(this.cache.reused.set(a,2),(o.children[o.children.length-1]=new Ve(a.dom,a.text+e)).parent=o):o.append(i||Ve.of(e,null==(r=this.cache.find(Ve))?void 0:r.dom)),this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?Vd(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let i=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],r=i.lastChild;if(r instanceof z7&&r.mark.eq(n.mark))r.dom!=n.dom&&r.setDOM(Vd(n.dom)),i=r;else{if(this.cache.reused.get(n)){let e=z5.get(n.dom);e&&e.setDOM(Vd(n.dom))}let e=z7.of(n.mark,n.dom);i.append(e),i=e}this.cache.reused.set(n,2)}let r=z5.get(e.text);r&&this.cache.reused.set(r,2);let o=new Ve(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,i.append(o)}addInlineWidget(e,t,n){let i=this.afterWidget&&48&e.flags&&(48&this.afterWidget.flags)==(48&e.flags);i||this.flushBuffer();let r=this.ensureMarks(t,n);i||16&e.flags||r.append(this.getBuffer(1)),r.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var n;e||(e=Vh);let i=z9.start(e,t||(null==(n=this.cache.find(z9))?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var n;let i=this.curLine;for(let r=e.length-1;r>=0;r--){let o=e[r],a;if(t>0&&(a=i.lastChild)&&a instanceof z7&&a.mark.eq(o))i=a,t--;else{let e=z7.of(o,null==(n=this.cache.find(z7,e=>e.mark.eq(o)))?void 0:n.dom);i.append(e),i=e,t=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Vc(this.curLine,!1)||"BR"!=e.dom.nodeName&&e.isWidget()&&!(FB.ios&&Vc(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Vf,0,32)||new Vt(Vf.toDOM(),0,Vf,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=102*e.rank+e.value.rank,n=new Vr(e.from,e.to,e.value,t),i=this.wrappers.length;for(;i>0&&0>(this.wrappers[i-1].rank-n.rank||this.wrappers[i-1].to-n.to);)i--;this.wrappers.splice(i,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let i=t.lastChild;if(n.from<this.pos&&i instanceof z8&&i.wrapper.eq(n.wrapper))t=i;else{let i=z8.of(n.wrapper,null==(e=this.cache.find(z8,e=>e.wrapper.eq(n.wrapper)))?void 0:e.dom);t.append(i),t=i}}return t}blockPosCovered(){let e=this.lastBlock;return null!=e&&!e.breakAfter&&(!e.isWidget()||(160&e.flags)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(Vn,void 0,1);return n&&(n.flags=t),n||new Vn(t)}flushBuffer(){this.afterWidget&&!(32&this.afterWidget.flags)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Va{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:i}=this.cursor.next(this.skipCount);if(this.skipCount=0,i)throw Error("Ran out of text content when drawing inline views");this.text=t;let r=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,r)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}let Vs=[Vt,z9,Ve,z7,Vn,z8,z6];for(let e=0;e<Vs.length;e++)Vs[e].bucket=e;class Vl{constructor(e){this.view=e,this.buckets=Vs.map(()=>[]),this.index=Vs.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let i=e.bucket,r=this.buckets[i],o=this.index[i];for(let e=r.length-1;e>=0;e--){let a=(e+o)%r.length,s=r[a];if((!t||t(s))&&!this.reused.has(s))return r.splice(a,1),a<o&&this.index[i]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let i=this.buckets[0];if(i.length)for(let r=0,o=0;;r++){if(r==i.length){if(o)return null;o=1,r=0}let a=i[r];if(!this.reused.has(a)&&(0==o?a.widget.compare(e):a.widget.constructor==e.constructor&&e.updateDOM(a.dom,this.view,a.widget))){if(i.splice(r,1),r<this.index[0]&&this.index[0]--,a.widget==e&&a.length==t&&(497&a.flags)==n)return this.reused.set(a,1),a;return this.reused.set(a,2),new Vt(a.dom,t,e,-498&a.flags|n)}}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class Vu{constructor(e,t,n,i,r){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=r,this.openWidget=!1,this.openMarks=0,this.cache=new Vl(e),this.text=new Va(e.state.doc),this.builder=new Vo(this.cache,new z6(e,e.contentDOM),B7.iter(n)),this.cache.reused.set(t,2),this.old=new Vi(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let i=0,r=0,o=0;;){let a=o<e.length?e[o++]:null,s=a?a.fromA:this.old.root.length;if(s>i){let e=s-i;this.preserve(e,!o,!a),i=s,r+=e}if(!a)break;t&&a.fromA<=t.range.fromA&&a.toA>=t.range.toA?(this.forward(a.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(r,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,a.toA),this.emit(t.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(r,a.toB)),r=a.toB,i=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let i=function(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof z7&&t.push(i.mark)}return t}(this.old),r=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let o=n>0||t<e.length?Vt.of(e.widget,this.view,n-t,496&e.flags,this.cache.maybeReuse(e)):this.cache.reuse(e);256&o.flags?(o.flags&=-2,this.builder.addBlockWidget(o)):(this.builder.ensureLine(null),this.builder.addInlineWidget(o,i,r),r=i.length)}else if(e.isText())this.builder.ensureLine(null),t||n!=e.length||this.cache.reused.has(e)?(this.cache.add(e),this.builder.addText(e.text.slice(t,n),i,r)):this.builder.addText(e.text,i,r,this.cache.reuse(e)),r=i.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof Vn)this.cache.add(e);else{if(!(e instanceof z7))return!1;this.builder.ensureLine(null),this.builder.addMark(e,i,r),this.cache.reused.set(e,1),r=i.length}this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof z7&&i.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?i.length&&(i.length=r=0):e instanceof z7&&(i.shift(),r=Math.min(r,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,i=this.builder,r=0,o=B7.spans(this.decorations,e,t,{point:(e,t,o,a,s,l)=>{var u,c,h;if(o instanceof Fq){if(this.disallowBlockEffectsFor[l]){if(o.block)throw RangeError("Block decorations may not be specified via plugins");if(t>this.view.state.doc.lineAt(e).to)throw RangeError("Decorations that replace line breaks may not be specified via plugins")}if(r=a.length,s>a.length)i.continueWidget(t-e);else{let r,l=o.widget||(o.block?Vp.block:Vp.inline),c=(r=(u=o).isReplace?64*(u.startSide<0)|128*(u.endSide>0):u.startSide>0?32:16,u.block&&(r|=256),r),h=this.cache.findWidget(l,t-e,c)||Vt.of(l,this.view,t-e,c);o.block?(o.startSide>0&&i.addLineStartIfNotCovered(n),i.addBlockWidget(h)):(i.ensureLine(n),i.addInlineWidget(h,a,s))}n=null}else{let e,t;c=n,e=(h=o).spec.attributes,t=h.spec.class,(e||t)&&(c||(c={class:"cm-line"}),e&&FF(e,c),t&&(c.class+=" "+t)),n=c}t>e&&this.text.skip(t-e)},span:(e,t,o,a)=>{for(let r=e;r<t;){let s=this.text.next(Math.min(512,t-r));null==s?(i.addLineStartIfNotCovered(n),i.addBreak(),r++):(i.ensureLine(n),i.addText(s,o,r==e?a:o.length),r+=s.length),n=null}r=o.length}});this.openWidget=o>r,this.openWidget||i.addLineStartIfNotCovered(n),this.openMarks=o}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let i=e.parentNode;;i=i.parentNode){let e=z5.get(i);if(i==this.view.contentDOM)break;e instanceof z7?t.push(e):(null==e?void 0:e.isLine())?n=e:e instanceof z8||("DIV"!=i.nodeName||n||i==this.view.contentDOM?n||t.push(z7.of(new F$({tagName:i.nodeName.toLowerCase(),attributes:function(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let i=e.attributes[n];t[i.name]=i.value}return t}(i)}),i)):n=new z9(i,Vh))}return{line:n,marks:t}}}function Vc(e,t){let n=e=>{for(let i of e.children)if((t?i.isText():i.length)||n(i))return!0;return!1};return n(e)}let Vh={class:"cm-line"};function Vd(e){let t=z5.get(e);return t&&t.setDOM(e.cloneNode()),e}class Vp extends FH{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Vp.inline=new Vp("span"),Vp.block=new Vp("div");let Vf=new class extends FH{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Vg{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=FG.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new z6(e,e.contentDOM),this.updateInner([new z0(0,0,0,e.state.doc.length)],null)}update(e){var t,n,i,r,o,a,s,l,u;let c,h,d,p=e.changedRanges;this.minWidth>0&&p.length&&(p.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let f=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null==(t=this.domChanged)?void 0:t.newSel)?f=this.domChanged.newSel.head:(n=e.changes,i=this.hasComposition,c=!1,i&&n.iterChangedRanges((e,t)=>{e<i.to&&t>i.from&&(c=!0)}),c||e.selectionSet||(f=e.state.selection.main.head)));let g=f>-1?function(e,t,n){let i=Vv(e,n);if(!i)return null;let{node:r,from:o,to:a}=i,s=r.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(i.from,i.to)!=s)return null;let l=t.invertedDesc;return{range:new z0(l.mapPos(o),l.mapPos(a),o,a),text:r}}(this.view,e.changes,f):null;if(this.domChanged=null,this.hasComposition){let{from:t,to:n}=this.hasComposition;p=new z0(t,n,e.changes.mapPos(t,-1),e.changes.mapPos(n,1)).addToSet(p.slice())}this.hasComposition=g?{from:g.range.fromB,to:g.range.toB}:null,(FB.ie||FB.chrome)&&!g&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let m=this.decorations,v=this.blockWrappers;this.updateDeco();let y=(r=m,o=this.decorations,a=e.changes,h=new Vy,B7.compare(r,o,a,h),h.changes);y.length&&(p=z0.extendWithRanges(p,y));let x=(s=v,l=this.blockWrappers,u=e.changes,d=new Vx,B7.compare(s,l,u,d),d.changes);return x.length&&(p=z0.extendWithRanges(p,x)),g&&!p.some(e=>e.fromA<=g.range.fromA&&e.toA>=g.range.toA)&&(p=g.range.addToSet(p.slice())),(!(2&this.tile.flags)||0!=p.length)&&(this.updateInner(p,g),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,i=new Vu(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&z5.get(t.text)&&i.cache.reused.set(z5.get(t.text),2),this.tile=i.run(e,t),Vm(n,i.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let i=FB.chrome||FB.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(i),i&&(i.written||n.selectionRange.focusNode!=i.node||!this.tile.dom.contains(i.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof Vb&&i.push(e.dom);n.updateGaps(i)}updateEditContextFormatting(e){for(let t of(this.editContextFormatting=this.editContextFormatting.map(e.changes),e.transactions))for(let e of t.effects)e.is(zN)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){var n;(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,o=r==i,a=!o&&!(this.view.state.facet(zF)||i.tabIndex>-1)&&FJ(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(o||t||a))return;let s=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,u,c;if(l.empty?c=u=this.inlineDOMNearPos(l.anchor,l.assoc||1):(c=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),u=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),FB.gecko&&l.empty&&!this.hasComposition&&1==(n=u).node.nodeType&&n.node.firstChild&&(0==n.offset||"false"==n.node.childNodes[n.offset-1].contentEditable)&&(n.offset==n.node.childNodes.length||"false"==n.node.childNodes[n.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(e,u.node.childNodes[u.offset]||null)),u=c=new zs(e,0),s=!0}let h=this.view.observer.selectionRange;!s&&h.focusNode&&(F1(u.node,u.offset,h.anchorNode,h.anchorOffset)&&F1(c.node,c.offset,h.focusNode,h.focusOffset)||this.suppressWidgetCursorChange(h,l))||(this.view.observer.ignore(()=>{FB.android&&FB.chrome&&i.contains(h.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(h.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let e=FK(this.view.root);if(e)if(l.empty){if(FB.gecko){var t,n;let e=(t=u.node,n=u.offset,1!=t.nodeType?0:(n&&"false"==t.childNodes[n-1].contentEditable?1:0)|2*(n<t.childNodes.length&&"false"==t.childNodes[n].contentEditable));if(e&&3!=e){let t=(1==e?zo:za)(u.node,u.offset);t&&(u=new zs(t.node,t.offset))}}e.collapse(u.node,u.offset),null!=l.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=l.bidiLevel)}else if(e.extend){e.collapse(u.node,u.offset);try{e.extend(c.node,c.offset)}catch(e){}}else{let t=document.createRange();l.anchor>l.head&&([u,c]=[c,u]),t.setEnd(c.node,c.offset),t.setStart(u.node,u.offset),e.removeAllRanges(),e.addRange(t)}a&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,c)),this.impreciseAnchor=u.precise?null:new zs(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new zs(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&F1(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=FK(e.root),{anchorNode:i,anchorOffset:r}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let s=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!s||!l||s.bottom>l.top)return;let u=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(u.node,u.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(i,r)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return 2&this.tile.dom.compareDocumentPosition(e)?0:this.view.state.doc.length;let i=n.posAtStart;if(n.isComposite()){let r;if(e==n.dom)r=n.dom.childNodes[t];else{let i=0==F4(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;0==i&&t.firstChild!=t.lastChild&&(i=e==t.firstChild?-1:1),e=t}r=i<0?e:e.nextSibling}if(r==n.dom.firstChild)return i;for(;r&&!z5.get(r);)r=r.nextSibling;if(!r)return i+n.length;for(let e=0,t=i;;e++){let i=n.children[e];if(i.dom==r)return t;t+=i.length+i.breakAfter}}else if(n.isText())return e==n.dom?i+t:i+(t?n.length:0);else return i}domAtPos(e,t){let{tile:n,offset:i}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(i,t)}inlineDOMNearPos(e,t){let n,i=-1,r=!1,o,a=-1,s=!1;return(this.tile.blockTiles((t,l)=>{if(t.isWidget()){if(32&t.flags&&l>=e)return!0;16&t.flags&&(r=!0)}else{let u=l+t.length;if(l<=e&&(n=t,i=e-l,r=u<e),u>=e&&!o&&(o=t,a=e-l,s=l>e),l>e&&o)return!0}}),n||o)?(r&&o?n=null:s&&n&&(o=null),n&&t<0||!o?n.domIn(i,t):o.domIn(a,t)):this.domAtPos(e,t)}coordsAt(e,t){let{tile:n,offset:i}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof Vb?null:n.coordsInWidget(i,t,!0):n.coordsIn(i,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);return t.isLine()?function e(t,n){if(t.isComposite())for(let i of t.children){if(i.length>=n){let t=e(i,n);if(t)return t}if((n-=i.length)<0)break}else if(t.isText()&&n<t.length){let e=Bo(t.text,n);if(e==n)return null;let i=zn(t.dom,n,e).getClientRects();for(let e=0;e<i.length;e++){let t=i[e];if(e==i.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}(t,n):null}measureVisibleLineHeights(e){let t=[],{from:n,to:i}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,s=this.view.textDirection==zl.LTR,l=0,u=(e,c,h)=>{for(let d=0;d<e.children.length&&!(c>i);d++){let i=e.children[d],p=c+i.length,f=i.dom.getBoundingClientRect(),{height:g}=f;if(h&&!d&&(l+=f.top-h.top),i instanceof z8)p>n&&u(i,c,f);else if(c>=n&&(l>0&&t.push(-l),t.push(g+l),l=0,o)){let e=i.dom.lastChild,t=e?F0(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-f.left:f.right-e.left;n>a&&(a=n,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=p)}}h&&d==e.children.length-1&&(l+=h.bottom-f.bottom),c=p+i.breakAfter}};return u(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return"rtl"==getComputedStyle(t.dom).direction?zl.RTL:zl.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let i of e.children){if(!i.isText()||/[^ -~]/.test(i.text))return;let e=F0(i.dom);if(1!=e.length)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement("div"),n,i,r;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=F0(t.firstChild)[0];n=t.getBoundingClientRect().height,i=e&&e.width?e.width/27:7,r=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:i,textHeight:r}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,i=0;;i++){let r=i==t.viewports.length?null:t.viewports[i],o=r?r.from-1:this.view.state.doc.length;if(o>n){let i=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(FG.replace({widget:new Vb(i),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!r)break;n=r.to+1}return FG.set(e)}updateDeco(){let e=1,t=this.view.state.facet(z$).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,i=this.view.state.facet(zq).map((e,t)=>{let i="function"==typeof e;return i&&(n=!0),i?e(this.view):e});for(i.length&&(this.dynamicDecorationMap[e++]=n,t.push(B7.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(zU).map(e=>"function"==typeof e?e(this.view):e)}scrollIntoView(e){var t;if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(zE))try{if(t(this.view,e.range,e))return!0}catch(e){zB(this.view.state,e,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,null!=(t=n.assoc)?t:n.empty?0:n.head>n.anchor?-1:1),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let o=zQ(this.view),a={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:s,offsetHeight:l}=this.view.scrollDOM;if(!function(e,t,n,i,r,o,a,s){let l=e.ownerDocument,u=l.defaultView||window;for(let c=e,h=!1;c&&!h;)if(1==c.nodeType){let e,d=c==l.body,p=1,f=1;if(d)e=function(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(h=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let t=c.getBoundingClientRect();({scaleX:p,scaleY:f}=F8(c,t)),e={left:t.left,right:t.left+c.clientWidth*p,top:t.top,bottom:t.top+c.clientHeight*f}}let g=0,m=0;if("nearest"==r)t.top<e.top+a?(m=t.top-(e.top+a),n>0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+a)):t.bottom>e.bottom-a&&(m=t.bottom-e.bottom+a,n<0&&t.top-m<e.top&&(m=t.top-(e.top+a)));else{let i=t.bottom-t.top,o=e.bottom-e.top;m=("center"==r&&i<=o?t.top+i/2-o/2:"start"==r||"center"==r&&n<0?t.top-a:t.bottom-o+a)-e.top}if("nearest"==i?t.left<e.left+o?(g=t.left-(e.left+o),n>0&&t.right>e.right+g&&(g=t.right-e.right+o)):t.right>e.right-o&&(g=t.right-e.right+o,n<0&&t.left<e.left+g&&(g=t.left-(e.left+o))):g=("center"==i?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==i==s?t.left-o:t.right-(e.right-e.left)+o)-e.left,g||m)if(d)u.scrollBy(g,m);else{let e=0,n=0;if(m){let e=c.scrollTop;c.scrollTop+=m/f,n=(c.scrollTop-e)*f}if(g){let t=c.scrollLeft;c.scrollLeft+=g/p,e=(c.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&1>Math.abs(e-g)&&(i="nearest"),n&&1>Math.abs(n-m)&&(r="nearest")}if(d)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),c=c.assignedSlot||c.parentNode}else if(11==c.nodeType)c=c.host;else break}(this.view.scrollDOM,a,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,s),-s),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==zl.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(n.head,1);e&&e.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Vm(this.tile)}}function Vm(e,t){let n=null==t?void 0:t.get(e);if(1!=n)for(let i of(null==n&&e.destroy(),e.children))Vm(i,t)}function Vv(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=zo(n.focusNode,n.focusOffset),r=za(n.focusNode,n.focusOffset),o=i||r;if(r&&i&&r.node!=i.node){let t=z5.get(r.node);if(!t||t.isText()&&t.text!=r.node.nodeValue)o=r;else if(e.docView.lastCompositionAfterCursor){let e=z5.get(i.node);!e||e.isText()&&e.text!=i.node.nodeValue||(o=r)}}if(e.docView.lastCompositionAfterCursor=o!=i,!o)return null;let a=t-o.offset;return{from:a,to:a+o.node.nodeValue.length,node:o.node}}let Vy=class{constructor(){this.changes=[]}compareRange(e,t){FZ(e,t,this.changes)}comparePoint(e,t){FZ(e,t,this.changes)}boundChange(e){FZ(e,e,this.changes)}};class Vx{constructor(){this.changes=[]}compareRange(e,t){FZ(e,t,this.changes)}comparePoint(){}boundChange(e){FZ(e,e,this.changes)}}class Vb extends FH{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function Vw(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let e;for(let r of i.type){if(r.from>t)break;if(!(r.to<t)){if(r.from<t&&r.to>t)return r;(!e||r.type==FW.Text&&(e.type!=r.type||(n<0?r.from<t:r.to>t)))&&(e=r)}}return e||i}return i}function VS(e,t,n,i){let r=e.state.doc.lineAt(t.head),o=e.bidiSpans(r),a=e.textDirectionAt(r.from);for(let s=t,l=null;;){let t=function(e,t,n,i,r){var o;let a=i.head-e.from,s=zy.find(t,a,null!=(o=i.bidiLevel)?o:-1,i.assoc),l=t[s],u=l.side(r,n);if(a==u){let e=s+=r?1:-1;if(e<0||e>=t.length)return null;a=(l=t[s=e]).side(!r,n),u=l.side(r,n)}let c=Bo(e.text,a,l.forward(r,n));(c<l.from||c>l.to)&&(c=u),zw=e.text.slice(Math.min(a,c),Math.max(a,c));let h=s==(r?t.length-1:0)?null:t[s+(r?1:-1)];return h&&c==u&&h.level+ +!r<l.level?Bb.cursor(h.side(!r,n)+e.from,h.forward(r,n)?1:-1,h.level):Bb.cursor(c+e.from,l.forward(r,n)?-1:1,l.level)}(r,o,a,s,n),u=zw;if(!t){if(r.number==(n?e.state.doc.lines:1))return s;u="\n",r=e.state.doc.line(r.number+(n?1:-1)),o=e.bidiSpans(r),t=e.visualLineSide(r,!n)}if(l){if(!l(u))return s}else{if(!i)return t;l=i(u)}s=t}}function V_(e,t,n){for(;;){let i=0;for(let r of e)r.between(t-1,t+1,(e,r,o)=>{if(t>e&&t<r){let o=i||n||(t-e<r-t?-1:1);t=o<0?e:r,i=o}});if(!i)return t}}function VM(e,t){let n=null;for(let i=0;i<t.ranges.length;i++){let r=t.ranges[i],o=null;if(r.empty){let t=V_(e,r.from,0);t!=r.from&&(o=Bb.cursor(t,-1))}else{let t=V_(e,r.from,-1),n=V_(e,r.to,1);(t!=r.from||n!=r.to)&&(o=r.undirectional?Bb.undirectionalRange(r.from,r.to):Bb.range(r.from==r.anchor?t:n,r.from==r.head?t:n))}o&&(n||(n=t.ranges.slice()),n[i]=o)}return n?Bb.create(n,t.mainIndex):t}function VC(e,t,n){let i=V_(e.state.facet(zY).map(t=>t(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:Bb.cursor(i,i<n.from?1:-1)}class VA{constructor(e,t){this.pos=e,this.assoc=t}}function Vk(e,t,n,i){let r=e.contentDOM.getBoundingClientRect(),o=r.top+e.viewState.paddingTop,{x:a,y:s}=t,l=s-o,u;for(;;){if(l<0)return new VA(0,1);if(l>e.viewState.docHeight)return new VA(e.state.doc.length,-1);if(u=e.elementAtHeight(l),null==i)break;if(u.type==FW.Text){if(i<0?u.to<e.viewport.from:u.from>e.viewport.to)break;let t=e.docView.coordsAt(i<0?u.from:u.to,i>0?-1:1);if(t&&(i<0?t.top<=l+o:t.bottom>=l+o))break}let t=e.viewState.heightOracle.textHeight/2;l=i>0?u.bottom+t:u.top-t}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==FW.Text){let t=function(e,t,n,i,r){let o=Math.round((i-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;o+=Math.floor((r-n.top-(e.defaultLineHeight-t)*.5)/t)*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(n.from,n.to);return n.from+Fd(a,o,e.state.tabSize)}(e,r,u,a,s);return new VA(t,t==u.from?1:-1)}}if(u.type!=FW.Text)return l<(u.top+u.bottom)/2?new VA(u.from,1):new VA(u.to,-1);let c=e.docView.lineAt(u.from,2);return c&&c.length==u.length||(c=e.docView.lineAt(u.from,-2)),new VT(e,a,s,e.textDirectionAt(u.from)).scanTile(c,u.from)}class VT{constructor(e,t,n,i){this.view=e,this.x=t,this.y=n,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:i}=this.bidiSpansAt(e);return i[zy.find(i,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:i}=this.bidiSpansAt(e);return i[zy.find(i,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:i}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+i.from<t)}scan(e,t,n=!1){let i,r,o=0,a=e.length-1,s=new Set,l=this.bidiIn(e[0],e[a]),u=-1,c=1e9,h;for(;o<a;){let n=a-o,d=o+a>>1;o:if(s.has(d)){let e=o+Math.floor(Math.random()*n);for(let t=0;t<n;t++){if(!s.has(e)){d=e;break o}++e==a&&(e=o)}break}s.add(d);let p=t(d);if(p)for(let t=0;t<p.length;t++){let n=p[t],s=0;if(0!=n.width||!(p.length>1)){if(n.bottom<this.y)(!i||i.bottom<n.bottom)&&(i=n),s=1;else if(n.top>this.y)(!r||r.top>n.top)&&(r=n),s=-1;else{let e=n.left>this.x?this.x-n.left:n.right<this.x?this.x-n.right:0,t=Math.abs(e);t<c&&(u=d,c=t,h=n),e&&(s=e<0==(this.baseDir==zl.LTR)?-1:1)}-1==s&&(!l||this.baseDirAt(e[d],1))?a=d:1==s&&(!l||this.baseDirAt(e[d+1],-1))&&(o=d+1)}}}if(!h){if(!r&&!i)return{i:e[0],after:!1};let n=i&&(!r||this.y-i.bottom<r.top-this.y)?i:r;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(c&&!n){let{top:n,bottom:o}=h;if(i&&i.bottom>(n+n+o)/3)return this.y=i.bottom-1,this.scan(e,t,!0);if(r&&r.top<(n+o+o)/3)return this.y=r.top+1,this.scan(e,t,!0)}let d=(l?this.dirAt(e[u],1):this.baseDir)==zl.LTR;return{i:u,after:this.x>(h.left+h.right)/2==d}}scanText(e,t){let n=[];for(let i=0;i<e.length;i=Bo(e.text,i))n.push(t+i);n.push(t+e.length);let i=this.scan(n,i=>{let r=n[i]-t,o=n[i+1]-t;return zn(e.dom,r,o).getClientRects()});return i.after?new VA(n[i.i+1],-1):new VA(n[i.i],1)}scanTile(e,t){if(!e.length)return new VA(t,1);if(1==e.children.length){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let i=0,r=t;i<e.children.length;i++)n.push(r+=e.children[i].length);let i=this.scan(n,t=>{let n=e.children[t];return 48&n.flags?null:(1==n.dom.nodeType?n.dom:zn(n.dom,0,n.length)).getClientRects()}),r=e.children[i.i],o=n[i.i];return r.isText()?this.scanText(r,o):r.isComposite()?this.scanTile(r,o):i.after?new VA(n[i.i+1],-1):new VA(o,1)}}class VD{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(B2.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+="￿"}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let e=this.text.length;this.readNode(i);let r=z5.get(i),o=i.nextSibling;if(o==t){(null==r?void 0:r.breakAfter)&&!o&&n!=this.view.contentDOM&&this.lineBreak();break}let a=z5.get(o);(r&&a?r.breakAfter:(r?r.breakAfter:F5(i))||F5(o)&&("BR"!=i.nodeName||(null==r?void 0:r.isWidget()))&&this.text.length>e)&&!function(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=z5.get(e);if(!(null==t?void 0:t.isWidget()))return!1;t&&(n||(n=[])).push(t)}if(n)for(let e of n){let t=e.overrideDOMText;if(null==t?void 0:t.length)return!1}return!0}(o,t)&&this.lineBreak(),i=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,a;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(a=i.exec(t))&&(r=a.index,o=a[0].length),this.append(t.slice(n,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=o-1);n=r+o}}readNode(e){let t=z5.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(!function(e,t,n){for(;;){if(!t||n<F4(t))return!1;if(t==e)return!0;n=F2(t)+1,t=t.parentNode}}(e,n.node,n.offset)?0:t))}}class VI{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class VO{constructor(e,t,n,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView,a=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=function e(t,n,i,r){if(t.isComposite()){let o=-1,a=-1,s=-1,l=-1;for(let u=0,c=r,h=r;u<t.children.length;u++){let r=t.children[u],d=c+r.length;if(c<n&&d>i)return e(r,n,i,c);if(d>=n&&-1==o&&(o=u,a=c),c>i&&r.dom.parentNode==t.dom){s=u,l=h;break}h=d,c=d+r.breakAfter}return{from:a,to:l<0?r+t.length:l,startDOM:(o?t.children[o-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:s<t.children.length&&s>=0?t.children[s].dom:null}}return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}(e.docView.tile,t,n,0))){let t=r||o?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new VI(n,i)),(r!=n||o!=i)&&t.push(new VI(r,o))),t}(e),n=new VD(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,i=2==e.length?e[1].pos:n;return n>-1&&i>-1?Bb.single(n+t,i+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!FQ(e.contentDOM,t.focusNode)?a.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),i=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!FQ(e.contentDOM,t.anchorNode)?a.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((FB.ios||FB.chrome)&&n!=i&&Math.min(n,i)<=a.main.from&&Math.max(n,i)>=a.main.to&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,i),r=Math.max(n,i),o=s.from-t,a=s.to-r;(0==o||1==o||0==t)&&(0==a||-1==a||r==e.state.doc.length)&&(n=0,i=e.state.doc.length)}if(e.inputState.composing>-1&&a.ranges.length>1)this.newSel=a.replaceRange(Bb.range(i,n));else if(e.lineWrapping&&i==n&&!(a.main.empty&&a.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),i=0;t&&(i=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=Bb.create([Bb.cursor(n,i)])}else this.newSel=Bb.single(i,n)}}}function VP(e,t){let n,{newSel:i}=t,{state:r}=e,o=r.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:i}=t.bounds,s=o.from,l=null;(8===a||FB.android&&t.text.length<i-e)&&(s=o.to,l="end");let u=r.doc.sliceString(e,i,"￿"),c,h;!o.empty&&o.from>=e&&o.to<=i&&(t.typeOver||u!=t.text)&&u.slice(0,o.from-e)==t.text.slice(0,o.from-e)&&u.slice(o.to-e)==t.text.slice(c=t.text.length-(u.length-(o.to-e)))?n={from:o.from,to:o.to,insert:N6.of(t.text.slice(o.from-e,c).split("￿"))}:(h=VR(u,t.text,s-e,l))&&(FB.chrome&&13==a&&h.toB==h.from+2&&"￿￿"==t.text.slice(h.from,h.toB)&&h.toB--,n={from:e+h.from,to:e+h.toA,insert:N6.of(t.text.slice(h.from,h.toB).split("￿"))})}else i&&(!e.hasFocus&&r.facet(zF)||VL(i,o))&&(i=null);if(!n&&!i)return!1;if((FB.mac||FB.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(i&&2==n.insert.length&&(i=Bb.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:N6.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:o.from,to:o.to,insert:r.toText(e.inputState.insertingText)}:FB.chrome&&n&&n.from==n.to&&n.from==o.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(i&&(i=Bb.single(i.main.anchor-1,i.main.head-1)),n={from:o.from,to:o.to,insert:N6.of([" "])}),n)return VE(e,n,i,a);if(!i||VL(i,o))return!1;{let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),"select.pointer"==(n=e.inputState.lastSelectionOrigin)&&(i=VM(r.facet(zY).map(t=>t(e)),i))),e.dispatch({selection:i,scrollIntoView:t,userEvent:n}),!0}}function VE(e,t,n,i=-1){let r;if(FB.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(FB.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&zi(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==i&&t.insert.length<t.to-t.from&&t.to>o.head)&&zi(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&zi(e.contentDOM,"Delete",46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let s=()=>r||(r=function(e,t,n){let i,r=e.state,o=r.selection.main,a=-1;if(t.from==t.to&&t.from<o.from||t.from>o.to){let n=t.from<o.from?-1:1,i=n<0?o.from:o.to,s=V_(r.facet(zY).map(t=>t(e)),i,n);t.from==s&&(a=s)}if(a>-1)i={changes:t,selection:Bb.cursor(t.from+t.insert.length,-1)};else if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=o.from<t.from?r.sliceDoc(o.from,t.from):"",a=o.to>t.to?r.sliceDoc(t.to,o.to):"";i=r.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+a))}else{let a=r.changes(t),s=n&&n.main.to<=a.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=o.to+10&&t.to>=o.to-10){let l=e.state.sliceDoc(t.from,t.to),u,c=n&&Vv(e,n.main.head);if(c){let e=t.insert.length-(t.to-t.from);u={from:c.from,to:c.to-e}}else u=e.state.doc.lineAt(o.head);let h=o.to-t.to;i=r.changeByRange(n=>{if(n.from==o.from&&n.to==o.to)return{changes:a,range:s||n.map(a)};let i=n.to-h,c=i-l.length;if(e.state.sliceDoc(c,i)!=l||i>=u.from&&c<=u.to)return{range:n};let d=r.changes({from:c,to:i,insert:t.insert}),p=n.to-o.to;return{changes:d,range:s?Bb.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(d)}})}else i={changes:a,selection:s&&r.selection.replaceRange(s)}}let s="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=".compose",e.inputState.compositionFirstChange&&(s+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:s,scrollIntoView:!0})}(e,t,n));return e.state.facet(zk).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function VR(e,t,n,i){let r=Math.min(e.length,t.length),o=0;for(;o<r&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==r&&e.length==t.length)return null;let a=e.length,s=t.length;for(;a>0&&s>0&&e.charCodeAt(a-1)==t.charCodeAt(s-1);)a--,s--;if("end"==i){let e=Math.max(0,o-Math.min(a,s));n-=a+e-o}if(a<o&&e.length<t.length){let e=n<=o&&n>=a?o-n:0;o-=e,s=o+(s-a),a=o}else if(s<o){let e=n<=o&&n>=s?o-n:0;o-=e,a=o+(a-s),s=o}return{from:o,toA:a,toB:s}}function VL(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class VN{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,FB.safari&&e.contentDOM.addEventListener("input",()=>null),FB.gecko&&function(e){V4.has(e)||(V4.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}(e.contentDOM.ownerDocument)}handleEvent(e){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=z5.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}(this.view,e)||this.ignoreDuringComposition(e)||"keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,i=e&&e.plugin.domEventHandlers,r=e&&e.plugin.domEventObservers;if(i)for(let e in i){let r=i[e];r&&n(e).handlers.push(VB(t.value,r))}if(r)for(let e in r){let i=r[e];i&&n(e).observers.push(VB(t.value,i))}}for(let e in VW)n(e).handlers.push(VW[e]);for(let e in VG)n(e).observers.push(VG[e]);return t}(e),n=this.handlers,i=this.view.contentDOM;for(let e in t)if("scroll"!=e){let r=!t[e].handlers.length,o=n[e];o&&!o.handlers.length!=r&&(i.removeEventListener(e,this.handleEvent),o=null),o||i.addEventListener(e,this.handleEvent,{passive:r})}for(let e in n)"scroll"==e||t[e]||i.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&0>VV.indexOf(e.keyCode)&&(this.tabFocusMode=-1),FB.android&&FB.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(FB.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(VF.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||Vz.indexOf(e.key)>-1&&e.ctrlKey)){var t;let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&FB.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&(t=this.view.win).visualViewport&&t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85&&(n.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return 229!=e.keyCode&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!(!t||"Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,zi(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&!e.synthetic&&(this.composing>0||!!(FB.safari&&!FB.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function VB(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(e){zB(n.state,e)}}}let VF=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Vz="dthko",VV=[16,17,18,20,91,92,224,225];function Vj(e){return .7*Math.max(0,e)+8}class VH{constructor(e,t,n,i){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=F9(e.contentDOM),this.atoms=e.state.facet(zY).map(t=>t(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(B2.allowMultipleSelections)&&function(e,t){let n=e.state.facet(zS);return n.length?n[0](t):FB.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=FK(e.root);if(!i||0==i.rangeCount)return!0;let r=i.getRangeAt(0).getClientRects();for(let e=0;e<r.length;e++){let n=r[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)&&1==VJ(t)&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&10>(t=this.startEvent,Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))))return;this.select(this.lastEvent=e);let n=0,i=0,r=0,o=0,a=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:s}=this.scrollParents.y.getBoundingClientRect());let l=zQ(this.view);e.clientX-l.left<=r+6?n=-Vj(r-e.clientX):e.clientX+l.right>=a-6&&(n=Vj(e.clientX-a)),e.clientY-l.top<=o+6?i=-Vj(o-e.clientY):e.clientY+l.bottom>=s-6&&(i=Vj(e.clientY-s)),this.setScrollSpeed(n,i)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=VM(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,!1===this.dragging))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}let VW=Object.create(null),VG=Object.create(null),V$=FB.ie&&FB.ie_version<15||FB.ios&&FB.webkit_version<604;function VU(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function Vq(e,t){t=VU(e.state,zD,t);let{state:n}=e,i,r=1,o=n.toText(t),a=o.lines==n.selection.ranges.length;if(null!=V1&&n.selection.ranges.every(e=>e.empty)&&V1==o.toString()){let e=-1;i=n.changeByRange(i=>{let s=n.doc.lineAt(i.from);if(s.from==e)return{range:i};e=s.from;let l=n.toText((a?o.line(r++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:l},range:Bb.cursor(i.from+l.length)}})}else i=a?n.changeByRange(e=>{let t=o.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Bb.cursor(e.from+t.length)}}):n.replaceSelection(o);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function VY(e,t,n,i){if(1==i)return Bb.cursor(t,n);{if(2==i)return function(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),o=t-r.from;if(0==r.length)return Bb.cursor(t);0==o?n=1:o==r.length&&(n=-1);let a=o,s=o;n<0?a=Bo(r.text,o,!1):s=Bo(r.text,o);let l=i(r.text.slice(a,s));for(;a>0;){let e=Bo(r.text,a,!1);if(i(r.text.slice(e,a))!=l)break;a=e}for(;s<r.length;){let e=Bo(r.text,s);if(i(r.text.slice(s,e))!=l)break;s=e}return Bb.undirectionalRange(a+r.from,s+r.from)}(e.state,t,n);let r=e.docView.lineAt(t,n),o=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:o.from,s=r?r.posAtEnd:o.to;return s<e.state.doc.length&&s==o.to&&s++,Bb.undirectionalRange(a,s)}}VG.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},VG.wheel=VG.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},VW.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),VG.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")},VG.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},VW.mousedown=(e,t)=>{var n,i;let r,o,a;if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let s=null;for(let n of e.state.facet(zM))if(s=n(e,t))break;if(s||0!=t.button||(n=e,i=t,r=n.posAndSideAtCoords({x:i.clientX,y:i.clientY},!1),o=VJ(i),a=n.state.selection,s={update(e){e.docChanged&&(r.pos=e.changes.mapPos(r.pos),a=a.map(e.changes))},get(e,t,i){let s=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),l,u=VY(n,s.pos,s.assoc,o);if(r.pos!=s.pos&&!t){let e=VY(n,r.pos,r.assoc,o),t=Math.min(e.from,u.from),i=Math.max(e.to,u.to);u=t<u.from?Bb.range(t,i,u.assoc):Bb.range(i,t,u.assoc)}return t?a.replaceRange(a.main.extend(u.from,u.to,u.assoc)):i&&1==o&&a.ranges.length>1&&(l=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:i,to:r}=e.ranges[n];if(i<=t&&r>=t)return Bb.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n))}return null}(a,s.pos))?l:i?a.addRange(u):Bb.create([u])}}),s){let n=!e.hasFocus;e.inputState.startMouseSelection(new VH(e,t,s,n)),n&&e.observer.ignore(()=>{zt(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),!1===i.dragging}else e.inputState.setSelectionOrigin("select.pointer");return!1};let VZ=FB.ie&&FB.ie_version<=11,VX=null,VK=0,VQ=0;function VJ(e){if(!VZ)return e.detail;let t=VX,n=VQ;return VX=e,VQ=Date.now(),VK=!t||n>Date.now()-400&&2>Math.abs(t.clientX-e.clientX)&&2>Math.abs(t.clientY-e.clientY)?(VK+1)%3:1}function V0(e,t,n,i){let r;if(!(n=VU(e.state,zD,n)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,s=i&&a&&((r=e.state.facet(z_)).length?r[0](t):FB.mac?!t.altKey:!t.ctrlKey)?{from:a.from,to:a.to}:null,l={from:o,insert:n},u=e.state.changes(s?[s,l]:l);e.focus(),e.dispatch({changes:u,selection:{anchor:u.mapPos(o,-1),head:u.mapPos(o,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}VW.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.tile.nearest(t.target);if(i&&i.isWidget()){let e=i.posAtStart,t=e+i.length;(e>=n.to||t<=n.from)&&(n=Bb.undirectionalRange(e,t))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",VU(e.state,zI,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},VW.dragend=e=>(e.inputState.draggedContent=null,!1),VW.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,o=()=>{++r==n.length&&V0(e,t,i.filter(e=>null!=e).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=o,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(i[e]=t.result),o()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return V0(e,t,n,!0),!0}return!1},VW.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=V$?null:t.clipboardData;return n?(Vq(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(!function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),Vq(e,n.value)},50)}(e),!1)};let V1=null;VW.copy=VW.cut=(e,t)=>{if(!FJ(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=function(e){let t=[],n=[],i=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let r=-1;for(let{from:i}of e.selection.ranges){let o=e.doc.lineAt(i);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:VU(e,zI,t.join(e.lineBreak)),ranges:n,linewise:i}}(e.state);if(!n&&!r)return!1;V1=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=V$?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(!function(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}(e,n),!1)};let V2=B$.define();function V5(e,t){let n=[];for(let i of e.facet(zT)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:V2.of(!0)}):null}function V3(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=V5(e.state,t);n?e.dispatch(n):e.update([])}},10)}VG.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),V3(e)},VG.blur=e=>{e.observer.clearSelectionRange(),V3(e)},VG.compositionstart=VG.compositionupdate=e=>{!e.observer.editContext&&(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},VG.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,FB.chrome&&FB.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},VG.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},VW.beforeinput=(e,t)=>{var n,i;let r;if(("insertText"==t.inputType||"insertCompositionText"==t.inputType)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),"insertReplacementText"==t.inputType&&e.observer.editContext){let i=null==(n=t.dataTransfer)?void 0:n.getData("text/plain"),r=t.getTargetRanges();if(i&&r.length){let t=r[0],n=e.posAtDOM(t.startContainer,t.startOffset),o=e.posAtDOM(t.endContainer,t.endOffset);return VE(e,{from:n,to:o,insert:e.state.toText(i)},null),!0}}if(FB.chrome&&FB.android&&(r=VF.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let t=(null==(i=window.visualViewport)?void 0:i.height)||0;setTimeout(()=>{var n;((null==(n=window.visualViewport)?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return FB.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),FB.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>VG.compositionend(e,t),20),!1};let V4=new Set,V6=["pre-wrap","normal","pre-line","break-spaces"],V8=!1;class V9{constructor(e){this.lineWrapping=e,this.doc=N6.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return V6.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let i=e[n];i<0?n++:this.heightSamples[Math.floor(10*i)]||(t=!0,this.heightSamples[Math.floor(10*i)]=!0)}return t}refresh(e,t,n,i,r,o){let a=V6.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=n,this.textHeight=i,this.lineLength=r,s){this.heightSamples={};for(let e=0;e<o.length;e++){let t=o[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return s}}class V7{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class je{constructor(e,t,n,i,r){this.from=e,this.length=t,this.top=n,this.height=i,this._content=r}get type(){return"number"==typeof this._content?FW.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Fq?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new je(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var jt=((E=jt||(jt={}))[E.ByPos=0]="ByPos",E[E.ByHeight=1]="ByHeight",E[E.ByPosNoHeight=2]="ByPosNoHeight",E);class jn{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=2*!!e|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>.001&&(V8=!0),this.height=e)}replace(e,t,n){return jn.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,i){let r=this,o=n.doc;for(let a=i.length-1;a>=0;a--){let{fromA:s,toA:l,fromB:u,toB:c}=i[a],h=r.lineAt(s,jt.ByPosNoHeight,n.setDoc(t),0,0),d=h.to>=l?h:r.lineAt(l,jt.ByPosNoHeight,n,0,0);for(c+=d.to-l,l=d.to;a>0&&h.from<=i[a-1].toA;)s=i[a-1].fromA,u=i[a-1].fromB,a--,s<h.from&&(h=r.lineAt(s,jt.ByPosNoHeight,n,0,0));u+=h.from-s,s=h.from;let p=jc.build(n.setDoc(o),e,u,c);r=ji(r,r.replace(s,l,p))}return r.updateHeight(n,0)}static empty(){return new ja(0,0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,i=0,r=0;for(;;)if(t==n)if(i>2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,i-=r.size}else if(r>2*i){let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,r-=t.size}else break;else if(i<r){let n=e[t++];n&&(i+=n.size)}else{let t=e[--n];t&&(r+=t.size)}let o=0;return null==e[t-1]?(o=1,t--):null==e[t]&&(o=1,n++),new jl(jn.of(e.slice(0,t)),o,jn.of(e.slice(n)))}}function ji(e,t){return e==t?e:(e.constructor!=t.constructor&&(V8=!0),t)}jn.prototype.size=1;let jr=FG.replace({});class jo extends jn{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new je(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,i){return this.spaceAbove&&e<n+this.spaceAbove?new je(i,0,n,this.spaceAbove,jr):this.mainBlock(n,i)}lineAt(e,t,n,i,r){let o=this.mainBlock(i,r);return this.spaceAbove?this.blockAt(0,n,i,r).join(o):o}forEachLine(e,t,n,i,r,o){e<=r+this.length&&t>=r&&o(this.lineAt(0,jt.ByPos,n,i,r))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ja extends jo{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new je(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let i=n[0];return 1==n.length&&(i instanceof ja||i instanceof js&&4&i.flags)&&10>Math.abs(this.length-i.length)?(i instanceof js?i=new ja(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):jn.of(n)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more?this.setMeasuredHeight(i):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class js extends jn{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,r=i-n+1,o,a=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*r);o=t/r,this.length>r+1&&(a=(this.height-t)/(this.length-r-1))}else o=this.height/r;return{firstLine:n,lastLine:i,perLine:o,perChar:a}}blockAt(e,t,n,i){let{firstLine:r,lastLine:o,perLine:a,perChar:s}=this.heightMetrics(t,i);if(t.lineWrapping){let r=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),o=t.doc.lineAt(r),l=a+o.length*s,u=Math.max(n,e-l/2);return new je(o.from,o.length,u,l,0)}{let i=Math.max(0,Math.min(o-r,Math.floor((e-n)/a))),{from:s,length:l}=t.doc.line(r+i);return new je(s,l,n+a*i,a,0)}}lineAt(e,t,n,i,r){if(t==jt.ByHeight)return this.blockAt(e,n,i,r);if(t==jt.ByPosNoHeight){let{from:t,to:i}=n.doc.lineAt(e);return new je(t,i-t,0,0,0)}let{firstLine:o,perLine:a,perChar:s}=this.heightMetrics(n,r),l=n.doc.lineAt(e),u=a+l.length*s,c=l.number-o,h=i+a*c+s*(l.from-r-c);return new je(l.from,l.length,Math.max(i,Math.min(h,i+this.height-u)),u,0)}forEachLine(e,t,n,i,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:a,perLine:s,perChar:l}=this.heightMetrics(n,r);for(let u=e,c=i;u<=t;){let t=n.doc.lineAt(u);if(u==e){let n=t.number-a;c+=s*n+l*(e-r-n)}let i=s+l*t.length;o(new je(t.from,t.length,c,i,0)),c+=i,u=t.to+1}}replace(e,t,n){let i=this.length-t;if(i>0){let e=n[n.length-1];e instanceof js?n[n.length-1]=new js(e.length+i):n.push(null,new js(i-1))}if(e>0){let t=n[0];t instanceof js?n[0]=new js(e+t.length):n.unshift(new js(e-1),null)}return jn.of(n)}decomposeLeft(e,t){t.push(new js(e-1),null)}decomposeRight(e,t){t.push(null,new js(this.length-e-1))}updateHeight(e,t=0,n=!1,i){let r=t+this.length;if(i&&i.from<=t+this.length&&i.more){let n=[],o=Math.max(t,i.from),a=-1;for(i.from>t&&n.push(new js(i.from-t-1).updateHeight(e,t));o<=r&&i.more;){let t=e.doc.lineAt(o).length;n.length&&n.push(null);let r=i.heights[i.index++],s=0;r<0&&(s=-r,r=i.heights[i.index++]),-1==a?a=r:Math.abs(r-a)>=.001&&(a=-2);let l=new ja(t,r,s);l.outdated=!1,n.push(l),o+=t+1}o<=r&&n.push(null,new js(r-o).updateHeight(e,o));let s=jn.of(n);return(a<0||Math.abs(s.height-this.height)>=.001||Math.abs(a-this.heightMetrics(e,t).perLine)>=.001)&&(V8=!0),ji(this,s)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class jl extends jn{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,i){let r=n+this.left.height;return e<r?this.left.blockAt(e,t,n,i):this.right.blockAt(e,t,r,i+this.left.length+this.break)}lineAt(e,t,n,i,r){let o=i+this.left.height,a=r+this.left.length+this.break,s=t==jt.ByHeight?e<o:e<a,l=s?this.left.lineAt(e,t,n,i,r):this.right.lineAt(e,t,n,o,a);if(this.break||(s?l.to<a:l.from>a))return l;let u=t==jt.ByPosNoHeight?jt.ByPosNoHeight:jt.ByPos;return s?l.join(this.right.lineAt(a,u,n,o,a)):this.left.lineAt(a,u,n,i,r).join(l)}forEachLine(e,t,n,i,r,o){let a=i+this.left.height,s=r+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,i,r,o),t>=s&&this.right.forEachLine(e,t,n,a,s,o);else{let l=this.lineAt(s,jt.ByPos,n,i,r);e<l.from&&this.left.forEachLine(e,l.from-1,n,i,r,o),l.to>=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,a,s,o)}}replace(e,t,n){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,n));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let e of n)r.push(e);if(e>0&&ju(r,o-1),t<this.length){let e=r.length;this.decomposeRight(t,r),ju(r,e)}return jn.of(r)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&e>=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?jn.of(this.break?[e,null,t]:[e,t]):(this.left=ji(this.left,e),this.right=ji(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,i){let{left:r,right:o}=this,a=t+r.length+this.break,s=null;return(i&&i.from<=t+r.length&&i.more?s=r=r.updateHeight(e,t,n,i):r.updateHeight(e,t,n),i&&i.from<=a+o.length&&i.more?s=o=o.updateHeight(e,a,n,i):o.updateHeight(e,a,n),s)?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function ju(e,t){let n,i;null==e[t]&&(n=e[t-1])instanceof js&&(i=e[t+1])instanceof js&&e.splice(t-1,3,new js(n.length+1+i.length))}class jc{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof ja?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new ja(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let i=n.widget?n.widget.estimatedHeight:0,r=n.widget?n.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new jo(o,i,n)):(o||r||i>=5)&&this.addLineDeco(i,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new ja(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new js(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ja)return e;let t=new ja(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof ja||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new ja(0,-1,0));let n=e;for(let e of this.nodes)e instanceof ja&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,i){let r=new jc(n,e);return B7.spans(t,n,i,r,0),r.finish(n)}}class jh{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,i){(e<t||n&&n.heightRelevant||i&&i.heightRelevant)&&FZ(e,t,this.changes,5)}}class jd{constructor(e,t,n,i){this.from=e,this.to=t,this.size=n,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],r=t[n];if(i.from!=r.from||i.to!=r.to||i.size!=r.size)return!1}return!0}draw(e,t){return FG.replace({widget:new jp(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class jp extends FH{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class jf{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=jy,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=zl.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(zG).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new V9(n),this.stateDeco=jx(t),this.heightMap=jn.empty().applyChanges(this.stateDeco,N6.empty,this.heightOracle.setDoc(t.doc),[new z0(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=FG.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let i=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>i>=e&&i<=t)){let{from:t,to:n}=this.lineBlockAt(i);e.push(new jg(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?jy:new jb(this.heightOracle,this.heightMap,this.viewports),2*!e.eq(this.scaler)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(jw(e,this.scaler))})}update(e,t=null){var n,i;let r;this.state=e.state;let o=this.stateDeco;this.stateDeco=jx(this.state);let a=e.changedRanges,s=z0.extendWithRanges(a,(n=this.stateDeco,i=e?e.changes:Bd.empty(this.state.doc.length),r=new jh,B7.compare(o,n,i,r,0),r.changes)),l=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);V8=!1,this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=l||V8)&&(e.flags|=2),u?(this.scrollAnchorPos=e.changes.mapPos(u.from,-1),this.scrollAnchorHeight=u.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let c=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<c.from||t.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,t));let h=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(h||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(zP)&&(this.mustEnforceCursorAssoc=!0)}measure(){var e;let t,n,{view:i}=this,r=i.contentDOM,o=window.getComputedStyle(r),a=this.heightOracle,s=o.whiteSpace;this.defaultTextDirection="rtl"==o.direction?zl.RTL:zl.LTR;let l=this.heightOracle.mustRefreshForWrapping(s)||"refresh"===this.mustMeasureContent,u=r.getBoundingClientRect(),c=l||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let h=0,d=0;if(u.width&&u.height){let{scaleX:e,scaleY:t}=F8(r,u);(e>.005&&Math.abs(this.scaleX-e)>.005||t>.005&&Math.abs(this.scaleY-t)>.005)&&(this.scaleX=e,this.scaleY=t,h|=16,l=c=!0)}let p=(parseInt(o.paddingTop)||0)*this.scaleY,f=(parseInt(o.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=f)&&(this.paddingTop=p,this.paddingBottom=f,h|=18),this.editorWidth!=i.scrollDOM.clientWidth&&(a.lineWrapping&&(c=!0),this.editorWidth=i.scrollDOM.clientWidth,h|=16);let g=F9(this.view.contentDOM,!1).y;g!=this.scrollParent&&(this.scrollParent=g,this.scrollAnchorHeight=-1,this.scrollOffset=0);let m=this.getScrollOffset();this.scrollOffset!=m&&(this.scrollAnchorHeight=-1,this.scrollOffset=m),this.scrolledToBottom=zr(this.scrollParent||i.win);let v=(this.printing?function(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}:function(e,t){let n=e.getBoundingClientRect(),i=e.ownerDocument,r=i.defaultView||window,o=Math.max(0,n.left),a=Math.min(r.innerWidth,n.right),s=Math.max(0,n.top),l=Math.min(r.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=i.body;)if(1==t.nodeType){let n=t,i=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=i.overflow){let i=n.getBoundingClientRect();o=Math.max(o,i.left),a=Math.min(a,i.right),s=Math.max(s,i.top),l=Math.min(t==e.parentNode?r.innerHeight:l,i.bottom)}t="absolute"==i.position||"fixed"==i.position?n.offsetParent:n.parentNode}else if(11==t.nodeType)t=t.host;else break;return{left:o-n.left,right:Math.max(o,a)-n.left,top:s-(n.top+t),bottom:Math.max(s,l)-(n.top+t)}})(r,this.paddingTop),y=v.top-this.pixelViewport.top,x=v.bottom-this.pixelViewport.bottom;this.pixelViewport=v;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(c=!0)),!this.inView&&!this.scrollTarget&&(t=(e=i.dom).getBoundingClientRect(),n=e.ownerDocument.defaultView||window,!(t.left<n.innerWidth)||!(t.right>0)||!(t.top<n.innerHeight)||!(t.bottom>0)))return 0;let w=u.width;if((this.contentDOMWidth!=w||this.editorHeight!=i.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=i.scrollDOM.clientHeight,h|=16),c){let e=i.docView.measureVisibleLineHeights(this.viewport);if(a.mustRefreshForHeights(e)&&(l=!0),l||a.lineWrapping&&Math.abs(w-this.contentDOMWidth)>a.charWidth){let{lineHeight:t,charWidth:n,textHeight:r}=i.docView.measureTextSize();(l=t>0&&a.refresh(s,t,n,r,Math.max(5,w/n),e))&&(i.docView.minWidth=0,h|=16)}for(let t of(y>0&&x>0?d=Math.max(y,x):y<0&&x<0&&(d=Math.min(y,x)),V8=!1,this.viewports)){let n=t.from==this.viewport.from?e:i.docView.measureVisibleLineHeights(t);this.heightMap=(l?jn.empty().applyChanges(this.stateDeco,N6.empty,this.heightOracle,[new z0(0,0,0,i.state.doc.length)]):this.heightMap).updateHeight(a,0,l,new V7(t.from,n))}V8&&(h|=2)}let S=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return S&&(2&h&&(h|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),h|=this.updateForViewport()),(2&h||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,i)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,i.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,s=new jg(i.lineAt(o-1e3*n,jt.ByHeight,r,0,0).from,i.lineAt(a+(1-n)*1e3,jt.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=i.lineAt(e,jt.ByPos,r,0,0),a;a="center"==t.y?(o.top+o.bottom)/2-n/2:"start"==t.y||"nearest"==t.y&&e<s.from?o.top:o.bottom-n,s=new jg(i.lineAt(a-500,jt.ByHeight,r,0,0).from,i.lineAt(a+n+500,jt.ByHeight,r,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new jg(this.heightMap.lineAt(n,jt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,jt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,jt.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,jt.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(0==e||i<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||r>=a+Math.max(10,Math.min(n,250)))&&i>o-2e3&&r<a+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let i of e)t.touchesRange(i.from,i.to)||n.push(new jd(t.mapPos(i.from),t.mapPos(i.to),i.size,i.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,i=n?1e4:2e3,r=i>>1,o=i<<1;if(this.defaultTextDirection!=zl.LTR&&!n)return[];let a=[],s=(i,o,l,u)=>{if(o-i<r)return;let c=this.state.selection.main,h=[c.from];for(let e of(c.empty||h.push(c.to),h))if(e>i&&e<o){s(i,e-10,l,u),s(e+10,o,l,u);return}let d=function(e,t){for(let n of e)if(t(n))return n}(e,e=>e.from>=l.from&&e.to<=l.to&&Math.abs(e.from-i)<r&&Math.abs(e.to-o)<r&&!h.some(t=>e.from<t&&e.to>t));if(!d){if(o<l.to&&t&&n&&t.visibleRanges.some(e=>e.from<=o&&e.to>=o)){let e=t.moveToLineBoundary(Bb.cursor(o),!1,!0).head;e>i&&(o=e)}let e=this.gapSize(l,i,o,u),r=n||e<2e6?e:2e6;d=new jd(i,o,e,r)}a.push(d)},l=t=>{var r,a,l;let u,c,h,d,p;if(t.length<o||t.type!=FW.Text)return;let f=(r=t.from,a=t.to,l=this.stateDeco,h=[],d=r,p=0,B7.spans(l,r,a,{span(){},point(e,t){e>d&&(h.push({from:d,to:e}),p+=e-d),d=t}},20),d<a&&(h.push({from:d,to:a}),p+=a-d),{total:p,ranges:h});if(f.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,r=i/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=g){let i=jv(f,g),o=((this.visibleBottom-this.visibleTop)/2+r)/t.height;e=i-o,n=i+o}else e=(this.visibleTop-t.top-r)/t.height,n=(this.visibleBottom-t.top+r)/t.height;u=jm(f,e),c=jm(f,n)}else{let n,r,o=f.total*this.heightOracle.charWidth,a=i*this.heightOracle.charWidth,s=0;if(o>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let l=this.pixelViewport.left+s,h=this.pixelViewport.right+s;if(null!=g){let e=jv(f,g),t=((h-l)/2+a)/o;n=e-t,r=e+t}else n=(l-a)/o,r=(h+a)/o;u=jm(f,n),c=jm(f,r)}u>t.from&&s(t.from,u,t,f),c<t.to&&s(c,t.to,t,f)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(l):l(e);return a}gapSize(e,t,n,i){let r=jv(i,n)-jv(i,t);return this.heightOracle.lineWrapping?e.height*r:i.total*this.heightOracle.charWidth*r}updateLineGaps(e){jd.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=FG.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];B7.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let i=0;if(n.length!=this.visibleRanges.length)i=12;else for(let t=0;t<n.length&&!(8&i);t++){let r=this.visibleRanges[t],o=n[t];(r.from!=o.from||r.to!=o.to)&&(i|=4,e&&e.mapPos(r.from,-1)==o.from&&e.mapPos(r.to,1)==o.to||(i|=8))}return this.visibleRanges=n,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||jw(this.heightMap.lineAt(e,jt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||jw(this.heightMap.lineAt(this.scaler.fromDOM(e),jt.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return jw(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class jg{constructor(e,t){this.from=e,this.to=t}}function jm({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:r}=t[e],o=r-n;if(i<=o)return n+i;i-=o}}function jv(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}let jy={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};function jx(e){let t=e.facet(z$).filter(e=>"function"!=typeof e),n=e.facet(zq).filter(e=>"function"!=typeof e);return n.length&&t.push(B7.join(n)),t}class jb{constructor(e,t,n){let i=0,r=0,o=0;for(let a of(this.viewports=n.map(({from:n,to:r})=>{let o=t.lineAt(n,jt.ByPos,e,0,0).top,a=t.lineAt(r,jt.ByPos,e,0,0).bottom;return i+=a-o,{from:n,to:r,top:o,bottom:a,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i),this.viewports))a.domTop=o+(a.top-r)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),r=a.bottom}toDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return i+(e-n)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);n=r.bottom,i=r.domBottom}}fromDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return n+(e-i)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);n=r.bottom,i=r.domBottom}}eq(e){return e instanceof jb&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to)}}function jw(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new je(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(e=>jw(e,t)):e._content)}let jS=B_.define({combine:e=>e.join(" ")}),j_=B_.define({combine:e=>e.indexOf(!0)>-1}),jM=Fm.newName(),jC=Fm.newName(),jA=Fm.newName(),jk={"&light":"."+jC,"&dark":"."+jA};function jT(e,t,n){return new Fm(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,t=>{if("&"==t)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+" "+t})}let jD=jT("."+jM,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},jk),jI={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},jO=FB.ie&&FB.ie_version<=11;class jP{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new F7,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(FB.ie&&FB.ie_version<=11||FB.ios&&e.composing)&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&FB.android&&!1!==e.constructor.EDIT_CONTEXT&&!(FB.chrome&&FB.chrome_version<126)&&(this.editContext=new jL(e),e.state.facet(zF)&&(e.contentDOM.editContext=this.editContext.editContext)),jO&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var e;(null==(e=this.view.docView)?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){for(let t of(this.gapIntersection.disconnect(),e))this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,i=this.selectionRange;if(n.state.facet(zF)?n.root.activeElement!=this.dom:!FJ(this.dom,i))return;let r=i.anchorNode&&n.docView.tile.nearest(i.anchorNode);if(r&&r.isWidget()&&r.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(FB.ie&&FB.ie_version<=11||FB.android&&FB.chrome)&&!n.state.selection.main.empty&&i.focusNode&&F1(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=FK(e.root);if(!t)return!1;let n=FB.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return jR(e,n)}let n=null;function i(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?jR(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let i=FJ(this.dom,n);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,i=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=i)return!1;for(i=Math.min(i,F4(n));;)if(i){if(1!=n.nodeType)return!1;let e=n.childNodes[i-1];"false"==e.contentEditable?i--:i=F4(n=e)}else{if(n==e)return!0;i=F2(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(11==n.nodeType)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,jI),jO&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),jO&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&zi(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null==(n=this.delayedAndroidKey)?void 0:n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,i=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(i=!0),-1==t?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:i}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),i=this.selectionChanged&&FJ(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new VO(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,i=VP(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!VL(this.view.state.selection,t.newSel.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty("attributes"==e.type),"childList"==e.type){let n=jE(t,e.previousSibling||e.target.previousSibling,-1),i=jE(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(zF)!=e.state.facet(zF)&&(e.view.contentDOM.editContext=e.state.facet(zF)?this.editContext.editContext:null))}destroy(){var e,t,n;for(let i of(this.stop(),null==(e=this.intersection)||e.disconnect(),null==(t=this.gapIntersection)||t.disconnect(),null==(n=this.resizeScroll)||n.disconnect(),this.scrollTargets))i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function jE(e,t,n){for(;t;){let i=z5.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function jR(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,o=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor,1);return F1(a.node,a.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}class jL{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});for(let n in this.handlers.textupdate=n=>{let i=e.state.selection.main,{anchor:r,head:o}=i,a=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:a,drifted:!1});let l=s-a>n.text.length;a==this.from&&r<this.from?a=r:s==this.to&&r>this.to&&(s=r);let u=VR(e.state.sliceDoc(a,s),n.text,(l?i.from:i.to)-a,l?"end":null);if(!u){let t=Bb.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));VL(t,i)||e.dispatch({selection:t,userEvent:"select"});return}let c={from:u.from+a,to:u.toA+a,insert:N6.of(n.text.slice(u.from,u.toB).split("\n"))};if((FB.mac||FB.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(c={from:a,to:s,insert:N6.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let t=this.to-this.from+(c.to-c.from+c.insert.length);VE(e,c,Bb.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),c.from<c.to&&!c.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let i=[],r=null;for(let t=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);t<o;t++){let n=e.coordsForChar(t);r=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||r||new DOMRect,i.push(r)}t.updateCharacterBounds(n.rangeStart,i)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,i=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(i)){let r=this.toEditorPos(e.rangeStart),o=this.toEditorPos(e.rangeEnd);if(r<o){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+" ":"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${/thin/i.test(i)?1:2}px`;n.push(FG.mark({attributes:{style:e}}).range(r,o))}}}e.dispatch({effects:zN.of(FG.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}},this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:e=>{let t=FK(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,i=this.pendingContextChange;return e.changes.iterChanges((r,o,a,s,l)=>{if(n)return;let u=l.length-(o-r);if(i&&o>=i.to)if(i.from==r&&i.to==o&&i.insert.eq(l)){i=this.pendingContextChange=null,t+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(r+=t,(o+=t)<=this.from)this.from+=u,this.to+=u;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+l.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),l.toString()),this.to+=u}t+=u}),i&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent("input.type")&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(n,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class jN{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;for(let t of(this.dispatchTransactions=e.dispatchTransactions||n&&(e=>e.forEach(e=>n(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new jf(this,e.state||B2.create(e)),e.scrollTo&&e.scrollTo.is(zL)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(zV).map(e=>new zH(e)),this.plugins))t.update(this);this.observer=new jP(this),this.inputState=new VN(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Vg(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null==(t=document.fonts)?void 0:t.ready)&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=1==e.length&&e[0]instanceof BZ?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,i,r=this.state;for(let t of e){if(t.startState!=r)throw RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=t.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,a=0,s=null;e.some(e=>e.annotation(V2))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,(s=V5(r,o))||(a=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),((u=this.observer.readChange())&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(u=null)):this.observer.clear(),r.facet(B2.phrases)!=this.state.facet(B2.phrases))return this.setState(r);i=z1.create(this,r,e),i.flags|=a;let c=this.viewState.scrollTarget;try{for(let t of(this.updateState=2,e)){if(c&&(c=c.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection,{x:n,y:i}=this.state.facet(jN.cursorScrollMargin);c=new zR(e.empty?e:Bb.cursor(e.head,e.head>e.anchor?-1:1),"nearest","nearest",i,n)}for(let e of t.effects)e.is(zL)&&(c=e.value.clip(this.state))}this.viewState.update(i,c),this.bidiCache=jz.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(zJ)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(e=>e.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(jS)!=i.state.facet(jS)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(zA))try{e(i)}catch(e){zB(this.state,e,"update listener")}(s||u)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),u&&!VP(this,u)&&l.force&&zi(this.contentDOM,l.key,l.keyCode)})}setState(e){if(0!=this.updateState)throw Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);for(let t of(this.viewState=new jf(this,e),this.plugins=e.facet(zV).map(e=>new zH(e)),this.pluginMap.clear(),this.plugins))t.update(this);this.docView.destroy(),this.docView=new Vg(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(zV),n=e.state.facet(zV);if(t!=n){let i=[];for(let r of n){let n=t.indexOf(r);if(n<0)i.push(new zH(r));else{let t=this.plugins[n];t.mustUpdate=e,i.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){zB(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(o<0)if(zr(n||this.win))r=-1,o=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(i);r=e.from,o=e.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let s=[];4&a||([this.measureRequests,s]=[s,this.measureRequests]);let l=s.map(e=>{try{return e.read(this)}catch(e){return zB(this.state,e),jF}}),u=z1.create(this,this.state,[]),c=!1;u.flags|=a,t?t.flags|=a:t=u,this.updateState=2,!u.empty&&(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),(c=this.docView.update(u))&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(l[e]!=jF)try{let t=s[e];t.write&&t.write(l[e],this)}catch(e){zB(this.state,e)}if(c&&this.docView.updateSelection(!0),!u.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let e=((r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(zA))e(t)}get themeClasses(){return jM+" "+(this.state.facet(j_)?jA:jC)+" "+this.state.facet(jS)}updateAttrs(){let e=jV(this,zW,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(zF)?"true":"false",class:"cm-content",style:`${FB.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),jV(this,zG,t);let n=this.observer.ignore(()=>{let n=Fj(this.contentDOM,this.contentAttrs,t),i=Fj(this.dom,this.editorAttrs,e);return n||i});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(jN.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(zJ);let e=this.state.facet(jN.cspNonce);Fm.mount(this.root,this.styleModules.concat(jD).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if((this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e)&&!(this.measureRequests.indexOf(e)>-1)){if(null!=e.key){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return VC(this,e,VS(this,e,t,n))}moveByGroup(e,t){return VC(this,e,VS(this,e,t,t=>{var n;let i,r;return n=e.head,r=(i=this.state.charCategorizer(n))(t),e=>{let t=i(e);return r==B0.Space&&(r=t),r==t}}))}visualLineSide(e,t){let n=this.bidiSpans(e),i=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return Bb.cursor(r.side(t,i)+e.from,r.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,i){let r=Vw(e,t.head,t.assoc||-1),o=i&&r.type==FW.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(o){let t=e.dom.getBoundingClientRect(),i=e.textDirectionAt(r.from),a=e.posAtCoords({x:n==(i==zl.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(null!=a)return Bb.cursor(a,n?-1:1)}return Bb.cursor(n?r.to:r.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return VC(this,e,function(e,t,n,i){let r=t.head,o=n?1:-1;if(r==(n?e.state.doc.length:0))return Bb.cursor(r,t.assoc);let a=t.goalColumn,s,l=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),c=e.documentTop;if(u)null==a&&(a=u.left-l.left),s=o<0?u.top:u.bottom;else{let t=e.viewState.lineBlockAt(r);null==a&&(a=Math.min(l.right-l.left,e.defaultCharacterWidth*(r-t.from))),s=(o<0?t.top:t.bottom)+c}let h=l.left+a,d=e.viewState.heightOracle.textHeight>>1,p=null!=i?i:d;for(let t=0;;t+=d){let i=s+(p+t)*o,r=Vk(e,{x:h,y:i},!1,o);if(n?i>l.bottom:i<l.top)return Bb.cursor(r.pos,r.assoc);let u=e.coordsAtPos(r.pos,r.assoc),c=u?(u.top+u.bottom)/2:0;if(!u||(n?c>s:c<s))return Bb.cursor(r.pos,r.assoc,void 0,a)}}(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=Vk(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Vk(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let i=this.state.doc.lineAt(e),r=this.bidiSpans(i);return F6(n,r[zy.find(r,e-i.from,-1,t)].dir==zl.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(zO)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>jB)return zb(e.length);let t=this.textDirectionAt(e.from),n;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==t&&(i.fresh||function e(t,n){if(t.length!=n.length)return!1;for(let i=0;i<t.length;i++){let r=t[i],o=n[i];if(r.from!=o.from||r.to!=o.to||r.direction!=o.direction||!e(r.inner,o.inner))return!1}return!0}(i.isolates,n=zX(this,e))))return i.order;n||(n=zX(this,e));let i=function(e,t,n){if(!e)return[new zy(0,0,+(t==zc))];if(t==zu&&!n.length&&!zv.test(e))return zb(e.length);if(n.length)for(;e.length>zx.length;)zx[zx.length]=256;let i=[],r=+(t!=zu);return function e(t,n,i,r,o,a,s){let l=n%2?2:1;!function(e,t,n,i,r){for(let o=0;o<=i.length;o++){let a=o?i[o-1].to:t,s=o<i.length?i[o].from:n,l=o?256:r;for(let t=a,n=l,i=l;t<s;t++){let r=zm(e.charCodeAt(t));512==r?r=n:8==r&&4==i&&(r=16),zx[t]=4==r?2:r,7&r&&(i=r),n=r}for(let e=a,t=l,i=l;e<s;e++){let r=zx[e];if(128==r)e<s-1&&t==zx[e+1]&&24&t?r=zx[e]=t:zx[e]=256;else if(64==r){let r=e+1;for(;r<s&&64==zx[r];)r++;let o=e&&8==t||r<n&&8==zx[r]?1==i?1:8:256;for(let t=e;t<r;t++)zx[t]=o;e=r-1}else 8==r&&1==i&&(zx[e]=1);t=r,7&r&&(i=r)}}}(t,o,a,r,l),function(e,t,n,i,r){let o=1==r?2:1;for(let a=0,s=0,l=0;a<=i.length;a++){let u=a?i[a-1].to:t,c=a<i.length?i[a].from:n;for(let t=u,n,i,a;t<c;t++)if(i=zf[n=e.charCodeAt(t)])if(i<0){for(let e=s-3;e>=0;e-=3)if(zg[e+1]==-i){let n=zg[e+2],i=2&n?r:4&n?1&n?o:r:0;i&&(zx[t]=zx[zg[e]]=i),s=e;break}}else if(189==zg.length)break;else zg[s++]=t,zg[s++]=n,zg[s++]=l;else if(2==(a=zx[t])||1==a){let e=a==r;l=+!e;for(let t=s-3;t>=0;t-=3){let n=zg[t+2];if(2&n)break;if(e)zg[t+2]|=2;else{if(4&n)break;zg[t+2]|=4}}}}}(t,o,a,r,l),function(e,t,n,i){for(let r=0,o=i;r<=n.length;r++){let a=r?n[r-1].to:e,s=r<n.length?n[r].from:t;for(let l=a;l<s;){let a=zx[l];if(256==a){let a=l+1;for(;;)if(a==s){if(r==n.length)break;a=n[r++].to,s=r<n.length?n[r].from:t}else if(256==zx[a])a++;else break;let u=1==o,c=u==((a<t?zx[a]:i)==1)?u?1:2:i;for(let t=a,i=r,o=i?n[i-1].to:e;t>l;)t==o&&(t=n[--i].from,o=i?n[i-1].to:e),zx[--t]=c;l=a}else o=a,l++}}}(o,a,r,l),function t(n,i,r,o,a,s,l){let u=o%2?2:1;if(o%2==a%2)for(let c=i,h=0;c<r;){let i=!0,d=!1;if(h==s.length||c<s[h].from){let e=zx[c];e!=u&&(i=!1,d=16==e)}let p=i||1!=u?null:[],f=i?o:o+1,g=c;a:for(;;)if(h<s.length&&g==s[h].from){if(d)break;let t=s[h];if(!i)for(let e=t.to,n=h+1;;){if(e==r)break a;if(n<s.length&&s[n].from==e)e=s[n++].to;else if(zx[e]==u)break a;else break}h++,p?p.push(t):(t.from>c&&l.push(new zy(c,t.from,f)),e(n,t.direction==zu!=!(f%2)?o+1:o,a,t.inner,t.from,t.to,l),c=t.to),g=t.to}else if(g==r||(i?zx[g]!=u:zx[g]==u))break;else g++;p?t(n,c,g,o+1,a,p,l):c<g&&l.push(new zy(c,g,f)),c=g}else for(let c=r,h=s.length;c>i;){let r=!0,d=!1;if(!h||c>s[h-1].to){let e=zx[c-1];e!=u&&(r=!1,d=16==e)}let p=r||1!=u?null:[],f=r?o:o+1,g=c;a:for(;;)if(h&&g==s[h-1].to){if(d)break;let t=s[--h];if(!r)for(let e=t.from,n=h;;){if(e==i)break a;if(n&&s[n-1].to==e)e=s[--n].from;else if(zx[e-1]==u)break a;else break}p?p.push(t):(t.to<c&&l.push(new zy(t.to,c,f)),e(n,t.direction==zu!=!(f%2)?o+1:o,a,t.inner,t.from,t.to,l),c=t.from),g=t.from}else if(g==i||(r?zx[g-1]!=u:zx[g-1]==u))break;else g--;p?t(n,g,c,o+1,a,p,l):g<c&&l.push(new zy(g,c,f)),c=g}}(t,o,a,n,i,r,s)}(e,r,r,n,0,e.length,i),i}(e.text,t,n);return this.bidiCache.push(new jz(e.from,e.to,t,n,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||FB.safari&&(null==(e=this.inputState)?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{zt(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of(this.root.activeElement==this.contentDOM&&this.contentDOM.blur(),this.plugins))e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var n,i,r,o;return zL.of(new zR("number"==typeof e?Bb.cursor(e):e,null!=(n=t.y)?n:"nearest",null!=(i=t.x)?i:"nearest",null!=(r=t.yMargin)?r:5,null!=(o=t.xMargin)?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return zL.of(new zR(Bb.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return zj.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return zj.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Fm.newName(),i=[jS.of(n),zJ.of(jT(`.${n}`,e))];return t&&t.dark&&i.push(j_.of(!0)),i}static baseTheme(e){return BO.lowest(zJ.of(jT("."+jM,e,jk)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),i=n&&z5.get(n)||z5.get(e);return(null==(t=null==i?void 0:i.root)?void 0:t.view)||null}}jN.styleModule=zJ,jN.inputHandler=zk,jN.clipboardInputFilter=zD,jN.clipboardOutputFilter=zI,jN.scrollHandler=zE,jN.focusChangeEffect=zT,jN.perLineTextDirection=zO,jN.exceptionSink=zC,jN.updateListener=zA,jN.editable=zF,jN.mouseSelectionStyle=zM,jN.dragMovesSelection=z_,jN.clickAddsSelectionRange=zS,jN.decorations=z$,jN.blockWrappers=zU,jN.outerDecorations=zq,jN.atomicRanges=zY,jN.bidiIsolatedRanges=zZ,jN.cursorScrollMargin=B_.define({combine:e=>{let t=5,n=5;for(let i of e)"number"==typeof i?t=n=i:{x:t,y:n}=i;return{x:t,y:n}}}),jN.scrollMargins=zK,jN.darkTheme=j_,jN.cspNonce=B_.define({combine:e=>e.length?e[0]:""}),jN.contentAttributes=zG,jN.editorAttributes=zW,jN.lineWrapping=jN.contentAttributes.of({class:"cm-lineWrapping"}),jN.announce=BY.define();let jB=4096,jF={};class jz{constructor(e,t,n,i,r,o){this.from=e,this.to=t,this.dir=n,this.isolates=i,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:zl.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir!=i||t.touchesRange(o.from,o.to)||n.push(new jz(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function jV(e,t,n){for(let i=e.state.facet(t),r=i.length-1;r>=0;r--){let t=i[r],o="function"==typeof t?t(e):t;o&&FF(o,n)}return n}let jj=FB.mac?"mac":FB.windows?"win":FB.linux?"linux":"key";function jH(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}let jW=BO.default(jN.domEventHandlers({keydown:(e,t)=>jZ(jU(t.state),e,t,"editor")})),jG=B_.define({enables:jW}),j$=new WeakMap;function jU(e){let t=e.facet(jG),n=j$.get(t);return n||j$.set(t,n=function(e,t=jj){let n=Object.create(null),i=Object.create(null),r=(e,t)=>{let n=i[e];if(null==n)i[e]=t;else if(n!=t)throw Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=(e,i,o,a,s)=>{var l,u;let c=n[e]||(n[e]=Object.create(null)),h=i.split(/ (?!$)/).map(e=>(function(e,t){let n,i,r,o,a=e.split(/-(?!$)/),s=a[a.length-1];"Space"==s&&(s=" ");for(let e=0;e<a.length-1;++e){let s=a[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))"mac"==t?o=!0:i=!0;else throw Error("Unrecognized modifier name: "+s)}return n&&(s="Alt-"+s),i&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s})(e,t));for(let t=1;t<h.length;t++){let n=h.slice(0,t).join(" ");r(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let i=jq={view:t,prefix:n,scope:e};return setTimeout(()=>{jq==i&&(jq=null)},4e3),!0}]})}let d=h.join(" ");r(d,!1);let p=c[d]||(c[d]={preventDefault:!1,stopPropagation:!1,run:(null==(u=null==(l=c._any)?void 0:l.run)?void 0:u.slice())||[]});o&&p.run.push(o),a&&(p.preventDefault=!0),s&&(p.stopPropagation=!0)};for(let i of e){let e=i.scope?i.scope.split(" "):["editor"];if(i.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:r}=i;for(let t in e)e[t].run.push(e=>r(e,jY))}let r=i[t]||i.key;if(r)for(let t of e)o(t,r,i.run,i.preventDefault,i.stopPropagation),i.shift&&o(t,"Shift-"+r,i.shift,i.preventDefault,i.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[]))),n}let jq=null,jY=null;function jZ(e,t,n,i){var r;jY=t;let o=("Esc"==(r=!(Fw&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||FS&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?Fb:Fx)[t.keyCode]||t.key||"Unidentified")&&(r="Escape"),"Del"==r&&(r="Delete"),"Left"==r&&(r="ArrowLeft"),"Up"==r&&(r="ArrowUp"),"Right"==r&&(r="ArrowRight"),"Down"==r&&(r="ArrowDown"),r),a=Bl(Ba(o,0))==o.length&&" "!=o,s="",l=!1,u=!1,c=!1;jq&&jq.view==n&&jq.scope==i&&(s=jq.prefix+" ",0>VV.indexOf(t.keyCode)&&(u=!0,jq=null));let h=new Set,d=e=>{if(e){for(let t of e.run)if(!h.has(t)&&(h.add(t),t(n)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),u=!0)}return!1},p=e[i],f,g;return p&&(d(p[s+jH(o,t,!a)])?l=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(FB.windows&&t.ctrlKey&&t.altKey)&&!(FB.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(f=Fx[t.keyCode])&&f!=o?d(p[s+jH(f,t,!0)])?l=!0:t.shiftKey&&(g=Fb[t.keyCode])!=o&&g!=f&&d(p[s+jH(g,t,!1)])&&(l=!0):a&&t.shiftKey&&d(p[s+jH(o,t,!0)])&&(l=!0),!l&&d(p._any)&&(l=!0)),u&&(l=!0),l&&c&&t.stopPropagation(),jY=null,l}class jX{constructor(e,t,n,i,r){this.className=e,this.left=t,this.top=n,this.width=i,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(!n.empty)return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),o=e.textDirection==zl.LTR,a=e.contentDOM,s=a.getBoundingClientRect(),l=jK(e),u=a.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),h=s.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=s.right-(c?parseInt(c.paddingRight):0),p=Vw(e,i,1),f=Vw(e,r,-1),g=p.type==FW.Text?p:null,m=f.type==FW.Text?f:null;if(g&&(e.lineWrapping||p.widgetLineBreaks)&&(g=jQ(e,i,1,g)),m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=jQ(e,r,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return y(x(n.from,n.to,g));{let t=g?x(n.from,null,g):b(p,!1),i=m?x(null,n.to,m):b(f,!0),r=[];return(g||p).to<(m||f).from-(g&&m?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<i.top?r.push(v(h,t.bottom,d,i.top)):t.bottom<i.top&&e.elementAtHeight((t.bottom+i.top)/2).type==FW.Text&&(t.bottom=i.top=(t.bottom+i.top)/2),y(t).concat(r).concat(y(i))}function v(e,n,i,r){return new jX(t,e-l.left,n-l.top,Math.max(0,i-e),r-n)}function y({top:e,bottom:t,horizontal:n}){let i=[];for(let r=0;r<n.length;r+=2)i.push(v(n[r],e,n[r+1],t));return i}function x(t,n,i){let r=1e9,a=-1e9,s=[];function l(t,n,l,u,c){let p=e.coordsAtPos(t,t==i.to?-2:2),f=e.coordsAtPos(l,l==i.from?2:-2);p&&f&&(r=Math.min(p.top,f.top,r),a=Math.max(p.bottom,f.bottom,a),c==zl.LTR?s.push(o&&n?h:p.left,o&&u?d:f.right):s.push(!o&&u?h:f.left,!o&&n?d:p.right))}let u=null!=t?t:i.from,c=null!=n?n:i.to;for(let i of e.visibleRanges)if(i.to>u&&i.from<c)for(let r=Math.max(i.from,u),o=Math.min(i.to,c);;){let i=e.state.doc.lineAt(r);for(let a of e.bidiSpans(i)){let e=a.from+i.from,s=a.to+i.from;if(e>=o)break;s>r&&l(Math.max(e,r),null==t&&e<=u,Math.min(s,o),null==n&&s>=c,a.dir)}if((r=i.to+1)>=o)break}return 0==s.length&&l(u,null==t,c,null==n,e.textDirection),{top:r,bottom:a,horizontal:s}}function b(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n);{let i=e.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let r=jK(e);return[new jX(t,i.left-r.left,i.top-r.top,null,i.bottom-i.top)]}}}function jK(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==zl.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function jQ(e,t,n,i){let r=e.coordsAtPos(t,2*n);if(!r)return i;let o=e.dom.getBoundingClientRect(),a=(r.top+r.bottom)/2,s=e.posAtCoords({x:o.left+1,y:a}),l=e.posAtCoords({x:o.right-1,y:a});return null==s||null==l?i:{from:Math.max(i.from,Math.min(s,l)),to:Math.min(i.to,Math.max(s,l))}}class jJ{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(j0)!=e.state.facet(j0)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(j0);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>{var n;return n=this.drawn[t],!(e.constructor==n.constructor&&e.eq(n))})){let t=this.dom.firstChild,n=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[n].constructor&&i.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(i.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,FB.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}let j0=B_.define();function j1(e){return[zj.define(t=>new jJ(t,e)),j0.of(e)]}let j2=B_.define({combine:e=>B5(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function j5(e){return e.startState.facet(j2)!=e.state.facet(j2)}let j3=j1({above:!0,markers(e){let{state:t}=e,n=t.facet(j2),i=[];for(let r of t.selection.ranges){let o=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(o&&FB.ios&&n.iosSelectionHandles)){let t=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=r.empty?r:Bb.cursor(r.head,r.assoc);for(let r of jX.forRange(e,t,n))i.push(r)}}return i},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=j5(e);return n&&j4(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){j4(t.state,e)},class:"cm-cursorLayer"});function j4(e,t){t.style.animationDuration=e.facet(j2).cursorBlinkRate+"ms"}let j6=j1({above:!1,markers(e){let t=[],{main:n,ranges:i}=e.state.selection;for(let n of i)if(!n.empty)for(let i of jX.forRange(e,"cm-selectionBackground",n))t.push(i);if(FB.ios&&!n.empty&&e.state.facet(j2).iosSelectionHandles){for(let i of jX.forRange(e,"cm-selectionHandle cm-selectionHandle-start",Bb.cursor(n.from,1)))t.push(i);for(let i of jX.forRange(e,"cm-selectionHandle cm-selectionHandle-end",Bb.cursor(n.to,1)))t.push(i)}return t},update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||j5(e),class:"cm-selectionLayer"}),j8=BO.highest(jN.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),j9=BY.define({map:(e,t)=>null==e?null:t.mapPos(e)}),j7=BD.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(j9)?t.value:e,e))}),He=zj.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(j7);null==n?null!=this.cursor&&(null==(t=this.cursor)||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(j7)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(j7),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(j7)!=e&&this.view.dispatch({effects:j9.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Ht(e,t,n,i,r){t.lastIndex=0;for(let o=e.iterRange(n,i),a=n,s;!o.next().done;a+=o.value.length)if(!o.lineBreak)for(;s=t.exec(o.value);)r(a+s.index,s)}class Hn{constructor(e){const{regexp:t,decoration:n,decorate:i,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(e,t,n,r)=>i(r,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,i,r)=>{let o=n(e,t,i);o&&r(i,i+e[0].length,o)};else if(n)this.addMatch=(e,t,i,r)=>r(i,i+e[0].length,n);else throw RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new Fe,n=t.add.bind(t);for(let{from:t,to:i}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let i=[];for(let{from:r,to:o}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=o:i.push({from:r,to:o});return i}(e,this.maxLength))Ht(e.state.doc,this.regexp,t,i,(t,i)=>this.addMatch(i,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,i=-1;return(e.docChanged&&e.changes.iterChanges((t,r,o,a)=>{a>=e.view.viewport.from&&o<=e.view.viewport.to&&(n=Math.min(o,n),i=Math.max(a,i))}),e.viewportMoved||i-n>1e3)?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),n,i):t}updateRange(e,t,n,i){for(let r of e.visibleRanges){let o=Math.max(r.from,n),a=Math.min(r.to,i);if(a>=o){let n=e.state.doc.lineAt(o),i=n.to<a?e.state.doc.lineAt(a):n,s=Math.max(r.from,n.from),l=Math.min(r.to,i.to);if(this.boundary){for(;o>n.from;o--)if(this.boundary.test(n.text[o-1-n.from])){s=o;break}for(;a<i.to;a++)if(this.boundary.test(i.text[a-i.from])){l=a;break}}let u=[],c,h=(e,t,n)=>u.push(n.range(e,t));if(n==i)for(this.regexp.lastIndex=s-n.from;(c=this.regexp.exec(n.text))&&c.index<l-n.from;)this.addMatch(c,e,c.index+n.from,h);else Ht(e.state.doc,this.regexp,s,l,(t,n)=>this.addMatch(n,e,t,h));t=t.update({filterFrom:s,filterTo:l,filter:(e,t)=>e<s||t>l,add:u})}}return t}}let Hi=null!=/x/.unicode?"gu":"g",Hr=RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]",Hi),Ho={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},Ha=null,Hs=B_.define({combine(e){let t=B5(e,{render:null,specialChars:Hr,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==Ha&&"u">typeof document&&document.body){let t=document.body.style;Ha=(null!=(e=t.tabSize)?e:t.MozTabSize)!=null}return Ha||!1}())&&(t.specialChars=RegExp(" |"+t.specialChars.source,Hi)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Hi)),t}}),Hl=null;class Hu extends FH{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){var t;let n=(t=this.code)>=32?"•":10==t?"␤":String.fromCharCode(9216+t),i=e.state.phrase("Control character")+" "+(Ho[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let o=document.createElement("span");return o.textContent=n,o.title=i,o.setAttribute("aria-label",i),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class Hc extends FH{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}let Hh=FG.line({class:"cm-activeLine"}),Hd=zj.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(Hh.range(r.from)),t=r.from)}return FG.set(n)}},{decorations:e=>e.decorations});class Hp extends FH{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?F0(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),i=F6(t[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return i.bottom-i.top>1.5*r?{left:i.left,right:i.right,top:i.top,bottom:i.top+r}:i}ignoreEvent(){return!1}}function Hf(e,t){var n;let i,r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(r),a=r-o.from,s=a>2e3?-1:a==o.length?(n=t.clientX,(i=e.coordsAtPos(e.viewport.from))?Math.round(Math.abs((i.left-n)/e.defaultCharacterWidth)):-1):Fh(o.text,e.state.tabSize,r-o.from);return{line:o.number,col:s,off:a}}let Hg={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},Hm={style:"cursor: crosshair"},Hv="-10000px";class Hy{constructor(e,t,n,i){this.facet=t,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let r=null;this.tooltipViews=this.tooltips.map(e=>r=n(e,r))}update(e,t){var n;let i=e.state.facet(this.facet),r=i.filter(e=>e);if(i===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let o=[],a=t?[]:null;for(let n=0;n<r.length;n++){let i=r[n],s=-1;if(i){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==i.create&&(s=e)}if(s<0)o[n]=this.createTooltipView(i,n?o[n-1]:null),a&&(a[n]=!!i.above);else{let i=o[n]=this.tooltipViews[s];a&&(a[n]=t[s]),i.update&&i.update(e)}}}for(let e of this.tooltipViews)0>o.indexOf(e)&&(this.removeTooltipView(e),null==(n=e.destroy)||n.call(e));return t&&(a.forEach((e,n)=>t[n]=e),t.length=a.length),this.input=i,this.tooltips=r,this.tooltipViews=o,!0}}function Hx(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}let Hb=B_.define({combine:e=>{var t,n,i;return{position:FB.ios?"absolute":(null==(t=e.find(e=>e.position))?void 0:t.position)||"fixed",parent:(null==(n=e.find(e=>e.parent))?void 0:n.parent)||null,tooltipSpace:(null==(i=e.find(e=>e.tooltipSpace))?void 0:i.tooltipSpace)||Hx}}}),Hw=new WeakMap,HS=zj.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(Hb);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Hy(e,HA,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver)for(let e of(this.intersectionObserver.disconnect(),this.manager.tooltipViews))this.intersectionObserver.observe(e.dom)}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(Hb);if(i.position!=this.position&&!this.madeAbsolute){for(let e of(this.position=i.position,this.manager.tooltipViews))e.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){for(let e of(this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer(),this.manager.tooltipViews))this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=Hv,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;for(let t of(this.view.win.removeEventListener("resize",this.measureSoon),this.manager.tooltipViews))t.dom.remove(),null==(e=t.destroy)||e.call(t);this.parent&&this.container.remove(),null==(t=this.resizeObserver)||t.disconnect(),null==(n=this.intersectionObserver)||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(FB.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||"absolute"==this.position)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=zQ(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(Hb).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute)for(let e of(this.madeAbsolute=!0,this.position="absolute",this.manager.tooltipViews))e.dom.style.position="absolute";let{visible:n,space:i,scaleX:r,scaleY:o}=e,a=[];for(let s=0;s<this.manager.tooltips.length;s++){let l=this.manager.tooltips[s],u=this.manager.tooltipViews[s],{dom:c}=u,h=e.pos[s],d=e.size[s];if(!h||!1!==l.clip&&(h.bottom<=Math.max(n.top,i.top)||h.top>=Math.min(n.bottom,i.bottom)||h.right<Math.max(n.left,i.left)-.1||h.left>Math.min(n.right,i.right)+.1)){c.style.top=Hv;continue}let p=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,f=7*!!p,g=d.right-d.left,m=null!=(t=Hw.get(u))?t:d.bottom-d.top,v=u.offset||HC,y=this.view.textDirection==zl.LTR,x=d.width>i.right-i.left?y?i.left:i.right-d.width:y?Math.max(i.left,Math.min(h.left-14*!!p+v.x,i.right-g)):Math.min(Math.max(i.left,h.left-g+14*!!p-v.x),i.right-g),b=this.above[s];!l.strictSide&&(b?h.top-m-f-v.y<i.top:h.bottom+m+f+v.y>i.bottom)&&b==i.bottom-h.bottom>h.top-i.top&&(b=this.above[s]=!b);let w=(b?h.top-i.top:i.bottom-h.bottom)-f;if(w<m&&!1!==u.resize){if(w<this.view.defaultLineHeight){c.style.top=Hv;continue}Hw.set(u,m),c.style.height=(m=w)/o+"px"}else c.style.height&&(c.style.height="");let S=b?h.top-m-f-v.y:h.bottom+f+v.y,_=x+g;if(!0!==u.overlap)for(let e of a)e.left<_&&e.right>x&&e.top<S+m&&e.bottom>S&&(S=b?e.top-m-2-f:e.bottom+f+2);if("absolute"==this.position?(c.style.top=(S-e.parent.top)/o+"px",H_(c,(x-e.parent.left)/r)):(c.style.top=S/o+"px",H_(c,x/r)),p){let e=h.left+(y?v.x:-v.x)-(x+14-7);p.style.left=e/r+"px"}!0!==u.overlap&&a.push({left:x,top:S,right:_,bottom:S+m}),c.classList.toggle("cm-tooltip-above",b),c.classList.toggle("cm-tooltip-below",!b),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView)&&(this.inView=this.view.inView,!this.inView))for(let e of this.manager.tooltipViews)e.dom.style.top=Hv}},{eventObservers:{scroll(){this.maybeMeasure()}}});function H_(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}let HM=jN.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),HC={x:0,y:0},HA=B_.define({enables:[HS,HM]}),Hk=B_.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class HT{static create(e){return new HT(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Hy(e,Hk,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null==(e=t.destroy)||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let i=n[e];if(void 0!==i){if(void 0===t)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}let HD=HA.compute([Hk],e=>{let t=e.facet(Hk);return 0===t.length?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var t;return null!=(t=e.end)?t:e.pos})),create:HT.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),HI=B_.define();class HO{constructor(e,t,n,i,r,o){this.view=e,this.source=t,this.field=n,this.locked=i,this.setHover=r,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let i,r=1;if(n.isWidget())i=n.posAtStart;else{if(null==(i=e.posAtCoords(t)))return;let n=e.coordsAtPos(i);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(i)).find(e=>e.from<=i&&e.to>=i),a=o&&o.dir==zl.RTL?-1:1;r=t.x<n.left?-a:a}this.activateHover(e,i,r)}activateHover(e,t,n,i){let r=this.source(e,t,n),o=t=>{if(t&&!(Array.isArray(t)&&!t.length)){let n=Array.isArray(t)?t:[t];i&&this.locked.set(n,i),e.dispatch({effects:this.setHover.of(n)})}};if(r&&"then"in r){let n=this.pending={pos:t};r.then(e=>{this.pending==n&&(this.pending=null,o(e))},t=>zB(e.state,t,"hover tooltip"))}else o(r)}get tooltip(){let e=this.view.plugin(HS),t=e?e.manager.tooltips.findIndex(e=>e.create==HT.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:r}=this;if(i.length&&!this.locked.has(i)&&r&&!function(e,t){let{left:n,right:i,top:r,bottom:o}=e.getBoundingClientRect(),a;if(a=e.querySelector(".cm-tooltip-arrow")){let e=a.getBoundingClientRect();r=Math.min(e.top,r),o=Math.max(e.bottom,o)}return t.clientX>=n-4&&t.clientX<=i+4&&t.clientY>=r-4&&t.clientY<=o+4}(r.dom,e)||this.pending){let{pos:r}=i[0]||this.pending,o=null!=(n=null==(t=i[0])?void 0:t.end)?n:r;(r==o?this.view.posAtCoords(this.lastMove)!=r:!function(e,t,n,i,r){let o=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>i||o.right<i||o.top>r||Math.min(o.bottom,a)<r)return!1;let s=e.posAtCoords({x:i,y:r},!1);return s>=t&&s<=n}(this.view,r,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t);let{active:i}=this;!i.length||this.locked.has(i)||this.view.dom.contains(n.relatedTarget)||this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function HP(e,t){let n=e.plugin(HS);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}let HE=BY.define(),HR=B_.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function HL(e,t){let n=e.plugin(HN),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}let HN=zj.fromClass(class{constructor(e){this.input=e.state.facet(Hz),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(HR);for(let n of(this.top=new HB(e,!0,t.topContainer),this.bottom=new HB(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top)),this.panels))n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(HR);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new HB(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new HB(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(Hz);if(n!=this.input){let t=n.filter(e=>e),i=[],r=[],o=[],a=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),a.push(s)):(s=this.panels[t]).update&&s.update(e),i.push(s),(s.top?r:o).push(s)}for(let e of(this.specs=t,this.panels=i,this.top.sync(r),this.bottom.sync(o),a))e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>jN.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class HB{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&0>e.indexOf(t)&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=HF(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=HF(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function HF(e){let t=e.nextSibling;return e.remove(),t}let Hz=B_.define({enables:HN}),HV=BD.define({create:()=>[],update(e,t){for(let n of t.effects)n.is(Hj)?e=[n.value].concat(e):n.is(HH)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>Hz.computeN([e],t=>t.field(e))}),Hj=BY.define(),HH=BY.define();class HW extends B3{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}HW.prototype.elementClass="",HW.prototype.toDOM=void 0,HW.prototype.mapMode=Bc.TrackBefore,HW.prototype.startSide=HW.prototype.endSide=-1,HW.prototype.point=!0;let HG=B_.define(),H$=B_.define(),HU={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>B7.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Hq=B_.define();function HY(e){return[HX(),Hq.of({...HU,...e})]}let HZ=B_.define({combine:e=>e.some(e=>e)});function HX(e){let t=[HK];return e&&!1===e.fixed&&t.push(HZ.of(!0)),t}let HK=zj.fromClass(class{constructor(e){for(let t of(this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(Hq).map(t=>new H1(e,t)),this.fixed=!e.state.facet(HZ),this.gutters))"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(HZ)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=B7.iter(this.view.state.facet(HG),this.view.viewport.from),i=[],r=this.gutters.map(e=>new H0(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(e.type)){let t=!0;for(let o of e.type)if(o.type==FW.Text&&t){for(let e of(HJ(n,i,o.from),r))e.line(this.view,o,i);t=!1}else if(o.widget)for(let e of r)e.widget(this.view,o)}else if(e.type==FW.Text)for(let t of(HJ(n,i,e.from),r))t.line(this.view,e,i);else if(e.widget)for(let t of r)t.widget(this.view,e);for(let e of r)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(Hq),n=e.state.facet(Hq),i=e.docChanged||e.heightChanged||e.viewportChanged||!B7.eq(e.startState.facet(HG),e.state.facet(HG),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(i=!0);else{i=!0;let r=[];for(let i of n){let n=t.indexOf(i);n<0?r.push(new H1(this.view,i)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),0>r.indexOf(e)&&e.destroy();for(let e of r)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>jN.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||0==n.gutters.length||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==zl.LTR?{left:i,right:r}:{right:i,left:r}})});function HQ(e){return Array.isArray(e)?e:[e]}function HJ(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class H0{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=B7.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:i}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==i.elements.length){let t=new H2(e,o,r,n);i.elements.push(t),i.dom.appendChild(t.dom)}else i.elements[this.i].update(e,o,r,n);this.height=t.bottom,this.i++}line(e,t,n){let i=[];HJ(this.cursor,i,t.from),n.length&&(i=i.concat(n));let r=this.gutter.config.lineMarker(e,t,i);r&&i.unshift(r);let o=this.gutter;(0!=i.length||o.config.renderEmptyElements)&&this.addElement(e,t,i)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),i=n?[n]:null;for(let n of e.state.facet(H$)){let r=n(e,t.widget,t);r&&(i||(i=[])).push(r)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class H1{constructor(e,t){for(let n in this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:""),t.domEventHandlers)this.dom.addEventListener(n,i=>{let r=i.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let e=r.getBoundingClientRect();o=(e.top+e.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,a,i)&&i.preventDefault()});this.markers=HQ(t.markers(e)),t.initialSpacer&&(this.spacer=new H2(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=HQ(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!B7.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class H2{constructor(e,t,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,i)}update(e,t,n,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),!function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}(this.markers,i)&&this.setMarkers(e,i)}setMarkers(e,t){let n="cm-gutterElement",i=this.dom.firstChild;for(let r=0,o=0;;){let a=o,s=r<t.length?t[r++]:null,l=!1;if(s){let e=s.elementClass;e&&(n+=" "+e);for(let e=o;e<this.markers.length;e++)if(this.markers[e].compare(s)){a=e,l=!0;break}}else a=this.markers.length;for(;o<a;){let e=this.markers[o++];if(e.toDOM){e.destroy(i);let t=i.nextSibling;i.remove(),i=t}}if(!s)break;s.toDOM&&(l?i=i.nextSibling:this.dom.insertBefore(s.toDOM(e),i)),l&&o++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}let H5=B_.define(),H3=B_.define(),H4=B_.define({combine:e=>B5(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let i=n[e],r=t[e];n[e]=i?(e,t,n)=>i(e,t,n)||r(e,t,n):r}return n}})});class H6 extends HW{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function H8(e,t){return e.state.facet(H4).formatNumber(t,e.state)}let H9=Hq.compute([H4],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(H5),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new H6(H8(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let i of e.state.facet(H3)){let r=i(e,t,n);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(H4)!=e.state.facet(H4),initialSpacer:e=>new H6(H8(e,H7(e.state.doc.lines))),updateSpacer(e,t){let n=H8(t.view,H7(t.view.state.doc.lines));return n==e.number?e:new H6(n)},domEventHandlers:e.facet(H4).domEventHandlers,side:"before"}));function H7(e){let t=9;for(;t<e;)t=10*t+9;return t}let We=new class extends HW{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Wt=HG.compute(["selection"],e=>{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(We.range(r)))}return B7.of(t)}),Wn=new LF,Wi=new LF;class Wr{constructor(e,t,n=[],i=""){this.data=e,this.name=i,B2.prototype.hasOwnProperty("tree")||Object.defineProperty(B2.prototype,"tree",{get(){return Ws(this)}}),this.parser=t,this.extension=[Wm.of(this),B2.languageData.of((e,t,n)=>{let i=Wo(e,t,n),r=i.type.prop(Wn);if(!r)return[];let o=e.facet(r),a=i.type.prop(Wi);if(a){let r=i.resolve(t-i.from,n);for(let t of a)if(t.test(r,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(o)}}return o})].concat(n)}isActiveAt(e,t,n=-1){return Wo(e,t,n).type.prop(Wn)==this.data}findRegions(e){let t=e.facet(Wm);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(e,t)=>{if(e.prop(Wn)==this.data)return void n.push({from:t,to:t+e.length});let r=e.prop(LF.mounted);if(r){if(r.tree.prop(Wn)==this.data){if(r.overlay)for(let e of r.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(r.overlay){let e=n.length;if(i(r.tree,r.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let r=e.children[n];r instanceof L$&&i(r,e.positions[n]+t)}};return i(Ws(e),0),n}get allowsNesting(){return!0}}function Wo(e,t,n){let i=e.facet(Wm),r=Ws(e).topNode;if(!i||i.allowsNesting)for(let e=r;e;e=e.enter(t,n,ev.ExcludeBuffers|ev.EnterBracketed))e.type.isTop&&(r=e);return r}Wr.setState=BY.define();class Wa extends Wr{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){var t;let n=(t=e.languageData,B_.define({combine:t?e=>e.concat(t):void 0}));return new Wa(n,e.parser.configure({props:[Wn.add(e=>e.isTop?n:void 0)]}),e.name)}configure(e,t){return new Wa(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ws(e){let t=e.field(Wr.state,!1);return t?t.tree:L$.empty}class Wl{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Wu=null;class Wc{constructor(e,t,n=[],i,r,o,a,s){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=o,this.skipped=a,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new Wc(e,t,[],L$.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Wl(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=L$.empty&&this.isDone(null!=t?t:this.state.doc.length))?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i){if(this.fragments=this.withoutTempSkipped(L7.addTree(i,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!=(n=this.parse.stoppedAt)?n:this.state.doc.length,this.tree=i,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(L7.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Wu;Wu=this;try{return e()}finally{Wu=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Wh(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:r,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,i,r)=>t.push({fromA:e,toA:n,fromB:i,toB:r})),n=L7.applyChanges(n,t),i=L$.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length)for(let t of(a=[],this.skipped)){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);n<i&&a.push({from:n,to:i})}}return new Wc(this.parser,t,n,i,r,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:i}=this.skipped[t];n<e.to&&i>e.from&&(this.fragments=Wh(this.fragments,n,i),this.skipped.splice(t--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ne{createParse(t,n,i){let r=i[0].from,o=i[i.length-1].to;return{parsedPos:r,advance(){let t=Wu;if(t){for(let e of i)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new L$(Lj.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return Wu}}function Wh(e,t,n){return L7.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class Wd{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new Wd(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=Wc.create(e.facet(Wm).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new Wd(n)}}Wr.state=BD.define({create:Wd.init,update(e,t){for(let e of t.effects)if(e.is(Wr.setState))return e.value;return t.startState.facet(Wm)!=t.state.facet(Wm)?Wd.init(t.state):e.apply(t)}});let Wp=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"u">typeof requestIdleCallback&&(Wp=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let Wf="u">typeof navigator&&(null==(ey=navigator.scheduling)?void 0:ey.isInputPending)?()=>navigator.scheduling.isInputPending():null,Wg=zj.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Wr.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Wr.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=Wp(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:i}}=this.view,r=n.field(Wr.state);if(r.tree==r.context.tree&&r.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!Wf?Math.max(25,e.timeRemaining()-5):1e9),a=r.context.treeLen<i&&n.doc.length>i+1e3,s=r.context.work(()=>Wf&&Wf()||Date.now()>o,i+1e5*!a);this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Wr.setState.of(new Wd(r.context))})),this.chunkBudget>0&&!(s&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>zB(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Wm=B_.define({combine:e=>e.length?e[0]:null,enables:e=>[Wr.state,Wg,jN.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class Wv{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}let Wy=B_.define(),Wx=B_.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function Wb(e){let t=e.facet(Wx);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function Ww(e,t){let n="",i=e.tabSize,r=e.facet(Wx)[0];if(" "==r){for(;t>=i;)n+=" ",t-=i;r=" "}for(let e=0;e<t;e++)n+=r;return n}function WS(e,t){for(let n of(e instanceof B2&&(e=new W_(e)),e.state.facet(Wy))){let i=n(e,t);if(void 0!==i)return i}let n=Ws(e.state);return n.length>=t?function(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let e=[];for(let t=r;t&&!(t.from<i.node.from||t.to>i.node.to||t.from==i.node.from&&t.type==i.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)i={node:e[t],next:i}}return WC(i,e,n)}(e,n,t):null}class W_{constructor(e,t={}){this.state=e,this.options=t,this.unit=Wb(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:r}=this.options;if(null!=i&&i>=n.from&&i<=n.to)if(r&&i==e)return{text:"",from:e};else if(t<0?i<e:i<=e)return{text:n.text.slice(i-n.from),from:i};else return{text:n.text.slice(0,i-n.from),from:n.from};return n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:i}=this.lineAt(e,t);return n.slice(e-i,Math.min(n.length,e+100-i))}column(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.countColumn(n,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(r+=o-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return Fh(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(i);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let WM=new LF;function WC(e,t,n){for(let i=e;i;i=i.next){let e=function(e){let t=e.type.prop(WM);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(LF.closedBy))){let t=e.lastChild,n=t&&i.indexOf(t.name)>-1;return e=>(function(e,t,n,i){let r=e.textAfter,o=r.match(/^\s*/)[0].length,a=n&&r.slice(o,o+n.length)==n||i==e.pos+o,s=t?function(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),a=null==r||r<=o.from?o.to:Math.min(o.to,r);for(let e=n.to;;){let r=t.childAfter(e);if(!r||r==i)return null;if(!r.type.isSkipped){if(r.from>=a)return null;let e=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+e}}e=r.to}}(e):null;return s?a?e.column(s.from):e.column(s.to):e.baseIndent+(a?0:+e.unit)})(e,!0,void 0,n&&!(e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak)?t.from:void 0)}return null==e.parent?WA:null}(i.node);if(e)return e(Wk.create(t,n,i))}return 0}function WA(){return 0}class Wk extends W_{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new Wk(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(function(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return WC(this.context.next,this.base,this.pos)}}function WT({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}let WD=B_.define(),WI=new LF;function WO(e,t,n){for(let i of e.facet(WD)){let r=i(e,t,n);if(r)return r}return function(e,t,n){let i=Ws(e);if(i.length<n)return null;let r=i.resolveStack(n,1),o=null;for(let a=r;a;a=a.next){let r=a.node;if(r.to<=n||r.from>n)continue;if(o&&r.from<t)break;let s=r.type.prop(WI);if(s&&(r.to<i.length-50||i.length==e.doc.length||!function(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}(r))){let i=s(r,e);i&&i.from<=n&&i.from>=t&&i.to>n&&(o=i)}}return o}(e,t,n)}function WP(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}let WE=BY.define({map:WP}),WR=BY.define({map:WP});function WL(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}let WN=BD.define({create:()=>FG.none,update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,n)=>e=WB(e,t,n)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(WE)&&!function(e,t,n){let i=!1;return e.between(t,t,(e,r)=>{e==t&&r==n&&(i=!0)}),i}(e,i.value.from,i.value.to)?n.push(i.value):i.is(WR)&&(e=e.update({filter:(e,t)=>i.value.from!=e||i.value.to!=t,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=t.state.facet(WW),r=n.map(e=>(i?FG.replace({widget:new Wq(i(t.state,e))}):WU).range(e.from,e.to));e=e.update({add:r})}return t.selection&&(e=WB(e,t.selection.main.head)),e},provide:e=>jN.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let i=e[n++],r=e[n++];if("number"!=typeof i||"number"!=typeof r)throw RangeError("Invalid JSON for fold state");t.push(WU.range(i,r))}return FG.set(t,!0)}});function WB(e,t,n=t){let i=!1;return e.between(t,n,(e,r)=>{e<n&&r>t&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(e,i)=>e>=n||i<=t}):e}function WF(e,t,n){var i;let r=null;return null==(i=e.field(WN,!1))||i.between(t,n,(e,t)=>{(!r||r.from>e)&&(r={from:e,to:t})}),r}function Wz(e,t){return e.field(WN,!1)?t:t.concat(BY.appendConfig.of(WG()))}function WV(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return jN.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}let Wj=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of WL(e)){let n=WO(e.state,t.from,t.to);if(n)return e.dispatch({effects:Wz(e.state,[WE.of(n),WV(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(WN,!1))return!1;let t=[];for(let n of WL(e)){let i=WF(e.state,n.from,n.to);i&&t.push(WR.of(i),WV(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let i=0;i<t.doc.length;){let r=e.lineBlockAt(i),o=WO(t,r.from,r.to);o&&n.push(WE.of(o)),i=(o?e.lineBlockAt(o.to):r).to+1}return n.length&&e.dispatch({effects:Wz(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(WN,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(WR.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],WH={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},WW=B_.define({combine:e=>B5(e,WH)});function WG(e){let t=[WN,WX];return e&&t.push(WW.of(e)),t}function W$(e,t){let{state:n}=e,i=n.facet(WW),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),i=WF(e.state,n.from,n.to);i&&e.dispatch({effects:WR.of(i)}),t.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let o=document.createElement("span");return o.textContent=i.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=r,o}let WU=FG.replace({widget:new class extends FH{toDOM(e){return W$(e,null)}}});class Wq extends FH{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return W$(e,this.value)}}let WY={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class WZ extends HW{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}let WX=jN.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class WK{constructor(e,t){let n;function i(e){let t=Fm.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const r="string"==typeof t.all?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof Wr?e=>e.prop(Wn)==o.data:o?e=>e==o:void 0,this.style=NO(e.map(e=>({tag:e.tag,class:e.class||i(Object.assign({},e,{tag:null}))})),{all:r}).style,this.module=n?new Fm(n):null,this.themeType=t.themeType}static define(e,t){return new WK(e,t||{})}}let WQ=B_.define(),WJ=B_.define({combine:e=>e.length?[e[0]]:null});function W0(e){let t=e.facet(WQ);return t.length?t:e.facet(WJ)}function W1(e,t){let n=[W2],i;return e instanceof WK&&(e.module&&n.push(jN.styleModule.of(e.module)),i=e.themeType),(null==t?void 0:t.fallback)?n.push(WJ.of(e)):i?n.push(WQ.computeN([jN.darkTheme],t=>t.facet(jN.darkTheme)==("dark"==i)?[e]:[])):n.push(WQ.of(e)),n}let W2=BO.high(zj.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=Ws(e.state),this.decorations=this.buildDeco(e,W0(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Ws(e.state),n=W0(e.state),i=n!=W0(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<r.to&&!i&&t.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return FG.none;let n=new Fe;for(let{from:i,to:r}of e.visibleRanges)!function(e,t,n,i=0,r=e.length){let o=new NP(i,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),i,r,"",o.highlighters),o.flush(r)}(this.tree,t,(e,t,i)=>{n.add(e,t,this.markCache[i]||(this.markCache[i]=FG.mark({class:i})))},i,r);return n.finish()}},{decorations:e=>e.decorations})),W5=WK.define([{tag:NY.meta,color:"#404740"},{tag:NY.link,textDecoration:"underline"},{tag:NY.heading,textDecoration:"underline",fontWeight:"bold"},{tag:NY.emphasis,fontStyle:"italic"},{tag:NY.strong,fontWeight:"bold"},{tag:NY.strikethrough,textDecoration:"line-through"},{tag:NY.keyword,color:"#708"},{tag:[NY.atom,NY.bool,NY.url,NY.contentSeparator,NY.labelName],color:"#219"},{tag:[NY.literal,NY.inserted],color:"#164"},{tag:[NY.string,NY.deleted],color:"#a11"},{tag:[NY.regexp,NY.escape,NY.special(NY.string)],color:"#e40"},{tag:NY.definition(NY.variableName),color:"#00f"},{tag:NY.local(NY.variableName),color:"#30a"},{tag:[NY.typeName,NY.namespace],color:"#085"},{tag:NY.className,color:"#167"},{tag:[NY.special(NY.variableName),NY.macroName],color:"#256"},{tag:NY.definition(NY.propertyName),color:"#00c"},{tag:NY.comment,color:"#940"},{tag:NY.invalid,color:"#f00"}]),W3=jN.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),W4="()[]{}",W6=B_.define({combine:e=>B5(e,{afterCursor:!0,brackets:W4,maxScanDistance:1e4,renderMatch:W7})}),W8=FG.mark({class:"cm-matchingBracket"}),W9=FG.mark({class:"cm-nonmatchingBracket"});function W7(e){let t=[],n=e.matched?W8:W9;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function Ge(e){let t=[],n=e.facet(W6);for(let i of e.selection.ranges){if(!i.empty)continue;let r=Go(e,i.head,-1,n)||i.head>0&&Go(e,i.head-1,1,n)||n.afterCursor&&(Go(e,i.head,1,n)||i.head<e.doc.length&&Go(e,i.head+1,-1,n));r&&(t=t.concat(n.renderMatch(r,e)))}return FG.set(t,!0)}let Gt=[zj.fromClass(class{constructor(e){this.paused=!1,this.decorations=Ge(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=Ge(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),W3],Gn=new LF;function Gi(e,t,n){let i=e.prop(t<0?LF.openedBy:LF.closedBy);if(i)return i;if(1==e.name.length){let i=n.indexOf(e.name);if(i>-1&&i%2==+(t<0))return[n[i+t]]}return null}function Gr(e){let t=e.type.prop(Gn);return t?t(e.node):e}function Go(e,t,n,i={}){let r=i.maxScanDistance||1e4,o=i.brackets||W4,a=Ws(e),s=a.resolveInner(t,n);for(let e=s;e;e=e.parent){let i=Gi(e.type,n,o);if(i&&e.from<e.to){let r=Gr(e);if(r&&(n>0?t>=r.from&&t<r.to:t>r.from&&t<=r.to))return function(e,t,n,i,r){let o=t.parent,a={from:n.from,to:n.to},s=0,l=null==o?void 0:o.cursor();if(l&&(e<0?l.childBefore(t.from):l.childAfter(t.to)))do if(e<0?l.to<=t.from:l.from>=t.to){if(0==s&&i.indexOf(l.type.name)>-1&&l.from<l.to){let e=Gr(l);return{start:a,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(Gi(l.type,e,r))s++;else if(Gi(l.type,-e,r)){if(0==s){let e=Gr(l);return{start:a,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}s--}}while(e<0?l.prevSibling():l.nextSibling());return{start:a,matched:!1}}(n,e,r,i,o)}}return function(e,t,n,i,r,o,a){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=a.indexOf(s);if(l<0||l%2==0!=n>0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),h=0;for(let e=0;!c.next().done&&e<=o;){let o=c.value;n<0&&(e+=o.length);let s=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=a.indexOf(o[e]);if(!(t<0)&&i.resolveInner(s+e,1).type==r)if(t%2==0==n>0)h++;else{if(1==h)return{start:u,end:{from:s+e,to:s+e+1},matched:t>>1==l>>1};h--}}n>0&&(e+=o.length)}return c.done?{start:u,matched:!1}:null}(e,t,n,a,s.type,r,o)}let Ga=Object.create(null),Gs=[Lj.none],Gl=[],Gu=Object.create(null),Gc=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Gc[e]=function(e,t){let n=[];for(let i of t.split(" ")){let t=[];for(let n of i.split(".")){let i=e[n]||NY[n];i?"function"==typeof i?t.length?t=t.map(i):Gh(n,`Modifier ${n} used at start of tag`):t.length?Gh(n,`Tag ${n} used as modifier`):t=Array.isArray(i)?i:[i]:Gh(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),r=i+" "+n.map(e=>e.id),o=Gu[r];if(o)return o.id;let a=Gu[r]=Lj.define({id:Gs.length,name:i,props:[NT({[i]:n})]});return Gs.push(a),a.id}(Ga,t);function Gh(e,t){Gl.indexOf(e)>-1||(Gl.push(e),console.warn(t))}zl.RTL,zl.LTR;let Gd=Wa.define({name:"json",parser:NX.configure({props:[WM.add({Object:WT({except:/^\s*\}/}),Array:WT({except:/^\s*\]/})}),WI.add({"Object Array":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});class Gp{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class Gf{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let i=n.facet(Gk).markerFilter;i&&(e=i(e,n));let r=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new Fe,a=[],s=0,l=n.doc.iter(),u=0,c=n.doc.length;for(let e=0;;){let t,n,i=e==r.length?null:r[e];if(!i&&!a.length)break;if(a.length)t=s,n=a.reduce((e,t)=>Math.min(e,t.to),i&&i.from>t?i.from:1e8);else{if((t=i.from)>c)break;n=i.to,a.push(i),e++}for(;e<r.length;){let i=r[e];if(i.from==t&&(i.to>i.from||i.to==t))a.push(i),e++,n=Math.min(i.to,n);else{n=Math.min(i.from,n);break}}n=Math.min(n,c);let h=!1;if(a.some(e=>e.from==t&&(e.to==n||n==c))&&!(h=t==n)&&n-t<10){let e=t-(u+l.value.length);e>0&&(l.next(e),u=t);for(let e=t;;){if(e>=n){h=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let d=GB(a);if(h)o.add(t,t,FG.widget({widget:new GO(d),diagnostics:a.slice()}));else{let e=a.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");o.add(t,n,FG.mark({class:"cm-lintRange cm-lintRange-"+d+e,diagnostics:a.slice(),inclusiveEnd:a.some(e=>e.to>n)}))}if((s=n)==c)break;for(let e=0;e<a.length;e++)a[e].to<=s&&a.splice(e--,1)}let h=o.finish();return new Gf(h,t,Gg(h))}}function Gg(e,t=null,n=0){let i=null;return e.between(n,1e9,(e,n,{spec:r})=>{if(!(t&&0>r.diagnostics.indexOf(t)))if(i){if(0>r.diagnostics.indexOf(i.diagnostic))return!1;i=new Gp(i.from,n,i.diagnostic)}else i=new Gp(e,n,t||r.diagnostics[0])}),i}function Gm(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(Gk).hideOn(e,n,i);if(null!=r)return r;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(Gy))||e.changes.touchesRange(o.from,Math.max(o.to,i)))}function Gv(e,t){return e.field(Gw,!1)?t:t.concat(BY.appendConfig.of(G$))}let Gy=BY.define(),Gx=BY.define(),Gb=BY.define(),Gw=BD.define({create:()=>new Gf(FG.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);i=Gg(n,e.selected.diagnostic,r)||Gg(n,null,r)}!n.size&&r&&t.state.facet(Gk).autoPanel&&(r=null),e=new Gf(n,r,i)}for(let n of t.effects)if(n.is(Gy)){let i=t.state.facet(Gk).autoPanel?n.value.length?GE.open:null:e.panel;e=Gf.init(n.value,i,t.state)}else n.is(Gx)?e=new Gf(e.diagnostics,n.value?GE.open:null,e.selected):n.is(Gb)&&(e=new Gf(e.diagnostics,e.panel,n.value));return e},provide:e=>[Hz.from(e,e=>e.panel),jN.decorations.from(e,e=>e.diagnostics)]}),GS=FG.mark({class:"cm-lintRange cm-lintRange-active"});function G_(e,t){return FC("ul",{class:"cm-tooltip-lint"},t.map(t=>GI(e,t,!1)))}let GM=e=>{let t=e.state.field(Gw,!1);return!!t&&!!t.panel&&(e.dispatch({effects:Gx.of(!1)}),!0)},GC=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(Gw,!1);t&&t.panel||e.dispatch({effects:Gv(e.state,[Gx.of(!0)])});let n=HL(e,GE.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(Gw,!1);if(!t)return!1;let n=e.state.selection.main,i=Gg(t.diagnostics,null,n.to+1);return(!!i||!!(i=Gg(t.diagnostics,null,0))&&(i.from!=n.from||i.to!=n.to))&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!function(e,t,n={}){var i;let r=e.state.facet(HI).map(t=>e.plugin(t)).filter(e=>!!e);if(n.tooltip&&n.tooltip.active){let e=r.find(e=>e.field==n.tooltip.active);e&&(r=[e])}for(let o of r)o.activateHover(e,t,1,null!=(i=n.until)?i:()=>!1)}(e,i.from,{tooltip:GG,until:e=>e.docChanged||e.newSelection.main.head<i.from||e.newSelection.main.head>i.to}),!0)}}],GA=zj.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(Gk);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(Gk);t.length&&function(e,t,n){let i=[],r=-1;for(let o of e)o.then(n=>{i.push(n),clearTimeout(r),i.length==e.length?t(i):r=setTimeout(()=>t(i),200)},n)}(t.map(e=>Promise.resolve(e(this.view))),t=>{var n,i;this.view.state.doc==e.doc&&this.view.dispatch((n=this.view.state,i=t.reduce((e,t)=>e.concat(t)),{effects:Gv(n,[Gy.of(i)])}))},e=>{zB(this.view.state,e)})}}update(e){let t=e.state.facet(Gk);(e.docChanged||t!=e.startState.facet(Gk)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Gk=B_.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...B5(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:GT,tooltipFilter:GT,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,i,r)=>e(n,i,r)||t(n,i,r):e:t,autoPanel:(e,t)=>e||t})})});function GT(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function GD(e){let t=[];if(e)s:for(let{name:n}of e){for(let e=0;e<n.length;e++){let i=n[e];if(/[a-zA-Z]/.test(i)&&!t.some(e=>e.toLowerCase()==i.toLowerCase())){t.push(i);continue s}}t.push("")}return t}function GI(e,t,n){var i;let r=n?GD(t.actions):[];return FC("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},FC("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null==(i=t.actions)?void 0:i.map((n,i)=>{let o=!1,a=i=>{if(i.preventDefault(),o)return;o=!0;let r=Gg(e.state.field(Gw).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:s}=n,l=r[i]?s.indexOf(r[i]):-1,u=l<0?s:[s.slice(0,l),FC("u",s.slice(l,l+1)),s.slice(l+1)];return FC("button",{type:"button",class:"cm-diagnosticAction"+(n.markClass?" "+n.markClass:""),onclick:a,onmousedown:a,"aria-label":` Action: ${s}${l<0?"":` (access key "${r[i]})"`}.`},u)}),t.source&&FC("div",{class:"cm-diagnosticSource"},t.source))}class GO extends FH{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return FC("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class GP{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(0xffffffff*Math.random()).toString(16),this.dom=GI(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class GE{constructor(e){this.view=e,this.items=[];let t=t=>{if(!t.ctrlKey&&!t.altKey&&!t.metaKey){if(27==t.keyCode)GM(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65)||!(t.keyCode<=90)||!(this.selectedIndex>=0))return;let{diagnostic:n}=this.items[this.selectedIndex],i=GD(n.actions);for(let r=0;r<i.length;r++)if(i[r].toUpperCase().charCodeAt(0)==t.keyCode){let t=Gg(this.view.state.field(Gw).diagnostics,n);t&&n.actions[r].apply(e,t.from,t.to)}}t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=FC("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:n}),this.dom=FC("div",{class:"cm-panel-lint"},this.list,FC("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>GM(this.view)},"\xd7")),this.update()}get selectedIndex(){let e=this.view.state.field(Gw).selected;if(!e)return -1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return -1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Gw),n=0,i=!1,r=null,o=new Set;for(e.between(0,this.view.state.doc.length,(e,a,{spec:s})=>{for(let e of s.diagnostics){if(o.has(e))continue;o.add(e);let a=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){a=t;break}a<0?(s=new GP(this.view,e),this.items.splice(n,0,s),i=!0):(s=this.items[a],a>n&&(this.items.splice(n,a-n),i=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute("aria-selected")||(s.dom.setAttribute("aria-selected","true"),r=s):s.dom.hasAttribute("aria-selected")&&s.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();0==this.items.length&&(this.items.push(new GP(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Gg(this.view.state.field(Gw).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:Gb.of(t)})}static open(e){return new GE(e)}}function GR(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function GL(e){return GR(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}let GN=jN.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:GL("#f11")},".cm-lintRange-warning":{backgroundImage:GL("orange")},".cm-lintRange-info":{backgroundImage:GL("#999")},".cm-lintRange-hint":{backgroundImage:GL("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function GB(e){let t="hint",n=1;for(let r of e){var i;let e="error"==(i=r.severity)?4:"warning"==i?3:"info"==i?2:1;e>n&&(n=e,t=r.severity)}return t}class GF extends HW{constructor(e){super(),this.diagnostics=e,this.severity=GB(e)}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let n=this.diagnostics,i=e.state.facet(GU).tooltipFilter;return i&&(n=i(n,e.state)),n.length&&(t.onmouseover=()=>(function(e,t,n){function i(){let i,r=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(r.from)&&e.dispatch({effects:Gj.of({pos:r.from,above:!1,clip:!1,create:()=>({dom:G_(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,i=n=>{let r=t.getBoundingClientRect();if(!(n.clientX>r.left-10)||!(n.clientX<r.right+10)||!(n.clientY>r.top-10)||!(n.clientY<r.bottom+10)){for(let e=n.target;e;e=e.parentNode)if(1==e.nodeType&&e.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",i),e.state.field(GH)&&e.dispatch({effects:Gj.of(null)})}},window.addEventListener("mousemove",i)}let{hoverTime:r}=e.state.facet(GU),o=setTimeout(i,r);t.onmouseout=()=>{clearTimeout(o),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(o),o=setTimeout(i,r)}})(e,t,n)),t}}let Gz=HY({class:"cm-gutter-lint",markers:e=>e.state.field(GV),widgetMarker:(e,t,n)=>{let i=[];return e.state.field(GV).between(n.from,n.to,(e,t,r)=>{e>n.from&&e<n.to&&i.push(...r.diagnostics)}),i.length?new GF(i):null}}),GV=BD.define({create:()=>B7.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(GU).markerFilter;for(let i of t.effects)if(i.is(Gy)){let r=i.value;n&&(r=n(r||[],t.state)),e=function(e,t){let n=Object.create(null);for(let i of t){let t=e.lineAt(i.from);(n[t.from]||(n[t.from]=[])).push(i)}let i=[];for(let e in n)i.push(new GF(n[e]).range(+e));return B7.of(i,!0)}(t.state.doc,r.slice(0))}return e}}),Gj=BY.define(),GH=BD.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=Gm(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(Gj)?t.value:e,e)),provide:e=>HA.from(e)}),GW=jN.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:GR('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:GR('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:GR('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),GG=function(e,t={}){let n=BY.define(),i=new WeakMap,r=BD.define({create:()=>[],update(e,o){let a=i.get(e);if(e.length&&(t.hideOnChange&&(o.docChanged||o.selection)||a&&a(o)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(o,e)))),o.docChanged&&e.length){let t=[];for(let n of e){let e=o.changes.mapPos(n.pos,-1,Bc.TrackDel);if(null!=e){let i=Object.assign(Object.create(null),n);i.pos=e,null!=i.end&&(i.end=o.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of o.effects)t.is(n)&&(e=t.value,a=void 0),(t.is(HE)&&!t.value||t.value==r)&&(e=[]);return e.length&&a&&i.set(e,a),e},provide:e=>Hk.from(e)}),o=zj.define(o=>new HO(o,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,o,HI.of(o),HD]}}(function(e,t,n){let{diagnostics:i}=e.state.field(Gw),r,o=-1,a=-1;i.between(t-(n<0),t+ +(n>0),(e,i,{spec:s})=>{if(t>=e&&t<=i&&(e==i||(t>e||n>0)&&(t<i||n<0)))return r=s.diagnostics,o=e,a=i,!1});let s=e.state.facet(Gk).tooltipFilter;return(r&&s&&(r=s(r,e.state)),r)?{pos:o,end:a,above:!0,create:()=>({dom:G_(e,r)})}:null},{hideOn:Gm}),G$=[Gw,jN.decorations.compute([Gw],e=>{let{selected:t,panel:n}=e.field(Gw);return t&&n&&t.from!=t.to?FG.set([GS.range(t.from,t.to)]):FG.none}),GG,GN],GU=B_.define({combine:e=>B5(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});var Gq=n(49257);function GY(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(i(n.update(r)),!0)}}let GZ=GY(function(e,t,n=t.selection.ranges){let i=[],r=-1;l:for(let{from:e,to:o}of n){let n=i.length,a=1e9,s;for(let n=e;n<=o;){let l=t.doc.lineAt(n);if(void 0==s&&!(s=GQ(t,l.from).line))continue l;if(l.from>r&&(e==o||o>l.from)){r=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,n=l.text.slice(e,e+s.length)==s?e:-1;e<l.text.length&&e<a&&(a=e),i.push({line:l,comment:n,token:s,indent:e,empty:t,single:!1})}n=l.to+1}if(a<1e9)for(let e=n;e<i.length;e++)i[e].indent<i[e].line.text.length&&(i[e].indent=a);i.length==n+1&&(i[n].single=!0)}if(2!=e&&i.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:r,empty:o,single:a}of i)(a||!o)&&e.push({from:t.from+r,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&i.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:r}of i)if(n>=0){let i=t.from+n,o=i+r.length;" "==t.text[o-t.from]&&o++,e.push({from:i,to:o})}return{changes:e}}return null},0),GX=GY(GJ,0),GK=GY((e,t)=>GJ(e,t,function(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>i.from?t[o].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}(t)),0);function GQ(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}function GJ(e,t,n=t.selection.ranges){let i=n.map(e=>GQ(t,e.from).block);if(!i.every(e=>e))return null;let r=n.map((e,n)=>(function(e,{open:t,close:n},i,r){let o,a,s=e.sliceDoc(i-50,i),l=e.sliceDoc(r,r+50),u=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(l)[0].length,h=s.length-u;if(s.slice(h-t.length,h)==t&&l.slice(c,c+n.length)==n)return{open:{pos:i-u,margin:u&&1},close:{pos:r+c,margin:c&&1}};r-i<=100?o=a=e.sliceDoc(i,r):(o=e.sliceDoc(i,i+50),a=e.sliceDoc(r-50,r));let d=/^\s*/.exec(o)[0].length,p=/\s*$/.exec(a)[0].length,f=a.length-p-n.length;return o.slice(d,d+t.length)==t&&a.slice(f,f+n.length)==n?{open:{pos:i+d+t.length,margin:+!!/\s/.test(o.charAt(d+t.length))},close:{pos:r-p-n.length,margin:+!!/\s/.test(a.charAt(f-1))}}:null})(t,i[n],e.from,e.to));if(2!=e&&!r.every(e=>e))return{changes:t.changes(n.map((e,t)=>r[t]?[]:[{from:e.from,insert:i[t].open+" "},{from:e.to,insert:" "+i[t].close}]))};if(1!=e&&r.some(e=>e)){let e=[];for(let t=0,n;t<r.length;t++)if(n=r[t]){let r=i[t],{open:o,close:a}=n;e.push({from:o.pos-r.open.length,to:o.pos+o.margin},{from:a.pos-a.margin,to:a.pos+r.close.length})}return{changes:e}}return null}let G0=B$.define(),G1=B$.define(),G2=B_.define(),G5=B_.define({combine:e=>B5(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}),G3=BD.define({create:()=>$s.empty,update(e,t){let n=t.state.facet(G5),i=t.annotation(G0);if(i){let r=$e.fromTransaction(t,i.selection),o=i.side,a=0==o?e.undone:e.done;return a=r?$t(a,a.length,n.minDepth,r):$r(a,t.startState.selection),new $s(0==o?i.rest:a,0==o?a:i.rest)}let r=t.annotation(G1);if(("full"==r||"before"==r)&&(e=e.isolate()),!1===t.annotation(BZ.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=$e.fromTransaction(t),a=t.annotation(BZ.time),s=t.annotation(BZ.userEvent);return o?e=e.addChanges(o,a,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,s,n.newGroupDelay)),("full"==r||"after"==r)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new $s(e.done.map($e.fromJSON),e.undone.map($e.fromJSON))});function G4(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(G3,!1);if(!r)return!1;let o=r.pop(e,n,t);return!!o&&(i(o),!0)}}let G6=G4(0,!1),G8=G4(1,!1),G9=G4(0,!0),G7=G4(1,!0);class $e{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new $e(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null==(e=this.changes)?void 0:e.toJSON(),mapped:null==(t=this.mapped)?void 0:t.toJSON(),startSelection:null==(n=this.startSelection)?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new $e(e.changes&&Bd.fromJSON(e.changes),[],e.mapped&&Bh.fromJSON(e.mapped),e.startSelection&&Bb.fromJSON(e.startSelection),e.selectionsAfter.map(Bb.fromJSON))}static fromTransaction(e,t){let n=$i;for(let t of e.startState.facet(G2)){let i=t(e);i.length&&(n=n.concat(i))}return!n.length&&e.changes.empty?null:new $e(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,$i)}static selection(e){return new $e(void 0,$i,void 0,void 0,e)}}function $t(e,t,n,i){let r=e.slice(t+1>n+20?t-n-1:0,t);return r.push(i),r}function $n(e,t){return e.length?t.length?e.concat(t):e:t}let $i=[];function $r(e,t){if(!e.length)return[$e.selection([t])];{let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),$t(e,e.length-1,1e9,n.setSelAfter(i)))}}function $o(e,t){if(!e.length)return e;let n=e.length,i=$i;for(;n;){let r=function(e,t,n){let i=$n(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):$i,n);if(!e.changes)return $e.selection(i);let r=e.changes.map(t),o=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(o):o;return new $e(r,BY.mapEffects(e.effects,t),a,e.startSelection.map(o),i)}(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,i=r.selectionsAfter}return i.length?[$e.selection(i)]:$i}let $a=/^(input\.type|delete)($|\.)/;class $s{constructor(e,t,n=0,i){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new $s(this.done,this.undone):this}addChanges(e,t,n,i,r){var o,a;let s,l,u=this.done,c=u[u.length-1];return new $s(u=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||$a.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(r,(o=c.changes,a=e.changes,s=[],l=!1,o.iterChangedRanges((e,t)=>s.push(e,t)),a.iterChangedRanges((e,t,n,i)=>{for(let e=0;e<s.length;){let t=s[e++],r=s[e++];i>=t&&n<=r&&(l=!0)}}),l))||"input.type.compose"==n)?$t(u,u.length-1,i.minDepth,new $e(e.changes.compose(c.changes),$n(BY.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,$i)):$t(u,u.length,i.minDepth,e),$i,t,n)}addSelection(e,t,n,i){var r;let o=this.done.length?this.done[this.done.length-1].selectionsAfter:$i;return o.length>0&&t-this.prevTime<i&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(r=o[o.length-1],r.ranges.length==e.ranges.length&&0===r.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length)?this:new $s($r(this.done,e),this.undone,t,n)}addMapping(e){return new $s($o(this.done,e),$o(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let i=0==e?this.done:this.undone;if(0==i.length)return null;let r=i[i.length-1],o=r.selectionsAfter[0]||(r.startSelection?r.startSelection.map(r.changes.invertedDesc,1):t.selection);if(n&&r.selectionsAfter.length){let n,a;return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:G0.of({side:e,rest:(n=i[i.length-1],(a=i.slice())[i.length-1]=n.setSelAfter(n.selectionsAfter.slice(0,n.selectionsAfter.length-1)),a),selection:o}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}{if(!r.changes)return null;let n=1==i.length?$i:i.slice(0,i.length-1);return r.mapped&&(n=$o(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:G0.of({side:e,rest:n,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}$s.empty=new $s($i,$i);let $l=[{key:"Mod-z",run:G6,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:G8,preventDefault:!0},{linux:"Ctrl-Shift-z",run:G8,preventDefault:!0},{key:"Mod-u",run:G9,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:G7,preventDefault:!0}];function $u(e,t){return Bb.create(e.ranges.map(t),e.mainIndex)}function $c(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function $h({state:e,dispatch:t},n){let i=$u(e.selection,n);return!i.eq(e.selection,!0)&&(t($c(e,i)),!0)}function $d(e,t){return Bb.cursor(t?e.to:e.from)}function $p(e,t){return $h(e,n=>n.empty?e.moveByChar(n,t):$d(n,t))}function $f(e){return e.textDirectionAt(e.state.selection.main.head)==zl.LTR}let $g=e=>$p(e,!$f(e)),$m=e=>$p(e,$f(e));function $v(e,t){return $h(e,n=>n.empty?e.moveByGroup(n,t):$d(n,t))}function $y(e,t,n){let i,r,o=Ws(e).resolveInner(t.head),a=n?LF.closedBy:LF.openedBy;for(let i=t.head;;){let t=n?o.childAfter(i):o.childBefore(i);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,a)?i=n?t.to:t.from:o=t}return r=o.type.prop(a)&&(i=n?Go(e,o.from,1):Go(e,o.to,-1))&&i.matched?n?i.end.to:i.end.from:n?o.to:o.from,Bb.cursor(r,n?-1:1)}function $x(e,t){return $h(e,n=>{if(!n.empty)return $d(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}"u">typeof Intl&&Intl.Segmenter;let $b=e=>$x(e,!1),$w=e=>$x(e,!0);function $S(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,i=0,r;if(t){for(let t of e.state.facet(jN.scrollMargins)){let r=t(e);(null==r?void 0:r.top)&&(n=Math.max(null==r?void 0:r.top,n)),(null==r?void 0:r.bottom)&&(i=Math.max(null==r?void 0:r.bottom,i))}r=e.scrollDOM.clientHeight-n-i}else r=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:t,height:Math.max(e.defaultLineHeight,r-5)}}function $_(e,t){let n,i=$S(e),{state:r}=e,o=$u(r.selection,n=>n.empty?e.moveVertically(n,t,i.height):$d(n,t));if(o.eq(r.selection))return!1;if(i.selfScroll){let t=e.coordsAtPos(r.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),s=a.top+i.marginTop,l=a.bottom-i.marginBottom;t&&t.top>s&&t.bottom<l&&(n=jN.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-s}))}return e.dispatch($c(r,o),{effects:n}),!0}let $M=e=>$_(e,!1),$C=e=>$_(e,!0);function $A(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let n=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(r=Bb.cursor(i.from+n))}return r}function $k(e,t,n){let i=$u(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=Bb.range(e.head,e.anchor));let i=n(e);return Bb.range(e.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return!i.eq(e.state.selection)&&(e.dispatch($c(e.state,i)),!0)}function $T(e,t){return $k(e,t,n=>e.moveByChar(n,t))}let $D=e=>$T(e,!$f(e)),$I=e=>$T(e,$f(e));function $O(e,t){return $k(e,t,n=>e.moveByGroup(n,t))}function $P(e,t){return $k(e,t,n=>e.moveVertically(n,t))}let $E=e=>$P(e,!1),$R=e=>$P(e,!0);function $L(e,t){return $k(e,t,n=>e.moveVertically(n,t,$S(e).height))}let $N=e=>$L(e,!1),$B=e=>$L(e,!0),$F=({state:e,dispatch:t})=>(t($c(e,{anchor:0})),!0),$z=({state:e,dispatch:t})=>(t($c(e,{anchor:e.doc.length})),!0),$V=({state:e,dispatch:t})=>(t($c(e,{anchor:e.selection.main.anchor,head:0})),!0),$j=({state:e,dispatch:t})=>(t($c(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function $H(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let i of n.selection.ranges){let o=n.doc.lineAt(i.head);if(t?o.to<e.state.doc.length:o.from>0)for(let n=i;;){let i=e.moveVertically(n,t);if(i.head<o.from||i.head>o.to){r.some(e=>e.head==i.head)||r.push(i);break}if(i.head==n.head)break;n=i}}return r.length!=i.ranges.length&&(e.dispatch($c(n,Bb.create(r,r.length-1))),!0)}function $W(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(i=>{let{from:r,to:o}=i;if(r==o){let a=t(i);a<r?(n="delete.backward",a=$G(e,a,!1)):a>r&&(n="delete.forward",a=$G(e,a,!0)),r=Math.min(r,a),o=Math.max(o,a)}else r=$G(e,r,!1),o=$G(e,o,!0);return r==o?{range:i}:{changes:{from:r,to:o},range:Bb.cursor(r,r<i.head?-1:1)}});return!r.changes.empty&&(e.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?jN.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function $G(e,t,n){if(e instanceof jN)for(let i of e.state.facet(jN.atomicRanges).map(t=>t(e)))i.between(t,t,(e,i)=>{e<t&&i>t&&(t=n?i:e)});return t}let $$=(e,t,n)=>$W(e,i=>{let r=i.from,{state:o}=e,a=o.doc.lineAt(r),s,l;if(n&&!t&&r>a.from&&r<a.from+200&&!/[^ \t]/.test(s=a.text.slice(0,r-a.from))){if(" "==s[s.length-1])return r-1;let e=Fh(s,o.tabSize)%Wb(o)||Wb(o);for(let t=0;t<e&&" "==s[s.length-1-t];t++)r--;l=r}else(l=Bo(a.text,r-a.from,t,t)+a.from)==r&&a.number!=(t?o.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(a.text.slice(l-a.from,r-a.from))&&(l=Bo(a.text,l-a.from,!1,!1)+a.from);return l}),$U=e=>$$(e,!1,!0),$q=e=>$$(e,!0,!1),$Y=(e,t)=>$W(e,n=>{let i=n.head,{state:r}=e,o=r.doc.lineAt(i),a=r.charCategorizer(i);for(let e=null;;){if(i==(t?o.to:o.from)){i==n.head&&o.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let s=Bo(o.text,i-o.from,t)+o.from,l=o.text.slice(Math.min(i,s)-o.from,Math.max(i,s)-o.from),u=a(l);if(null!=e&&u!=e)break;(" "!=l||i!=n.head)&&(e=u),i=s}return i}),$Z=e=>$Y(e,!1);function $X(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),o=e.doc.lineAt(i.to);if(i.empty||i.to!=o.from||(o=e.doc.lineAt(i.to-1)),n>=r.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(i)}else t.push({from:r.from,to:o.to,ranges:[i]});n=o.number+1}return t}function $K(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let t of $X(e)){if(n?t.to==e.doc.length:0==t.from)continue;let o=e.doc.lineAt(n?t.to+1:t.from-1),a=o.length+1;if(n)for(let n of(i.push({from:t.to,to:o.to},{from:t.from,insert:o.text+e.lineBreak}),t.ranges))r.push(Bb.range(Math.min(e.doc.length,n.anchor+a),Math.min(e.doc.length,n.head+a)));else for(let n of(i.push({from:o.from,to:t.from},{from:t.to,insert:e.lineBreak+o.text}),t.ranges))r.push(Bb.range(n.anchor-a,n.head-a))}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:Bb.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function $Q(e,t,n){if(e.readOnly)return!1;let i=[];for(let t of $X(e))n?i.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):i.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}let $J=$1(!1),$0=$1(!0);function $1(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:i,to:r}=n,o=t.doc.lineAt(i),a=!e&&i==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Ws(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),o;return i&&r&&i.to<=t&&r.from>=t&&(o=i.type.prop(LF.closedBy))&&o.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}(t,i);e&&(i=r=(r<=o.to?o:t.doc.lineAt(r)).to);let s=new W_(t,{simulateBreak:i,simulateDoubleBreak:!!a}),l=WS(s,i);for(null==l&&(l=Fh(/^\s*/.exec(t.doc.lineAt(i).text)[0],t.tabSize));r<o.to&&/\s/.test(o.text[r-o.from]);)r++;a?{from:i,to:r}=a:i>o.from&&i<o.from+100&&!/\S/.test(o.text.slice(0,i))&&(i=o.from);let u=["",Ww(t,l)];return a&&u.push(Ww(t,s.lineIndent(o.from,-1))),{changes:{from:i,to:r,insert:N6.of(u)},range:Bb.cursor(i+1+u[1].length)}});return n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function $2(e,t){let n=-1;return e.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let a=e.doc.lineAt(o);a.number>n&&(i.empty||i.to>a.from)&&(t(a,r,i),n=a.number),o=a.to+1}let o=e.changes(r);return{changes:r,range:Bb.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}let $5=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update($2(e,(t,n)=>{n.push({from:t.from,insert:e.facet(Wx)})}),{userEvent:"input.indent"})),!0),$3=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update($2(e,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=Fh(i,e.tabSize),o=0,a=Ww(e,Math.max(0,r-Wb(e)));for(;o<i.length&&o<a.length&&i.charCodeAt(o)==a.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+i.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),$4=[{key:"Ctrl-b",run:$g,shift:$D,preventDefault:!0},{key:"Ctrl-f",run:$m,shift:$I},{key:"Ctrl-p",run:$b,shift:$E},{key:"Ctrl-n",run:$w,shift:$R},{key:"Ctrl-a",run:e=>$h(e,t=>Bb.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>$k(e,!1,t=>Bb.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>$h(e,t=>Bb.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>$k(e,!0,t=>Bb.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:$q},{key:"Ctrl-h",run:$U},{key:"Ctrl-k",run:e=>$W(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:$Z},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:N6.of(["",""])},range:Bb.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),r=n==i.from?n-1:Bo(i.text,n-i.from,!1)+i.from,o=n==i.to?n+1:Bo(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:o,insert:e.doc.slice(n,o).append(e.doc.slice(r,n))},range:Bb.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:$C}],$6=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>$h(e,t=>$y(e.state,t,!$f(e))),shift:e=>{let t=!$f(e);return $k(e,t,n=>$y(e.state,n,t))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>$h(e,t=>$y(e.state,t,$f(e))),shift:e=>{let t=$f(e);return $k(e,t,n=>$y(e.state,n,t))}},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>$K(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>$Q(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>$K(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>$Q(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>$H(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>$H(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=Bb.create([n.main]):n.main.empty||(i=Bb.create([Bb.cursor(n.main.head)])),!!i&&(t($c(e,i)),!0)}},{key:"Mod-Enter",run:$0},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=$X(e).map(({from:t,to:n})=>Bb.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Bb.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=$u(e.selection,t=>{let n=Ws(e),i=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=i.node.from&&e.node.to<=i.node.to&&(i=e)}for(let e=i;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return Bb.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t($c(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:$3},{key:"Mod-]",run:$5},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new W_(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=$2(e,(t,r,o)=>{let a=WS(i,t.from);if(null==a)return;/\S/.test(t.text)||(a=0);let s=/^\s*/.exec(t.text)[0],l=Ww(e,a);(s!=l||o.from<t.from+s.length)&&(n[t.from]=a,r.push({from:t.from,to:t.from+s.length,insert:l}))});return r.changes.empty||t(e.update(r,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes($X(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),i=$u(t.selection,t=>{let n;if(e.lineWrapping){let i=e.lineBlockAt(t.head),r=e.coordsAtPos(t.head,t.assoc||1);r&&(n=i.bottom+e.documentTop-r.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,i;return n=!1,i=$u(e.selection,t=>{let i=Go(e,t.head,-1)||Go(e,t.head,1)||t.head>0&&Go(e,t.head-1,1)||t.head<e.doc.length&&Go(e,t.head+1,-1);if(!i||!i.end)return t;n=!0;let r=i.start.from==t.head?i.end.to:i.end.from;return Bb.cursor(r)}),!!n&&(t($c(e,i)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=GQ(e.state,n.from);return i.line?GZ(e):!!i.block&&GK(e)}},{key:"Alt-A",run:GX},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:$g,shift:$D,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>$v(e,!$f(e)),shift:e=>$O(e,!$f(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>$h(e,t=>$A(e,t,!$f(e))),shift:e=>{let t=!$f(e);return $k(e,t,n=>$A(e,n,t))},preventDefault:!0},{key:"ArrowRight",run:$m,shift:$I,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>$v(e,$f(e)),shift:e=>$O(e,$f(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>$h(e,t=>$A(e,t,$f(e))),shift:e=>{let t=$f(e);return $k(e,t,n=>$A(e,n,t))},preventDefault:!0},{key:"ArrowUp",run:$b,shift:$E,preventDefault:!0},{mac:"Cmd-ArrowUp",run:$F,shift:$V},{mac:"Ctrl-ArrowUp",run:$M,shift:$N},{key:"ArrowDown",run:$w,shift:$R,preventDefault:!0},{mac:"Cmd-ArrowDown",run:$z,shift:$j},{mac:"Ctrl-ArrowDown",run:$C,shift:$B},{key:"PageUp",run:$M,shift:$N},{key:"PageDown",run:$C,shift:$B},{key:"Home",run:e=>$h(e,t=>$A(e,t,!1)),shift:e=>$k(e,!1,t=>$A(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:$F,shift:$V},{key:"End",run:e=>$h(e,t=>$A(e,t,!0)),shift:e=>$k(e,!0,t=>$A(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:$z,shift:$j},{key:"Enter",run:$J,shift:$J},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:$U,shift:$U,preventDefault:!0},{key:"Delete",run:$q,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:$Z,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>$Y(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>$W(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>$W(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat($4.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),$8={key:"Tab",run:$5,shift:$3},$9="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class $7{constructor(e,t,n=0,i=e.length,r,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=r?e=>r($9(e)):$9,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return -1;this.bufferPos=0,this.buffer=this.iter.value}return Ba(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Bs(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Bl(e);let i=this.normalize(t);if(i.length)for(let e=0,r=n,o=!0;;e++){let n=i.charCodeAt(e),a=this.match(n,r,o,this.bufferPos+this.bufferStart,e==i.length-1);if(a)return this.value=a,this;if(e==i.length-1)break;o&&e<t.length&&t.charCodeAt(e)==n?r++:o=!1}}}match(e,t,n,i,r){let o=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],a=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?o={from:n.from,to:i,precise:r&&n.precise}:(n.index++,a=!0)),a?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(1==this.query.length?o={from:t,to:i,precise:n&&r}:this.matches.push({from:t,index:1,precise:n})),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}"u">typeof Symbol&&($7.prototype[Symbol.iterator]=function(){return this});let Ue={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Ut="gm"+(null==/x/.unicode?"":"u");class Un{constructor(e,t,n,i=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=Ue,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Uo(e,t,n,i,r);this.re=new RegExp(t,Ut+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=Ua(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,i=n+t[0].length;if(this.matchPos=Ua(this.text,i+ +(n==i)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<i||n>this.value.to)&&(!this.test||this.test(n,i,t)))return this.value={from:n,to:i,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}let Ui=new WeakMap;class Ur{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let i=Ui.get(e);if(!i||i.from>=n||i.to<=t){let i=new Ur(t,e.sliceString(t,n));return Ui.set(e,i),i}if(i.from==t&&i.to==n)return i;let{text:r,from:o}=i;return o>t&&(r=e.sliceString(t,o)+r,o=t),i.to<n&&(r+=e.sliceString(i.to,n)),Ui.set(e,new Ur(o,r)),new Ur(t,r.slice(t-o,n-o))}}class Uo{constructor(e,t,n,i,r){this.text=e,this.to=r,this.done=!1,this.value=Ue,this.matchPos=Ua(e,i),this.re=new RegExp(t,Ut+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=Ur.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=Ua(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ur.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Ua(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t<n.to&&(i=n.text.charCodeAt(t-n.from))>=56320&&i<57344;)t++;return t}"u">typeof Symbol&&(Un.prototype[Symbol.iterator]=Uo.prototype[Symbol.iterator]=function(){return this});let Us={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ul=B_.define({combine:e=>B5(e,Us,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),Uu=FG.mark({class:"cm-selectionMatch"}),Uc=FG.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Uh(e,t,n,i){return(0==n||e(t.sliceDoc(n-1,n))!=B0.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=B0.Word)}let Ud=zj.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Ul),{state:n}=e,i=n.selection;if(i.ranges.length>1)return FG.none;let r=i.main,o,a=null;if(r.empty){if(!t.highlightWordAroundCursor)return FG.none;let e=n.wordAt(r.head);if(!e)return FG.none;a=n.charCategorizer(r.head),o=n.sliceDoc(e.from,e.to)}else{let e=r.to-r.from;if(e<t.minSelectionLength||e>200)return FG.none;if(t.wholeWords){var s,l,u;if(o=n.sliceDoc(r.from,r.to),!(Uh(a=n.charCategorizer(r.head),n,r.from,r.to)&&(s=a,l=r.from,u=r.to,s(n.sliceDoc(l,l+1))==B0.Word&&s(n.sliceDoc(u-1,u))==B0.Word)))return FG.none}else if(!(o=n.sliceDoc(r.from,r.to)))return FG.none}let c=[];for(let i of e.visibleRanges){let e=new $7(n.doc,o,i.from,i.to);for(;!e.next().done;){let{from:i,to:o}=e.value;if((!a||Uh(a,n,i,o))&&(r.empty&&i<=r.from&&o>=r.to?c.push(Uc.range(i,o)):(i>=r.to||o<=r.from)&&c.push(Uu.range(i,o)),c.length>t.maxMatches))return FG.none}}return FG.set(c)}},{decorations:e=>e.decorations}),Up=jN.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Uf=B_.define({combine:e=>B5(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new UW(e),scrollToMatch:e=>jN.scrollIntoView(e)})});class Ug{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,Ut),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new US(this):new Uy(this)}getCursor(e,t=0,n){let i=e.doc?e:B2.create({doc:e});return null==n&&(n=i.doc.length),this.regexp?Ux(this,i,t,n):Uv(this,i,t,n)}}class Um{constructor(e){this.spec=e}}function Uv(e,t,n,i){var r,o,a,s;let l;return e.wholeWord&&(a=t.doc,s=t.charCategorizer(t.selection.main.head),l=(e,t,n,i)=>((i>e||i+n.length<t)&&(i=Math.max(0,e-2),n=a.sliceString(i,Math.min(a.length,t+2))),(s(Ub(n,e-i))!=B0.Word||s(Uw(n,e-i))!=B0.Word)&&(s(Uw(n,t-i))!=B0.Word||s(Ub(n,t-i))!=B0.Word))),e.test&&(r=e.test,o=l,l=(e,n,i,a)=>(!o||!!o(e,n,i,a))&&r(e>=a&&n<=a+i.length?i.slice(e-a,n-a):t.doc.sliceString(e,n),t,e,n)),new $7(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:e=>e.toLowerCase(),l)}class Uy extends Um{constructor(e){super(e)}nextMatch(e,t,n){let i=Uv(this.spec,e,n,e.doc.length).nextOverlapping();if(i.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);i=Uv(this.spec,e,0,n).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==n?null:i.value}prevMatchInRange(e,t,n){for(let i=n;;){let n=Math.max(t,i-1e4-this.spec.unquoted.length),r=Uv(this.spec,e,n,i),o=null;for(;!r.nextOverlapping().done;)o=r.value;if(o)return o;if(n==t)return null;i-=1e4}}prevMatch(e,t,n){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=n)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Uv(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=Uv(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}function Ux(e,t,n,i){var r,o,a;let s;return e.wholeWord&&(a=t.charCategorizer(t.selection.main.head),s=(e,t,n)=>!n[0].length||(a(Ub(n.input,n.index))!=B0.Word||a(Uw(n.input,n.index))!=B0.Word)&&(a(Uw(n.input,n.index+n[0].length))!=B0.Word||a(Ub(n.input,n.index+n[0].length))!=B0.Word)),e.test&&(r=e.test,o=s,s=(e,n,i)=>(!o||o(e,n,i))&&r(i[0],t,e,n)),new Un(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:s},n,i)}function Ub(e,t){return e.slice(Bo(e,t,!1),t)}function Uw(e,t){return e.slice(t,Bo(e,t))}class US extends Um{nextMatch(e,t,n){let i=Ux(this.spec,e,n,e.doc.length).next();return i.done&&(i=Ux(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,n){for(let i=1;;i++){let r=Math.max(t,n-1e4*i),o=Ux(this.spec,e,r,n),a=null;for(;!o.next().done;)a=o.value;if(a&&(r==t||a.from>r+10))return a;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let t=n.length;t>0;t--){let i=+n.slice(0,t);if(i>0&&i<e.match.length)return e.match[i]+n.slice(t)}return t})}matchAll(e,t){let n=Ux(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=Ux(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}let U_=BY.define(),UM=BY.define(),UC=BD.define({create:e=>new UA(UB(e).create(),null),update(e,t){for(let n of t.effects)n.is(U_)?e=new UA(n.value.create(),e.panel):n.is(UM)&&(e=new UA(e.query,n.value?UN:null));return e},provide:e=>Hz.from(e,e=>e.panel)});class UA{constructor(e,t){this.query=e,this.panel=t}}let Uk=FG.mark({class:"cm-searchMatch"}),UT=FG.mark({class:"cm-searchMatch cm-searchMatch-selected"}),UD=zj.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(UC))}update(e){let t=e.state.field(UC);(t!=e.startState.field(UC)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return FG.none;let{view:n}=this,i=new Fe;for(let t=0,r=n.visibleRanges,o=r.length;t<o;t++){let{from:a,to:s}=r[t];for(;t<o-1&&s>r[t+1].from-500;)s=r[++t].to;e.highlight(n.state,a,s,(e,t)=>{let r=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);i.add(e,t,r?UT:Uk)})}return i.finish()}},{decorations:e=>e.decorations});function UI(e){return t=>{let n=t.state.field(UC,!1);return n&&n.query.spec.valid?e(t,n):UV(t)}}let UO=UI((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=Bb.single(i.from,i.to),o=e.state.facet(Uf);return e.dispatch({selection:r,effects:[UU(e,i),o.scrollToMatch(r.main,e)],userEvent:"select.search"}),Uz(e),!0}),UP=UI((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let o=Bb.single(r.from,r.to),a=e.state.facet(Uf);return e.dispatch({selection:o,effects:[UU(e,r),a.scrollToMatch(o.main,e)],userEvent:"select.search"}),Uz(e),!0}),UE=UI((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:Bb.create(n.map(e=>Bb.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),UR=UI((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,i,i);if(!o)return!1;let a=o,s=[],l,u,c=[];a.precise?a.from==i&&a.to==r&&(u=n.toText(t.getReplacement(a)),s.push({from:a.from,to:a.to,insert:u}),a=t.nextMatch(n,a.from,a.to),c.push(jN.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):a=t.nextMatch(n,a.from,a.to);let h=e.state.changes(s);return a&&(l=Bb.single(a.from,a.to).map(h),c.push(UU(e,a)),c.push(n.facet(Uf).scrollToMatch(l.main,e))),e.dispatch({changes:h,selection:l,effects:c,userEvent:"input.replace"}),!0}),UL=UI((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let i of t.matchAll(e.state,1e9)){let{from:e,to:r,precise:o}=i;o&&n.push({from:e,to:r,insert:t.getReplacement(i)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:jN.announce.of(i),userEvent:"input.replace.all"}),!0});function UN(e){return e.state.facet(Uf).createPanel(e)}function UB(e,t){var n,i,r,o,a;let s=e.selection.main,l=s.empty||s.to>s.from+100?"":e.sliceDoc(s.from,s.to);if(t&&!l)return t;let u=e.facet(Uf);return new Ug({search:(null!=(n=null==t?void 0:t.literal)?n:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!=(i=null==t?void 0:t.caseSensitive)?i:u.caseSensitive,literal:null!=(r=null==t?void 0:t.literal)?r:u.literal,regexp:null!=(o=null==t?void 0:t.regexp)?o:u.regexp,wholeWord:null!=(a=null==t?void 0:t.wholeWord)?a:u.wholeWord})}function UF(e){let t=HL(e,UN);return t&&t.dom.querySelector("[main-field]")}function Uz(e){let t=UF(e);t&&t==e.root.activeElement&&t.select()}let UV=e=>{let t=e.state.field(UC,!1);if(t&&t.panel){let n=UF(e);if(n&&n!=e.root.activeElement){let i=UB(e.state,t.query.spec);i.valid&&e.dispatch({effects:U_.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[UM.of(!0),t?U_.of(UB(e.state,t.query.spec)):BY.appendConfig.of(UY)]});return!0},Uj=e=>{let t=e.state.field(UC,!1);if(!t||!t.panel)return!1;let n=HL(e,UN);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:UM.of(!1)}),!0},UH=[{key:"Mod-f",run:UV,scope:"editor search-panel"},{key:"F3",run:UO,shift:UP,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:UO,shift:UP,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Uj,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,o=[],a=0;for(let t=new $7(e.doc,e.sliceDoc(i,r));!t.next().done;){if(o.length>1e3)return!1;t.value.from==i&&(a=o.length),o.push(Bb.range(t.value.from,t.value.to))}return t(e.update({selection:Bb.create(o,a),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{var t;let n,i,r,o,{state:a}=e,s=String(a.doc.lineAt(e.state.selection.main.head).number),{close:l,result:u}=(t={label:a.phrase("Go to line"),input:{type:"text",name:"line",value:s},focus:!0,submitLabel:a.phrase("go")},i=new Promise(e=>n=e),r=e=>(function(e,t,n){let i=t.content?t.content(e,()=>a(null)):null;if(!i){if(i=FC("form"),t.input){let e=FC("input",t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add("cm-textfield"),e.name||(e.name="input"),i.appendChild(FC("label",(t.label||"")+": ",e))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(FC("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r="FORM"==i.nodeName?[i]:i.querySelectorAll("form");for(let e=0;e<r.length;e++){let t=r[e];t.addEventListener("keydown",e=>{27==e.keyCode?(e.preventDefault(),a(null)):13==e.keyCode&&(e.preventDefault(),a(t))}),t.addEventListener("submit",e=>{e.preventDefault(),a(t)})}let o=FC("div",i,FC("button",{onclick:()=>a(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["\xd7"]));function a(t){o.contains(o.ownerDocument.activeElement)&&e.focus(),n(t)}return t.class&&(o.className=t.class),o.classList.add("cm-dialog"),{dom:o,top:t.top,mount:()=>{if(t.focus){let e;(e="string"==typeof t.focus?i.querySelector(t.focus):i.querySelector("input")||i.querySelector("button"))&&"select"in e?e.select():e&&"focus"in e&&e.focus()}}}})(e,t,n),e.state.field(HV,!1)?e.dispatch({effects:Hj.of(r)}):e.dispatch({effects:BY.appendConfig.of(HV.init(()=>[r]))}),{close:o=HH.of(r),result:i.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(HV).indexOf(r)>-1&&e.dispatch({effects:o})}),t))});return u.then(t=>{let n=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!n)return void e.dispatch({effects:l});let i=a.doc.lineAt(a.selection.main.head),[,r,o,s,u]=n,c=s?+s.slice(1):0,h=o?+o:i.number;if(o&&u){let e=h/100;r&&(e=e*("-"==r?-1:1)+i.number/a.doc.lines),h=Math.round(a.doc.lines*e)}else o&&r&&(h=h*("-"==r?-1:1)+i.number);let d=a.doc.line(Math.max(1,Math.min(a.doc.lines,h))),p=Bb.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[l,jN.scrollIntoView(p.from,{y:"center"})],selection:p})}),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,i=Bb.create(n.ranges.map(t=>e.wordAt(t.head)||Bb.cursor(t.head)),n.mainIndex);return!i.eq(n)&&(t(e.update({selection:i})),!0)})({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=i))return!1;let r=function(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),o=r&&r.from==n.from&&r.to==n.to;for(let n=!1,r=new $7(e.doc,t,i[i.length-1].to);;)if(r.next(),r.done){if(n)return null;r=new $7(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),n=!0}else{if(n&&i.some(e=>e.from==r.value.from))continue;if(o){let t=e.wordAt(r.value.from);if(!t||t.from!=r.value.from||t.to!=r.value.to)continue}return r.value}}(e,i);return!!r&&(t(e.update({selection:e.selection.addRange(Bb.range(r.from,r.to),!1),effects:jN.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class UW{constructor(e){this.view=e;let t=this.query=e.state.field(UC).query.spec;function n(e,t,n){return FC("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=FC("input",{value:t.search,placeholder:UG(e,"Find"),"aria-label":UG(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=FC("input",{value:t.replace,placeholder:UG(e,"Replace"),"aria-label":UG(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=FC("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=FC("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=FC("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=FC("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>UO(e),[UG(e,"next")]),n("prev",()=>UP(e),[UG(e,"previous")]),n("select",()=>UE(e),[UG(e,"all")]),FC("label",null,[this.caseField,UG(e,"match case")]),FC("label",null,[this.reField,UG(e,"regexp")]),FC("label",null,[this.wordField,UG(e,"by word")]),...e.state.readOnly?[]:[FC("br"),this.replaceField,n("replace",()=>UR(e),[UG(e,"replace")]),n("replaceAll",()=>UL(e),[UG(e,"replace all")])],FC("button",{name:"close",onclick:()=>Uj(e),"aria-label":UG(e,"close"),type:"button"},["\xd7"])])}commit(){let e=new Ug({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:U_.of(e)}))}keydown(e){var t;(t=this.view,jZ(jU(t.state),e,t,"search-panel"))?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?UP:UO)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),UR(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(U_)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Uf).top}}function UG(e,t){return e.state.phrase(t)}let U$=/[\s\.,:;?!]/;function UU(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,o=Math.max(i.from,t-30),a=Math.min(r,n+30),s=e.state.sliceDoc(o,a);if(o!=i.from){for(let e=0;e<30;e++)if(!U$.test(s[e+1])&&U$.test(s[e])){s=s.slice(e);break}}if(a!=r){for(let e=s.length-1;e>s.length-30;e--)if(!U$.test(s[e-1])&&U$.test(s[e])){s=s.slice(0,e);break}}return jN.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${i.number}.`)}let Uq=jN.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),UY=[UC,BO.low(UD),Uq];class UZ{constructor(e,t,n,i){this.state=e,this.pos=t,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Ws(this.state).resolveInner(this.pos,-1);for(;t&&0>e.indexOf(t.name);)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),i=t.text.slice(n-t.from,this.pos-t.from),r=i.search(UJ(e,!1));return r<0?null:{from:n+r,to:this.pos,text:i.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function UX(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}class UK{constructor(e,t,n,i){this.completion=e,this.source=t,this.match=n,this.score=i}}function UQ(e){return e.selection.main.from}function UJ(e,t){var n;let{source:i}=e,r=t&&"^"!=i[0],o="$"!=i[i.length-1];return r||o?RegExp(`${r?"^":""}(?:${i})${o?"$":""}`,null!=(n=e.flags)?n:e.ignoreCase?"i":""):e}let U0=B$.define(),U1=new WeakMap;function U2(e){if(!Array.isArray(e))return e;let t=U1.get(e);return t||U1.set(e,t=function(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,i]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let e=1;e<i.length;e++)n[i[e]]=!0}let i=UX(t)+UX(n)+"*$";return[RegExp("^"+i),new RegExp(i)]}(t);return e=>{let r=e.matchBefore(i);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}(e)),t}let U5=BY.define(),U3=BY.define();class U4{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=Ba(e,t),i=Bl(n);this.chars.push(n);let r=e.slice(t,t+i),o=r.toUpperCase();this.folded.push(Ba(o==r?r.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:i,precise:r,byWord:o}=this;if(1==t.length){let i=Ba(e,0),r=Bl(i),o=r==e.length?0:-100;if(i==t[0]);else{if(i!=n[0])return null;o+=-200}return this.ret(o,[0,r])}let a=e.indexOf(this.pattern);if(0==a)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,l=0;if(a<0){for(let r=0,o=Math.min(e.length,200);r<o&&l<s;){let o=Ba(e,r);(o==t[l]||o==n[l])&&(i[l++]=r),r+=Bl(o)}if(l<s)return null}let u=0,c=0,h=!1,d=0,p=-1,f=-1,g=/[a-z]/.test(e),m=!0;for(let i=0,l=Math.min(e.length,200),v=0;i<l&&c<s;){let l=Ba(e,i);a<0&&(u<s&&l==t[u]&&(r[u++]=i),d<s&&(l==t[d]||l==n[d]?(0==d&&(p=i),f=i+1,d++):d=0));let y,x=l<255?l>=48&&l<=57||l>=97&&l<=122?2:+(l>=65&&l<=90):(y=Bs(l))!=y.toLowerCase()?1:2*(y!=y.toUpperCase());(!i||1==x&&g||0==v&&0!=x)&&(t[c]==l||n[c]==l&&(h=!0)?o[c++]=i:o.length&&(m=!1)),v=x,i+=Bl(l)}return c==s&&0==o[0]&&m?this.result(-100+(h?-200:0),o,e):d==s&&0==p?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):d==s?this.ret(-900-e.length,[p,f]):c==s?this.result(-100+(h?-200:0)+-700+(m?0:-1100),o,e):2==t.length?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,n){let i=[],r=0;for(let e of t){let t=e+(this.astral?Bl(Ba(n,e)):1);r&&i[r-1]==e?i[r-1]=t:(i[r++]=e,i[r++]=t)}return this.ret(e-n.length,i)}}class U6{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}let U8=B_.define({combine:e=>B5(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:U7,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>U9(e(n),t(n)),optionClass:(e,t)=>n=>U9(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function U9(e,t){return e?t?e+" "+t:e:t}function U7(e,t,n,i,r,o){let a=e.textDirection==zl.RTL,s=a,l=!1,u="top",c,h,d=t.left-r.left,p=r.right-t.right,f=i.right-i.left,g=i.bottom-i.top;if(s&&d<Math.min(f,p)?s=!1:!s&&p<Math.min(f,d)&&(s=!0),f<=(s?d:p))c=Math.max(r.top,Math.min(n.top,r.bottom-g))-t.top,h=Math.min(400,s?d:p);else{l=!0,h=Math.min(400,(a?t.right:r.right-t.left)-30);let e=r.bottom-t.bottom;e>=g||e>t.top?c=n.bottom-t.top:(u="bottom",c=t.bottom-n.top)}let m=(t.bottom-t.top)/o.offsetHeight,v=(t.right-t.left)/o.offsetWidth;return{style:`${u}: ${c/m}px; max-width: ${h/v}px`,class:"cm-completionInfo-"+(l?a?"left-narrow":"right-narrow":s?"left":"right")}}let qe=BY.define();function qt(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let i=Math.ceil((e-t)/n);return{from:e-i*n,to:e-(i-1)*n}}class qn{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:r,selected:o}=i.open,a=e.state.facet(U8);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,i){let r=document.createElement("span");r.className="cm-completionLabel";let o=e.displayLabel||e.label,a=0;for(let e=0;e<i.length;){let t=i[e++],n=i[e++];t>a&&r.appendChild(document.createTextNode(o.slice(a,t)));let s=r.appendChild(document.createElement("span"));s.appendChild(document.createTextNode(o.slice(t,n))),s.className="cm-completionMatchedText",a=n}return a<o.length&&r.appendChild(document.createTextNode(o.slice(a))),r},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=qt(r.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:i}=e.state.field(t).open;for(let t=n.target,r;t&&t!=this.dom;t=t.parentNode)if("LI"==t.nodeName&&(r=/-(\d+)$/.exec(t.id))&&+r[1]<i.length){this.applyCompletion(e,i[+r[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains("cm-completionListIncompleteTop")&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;null!=t&&(e.dispatch({effects:qe.of(t)}),n.preventDefault())}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(U8).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:U3.of(null)})}),this.showOptions(r,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=i){let{options:r,selected:o,disabled:a}=n.open;i.open&&i.open.options==r||(this.range=qt(r.length,o,e.state.facet(U8).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),a!=(null==(t=i.open)?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=qt(t.options.length,t.selected,this.view.state.facet(U8).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:r}=i;if(!r)return;let o="string"==typeof r?document.createTextNode(r):r(i);if(!o)return;"then"in o?o.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,i)}).catch(e=>zB(this.view.state,e,"completion info")):(this.addInfoPane(o,i),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:i}=e;n.appendChild(t),this.infoDestroy=i||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){var t,n;let i,r,o,a=null;for(let t=this.list.firstChild,n=this.range.from;t;t=t.nextSibling,n++)"LI"==t.nodeName&&t.id?n==e?t.hasAttribute("aria-selected")||(t.setAttribute("aria-selected","true"),a=t):t.hasAttribute("aria-selected")&&(t.removeAttribute("aria-selected"),t.removeAttribute("aria-describedby")):n--;return a&&(t=this.list,n=a,i=t.getBoundingClientRect(),r=n.getBoundingClientRect(),o=i.height/t.offsetHeight,r.top<i.top?t.scrollTop-=(i.top-r.top)/o:r.bottom>i.bottom&&(t.scrollTop+=(r.bottom-i.bottom)/o)),a}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return i.top>Math.min(r.bottom,t.bottom)-10||i.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(U8).positionInfo(this.view,t,i,n,r,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){let i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",e=>{e.target==i&&e.preventDefault()});let r=null;for(let o=n.from;o<n.to;o++){let{completion:a,match:s}=e[o],{section:l}=a;if(l){let e="string"==typeof l?l:l.name;e!=r&&(o>n.from||0==n.from)&&(r=e,"string"!=typeof l&&l.header?i.appendChild(l.header(l)):i.appendChild(document.createElement("completion-section")).textContent=e)}let u=i.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let c=this.optionClass(a);for(let e of(c&&(u.className=c),this.optionContent)){let t=e(a,this.view.state,this.view,s);t&&u.appendChild(t)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function qi(e){return 100*(e.boost||0)+10*!!e.apply+5*!!e.info+ +!!e.type}class qr{constructor(e,t,n,i,r,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=i,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new qr(this.options,ql(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,i,r,o){if(i&&!o&&e.some(e=>e.isPending))return i.setDisabled();let a=function(e,t){let n=[],i=null,r=null,o=e=>{n.push(e);let{section:t}=e.completion;if(t){i||(i=[]);let e="string"==typeof t?t:t.name;i.some(t=>t.name==e)||i.push("string"==typeof t?{name:e}:t)}},a=t.facet(U8);for(let i of e)if(i.hasResult()){let e=i.result.getMatch;if(!1===i.result.filter)for(let t of i.result.options)o(new UK(t,i.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(i.from,i.to),s,l=a.filterStrict?new U6(n):new U4(n);for(let t of i.result.options)if(s=l.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,a=s.score+(t.boost||0);if(o(new UK(t,i.source,n,a)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;r||(r=Object.create(null)),r[e]=Math.max(a,r[e]||-1e9)}}}}if(i){let e=Object.create(null),t=0;for(let n of i.sort((e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?r[t.name]-r[e.name]:0)||("number"==typeof e.rank?e.rank:1e9)-("number"==typeof t.rank?t.rank:1e9)||(e.name<t.name?-1:1)))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let s=[],l=null,u=a.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||u(e.completion,t.completion))){let t=e.completion;l&&l.label==t.label&&l.detail==t.detail&&(null==l.type||null==t.type||l.type==t.type)&&l.apply==t.apply&&l.boost==t.boost?qi(e.completion)>qi(l)&&(s[s.length-1]=e):s.push(e),l=e.completion}return s}(e,t);if(!a.length)return i&&e.some(e=>e.isPending)?i.setDisabled():null;let s=t.facet(U8).selectOnOpen?0:-1;if(i&&i.selected!=s&&-1!=i.selected){let e=i.options[i.selected].completion;for(let t=0;t<a.length;t++)if(a[t].completion==e){s=t;break}}return new qr(a,ql(n,s),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:qm,above:r.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(e){return new qr(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new qr(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class qo{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new qo(qu,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(U8),i=(n.override||t.languageDataAt("autocomplete",UQ(t)).map(U2)).map(t=>(this.active.find(e=>e.source==t)||new qh(t,+!!this.active.some(e=>0!=e.state))).update(e,n));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let r=this.open,o=e.effects.some(e=>e.is(qp));for(let a of(r&&e.docChanged&&(r=r.map(e.changes)),e.selection||i.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;i<t.length&&!t[i].hasResult();)i++;let r=n==e.length,o=i==t.length;if(r||o)return r==o;if(e[n++].result!=t[i++].result)return!1}}(i,this.active)||o?r=qr.build(i,t,this.id,r,n,o):r&&r.disabled&&!i.some(e=>e.isPending)&&(r=null),!r&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new qh(e.source,0):e)),e.effects))a.is(qe)&&(r=r&&r.setSelected(a.value,this.id));return i==this.active&&r==this.open?this:new qo(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?qa:qs}}let qa={"aria-autocomplete":"list"},qs={};function ql(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let qu=[];function qc(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(U0);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:16*!!e.docChanged}class qh{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=qc(e,t),i=this;for(let t of((8&n||16&n&&this.touches(e))&&(i=new qh(i.source,0)),4&n&&0==i.state&&(i=new qh(this.source,1)),i=i.updateFor(e,n),e.effects))if(t.is(U5))i=new qh(i.source,1,t.value);else if(t.is(U3))i=new qh(i.source,0);else if(t.is(qp))for(let e of t.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(UQ(e.state))}}class qd extends qh{constructor(e,t,n,i,r,o){super(e,3,t),this.limit=n,this.result=i,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=UQ(e.state);if(a>o||!i||2&t&&(UQ(e.startState)==this.from||a<this.limit))return new qh(this.source,4&t?1:0);let s=e.changes.mapPos(this.limit);return!function(e,t,n,i){if(!e)return!1;let r=t.sliceDoc(n,i);return"function"==typeof e?e(r,n,i,t):UJ(e,!0).test(r)}(i.validFor,e.state,r,o)?i.update&&(i=i.update(i,r,o,new UZ(e.state,a,!1)))?new qd(this.source,this.explicit,s,i,i.from,null!=(n=i.to)?n:UQ(e.state)):new qh(this.source,1,this.explicit):new qd(this.source,this.explicit,s,i,r,o)}map(e){if(e.empty)return this;let t=this.result.map?this.result.map(this.result,e):this.result;return t?new qd(this.source,this.explicit,e.mapPos(this.limit),t,e.mapPos(this.from),e.mapPos(this.to,1)):new qh(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}let qp=BY.define({map:(e,t)=>e.map(e=>e.map(t))}),qf=BD.define({create:()=>qo.start(),update:(e,t)=>e.update(t),provide:e=>[HA.from(e,e=>e.tooltip),jN.contentAttributes.from(e,e=>e.attrs)]});function qg(e,t){let n=t.completion.apply||t.completion.label,i=e.state.field(qf).active.find(e=>e.source==t.source);return i instanceof qd&&("string"==typeof n?e.dispatch({...function(e,t,n,i){let{main:r}=e.selection,o=n-r.from,a=i-r.from;return{...e.changeByRange(s=>{if(s!=r&&n!=i&&e.sliceDoc(s.from+o,s.from+a)!=e.sliceDoc(n,i))return{range:s};let l=e.toText(t);return{changes:{from:s.from+o,to:i==r.from?s.to:s.from+a,insert:l},range:Bb.cursor(s.from+o+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}(e.state,n,i.from,i.to),annotations:U0.of(t.completion)}):n(e,t.completion,i.from,i.to),!0)}let qm=e=>new qn(e,qf,qg);function qv(e,t="option"){return n=>{let i=n.state.field(qf,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(U8).interactionDelay)return!1;let r=1,o;"page"==t&&(o=HP(n,i.open.tooltip))&&(r=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:a}=i.open.options,s=i.open.selected>-1?i.open.selected+r*(e?1:-1):e?0:a-1;return s<0?s="page"==t?0:a-1:s>=a&&(s="page"==t?a-1:0),n.dispatch({effects:qe.of(s)}),!0}}let qy=e=>!!e.state.field(qf,!1)&&(e.dispatch({effects:U5.of(!0)}),!0);class qx{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}let qb=zj.fromClass(class{constructor(e){for(let t of(this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0,e.state.field(qf).active))t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(qf),n=e.state.facet(U8);if(!e.selectionSet&&!e.docChanged&&e.startState.field(qf)==t)return;let i=e.transactions.some(e=>{let t=qc(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(i||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){zB(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(U5)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),r):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(qf);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(U8).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=UQ(t),i=new UZ(t,n,e.explicit,this.view),r=new qx(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:U3.of(null)}),zB(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(U8).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(U8),i=this.view.state.field(qf);for(let r=0;r<this.running.length;r++){let o=this.running[r];if(void 0===o.done)continue;if(this.running.splice(r--,1),o.done){let i=UQ(o.updates.length?o.updates[0].startState:this.view.state),r=Math.min(i,o.done.from+ +!o.active.explicit),a=new qd(o.active.source,o.active.explicit,r,o.done,o.done.from,null!=(e=o.done.to)?e:i);for(let e of o.updates)a=a.update(e,n);if(a.hasResult()){t.push(a);continue}}let a=i.active.find(e=>e.source==o.active.source);if(a&&a.isPending)if(null==o.done){let e=new qh(o.active.source,0);for(let t of o.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(a)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:qp.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(qf,!1);if(t&&t.tooltip&&this.view.state.facet(U8).closeOnBlur){let n=t.open&&HP(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:U3.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:U5.of(!1)}),20),this.composing=0}}}),qw="object"==typeof navigator&&/Win/.test(navigator.platform),qS=BO.highest(jN.domEventHandlers({keydown(e,t){let n=t.state.field(qf,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(qw&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(e=>e.source==i.source),o=i.completion.commitCharacters||r.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&qg(t,i),!1}})),q_=jN.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),qM={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},qC=BY.define({map(e,t){let n=t.mapPos(e,-1,Bc.TrackAfter);return null==n?void 0:n}}),qA=new class extends B3{};qA.startSide=1,qA.endSide=-1;let qk=BD.define({create:()=>B7.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(qC)&&(e=e.update({add:[qA.range(n.value,n.value+1)]}));return e}}),qT="()[]{}<>\xab\xbb\xbb\xab[]{}";function qD(e){for(let t=0;t<qT.length;t+=2)if(qT.charCodeAt(t)==e)return qT.charAt(t+1);return Bs(e<128?e:e+1)}function qI(e,t){return e.languageDataAt("closeBrackets",t)[0]||qM}let qO="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),qP=jN.inputHandler.of((e,t,n,i)=>{if((qO?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||2==i.length&&1==Bl(Ba(i,0))||t!=r.from||n!=r.to)return!1;let o=function(e,t){let n=qI(e,e.selection.main.head),i=n.brackets||qM.brackets;for(let r of i){let o=qD(Ba(r,0));if(t==r)return o==r?function(e,t,n,i){let r=i.stringPrefixes||qM.stringPrefixes,o=null,a=e.changeByRange(i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:qC.of(i.to+t.length),range:Bb.range(i.anchor+t.length,i.head+t.length)};let a=i.head,s=qL(e.doc,a),l;if(s==t){if(qN(e,a))return{changes:{insert:t+t,from:a},effects:qC.of(a+t.length),range:Bb.cursor(a+t.length)};else if(qR(e,a)){let i=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+i.length,insert:i},range:Bb.cursor(a+i.length)}}}else if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(l=qB(e,a-2*t.length,r))>-1&&qN(e,l))return{changes:{insert:t+t+t+t,from:a},effects:qC.of(a+t.length),range:Bb.cursor(a+t.length)};else if(e.charCategorizer(a)(s)!=B0.Word&&qB(e,a,r)>-1&&!function(e,t,n,i){let r=Ws(e).resolveInner(t,-1),o=i.reduce((e,t)=>Math.max(e,t.length),0);for(let a=0;a<5;a++){let a=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+o)),s=a.indexOf(n);if(!s||s>-1&&i.indexOf(a.slice(0,s))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let l=r.to==t&&r.parent;if(!l)break;r=l}return!1}(e,a,t,r))return{changes:{insert:t+t,from:a},effects:qC.of(a+t.length),range:Bb.cursor(a+t.length)};return{range:o=i}});return o?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}(e,r,i.indexOf(r+r+r)>-1,n):function(e,t,n,i){let r=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:qC.of(o.to+t.length),range:Bb.range(o.anchor+t.length,o.head+t.length)};let a=qL(e.doc,o.head);return!a||/\s/.test(a)||i.indexOf(a)>-1?{changes:{insert:t+n,from:o.head},effects:qC.of(o.head+t.length),range:Bb.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,r,o,n.before||qM.before);if(t==o&&qR(e,e.selection.main.from))return function(e,t){let n=null,i=e.changeByRange(i=>i.empty&&qL(e.doc,i.head)==t?{changes:{from:i.head,to:i.head+t.length,insert:t},range:Bb.cursor(i.head+t.length)}:n={range:i});return n?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}(e,o)}return null}(e.state,i);return!!o&&(e.dispatch(o),!0)}),qE=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=qI(e,e.selection.main.head).brackets||qM.brackets,i=null,r=e.changeByRange(t=>{if(t.empty){var r,o;let i,a=(r=e.doc,o=t.head,Bl(Ba(i=r.sliceString(o-2,o),0))==i.length?i:i.slice(1));for(let i of n)if(i==a&&qL(e.doc,t.head)==qD(Ba(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:Bb.cursor(t.head-i.length)}}return{range:i=t}});return i||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function qR(e,t){let n=!1;return e.field(qk).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function qL(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Bl(Ba(n,0)))}function qN(e,t){let n=Ws(e).resolveInner(t+1);return n.parent&&n.from==t}function qB(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=B0.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&i(e.sliceDoc(n-1,n))!=B0.Word)return n}return -1}let qF=[{key:"Ctrl-Space",run:qy},{mac:"Alt-`",run:qy},{mac:"Alt-i",run:qy},{key:"Escape",run:e=>{let t=e.state.field(qf,!1);return!!t&&!!t.active.some(e=>0!=e.state)&&(e.dispatch({effects:U3.of(null)}),!0)}},{key:"ArrowDown",run:qv(!0)},{key:"ArrowUp",run:qv(!1)},{key:"PageDown",run:qv(!0,"page")},{key:"PageUp",run:qv(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(qf,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(U8).interactionDelay)&&qg(e,t.open.options[t.open.selected])}}],qz=BO.highest(jG.computeN([U8],e=>e.facet(U8).defaultKeymap?[qF]:[]));var qV=function(e){let t;void 0===e&&(e={});var n=e.crosshairCursor,i=[];!1!==e.closeBracketsKeymap&&(i=i.concat(qE)),!1!==e.defaultKeymap&&(i=i.concat($6)),!1!==e.searchKeymap&&(i=i.concat(UH)),!1!==e.historyKeymap&&(i=i.concat($l)),!1!==e.foldKeymap&&(i=i.concat(Wj)),!1!==e.completionKeymap&&(i=i.concat(qF)),!1!==e.lintKeymap&&(i=i.concat(GC));var r=[];return!1!==e.lineNumbers&&r.push(function(e={}){return[H4.of(e),HX(),H9]}()),!1!==e.highlightActiveLineGutter&&r.push(Wt),!1!==e.highlightSpecialChars&&r.push(function(e={}){return[Hs.of(e),Hl||(Hl=zj.fromClass(class{constructor(e){this.view=e,this.decorations=FG.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Hs)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new Hn({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,o=Ba(t[0],0);if(9==o){let e=r.lineAt(i),t=n.state.tabSize,o=Fh(e.text,t,i-e.from);return FG.replace({widget:new Hc((t-o%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=FG.replace({widget:new Hu(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Hs);e.startState.facet(Hs)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}()),!1!==e.history&&r.push(function(e={}){return[G3,G5.of(e),jN.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?G6:"historyRedo"==e.inputType?G8:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&r.push(function(e={}){let t={...WY,...e},n=new WZ(t,!0),i=new WZ(t,!1),r=zj.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(Wm)!=e.state.facet(Wm)||e.startState.field(WN,!1)!=e.state.field(WN,!1)||Ws(e.startState)!=Ws(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new Fe;for(let r of e.viewportLineBlocks){let o=WF(e.state,r.from,r.to)?i:WO(e.state,r.from,r.to)?n:null;o&&t.add(r.from,r.from,o)}return t.finish()}}),{domEventHandlers:o}=t;return[r,HY({class:"cm-foldGutter",markers(e){var t;return(null==(t=e.plugin(r))?void 0:t.markers)||B7.empty},initialSpacer:()=>new WZ(t,!1),domEventHandlers:{...o,click:(e,t,n)=>{if(o.click&&o.click(e,t,n))return!0;let i=WF(e.state,t.from,t.to);if(i)return e.dispatch({effects:WR.of(i)}),!0;let r=WO(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:WE.of(r)}),!0)}}}),WG()]}()),!1!==e.drawSelection&&r.push(function(e={}){return[j2.of(e),j3,j6,j8,zP.of(!0)]}()),!1!==e.dropCursor&&r.push([j7,He]),!1!==e.allowMultipleSelections&&r.push(B2.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&r.push(B2.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+200)return e;let o=n.sliceString(r.from,i);if(!t.some(e=>e.test(o)))return e;let{state:a}=e,s=-1,l=[];for(let{head:e}of a.selection.ranges){let t=a.doc.lineAt(e);if(t.from==s)continue;s=t.from;let n=WS(a,t.from);if(null==n)continue;let i=/^\s*/.exec(t.text)[0],r=Ww(a,n);i!=r&&l.push({from:t.from,to:t.from+i.length,insert:r})}return l.length?[e,{changes:l,sequential:!0}]:e})),!1!==e.syntaxHighlighting&&r.push(W1(W5,{fallback:!0})),!1!==e.bracketMatching&&r.push(function(e={}){return[W6.of(e),Gt]}()),!1!==e.closeBrackets&&r.push([qP,qk]),!1!==e.autocompletion&&r.push(function(e={}){return[qS,qf,U8.of(e),qb,qz,q_]}()),!1!==e.rectangularSelection&&r.push((t=e=>e.altKey&&0==e.button,jN.mouseSelectionStyle.of((e,n)=>{let i,r;return t(n)?(i=Hf(e,n),r=e.state.selection,i?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(i.line).from),n=e.state.doc.lineAt(t);i={line:n.number,col:i.col,off:Math.min(i.off,n.length)},r=r.map(e.changes)}},get(t,n,o){let a=Hf(e,t);if(!a)return r;let s=function(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),o=[];if(t.off>2e3||n.off>2e3||t.col<0||n.col<0){let a=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=i;t<=r;t++){let n=e.doc.line(t);n.length<=s&&o.push(Bb.range(n.from+a,n.to+s))}}else{let a=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=i;t<=r;t++){let n=e.doc.line(t),i=Fd(n.text,a,e.tabSize,!0);if(i<0)o.push(Bb.cursor(n.to));else{let t=Fd(n.text,s,e.tabSize);o.push(Bb.range(n.from+i,n.from+t))}}}return o}(e.state,i,a);return s.length?o?Bb.create(s.concat(r.ranges)):Bb.create(s):r}}:null):null}))),!1!==(void 0!==n&&n)&&r.push(function(e={}){let[t,n]=Hg[e.key||"Alt"],i=zj.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[i,jN.contentAttributes.of(e=>{var t;return(null==(t=e.plugin(i))?void 0:t.isDown)?Hm:null})]}()),!1!==e.highlightActiveLine&&r.push(Hd),!1!==e.highlightSelectionMatches&&r.push([Up,Ud]),e.tabSize&&"number"==typeof e.tabSize&&r.push(Wx.of(" ".repeat(e.tabSize))),r.concat([jG.of(i.flat())]).filter(Boolean)};let qj="#e06c75",qH="#abb2bf",qW="#7d8799",qG="#d19a66",q$="#2c313a",qU="#282c34",qq="#353a42",qY="#528bff",qZ=[jN.theme({"&":{color:qH,backgroundColor:qU},".cm-content":{caretColor:qY},".cm-cursor, .cm-dropCursor":{borderLeftColor:qY},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:qH},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:qU,color:qW,border:"none"},".cm-activeLineGutter":{backgroundColor:q$},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:qq},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:qq,borderBottomColor:qq},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:q$,color:qH}}},{dark:!0}),W1(WK.define([{tag:NY.keyword,color:"#c678dd"},{tag:[NY.name,NY.deleted,NY.character,NY.propertyName,NY.macroName],color:qj},{tag:[NY.function(NY.variableName),NY.labelName],color:"#61afef"},{tag:[NY.color,NY.constant(NY.name),NY.standard(NY.name)],color:qG},{tag:[NY.definition(NY.name),NY.separator],color:qH},{tag:[NY.typeName,NY.className,NY.number,NY.changed,NY.annotation,NY.modifier,NY.self,NY.namespace],color:"#e5c07b"},{tag:[NY.operator,NY.operatorKeyword,NY.url,NY.escape,NY.regexp,NY.link,NY.special(NY.string)],color:"#56b6c2"},{tag:[NY.meta,NY.comment],color:qW},{tag:NY.strong,fontWeight:"bold"},{tag:NY.emphasis,fontStyle:"italic"},{tag:NY.strikethrough,textDecoration:"line-through"},{tag:NY.link,color:qW,textDecoration:"underline"},{tag:NY.heading,fontWeight:"bold",color:qj},{tag:[NY.atom,NY.bool,NY.special(NY.variableName)],color:qG},{tag:[NY.processingInstruction,NY.string,NY.inserted],color:"#98c379"},{tag:NY.invalid,color:"#ffffff"}]))];var qX=jN.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),qK=function(e){let t;void 0===e&&(e={});var n=e,i=n.indentWithTab,r=n.editable,o=n.readOnly,a=n.theme,s=void 0===a?"light":a,l=n.placeholder,u=void 0===l?"":l,c=n.basicSetup,h=void 0===c||c,d=[];switch((void 0===i||i)&&d.unshift(jG.of([$8])),h&&("boolean"==typeof h?d.unshift(qV()):d.unshift(qV(h))),u&&d.unshift((t=zj.fromClass(class{constructor(e){this.view=e,this.placeholder=u?FG.set([FG.widget({widget:new Hp(u),side:1}).range(0)]):FG.none}get decorations(){return this.view.state.doc.length?FG.none:this.placeholder}},{decorations:e=>e.decorations}),"string"==typeof u?[t,jN.contentAttributes.of({"aria-placeholder":u})]:t)),s){case"light":d.push(qX);break;case"dark":d.push(qZ);break;case"none":break;default:d.push(s)}return!1===(void 0===r||r)&&d.push(jN.editable.of(!1)),void 0!==o&&o&&d.push(B2.readOnly.of(!0)),[...d]};class qQ{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error("TimeoutLatch callback error:",e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class qJ{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),0===this.latches.size&&this.stop()}start(){null===this.interval&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){null!==this.interval&&(clearInterval(this.interval),this.interval=null)}}var q0=null,q1=B$.define(),q2=[],q5=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],q3=(0,eD.forwardRef)((e,t)=>{var n,i,r,o,a,s,l,u,c,h,d,p,f,g,m,v,y,x,b,w,S,_,M,C,A,k,T,D,I,O,P,E,R,L,N,B,F,z,V,j,H,W,G,$,U,q,Y,Z,X,K=e.className,Q=e.value,J=void 0===Q?"":Q,ee=e.selection,et=e.extensions,en=e.onChange,ei=e.onStatistics,er=e.onCreateEditor,eo=e.onUpdate,ea=e.autoFocus,es=e.theme,el=void 0===es?"light":es,eu=e.height,ec=e.minHeight,eh=e.maxHeight,ed=e.width,ep=e.minWidth,ef=e.maxWidth,eg=e.basicSetup,em=e.placeholder,ev=e.indentWithTab,ey=e.editable,ex=e.readOnly,ew=e.root,eS=e.initialState,e_=(0,Gq.A)(e,q5),eM=(0,eD.useRef)(null),eC=(i=(n={root:ew,value:J,autoFocus:ea,theme:el,height:eu,minHeight:ec,maxHeight:eh,width:ed,minWidth:ep,maxWidth:ef,basicSetup:eg,placeholder:em,indentWithTab:ev,editable:ey,readOnly:ex,selection:ee,onChange:en,onStatistics:ei,onCreateEditor:er,onUpdate:eo,extensions:void 0===et?[]:et,initialState:eS}).value,r=n.selection,o=n.onChange,a=n.onStatistics,s=n.onCreateEditor,l=n.onUpdate,c=void 0===(u=n.extensions)?q2:u,h=n.autoFocus,p=void 0===(d=n.theme)?"light":d,g=void 0===(f=n.height)?null:f,v=void 0===(m=n.minHeight)?null:m,x=void 0===(y=n.maxHeight)?null:y,w=void 0===(b=n.width)?null:b,_=void 0===(S=n.minWidth)?null:S,C=void 0===(M=n.maxWidth)?null:M,k=void 0===(A=n.placeholder)?"":A,D=void 0===(T=n.editable)||T,O=void 0!==(I=n.readOnly)&&I,E=void 0===(P=n.indentWithTab)||P,L=void 0===(R=n.basicSetup)||R,N=n.root,B=n.initialState,z=(F=(0,eD.useState)())[0],V=F[1],H=(j=(0,eD.useState)())[0],W=j[1],$=(G=(0,eD.useState)())[0],U=G[1],q=(0,eD.useState)(()=>({current:null}))[0],Y=(0,eD.useState)(()=>({current:null}))[0],Z=jN.theme({"&":{height:g,minHeight:v,maxHeight:x,width:w,minWidth:_,maxWidth:C},"& .cm-scroller":{height:"100% !important"}}),X=[jN.updateListener.of(e=>{e.docChanged&&"function"==typeof o&&!e.transactions.some(e=>e.annotation(q1))&&(q.current?q.current.reset():(q.current=new qQ(()=>{if(Y.current){var e=Y.current;Y.current=null,e()}q.current=null},200),("u"<typeof window?new qJ:(!q0&&(q0=new qJ),q0)).add(q.current)),o(e.state.doc.toString(),e)),a&&a({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)})}),Z,...qK({theme:p,editable:D,readOnly:O,placeholder:k,indentWithTab:E,basicSetup:L})],l&&"function"==typeof l&&X.push(jN.updateListener.of(l)),X=X.concat(c),(0,eD.useLayoutEffect)(()=>{if(z&&!$){var e={doc:i,selection:r,extensions:X},t=B?B2.fromJSON(B.json,e,B.fields):B2.create(e);if(U(t),!H){var n=new jN({state:t,parent:z,root:N});W(n),s&&s(n,t)}}return()=>{H&&(U(void 0),W(void 0))}},[z,$]),(0,eD.useEffect)(()=>{n.container&&V(n.container)},[n.container]),(0,eD.useEffect)(()=>()=>{H&&(H.destroy(),W(void 0)),q.current&&(q.current.cancel(),q.current=null)},[H]),(0,eD.useEffect)(()=>{h&&H&&H.focus()},[h,H]),(0,eD.useEffect)(()=>{H&&H.dispatch({effects:BY.reconfigure.of(X)})},[p,c,g,v,x,w,_,C,k,D,O,E,L,o,l]),(0,eD.useEffect)(()=>{if(void 0!==i){var e=H?H.state.doc.toString():"";if(H&&i!==e){var t=q.current&&!q.current.isDone,n=()=>{H&&i!==H.state.doc.toString()&&H.dispatch({changes:{from:0,to:H.state.doc.toString().length,insert:i||""},annotations:[q1.of(!0)]})};t?Y.current=n:n()}}},[i,H]),{state:$,setState:U,view:H,setView:W,container:z,setContainer:V}),eA=eC.state,ek=eC.view,eT=eC.container,eI=eC.setContainer;(0,eD.useImperativeHandle)(t,()=>({editor:eM.current,state:eA,view:ek}),[eM,eT,eA,ek]);var eO=(0,eD.useCallback)(e=>{eM.current=e,eI(e)},[eI]);if("string"!=typeof J)throw Error("value must be typeof string but got "+typeof J);return(0,eb.jsx)("div",(0,ou.A)({ref:eO,className:("string"==typeof el?"cm-theme-"+el:"cm-theme")+(K?" "+K:"")},e_))});function q4(e){let t=(0,ur.A)(),n="dark"===t.palette.mode,[i,r]=(0,eD.useState)(()=>JSON.stringify(e.value,null,2)),[o,a]=(0,eD.useState)(i);return(0,eb.jsx)(q3,{...e,style:{border:`1px solid ${t.palette.divider}`},theme:n?"dark":"light",extensions:[new Wv(Gd),function(e,t={}){return[Gk.of({source:e,config:t}),GA,G$]}(e=>{try{JSON.parse(e.state.doc.toString())}catch(r){var t;let n;if(!(r instanceof SyntaxError))throw r;let i=(t=e.state.doc,(n=r.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=r.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0);return[{from:i,message:r.message,severity:"error",to:i}]}return[]}),function(e={}){return[GU.of(e),GV,Gz,GW,GH]}()],value:i,onChange:t=>{r(t),e.onChange&&e.onChange(t)},onBlur:()=>{o!==i&&void 0!==e.onChange&&(e.onChange(i),a(i))},placeholder:e.placeholder})}q3.displayName="CodeMirror";var q6=n(10740);let q8=e=>{let{mode:t,url:n,name:i,newTabOpen:r,renderVariables:o,tooltip:a}=e;return(0,eb.jsxs)(eM.A,{direction:"column",gap:2,flexGrow:1,children:[(0,eb.jsx)(h_,{label:n.label,error:n.error?.hasError,helperText:n.error?.helperText,onChange:n.onChange,placeholder:n.placeholder,multiline:!0,maxRows:5,required:!0,fullWidth:!0,value:n.value}),(i||a)&&(0,eb.jsxs)(eM.A,{gap:1,direction:"inline"===t?"row":"column",children:[i&&(0,eb.jsx)(h_,{sx:{flexGrow:"1"},label:i.label,onChange:i?.onChange,placeholder:i?.placeholder,value:i?.value}),a&&(0,eb.jsx)(h_,{sx:{flexGrow:"1"},label:a.label,onChange:a?.onChange,placeholder:a?.placeholder,value:a?.value})]}),(0,eb.jsxs)(eM.A,{direction:"row",gap:1,children:[o&&(0,eb.jsx)(q6.A,{label:o.label,control:(0,eb.jsx)(cm.A,{checked:o.value,onChange:e=>{o?.onChange(e.target.checked)}})}),(0,eb.jsx)(q6.A,{label:r.label,control:(0,eb.jsx)(cm.A,{checked:r.value,onChange:e=>{r?.onChange(e.target.checked)}})})]})]})},q9=[{id:"value",label:"Value"},{id:"percentage",label:"Percentage"}];function q7({disablePercentageMode:e,onChange:t,value:n="value"}){return(0,eb.jsx)(h2,{label:"Mode",control:(0,eb.jsx)(h8,{value:q9.find(e=>e.id===n),options:q9,getOptionLabel:e=>e.label,getOptionDisabled:t=>"percentage"===t.id&&e,onChange:(e,{id:n})=>{t(n)},disableClearable:!0})})}var Ye=n(33313);function Yt(e){let{message:t}=e;return(0,eb.jsx)(eM.A,{sx:{height:"100%",alignItems:"center",justifyContent:"center"},children:(0,eb.jsx)(hi.A,{children:t})})}function Yn(e){let{resource:t}=e;return(0,eb.jsx)(Yt,{message:`No ${t}`})}function Yi(e){let{variant:t="rounded"}=e;return(0,eb.jsx)(eM.A,{sx:{height:"100%",alignItems:"center",justifyContent:"center",px:1},children:(0,eb.jsx)(Ye.A,{variant:t,width:"100%",height:"30%","aria-label":"Loading..."})})}let Yr=[{id:"asc",label:"Ascending"},{id:"desc",label:"Descending"}];function Yo({onChange:e,value:t="desc"}){return(0,eb.jsx)(h2,{label:"Sort",control:(0,eb.jsx)(h8,{value:Yr.find(e=>e.id===t),options:Yr,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function Ya({onChange:e,value:t,...n}){let i=t=>{e(t)};return(0,eb.jsxs)(ew.A,{"aria-label":"Sort",...n,children:[(0,eb.jsx)(eS.A,{onClick:()=>i(void 0),variant:void 0===t?"contained":"outlined",children:"None"}),(0,eb.jsx)(eS.A,{onClick:()=>i("asc"),variant:"asc"===t?"contained":"outlined",children:"Asc"}),(0,eb.jsx)(eS.A,{onClick:()=>i("desc"),variant:"desc"===t?"contained":"outlined",children:"Desc"})]})}var Ys=n(61375),Yl=n(31729);let Yu=(0,n(68335).A)();var Yc=n(86742),Yh=n(86067);function Yd({inputRef:e,label:t,color:n,value:i,mode:r,onChange:o,onColorChange:a,onBlur:s,onDelete:l}){let[u,c]=(0,eD.useState)(0);return(0,eb.jsxs)(eM.A,{flex:1,direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,eb.jsx)(un,{label:t,color:n,onColorChange:a}),(0,eb.jsx)(hX.A,{htmlFor:t,children:t}),(0,eb.jsx)(eA.A,{id:t,inputRef:e,type:"number",value:0===i?"":i,placeholder:"0",onChange:o,onBlur:s,onKeyDown:e=>{"Enter"===e.key&&(s(),c(u+1))},InputProps:{endAdornment:"percent"===r?(0,eb.jsx)(uo.A,{paddingX:1,children:"%"}):void 0}},u),(0,eb.jsx)(eC.A,{"aria-label":`delete threshold ${t}`,size:"small",onClick:l,children:(0,eb.jsx)(Yh,{})})]})}function Yp({thresholds:e,onChange:t,hideDefault:n,disablePercentMode:i}){let{thresholds:{defaultColor:r,palette:o}}=ti(),a=e?.defaultColor??r,s=e?.steps,l=(0,eD.useRef)(null),u=(0,eD.useRef)(!1);(0,eD.useEffect)(()=>{l.current&&u.current&&(l.current?.focus(),u.current=!1)},[s?.length]);let c=()=>{if(void 0!==s){let n=[...s];n.sort((e,t)=>e.value-t.value),void 0!==e&&t((0,ua.jM)(e,e=>{e.steps=n}))}};return(0,eb.jsxs)(h3,{title:"Thresholds",icon:(0,eb.jsx)(hJ,{description:"Add threshold",children:(0,eb.jsx)(eC.A,{size:"small","aria-label":"add threshold",onClick:()=>{u.current=!0,void 0===e?t({steps:[{value:10}]}):e&&void 0===e.steps?t((0,ua.jM)(e,e=>{e.steps=[{value:10}]})):t((0,ua.jM)(e,e=>{let t=e.steps;if(t?.length){let e=t[t.length-1],n=o[t.length]??Yf();t.push({color:n,value:(e?.value??0)+10})}else t&&t.push({value:10})}))},children:(0,eb.jsx)(Yc,{})})}),children:[(0,eb.jsx)(h2,{label:"Mode",description:"Percentage means thresholds relative to min & max",control:(0,eb.jsxs)(Ys.A,{exclusive:!0,disabled:i,value:e?.mode??"absolute",onChange:(n,i)=>{let r="percent"===i?"percent":void 0;void 0!==e?t((0,ua.jM)(e,e=>{e.mode=r})):t({mode:r})},sx:{height:"36px",marginLeft:"auto"},children:[(0,eb.jsx)(Yl.A,{"aria-label":"absolute",value:"absolute",sx:{fontWeight:500},children:"Absolute"}),(0,eb.jsx)(Yl.A,{"aria-label":"percent",value:"percent",sx:{fontWeight:500},children:"Percent"})]})}),s&&s.map((n,i)=>(0,eb.jsx)(Yd,{inputRef:i===s.length-1?l:void 0,label:`T${i+1}`,color:n.color??o[i]??a,value:n.value,mode:e?.mode,onColorChange:n=>{void 0!==e&&t((0,ua.jM)(e,e=>{if(void 0!==e.steps){let t=e.steps[i];t&&(t.color=n)}}))},onChange:n=>{void 0!==e&&t((0,ua.jM)(e,e=>{let t=e.steps?.[i];t&&(t.value=Number(n.target.value))}))},onDelete:()=>{void 0!==e&&t((0,ua.jM)(e,e=>{e.steps&&e.steps.splice(i,1)}))},onBlur:c},i)).reverse(),!n&&(0,eb.jsxs)(Yu,{flex:1,direction:"row",alignItems:"center",spacing:1,children:[(0,eb.jsx)(un,{label:"default",color:a,onColorChange:n=>{void 0!==e?t((0,ua.jM)(e,e=>{e.defaultColor=n})):t({defaultColor:n})}}),(0,eb.jsx)(hi.A,{children:"Default"})]})]})}let Yf=()=>"#"+Math.floor(0x1000000*Math.random()).toString(16).padStart(6,"0");var Yg=n(24300),Ym=n(26684),Yv=n(51327),Yy=n(87169),Yx=n(93724);function Yb({props:e,name:t}){return(0,Yv.A)({props:e,name:t,defaultTheme:Yy.A,themeId:Yx.A})}let Yw=["localeText"],YS=eD.createContext(null),Y_=function(e){let{localeText:t}=e,n=(0,Gq.A)(e,Yw),{utils:i,localeText:r}=eD.useContext(YS)??{utils:void 0,localeText:void 0},{children:o,dateAdapter:a,dateFormats:s,dateLibInstance:l,adapterLocale:u,localeText:c}=Yb({props:n,name:"MuiLocalizationProvider"}),h=eD.useMemo(()=>(0,ou.A)({},c,r,t),[c,r,t]),d=eD.useMemo(()=>{if(!a)return i||null;let e=new a({locale:u,formats:s,instance:l});if(!e.isMUIAdapter)throw Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(`
6
+ `));return e},[a,u,s,l,i]),p=eD.useMemo(()=>d?{minDate:d.date("1900-01-01T00:00:00.000"),maxDate:d.date("2099-12-31T00:00:00.000")}:null,[d]),f=eD.useMemo(()=>({utils:d,defaultDates:p,localeText:h}),[p,d,h]);return(0,eb.jsx)(YS.Provider,{value:f,children:o})};var YM=n(62688),YC=n.n(YM);let YA={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>"year"===e?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(e,t,n,i)=>`Select ${e}. ${!i&&(null===t||!n.isValid(t))?"No time selected":`Selected time is ${i??n.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t,n)=>n||null!==e&&t.isValid(e)?`Choose date, selected date is ${n??t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t,n)=>n||null!==e&&t.isValid(e)?`Choose time, selected time is ${n??t.format(e,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>"letter"===e.contentType?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>"letter"===e.contentType?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"};(0,ou.A)({},YA);let Yk=()=>{let e=eD.useContext(YS);if(null===e)throw Error("MUI X: Can not find the date and time pickers localization context.\nIt looks like you forgot to wrap your component in LocalizationProvider.\nThis can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package");if(null===e.utils)throw Error("MUI X: Can not find the date and time pickers adapter from its localization context.\nIt looks like you forgot to pass a `dateAdapter` to your LocalizationProvider.");let t=eD.useMemo(()=>(0,ou.A)({},YA,e.localeText),[e.localeText]);return eD.useMemo(()=>(0,ou.A)({},e,{localeText:t}),[e,t])},YT=e=>{let t=Yk().utils,n=eD.useRef(void 0);return void 0===n.current&&(n.current=t.date(void 0,e)),n.current},YD=(e,t,n)=>{let i=t;return i=e.setHours(i,e.getHours(n)),i=e.setMinutes(i,e.getMinutes(n)),i=e.setSeconds(i,e.getSeconds(n)),i=e.setMilliseconds(i,e.getMilliseconds(n))},YI=({date:e,disableFuture:t,disablePast:n,maxDate:i,minDate:r,isDateDisabled:o,utils:a,timezone:s})=>{let l=YD(a,a.date(void 0,s),e);n&&a.isBefore(r,l)&&(r=l),t&&a.isAfter(i,l)&&(i=l);let u=e,c=e;for(a.isBefore(e,r)&&(u=r,c=null),a.isAfter(e,i)&&(c&&(c=i),u=null);u||c;){if(u&&a.isAfter(u,i)&&(u=null),c&&a.isBefore(c,r)&&(c=null),u){if(!o(u))return u;u=a.addDays(u,1)}if(c){if(!o(c))return c;c=a.addDays(c,-1)}}return null},YO=(e,t,n)=>null!=t&&e.isValid(t)?t:n,YP=(e,t)=>{let n=[e.startOfYear(t)];for(;n.length<12;){let t=n[n.length-1];n.push(e.addMonths(t,1))}return n},YE=(e,t,n)=>"date"===n?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),YR=(e,t)=>{let n=e.setHours(e.date(),"am"===t?2:14);return e.format(n,"meridiem")},YL=["year","month","day"],YN=e=>YL.includes(e);var YB=n(33868),YF=n(87034),Yz=n(22857);let YV=(0,cD.A)((0,eb.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),Yj=(0,cD.A)((0,eb.jsx)("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),YH=(0,cD.A)((0,eb.jsx)("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight");(0,cD.A)((0,eb.jsx)("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar"),(0,cD.A)((0,eb.jsxs)(eD.Fragment,{children:[(0,eb.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),(0,eb.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");let YW=(0,cD.A)((0,eb.jsx)("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange"),YG=(0,cD.A)((0,eb.jsxs)(eD.Fragment,{children:[(0,eb.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),(0,eb.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),Y$=(0,cD.A)((0,eb.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");function YU(e){return(0,ux.Ay)("MuiDateTimePickerTabs",e)}(0,uy.A)("MuiDateTimePickerTabs",["root"]);let Yq=(0,e7.A)(YF.A,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({boxShadow:`0 -1px 0 0 inset ${(e.vars||e).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(e.vars||e).palette.divider}`,[`& .${Yz.A.indicator}`]:{bottom:"auto",top:0}}})),YY=function(e){let t=Yb({props:e,name:"MuiDateTimePickerTabs"}),{dateIcon:n=(0,eb.jsx)(YW,{}),onViewChange:i,timeIcon:r=(0,eb.jsx)(YG,{}),view:o,hidden:a="u"<typeof window||window.innerHeight<667,className:s,sx:l}=t,u=Yk().localeText,c=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"]},YU,t)})(t);return a?null:(0,eb.jsxs)(Yq,{ownerState:t,variant:"fullWidth",value:YN(o)?"date":"time",onChange:(e,t)=>{i("date"===t?"day":"hours")},className:(0,ul.A)(s,c.root),sx:l,children:[(0,eb.jsx)(YB.A,{value:"date","aria-label":u.dateTableLabel,icon:(0,eb.jsx)(eD.Fragment,{children:n})}),(0,eb.jsx)(YB.A,{value:"time","aria-label":u.timeTableLabel,icon:(0,eb.jsx)(eD.Fragment,{children:r})})]})};function YZ(e){return(0,ux.Ay)("MuiPickersToolbarText",e)}let YX=(0,uy.A)("MuiPickersToolbarText",["root","selected"]),YK=["className","selected","value"],YQ=(0,e7.A)(hi.A,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${YX.selected}`]:t.selected}]})(({theme:e})=>({transition:e.transitions.create("color"),color:(e.vars||e).palette.text.secondary,[`&.${YX.selected}`]:{color:(e.vars||e).palette.text.primary}})),YJ=eD.forwardRef(function(e,t){let n=Yb({props:e,name:"MuiPickersToolbarText"}),{className:i,value:r}=n,o=(0,Gq.A)(n,YK),a=(e=>{let{classes:t,selected:n}=e;return(0,uu.A)({root:["root",n&&"selected"]},YZ,t)})(n);return(0,eb.jsx)(YQ,(0,ou.A)({ref:t,className:(0,ul.A)(a.root,i),component:"span"},o,{children:r}))});function Y0(e){return(0,ux.Ay)("MuiPickersToolbar",e)}let Y1=(0,uy.A)("MuiPickersToolbar",["root","content"]),Y2=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],Y5=(0,e7.A)("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),Y3=(0,e7.A)("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),Y4=eD.forwardRef(function(e,t){let n=Yb({props:e,name:"MuiPickersToolbar"}),{children:i,className:r,toolbarTitle:o,hidden:a,titleId:s}=n,l=(0,Gq.A)(n,Y2),u=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"],content:["content"]},Y0,t)})(n);return a?null:(0,eb.jsxs)(Y5,(0,ou.A)({ref:t,className:(0,ul.A)(u.root,r),ownerState:n},l,{children:[(0,eb.jsx)(hi.A,{color:"text.secondary",variant:"overline",id:s,children:o}),(0,eb.jsx)(Y3,{className:u.content,ownerState:n,children:i})]}))}),Y6=["align","className","selected","typographyClassName","value","variant","width"],Y8=(0,e7.A)(eS.A,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,minWidth:16,textTransform:"none"}),Y9=eD.forwardRef(function(e,t){let n=Yb({props:e,name:"MuiPickersToolbarButton"}),{align:i,className:r,selected:o,typographyClassName:a,value:s,variant:l,width:u}=n,c=(0,Gq.A)(n,Y6),h=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"]},Y0,t)})(n);return(0,eb.jsx)(Y8,(0,ou.A)({variant:"text",ref:t,className:(0,ul.A)(h.root,r)},u?{sx:{width:u}}:{},c,{children:(0,eb.jsx)(YJ,{align:i,className:a,variant:l,value:s,selected:o})}))});function Y7(e){return(0,ux.Ay)("MuiDateTimePickerToolbar",e)}let Ze=(0,uy.A)("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),Zt=["hours","minutes","seconds"],Zn=e=>Zt.includes(e),Zi=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?"am"===t?e-12:e+12:e,Zr=(e,t)=>3600*t.getHours(e)+60*t.getMinutes(e)+t.getSeconds(e),Zo=(e,t)=>(n,i)=>e?t.isAfter(n,i):Zr(n,t)>Zr(i,t);function Za(e,t,n,i){let r=Yk().utils;return{meridiemMode:e?r.getHours(e)>=12?"pm":"am":null,handleMeridiemChange:eD.useCallback(o=>{var a;let s;n(null==e?null:(a=!!t,s=Zi(r.getHours(e),o,a),r.setHours(e,s)),i??"partial")},[t,e,n,i,r])}}let Zs=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],Zl=(0,e7.A)(Y4,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,[`& .${Y1.content} .${YX.selected}`]:{color:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",isLandscape:!0},style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{paddingLeft:24,paddingRight:0}}]})),Zu=(0,e7.A)("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(e,t)=>t.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),Zc=(0,e7.A)("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(e,t)=>t.timeContainer})({display:"flex",flexDirection:"row",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({isLandscape:e,toolbarVariant:t})=>e&&"desktop"!==t,style:{flexDirection:"column"}},{props:({isLandscape:e,toolbarVariant:t,isRtl:n})=>e&&"desktop"!==t&&n,style:{flexDirection:"column-reverse"}}]}),Zh=(0,e7.A)("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",overridesResolver:(e,t)=>t.timeDigitsContainer})({display:"flex",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),Zd=(0,e7.A)(YJ,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),Zp=(0,e7.A)("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${Ze.ampmLabel}`]:t.ampmLabel},{[`&.${Ze.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${Ze.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function Zf(e){let t=Yb({props:e,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:i,value:r,onChange:o,view:a,isLandscape:s,onViewChange:l,toolbarFormat:u,toolbarPlaceholder:c="––",views:h,disabled:d,readOnly:p,toolbarVariant:f="mobile",toolbarTitle:g,className:m}=t,v=(0,Gq.A)(t,Zs),y=(0,cA.I)(),x=(0,ou.A)({},t,{isRtl:y}),b=Yk().utils,{meridiemMode:w,handleMeridiemChange:S}=Za(r,n,o),_=!!(n&&!i),M="desktop"===f,C=Yk().localeText,A=(e=>{let{classes:t,isLandscape:n,isRtl:i}=e;return(0,uu.A)({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",i&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",i&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},Y7,t)})(x),k=g??C.dateTimePickerToolbarTitle,T=eD.useMemo(()=>r?u?b.formatByString(r,u):b.format(r,"shortDate"):c,[r,u,c,b]);return(0,eb.jsxs)(Zl,(0,ou.A)({isLandscape:s,className:(0,ul.A)(A.root,m),toolbarTitle:k},v,{ownerState:x,children:[(0,eb.jsxs)(Zu,{className:A.dateContainer,ownerState:x,children:[h.includes("year")&&(0,eb.jsx)(Y9,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:"year"===a,value:r?b.format(r,"year"):"–"}),h.includes("day")&&(0,eb.jsx)(Y9,{tabIndex:-1,variant:M?"h5":"h4",onClick:()=>l("day"),selected:"day"===a,value:T})]}),(0,eb.jsxs)(Zc,{className:A.timeContainer,ownerState:x,children:[(0,eb.jsxs)(Zh,{className:A.timeDigitsContainer,ownerState:x,children:[h.includes("hours")&&(0,eb.jsxs)(eD.Fragment,{children:[(0,eb.jsx)(Y9,{variant:M?"h5":"h3",width:M&&!s?48:void 0,onClick:()=>l("hours"),selected:"hours"===a,value:r?n?b.format(r,"hours12h"):b.format(r,"hours24h"):"--"}),(0,eb.jsx)(Zd,{variant:M?"h5":"h3",value:":",className:A.separator,ownerState:x}),(0,eb.jsx)(Y9,{variant:M?"h5":"h3",width:M&&!s?48:void 0,onClick:()=>l("minutes"),selected:"minutes"===a||!h.includes("minutes")&&"hours"===a,value:r?b.format(r,"minutes"):"--",disabled:!h.includes("minutes")})]}),h.includes("seconds")&&(0,eb.jsxs)(eD.Fragment,{children:[(0,eb.jsx)(Zd,{variant:M?"h5":"h3",value:":",className:A.separator,ownerState:x}),(0,eb.jsx)(Y9,{variant:M?"h5":"h3",width:M&&!s?48:void 0,onClick:()=>l("seconds"),selected:"seconds"===a,value:r?b.format(r,"seconds"):"--"})]})]}),_&&!M&&(0,eb.jsxs)(Zp,{className:A.ampmSelection,ownerState:x,children:[(0,eb.jsx)(Y9,{variant:"subtitle2",selected:"am"===w,typographyClassName:A.ampmLabel,value:YR(b,"am"),onClick:p?void 0:()=>S("am"),disabled:d}),(0,eb.jsx)(Y9,{variant:"subtitle2",selected:"pm"===w,typographyClassName:A.ampmLabel,value:YR(b,"pm"),onClick:p?void 0:()=>S("pm"),disabled:d})]}),n&&M&&(0,eb.jsx)(Y9,{variant:"h5",onClick:()=>l("meridiem"),selected:"meridiem"===a,value:r&&w?YR(b,w):"--",width:48})]})]}))}var Zg=n(54553),Zm=n(77893);function Zv(e){return(0,ux.Ay)("MuiPickersArrowSwitcher",e)}(0,uy.A)("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);let Zy=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],Zx=["ownerState"],Zb=["ownerState"],Zw=(0,e7.A)("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),ZS=(0,e7.A)("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),Z_=(0,e7.A)(eC.A,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),ZM=eD.forwardRef(function(e,t){let n=(0,cA.I)(),i=Yb({props:e,name:"MuiPickersArrowSwitcher"}),{children:r,className:o,slots:a,slotProps:s,isNextDisabled:l,isNextHidden:u,onGoToNext:c,nextLabel:h,isPreviousDisabled:d,isPreviousHidden:p,onGoToPrevious:f,previousLabel:g,labelId:m}=i,v=(0,Gq.A)(i,Zy),y=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},Zv,t)})(i),x=a?.previousIconButton??Z_,b=(0,Zm.A)({elementType:x,externalSlotProps:s?.previousIconButton,additionalProps:{size:"medium",title:g,"aria-label":g,disabled:d,edge:"end",onClick:f},ownerState:(0,ou.A)({},i,{hidden:p}),className:(0,ul.A)(y.button,y.previousIconButton)}),w=a?.nextIconButton??Z_,S=(0,Zm.A)({elementType:w,externalSlotProps:s?.nextIconButton,additionalProps:{size:"medium",title:h,"aria-label":h,disabled:l,edge:"start",onClick:c},ownerState:(0,ou.A)({},i,{hidden:u}),className:(0,ul.A)(y.button,y.nextIconButton)}),_=a?.leftArrowIcon??Yj,M=(0,Zm.A)({elementType:_,externalSlotProps:s?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:i,className:y.leftArrowIcon}),C=(0,Gq.A)(M,Zx),A=a?.rightArrowIcon??YH,k=(0,Zm.A)({elementType:A,externalSlotProps:s?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:i,className:y.rightArrowIcon}),T=(0,Gq.A)(k,Zb);return(0,eb.jsxs)(Zw,(0,ou.A)({ref:t,className:(0,ul.A)(y.root,o),ownerState:i},v,{children:[(0,eb.jsx)(x,(0,ou.A)({},b,{children:n?(0,eb.jsx)(A,(0,ou.A)({},T)):(0,eb.jsx)(_,(0,ou.A)({},C))})),r?(0,eb.jsx)(hi.A,{variant:"subtitle1",component:"span",id:m,children:r}):(0,eb.jsx)(ZS,{className:y.spacer,ownerState:i}),(0,eb.jsx)(w,(0,ou.A)({},S,{children:n?(0,eb.jsx)(_,(0,ou.A)({},C)):(0,eb.jsx)(A,(0,ou.A)({},T))}))]}))});var ZC=n(83183),ZA=n(89369);function Zk({onChange:e,onViewChange:t,openTo:n,view:i,views:r,autoFocus:o,focusedView:a,onFocusedViewChange:s}){let l=eD.useRef(n),u=eD.useRef(r),c=eD.useRef(r.includes(n)?n:r[0]),[h,d]=(0,ZA.A)({name:"useViews",state:"view",controlled:i,default:c.current}),p=eD.useRef(o?h:null),[f,g]=(0,ZA.A)({name:"useViews",state:"focusedView",controlled:a,default:p.current});eD.useEffect(()=>{(l.current&&l.current!==n||u.current&&u.current.some(e=>!r.includes(e)))&&(d(r.includes(n)?n:r[0]),u.current=r,l.current=n)},[n,d,h,r]);let m=r.indexOf(h),v=r[m-1]??null,y=r[m+1]??null,x=(0,ZC.A)((e,t)=>{t?g(e):g(t=>e===t?null:t),s?.(e,t)}),b=(0,ZC.A)(e=>{x(e,!0),e!==h&&(d(e),t&&t(e))}),w=(0,ZC.A)(()=>{y&&b(y)}),S=(0,ZC.A)((t,n,i)=>{let o="finish"===n,a=i?r.indexOf(i)<r.length-1:!!y;if(e(t,o&&a?"partial":n,i),i&&i!==h){let e=r[r.indexOf(i)+1];e&&b(e)}else o&&w()});return{view:h,setView:b,focusedView:f,setFocusedView:x,nextView:y,previousView:v,defaultView:r.includes(n)?n:r[0],goToNextView:w,setValueAndGoToNextView:S}}let ZT=(0,e7.A)("div")({overflow:"hidden",width:320,maxHeight:336,display:"flex",flexDirection:"column",margin:"0 auto"});function ZD(e){return(0,ux.Ay)("MuiTimeClock",e)}(0,uy.A)("MuiTimeClock",["root","arrowSwitcher"]);var ZI=n(31789);function ZO(e){return(0,ux.Ay)("MuiClockPointer",e)}(0,uy.A)("MuiClockPointer",["root","thumb"]);let ZP=["className","hasSelected","isInner","type","viewValue"],ZE=(0,e7.A)("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({width:2,backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:e.transitions.create(["transform","height"])}}]})),ZR=(0,e7.A)("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(({theme:e})=>({width:4,height:4,backgroundColor:(e.vars||e).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:"calc(50% - 18px)",border:`16px solid ${(e.vars||e).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(e.vars||e).palette.primary.main}}]}));function ZL(e){let t,n=Yb({props:e,name:"MuiClockPointer"}),{className:i,isInner:r,type:o,viewValue:a}=n,s=(0,Gq.A)(n,ZP),l=eD.useRef(o);eD.useEffect(()=>{l.current=o},[o]);let u=(0,ou.A)({},n,{shouldAnimate:l.current!==o}),c=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"],thumb:["thumb"]},ZO,t)})(u);return(0,eb.jsx)(ZE,(0,ou.A)({style:(t=360/("hours"===o?12:60)*a,"hours"===o&&a>12&&(t-=360),{height:Math.round((r?.26:.4)*220),transform:`rotateZ(${t}deg)`}),className:(0,ul.A)(c.root,i),ownerState:u},s,{children:(0,eb.jsx)(ZR,{ownerState:u,className:c.thumb})}))}let ZN=110,ZB=110,ZF=ZN,Zz=0,ZV=ZF-ZN,Zj=Zz-ZB,ZH=(e,t,n)=>{let i=t-ZN,r=n-ZB,o=180/Math.PI*(Math.atan2(ZV,Zj)-Math.atan2(i,r));return{value:Math.floor((o=Math.round(o/e)*e%360)/e)||0,distance:Math.sqrt(i**2+r**2)}};function ZW(e){return(0,ux.Ay)("MuiClock",e)}(0,uy.A)("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);let ZG=(0,e7.A)("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)})),Z$=(0,e7.A)("div",{name:"MuiClock",slot:"Clock",overridesResolver:(e,t)=>t.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),ZU=(0,e7.A)("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),Zq=(0,e7.A)("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(e,t)=>t.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),ZY=(0,e7.A)("div",{name:"MuiClock",slot:"Pin",overridesResolver:(e,t)=>t.pin})(({theme:e})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),ZZ=(e,t)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:36,variants:[{props:{meridiemMode:t},style:{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:hover":{backgroundColor:(e.vars||e).palette.primary.light}}}]}),ZX=(0,e7.A)(eC.A,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})(({theme:e})=>(0,ou.A)({},ZZ(e,"am"),{position:"absolute",left:8})),ZK=(0,e7.A)(eC.A,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})(({theme:e})=>(0,ou.A)({},ZZ(e,"pm"),{position:"absolute",right:8})),ZQ=(0,e7.A)(hi.A,{name:"MuiClock",slot:"meridiemText",overridesResolver:(e,t)=>t.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function ZJ(e){let t=Yb({props:e,name:"MuiClock"}),{ampm:n,ampmInClock:i,autoFocus:r,children:o,value:a,handleMeridiemChange:s,isTimeDisabled:l,meridiemMode:u,minutesStep:c=1,onChange:h,selectedId:d,type:p,viewValue:f,viewRange:[g,m],disabled:v=!1,readOnly:y,className:x}=t,b=Yk().utils,w=Yk().localeText,S=eD.useRef(!1),_=(e=>{let{classes:t,meridiemMode:n}=e;return(0,uu.A)({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton","am"===n&&"selected"],pmButton:["pmButton","pm"===n&&"selected"],meridiemText:["meridiemText"]},ZW,t)})(t),M=l(f,p),C=!n&&"hours"===p&&(f<1||f>12),A=(e,t)=>{v||y||l(e,p)||h(e,t)},k=(e,t)=>{let{offsetX:i,offsetY:r}=e;if(void 0===i){let t=e.target.getBoundingClientRect();i=e.changedTouches[0].clientX-t.left,r=e.changedTouches[0].clientY-t.top}A("seconds"===p||"minutes"===p?((e,t,n=1)=>{let{value:i}=ZH(6*n,e,t);return i*n%60})(i,r,c):((e,t,n)=>{let{value:i,distance:r}=ZH(30,e,t),o=i||12;return n?o%=12:r<74&&(o+=12,o%=24),o})(i,r,!!n),t)},T=e=>{S.current=!0,k(e,"shallow")},D=eD.useMemo(()=>"hours"===p||f%5==0,[p,f]),I="minutes"===p?c:1,O=eD.useRef(null);(0,ZI.A)(()=>{r&&O.current.focus()},[r]);let P=e=>Math.max(g,Math.min(m,e)),E=e=>(e+(m+1))%(m+1);return(0,eb.jsxs)(ZG,{className:(0,ul.A)(_.root,x),children:[(0,eb.jsxs)(Z$,{className:_.clock,children:[(0,eb.jsx)(Zq,{onTouchMove:T,onTouchStart:T,onTouchEnd:e=>{S.current&&(k(e,"finish"),S.current=!1),e.preventDefault()},onMouseUp:e=>{S.current&&(S.current=!1),k(e.nativeEvent,"finish")},onMouseMove:e=>{e.buttons>0&&k(e.nativeEvent,"shallow")},ownerState:{disabled:v},className:_.squareMask}),!M&&(0,eb.jsxs)(eD.Fragment,{children:[(0,eb.jsx)(ZY,{className:_.pin}),null!=a&&(0,eb.jsx)(ZL,{type:p,viewValue:f,isInner:C,hasSelected:D})]}),(0,eb.jsx)(ZU,{"aria-activedescendant":d,"aria-label":w.clockLabelText(p,a,b,null==a?null:b.format(a,"fullTime")),ref:O,role:"listbox",onKeyDown:e=>{if(!S.current)switch(e.key){case"Home":A(g,"partial"),e.preventDefault();break;case"End":A(m,"partial"),e.preventDefault();break;case"ArrowUp":A(E(f+I),"partial"),e.preventDefault();break;case"ArrowDown":A(E(f-I),"partial"),e.preventDefault();break;case"PageUp":A(P(f+5),"partial"),e.preventDefault();break;case"PageDown":A(P(f-5),"partial"),e.preventDefault();break;case"Enter":case" ":A(f,"finish"),e.preventDefault()}},tabIndex:0,className:_.wrapper,children:o})]}),n&&i&&(0,eb.jsxs)(eD.Fragment,{children:[(0,eb.jsx)(ZX,{onClick:y?void 0:()=>s("am"),disabled:v||null===u,ownerState:t,className:_.amButton,title:YR(b,"am"),children:(0,eb.jsx)(ZQ,{variant:"caption",className:_.meridiemText,children:YR(b,"am")})}),(0,eb.jsx)(ZK,{disabled:v||null===u,onClick:y?void 0:()=>s("pm"),ownerState:t,className:_.pmButton,title:YR(b,"pm"),children:(0,eb.jsx)(ZQ,{variant:"caption",className:_.meridiemText,children:YR(b,"pm")})})]})]})}function Z0(e){return(0,ux.Ay)("MuiClockNumber",e)}let Z1=(0,uy.A)("MuiClockNumber",["root","selected","disabled"]),Z2=["className","disabled","index","inner","label","selected"],Z5=(0,e7.A)("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${Z1.disabled}`]:t.disabled},{[`&.${Z1.selected}`]:t.selected}]})(({theme:e})=>({height:36,width:36,position:"absolute",left:"calc((100% - 36px) / 2)",display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(e.vars||e).palette.text.primary,fontFamily:e.typography.fontFamily,"&:focused":{backgroundColor:(e.vars||e).palette.background.paper},[`&.${Z1.selected}`]:{color:(e.vars||e).palette.primary.contrastText},[`&.${Z1.disabled}`]:{pointerEvents:"none",color:(e.vars||e).palette.text.disabled},variants:[{props:{inner:!0},style:(0,ou.A)({},e.typography.body2,{color:(e.vars||e).palette.text.secondary})}]}));function Z3(e){let t=Yb({props:e,name:"MuiClockNumber"}),{className:n,disabled:i,index:r,inner:o,label:a,selected:s}=t,l=(0,Gq.A)(t,Z2),u=(e=>{let{classes:t,selected:n,disabled:i}=e;return(0,uu.A)({root:["root",n&&"selected",i&&"disabled"]},Z0,t)})(t),c=r%12/12*Math.PI*2-Math.PI/2,h=91*(o?.65:1),d=Math.round(Math.cos(c)*h),p=Math.round(Math.sin(c)*h);return(0,eb.jsx)(Z5,(0,ou.A)({className:(0,ul.A)(u.root,n),"aria-disabled":!!i||void 0,"aria-selected":!!s||void 0,role:"option",style:{transform:`translate(${d}px, ${p+92}px`},ownerState:t},l,{children:a}))}let Z4=({utils:e,value:t,isDisabled:n,getClockNumberText:i,selectedId:r})=>{let o=e.formatNumber;return[[5,o("05")],[10,o("10")],[15,o("15")],[20,o("20")],[25,o("25")],[30,o("30")],[35,o("35")],[40,o("40")],[45,o("45")],[50,o("50")],[55,o("55")],[0,o("00")]].map(([e,o],a)=>{let s=e===t;return(0,eb.jsx)(Z3,{label:o,id:s?r:void 0,index:a+1,inner:!1,disabled:n(e),selected:s,"aria-label":i(o)},e)})},Z6=({timezone:e,value:t,defaultValue:n,referenceDate:i,onChange:r,valueManager:o})=>{let a,s=Yk().utils,l=eD.useRef(n),u=t??l.current??o.emptyValue,c=eD.useMemo(()=>o.getTimezone(s,u),[s,o,u]),h=(0,ZC.A)(e=>null==c?e:o.setTimezone(s,c,e));return a=e||c||(i?s.getTimezone(i):"default"),{value:eD.useMemo(()=>o.setTimezone(s,a,u),[o,s,a,u]),handleValueChange:(0,ZC.A)((e,...t)=>{let n=h(e);r?.(n,...t)}),timezone:a}},Z8=({name:e,timezone:t,value:n,defaultValue:i,referenceDate:r,onChange:o,valueManager:a})=>{let[s,l]=(0,ZA.A)({name:e,state:"value",controlled:n,default:i??a.emptyValue});return Z6({timezone:t,value:s,defaultValue:void 0,referenceDate:r,onChange:(0,ZC.A)((e,...t)=>{l(e),o?.(e,...t)}),valueManager:a})},Z9={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},Z7=(e,t,n)=>{if(t===Z9.year)return e.startOfYear(n);if(t===Z9.month)return e.startOfMonth(n);if(t===Z9.day)return e.startOfDay(n);let i=n;return t<Z9.minutes&&(i=e.setMinutes(i,0)),t<Z9.seconds&&(i=e.setSeconds(i,0)),t<Z9.milliseconds&&(i=e.setMilliseconds(i,0)),i},Xe=(e,t)=>{let n=e.formatTokenMap[t];if(null==n)throw Error(`MUI X: The token "${t}" is not supported by the Date and Time Pickers.
7
+ Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported.`);return"string"==typeof n?{type:n,contentType:"meridiem"===n?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},Xt=(e,t)=>{let n=[],i=e.date(void 0,"default"),r=e.startOfWeek(i),o=e.endOfWeek(i),a=r;for(;e.isBefore(a,o);)n.push(a),a=e.addDays(a,1);return n.map(n=>e.formatByString(n,t))},Xn=(e,t,n,i)=>{switch(n){case"month":return YP(e,e.date(void 0,t)).map(t=>e.formatByString(t,i));case"weekDay":return Xt(e,i);case"meridiem":{let n=e.date(void 0,t);return[e.startOfDay(n),e.endOfDay(n)].map(t=>e.formatByString(t,i))}default:return[]}},Xi=["0","1","2","3","4","5","6","7","8","9"],Xr=(e,t)=>{if("0"===t[0])return e;let n=[],i="";for(let r=0;r<e.length;r+=1){i+=e[r];let o=t.indexOf(i);o>-1&&(n.push(o.toString()),i="")}return n.join("")},Xo=(e,t)=>"0"===t[0]?e:e.split("").map(e=>t[Number(e)]).join(""),Xa=(e,t)=>{let n=Xr(e,t);return" "!==n&&!Number.isNaN(Number(n))},Xs=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},Xl=(e,t,n,i,r)=>{if("day"===r.type&&"digit-with-letter"===r.contentType){let i=e.setDate(n.longestMonth,t);return e.formatByString(i,r.format)}let o=t.toString();return r.hasLeadingZerosInInput&&(o=Xs(o,r.maxLength)),Xo(o,i)},Xu=(e,t,n)=>{let i=e.value||e.placeholder,r="non-input"===t?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return"non-input"===t&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(i=Number(Xr(i,n)).toString()),["input-rtl","input-ltr"].includes(t)&&"digit"===e.contentType&&!r&&1===i.length&&(i=`${i}\u200e`),"input-rtl"===t&&(i=`\u2068${i}\u2069`),i},Xc=(e,t,n,i)=>e.formatByString(e.parse(t,n),i),Xh=(e,t,n,i)=>{if("digit"!==t)return!1;let r=e.date(void 0,"default");switch(n){case"year":if("dayjs"===e.lib&&"YY"===i)return!0;return e.formatByString(e.setYear(r,1),i).startsWith("0");case"month":return e.formatByString(e.startOfYear(r),i).length>1;case"day":return e.formatByString(e.startOfMonth(r),i).length>1;case"weekDay":return e.formatByString(e.startOfWeek(r),i).length>1;case"hours":return e.formatByString(e.setHours(r,1),i).length>1;case"minutes":return e.formatByString(e.setMinutes(r,1),i).length>1;case"seconds":return e.formatByString(e.setSeconds(r,1),i).length>1;default:throw Error("Invalid section type")}},Xd=(e,t)=>{},Xp={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},Xf=(e,t,n,i,r)=>[...n].sort((e,t)=>Xp[e.type]-Xp[t.type]).reduce((n,i)=>!r||i.modified?((e,t,n,i)=>{switch(t.type){case"year":return e.setYear(i,e.getYear(n));case"month":return e.setMonth(i,e.getMonth(n));case"weekDay":{let i=Xt(e,t.format),r=e.formatByString(n,t.format),o=i.indexOf(r),a=i.indexOf(t.value);return e.addDays(n,a-o)}case"day":return e.setDate(i,e.getDate(n));case"meridiem":{let t=12>e.getHours(n),r=e.getHours(i);if(t&&r>=12)return e.addHours(i,-12);if(!t&&r<12)return e.addHours(i,12);return i}case"hours":return e.setHours(i,e.getHours(n));case"minutes":return e.setMinutes(i,e.getMinutes(n));case"seconds":return e.setSeconds(i,e.getSeconds(n));default:return i}})(e,i,t,n):n,i),Xg=(e,t)=>{if(null==e)return null;if("all"===e)return"all";if("string"==typeof e){let n=t.findIndex(t=>t.type===e);return -1===n?null:n}return e},Xm=["value","referenceDate"],Xv={emptyValue:null,getTodayValue:YE,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,i=(0,Gq.A)(e,Xm);return null!=t&&i.utils.isValid(t)?t:null!=n?n:(({props:e,utils:t,granularity:n,timezone:i,getTodayDate:r})=>{let o=r?r():Z7(t,n,YE(t,i));null!=e.minDate&&t.isAfterDay(e.minDate,o)&&(o=Z7(t,n,e.minDate)),null!=e.maxDate&&t.isBeforeDay(e.maxDate,o)&&(o=Z7(t,n,e.maxDate));let a=Zo(e.disableIgnoringDatePartForTimeValidation??!1,t);return null!=e.minTime&&a(e.minTime,o)&&(o=Z7(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:YD(t,o,e.minTime))),null!=e.maxTime&&a(o,e.maxTime)&&(o=Z7(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:YD(t,o,e.maxTime))),o})(i)},cleanValue:(e,t)=>null!=t&&e.isValid(t)?t:null,areValuesEqual:(e,t,n)=>!(e.isValid(t)||null==t||e.isValid(n))&&null!=n||e.isEqual(t,n),isSameError:(e,t)=>e===t,hasError:e=>null!=e,defaultErrorState:null,getTimezone:(e,t)=>null!=t&&e.isValid(t)?e.getTimezone(t):null,setTimezone:(e,t,n)=>null==n?null:e.setTimezone(n,t)},Xy={updateReferenceValue:(e,t,n)=>null!=t&&e.isValid(t)?t:n,getSectionsFromValue:(e,t,n,i)=>!e.isValid(t)&&n?n:i(t),getV7HiddenInputValueFromSections:e=>e.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),getV6InputValueFromSections:(e,t,n)=>{let i=e.map(e=>{let i=Xu(e,n?"input-rtl":"input-ltr",t);return`${e.startSeparator}${i}${e.endSeparator}`}).join("");return n?`\u2066${i}\u2069`:i},getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:e=>e,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:null!=n&&e.isValid(n)?n:t.referenceValue})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},Xx=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],Xb=(0,e7.A)(ZT,{name:"MuiTimeClock",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",position:"relative"}),Xw=(0,e7.A)(ZM,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),XS=["hours","minutes"],X_=eD.forwardRef(function(e,t){let n=Yk().utils,i=Yb({props:e,name:"MuiTimeClock"}),{ampm:r=n.is12HourCycleInCurrentLocale(),ampmInClock:o=!1,autoFocus:a,slots:s,slotProps:l,value:u,defaultValue:c,referenceDate:h,disableIgnoringDatePartForTimeValidation:d=!1,maxTime:p,minTime:f,disableFuture:g,disablePast:m,minutesStep:v=1,shouldDisableTime:y,showViewSwitcher:x,onChange:b,view:w,views:S=XS,openTo:_,onViewChange:M,focusedView:C,onFocusedViewChange:A,className:k,disabled:T,readOnly:D,timezone:I}=i,O=(0,Gq.A)(i,Xx),{value:P,handleValueChange:E,timezone:R}=Z8({name:"TimeClock",timezone:I,value:u,defaultValue:c,referenceDate:h,onChange:b,valueManager:Xv}),L=(({value:e,referenceDate:t,utils:n,props:i,timezone:r})=>{let o=eD.useMemo(()=>Xv.getInitialReferenceValue({value:e,utils:n,props:i,referenceDate:t,granularity:Z9.day,timezone:r,getTodayDate:()=>YE(n,r,"date")}),[]);return e??o})({value:P,referenceDate:h,utils:n,props:i,timezone:R}),N=Yk().localeText,B=YT(R),{view:F,setView:z,previousView:V,nextView:j,setValueAndGoToNextView:H}=Zk({view:w,views:S,openTo:_,onViewChange:M,onChange:E,focusedView:C,onFocusedViewChange:A}),{meridiemMode:W,handleMeridiemChange:G}=Za(L,r,H),$=eD.useCallback((e,t)=>{let i=Zo(d,n),o="hours"===t||"minutes"===t&&S.includes("seconds"),a=({start:e,end:t})=>!(f&&i(f,t)||p&&i(e,p)||g&&i(e,B)||m&&i(B,o?t:e)),s=(e,i=1)=>{if(e%i!=0)return!1;if(y)switch(t){case"hours":return!y(n.setHours(L,e),"hours");case"minutes":return!y(n.setMinutes(L,e),"minutes");case"seconds":return!y(n.setSeconds(L,e),"seconds");default:return!1}return!0};switch(t){case"hours":{let t=Zi(e,W,r),i=n.setHours(L,t);if(n.getHours(i)!==t)return!0;return!a({start:n.setSeconds(n.setMinutes(i,0),0),end:n.setSeconds(n.setMinutes(i,59),59)})||!s(t)}case"minutes":{let t=n.setMinutes(L,e);return!a({start:n.setSeconds(t,0),end:n.setSeconds(t,59)})||!s(e,v)}case"seconds":{let t=n.setSeconds(L,e);return!a({start:t,end:t})||!s(e)}default:throw Error("not supported")}},[r,L,d,p,W,f,v,y,n,g,m,B,S]),U=(0,Zg.A)(),q=eD.useMemo(()=>{switch(F){case"hours":{let e,t=(e,t)=>{let i=Zi(e,W,r);H(n.setHours(L,i),t,"hours")},i=n.getHours(L);return e=r?i>12?[12,23]:[0,11]:[0,23],{onChange:t,viewValue:i,children:(({ampm:e,value:t,getClockNumberText:n,isDisabled:i,selectedId:r,utils:o})=>{let a=t?o.getHours(t):null,s=[],l=+!!e,u=e?12:23,c=t=>null!==a&&(e?12===t?12===a||0===a:a===t||a-12===t:a===t);for(let t=l;t<=u;t+=1){let a=t.toString();0===t&&(a="00");let l=!e&&(0===t||t>12);a=o.formatNumber(a);let u=c(t);s.push((0,eb.jsx)(Z3,{id:u?r:void 0,index:t,inner:l,selected:u,disabled:i(t),label:a,"aria-label":n(a)},t))}return s})({value:P,utils:n,ampm:r,onChange:t,getClockNumberText:N.hoursClockNumberText,isDisabled:e=>T||$(e,"hours"),selectedId:U}),viewRange:e}}case"minutes":{let e=n.getMinutes(L),t=(e,t)=>{H(n.setMinutes(L,e),t,"minutes")};return{viewValue:e,onChange:t,children:Z4({utils:n,value:e,onChange:t,getClockNumberText:N.minutesClockNumberText,isDisabled:e=>T||$(e,"minutes"),selectedId:U}),viewRange:[0,59]}}case"seconds":{let e=n.getSeconds(L),t=(e,t)=>{H(n.setSeconds(L,e),t,"seconds")};return{viewValue:e,onChange:t,children:Z4({utils:n,value:e,onChange:t,getClockNumberText:N.secondsClockNumberText,isDisabled:e=>T||$(e,"seconds"),selectedId:U}),viewRange:[0,59]}}default:throw Error("You must provide the type for ClockView")}},[F,n,P,r,N.hoursClockNumberText,N.minutesClockNumberText,N.secondsClockNumberText,W,H,L,$,U,T]),Y=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"],arrowSwitcher:["arrowSwitcher"]},ZD,t)})(i);return(0,eb.jsxs)(Xb,(0,ou.A)({ref:t,className:(0,ul.A)(Y.root,k),ownerState:i},O,{children:[(0,eb.jsx)(ZJ,(0,ou.A)({autoFocus:a??!!C,ampmInClock:o&&S.includes("hours"),value:P,type:F,ampm:r,minutesStep:v,isTimeDisabled:$,meridiemMode:W,handleMeridiemChange:G,selectedId:U,disabled:T,readOnly:D},q)),x&&(0,eb.jsx)(Xw,{className:Y.arrowSwitcher,slots:s,slotProps:l,onGoToPrevious:()=>z(V),isPreviousDisabled:!V,previousLabel:N.openPreviousView,onGoToNext:()=>z(j),isNextDisabled:!j,nextLabel:N.openNextView,ownerState:i})]}))}),XM=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:i,views:r,value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:h,disablePast:d,minTime:p,maxTime:f,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:S,sx:_,autoFocus:M,showViewSwitcher:C,disableIgnoringDatePartForTimeValidation:A,timezone:k})=>(0,eb.jsx)(X_,{view:e,onViewChange:t,focusedView:n&&Zn(n)?n:null,onFocusedViewChange:i,views:r.filter(Zn),value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:h,disablePast:d,minTime:p,maxTime:f,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:S,sx:_,autoFocus:M,showViewSwitcher:C,disableIgnoringDatePartForTimeValidation:A,timezone:k}),XC=({props:e,value:t,timezone:n,adapter:i})=>{if(null===t)return null;let{shouldDisableDate:r,shouldDisableMonth:o,shouldDisableYear:a,disablePast:s,disableFuture:l}=e,u=i.utils.date(void 0,n),c=YO(i.utils,e.minDate,i.defaultDates.minDate),h=YO(i.utils,e.maxDate,i.defaultDates.maxDate);switch(!0){case!i.utils.isValid(t):return"invalidDate";case!!(r&&r(t)):return"shouldDisableDate";case!!(o&&o(t)):return"shouldDisableMonth";case!!(a&&a(t)):return"shouldDisableYear";case!!(l&&i.utils.isAfterDay(t,u)):return"disableFuture";case!!(s&&i.utils.isBeforeDay(t,u)):return"disablePast";case!!(c&&i.utils.isBeforeDay(t,c)):return"minDate";case!!(h&&i.utils.isAfterDay(t,h)):return"maxDate";default:return null}};XC.valueManager=Xv;let XA=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:i,maxDate:r,disableFuture:o,disablePast:a,timezone:s})=>{let l=Yk();return eD.useCallback(u=>null!==XC({adapter:l,value:u,timezone:s,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:i,maxDate:r,disableFuture:o,disablePast:a}}),[l,e,t,n,i,r,o,a,s])};var Xk=n(44394),XT=n(96313);let XD=e=>(0,ux.Ay)("MuiPickersFadeTransitionGroup",e);(0,uy.A)("MuiPickersFadeTransitionGroup",["root"]);let XI=(0,e7.A)(Xk.A,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function XO(e){let t=Yb({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:i,reduceAnimations:r,transKey:o}=t,a=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"]},XD,t)})(t),s=(0,ur.A)();return r?n:(0,eb.jsx)(XI,{className:(0,ul.A)(a.root,i),children:(0,eb.jsx)(XT.A,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:s.transitions.duration.enteringScreen,enter:s.transitions.duration.enteringScreen,exit:0},children:n},o)})}var XP=n(95591);function XE(e){return(0,ux.Ay)("MuiPickersDay",e)}let XR=(0,uy.A)("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),XL=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],XN=({theme:e})=>(0,ou.A)({},e.typography.caption,{width:36,height:36,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,uc.X4)(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:(0,uc.X4)(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${XR.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${XR.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${XR.disabled}:not(.${XR.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${XR.disabled}&.${XR.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:"0 2px"}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${XR.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),XB=(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},XF=(0,e7.A)(uf.A,{name:"MuiPickersDay",slot:"Root",overridesResolver:XB})(XN),Xz=(0,e7.A)("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:XB})(({theme:e})=>(0,ou.A)({},XN({theme:e}),{opacity:0,pointerEvents:"none"})),XV=()=>{},Xj=eD.forwardRef(function(e,t){let n=Yb({props:e,name:"MuiPickersDay"}),{autoFocus:i=!1,className:r,day:o,disabled:a=!1,disableHighlightToday:s=!1,disableMargin:l=!1,isAnimating:u,onClick:c,onDaySelect:h,onFocus:d=XV,onBlur:p=XV,onKeyDown:f=XV,onMouseDown:g=XV,onMouseEnter:m=XV,outsideCurrentMonth:v,selected:y=!1,showDaysOutsideCurrentMonth:x=!1,children:b,today:w=!1}=n,S=(0,Gq.A)(n,XL),_=(0,ou.A)({},n,{autoFocus:i,disabled:a,disableHighlightToday:s,disableMargin:l,selected:y,showDaysOutsideCurrentMonth:x,today:w}),M=(e=>{let{selected:t,disableMargin:n,disableHighlightToday:i,today:r,disabled:o,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:s,classes:l}=e,u=a&&!s;return(0,uu.A)({root:["root",t&&!u&&"selected",o&&"disabled",!n&&"dayWithMargin",!i&&r&&"today",a&&s&&"dayOutsideMonth",u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},XE,l)})(_),C=Yk().utils,A=eD.useRef(null),k=(0,XP.A)(A,t);return((0,ZI.A)(()=>{!i||a||u||v||A.current.focus()},[i,a,u,v]),v&&!x)?(0,eb.jsx)(Xz,{className:(0,ul.A)(M.root,M.hiddenDaySpacingFiller,r),ownerState:_,role:S.role}):(0,eb.jsx)(XF,(0,ou.A)({className:(0,ul.A)(M.root,r),ref:k,centerRipple:!0,disabled:a,tabIndex:y?0:-1,onKeyDown:e=>f(e,o),onFocus:e=>d(e,o),onBlur:e=>p(e,o),onMouseEnter:e=>m(e,o),onClick:e=>{a||h(o),v&&e.currentTarget.focus(),c&&c(e)},onMouseDown:e=>{g(e),v&&e.preventDefault()}},S,{ownerState:_,children:b||C.format(o,"dayOfMonth")}))}),XH=eD.memo(Xj);var XW=n(7490);function XG(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var X$=n(64863),XU=function(e,t){return e&&t&&t.split(" ").forEach(function(t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=XG(e.className,t):e.setAttribute("class",XG(e.className&&e.className.baseVal||"",t))})},Xq=function(e){function t(){for(var t,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1];t.removeClasses(r,"exit"),t.addClass(r,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1];t.addClass(r,o?"appear":"enter","active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1]?"appear":"enter";t.removeClasses(r,o),t.addClass(r,o,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,i="string"==typeof n,r=i&&n?n+"-":"",o=i?""+r+e:n[e],a=i?o+"-active":n[e+"Active"],s=i?o+"-done":n[e+"Done"];return{baseClassName:o,activeClassName:a,doneClassName:s}},t}(0,XW.A)(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var i,r=this.getClassNames(t)[n+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&o&&(r+=" "+o),"active"===n&&e&&(0,X$.F)(e),r&&(this.appliedClasses[t][n]=r,i=r,e&&i&&i.split(" ").forEach(function(t){e.classList?e.classList.add(t):(e.classList?t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" "))||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],i=n.base,r=n.active,o=n.done;this.appliedClasses[t]={},i&&XU(e,i),r&&XU(e,r),o&&XU(e,o)},n.render=function(){var e=this.props,t=(e.classNames,(0,Gq.A)(e,["classNames"]));return eI().createElement(d7.Ay,(0,ou.A)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(eI().Component);Xq.defaultProps={classNames:""},Xq.propTypes={};let XY=e=>(0,ux.Ay)("MuiPickersSlideTransition",e),XZ=(0,uy.A)("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),XX=["children","className","reduceAnimations","slideDirection","transKey","classes"],XK=(0,e7.A)(Xk.A,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${XZ["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${XZ["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${XZ.slideEnterActive}`]:t.slideEnterActive},{[`.${XZ.slideExit}`]:t.slideExit},{[`.${XZ["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${XZ["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{let t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${XZ["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${XZ["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${XZ.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${XZ.slideExit}`]:{transform:"translate(0%)"},[`& .${XZ["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${XZ["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}}),XQ=e=>(0,ux.Ay)("MuiDayCalendar",e);(0,uy.A)("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);let XJ=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],X0=["ownerState"],X1=(0,e7.A)("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),X2=(0,e7.A)("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),X5=(0,e7.A)(hi.A,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),X3=(0,e7.A)(hi.A,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(e,t)=>t.weekNumberLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),X4=(0,e7.A)(hi.A,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>(0,ou.A)({},e.typography.caption,{width:36,height:36,padding:0,margin:"0 2px",color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),X6=(0,e7.A)("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:240}),X8=(0,e7.A)(function(e){let t=Yb({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:i,reduceAnimations:r,transKey:o}=t,a=(0,Gq.A)(t,XX),s=(e=>{let{classes:t,slideDirection:n}=e,i={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return(0,uu.A)(i,XY,t)})(t),l=(0,ur.A)();if(r)return(0,eb.jsx)("div",{className:(0,ul.A)(s.root,i),children:n});let u={exit:s.exit,enterActive:s.enterActive,enter:s.enter,exitActive:s.exitActive};return(0,eb.jsx)(XK,{className:(0,ul.A)(s.root,i),childFactory:e=>eD.cloneElement(e,{classNames:u}),role:"presentation",children:(0,eb.jsx)(Xq,(0,ou.A)({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:u},a,{children:n}),o)})},{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:240}),X9=(0,e7.A)("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),X7=(0,e7.A)("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:"2px 0",display:"flex",justifyContent:"center"});function Ke(e){let{parentProps:t,day:n,focusableDay:i,selectedDays:r,isDateDisabled:o,currentMonthNumber:a,isViewFocused:s}=e,l=(0,Gq.A)(e,XJ),{disabled:u,disableHighlightToday:c,isMonthSwitchingAnimating:h,showDaysOutsideCurrentMonth:d,slots:p,slotProps:f,timezone:g}=t,m=Yk().utils,v=YT(g),y=null!==i&&m.isSameDay(n,i),x=r.some(e=>m.isSameDay(e,n)),b=m.isSameDay(n,v),w=p?.day??XH,S=(0,Zm.A)({elementType:w,externalSlotProps:f?.day,additionalProps:(0,ou.A)({disableHighlightToday:c,showDaysOutsideCurrentMonth:d,role:"gridcell",isAnimating:h,"data-timestamp":m.toJsDate(n).valueOf()},l),ownerState:(0,ou.A)({},t,{day:n,selected:x})}),_=(0,Gq.A)(S,X0),M=eD.useMemo(()=>u||o(n),[u,o,n]),C=eD.useMemo(()=>m.getMonth(n)!==a,[m,n,a]),A=eD.useMemo(()=>{let e=m.startOfMonth(m.setMonth(n,a));return d?m.isSameDay(n,m.startOfWeek(e)):m.isSameDay(n,e)},[a,n,d,m]),k=eD.useMemo(()=>{let e=m.endOfMonth(m.setMonth(n,a));return d?m.isSameDay(n,m.endOfWeek(e)):m.isSameDay(n,e)},[a,n,d,m]);return(0,eb.jsx)(w,(0,ou.A)({},_,{day:n,disabled:M,autoFocus:s&&y,today:b,outsideCurrentMonth:C,isFirstVisibleCell:A,isLastVisibleCell:k,selected:x,tabIndex:y?0:-1,"aria-selected":x,"aria-current":b?"date":void 0}))}function Kt(e){let t,n=Yb({props:e,name:"MuiDayCalendar"}),i=Yk().utils,{onFocusedDayChange:r,className:o,currentMonth:a,selectedDays:s,focusedDay:l,loading:u,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:h,readOnly:d,reduceAnimations:p,renderLoading:f=()=>(0,eb.jsx)("span",{children:"..."}),slideDirection:g,TransitionProps:m,disablePast:v,disableFuture:y,minDate:x,maxDate:b,shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:_,dayOfWeekFormatter:M=e=>i.format(e,"weekdayShort").charAt(0).toUpperCase(),hasFocus:C,onFocusedViewChange:A,gridLabelId:k,displayWeekNumber:T,fixedWeekNumber:D,autoFocus:I,timezone:O}=n,P=YT(O),E=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},XQ,t)})(n),R=(0,cA.I)(),L=XA({shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:_,minDate:x,maxDate:b,disablePast:v,disableFuture:y,timezone:O}),N=Yk().localeText,[B,F]=(0,ZA.A)({name:"DayCalendar",state:"hasFocus",controlled:C,default:I??!1}),[z,V]=eD.useState(()=>l||P),j=(0,ZC.A)(e=>{d||c(e)}),H=e=>{L(e)||(r(e),V(e),A?.(!0),F(!0))},W=(0,ZC.A)((e,t)=>{switch(e.key){case"ArrowUp":H(i.addDays(t,-7)),e.preventDefault();break;case"ArrowDown":H(i.addDays(t,7)),e.preventDefault();break;case"ArrowLeft":{let n=i.addDays(t,R?1:-1),r=i.addMonths(t,R?1:-1);H(YI({utils:i,date:n,minDate:R?n:i.startOfMonth(r),maxDate:R?i.endOfMonth(r):n,isDateDisabled:L,timezone:O})||n),e.preventDefault();break}case"ArrowRight":{let n=i.addDays(t,R?-1:1),r=i.addMonths(t,R?-1:1);H(YI({utils:i,date:n,minDate:R?i.startOfMonth(r):n,maxDate:R?n:i.endOfMonth(r),isDateDisabled:L,timezone:O})||n),e.preventDefault();break}case"Home":H(i.startOfWeek(t)),e.preventDefault();break;case"End":H(i.endOfWeek(t)),e.preventDefault();break;case"PageUp":H(i.addMonths(t,1)),e.preventDefault();break;case"PageDown":H(i.addMonths(t,-1)),e.preventDefault()}}),G=(0,ZC.A)((e,t)=>H(t)),$=(0,ZC.A)((e,t)=>{B&&i.isSameDay(z,t)&&A?.(!1)}),U=i.getMonth(a),q=i.getYear(a),Y=eD.useMemo(()=>s.filter(e=>!!e).map(e=>i.startOfDay(e)),[i,s]),Z=`${q}-${U}`,X=eD.useMemo(()=>eD.createRef(),[Z]),K=eD.useMemo(()=>{let e=i.startOfMonth(a),t=i.endOfMonth(a);return L(z)||i.isAfterDay(z,t)||i.isBeforeDay(z,e)?YI({utils:i,date:z,minDate:e,maxDate:t,disablePast:v,disableFuture:y,isDateDisabled:L,timezone:O}):z},[a,y,v,z,L,i,O]),Q=eD.useMemo(()=>{let e=i.getWeekArray(a),t=i.addMonths(a,1);for(;D&&e.length<D;){let n=i.getWeekArray(t),r=i.isSameDay(e[e.length-1][0],n[0][0]);n.slice(+!!r).forEach(t=>{e.length<D&&e.push(t)}),t=i.addMonths(t,1)}return e},[a,D,i]);return(0,eb.jsxs)(X1,{role:"grid","aria-labelledby":k,className:E.root,children:[(0,eb.jsxs)(X2,{role:"row",className:E.header,children:[T&&(0,eb.jsx)(X3,{variant:"caption",role:"columnheader","aria-label":N.calendarWeekNumberHeaderLabel,className:E.weekNumberLabel,children:N.calendarWeekNumberHeaderText}),(t=i.startOfWeek(P),[0,1,2,3,4,5,6].map(e=>i.addDays(t,e))).map((e,t)=>(0,eb.jsx)(X5,{variant:"caption",role:"columnheader","aria-label":i.format(e,"weekday"),className:E.weekDayLabel,children:M(e)},t.toString()))]}),u?(0,eb.jsx)(X6,{className:E.loadingContainer,children:f()}):(0,eb.jsx)(X8,(0,ou.A)({transKey:Z,onExited:h,reduceAnimations:p,slideDirection:g,className:(0,ul.A)(o,E.slideTransition)},m,{nodeRef:X,children:(0,eb.jsx)(X9,{ref:X,role:"rowgroup",className:E.monthContainer,children:Q.map((e,t)=>(0,eb.jsxs)(X7,{role:"row",className:E.weekContainer,"aria-rowindex":t+1,children:[T&&(0,eb.jsx)(X4,{className:E.weekNumber,role:"rowheader","aria-label":N.calendarWeekNumberAriaLabelText(i.getWeekNumber(e[0])),children:N.calendarWeekNumberText(i.getWeekNumber(e[0]))}),e.map((e,t)=>(0,eb.jsx)(Ke,{parentProps:n,day:e,selectedDays:Y,focusableDay:K,onKeyDown:W,onFocus:G,onBlur:$,onDaySelect:j,isDateDisabled:L,currentMonthNumber:U,isViewFocused:B,"aria-colindex":t+1},e.toString()))]},`week-${e[0]}`))})}))]})}function Kn(e){return(0,ux.Ay)("MuiPickersMonth",e)}let Ki=(0,uy.A)("MuiPickersMonth",["root","monthButton","disabled","selected"]),Kr=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],Ko=(0,e7.A)("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),Ka=(0,e7.A)("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${Ki.disabled}`]:t.disabled},{[`&.${Ki.selected}`]:t.selected}]})(({theme:e})=>(0,ou.A)({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,uc.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,uc.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Ki.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${Ki.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),Ks=eD.memo(function(e){let t=Yb({props:e,name:"MuiPickersMonth"}),{autoFocus:n,className:i,children:r,disabled:o,selected:a,value:s,tabIndex:l,onClick:u,onKeyDown:c,onFocus:h,onBlur:d,"aria-current":p,"aria-label":f,slots:g,slotProps:m}=t,v=(0,Gq.A)(t,Kr),y=eD.useRef(null),x=(e=>{let{disabled:t,selected:n,classes:i}=e;return(0,uu.A)({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},Kn,i)})(t);(0,ZI.A)(()=>{n&&y.current?.focus()},[n]);let b=g?.monthButton??Ka,w=(0,Zm.A)({elementType:b,externalSlotProps:m?.monthButton,additionalProps:{children:r,disabled:o,tabIndex:l,ref:y,type:"button",role:"radio","aria-current":p,"aria-checked":a,"aria-label":f,onClick:e=>u(e,s),onKeyDown:e=>c(e,s),onFocus:e=>h(e,s),onBlur:e=>d(e,s)},ownerState:t,className:x.monthButton});return(0,eb.jsx)(Ko,(0,ou.A)({className:(0,ul.A)(x.root,i),ownerState:t},v,{children:(0,eb.jsx)(b,(0,ou.A)({},w))}))});function Kl(e){return(0,ux.Ay)("MuiMonthCalendar",e)}(0,uy.A)("MuiMonthCalendar",["root"]);let Ku=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],Kc=(0,e7.A)("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:320,boxSizing:"border-box"}),Kh=eD.forwardRef(function(e,t){let n,i,r,o=(n=Yk().utils,i=Yk().defaultDates,r=Yb({props:e,name:"MuiMonthCalendar"}),(0,ou.A)({disableFuture:!1,disablePast:!1},r,{minDate:YO(n,r.minDate,i.minDate),maxDate:YO(n,r.maxDate,i.maxDate)})),{className:a,value:s,defaultValue:l,referenceDate:u,disabled:c,disableFuture:h,disablePast:d,maxDate:p,minDate:f,onChange:g,shouldDisableMonth:m,readOnly:v,autoFocus:y=!1,onMonthFocus:x,hasFocus:b,onFocusedViewChange:w,monthsPerRow:S=3,timezone:_,gridLabelId:M,slots:C,slotProps:A}=o,k=(0,Gq.A)(o,Ku),{value:T,handleValueChange:D,timezone:I}=Z8({name:"MonthCalendar",timezone:_,value:s,defaultValue:l,referenceDate:u,onChange:g,valueManager:Xv}),O=YT(I),P=(0,cA.I)(),E=Yk().utils,R=eD.useMemo(()=>Xv.getInitialReferenceValue({value:T,utils:E,props:o,timezone:I,referenceDate:u,granularity:Z9.month}),[]),L=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"]},Kl,t)})(o),N=eD.useMemo(()=>E.getMonth(O),[E,O]),B=eD.useMemo(()=>null!=T?E.getMonth(T):null,[T,E]),[F,z]=eD.useState(()=>B||E.getMonth(R)),[V,j]=(0,ZA.A)({name:"MonthCalendar",state:"hasFocus",controlled:b,default:y??!1}),H=(0,ZC.A)(e=>{j(e),w&&w(e)}),W=eD.useCallback(e=>{let t=E.startOfMonth(d&&E.isAfter(O,f)?O:f),n=E.startOfMonth(h&&E.isBefore(O,p)?O:p),i=E.startOfMonth(e);return!!(E.isBefore(i,t)||E.isAfter(i,n))||!!m&&m(i)},[h,d,p,f,O,m,E]),G=(0,ZC.A)((e,t)=>{v||D(E.setMonth(T??R,t))}),$=(0,ZC.A)(e=>{!W(E.setMonth(T??R,e))&&(z(e),H(!0),x&&x(e))});eD.useEffect(()=>{z(e=>null!==B&&e!==B?B:e)},[B]);let U=(0,ZC.A)((e,t)=>{switch(e.key){case"ArrowUp":$((12+t-3)%12),e.preventDefault();break;case"ArrowDown":$((12+t+3)%12),e.preventDefault();break;case"ArrowLeft":$((12+t+(P?1:-1))%12),e.preventDefault();break;case"ArrowRight":$((12+t+(P?-1:1))%12),e.preventDefault()}}),q=(0,ZC.A)((e,t)=>{$(t)}),Y=(0,ZC.A)((e,t)=>{F===t&&H(!1)});return(0,eb.jsx)(Kc,(0,ou.A)({ref:t,className:(0,ul.A)(L.root,a),ownerState:o,role:"radiogroup","aria-labelledby":M},k,{children:YP(E,T??R).map(e=>{let t=E.getMonth(e),n=E.format(e,"monthShort"),i=E.format(e,"month"),r=c||W(e);return(0,eb.jsx)(Ks,{selected:t===B,value:t,onClick:G,onKeyDown:U,autoFocus:V&&t===F,disabled:r,tabIndex:t!==F||r?-1:0,onFocus:q,onBlur:Y,"aria-current":N===t?"date":void 0,"aria-label":i,monthsPerRow:S,slots:C,slotProps:A,children:n},n)})}))});function Kd(e){return(0,ux.Ay)("MuiPickersYear",e)}let Kp=(0,uy.A)("MuiPickersYear",["root","yearButton","selected","disabled"]),Kf=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],Kg=(0,e7.A)("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),Km=(0,e7.A)("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${Kp.disabled}`]:t.disabled},{[`&.${Kp.selected}`]:t.selected}]})(({theme:e})=>(0,ou.A)({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:(0,uc.X4)(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,uc.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Kp.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${Kp.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),Kv=eD.memo(function(e){let t=Yb({props:e,name:"MuiPickersYear"}),{autoFocus:n,className:i,children:r,disabled:o,selected:a,value:s,tabIndex:l,onClick:u,onKeyDown:c,onFocus:h,onBlur:d,"aria-current":p,slots:f,slotProps:g}=t,m=(0,Gq.A)(t,Kf),v=eD.useRef(null),y=(e=>{let{disabled:t,selected:n,classes:i}=e;return(0,uu.A)({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},Kd,i)})(t);(0,ZI.A)(()=>{n&&v.current?.focus()},[n]);let x=f?.yearButton??Km,b=(0,Zm.A)({elementType:x,externalSlotProps:g?.yearButton,additionalProps:{children:r,disabled:o,tabIndex:l,ref:v,type:"button",role:"radio","aria-current":p,"aria-checked":a,onClick:e=>u(e,s),onKeyDown:e=>c(e,s),onFocus:e=>h(e,s),onBlur:e=>d(e,s)},ownerState:t,className:y.yearButton});return(0,eb.jsx)(Kg,(0,ou.A)({className:(0,ul.A)(y.root,i),ownerState:t},m,{children:(0,eb.jsx)(x,(0,ou.A)({},b))}))});function Ky(e){return(0,ux.Ay)("MuiYearCalendar",e)}(0,uy.A)("MuiYearCalendar",["root"]);let Kx=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],Kb=(0,e7.A)("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:320,maxHeight:280,boxSizing:"border-box",position:"relative"}),Kw=eD.forwardRef(function(e,t){let n,i,r,o=(n=Yk().utils,i=Yk().defaultDates,r=Yb({props:e,name:"MuiYearCalendar"}),(0,ou.A)({disablePast:!1,disableFuture:!1},r,{yearsPerRow:r.yearsPerRow??3,minDate:YO(n,r.minDate,i.minDate),maxDate:YO(n,r.maxDate,i.maxDate)})),{autoFocus:a,className:s,value:l,defaultValue:u,referenceDate:c,disabled:h,disableFuture:d,disablePast:p,maxDate:f,minDate:g,onChange:m,readOnly:v,shouldDisableYear:y,onYearFocus:x,hasFocus:b,onFocusedViewChange:w,yearsOrder:S="asc",yearsPerRow:_,timezone:M,gridLabelId:C,slots:A,slotProps:k}=o,T=(0,Gq.A)(o,Kx),{value:D,handleValueChange:I,timezone:O}=Z8({name:"YearCalendar",timezone:M,value:l,defaultValue:u,referenceDate:c,onChange:m,valueManager:Xv}),P=YT(O),E=(0,cA.I)(),R=Yk().utils,L=eD.useMemo(()=>Xv.getInitialReferenceValue({value:D,utils:R,props:o,timezone:O,referenceDate:c,granularity:Z9.year}),[]),N=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"]},Ky,t)})(o),B=eD.useMemo(()=>R.getYear(P),[R,P]),F=eD.useMemo(()=>null!=D?R.getYear(D):null,[D,R]),[z,V]=eD.useState(()=>F||R.getYear(L)),[j,H]=(0,ZA.A)({name:"YearCalendar",state:"hasFocus",controlled:b,default:a??!1}),W=(0,ZC.A)(e=>{H(e),w&&w(e)}),G=eD.useCallback(e=>!!(p&&R.isBeforeYear(e,P)||d&&R.isAfterYear(e,P)||g&&R.isBeforeYear(e,g)||f&&R.isAfterYear(e,f))||!!y&&y(R.startOfYear(e)),[d,p,f,g,P,y,R]),$=(0,ZC.A)((e,t)=>{v||I(R.setYear(D??L,t))}),U=(0,ZC.A)(e=>{G(R.setYear(D??L,e))||(V(e),W(!0),x?.(e))});eD.useEffect(()=>{V(e=>null!==F&&e!==F?F:e)},[F]);let q="desc"!==S?+_:-1*_,Y=E&&"asc"===S||!E&&"desc"===S?-1:1,Z=(0,ZC.A)((e,t)=>{switch(e.key){case"ArrowUp":U(t-q),e.preventDefault();break;case"ArrowDown":U(t+q),e.preventDefault();break;case"ArrowLeft":U(t-Y),e.preventDefault();break;case"ArrowRight":U(t+Y),e.preventDefault()}}),X=(0,ZC.A)((e,t)=>{U(t)}),K=(0,ZC.A)((e,t)=>{z===t&&W(!1)}),Q=eD.useRef(null),J=(0,XP.A)(t,Q);eD.useEffect(()=>{if(a||null===Q.current)return;let e=Q.current.querySelector('[tabindex="0"]');if(!e)return;let t=e.offsetHeight,n=e.offsetTop,i=Q.current.clientHeight,r=Q.current.scrollTop;t>i||n<r||(Q.current.scrollTop=n+t-i/2-t/2)},[a]);let ee=R.getYearRange([g,f]);return"desc"===S&&ee.reverse(),(0,eb.jsx)(Kb,(0,ou.A)({ref:J,className:(0,ul.A)(N.root,s),ownerState:o,role:"radiogroup","aria-labelledby":C},T,{children:ee.map(e=>{let t=R.getYear(e),n=h||G(e);return(0,eb.jsx)(Kv,{selected:t===F,value:t,onClick:$,onKeyDown:Z,autoFocus:j&&t===z,disabled:n,tabIndex:t!==z||n?-1:0,onFocus:X,onBlur:K,"aria-current":B===t?"date":void 0,yearsPerRow:_,slots:A,slotProps:k,children:R.format(e,"year")},R.format(e,"year"))})}))}),KS=e=>(0,ux.Ay)("MuiPickersCalendarHeader",e),K_=(0,uy.A)("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),KM=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],KC=["ownerState"],KA=(0,e7.A)("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),Kk=(0,e7.A)("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>(0,ou.A)({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),KT=(0,e7.A)("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),KD=(0,e7.A)(eC.A,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${K_.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),KI=(0,e7.A)(YV,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),KO=eD.forwardRef(function(e,t){let n=Yk().localeText,i=Yk().utils,r=Yb({props:e,name:"MuiPickersCalendarHeader"}),{slots:o,slotProps:a,currentMonth:s,disabled:l,disableFuture:u,disablePast:c,maxDate:h,minDate:d,onMonthChange:p,onViewChange:f,view:g,reduceAnimations:m,views:v,labelId:y,className:x,timezone:b,format:w=`${i.formats.month} ${i.formats.year}`}=r,S=(0,Gq.A)(r,KM),_=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},KS,t)})(r),M=o?.switchViewButton??KD,C=(0,Zm.A)({elementType:M,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(g)},ownerState:r,className:_.switchViewButton}),A=o?.switchViewIcon??KI,k=(0,Zm.A)({elementType:A,externalSlotProps:a?.switchViewIcon,ownerState:r,className:_.switchViewIcon}),T=(0,Gq.A)(k,KC),D=function(e,{disableFuture:t,maxDate:n,timezone:i}){let r=Yk().utils;return eD.useMemo(()=>{let o=r.date(void 0,i),a=r.startOfMonth(t&&r.isBefore(o,n)?o:n);return!r.isAfter(a,e)},[t,n,e,r,i])}(s,{disableFuture:u,maxDate:h,timezone:b}),I=function(e,{disablePast:t,minDate:n,timezone:i}){let r=Yk().utils;return eD.useMemo(()=>{let o=r.date(void 0,i),a=r.startOfMonth(t&&r.isAfter(o,n)?o:n);return!r.isBefore(a,e)},[t,n,e,r,i])}(s,{disablePast:c,minDate:d,timezone:b});if(1===v.length&&"year"===v[0])return null;let O=i.formatByString(s,w);return(0,eb.jsxs)(KA,(0,ou.A)({},S,{ownerState:r,className:(0,ul.A)(_.root,x),ref:t,children:[(0,eb.jsxs)(Kk,{role:"presentation",onClick:()=>{if(1!==v.length&&f&&!l)if(2===v.length)f(v.find(e=>e!==g)||v[0]);else{let e=+(0===v.indexOf(g));f(v[e])}},ownerState:r,"aria-live":"polite",className:_.labelContainer,children:[(0,eb.jsx)(XO,{reduceAnimations:m,transKey:O,children:(0,eb.jsx)(KT,{id:y,ownerState:r,className:_.label,children:O})}),v.length>1&&!l&&(0,eb.jsx)(M,(0,ou.A)({},C,{children:(0,eb.jsx)(A,(0,ou.A)({},T))}))]}),(0,eb.jsx)(XT.A,{in:"day"===g,appear:!m,enter:!m,children:(0,eb.jsx)(ZM,{slots:o,slotProps:a,onGoToPrevious:()=>p(i.addMonths(s,-1),"right"),isPreviousDisabled:I,previousLabel:n.previousMonth,onGoToNext:()=>p(i.addMonths(s,1),"left"),isNextDisabled:D,nextLabel:n.nextMonth})})]}))}),KP="u">typeof navigator&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),KE=KP&&KP[1]?parseInt(KP[1],10):null,KR=KP&&KP[2]?parseInt(KP[2],10):null,KL=KE&&KE<10||KR&&KR<13||!1,KN=e=>(0,ux.Ay)("MuiDateCalendar",e);(0,uy.A)("MuiDateCalendar",["root","viewTransitionContainer"]);let KB=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],KF=(0,e7.A)(ZT,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:336}),Kz=(0,e7.A)(XO,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),KV=eD.forwardRef(function(e,t){let n,i,r,o,a=Yk().utils,s=(0,Zg.A)(),l=(n=Yk().utils,i=Yk().defaultDates,r=(0,d8.A)("@media (prefers-reduced-motion: reduce)",{defaultMatches:!1})||KL,o=Yb({props:e,name:"MuiDateCalendar"}),(0,ou.A)({},o,{loading:o.loading??!1,disablePast:o.disablePast??!1,disableFuture:o.disableFuture??!1,openTo:o.openTo??"day",views:o.views??["year","day"],reduceAnimations:o.reduceAnimations??r,renderLoading:o.renderLoading??(()=>(0,eb.jsx)("span",{children:"..."})),minDate:YO(n,o.minDate,i.minDate),maxDate:YO(n,o.maxDate,i.maxDate)})),{autoFocus:u,onViewChange:c,value:h,defaultValue:d,referenceDate:p,disableFuture:f,disablePast:g,onChange:m,onYearChange:v,onMonthChange:y,reduceAnimations:x,shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:S,view:_,views:M,openTo:C,className:A,disabled:k,readOnly:T,minDate:D,maxDate:I,disableHighlightToday:O,focusedView:P,onFocusedViewChange:E,showDaysOutsideCurrentMonth:R,fixedWeekNumber:L,dayOfWeekFormatter:N,slots:B,slotProps:F,loading:z,renderLoading:V,displayWeekNumber:j,yearsOrder:H,yearsPerRow:W,monthsPerRow:G,timezone:$}=l,U=(0,Gq.A)(l,KB),{value:q,handleValueChange:Y,timezone:Z}=Z8({name:"DateCalendar",timezone:$,value:h,defaultValue:d,referenceDate:p,onChange:m,valueManager:Xv}),{view:X,setView:K,focusedView:Q,setFocusedView:J,goToNextView:ee,setValueAndGoToNextView:et}=Zk({view:_,views:M,openTo:C,onChange:Y,onViewChange:c,autoFocus:u,focusedView:P,onFocusedViewChange:E}),{referenceDate:en,calendarState:ei,changeFocusedDay:er,changeMonth:eo,handleChangeMonth:ea,isDateDisabled:es,onMonthSwitchingAnimationEnd:el}=(e=>{let t,{value:n,referenceDate:i,disableFuture:r,disablePast:o,disableSwitchToMonthOnDayFocus:a=!1,maxDate:s,minDate:l,onMonthChange:u,reduceAnimations:c,shouldDisableDate:h,timezone:d}=e,p=Yk().utils,f=eD.useRef((t=!!c,(e,n)=>{switch(n.type){case"changeMonth":return(0,ou.A)({},e,{slideDirection:n.direction,currentMonth:n.newMonth,isMonthSwitchingAnimating:!t});case"changeMonthTimezone":{let t=n.newTimezone;if(p.getTimezone(e.currentMonth)===t)return e;let i=p.setTimezone(e.currentMonth,t);return p.getMonth(i)!==p.getMonth(e.currentMonth)&&(i=p.setMonth(i,p.getMonth(e.currentMonth))),(0,ou.A)({},e,{currentMonth:i})}case"finishMonthSwitchingAnimation":return(0,ou.A)({},e,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(null!=e.focusedDay&&null!=n.focusedDay&&p.isSameDay(n.focusedDay,e.focusedDay))return e;let i=null!=n.focusedDay&&!a&&!p.isSameMonth(e.currentMonth,n.focusedDay);return(0,ou.A)({},e,{focusedDay:n.focusedDay,isMonthSwitchingAnimating:i&&!t&&!n.withoutMonthSwitchingAnimation,currentMonth:i?p.startOfMonth(n.focusedDay):e.currentMonth,slideDirection:null!=n.focusedDay&&p.isAfterDay(n.focusedDay,e.currentMonth)?"left":"right"})}default:throw Error("missing support")}})).current,g=eD.useMemo(()=>Xv.getInitialReferenceValue({value:n,utils:p,timezone:d,props:e,referenceDate:i,granularity:Z9.day}),[i,d]),[m,v]=eD.useReducer(f,{isMonthSwitchingAnimating:!1,focusedDay:g,currentMonth:p.startOfMonth(g),slideDirection:"left"});eD.useEffect(()=>{v({type:"changeMonthTimezone",newTimezone:p.getTimezone(g)})},[g,p]);let y=eD.useCallback(e=>{v((0,ou.A)({type:"changeMonth"},e)),u&&u(e.newMonth)},[u]),x=eD.useCallback(e=>{p.isSameMonth(e,m.currentMonth)||y({newMonth:p.startOfMonth(e),direction:p.isAfterDay(e,m.currentMonth)?"left":"right"})},[m.currentMonth,y,p]),b=XA({shouldDisableDate:h,minDate:l,maxDate:s,disableFuture:r,disablePast:o,timezone:d}),w=eD.useCallback(()=>{v({type:"finishMonthSwitchingAnimation"})},[]);return{referenceDate:g,calendarState:m,changeMonth:x,changeFocusedDay:(0,ZC.A)((e,t)=>{b(e)||v({type:"changeFocusedDay",focusedDay:e,withoutMonthSwitchingAnimation:t})}),isDateDisabled:b,onMonthSwitchingAnimationEnd:w,handleChangeMonth:y}})({value:q,referenceDate:p,reduceAnimations:x,onMonthChange:y,minDate:D,maxDate:I,shouldDisableDate:b,disablePast:g,disableFuture:f,timezone:Z}),eu=k&&q||D,ec=k&&q||I,eh=`${s}-grid-label`,ed=null!==Q,ep=B?.calendarHeader??KO,ef=(0,Zm.A)({elementType:ep,externalSlotProps:F?.calendarHeader,additionalProps:{views:M,view:X,currentMonth:ei.currentMonth,onViewChange:K,onMonthChange:(e,t)=>ea({newMonth:e,direction:t}),minDate:eu,maxDate:ec,disabled:k,disablePast:g,disableFuture:f,reduceAnimations:x,timezone:Z,labelId:eh},ownerState:l}),eg=(0,ZC.A)(e=>{let t=a.startOfMonth(e),n=a.endOfMonth(e),i=es(e)?YI({utils:a,date:e,minDate:a.isBefore(D,t)?t:D,maxDate:a.isAfter(I,n)?n:I,disablePast:g,disableFuture:f,isDateDisabled:es,timezone:Z}):e;i?(et(i,"finish"),y?.(t)):(ee(),eo(t)),er(i,!0)}),em=(0,ZC.A)(e=>{let t=a.startOfYear(e),n=a.endOfYear(e),i=es(e)?YI({utils:a,date:e,minDate:a.isBefore(D,t)?t:D,maxDate:a.isAfter(I,n)?n:I,disablePast:g,disableFuture:f,isDateDisabled:es,timezone:Z}):e;i?(et(i,"finish"),v?.(i)):(ee(),eo(t)),er(i,!0)}),ev=(0,ZC.A)(e=>e?Y(YD(a,e,q??en),"finish",X):Y(e,"finish",X));eD.useEffect(()=>{null!=q&&a.isValid(q)&&eo(q)},[q]);let ey=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},KN,t)})(l),ex={disablePast:g,disableFuture:f,maxDate:I,minDate:D},ew={disableHighlightToday:O,readOnly:T,disabled:k,timezone:Z,gridLabelId:eh,slots:B,slotProps:F},eS=eD.useRef(X);eD.useEffect(()=>{eS.current!==X&&(Q===eS.current&&J(X,!0),eS.current=X)},[Q,J,X]);let e_=eD.useMemo(()=>[q],[q]);return(0,eb.jsxs)(KF,(0,ou.A)({ref:t,className:(0,ul.A)(ey.root,A),ownerState:l},U,{children:[(0,eb.jsx)(ep,(0,ou.A)({},ef,{slots:B,slotProps:F})),(0,eb.jsx)(Kz,{reduceAnimations:x,className:ey.viewTransitionContainer,transKey:X,ownerState:l,children:(0,eb.jsxs)("div",{children:["year"===X&&(0,eb.jsx)(Kw,(0,ou.A)({},ex,ew,{value:q,onChange:em,shouldDisableYear:S,hasFocus:ed,onFocusedViewChange:e=>J("year",e),yearsOrder:H,yearsPerRow:W,referenceDate:en})),"month"===X&&(0,eb.jsx)(Kh,(0,ou.A)({},ex,ew,{hasFocus:ed,className:A,value:q,onChange:eg,shouldDisableMonth:w,onFocusedViewChange:e=>J("month",e),monthsPerRow:G,referenceDate:en})),"day"===X&&(0,eb.jsx)(Kt,(0,ou.A)({},ei,ex,ew,{onMonthSwitchingAnimationEnd:el,onFocusedDayChange:er,reduceAnimations:x,selectedDays:e_,onSelectedDaysChange:ev,shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:S,hasFocus:ed,onFocusedViewChange:e=>J("day",e),showDaysOutsideCurrentMonth:R,fixedWeekNumber:L,dayOfWeekFormatter:N,displayWeekNumber:j,loading:z,renderLoading:V}))]})})]}))}),Kj=({view:e,onViewChange:t,views:n,focusedView:i,onFocusedViewChange:r,value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:h,disablePast:d,minDate:p,maxDate:f,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:S,yearsPerRow:_,slots:M,slotProps:C,loading:A,renderLoading:k,disableHighlightToday:T,readOnly:D,disabled:I,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:P,sx:E,autoFocus:R,fixedWeekNumber:L,displayWeekNumber:N,timezone:B})=>(0,eb.jsx)(KV,{view:e,onViewChange:t,views:n.filter(YN),focusedView:i&&YN(i)?i:null,onFocusedViewChange:r,value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:h,disablePast:d,minDate:p,maxDate:f,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:S,yearsPerRow:_,slots:M,slotProps:C,loading:A,renderLoading:k,disableHighlightToday:T,readOnly:D,disabled:I,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:P,sx:E,autoFocus:R,fixedWeekNumber:L,displayWeekNumber:N,timezone:B});function KH(e){let{props:t,validator:n,value:i,timezone:r,onError:o}=e,a=Yk(),s=eD.useRef(n.valueManager.defaultErrorState),l=n({adapter:a,value:i,timezone:r,props:t}),u=n.valueManager.hasError(l);return eD.useEffect(()=>{o&&!n.valueManager.isSameError(l,s.current)&&o(l,i),s.current=l},[n,o,l,i]),{validationError:l,hasValidationError:u,getValidationErrorForNewValue:(0,ZC.A)(e=>n({adapter:a,value:e,timezone:r,props:t}))}}let KW=["className","sx"],KG=(e=document)=>{let t=e.activeElement;return t?t.shadowRoot?KG(t.shadowRoot):t:null};function K$(){return"u"<typeof window?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?90===Math.abs(window.screen.orientation.angle)?"landscape":"portrait":window.orientation&&90===Math.abs(Number(window.orientation))?"landscape":"portrait"}function KU(e){return(0,ux.Ay)("MuiPickersLayout",e)}let Kq=(0,uy.A)("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),KY=["onAccept","onClear","onCancel","onSetToday","actions"];function KZ(e){let{onAccept:t,onClear:n,onCancel:i,onSetToday:r,actions:o}=e,a=(0,Gq.A)(e,KY),s=Yk().localeText;if(null==o||0===o.length)return null;let l=o?.map(e=>{switch(e){case"clear":return(0,eb.jsx)(eS.A,{onClick:n,children:s.clearButtonLabel},e);case"cancel":return(0,eb.jsx)(eS.A,{onClick:i,children:s.cancelButtonLabel},e);case"accept":return(0,eb.jsx)(eS.A,{onClick:t,children:s.okButtonLabel},e);case"today":return(0,eb.jsx)(eS.A,{onClick:r,children:s.todayButtonLabel},e);default:return null}});return(0,eb.jsx)(hH.A,(0,ou.A)({},a,{children:l}))}var KX=n(76477),KK=n(79223),KQ=n(6835);function KJ(e){return(0,ux.Ay)("MuiListItem",e)}function K0(e){return(0,ux.Ay)("MuiListItemSecondaryAction",e)}(0,uy.A)("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]),(0,uy.A)("MuiListItemSecondaryAction",["root","disableGutters"]);let K1=(0,e7.A)("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),K2=eD.forwardRef(function(e,t){let n=(0,ud.b)({props:e,name:"MuiListItemSecondaryAction"}),{className:i,...r}=n,o=eD.useContext(uv.A),a={...n,disableGutters:o.disableGutters},s=(e=>{let{disableGutters:t,classes:n}=e;return(0,uu.A)({root:["root",t&&"disableGutters"]},K0,n)})(a);return(0,eb.jsx)(K1,{className:(0,ul.A)(s.root,i),ownerState:a,ref:t,...r})});K2.muiName="ListItemSecondaryAction";let K5=(0,e7.A)("div",{name:"MuiListItem",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]}})((0,uh.A)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${uw.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>e.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),K3=(0,e7.A)("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),K4=eD.forwardRef(function(e,t){let n=(0,ud.b)({props:e,name:"MuiListItem"}),{alignItems:i="center",children:r,className:o,component:a,components:s={},componentsProps:l={},ContainerComponent:u="li",ContainerProps:{className:c,...h}={},dense:d=!1,disableGutters:p=!1,disablePadding:f=!1,divider:g=!1,secondaryAction:m,slotProps:v={},slots:y={},...x}=n,b=eD.useContext(uv.A),w=eD.useMemo(()=>({dense:d||b.dense||!1,alignItems:i,disableGutters:p}),[i,b.dense,d,p]),S=eD.useRef(null),_=eD.Children.toArray(r),M=_.length&&(0,KQ.A)(_[_.length-1],["ListItemSecondaryAction"]),C={...n,alignItems:i,dense:w.dense,disableGutters:p,disablePadding:f,divider:g,hasSecondaryAction:M},A=(e=>{let{alignItems:t,classes:n,dense:i,disableGutters:r,disablePadding:o,divider:a,hasSecondaryAction:s}=e;return(0,uu.A)({root:["root",i&&"dense",!r&&"gutters",!o&&"padding",a&&"divider","flex-start"===t&&"alignItemsFlexStart",s&&"secondaryAction"],container:["container"]},KJ,n)})(C),k=(0,um.A)(S,t),T=y.root||s.Root||K5,D=v.root||l.root||{},I={className:(0,ul.A)(A.root,D.className,o),...x},O=a||"li";return M?(O=I.component||a?O:"div","li"===u&&("li"===O?O="div":"li"===I.component&&(I.component="div")),(0,eb.jsx)(uv.A.Provider,{value:w,children:(0,eb.jsxs)(K3,{as:u,className:(0,ul.A)(A.container,c),ref:k,ownerState:C,...h,children:[(0,eb.jsx)(T,{...D,...!(0,KK.A)(T)&&{as:O,ownerState:{...C,...D.ownerState}},...I,children:_}),_.pop()]})})):(0,eb.jsx)(uv.A.Provider,{value:w,children:(0,eb.jsxs)(T,{...D,as:O,ref:k,...!(0,KK.A)(T)&&{ownerState:{...C,...D.ownerState}},...I,children:[_,m&&(0,eb.jsx)(K2,{children:m})]})})});var K6=n(47601);let K8=["items","changeImportance","isLandscape","onChange","isValid"],K9=["getValue"];function K7(e){let{items:t,changeImportance:n="accept",onChange:i,isValid:r}=e,o=(0,Gq.A)(e,K8);if(null==t||0===t.length)return null;let a=t.map(e=>{let{getValue:t}=e,o=(0,Gq.A)(e,K9),a=t({isValid:r});return(0,ou.A)({},o,{label:o.label,onClick:()=>{i(a,n,o)},disabled:!r(a)})});return(0,eb.jsx)(KX.A,(0,ou.A)({dense:!0,sx:[{maxHeight:336,maxWidth:200,overflow:"auto"},...Array.isArray(o.sx)?o.sx:[o.sx]]},o,{children:a.map(e=>(0,eb.jsx)(K4,{children:(0,eb.jsx)(K6.A,(0,ou.A)({},e))},e.id??e.label))}))}let Qe=(0,e7.A)("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${Kq.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${Kq.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${Kq.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${Kq.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${Kq.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${Kq.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${Kq.shortcuts}`]:{gridColumn:3}}}]}),Qt=(0,e7.A)("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),Qn=eD.forwardRef(function(e,t){let n=Yb({props:e,name:"MuiPickersLayout"}),{toolbar:i,content:r,tabs:o,actionBar:a,shortcuts:s}=(e=>{let{wrapperVariant:t,onAccept:n,onClear:i,onCancel:r,onSetToday:o,view:a,views:s,onViewChange:l,value:u,onChange:c,onSelectShortcut:h,isValid:d,isLandscape:p,disabled:f,readOnly:g,children:m,slots:v,slotProps:y}=e,x=(e=>{let{classes:t,isLandscape:n}=e;return(0,uu.A)({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},KU,t)})(e),b=v?.actionBar??KZ,w=(0,Zm.A)({elementType:b,externalSlotProps:y?.actionBar,additionalProps:{onAccept:n,onClear:i,onCancel:r,onSetToday:o,actions:"desktop"===t?[]:["cancel","accept"]},className:x.actionBar,ownerState:(0,ou.A)({},e,{wrapperVariant:t})}),S=(0,eb.jsx)(b,(0,ou.A)({},w)),_=v?.toolbar,M=(0,Zm.A)({elementType:_,externalSlotProps:y?.toolbar,additionalProps:{isLandscape:p,onChange:c,value:u,view:a,onViewChange:l,views:s,disabled:f,readOnly:g},className:x.toolbar,ownerState:(0,ou.A)({},e,{wrapperVariant:t})}),C=null!==M.view&&_?(0,eb.jsx)(_,(0,ou.A)({},M)):null,A=v?.tabs,k=a&&A?(0,eb.jsx)(A,(0,ou.A)({view:a,onViewChange:l,className:x.tabs},y?.tabs)):null,T=v?.shortcuts??K7,D=(0,Zm.A)({elementType:T,externalSlotProps:y?.shortcuts,additionalProps:{isValid:d,isLandscape:p,onChange:h},className:x.shortcuts,ownerState:{isValid:d,isLandscape:p,onChange:h,wrapperVariant:t}});return{toolbar:C,content:m,tabs:k,actionBar:S,shortcuts:a&&T?(0,eb.jsx)(T,(0,ou.A)({},D)):null}})(n),{sx:l,className:u,isLandscape:c,wrapperVariant:h}=n,d=(e=>{let{isLandscape:t,classes:n}=e;return(0,uu.A)({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},KU,n)})(n);return(0,eb.jsxs)(Qe,{ref:t,sx:l,className:(0,ul.A)(d.root,u),ownerState:n,children:[c?s:i,c?i:s,(0,eb.jsx)(Qt,{className:d.contentWrapper,children:"desktop"===h?(0,eb.jsxs)(eD.Fragment,{children:[r,o]}):(0,eb.jsxs)(eD.Fragment,{children:[o,r]})}),a]})}),Qi=["props","ref"],Qr=(0,e7.A)(Qn)(({theme:e})=>({overflow:"hidden",minWidth:320,backgroundColor:(e.vars||e).palette.background.paper})),Qo=({adapter:e,value:t,timezone:n,props:i})=>{if(null===t)return null;let{minTime:r,maxTime:o,minutesStep:a,shouldDisableTime:s,disableIgnoringDatePartForTimeValidation:l=!1,disablePast:u,disableFuture:c}=i,h=e.utils.date(void 0,n),d=Zo(l,e.utils);switch(!0){case!e.utils.isValid(t):return"invalidDate";case!!(r&&d(r,t)):return"minTime";case!!(o&&d(t,o)):return"maxTime";case!!(c&&e.utils.isAfter(t,h)):return"disableFuture";case!!(u&&e.utils.isBefore(t,h)):return"disablePast";case!!(s&&s(t,"hours")):return"shouldDisableTime-hours";case!!(s&&s(t,"minutes")):return"shouldDisableTime-minutes";case!!(s&&s(t,"seconds")):return"shouldDisableTime-seconds";case!!(a&&e.utils.getMinutes(t)%a!=0):return"minutesStep";default:return null}};Qo.valueManager=Xv;let Qa=({adapter:e,value:t,timezone:n,props:i})=>{let r=XC({adapter:e,value:t,timezone:n,props:i});return null!==r?r:Qo({adapter:e,value:t,timezone:n,props:i})};Qa.valueManager=Xv;let Qs=eD.forwardRef(function(e,t){let n,i,r,o,a,s=(n=Yk().utils,i=Yk().defaultDates,o=(r=Yb({props:e,name:"MuiStaticDateTimePicker"})).ampm??n.is12HourCycleInCurrentLocale(),a=eD.useMemo(()=>r.localeText?.toolbarTitle==null?r.localeText:(0,ou.A)({},r.localeText,{dateTimePickerToolbarTitle:r.localeText.toolbarTitle}),[r.localeText]),(0,ou.A)({},r,(({openTo:e,defaultOpenTo:t,views:n,defaultViews:i})=>{let r,o=n??i;if(null!=e)r=e;else if(o.includes(t))r=t;else if(o.length>0)r=o[0];else throw Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:r}})({views:r.views,openTo:r.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:o,localeText:a,orientation:r.orientation??"portrait",disableIgnoringDatePartForTimeValidation:r.disableIgnoringDatePartForTimeValidation??!!(r.minDateTime||r.maxDateTime||r.disablePast||r.disableFuture),disableFuture:r.disableFuture??!1,disablePast:r.disablePast??!1,minDate:YO(n,r.minDateTime??r.minDate,i.minDate),maxDate:YO(n,r.maxDateTime??r.maxDate,i.maxDate),minTime:r.minDateTime??r.minTime,maxTime:r.maxDateTime??r.maxTime,slots:(0,ou.A)({toolbar:Zf,tabs:YY},r.slots),slotProps:(0,ou.A)({},r.slotProps,{toolbar:(0,ou.A)({ampm:o},r.slotProps?.toolbar)})})),l=s.displayStaticWrapperAs??"mobile",u=s.ampmInClock??"desktop"===l,c=(0,ou.A)({day:Kj,month:Kj,year:Kj,hours:XM,minutes:XM,seconds:XM},s.viewRenderers),{renderPicker:h}=(e=>{let{props:t,ref:n}=e,i=(0,Gq.A)(e,Qi),{localeText:r,slots:o,slotProps:a,className:s,sx:l,displayStaticWrapperAs:u,autoFocus:c}=t,{layoutProps:h,renderCurrentView:d}=(({props:e,valueManager:t,valueType:n,wrapperVariant:i,additionalViewProps:r,validator:o,autoFocusView:a,rendererInterceptor:s,fieldRef:l})=>{let u=(({props:e,valueManager:t,valueType:n,wrapperVariant:i,validator:r})=>{let{onAccept:o,onChange:a,value:s,defaultValue:l,closeOnSelect:u="desktop"===i,timezone:c,referenceDate:h}=e,{current:d}=eD.useRef(l),{current:p}=eD.useRef(void 0!==s),[f,g]=eD.useState(c),m=Yk().utils,v=Yk(),{isOpen:y,setIsOpen:x}=(({open:e,onOpen:t,onClose:n})=>{let i=eD.useRef("boolean"==typeof e).current,[r,o]=eD.useState(!1);return eD.useEffect(()=>{if(i){if("boolean"!=typeof e)throw Error("You must not mix controlling and uncontrolled mode for `open` prop");o(e)}},[i,e]),{isOpen:r,setIsOpen:eD.useCallback(e=>{i||o(e),e&&t&&t(),!e&&n&&n()},[i,t,n])}})(e),{timezone:b,value:w,handleValueChange:S}=Z6({timezone:c,value:s,defaultValue:d,referenceDate:h,onChange:a,valueManager:t}),[_,M]=eD.useState(()=>{let e;return{draft:e=void 0!==w?w:void 0!==d?d:t.emptyValue,lastPublishedValue:e,lastCommittedValue:e,lastControlledValue:s,hasBeenModifiedSinceMount:!1}}),C=t.getTimezone(m,_.draft);f!==c&&(g(c),c&&C&&c!==C&&M(e=>(0,ou.A)({},e,{draft:t.setTimezone(m,c,e.draft)})));let{getValidationErrorForNewValue:A}=KH({props:e,validator:r,timezone:b,value:_.draft,onError:e.onError}),k=(0,ZC.A)(e=>{let n={action:e,dateState:_,hasChanged:n=>!t.areValuesEqual(m,e.value,n),isControlled:p,closeOnSelect:u},i=(e=>{let{action:t,hasChanged:n,dateState:i,isControlled:r}=e,o=!r&&!i.hasBeenModifiedSinceMount;return"setValueFromField"===t.name||("setValueFromAction"===t.name?!!(o&&["accept","today","clear"].includes(t.pickerAction))||n(i.lastPublishedValue):("setValueFromView"===t.name&&"shallow"!==t.selectionState||"setValueFromShortcut"===t.name)&&(!!o||n(i.lastPublishedValue)))})(n),r=(e=>{let{action:t,hasChanged:n,dateState:i,isControlled:r,closeOnSelect:o}=e,a=!r&&!i.hasBeenModifiedSinceMount;return"setValueFromAction"===t.name?!!(a&&["accept","today","clear"].includes(t.pickerAction))||n(i.lastCommittedValue):"setValueFromView"===t.name&&"finish"===t.selectionState&&o?!!a||n(i.lastCommittedValue):"setValueFromShortcut"===t.name&&"accept"===t.changeImportance&&n(i.lastCommittedValue)})(n),a=(e=>{let{action:t,closeOnSelect:n}=e;return"setValueFromAction"===t.name||("setValueFromView"===t.name?"finish"===t.selectionState&&n:"setValueFromShortcut"===t.name&&"accept"===t.changeImportance)})(n);M(t=>(0,ou.A)({},t,{draft:e.value,lastPublishedValue:i?e.value:t.lastPublishedValue,lastCommittedValue:r?e.value:t.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let s=null,l=()=>(s||(s={validationError:"setValueFromField"===e.name?e.context.validationError:A(e.value)},"setValueFromShortcut"===e.name&&(s.shortcut=e.shortcut)),s);i&&S(e.value,l()),r&&o&&o(e.value,l()),a&&x(!1)});if(_.lastControlledValue!==s){let e=t.areValuesEqual(m,_.draft,w);M(t=>(0,ou.A)({},t,{lastControlledValue:s},e?{}:{lastCommittedValue:w,lastPublishedValue:w,draft:w,hasBeenModifiedSinceMount:!0}))}let T=(0,ZC.A)(()=>{k({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),D=(0,ZC.A)(()=>{k({value:_.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),I=(0,ZC.A)(()=>{k({value:_.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),O=(0,ZC.A)(()=>{k({value:_.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),P=(0,ZC.A)(()=>{k({value:t.getTodayValue(m,b,n),name:"setValueFromAction",pickerAction:"today"})}),E=(0,ZC.A)(e=>{e.preventDefault(),x(!0)}),R=(0,ZC.A)(e=>{e?.preventDefault(),x(!1)}),L=(0,ZC.A)((e,t="partial")=>k({name:"setValueFromView",value:e,selectionState:t})),N=(0,ZC.A)((e,t,n)=>k({name:"setValueFromShortcut",value:e,changeImportance:t,shortcut:n})),B=(0,ZC.A)((e,t)=>k({name:"setValueFromField",value:e,context:t})),F={onClear:T,onAccept:D,onDismiss:I,onCancel:O,onSetToday:P,onOpen:E,onClose:R},z={value:_.draft,onChange:B},V=eD.useMemo(()=>t.cleanValue(m,_.draft),[m,t,_.draft]),j=(0,ou.A)({},F,{value:V,onChange:L,onSelectShortcut:N,isValid:n=>{let i=r({adapter:v,value:n,timezone:b,props:e});return!t.hasError(i)}}),H=eD.useMemo(()=>({onOpen:E,onClose:R,open:y}),[y,R,E]);return{open:y,fieldProps:z,viewProps:{value:V,onChange:L,onClose:R,open:y},layoutProps:j,actions:F,contextValue:H}})({props:e,valueManager:t,valueType:n,wrapperVariant:i,validator:o}),c=(({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:i,rendererInterceptor:r,fieldRef:o})=>{let{onChange:a,open:s,onClose:l}=t,{view:u,views:c,openTo:h,onViewChange:d,viewRenderers:p,timezone:f}=e,g=(0,Gq.A)(e,KW),{view:m,setView:v,defaultView:y,focusedView:x,setFocusedView:b,setValueAndGoToNextView:w}=Zk({view:u,views:c,openTo:h,onChange:a,onViewChange:d,autoFocus:i}),{hasUIView:S,viewModeLookup:_}=eD.useMemo(()=>c.reduce((e,t)=>{let n;return n=null!=p[t]?"UI":"field",e.viewModeLookup[t]=n,"UI"===n&&(e.hasUIView=!0),e},{hasUIView:!1,viewModeLookup:{}}),[p,c]),M=eD.useMemo(()=>c.reduce((e,t)=>null!=p[t]&&Zn(t)?e+1:e,0),[p,c]),C=_[m],A=(0,ZC.A)(()=>"UI"===C),[k,T]=eD.useState("UI"===C?m:null);return k!==m&&"UI"===_[m]&&T(m),(0,ZI.A)(()=>{"field"===C&&s&&(l(),setTimeout(()=>{o?.current?.setSelectedSections(m),o?.current?.focusField(m)}))},[m]),(0,ZI.A)(()=>{if(!s)return;let e=m;"field"===C&&null!=k&&(e=k),e!==y&&"UI"===_[e]&&"UI"===_[y]&&(e=y),e!==m&&v(e),b(e,!0)},[s]),{hasUIView:S,shouldRestoreFocus:A,layoutProps:{views:c,view:k,onViewChange:v},renderCurrentView:()=>{if(null==k)return null;let e=p[k];if(null==e)return null;let i=(0,ou.A)({},g,n,t,{views:c,timezone:f,onChange:w,view:k,onViewChange:v,focusedView:x,onFocusedViewChange:b,showViewSwitcher:M>1,timeViewsCount:M});return r?r(p,k,i):e(i)}}})({props:e,additionalViewProps:r,autoFocusView:a,fieldRef:l,propsFromPickerValue:u.viewProps,rendererInterceptor:s}),h=(({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:i})=>{let{orientation:r}=e,o=((e,t)=>{var n;let[i,r]=eD.useState(K$);return(0,ZI.A)(()=>{let e=()=>{r(K$())};return window.addEventListener("orientationchange",e),()=>{window.removeEventListener("orientationchange",e)}},[]),(Array.isArray(n=["hours","minutes","seconds"])?!n.every(t=>-1!==e.indexOf(t)):-1===e.indexOf(n))&&"landscape"===(t||i)})(n.views,r),a=(0,cA.I)();return{layoutProps:(0,ou.A)({},n,t,{isLandscape:o,isRtl:a,wrapperVariant:i,disabled:e.disabled,readOnly:e.readOnly})}})({props:e,wrapperVariant:i,propsFromPickerValue:u.layoutProps,propsFromPickerViews:c.layoutProps}),d=function(e){let{props:t,pickerValueResponse:n}=e;return eD.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:t.disabled??!1,readOnly:t.readOnly??!1}),[n.viewProps.value,n.open,t.disabled,t.readOnly])}({props:e,pickerValueResponse:u});return{open:u.open,actions:u.actions,fieldProps:u.fieldProps,renderCurrentView:c.renderCurrentView,hasUIView:c.hasUIView,shouldRestoreFocus:c.shouldRestoreFocus,layoutProps:h.layoutProps,contextValue:u.contextValue,ownerState:d}})((0,ou.A)({},i,{props:t,autoFocusView:c??!1,additionalViewProps:{},wrapperVariant:u})),p=o?.layout??Qr;return{renderPicker:()=>(0,eb.jsx)(Y_,{localeText:r,children:(0,eb.jsx)(p,(0,ou.A)({},h,a?.layout,{slots:o,slotProps:a,sx:[...Array.isArray(l)?l:[l],...Array.isArray(a?.layout?.sx)?a.layout.sx:[a?.layout?.sx]],className:(0,ul.A)(s,a?.layout?.className),ref:n,children:d()}))})}})({props:(0,ou.A)({},s,{viewRenderers:c,displayStaticWrapperAs:l,ampmInClock:u,yearsPerRow:s.yearsPerRow??("mobile"===l?3:4),slotProps:(0,ou.A)({},s.slotProps,{tabs:(0,ou.A)({hidden:"desktop"===l},s.slotProps?.tabs),toolbar:(0,ou.A)({hidden:"desktop"===l,ampmInClock:u},s.slotProps?.toolbar)})}),valueManager:Xv,valueType:"date-time",validator:Qa,ref:t});return h()});Qs.propTypes={ampm:YC().bool,ampmInClock:YC().bool,autoFocus:YC().bool,className:YC().string,dayOfWeekFormatter:YC().func,defaultValue:YC().object,disabled:YC().bool,disableFuture:YC().bool,disableHighlightToday:YC().bool,disableIgnoringDatePartForTimeValidation:YC().bool,disablePast:YC().bool,displayStaticWrapperAs:YC().oneOf(["desktop","mobile"]),displayWeekNumber:YC().bool,fixedWeekNumber:YC().number,loading:YC().bool,localeText:YC().object,maxDate:YC().object,maxDateTime:YC().object,maxTime:YC().object,minDate:YC().object,minDateTime:YC().object,minTime:YC().object,minutesStep:YC().number,monthsPerRow:YC().oneOf([3,4]),onAccept:YC().func,onChange:YC().func,onClose:YC().func,onError:YC().func,onMonthChange:YC().func,onViewChange:YC().func,onYearChange:YC().func,openTo:YC().oneOf(["day","hours","minutes","month","seconds","year"]),orientation:YC().oneOf(["landscape","portrait"]),readOnly:YC().bool,reduceAnimations:YC().bool,referenceDate:YC().object,renderLoading:YC().func,shouldDisableDate:YC().func,shouldDisableMonth:YC().func,shouldDisableTime:YC().func,shouldDisableYear:YC().func,showDaysOutsideCurrentMonth:YC().bool,slotProps:YC().object,slots:YC().object,sx:YC().oneOfType([YC().arrayOf(YC().oneOfType([YC().func,YC().object,YC().bool])),YC().func,YC().object]),timezone:YC().string,value:YC().object,view:YC().oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:YC().shape({day:YC().func,hours:YC().func,minutes:YC().func,month:YC().func,seconds:YC().func,year:YC().func}),views:YC().arrayOf(YC().oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:YC().oneOf(["asc","desc"]),yearsPerRow:YC().oneOf([3,4])};let Ql=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:i,localizedDigits:r,now:o,token:a,startSeparator:s})=>{if(""===a)throw Error("MUI X: Should not call `commitToken` with an empty token");let l=Xe(e,a),u=Xh(e,l.contentType,l.type,a),c=n?u:"digit"===l.contentType,h=null!=t&&e.isValid(t),d=h?e.formatByString(t,a):"",p=null;if(c)if(u)p=""===d?e.formatByString(o,a).length:d.length;else{if(null==l.maxLength)throw Error(`MUI X: The token ${a} should have a 'maxDigitNumber' property on it's adapter`);p=l.maxLength,h&&(d=Xo(Xs(Xr(d,r),p),r))}return(0,ou.A)({},l,{format:a,maxLength:p,value:d,placeholder:((e,t,n,i)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),i).length,format:i});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:i});case"day":return t.fieldDayPlaceholder({format:i});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:i});case"hours":return t.fieldHoursPlaceholder({format:i});case"minutes":return t.fieldMinutesPlaceholder({format:i});case"seconds":return t.fieldSecondsPlaceholder({format:i});case"meridiem":return t.fieldMeridiemPlaceholder({format:i});default:return i}})(e,i,l,a),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:c,startSeparator:s,endSeparator:"",modified:!1})},Qu=e=>{let t=(({utils:e,format:t})=>{let n=10,i=t,r=e.expandFormat(t);for(;r!==i;)if(i=r,r=e.expandFormat(i),(n-=1)<0)throw Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return r})(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));let n=(({utils:e,expandedFormat:t})=>{let n=[],{start:i,end:r}=e.escapedCharacters,o=RegExp(`(\\${i}[^\\${r}]*\\${r})+`,"g"),a=null;for(;a=o.exec(t);)n.push({start:a.index,end:o.lastIndex-1});return n})((0,ou.A)({},e,{expandedFormat:t})),i=(e=>{let{utils:t,expandedFormat:n,escapedParts:i}=e,r=t.date(void 0),o=[],a="",s=Object.keys(t.formatTokenMap).sort((e,t)=>t.length-e.length),l=/^([a-zA-Z]+)/,u=RegExp(`^(${s.join("|")})*$`),c=RegExp(`^(${s.join("|")})`),h=e=>i.find(t=>t.start<=e&&t.end>=e),d=0;for(;d<n.length;){let t=h(d),i=null!=t,s=l.exec(n.slice(d))?.[1];if(!i&&null!=s&&u.test(s)){let t=s;for(;t.length>0;){let n=c.exec(t)[1];t=t.slice(n.length),o.push(Ql((0,ou.A)({},e,{now:r,token:n,startSeparator:a}))),a=""}d+=s.length}else{let e=n[d];i&&t?.start===d||t?.end===d||(0===o.length?a+=e:o[o.length-1].endSeparator+=e),d+=1}}return 0===o.length&&a.length>0&&o.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:a,endSeparator:"",modified:!1}),o})((0,ou.A)({},e,{expandedFormat:t,escapedParts:n}));return(({isRtl:e,formatDensity:t,sections:n})=>n.map(n=>{let i=n=>{let i=n;return e&&null!==i&&i.includes(" ")&&(i=`\u2069${i}\u2066`),"spacious"===t&&["/",".","-"].includes(i)&&(i=` ${i} `),i};return n.startSeparator=i(n.startSeparator),n.endSeparator=i(n.endSeparator),n}))((0,ou.A)({},e,{sections:i}))},Qc=e=>{let{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:i,onBlur:r,onClick:o,onFocus:a,onInput:s,onPaste:l,focused:u,autoFocus:c=!1},fieldValueManager:h,applyCharacterEditing:d,resetCharacterQuery:p,setSelectedSections:f,parsedSelectedSections:g,state:m,clearActiveSection:v,clearValue:y,updateSectionValue:x,updateValueFromValueStr:b,sectionOrder:w,areAllSectionsEmpty:S,sectionsValueBoundaries:_}=e,M=eD.useRef(null),C=(0,XP.A)(i,M),A=Yk().localeText,k=Yk().utils,T=(0,Zg.A)(),[D,I]=eD.useState(!1),O=eD.useMemo(()=>({syncSelectionToDOM:()=>{let e;if(!M.current)return;let t=document.getSelection();if(!t)return;if(null==g){t.rangeCount>0&&M.current.getRoot().contains(t.getRangeAt(0).startContainer)&&t.removeAllRanges(),D&&M.current.getRoot().blur();return}if(!M.current.getRoot().contains(KG(document)))return;let n=new window.Range;e="all"===g?M.current.getRoot():"empty"===m.sections[g].type?M.current.getSectionContainer(g):M.current.getSectionContent(g),n.selectNodeContents(e),e.focus(),t.removeAllRanges(),t.addRange(n)},getActiveSectionIndexFromDOM:()=>{let e=KG(document);return e&&M.current&&M.current.getRoot().contains(e)?M.current.getSectionIndexFromDOMElement(e):null},focusField:(e=0)=>{if(!M.current||null!=O.getActiveSectionIndexFromDOM())return;let t=Xg(e,m.sections);I(!0),M.current.getSectionContent(t).focus()},setSelectedSections:e=>{if(!M.current)return;let t=Xg(e,m.sections);I(null!==("all"===t?0:t)),f(e)},isFieldFocused:()=>{let e=KG(document);return!!M.current&&M.current.getRoot().contains(e)}}),[g,f,m.sections,D]),P=(0,ZC.A)(e=>{if(!M.current)return;let t=m.sections[e];M.current.getSectionContent(e).innerHTML=t.value||t.placeholder,O.syncSelectionToDOM()}),E=(0,ZC.A)((e,...t)=>{!e.isDefaultPrevented()&&M.current&&(I(!0),o?.(e,...t),"all"===g?setTimeout(()=>{let e=document.getSelection().getRangeAt(0).startOffset;if(0===e)return void f(w.startIndex);let t=0,n=0;for(;n<e&&t<m.sections.length;){let e=m.sections[t];t+=1,n+=`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`.length}f(t-1)}):D?M.current.getRoot().contains(e.target)||f(w.startIndex):(I(!0),f(w.startIndex)))}),R=(0,ZC.A)(e=>{if(s?.(e),!M.current||"all"!==g)return;let t=e.target.textContent??"";M.current.getRoot().innerHTML=m.sections.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),O.syncSelectionToDOM(),0===t.length||10===t.charCodeAt(0)?(p(),y(),f("all")):t.length>1?b(t):("all"===g&&f(0),d({keyPressed:t,sectionIndex:0}))}),L=(0,ZC.A)(e=>{if(l?.(e),n||"all"!==g)return void e.preventDefault();let t=e.clipboardData.getData("text");e.preventDefault(),p(),b(t)}),N=(0,ZC.A)((...e)=>{a?.(...e),D||!M.current||(I(!0),null==M.current.getSectionIndexFromDOMElement(KG(document))&&f(w.startIndex))}),B=(0,ZC.A)((...e)=>{r?.(...e),setTimeout(()=>{if(!M.current)return;let e=KG(document);M.current.getRoot().contains(e)||(I(!1),f(null))})}),F=(0,ZC.A)(e=>t=>{t.isDefaultPrevented()||f(e)}),z=(0,ZC.A)(e=>{e.preventDefault()}),V=(0,ZC.A)(e=>()=>{f(e)}),j=(0,ZC.A)(e=>{if(e.preventDefault(),n||t||"number"!=typeof g)return;let i=m.sections[g],r=e.clipboardData.getData("text"),o=/^[a-zA-Z]+$/.test(r),a=/^[0-9]+$/.test(r),s=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(r);"letter"===i.contentType&&o||"digit"===i.contentType&&a||"digit-with-letter"===i.contentType&&s?(p(),x({activeSection:i,newSectionValue:r,shouldGoToNextSection:!0})):o||a||(p(),b(r))}),H=(0,ZC.A)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="none"}),W=(0,ZC.A)(e=>{if(!M.current)return;let t=e.target,i=t.textContent??"",r=M.current.getSectionIndexFromDOMElement(t),o=m.sections[r];if(n||!M.current)return void P(r);if(0===i.length){if(""===o.value)return void P(r);let t=e.nativeEvent.inputType;return"insertParagraph"===t||"insertLineBreak"===t?void P(r):(p(),void v())}d({keyPressed:i,sectionIndex:r}),P(r)});(0,ZI.A)(()=>{if(D&&M.current){if("all"===g)M.current.getRoot().focus();else if("number"==typeof g){let e=M.current.getSectionContent(g);e&&e.focus()}}},[g,D]);let G=eD.useMemo(()=>m.sections.reduce((e,t)=>(e[t.type]=_[t.type]({currentDate:null,contentType:t.contentType,format:t.format}),e),{}),[_,m.sections]),$="all"===g,U=eD.useMemo(()=>m.sections.map((e,i)=>{let r=!$&&!t&&!n;return{container:{"data-sectionindex":i,onClick:F(i)},content:{tabIndex:$||i>0?-1:0,contentEditable:!$&&!t&&!n,role:"spinbutton",id:`${T}-${e.type}`,"aria-labelledby":`${T}-${e.type}`,"aria-readonly":n,"aria-valuenow":((e,t)=>{if(e.value)switch(e.type){case"weekDay":if("letter"===e.contentType)return;return Number(e.value);case"meridiem":{let n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);if(n)return+(t.getHours(n)>=12);return}case"day":return"digit-with-letter"===e.contentType?parseInt(e.value,10):Number(e.value);case"month":{if("digit"===e.contentType)return Number(e.value);let n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return"letter"!==e.contentType?Number(e.value):void 0}})(e,k),"aria-valuemin":G[e.type].minimum,"aria-valuemax":G[e.type].maximum,"aria-valuetext":e.value?((e,t)=>{if(e.value)switch(e.type){case"month":{if("digit"===e.contentType)return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");let n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return"digit"===e.contentType?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;default:return}})(e,k):A.empty,"aria-label":A[e.type],"aria-disabled":t,spellCheck:!r&&void 0,autoCapitalize:r?"off":void 0,autoCorrect:r?"off":void 0,[parseInt(eD.version,10)>=17?"enterKeyHint":"enterkeyhint"]:r?"next":void 0,children:e.value||e.placeholder,onInput:W,onPaste:j,onFocus:V(i),onDragOver:H,onMouseUp:z,inputMode:"letter"===e.contentType?"text":"numeric"},before:{children:e.startSeparator},after:{children:e.endSeparator}}}),[m.sections,V,j,H,W,F,z,t,n,$,A,k,G,T]),q=(0,ZC.A)(e=>{b(e.target.value)}),Y=eD.useMemo(()=>S?"":h.getV7HiddenInputValueFromSections(m.sections),[S,m.sections,h]);return eD.useEffect(()=>{if(null==M.current)throw Error("MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`\nYou probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.\n\nIf you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:\n\n<DatePicker slots={{ textField: MyCustomTextField }} />\n\nLearn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element");c&&M.current&&M.current.getSectionContent(w.startIndex).focus()},[]),{interactions:O,returnedValue:{autoFocus:c,readOnly:n,focused:u??D,sectionListRef:C,onBlur:B,onClick:E,onFocus:N,onInput:R,onPaste:L,enableAccessibleFieldDOMStructure:!0,elements:U,tabIndex:0===g?-1:0,contentEditable:$,value:Y,onChange:q,areAllSectionsEmpty:S}}},Qh=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),Qd=e=>{let t=(0,cA.I)(),n=eD.useRef(void 0),i=eD.useRef(void 0),{forwardedProps:{onFocus:r,onClick:o,onPaste:a,onBlur:s,inputRef:l,placeholder:u},internalProps:{readOnly:c=!1,disabled:h=!1},parsedSelectedSections:d,activeSectionIndex:p,state:f,fieldValueManager:g,valueManager:m,applyCharacterEditing:v,resetCharacterQuery:y,updateSectionValue:x,updateValueFromValueStr:b,clearActiveSection:w,clearValue:S,setTempAndroidValueStr:_,setSelectedSections:M,getSectionsFromValue:C,areAllSectionsEmpty:A,localizedDigits:k}=e,T=eD.useRef(null),D=(0,XP.A)(l,T),I=eD.useMemo(()=>((e,t,n)=>{let i=0,r=+!!n,o=[];for(let a=0;a<e.length;a+=1){let s=e[a],l=Xu(s,n?"input-rtl":"input-ltr",t),u=`${s.startSeparator}${l}${s.endSeparator}`,c=Qh(u).length,h=u.length,d=Qh(l),p=r+(""===d?0:l.indexOf(d[0]))+s.startSeparator.length,f=p+d.length;o.push((0,ou.A)({},s,{start:i,end:i+c,startInInput:p,endInInput:f})),i+=c,r+=h}return o})(f.sections,k,t),[f.sections,k,t]),O=eD.useMemo(()=>({syncSelectionToDOM:()=>{if(!T.current)return;if(null==d){T.current.scrollLeft&&(T.current.scrollLeft=0);return}if(T.current!==KG(document))return;let e=T.current.scrollTop;if("all"===d)T.current.select();else{let e=I[d],t="empty"===e.type?e.startInInput-e.startSeparator.length:e.startInInput,n="empty"===e.type?e.endInInput+e.endSeparator.length:e.endInInput;(t!==T.current.selectionStart||n!==T.current.selectionEnd)&&T.current===KG(document)&&T.current.setSelectionRange(t,n),clearTimeout(i.current),i.current=setTimeout(()=>{T.current&&T.current===KG(document)&&T.current.selectionStart===T.current.selectionEnd&&(T.current.selectionStart!==t||T.current.selectionEnd!==n)&&O.syncSelectionToDOM()})}T.current.scrollTop=e},getActiveSectionIndexFromDOM:()=>{let e=T.current.selectionStart??0,t=T.current.selectionEnd??0;if(0===e&&0===t)return null;let n=e<=I[0].startInInput?1:I.findIndex(t=>t.startInInput-t.startSeparator.length>e);return -1===n?I.length-1:n-1},focusField:(e=0)=>{KG(document)!==T.current&&(T.current?.focus(),M(e))},setSelectedSections:e=>M(e),isFieldFocused:()=>T.current===KG(document)}),[T,d,I,M]),P=()=>{let e,t=T.current.selectionStart??0;M(-1===(e=t<=I[0].startInInput||t>=I[I.length-1].endInInput?1:I.findIndex(e=>e.startInInput-e.startSeparator.length>t))?I.length-1:e-1)},E=(0,ZC.A)((...e)=>{r?.(...e);let t=T.current;clearTimeout(n.current),n.current=setTimeout(()=>{t&&t===T.current&&null==p&&(t.value.length&&Number(t.selectionEnd)-Number(t.selectionStart)===t.value.length?M("all"):P())})}),R=(0,ZC.A)((e,...t)=>{e.isDefaultPrevented()||(o?.(e,...t),P())}),L=(0,ZC.A)(e=>{if(a?.(e),e.preventDefault(),c||h)return;let t=e.clipboardData.getData("text");if("number"==typeof d){let e=f.sections[d],n=/^[a-zA-Z]+$/.test(t),i=/^[0-9]+$/.test(t),r=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(t);if("letter"===e.contentType&&n||"digit"===e.contentType&&i||"digit-with-letter"===e.contentType&&r){y(),x({activeSection:e,newSectionValue:t,shouldGoToNextSection:!0});return}if(n||i)return}y(),b(t)}),N=(0,ZC.A)((...e)=>{s?.(...e),M(null)}),B=(0,ZC.A)(e=>{let n;if(c)return;let i=e.target.value;if(""===i){y(),S();return}let r=e.nativeEvent.data,o=r&&r.length>1,a=o?r:i,s=Qh(a);if("all"===d&&M(p),null==p||o)return void b(o?r:s);if("all"===d&&1===s.length)n=s;else{let e=Qh(g.getV6InputValueFromSections(I,k,t)),i=-1,r=-1;for(let t=0;t<e.length;t+=1)-1===i&&e[t]!==s[t]&&(i=t),-1===r&&e[e.length-t-1]!==s[s.length-t-1]&&(r=t);let o=I[p];if(i<o.start||e.length-r-1>o.end)return;let a=s.length-e.length+o.end-Qh(o.endSeparator||"").length;n=s.slice(o.start+Qh(o.startSeparator||"").length,a)}if(0===n.length){navigator.userAgent.toLowerCase().includes("android")&&_(a),y(),w();return}v({keyPressed:n,sectionIndex:p})}),F=eD.useMemo(()=>void 0!==u?u:g.getV6InputValueFromSections(C(m.emptyValue),k,t),[u,g,C,m.emptyValue,k,t]),z=eD.useMemo(()=>f.tempValueStrAndroid??g.getV6InputValueFromSections(f.sections,k,t),[f.sections,g,f.tempValueStrAndroid,k,t]);return eD.useEffect(()=>(T.current&&T.current===KG(document)&&M("all"),()=>{clearTimeout(n.current),clearTimeout(i.current)}),[]),{interactions:O,returnedValue:{readOnly:c,onBlur:N,onClick:R,onFocus:E,onPaste:L,inputRef:D,enableAccessibleFieldDOMStructure:!1,placeholder:F,inputMode:eD.useMemo(()=>null==p||"letter"===f.sections[p].contentType?"text":"numeric",[p,f.sections]),autoComplete:"off",value:!(T.current&&T.current===KG(document))&&A?"":z,onChange:B}}},Qp=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],Qf=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],Qg=["minDateTime","maxDateTime"];[...Qp,...Qf,...Qg];let Qm=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],Qv=["clearable","onClear","InputProps","sx","slots","slotProps"],Qy=["ownerState"];var Qx=n(54227),Qb=n(75472);function Qw(e){return(0,ux.Ay)("MuiPickersTextField",e)}(0,uy.A)("MuiPickersTextField",["root","focused","disabled","error","required"]);var QS=n(42872);function Q_(e){return(0,ux.Ay)("MuiPickersInputBase",e)}let QM=(0,uy.A)("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function QC(e){return(0,ux.Ay)("MuiPickersOutlinedInput",e)}let QA=(0,ou.A)({},QM,(0,uy.A)("MuiPickersOutlinedInput",["root","notchedOutline","input"])),Qk=["children","className","label","notched","shrink"],QT=(0,e7.A)("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),QD=(0,e7.A)("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),QI=(0,e7.A)("legend")(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function QO(e){let{className:t,label:n}=e,i=(0,Gq.A)(e,Qk),r=null!=n&&""!==n,o=(0,ou.A)({},e,{withLabel:r});return(0,eb.jsx)(QT,(0,ou.A)({"aria-hidden":!0,className:t},i,{ownerState:o,children:(0,eb.jsx)(QI,{ownerState:o,children:r?(0,eb.jsx)(QD,{children:n}):(0,eb.jsx)(QD,{className:"notranslate",children:"​"})})}))}var QP=n(85235);function QE(e){return(0,ux.Ay)("MuiPickersSectionList",e)}let QR=(0,uy.A)("MuiPickersSectionList",["root","section","sectionContent"]),QL=["slots","slotProps","elements","sectionListRef"],QN=(0,e7.A)("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),QB=(0,e7.A)("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),QF=(0,e7.A)("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),Qz=(0,e7.A)("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"});function QV(e){let{slots:t,slotProps:n,element:i,classes:r}=e,o=t?.section??QB,a=(0,Zm.A)({elementType:o,externalSlotProps:n?.section,externalForwardedProps:i.container,className:r.section,ownerState:{}}),s=t?.sectionContent??Qz,l=(0,Zm.A)({elementType:s,externalSlotProps:n?.sectionContent,externalForwardedProps:i.content,additionalProps:{suppressContentEditableWarning:!0},className:r.sectionContent,ownerState:{}}),u=t?.sectionSeparator??QF,c=(0,Zm.A)({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:i.before,ownerState:{position:"before"}}),h=(0,Zm.A)({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:i.after,ownerState:{position:"after"}});return(0,eb.jsxs)(o,(0,ou.A)({},a,{children:[(0,eb.jsx)(u,(0,ou.A)({},c)),(0,eb.jsx)(s,(0,ou.A)({},l)),(0,eb.jsx)(u,(0,ou.A)({},h))]}))}let Qj=eD.forwardRef(function(e,t){let n=Yb({props:e,name:"MuiPickersSectionList"}),{slots:i,slotProps:r,elements:o,sectionListRef:a}=n,s=(0,Gq.A)(n,QL),l=(e=>{let{classes:t}=e;return(0,uu.A)({root:["root"],section:["section"],sectionContent:["sectionContent"]},QE,t)})(n),u=eD.useRef(null),c=(0,XP.A)(t,u),h=e=>{if(!u.current)throw Error(`MUI X: Cannot call sectionListRef.${e} before the mount of the component.`);return u.current};eD.useImperativeHandle(a,()=>({getRoot:()=>h("getRoot"),getSectionContainer:e=>h("getSectionContainer").querySelector(`.${QR.section}[data-sectionindex="${e}"]`),getSectionContent:e=>h("getSectionContent").querySelector(`.${QR.section}[data-sectionindex="${e}"] .${QR.sectionContent}`),getSectionIndexFromDOMElement(e){let t=h("getSectionIndexFromDOMElement");if(null==e||!t.contains(e))return null;let n=null;return(e.classList.contains(QR.section)?n=e:e.classList.contains(QR.sectionContent)&&(n=e.parentElement),null==n)?null:Number(n.dataset.sectionindex)}}));let d=i?.root??QN,p=(0,Zm.A)({elementType:d,externalSlotProps:r?.root,externalForwardedProps:s,additionalProps:{ref:c,suppressContentEditableWarning:!0},className:l.root,ownerState:{}});return(0,eb.jsx)(d,(0,ou.A)({},p,{children:p.contentEditable?o.map(({content:e,before:t,after:n})=>`${t.children}${e.children}${n.children}`).join(""):(0,eb.jsx)(eD.Fragment,{children:o.map((e,t)=>(0,eb.jsx)(QV,{slots:i,slotProps:r,element:e,classes:l},t))})}))}),QH=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],QW=(0,e7.A)("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>(0,ou.A)({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${Math.round(.15/16*1e5)/1e5}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),QG=(0,e7.A)(QN,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:e,focused:t,filled:n,label:i})=>!e&&!t&&!n&&null==i,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:"light"===e.palette.mode?.42:.5}}]})),Q$=(0,e7.A)(QB,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(e,t)=>t.section})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),QU=(0,e7.A)(Qz,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),Qq=(0,e7.A)(QF,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),QY=(0,e7.A)("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})((0,ou.A)({},{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"})),QZ=eD.forwardRef(function(e,t){let n=Yb({props:e,name:"MuiPickersInputBase"}),{elements:i,areAllSectionsEmpty:r,value:o,onChange:a,id:s,endAdornment:l,startAdornment:u,renderSuffix:c,slots:h,slotProps:d,contentEditable:p,tabIndex:f,onInput:g,onPaste:m,onKeyDown:v,name:y,readOnly:x,inputProps:b,inputRef:w,sectionListRef:S}=n,_=(0,Gq.A)(n,QH),M=eD.useRef(null),C=(0,XP.A)(t,M),A=(0,XP.A)(b?.ref,w),k=(0,cA.I)(),T=(0,QS.A)();if(!T)throw Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");eD.useEffect(()=>{T&&T.setAdornedStart(!!u)},[T,u]),eD.useEffect(()=>{T&&(r?T.onEmpty():T.onFilled())},[T,r]);let D=(0,ou.A)({},n,T,{isRtl:k}),I=(e=>{let{focused:t,disabled:n,error:i,classes:r,fullWidth:o,readOnly:a,color:s,size:l,endAdornment:u,startAdornment:c}=e,h={root:["root",t&&!n&&"focused",n&&"disabled",a&&"readOnly",i&&"error",o&&"fullWidth",`color${(0,QP.A)(s)}`,"small"===l&&"inputSizeSmall",!!c&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return(0,uu.A)(h,Q_,r)})(D),O=h?.root||QW,P=(0,Zm.A)({elementType:O,externalSlotProps:d?.root,externalForwardedProps:_,additionalProps:{"aria-invalid":T.error,ref:C},className:I.root,ownerState:D}),E=h?.input||QG;return(0,eb.jsxs)(O,(0,ou.A)({},P,{children:[u,(0,eb.jsx)(Qj,{sectionListRef:S,elements:i,contentEditable:p,tabIndex:f,className:I.sectionsContainer,onFocus:e=>{T.disabled?e.stopPropagation():T.onFocus?.(e)},onBlur:T.onBlur,onInput:g,onPaste:m,onKeyDown:v,slots:{root:E,section:Q$,sectionContent:QU,sectionSeparator:Qq},slotProps:{root:{ownerState:D},sectionContent:{className:QM.sectionContent},sectionSeparator:({position:e})=>({className:"before"===e?QM.sectionBefore:QM.sectionAfter})}}),l,c?c((0,ou.A)({},T)):null,(0,eb.jsx)(QY,(0,ou.A)({name:y,className:I.input,value:o,onChange:a,id:s,"aria-hidden":"true",tabIndex:-1,readOnly:x,required:T.required,disabled:T.disabled},b,{ref:A}))]}))}),QX=["label","autoFocus","ownerState","notched"],QK=(0,e7.A)(QW,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${QA.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${QA.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${QA.focused} .${QA.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${QA.disabled}`]:{[`& .${QA.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${QA.error} .${QA.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t]?.main??!1).map(t=>({props:{color:t},style:{[`&.${QA.focused}:not(.${QA.error}) .${QA.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}}))}}),QQ=(0,e7.A)(QG,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),QJ=eD.forwardRef(function(e,t){let n=Yb({props:e,name:"MuiPickersOutlinedInput"}),{label:i,ownerState:r,notched:o}=n,a=(0,Gq.A)(n,QX),s=(0,QS.A)(),l=(0,ou.A)({},n,r,s,{color:s?.color||"primary"}),u=(e=>{let{classes:t}=e,n=(0,uu.A)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},QC,t);return(0,ou.A)({},t,n)})(l);return(0,eb.jsx)(QZ,(0,ou.A)({slots:{root:QK,input:QQ},renderSuffix:e=>(0,eb.jsx)(QO,{shrink:!!(o||e.adornedStart||e.focused||e.filled),notched:!!(o||e.adornedStart||e.focused||e.filled),className:u.notchedOutline,label:null!=i&&""!==i&&s?.required?(0,eb.jsxs)(eD.Fragment,{children:[i," ","*"]}):i,ownerState:l})},a,{label:i,classes:u,ref:t}))});QJ.muiName="Input";var Q0=n(57867);function Q1(e){return(0,ux.Ay)("MuiPickersFilledInput",e)}let Q2=(0,ou.A)({},QM,(0,uy.A)("MuiPickersFilledInput",["root","underline","input"])),Q5=["label","autoFocus","disableUnderline","ownerState"],Q3=(0,e7.A)(QW,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>(0,Q0.MC)(e)&&"disableUnderline"!==e})(({theme:e})=>{let t="light"===e.palette.mode,n=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n}},[`&.${Q2.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n},[`&.${Q2.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{color:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t]?.main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Q2.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Q2.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)"}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Q2.disabled}, .${Q2.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Q2.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:12}},{props:({endAdornment:e})=>!!e,style:{paddingRight:12}}]}}),Q4=(0,e7.A)(QG,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:0}},{props:({endAdornment:e})=>!!e,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),Q6=eD.forwardRef(function(e,t){let n=Yb({props:e,name:"MuiPickersFilledInput"}),{label:i,disableUnderline:r=!1,ownerState:o}=n,a=(0,Gq.A)(n,Q5),s=(0,QS.A)(),l=(e=>{let{classes:t,disableUnderline:n}=e,i=(0,uu.A)({root:["root",!n&&"underline"],input:["input"]},Q1,t);return(0,ou.A)({},t,i)})((0,ou.A)({},n,o,s,{color:s?.color||"primary"}));return(0,eb.jsx)(QZ,(0,ou.A)({slots:{root:Q3,input:Q4},slotProps:{root:{disableUnderline:r}}},a,{label:i,classes:l,ref:t}))});function Q8(e){return(0,ux.Ay)("MuiPickersFilledInput",e)}Q6.muiName="Input";let Q9=(0,ou.A)({},QM,(0,uy.A)("MuiPickersInput",["root","input"])),Q7=["label","autoFocus","disableUnderline","ownerState"],Je=(0,e7.A)(QW,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{color:t},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Q9.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Q9.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Q9.disabled}, .${Q9.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${Q9.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),Jt=eD.forwardRef(function(e,t){let n=Yb({props:e,name:"MuiPickersInput"}),{label:i,disableUnderline:r=!1,ownerState:o}=n,a=(0,Gq.A)(n,Q7),s=(0,QS.A)(),l=(e=>{let{classes:t,disableUnderline:n}=e,i=(0,uu.A)({root:["root",!n&&"underline"],input:["input"]},Q8,t);return(0,ou.A)({},t,i)})((0,ou.A)({},n,o,s,{disableUnderline:r,color:s?.color||"primary"}));return(0,eb.jsx)(QZ,(0,ou.A)({slots:{root:Je}},a,{label:i,classes:l,ref:t}))});Jt.muiName="Input";let Jn=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],Ji={standard:Jt,filled:Q6,outlined:QJ},Jr=(0,e7.A)(hZ.A,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),Jo=eD.forwardRef(function(e,t){let n=Yb({props:e,name:"MuiPickersTextField"}),{onFocus:i,onBlur:r,className:o,color:a="primary",disabled:s=!1,error:l=!1,variant:u="outlined",required:c=!1,InputProps:h,inputProps:d,inputRef:p,sectionListRef:f,elements:g,areAllSectionsEmpty:m,onClick:v,onKeyDown:y,onKeyUp:x,onPaste:b,onInput:w,endAdornment:S,startAdornment:_,tabIndex:M,contentEditable:C,focused:A,value:k,onChange:T,fullWidth:D,id:I,name:O,helperText:P,FormHelperTextProps:E,label:R,InputLabelProps:L}=n,N=(0,Gq.A)(n,Jn),B=eD.useRef(null),F=(0,XP.A)(t,B),z=(0,Zg.A)(I),V=P&&z?`${z}-helper-text`:void 0,j=R&&z?`${z}-label`:void 0,H=(0,ou.A)({},n,{color:a,disabled:s,error:l,focused:A,required:c,variant:u}),W=(e=>{let{focused:t,disabled:n,classes:i,required:r}=e;return(0,uu.A)({root:["root",t&&!n&&"focused",n&&"disabled",r&&"required"]},Qw,i)})(H),G=Ji[u];return(0,eb.jsxs)(Jr,(0,ou.A)({className:(0,ul.A)(W.root,o),ref:F,focused:A,onFocus:i,onBlur:r,disabled:s,variant:u,error:l,color:a,fullWidth:D,required:c,ownerState:H},N,{children:[(0,eb.jsx)(Qx.A,(0,ou.A)({htmlFor:z,id:j},L,{children:R})),(0,eb.jsx)(G,(0,ou.A)({elements:g,areAllSectionsEmpty:m,onClick:v,onKeyDown:y,onKeyUp:x,onInput:w,onPaste:b,endAdornment:S,startAdornment:_,tabIndex:M,contentEditable:C,value:k,onChange:T,id:z,fullWidth:D,inputProps:d,inputRef:p,sectionListRef:f,label:R,name:O,role:"group","aria-labelledby":j,"aria-describedby":V,"aria-live":V?"polite":void 0},h)),P&&(0,eb.jsx)(Qb.A,(0,ou.A)({id:V},E,{children:P}))]}))}),Ja=["enableAccessibleFieldDOMStructure"],Js=["InputProps","readOnly"],Jl=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],Ju=["slots","slotProps","InputProps","inputProps"],Jc=eD.forwardRef(function(e,t){let n=Yb({props:e,name:"MuiDateTimeField"}),{slots:i,slotProps:r,InputProps:o,inputProps:a}=n,s=(0,Gq.A)(n,Ju),l=i?.textField??(e.enableAccessibleFieldDOMStructure?Jo:eA.A),u=(0,Zm.A)({elementType:l,externalSlotProps:r?.textField,externalForwardedProps:s,ownerState:n,additionalProps:{ref:t}});u.inputProps=(0,ou.A)({},a,u.inputProps),u.InputProps=(0,ou.A)({},o,u.InputProps);let c=(e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=(0,Gq.A)(e,Ja);if(t){let{InputProps:e,readOnly:t}=n,i=(0,Gq.A)(n,Js);return(0,ou.A)({},i,{InputProps:(0,ou.A)({},e??{},{readOnly:t})})}let{onPaste:i,onKeyDown:r,inputMode:o,readOnly:a,InputProps:s,inputProps:l,inputRef:u}=n,c=(0,Gq.A)(n,Jl);return(0,ou.A)({},c,{InputProps:(0,ou.A)({},s??{},{readOnly:a}),inputProps:(0,ou.A)({},l??{},{inputMode:o,onPaste:i,onKeyDown:r,ref:u})})})((e=>{let t,n,i,r,o,{forwardedProps:a,internalProps:s}=(t=Yk().utils,n=Yk().defaultDates,i=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.keyboardDateTime12h:t.formats.keyboardDateTime24h,r=(0,ou.A)({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??i,disableIgnoringDatePartForTimeValidation:!!(e.minDateTime||e.maxDateTime),minDate:YO(t,e.minDateTime??e.minDate,n.minDate),maxDate:YO(t,e.maxDateTime??e.maxDate,n.maxDate),minTime:e.minDateTime??e.minTime,maxTime:e.maxDateTime??e.maxTime}),o="date-time",eD.useMemo(()=>{let e=(0,ou.A)({},r),t={},n=n=>{e.hasOwnProperty(n)&&(t[n]=e[n],delete e[n])};return Qm.forEach(n),Qp.forEach(n),Qf.forEach(n),Qg.forEach(n),{forwardedProps:e,internalProps:t}},[r,o]));return(e=>{let t=Yk().utils,{internalProps:n,internalProps:{unstableFieldRef:i,minutesStep:r,enableAccessibleFieldDOMStructure:o=!1,disabled:a=!1,readOnly:s=!1},forwardedProps:{onKeyDown:l,error:u,clearable:c,onClear:h},fieldValueManager:d,valueManager:p,validator:f}=e,g=(0,cA.I)(),m=(e=>{let t=Yk().utils,n=Yk().localeText,i=Yk(),r=(0,cA.I)(),{valueManager:o,fieldValueManager:a,valueType:s,validator:l,internalProps:u,internalProps:{value:c,defaultValue:h,referenceDate:d,onChange:p,format:f,formatDensity:g="dense",selectedSections:m,onSelectedSectionsChange:v,shouldRespectLeadingZeros:y=!1,timezone:x,enableAccessibleFieldDOMStructure:b=!1}}=e,{timezone:w,value:S,handleValueChange:_}=Z6({timezone:x,value:c,defaultValue:h,referenceDate:d,onChange:p,valueManager:o}),M=eD.useMemo(()=>{let e;return e=t.date(void 0),"0"===t.formatByString(t.setSeconds(e,0),"s")?Xi:Array.from({length:10}).map((n,i)=>t.formatByString(t.setSeconds(e,i),"s"))},[t]),C=eD.useMemo(()=>((e,t,n)=>{let i=e.date(void 0,n),r=e.endOfYear(i),o=e.endOfDay(i),{maxDaysInMonth:a,longestMonth:s}=YP(e,i).reduce((t,n)=>{let i=e.getDaysInMonth(n);return i>t.maxDaysInMonth?{maxDaysInMonth:i,longestMonth:n}:t},{maxDaysInMonth:0,longestMonth:null});return{year:({format:t})=>({minimum:0,maximum:4===e.formatByString(e.date(void 0,"system"),t).length?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(r)+1}),day:({currentDate:t})=>({minimum:1,maximum:null!=t&&e.isValid(t)?e.getDaysInMonth(t):a,longestMonth:s}),weekDay:({format:t,contentType:n})=>{if("digit"===n){let n=Xt(e,t).map(Number);return{minimum:Math.min(...n),maximum:Math.max(...n)}}return{minimum:1,maximum:7}},hours:({format:n})=>{let r=e.getHours(o);return Xr(e.formatByString(e.endOfDay(i),n),t)!==r.toString()?{minimum:1,maximum:Number(Xr(e.formatByString(e.startOfDay(i),n),t))}:{minimum:0,maximum:r}},minutes:()=>({minimum:0,maximum:e.getMinutes(o)}),seconds:()=>({minimum:0,maximum:e.getSeconds(o)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}})(t,M,w),[t,M,w]),A=eD.useCallback((e,i=null)=>a.getSectionsFromValue(t,e,i,e=>Qu({utils:t,localeText:n,localizedDigits:M,format:f,date:e,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:r})),[a,f,n,M,r,y,t,g,b]),[k,T]=eD.useState(()=>{let e=A(S);Xd(e,s);let n={sections:e,value:S,referenceValue:o.emptyValue,tempValueStrAndroid:null},i=Math.max(...e.map(e=>Z9[e.type]??1)),r=o.getInitialReferenceValue({referenceDate:d,value:S,utils:t,props:u,granularity:i,timezone:w});return(0,ou.A)({},n,{referenceValue:r})}),[D,I]=(0,ZA.A)({controlled:m,default:null,name:"useField",state:"selectedSections"}),O=e=>{I(e),v?.(e)},P=eD.useMemo(()=>Xg(D,k.sections),[D,k.sections]),E="all"===P?0:P,R=({value:e,referenceValue:n,sections:r})=>{if(T(t=>(0,ou.A)({},t,{sections:r,value:e,referenceValue:n,tempValueStrAndroid:null})),o.areValuesEqual(t,k.value,e))return;let a={validationError:l({adapter:i,value:e,timezone:w,props:u})};_(e,a)},L=(e,t)=>{let n=[...k.sections];return n[e]=(0,ou.A)({},n[e],{value:t,modified:!0}),n};return eD.useEffect(()=>{let e=A(k.value);Xd(e,s),T(t=>(0,ou.A)({},t,{sections:e}))},[f,t.locale,r]),eD.useEffect(()=>{o.areValuesEqual(t,k.value,S)&&o.getTimezone(t,k.value)===o.getTimezone(t,S)||T(e=>(0,ou.A)({},e,{value:S,referenceValue:a.updateReferenceValue(t,S,e.referenceValue),sections:A(S)}))},[S]),{state:k,activeSectionIndex:E,parsedSelectedSections:P,setSelectedSections:O,clearValue:()=>{R({value:o.emptyValue,referenceValue:k.referenceValue,sections:A(o.emptyValue)})},clearActiveSection:()=>{if(null==E)return;let e=k.sections[E],n=a.getActiveDateManager(t,k,e),i=n.getSections(k.sections).filter(e=>""!==e.value).length===+(""!==e.value),r=L(E,""),o=i?null:t.getInvalidDate(),s=n.getNewValuesFromNewActiveDate(o);R((0,ou.A)({},s,{sections:r}))},updateSectionValue:({activeSection:e,newSectionValue:n,shouldGoToNextSection:i})=>{let r,o;i&&E<k.sections.length-1&&O(E+1);let s=a.getActiveDateManager(t,k,e),l=L(E,n),u=s.getSections(l),c=((e,t,n)=>{let i=t.some(e=>"day"===e.type),r=[],o=[];for(let e=0;e<t.length;e+=1){let a=t[e];i&&"weekDay"===a.type||(r.push(a.format),o.push(Xu(a,"non-input",n)))}let a=r.join(" "),s=o.join(" ");return e.parse(s,a)})(t,u,M);if(null!=c&&t.isValid(c)){let e=Xf(t,c,u,s.referenceDate,!0);r=s.getNewValuesFromNewActiveDate(e),o=!0}else r=s.getNewValuesFromNewActiveDate(c),o=(null!=c&&!t.isValid(c))!=(null!=s.date&&!t.isValid(s.date));return o?R((0,ou.A)({},r,{sections:l})):T(e=>(0,ou.A)({},e,r,{sections:l,tempValueStrAndroid:null}))},updateValueFromValueStr:e=>{let i=a.parseValueStr(e,k.referenceValue,(e,i)=>{let o=t.parse(e,f);if(null==o||!t.isValid(o))return null;let a=Qu({utils:t,localeText:n,localizedDigits:M,format:f,date:o,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:r});return Xf(t,o,a,i,!1)}),o=a.updateReferenceValue(t,i,k.referenceValue);R({value:i,referenceValue:o,sections:A(i,k.sections)})},setTempAndroidValueStr:e=>T(t=>(0,ou.A)({},t,{tempValueStrAndroid:e})),getSectionsFromValue:A,sectionsValueBoundaries:C,localizedDigits:M,timezone:w}})(e),{state:v,activeSectionIndex:y,parsedSelectedSections:x,setSelectedSections:b,clearValue:w,clearActiveSection:S,updateSectionValue:_,setTempAndroidValueStr:M,sectionsValueBoundaries:C,localizedDigits:A,timezone:k}=m,T=(({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:i,setTempAndroidValueStr:r,timezone:o})=>{let a=Yk().utils,[s,l]=eD.useState(null),u=(0,ZC.A)(()=>l(null));eD.useEffect(()=>{null!=s&&e[s.sectionIndex]?.type!==s.sectionType&&u()},[e,s,u]),eD.useEffect(()=>{if(null!=s){let e=setTimeout(()=>u(),5e3);return()=>{clearTimeout(e)}}return()=>{}},[s,u]);let c=({keyPressed:t,sectionIndex:n},i,r)=>{let o=t.toLowerCase(),a=e[n];if(null!=s&&(!r||r(s.value))&&s.sectionIndex===n){let e=`${s.value}${o}`,t=i(e,a);if(null==t.saveQuery)return l({sectionIndex:n,value:e,sectionType:a.type}),t}let c=i(o,a);return null==c.saveQuery||c.saveQuery?(l({sectionIndex:n,value:o,sectionType:a.type}),null!=c.saveQuery?null:c):(u(),null)};return{applyCharacterEditing:(0,ZC.A)(s=>{var l;let u,h,d,p=e[s.sectionIndex],f=Xa(s.keyPressed,i)?(l=(0,ou.A)({},s,{keyPressed:Xo(s.keyPressed,i)}),u=(e,t)=>{let r=Xr(e,i),o=Number(r),s=n[t.type]({currentDate:null,format:t.format,contentType:t.contentType});if(o>s.maximum)return{saveQuery:!1};if(o<s.minimum)return{saveQuery:!0};let l=10*o>s.maximum||r.length===s.maximum.toString().length;return{sectionValue:Xl(a,o,s,i,t),shouldGoToNextSection:l}},c(l,(e,t)=>{if("digit"===t.contentType||"digit-with-letter"===t.contentType)return u(e,t);if("month"===t.type){let n=Xh(a,"digit","month","MM"),i=u(e,{type:t.type,format:"MM",hasLeadingZerosInFormat:n,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(null!=i.saveQuery)return i;let r=Xc(a,i.sectionValue,"MM",t.format);return(0,ou.A)({},i,{sectionValue:r})}if("weekDay"===t.type){let n=u(e,t);if(null!=n.saveQuery)return n;let i=Xt(a,t.format)[Number(n.sectionValue)-1];return(0,ou.A)({},n,{sectionValue:i})}return{saveQuery:!1}},e=>Xa(e,i))):(h=(e,t,n)=>{let i=t.filter(e=>e.toLowerCase().startsWith(n));return 0===i.length?{saveQuery:!1}:{sectionValue:i[0],shouldGoToNextSection:1===i.length}},d=(e,t,n,i)=>{let r=e=>Xn(a,o,t.type,e);if("letter"===t.contentType)return h(t.format,r(t.format),e);if(n&&null!=i&&"letter"===Xe(a,n).contentType){let t=r(n),o=h(n,t,e);return null!=o.saveQuery?{saveQuery:!1}:(0,ou.A)({},o,{sectionValue:i(o.sectionValue,t)})}return{saveQuery:!1}},c(s,(e,t)=>{switch(t.type){case"month":return d(e,t,a.formats.month,e=>Xc(a,e,a.formats.month,t.format));case"weekDay":return d(e,t,a.formats.weekday,(e,t)=>t.indexOf(e).toString());case"meridiem":return d(e,t);default:return{saveQuery:!1}}}));null==f?r(null):t({activeSection:p,newSectionValue:f.sectionValue,shouldGoToNextSection:f.shouldGoToNextSection})}),resetCharacterQuery:u}})({sections:v.sections,updateSectionValue:_,sectionsValueBoundaries:C,localizedDigits:A,setTempAndroidValueStr:M,timezone:k}),{resetCharacterQuery:D}=T,I=p.areValuesEqual(t,v.value,p.emptyValue),O=o?Qc:Qd,P=eD.useMemo(()=>((e,t)=>{let n={};if(!t)return e.forEach((t,i)=>{let r=i===e.length-1?null:i+1;n[i]={leftIndex:0===i?null:i-1,rightIndex:r}}),{neighbors:n,startIndex:0,endIndex:e.length-1};let i={},r={},o=0,a=0,s=e.length-1;for(;s>=0;){-1===(a=e.findIndex((e,t)=>t>=o&&e.endSeparator?.includes(" ")&&" / "!==e.endSeparator))&&(a=e.length-1);for(let e=a;e>=o;e-=1)r[e]=s,i[s]=e,s-=1;o=a+1}return e.forEach((t,o)=>{let a=r[o],s=0===a?null:i[a-1],l=a===e.length-1?null:i[a+1];n[o]={leftIndex:s,rightIndex:l}}),{neighbors:n,startIndex:i[0],endIndex:i[e.length-1]}})(v.sections,g&&!o),[v.sections,g,o]),{returnedValue:E,interactions:R}=O((0,ou.A)({},e,m,T,{areAllSectionsEmpty:I,sectionOrder:P})),L=(0,ZC.A)(e=>{if(l?.(e),!a)switch(!0){case(e.ctrlKey||e.metaKey)&&"A"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey:e.preventDefault(),b("all");break;case"ArrowRight"===e.key:if(e.preventDefault(),null==x)b(P.startIndex);else if("all"===x)b(P.endIndex);else{let e=P.neighbors[x].rightIndex;null!==e&&b(e)}break;case"ArrowLeft"===e.key:if(e.preventDefault(),null==x)b(P.endIndex);else if("all"===x)b(P.startIndex);else{let e=P.neighbors[x].leftIndex;null!==e&&b(e)}break;case"Delete"===e.key:if(e.preventDefault(),s)break;null==x||"all"===x?w():S(),D();break;case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(e.key):{if(e.preventDefault(),s||null==y)break;"all"===x&&b(y);let n=v.sections[y],i=d.getActiveDateManager(t,v,n),o=((e,t,n,i,r,o,a,s)=>{let l=(e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return -1;case"PageUp":return 5;case"PageDown":return -5;default:return 0}})(i),u="Home"===i,c="End"===i,h=""===n.value||u||c;if("digit"===n.contentType||"digit-with-letter"===n.contentType){let i,d=r[n.type]({currentDate:a,format:n.format,contentType:n.contentType}),p="minutes"===n.type&&s?.minutesStep?s.minutesStep:1;if(h){if("year"===n.type&&!c&&!u)return e.formatByString(e.date(void 0,t),n.format);i=l>0||u?d.minimum:d.maximum}else i=parseInt(Xr(n.value,o),10)+l*p;return(i%p!=0&&((l<0||u)&&(i+=p-(p+i)%p),(l>0||c)&&(i-=i%p)),i>d.maximum)?Xl(e,d.minimum+(i-d.maximum-1)%(d.maximum-d.minimum+1),d,o,n):i<d.minimum?Xl(e,d.maximum-(d.minimum-i-1)%(d.maximum-d.minimum+1),d,o,n):Xl(e,i,d,o,n)}let d=Xn(e,t,n.type,n.format);if(0===d.length)return n.value;if(h)return l>0||u?d[0]:d[d.length-1];let p=((d.indexOf(n.value)+l)%d.length+d.length)%d.length;return d[p]})(t,k,n,e.key,C,A,i.date,{minutesStep:r});_({activeSection:n,newSectionValue:o,shouldGoToNextSection:!1})}}});(0,ZI.A)(()=>{R.syncSelectionToDOM()});let{hasValidationError:N}=KH({props:n,validator:f,timezone:k,value:v.value,onError:n.onError}),B=eD.useMemo(()=>void 0!==u?u:N,[N,u]);eD.useEffect(()=>{B||null!=y||D()},[v.referenceValue,y,B]),eD.useEffect(()=>{null!=v.tempValueStrAndroid&&null!=y&&(D(),S())},[v.sections]),eD.useImperativeHandle(i,()=>({getSections:()=>v.sections,getActiveSectionIndex:R.getActiveSectionIndexFromDOM,setSelectedSections:R.setSelectedSections,focusField:R.focusField,isFieldFocused:R.isFieldFocused}));let F={onKeyDown:L,onClear:(0,ZC.A)((e,...t)=>{e.preventDefault(),h?.(e,...t),w(),R.isFieldFocused()?b(P.startIndex):R.focusField(0)}),error:B,clearable:!!(c&&!I&&!s&&!a)};return(0,ou.A)({},e.forwardedProps,F,{disabled:a,readOnly:s},E)})({forwardedProps:a,internalProps:s,valueManager:Xv,fieldValueManager:Xy,validator:Qa,valueType:"date-time"})})(u)),h=(e=>{let t=Yk().localeText,{clearable:n,onClear:i,InputProps:r,sx:o,slots:a,slotProps:s}=e,l=(0,Gq.A)(e,Qv),u=a?.clearButton??eC.A,c=(0,Zm.A)({elementType:u,externalSlotProps:s?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),h=(0,Gq.A)(c,Qy),d=a?.clearIcon??Y$,p=(0,Zm.A)({elementType:d,externalSlotProps:s?.clearIcon,ownerState:{}});return(0,ou.A)({},l,{InputProps:(0,ou.A)({},r,{endAdornment:(0,eb.jsxs)(eD.Fragment,{children:[n&&(0,eb.jsx)(hf.A,{position:"end",sx:{marginRight:r?.endAdornment?-1:-1.5},children:(0,eb.jsx)(u,(0,ou.A)({},h,{onClick:i,children:(0,eb.jsx)(d,(0,ou.A)({fontSize:"small"},p))}))}),r?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(o)?o:[o]]})})((0,ou.A)({},c,{slots:i,slotProps:r}));return(0,eb.jsx)(l,(0,ou.A)({},h))});var Jh=n(65130),Jd=n(43628),Jp=n(47196),Jf=n(54266),Jg=n(54708),Jm=n(38086),Jv=n(16299),Jy=n(85910),Jx=n(44766),Jb=n(65043),Jw=n(72710),JS=n(96962),J_=n(47918),JM=n(54354),JC=n(8151),JA=n(91733),Jk=n(99042),JT=n(89321),JD=n(51148),JI=n(55578),JO=n(18463),JP=n(54752),JE=n(36163),JR=n(28850),JL=n(45350),JN=n(67619),JB=n(39270),JF=n(56756),Jz=n(268),JV=n(12282),Jj=n(41042),JH=n(38267),JW=n(47025),JG=n(30118),J$=n(84253),JU=n(98608),Jq=n(8643),JY=n(18109),JZ=n(19681),JX=n(73206),JK=n(53819),JQ=n(96058),JJ=n(682),J0=n(67671);let J1={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"},c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},J2={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class J5{constructor(e){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=J1,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=e=>void 0===e?new Date:null===e?null:new Date(e),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=e=>e,this.toJsDate=e=>e,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=e=>e.match(/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,this.longFormatters[t])(e,this.locale.formatLong):e}).join(""),this.formatNumber=e=>e,this.getDayOfWeek=e=>e.getDay()+1;const{locale:t,formats:n,longFormatters:i,lib:r}=e;this.locale=t,this.formats=(0,ou.A)({},J2,n),this.longFormatters=i,this.lib=r||"date-fns"}}class J3 extends J5{constructor({locale:e,formats:t}={}){super({locale:e??J0.c,formats:t,longFormatters:Jw.m}),this.parse=(e,t)=>""===e?null:(0,JV.qg)(e,t,new Date,{locale:this.locale}),this.isValid=e=>null!=e&&(0,Jz.f)(e),this.format=(e,t)=>this.formatByString(e,this.formats[t]),this.formatByString=(e,t)=>(0,JS.GP)(e,t,{locale:this.locale}),this.isEqual=(e,t)=>null===e&&null===t||null!==e&&null!==t&&(0,JR.n)(e,t),this.isSameYear=(e,t)=>(0,JN.s)(e,t),this.isSameMonth=(e,t)=>(0,JB.t)(e,t),this.isSameDay=(e,t)=>(0,JL.r)(e,t),this.isSameHour=(e,t)=>(0,JF.l)(e,t),this.isAfter=(e,t)=>(0,JP.d)(e,t),this.isAfterYear=(e,t)=>(0,JP.d)(e,(0,Jb.Q)(t)),this.isAfterDay=(e,t)=>(0,JP.d)(e,(0,Jy.D)(t)),this.isBefore=(e,t)=>(0,JE.Y)(e,t),this.isBeforeYear=(e,t)=>(0,JE.Y)(e,this.startOfYear(t)),this.isBeforeDay=(e,t)=>(0,JE.Y)(e,this.startOfDay(t)),this.isWithinRange=(e,[t,n])=>(0,JJ.v)(e,{start:t,end:n}),this.startOfYear=e=>(0,JQ.D)(e),this.startOfMonth=e=>(0,JZ.w)(e),this.startOfWeek=e=>(0,JK.k)(e,{locale:this.locale}),this.startOfDay=e=>(0,JY.o)(e),this.endOfYear=e=>(0,Jb.Q)(e),this.endOfMonth=e=>(0,JX.p)(e),this.endOfWeek=e=>(0,Jx.$)(e,{locale:this.locale}),this.endOfDay=e=>(0,Jy.D)(e),this.addYears=(e,t)=>(0,Jv.e)(e,t),this.addMonths=(e,t)=>(0,Jm.P)(e,t),this.addWeeks=(e,t)=>(0,Jg.J)(e,t),this.addDays=(e,t)=>(0,Jh.f)(e,t),this.addHours=(e,t)=>(0,Jf.L)(e,t),this.addMinutes=(e,t)=>(0,Jp.z)(e,t),this.addSeconds=(e,t)=>(0,Jd.p)(e,t),this.getYear=e=>(0,JO.C)(e),this.getMonth=e=>(0,Jk.t)(e),this.getDate=e=>(0,J_.p)(e),this.getHours=e=>(0,JC.q)(e),this.getMinutes=e=>(0,JA.O)(e),this.getSeconds=e=>(0,JT.S)(e),this.getMilliseconds=e=>(0,JD.D)(e),this.setYear=(e,t)=>(0,Jq.i)(e,t),this.setMonth=(e,t)=>(0,JG.Z)(e,t),this.setDate=(e,t)=>(0,Jj.X)(e,t),this.setHours=(e,t)=>(0,JH.a)(e,t),this.setMinutes=(e,t)=>(0,JW.g)(e,t),this.setSeconds=(e,t)=>(0,J$.g)(e,t),this.setMilliseconds=(e,t)=>(0,JU.$)(e,t),this.getDaysInMonth=e=>(0,JM.P)(e),this.getWeekArray=e=>{let t=this.startOfWeek(this.startOfMonth(e)),n=this.endOfWeek(this.endOfMonth(e)),i=0,r=t,o=[];for(;this.isBefore(r,n);){let e=Math.floor(i/7);o[e]=o[e]||[],o[e].push(r),r=this.addDays(r,1),i+=1}return o},this.getWeekNumber=e=>(0,JI.N)(e,{locale:this.locale}),this.getYearRange=([e,t])=>{let n=this.startOfYear(e),i=this.endOfYear(t),r=[],o=n;for(;this.isBefore(o,i);)r.push(o),o=this.addYears(o,1);return r}}}let J4="yyyy-MM-dd HH:mm:ss";function J6(e,t){let n,i;return e?(0,nk.isRelativeTimeRange)(e)?e.pastDuration:(n=rJ(e.start,J4,t),i=rJ(e.end,J4,t),`${n} - ${i}`):"Custom Time Range"}let J8=({initialTimeRange:e,onChange:t,onCancel:n,timeZone:i})=>{let r=["local","browser"].includes(i.toLowerCase())?Intl.DateTimeFormat().resolvedOptions().timeZone:i,[o,a]=(0,eD.useState)(e),[s,l]=(0,eD.useState)(!0),u=(e,t)=>{a(n=>({...n,[t]:e}))},c=e=>{u(e,"start")},h=e=>{u(e,"end")},d=()=>{var e,t;let n={start:o.start,end:o.end};if(e=n.start,t=n.end,(0,nT.isValid)(e)&&(0,nT.isValid)(t)?!!(0,nT.isBefore)(e,t)||(console.error("End Time is before Start Time"),!1):(console.error("Invalid Date"),!1))return n};return(0,eb.jsx)(Y_,{dateAdapter:J3,children:(0,eb.jsxs)(eM.A,{spacing:2,sx:e=>({padding:e.spacing(1,0,2)}),children:[s&&(0,eb.jsxs)(uo.A,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,eb.jsx)(hi.A,{variant:"h3",padding:1,paddingLeft:2,children:"Select Start Time"}),(0,eb.jsx)(Qs,{timezone:r,displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:new rK(o.start,r),onChange:e=>{null!==e&&c(e)},onAccept:()=>{l(!1)}})]}),!s&&(0,eb.jsxs)(uo.A,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,eb.jsx)(hi.A,{variant:"h3",padding:1,paddingLeft:2,children:"Select End Time"}),(0,eb.jsx)(Qs,{timezone:r,displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:new rK(o.end,r),minDateTime:new rK(o.start,r),onChange:e=>{null!==e&&h(e)},onAccept:e=>{null!==e&&(l(!0),h(e))}})]}),(0,eb.jsxs)(eM.A,{direction:"row",alignItems:"center",gap:1,pl:1,pr:1,children:[(0,eb.jsx)(LP.ErrorBoundary,{FallbackComponent:LO,children:(0,eb.jsx)(Jc,{"data-testid":"start_time_input",timezone:r,label:"Start Time",value:new rK(o.start,r),onChange:e=>{e&&c(e)},onBlur:()=>d(),format:J4})}),(0,eb.jsx)(LP.ErrorBoundary,{FallbackComponent:LO,children:(0,eb.jsx)(Jc,{"data-testid":"end_time_input",timezone:r,label:"End Time",value:new rK(o.end,r),onChange:e=>{e&&h(e)},onBlur:()=>d(),format:J4})})]}),(0,eb.jsxs)(eM.A,{direction:"row",sx:{padding:e=>e.spacing(0,1)},gap:1,children:[(0,eb.jsx)(eS.A,{variant:"contained",onClick:()=>{let e;(e=d())&&t(e)},fullWidth:!0,children:"Apply"}),(0,eb.jsx)(eS.A,{variant:"outlined",onClick:()=>n(),fullWidth:!0,children:"Cancel"})]})]})})};function J9({value:e,timeOptions:t,onChange:n,height:i,showCustomTimeRange:r=!0,timeZone:o,timeZoneOptions:a,onTimeZoneChange:s}){let l,{timeZone:u}=ut(),c=o??u,h=(0,eD.useRef)(),[d,p]=(0,eD.useState)(!1),f=(0,eD.useMemo)(()=>(0,nk.isRelativeTimeRange)(e)?(0,nk.toAbsoluteTimeRange)(e):e,[e]),g=(0,eD.useMemo)(()=>{var t;return{value:t=(0,nk.isRelativeTimeRange)(e)?void 0:e,display:J6(t,c)}},[e,c]),[m,v]=(0,eD.useState)(!1),y=a??nI(),[x,b]=(0,eD.useState)(null),w=y.find(e=>e.value===c)?.display??c,S=r0(c),_=r0("local"),M=y.map(e=>({id:e.value,label:e.display}));{let e=y.find(e=>e.value===c);e&&(l={id:e.value,label:e.display})}return(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(e9.Ay,{anchorEl:x,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},open:!!x,onClose:()=>b(null),sx:e=>({padding:e.spacing(1)}),children:(0,eb.jsx)(uo.A,{sx:{p:1,minWidth:260},onClick:e=>{e.stopPropagation()},children:(0,eb.jsx)(h8,{options:M,value:l,onChange:(e,t)=>{if(t){let e=y.find(e=>e.value===t.id);e&&s?.(e)}b(null)},disableClearable:!0,renderInput:e=>(0,eb.jsx)(eA.A,{...e,placeholder:"Search timezones",size:"small"})})})}),(0,eb.jsx)(e9.Ay,{anchorEl:h.current,anchorOrigin:{vertical:"bottom",horizontal:"center"},open:d,onClose:()=>p(!1),sx:e=>({padding:e.spacing(2)}),children:(0,eb.jsx)(J8,{initialTimeRange:f,onChange:e=>{n(e),p(!1),v(!1)},onCancel:()=>p(!1),timeZone:c})}),(0,eb.jsx)(uo.A,{ref:h,children:(0,eb.jsxs)(cw.A,{open:m,value:J6(e,c),onClick:()=>v(!m),IconComponent:Yg,renderValue:()=>(0,eb.jsxs)(eM.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,eb.jsx)("span",{children:t.find(t=>J6(t.value,c)===J6(e,c))?.display??J6(e,c)}),S!==_&&(0,eb.jsxs)(uo.A,{sx:{typography:"caption",color:"text.secondary"},children:["\xb7 ",S]})]}),inputProps:{"aria-label":`Select time range. Currently set to ${e}`},sx:{".MuiSelect-icon":{marginTop:"1px",transform:"none"},".MuiSelect-select.MuiSelect-outlined.MuiInputBase-input":{paddingRight:"36px"},".MuiSelect-select":i?{lineHeight:i,paddingY:0}:{}},children:[(0,eb.jsx)(cb.A,{disableRipple:!0,onClick:e=>{e.preventDefault(),e.stopPropagation()},sx:{cursor:"default","&:hover":{backgroundColor:"transparent"},py:.5,px:1},children:(0,eb.jsxs)(uo.A,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[(0,eb.jsxs)(uo.A,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,eb.jsx)(uo.A,{sx:{typography:"subtitle1"},children:"Time Range"}),(0,eb.jsxs)(uo.A,{sx:{color:"text.secondary",typography:"caption",mt:.25},children:["Timezone: ",w]})]}),(0,eb.jsx)(uo.A,{sx:{display:"flex",alignItems:"center",pr:1,ml:1.5},children:(0,eb.jsx)(eC.A,{size:"small","aria-label":"Select timezone",onClick:e=>{e.preventDefault(),e.stopPropagation(),b(e.currentTarget)},children:(0,eb.jsx)(Ym,{fontSize:"small"})})})]})}),t.map((e,t)=>(0,eb.jsx)(cb.A,{value:J6(e.value,c),onClick:()=>{n(e.value)},children:e.display},t)),r&&(0,eb.jsx)(cb.A,{value:J6(g.value,c),onClick:()=>p(!0),children:g.display})]})})]})}function J7({value:e,onChange:t,timeZoneOptions:n,variant:i="standard",heightPx:r,...o}){let a,s=(0,eD.useMemo)(()=>n??nI(),[n]);r&&(a="number"==typeof r?`${r}px`:r);let l=(0,eD.useMemo)(()=>({minWidth:"compact"===i?"80px":"150px",...a&&{lineHeight:a,paddingY:0},...o.sx}),[i,a,o.sx]);return(0,eb.jsx)(cw.A,{...o,value:e,onChange:(e,n)=>{var i;let r;i=e.target.value,(r=s.find(e=>e.value===i))&&t&&t(r)},sx:l,size:"compact"===i?"small":"medium",children:s.map(e=>(0,eb.jsx)(cb.A,{value:e.value,children:e.display},e.value))})}function eee(e){let{markerColor:t,sx:n}=e;return(0,eb.jsx)(uo.A,{sx:rv({display:"inline-block",width:"11px",height:"11px",borderRadius:"2px",marginRight:1,verticalAlign:"top"},n),style:{backgroundColor:t}})}function eet(e){let{formattedY:t,markerColor:n,metricName:i,metricLabels:r}=e;return(0,eb.jsxs)(eM.A,{spacing:.5,children:[(0,eb.jsxs)(uo.A,{sx:e=>({display:"flex",height:"16px",flexDirection:"row",alignItems:"center",justifyContent:"left",color:e.palette.common.white,fontSize:"11px"}),children:[(0,eb.jsx)(eee,{markerColor:n,sx:{marginTop:.25}}),(0,eb.jsxs)(uo.A,{component:"span",children:[i,(0,eb.jsx)(uo.A,{component:"span",sx:e=>({color:e.palette.common.white,fontWeight:700,paddingLeft:"2px"}),children:t})]})]}),(0,eb.jsx)(hh.A,{sx:e=>({borderColor:e.palette.grey["500"]})}),(0,eb.jsx)(uo.A,{sx:e=>({color:e.palette.common.white}),children:r.map(e=>{if(e){let[t,n]=e.split("="),i=void 0!==n?`${t}: `:t,r=void 0!==n?n.replace(/(^"|"$)/g,""):n;return(0,eb.jsxs)(uo.A,{sx:{display:"flex",gap:"4px"},children:[(0,eb.jsx)(hi.A,{sx:{fontSize:"11px"},children:i}),(0,eb.jsx)(hi.A,{sx:e=>({color:e.palette.common.white,fontWeight:700,fontSize:"11px"}),children:r})]},e)}})})]})}let een=375,eei=650,eer=650,eeo=500,eea=.75,ees=8,eel=750,eeu="nearby series showing in tooltip",eec="emphasized series showing as bold in tooltip",eeh="#2E313E",eed=new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}),eep={coords:{plotCanvas:{x:0,y:0},zrender:{x:0,y:0},target:null},chartWidth:0},eef=[],eeg=()=>{let[e,t]=(0,eD.useState)(null);return(0,eD.useEffect)(()=>{let e=e=>t({page:{x:e.pageX,y:e.pageY},client:{x:e.clientX,y:e.clientY},plotCanvas:{x:e.zrX??e.offsetX,y:e.zrY??e.offsetY},target:e.target});return window.addEventListener("mousemove",e),()=>{window.removeEventListener("mousemove",e)}},[]),e},eem={wrapLabels:!0,enablePinning:!0},eev="Click chart to pin",eey="Click chart to unpin";function eex(e){let{seriesName:t,formattedY:n,markerColor:i,totalSeries:r,emphasizeText:o=!1,wrapLabels:a=!0}=e,s=t.split("{"),l=(s[1]??t).replace(/[{}]/g,"").split(",");if(1===r&&l.length>1){let e=s[0]?`${s[0]}:`:"value:";return(0,eb.jsx)(eet,{formattedY:n,metricName:e,metricLabels:l,markerColor:i})}let u=t.replace(/[,]/g,", ");return(0,eb.jsxs)(uo.A,{sx:{display:"table-row",paddingTop:.5},children:[(0,eb.jsxs)(uo.A,{sx:{display:"table-cell",maxWidth:"520px"},children:[(0,eb.jsx)(eee,{markerColor:i,sx:{marginTop:.5}}),(0,eb.jsx)(uo.A,{component:"span",sx:e=>({display:"inline-block",width:"calc(100% - 20px)",minWidth:150,maxWidth:eeo,overflow:"hidden",color:e.palette.common.white,fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular,textOverflow:"ellipsis",whiteSpace:a?"normal":"nowrap"}),"aria-label":o?eec:eeu,children:u})]}),(0,eb.jsx)(uo.A,{sx:e=>({display:"table-cell",paddingLeft:1.5,textAlign:"right",verticalAlign:"top",fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular}),children:n})]})}var eeb=n(36961),eew=n(13850),eeS=n.n(eew);function ee_(e,t,n,i,r){if(null===e||(null!==t&&(e=t),void 0===e.plotCanvas.x))return;let o=n>0?n:eer,a=i>0?i:eei,s=e.page.x+32,l=e.page.y+16;if(r){let e=r.getBoundingClientRect();s=s-e.left+r.scrollLeft,l=l-e.top+r.scrollTop;let t=e.top+r.scrollHeight;l+o>t&&(l=Math.max(t-o-16,ees/2))}else l+o>window.innerHeight+window.scrollY&&(l=Math.max(window.innerHeight+window.scrollY-o-16,ees/2));return s+a>window.innerWidth&&(s=e.page.x-a-32),s<32&&(s=32),l<ees/2&&(l=ees/2),`translate3d(${s}px, ${l}px, 0)`}function eeM(e,t,n){return{minWidth:een,maxWidth:eei,maxHeight:(n?n-ees:void 0)??eer,padding:0,position:"absolute",top:0,left:0,backgroundColor:e.palette.designSystem?.grey[800]??eeh,borderRadius:"6px",color:"#fff",fontSize:"11px",visibility:"visible",opacity:1,transition:"opacity 0.1s ease-out, visibility 0.1s ease-out",zIndex:null!==t?"auto":e.zIndex.tooltip,overflow:"hidden","&:hover":{overflowY:"auto"}}}function eeC(e,t){try{let n=t.convertToPixel("grid",[e,0]);return n?.[0]??null}catch{return null}}function eeA(e,t,n,i){let r=n[e];if(!r)return t;let o=r.stack;if(!o)return t;let a=o.toString(),s=(i.get(a)??0)+t;return i.set(a,s),s}function eek(e,t,n){let i,r,o=t.indexOf(e);if(-1===o)return 20;let a=o>0?t[o-1]??null:null,s=o<t.length-1?t[o+1]??null:null,l=eeC(e,n);if(null===l)return 20;if(null!==a&&null!==s){let e=eeC(a,n)??l,t=eeC(s,n)??l;i=(l+e)/2,r=(l+t)/2}else if(null!==a){let e=eeC(a,n)??l;i=(l+e)/2,r=l+(l-i)}else{if(null===s)return 20;let e=eeC(s,n)??l;r=(l+e)/2,i=l-(r-l)}return Math.max(1,r-i)}function eeT(e,t,n,i){let r=t/Math.max(1,i),o=n-t/2+e*r;return{left:o,right:o+r}}function eeD(e,t,n){try{let i=n.convertToPixel("grid",[0,e]),r=n.convertToPixel("grid",[0,t]);if(!i||!r||void 0===i[1]||void 0===r[1])return null;return{top:Math.min(r[1],i[1]),bottom:Math.max(r[1],i[1])}}catch{return null}}let eeI=5.5,eeO=30,eeP=5;function eeE(e,t,n,i,r,o,a,s,l){let u=n[0]??null,c=n[1]??null;if(null===u||null===c||void 0===r.dispatchAction||!Array.isArray(e))return eef;let h=rg(e[0]?.values,u);if(null===h)return eef;let d=null;if(void 0!==s){let e=r.convertToPixel("grid",[0,c]),t=r.convertToPixel("grid",[0,c+i]);e&&t&&void 0!==e[1]&&void 0!==t[1]&&(d=Math.abs(t[1]-e[1]))}let p=l??eeC(h,r),f=function(e,t,n,i,r,o,a,s,l){let u=[],c=e.length,h=new Map,d=[],p=e[0]?.values;if(p&&p.length>0){let e=new Set;for(let[t]of p)e.has(t)||(e.add(t),d.push(t));d=d.sort((e,t)=>e-t)}let f=[];for(let e=0;e<c;e++)(t[e]?.type??"line")==="bar"&&f.push(e);let g=null,m=null;f.length>0&&null!==r&&(g=eek(n,d,l),m=eeC(n,l));for(let d=0;d<c;d++){let c,p=t[d];if(!p)continue;let v=e[d];if(!v)continue;let y=v.values;if(!y||!Array.isArray(y))continue;let x=p.type??"line",b=p.name?p.name.toString():"",w=p.id?p.id.toString():"",S=(p.color??"#000").toString(),_=-1,M=0;for(let e=0;e<y.length;e++){let t=y[e];if(t&&t[0]===n){_=e,M=t[0],c=t[1];break}}if(-1===_||null==c)continue;let C=!1,A=c,k=1/0;if("line"===x)if(A=eeA(d,c,t,h),void 0!==o&&null!==s)try{let e=l.convertToPixel({seriesIndex:d},[_,A]);if(e&&void 0!==e[1]){let t=Math.abs(o-e[1]);C=t<=s,k=t}else{let e=Math.abs(A-i);C=e<=a,k=e}}catch{let e=Math.abs(A-i);C=e<=a,k=e}else{let e=Math.abs(A-i);C=e<=a,k=e}else if("bar"===x){if(null===r||null===g||null===m)continue;let e=f.indexOf(d);if(-1===e)continue;let n=eeT(e,g,m,f.length);if(!(r>=n.left&&r<=n.right))continue;let o=p.stack,a=!0;if(o){let e=o.toString(),n=eeD(h.get(e)??0,A=eeA(d,c,t,h),l);if(n){let e=l.convertToPixel("grid",[0,i]);e&&void 0!==e[1]&&(a=e[1]>=n.top&&e[1]<=n.bottom)}}else A=c;if(!a)continue;k=Math.abs(r-(n.left+n.right)/2),C=!0}C&&u.push({seriesIdx:d,datumIdx:_,seriesId:w,seriesName:b,date:n,markerColor:S,x:M,y:c,visualY:A,distance:k})}return u}(e,t,h,c,p,s,i,d,r),g=function(e){if(0===e.length)return null;let t=null;for(let n of e)(null===t||n.distance<t.distance)&&(t=n);return t}(f),m=new Set;for(let e of f)m.add(e.seriesIdx);let v=[];for(let t=0;t<e.length;t++)m.has(t)||v.push(t);return function(e,t,n,i,r,o){let a=[],s=[],l=[...o],u=[],c=[],h=new Map,d=[];for(let r of e){let e=i?.get(r.seriesId)??n,o=r.y,p=i0(o,e),f=null!==t&&r.seriesIdx===t.seriesIdx;if(f){s.push(r.seriesIdx);let e=h.get(o)??0;h.set(o,e+1),e>0&&c.push({seriesIndex:r.seriesIdx,dataIndex:r.datumIdx,seriesName:r.seriesName,yValue:o}),u.push({seriesIndex:r.seriesIdx,dataIndex:r.datumIdx,seriesName:r.seriesName,yValue:o})}else l.push(r.seriesIdx);d.push({seriesIdx:r.seriesIdx,datumIdx:r.datumIdx,seriesName:r.seriesName,date:r.date,x:r.x,y:o,formattedY:p,markerColor:r.markerColor,isClosestToCursor:f}),a.push(r.seriesIdx)}return rp(r,a,s,l,u,c),d}(f,g,o,a,r,v)}function eeR(e,t,n,i,r){let o=[],a=t[0]??null,s=t[1]??null;if(null===a||null===s)return o;let l=[],u=[],c=[],h=e.timeSeries.length;if(Array.isArray(e.xAxis)&&Array.isArray(e.timeSeries))for(let t=0;t<h;t++){let d=e.timeSeries[t];if(void 0===d||o.length>=1e3)break;let p=d.name?d.name.toString():"",f=d.color??"#000";if(Array.isArray(d.data))for(let g=0;g<d.data.length;g++){let m=e.xAxis[g]??0,v=d.data[g];if(null!=v&&a===g&&"-"!==v&&s<=v+n&&s>=v-n){let e=eeN({valueToCheck:s,baseValue:v,percentage:Math.max(h>eeP?2:5,100/h)});e?u.push(t):(c.push(t),i?.dispatchAction!==void 0&&i.dispatchAction({type:"downplay",seriesIndex:t}));let n=m>0x174876e7ff?m:1e3*m,a=i0(v,r);o.push({seriesIdx:t,datumIdx:g,seriesName:p,date:n,x:m,y:v,formattedY:a,markerColor:f.toString(),isClosestToCursor:e}),l.push(t)}}}return i?.dispatchAction!==void 0&&(i.dispatchAction({type:"downplay",seriesIndex:c}),u.length>0?i.dispatchAction({type:"highlight",seriesIndex:u,notBlur:!1,escapeConnect:!0}):i.dispatchAction({type:"highlight",seriesIndex:l,notBlur:!0,escapeConnect:!0})),o}function eeL({mousePos:e,pinnedPos:t,data:n,seriesMapping:i,chart:r,format:o,seriesFormatMap:a,showAllSeries:s=!1}){if(void 0===r||null===e)return eef;let l=!1;if(null!==e.target){let t=e.target.parentElement;if(null!==t){let e=t.parentElement;null!==e&&r.getDom()===e&&(l=!0)}}if(null!==t&&(e=t,l=!0),!1===l||null===n||void 0===r._model||void 0===e.plotCanvas.x||void 0===e.plotCanvas.y)return eef;let u=e.plotCanvas.y,c=e.plotCanvas.x,h=rd(c,u,r);if(null!==h){let e=r._model.getComponent("yAxis").axis.scale,t="log"===e.type,l=e._interval;if(t&&e.base){let t=e.base,n=e._extent,i=t**n[0];l=(t**n[1]-i)/100}let d=eeB({yInterval:l,totalSeries:n.length,showAllSeries:s}),p=i.some(e=>void 0!==e.yAxisIndex&&e.yAxisIndex>0);return eeE(n,i,h,d,r,o,a,p?u:void 0,c)}return eef}function eeN({valueToCheck:e,baseValue:t,percentage:n}){let i=n/100*t;return e>=t-i&&e<=t+i}function eeB({yInterval:e,totalSeries:t,showAllSeries:n=!1}){if(n)return 10*e;let i=.3*e;return t>eeP?Math.max(i,e*eeO/t):Math.max(i,e*eeI)}function eeF(e){let{series:t,wrapLabels:n}=e,i=(0,eD.useMemo)(()=>null===t?null:t.sort((e,t)=>e.y>t.y?-1:1),[t]);return null===t||null===i?null:(0,eb.jsx)(uo.A,{sx:e=>({display:"table",padding:e.spacing(.5,2)}),children:i.map(({datumIdx:e,seriesIdx:t,seriesName:r,y:o,formattedY:a,markerColor:s,isClosestToCursor:l})=>{if(null===e||null===t)return null;let u=t.toString()+e.toString();return(0,eb.jsx)(eex,{seriesName:r,y:o,formattedY:a,markerColor:s,totalSeries:i.length,wrapLabels:n,emphasizeText:l},u)})})}var eez=n(68003),eeV=n(4491),eej=n(29917);let eeH=(0,eD.memo)(function({nearbySeries:e,totalSeries:t,isTooltipPinned:n,showAllSeries:i,enablePinning:r=!0,onShowAllClick:o,onUnpinClick:a}){let s,l,u,{formatWithUserTimeZone:c}=ut(),h=e[0]?.date??null;if(null===h)return null;let d=r&&t>5;return(0,eb.jsxs)(uo.A,{sx:e=>({width:"100%",maxWidth:eei,padding:e.spacing(1.5,2,.5,2),backgroundColor:e.palette.designSystem?.grey[800]??eeh,position:"sticky",top:0,left:0}),children:[(0,eb.jsxs)(uo.A,{sx:{width:"100%",display:"flex",justifyContent:"start",alignItems:"center",paddingBottom:.5},children:[(l=c(s=new Date(h),"MMM dd, yyyy - "),u=c(s,"HH:mm:ss"),(0,eb.jsxs)(uo.A,{children:[(0,eb.jsx)(hi.A,{variant:"caption",sx:e=>({color:e.palette.common.white}),children:l}),(0,eb.jsx)(hi.A,{variant:"caption",children:(0,eb.jsx)("strong",{children:u})})]})),(0,eb.jsxs)(eM.A,{direction:"row",gap:1,sx:{marginLeft:"auto"},children:[d&&(0,eb.jsxs)(eM.A,{direction:"row",gap:.5,alignItems:"center",sx:{textAlign:"right"},children:[(0,eb.jsx)(hi.A,{sx:{fontSize:11},children:"Show All"}),(0,eb.jsx)(eez.A,{checked:i,size:"small",onChange:(e,t)=>{if(void 0!==o)return o(t)},sx:e=>({"& .MuiSwitch-switchBase":{color:e.palette.common.white},"& .MuiSwitch-track":{backgroundColor:e.palette.common.white}})})]}),r&&(0,eb.jsxs)(eM.A,{direction:"row",alignItems:"center",children:[(0,eb.jsx)(hi.A,{sx:{marginRight:.5,fontSize:11,verticalAlign:"middle"},children:n?eey:eev}),n?(0,eb.jsx)(eeV,{onClick:()=>{void 0!==a&&a()},sx:{fontSize:16,cursor:"pointer"}}):(0,eb.jsx)(eej,{sx:{fontSize:16}})]})]})]}),(0,eb.jsx)(hh.A,{sx:e=>({width:"100%",borderColor:e.palette.grey["500"]})})]})}),eeW=(0,eD.memo)(function({containerId:e,chartRef:t,data:n,seriesMapping:i,enablePinning:r=!0,wrapLabels:o,format:a,seriesFormatMap:s,onUnpinClick:l,pinnedPos:u}){let[c,h]=(0,eD.useState)(!1),d=(0,eD.useRef)(),p=(0,eD.useRef)(null),f=eeg(),{height:g,width:m,ref:v}=eeS()(),y=null!==u&&r,x=(0,eD.useCallback)(e=>{p.current=e,v(e)},[v]),b=e?document.querySelector(e):void 0;if((0,eD.useLayoutEffect)(()=>{if(null===f)return;let e=p.current;if(!e)return;let t=e.getBoundingClientRect();if(0===t.height||0===t.width)return;let n=ee_(f,u,t.height,t.width,b);n&&n!==d.current&&(d.current=n,e.style.transform=n)}),null===f||null===f.target||null===n||null===u&&"CANVAS"!==f.target.tagName)return null;let w=t.current,S=b?b.getBoundingClientRect().height:void 0;d.current=ee_(f,u,g??0,m??0,b);let _=eeL({mousePos:f,data:n,seriesMapping:i,pinnedPos:u,chart:w,format:a,seriesFormatMap:s,showAllSeries:c});if(0===_.length)return null;let M=n.length;return(0,eb.jsx)(eeb.A,{container:b,children:(0,eb.jsx)(uo.A,{ref:x,sx:e=>eeM(e,u,S),style:{transform:d.current},children:(0,eb.jsxs)(eM.A,{spacing:.5,children:[(0,eb.jsx)(eeH,{nearbySeries:_,totalSeries:M,enablePinning:r,isTooltipPinned:y,showAllSeries:c,onShowAllClick:e=>h(e),onUnpinClick:l}),(0,eb.jsx)(eeF,{series:_,wrapLabels:o})]})})})}),eeG=(0,e7.A)(eS.A)(({theme:e})=>({padding:e.spacing(.5),minWidth:"auto"})),ee$=(0,eD.forwardRef)(function(e,t){return(0,eb.jsx)(eeG,{ref:t,variant:"outlined",color:"secondary",...e})}),eeU=Object.entries(iJ).map(([e,t])=>({...t,id:e,group:t.group||"Decimal"})).filter(e=>!e.disableSelectorOption);function eeq({value:e,onChange:t,disabled:n=!1,...i}){let r=iJ[e?.unit||"decimal"];return(0,eb.jsx)(h8,{value:{id:e?.unit||"decimal",...r},options:eeU,groupBy:e=>e.group??"Decimal",onChange:(e,n)=>{null===n?t(void 0):t({unit:n.id})},disabled:n,disableClearable:!0,renderInput:({InputProps:e,...i})=>(0,eb.jsx)(eA.A,{...i,slotProps:{input:{...e,endAdornment:(0,eb.jsxs)(eb.Fragment,{children:[e.endAdornment,(0,eb.jsx)(hf.A,{position:"end",children:(0,eb.jsx)(eC.A,{size:"small","aria-label":"clear unit",onClick:()=>t(void 0),disabled:n,tabIndex:-1,children:(0,eb.jsx)(hv,{fontSize:"small"})})})]})}}}),...i})}let eeY=[{id:"default",label:"Default",decimalPlaces:void 0},{id:"0",label:"0",decimalPlaces:0},{id:"1",label:"1",decimalPlaces:1},{id:"2",label:"2",decimalPlaces:2},{id:"3",label:"3",decimalPlaces:3},{id:"4",label:"4",decimalPlaces:4}];function eeZ({value:e,onChange:t,disabled:n=!1}){var i;let r=i7(e),o=re(e);return(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(h2,{label:"Short values",control:(0,eb.jsx)(eez.A,{checked:!!o&&nU(e.shortValues),onChange:(n,i)=>{o&&t({...e,shortValues:i})},disabled:!o})}),(0,eb.jsx)(h2,{label:"Unit",control:(0,eb.jsx)(eeq,{value:e,onChange:e=>{t(e||{unit:"decimal"})},disabled:n})}),(0,eb.jsx)(h2,{label:"Decimals",control:(0,eb.jsx)(h8,{value:(i=e.decimalPlaces,eeY.find(e=>e.decimalPlaces===i)),options:eeY,getOptionLabel:e=>e.label,onChange:(n,i)=>(({decimalPlaces:n})=>{r&&t({...e,decimalPlaces:n})})(i),disabled:!r,disableClearable:!0})})]})}function eeX({name:e,height:t}){return(0,eb.jsx)(uo.A,{style:{maxWidth:t,top:`calc(${t}px / 2)`},sx:{display:"inline-block",position:"absolute",transform:"translateX(-50%) rotate(-90deg)",transformOrigin:"top",textAlign:"center",zIndex:1},children:(0,eb.jsx)(hi.A,{variant:"body1","aria-label":"y axis label",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})}var eeK=n(9408);let eeQ=on((0,eeK.A)({}),{echartsTheme:{textStyle:{fontFamily:"Lato"},categoryAxis:{splitLine:{show:!1}},timeAxis:{splitLine:{show:!1}},bar:{barCategoryGap:2}}}),eeJ={chartsTheme:eeQ,enablePinning:!1,enableSyncGrouping:!0,lastTooltipPinnedCoords:null,setLastTooltipPinnedCoords:()=>null};var ee0=n(52855);let ee1={defaultProps:{variant:"standard",severity:"success"},styleOverrides:{standardError:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.error.dark,color:e.palette.error.light,[`& .${ee0.A.icon}`]:{color:e.palette.error.main}}:{...e.typography.body1,backgroundColor:e.palette.error.light,color:e.palette.error.dark,[`& .${ee0.A.icon}`]:{color:e.palette.error.main}},standardInfo:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.info.dark,color:e.palette.info.light,[`& .${ee0.A.icon}`]:{color:e.palette.info.main}}:{...e.typography.body1,backgroundColor:e.palette.info.light,color:e.palette.info.dark,[`& .${ee0.A.icon}`]:{color:e.palette.info.main}},standardSuccess:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.success.dark,color:e.palette.success.light,[`& .${ee0.A.icon}`]:{color:e.palette.success.main}}:{...e.typography.body1,backgroundColor:e.palette.success.light,color:e.palette.success.dark,[`& .${ee0.A.icon}`]:{color:e.palette.success.main}},standardWarning:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.warning.dark,color:e.palette.warning.light,[`& .${ee0.A.icon}`]:{color:e.palette.warning.main}}:{...e.typography.body1,backgroundColor:e.palette.warning.light,color:e.palette.warning.dark,[`& .${ee0.A.icon}`]:{color:e.palette.warning.main}},root:{["& ."+n(82561).A.root]:{textDecoration:"underline"}}}},ee2={styleOverrides:{root:({theme:e})=>({backgroundColor:e.palette.background.default})}},ee5={50:"#E7F1FC",100:"#D0E3FA",150:"#B8D5F7",200:"#A1C7F5",300:"#72ABF0",400:"#438FEB",500:"#1473E6",600:"#105CB8",700:"#0C458A",800:"#082E5C",850:"#062345",900:"#04172E",950:"#020C17"},ee3="#FFFFFF",ee4={50:"#F0F1F6",100:"#E1E3ED",150:"#D2D5E4",200:"#C3C7DB",300:"#A4ACC8",400:"#8690B6",500:"#717CA4",600:"#535D83",700:"#3E4662",800:"#2A2E42",850:"#1F2331",900:"#151721",950:"#0A0C10"},ee6={50:"#EAF9F1",100:"#D5F2E3",150:"#C1ECD4",200:"#ACE5C6",300:"#82D9AA",400:"#59CC8D",500:"#2FBF71",600:"#26995A",700:"#1C7344",800:"#134C2D",850:"#0E3922",900:"#092617",950:"#05130B"},ee8={50:"#FFF5E8",100:"#FFECD2",150:"#FFE2BB",200:"#FFD9A4",300:"#FFC577",400:"#FFB249",500:"#FF9F1C",600:"#CC7F16",700:"#995F11",800:"#66400B",850:"#4D3008",900:"#332006",950:"#1A1003"},ee9={50:"#EFE9FD",100:"#E0D2FC",150:"#D0BCFA",200:"#C1A6F8",300:"#A179F5",400:"#824DF1",500:"#6320EE",600:"#4F1ABE",700:"#3B138F",800:"#280D5F",850:"#1E0A47",900:"#140630",950:"#0A0318"},ee7={50:"#FDEDED",100:"#FBDADA",150:"#F9C8C8",200:"#F7B5B5",300:"#F29191",400:"#EE6C6C",500:"#EA4747",600:"#BD3939",700:"#902B2B",800:"#621D1D",850:"#4C1616",900:"#350F0F",950:"#1F0808"},ete=e=>"light"===e?{main:ee5["500"],dark:ee5["600"],light:ee5["50"]}:{main:ee5["400"],dark:ee5["800"],light:ee5["200"]},ett={fontFamily:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:600,fontWeightBold:700,h1:{fontSize:"1.5rem",fontWeight:600,lineHeight:"32px"},h2:{fontSize:"1.25rem",fontWeight:600,lineHeight:"28px"},h3:{fontSize:"1rem",fontWeight:600,lineHeight:"24px"},h4:{fontSize:"0.875rem",fontWeight:600,lineHeight:"22px"},h5:void 0,h6:void 0,body1:{fontSize:"0.875rem",fontWeight:400,lineHeight:"20px"},body2:{fontSize:"0.75rem",fontWeight:400,lineHeight:"18px"},subtitle1:{fontSize:"1rem",fontWeight:400,lineHeight:"24px",letterSpacing:"0.02rem"},subtitle2:{fontSize:"0.875rem",fontWeight:600,lineHeight:"22px",letterSpacing:"0.03rem",textTransform:"uppercase"},button:{fontSize:"0.875rem",fontWeight:600,lineHeight:"1.25rem",textTransform:"none",letterSpacing:"0.03rem"},caption:{fontSize:"0.6875rem",fontWeight:400,lineHeight:"16px"}},etn=({theme:e})=>({..."light"===e.palette.mode?{}:{backgroundImage:"unset",backgroundColor:e.palette.designSystem.grey[800]}});function eti(e,t={},n=!1){var i,r;let o;return(0,eeK.A)({palette:function(e){let t,n,i,r;return{mode:e,primary:ete(e),secondary:"light"===e?{main:ee4["600"],dark:ee4["900"],light:ee4["100"]}:{main:ee3,dark:ee3,light:ee3},grey:"light"===e?{50:ee4["50"],100:ee4["100"],200:ee4["200"],300:ee4["300"],400:ee4["400"],500:ee4["500"],600:ee4["600"],700:ee4["700"],800:ee4["800"],900:ee4["900"],950:ee4["950"]}:{50:ee4["950"],100:ee4["900"],200:ee4["800"],300:ee4["700"],400:ee4["600"],500:ee4["500"],600:ee4["400"],700:ee4["300"],800:ee4["200"],900:ee4["100"],950:ee4["50"]},background:(t=ee5["150"],n="rgba(21, 23, 33, 0.75)","light"===e?{navigation:t,overlay:n,default:ee3,paper:ee4["50"],code:ee4["50"],tooltip:ee4["100"],lighter:ee4["50"],border:ee4["100"]}:{navigation:t,overlay:n,default:ee4["900"],paper:ee4["850"],code:ee4["800"],tooltip:ee4["600"],lighter:ee4["700"],border:ee4["600"]}),text:(i=ee4["800"],r=ee4["300"],"light"===e?{navigation:i,accent:r,primary:ee4["800"],secondary:ee4["700"],disabled:ee4["300"],link:ee5["500"],linkHover:ee5["600"]}:{navigation:i,accent:r,primary:ee3,secondary:ee4["50"],disabled:ee4["600"],link:ee5["400"],linkHover:ee5["500"]}),error:"light"===e?{main:ee7["500"],dark:ee7["600"],light:ee7["50"]}:{main:ee7["400"],dark:ee7["800"],light:ee7["300"]},warning:"light"===e?{main:ee8["500"],dark:ee8["700"],light:ee8["50"]}:{main:ee8["400"],dark:ee8["800"],light:ee8["300"]},info:ete(e),success:"light"===e?{main:ee6["500"],dark:ee6["700"],light:ee6["50"]}:{main:ee6["400"],dark:ee6["800"],light:ee6["300"]},common:{white:ee3,black:"#000000"},designSystem:{blue:ee5,green:ee6,grey:ee4,orange:ee8,purple:ee9,red:ee7}}}(e),typography:ett,mixins:{},components:(i=e,r=n,o={MuiAlert:ee1,MuiFormControl:{defaultProps:{size:"small"}},MuiPaper:ee2,MuiTextField:{defaultProps:{size:"small"}},MuiDrawer:{styleOverrides:{paper:etn}},MuiDialog:{styleOverrides:{paper:etn}},MuiPopover:{styleOverrides:{paper:etn}}},r?o:{MuiCssBaseline:{styleOverrides:{body:{colorScheme:i}}},...o}),...t})}var etr=n(87275),eto=n(11061),eta=n(78536),ets=n(1355);function etl({value:e,onChange:t}){return(0,eb.jsxs)(eM.A,{direction:"row",children:[(0,eb.jsx)(h4.A,{freeSolo:!0,multiple:!0,id:"join-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,eb.jsx)(eA.A,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,i)=>{t({...e,spec:{...e.spec,columns:i}})}}),(0,eb.jsx)(q6.A,{label:"Enabled",labelPlacement:"start",control:(0,eb.jsx)(eez.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function etu({value:e,onChange:t}){return(0,eb.jsxs)(eM.A,{direction:"row",gap:1,alignItems:"center",children:[(0,eb.jsx)(h4.A,{freeSolo:!0,multiple:!0,id:"merge-columns-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,eb.jsx)(eA.A,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,i)=>{t({...e,spec:{...e.spec,columns:i}})}}),(0,eb.jsx)(h_,{id:"merge-columns-name",variant:"outlined",label:"Output Name",value:e.spec.name??"",sx:{width:"100%"},onChange:n=>{t({...e,spec:{...e.spec,name:n}})},required:!0}),(0,eb.jsx)(q6.A,{label:"Enabled",labelPlacement:"start",control:(0,eb.jsx)(eez.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function etc({value:e,onChange:t}){return(0,eb.jsxs)(eM.A,{direction:"row",children:[(0,eb.jsx)(h_,{id:"merge-indexed-columns",variant:"outlined",label:"Column",placeholder:"Example: 'value' for merging 'value #1', 'value #2' and 'value #...'",value:e.spec.column??"",sx:{width:"100%"},onChange:n=>{t({...e,spec:{...e.spec,column:n}})},required:!0}),(0,eb.jsx)(q6.A,{label:"Enabled",labelPlacement:"start",control:(0,eb.jsx)(eez.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function eth({value:e,onChange:t}){return(0,eb.jsx)(eM.A,{direction:"row",children:(0,eb.jsx)(q6.A,{label:"Enabled",labelPlacement:"start",control:(0,eb.jsx)(eez.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})})}function etd({value:e,onChange:t,...n}){return(0,eb.jsxs)(eM.A,{gap:2,sx:{width:"100%"},mt:1,...n,children:[(0,eb.jsxs)(h_,{select:!0,label:"Kind",value:e.kind,onChange:n=>t({...e,kind:n}),children:[(0,eb.jsx)(cb.A,{value:"JoinByColumnValue",children:(0,eb.jsxs)(eM.A,{children:[(0,eb.jsx)(hi.A,{children:"Join by column value"}),(0,eb.jsx)(hi.A,{variant:"caption",children:"Regroup rows with equal cell value in a column"})]})}),(0,eb.jsx)(cb.A,{value:"MergeColumns",children:(0,eb.jsxs)(eM.A,{children:[(0,eb.jsx)(hi.A,{children:"Merge columns"}),(0,eb.jsx)(hi.A,{variant:"caption",children:"Multiple columns are merged to one column"})]})}),(0,eb.jsx)(cb.A,{value:"MergeIndexedColumns",children:(0,eb.jsxs)(eM.A,{children:[(0,eb.jsx)(hi.A,{children:"Merge indexed columns"}),(0,eb.jsx)(hi.A,{variant:"caption",children:"Indexed columns are merged to one column"})]})}),(0,eb.jsx)(cb.A,{value:"MergeSeries",children:(0,eb.jsxs)(eM.A,{children:[(0,eb.jsx)(hi.A,{children:"Merge series"}),(0,eb.jsx)(hi.A,{variant:"caption",children:"Series will be merged by their labels"})]})})]}),"JoinByColumnValue"===e.kind&&(0,eb.jsx)(etl,{value:e,onChange:t}),"MergeColumns"===e.kind&&(0,eb.jsx)(etu,{value:e,onChange:t}),"MergeIndexedColumns"===e.kind&&(0,eb.jsx)(etc,{value:e,onChange:t}),"MergeSeries"===e.kind&&(0,eb.jsx)(eth,{value:e,onChange:t})]})}function etp({index:e,value:t,isCollapsed:n,onChange:i,onCollapse:r,onDelete:o,...a}){return(0,eb.jsxs)(eM.A,{...a,children:[(0,eb.jsxs)(eM.A,{direction:"row",alignItems:"center",borderBottom:1,borderColor:e=>e.palette.divider,justifyContent:"space-between",gap:4,children:[(0,eb.jsxs)(eM.A,{direction:"row",gap:1,children:[(0,eb.jsx)(eC.A,{"data-testid":`transform-toggle#${e}`,size:"small",onClick:()=>r(!n),children:n?(0,eb.jsx)(eto,{}):(0,eb.jsx)(etr,{})}),(0,eb.jsx)(hi.A,{variant:"overline",component:"h4",sx:{textTransform:"none"},children:t.kind?(0,eb.jsx)("span",{children:(0,eb.jsx)("strong",{children:ro[t.kind]})}):(0,eb.jsx)("strong",{children:"Select a transformation kind"})})]}),(0,eb.jsxs)(eM.A,{direction:"row",gap:1,children:[n&&(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(hg.A,{title:t.spec?.disabled?"Enable transformation":"Disable transformation",placement:"top",children:(0,eb.jsx)(eC.A,{size:"small",sx:{marginLeft:"auto"},onClick:function(){i({...t,spec:{...t.spec,disabled:!t.spec?.disabled}})},children:t.spec?.disabled?(0,eb.jsx)(eta,{}):(0,eb.jsx)(ets,{})})}),(0,eb.jsx)(hh.A,{flexItem:!0,orientation:"vertical",variant:"middle"})]}),(0,eb.jsx)(hg.A,{title:"Remove transformation",placement:"top",children:(0,eb.jsx)(eC.A,{size:"small",sx:{marginLeft:"auto"},onClick:o,children:(0,eb.jsx)(Yh,{})})})]})]}),!n&&(0,eb.jsx)(etd,{value:t,onChange:i})]})}function etf({value:e,onChange:t,...n}){let[i,r]=(0,eD.useState)(e.map(()=>!0));return(0,eb.jsxs)(eM.A,{gap:1,...n,children:[e.map((n,o)=>(0,eb.jsx)(etp,{index:o,value:n,isCollapsed:i[o]??!0,onChange:n=>{let i;(i=[...e])[o]=n,t(i)},onDelete:()=>{let n;(n=[...e]).splice(o,1),t(n),r(e=>(e.splice(o,1),[...e]))},onCollapse:e=>{r(t=>(t[o]=e,[...t]))}},o)),(0,eb.jsx)(eS.A,{variant:"contained",startIcon:(0,eb.jsx)(Yc,{}),sx:{marginTop:1},onClick:function(){let n=[...e];n.push({kind:"",spec:{}}),t(n),r(e=>(e.push(!1),[...e]))},children:"Add Transformation"})]})}function etg(e){let{value:t,onChange:n,timeOptions:i,height:r}=e,o=(0,eD.useMemo)(()=>{if(t&&!i.some(e=>e.value.pastDuration===t))return(0,eb.jsx)(cb.A,{value:t,children:t})},[i,t]);return(0,eb.jsx)(hZ.A,{children:(0,eb.jsx)(uo.A,{children:(0,eb.jsxs)(cw.A,{id:"refreshInterval",value:t,onChange:e=>{n(e.target.value)},inputProps:{"aria-label":`Select refresh interval. Currently set to ${t}`},sx:{".MuiSelect-select":r?{lineHeight:r,paddingY:0}:{}},children:[i.map((e,t)=>(0,eb.jsx)(cb.A,{value:e.value.pastDuration,children:e.display},t)),o]})})})}function etm({repeatItems:e,maxPer:t,gap:n,renderItem:i,containerSx:r,rowSx:o}){let{rows:a,perRow:s}=(0,eD.useMemo)(()=>{let n=Math.max(1,t),i=[];for(let t=0;t<e.length;t+=n)i.push(e.slice(t,t+n));return{rows:i,perRow:n}},[t,e]);return(0,eb.jsx)(uo.A,{sx:[{display:"flex",flexDirection:"column",width:"100%",height:"100%",gap:`${n}px`},...Array.isArray(r)?r:[r]],children:a.map((e,t)=>(0,eb.jsx)(uo.A,{sx:[{display:"flex",gap:`${n}px`},...Array.isArray(o)?o:[o]],children:e.map((e,r)=>(0,eb.jsx)(uo.A,{sx:{width:`calc((100% - ${n*(s-1)}px) / ${s})`,overflow:"hidden"},children:i(e,{rowIndex:t,colIndex:r})},`${t}-${r}`))},t))})}var etv=n(54381);let ety=({mapping:e,onChange:t,...n})=>{switch(e.kind){case"Value":return(0,eb.jsx)(eM.A,{gap:1,direction:"row",...n,children:(0,eb.jsx)(eA.A,{label:"Value",placeholder:"Exact value",value:e.spec?.value??"",onChange:n=>t({...e,spec:{...e.spec,value:n.target.value}}),fullWidth:!0})});case"Range":return(0,eb.jsxs)(eM.A,{gap:1,direction:"row",...n,children:[(0,eb.jsx)(eA.A,{label:"From",placeholder:"Start of range",value:e.spec?.from??"",onChange:n=>t({...e,spec:{...e.spec,from:""===n.target.value?void 0:+n.target.value}}),fullWidth:!0}),(0,eb.jsx)(eA.A,{label:"To",placeholder:"End of range (inclusive)",value:e.spec?.to??"",onChange:n=>t({...e,spec:{...e.spec,to:""===n.target.value?void 0:+n.target.value}}),fullWidth:!0})]});case"Regex":return(0,eb.jsx)(eM.A,{gap:1,direction:"row",...n,children:(0,eb.jsx)(eA.A,{label:"Regular Expression",placeholder:"JavaScript regular expression",value:e.spec?.pattern??"",onChange:n=>t({...e,spec:{...e.spec,pattern:n.target.value}}),fullWidth:!0})});case"Misc":return(0,eb.jsx)(eM.A,{gap:1,direction:"row",...n,children:(0,eb.jsxs)(eA.A,{select:!0,label:"Value",value:e.spec?.value??"",onChange:n=>t({...e,spec:{value:n.target.value}}),SelectProps:{renderValue:e=>{switch(e){case"empty":return"Empty";case"null":return"Null";case"NaN":return"NaN";case"true":return"True";case"false":return"False";default:return String(e)}}},fullWidth:!0,children:[(0,eb.jsx)(cb.A,{value:"empty",children:(0,eb.jsxs)(eM.A,{children:[(0,eb.jsx)(hi.A,{children:"Empty"}),(0,eb.jsx)(hi.A,{variant:"caption",children:"Matches empty string"})]})}),(0,eb.jsx)(cb.A,{value:"null",children:(0,eb.jsxs)(eM.A,{children:[(0,eb.jsx)(hi.A,{children:"Null"}),(0,eb.jsx)(hi.A,{variant:"caption",children:"Matches null or undefined"})]})}),(0,eb.jsx)(cb.A,{value:"NaN",children:(0,eb.jsxs)(eM.A,{children:[(0,eb.jsx)(hi.A,{children:"NaN"}),(0,eb.jsx)(hi.A,{variant:"caption",children:"Matches Not a Number value"})]})}),(0,eb.jsx)(cb.A,{value:"true",children:(0,eb.jsxs)(eM.A,{children:[(0,eb.jsx)(hi.A,{children:"True"}),(0,eb.jsx)(hi.A,{variant:"caption",children:"Matches true boolean"})]})}),(0,eb.jsx)(cb.A,{value:"false",children:(0,eb.jsxs)(eM.A,{children:[(0,eb.jsx)(hi.A,{children:"False"}),(0,eb.jsx)(hi.A,{variant:"caption",children:"Matches false boolean"})]})})]})});default:return null}},etx=({mapping:e,onChange:t,onDelete:n,...i})=>{let r=n=>{t({...e,spec:{...e.spec,result:{...e.spec.result,color:n}}})};return(0,eb.jsxs)(etv.A,{container:!0,spacing:2,...i,children:[(0,eb.jsx)(etv.A,{size:{xs:5},children:(0,eb.jsxs)(eM.A,{direction:"row",gap:1,width:"100%",children:[(0,eb.jsxs)(eA.A,{select:!0,label:"Type",value:e.kind,onChange:n=>t({...e,kind:n.target.value}),required:!0,sx:{width:"120px"},children:[(0,eb.jsx)(cb.A,{value:"Value",children:(0,eb.jsxs)(eM.A,{children:[(0,eb.jsx)(hi.A,{children:"Value"}),"Value"!==e.kind&&(0,eb.jsx)(hi.A,{variant:"caption",children:"Matches an exact text value"})]})}),(0,eb.jsx)(cb.A,{value:"Range",children:(0,eb.jsxs)(eM.A,{children:[(0,eb.jsx)(hi.A,{children:"Range"}),"Range"!==e.kind&&(0,eb.jsx)(hi.A,{variant:"caption",children:"Matches against a numerical range"})]})}),(0,eb.jsx)(cb.A,{value:"Regex",children:(0,eb.jsxs)(eM.A,{children:[(0,eb.jsx)(hi.A,{children:"Regex"}),"Regex"!==e.kind&&(0,eb.jsx)(hi.A,{variant:"caption",children:"Matches against a regular expression"})]})}),(0,eb.jsx)(cb.A,{value:"Misc",children:(0,eb.jsxs)(eM.A,{children:[(0,eb.jsx)(hi.A,{children:"Misc"}),"Misc"!==e.kind&&(0,eb.jsx)(hi.A,{variant:"caption",children:"Matches against empty, null and NaN values"})]})})]}),(0,eb.jsx)(ety,{width:"100%",mapping:e,onChange:n=>t({...e,...n})})]})}),(0,eb.jsx)(etv.A,{size:{xs:4},children:(0,eb.jsx)(eA.A,{label:"Display text",value:e.spec?.result?.value??"",onChange:n=>t({...e,spec:{...e.spec,result:{...e.spec?.result,value:n.target.value}}}),fullWidth:!0})}),(0,eb.jsx)(etv.A,{size:{xs:1},children:(0,eb.jsx)(eM.A,{direction:"row",justifyContent:"center",gap:1,children:e.spec?.result?.color?(0,eb.jsx)(un,{label:"Color",color:e.spec.result.color??"#000",onColorChange:r,onClear:()=>r(void 0)}):(0,eb.jsx)(eC.A,{onClick:()=>r("#000"),children:(0,eb.jsx)(Yc,{})})})}),(0,eb.jsx)(etv.A,{size:{xs:1},textAlign:"end",children:(0,eb.jsx)(hg.A,{title:"Remove mapping settings",placement:"top",children:(0,eb.jsx)(eC.A,{size:"small",sx:{marginLeft:"auto"},onClick:n,children:(0,eb.jsx)(Yh,{})})})})]})},etb=({mappings:e,onChange:t})=>{let[n,i]=(0,eD.useState)(e);return(0,eb.jsxs)(eM.A,{spacing:1,children:[(0,eb.jsxs)(etv.A,{container:!0,spacing:2,children:[(0,eb.jsx)(etv.A,{size:{xs:5},children:(0,eb.jsx)(hi.A,{variant:"subtitle1",children:"Condition"})}),(0,eb.jsx)(etv.A,{size:{xs:4},children:(0,eb.jsx)(hi.A,{variant:"subtitle1",children:"Display Text"})}),(0,eb.jsx)(etv.A,{size:{xs:1},textAlign:"center",children:(0,eb.jsx)(hi.A,{variant:"subtitle1",children:"Color"})}),(0,eb.jsx)(etv.A,{size:{xs:1}})]}),(0,eb.jsx)(eM.A,{gap:1.5,divider:(0,eb.jsx)(hh.A,{flexItem:!0,orientation:"horizontal"}),children:n.map((e,r)=>(0,eb.jsx)(etx,{mapping:e,onChange:e=>{let o;(o=[...n])[r]=e,i(o),t(o)},onDelete:()=>{let e;(e=[...n]).splice(r,1),i(e),t(e)}},r))}),(0,eb.jsx)(eS.A,{variant:"contained",startIcon:(0,eb.jsx)(Yc,{}),sx:{marginTop:1},onClick:function(){let e=[...n];e.push({kind:"Value",spec:{result:{value:""}}}),i(e),t(e)},children:"Add value mappings"})]})}}}]);