@perses-dev/markdown-plugin 0.12.0 → 0.13.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 (106) hide show
  1. package/__mf/js/{Markdown.20f59bf1.js → Markdown.7274a42c.js} +4 -4
  2. package/__mf/js/async/121.4f618242.js +2 -0
  3. package/__mf/js/async/192.5fcbacc8.js +1 -0
  4. package/__mf/js/async/235.8e51686f.js +1 -0
  5. package/__mf/js/async/274.46511e6c.js +2 -0
  6. package/__mf/js/async/354.a4ff15e0.js +4 -0
  7. package/__mf/js/async/354.a4ff15e0.js.LICENSE.txt +9 -0
  8. package/__mf/js/async/356.f2464831.js +1 -0
  9. package/__mf/js/async/377.33c77c6a.js +1 -0
  10. package/__mf/js/async/392.9a0e3220.js +2 -0
  11. package/__mf/js/async/470.4ec75a15.js +2 -0
  12. package/__mf/js/async/493.09764f91.js +102 -0
  13. package/__mf/js/async/555.aa8a9203.js +1 -0
  14. package/__mf/js/async/587.20e47b23.js +1 -0
  15. package/__mf/js/async/616.fcbca7cf.js +1 -0
  16. package/__mf/js/async/663.9789bc66.js +1 -0
  17. package/__mf/js/async/680.d2acb11f.js +12 -0
  18. package/__mf/js/async/808.1e94c038.js +43 -0
  19. package/__mf/js/async/808.1e94c038.js.LICENSE.txt +102 -0
  20. package/__mf/js/async/936.7be3b9ae.js +1 -0
  21. package/__mf/js/async/94.eb815395.js +10 -0
  22. package/__mf/js/async/941.601daa22.js +2 -0
  23. package/__mf/js/async/968.bc5b60bc.js +1 -0
  24. package/__mf/js/async/__federation_expose_Markdown.45af9b33.js +1 -0
  25. package/__mf/js/async/lib-router.8d81e712.js +2 -0
  26. package/__mf/js/{main.d8c74d29.js → main.c38f12c3.js} +3 -3
  27. package/lib/Markdown.d.ts +2 -2
  28. package/lib/Markdown.d.ts.map +1 -1
  29. package/lib/Markdown.js +3 -3
  30. package/lib/Markdown.js.map +1 -1
  31. package/lib/MarkdownPanel.d.ts +3 -3
  32. package/lib/MarkdownPanel.d.ts.map +1 -1
  33. package/lib/MarkdownPanel.js +7 -7
  34. package/lib/MarkdownPanel.js.map +1 -1
  35. package/lib/MarkdownPanelOptionsEditor.d.ts +3 -3
  36. package/lib/MarkdownPanelOptionsEditor.d.ts.map +1 -1
  37. package/lib/MarkdownPanelOptionsEditor.js +2 -2
  38. package/lib/MarkdownPanelOptionsEditor.js.map +1 -1
  39. package/lib/bootstrap.js +2 -2
  40. package/lib/getPluginModule.d.ts +1 -1
  41. package/lib/getPluginModule.d.ts.map +1 -1
  42. package/lib/getPluginModule.js +3 -1
  43. package/lib/getPluginModule.js.map +1 -1
  44. package/lib/index-federation.js +1 -1
  45. package/lib/index.js +5 -5
  46. package/lib/index.js.map +1 -1
  47. package/lib/markdown-panel-model.d.ts +1 -1
  48. package/lib/markdown-panel-model.d.ts.map +1 -1
  49. package/lib/markdown-panel-model.js.map +1 -1
  50. package/lib/setup-tests.d.ts +1 -1
  51. package/lib/setup-tests.d.ts.map +1 -1
  52. package/lib/setup-tests.js +2 -2
  53. package/lib/setup-tests.js.map +1 -1
  54. package/mf-manifest.json +29 -72
  55. package/mf-stats.json +29 -80
  56. package/package.json +10 -10
  57. package/__mf/js/async/121.a9ac3871.js +0 -2
  58. package/__mf/js/async/125.3fab3f86.js +0 -10
  59. package/__mf/js/async/177.5335836c.js +0 -1
  60. package/__mf/js/async/187.e36c4021.js +0 -7
  61. package/__mf/js/async/187.e36c4021.js.LICENSE.txt +0 -39
  62. package/__mf/js/async/192.1bcbacc5.js +0 -1
  63. package/__mf/js/async/235.f508ea23.js +0 -1
  64. package/__mf/js/async/274.fa2aa111.js +0 -2
  65. package/__mf/js/async/356.90d42c91.js +0 -1
  66. package/__mf/js/async/377.e079a255.js +0 -1
  67. package/__mf/js/async/392.6999603c.js +0 -2
  68. package/__mf/js/async/43.e1743b42.js +0 -2
  69. package/__mf/js/async/43.e1743b42.js.LICENSE.txt +0 -24
  70. package/__mf/js/async/470.926a1541.js +0 -2
  71. package/__mf/js/async/546.8bdb58c4.js +0 -24
  72. package/__mf/js/async/546.8bdb58c4.js.LICENSE.txt +0 -19
  73. package/__mf/js/async/558.3bb15034.js +0 -1
  74. package/__mf/js/async/587.99ce4abf.js +0 -1
  75. package/__mf/js/async/588.cfa85cf3.js +0 -1
  76. package/__mf/js/async/616.79bbce2d.js +0 -1
  77. package/__mf/js/async/71.1717f603.js +0 -1
  78. package/__mf/js/async/73.1d9051a3.js +0 -12
  79. package/__mf/js/async/854.1c79821c.js +0 -1
  80. package/__mf/js/async/873.8558505f.js +0 -1
  81. package/__mf/js/async/935.ce92b5f1.js +0 -139
  82. package/__mf/js/async/935.ce92b5f1.js.LICENSE.txt +0 -37
  83. package/__mf/js/async/941.4cd009e6.js +0 -2
  84. package/__mf/js/async/968.14a1791c.js +0 -1
  85. package/__mf/js/async/978.f2e7b013.js +0 -1
  86. package/__mf/js/async/__federation_expose_Markdown.c6f196e2.js +0 -1
  87. package/__mf/js/async/lib-router.ad82c2bf.js +0 -2
  88. package/lib/cjs/Markdown.js +0 -37
  89. package/lib/cjs/MarkdownPanel.js +0 -148
  90. package/lib/cjs/MarkdownPanelOptionsEditor.js +0 -58
  91. package/lib/cjs/bootstrap.js +0 -26
  92. package/lib/cjs/env.d.js +0 -14
  93. package/lib/cjs/getPluginModule.js +0 -39
  94. package/lib/cjs/index-federation.js +0 -55
  95. package/lib/cjs/index.js +0 -40
  96. package/lib/cjs/markdown-panel-model.js +0 -27
  97. package/lib/cjs/setup-tests.js +0 -19
  98. /package/__mf/css/async/{187.85c2cbf6.css → 808.85c2cbf6.css} +0 -0
  99. /package/__mf/js/async/{121.a9ac3871.js.LICENSE.txt → 121.4f618242.js.LICENSE.txt} +0 -0
  100. /package/__mf/js/async/{274.fa2aa111.js.LICENSE.txt → 274.46511e6c.js.LICENSE.txt} +0 -0
  101. /package/__mf/js/async/{392.6999603c.js.LICENSE.txt → 392.9a0e3220.js.LICENSE.txt} +0 -0
  102. /package/__mf/js/async/{470.926a1541.js.LICENSE.txt → 470.4ec75a15.js.LICENSE.txt} +0 -0
  103. /package/__mf/js/async/{73.1d9051a3.js.LICENSE.txt → 680.d2acb11f.js.LICENSE.txt} +0 -0
  104. /package/__mf/js/async/{125.3fab3f86.js.LICENSE.txt → 94.eb815395.js.LICENSE.txt} +0 -0
  105. /package/__mf/js/async/{941.4cd009e6.js.LICENSE.txt → 941.601daa22.js.LICENSE.txt} +0 -0
  106. /package/__mf/js/async/{lib-router.ad82c2bf.js.LICENSE.txt → lib-router.8d81e712.js.LICENSE.txt} +0 -0
@@ -0,0 +1,43 @@
1
+ /*! For license information please see 808.1e94c038.js.LICENSE.txt */
2
+ (self.chunk_Markdown_0_13_0_beta_1=self.chunk_Markdown_0_13_0_beta_1||[]).push([["808"],{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,C=b==w;if(C&&u(e)){if(!u(t))return!1;y=!0,S=!1}if(C&&!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 M=S&&f.call(e,"__wrapped__"),A=_&&f.call(t,"__wrapped__");if(M||A){var k=M?e.value():e,T=A?t.value():t;return v||(v=new i),m(k,T,n,g,v)}}return!!C&&(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),C=w.get(_);if(C)return void i(e,n,C);var M=b?b(S,_,n+"",e,t,w):void 0,A=void 0===M;if(A){var k=u(_),T=!k&&h(_),I=!k&&!T&&g(_);M=_,k||T||I?u(S)?M=S:c(S)?M=a(S):T?(A=!1,M=r(_,!0)):I?(A=!1,M=o(_,!0)):M=[]:f(_)||l(_)?(M=S,l(S)?M=v(S):(!p(S)||d(S))&&(M=s(_))):A=!1}A&&(w.set(_,M),x(M,_,y,b,w),w.delete(_)),i(e,n,M)}},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")},29917(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,12M8.8,14L10,12.8V4H14V12.8L15.2,14H8.8Z","PinOutline")},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")},40362(e,t,n){"use strict";var i=n(56441);function r(){}function o(){}o.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,o,a){if(a!==i){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:r};return n.PropTypes=n,n}},62688(e,t,n){e.exports=n(40362)()},56441(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},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=E(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)?E(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 C(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 M(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(D).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(D).filter(O).filter(I),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(P))?null:{params:r,fn:t}}).filter(R).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(R);a.sort(C);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(E(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,z=x?g(a[4].params[0]):t,F=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,$=x?g(a[4].params[1]):t,G=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(M);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&&z(t)&&$(n)?K.apply(e,arguments):arguments.length===er&&F(t)&&G(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 I(e){return -1===l.ignore.indexOf(e)}function D(e){return e.trim()}function O(e){return!!e}function R(e){return null!==e}function P(e){return 0===e.types.length}function E(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 z(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 F(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(z(t),e)},"...Function":function(e){return k(z(e),F(e))},"string, ...Function":function(e,t){return k(e,F(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()},4539(e,t,n){"use strict";let i,r;n.r(t),n.d(t,{generateChartsTheme:()=>oy,DensitySelector:()=>gj,applyMergeIndexedColumnsTransform:()=>oS,interpolateSelectionIndividual:()=>om,DragButton:()=>mB,TimeRangeSelector:()=>eiY,getFormatterStats:()=>n8,OptionsEditorGrid:()=>gL,TOOLTIP_MAX_HEIGHT:()=>ei0,useMousePosition:()=>ert,TextOverlay:()=>KJ,isValidLegendSize:()=>n0,isValidLegendMode:()=>nJ,isDateUnit:()=>rx,parseVariables:()=>rV,UnitSelector:()=>erR,PERCENT_UNIT_CONFIG:()=>i0,RepeatGrid:()=>eot,PERCENT_GROUP_CONFIG:()=>iQ,YAxisLabel:()=>erL,replaceVariablesForDisplay:()=>rW,TOOLTIP_MIN_WIDTH:()=>eiQ,useId:()=>rE,getTitleAction:()=>nq,getYBuffer:()=>erS,PINNED_CROSSHAIR_SERIES_NAME:()=>nj,getPixelXFromGrid:()=>erc,getFormattedAxisLabel:()=>os,clearHighlightedSeries:()=>rk,FALLBACK_CHART_WIDTH:()=>ei3,restoreChart:()=>rA,FormatControls:()=>erE,transformData:()=>oC,getTimeSeriesValues:()=>uc,DEFAULT_LEGEND:()=>n1,OptionsEditorControl:()=>gE,formatDecimal:()=>i9,DiscardChangesConfirmationDialog:()=>gM,formatTime:()=>il,SelectionProvider:()=>tA,TimeChartTooltip:()=>erT,legendModes:()=>nX,EMPTY_TOOLTIP_DATA:()=>ere,isThroughputUnit:()=>rv,applyJoinTransform:()=>ob,TextField:()=>gn,SeriesInfo:()=>ero,getClosestTimestamp:()=>rO,DropIndicator:()=>gH,applyMergeColumnsTransform:()=>ow,isTemperatureUnit:()=>rb,limitDecimalPlaces:()=>ie,useSnackbar:()=>nz,dateFormatOptionsWithTimeZone:()=>or,calculateBarYBounds:()=>erf,DEFAULT_COLUMN_HEIGHT:()=>40,parseVariablesAndFormat:()=>rj,getCommonTimeScale:()=>uh,isBytesUnit:()=>rp,ModeSelector:()=>K$,OptionsEditorColumn:()=>gk,DECIMAL_UNIT_CONFIG:()=>i8,DEFAULT_PINNED_CROSSHAIR:()=>nH,TEMPERATURE_GROUP_CONFIG:()=>i5,NoDataOverlay:()=>K0,getResourceExtendedDisplayName:()=>uf,InterpolationFormat:()=>rL,ErrorBoundary:()=>Fp.ErrorBoundary,hasDataFieldPatterns:()=>r1,CURRENCY_UNIT_CONFIG:()=>iX,ToolbarIconButton:()=>erD,DEFAULT_TOOLTIP_CONFIG:()=>ern,TRANSFORM_TEXT:()=>rw,calculateBarBandwidth:()=>erd,ItemActionsProvider:()=>tb,isWithinPercentageRange:()=>erw,OPTIMIZED_MODE_SERIES_LIMIT:()=>1e3,legendPositions:()=>nZ,TIME_GROUP_CONFIG:()=>ii,defaultCursorData:()=>ei7,createTimezoneAwareAxisFormatter:()=>Fc,RefreshIntervalPicker:()=>eoe,legendSizes:()=>nK,BITS_GROUP_CONFIG:()=>ij,TOOLTIP_LABELS_MAX_WIDTH:()=>ei1,applyValueMapping:()=>ox,UNIT_GROUP_CONFIG:()=>rr,batchDispatchNearbySeriesActions:()=>rI,DEFAULT_COLUMN_WIDTH:()=>150,getGMTOffset:()=>oa,getPointInGrid:()=>rT,InfoTooltip:()=>gO,AlignSelector:()=>ej,JSONEditor:()=>KV,CURRENCY_GROUP_CONFIG:()=>iZ,TooltipHeader:()=>erk,SeriesMarker:()=>eiX,FontSizeSelector:()=>Fg,THROUGHPUT_UNIT_CONFIG:()=>rt,DEFAULT_COLUMN_MAX_WIDTH:()=>1e3,TOOLTIP_PADDING:()=>ei5,TimeZoneContext:()=>ug,TimeZoneProvider:()=>um,useDeepMemo:()=>oh,TransformsEditor:()=>er7,combineSx:()=>rP,getFormatterFromCache:()=>n6,applyMergeSeriesTransform:()=>o_,Legend:()=>gg,Dialog:()=>gC,getFormattedMultipleYAxes:()=>r_,replaceVariables:()=>rH,DECIMAL_GROUP_CONFIG:()=>i6,getResourceDisplayName:()=>up,SnackbarProvider:()=>nB,formatBytes:()=>iU,getUnitConfig:()=>rs,LoadingOverlay:()=>K1,formatWithTimeZone:()=>oo,legacyCheckforNearbySeries:()=>erx,replaceVariable:()=>rz,UNIT_CONFIG:()=>ro,testChartsTheme:()=>erB,TOOLTIP_ADJUST_Y_POS_MULTIPLIER:()=>ei2,interpolate:()=>rB,THROUGHPUT_GROUP_CONFIG:()=>i7,BYTES_UNIT_CONFIG:()=>iG,useChartsTheme:()=>ty,calculateBarSegmentBounds:()=>erp,checkCrosshairPinnedStatus:()=>rD,mockChartsContext:()=>erz,checkforNearbyTimeSeries:()=>ery,TOOLTIP_DATE_FORMAT:()=>ei9,hasDecimalPlaces:()=>n7,isCurrencyUnit:()=>ry,DEFAULT_COLUMN_MIN_WIDTH:()=>60,handleMoveUp:()=>mL,ContentWithLegend:()=>gv,OptionsEditorGroup:()=>gN,isUnitWithDecimalPlaces:()=>rg,SeriesLabelsStack:()=>eiK,getDateAndTime:()=>ol,getTableCellLayout:()=>pO,ChartsThemeContext:()=>tm,TooltipContent:()=>er_,isValidTraceId:()=>ud,formatCurrency:()=>iK,ValueMappingsEditor:()=>eoo,BYTES_GROUP_CONFIG:()=>i$,interpolateSelectionBatch:()=>ov,isLegendItemVisuallySelected:()=>u_,getFormattedAxis:()=>rS,getClosestTimestampInFullDataset:()=>rR,ChartsProvider:()=>tg,TimeZoneSelector:()=>eiZ,LinkEditorForm:()=>KH,SortSelector:()=>K5,formatValue:()=>ra,persesColumnsToTanstackColumns:()=>pR,NEARBY_SERIES_DESCRIPTION:()=>ei4,calculateVisualYForSeries:()=>erh,hasIndexedPatterns:()=>r0,ColorPicker:()=>td,useItemActions:()=>t_,getUnitGroup:()=>rl,formatThroughput:()=>rn,getTheme:()=>erQ,shouldShortenValues:()=>n9,MIN_STEP_INTERVAL_MS:()=>uu,buildRelativeTimeOption:()=>nG,useSelection:()=>tI,TEMPERATURE_UNIT_CONFIG:()=>i3,SortSelectorButtons:()=>K3,formatBits:()=>iW,getTimeZoneOptions:()=>nU,DYNAMIC_NEARBY_SERIES_MULTIPLIER:()=>erm,isUnitWithShortValues:()=>rm,getTooltipStyles:()=>eru,interpolateHeaders:()=>of,ErrorAlert:()=>Fd,OptionsColorPicker:()=>uy,getUnitGroupConfig:()=>ru,TOOLTIP_BG_COLOR_FALLBACK:()=>ei8,TOOLTIP_MAX_WIDTH:()=>eiJ,DragAndDropElement:()=>mP,extractFieldNames:()=>r2,isBitsUnit:()=>rf,SHOW_FEWER_SERIES_LIMIT:()=>erv,TIME_UNIT_CONFIG:()=>ir,INCREASE_NEARBY_SERIES_MULTIPLIER:()=>erg,isPercentUnit:()=>rh,getLegendSize:()=>n3,getSubmitText:()=>nY,handleMoveDown:()=>mN,PIN_TOOLTIP_HELP_TEXT:()=>eri,Table:()=>gc,typography:()=>erX,formatPercent:()=>i1,assembleTransform:()=>erl,formatTemperature:()=>i4,useTimeZone:()=>uv,createRegexFromString:()=>op,hasBatchPatterns:()=>rJ,PersesTimeToIntlTime:()=>io,parseFormat:()=>rX,FormActions:()=>Fm,getNearbySeriesData:()=>erb,useMemoized:()=>oc,isValidLegendPosition:()=>nQ,getLegendMode:()=>n5,EMPHASIZED_SERIES_DESCRIPTION:()=>ei6,replaceDataFields:()=>rK,Drawer:()=>m6,getLegendPosition:()=>n2,BITS_UNIT_CONFIG:()=>iH,EChart:()=>Fl,isTimeUnit:()=>rc,useChartsContext:()=>tv,interpolateQueryParams:()=>og,UNPIN_TOOLTIP_HELP_TEXT:()=>err,DateTimeRangePicker:()=>eiq,SettingsAutocomplete:()=>gF,ThresholdsEditor:()=>Qt,isDecimalUnit:()=>rd,enableDataZoom:()=>rM,replaceDataFieldsBatch:()=>rQ,useDragAndDropMonitor:()=>mR,useLocalStorage:()=>rC,isRegexPattern:()=>od});var o,a,s,l,u,c,h,d,p,f,g,m,v,y,x,b,w,S,_,C,M,A,k,T,I,D,O,R,P,E,L,N,B,z,F,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:()=>ka,BezierCurve:()=>ki,BoundingRect:()=>xZ,Circle:()=>AO,CompoundPath:()=>ks,Ellipse:()=>AE,Group:()=>Ah,Image:()=>Sx,IncrementalDisplayable:()=>kv,Line:()=>A9,LinearGradient:()=>ku,OrientedBoundingRect:()=>kg,Path:()=>Sp,Point:()=>xV,Polygon:()=>A1,Polyline:()=>A3,RadialGradient:()=>kc,Rect:()=>Sk,Ring:()=>AK,Sector:()=>AY,Text:()=>Sj,applyTransform:()=>kL,clipPointsByRect:()=>kz,clipRectByRect:()=>kF,createIcon:()=>kV,extendPath:()=>k_,extendShape:()=>kw,getShapeClass:()=>kM,getTransform:()=>kE,groupTransition:()=>kB,initProps:()=>_A,isElementRemoved:()=>_k,lineLineIntersect:()=>kH,linePolygonIntersect:()=>kj,makeImage:()=>kk,makePath:()=>kA,mergePath:()=>kI,registerShape:()=>kC,removeElement:()=>_T,removeElementWithFadeOut:()=>_D,resizePath:()=>kD,setTooltipConfig:()=>kW,subPixelOptimize:()=>kP,subPixelOptimizeLine:()=>kO,subPixelOptimizeRect:()=>kR,transformDirection:()=>kN,traverseElements:()=>kG,updateProps:()=>_M});var eb=n(62540),ew=n(70451),eS=n.n(ew),e_=n(11750),eC=n(81023),eM=n(59238),eA=n(41953),ek=n(24726),eT=n(77308),eI=n(23434),eD=n(26952),eO=n(72052),eR=n(29009),eP=n(46733);function eE(e){return(0,eP.Ay)("MuiButtonGroup",e)}let eL=(0,eR.A)("MuiButtonGroup",["root","contained","outlined","text","disableElevation","disabled","firstButton","fullWidth","horizontal","vertical","colorPrimary","colorSecondary","grouped","groupedHorizontal","groupedVertical","groupedText","groupedTextHorizontal","groupedTextVertical","groupedTextPrimary","groupedTextSecondary","groupedOutlined","groupedOutlinedHorizontal","groupedOutlinedVertical","groupedOutlinedPrimary","groupedOutlinedSecondary","groupedContained","groupedContainedHorizontal","groupedContainedVertical","groupedContainedPrimary","groupedContainedSecondary","lastButton","middleButton"]);var eN=n(94580),eB=n(30016);let ez=(0,eT.A)("div",{name:"MuiButtonGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${eL.grouped}`]:t.grouped},{[`& .${eL.grouped}`]:t[`grouped${(0,ek.A)(n.orientation)}`]},{[`& .${eL.grouped}`]:t[`grouped${(0,ek.A)(n.variant)}`]},{[`& .${eL.grouped}`]:t[`grouped${(0,ek.A)(n.variant)}${(0,ek.A)(n.orientation)}`]},{[`& .${eL.grouped}`]:t[`grouped${(0,ek.A)(n.variant)}${(0,ek.A)(n.color)}`]},{[`& .${eL.firstButton}`]:t.firstButton},{[`& .${eL.lastButton}`]:t.lastButton},{[`& .${eL.middleButton}`]:t.middleButton},t.root,t[n.variant],!0===n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,"vertical"===n.orientation&&t.vertical]}})((0,eI.A)(({theme:e})=>({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{variant:"contained"},style:{boxShadow:(e.vars||e).shadows[2]}},{props:{disableElevation:!0},style:{boxShadow:"none"}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${eL.lastButton},& .${eL.middleButton}`]:{borderTopRightRadius:0,borderTopLeftRadius:0},[`& .${eL.firstButton},& .${eL.middleButton}`]:{borderBottomRightRadius:0,borderBottomLeftRadius:0}}},{props:{orientation:"horizontal"},style:{[`& .${eL.firstButton},& .${eL.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${eL.lastButton},& .${eL.middleButton}`]:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}},{props:{variant:"text",orientation:"horizontal"},style:{[`& .${eL.firstButton},& .${eL.middleButton}`]:{borderRight:e.vars?`1px solid rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${"light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${eL.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:"text",orientation:"vertical"},style:{[`& .${eL.firstButton},& .${eL.middleButton}`]:{borderBottom:e.vars?`1px solid rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${"light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${eL.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter((0,eD.A)()).flatMap(([t])=>[{props:{variant:"text",color:t},style:{[`& .${eL.firstButton},& .${eL.middleButton}`]:{borderColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.5)`:(0,eM.X4)(e.palette[t].main,.5)}}}]),{props:{variant:"outlined",orientation:"horizontal"},style:{[`& .${eL.firstButton},& .${eL.middleButton}`]:{borderRightColor:"transparent","&:hover":{borderRightColor:"currentColor"}},[`& .${eL.lastButton},& .${eL.middleButton}`]:{marginLeft:-1}}},{props:{variant:"outlined",orientation:"vertical"},style:{[`& .${eL.firstButton},& .${eL.middleButton}`]:{borderBottomColor:"transparent","&:hover":{borderBottomColor:"currentColor"}},[`& .${eL.lastButton},& .${eL.middleButton}`]:{marginTop:-1}}},{props:{variant:"contained",orientation:"horizontal"},style:{[`& .${eL.firstButton},& .${eL.middleButton}`]:{borderRight:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${eL.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:"contained",orientation:"vertical"},style:{[`& .${eL.firstButton},& .${eL.middleButton}`]:{borderBottom:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${eL.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter((0,eD.A)(["dark"])).map(([t])=>({props:{variant:"contained",color:t},style:{[`& .${eL.firstButton},& .${eL.middleButton}`]:{borderColor:(e.vars||e).palette[t].dark}}}))],[`& .${eL.grouped}`]:{minWidth:40,boxShadow:"none",props:{variant:"contained"},style:{"&:hover":{boxShadow:"none"}}}}))),eF=ew.forwardRef(function(e,t){let n=(0,eO.b)({props:e,name:"MuiButtonGroup"}),{children:i,className:r,color:o="primary",component:a="div",disabled:s=!1,disableElevation:l=!1,disableFocusRipple:u=!1,disableRipple:c=!1,fullWidth:h=!1,orientation:d="horizontal",size:p="medium",variant:f="outlined",...g}=n,m={...n,color:o,component:a,disabled:s,disableElevation:l,disableFocusRipple:u,disableRipple:c,fullWidth:h,orientation:d,size:p,variant:f},v=(e=>{let{classes:t,color:n,disabled:i,disableElevation:r,fullWidth:o,orientation:a,variant:s}=e,l={root:["root",s,a,o&&"fullWidth",r&&"disableElevation",`color${(0,ek.A)(n)}`],grouped:["grouped",`grouped${(0,ek.A)(a)}`,`grouped${(0,ek.A)(s)}`,`grouped${(0,ek.A)(s)}${(0,ek.A)(a)}`,`grouped${(0,ek.A)(s)}${(0,ek.A)(n)}`,i&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,eC.A)(l,eE,t)})(m),y=ew.useMemo(()=>({className:v.grouped,color:o,disabled:s,disableElevation:l,disableFocusRipple:u,disableRipple:c,fullWidth:h,size:p,variant:f}),[o,s,l,u,c,h,p,f,v.grouped]),x=(0,eA.A)(i),b=x.length;return(0,eb.jsx)(ez,{as:a,role:"group",className:(0,e_.A)(v.root,r),ref:t,ownerState:m,...g,children:(0,eb.jsx)(eN.A.Provider,{value:y,children:x.map((e,t)=>{let n,i;return(0,eb.jsx)(eB.A.Provider,{value:(n=0===t,i=t===b-1,n&&i?"":n?v.firstButton:i?v.lastButton:v.middleButton),children:e},t)})})})});var eV=n(7013);function ej({onChange:e,value:t="left",...n}){let i=t=>{e(t)};return(0,eb.jsxs)(eF,{"aria-label":"Alignement",...n,children:[(0,eb.jsx)(eV.A,{onClick:()=>i("left"),variant:"left"===t?"contained":"outlined",children:"Left"},"left"),(0,eb.jsx)(eV.A,{onClick:()=>i("center"),variant:"center"===t?"contained":"outlined",children:"Center"},"center"),(0,eb.jsx)(eV.A,{onClick:()=>i("right"),variant:"right"===t?"contained":"outlined",children:"Right"},"right")]})}var eH=n(315),eW=n(47095),e$=n(93648),eG=n(29618),eU=n(98029);function eq(){return(eq=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 eY(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 eZ(e){var t=(0,ew.useRef)(e),n=(0,ew.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var eX,eK=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},eQ=function(e){return"touches"in e},eJ=function(e){return e&&e.ownerDocument.defaultView||self},e0=function(e,t,n){var i=e.getBoundingClientRect(),r=eQ(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:eK((r.pageX-(i.left+eJ(e).pageXOffset))/i.width),top:eK((r.pageY-(i.top+eJ(e).pageYOffset))/i.height)}},e1=function(e){eQ(e)||e.preventDefault()},e2=eS().memo(function(e){var t=e.onMove,n=e.onKey,i=e.onEnd,r=eY(e,["onMove","onKey","onEnd"]),o=(0,ew.useRef)(null),a=eZ(t),s=eZ(n),l=eZ(i),u=(0,ew.useRef)(null),c=(0,ew.useRef)(!1),h=(0,ew.useMemo)(function(){var e=function(e){e1(e),(eQ(e)?e.touches.length>0:e.buttons>0)&&o.current?a(e0(o.current,e,u.current)):(n(!1),l())},t=function(){n(!1),l()};function n(n){var i=c.current,r=eJ(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&&(e1(t),(!c.current||eQ(t))&&i)){if(eQ(t)){c.current=!0;var r=t.changedTouches||[];r.length&&(u.current=r[0].identifier)}i.focus(),a(e0(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,ew.useEffect)(function(){return g},[g]),eS().createElement("div",eq({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:o,onKeyDown:p,onKeyUp:f,tabIndex:0,role:"slider"}))}),e5=function(e){return e.filter(Boolean).join(" ")},e3=function(e){var t=e.color,n=e.left,i=e.top,r=e5(["react-colorful__pointer",e.className]);return eS().createElement("div",{className:r,style:{top:100*(void 0===i?.5:i)+"%",left:100*n+"%"}},eS().createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},e4=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},e6=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?e4(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?e4(parseInt(e.substring(6,8),16)/255,2):1}},e8=function(e){var t=e.s,n=e.v,i=e.a,r=(200-t)*n/100;return{h:e4(e.h),s:e4(r>0&&r<200?t*n/100/(r<=100?r:200-r)*100:0),l:e4(r/2),a:e4(i,2)}},e9=function(e){var t=e8(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},e7=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:e4(255*[i,s,a,a,l,i][u]),g:e4(255*[l,i,i,s,a,a][u]),b:e4(255*[a,a,l,i,i,s][u]),a:e4(r,2)}},te=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},tt=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=r<1?te(e4(255*r)):"";return"#"+te(t)+te(n)+te(i)+o},tn=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:e4(60*(s<0?s+6:s)),s:e4(o?a/o*100:0),v:e4(o/255*100),a:r}},ti=eS().memo(function(e){var t=e.hue,n=e.onChange,i=e.onChangeEnd,r=e5(["react-colorful__hue",e.className]);return eS().createElement("div",{className:r},eS().createElement(e2,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:eK(t+360*e.left,0,360)})},onEnd:i,"aria-label":"Hue","aria-valuenow":e4(t),"aria-valuemax":"360","aria-valuemin":"0"},eS().createElement(e3,{className:"react-colorful__hue-pointer",left:t/360,color:e9({h:t,s:100,v:100,a:1})})))}),tr=eS().memo(function(e){var t=e.hsva,n=e.onChange,i=e.onChangeEnd,r={backgroundColor:e9({h:t.h,s:100,v:100,a:1})};return eS().createElement("div",{className:"react-colorful__saturation",style:r},eS().createElement(e2,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:eK(t.s+100*e.left,0,100),v:eK(t.v-100*e.top,0,100)})},onEnd:i,"aria-label":"Color","aria-valuetext":"Saturation "+e4(t.s)+"%, Brightness "+e4(t.v)+"%"},eS().createElement(e3,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:e9(t)})))}),to=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},ta="u">typeof window?ew.useLayoutEffect:ew.useEffect,ts=new Map,tl=function(e){ta(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!ts.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}',ts.set(t,i);var r=eX||n.nc;r&&i.setAttribute("nonce",r),t.head.appendChild(i)}},[])},tu=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=eY(e,["className","colorModel","color","onChange","onChangeEnd"]),g=(0,ew.useRef)(null);tl(g);var m=(t=eZ(d),n=eZ(p),r=(i=(0,ew.useState)(function(){return u.toHsva(h)}))[0],o=i[1],a=(0,ew.useRef)({color:h,hsva:r}),s=(0,ew.useRef)(!1),(0,ew.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,ew.useEffect)(function(){var e;to(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,ew.useCallback)(function(e){o(function(t){return Object.assign({},t,e)})},[]),(0,ew.useCallback)(function(){s.current&&(s.current=!1,n(a.current.color))},[n])]),v=m[0],y=m[1],x=m[2],b=e5(["react-colorful",l]);return eS().createElement("div",eq({},f,{ref:g,className:b}),eS().createElement(tr,{hsva:v,onChange:y,onChangeEnd:x}),eS().createElement(ti,{hue:v.h,onChange:y,onChangeEnd:x,className:"react-colorful__last-control"}))},tc={defaultColor:"000",toHsva:function(e){return tn(e6(e))},fromHsva:function(e){return tt(e7({h:e.h,s:e.s,v:e.v,a:1}))},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||to(e6(e),e6(t))}},th=function(e){return eS().createElement(tu,eq({},e,{colorModel:tc}))};let td=({color:e,onChange:t,onClear:n,palette:i})=>{let[r,o]=(0,ew.useState)(e),a=e=>{o(e),t?.(e)};return(0,eb.jsxs)(eH.A,{spacing:1,children:[(0,eb.jsx)(th,{color:e,onChange:a,style:{width:"100%"}}),(0,eb.jsx)(eH.A,{direction:"row",flexWrap:"wrap",justifyContent:"space-evenly",width:"200px",children:i&&i.map((e,t)=>(0,eb.jsx)(eW.A,{size:"small","aria-label":`change color to ${e}`,sx:{color:e},onClick:()=>a(e),children:(0,eb.jsx)(eG,{})},t))}),(0,eb.jsxs)(eH.A,{direction:"row",gap:1,alignItems:"center",children:[(0,eb.jsx)(e$.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}`),tp(e.target.value)&&t?.(e.target.value)}}),n&&(0,eb.jsx)(eW.A,{onClick:n,children:(0,eb.jsx)(eU,{})})]})]})},tp=(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 tf=n(91823);function tg(e){let{children:t,chartsTheme:n,enablePinning:i=!1,enableSyncGrouping:r=!0}=e,[o,a]=(0,ew.useState)(null),s=(0,ew.useMemo)(()=>({chartsTheme:n,enablePinning:i,lastTooltipPinnedCoords:o,enableSyncGrouping:r,setLastTooltipPinnedCoords:a}),[n,i,r,o,a]);return(0,eb.jsx)(tm.Provider,{value:s,children:t})}let tm=(0,ew.createContext)(void 0);function tv(){let e=(0,ew.useContext)(tm);if(void 0===e)throw Error("No ChartsThemeContext found. Did you forget a Provider?");return e}function ty(){return tv().chartsTheme}let tx=(0,ew.createContext)(void 0);function tb({children:e}){let[t,n]=(0,ew.useState)(new Map),i=(0,ew.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,ew.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,ew.useMemo)(()=>({actionStatuses:t,setActionStatus:i,clearActionStatus:r}),[t,i,r]);return(0,eb.jsx)(tx.Provider,{value:o,children:e})}let tw=()=>{},tS={actionStatuses:new Map,setActionStatus:tw,clearActionStatus:tw,hasContext:!1};function t_(){let e=(0,ew.useContext)(tx);return(0,ew.useMemo)(()=>e?{...e,hasContext:!0}:tS,[e])}let tC=(0,ew.createContext)(void 0),tM=(e,t)=>t;function tA({children:e}){let[t,n]=(0,ew.useState)(new Map),i=(0,ew.useRef)(tM),r=(0,ew.useCallback)(e=>{i.current=e},[]),o=(0,ew.useCallback)(e=>{let t=new Map;e.forEach(({item:e,id:n})=>t.set(n,e)),n(t)},[]),a=(0,ew.useCallback)((e,t)=>{n(n=>{let i=new Map(n);return i.has(t)?i.delete(t):i.set(t,e),i})},[]),s=(0,ew.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),l=(0,ew.useCallback)(()=>n(new Map),[]),u=(0,ew.useCallback)((e,n)=>t.has(i.current(e,n)),[t]),c=(0,ew.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)(tC.Provider,{value:c,children:e})}let tk=()=>{},tT={selectionMap:new Map,setSelection:tk,toggleSelection:tk,removeFromSelection:tk,clearSelection:tk,isSelected:()=>!1,hasContext:!1};function tI(e){let t=(0,ew.useContext)(tC);return(0,ew.useEffect)(()=>{t&&e?.getId&&t.registerGetId(e.getId)},[t,e?.getId]),(0,ew.useMemo)(()=>{if(!t)return tT;let{registerGetId:e,...n}=t;return{...n,hasContext:!0}},[t])}var tD=n(20231),tO=n.n(tD);let tR=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},tP={data:""},tE=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,tL=/\/\*[^]*?\*\/| +/g,tN=/\n+/g,tB=(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]?tB(a,o):o+"{"+tB(a,"k"==o[1]?"":t)+"}":"object"==typeof a?i+=tB(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+=tB.p?tB.p(o,a):o+":"+a+";")}return n+(t&&r?t+"{"+r+"}":r)+i},tz={},tF=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+tF(e[n]);return t}return e};function tV(e){let t,n,i=this||{},r=e.call?e(i.p):e;return((e,t,n,i,r)=>{var o;let a=tF(e),s=tz[a]||(tz[a]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(a));if(!tz[s]){let t=a!==e?e:(e=>{let t,n,i=[{}];for(;t=tE.exec(e.replace(tL,""));)t[4]?i.shift():t[3]?(n=t[3].replace(tN," ").trim(),i.unshift(i[0][n]=i[0][n]||{})):i[0][t[1]]=t[2].replace(tN," ").trim();return i[0]})(e);tz[s]=tB(r?{["@keyframes "+s]:t}:t,n?"":"."+s)}let l=n&&tz.g;return n&&(tz.g=tz[s]),o=tz[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?"":tB(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||tP})(i.target),i.g,i.o,i.k)}function tj(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 tH(e,t,n){return t&&tj(e.prototype,t),n&&tj(e,n),e}function tW(){return(tW=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 t$(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function tG(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 tU(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}tV.bind({g:1}),tV.bind({k:1});var tq=function(){return""},tY=eS().createContext({enqueueSnackbar:tq,closeSnackbar:tq}),tZ="@media (max-width:599.95px)",tX="@media (min-width:600px)",tK=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},tQ=function(e){return""+tK(e.vertical)+tK(e.horizontal)},tJ=function(e){return!!e||0===e},t0="unmounted",t1="exited",t2="entering",t5="entered",t3="exiting",t4=function(e){function t(t){var n,i=e.call(this,t)||this,r=t.appear;return i.appearStatus=null,t.in?r?(n=t1,i.appearStatus=t2):n=t5:n=t.unmountOnExit||t.mountOnEnter?t0:t1,i.state={status:n},i.nextCallback=null,i}t$(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===t0?{status:t1}: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!==t2&&n!==t5&&(t=t2):(n===t2||n===t5)&&(t=t3)}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===t2?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===t1&&this.setState({status:t0})},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:t2},function(){t.props.onEntering&&t.props.onEntering(t.node,e),t.onTransitionEnd(i.enter,function(){t.safeSetState({status:t5},function(){t.props.onEntered&&t.props.onEntered(t.node,e)})})})):this.safeSetState({status:t5},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:t3},function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:t1},function(){e.props.onExited&&e.props.onExited(e.node)})})})):this.safeSetState({status:t1},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===t0)return null;var t=this.props;return(0,t.children)(e,tG(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},tH(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}(eS().Component);function t6(){}function t8(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function t9(e,t){return(0,ew.useMemo)(function(){return null==e&&null==t?null:function(n){t8(e,n),t8(t,n)}},[e,t])}function t7(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}}t4.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:t6,onEntering:t6,onEntered:t6,onExit:t6,onExiting:t6,onExited:t6};var ne=function(e){e.scrollTop=e.scrollTop},nt=function(e){return Math.round(e)+"ms"};function nn(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:nt(r))+" "+a+" "+("string"==typeof l?l:nt(l))}).join(",")}function ni(e){return(e&&e.ownerDocument||document).defaultView||window}function nr(e,t){if(t){var n=function(e,t){var n,i=t.getBoundingClientRect(),r=ni(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 no=(0,ew.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=tG(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),f=(0,ew.useRef)(null),g=t9(n.ref,f),m=t9(g,t),v=(0,ew.useCallback)(function(){f.current&&nr(r,f.current)},[r]);return(0,ew.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&&nr(r,f.current)}),t=ni(f.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}},[r,o]),(0,ew.useEffect)(function(){o||v()},[o,v]),(0,ew.createElement)(t4,Object.assign({appear:!0,nodeRef:f,onEnter:function(e,t){nr(r,e),ne(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=t7({timeout:l,mode:"enter",style:tW({},a,{transitionTimingFunction:t})});e.style.webkitTransition=nn("-webkit-transform",n),e.style.transition=nn("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=t7({timeout:l,mode:"exit",style:tW({},a,{transitionTimingFunction:t})});e.style.webkitTransition=nn("-webkit-transform",n),e.style.transition=nn("transform",n),nr(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,ew.cloneElement)(n,tW({ref:m,style:tW({visibility:"exited"!==e||o?void 0:"hidden"},a,{},n.props.style)},t))})});no.displayName="Slide";var na=function(e){return eS().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))},ns={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:eS().createElement(function(){return eS().createElement(na,null,eS().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:eS().createElement(function(){return eS().createElement(na,null,eS().createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},null),error:eS().createElement(function(){return eS().createElement(na,null,eS().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:eS().createElement(function(){return eS().createElement(na,null,eS().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:no,transitionDuration:{enter:225,exit:195}},nl=function(e,t){var n=function(e){return"number"==typeof e||null===e};return n(e)?e:n(t)?t:ns.autoHideDuration},nu=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"])?tW({},ns.transitionDuration,{},n(t,["object"])&&t,{},e):n(t,["string","number"])?t:n(t,["object"])?tW({},ns.transitionDuration,{},t):ns.transitionDuration};function nc(e){return Object.entries(e).reduce(function(e,t){var n,i=t[0],r=t[1];return tW({},e,((n={})[i]=tV(r),n))},{})}var nh="notistack-CollapseWrapper",nd=nc({root:{height:0},entered:{height:"auto"}}),np=(0,ew.forwardRef)(function(e,t){var n=e.children,i=e.in,r=e.onExited,o=(0,ew.useRef)(null),a=(0,ew.useRef)(null),s=t9(t,a),l=function(){return o.current?o.current.clientHeight:0};return(0,ew.createElement)(t4,{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=t7({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){ne(e);var t=t7({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,ew.createElement)("div",Object.assign({ref:s,className:tR(nd.root,"entered"===e&&nd.entered),style:tW({pointerEvents:"all",overflow:"hidden",minHeight:"0px",transition:nn("height")},"entered"===e&&{overflow:"visible"},{},"exited"===e&&!i&&{visibility:"hidden"})},t),(0,ew.createElement)("div",{ref:o,className:nh,style:{display:"flex",width:"100%"}},n))})});np.displayName="Collapse";var nf={right:"left",left:"right",bottom:"up",top:"down"},ng=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 tW({},t,((i={})[n]=e[n],i))},{})},nm=function(){};function nv(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)}},nm)}var ny="u">typeof window?ew.useLayoutEffect:ew.useEffect;function nx(e){var t=(0,ew.useRef)(e);return ny(function(){t.current=e}),(0,ew.useCallback)(function(){return t.current.apply(void 0,arguments)},[])}var nb=(0,ew.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,ew.useRef)(),p=nx(function(){s&&s.apply(void 0,arguments)}),f=nx(function(e){s&&null!=e&&(d.current&&clearTimeout(d.current),d.current=setTimeout(function(){p(null,"timeout",l)},e))});(0,ew.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,ew.useCallback)(function(){null!=r&&f(.5*r)},[r,f]);return(0,ew.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,ew.createElement)("div",Object.assign({ref:t},h,{className:tR("notistack-Snackbar",i),onMouseEnter:function(e){h.onMouseEnter&&h.onMouseEnter(e),g()},onMouseLeave:function(e){h.onMouseLeave&&h.onMouseLeave(e),m()}}),n)});nb.displayName="Snackbar";var nw=nc({root:((aW={display:"flex",flexWrap:"wrap",flexGrow:1})[tX]={flexGrow:"initial",minWidth:"288px"},aW)}),nS=(0,ew.forwardRef)(function(e,t){var n=e.className,i=tG(e,["className"]);return eS().createElement("div",Object.assign({ref:t,className:tR(nw.root,n)},i))});nS.displayName="SnackbarContent";var n_=nc({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"}}),nC="notistack-snackbar",nM=(0,ew.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)),eS().createElement(nS,{ref:t,role:"alert","aria-describedby":nC,style:l,className:tR("notistack-MuiContent","notistack-MuiContent-"+a,n_.root,n_[a],u,!s&&c&&n_.lessPadding)},eS().createElement("div",{id:nC,className:n_.message},s?null:c,i),h&&eS().createElement("div",{className:n_.action},h))});nM.displayName="MaterialDesignContent";var nA=(0,ew.memo)(nM),nk=nc({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),nT=function(e){var t,n=(0,ew.useRef)(),i=(0,ew.useState)(!0),r=i[0],o=i[1],a=nv([e.snack.onClose,e.onClose]),s=(0,ew.useCallback)(function(){n.current=setTimeout(function(){o(function(e){return!e})},125)},[]);(0,ew.useEffect)(function(){return function(){n.current&&clearTimeout(n.current)}},[]);var l=e.snack,u=e.classes,c=e.Component,h=(0,ew.useMemo)(function(){return ng(u)},[u]),d=l.open,p=l.SnackbarProps,f=l.TransitionComponent,g=l.TransitionProps,m=l.transitionDuration,v=l.disableWindowBlurListener,y=l.content,x=tG(l,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),b=tW({direction:"center"!==(t=x.anchorOrigin).horizontal?nf[t.horizontal]:nf[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 tW({},t,((i={})[n]=nv([e.snack[n],e[n]],x.id),i))},{});return eS().createElement(np,{in:r,onExited:S.onExited},eS().createElement(nb,{open:d,id:x.id,disableWindowBlurListener:v,autoHideDuration:x.autoHideDuration,className:tR(nk.wrappedRoot,h.root,h["anchorOrigin"+tQ(x.anchorOrigin)]),SnackbarProps:p,onClose:a},eS().createElement(f,Object.assign({},b,{appear:!0,in:d,onExit:S.onExit,onExited:s,onEnter:S.onEnter,onEntered:nv([S.onEntered,function(){e.snack.requestClose&&a(null,"instructed",e.snack.id)}],x.id)}),w||eS().createElement(void 0===c?nA:c,Object.assign({},x)))))},nI=20,nD=6,nO=2,nR="."+nh,nP=nc({root:((a$={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:nn(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"})[nR]={padding:nD+"px 0px",transition:"padding 300ms ease 0ms"},a$.maxWidth="calc(100% - "+2*nI+"px)",a$[tZ]={width:"100%",maxWidth:"calc(100% - 32px)"},a$),rootDense:((aG={})[nR]={padding:nO+"px 0px"},aG),top:{top:nI-nD+"px",flexDirection:"column"},bottom:{bottom:nI-nD+"px",flexDirection:"column-reverse"},left:((aU={left:nI+"px"})[tX]={alignItems:"flex-start"},aU[tZ]={left:"16px"},aU),right:((aq={right:nI+"px"})[tX]={alignItems:"flex-end"},aq[tZ]={right:"16px"},aq),center:((aY={left:"50%",transform:"translateX(-50%)"})[tX]={alignItems:"center"},aY)}),nE=(0,ew.memo)(function(e){var t=e.classes,n=void 0===t?{}:t,i=e.anchorOrigin,r=e.dense,o=e.children,a=tR("notistack-SnackbarContainer",nP[i.vertical],nP[i.horizontal],nP.root,n.containerRoot,n["containerAnchorOrigin"+tQ(i)],r&&nP.rootDense);return eS().createElement("div",{className:a},o)}),nL=function(e){return!("string"==typeof e||(0,ew.isValidElement)(e))},nN=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=nL(e)?e:t,o=nL(e)?e.message:e,a=r.key,s=r.preventDuplicate,l=tG(r,["key","preventDuplicate"]),u=tJ(a),c=u?a:new Date().getTime()+Math.random(),h=(i=n.props,function(e,t){return(void 0===t&&(t=!1),t)?tW({},ns[e],{},i[e],{},l[e]):"autoHideDuration"===e?nl(l.autoHideDuration,i.autoHideDuration):"transitionDuration"===e?nu(l.transitionDuration,i.transitionDuration):l[e]||i[e]||ns[e]}),d=tW({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:tR(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(tW({},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?tW({},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?tW({},e):(t=!0,e.entered)?(e.onClose&&e.onClose(null,"maxsnack",e.id),n.props.onClose&&n.props.onClose(null,"maxsnack",e.id),tW({},e,{open:!1})):tW({},e,{requestClose:!0})});return tW({},e,{snacks:r})},n.handleEnteredSnack=function(e,t,i){if(!tJ(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?tW({},e,{entered:!0}):tW({},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?tW({},e,{open:!1}):tW({},e,{requestClose:!0}):tW({},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});tJ(e)&&t&&t.onClose&&t.onClose(null,"instructed",e),n.handleCloseSnack(null,"instructed",e)},n.handleExitedSnack=function(e,t){if(!tJ(t))throw Error("handleExitedSnack Cannot be called with undefined key");n.setState(function(e){var i=n.processQueue(tW({},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(tU(n)),closeSnackbar:n.closeSnackbar.bind(tU(n))}},n}return t$(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=tQ(t.anchorOrigin),r=e[i]||[];return tW({},e,((n={})[i]=[].concat(r,[t]),n))},{}),h=Object.keys(c).map(function(t){var n=c[t],i=n[0];return eS().createElement(nE,{key:t,dense:a,anchorOrigin:i.anchorOrigin,classes:u},n.map(function(t){return eS().createElement(nT,{key:t.id,snack:t,classes:u,Component:l[t.variant],onClose:e.handleCloseSnack,onEnter:e.props.onEnter,onExit:e.props.onExit,onExited:nv([e.handleExitedSnack,e.props.onExited],t.id),onEntered:nv([e.handleEnteredSnack,e.props.onEntered],t.id)})}))});return eS().createElement(tY.Provider,{value:t},r,i?(0,tD.createPortal)(h,i):h)},tH(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||ns.maxSnack}}]),t}(ew.Component);function nB({children:e,...t}){return(0,eb.jsx)(nN,{...t,Components:{error:(0,eT.A)(nA)(()=>({"&.notistack-MuiContent-error":{whiteSpace:"pre-wrap"}}))},children:e})}function nz(){let{enqueueSnackbar:e,closeSnackbar:t}=(0,ew.useContext)(tY),n=nF(e,"error"),i=nF(e,"info"),r=nF(e,"warning"),o=nF(e,"success"),a=(0,ew.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 nF(e,t){return(0,ew.useCallback)((n,i)=>e(n,{...i,variant:t}),[e,t])}var nV=n(25632);let nj="Pinned Crosshair",nH={name:nj,type:"line",markLine:{data:[],lineStyle:{type:"dashed",width:2},emphasis:{lineStyle:{width:2,opacity:1}},blur:{lineStyle:{width:2,opacity:1}}}};var nW=n(97618),n$=n(94461);function nG(e){return{value:{pastDuration:e},display:`Last ${(0,n$.formatDuration)((0,nW.pW)(e),{delimiter:", "})}`}}function nU(){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 nq(e,t){return"read"===e?"View":t&&"create"===e?"Add":t||"create"!==e?"update"===e?"Edit":"":"Create"}function nY(e,t){return t&&"create"===e?"Add":t&&"update"===e?"Apply":t?"":"Save"}let nZ=["bottom","right"],nX=["list","table"],nK=["small","medium"];function nQ(e){return nZ.includes(e)}function nJ(e){return nX.includes(e)}function n0(e){return nK.includes(e)}let n1={position:"bottom",mode:"list",size:"medium"};function n2(e){return void 0===e?n1.position:nQ(e)?e:n1.position}function n5(e){return e&&nJ(e)?e:n1.mode}function n3(e){return e&&n0(e)?e:n1.size}let n4=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 n6(e,t,n,i="en-US"){let r=`${e.filter(e=>![void 0,null,"",NaN].includes(e)).join("|")}|${i}`,o=n4.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 n8=()=>({countCacheItems:e=>"all"!==e?n4.get(e)?.size??0:Array.from(n4.values()).reduce((e,t)=>e+(t?.size??0),0),getKeys:e=>[...n4.get(e)?.keys()||[]]});function n9(e){return!1!==e}function n7(e){return"number"==typeof e}function ie(e){return e&&(e<0?e=0:e>20&&(e=20)),e}let it="Time",ii={label:"Time",decimalPlaces:!0},ir={nanoseconds:{group:it,label:"Nanoseconds"},microseconds:{group:it,label:"Microseconds"},milliseconds:{group:it,label:"Milliseconds"},seconds:{group:it,label:"Seconds"},minutes:{group:it,label:"Minutes"},hours:{group:it,label:"Hours"},days:{group:it,label:"Days"},weeks:{group:it,label:"Weeks"},months:{group:it,label:"Months"},years:{group:it,label:"Years"}};var io=((aj={}).nanoseconds="nanosecond",aj.microseconds="microsecond",aj.milliseconds="millisecond",aj.seconds="second",aj.minutes="minute",aj.hours="hour",aj.days="day",aj.weeks="week",aj.months="month",aj.years="year",aj);let ia={years:31536e3,months:2592e3,weeks:604800,days:86400,hours:3600,minutes:60,seconds:1,milliseconds:.001,microseconds:1e-6,nanoseconds:1e-9},is=["years","months","weeks","days","hours","minutes","seconds","milliseconds","microseconds","nanoseconds"];function il(e,{unit:t,decimalPlaces:n}){var i;if(0===e)return"0s";let r=function(e,t){let n=e*ia[t],i=is[0]||"years",r=i,o=n/ia[i];for(r of is)if((o=n/ia[r])>=1)break;return{value:o,unit:r}}(e,t??"seconds"),o={style:"unit",unit:io[r.unit],unitDisplay:"months"===(i=r.unit)||"years"===i?"long":"narrow"};return n7(n)?(o.minimumFractionDigits=ie(n),o.maximumFractionDigits=ie(n)):o.maximumSignificantDigits=3,n6([o.style,o.unit,o.unitDisplay,o.maximumSignificantDigits,n,t??"seconds"],"time",o,"en-US")(r.value)}var iu="u">typeof globalThis?globalThis:"u">typeof window?window:void 0!==n.g?n.g:"u">typeof self?self:{};function ic(){if(aQ)return aK;aQ=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 aK={unformat:function(n,i){let r,o=ip(),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 ih(){if(a0)return aJ;a0=1;let e=ic(),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 aJ={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 id=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 ip(){let e;if(a2)return a1;a2=1;let t=aX?aZ:(aX=1,aZ={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=ih(),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=id(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,a1=i}var ig={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,_,C=z.prototype={constructor:z,toString:null,valueOf:null},M=new z(1),A=20,k=4,T=-7,I=21,D=-1e7,O=1e7,R=!1,P=1,E=0,L={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},N="0123456789abcdefghijklmnopqrstuvwxyz",B=!0;function z(e,t){var i,o,s,l,u,c,d,p,f=this;if(!(f instanceof z))return new z(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<D?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 z(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,z.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&&z.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<D)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 F(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>=I)?p(l,a):f(l,a,"0");else if(o=(e=H(new z(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 z(e[0]);r<e.length;r++)(i=new z(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<D?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<D&&(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>=I?p(t,n):f(t,n,"0"),e.s<0?"-"+t:t)}return z.clone=e,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.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],I=n[1]):(h(n,-1e9,1e9,t),T=-(I=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),D=n[0],O=n[1];else if(h(n,-1e9,1e9,t),n)D=-(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))R=n;else throw R=!n,Error(o+"crypto unavailable");else R=n;else throw Error(o+t+" not true or false: "+n);if(e.hasOwnProperty(t="MODULO_MODE")&&(h(n=e[t],0,9,t),P=n),e.hasOwnProperty(t="POW_PRECISION")&&(h(n=e[t],0,1e9,t),E=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,I],RANGE:[D,O],CRYPTO:R,MODULO_MODE:P,POW_PRECISION:E,FORMAT:L,ALPHABET:N}},z.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!z.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)},z.maximum=z.max=function(){return V(arguments,-1)},z.minimum=z.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)},z.random=function(e){var t,n,a,l,u,c=0,d=[],p=new z(M);if(null==e?e=A:h(e,0,1e9),l=i(e/14),R)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 R=!1,Error(o+"crypto unavailable");if(!R)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},z.sum=function(){for(var e=1,t=arguments,n=new z(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=E,E=0,n=n.replace(".",""),p=(m=new z(i)).pow(n.length-v),E=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,_,C,M,A,k=i.s==o.s?1:-1,T=i.c,I=o.c;if(!T||!T[0]||!I||!I[0])return new z(!i.s||!o.s||(T?I&&T[0]==I[0]:!I)?NaN:T&&0==T[0]||!I?0*k:k/0);for(y=(v=new z(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;I[d]==(T[d]||0);d++);if(I[d]>(T[d]||0)&&h--,k<0)y.push(1),p=!0;else{for(_=T.length,M=I.length,d=0,k+=2,(f=r(u/(I[0]+1)))>1&&(I=e(I,f,u),T=e(T,f,u),M=I.length,_=T.length),S=M,b=(x=T.slice(0,M)).length;b<M;x[b++]=0);A=[0].concat(A=I.slice()),C=I[0],I[1]>=u/2&&C++;do{if(f=0,(c=t(I,x,M,b))<0){if(w=x[0],M!=b&&(w=w*u+(x[1]||0)),(f=r(w/C))>1)for(f>=u&&(f=u-1),m=(g=e(I,f,u)).length,b=x.length;1==t(g,x,m,b);)f--,n(g,M<m?A:I,m,u),m=g.length,c=1;else 0==f&&(c=f=1),m=(g=I.slice()).length;if(m<b&&(g=[0].concat(g)),n(x,g,b,u),b=x.length,-1==c)for(;1>t(I,x,M,b);)f++,n(x,M<b?A:I,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 z(a,r);if(z.DEBUG)throw Error(o+"Not a"+(i?" base "+i:"")+" number: "+t);e.s=null}e.c=e.e=null},C.absoluteValue=C.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return c(this,new z(e,t))},C.decimalPlaces=C.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 z(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},C.dividedBy=C.div=function(e,t){return w(this,new z(e,t),A,k)},C.dividedToIntegerBy=C.idiv=function(e,t){return w(this,new z(e,t),0,1)},C.exponentiatedBy=C.pow=function(e,t){var n,a,s,l,u,c,h,p,f,g=this;if((e=new z(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+W(e));if(null!=t&&(t=new z(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 z(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 z(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 z(h?1/l:l);E&&(l=i(E/14+2))}for(c?(n=new z(.5),h&&(e.s=1),p=d(e)):p=(s=Math.abs(+W(e)))%2,f=new z(M);;){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=M.div(f)),t?f.mod(t):l?H(f,E,k,u):f)},C.integerValue=function(e){var t=new z(this);return null==e?e=k:h(e,0,8),H(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return 0===c(this,new z(e,t))},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return c(this,new z(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return 1===(t=c(this,new z(e,t)))||0===t},C.isInteger=function(){return!!this.c&&l(this.e/14)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return 0>c(this,new z(e,t))},C.isLessThanOrEqualTo=C.lte=function(e,t){return -1===(t=c(this,new z(e,t)))||0===t},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.minus=function(e,t){var n,i,r,o,a=this.s;if(t=(e=new z(e,t)).s,!a||!t)return new z(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 z(h?this:NaN);if(!c[0]||!h[0])return h[0]?(e.s=-t,e):new z(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)},C.modulo=C.mod=function(e,t){var n,i;return(e=new z(e,t),this.c&&e.s&&(!e.c||e.c[0]))?e.c&&(!this.c||this.c[0])?(9==P?(i=e.s,e.s=1,n=w(this,e,0,3),e.s=i,n.s*=i):n=w(this,e,0,P),(e=this.minus(n.times(e))).c[0]||1!=P||(e.s=this.s),e):new z(this):new z(NaN)},C.multipliedBy=C.times=function(e,t){var n,i,r,o,a,s,u,c,h,d,p,f,g,m=this.c,v=(e=new z(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)},C.negated=function(){var e=new z(this);return e.s=-e.s||null,e},C.plus=function(e,t){var n,i=this.s;if(t=(e=new z(e,t)).s,!i||!t)return new z(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 z(i/0);if(!a[0]||!s[0])return s[0]?e:new z(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)},C.precision=C.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 z(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},C.shiftedBy=function(e){return h(e,-0x1fffffffffffff,0x1fffffffffffff),this.times("1e"+e)},C.squareRoot=C.sqrt=function(){var e,t,n,i,r,o=this.c,a=this.s,s=this.e,c=A+4,h=new z("0.5");if(1!==a||!o||!o[0])return new z(!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 z(t=a==1/0?"5e"+s:(t=a.toExponential()).slice(0,t.indexOf("e")+1)+s)):n=new z(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)},C.toExponential=function(e,t){return null!=e&&(h(e,0,1e9),e++),F(this,e,t,1)},C.toFixed=function(e,t){return null!=e&&(h(e,0,1e9),e=e+this.e+1),F(this,e,t)},C.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||"")},C.toFraction=function(e){var t,n,i,r,a,l,c,h,d,p,f,g,m=this.c;if(null!=e&&(!(c=new z(e)).isInteger()&&(c.c||1!==c.s)||c.lt(M)))throw Error(o+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+W(c));if(!m)return new z(this);for(t=new z(M),d=n=new z(M),i=h=new z(M),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 z(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},C.toNumber=function(){return+W(this)},C.toPrecision=function(e,t){return null!=e&&h(e,1,1e9),F(this,e,t,2)},C.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>=I?p(u(n.c),r):f(u(n.c),r,"0"):10===e&&B?t=f(u((n=H(new z(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},C.valueOf=C.toJSON=function(){return W(this)},C._isBigNumber=!0,null!=t&&z.set(t),z}()).default=t.BigNumber=t,ig.exports?ig.exports=t:(e||(e="u">typeof self&&self?self:window),e.BigNumber=t)})(iu);var im=ig.exports;let iv=ip(),iy=ih(),ix={trillion:1e12,billion:1e9,million:1e6,thousand:1e3},ib={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:iw,decimalSuffixes:iS}=iv.currentBytes(),i_={scale:1024,suffixes:iS,marker:"bd"},iC={scale:1024,suffixes:iw,marker:"b"},iM={scale:1e3,suffixes:iS,marker:"d"};function iA(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 ik(e){let t="";for(let n=0;n<e;n++)t+="0";return t}function iT({instance:e,providedFormat:t,state:n=iv,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({},ib,r,t),x=y.totalLength,b=x?0:y.characteristic,w=y.optionalCharacteristic,S=y.forceAverage,_=y.lowPrecision,C=!!x||!!S||y.average,M=x?-1:C&&void 0===t.mantissa?0:y.mantissa,A=!x&&(void 0===t.optionalMantissa?-1===M:y.optionalMantissa),k=y.trimMantissa,T=y.thousandSeparated,I=y.spaceSeparated,D=y.negative,O=y.forceSign,R=y.exponential,P=y.roundingFunction,E="";if(C){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]&&ix[t]?(s=i[t],e/=ix[t]):l>=ix.trillion||n&&1===a(l/ix.trillion)?(s=i.trillion,e/=ix.trillion):l<ix.trillion&&l>=ix.billion||n&&1===a(l/ix.billion)?(s=i.billion,e/=ix.billion):l<ix.billion&&l>=ix.million||n&&1===a(l/ix.million)?(s=i.million,e/=ix.million):(l<ix.million&&l>=ix.thousand||n&&1===a(l/ix.thousand))&&(s=i.thousand,e/=ix.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:I,roundingFunction:P,totalLength:x});v=e.value,E+=e.abbreviation,x&&(M=e.mantissaPrecision)}if(R){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,E=e.abbreviation+E}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+ik(r-a.length);else{let e=".";e=0>+o?`-0${e}`:`0${e}`;let i=(ik(-r-1)+Math.abs(o)+a).substr(0,t);i.length<t&&(i+=ik(t-i.length)),n=e+i}return+r>0&&t>0&&(n+=`.${ik(t)}`),n}(e,t):new im(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,M,k,P);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,(C||R)&&(L+=E),(O||v<0)&&(l=L,L=0===(u=v)?l:0==+l?l.replace("-",""):u>0?`+${l}`:"sign"===D?l:`(${l.replace("-","")})`),L}function iI(e,t){if(!e)return t;let n=Object.keys(e);return 1===n.length&&"output"===n[0]?t:e}function iD(e,t,n){let i=new im(e._value),r=t;return n.isNumbro(t)&&(r=t._value),r=new im(r),e._value=i.minus(r).toNumber(),e}let iO=ip(),iR=ih(),iP={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&&iF.registerLanguage(t)})}},iE=ic(),iL={format:(...e)=>(function(e,t={},n){if("string"==typeof t&&(t=id(t)),!iy.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=iI(t,iv.currentCurrencyDefaultFormat()),a=iv.currentCurrency(),l=Object.assign({},ib,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=iT({instance:e,providedFormat:s,state:iv,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=iI(t,iv.currentPercentageDefaultFormat()),m=r.prefixSymbol,v=iT({instance:n(100*e._value),providedFormat:r,state:iv}),y=Object.assign({},ib,r),m?`%${y.spaceSeparated?" ":""}${v}`:`${v}${y.spaceSeparated?" ":""}%`;case"byte":return function(e,t,n,i){let r=t.base||"binary",o=Object.assign({},ib,t),{binarySuffixes:a,decimalSuffixes:s}=n.currentBytes(),l={general:{scale:1024,suffixes:s||iS,marker:"bd"},binary:{scale:1024,suffixes:a||iw,marker:"b"},decimal:{scale:1e3,suffixes:s||iS,marker:"d"}}[r],{value:u,suffix:c}=iA(e._value,l.suffixes,l.scale),h=iT({instance:i(u),providedFormat:t,state:n,defaults:n.currentByteDefaultFormat()});return`${h}${o.spaceSeparated?" ":""}${c}`}(e,t=iI(t,iv.currentByteDefaultFormat()),iv,n);case"time":let x,b,w;return t=iI(t,iv.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,_,C,M;return o=t=iI(t,iv.currentOrdinalDefaultFormat()),S=iv.currentOrdinal(),_=Object.assign({},ib,o),C=iT({instance:e,providedFormat:o,state:iv}),M=S(e._value),`${C}${_.spaceSeparated?" ":""}${M}`;default:return iT({instance:e,providedFormat:t,numbro:n})}}(e,t,n);return(o=i+o)+r})(...e,iF),getByteUnit:(...e)=>(function(e){return iA(e._value,i_.suffixes,i_.scale).suffix})(...e),getBinaryByteUnit:(...e)=>(function(e){return iA(e._value,iC.suffixes,iC.scale).suffix})(...e),getDecimalByteUnit:(...e)=>(function(e){return iA(e._value,iM.suffixes,iM.scale).suffix})(...e),formatOrDefault:iI},iN={add:(e,t)=>{let n,i;return n=new im(e._value),i=t,iF.isNumbro(t)&&(i=t._value),i=new im(i),e._value=n.plus(i).toNumber(),e},subtract:(e,t)=>iD(e,t,iF),multiply:(e,t)=>{let n,i;return n=new im(e._value),i=t,iF.isNumbro(t)&&(i=t._value),i=new im(i),e._value=n.times(i).toNumber(),e},divide:(e,t)=>{let n,i;return n=new im(e._value),i=t,iF.isNumbro(t)&&(i=t._value),i=new im(i),e._value=n.dividedBy(i).toNumber(),e},set:(e,t)=>{let n;return n=t,iF.isNumbro(t)&&(n=t._value),e._value=n,e},difference:(e,t)=>{let n;return iD(n=iF(e._value),t,iF),Math.abs(n._value)},BigNumber:im};class iB{constructor(e){this._value=e}clone(){return iF(this._value)}format(e={}){return iL.format(this,e)}formatCurrency(e){return"string"==typeof e&&(e=id(e)),(e=iL.formatOrDefault(e,iO.currentCurrencyDefaultFormat())).output="currency",iL.format(this,e)}formatTime(e={}){return e.output="time",iL.format(this,e)}binaryByteUnits(){return iL.getBinaryByteUnit(this)}decimalByteUnits(){return iL.getDecimalByteUnit(this)}byteUnits(){return iL.getByteUnit(this)}difference(e){return iN.difference(this,e)}add(e){return iN.add(this,e)}subtract(e){return iN.subtract(this,e)}multiply(e){return iN.multiply(this,e)}divide(e){return iN.divide(this,e)}set(e){return iN.set(this,iz(e))}value(){return this._value}valueOf(){return this._value}}function iz(e){let t=e;return iF.isNumbro(e)?t=e._value:"string"==typeof e?t=iF.unformat(e):isNaN(e)&&(t=NaN),t}function iF(e){return new iB(iz(e))}iF.version="2.5.0",iF.isNumbro=function(e){return e instanceof iB},iF.language=iO.currentLanguage,iF.registerLanguage=iO.registerLanguage,iF.setLanguage=iO.setLanguage,iF.languages=iO.languages,iF.languageData=iO.languageData,iF.zeroFormat=iO.setZeroFormat,iF.defaultFormat=iO.currentDefaults,iF.setDefaults=iO.setDefaults,iF.defaultCurrencyFormat=iO.currentCurrencyDefaultFormat,iF.validate=iR.validate,iF.loadLanguagesInNode=iP.loadLanguagesInNode,iF.unformat=iE.unformat,iF.BigNumber=iN.BigNumber;var iV=iF&&iF.__esModule&&Object.prototype.hasOwnProperty.call(iF,"default")?iF.default:iF;let ij={label:"Bits",decimalPlaces:!0,shortValues:!0},iH={bits:{group:"Bits",label:"Bits (IEC)"},decbits:{group:"Bits",label:"Bits (SI)"}};function iW(e,{unit:t="bits",shortValues:n,decimalPlaces:i}){let r="decbits"===t;if(!n9(n)||Math.abs(e)<(r?1e3:1024)){let r={style:"decimal",useGrouping:!0};n7(i)?(r.minimumFractionDigits=ie(i),r.maximumFractionDigits=ie(i)):n9(n)&&(r.maximumSignificantDigits=3);let o=[r.style,r.useGrouping,r.maximumSignificantDigits,i,n,t];return`${n6(o,"bits",r,"en-US")(e)} bits`}return iV(e).format({output:"byte",base:r?"decimal":"binary",spaceSeparated:!0,mantissa:n7(i)?i:2,trimMantissa:!n7(i),optionalMantissa:!n7(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 i$={label:"Bytes",decimalPlaces:!0,shortValues:!0},iG={bytes:{group:"Bytes",label:"Bytes (IEC)"},decbytes:{group:"Bytes",label:"Bytes (SI)"}};function iU(e,{unit:t="bytes",shortValues:n,decimalPlaces:i}){let r="decbytes"===t;if(!n9(n)||Math.abs(e)<(r?1e3:1024)){let r={style:"unit",unit:"byte",unitDisplay:"long",useGrouping:!0};return n7(i)?(r.minimumFractionDigits=ie(i),r.maximumFractionDigits=ie(i)):n9(n)&&(r.maximumSignificantDigits=3),n6([r.style,r.unit,r.unitDisplay,r.useGrouping,r.maximumSignificantDigits,i,n,t],"bytes",r,"en-US")(e)}return iV(e).format({output:"byte",base:r?"decimal":"binary",spaceSeparated:!0,mantissa:n7(i)?i:2,trimMantissa:!n7(i),optionalMantissa:!n7(i)})}var iq=n(40224);let iY="Currency",iZ={label:"Currency",decimalPlaces:!0},iX={aud:{group:iY,label:"Australian Dollar (A$)"},cad:{group:iY,label:"Canadian Dollar (CA$)"},chf:{group:iY,label:"Swiss Franc (CHF)"},cny:{group:iY,label:"Renminbi (CN\xa5)"},eur:{group:iY,label:"Euro (€)"},gbp:{group:iY,label:"Pound (\xa3)"},hkd:{group:iY,label:"Hong Kong Dollar (HK$)"},inr:{group:iY,label:"Indian Rupee (₹)"},jpy:{group:iY,label:"Yen (\xa5)"},krw:{group:iY,label:"South Korean Won (₩)"},nok:{group:iY,label:"Norwegian Krone (NOK)"},nzd:{group:iY,label:"New Zealand Dollar (NZ$)"},sek:{group:iY,label:"Swedish Krona (SEK)"},sgd:{group:iY,label:"Singapore Dollar (S$)"},usd:{group:iY,label:"US Dollar ($)"}};function iK(e,{unit:t,decimalPlaces:n}){let i={style:"currency",currency:(0,iq.toUpper)(t),currencyDisplay:"symbol"};return n7(n)?(i.minimumFractionDigits=ie(n),i.maximumFractionDigits=ie(n)):i.maximumSignificantDigits=3,n6([i.style,i.currency,i.currencyDisplay,i.maximumSignificantDigits,n,t],"currency",i,"en-US")(e)}let iQ={label:"percent",decimalPlaces:!0},iJ="Percent",i0={percent:{group:iJ,label:"Percent (0-100)"},"percent-decimal":{group:iJ,label:"Percent (0.0-1.0)"},"%":{disableSelectorOption:!0,group:iJ,label:"%"}};function i1(e,{unit:t,decimalPlaces:n}){let i={style:"percent",useGrouping:!0};return n7(n)?(i.minimumFractionDigits=ie(n),i.maximumFractionDigits=ie(n)):i.maximumSignificantDigits=3,"percent"===t&&(e/=100),n6([i.style,i.useGrouping,i.maximumSignificantDigits,n,t],"percent",i,"en-US")(e)}let i2="Temperature",i5={label:i2,decimalPlaces:!0},i3={celsius:{group:i2,label:"Celsius (\xb0C)"},fahrenheit:{group:i2,label:"Fahrenheit (\xb0F)"}},i4=(e,{unit:t,decimalPlaces:n})=>{let i={unit:t,style:"unit"};n7(n)?(i.minimumFractionDigits=ie(n),i.maximumFractionDigits=ie(n)):i.maximumSignificantDigits=3;let r="celsius"===t?"en-GB":"en-US";return n6([i.style,i.unit,i.maximumSignificantDigits,n,r],"temperature",i,r)(e)},i6={label:"Decimal",decimalPlaces:!0,shortValues:!0},i8={decimal:{group:"Decimal",label:"Decimal"}};function i9(e,{shortValues:t,decimalPlaces:n}){let i={style:"decimal",useGrouping:!0};return n9(t)&&(i.notation="compact"),n7(n)?(i.minimumFractionDigits=ie(n),i.maximumFractionDigits=ie(n)):n9(t)&&(i.maximumSignificantDigits=3),n6([i.style,i.useGrouping,i.notation,i.maximumSignificantDigits,n],"decimal",i,"en-US")(e)}let i7={label:"Throughput",decimalPlaces:!0},re="Throughput",rt={"bits/sec":{group:re,label:"Bits/sec (IEC)"},"decbits/sec":{group:re,label:"Bits/sec (SI)"},"bytes/sec":{group:re,label:"Bytes/sec (IEC)"},"decbytes/sec":{group:re,label:"Bytes/sec (SI)"},"counts/sec":{group:re,label:"Counts/sec"},"events/sec":{group:re,label:"Events/sec"},"messages/sec":{group:re,label:"Messages/sec"},"ops/sec":{group:re,label:"Ops/sec"},"packets/sec":{group:re,label:"Packets/sec"},"reads/sec":{group:re,label:"Reads/sec"},"requests/sec":{group:re,label:"Requests/sec"},"records/sec":{group:re,label:"Records/sec"},"rows/sec":{group:re,label:"Rows/sec"},"writes/sec":{group:re,label:"Writes/sec"}};function rn(e,{unit:t,shortValues:n,decimalPlaces:i}){if("bits/sec"===t){let t=1024>Math.abs(e)?"sec":"s";return iW(e,{unit:"bits",shortValues:n,decimalPlaces:i})+"/"+t}if("decbits/sec"===t){let t=1e3>Math.abs(e)?"sec":"s";return iW(e,{unit:"decbits",shortValues:n,decimalPlaces:i})+"/"+t}if("decbytes/sec"===t){let t=1e3>Math.abs(e)?"sec":"s";return iU(e,{unit:"decbytes",shortValues:n,decimalPlaces:i})+"/"+t}if("bytes/sec"===t){let t=1024>Math.abs(e)?"sec":"s";return iU(e,{unit:"bytes",shortValues:n,decimalPlaces:i})+"/"+t}let r={style:"decimal",useGrouping:!0};n9(n)&&(r.notation="compact"),n7(i)?(r.minimumFractionDigits=ie(i),r.maximumFractionDigits=ie(i)):n9(n)&&(r.maximumSignificantDigits=3);let o=[r.style,r.useGrouping,r.notation,r.maximumSignificantDigits,i,n,t];return`${n6(o,"throughput",r,"en-US")(e)} ${t}`}let ri="Date",rr={Time:ii,Percent:iQ,Decimal:i6,Bytes:i$,Bits:ij,Throughput:i7,Currency:iZ,Temperature:i5,Date:{label:"Date & Time"}},ro={...ir,...i0,...i8,...iG,...iH,...rt,...iX,...i3,"datetime-iso":{group:ri,label:"DateTime (GMT)"},"datetime-us":{group:ri,label:"DateTime (US-East)"},"datetime-local":{group:ri,label:"DateTime (Browser Local)"},"date-iso":{group:ri,label:"Date (GMT)"},"date-us":{group:ri,label:"Date (US-East)"},"date-local":{group:ri,label:"Date (Browser Local)"},"time-local":{group:ri,label:"Time (Browser Local)"},"time-iso":{group:ri,label:"Time (GMT)"},"time-us":{group:ri,label:"Time (US-East)"},"relative-time":{group:ri,label:"Relative Time"},"unix-timestamp":{group:ri,label:"Unix Timestamp (s)"},"unix-timestamp-ms":{group:ri,label:"Unix Timestamp (ms)"}};function ra(e,t){if(!t)return e.toString();if(rp(t))return iU(e,t);if(rf(t))return iW(e,t);if(rd(t))return i9(e,t);if(rh(t))return i1(e,t);if(rc(t))return il(e,t);if(rv(t))return rn(e,t);if(ry(t))return iK(e,t);if(rx(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(rb(t))return i4(e,t);throw Error(`Unknown unit options ${t}`)}function rs(e){return ro[e.unit??"decimal"]}function rl(e){return rs(e).group??"Decimal"}function ru(e){return rr[rs(e).group??"Decimal"]}function rc(e){return"Time"===rl(e)}function rh(e){return"Percent"===rl(e)}function rd(e){return"Decimal"===rl(e)}function rp(e){return"Bytes"===rl(e)}function rf(e){return"Bits"===rl(e)}function rg(e){return!!ru(e).decimalPlaces}function rm(e){return!!ru(e).shortValues}function rv(e){return"Throughput"===rl(e)}function ry(e){return"Currency"===rl(e)}function rx(e){return"Date"===rl(e)}function rb(e){return"Temperature"===rl(e)}let rw={JoinByColumnValue:"Join by column value",MergeColumns:"Merge columns",MergeIndexedColumns:"Merge indexed columns",MergeSeries:"Merge series",ExtractColumnFields:"Extract column fields"};function rS(e,t){return[nV({type:"value",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>ra(e,t)}},e)]}function r_(e,t,n,i){let r=[],o=nV({type:"value",position:"left",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>ra(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=>ra(e,t)},splitLine:{show:!1},show:e?.show};r.push(l),i&&(a+=(o=ra(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 rC(e,t){let{value:n,setValueAndStore:i}=function(e,t,n){let[i,r]=(0,ew.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,ew.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 rM(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 rA(e){e.dispatchAction({type:"restore"})}function rk(e){void 0!==e.dispatchAction&&(e.dispatchAction({type:"unselect"}),e.dispatchAction({type:"downplay"}))}function rT(e,t,n){if(void 0===n)return null;let i=[e,t];return n.containPixel("grid",i)?n.convertFromPixel("grid",i):null}function rI(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 rD(e){return e[e.length-1]?.name===nj}function rO(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 rR(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=rO(o.values,t)}return i}function rP(...e){return e.flatMap(e=>void 0===e?[]:Array.isArray(e)?e:[e])}function rE(e){void 0===globalThis.useIdValue&&(globalThis.useIdValue=0);let t=(0,ew.useRef)(void 0);return void 0===t.current&&(t.current=`${e}-${globalThis.useIdValue++}`),t.current}var rL=((aH={}).CSV="csv",aH.DISTRIBUTED="distributed",aH.DOUBLEQUOTE="doublequote",aH.GLOB="glob",aH.JSON="json",aH.LUCENE="lucene",aH.PERCENTENCODE="percentencode",aH.PIPE="pipe",aH.PROMETHEUS="prometheus",aH.RAW="raw",aH.REGEX="regex",aH.SINGLEQUOTE="singlequote",aH.SQLSTRING="sqlstring",aH.TEXT="text",aH.QUERYPARAM="queryparam",aH.REGEX_LITERAL="regexliteral",aH);function rN(e){if(!e)return;let t=e.toLowerCase();return Object.values(rL).find(e=>e===t)||void 0}function rB(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 rz(e,t,n,i){let r="$"+t,o="${"+t+(i?":"+i:"")+"}",a="";return Array.isArray(n)&&(a=rB(n,t,i||"prometheus")),"string"==typeof n&&(a=rB([n],t,i||"raw")),(e=e.replaceAll(r,a)).replaceAll(o,a)}let rF=/\$(\w+)|\${(\w+)(?:\.([^:^}]+))?(?::([^}]+))?}/gm;function rV(e){let t,n=new Set;for(;null!==(t=rF.exec(e));)t&&(t[1]?n.add(t[1]):t[2]&&n.add(t[2]));return Array.from(n.values())}function rj(e){let t,n=new Map;for(;null!==(t=rF.exec(e));)if(t){let e;t[4]&&(e=t[4]),t[1]?n.set(t[1],rN(e)):t[2]&&n.set(t[2],rN(e))}return n}function rH(e,t){let n=rj(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=rz(r,e,i?.value,n.get(e)))}),r}function rW(e,t){let n={};for(let[e,i]of Object.entries(t))n[e]=void 0===i.displayValue?i:{...i,value:i.displayValue};return rH(e,n)}let r$=/\$\{__data\.fields(?:\[(?:"|')([^"']+)(?:"|')\]|\.([a-zA-Z_][a-zA-Z0-9_]*))(?::([a-z]+))?\}/g,rG=/\$\{__data\[(\d+)\]\.fields\[(?:"|')([^"']+)(?:"|')\]\}/g,rU=/\$\{__data\.index\}/g,rq=/\$\{__data\.count\}/g,rY=/("|')?\$\{__data(?::([a-z]+))?\}("|')?/g;function rZ(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 rX(e){if(!e)return;let t=e.toLowerCase();return Object.values(rL).find(e=>e===t)}function rK(e,t,n={}){let{urlEncode:i=!0,index:r,count:o}=n,a=e,s=[];return void 0!==r&&(a=a.replaceAll(rU,String(r))),void 0!==o&&(a=a.replaceAll(rq,String(o))),a=a.replaceAll(rY,(e,n,i,r)=>{let o=rX(i)??rL.RAW;return o===rL.JSON?JSON.stringify(t):rB(Object.values(t).map(e=>JSON.stringify(e)),"",o)}),r$.lastIndex=0,{text:a=a.replaceAll(r$,(e,n,r,o)=>{let a=n??r??"",l=rZ(t,a);""===l&&void 0===t[a]&&s.push(`Field "${a}" not found in data`);let u=rX(o);if(u)return rB([l],a,u);if(i){if(u===rL.RAW)return l;if(u!==rL.QUERYPARAM&&u!==rL.PERCENTENCODE)return encodeURIComponent(l)}return l}),errors:s.length>0?s:void 0}}function rQ(e,t,n={}){let{urlEncode:i=!0}=n,r=e,o=[];return r=r.replaceAll(rq,String(t.length)),rG.lastIndex=0,r$.lastIndex=0,{text:r=(r=(r=r.replaceAll(rY,(e,n,i,r)=>{let o=rX(i)??rL.RAW,a=rB(Object.values(t).map(e=>JSON.stringify(e)),"",o);return n&&r?a:`${n??""}${a}${r??""}`})).replaceAll(rG,(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=rZ(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(r$,(e,n,i,r)=>{let o=n??i??"";return rB(t.map(e=>rZ(e,o)),o,rX(r)||rL.CSV)}),errors:o.length>0?o:void 0}}function rJ(e){return rG.lastIndex=0,rG.test(e)||/\$\{__data\.fields(?:\[["'][^"']+["']\]|\.[a-zA-Z_][a-zA-Z0-9_]*):[a-z]+\}/.test(e)}function r0(e){return rG.lastIndex=0,rG.test(e)}function r1(e){return r$.lastIndex=0,rG.lastIndex=0,r$.test(e)||rG.test(e)}function r2(e){let t,n=new Set;for(r$.lastIndex=0,rG.lastIndex=0;null!==(t=r$.exec(e));)n.add(t[1]??t[2]);for(;null!==(t=rG.exec(e));)n.add(t[2]);return Array.from(n)}Symbol.for("constructDateFrom");let r5={},r3={};function r4(e,t){try{let n=(r5[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];if(n in r3)return r3[n];return r8(n,n.split(":"))}catch{if(e in r3)return r3[e];let t=e?.match(r6);if(t)return r8(e,t.slice(1));return NaN}}let r6=/([+-]\d\d):?(\d\d)?/;function r8(e,t){let n=+(t[0]||0),i=+(t[1]||0),r=(t[2]||0)/60;return r3[e]=60*n+i>0?60*n+i+r:60*n-i-r}class r9 extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(r4(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)),ot(this,e)):this.setTime(Date.now())}static tz(e,...t){return t.length?new r9(...t,e):new r9(Date.now(),e)}withTimeZone(e){return new r9(+this,e)}getTimezoneOffset(){let e=-r4(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),oe(this),+this}[Symbol.for("constructDateFrom")](e){return new r9(+new Date(e),this.timeZone)}}let r7=/^(get|set)(?!UTC)/;function oe(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-(60*r4(e.timeZone,e))))}function ot(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=r4(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=r4(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*r4(e.timeZone,e)))%60;(p||d)&&Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+d);let f=r4(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&&on(e)-i==60*v*1e3&&on(e,i-60*g*1e3)!==i;if(g!==o&&m&&!y){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+m);let t=r4(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)}oe(e);let x=(t?i:i+1e3*p)-e.internal;x&&18e5>Math.abs(x)&&(Date.prototype.setTime.call(e,+e+x),oe(e))}function on(e,t){let n=new Date(t??+e);return n.setUTCSeconds(n.getUTCSeconds()-Math.round(-(60*r4(e.timeZone,n)))),+n}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!r7.test(e))return;let t=e.replace(r7,"$1UTC");r9.prototype[t]&&(e.startsWith("get")?r9.prototype[e]=function(){return this.internal[t]()}:(r9.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()),ot(e),+this},r9.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),oe(this),+this}))});class oi extends r9{static tz(e,...t){return t.length?new oi(...t,e):new oi(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 oi(+this,e)}[Symbol.for("constructDateFrom")](e){return new oi(+new Date(e),this.timeZone)}}function or(e,t){if(t){let n=t.toLowerCase();if("local"!==n&&"browser"!==n)return{...e,timeZone:"utc"===n?"UTC":t}}return e}function oo(e,t,n){let i,r=n?.toLowerCase();if(!n||"local"===r||"browser"===r)return(0,n$.format)(e,t);return(0,n$.format)(e,t,{in:(i="utc"===r?"UTC":n,e=>oi.tz(i,+new Date(e)))})}function oa(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 os(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 ol=(e,t)=>{if(!e)return{formattedDate:"",formattedTime:""};let n=new Date(e);return{formattedDate:t?t(n,"MMM dd, yyyy"):(0,n$.format)(n,"MMM dd, yyyy"),formattedTime:t?t(n,"HH:mm:ss"):(0,n$.format)(n,"HH:mm:ss")}};var ou=n(18264);function oc(e,t){let n=(0,ew.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 oh(e,t){let n=(0,ew.useRef)();return(void 0===n.current||!1===ou(t,n.current.deps))&&(n.current={value:e(),deps:t}),n.current.value}function od(e){return!!e?.startsWith("/")}function op(e){if(!e)throw Error("Input string cannot be empty");if(!od(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 of(e,t){let n={};for(let[i,r]of Object.entries(e))n[i]=rH(r,t);return n}function og(e,t){let n={};for(let[i,r]of Object.entries(e))Array.isArray(r)?n[i]=r.map(e=>rH(e,t)):n[i]=function e(t,n){if(Array.isArray(t))return t.map(t=>e(t,n));for(let[e,i]of rj(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=op(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===rL.QUERYPARAM)){let o="$"+e,a=i?"${"+e+":"+i+"}":"${"+e+"}";return r.map(e=>{let i=t;return rH(i=(i=i.replaceAll(a,e)).replaceAll(o,e),n)})}}return rH(t,n)}(r,t);return n}function om(e,t,n,i,r){let o=rK(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=rH(a,r)),{text:a,errors:s.length>0?s:void 0}}function ov(e,t,n){let i=rQ(e,t),r=i.text,o=[];return i.errors&&o.push(...i.errors.map(e=>e.replace("in data","in selection data"))),n&&(r=rH(r,n)),{text:r,errors:o.length>0?o:void 0}}function oy(e,t){let n=e.palette.text?.primary??"#222";return nV({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 ox(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=op(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 ob(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 ow(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 oS(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 o_(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=oS(t,e);return ob(t,n)}function oC(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=ob(n,e.spec.columns));break;case"MergeIndexedColumns":e.spec.column&&(n=oS(n,e.spec.column));break;case"MergeColumns":e.spec.columns&&e.spec.columns.length>0&&e.spec.name&&(n=ow(n,e.spec.columns,e.spec.name));break;case"MergeSeries":n=o_(n)}return n.map(e=>Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{}))}var oM=n(68102);function oA(e){return"number"==typeof e}function ok(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 oT(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function oI(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function oD(e){return e&&!0===e.constructor.prototype.isUnit||!1}function oO(e){return"string"==typeof e}var oR=Array.isArray;function oP(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function oE(e){return Array.isArray(e)||oP(e)}function oL(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function oN(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function oB(e){return e&&!0===e.constructor.prototype.isRange||!1}function oz(e){return e&&!0===e.constructor.prototype.isIndex||!1}function oF(e){return"boolean"==typeof e}function oV(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function oj(e){return e&&!0===e.constructor.prototype.isHelp||!1}function oH(e){return"function"==typeof e}function oW(e){return e instanceof Date}function o$(e){return e instanceof RegExp}function oG(e){return!!(e&&"object"==typeof e&&e.constructor===Object&&!oT(e)&&!oI(e))}function oU(e){return null===e}function oq(e){return void 0===e}function oY(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function oZ(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function oX(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function oK(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function oQ(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function oJ(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function o0(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function o1(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function o2(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function o5(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function o3(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function o4(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function o6(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function o8(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function o9(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function o7(e){return e&&!0===e.constructor.prototype.isChain||!1}function ae(e){var t=typeof e;return"object"===t?null===e?"null":Array.isArray(e)?"Array":e instanceof Date?"Date":e instanceof RegExp?"RegExp":ok(e)?"BigNumber":oT(e)?"Complex":oI(e)?"Fraction":oP(e)?"Matrix":oD(e)?"Unit":oz(e)?"Index":oB(e)?"Range":oV(e)?"ResultSet":o5(e)?e.type:o7(e)?"Chain":oj(e)?"Help":"Object":"function"===t?"Function":t}function at(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 at(e)});if(e instanceof Date)return new Date(e.valueOf());if(ok(e))return e;if(e instanceof RegExp)throw TypeError("Cannot clone "+e);return an(e,at)}function an(e,t){var n={};for(var i in e)ao(e,i)&&(n[i]=t(e[i]));return n}function ai(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(!ai(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)||!ai(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}function ar(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 ao(e,t){return e&&Object.hasOwnProperty.call(e,t)}function aa(e){return Object.keys(e).map(t=>e[t])}var as=n(23420);function al(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(ac));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 au(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function ac(e){return e&&"?"===e[0]?e.slice(1):e}function ah(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}function ad(e,t,n){var i="";if(n){if(n<1)throw Error("size must be in greater than 0");if(!ah(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(!ah(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 ap(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),oA(t)?n=t:oA(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 ag(e,n);case"exponential":return am(e,n);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=av(af(e),t),i=n.exponent,r=n.coefficients,o=i%3==0?i:i<0?i-3-i%3:i-i%3;if(oA(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=oA(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 ad(e,2,i);case"oct":return ad(e,8,i);case"hex":return ad(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=af(e),a=t?av(o,t):o;if(a.exponent<i||a.exponent>=r)return am(e,t);var s=a.coefficients,l=a.exponent;s.length<t&&(s=s.concat(ay(t-s.length))),s=s.concat(ay(l-s.length+1+(s.length<t?t-s.length:0))),s=ay(-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 af(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 ag(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=af(e),i="number"==typeof t?av(n,n.exponent+1+t):n,r=i.coefficients,o=i.exponent+1,a=o+(t||0);return r.length<a&&(r=r.concat(ay(a-r.length))),o<0&&(r=ay(-o+1).concat(r),o=1),o<r.length&&r.splice(o,0,0===o?"0.":"."),i.sign+r.join("")}function am(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=af(e),i=t?av(n,t):n,r=i.coefficients,o=i.exponent;r.length<t&&(r=r.concat(ay(t-r.length)));var a=r.shift();return i.sign+a+(r.length>0?"."+r.join(""):"")+"e"+(o>=0?"+":"")+o}function av(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 ay(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}var ax=Number.EPSILON||2220446049250313e-31;function ab(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<ax||i<=Math.max(Math.abs(e),Math.abs(t))*n}return!1}function aw(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(!ah(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 aS(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function a_(e,t){var n=function(e,t){var n;if("number"==typeof e)return ap(e,t);if(ok(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 aS(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 aw(e,2,d);case"oct":return aw(e,8,d);case"hex":return aw(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():aS(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 a_(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(oO(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+'": '+a_(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 aC(e,t,n){if(!(this instanceof aC))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 aM(e,t,n){if(!(this instanceof aM))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 aA(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function ak(e,t){if(0===t.length){if(Array.isArray(e))throw new aC(e.length,0)}else!function e(t,n,i){var r,o=t.length;if(o!==n[i])throw new aC(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 aC(n.length-1,n.length,"<");e(t[r],n,a)}}else for(r=0;r<o;r++)if(Array.isArray(t[r]))throw new aC(n.length+1,n.length,">")}(e,t,0)}function aT(e,t){if(!oA(e)||!ah(e))throw TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new aM(e,t)}function aI(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(!oA(e)||!ah(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+a_(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 aD(e,t){var n=aO(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 aO(e){return e.reduce((e,t)=>e*t,1)}function aR(e,t,n,i){var r=i||aA(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 aP(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?aP(o,t):t(o);if(void 0===n)n=s;else if(n!==s)return"mixed"}return n}function aE(e,t){return -1!==e.indexOf(t)}function aL(e,t,n,i){if(!(this instanceof aL))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}aC.prototype=RangeError(),aC.prototype.constructor=RangeError,aC.prototype.name="DimensionError",aC.prototype.isDimensionError=!0,aM.prototype=RangeError(),aM.prototype.constructor=RangeError,aM.prototype.name="IndexError",aM.prototype.isIndexError=!0,aL.prototype=Error(),aL.prototype.constructor=Error,aL.prototype.name="ArgumentsError",aL.prototype.isArgumentsError=!0;var aN={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null},aB=["Matrix","Array"],az=["number","BigNumber","Fraction"];function aF(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 aV(e,t){var n,i,r,o=(0,oM.A)({},aN,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:oA,isComplex:oT,isBigNumber:ok,isFraction:oI,isUnit:oD,isString:oO,isArray:oR,isMatrix:oP,isCollection:oE,isDenseMatrix:oL,isSparseMatrix:oN,isRange:oB,isIndex:oz,isBoolean:oF,isResultSet:oV,isHelp:oj,isFunction:oH,isDate:oW,isRegExp:o$,isObject:oG,isNull:oU,isUndefined:oq,isAccessorNode:oY,isArrayNode:oZ,isAssignmentNode:oX,isBlockNode:oK,isConditionalNode:oQ,isConstantNode:oJ,isFunctionAssignmentNode:o0,isFunctionNode:o1,isIndexNode:o2,isNode:o5,isObjectNode:o3,isOperatorNode:o4,isParenthesisNode:o6,isRangeNode:o8,isSymbolNode:o9,isChain:o7}).on=(i=new as).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 an(e,at);var i=an(e,at);aF(n,"matrix",aB),aF(n,"number",az),function e(t,n){if(Array.isArray(n))throw TypeError("Arrays are not supported by deepExtend");for(var i in n)if(ao(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=an(e,at);return t("config",r,i,an(n,at)),r}return n.MATRIX_OPTIONS=aB,n.NUMBER_OPTIONS=az,Object.keys(aN).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,ao(a,e)||(t.expression.mathWithTransform[e]=n.transform)):(delete t.expression.transform[e],ao(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 aL("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)ao(n,r)&&e(t,n[r],r);else if(au(n)||void 0!==i){var a=au(n)?o(n)?n.fn+".transform":n.fn:i;if(ao(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(ao(c,h)){var d,p=c[h];if(au(p))!function(i,s){var l,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.fn;if(aE(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=ao(c,u)?c[u]:void 0,p=function(){var n={};i.dependencies.map(ac).forEach(e=>{if(aE(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():ar(c,u,p),d&&h?function(e){delete t.expression.transform[e],ao(a,e)?delete t.expression.mathWithTransform[e]:t.expression.mathWithTransform[e]=t[e]}(u):!o(i)&&(-1!==(l=i).fn.indexOf(".")||ao(a,l.fn)||l.meta&&l.meta.isClass)||ar(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||oD(d)||oT(d)||ok(d)||oI(d)||oP(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",()=>{aa(s).forEach(e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&l(e,{override:!0})})}),a.create=aV.bind(null,e),a.factory=al,a.import(aa((function e(t,n){for(var i in t)if(ao(t,i)){var r=t[i];"object"==typeof r&&null!==r?e(r,n):n[i]=r}}(e,r={}),r))),a.ArgumentsError=aL,a.DimensionError=aC,a.IndexError=aM,a}var aj,aH,aW,a$,aG,aU,aq,aY,aZ,aX,aK,aQ,aJ,a0,a1,a2,a5,a3,a4="0123456789abcdef",a6="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",a8="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",a9={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},a7=!0,se="[DecimalError] ",st=se+"Invalid argument: ",sn=se+"Precision limit exceeded",si=se+"crypto unavailable",sr="[object Decimal]",so=Math.floor,sa=Math.pow,ss=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,sl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,su=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,sc=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,sh=a6.length-1,sd=a8.length-1,sp={toStringTag:sr};function sf(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+=sM(n)),o+=i;(n=7-(i=(a=e[t])+"").length)&&(o+=sM(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function sg(e,t,n){if(e!==~~e||e<t||e>n)throw Error(st+e)}function sm(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=sa(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)==sa(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)==sa(10,t-3)-1,a}function sv(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]+=a4.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()}sp.absoluteValue=sp.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),sx(e)},sp.ceil=function(){return sx(new this.constructor(this),this.e+1,2)},sp.clampedTo=sp.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(st+t);return 0>this.cmp(e)?e:this.cmp(t)>0?t:new n(this)},sp.comparedTo=sp.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},sp.cosine=sp.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/sE(4,n=Math.ceil(i/3))).toString():(n=16,r="2.3283064365386962890625e-10"),e.precision+=n,t=sP(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,sL(i,n)),i.precision=e,i.rounding=t,sx(2==a3||3==a3?n.neg():n,e,t,!0)):new i(1):new i(NaN)},sp.cubeRoot=sp.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(a7=!1,(o=this.s*sa(this.s*this,1/3))&&Math.abs(o)!=1/0?i=new c(o.toString()):(n=sf(this.d),(o=((e=this.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=sa(n,1/3),e=so((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=sy((u=(l=(s=i).times(s).times(s)).plus(this)).plus(this).times(s),u.plus(l),a+2,1),sf(s.d).slice(0,a)===(n=sf(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))||(sx(i,e+1,1),t=!i.times(i).times(i).eq(this));break}if(!r&&(sx(s,e+1,0),s.times(s).times(s).eq(this))){i=s;break}a+=4,r=1}return a7=!0,sx(i,e,c.rounding,t)},sp.decimalPlaces=sp.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=((e=t.length-1)-so(this.e/7))*7,e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},sp.dividedBy=sp.div=function(e){return sy(this,new this.constructor(e))},sp.dividedToIntegerBy=sp.divToInt=function(e){var t=this.constructor;return sx(sy(this,new t(e),0,1,1),t.precision,t.rounding)},sp.equals=sp.eq=function(e){return 0===this.cmp(e)},sp.floor=function(){return sx(new this.constructor(this),this.e+1,3)},sp.greaterThan=sp.gt=function(e){return this.cmp(e)>0},sp.greaterThanOrEqualTo=sp.gte=function(e){var t=this.cmp(e);return 1==t||0===t},sp.hyperbolicCosine=sp.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/sE(4,e=Math.ceil(r/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=sP(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 sx(o,a.precision=n,a.rounding=i,!0)},sp.hyperbolicSine=sp.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=sP(o,2,r,r,!0);else{e=(e=1.4*Math.sqrt(i))>16?16:0|e,r=sP(o,2,r=r.times(1/sE(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,sx(r,t,n,!0)},sp.hyperbolicTangent=sp.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,sy(this.sinh(),this.cosh(),n.precision=e,n.rounding=t)):new n(this.s)},sp.inverseCosine=sp.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()?s_(t,i,r):new t(0):new t(NaN):e.isZero()?s_(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))},sp.inverseHyperbolicCosine=sp.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,a7=!1,n=n.times(n).minus(1).sqrt().plus(n),a7=!0,i.precision=e,i.rounding=t,n.ln()):new i(n)},sp.inverseHyperbolicSine=sp.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,a7=!1,n=n.times(n).plus(1).sqrt().plus(n),a7=!0,i.precision=e,i.rounding=t,n.ln())},sp.inverseHyperbolicTangent=sp.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)?sx(new o(r),e,t,!0):(o.precision=n=i-r.e,r=sy(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)},sp.inverseSine=sp.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=s_(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))},sp.inverseTangent=sp.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<=sd)return(a=s_(c,h+4,d).times(.25)).s=u.s,a}else{if(!u.s)return new c(NaN);if(h+4<=sd)return(a=s_(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(a7=!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)),a7=!0,sx(a,c.precision=h,c.rounding=d,!0)},sp.isFinite=function(){return!!this.d},sp.isInteger=sp.isInt=function(){return!!this.d&&so(this.e/7)>this.d.length-2},sp.isNaN=function(){return!this.s},sp.isNegative=sp.isNeg=function(){return this.s<0},sp.isPositive=sp.isPos=function(){return this.s>0},sp.isZero=function(){return!!this.d&&0===this.d[0]},sp.lessThan=sp.lt=function(e){return 0>this.cmp(e)},sp.lessThanOrEqualTo=sp.lte=function(e){return 1>this.cmp(e)},sp.logarithm=sp.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(a7=!1,sm((s=sy(o=sD(this,a=u+5),t?sS(l,a+10):sD(e,a),a,1)).d,i=u,c))do if(a+=10,s=sy(o=sD(this,a),t?sS(l,a+10):sD(e,a),a,1),!r){+sf(s.d).slice(i+1,i+15)+1==1e14&&(s=sx(s,u+1,0));break}while(sm(s.d,i+=10,c));return a7=!0,sx(s,u,c)},sp.minus=sp.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 a7?sx(e,s,l):e}if(n=so(e.e/7),c=so(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=sw(u,n),a7?sx(e,s,l):e):new p(3===l?-0:0)},sp.modulo=sp.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])?(a7=!1,9==n.modulo?(t=sy(this,e.abs(),0,3,1),t.s*=e.s):t=sy(this,e,0,n.modulo,1),t=t.times(e),a7=!0,this.minus(t)):sx(new n(this),n.precision,n.rounding):new n(NaN)},sp.naturalExponential=sp.exp=function(){return sI(this)},sp.naturalLogarithm=sp.ln=function(){return sD(this)},sp.negated=sp.neg=function(){var e=new this.constructor(this);return e.s=-e.s,sx(e)},sp.plus=sp.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)),a7?sx(e,s,l):e;if(o=so(this.e/7),i=so(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=sw(u,i),a7?sx(e,s,l):e},sp.precision=sp.sd=function(e){var t;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(st+e);return this.d?(t=sC(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},sp.round=function(){var e=this.constructor;return sx(new e(this),this.e+1,e.rounding)},sp.sine=sp.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:sP(e,2,t,t);n=(n=1.4*Math.sqrt(i))>16?16:0|n,t=sP(e,2,t=t.times(1/sE(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,sL(i,n)),i.precision=e,i.rounding=t,sx(a3>2?n.neg():n,e,t,!0)):new i(NaN)},sp.squareRoot=sp.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(a7=!1,0==(l=Math.sqrt(+this))||l==1/0?(((t=sf(a)).length+s)%2==0&&(t+="0"),l=Math.sqrt(t),s=so((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(sy(this,o,n+2,1)).times(.5),sf(o.d).slice(0,n)===(t=sf(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))||(sx(i,s+1,1),e=!i.times(i).eq(this));break}if(!r&&(sx(o,s+1,0),o.times(o).eq(this))){i=o;break}n+=4,r=1}return a7=!0,sx(i,s,u.rounding,e)},sp.tangent=sp.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=sy(n,new i(1).minus(n.times(n)).sqrt(),e+10,0),i.precision=e,i.rounding=t,sx(2==a3||4==a3?n.neg():n,e,t,!0)):new i(NaN)},sp.times=sp.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=so(this.e/7)+so(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=sw(o,n),a7?sx(e,c.precision,c.rounding):e},sp.toBinary=function(e,t){return sN(this,2,e,t)},sp.toDecimalPlaces=sp.toDP=function(e,t){var n=this,i=n.constructor;return(n=new i(n),void 0===e)?n:(sg(e,0,1e9),void 0===t?t=i.rounding:sg(t,0,8),sx(n,e+n.e+1,t))},sp.toExponential=function(e,t){var n,i=this,r=i.constructor;return void 0===e?n=sb(i,!0):(sg(e,0,1e9),void 0===t?t=r.rounding:sg(t,0,8),n=sb(i=sx(new r(i),e+1,t),!0,e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},sp.toFixed=function(e,t){var n,i,r=this.constructor;return void 0===e?n=sb(this):(sg(e,0,1e9),void 0===t?t=r.rounding:sg(t,0,8),n=sb(i=sx(new r(this),e+this.e+1,t),!1,e+i.e+1)),this.isNeg()&&!this.isZero()?"-"+n:n},sp.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=sC(p)-this.e-1)%7,t.d[0]=sa(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(st+s);e=s.gt(t)?o>0?t:u:s}for(a7=!1,s=new f(sf(p)),c=f.precision,f.precision=o=7*p.length*2;h=sy(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=sy(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>sy(u,i,o,1).minus(this).abs().cmp(sy(l,n,o,1).minus(this).abs())?[u,i]:[l,n],f.precision=c,a7=!0,d},sp.toHexadecimal=sp.toHex=function(e,t){return sN(this,16,e,t)},sp.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:sg(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]?(a7=!1,n=sy(n,e,0,t,1).times(e),a7=!0,sx(n)):(e.s=n.s,n=e),n},sp.toNumber=function(){return+this},sp.toOctal=function(e,t){return sN(this,8,e,t)},sp.toPower=sp.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(sa(+s,u));if((s=new l(s)).eq(1))return s;if(i=l.precision,o=l.rounding,e.eq(1))return sx(s,i,o);if((t=so(e.e/7))>=e.d.length-1&&(n=u<0?-u:u)<=0x1fffffffffffff)return r=sA(l,s,n,i),e.s<0?new l(1).div(r):sx(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=sa(+s,u))&&isFinite(n)?new l(n+"").e:so(u*(Math.log("0."+sf(s.d))/Math.LN10+s.e+1)))>l.maxE+1||t<l.minE-1?new l(t>0?a/0:0):(a7=!1,l.rounding=s.s=1,n=Math.min(12,(t+"").length),(r=sI(e.times(sD(s,i+n)),i)).d&&sm((r=sx(r,i+5,1)).d,i,o)&&(t=i+10,+sf((r=sx(sI(e.times(sD(s,t+n)),t),t+5,1)).d).slice(i+1,i+15)+1==1e14&&(r=sx(r,i+1,0))),r.s=a,a7=!0,l.rounding=o,sx(r,i,o))},sp.toPrecision=function(e,t){var n,i=this,r=i.constructor;return void 0===e?n=sb(i,i.e<=r.toExpNeg||i.e>=r.toExpPos):(sg(e,1,1e9),void 0===t?t=r.rounding:sg(t,0,8),n=sb(i=sx(new r(i),e,t),e<=i.e||i.e<=r.toExpNeg,e)),i.isNeg()&&!i.isZero()?"-"+n:n},sp.toSignificantDigits=sp.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(sg(e,1,1e9),void 0===t?t=n.rounding:sg(t,0,8)),sx(new n(this),e,t)},sp.toString=function(){var e=this.constructor,t=sb(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()&&!this.isZero()?"-"+t:t},sp.truncated=sp.trunc=function(){return sx(new this.constructor(this),this.e+1,1)},sp.valueOf=sp.toJSON=function(){var e=this.constructor,t=sb(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()?"-"+t:t};var sy=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,_,C,M,A,k,T,I=i.constructor,D=i.s==r.s?1:-1,O=i.d,R=r.d;if(!O||!O[0]||!R||!R[0])return new I(!i.s||!r.s||(O?R&&O[0]==R[0]:!R)?NaN:O&&0==O[0]||!R?0*D:D/0);for(l?(p=1,c=i.e-r.e):(l=1e7,p=7,c=so(i.e/p)-so(r.e/p)),k=R.length,M=O.length,y=(v=new I(D)).d=[],h=0;R[h]==(O[h]||0);h++);if(R[h]>(O[h]||0)&&c--,null==o?(S=o=I.precision,a=I.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,R=R[0],S++;(h<M||d)&&S--;h++)_=d*l+(O[h]||0),y[h]=_/R|0,d=_%R|0;f=d||h<M}else{for((d=l/(R[0]+1)|0)>1&&(R=e(R,d,l),O=e(O,d,l),k=R.length,M=O.length),C=k,b=(x=O.slice(0,k)).length;b<k;)x[b++]=0;(T=R.slice()).unshift(0),A=R[0],R[1]>=l/2&&++A;do d=0,(u=t(R,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(R,d,l)).length,b=x.length,1==(u=t(g,x,m,b))&&(d--,n(g,k<m?T:R,m,l))):(0==d&&(u=d=1),g=R.slice()),(m=g.length)<b&&g.unshift(0),n(x,g,b,l),-1==u&&(b=x.length,(u=t(R,x,k,b))<1&&(d++,n(x,k<b?T:R,b,l))),b=x.length):0===u&&(d++,x=[0]),y[h++]=d,u&&x[0]?x[b++]=O[C]||0:(x=[O[C]],b=1);while((C++<M||void 0!==x[0])&&S--);f=void 0!==x[0]}y[0]||y.shift()}if(1==p)v.e=c,a5=f;else{for(h=1,d=y[0];d>=10;d/=10)h++;v.e=h+c*p-1,sx(v,s?o+v.e+1:o,a,f)}return v}}();function sx(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])/sa(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/sa(10,r-a-1)%10|0}if(i=i||t<0||void 0!==h[d+1]||(a<0?c:c%sa(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/sa(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]=sa(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=sa(10,7-o),h[d]=a>0?(c/sa(10,r-a)%sa(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 a7&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function sb(e,t,n){if(!e.isFinite())return sO(e);var i,r=e.e,o=sf(e.d),a=o.length;return t?(n&&(i=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+sM(i):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):r<0?(o="0."+sM(-r-1)+o,n&&(i=n-a)>0&&(o+=sM(i))):r>=a?(o+=sM(r+1-a),n&&(i=n-r-1)>0&&(o=o+"."+sM(i))):((i=r+1)<a&&(o=o.slice(0,i)+"."+o.slice(i)),n&&(i=n-a)>0&&(r+1===a&&(o+="."),o+=sM(i))),o}function sw(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function sS(e,t,n){if(t>sh)throw a7=!0,n&&(e.precision=n),Error(sn);return sx(new e(a6),t,1,!0)}function s_(e,t,n){if(t>sd)throw Error(sn);return sx(new e(a8),t,n,!0)}function sC(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 sM(e){for(var t="";e--;)t+="0";return t}function sA(e,t,n,i){var r,o=new e(1),a=Math.ceil(i/7+4);for(a7=!1;;){if(n%2&&sB((o=o.times(t)).d,a)&&(r=!0),0===(n=so(n/2))){n=o.d.length-1,r&&0===o.d[n]&&++o.d[n];break}sB((t=t.times(t)).d,a)}return a7=!0,o}function sk(e){return 1&e.d[e.d.length-1]}function sT(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 sI(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?(a7=!1,l=f):l=t,s=new d(.03125);e.e>-2;)e=e.times(s),h+=5;for(l+=i=Math.log(sa(2,h))/Math.LN10*2+5|0,n=o=a=new d(1),d.precision=l;;){if(o=sx(o.times(e),l,1),n=n.times(++c),sf((s=a.plus(sy(o,n,l,1))).d).slice(0,l)===sf(a.d).slice(0,l)){for(r=h;r--;)a=sx(a.times(a),l,1);if(null!=t)return d.precision=f,a;if(!(u<3&&sm(a.d,l-i,p,u)))return sx(a,d.precision=f,p,a7=!0);d.precision=l+=10,n=o=s=new d(1),c=0,u++}a=s}}function sD(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?(a7=!1,c=y):c=t,m.precision=c+=10,i=(n=sf(g)).charAt(0),!(15e14>Math.abs(o=f.e)))return u=sS(m,c+2,y).times(o+""),f=sD(new m(i+"."+n.slice(1)),c-10).plus(u),m.precision=y,null==t?sx(f,y,v,a7=!0):f;for(;i<7&&1!=i||1==i&&n.charAt(1)>3;)i=(n=sf((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=sy(f.minus(1),f.plus(1),c,1),d=sx(f.times(f),c,1),r=3;;){if(a=sx(a.times(d),c,1),sf((u=l.plus(sy(a,new m(r),c,1))).d).slice(0,c)===sf(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(sS(m,c+2,y).times(o+""))),l=sy(l,new m(p),c,1),null!=t)return m.precision=y,l;if(!sm(l.d,c-10,v,s))return sx(l,m.precision=y,v,a7=!0);m.precision=c+=10,u=a=f=sy(h.minus(1),h.plus(1),c,1),d=sx(f.times(f),c,1),r=s=1}l=u,r+=2}}function sO(e){return String(e.s*e.s/0)}function sR(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),a7&&(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 sP(e,t,n,i,r){var o,a,s,l,u=e.precision,c=Math.ceil(u/7);for(a7=!1,l=n.times(n),s=new e(i);;){if(a=sy(s.times(l),new e(t++*t++),u,1),s=r?i.plus(a):i.minus(a),i=sy(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 a7=!0,a.d.length=c+1,a}function sE(e,t){for(var n=e;--t;)n*=e;return n}function sL(e,t){var n,i=t.s<0,r=s_(e,e.precision,1),o=r.times(.5);if((t=t.abs()).lte(o))return a3=i?4:1,t;if((n=t.divToInt(r)).isZero())a3=i?3:2;else{if((t=t.minus(n.times(r))).lte(o))return a3=sk(n)?i?2:3:i?4:1,t;a3=sk(n)?i?1:4:i?3:2}return t.minus(r).abs()}function sN(e,t,n,i){var r,o,a,s,l,u,c,h,d,p=e.constructor,f=void 0!==n;if(f?(sg(n,1,1e9),void 0===i?i=p.rounding:sg(i,0,8)):(n=p.precision,i=p.rounding),e.isFinite()){for(a=(c=sb(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=sv(sb(d),10,r),d.e=d.d.length),o=l=(h=sv(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=sy(e,d,n,i,0,r)).d,o=e.e,u=a5),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+=a4.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=sv(c,r,t)).length;!h[l-1];--l);for(a=1,c="1.";a<l;a++)c+=a4.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=sO(e);return e.s<0?"-"+c:c}function sB(e,t){if(e.length>t)return e.length=t,!0}function sz(e){return new this(e).abs()}function sF(e){return new this(e).acos()}function sV(e){return new this(e).acosh()}function sj(e,t){return new this(e).plus(t)}function sH(e){return new this(e).asin()}function sW(e){return new this(e).asinh()}function s$(e){return new this(e).atan()}function sG(e){return new this(e).atanh()}function sU(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?s_(this,i,r):new this(0)).s=e.s:!e.d||t.isZero()?(n=s_(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(sy(e,t,o,1)),t=s_(this,o,1),this.precision=i,this.rounding=r,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(sy(e,t,o,1)):(n=s_(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function sq(e){return new this(e).cbrt()}function sY(e){return sx(e=new this(e),e.e+1,2)}function sZ(e,t,n){return new this(e).clamp(t,n)}function sX(e){if(!e||"object"!=typeof e)throw Error(se+"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]=a9[n]),void 0!==(i=e[n]))if(so(i)===i&&i>=o[t+1]&&i<=o[t+2])this[n]=i;else throw Error(st+n+": "+i);if(n="crypto",r&&(this[n]=a9[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(si);else this[n]=!1;else throw Error(st+n+": "+i);return this}function sK(e){return new this(e).cos()}function sQ(e){return new this(e).cosh()}function sJ(e,t){return new this(e).div(t)}function s0(e){return new this(e).exp()}function s1(e){return sx(e=new this(e),e.e+1,3)}function s2(){var e,t,n=new this(0);for(e=0,a7=!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 a7=!0,new this(1/0);n=t}return a7=!0,n.sqrt()}function s5(e){return e instanceof lf||e&&e.toStringTag===sr||!1}function s3(e){return new this(e).ln()}function s4(e,t){return new this(e).log(t)}function s6(e){return new this(e).log(2)}function s8(e){return new this(e).log(10)}function s9(){return sT(this,arguments,-1)}function s7(){return sT(this,arguments,1)}function le(e,t){return new this(e).mod(t)}function lt(e,t){return new this(e).mul(t)}function ln(e,t){return new this(e).pow(t)}function li(e){var t,n,i,r,o=0,a=new this(1),s=[];if(void 0===e?e=this.precision:sg(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(si);else for(;o<i;)s[o++]=1e7*Math.random()|0;for(i=s[--o],e%=7,i&&e&&(r=sa(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 lr(e){return sx(e=new this(e),e.e+1,this.rounding)}function lo(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function la(e){return new this(e).sin()}function ls(e){return new this(e).sinh()}function ll(e){return new this(e).sqrt()}function lu(e,t){return new this(e).sub(t)}function lc(){var e=0,t=arguments,n=new this(t[0]);for(a7=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return a7=!0,sx(n,this.precision,this.rounding)}function lh(e){return new this(e).tan()}function ld(e){return new this(e).tanh()}function lp(e){return sx(e=new this(e),e.e+1,1)}sp[Symbol.for("nodejs.util.inspect.custom")]=sp.toString,sp[Symbol.toStringTag]="Decimal";var lf=sp.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,s5(e)){this.s=e.s,a7?!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++;a7?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 sR(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),sc.test(e)?sR(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"),sc.test(t))return sR(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(sl.test(t))n=16,t=t.toLowerCase();else if(ss.test(t))n=2;else if(su.test(t))n=8;else throw Error(st+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=sA(i,new i(n),o,2*o)),o=c=(u=sv(t,n,1e7)).length-1;0===u[o];--o)u.pop();return o<0?new i(0*e.s):(e.e=sw(u,c),e.d=u,a7=!1,a&&(e=sy(e,r,4*s)),l&&(e=e.times(54>Math.abs(l)?sa(2,l):lf.pow(2,l))),a7=!0,e)}(this,e);if("bigint"===i)return e<0?(e=-e,this.s=-1):this.s=1,sR(this,e.toString());throw Error(st+e)}if(o.prototype=sp,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=sX,o.clone=e,o.isDecimal=s5,o.abs=sz,o.acos=sF,o.acosh=sV,o.add=sj,o.asin=sH,o.asinh=sW,o.atan=s$,o.atanh=sG,o.atan2=sU,o.cbrt=sq,o.ceil=sY,o.clamp=sZ,o.cos=sK,o.cosh=sQ,o.div=sJ,o.exp=s0,o.floor=s1,o.hypot=s2,o.ln=s3,o.log=s4,o.log10=s8,o.log2=s6,o.max=s9,o.min=s7,o.mod=le,o.mul=lt,o.pow=ln,o.random=li,o.round=lr,o.sign=lo,o.sin=la,o.sinh=ls,o.sqrt=ll,o.sub=lu,o.sum=lc,o.tan=lh,o.tanh=ld,o.trunc=lp,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}(a9);a6=new lf(a6),a8=new lf(a8);var lg={createBigNumberClass:al("BigNumber",["?on","config"],e=>{var{on:t,config:n}=e,i=lf.clone({precision:n.precision,modulo:lf.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})},lm={createMatrixClass:al("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})},lv={MatrixDependencies:lm,createDenseMatrixClass:al("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&&!oO(t))throw Error("Invalid datatype: "+t);if(oP(e))"DenseMatrix"===e.type?(this._data=at(e._data),this._size=at(e._size)):(this._data=e.toArray(),this._size=e.size()),this._datatype=t||e._datatype;else if(e&&oR(e.data)&&oR(e.size))this._data=e.data,this._size=e.size,ak(this._data,this._size),this._datatype=t||e.datatype;else if(oR(e))this._data=function e(t){for(var n=0,i=t.length;n<i;n++){var r=t[n];oR(r)?t[n]=e(r):r&&!0===r.isMatrix&&(t[n]=e(r.valueOf()))}return t}(e),this._size=aA(this._data),ak(this._data,this._size),this._datatype=t;else if(e)throw TypeError("Unsupported type of data ("+ae(e)+")");else this._data=[],this._size=[0],this._datatype=t}function i(e,t,n){if(0===t.length){for(var i=e._data;oR(i);)i=i[0];return i}return e._size=t.slice(0),e._data=aI(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 aP(this._data,ae)},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(!oz(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 aC(i.length,e._size.length);for(var r=t.min(),o=t.max(),a=0,s=e._size.length;a<s;a++)aT(r[a],e._size[a]),aT(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 aT(e,t.length),t[e]}).valueOf():a.map(function(o){return aT(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(oP(n)?(o=n.size(),n=n.valueOf()):o=aA(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 aC(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=aR(n,a.length,u,o)}if(!ai(a,o))throw new aC(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){aT(e),t[e]=i[n[0]]}):s.forEach(function(a,s){aT(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(!oR(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new aC(e.length,this._size.length);for(var t=0;t<e.length;t++)aT(e[t],this._size[t]);for(var n=this._data,i=0,r=e.length;i<r;i++){var o=e[i];aT(o,n.length),n=n[o]}return n},n.prototype.set=function(e,t,n){if(!oR(e))throw TypeError("Array expected");if(e.length<this._size.length)throw new aC(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++)aT(a=e[i],s.length),s=s[a];return aT(a=e[e.length-1],s.length),s[a]=t,this},n.prototype.resize=function(e,t,n){if(!oE(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 aC(0,i,"!=");var r=aO(t=aD(t,i));if(i!==r)throw new aC(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 aC)throw new aC(r,i,"!=");throw e}}(n._data,e);var i=n._size.reduce((e,t)=>e*t);return n._size=aD(e,i),n},n.prototype.clone=function(){return new n({data:at(this._data),size:at(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 oR(i)?i.map(function(e,t){return n(e,r.concat(t))}):e(i,r,t)}(this._data,[]),r=void 0!==this._datatype?aP(i,ae):void 0;return new n(i,r)},n.prototype.forEach=function(e){var t=this;!function n(i,r){oR(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(oR(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 at(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(e){return a_(this._data,e)},n.prototype.toString=function(){return a_(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(ok(e)&&(e=e.toNumber()),!oA(e)||!ah(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(!oR(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(ok(e)&&(e=e.toNumber()),!oA(e)||!ah(e)||e<1)throw Error("Size values must be positive integers");return e}),i){if(ok(i)&&(i=i.toNumber()),!oA(i)||!ah(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(oR(t)){if(t.length!==c)throw Error("Invalid value array length");o=function(e){return t[e]}}else if(oP(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=ok(o(0))?o(0).mul(0):0);var d=[];if(e.length>0){d=aI(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(!oA(e)||!ah(e)||!oA(t)||!ah(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return aT(e,this._size[0]),aT(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 ly=Math.cosh||function(e){return 1e-9>Math.abs(e)?1-e:(Math.exp(e)+Math.exp(-e))*.5},lx=Math.sinh||function(e){return 1e-9>Math.abs(e)?e:(Math.exp(e)-Math.exp(-e))*.5},lb=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))},lw=function(){throw SyntaxError("Invalid Param")};function lS(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 l_={re:0,im:0},lC=function(e,t){if(null==e)l_.re=l_.im=0;else if(void 0!==t)l_.re=e,l_.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)l_.re=e.re,l_.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return lM.INFINITY;l_.re=e.abs*Math.cos(e.arg),l_.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return lM.INFINITY;l_.re=e.r*Math.cos(e.phi),l_.im=e.r*Math.sin(e.phi)}else 2===e.length?(l_.re=e[0],l_.im=e[1]):lw();break;case"string":l_.im=l_.re=0;let n=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,r=0;null===n&&lw();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&&lw()," "===n[e+1]||isNaN(n[e+1])?l_.im+=parseFloat((r%2?"-":"")+"1"):(l_.im+=parseFloat((r%2?"-":"")+n[e+1]),e++)):((i+r===0||isNaN(t))&&lw(),"i"===n[e+1]||"I"===n[e+1]?(l_.im+=parseFloat((r%2?"-":"")+t),e++):l_.re+=parseFloat((r%2?"-":"")+t)),i=r=0))}i+r>0&&lw();break;case"number":l_.im=0,l_.re=e;break;default:lw()}return isNaN(l_.re)||isNaN(l_.im),l_};function lM(e,t){if(!(this instanceof lM))return new lM(e,t);let n=lC(e,t);this.re=n.re,this.im=n.im}lM.prototype={re:0,im:0,sign:function(){let e=lb(this.re,this.im);return new lM(this.re/e,this.im/e)},add:function(e,t){let n=lC(e,t),i=this.isInfinite(),r=!(isFinite(n.re)&&isFinite(n.im));return i||r?i&&r?lM.NAN:lM.INFINITY:new lM(this.re+n.re,this.im+n.im)},sub:function(e,t){let n=lC(e,t),i=this.isInfinite(),r=!(isFinite(n.re)&&isFinite(n.im));return i||r?i&&r?lM.NAN:lM.INFINITY:new lM(this.re-n.re,this.im-n.im)},mul:function(e,t){let n=lC(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?lM.NAN:i||r?lM.INFINITY:0===n.im&&0===this.im?new lM(this.re*n.re,0):new lM(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){let n=lC(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 lM.NAN;if(a||i)return lM.INFINITY;if(o||r)return lM.ZERO;if(0===n.im)return new lM(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 lM((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 lM((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){let n=lC(e,t),i=0===this.re&&0===this.im;if(0===n.re&&0===n.im)return lM.ONE;if(0===n.im){if(0===this.im&&this.re>0)return new lM(Math.pow(this.re,n.re),0);else if(0===this.re)switch((n.re%4+4)%4){case 0:return new lM(Math.pow(this.im,n.re),0);case 1:return new lM(0,Math.pow(this.im,n.re));case 2:return new lM(-Math.pow(this.im,n.re),0);case 3:return new lM(0,-Math.pow(this.im,n.re))}}if(i&&n.re>0)return lM.ZERO;let r=Math.atan2(this.im,this.re),o=lS(this.re,this.im),a=Math.exp(n.re*o-n.im*r),s=n.im*o+n.re*r;return new lM(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 lM(Math.sqrt(e),0);else return new lM(0,Math.sqrt(-e));let n=Math.sqrt(.5*(lb(e,t)+Math.abs(e))),i=Math.abs(t)/(2*n);return e>=0?new lM(n,t<0?-i:i):new lM(i,t<0?-n:n)},exp:function(){let e=Math.exp(this.re);return 0===this.im?new lM(e,0):new lM(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){let e,t=this.re,n=this.im;return new lM(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 lM(Math.log(e),0):new lM(lS(e,t),Math.atan2(t,e))},abs:function(){return lb(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let e=this.re,t=this.im;return new lM(Math.sin(e)*ly(t),Math.cos(e)*lx(t))},cos:function(){let e=this.re,t=this.im;return new lM(Math.cos(e)*ly(t),-Math.sin(e)*lx(t))},tan:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)+ly(t);return new lM(Math.sin(e)/n,lx(t)/n)},cot:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)-ly(t);return new lM(-Math.sin(e)/n,lx(t)/n)},sec:function(){let e=this.re,t=this.im,n=.5*ly(2*t)+.5*Math.cos(2*e);return new lM(Math.cos(e)*ly(t)/n,Math.sin(e)*lx(t)/n)},csc:function(){let e=this.re,t=this.im,n=.5*ly(2*t)-.5*Math.cos(2*e);return new lM(Math.sin(e)*ly(t)/n,-Math.cos(e)*lx(t)/n)},asin:function(){let e=this.re,t=this.im,n=new lM(t*t-e*e+1,-2*e*t).sqrt(),i=new lM(n.re-t,n.im+e).log();return new lM(i.im,-i.re)},acos:function(){let e=this.re,t=this.im,n=new lM(t*t-e*e+1,-2*e*t).sqrt(),i=new lM(n.re-t,n.im+e).log();return new lM(Math.PI/2-i.im,i.re)},atan:function(){let e=this.re,t=this.im;if(0===e){if(1===t)return new lM(0,1/0);if(-1===t)return new lM(0,-1/0)}let n=e*e+(1-t)*(1-t),i=new lM((1-t*t-e*e)/n,-2*e/n).log();return new lM(-.5*i.im,.5*i.re)},acot:function(){let e=this.re,t=this.im;if(0===t)return new lM(Math.atan2(1,e),0);let n=e*e+t*t;return 0!==n?new lM(e/n,-t/n).atan():new lM(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 lM(0,1/0);let n=e*e+t*t;return 0!==n?new lM(e/n,-t/n).acos():new lM(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 lM(Math.PI/2,1/0);let n=e*e+t*t;return 0!==n?new lM(e/n,-t/n).asin():new lM(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){let e=this.re,t=this.im;return new lM(lx(e)*Math.cos(t),ly(e)*Math.sin(t))},cosh:function(){let e=this.re,t=this.im;return new lM(ly(e)*Math.cos(t),lx(e)*Math.sin(t))},tanh:function(){let e=2*this.re,t=2*this.im,n=ly(e)+Math.cos(t);return new lM(lx(e)/n,Math.sin(t)/n)},coth:function(){let e=2*this.re,t=2*this.im,n=ly(e)-Math.cos(t);return new lM(lx(e)/n,-Math.sin(t)/n)},csch:function(){let e=this.re,t=this.im,n=Math.cos(2*t)-ly(2*e);return new lM(-2*lx(e)*Math.cos(t)/n,2*ly(e)*Math.sin(t)/n)},sech:function(){let e=this.re,t=this.im,n=Math.cos(2*t)+ly(2*e);return new lM(2*ly(e)*Math.cos(t)/n,-2*lx(e)*Math.sin(t)/n)},asinh:function(){let e=this.re,t=this.im;if(0===t){if(0===e)return new lM(0,0);let t=Math.abs(e),n=Math.log(t+Math.sqrt(t*t+1));return new lM(e<0?-n:n,0)}let n=new lM(e*e-t*t+1,2*e*t).sqrt();return new lM(e+n.re,t+n.im).log()},acosh:function(){let e=this.re,t=this.im;if(0===t){if(e>1)return new lM(Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1)),0);if(e<-1){let t=Math.sqrt(e*e-1);return new lM(Math.log(-e+t),Math.PI)}return new lM(0,Math.acos(e))}let n=new lM(e-1,t).sqrt(),i=new lM(e+1,t).sqrt();return new lM(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 lM(0,0):1===e?new lM(1/0,0):-1===e?new lM(-1/0,0):-1<e&&e<1?new lM(.5*Math.log((1+e)/(1-e)),0):e>1?new lM(.5*Math.log((e+1)/(e-1)),-Math.PI/2):new lM(.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 lM(-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 lM(lS(o,a)/2,Math.atan2(a,o)/2)},acoth:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new lM(0,Math.PI/2);let n=e*e+t*t;return 0!==n?new lM(e/n,-t/n).atanh():new lM(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 lM(1/0,0);let t=1/e;return new lM(Math.log(t+Math.sqrt(t*t+1)),0)}let n=e*e+t*t;return 0!==n?new lM(e/n,-t/n).asinh():new lM(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){let e=this.re,t=this.im;if(this.isZero())return lM.INFINITY;let n=e*e+t*t;return 0!==n?new lM(e/n,-t/n).acosh():new lM(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return lM.INFINITY;if(this.isInfinite())return lM.ZERO;let e=this.re,t=this.im,n=e*e+t*t;return new lM(e/n,-t/n)},conjugate:function(){return new lM(this.re,-this.im)},neg:function(){return new lM(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new lM(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new lM(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new lM(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){let n=lC(e,t);return Math.abs(n.re-this.re)<=lM.EPSILON&&Math.abs(n.im-this.im)<=lM.EPSILON},clone:function(){return new lM(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<lM.EPSILON&&(e=0),Math.abs(t)<lM.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()}},lM.ZERO=new lM(0,0),lM.ONE=new lM(1,0),lM.I=new lM(0,1),lM.PI=new lM(Math.PI,0),lM.E=new lM(Math.E,0),lM.INFINITY=new lM(1/0,1/0),lM.NAN=new lM(NaN,NaN),lM.EPSILON=1e-15;var lA=al("Complex",[],()=>(lM.prototype.type="Complex",lM.prototype.isComplex=!0,lM.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},lM.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},lM.prototype.format=function(e){var t=this.im,n=this.re,i=ap(this.re,e),r=ap(this.im,e),o=oA(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"},lM.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if("object"==typeof t)return lM(t);throw TypeError("Input has to be an object with r and phi keys.");case 2:var n=arguments[0],i=arguments[1];if(oA(n)){if(oD(i)&&i.hasBase("ANGLE")&&(i=i.toNumber("rad")),oA(i))return new lM({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")}},lM.prototype.valueOf=lM.prototype.toString,lM.fromJSON=function(e){return new lM(e)},lM.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},lM),{isClass:!0}),lk={s:1,n:0,d:1};function lT(e,t){if(isNaN(e=parseInt(e,10)))throw lL();return e*t}function lI(e,t){if(0===t)throw lE();var n=Object.create(lP.prototype);n.s=e<0?-1:1;var i=lR(e=e<0?-e:e,t);return n.n=e/i,n.d=t/i,n}function lD(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 lO=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 lN()}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 lL();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 lL();if("-"===d[h]?(o=-1,h++):"+"===d[h]&&h++,d.length===h+1?s=lT(d[h++],o):"."===d[h+1]||"."===d[h]?("."!==d[h]&&(a=lT(d[h++],o)),(++h+1===d.length||"("===d[h+1]&&")"===d[h+3]||"'"===d[h+1]&&"'"===d[h+3])&&(s=lT(d[h],o),u=Math.pow(10,d[h].length),h++),("("===d[h]&&")"===d[h+2]||"'"===d[h]&&"'"===d[h+2])&&(l=lT(d[h+1],o),c=Math.pow(10,d[h+1].length)-1,h+=3)):"/"===d[h+1]||":"===d[h+1]?(s=lT(d[h],o),u=lT(d[h+2],1),h+=3):"/"===d[h+3]&&" "===d[h+1]&&(a=lT(d[h],o),s=lT(d[h+2],o),u=lT(d[h+4],1),h+=5),d.length<=h){o=i=l+(r=u*c)*a+c*s;break}default:throw lL()}if(0===r)throw lE();lk.s=o<0?-1:1,lk.n=Math.abs(i),lk.d=Math.abs(r)};function lR(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function lP(e,t){if(lO(e,t),!(this instanceof lP))return lI(lk.s*lk.n,lk.d);e=lR(lk.d,lk.n),this.s=lk.s,this.n=lk.n/e,this.d=lk.d/e}var lE=function(){return Error("Division by Zero")},lL=function(){return Error("Invalid argument")},lN=function(){return Error("Parameters must be integer")};lP.prototype={s:1,n:0,d:1,abs:function(){return lI(this.n,this.d)},neg:function(){return lI(-this.s*this.n,this.d)},add:function(e,t){return lO(e,t),lI(this.s*this.n*lk.d+lk.s*this.d*lk.n,this.d*lk.d)},sub:function(e,t){return lO(e,t),lI(this.s*this.n*lk.d-lk.s*this.d*lk.n,this.d*lk.d)},mul:function(e,t){return lO(e,t),lI(this.s*lk.s*this.n*lk.n,this.d*lk.d)},div:function(e,t){return lO(e,t),lI(this.s*lk.s*this.n*lk.d,this.d*lk.n)},clone:function(){return lI(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new lP(NaN);if(void 0===e)return lI(this.s*this.n%this.d,1);if(lO(e,t),0===lk.n&&0===this.d)throw lE();return lI(this.s*(lk.d*this.n)%(lk.n*this.d),lk.d*this.d)},gcd:function(e,t){return lO(e,t),lI(lR(lk.n,this.n)*lR(lk.d,this.d),lk.d*this.d)},lcm:function(e,t){return(lO(e,t),0===lk.n&&0===this.n)?lI(0,1):lI(lk.n*this.n,lR(lk.n,this.n)*lR(lk.d,this.d))},ceil:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new lP(NaN):lI(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 lP(NaN):lI(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 lP(NaN):lI(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return lO(e,t),lI(this.s*Math.round(this.n*lk.d/(this.d*lk.n))*lk.n,lk.d)},inverse:function(){return lI(this.s*this.d,this.n)},pow:function(e,t){if(lO(e,t),1===lk.d)if(lk.s<0)return lI(Math.pow(this.s*this.d,lk.n),Math.pow(this.n,lk.n));else return lI(Math.pow(this.s*this.n,lk.n),Math.pow(this.d,lk.n));if(this.s<0)return null;var n=lD(this.n),i=lD(this.d),r=1,o=1;for(var a in n)if("1"!==a){if("0"===a){r=0;break}if(n[a]*=lk.n,n[a]%lk.d!=0)return null;n[a]/=lk.d,r*=Math.pow(a,n[a])}for(var a in i)if("1"!==a){if(i[a]*=lk.n,i[a]%lk.d!=0)return null;i[a]/=lk.d,o*=Math.pow(a,i[a])}return lk.s<0?lI(o,r):lI(r,o)},equals:function(e,t){return lO(e,t),this.s*this.n*lk.d==lk.s*lk.n*this.d},compare:function(e,t){lO(e,t);var n=this.s*this.n*lk.d-lk.s*lk.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=lI(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 lO(e,t),!(!(lk.n*this.d)||this.n*lk.d%(lk.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 lB=al("Fraction",[],()=>(lP.prototype.type="Fraction",lP.prototype.isFraction=!0,lP.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},lP.fromJSON=function(e){return new lP(e)},lP),{isClass:!0}),lz=n(42915);function lF(e,t){return!!e&&"object"==typeof e&&(!!ao(lj,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function lV(e){return"object"==typeof e&&e&&e.constructor===Object}var lj={length:!0,name:!0},lH={toString:!0,valueOf:!0,toLocaleString:!0};class lW{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){var t,n,i=this.wrappedObject;if(lV(i)&&lF(i,e))return i[e];if("function"==typeof i[e]&&(t=i,n=e,!(null==t||"function"!=typeof t[n]||ao(t,n)&&Object.getPrototypeOf&&n in Object.getPrototypeOf(t))&&(ao(lH,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(lV(e)&&lF(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 l$(e){return!!e&&(e instanceof Map||e instanceof lW||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}var lG=function(){return lG=lz.create,lz};function lU(e){throw Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function lq(e){throw Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function lY(e){throw Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var lZ={BigNumberDependencies:lg,ComplexDependencies:{createComplexClass:lA},DenseMatrixDependencies:lv,FractionDependencies:{createFractionClass:lB},createTyped:al("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],function(e){var{BigNumber:t,Complex:n,DenseMatrix:i,Fraction:r}=e,o=lG();return o.types=[{name:"number",test:oA},{name:"Complex",test:oT},{name:"BigNumber",test:ok},{name:"Fraction",test:oI},{name:"Unit",test:oD},{name:"string",test:oO},{name:"Chain",test:o7},{name:"Array",test:oR},{name:"Matrix",test:oP},{name:"DenseMatrix",test:oL},{name:"SparseMatrix",test:oN},{name:"Range",test:oB},{name:"Index",test:oz},{name:"boolean",test:oF},{name:"ResultSet",test:oV},{name:"Help",test:oj},{name:"function",test:oH},{name:"Date",test:oW},{name:"RegExp",test:o$},{name:"null",test:oU},{name:"undefined",test:oq},{name:"AccessorNode",test:oY},{name:"ArrayNode",test:oZ},{name:"AssignmentNode",test:oX},{name:"BlockNode",test:oK},{name:"ConditionalNode",test:oQ},{name:"ConstantNode",test:oJ},{name:"FunctionNode",test:o1},{name:"FunctionAssignmentNode",test:o0},{name:"IndexNode",test:o2},{name:"Node",test:o5},{name:"ObjectNode",test:o3},{name:"OperatorNode",test:o4},{name:"ParenthesisNode",test:o6},{name:"RangeNode",test:o8},{name:"SymbolNode",test:o9},{name:"Map",test:l$},{name:"Object",test:oG}],o.conversions=[{from:"number",to:"BigNumber",convert:function(e){if(t||lU(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||lq(e),new n(e,0)}},{from:"number",to:"string",convert:function(e){return e+""}},{from:"BigNumber",to:"Complex",convert:function(e){return n||lq(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||lq(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){r||lY(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||lU(e);try{return new t(e)}catch(t){throw Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){r||lY(e);try{return new r(e)}catch(t){throw Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){n||lq(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||lU(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return r||lY(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})},lX="equalScalar",lK=al(lX,["typed","config"],e=>{var{typed:t,config:n}=e;return t(lX,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return ab(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,ab(e.re,t.re,i)&&ab(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)}})});al(lX,["typed","config"],e=>{var{typed:t,config:n}=e;return t(lX,{"number, number":function(e,t){return ab(e,t,n.epsilon)}})});var lQ={typedDependencies:lZ,createEqualScalar:lK},lJ=al("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&&!oO(t))throw Error("Invalid datatype: "+t);if(oP(e)){var n,i,a;n=this,i=e,a=t,"SparseMatrix"===i.type?(n._values=i._values?at(i._values):void 0,n._index=at(i._index),n._ptr=at(i._ptr),n._size=at(i._size),n._datatype=a||i._datatype):o(n,i.valueOf(),a||i._datatype)}else if(e&&oR(e.index)&&oR(e.ptr)&&oR(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(oR(e))o(this,e,t);else if(e)throw TypeError("Unsupported type of data ("+ae(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(oO(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(oR(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;oO(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?at(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 aP(this._values,ae)},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(!oz(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 aC(s.length,e._size.length);var l=t.min(),u=t.max();for(n=0,i=e._size.length;n<i;n++)aT(l[n],e._size[n]),aT(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(oP(n)?(r=n.size(),n=n.toArray()):r=aA(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 aC(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=aR(n,o.length,l,r)}if(!ai(o,r))throw new aC(o,r,">");if(1===o.length)t.dimension(0).forEach(function(t,r){aT(t),e.set([t,0],n[r[0]],i)});else{var u=t.dimension(0),c=t.dimension(1);u.forEach(function(t,r){aT(t),c.forEach(function(o,a){aT(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(!oR(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new aC(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];aT(t,this._size[0]),aT(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(!oR(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new aC(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;oO(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]),aT(o,c),aT(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(!oE(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(!oA(e)||!ah(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+a_(i)+")")}),l(n?this.clone():this,i[0],i[1],t)},r.prototype.reshape=function(e,t){if(!oR(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(!oA(t)||!ah(t)||t<=-2||0===t)throw TypeError("Invalid size, must contain positive integers or -1 (size: "+a_(e)+")")});var n=this._size[0]*this._size[1],i=(e=aD(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?at(this._values):void 0,index:at(this._index),ptr:at(this._ptr),size:at(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;oO(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 ["+a_(t,e)+" x "+a_(n,e)+"] density: "+a_(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 ("+a_(this._index[l],e)+", "+a_(o,e)+") ==> "+(this._values?a_(this._values[l],e):"X");return r},r.prototype.toString=function(){return a_(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(ok(e)&&(e=e.toNumber()),!oA(e)||!ah(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(!oR(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(ok(e)&&(e=e.toNumber()),!oA(e)||!ah(e)||e<1)throw Error("Size values must be positive integers");return e}),o){if(ok(o)&&(o=o.toNumber()),!oA(o)||!ah(o))throw TypeError("The parameter k must be an integer number")}else o=0;var l,u=n,c=0;oO(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(oR(i)){if(i.length!==g)throw Error("Invalid value array length");l=function(e){return i[e]}}else if(oP(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(!oA(e)||!ah(e)||!oA(t)||!ah(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return aT(e,this._size[0]),aT(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}),l0="matrix",l1={DenseMatrixDependencies:lv,MatrixDependencies:lm,SparseMatrixDependencies:{MatrixDependencies:lm,equalScalarDependencies:lQ,typedDependencies:lZ,createSparseMatrixClass:lJ},typedDependencies:lZ,createMatrix:al(l0,["typed","Matrix","DenseMatrix","SparseMatrix"],e=>{var{typed:t,Matrix:n,DenseMatrix:i,SparseMatrix:r}=e;return t(l0,{"":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)+".")}})},l2="zeros",l5=al(l2,["typed","config","matrix","BigNumber"],e=>{var{typed:t,config:n,matrix:i,BigNumber:r}=e;return t(l2,{"":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){ok(e)&&(n=!0,i[t]=e.toNumber())}),n)?new r(0):0;if(e.forEach(function(e){if("number"!=typeof e||!ah(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?aI(s,e,o):s}}),l3=al("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 C=l[_],M=o?m(i,s[_]):m(s[_],i);f(M,g)||(y.push(C),v.push(M))}}return x[p]=y.length,e.createSparseMatrix({values:v,index:y,ptr:x,size:[d,p],datatype:a})}}),l4=al("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 C=0;C<d;C++)0===y&&(g[C]=[]),v[C]===x?g[C][y]=o?f(i,m[C]):f(m[C],i):g[C][y]=o?f(i,0):f(0,i)}return new n({data:g,size:[d,p],datatype:a})}}),l6=al("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:at(s),datatype:o})}});function l8(e,t){var n;if(!ah(e)||!ah(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 l9(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!ah(t)||t<0||t>15)throw Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(ag(e,t))}l8.signature="number, number";var l7="Number of decimals in function round must be an integer",ue="round",ut=al(ue,["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],e=>{var{typed:t,matrix:n,equalScalar:i,zeros:r,BigNumber:o,DenseMatrix:a}=e,s=l3({typed:t,equalScalar:i}),l=l4({typed:t,DenseMatrix:a}),u=l6({typed:t});return t(ue,{number:l9,"number, number":l9,"number, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(l7);return new o(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw TypeError(l7);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(l7);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(l7);return e.toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw TypeError(l7);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(l7);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()}})}),un=al("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 aC(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],C=d[a+1],M=_;M<C;M++)b[o=h[M]]=r?y(c[M],s[o][a]):y(s[o][a],c[M]),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})}}),ui=al("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 aC(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,C=0,M=r;"string"==typeof g&&g===b&&(o=g,_=t.find(n,[o,o]),C=t.convert(0,o),M=t.find(r,[o,o]));var A=h&&m?[]:void 0,k=[],T=[],I=h&&m?[]:void 0,D=h&&m?[]:void 0,O=[],R=[];for(s=0;s<S;s++){T[s]=k.length;var P=s+1;for(u=p[s],c=p[s+1],l=u;l<c;l++)a=d[l],k.push(a),O[a]=P,I&&(I[a]=h[l]);for(u=y[s],c=y[s+1],l=u;l<c;l++)if(O[a=v[l]]===P){if(I){var E=M(I[a],m[l]);_(E,C)?O[a]=null:I[a]=E}}else k.push(a),R[a]=P,D&&(D[a]=m[l]);if(I&&D)for(l=T[s];l<k.length;)O[a=k[l]]===P?(A[l]=I[a],l++):R[a]===P?(A[l]=D[a],l++):k.splice(l,1)}return T[S]=k.length,e.createSparseMatrix({values:A,index:k,ptr:T,size:[w,S],datatype:o})}}),ur=al("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 C=0;C<d;C++)0===y&&(g[C]=[]),v[C]===x?g[C][y]=o?f(i,m[C]):f(m[C],i):g[C][y]=i}return new n({data:g,size:[d,p],datatype:a})}}),uo=al("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 aC(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})}}),ua=al("gcd",["typed","matrix","equalScalar","BigNumber","DenseMatrix"],e=>{var{typed:t,matrix:n,equalScalar:i,BigNumber:r,DenseMatrix:o}=e,a=un({typed:t}),s=ui({typed:t,equalScalar:i}),l=ur({typed:t,DenseMatrix:o}),u=uo({typed:t}),c=l6({typed:t});return t("gcd",{"number, number":l8,"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:us}=aV({roundDependencies:{BigNumberDependencies:lg,DenseMatrixDependencies:lv,equalScalarDependencies:lQ,matrixDependencies:l1,typedDependencies:lZ,zerosDependencies:{BigNumberDependencies:lg,matrixDependencies:l1,typedDependencies:lZ,createZeros:l5},createRound:ut}}),{gcd:ul}=aV({gcdDependencies:{BigNumberDependencies:lg,DenseMatrixDependencies:lv,equalScalarDependencies:lQ,matrixDependencies:l1,typedDependencies:lZ,createGcd:ua}}),uu=10;function uc(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 uh(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:uu}}if(void 0===n)return;if(1===i.length)t=i[0];else{let e=ul(...i);t=e<uu?uu:e}let r=n.start.valueOf(),o=n.end.valueOf();return{startMs:r,endMs:o,stepMs:t,rangeMs:o-r}}function ud(e){return/^[0-9a-fA-F]+$/.test(e)}function up(e){return e.spec?.spec?.display?.name?e.spec.spec.display.name:e.spec?.display?.name?e.spec.display.name:e.metadata.name}function uf(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 ug=(0,ew.createContext)(void 0);function um(e){let{children:t,timeZone:n}=e;return(0,eb.jsx)(ug.Provider,{value:n,children:t})}function uv(){let e=(0,ew.useContext)(ug);return{timeZone:e??"local",formatWithUserTimeZone:(t,n)=>oo(t,n,e),dateFormatOptionsWithUserTimeZone:t=>or(t,e)}}function uy({label:e,color:t,size:n="small",onColorChange:i,onClear:r}){let[o,a]=(0,ew.useState)(null),s=!!o,{thresholds:{defaultColor:l,palette:u}}=ty();return(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(ux,{size:n,"aria-label":`change ${e} color`,isSelected:s,iconColor:t,onClick:e=>{a(e.currentTarget)},children:(0,eb.jsx)(eG,{})}),(0,eb.jsx)(tf.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)(td,{color:t,palette:[l,...u],onChange:i,onClear:r})})]})}let ux=(0,eT.A)(eW.A,{shouldForwardProp:e=>"isSelected"!==e&&"iconColor"!==e})(({iconColor:e,isSelected:t})=>({backgroundColor:t&&e?`${e}3F`:"undefined",color:e}));var ub=n(56599),uw=n(74628),uS=n(38662);function u_(e,t){return"ALL"!==t&&!!t[e.id]}var uC=n(83926),uM=n(1337),uA=n(54382),uk=n(29424),uT=n(67214);function uI(e){return(0,eP.Ay)("MuiListItemButton",e)}let uD=(0,eR.A)("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),uO=(0,eT.A)(uM.A,{shouldForwardProp:e=>(0,uC.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,eI.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"}},[`&.${uD.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,eM.X4)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${uD.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,eM.X4)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${uD.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,eM.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,eM.X4)(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${uD.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${uD.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}}]}))),uR=ew.forwardRef(function(e,t){let n=(0,eO.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=ew.useContext(uT.A),g=ew.useMemo(()=>({dense:s||f.dense||!1,alignItems:i,disableGutters:l}),[i,f.dense,s,l]),m=ew.useRef(null);(0,uA.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,eC.A)({root:["root",i&&"dense",!o&&"gutters",a&&"divider",r&&"disabled","flex-start"===t&&"alignItemsFlexStart",s&&"selected"]},uI,n);return{...n,...l}})(v),x=(0,uk.A)(m,t);return(0,eb.jsx)(uT.A.Provider,{value:g,children:(0,eb.jsx)(uO,{ref:x,href:p.href||p.to,component:(p.href||p.to)&&"div"===o?"button":o,focusVisibleClassName:(0,e_.A)(y.focusVisible,c),ownerState:v,className:(0,e_.A)(y.root,d),...p,classes:y,children:a})})});var uP=n(14045);let uE=(0,ew.memo)(function({color:e,sx:t,...n}){return(0,eb.jsx)(uw.A,{...n,sx:rP({height:4,width:16,margin:e=>e.spacing(.5)},t),style:{backgroundColor:e}})}),uL=(0,ew.forwardRef)(function({item:e,sx:t,truncateLabel:n,onClick:i,isVisuallySelected:r,onMouseOver:o,onMouseOut:a,index:s,...l},u){let[c,h]=(0,ew.useState)(n);return(0,eb.jsxs)(uR,{...l,role:"listitem",sx:rP({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)(uw.A,{sx:{display:"flex",alignItems:"center"},children:(0,eb.jsx)(uE,{color:e.color})}),(0,eb.jsx)(uP.A,{primary:e.label,primaryTypographyProps:{noWrap:c},onMouseOver:function(){n&&h(!1)},onMouseOut:function(){n&&h(!0)}})]})}),uN=(0,ew.memo)(uL);function uB({height:e,items:t,selectedItems:n,onLegendItemClick:i,onItemMouseOver:r,onItemMouseOut:o}){return(0,eb.jsx)(uw.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)(uN,{item:e,index:t,isVisuallySelected:u_(e,n),onMouseOver:r,onMouseOut:o,onClick:i,sx:{width:"auto",float:"left",paddingRight:1.5}},e.id))})}function uz(e){e()}function uF(e,t){return n=>e(t(n))}function uV(e){return void 0!==e}function uj(){}function uH(e,t){return t(e)}function uW(...e){return e}function u$(e){e(2)}function uG(e){return e(4)}function uU(e,t){return e(1,e=>t(0,e))}function uq(e,t){let n=e(1,e=>{n(),t(e)});return n}function uY(e){let t,n;return i=>r=>{t=r,n&&clearTimeout(n),n=setTimeout(()=>{i(t)},e)}}function uZ(e,t){return e===t}function uX(e=uZ){let t;return n=>i=>{e(t,i)||(t=i,n(i))}}function uK(e){return t=>n=>{e(n)&&t(n)}}function uQ(e){return t=>uF(t,e)}function uJ(e){return t=>()=>{t(e)}}function u0(e,...t){let n=function(...e){return t=>e.reduceRight(uH,t)}(...t);return(t,i)=>{switch(t){case 2:u$(e);return;case 1:return e(1,n(i))}}}function u1(e,t){return n=>i=>{n(t=e(t,i))}}function u2(e){return t=>n=>{e>0?e--:t(n)}}function u5(e){let t=null,n;return i=>r=>{t=r,n||(n=setTimeout(()=>{n=void 0,i(t)},e))}}function u3(...e){let t=Array.from({length:e.length}),n=0,i=null,r=2**e.length-1;return e.forEach((e,o)=>{let a=2**o;e(1,e=>{let s=n;n|=a,t[o]=e,s!==r&&n===r&&i&&(i(),i=null)})}),e=>o=>{let a=()=>{e([o].concat(t))};n===r?a():i=a}}function u4(e){let t=e,n=u8();return(e,i)=>{switch(e){case 0:t=i;break;case 1:i(t);break;case 4:return t}return n(e,i)}}function u6(e,t){var n;return n=u4(t),uU(e,n),n}function u8(){let e=[];return(t,n)=>{switch(t){case 0:e.slice().forEach(e=>{e(n)});return;case 2:e.splice(0);return;case 1:return e.push(n),()=>{let t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function u9(e){var t;return t=u8(),uU(e,t),t}let u7={singleton:!0};function ce(e,t=[],n=u7){let{singleton:i}=n;return{constructor:e,dependencies:t,id:ct(),singleton:i}}let ct=()=>Symbol("id");function cn(...e){let t=u8(),n=Array.from({length:e.length}),i=0,r=2**e.length-1;return e.forEach((e,o)=>{let a=2**o;e(1,e=>{n[o]=e,(i|=a)===r&&t(0,n)})}),function(e,o){switch(e){case 2:return void u$(t);case 1:return i===r&&o(n),t(1,o)}}}function ci(e,t=uZ){return u0(e,uX(t))}function cr(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(uz)}}(...e.map(e=>e(1,n)))}}}let co=1,ca={0:"debug",3:"error",[co]:"log",2:"warn"},cs=ce(()=>{let e=u4(3);return{log:u4((t,n,i=co)=>{i>=((typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL??uG(e))&&console[ca[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0}),cl=new WeakMap;function cu(e){return"self"in e?e.document.documentElement:e}function cc(e){cl.delete(cu(e))}function ch(e,t){return!function(e){let t=cu(e),n=cl.get(t);if(void 0!==n)return n;let i="rtl"===t.ownerDocument.defaultView.getComputedStyle(t).direction;return cl.set(t,i),i}(e)?t:-t}function cd(e,t,n){return cp(e,t,n).callbackRef}function cp(e,t,n){let i=eS().useRef(null),r=eS().useMemo(()=>"u">typeof ResizeObserver?new ResizeObserver(t=>{let i=()=>{let n=t[0].target;null!==n.offsetParent&&e(n)};n?i():requestAnimationFrame(i)}):null,[e,n]);return{callbackRef:e=>{e&&t?(r?.observe(e),i.current=e):(i.current&&r?.unobserve(i.current),i.current=null)},ref:i}}function cf(e,t,n,i,r,o,a,s,l){return cp(eS().useCallback(n=>{let l,u=function(e,t,n,i){let r=e.length;if(0===r)return null;let o=[];for(let a=0;a<r;a++){let r=e.item(a);if(void 0===r.dataset.index)continue;let s=parseInt(r.dataset.index,10),l=parseFloat(r.dataset.knownSize),u=t(r,n);if(0===u&&i("Zero-sized element, this should not happen",{child:r},3),u===l)continue;let c=o[o.length-1];0===o.length||c.size!==u||c.endIndex!==s-1?o.push({endIndex:s,size:u,startIndex:s}):o[o.length-1].endIndex++}return o}(n.children,t,s?"offsetWidth":"offsetHeight",r),c=n.parentElement;for(;void 0===c.dataset.virtuosoScroller;)c=c.parentElement;let h=c.lastElementChild?.dataset.viewportType==="window";h&&(l=c.ownerDocument.defaultView);let d=a?s?a.scrollWidth:a.scrollHeight:h?s?l.document.documentElement.scrollWidth:l.document.documentElement.scrollHeight:s?c.scrollWidth:c.scrollHeight,p=a?s?a.offsetWidth:a.offsetHeight:h?s?l.innerWidth:l.innerHeight:s?c.offsetWidth:c.offsetHeight;i({scrollHeight:d,scrollTop:Math.max(a?s?ch(a,a.scrollLeft):a.scrollTop:h?s?ch(l,l.scrollX||l.document.documentElement.scrollLeft):l.scrollY||l.document.documentElement.scrollTop:s?ch(c,c.scrollLeft):c.scrollTop,0),viewportHeight:p}),o?.(s?cg("column-gap",getComputedStyle(n).columnGap,r):cg("row-gap",getComputedStyle(n).rowGap,r)),null!==u&&e(u)},[e,t,r,o,a,i,s]),n,l)}function cg(e,t,n){return"normal"!==t&&t?.endsWith("px")!==!0&&n(`${e} was not resolved to pixel value correctly`,t,2),"normal"===t?0:parseInt(t??"0",10)}function cm(e,t,n){let i=eS().useRef(null),r=eS().useCallback(n=>{let r,o;if(!n?.offsetParent)return;let s=n.getBoundingClientRect(),l=s.width;if(t){let e=t.getBoundingClientRect(),n=s.top-e.top;o=e.height-Math.max(0,n),r=n+t.scrollTop}else{let e=a.current.ownerDocument.defaultView;o=e.innerHeight-Math.max(0,s.top),r=s.top+e.scrollY}i.current={listHeight:s.height,offsetTop:r,visibleHeight:o,visibleWidth:l},e(i.current)},[e,t]),{callbackRef:o,ref:a}=cp(r,!0,n),s=eS().useCallback(()=>{r(a.current)},[r,a]);return eS().useEffect(()=>{if(t){t.addEventListener("scroll",s);let e=new ResizeObserver(()=>{requestAnimationFrame(s)});return e.observe(t),()=>{t.removeEventListener("scroll",s),e.unobserve(t)}}let e=a.current?.ownerDocument.defaultView;return e?.addEventListener("scroll",s),e?.addEventListener("resize",s),()=>{e?.removeEventListener("scroll",s),e?.removeEventListener("resize",s)}},[s,t,a]),o}let cv=ce(()=>{let e=u8(),t=u8(),n=u4(0),i=u8(),r=u4(0),o=u8(),a=u8(),s=u4(0),l=u4(0),u=u4(0),c=u4(0),h=u8(),d=u8(),p=u4(!1),f=u4(!1),g=u4(!1);return uU(u0(e,uQ(({scrollTop:e})=>e)),t),uU(u0(e,uQ(({scrollHeight:e})=>e)),a),uU(t,r),{deviation:n,fixedFooterHeight:u,fixedHeaderHeight:l,footerHeight:c,headerHeight:s,horizontalDirection:f,scrollBy:d,scrollContainerState:e,scrollHeight:a,scrollingInProgress:p,scrollTo:h,scrollTop:t,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:i,statefulScrollTop:r,viewportHeight:o}},[],{singleton:!0}),cy={lvl:0};function cx(e,t){let n=e.length;if(0===n)return[];let{index:i,value:r}=t(e[0]),o=[];for(let a=1;a<n;a++){let{index:n,value:s}=t(e[a]);o.push({end:n-1,start:i,value:r}),i=n,r=s}return o.push({end:1/0,start:i,value:r}),o}function cb(e){return e===cy}function cw(e,t){if(!cb(e))return t===e.k?e.v:t<e.k?cw(e.l,t):cw(e.r,t)}function cS(e,t,n="k"){if(cb(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){let i=cS(e.r,t,n);return i[0]===-1/0?[e.k,e.v]:i}return cS(e.l,t,n)}function c_(e,t,n){return cb(e)?cI(t,n,1):t===e.k?ck(e,{k:t,v:n}):t<e.k?cO(cD(ck(e,{l:c_(e.l,t,n)}))):cO(cD(ck(e,{r:c_(e.r,t,n)})))}function cC(e,t,n){if(cb(e))return[];let i=cS(e,t)[0];return cx(function e(t,n,i){if(cb(t))return[];let{k:r,l:o,r:a,v:s}=t,l=[];return r>n&&(l=l.concat(e(o,n,i))),r>=n&&r<=i&&l.push({k:r,v:s}),r<=i&&(l=l.concat(e(a,n,i))),l}(e,i,n),({k:e,v:t})=>({index:e,value:t}))}function cM(e){return cb(e)?[]:[...cM(e.l),{k:e.k,v:e.v},...cM(e.r)]}function cA(e){let{l:t,lvl:n,r:i}=e;if(i.lvl>=n-1&&t.lvl>=n-1)return e;if(n>i.lvl+1){if(cT(t))return cD(ck(e,{lvl:n-1}));if(!cb(t)&&!cb(t.r))return ck(t.r,{l:ck(t,{r:t.r.l}),lvl:n,r:ck(e,{l:t.r.r,lvl:n-1})});throw Error("Unexpected empty nodes")}if(cT(e))return cO(ck(e,{lvl:n-1}));if(!cb(i)&&!cb(i.l)){let t=i.l,r=cT(t)?i.lvl-1:i.lvl;return ck(t,{l:ck(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:cO(ck(i,{l:t.r,lvl:r}))})}throw Error("Unexpected empty nodes")}function ck(e,t){return cI(void 0===t.k?e.k:t.k,void 0===t.v?e.v:t.v,void 0===t.lvl?e.lvl:t.lvl,void 0===t.l?e.l:t.l,void 0===t.r?e.r:t.r)}function cT(e){return cb(e)||e.lvl>e.r.lvl}function cI(e,t,n,i=cy,r=cy){return{k:e,l:i,lvl:n,r,v:t}}function cD(e){let{l:t}=e;return cb(t)||t.lvl!==e.lvl?e:ck(t,{r:ck(e,{l:t.r})})}function cO(e){let{lvl:t,r:n}=e;return cb(n)||cb(n.r)||n.lvl!==t||n.r.lvl!==t?e:ck(n,{l:ck(e,{r:n.l}),lvl:t+1})}function cR(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function cP(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}let cE=ce(()=>({recalcInProgress:u4(!1)}),[],{singleton:!0});function cL(e,t,n,i=0){let r=e.length-1;for(;i<=r;){let o=Math.floor((i+r)/2),a=n(e[o],t);if(0===a)return o;if(-1===a){if(r-i<2)return o-1;r=o-1}else{if(r===i)return o;i=o+1}}throw Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function cN(e,t){return Math.round(e.getBoundingClientRect()[t])}function cB(e){return!cb(e.groupOffsetTree)}function cz({index:e},t){return t===e?0:t<e?-1:1}function cF({offset:e},t){return t===e?0:t<e?-1:1}function cV(e,t,n){if(0===t.length)return 0;let{index:i,offset:r,size:o}=t[cL(t,e,cz)],a=e-i,s=o*a+(a-1)*n+r;return s>0?s+n:s}function cj(e,t){if(!cB(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function cH(e,t,n){if(void 0!==e.groupIndex)return t.groupIndices[e.groupIndex]+1;let i=cj("LAST"===e.index?n:e.index,t);return Math.max(0,Math.min(n,i))}function cW(e,[t,n,i,r]){t.length>0&&i("received item sizes",t,0);let o=e.sizeTree,a=o,s=0;if(n.length>0&&cb(o)&&2===t.length){let e=t[0].size,i=t[1].size;a=n.reduce((t,n)=>c_(c_(t,n,e),n+1,i),a)}else[a,s]=function(e,t){let n=cb(e)?0:1/0;for(let i of t){let{endIndex:t,size:r,startIndex:o}=i;if(n=Math.min(n,o),cb(e)){e=c_(e,0,r);continue}let a=cC(e,o-1,t+1);if(a.some(function(e){let{endIndex:t,size:n,startIndex:i}=e;return e=>e.start===i&&(e.end===t||e.end===1/0)&&e.value===n}(i)))continue;let s=!1,l=!1;for(let{end:n,start:i,value:o}of a)s?(t>=i||r===o)&&(e=function e(t,n){if(cb(t))return cy;let{k:i,l:r,r:o}=t;if(n===i){if(cb(r))return o;if(cb(o))return r;let[e,n]=function e(t){return cb(t.r)?[t.k,t.v]:e(t.r)}(r);return cA(ck(t,{k:e,l:function e(t){return cb(t.r)?t.l:cA(ck(t,{r:e(t.r)}))}(r),v:n}))}return n<i?cA(ck(t,{l:e(r,n)})):cA(ck(t,{r:e(o,n)}))}(e,i)):(l=o!==r,s=!0),n>t&&t>=i&&o!==r&&(e=c_(e,t+1,o));l&&(e=c_(e,o,r))}return[e,n]}(a,t);if(a===o)return e;let{lastIndex:l,lastOffset:u,lastSize:c,offsetTree:h}=cG(e.offsetTree,s,a,r);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>c_(e,t,cV(t,h,r)),cy),lastIndex:l,lastOffset:u,lastSize:c,offsetTree:h,sizeTree:a}}function c$(e,t){let n=0,i=0;for(;n<e;)n+=t[i+1]-t[i]-1,i++;return i-(n!==e)}function cG(e,t,n,i){let r=e,o=0,a=0,s=0,l=0;if(0===t)r=[];else{l=cL(r,t-1,cz),s=r[l].offset;let e=cS(n,t-1);o=e[0],a=e[1],r.length&&r[l].size===cS(n,t)[1]&&(l-=1),r=r.slice(0,l+1)}for(let{start:e,value:l}of cC(n,t,1/0)){let t=e-o,n=t*a+s+t*i;r.push({index:e,offset:n,size:l}),o=e,s=n,a=l}return{lastIndex:o,lastOffset:s,lastSize:a,offsetTree:r}}function cU(e){return{index:e.index,value:e}}let cq={offsetHeight:"height",offsetWidth:"width"},cY=ce(([{log:e},{recalcInProgress:t}])=>{let n=u8(),i=u8(),r=u6(i,0),o=u8(),a=u8(),s=u4(0),l=u4([]),u=u4(void 0),c=u4(void 0),h=u4(void 0),d=u4(void 0),p=u4((e,t)=>cN(e,cq[t])),f=u4(void 0),g=u4(0),m={groupIndices:[],groupOffsetTree:cy,lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:cy},v=u6(u0(n,u3(l,e,g),u1(cW,m),uX()),m),y=u6(u0(l,uX(),u1((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),uQ(({prev:e})=>e)),[]);uU(u0(l,uK(e=>e.length>0),u3(v,g),uQ(([e,t,n])=>{let i=e.reduce((e,i,r)=>c_(e,i,cV(i,t.offsetTree,n)||r),cy);return{...t,groupIndices:e,groupOffsetTree:i}})),v),uU(u0(i,u3(v),uK(([e,{lastIndex:t}])=>e<t),uQ(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),uU(u,c);let x=u6(u0(u,uQ(e=>void 0===e)),!0);uU(u0(c,uK(e=>void 0!==e&&cb(uG(v).sizeTree)),uQ(e=>{let t=uG(h),n=uG(l).length>0;return void 0!==t&&0!==t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),uU(u0(d,uK(e=>void 0!==e&&e.length>0&&cb(uG(v).sizeTree)),uQ(e=>{let t=[],n=e[0],i=0;for(let r=1;r<e.length;r++){let o=e[r];o!==n&&(t.push({endIndex:r-1,size:n,startIndex:i}),n=o,i=r)}return t.push({endIndex:e.length-1,size:n,startIndex:i}),t})),n),uU(u0(l,u3(h,c),uK(([,e,t])=>void 0!==e&&void 0!==t),uQ(([e,t,n])=>{let i=[];for(let r=0;r<e.length;r++){let o=e[r],a=e[r+1];i.push({startIndex:o,endIndex:o,size:t}),void 0!==a&&i.push({startIndex:o+1,endIndex:a-1,size:n})}return i})),n);let b=u9(u0(n,u3(v),u1(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:m}),uQ(e=>e.changed)));u0(s,u1((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),uQ(e=>e.diff))(1,e=>{let{groupIndices:n}=uG(v);if(e>0)t(0,!0),o(0,e+c$(e,n));else if(e<0){let t=uG(y);t.length>0&&(e-=c$(-e,t)),a(0,e)}}),u0(s,u3(e))(1,([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},3)});let w=u9(o);uU(u0(o,u3(v),uQ(([e,t])=>{let n=t.groupIndices.length>0,i=[],r=t.lastSize;if(n){let n=cw(t.sizeTree,0),o=0,a=0;for(;o<e;){let e=t.groupIndices[a],s=t.groupIndices.length===a+1?1/0:t.groupIndices[a+1]-e-1;i.push({endIndex:e,size:n,startIndex:e}),i.push({endIndex:e+1+s-1,size:r,startIndex:e+1}),a++,o+=s+1}let s=cM(t.sizeTree);return o!==e&&s.shift(),s.reduce((t,{k:n,v:i})=>{let r=t.ranges;return 0!==t.prevSize&&(r=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:i,ranges:r}},{prevIndex:e,prevSize:0,ranges:i}).ranges}return cM(t.sizeTree).reduce((t,{k:n,v:i})=>({prevIndex:n+e,prevSize:i,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:r,ranges:[]}).ranges})),n);let S=u9(u0(a,u3(v,g),uQ(([e,{offsetTree:t},n])=>cV(-e,t,n))));return uU(u0(a,u3(v,g),uQ(([e,t,n])=>{if(t.groupIndices.length>0){if(cb(t.sizeTree))return t;let i=cy,r=uG(y),o=0,a=0,s=0;for(;o<-e;){s=r[a];let e=r[a+1]-s-1;a++,o+=e+1}return i=cM(t.sizeTree).reduce((t,{k:n,v:i})=>c_(t,Math.max(0,n+e),i),i),o!==-e&&(i=c_(i,0,cw(t.sizeTree,s)),i=c_(i,1,cS(t.sizeTree,-e+1)[1])),{...t,sizeTree:i,...cG(t.offsetTree,0,i,n)}}let i=cM(t.sizeTree).reduce((t,{k:n,v:i})=>c_(t,Math.max(0,n+e),i),cy);return{...t,sizeTree:i,...cG(t.offsetTree,0,i,n)}})),v),{beforeUnshiftWith:w,data:f,defaultItemSize:c,firstItemIndex:s,fixedItemSize:u,fixedGroupSize:h,gap:g,groupIndices:l,heightEstimates:d,itemSize:p,listRefresh:b,shiftWith:a,shiftWithOffset:S,sizeRanges:n,sizes:v,statefulTotalCount:r,totalCount:i,trackItemSizes:x,unshiftWith:o}},uW(cs,cE),{singleton:!0});function cZ(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}let cX=ce(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:i,scrollTop:r}])=>{let o=u8(),a=u8(),s=u9(u0(o,uQ(cZ)));return uU(u0(s,uQ(e=>e.totalCount)),n),uU(u0(s,uQ(e=>e.groupIndices)),e),uU(u0(cn(r,t,i),uK(([e,t])=>cB(t)),uQ(([e,t,n])=>cS(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),uX(),uQ(e=>[e])),a),{groupCounts:o,topItemsIndexes:a}},uW(cY,cv)),cK=ce(([{log:e}])=>{let t=u4(!1),n=u9(u0(t,uK(e=>e),uX()));return t(1,t=>{t&&uG(e)("props updated",{},0)}),{didMount:n,propsReady:t}},uW(cs),{singleton:!0}),cQ="u">typeof document&&"scrollBehavior"in document.documentElement.style;function cJ(e){let t="number"==typeof e?{index:e}:{...e};return t.align||(t.align="start"),t.behavior&&cQ||(t.behavior="auto"),void 0===t.offset&&(t.offset=0),t}let c0=ce(([{gap:e,listRefresh:t,sizes:n,totalCount:i},{fixedFooterHeight:r,fixedHeaderHeight:o,footerHeight:a,headerHeight:s,scrollingInProgress:l,scrollTo:u,smoothScrollTargetReached:c,viewportHeight:h},{log:d}])=>{let p=u8(),f=u8(),g=u4(0),m=null,v=null,y=null;function x(){null!==m&&(m(),m=null),null!==y&&(y(),y=null),v&&(clearTimeout(v),v=null),l(0,!1)}return uU(u0(p,u3(n,h,i,g,s,a,d),u3(e,o,r),uQ(([[e,n,i,r,o,a,s,u],h,d,g])=>{let b=cJ(e),{align:w,behavior:S,offset:_}=b,C=r-1,M=cH(b,n,C),A=cV(M,n.offsetTree,h)+a;"end"===w?(A+=d+cS(n.sizeTree,M)[1]-i+g,M===C&&(A+=s)):"center"===w?A+=(d+cS(n.sizeTree,M)[1]-i+g)/2:A-=o,void 0!==_&&0!==_&&(A+=_);let k=t=>{x(),t?(u("retrying to scroll to",{location:e},0),p(0,e)):(f(0,!0),u("list did not change, scroll successful",{},0))};if(x(),"smooth"===S){let e=!1;y=t(1,t=>{e=e||t}),m=uq(c,()=>{k(e)})}else m=uq(u0(t,e=>{let t=setTimeout(()=>{e(!1)},150);return n=>{n&&(e(!0),clearTimeout(t))}}),k);return v=setTimeout(()=>{x()},1200),l(0,!0),u("scrolling from index to",{behavior:S,index:M,top:A},0),{behavior:S,top:A}})),u),{scrollTargetReached:f,scrollToIndex:p,topListHeight:g}},uW(cY,cv,cs),{singleton:!0});function c1(e,t){0===e?t():requestAnimationFrame(()=>{c1(e-1,t)})}function c2(e,t){if(void 0===e)return 0;let n=t-1;return Math.max(0,Math.min("number"==typeof e?e:"LAST"===e.index?n:e.index,n))}function c5(e){return void 0===e||("number"==typeof e?0===e:0===e.index&&(void 0===e.align||"start"===e.align)&&(void 0===e.offset||0===e.offset))}let c3=ce(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:i},{scrollTargetReached:r,scrollToIndex:o},{didMount:a}])=>{let s=u4(!0),l=u4(0),u=u4(!0);return uU(u0(a,u3(l),uK(([e,t])=>!c5(t)),uJ(!1)),s),uU(u0(a,u3(l),uK(([e,t])=>!c5(t)),uJ(!1)),u),u0(cn(t,a),u3(s,n,e,u),uK(([[,e],t,{sizeTree:n},i,r])=>e&&(!cb(n)||uV(i))&&!t&&!r),u3(l))(1,([,e])=>{if(void 0===e){s(0,!0),u(0,!0);return}uq(r,()=>{u(0,!0)}),c1(4,()=>{uq(i,()=>{s(0,!0)}),o(0,e)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:l,scrolledToInitialItem:s}},uW(cY,cv,c0,cK),{singleton:!0});function c4(e,t){return 1.01>Math.abs(e-t)}let c6="down",c8={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},c9=ce(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:i,scrollTop:r,viewportHeight:o}])=>{let a=u4(!1),s=u4(!0),l=u8(),u=u8(),c=u4(4),h=u4(0),d=u6(u0(cr(u0(ci(r),u2(1),uJ(!0)),u0(ci(r),u2(1),uJ(!1),uY(100))),uX()),!1),p=u6(u0(cr(u0(n,uJ(!0)),u0(n,uJ(!1),uY(200))),uX()),!1);uU(u0(cn(ci(r),ci(h)),uQ(([e,t])=>e<=t),uX()),s),uU(u0(s,u5(50)),u);let f=u9(u0(cn(i,ci(o),ci(t),ci(e),ci(c)),u1((e,[{scrollHeight:t,scrollTop:n},i,r,o,a])=>{let s={scrollHeight:t,scrollTop:n,viewportHeight:i};if(n+i-t>-a){let t,i;return n>e.state.scrollTop?(t="SCROLLED_DOWN",i=e.state.scrollTop-n):(t="SIZE_DECREASED",i=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:i,state:s}}return{atBottom:!1,notAtBottomBecause:s.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":i<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:s}},c8),uX((e,t)=>void 0!==e&&e.atBottom===t.atBottom))),g=u6(u0(i,u1((e,{scrollHeight:t,scrollTop:n,viewportHeight:i})=>{if(!c4(e.scrollHeight,t)){let r=t-(n+i)<1;return e.scrollTop!==n&&r?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}return{changed:!1,jump:0,scrollHeight:t,scrollTop:n}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),uK(e=>e.changed),uQ(e=>e.jump)),0);uU(u0(f,uQ(e=>e.atBottom)),a),uU(u0(a,u5(50)),l);let m=u4(c6);uU(u0(i,uQ(({scrollTop:e})=>e),uX(),u1((e,t)=>uG(p)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?"up":c6,prevScrollTop:t},{direction:c6,prevScrollTop:0}),uQ(e=>e.direction)),m),uU(u0(i,u5(50),uJ("none")),m);let v=u4(0);return uU(u0(d,uK(e=>!e),uJ(0)),v),uU(u0(r,u5(100),u3(d),uK(([e,t])=>t),u1(([e,t],[n])=>[t,n],[0,0]),uQ(([e,t])=>t-e)),v),{atBottomState:f,atBottomStateChange:l,atBottomThreshold:c,atTopStateChange:u,atTopThreshold:h,isAtBottom:a,isAtTop:s,isScrolling:d,lastJumpDueToItemResize:g,scrollDirection:m,scrollVelocity:v}},uW(cv)),c7="bottom",he="none";function ht(e,t,n){return"number"==typeof e?"up"===n&&"top"===t||n===c6&&t===c7?e:0:"up"===n?"top"===t?e.main:e.reverse:t===c7?e.main:e.reverse}function hn(e,t){return"number"==typeof e?e:e[t]??0}let hi=ce(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:i,viewportHeight:r}])=>{let o=u8(),a=u4(0),s=u4(0),l=u4(0),u=u6(u0(cn(ci(i),ci(r),ci(n),ci(o,cP),ci(l),ci(a),ci(t),ci(e),ci(s)),uQ(([e,t,n,[i,r],o,a,s,l,u])=>{let c=e-l,h=Math.max(n-c,0),d=he,p=hn(u,"top"),f=hn(u,c7);return i-=l,i+=n+s,r+=n+s,i>e+(a+s)-p&&(d="up"),(r-=l)<e-h+t+f&&(d=c6),d!==he?[Math.max(c-n-ht(o,"top",d)-p,0),c-h-s+t+ht(o,c7,d)+f]:null}),uK(e=>null!==e),uX(cP)),[0,0]);return{increaseViewportBy:s,listBoundary:o,overscan:l,topListHeight:a,visibleRange:u}},uW(cv),{singleton:!0}),hr={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function ho(e,t,n,i,r,o){let{lastIndex:a,lastOffset:s,lastSize:l}=r,u=0,c=0;if(e.length>0){u=e[0].offset;let t=e[e.length-1];c=t.offset+t.size}let h=n-a,d=u,p=s+h*l+(h-1)*i-c;return{bottom:c,firstItemIndex:o,items:hs(e,r,o),offsetBottom:p,offsetTop:u,top:d,topItems:hs(t,r,o),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function ha(e,t,n,i,r,o){let a=0;if(n.groupIndices.length>0)for(let t of n.groupIndices){if(t-a>=e)break;a++}let s=e+a,l=c2(t,s);return ho(Array.from({length:s}).map((e,t)=>({data:o[t+l],index:t+l,offset:0,size:0})),[],s,r,n,i)}function hs(e,t,n){if(0===e.length)return[];if(!cB(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));let i=e[0].index,r=e[e.length-1].index,o=[],a=cC(t.groupOffsetTree,i,r),s,l=0;for(let i of e){let e;(!s||s.end<i.index)&&(s=a.shift(),l=t.groupIndices.indexOf(s.start)),e=i.index===s.start?{index:l,type:"group"}:{groupIndex:l,index:i.index-(l+1)+n},o.push({...e,data:i.data,offset:i.offset,originalIndex:i.index,size:i.size})}return o}function hl(e,t){return void 0===e?0:"number"==typeof e?e:e[t]??0}let hu=ce(([{data:e,firstItemIndex:t,gap:n,sizes:i,totalCount:r},o,{listBoundary:a,topListHeight:s,visibleRange:l},{initialTopMostItemIndex:u,scrolledToInitialItem:c},{topListHeight:h},d,{didMount:p},{recalcInProgress:f}])=>{let g=u4([]),m=u4(0),v=u8(),y=u4(0);uU(o.topItemsIndexes,g);let x=u6(u0(cn(p,f,ci(l,cP),ci(r),ci(i),ci(u),c,ci(g),ci(t),ci(n),ci(y),e),uK(([e,t,,n,,,,,,,,i])=>{let r=void 0!==i&&i.length!==n;return e&&!t&&!r}),uQ(([,,[e,t],n,i,r,o,a,s,l,u,c])=>{var h;let{offsetTree:d,sizeTree:p}=i,f=uG(m);if(0===n)return{...hr,totalCount:n};if(0===e&&0===t)return 0===f?{...hr,totalCount:n}:ha(f,r,i,s,l,c||[]);if(cb(p))return f>0?null:ho(function(e,t,n){if(cB(t)){let i=cj(e,t);return[{index:cS(t.groupOffsetTree,i)[0],offset:0,size:0},{data:n?.[0],index:i,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}(c2(r,n),i,c),[],n,l,i,s);let g=[];if(a.length>0){let e=a[0],t=a[a.length-1],n=0;for(let i of cC(p,e,t)){let r=i.value,o=Math.max(i.start,e),a=Math.min(i.end,t);for(let e=o;e<=a;e++)g.push({data:c?.[e],index:e,offset:n,size:r}),n+=r}}if(!o)return ho([],g,n,l,i,s);let v=a.length>0?a[a.length-1]+1:0,y=function(e,t,n,i=0){let r,o;return i>0&&(t=Math.max(t,e[cL(e,i,cz)].offset)),cx((r=cL(e,t,cF),o=cL(e,n,cF,r),e.slice(r,o+1)),cU)}(d,e,t,v);if(0===y.length)return null;let x=n-1,b=((n=>{for(let i of y){let r=i.value,o=r.offset,a=i.start,s=r.size;if(r.offset<e){let t=(a+=Math.floor((e-r.offset+l)/(s+l)))-i.start;o+=t*s+t*l}a<v&&(o+=(v-a)*s,a=v);let u=Math.min(i.end,x);for(let e=a;e<=u&&!(o>=t);e++)n.push({data:c?.[e],index:e,offset:o,size:s}),o+=s+l}})(h=[]),h),w=hl(u,"top"),S=hl(u,c7);if(b.length>0&&(w>0||S>0)){let e=b[0],t=b[b.length-1];if(w>0&&e.index>v){let t=Math.min(w,e.index-v),n=[],i=e.offset;for(let r=e.index-1;r>=e.index-t;r--){let t=cC(p,r,r)[0]?.value??e.size;i-=t+l,n.unshift({data:c?.[r],index:r,offset:i,size:t})}b.unshift(...n)}if(S>0&&t.index<x){let e=Math.min(S,x-t.index),n=t.offset+t.size+l;for(let i=t.index+1;i<=t.index+e;i++){let e=cC(p,i,i)[0]?.value??t.size;b.push({data:c?.[i],index:i,offset:n,size:e}),n+=e+l}}}return ho(b,g,n,l,i,s)}),uK(e=>null!==e),uX()),hr);uU(u0(e,uK(uV),uQ(e=>e?.length)),r),uU(u0(x,uQ(e=>e.topListHeight)),h),uU(h,s),uU(u0(x,uQ(e=>[e.top,e.bottom])),a),uU(u0(x,uQ(e=>e.items)),v);let b=u9(u0(x,uK(({items:e})=>e.length>0),u3(r,e),uK(([{items:e},t])=>e[e.length-1].originalIndex===t-1),uQ(([,e,t])=>[e-1,t]),uX(cP),uQ(([e])=>e))),w=u9(u0(x,u5(200),uK(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),uQ(({items:e})=>e[0].index),uX())),S=u9(u0(x,uK(({items:e})=>e.length>0),uQ(({items:e})=>{let t=0,n=e.length-1;for(;"group"===e[t].type&&t<n;)t++;for(;"group"===e[n].type&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),uX(cR)));return{endReached:b,initialItemCount:m,itemsRendered:v,listState:x,minOverscanItemCount:y,rangeChanged:S,startReached:w,topItemsIndexes:g,...d}},uW(cY,cX,hi,c3,c0,c9,cK,cE),{singleton:!0}),hc=ce(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:i},{listState:r}])=>{let o=u8(),a=u6(u0(cn(n,e,i,t,r),uQ(([e,t,n,i,r])=>e+t+n+i+r.offsetBottom+r.bottom)),0);return uU(ci(a),o),{totalListHeight:a,totalListHeightChanged:o}},uW(cv,hu),{singleton:!0}),hh=ce(([{viewportHeight:e},{totalListHeight:t}])=>{let n=u4(!1),i=u6(u0(cn(n,e,t),uK(([e])=>e),uQ(([,e,t])=>Math.max(0,e-t)),u5(0),uX()),0);return{alignToBottom:n,paddingTopAddition:i}},uW(cv,hc),{singleton:!0}),hd=ce(()=>({context:u4(null)})),hp=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:i,...r},viewportBottom:o,viewportTop:a})=>t<a?{...r,align:n??"start",...void 0===i?{}:{behavior:i}}:e>o?{...r,align:n??"end",...void 0===i?{}:{behavior:i}}:null,hf=ce(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:i,fixedHeaderHeight:r,headerHeight:o,scrollingInProgress:a,scrollTop:s,viewportHeight:l},{scrollToIndex:u}])=>{let c=u8();return uU(u0(c,u3(t,l,n,o,r,i,s),u3(e),uQ(([[e,t,n,i,r,o,s,l],u])=>{let{calculateViewLocation:c=hp,done:h,...d}=e,p=cH(e,t,i-1),f=cV(p,t.offsetTree,u)+r+o,g=c({itemBottom:f+cS(t.sizeTree,p)[1],itemTop:f,locationParams:d,viewportBottom:l+n-s,viewportTop:l+o});return null===g?h?.():h&&uq(u0(a,uK(e=>!e),u2(uG(a)?1:2)),h),g}),uK(e=>null!==e)),u),{scrollIntoView:c}},uW(cY,cv,c0,hu,cs),{singleton:!0});function hg(e){return!1!==e&&("smooth"===e?"smooth":"auto")}let hm=ce(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:i},{atBottomState:r,isAtBottom:o},{scrollToIndex:a},{scrolledToInitialItem:s},{didMount:l,propsReady:u},{log:c},{scrollingInProgress:h},{context:d},{scrollIntoView:p}])=>{let f=u4(!1),g=u8(),m=null;function v(e){a(0,{align:"end",behavior:e,index:"LAST"})}function y(e){setTimeout(uq(r,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&null===m&&(uG(c)("scrolling to bottom due to increased size",{},0),v("auto"))}),100)}u0(cn(u0(ci(t),u2(1)),l),u3(ci(f),o,s,h),uQ(([[e,t],n,i,r,o])=>{let a,s=t&&r,l="auto";return s&&(a=i||o,l="function"==typeof n?hg(n(a)):a&&hg(n),s=s&&!1!==l),{followOutputBehavior:l,shouldFollow:s,totalCount:e}}),uK(({shouldFollow:e})=>e))(1,({followOutputBehavior:t,totalCount:i})=>{null!==m&&(m(),m=null),void 0===uG(n)?m=uq(e,()=>{uG(c)("following output to ",{totalCount:i},0),v(t),m=null}):requestAnimationFrame(()=>{uG(c)("following output to ",{totalCount:i},0),v(t)})}),u0(cn(ci(f),t,u),uK(([e,,t])=>!1!==e&&t),u1(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),uK(({refreshed:e})=>e),u3(f,t))(1,([,e])=>{uG(s)&&y(!1!==e)}),g(1,()=>{y(!1!==uG(f))}),cn(ci(f),r)(1,([e,t])=>{!1===e||t.atBottom||"VIEWPORT_HEIGHT_DECREASING"!==t.notAtBottomBecause||v("auto")});let x=u4(null),b=u8();return uU(cr(u0(ci(i),uQ(e=>e?.length??0)),u0(ci(t))),b),u0(cn(u0(b,u2(1)),l),u3(ci(x),s,h,d),uQ(([[e,t],n,i,r,o])=>t&&i&&n?.({context:o,totalCount:e,scrollingInProgress:r})),uK(e=>!!e),u5(0))(1,t=>{null!==m&&(m(),m=null),void 0===uG(n)?m=uq(e,()=>{uG(c)("scrolling into view",{}),p(0,t),m=null}):requestAnimationFrame(()=>{uG(c)("scrolling into view",{}),p(0,t)})}),{autoscrollToBottom:g,followOutput:f,scrollIntoViewOnChange:x}},uW(cY,c9,c0,c3,cK,cs,cv,hd,hf)),hv=ce(([{data:e,firstItemIndex:t,gap:n,sizes:i},{initialTopMostItemIndex:r},{initialItemCount:o,listState:a},{didMount:s}])=>(uU(u0(s,u3(o),uK(([,e])=>0!==e),u3(r,i,t,n,e),uQ(([[,e],t,n,i,r,o=[]])=>ha(e,t,n,i,r,o))),a),{}),uW(cY,c3,hu,cK),{singleton:!0}),hy=ce(([{didMount:e},{scrollTo:t},{listState:n}])=>{let i=u4(0);return u0(e,u3(i),uK(([,e])=>0!==e),uQ(([,e])=>({top:e})))(1,e=>{uq(u0(n,u2(1),uK(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{t(0,e)})})}),{initialScrollTop:i}},uW(cK,cv,hu),{singleton:!0}),hx=ce(([{scrollVelocity:e}])=>{let t=u4(!1),n=u8(),i=u4(!1);return uU(u0(e,u3(i,t,n),uK(([e,t])=>!1!==t&&void 0!==t),uQ(([e,t,n,i])=>{let{enter:r,exit:o}=t;if(n){if(o(e,i))return!1}else if(r(e,i))return!0;return n}),uX()),t),u0(cn(t,e,n),u3(i))(1,([[e,t,n],i])=>{e&&!1!==i&&void 0!==i&&i.change&&i.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:i,scrollSeekRangeChanged:n,scrollVelocity:e}},uW(c9),{singleton:!0}),hb=ce(([{scrollContainerState:e,scrollTo:t}])=>{let n=u8(),i=u8(),r=u8(),o=u4(!1),a=u4(void 0);return uU(u0(cn(n,i),uQ(([{scrollTop:e,viewportHeight:t},{offsetTop:n,listHeight:i}])=>({scrollHeight:i,scrollTop:Math.max(0,e-n),viewportHeight:t}))),e),uU(u0(t,u3(i),uQ(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),r),{customScrollParent:a,useWindowScroll:o,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:i}},uW(cv)),hw=ce(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:i},{initialTopMostItemIndex:r},{didMount:o},{useWindowScroll:a,windowScrollContainerState:s,windowViewportRect:l}])=>{let u=u8(),c=u4(void 0),h=u4(null),d=u4(null);return uU(s,h),uU(l,d),u0(u,u3(t,i,a,h,d,n))(1,([e,t,n,i,r,o,a])=>{let s=cM(t.sizeTree).map(({k:e,v:t},n,i)=>{let r=i[n+1];return{endIndex:void 0===r?1/0:r.k-1,size:t,startIndex:e}});i&&null!==r&&null!==o&&(n=r.scrollTop-o.offsetTop),e({ranges:s,scrollTop:n-=a})}),uU(u0(c,uK(uV),uQ(hS)),r),uU(u0(o,u3(c),uK(([,e])=>void 0!==e),uX(),uQ(([,e])=>e.ranges)),e),{getState:u,restoreStateFrom:c}},uW(cY,cv,c3,cK,hb));function hS(e){return{align:"start",index:0,offset:e.scrollTop}}let h_=ce(([{topItemsIndexes:e}])=>{let t=u4(0);return uU(u0(t,uK(e=>e>=0),uQ(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},uW(hu));function hC(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}let hM=hC(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),hA=ce(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:i},{isAtBottom:r,isScrolling:o,lastJumpDueToItemResize:a,scrollDirection:s},{listState:l},{beforeUnshiftWith:u,gap:c,shiftWithOffset:h,sizes:d},{log:p},{recalcInProgress:f}])=>{let g=u9(u0(l,u3(a),u1(([,e,t,n],[{bottom:i,items:r,offsetBottom:o,totalCount:a},s])=>{let l=i+o,u=0;return t===a&&e.length>0&&r.length>0&&(0===r[0].originalIndex&&0===e[0].originalIndex||0!=(u=l-n)&&(u+=s)),[u,r,a,l]},[0,[],0,0]),uK(([e])=>0!==e),u3(i,s,n,r,p,f),uK(([,e,t,n,,,i])=>!i&&!n&&0!==e&&"up"===t),uQ(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},0),e))));function m(n){n>0?(t(0,{behavior:"auto",top:-n}),e(0,0)):(e(0,0),t(0,{behavior:"auto",top:-n}))}return u0(g,u3(e,o))(1,([t,n,i])=>{i&&hM()?e(0,n-t):m(-t)}),u0(cn(u6(o,!1),e,f),uK(([e,t,n])=>!e&&!n&&0!==t),uQ(([e,t])=>t),u5(1))(1,m),uU(u0(h,uQ(e=>({top:-e}))),t),u0(u,u3(d,c),uQ(([e,{groupIndices:t,lastSize:n,sizeTree:i},r])=>{if(0===t.length)return e*(n+r);let o=0,a=cw(i,0),s=0,l=0;for(;s<e;){s++,o+=a;let i=t.length===l+1?1/0:t[l+1]-t[l]-1;s+i>e&&(o-=a,i=e-s+1),s+=i,o+=i*(n+r),l++}return o}))(1,n=>{e(0,n),requestAnimationFrame(()=>{t(0,{top:n}),requestAnimationFrame(()=>{e(0,0),f(0,!1)})})}),{deviation:e}},uW(cv,c9,hu,cY,cs,cE)),hk=ce(([e,t,n,i,r,o,a,s,l,u,c])=>({...e,...t,...n,...i,...r,...o,...a,...s,...l,...u,...c}),uW(hi,hv,cK,hx,hc,hy,hh,hb,hf,cs,hd)),hT=ce(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:i,fixedGroupSize:r,gap:o,groupIndices:a,heightEstimates:s,itemSize:l,sizeRanges:u,sizes:c,statefulTotalCount:h,totalCount:d,trackItemSizes:p},{initialItemFinalLocationReached:f,initialTopMostItemIndex:g,scrolledToInitialItem:m},v,y,x,b,{scrollToIndex:w},S,{topItemCount:_},{groupCounts:C},M])=>{let{listState:A,minOverscanItemCount:k,topItemsIndexes:T,rangeChanged:I,...D}=b;return uU(I,M.scrollSeekRangeChanged),uU(u0(M.windowViewportRect,uQ(e=>e.visibleHeight)),v.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:i,fixedGroupHeight:r,gap:o,groupCounts:C,heightEstimates:s,initialItemFinalLocationReached:f,initialTopMostItemIndex:g,scrolledToInitialItem:m,sizeRanges:u,topItemCount:_,topItemsIndexes:T,totalCount:d,...x,groupIndices:a,itemSize:l,listState:A,minOverscanItemCount:k,scrollToIndex:w,statefulTotalCount:h,trackItemSizes:p,rangeChanged:I,...D,...M,...v,sizes:c,...y}},uW(cY,c3,cv,hw,hm,hu,c0,hA,h_,cX,hk)),hI=typeof document>"u"?eS().useEffect:eS().useLayoutEffect;function hD(e,t,n){let i=Object.keys(t.required||{}),r=Object.keys(t.optional||{}),o=Object.keys(t.methods||{}),a=Object.keys(t.events||{}),s=eS().createContext({});function l(e,n){for(let r of(void 0!==e.propsReady&&(0,e.propsReady)(0,!1),i))(0,e[t.required[r]])(0,n[r]);for(let i of r)i in n&&(0,e[t.optional[i]])(0,n[i]);void 0!==e.propsReady&&(0,e.propsReady)(0,!0)}function u(e){return a.reduce((n,i)=>{var r;let o,a,s;return n[i]=(r=e[t.events[i]],s=()=>o?.(),function(e,t){switch(e){case 1:return t?a===t?void 0:(s(),a=t,o=r(1,t)):(s(),uj);case 2:s(),a=null;return}}),n},{})}return{Component:eS().forwardRef(function(c,h){var d;let{children:p,...f}=c,[g]=eS().useState(()=>{var t;let n,i;return n=new Map,l(t=(i=({constructor:e,dependencies:t,id:r,singleton:o})=>{if(o&&n.has(r))return n.get(r);let a=e(t.map(e=>i(e)));return o&&n.set(r,a),a})(e),f),t}),[m]=eS().useState(()=>u(g));return hI(()=>{for(let e of a)e in f&&(0,m[e])(1,f[e]);return()=>{Object.values(m).map(u$)}},[f,m,g]),hI(()=>{l(g,f)}),eS().useImperativeHandle(h,(d=o.reduce((e,n)=>(e[n]=e=>{(0,g[t.methods[n]])(0,e)},e),{}),()=>d)),(0,eb.jsx)(s.Provider,{value:g,children:void 0===n?p:(0,eb.jsx)(n,{...function(e,t){let n={},i={},r=0,o=e.length;for(;r<o;)i[e[r]]=1,r+=1;for(let e in t)Object.hasOwn(i,e)||(n[e]=t[e]);return n}([...i,...r,...a],f),children:p})})}),useEmitter:(e,t)=>{let n=eS().useContext(s)[e];hI(()=>n(1,t),[t,n])},useEmitterValue:parseInt(eS().version,10)>=18?e=>{let t=eS().useContext(s)[e],n=eS().useCallback(e=>t(1,e),[t]);return eS().useSyncExternalStore(n,()=>uG(t),()=>uG(t))}:e=>{let t=eS().useContext(s)[e],[n,i]=eS().useState(()=>uG(t));return hI(()=>t(1,e=>{e!==n&&i(()=>e)}),[t,n]),n},usePublisher:e=>{let t=eS().useContext(s);return eS().useCallback(n=>{(0,t[e])(0,n)},[t,e])}}}let hO=eS().createContext(void 0),hR=eS().createContext(void 0),hP="-webkit-sticky",hE="sticky",hL=hC(()=>{if(typeof document>"u")return hE;let e=document.createElement("div");return e.style.position=hP,e.style.position===hP?hP:hE}),hN=typeof document>"u"?eS().useEffect:eS().useLayoutEffect;function hB(e){return"self"in e}function hz(e,t,n,i=uj,r,o){let a=eS().useRef(null),s=eS().useRef(null),l=eS().useRef(null),u=eS().useCallback(n=>{let i,r,a,u=n.target;if("body"in u||hB(u)){let e=hB(u)?u:u.defaultView;a=!0===o?ch(e,e.scrollX):e.scrollY,i=!0===o?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,r=!0===o?e.innerWidth:e.innerHeight}else a=!0===o?ch(u,u.scrollLeft):u.scrollTop,i=!0===o?u.scrollWidth:u.scrollHeight,r=!0===o?u.offsetWidth:u.offsetHeight;let c=()=>{e({scrollHeight:i,scrollTop:Math.max(a,0),viewportHeight:r})};!0===n.suppressFlushSync?c():tO().flushSync(c),null!==s.current&&(a===s.current||a<=0||a===i-r)&&(s.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,o]);return eS().useEffect(()=>{let e=r??a.current;return cc(e),i(r??a.current),u({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",u,{passive:!0}),()=>{cc(e),i(null),e.removeEventListener("scroll",u)}},[a,u,n,i,r]),{scrollByCallback:function(e){!0===o&&(e={...void 0===e.behavior?{}:{behavior:e.behavior},...void 0===e.top?{}:{left:ch(a.current,e.top)}}),a.current.scrollBy(e)},scrollerRef:a,scrollToCallback:function(n){let i,r,u,c=a.current;if(!c||(!0===o?"offsetWidth"in c&&0===c.offsetWidth:"offsetHeight"in c&&0===c.offsetHeight))return;let h="smooth"===n.behavior;hB(c)?(r=Math.max(cN(c.document.documentElement,!0===o?"width":"height"),!0===o?c.document.documentElement.scrollWidth:c.document.documentElement.scrollHeight),i=!0===o?c.innerWidth:c.innerHeight,u=!0===o?ch(c,c.scrollX):c.scrollY):(r=c[!0===o?"scrollWidth":"scrollHeight"],i=cN(c,!0===o?"width":"height"),u=!0===o?ch(c,c.scrollLeft):c.scrollTop);let d=r-i;if(void 0===n.top)return void c.scrollTo(n);let p=Math.ceil(Math.max(Math.min(d,n.top),0));if(n.top=p,c4(i,r)||p===u){e({scrollHeight:r,scrollTop:u,viewportHeight:i}),h&&t(!0);return}h?(s.current=p,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,s.current=null,t(!0)},1e3)):s.current=null,!0===o&&(n={...void 0===n.behavior?{}:{behavior:n.behavior},left:ch(c,p)}),c.scrollTo(n)}}}function hF(e){return e}let hV=ce(()=>{let e=u4(e=>`Item ${e}`),t=u4(e=>`Group ${e}`),n=u4({}),i=u4(hF),r=u4("div"),o=u4(uj),a=(e,t=null)=>u6(u0(n,uQ(t=>t[e]),uX()),t);return{components:n,computeItemKey:i,EmptyPlaceholder:a("EmptyPlaceholder"),FooterComponent:a("Footer"),GroupComponent:a("Group","div"),groupContent:t,HeaderComponent:a("Header"),HeaderFooterTag:r,ItemComponent:a("Item","div"),itemContent:e,ListComponent:a("List","div"),ScrollerComponent:a("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TopItemListComponent:a("TopItemList")}}),hj=ce(([e,t])=>({...e,...t}),uW(hT,hV)),hH=({height:e})=>(0,eb.jsx)("div",{style:{height:e}}),hW={overflowAnchor:"none",position:hL(),zIndex:1},h$={overflowAnchor:"none"},hG={...h$,display:"inline-block",height:"100%"},hU=eS().memo(function({showTopList:e=!1}){let t=h7("listState"),n=de("sizeRanges"),i=h7("useWindowScroll"),r=h7("customScrollParent"),o=de("windowScrollContainerState"),a=de("scrollContainerState"),s=h7("itemContent"),l=h7("context"),u=h7("groupContent"),c=h7("trackItemSizes"),h=h7("itemSize"),d=h7("log"),p=de("gap"),f=h7("horizontalDirection"),{callbackRef:g}=cf(n,h,c,e?uj:r||i?o:a,d,p,r,f,h7("skipAnimationFrameInResizeObserver")),[m,v]=eS().useState(0);h9("deviation",e=>{m!==e&&v(e)});let y=h7("EmptyPlaceholder"),x=h7("ScrollSeekPlaceholder")??hH,b=h7("ListComponent"),w=h7("ItemComponent"),S=h7("GroupComponent"),_=h7("computeItemKey"),C=h7("isSeeking"),M=h7("groupIndices").length>0,A=h7("alignToBottom"),k=h7("initialItemFinalLocationReached"),T=e?{}:{boxSizing:"border-box",...f?{display:"inline-block",height:"100%",marginInlineStart:0===m?A?"auto":0:m,paddingInlineEnd:t.offsetBottom,paddingInlineStart:t.offsetTop,whiteSpace:"nowrap"}:{marginTop:0===m?A?"auto":0:m,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...k?{}:{visibility:"hidden"}};return e||0!==t.totalCount||null==y?(0,eb.jsx)(b,{...hQ(b,l),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:g,style:T,children:(e?t.topItems:t.items).map(e=>{let n=e.originalIndex,i=_(n+t.firstItemIndex,e.data,l);return C?(0,ew.createElement)(x,{...hQ(x,l),height:e.size,index:e.index,key:i,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?(0,ew.createElement)(S,{...hQ(S,l),"data-index":n,"data-item-index":e.index,"data-known-size":e.size,key:i,style:hW},u(e.index,l)):(0,ew.createElement)(w,{...hQ(w,l),...hJ(w,e.data),"data-index":n,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:i,style:f?hG:h$},M?s(e.index,e.groupIndex,e.data,l):s(e.index,e.data,l))})}):(0,eb.jsx)(y,{...hQ(y,l)})}),hq={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},hY={outline:"none",overflowX:"auto",position:"relative"},hZ=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),hX=(e,t,n=0)=>({...hZ(e),position:t?"relative":"absolute",top:t?-n:0}),hK={position:hL(),top:0,width:"100%",zIndex:1};function hQ(e,t){if("string"!=typeof e)return{context:t}}function hJ(e,t){return{item:"string"==typeof e?void 0:t}}let h0=eS().memo(function(){let e=h7("HeaderComponent"),t=de("headerHeight"),n=h7("HeaderFooterTag"),i=cd(eS().useMemo(()=>e=>{t(cN(e,"height"))},[t]),!0,h7("skipAnimationFrameInResizeObserver")),r=h7("context");return null!=e?(0,eb.jsx)(n,{ref:i,children:(0,eb.jsx)(e,{...hQ(e,r)})}):null}),h1=eS().memo(function(){let e=h7("FooterComponent"),t=de("footerHeight"),n=h7("HeaderFooterTag"),i=cd(eS().useMemo(()=>e=>{t(cN(e,"height"))},[t]),!0,h7("skipAnimationFrameInResizeObserver")),r=h7("context");return null!=e?(0,eb.jsx)(n,{ref:i,children:(0,eb.jsx)(e,{...hQ(e,r)})}):null});function h2({useEmitter:e,useEmitterValue:t,usePublisher:n}){return eS().memo(function({children:i,style:r,context:o,...a}){let s=n("scrollContainerState"),l=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),c=t("scrollerRef"),h=t("horizontalDirection")||!1,{scrollByCallback:d,scrollerRef:p,scrollToCallback:f}=hz(s,u,l,c,void 0,h);return e("scrollTo",f),e("scrollBy",d),(0,eb.jsx)(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...h?hY:hq,...r},tabIndex:0,...a,...hQ(l,o),children:i})})}function h5({useEmitter:e,useEmitterValue:t,usePublisher:n}){return eS().memo(function({children:i,style:r,context:o,...a}){let s=n("windowScrollContainerState"),l=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),c=t("totalListHeight"),h=t("deviation"),d=t("customScrollParent"),p=eS().useRef(null),{scrollByCallback:f,scrollerRef:g,scrollToCallback:m}=hz(s,u,l,t("scrollerRef"),d);return hN(()=>(g.current=d??p.current?.ownerDocument.defaultView,()=>{g.current=null}),[g,d]),e("windowScrollTo",m),e("scrollBy",f),(0,eb.jsx)(l,{ref:p,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...0===c?void 0:{height:c+h}},...a,...hQ(l,o),children:i})})}let h3=({children:e})=>{let t=eS().useContext(hO),n=de("viewportHeight"),i=de("fixedItemHeight"),r=h7("alignToBottom"),o=h7("horizontalDirection"),a=cd(eS().useMemo(()=>uF(n,e=>cN(e,o?"width":"height")),[n,o]),!0,h7("skipAnimationFrameInResizeObserver"));return eS().useEffect(()=>{t&&(n(t.viewportHeight),i(t.itemHeight))},[t,n,i]),(0,eb.jsx)("div",{"data-viewport-type":"element",ref:a,style:hZ(r),children:e})},h4=({children:e})=>{let t=eS().useContext(hO),n=de("windowViewportRect"),i=de("fixedItemHeight"),r=h7("customScrollParent"),o=h7("useWindowScroll"),a=h7("topListHeight"),s=cm(n,r,h7("skipAnimationFrameInResizeObserver")),l=h7("alignToBottom");return eS().useEffect(()=>{t&&(i(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,i]),(0,eb.jsx)("div",{"data-viewport-type":"window",ref:s,style:hX(l,o,a),children:e})},h6=({children:e})=>{let t=h7("TopItemListComponent")??"div",n=h7("headerHeight"),i={...hK,marginTop:`${n}px`},r=h7("context");return(0,eb.jsx)(t,{style:i,...hQ(t,r),children:e})},{Component:h8,useEmitter:h9,useEmitterValue:h7,usePublisher:de}=hD(hj,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},eS().memo(function(e){let t=h7("useWindowScroll"),n=h7("topItemsIndexes").length>0,i=h7("customScrollParent"),r=h7("context");return(0,eb.jsxs)(i||t?dn:dt,{...e,context:r,children:[n&&(0,eb.jsx)(h6,{children:(0,eb.jsx)(hU,{showTopList:!0})}),(0,eb.jsxs)(i||t?h4:h3,{children:[(0,eb.jsx)(h0,{}),(0,eb.jsx)(hU,{}),(0,eb.jsx)(h1,{})]})]})})),dt=h2({useEmitter:h9,useEmitterValue:h7,usePublisher:de}),dn=h5({useEmitter:h9,useEmitterValue:h7,usePublisher:de}),di=ce(()=>{let e=u4(e=>(0,eb.jsxs)("td",{children:["Item $",e]})),t=u4(null),n=u4(e=>(0,eb.jsxs)("td",{colSpan:1e3,children:["Group ",e]})),i=u4(null),r=u4(null),o=u4({}),a=u4(hF),s=u4(uj),l=(e,t=null)=>u6(u0(o,uQ(t=>t[e]),uX()),t);return{components:o,computeItemKey:a,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:r,fixedHeaderContent:i,itemContent:e,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}}),dr=ce(([e,t])=>({...e,...t}),uW(hT,di)),da=({height:e})=>(0,eb.jsx)("tr",{children:(0,eb.jsx)("td",{style:{height:e}})}),ds=({height:e})=>(0,eb.jsx)("tr",{children:(0,eb.jsx)("td",{style:{border:0,height:e,padding:0}})}),dl={overflowAnchor:"none"},du={position:hL(),zIndex:2,overflowAnchor:"none"},dc=eS().memo(function({showTopList:e=!1}){let t=dm("listState"),n=dm("computeItemKey"),i=dm("firstItemIndex"),r=dm("context"),o=dm("isSeeking"),a=dm("fixedHeaderHeight"),s=dm("groupIndices").length>0,l=dm("itemContent"),u=dm("groupContent"),c=dm("ScrollSeekPlaceholder")??da,h=dm("GroupComponent"),d=dm("TableRowComponent"),p=(e?t.topItems:[]).reduce((e,t,n)=>(0===n?e.push(t.size):e.push(e[n-1]+t.size),e),[]);return(e?t.topItems:t.items).map(t=>{let f=t.originalIndex,g=n(f+i,t.data,r),m=e?0===f?0:p[f-1]:0;return o?(0,ew.createElement)(c,{...hQ(c,r),height:t.size,index:t.index,key:g,type:t.type||"item"}):"group"===t.type?(0,ew.createElement)(h,{...hQ(h,r),"data-index":f,"data-item-index":t.index,"data-known-size":t.size,key:g,style:{...du,top:a}},u(t.index,r)):(0,ew.createElement)(d,{...hQ(d,r),...hJ(d,t.data),"data-index":f,"data-item-index":t.index,"data-known-size":t.size,"data-item-group-index":t.groupIndex,key:g,style:e?{...du,top:a+m}:dl},s?l(t.index,t.groupIndex,t.data,r):l(t.index,t.data,r))})}),dh=eS().memo(function(){let e=dm("listState"),t=dm("topItemsIndexes").length>0,n=dv("sizeRanges"),i=dm("useWindowScroll"),r=dm("customScrollParent"),o=dv("windowScrollContainerState"),a=dv("scrollContainerState"),s=dm("trackItemSizes"),{callbackRef:l,ref:u}=cf(n,dm("itemSize"),s,r||i?o:a,dm("log"),void 0,r,!1,dm("skipAnimationFrameInResizeObserver")),[c,h]=eS().useState(0);dg("deviation",e=>{c!==e&&(u.current.style.marginTop=`${e}px`,h(e))});let d=dm("EmptyPlaceholder"),p=dm("FillerRow")??ds,f=dm("TableBodyComponent"),g=dm("paddingTopAddition"),m=dm("statefulTotalCount"),v=dm("context");if(0===m&&null!=d)return(0,eb.jsx)(d,{...hQ(d,v)});let y=(t?e.topItems:[]).reduce((e,t)=>e+t.size,0),x=e.offsetTop+g+c-y,b=e.offsetBottom,w=x>0?(0,eb.jsx)(p,{context:v,height:x},"padding-top"):null,S=b>0?(0,eb.jsx)(p,{context:v,height:b},"padding-bottom"):null;return(0,eb.jsxs)(f,{"data-testid":"virtuoso-item-list",ref:l,...hQ(f,v),children:[w,t&&(0,eb.jsx)(dc,{showTopList:!0}),(0,eb.jsx)(dc,{}),S]})}),dd=({children:e})=>{let t=eS().useContext(hO),n=dv("viewportHeight"),i=dv("fixedItemHeight"),r=cd(eS().useMemo(()=>uF(n,e=>cN(e,"height")),[n]),!0,dm("skipAnimationFrameInResizeObserver"));return eS().useEffect(()=>{t&&(n(t.viewportHeight),i(t.itemHeight))},[t,n,i]),(0,eb.jsx)("div",{"data-viewport-type":"element",ref:r,style:hZ(!1),children:e})},dp=({children:e})=>{let t=eS().useContext(hO),n=dv("windowViewportRect"),i=dv("fixedItemHeight"),r=dm("customScrollParent"),o=dm("useWindowScroll"),a=cm(n,r,dm("skipAnimationFrameInResizeObserver"));return eS().useEffect(()=>{t&&(i(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,i]),(0,eb.jsx)("div",{"data-viewport-type":"window",ref:a,style:hX(!1,o),children:e})},{Component:df,useEmitter:dg,useEmitterValue:dm,usePublisher:dv}=hD(dr,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},eS().memo(function(e){let t=dm("useWindowScroll"),n=dm("customScrollParent"),i=dv("fixedHeaderHeight"),r=dv("fixedFooterHeight"),o=dm("fixedHeaderContent"),a=dm("fixedFooterContent"),s=dm("context"),l=cd(eS().useMemo(()=>uF(i,e=>cN(e,"height")),[i]),!0,dm("skipAnimationFrameInResizeObserver")),u=cd(eS().useMemo(()=>uF(r,e=>cN(e,"height")),[r]),!0,dm("skipAnimationFrameInResizeObserver")),c=n||t?dx:dy,h=n||t?dp:dd,d=dm("TableComponent"),p=dm("TableHeadComponent"),f=dm("TableFooterComponent"),g=o?(0,eb.jsx)(p,{ref:l,style:{position:"sticky",top:0,zIndex:2},...hQ(p,s),children:o()},"TableHead"):null,m=a?(0,eb.jsx)(f,{ref:u,style:{bottom:0,position:"sticky",zIndex:1},...hQ(f,s),children:a()},"TableFoot"):null;return(0,eb.jsx)(c,{...e,...hQ(c,s),children:(0,eb.jsx)(h,{children:(0,eb.jsxs)(d,{style:{borderSpacing:0,overflowAnchor:"none"},...hQ(d,s),children:[g,(0,eb.jsx)(dh,{},"TableBody"),m]})})})})),dy=h2({useEmitter:dg,useEmitterValue:dm,usePublisher:dv}),dx=h5({useEmitter:dg,useEmitterValue:dm,usePublisher:dv}),db={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},dw={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:dS,floor:d_,max:dC,min:dM,round:dA}=Math;function dk(e,t,n){return Array.from({length:t-e+1}).map((t,i)=>({data:null===n?null:n[i+e],index:i+e}))}function dT(e,t){return void 0!==e&&e.width===t.width&&e.height===t.height}function dI(e,t){return void 0!==e&&e.column===t.column&&e.row===t.row}let dD=ce(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:i},{footerHeight:r,headerHeight:o,scrollBy:a,scrollContainerState:s,scrollTo:l,scrollTop:u,smoothScrollTargetReached:c,viewportHeight:h},d,p,{didMount:f,propsReady:g},{customScrollParent:m,useWindowScroll:v,windowScrollContainerState:y,windowScrollTo:x,windowViewportRect:b},w])=>{let S=u4(0),_=u4(0),C=u4(db),M=u4({height:0,width:0}),A=u4({height:0,width:0}),k=u8(),T=u8(),I=u4(0),D=u4(null),O=u4({column:0,row:0}),R=u8(),P=u8(),E=u4(!1),L=u4(0),N=u4(!0),B=u4(!1),z=u4(!1);u0(f,u3(L),uK(([e,t])=>!c5(t)))(1,()=>{N(0,!1)}),u0(cn(f,N,A,M,L,B),uK(([e,t,n,i,,r])=>e&&!t&&0!==n.height&&0!==i.height&&!r))(1,([,,,,e])=>{void 0===e?N(0,!0):(B(0,!0),c1(1,()=>{k(0,e)}),uq(u0(u),()=>{t(0,[0,0]),N(0,!0)}))}),uU(u0(P,uK(e=>null!=e&&e.scrollTop>0),uJ(0)),_),u0(f,u3(P),uK(([,e])=>null!=e))(1,([,e])=>{e&&(M(0,e.viewport),A(0,e.item),O(0,e.gap),e.scrollTop>0&&(E(0,!0),uq(u0(u,u2(1)),e=>{E(0,!1)}),l(0,{top:e.scrollTop})))}),uU(u0(M,uQ(({height:e})=>e)),h),uU(u0(cn(ci(M,dT),ci(A,dT),ci(O,(e,t)=>void 0!==e&&e.column===t.column&&e.row===t.row),ci(u)),uQ(([e,t,n,i])=>({gap:n,item:t,scrollTop:i,viewport:e}))),R),uU(u0(cn(ci(S),i,ci(O,dI),ci(A,dT),ci(M,dT),ci(D),ci(_),ci(E),ci(N),ci(L)),uK(([,,,,,,,e])=>!e),uQ(([e,[t,n],i,r,o,a,s,,l,u])=>{let c,h,{column:d,row:p}=i,{height:f,width:g}=r,{width:m}=o;if(0===s&&(0===e||0===m))return db;if(0===g){var v;let t=c2(u,e),n=t+Math.max(s-1,0);return v=dk(t,n,a),{...dw,items:v}}let y=dO(m,g,d);l?0===t&&0===n&&s>0?(c=0,h=s-1):(c=y*d_((t+p)/(f+p)),h=dM(e-1,dC(h=y*dS((n+p)/(f+p))-1,y-1)),c=dM(h,dC(0,c))):(c=0,h=-1);let x=dk(c,h,a),{bottom:b,top:w}=dR(o,i,r,x),S=dS(e/y);return{bottom:b,itemHeight:f,items:x,itemWidth:g,offsetBottom:S*f+(S-1)*p-b,offsetTop:w,top:w}})),C),uU(u0(D,uK(e=>null!==e),uQ(e=>e.length)),S),uU(u0(cn(M,A,C,O),uK(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),uQ(([e,t,{items:n},i])=>{let{bottom:r,top:o}=dR(e,i,t,n);return[o,r]}),uX(cP)),t);let F=u4(!1);uU(u0(u,u3(F),uQ(([e,t])=>t||0!==e)),F);let V=u9(u0(cn(C,S),uK(([{items:e}])=>e.length>0),u3(F),uK(([[e,t],n])=>{let i=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&i}),uQ(([[,e]])=>e-1),uX())),j=u9(u0(ci(C),uK(({items:e})=>e.length>0&&0===e[0].index),uJ(0),uX())),H=u9(u0(ci(C),u3(E),uK(([{items:e},t])=>e.length>0&&!t),uQ(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),uX(cR),u5(0)));uU(H,p.scrollSeekRangeChanged),uU(u0(k,u3(M,A,S,O),uQ(([e,t,n,i,r])=>{let o=cJ(e),{align:a,behavior:s,offset:l}=o,u=o.index;"LAST"===u&&(u=i-1);let c=dP(t,r,n,u=dC(0,u,dM(i-1,u)));return"end"===a?c=dA(c-t.height+n.height):"center"===a&&(c=dA(c-t.height/2+n.height/2)),void 0!==l&&0!==l&&(c+=l),{behavior:s,top:c}})),l);let W=u6(u0(C,uQ(e=>e.offsetBottom+e.bottom)),0);return uU(u0(b,uQ(e=>({height:e.visibleHeight,width:e.visibleWidth}))),M),{customScrollParent:m,data:D,deviation:I,footerHeight:r,gap:O,headerHeight:o,increaseViewportBy:e,initialItemCount:_,itemDimensions:A,overscan:n,restoreStateFrom:P,scrollBy:a,scrollContainerState:s,scrollHeight:T,scrollTo:l,scrollToIndex:k,scrollTop:u,smoothScrollTargetReached:c,totalCount:S,useWindowScroll:v,viewportDimensions:M,windowScrollContainerState:y,windowScrollTo:x,windowViewportRect:b,...p,gridState:C,horizontalDirection:z,initialTopMostItemIndex:L,totalListHeight:W,...d,endReached:V,propsReady:g,rangeChanged:H,startReached:j,stateChanged:R,stateRestoreInProgress:E,...w}},uW(hi,cv,c9,hx,cK,hb,cs));function dO(e,t,n){return dC(1,d_((e+n)/(d_(t)+n)))}function dR(e,t,n,i){let{height:r}=n;if(void 0===r||0===i.length)return{bottom:0,top:0};let o=dP(e,t,n,i[0].index);return{bottom:dP(e,t,n,i[i.length-1].index)+r,top:o}}function dP(e,t,n,i){let r=d_(i/dO(e.width,n.width,t.column)),o=r*n.height+dC(0,r-1)*t.row;return o>0?o+t.row:o}let dE=ce(()=>{let e=u4(e=>`Item ${e}`),t=u4({}),n=u4(null),i=u4("virtuoso-grid-item"),r=u4("virtuoso-grid-list"),o=u4(hF),a=u4("div"),s=u4(uj),l=(e,n=null)=>u6(u0(t,uQ(t=>t[e]),uX()),n),u=u4(!1),c=u4(!1);return uU(ci(c),u),{components:t,computeItemKey:o,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:a,itemClassName:i,ItemComponent:l("Item","div"),itemContent:e,listClassName:r,ListComponent:l("List","div"),readyStateChanged:u,reportReadyState:c,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),dL=ce(([e,t])=>({...e,...t}),uW(dD,dE)),dN=eS().memo(function(){let e=dH("gridState"),t=dH("listClassName"),n=dH("itemClassName"),i=dH("itemContent"),r=dH("computeItemKey"),o=dH("isSeeking"),a=dW("scrollHeight"),s=dH("ItemComponent"),l=dH("ListComponent"),u=dH("ScrollSeekPlaceholder"),c=dH("context"),h=dW("itemDimensions"),d=dW("gap"),p=dH("log"),f=dH("stateRestoreInProgress"),g=dW("reportReadyState"),m=cd(eS().useMemo(()=>e=>{a(e.parentElement.parentElement.scrollHeight);let t=e.firstChild;if(null!==t){let{height:e,width:n}=t.getBoundingClientRect();h({height:e,width:n})}d({column:dU("column-gap",getComputedStyle(e).columnGap,p),row:dU("row-gap",getComputedStyle(e).rowGap,p)})},[a,h,d,p]),!0,!1);return hN(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),f?null:(0,eb.jsx)(l,{className:t,ref:m,...hQ(l,c),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(t=>{let a=r(t.index,t.data,c);return o?(0,eb.jsx)(u,{...hQ(u,c),height:e.itemHeight,index:t.index,width:e.itemWidth},a):(0,ew.createElement)(s,{...hQ(s,c),className:n,"data-index":t.index,key:a},i(t.index,t.data,c))})})}),dB=eS().memo(function(){let e=dH("HeaderComponent"),t=dW("headerHeight"),n=dH("headerFooterTag"),i=cd(eS().useMemo(()=>e=>{t(cN(e,"height"))},[t]),!0,!1),r=dH("context");return null!=e?(0,eb.jsx)(n,{ref:i,children:(0,eb.jsx)(e,{...hQ(e,r)})}):null}),dz=eS().memo(function(){let e=dH("FooterComponent"),t=dW("footerHeight"),n=dH("headerFooterTag"),i=cd(eS().useMemo(()=>e=>{t(cN(e,"height"))},[t]),!0,!1),r=dH("context");return null!=e?(0,eb.jsx)(n,{ref:i,children:(0,eb.jsx)(e,{...hQ(e,r)})}):null}),dF=({children:e})=>{let t=eS().useContext(hR),n=dW("itemDimensions"),i=dW("viewportDimensions"),r=cd(eS().useMemo(()=>e=>{i(e.getBoundingClientRect())},[i]),!0,!1);return eS().useEffect(()=>{t&&(i({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,i,n]),(0,eb.jsx)("div",{ref:r,style:hZ(!1),children:e})},dV=({children:e})=>{let t=eS().useContext(hR),n=dW("windowViewportRect"),i=dW("itemDimensions"),r=dH("customScrollParent"),o=dH("useWindowScroll"),a=cm(n,r,!1);return eS().useEffect(()=>{t&&(i({height:t.itemHeight,width:t.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,i]),(0,eb.jsx)("div",{ref:a,style:hX(!1,o),children:e})},{useEmitter:dj,useEmitterValue:dH,usePublisher:dW}=hD(dL,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},eS().memo(function({...e}){let t=dH("useWindowScroll"),n=dH("customScrollParent"),i=n||t?dG:d$,r=n||t?dV:dF,o=dH("context");return(0,eb.jsx)(i,{...e,...hQ(i,o),children:(0,eb.jsxs)(r,{children:[(0,eb.jsx)(dB,{}),(0,eb.jsx)(dN,{}),(0,eb.jsx)(dz,{})]})})})),d$=h2({useEmitter:dj,useEmitterValue:dH,usePublisher:dW}),dG=h5({useEmitter:dj,useEmitterValue:dH,usePublisher:dW});function dU(e,t,n){return"normal"!==t&&t?.endsWith("px")!==!0&&n(`${e} was not resolved to pixel value correctly`,t,2),"normal"===t?0:parseInt(t??"0",10)}function dq({items:e,height:t,width:n,selectedItems:i,onLegendItemClick:r,onItemMouseOver:o,onItemMouseOut:a}){let s=e.length>5;return(0,eb.jsx)(h8,{style:{height:t,width:n},data:e,itemContent:(e,t)=>(0,eb.jsx)(uN,{item:t,index:e,truncateLabel:s,isVisuallySelected:u_(t,i),onClick:r,onMouseOver:o,onMouseOut:a,sx:{width:"100%",wordBreak:"break-word",overflow:"hidden"}},t.id),role:"list"})}function dY(e,t){return"function"==typeof e?e(t):e}function dZ(e,t){return n=>{t.setState(t=>({...t,[e]:dY(n,t[e])}))}}function dX(e){return e instanceof Function}function dK(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 dQ(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 dJ="debugHeaders";function d0(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 d1(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=d0(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)=>d0(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 d2=(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:dK(()=>[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:dK(()=>[e,t,s,i],(e,t,n,i)=>({table:e,column:t,row:n,cell:i,getValue:i.getValue,renderValue:i.renderValue}),dQ(e.options,"debugCells","cell.getContext"))},e._features.forEach(n=>{null==n.createCell||n.createCell(i,t,s,e)},{}),i}),dQ(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:dK(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),dQ(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},d5=(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))};d5.autoRemove=e=>pi(e);let d3=(e,t,n)=>{var i;return!!(null==(i=e.getValue(t))||null==(i=i.toString())?void 0:i.includes(n))};d3.autoRemove=e=>pi(e);let d4=(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())};d4.autoRemove=e=>pi(e);let d6=(e,t,n)=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)};d6.autoRemove=e=>pi(e);let d8=(e,t,n)=>!n.some(n=>{var i;return!(null!=(i=e.getValue(t))&&i.includes(n))});d8.autoRemove=e=>pi(e)||!(null!=e&&e.length);let d9=(e,t,n)=>n.some(n=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)});d9.autoRemove=e=>pi(e)||!(null!=e&&e.length);let d7=(e,t,n)=>e.getValue(t)===n;d7.autoRemove=e=>pi(e);let pe=(e,t,n)=>e.getValue(t)==n;pe.autoRemove=e=>pi(e);let pt=(e,t,n)=>{let[i,r]=n,o=e.getValue(t);return o>=i&&o<=r};pt.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]},pt.autoRemove=e=>pi(e)||pi(e[0])&&pi(e[1]);let pn={includesString:d5,includesStringSensitive:d3,equalsString:d4,arrIncludes:d6,arrIncludesAll:d8,arrIncludesSome:d9,equals:d7,weakEquals:pe,inNumberRange:pt};function pi(e){return null==e||""===e}function pr(e,t,n){return!!e&&!!e.autoRemove&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}let po={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},pa=()=>({left:[],right:[]}),ps={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},pl=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),pu=null;function pc(e){return"touchstart"===e.type}function ph(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}let pd=()=>({pageIndex:0,pageSize:10}),pp=()=>({top:[],bottom:[]}),pf=(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=>pf(e,t.id,n,i,r))};function pg(e,t){let n=e.getState().rowSelection,i=[],r={},o=function(e,t){return e.map(e=>{var t;let a=pm(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 pm(e,t){var n;return null!=(n=t[e.id])&&n}function pv(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()&&(pm(e,t)?o=!0:r=!1),e.subRows&&e.subRows.length)){let n=pv(e,t);"all"===n?o=!0:("some"===n&&(o=!0),r=!1)}}),r?"all":!!o&&"some"}let py=/([0-9]+)/gm;function px(e,t){return e===t?0:e>t?1:-1}function pb(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function pw(e,t){let n=e.split(py).filter(Boolean),i=t.split(py).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 pS={alphanumeric:(e,t,n)=>pw(pb(e.getValue(n)).toLowerCase(),pb(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>pw(pb(e.getValue(n)),pb(t.getValue(n))),text:(e,t,n)=>px(pb(e.getValue(n)).toLowerCase(),pb(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>px(pb(e.getValue(n)),pb(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)=>px(e.getValue(n),t.getValue(n))},p_=[{createTable:e=>{e.getHeaderGroups=dK(()=>[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 d1(t,[...s,...n.filter(e=>!(null!=i&&i.includes(e.id))&&!(null!=r&&r.includes(e.id))),...l],e)},dQ(e.options,dJ,"getHeaderGroups")),e.getCenterHeaderGroups=dK(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,r)=>d1(t,n=n.filter(e=>!(null!=i&&i.includes(e.id))&&!(null!=r&&r.includes(e.id))),e,"center"),dQ(e.options,dJ,"getCenterHeaderGroups")),e.getLeftHeaderGroups=dK(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,i)=>{var r;return d1(t,null!=(r=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?r:[],e,"left")},dQ(e.options,dJ,"getLeftHeaderGroups")),e.getRightHeaderGroups=dK(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,i)=>{var r;return d1(t,null!=(r=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?r:[],e,"right")},dQ(e.options,dJ,"getRightHeaderGroups")),e.getFooterGroups=dK(()=>[e.getHeaderGroups()],e=>[...e].reverse(),dQ(e.options,dJ,"getFooterGroups")),e.getLeftFooterGroups=dK(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),dQ(e.options,dJ,"getLeftFooterGroups")),e.getCenterFooterGroups=dK(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),dQ(e.options,dJ,"getCenterFooterGroups")),e.getRightFooterGroups=dK(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),dQ(e.options,dJ,"getRightFooterGroups")),e.getFlatHeaders=dK(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),dQ(e.options,dJ,"getFlatHeaders")),e.getLeftFlatHeaders=dK(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),dQ(e.options,dJ,"getLeftFlatHeaders")),e.getCenterFlatHeaders=dK(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),dQ(e.options,dJ,"getCenterFlatHeaders")),e.getRightFlatHeaders=dK(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),dQ(e.options,dJ,"getRightFlatHeaders")),e.getCenterLeafHeaders=dK(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),dQ(e.options,dJ,"getCenterLeafHeaders")),e.getLeftLeafHeaders=dK(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),dQ(e.options,dJ,"getLeftLeafHeaders")),e.getRightLeafHeaders=dK(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),dQ(e.options,dJ,"getRightLeafHeaders")),e.getLeafHeaders=dK(()=>[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()},dQ(e.options,dJ,"getLeafHeaders"))}},{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:dZ("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=dK(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),dQ(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=dK(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],dQ(t.options,"debugRows","getVisibleCells"))},createTable:e=>{let t=(t,n)=>dK(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),dQ(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:dZ("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=dK(e=>[ph(t,e)],t=>t.findIndex(t=>t.id===e.id),dQ(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var i;return(null==(i=ph(t,n)[0])?void 0:i.id)===e.id},e.getIsLastColumn=n=>{var i;let r=ph(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=dK(()=>[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]},dQ(e.options,"debugTable","_getOrderColumnsFn"))}},{getInitialState:e=>({columnPinning:pa(),...e}),getDefaultOptions:e=>({onColumnPinningChange:dZ("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=dK(()=>[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))},dQ(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=dK(()=>[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"})),dQ(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=dK(()=>[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"})),dQ(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?pa():null!=(n=null==(i=e.initialState)?void 0:i.columnPinning)?n:pa())},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=dK(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),dQ(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=dK(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),dQ(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=dK(()=>[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))},dQ(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:dZ("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?pn.includesString:"number"==typeof i?pn.inNumberRange:"boolean"==typeof i||null!==i&&"object"==typeof i?pn.equals:Array.isArray(i)?pn.arrIncludes:pn.weakEquals},e.getFilterFn=()=>{var n,i;return dX(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:pn[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=dY(n,a?a.value:void 0);if(pr(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=dY(t,e))?void 0:i.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&pr(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:dZ("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=()=>pn.includesString,e.getGlobalFilterFn=()=>{var t,n;let{globalFilterFn:i}=e.options;return dX(i)?i:"auto"===i?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[i])?t:pn[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:dZ("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 pS.datetime;if("string"==typeof n&&(i=!0,n.split(py).length>1))return pS.alphanumeric}return i?pS.text:pS.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 dX(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:pS[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:dZ("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?po.sum:"[object Date]"===Object.prototype.toString.call(i)?po.extent:void 0},e.getAggregationFn=()=>{var n,i;if(!e)throw Error();return dX(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:po[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:dZ("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:{...pd(),...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:dZ("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=>dY(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?pd():null!=(n=e.initialState.pagination)?n:pd())},e.setPageIndex=t=>{e.setPagination(n=>{let i=dY(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,dY(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=dY(t,null!=(i=e.options.pageCount)?i:-1);return"number"==typeof r&&(r=Math.max(-1,r)),{...n,pageCount:r}}),e.getPageOptions=dK(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},dQ(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:pp(),...e}),getDefaultOptions:e=>({onRowPinningChange:dZ("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?pp():null!=(n=null==(i=e.initialState)?void 0:i.rowPinning)?n:pp())},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=dK(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),dQ(e.options,"debugRows","getTopRows")),e.getBottomRows=dK(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),dQ(e.options,"debugRows","getBottomRows")),e.getCenterRows=dK(()=>[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))},dQ(e.options,"debugRows","getCenterRows"))}},{getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:dZ("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=>{pf(r,t.id,i,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=dK(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?pg(e,n):{rows:[],flatRows:[],rowsById:{}},dQ(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=dK(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?pg(e,n):{rows:[],flatRows:[],rowsById:{}},dQ(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=dK(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?pg(e,n):{rows:[],flatRows:[],rowsById:{}},dQ(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 pf(s,e.id,n,null==(a=null==i?void 0:i.selectChildren)||a,t),s})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return pm(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return"some"===pv(e,n)},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return"all"===pv(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:()=>ps,getInitialState:e=>({columnSizing:{},columnSizingInfo:pl(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:dZ("columnSizing",e),onColumnSizingInfoChange:dZ("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:ps.minSize,null!=(i=null!=o?o:e.columnDef.size)?i:ps.size),null!=(r=e.columnDef.maxSize)?r:ps.maxSize)},e.getStart=dK(e=>[e,ph(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),dQ(t.options,"debugColumns","getStart")),e.getAfter=dK(e=>[e,ph(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),dQ(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(),pc(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=pc(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 pu)return pu;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 pu=e}()&&{passive:!1};pc(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?pl():null!=(n=e.initialState.columnSizingInfo)?n:pl())},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 pC(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 pM={À:"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"},pA=RegExp(Object.keys(pM).join("|"),"g"),pk={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function pT(e,t,n){let i;return(e=pI(e,n),(t=pI(t,n)).length>e.length)?pk.NO_MATCH:e===t?pk.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase())===(t=t.toLowerCase())?pk.EQUAL:e.startsWith(t)?pk.STARTS_WITH:e.includes(` ${t}`)?pk.WORD_STARTS_WITH:e.includes(t)?pk.CONTAINS:1===t.length?pk.NO_MATCH:(i="",e.split(" ").forEach(e=>{e.split("-").forEach(e=>{i+=e.substr(0,1)})}),i).includes(t)?pk.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 pk.NO_MATCH;o=s;for(let n=1,i=t.length;n<i;n++)if(!((o=a(t[n],e,o))>-1))return pk.NO_MATCH;return n=o-s,i=r/t.length,pk.MATCHES+1/n*i}(e,t)}function pI(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(pA,e=>pM[e])),e}let pD={maxRanking:1/0,minRanking:-1/0};function pO(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 pR(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 pP=n(32560),pE=n(22402);let pL=(0,pE.A)((0,eb.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),pN=(0,pE.A)((0,eb.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),pB=(0,pE.A)((0,eb.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function pz(e){return(0,eP.Ay)("MuiCheckbox",e)}let pF=(0,eR.A)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]);var pV=n(64606),pj=n(73397);let pH=(0,eT.A)(pP.A,{shouldForwardProp:e=>(0,uC.A)(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${(0,ek.A)(n.size)}`],"default"!==n.color&&t[`color${(0,ek.A)(n.color)}`]]}})((0,eI.A)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,eM.X4)(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter((0,eD.A)()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,eM.X4)(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter((0,eD.A)()).map(([t])=>({props:{color:t},style:{[`&.${pF.checked}, &.${pF.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${pF.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),pW=(0,eb.jsx)(pN,{}),p$=(0,eb.jsx)(pL,{}),pG=(0,eb.jsx)(pB,{}),pU=ew.forwardRef(function(e,t){let n=(0,eO.b)({props:e,name:"MuiCheckbox"}),{checkedIcon:i=pW,color:r="primary",icon:o=p$,indeterminate:a=!1,indeterminateIcon:s=pG,inputProps:l,size:u="medium",disableRipple:c=!1,className:h,slots:d={},slotProps:p={},...f}=n,g=a?s:o,m=a?s:i,v={...n,disableRipple:c,color:r,indeterminate:a,size:u},y=(e=>{let{classes:t,indeterminate:n,color:i,size:r}=e,o={root:["root",n&&"indeterminate",`color${(0,ek.A)(i)}`,`size${(0,ek.A)(r)}`]},a=(0,eC.A)(o,pz,t);return{...t,...a}})(v),x=p.input??l,[b,w]=(0,pj.A)("root",{ref:t,elementType:pH,className:(0,e_.A)(y.root,h),shouldForwardComponentProp:!0,externalForwardedProps:{slots:d,slotProps:p,...f},ownerState:v,additionalProps:{type:"checkbox",icon:ew.cloneElement(g,{fontSize:g.props.fontSize??u}),checkedIcon:ew.cloneElement(m,{fontSize:m.props.fontSize??u}),disableRipple:c,slots:d,slotProps:{input:(0,pV.A)("function"==typeof x?x(v):x,{"data-indeterminate":a})}}});return(0,eb.jsx)(b,{...w,classes:y})});function pq({color:e,density:t,...n}){let i="compact"===t;return(0,eb.jsx)(pU,{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,eM.X4)(e,.5):void 0},"& .MuiSvgIcon-root":{fontSize:i?16:18}}})}var pY=n(3399),pZ=n(76746),pX=n(97653),pK=n(76795),pQ=n(45271);function pJ(e){return(0,eP.Ay)("MuiToolbar",e)}(0,eR.A)("MuiToolbar",["root","gutters","regular","dense"]);let p0=(0,eT.A)("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})((0,eI.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}]}))),p1=ew.forwardRef(function(e,t){let n=(0,eO.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,eC.A)({root:["root",!n&&"gutters",i]},pJ,t)})(l);return(0,eb.jsx)(p0,{as:r,className:(0,e_.A)(u.root,i),ref:t,ownerState:l,...s})});var p2=n(35216),p5=n(96913),p3=n(70776);let p4=(0,pE.A)((0,eb.jsx)("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),p6=(0,pE.A)((0,eb.jsx)("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),p8=ew.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,p2.I)(),m=d.firstButton??eW.A,v=d.lastButton??eW.A,y=d.nextButton??eW.A,x=d.previousButton??eW.A,b=d.firstButtonIcon??p6,w=d.lastButtonIcon??p4,S=d.nextButtonIcon??p3.A,_=d.previousButtonIcon??p5.A,C=g?v:m,M=g?y:x,A=g?x:y,k=g?m:v,T=g?p.lastButton:p.firstButton,I=g?p.nextButton:p.previousButton,D=g?p.previousButton:p.nextButton,O=g?p.firstButton:p.lastButton;return(0,eb.jsxs)("div",{ref:t,...f,children:[c&&(0,eb.jsx)(C,{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)(M,{onClick:e=>{s(e,l-1)},disabled:r||0===l,color:"inherit","aria-label":o("previous",l),title:o("previous",l),...I??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),...D??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 p9=n(63392);function p7(e){return(0,eP.Ay)("MuiTablePagination",e)}let fe=(0,eR.A)("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]),ft=(0,eT.A)(pQ.A,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})((0,eI.A)(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),fn=(0,eT.A)(p1,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${fe.actions}`]:t.actions,...t.toolbar})})((0,eI.A)(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${fe.actions}`]:{flexShrink:0,marginLeft:20}}))),fi=(0,eT.A)("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),fr=(0,eT.A)("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})((0,eI.A)(({theme:e})=>({...e.typography.body2,flexShrink:0}))),fo=(0,eT.A)(pK.A,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${fe.selectIcon}`]:t.selectIcon,[`& .${fe.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${fe.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),fa=(0,eT.A)(pX.A,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),fs=(0,eT.A)("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})((0,eI.A)(({theme:e})=>({...e.typography.body2,flexShrink:0})));function fl({from:e,to:t,count:n}){return`${e}–${t} of ${-1!==n?n:`more than ${t}`}`}function fu(e){return`Go to ${e} page`}let fc=ew.forwardRef(function(e,t){let n,i=(0,eO.b)({props:e,name:"MuiTablePagination"}),{ActionsComponent:r=p8,backIconButtonProps:o,colSpan:a,component:s=pQ.A,count:l,disabled:u=!1,getItemAriaLabel:c=fu,labelDisplayedRows:h=fl,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:_={},...C}=i,M=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},p7,t)})(i),A=S?.select??x,k=A.native?"option":fa;(s===pQ.A||"td"===s)&&(n=a||1e3);let T=(0,p9.A)(A.id),I=(0,p9.A)(A.labelId),D={slots:_,slotProps:S},[O,R]=(0,pj.A)("root",{ref:t,className:M.root,elementType:ft,externalForwardedProps:{...D,component:s,...C},ownerState:i,additionalProps:{colSpan:n}}),[P,L]=(0,pj.A)("toolbar",{className:M.toolbar,elementType:fn,externalForwardedProps:D,ownerState:i}),[N,B]=(0,pj.A)("spacer",{className:M.spacer,elementType:fi,externalForwardedProps:D,ownerState:i}),[z,F]=(0,pj.A)("selectLabel",{className:M.selectLabel,elementType:fr,externalForwardedProps:D,ownerState:i,additionalProps:{id:I}}),[V,j]=(0,pj.A)("select",{className:M.select,elementType:fo,externalForwardedProps:D,ownerState:i}),[H,W]=(0,pj.A)("menuItem",{className:M.menuItem,elementType:k,externalForwardedProps:D,ownerState:i}),[$,G]=(0,pj.A)("displayedRows",{className:M.displayedRows,elementType:fs,externalForwardedProps:D,ownerState:i});return(0,eb.jsx)(O,{...R,children:(0,eb.jsxs)(P,{...L,children:[(0,eb.jsx)(N,{...B}),y.length>1&&(0,eb.jsx)(z,{...F,children:d}),y.length>1&&(0,eb.jsx)(V,{variant:"standard",...!A.variant&&{input:E||(E=(0,eb.jsx)(pZ.Ay,{}))},value:v,onChange:g,id:T,labelId:I,...A,classes:{...A.classes,root:(0,e_.A)(M.input,M.selectRoot,(A.classes||{}).root),select:(0,e_.A)(M.select,(A.classes||{}).select),icon:(0,e_.A)(M.selectIcon,(A.classes||{}).icon)},disabled:u,...j,children:y.map(e=>(0,ew.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:M.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})]})})}),fh={row:0,column:0},fd=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"];var fp=n(91394);let ff=(0,eT.A)(fp.A)(({theme:e})=>({tableLayout:"fixed",borderCollapse:"separate",backgroundColor:e.palette.background.default})),fg={compact:"small",standard:"medium",comfortable:"medium"},fm=(0,ew.forwardRef)(function({density:e,...t},n){return(0,eb.jsx)(ff,{...t,tabIndex:-1,size:fg[e],ref:n,sx:{width:"100%"}})});var fv=n(5139);let fy=(0,ew.forwardRef)(function(e,t){return(0,eb.jsx)(fv.A,{...e,ref:t})});var fx=n(57438);let fb=(0,eT.A)(pQ.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 fw({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,ub.A)(),v=(0,ew.useRef)(),y="head"===n;(0,ew.useEffect)(()=>{"trigger-focus"===o&&v.current&&v.current.focus()},[o]);let x=e=>{a?.(e)},b=(0,ew.useMemo)(()=>{if(p){if(f&&r1(p.url)){let{text:e}=rK(p.url,f,{urlEncode:!0});return{...p,url:e}}return p}},[p,f]);return(0,eb.jsx)(fb,{...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)(uw.A,{id:"original-cell",sx:{...pO(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)(fx.A,{href:b.url,target:b.targetBlank?"_blank":"_self",rel:b.targetBlank?"noopener noreferrer":void 0,children:e}):e})})}var fS=n(91644);function f_(e){return(0,eP.Ay)("MuiTableFooter",e)}(0,eR.A)("MuiTableFooter",["root"]);let fC=(0,eT.A)("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-footer-group"}),fM={variant:"footer"},fA="tfoot",fk=ew.forwardRef(function(e,t){let n=(0,eO.b)({props:e,name:"MuiTableFooter"}),{className:i,component:r=fA,...o}=n,a={...n,component:r},s=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"]},f_,t)})(a);return(0,eb.jsx)(fS.A.Provider,{value:fM,children:(0,eb.jsx)(fC,{as:r,className:(0,e_.A)(s.root,i),ref:t,role:r===fA?null:"rowgroup",ownerState:a,...o})})}),fT=(0,ew.forwardRef)(function(e,t){return(0,eb.jsx)(fk,{...e,ref:t})});var fI=n(70561);let fD=(0,ew.forwardRef)(function(e,t){return(0,eb.jsx)(fI.A,{...e,ref:t})});var fO=n(88091);let fR=(0,pE.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");function fP(e){return(0,eP.Ay)("MuiTableSortLabel",e)}let fE=(0,eR.A)("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc","directionDesc","directionAsc"]),fL=(0,eT.A)(uM.A,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.active&&t.active]}})((0,eI.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,[`& .${fE.icon}`]:{opacity:.5}},[`&.${fE.active}`]:{color:(e.vars||e).palette.text.primary,[`& .${fE.icon}`]:{opacity:1,color:(e.vars||e).palette.text.secondary}}}))),fN=(0,eT.A)("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,t[`iconDirection${(0,ek.A)(n.direction)}`]]}})((0,eI.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)"}}]}))),fB=ew.forwardRef(function(e,t){let n=(0,eO.b)({props:e,name:"MuiTableSortLabel"}),{active:i=!1,children:r,className:o,direction:a="asc",hideSortIcon:s=!1,IconComponent:l=fR,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,ek.A)(n)}`],icon:["icon",`iconDirection${(0,ek.A)(n)}`]};return(0,eC.A)(r,fP,t)})(d),f={slots:u,slotProps:c},[g,m]=(0,pj.A)("root",{elementType:fL,externalForwardedProps:f,ownerState:d,className:(0,e_.A)(p.root,o),ref:t}),[v,y]=(0,pj.A)("icon",{elementType:fN,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 fz=n(6227);function fF({onSort:e,sortDirection:t,nextSortDirection:n,children:i,resizeConfig:r,...o}){let a=!!e,s=(0,eb.jsx)(fO.A,{noWrap:!0,variant:"inherit",component:"div",color:"inherit",children:i}),l=!!t;return(0,eb.jsxs)(fw,{...o,children:[a?(0,eb.jsx)(fB,{onClick:e,direction:l?t:n,active:l,sx:{verticalAlign:"unset",maxWidth:"100%","&:focus-visible":{[`& .${fE.icon}`]:{opacity:l?1:.5}}},children:s}):s,r&&(0,eb.jsx)(uw.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)(fz.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 fV=(0,ew.forwardRef)(function(e,t){return(0,eb.jsx)(pY.A,{...e,ref:t,sx:{backgroundColor:e=>e.palette.background.default,"&:hover":{backgroundColor:e=>(0,eM.X4)(e.palette.primary.main,e.palette.action.hoverOpacity)}}})});var fj=n(2582),fH=n(3725),fW=n(93399),f$=n(30443),fG=n(46823),fU=n(48865),fq=n(32398),fY=n(2203);function fZ(e){return(0,eP.Ay)("MuiTooltip",e)}let fX=(0,eR.A)("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),fK=(0,eT.A)(fU.A,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})((0,eI.A)(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:e})=>!e.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:e})=>!e,style:{pointerEvents:"none"}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${fX.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${fX.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${fX.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${fX.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${fX.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${fX.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${fX.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${fX.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),fQ=(0,eT.A)("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${(0,ek.A)(n.placement.split("-")[0])}`]]}})((0,eI.A)(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:(0,eM.X4)(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${fX.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${fX.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${fX.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${fX.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:e})=>e.arrow,style:{position:"relative",margin:0}},{props:({ownerState:e})=>e.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${Math.round(16/14*1e5)/1e5}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:e})=>!e.isRtl,style:{[`.${fX.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${fX.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${fX.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${fX.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${fX.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${fX.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${fX.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${fX.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${fX.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${fX.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),fJ=(0,eT.A)("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})((0,eI.A)(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:(0,eM.X4)(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}))),f0=!1,f1=new fH.E,f2={x:0,y:0};function f5(e,t){return(n,...i)=>{t&&t(n,...i),e(n,...i)}}let f3=ew.forwardRef(function(e,t){let n=(0,eO.b)({props:e,name:"MuiTooltip"}),{arrow:i=!1,children:r,classes:o,components:a={},componentsProps:s={},describeChild:l=!1,disableFocusListener:u=!1,disableHoverListener:c=!1,disableInteractive:h=!1,disableTouchListener:d=!1,enterDelay:p=100,enterNextDelay:f=0,enterTouchDelay:g=700,followCursor:m=!1,id:v,leaveDelay:y=0,leaveTouchDelay:x=1500,onClose:b,onOpen:w,open:S,placement:_="bottom",PopperComponent:C,PopperProps:M={},slotProps:A={},slots:k={},title:T,TransitionComponent:I,TransitionProps:D,...O}=n,R=ew.isValidElement(r)?r:(0,eb.jsx)("span",{children:r}),P=(0,ub.A)(),E=(0,p2.I)(),[L,N]=ew.useState(),[B,z]=ew.useState(null),F=ew.useRef(!1),V=h||m,j=(0,fH.A)(),H=(0,fH.A)(),W=(0,fH.A)(),$=(0,fH.A)(),[G,U]=(0,fY.A)({controlled:S,default:!1,name:"Tooltip",state:"open"}),q=G,Y=(0,p9.A)(v),Z=ew.useRef(),X=(0,fq.A)(()=>{void 0!==Z.current&&(document.body.style.WebkitUserSelect=Z.current,Z.current=void 0),$.clear()});ew.useEffect(()=>X,[X]);let K=e=>{f1.clear(),f0=!0,U(!0),w&&!q&&w(e)},Q=(0,fq.A)(e=>{f1.start(800+y,()=>{f0=!1}),U(!1),b&&q&&b(e),j.start(P.transitions.duration.shortest,()=>{F.current=!1})}),J=e=>{F.current&&"touchstart"!==e.type||(L&&L.removeAttribute("title"),H.clear(),W.clear(),p||f0&&f?H.start(f0?f:p,()=>{K(e)}):K(e))},ee=e=>{H.clear(),W.start(y,()=>{Q(e)})},[,et]=ew.useState(!1),en=e=>{(0,fW.A)(e.target)||(et(!1),ee(e))},ei=e=>{L||N(e.currentTarget),(0,fW.A)(e.target)&&(et(!0),J(e))},er=e=>{F.current=!0;let t=R.props;t.onTouchStart&&t.onTouchStart(e)};ew.useEffect(()=>{if(q)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){"Escape"===e.key&&Q(e)}},[Q,q]);let eo=(0,uk.A)((0,f$.A)(R),N,t);T||0===T||(q=!1);let ea=ew.useRef(),es={},el="string"==typeof T;l?(es.title=q||!el||c?null:T,es["aria-describedby"]=q?Y:null):(es["aria-label"]=el?T:null,es["aria-labelledby"]=q&&!el?Y:null);let eu={...es,...O,...R.props,className:(0,e_.A)(O.className,R.props.className),onTouchStart:er,ref:eo,...m?{onMouseMove:e=>{let t=R.props;t.onMouseMove&&t.onMouseMove(e),f2={x:e.clientX,y:e.clientY},ea.current&&ea.current.update()}}:{}},ec={};d||(eu.onTouchStart=e=>{er(e),W.clear(),j.clear(),X(),Z.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",$.start(g,()=>{document.body.style.WebkitUserSelect=Z.current,J(e)})},eu.onTouchEnd=e=>{R.props.onTouchEnd&&R.props.onTouchEnd(e),X(),W.start(x,()=>{Q(e)})}),!c&&(eu.onMouseOver=f5(J,eu.onMouseOver),eu.onMouseLeave=f5(ee,eu.onMouseLeave),V||(ec.onMouseOver=J,ec.onMouseLeave=ee)),!u&&(eu.onFocus=f5(ei,eu.onFocus),eu.onBlur=f5(en,eu.onBlur),V||(ec.onFocus=ei,ec.onBlur=en));let eh={...n,isRtl:E,arrow:i,disableInteractive:V,placement:_,PopperComponentProp:C,touch:F.current},ed="function"==typeof A.popper?A.popper(eh):A.popper,ep=ew.useMemo(()=>{let e=[{name:"arrow",enabled:!!B,options:{element:B,padding:4}}];return M.popperOptions?.modifiers&&(e=e.concat(M.popperOptions.modifiers)),ed?.popperOptions?.modifiers&&(e=e.concat(ed.popperOptions.modifiers)),{...M.popperOptions,...ed?.popperOptions,modifiers:e}},[B,M.popperOptions,ed?.popperOptions]),ef=(e=>{let{classes:t,disableInteractive:n,arrow:i,touch:r,placement:o}=e,a={popper:["popper",!n&&"popperInteractive",i&&"popperArrow"],tooltip:["tooltip",i&&"tooltipArrow",r&&"touch",`tooltipPlacement${(0,ek.A)(o.split("-")[0])}`],arrow:["arrow"]};return(0,eC.A)(a,fZ,t)})(eh),eg="function"==typeof A.transition?A.transition(eh):A.transition,em={slots:{popper:a.Popper,transition:a.Transition??I,tooltip:a.Tooltip,arrow:a.Arrow,...k},slotProps:{arrow:A.arrow??s.arrow,popper:{...M,...ed??s.popper},tooltip:A.tooltip??s.tooltip,transition:{...D,...eg??s.transition}}},[ev,ey]=(0,pj.A)("popper",{elementType:fK,externalForwardedProps:em,ownerState:eh,className:(0,e_.A)(ef.popper,M?.className)}),[ex,eS]=(0,pj.A)("transition",{elementType:fG.A,externalForwardedProps:em,ownerState:eh}),[eM,eA]=(0,pj.A)("tooltip",{elementType:fQ,className:ef.tooltip,externalForwardedProps:em,ownerState:eh}),[eT,eI]=(0,pj.A)("arrow",{elementType:fJ,className:ef.arrow,externalForwardedProps:em,ownerState:eh,ref:z});return(0,eb.jsxs)(ew.Fragment,{children:[ew.cloneElement(R,eu),(0,eb.jsx)(ev,{as:C??fU.A,placement:_,anchorEl:m?{getBoundingClientRect:()=>({top:f2.y,left:f2.x,right:f2.x,bottom:f2.y,width:0,height:0})}:L,popperRef:ea,open:!!L&&q,id:Y,transition:!0,...ec,...ey,popperOptions:ep,children:({TransitionProps:e})=>(0,eb.jsx)(ex,{timeout:P.transitions.duration.shorter,...e,...eS,children:(0,eb.jsxs)(eM,{...eA,children:[T,i?(0,eb.jsx)(eT,{...eI}):null]})})})]})});var f4=n(58597),f6=n(7800),f8=n(98599),f9=n(16979),f7=n(9323),ge=n(12933),gt=n(46177);let gn=(0,ew.forwardRef)(function({debounceMs:e=250,value:t,onChange:n,...i},r){let[o,a]=(0,ew.useState)(t),s=(0,ew.useCallback)(e=>{n?.(e)},[n]),l=(0,ew.useMemo)(()=>gt(s,e),[e,s]);return(0,eb.jsx)(e$.A,{ref:r,value:o,onChange:function(e){a(e.target.value),l(e.target.value)},...i})});function gi({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,ew.useState)(null),d=!!c,[p,f]=(0,ew.useState)(0),g=(0,ew.useCallback)(()=>{n(""),f(e=>e+1)},[n]);return e||i||s?(0,eb.jsxs)(eH.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)(gn,{placeholder:"Search...",value:t,onChange:n,variant:"standard",slotProps:{htmlInput:{"aria-label":"search table"},input:{startAdornment:(0,eb.jsx)(fj.A,{position:"start",children:(0,eb.jsx)(f8,{fontSize:"small"})}),endAdornment:""!==t&&(0,eb.jsx)(fj.A,{position:"end",children:(0,eb.jsx)(eW.A,{onClick:g,children:(0,eb.jsx)(f6,{fontSize:"small"})})})}},sx:{flexGrow:1}},p),s&&(0,eb.jsx)(f3,{title:l?"Collapse all":"Expand all",children:(0,eb.jsx)(eW.A,{onClick:u,color:"info","aria-label":l?"collapse all rows":"expand all rows",children:l?(0,eb.jsx)(f9,{}):(0,eb.jsx)(f7,{})})}),i&&(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(eW.A,{onClick:e=>h(e.currentTarget),"aria-haspopup":"listbox","aria-expanded":d,color:"info",children:(0,eb.jsx)(ge,{})}),(0,eb.jsx)(f4.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)(pX.A,{disabled:!e.getCanHide(),onClick:e.getCanHide()?e.getToggleVisibilityHandler():void 0,dense:!0,children:[(0,eb.jsx)(pU,{checked:e.getIsVisible(),disabled:!e.getCanHide(),size:"small",disableRipple:!0,sx:{p:0,mr:1}}),(0,eb.jsx)(uP.A,{primary:n})]},e.id)})})]})]}):null}gn.displayName="TextField";var gr=n(347);let go=(0,ew.forwardRef)(function(e,t){return(0,eb.jsx)(gr.A,{...e,tabIndex:-1,ref:t,sx:rP({flexGrow:1},e.sx)})});function ga({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,ew.useRef)(null),x=(0,ew.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,ew.useState)(fh),[o,a]=(0,ew.useState)(!1);return{activeCell:i,isActive:o,onTableKeyDown:(0,ew.useCallback)(i=>{let o=i.key;(fd.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,ew.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||(a(!1),r(fh))},[])}}({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,ew.useMemo)(()=>({Scroller:go,Table:t=>(0,eb.jsx)(fm,{...t,width:e,density:n,onKeyDown:b.onTableKeyDown,onBlur:b.onTableBlur}),TableHead:fD,TableFoot:fT,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)(fV,{...t,onClick:e=>o(e,i.id),density:n,onMouseOver:e=>{a?.(e,r)},onMouseOut:e=>{s?.(e,r)}})},TableBody:fy}),[n,b.onTableKeyDown,b.onTableBlur,o,s,a,l,e]),_=(e,t)=>{f&&g&&g({...f,pageIndex:t})},C=e=>{f&&g&&g({pageIndex:0,pageSize:parseInt(e.target.value,10)})},M=(0,ew.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)(uw.A,{style:{width:e,height:t,...M},children:[(0,eb.jsx)(gi,{...v,width:e}),(0,eb.jsx)(df,{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)(fV,{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)(fF,{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)?ew.createElement(a,s):a:null)},e.id)})},e.id))}),fixedFooterContent:f?()=>(0,eb.jsx)(pY.A,{sx:{backgroundColor:e=>e.palette.background.default},children:(0,eb.jsx)(fc,{colSpan:u.length,count:m,page:f.pageIndex,rowsPerPage:f.pageSize,onPageChange:_,onRowsPerPageChange:C})}):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)(fw,{"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 gs=(e,t)=>`${t}`,gl={},gu=[];function gc({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=gs,rowSelection:h=gl,sorting:d=gu,getItemActions:p,hasItemActions:f,pagination:g,onPaginationChange:m,rowSelectionVariant:v="standard",getSubRows:y,hiddenColumns:x,tableToolbarConfig:b,columnResizeMode:w="onChange",defaultColumnConfig:S,..._}){let C=(0,ub.A)(),M=!!y,[A,k]=(0,ew.useState)({}),{globalFilter:T,setGlobalFilter:I,fuzzySearchOptions:D}=function(e,t,n,i){let[r,o]=(0,ew.useState)(""),[a,s]=(0,ew.useState)(n),l=(0,ew.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:pk.MATCHES,!n.accessors){let i=pT(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?pD:{...pD,...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:pk.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let e=0;e<r.length;e++){let i=r[e],a=pT(i.itemValue,t,n),{minRanking:s,maxRanking:l,threshold:u=n.threshold}=i.attributes;a<s&&a>=pk.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:pk[t]});return r({itemRank:o}),o.passed}},globalFilterFn:e?"fuzzy":void 0,getFilteredRowModel:e?e=>dK(()=>[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 C=[],M=[];(null!=n?n:[]).forEach(t=>{var n;let i=e.getColumn(t.id);if(!i)return;let r=i.getFilterFn();r&&C.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;M.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={},C.length)for(let e=0;e<C.length;e++){let t=(f=C[e]).id;n.columnFilters[t]=f.filterFn(n,t,f.resolvedValue,e=>{n.columnFiltersMeta[t]=e})}if(M.length){for(let e=0;e<M.length;e++){let t=(g=M[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=d2(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=d2(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})},dQ(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex())):void 0,filterFromLeafRows:e,onGlobalFilterChange:l}}}(b?.isSearchEnabled,b?.fuzzyMatchThreshold??"CONTAINS",A,k),[O,R]=(0,ew.useState)(x?.reduce((e,t)=>({...e,[t]:!1}),{})??{}),P=(0,ew.useCallback)((e,t,n)=>{"standard"===v||n?t.toggleSelected():t.getIsSelected()&&!e.getIsAllRowsSelected()?e.toggleAllRowsSelected():s?.({[t.id]:!0})},[s,v]),E=(0,ew.useCallback)((e,t,n)=>{let i=e.nativeEvent&&(e.nativeEvent instanceof MouseEvent||e.nativeEvent instanceof KeyboardEvent)?e.nativeEvent:void 0;P(t,n,!!i?.metaKey||!!i?.shiftKey)},[P]),L=(0,ew.useMemo)(()=>({id:"itemActions",header:"Actions",cell:({row:e})=>(0,eb.jsx)(eH.A,{direction:"row",alignItems:"center",children:p?.({id:e.id,data:e.original})}),enableSorting:!1,enableResizing:!1}),[p]),N=(0,ew.useMemo)(()=>({id:"checkboxRowSelect",size:28,header:({table:e})=>(0,eb.jsx)(pq,{checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler(),color:C.palette.text.primary,density:i}),cell:({row:e,table:t})=>(0,eb.jsx)(pq,{checked:e.getIsSelected(),indeterminate:e.getIsSomeSelected(),onChange:n=>{E(n,t,e)},color:u?.(e.original),density:i}),enableSorting:!1,enableResizing:!1}),[C.palette.text.primary,i,u,E]),B=function(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=ew.useState(()=>({current:function(e){var t,n;let i=[...p_,...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=dY(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:dK(()=>[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}},dQ(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:dK(()=>[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:dK(()=>[!0],()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},dQ(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:dK(()=>[e._getOrderColumnsFn()],e=>{var t;return null!=(t=c.columns)&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},dQ(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)},dQ(e,"debugColumns","getAllColumns")),getAllFlatColumns:dK(()=>[r.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),dQ(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:dK(()=>[r.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),dQ(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:dK(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),dQ(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]=ew.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,ew.useMemo)(()=>{let e=pR(t,S);return f&&e.unshift(L),a&&e.unshift(N),e},[t,S,f,a,L,N]),getRowId:c,getCoreRowModel:e=>dK(()=>[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=d2(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},dQ(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex())),getSortedRowModel:e=>dK(()=>[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}},dQ(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex())),getPaginationRowModel:g?e=>dK(()=>[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}:pC({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},dQ(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:R,getSubRows:y,getExpandedRowModel:M?e=>dK(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(e,t,n)=>t.rows.length&&(!0===e||Object.keys(null!=e?e:{}).length)&&n?pC(t):t,dQ(e.options,"debugTable","getExpandedRowModel")):void 0,...D,sortDescFirst:!0,columnResizeMode:w,onExpandedChange:k,state:{rowSelection:h,sorting:d,globalFilter:b?.isSearchEnabled?T:void 0,columnVisibility:O,...g?{pagination:g}:{},expanded:A}}),z=(0,ew.useCallback)((e,t)=>{let n=B.getRow(t);P(B,n,e.metaKey||e.shiftKey)},[P,B]);return(0,eb.jsx)(ga,{..._,density:i,defaultColumnWidth:r,defaultColumnHeight:o,onRowClick:z,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:I,isColumnFilterEnabled:b?.isColumnFilterEnabled,columns:B.getAllColumns(),columnFilterMenuMaxHeight:b?.columnFilterMenuMaxHeight,isExpandAllEnabled:M,isAllExpanded:B.getIsAllRowsExpanded(),onExpandAllChange:B.getToggleAllRowsExpandedHandler()}})}let gh=[{accessorKey:"label",header:"Name",enableSorting:!0,enableResizing:!0,cell:({getValue:e})=>(0,eb.jsx)("span",{title:e(),children:e()})}],gd=e=>e.id,gp=e=>e.color;function gf({items:e,selectedItems:t,onSelectedItemsChange:n,onItemMouseOver:i,onItemMouseOut:r,height:o,width:a,columns:s=[],sorting:l,onSortingChange:u}){let c=(0,ew.useMemo)(()=>"string"!=typeof t?t:e.reduce((e,t,n)=>(e[gd(t,n)]=!0,e),{}),[t,e]),h=(0,ew.useMemo)(()=>{let e=Math.max(a-(s?.reduce((e,t)=>e+("number"==typeof t.width?t.width:150),0)??0)-45,60*gh.length)/gh.length;return[...gh.map(t=>({...t,width:e})),...s]},[s,a]);return(0,eb.jsx)(gc,{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:gd,getCheckboxColor:gp,checkboxSelection:!0,rowSelectionVariant:"legend"})}function gg({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,uS.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=n5(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)(gf,{...p,onSelectedItemsChange:o,width:e,...l}):"right"===n.position||d?(0,eb.jsx)(dq,{...p,width:e,onLegendItemClick:c}):(0,eb.jsx)(uB,{...p,onLegendItemClick:c}),"right"===n.position)?(0,eb.jsx)(uw.A,{style:{width:e,height:t},sx:{position:"absolute",top:0,right:0,backgroundColor:e=>`${e.palette.background.default}`},children:u}):(0,eb.jsx)(uw.A,{style:{width:e,height:t},sx:{position:"absolute",bottom:0,backgroundColor:e=>`${e.palette.background.default}`},children:u})}let gm={medium:{bottom:6,right:250},small:{bottom:4,right:150}};function gv({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"===n5(c.mode))l="right"===d?200:e,u=40,"right"===d?u=t:t>=300&&(u=100);else{let r=pO(s,"compact"),o=(n?.tableProps?.columns||[]).reduce((e,t)=>("number"==typeof t.width&&(e+=t.width),e),0);l="right"===d?gm[i].right+o:e;let a=Math.min(gm[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,ub.A)(),legendSize:n3(o)});return(0,eb.jsxs)(uw.A,{style:{width:n,height:i},sx:{position:"relative",overflow:"hidden"},children:[(0,eb.jsx)(uw.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)(gg,{...t,height:u.height,width:u.width})]})}var gy=n(91467),gx=n(66834),gb=n(92890),gw=n(39750);let gS=(0,eT.A)("form")({overflowY:"auto",display:"flex",flexDirection:"column"}),g_=e=>({position:"absolute",top:e.spacing(.5),right:e.spacing(.5)}),gC=({children:e,...t})=>(0,eb.jsx)(gb.A,{...t,children:e});gC.Header=({children:e,onClose:t,...n})=>(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(gy.A,{style:{textOverflow:"ellipsis",overflow:"hidden"},...n,children:e}),t&&(0,eb.jsx)(eW.A,{"aria-label":"Close",onClick:t,sx:g_,children:(0,eb.jsx)(f6,{})})]}),gC.Form=gS,gC.Content=({children:e,sx:t,...n})=>(0,eb.jsx)(gx.A,{dividers:!0,...n,sx:rP({minWidth:"500px",textWrap:"balance"},t),children:e}),gC.PrimaryButton=({children:e,...t})=>(0,eb.jsx)(eV.A,{variant:"contained",type:"submit",...t,children:e}),gC.SecondaryButton=({children:e,...t})=>(0,eb.jsx)(eV.A,{variant:"outlined",color:"secondary",...t,children:e}),gC.Actions=gw.A;let gM=e=>{let{description:t,isOpen:n,onCancel:i,onDiscardChanges:r}=e;return(0,eb.jsxs)(gC,{open:n,"aria-labelledby":"discard-dialog",children:[(0,eb.jsx)(gC.Header,{children:"Discard Changes"}),(0,eb.jsx)(gC.Content,{children:t}),(0,eb.jsxs)(gC.Actions,{children:[(0,eb.jsx)(eV.A,{variant:"contained",onClick:r,children:"Discard Changes"}),(0,eb.jsx)(eV.A,{variant:"outlined",color:"secondary",onClick:i,children:"Cancel"})]})]})};var gA=n(66395);let gk=({children:e})=>(0,eb.jsx)(gA.Ay,{item:!0,xs:4,children:(0,eb.jsx)(eH.A,{spacing:3,children:e})});var gT=n(67987),gI=n(9799),gD=n(17366);let gO=({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)(gP,{arrow:!0,id:e,placement:i??"top",title:(0,eb.jsx)(gR,{title:t,description:n}),enterDelay:o??500,enterNextDelay:a??500,children:s})},gR=({title:e,description:t})=>(0,eb.jsxs)(eb.Fragment,{children:[e&&(0,eb.jsx)(fO.A,{variant:"body2",sx:e=>({color:e.palette.text.primary,fontWeight:e.typography.fontWeightMedium}),children:e}),(0,eb.jsx)(fO.A,{variant:"caption",sx:e=>({color:e.palette.text.primary,whiteSpace:"pre-line"}),children:t})]}),gP=(0,eT.A)(({className:e,...t})=>(0,eb.jsx)(f3,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${fX.tooltip}`]:{backgroundColor:e.palette.background.tooltip,color:e.palette.text.primary,maxWidth:"300px",padding:e.spacing(1),boxShadow:e.shadows[1]},[`& .${fX.arrow}`]:{color:e.palette.background.tooltip}})),gE=({label:e,control:t,description:n})=>{let i=rE("EditorSectionControl"),r=`${i}-control`,o=`${i}-label`;return(0,eb.jsx)(gT.A,{children:(0,eb.jsxs)(eH.A,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,eb.jsxs)(eH.A,{direction:"row",alignItems:"center",justifyContent:"center",children:[(0,eb.jsx)(gI.A,{id:o,htmlFor:r,children:e}),n&&(0,eb.jsx)(gO,{description:n,enterDelay:100,children:(0,eb.jsx)(eW.A,{size:"small",sx:e=>({borderRadius:e.shape.borderRadius,padding:"4x",margin:"0 2px"}),children:(0,eb.jsx)(gD,{"aria-describedby":"info-tooltip","aria-hidden":!1,fontSize:"inherit",sx:{color:e=>e.palette.grey[700]}})})})]}),(0,eb.jsxs)(uw.A,{sx:{width:"180px",textAlign:"right"},children:[" ",eS().cloneElement(t,{id:r,"aria-labelledby":o})]})]})})},gL=({children:e})=>(0,eb.jsx)(gA.Ay,{container:!0,spacing:8,children:e}),gN=({title:e,children:t,icon:n})=>(0,eb.jsxs)(uw.A,{children:[(0,eb.jsxs)(uw.A,{display:"flex",borderBottom:1,borderColor:"grey.300",marginBottom:e=>e.spacing(1),children:[(0,eb.jsx)(fO.A,{variant:"overline",component:"h4",children:e}),n&&(0,eb.jsx)(uw.A,{sx:{marginLeft:"auto"},children:n})]}),(0,eb.jsx)(eH.A,{spacing:1,children:t})]});var gB=n(31271),gz=n(81227);function gF({options:e,renderInput:t=e=>(0,eb.jsx)(e$.A,{...e}),id:n,"aria-labelledby":i,...r}){let o=e=>e.label??e.id;return(0,eb.jsx)(gB.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)(fO.A,{variant:"body1",component:"div",children:o(n)}),n.description&&(0,eb.jsx)(fO.A,{variant:"body2",component:"div",sx:{color:e=>e.palette.text.secondary},children:n.description})]})},e),filterOptions:(0,gz.Z)({stringify:e=>`${o(e)} ${e.description||""}`}),...r})}let gV=[{id:"compact",label:"Compact"},{id:"standard",label:"Standard"},{id:"comfortable",label:"Comfortable"}];function gj({onChange:e,value:t="standard"}){return(0,eb.jsx)(gE,{label:"Density",control:(0,eb.jsx)(gF,{value:gV.find(e=>e.id===t),options:gV,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function gH(){return(0,eb.jsxs)(eH.A,{direction:"row",alignItems:"center",children:[(0,eb.jsx)(uw.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)(uw.A,{sx:{content:'""',height:2,background:e=>e.palette.info.main,width:"100%"}})]})}function gW(e){return(gW="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 g$(e,t,n){var i;return(i=function(e,t){if("object"!=gW(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=gW(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==gW(i)?i:i+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gG(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 gU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gG(Object(n),!0).forEach(function(t){g$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gG(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var gq={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)}},gY=Symbol("closestEdge");function gZ(e){var t;return null!=(t=e[gY])?t:null}function gX(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 gK(e,t){if(e){if("string"==typeof e)return gX(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)?gX(e,t):void 0}}function gQ(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)||gK(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 gJ(){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 g0=n(96907),g1="data-pdnd-honey-pot";function g2(e){return e instanceof Element&&e.hasAttribute(g1)}function g5(e){var t=gQ(document.elementsFromPoint(e.x,e.y),2),n=t[0],i=t[1];return n?g2(n)?null!=i?i:null:n:null}var g3={inset:"unset",border:"none",padding:0,margin:0,overflow:"visible",color:"inherit",background:"transparent"};function g4(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 g6=g4(function(){return"u">typeof HTMLElement&&"function"==typeof HTMLElement.prototype.showPopover});function g8(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 g9(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g8(Object(n),!0).forEach(function(t){g$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function g7(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 me(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 mt(e){return function(e){if(Array.isArray(e))return gX(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||gK(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 mn=g4(function(){return navigator.userAgent.includes("Firefox")}),mi=g4(function(){var e=navigator.userAgent;return e.includes("AppleWebKit")&&!e.includes("Chrome")}),mr={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};if(!("u"<typeof window)&&mi()){var mo=ma();(0,g0.bindAll)(window,[{type:"dragstart",listener:function(){mo.enterCount=0,mo.isOverWindow=!0}},{type:"drop",listener:ms},{type:"dragend",listener:ms},{type:"dragenter",listener:function(e){mo.isOverWindow||0!==mo.enterCount||(e[mr.isEnteringWindow]=!0),mo.isOverWindow=!0,mo.enterCount++}},{type:"dragleave",listener:function(e){mo.enterCount--,mo.isOverWindow&&0===mo.enterCount&&(e[mr.isLeavingWindow]=!0,mo.isOverWindow=!1)}}],{capture:!0})}function ma(){return{enterCount:0,isOverWindow:!1}}function ms(){mo=ma()}function ml(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 mu=(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),mc=(v=null,{schedule:function(e){v={frameId:requestAnimationFrame(function(){v=null,e()}),fn:e}},flush:function(){v&&(cancelAnimationFrame(v.frameId),v.fn(),v=null)}}),mh={isActive:!1};function md(){return!mh.isActive}function mp(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 mf=function(e){var t=e.event,n=e.dragType,i=e.getDropTargetsOver,r=e.dispatchEvent;if(md()){var o,a,s=function(e){var t=e.event,n=e.dragType,i=e.getDropTargetsOver,r=ml(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});mh.isActive=!0;var l={current:s};mp({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}}),mc.schedule(function(){o({eventName:"onDragStart",payload:{source:t,location:a}})})},dragUpdate:function(e){var i=e.current;mc.flush(),mu.cancel(),o({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:r,current:i}}})},drag:function(e){var i=e.current;mu(function(){mc.flush(),o({eventName:"onDrag",payload:{source:t,location:{initial:n,previous:r,current:i}}})})},drop:function(e){var i=e.current,a=e.updatedSourcePayload;mc.flush(),mu.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,g0.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&&(mi()?!!mi()&&t.hasOwnProperty(mr.isLeavingWindow):null==i||(mn()?"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:ml(e)},l.current.dropTargets.length)?(e.preventDefault(),mp({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:ml(e)},p()}}].concat(mt([{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=ml(e),r=i({target:g2(e.target)?g5({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:l.current.dropTargets});r.length&&(e.preventDefault(),mp({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(){mh.isActive=!1,c()}},mg=new Map;function mm(e,t){var n=t.attribute,i=t.value;return e.setAttribute(n,i),function(){return e.removeAttribute(n)}}function mv(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 my(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mv(Object(n),!0).forEach(function(t){g$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mx(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 mb(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)?mb(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 mb(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 mw(e){return e.slice(0).reverse()}function mS(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 m_(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 mC=g4(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),mM="text/plain",mA=new WeakMap,mk=(y=null,{bindEvents:function(){return y=null,(0,g0.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(g1,"true"),g6()&&r.setAttribute("popover","manual"),o=g7({client:l}),Object.assign(r.style,g9(g9({position:"fixed"},g6()?g3:{zIndex:0x7fffffff}),{},{backgroundColor:"transparent",padding:0,margin:0,boxSizing:"border-box",pointerEvents:"auto"},me({clientRect:o}))),document.body.appendChild(r),g6()&&r.showPopover(),a=(0,g0.bind)(window,{type:"pointermove",listener:function(e){o=g7({client:{x:e.clientX,y:e.clientY}}),Object.assign(r.style,me({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,g0.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}}}}),mT=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 mS(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)?mS(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?m_(Object(n),!0).forEach(function(t){g$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},i);return e.add(r),n(r),g4(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=mx(r.location.current.dropTargets);try{for(o.s();!(t=o.n()).done;){var a,s=t.value,l=i.get(s.element),u=my(my({},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=mx(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=my(my({},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=mx(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=my(my({},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 g4(gJ(mm(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(mt(p),[x])})}({source:t,target:r,input:a});if(l.length>=s.length)return l;for(var u=mw(s),c=mw(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(my(my({},f),{},{isActiveDueToStickiness:!0}))}return mw(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){mf({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=mg.get(t);if(i)return i.usageCount++,i;var r={typeKey:t,unmount:n(),usageCount:1};return mg.set(t,r),r}(e={typeKey:t,mount:function(){return n({canStart:md,start:u})}}),function(){i.usageCount--,i.usageCount>0||(i.unmount(),mg.delete(e.typeKey))}},dropTarget:s.dropTargetForConsumers,monitor:a.monitorForConsumers}}({typeKey:"element",defaultDropEffect:"move",mount:function(e){return gJ(mk.bindEvents(),(0,g0.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=mA.get(l);if(u){var c=ml(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=g5({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=gQ(g[f],2),v=m[0],y=m[1];t.dataTransfer.setData(v,null!=y?y:"")}!mC()||t.dataTransfer.types.includes(mM)||t.dataTransfer.types.includes("text/uri-list")||t.dataTransfer.setData(mM,"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=mA.get(r.source.element))||null==(n=t[i])||n.call(t,r)},onPostDispatch:mk.getOnPostDispatch()}),mI=mT.dropTarget,mD=mT.monitor;let mO={type:"idle"};function mR({elements:e,accessKey:t,axis:n="vertical",onChange:i}){return(0,ew.useEffect)(()=>mD({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=gQ(r.splice(n,1),1)[0];return r.splice(i,0,o),r}({list:(a={list:e,startIndex:h,indexOfTarget:d,closestEdgeOfTarget:gZ(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 mP({children:e,data:t}){let n=(0,ew.useRef)(null),[i,r]=(0,ew.useState)(mO);return(0,ew.useEffect)(()=>{let e=n.current;if(e){var i;return gJ((i={element:e,getInitialData:()=>t,onDragStart(){r({type:"is-dragging"})},onDrop(){r(mO)}},g4(gJ(mT.registerUsage(),(mA.set(i.element,i),function(){mA.delete(i.element)}),mm(i.element,{attribute:"draggable",value:"true"})))),mI({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:gq[e](c,u)}}).sort(function(e,t){return e.value-t.value})[0])?void 0:o.edge)?r:null,gU(gU({},t),{},g$({},gY,h))},getIsSticky:()=>!0,onDragEnter({self:e}){r({type:"is-dragging-over",closestEdge:gZ(e.data)})},onDrag({self:e}){let t=gZ(e.data);r(e=>"is-dragging-over"===e.type&&e.closestEdge===t?e:{type:"is-dragging-over",closestEdge:t})},onDragLeave(){r(mO)},onDrop(){r(mO)}}))}},[t]),(0,eb.jsxs)(eH.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)(gH,{}):null,e,"is-dragging-over"===i.type&&"bottom"===i.closestEdge?(0,eb.jsx)(gH,{}):null]})}var mE=n(53064);function mL(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 mN(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 mB=(0,ew.forwardRef)(function({onMoveUp:e,onMoveDown:t,onMoveLeft:n,onMoveRight:i,menuSx:r,...o},a){let[s,l]=(0,ew.useState)(null),u=!!s;function c(e){l(null),e?.()}return(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(eW.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)(mE,{})}),(e||t||n||i)&&(0,eb.jsxs)(f4.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)(pX.A,{onClick:()=>c(e),children:"Move Up"}),t&&(0,eb.jsx)(pX.A,{onClick:()=>c(t),children:"Move Down"}),n&&(0,eb.jsx)(pX.A,{onClick:()=>c(n),children:"Move Left"}),i&&(0,eb.jsx)(pX.A,{onClick:()=>c(i),children:"Move Right"}),i&&(0,eb.jsx)(pX.A,{onClick:()=>c(i),children:"Move Right"})]})]})});var mz=n(31789),mF=n(70320),mV=n(45827);let mj={...ew}.useSyncExternalStore;function mH(e={}){let{themeId:t}=e;return function(e,n={}){let i=(0,mV.A)();i&&t&&(i=i[t]||i);let r="u">typeof window&&void 0!==window.matchMedia,{defaultMatches:o=!1,matchMedia:a=r?window.matchMedia:null,ssrMatchMedia:s=null,noSsr:l=!1}=(0,mF.A)({name:"MuiUseMediaQuery",props:n,theme:i}),u="function"==typeof e?e(i):e;return(u=u.replace(/^@media( ?)/m,"")).includes("print")&&console.warn("MUI: You have provided a `print` query to the `useMediaQuery` hook.\nUsing the print media query to modify print styles can lead to unexpected results.\nConsider using the `displayPrint` field in the `sx` prop instead.\nMore information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."),(void 0!==mj?function(e,t,n,i,r){let o=ew.useCallback(()=>t,[t]),a=ew.useMemo(()=>{if(r&&n)return()=>n(e).matches;if(null!==i){let{matches:t}=i(e);return()=>t}return o},[o,e,i,r,n]),[s,l]=ew.useMemo(()=>{if(null===n)return[o,()=>()=>{}];let t=n(e);return[()=>t.matches,e=>(t.addEventListener("change",e),()=>{t.removeEventListener("change",e)})]},[o,n,e]);return mj(l,s,a)}:function(e,t,n,i,r){let[o,a]=ew.useState(()=>r&&n?n(e).matches:i?i(e).matches:t);return(0,mz.A)(()=>{if(!n)return;let t=n(e),i=()=>{a(t.matches)};return i(),t.addEventListener("change",i),()=>{t.removeEventListener("change",i)}},[e,n]),o})(u,o,a,s,l)}}mH();var mW=n(93724);let m$=mH({themeId:mW.A});var mG=n(10972),mU=n(46477),mq=n(55403),mY=n(32494),mZ=n(63025);function mX(e,t,n){let i=function(e,t,n){let i,r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),a=(0,mZ.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 mK=ew.forwardRef(function(e,t){let n=(0,ub.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=mU.Ay,...w}=e,S=ew.useRef(null),_=(0,uk.A)((0,f$.A)(s),S,t),C=e=>t=>{e&&(void 0===t?e(S.current):e(S.current,t))},M=C((e,t)=>{mX(u,e,l),(0,mY.q)(e),d&&d(e,t)}),A=C((e,t)=>{let i=(0,mY.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=C(p),T=C(v),I=C(e=>{let t=(0,mY.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),mX(u,e,l),g&&g(e)}),D=C(e=>{e.style.webkitTransition="",e.style.transition="",m&&m(e)}),O=ew.useCallback(()=>{S.current&&mX(u,S.current,l)},[u,l]);return ew.useEffect(()=>{if(h||"down"===u||"right"===u)return;let e=(0,mq.A)(()=>{S.current&&mX(u,S.current,l)}),t=(0,mZ.A)(S.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[u,h,l]),ew.useEffect(()=>{h||O()},[h,O]),(0,eb.jsx)(b,{nodeRef:S,onEnter:M,onEntered:k,onEntering:A,onExit:I,onExited:D,onExiting:T,addEndListener:e=>{o&&o(S.current,e)},appear:a,in:h,timeout:x,...w,children:(e,{ownerState:t,...n})=>ew.cloneElement(s,{ref:_,style:{visibility:"exited"!==e||h?void 0:"hidden",...y,...s.props.style},...n})})});var mQ=n(11502);function mJ(e){return(0,eP.Ay)("MuiDrawer",e)}(0,eR.A)("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);let m0=(e,t)=>{let{ownerState:n}=e;return[t.root,("permanent"===n.variant||"persistent"===n.variant)&&t.docked,t.modal]},m1=(0,eT.A)(mG.A,{name:"MuiDrawer",slot:"Root",overridesResolver:m0})((0,eI.A)(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),m2=(0,eT.A)("div",{shouldForwardProp:uC.A,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:m0})({flex:"0 0 auto"}),m5=(0,eT.A)(mQ.A,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`paperAnchor${(0,ek.A)(n.anchor)}`],"temporary"!==n.variant&&t[`paperAnchorDocked${(0,ek.A)(n.anchor)}`]]}})((0,eI.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}`}}]}))),m3={left:"right",right:"left",top:"down",bottom:"up"},m4=ew.forwardRef(function(e,t){let n=(0,eO.b)({props:e,name:"MuiDrawer"}),i=(0,ub.A)(),r=(0,p2.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,C=ew.useRef(!1);ew.useEffect(()=>{C.current=!0},[]);let M=function({direction:e},t){return"rtl"===e&&["left","right"].includes(t)?m3[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,ek.A)(n)}`],docked:[("permanent"===i||"persistent"===i)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${(0,ek.A)(n)}`,"temporary"!==i&&`paperAnchorDocked${(0,ek.A)(n)}`]};return(0,eC.A)(r,mJ,t)})(A),T={slots:{transition:y,...w},slotProps:{paper:m,transition:v,...S,backdrop:(0,pV.A)(S.backdrop||{...s,...d},{transitionDuration:x})}},[I,D]=(0,pj.A)("root",{ref:t,elementType:m1,className:(0,e_.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,R]=(0,pj.A)("paper",{elementType:m5,shouldForwardComponentProp:!0,className:(0,e_.A)(k.paper,m.className),ownerState:A,externalForwardedProps:T,additionalProps:{elevation:"temporary"===b?c:0,square:!0}}),[P,E]=(0,pj.A)("docked",{elementType:m2,ref:t,className:(0,e_.A)(k.root,k.docked,u),ownerState:A,externalForwardedProps:T,additionalProps:_}),[L,N]=(0,pj.A)("transition",{elementType:mK,ownerState:A,externalForwardedProps:T,additionalProps:{in:g,direction:m3[M],timeout:x,appear:C.current}}),B=(0,eb.jsx)(O,{...R,children:l});if("permanent"===b)return(0,eb.jsx)(P,{...E,children:B});let z=(0,eb.jsx)(L,{...N,children:B});return"persistent"===b?(0,eb.jsx)(P,{...E,children:z}):(0,eb.jsx)(I,{...D,children:z})}),m6=({anchor:e="right",isOpen:t,onClose:n,PaperProps:i,children:r,...o})=>{let a=m$("(max-width:1080px)");return(0,eb.jsx)(m4,{...o,open:t,onClose:n,anchor:e,PaperProps:{...i,sx:rP({width:a?"100%":"1080px",overflow:"hidden"},i?.sx)},"aria-hidden":!t,children:r})};var m8="12px sans-serif",m9=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"),m7={createCanvas:function(){return"u">typeof document&&document.createElement("canvas")},measureText:function(e,t){if(!x){var n=m7.createCanvas();x=n&&n.getContext("2d")}if(x)return b!==t&&(b=x.font=t||m8),x.measureText(e);e=e||"",t=t||m8;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=m9[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}},ve=vS(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(e,t){return e["[object "+t+"]"]=!0,e},{}),vt=vS(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(e,t){return e["[object "+t+"Array]"]=!0,e},{}),vn=Object.prototype.toString,vi=Array.prototype,vr=vi.forEach,vo=vi.filter,va=vi.slice,vs=vi.map,vl=(function(){}).constructor,vu=vl?vl.prototype:null,vc="__proto__",vh=2311;function vd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];"u">typeof console&&console.error.apply(console,e)}function vp(e){if(null==e||"object"!=typeof e)return e;var t=e,n=vn.call(e);if("[object Array]"===n){if(!e[v$]){t=[];for(var i=0,r=e.length;i<r;i++)t[i]=vp(e[i])}}else if(vt[n]){if(!e[v$]){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(!ve[n]&&!e[v$]&&!vL(e))for(var a in t={},e)e.hasOwnProperty(a)&&a!==vc&&(t[a]=vp(e[a]));return t}function vf(e,t,n){if(!vR(t)||!vR(e))return n?vp(t):e;for(var i in t)if(t.hasOwnProperty(i)&&i!==vc){var r=e[i],o=t[i];!(vR(o)&&vR(r))||vk(o)||vk(r)||vL(o)||vL(r)||vP(o)||vP(r)||o[v$]||r[v$]?!n&&i in e||(e[i]=vp(t[i])):vf(r,o,n)}return e}function vg(e,t){if(Object.assign)Object.assign(e,t);else for(var n in t)t.hasOwnProperty(n)&&n!==vc&&(e[n]=t[n]);return e}function vm(e,t,n){for(var i=vC(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 vv(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 vy(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 vm(e,t,n)}function vx(e){return!!e&&"string"!=typeof e&&"number"==typeof e.length}function vb(e,t,n){if(e&&t)if(e.forEach&&e.forEach===vr)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 vw(e,t,n){if(!e)return[];if(!t)return vV(e);if(e.map&&e.map===vs)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 vS(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 v_(e,t,n){if(!e)return[];if(!t)return vV(e);if(e.filter&&e.filter===vo)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 vC(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}m7.createCanvas;var vM=vu&&vT(vu.bind)?vu.call.bind(vu.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(va.call(arguments)))}};function vA(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(this,t.concat(va.call(arguments)))}}function vk(e){return Array.isArray?Array.isArray(e):"[object Array]"===vn.call(e)}function vT(e){return"function"==typeof e}function vI(e){return"string"==typeof e}function vD(e){return"[object String]"===vn.call(e)}function vO(e){return"number"==typeof e}function vR(e){var t=typeof e;return"function"===t||!!e&&"object"===t}function vP(e){return!!ve[vn.call(e)]}function vE(e){return!!vt[vn.call(e)]}function vL(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}function vN(e){return null!=e.colorStops}function vB(){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 vz(e,t){return null!=e?e:t}function vF(e,t,n){return null!=e?e:null!=t?t:n}function vV(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return va.apply(e,t)}function vj(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 vH(e,t){if(!e)throw Error(t)}function vW(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var v$="__ec_primitive__",vG=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 vC(this.data)},e.prototype.forEach=function(e){var t=this.data;for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},e}(),vU="function"==typeof Map,vq=function(){function e(t){var n=vk(t);this.data=vU?new Map:new vG;var i=this;function r(e,t){n?i.set(e,t):i.set(t,e)}t instanceof e?t.each(r):t&&vb(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 vU?Array.from(e):e},e.prototype.removeKey=function(e){this.data.delete(e)},e}();function vY(e){return new vq(e)}function vZ(e,t){var n;if(Object.create)n=Object.create(e);else{var i=function(){};i.prototype=e,n=new i}return t&&vg(n,t),n}function vX(e){var t=e.style;t.webkitUserSelect="none",t.userSelect="none",t.webkitTapHighlightColor="rgba(0,0,0,0)",t["-webkit-touch-callout"]="none"}function vK(e,t){return e.hasOwnProperty(t)}function vQ(){}var vJ=180/Math.PI;function v0(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 v1(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 vI(e)?e.replace(/^\s+|\s+$/g,"").match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e}function v2(e,t,n){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),n?e:+e}function v5(e){return e.sort(function(e,t){return e-t}),e}function v3(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 v4(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 v6(e){var t=2*Math.PI;return(e%t+t)%t}function v8(e){return e>-1e-4&&e<1e-4}var v9=/^(?:(\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 v7(e){if(e instanceof Date)return e;if(vI(e)){var t=v9.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 ye(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 yt(e,t){var n=ye(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 yn(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 yi(e){var t=parseFloat(e);return t==e&&(0!==t||!vI(e)||0>=e.indexOf("x"))?t:NaN}function yr(){return Math.round(9*Math.random())}function yo(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 ya=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},ys=new function(){this.browser=new ya,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?(ys.wxa=!0,ys.touchEventsSupported=!0):"u"<typeof document&&"u">typeof self?ys.worker=!0:"u"<typeof navigator||0===navigator.userAgent.indexOf("Node.js")?(ys.node=!0,ys.svgSupported=!0):(o=navigator.userAgent,s=(a=ys).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 yl="series\0",yu="\0_ec_\0";function yc(e){return e instanceof Array?e:null==e?[]:[e]}function yh(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 yd=["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 yp(e){return!vR(e)||vk(e)||e instanceof Date?e:e.value}function yf(e,t,n){var i=ym(t[e],null),r=ym(n[e],null);return null!=i&&null!=r&&i===r}function yg(e){return ym(e,"")}function ym(e,t){return null==e?t:vI(e)?e:vO(e)||vD(e)?e+"":t}function yv(e){var t=e.name;return!!(t&&t.indexOf(yl))}function yy(e){return e&&null!=e.id&&0===yg(e.id).indexOf(yu)}function yx(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?vk(t.dataIndex)?vw(t.dataIndex,function(t){return e.indexOfRawIndex(t)}):e.indexOfRawIndex(t.dataIndex):null!=t.name?vk(t.name)?vw(t.name,function(t){return e.indexOfName(t)}):e.indexOfName(t.name):void 0}function yb(){var e="__ec_inner_"+yw++;return function(t){return t[e]||(t[e]={})}}var yw=yr();function yS(e,t,n){var i=y_(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=yA(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 y_(e,t){if(vI(e)){var n,i={};i[e+"Index"]=0,n=i}else n=e;var r=vY(),o={},a=!1;return vb(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>vv(t.includeMainTypes,s)||(a=a||!!s,(r.get(s)||r.set(s,{}))[l]=e)}),{mainTypeSpecified:a,queryOptionMap:r,others:o}}var yC={useDefault:!0,enableAll:!1,enableNone:!1},yM={useDefault:!1,enableAll:!0,enableNone:!0};function yA(e,t,n,i){i=i||yC;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?(vH(i.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[]):("all"===r&&(vH(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 yk(e,t,n){e.setAttribute?e.setAttribute(t,n):e[t]=n}function yT(e,t,n,i,r){var o=null==t||"auto"===t;if(null==i)return i;if(vO(i)){var a,s=(i-(a=n||0))*r+a;return v2(s,o?Math.max(v3(n||0),v3(i)):t)}if(vI(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]=v2(s,o?Math.max(v3(d),v3(p)):t)}}return l}var yI=vY(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),yD="original",yO="arrayRows",yR="objectRows",yP="keyedColumns",yE="typedArray",yL="unknown",yN="column",yB=yb();function yz(e,t,n){var i,r,o={},a=yV(t);if(!a||!e)return o;var s=[],l=[],u=yB(t.ecModel).datasetMap,c=a.uid+"_"+n.seriesLayoutBy;vb(e=e.slice(),function(t,n){var a=vR(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 vb(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 yF(e,t,n){var i,r={};if(!yV(e))return r;var o=t.sourceFormat,a=t.dimensionsDefine;(o===yR||o===yP)&&vb(a,function(e,t){(vR(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=yH(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 yV(e){if(!e.get("data",!0))return yA(e.ecModel,"dataset",{index:e.get("datasetIndex",!0),id:e.get("datasetId",!0)},yC).models[0]}function yj(e,t){return yH(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)}function yH(e,t,n,i,r,o){var a,s,l;if(vE(e))return 3;if(i){var u=i[o];vR(u)?(s=u.name,l=u.type):vI(u)&&(s=u)}if(null!=l)return"ordinal"===l?1:3;if(t===yO)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===yR){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===yP){if(!s)return 3;var c=e[s];if(!c||vE(c))return 3;for(var h=0;h<c.length&&h<5;h++)if(null!=(a=g(c[h])))return a}else if(t===yD)for(var h=0;h<e.length&&h<5;h++){var p=e[h],f=yp(p);if(!vk(f))return 3;if(null!=(a=g(f[o])))return a}function g(e){var t=vI(e);return null!=e&&isFinite(e)&&""!==e?t?2:3:t&&"-"!==e?1:void 0}return 3}var yW=function(e){this.data=e.data||(e.sourceFormat===yP?{}:[]),this.sourceFormat=e.sourceFormat||yL,this.seriesLayoutBy=e.seriesLayoutBy||yN,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===yj(this,n)&&(i.type="ordinal")}};function y$(e){return e instanceof yW}function yG(e,t,n){n=n||yq(e);var i=t.seriesLayoutBy,r=function(e,t,n,i,r){if(!e)return{dimensionsDefine:yY(r),startIndex:a,dimensionsDetectedCount:o};if(t===yO){var o,a;"auto"===i||null==i?yZ(function(e){null!=e&&"-"!==e&&(vI(e)?null==a&&(a=1):a=0)},n,e,10):a=vO(i)?i:+!!i,r||1!==a||(r=[],yZ(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===yR)r||(r=function(e){for(var t,n=0;n<e.length&&!(t=e[n++]););if(t)return vC(t)}(e));else if(t===yP)r||(r=[],vb(e,function(e,t){r.push(t)}));else if(t===yD){var s=yp(e[0]);o=vk(s)&&s.length||1}return{startIndex:a,dimensionsDefine:yY(r),dimensionsDetectedCount:o}}(e,n,i,t.sourceHeader,t.dimensions);return new yW({data:e,sourceFormat:n,seriesLayoutBy:i,dimensionsDefine:r.dimensionsDefine,startIndex:r.startIndex,dimensionsDetectedCount:r.dimensionsDetectedCount,metaRawOption:vp(t)})}function yU(e){return new yW({data:e,sourceFormat:vE(e)?yE:yD})}function yq(e){var t=yL;if(vE(e))t=yE;else if(vk(e)){0===e.length&&(t=yO);for(var n=0,i=e.length;n<i;n++){var r=e[n];if(null!=r){if(vk(r)||vE(r)){t=yO;break}else if(vR(r)){t=yR;break}}}}else if(vR(e)){for(var o in e)if(vK(e,o)&&vx(e[o])){t=yP;break}}return t}function yY(e){if(e){var t=vY();return vw(e,function(e,n){var i={name:(e=vR(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 yZ(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 yX(e){var t=e.sourceFormat;return t===yR||t===yP}var yK=yb(),yQ={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},yJ=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=y2(this.source)))},e.prototype.getSourceDimensionIndex=function(e){return vz(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=yX(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+=yQ[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 y0(e){return e instanceof yJ}function y1(e){for(var t=vY(),n=0;n<(e||[]).length;n++){var i=e[n],r=vR(i)?i.name:i;null!=r&&null==t.get(r)&&t.set(r,n)}return t}function y2(e){var t=yK(e);return t.dimNameMap||(t.dimNameMap=y1(e.dimensionsDefine))}function y5(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function y3(e,t){return y5(e,t)?e.getCalculationInfo("stackResultDimension"):t}function y4(){var e=yb();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 y6="u">typeof Float32Array,y8=y6?Float32Array:Array;function y9(e){return vk(e)?y6?new Float32Array(e):e:new y8(e)}var y7="__ec_stack_";function xe(e){return e.get("stack")||y7+e.seriesIndex}function xt(e){return e.dim+e.index}function xn(e,t){var n=[];return t.eachSeriesByType(e,function(e){xa(e)&&n.push(e)}),n}function xi(e){var t=function(e){var t={};vb(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 vb(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=v1(e.get("barWidth"),i),d=v1(e.get("barMaxWidth"),i),p=v1(e.get("barMinWidth")||(xs(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:xt(r),stackId:xe(e)})}),xr(n)}function xr(e){var t={};vb(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 vb(t,function(e,t){n[t]={};var i,r=e.stacks,o=e.bandWidth,a=e.categoryGap;null==a&&(a=Math.max(35-4*vC(r).length,15)+"%");var s=v1(a,o),l=v1(e.gap,1),u=e.remainedWidth,c=e.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),vb(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;vb(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;vb(r,function(e,i){n[t][i]=n[t][i]||{bandWidth:o,offset:p,width:e.width},p+=e.width*(1+l)})}),n}function xo(e,t){var n=xn(e,t),i=xi(n);vb(n,function(e){var t=e.getData(),n=e.coordinateSystem.getBaseAxis(),r=xe(e),o=i[xt(n)][r],a=o.offset,s=o.width;t.setLayout({bandWidth:o.bandWidth,offset:a,size:s})})}function xa(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function xs(e){return e.pipelineContext&&e.pipelineContext.large}var xl={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]}},xu=function(e){return Math.round(e.length/2)};function xc(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;vI(r)?d=xl[r]:vT(r)&&(d=r),d&&e.setData(i.downSample(i.mapDimension(l.dim),1/h,d,xu))}}}}}var xh=function(e,t){return(xh=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 xd(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}xh(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var xp="___EC__COMPONENT__CONTAINER___",xf="___EC__EXTENDED_CLASS___";function xg(e){var t={main:"",sub:""};if(e){var n=e.split(".");t.main=n[0]||"",t.sub=n[1]||""}return t}function xm(e,t){e.$constructor=e,e.extend=function(e){var t,n,i=this;if(vT(t=i)&&/^class\s/.test(Function.prototype.toString.call(t)))n=function(e){function t(){return e.apply(this,arguments)||this}return xd(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 vg(n.prototype,e),n[xf]=!0,n.extend=this.extend,n.superCall=xx,n.superApply=xb,n.superClass=i,n}}function xv(e,t){e.extend=t.extend}var xy=Math.round(10*Math.random());function xx(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 xb(e,t,n){return this.superClass.prototype[t].apply(e,n)}function xw(e){var t={};e.registerClass=function(e){var n=e.type||e.prototype.type;if(n){vH(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(n),'componentType "'+n+'" illegal'),e.prototype.type=n;var i,r,o=xg(n);o.sub?o.sub!==xp&&(((r=t[(i=o).main])&&r[xp]||((r=t[i.main]={})[xp]=!0),r)[o.sub]=e):t[o.main]=e}return e},e.getClass=function(e,n,i){var r=t[e];if(r&&r[xp]&&(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=xg(e),i=[],r=t[n.main];return r&&r[xp]?vb(r,function(e,t){t!==xp&&i.push(e)}):i.push(r),i},e.hasClass=function(e){return!!t[xg(e).main]},e.getAllClassMainTypes=function(){var e=[];return vb(t,function(t,n){e.push(n)}),e},e.hasSubTypes=function(e){var n=t[xg(e).main];return n&&n[xp]}}function xS(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&&vv(i,s)>=0||r&&0>vv(r,s))){var l=n.getShallow(s,t);null!=l&&(o[e[a][0]]=l)}}return o}}var x_=xS([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),xC=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return x_(this,e,t)},e}(),xM=function(e,t){return(xM=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 xA(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}xM(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var xk=function(e){this.value=e},xT=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new xk(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}(),xI=function(){function e(e){this._list=new xT,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 xk(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}(),xD=new xI(50);function xO(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=xD.get(e),a={hostEl:n,cb:i,cbPayload:r};return o?xP(t=o.image)||o.pending.push(a):((t=m7.loadImage(e,xR,xR)).__zrImageSrc=e,xD.put(e,t.__cachedImgObj={image:t,pending:[a]})),t}function xR(){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 xP(e){return e&&e.width&&e.height}function xE(){return[1,0,0,1,0,0]}function xL(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function xN(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 xB(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 xz(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 xF(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 xV=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 xj=Math.min,xH=Math.max,xW=new xV,x$=new xV,xG=new xV,xU=new xV,xq=new xV,xY=new xV;let xZ=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=xj(e.x,this.x),n=xj(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=xH(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=xH(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=xE();return xB(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,xB(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?xV.set(xY,-f,0):xV.set(xY,g,0)):y<d&&(d=y,f<g?xV.set(xq,f,0):xV.set(xq,-g,0)),a<u||c<o?x>p&&(p=x,m<v?xV.set(xY,0,-m):xV.set(xY,0,v)):y<d&&(d=y,m<v?xV.set(xq,0,m):xV.set(xq,0,-v))}return n&&xV.copy(n,h?xq:xY),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}xW.x=xG.x=n.x,xW.y=xU.y=n.y,x$.x=xU.x=n.x+n.width,x$.y=xG.y=n.y+n.height,xW.transform(i),xU.transform(i),x$.transform(i),xG.transform(i),t.x=xj(xW.x,x$.x,xG.x,xU.x),t.y=xj(xW.y,x$.y,xG.y,xU.y);var l=xH(xW.x,x$.x,xG.x,xU.x),u=xH(xW.y,x$.y,xG.y,xU.y);t.width=l-t.x,t.height=u-t.y},e}();var xX={};function xK(e,t){var n=xX[t=t||m8];n||(n=xX[t]=new xI(500));var i=n.get(e);return null==i&&(i=m7.measureText(e,t).width,n.put(e,i)),i}function xQ(e,t,n,i){var r=xK(e,t),o=x2(t);return new xZ(x0(0,r,n),x1(0,o,i),r,o)}function xJ(e,t,n,i){var r=((e||"")+"").split("\n");if(1===r.length)return xQ(r[0],t,n,i);for(var o=new xZ(0,0,0,0),a=0;a<r.length;a++){var s=xQ(r[a],t,n,i);0===a?o.copy(s):o.union(s)}return o}function x0(e,t,n){return"right"===n?e-=t:"center"===n&&(e-=t/2),e}function x1(e,t,n){return"middle"===n?e-=t/2:"bottom"===n&&(e-=t),e}function x2(e){return xK("国",e)}function x5(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function x3(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+=x5(i[0],n.width),u+=x5(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 x4=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function x6(e,t,n,i){var r=vg({},i=i||{});r.font=t,n=vz(n,"..."),r.maxIterations=vz(i.maxIterations,2);var o=r.minChar=vz(i.minChar,0);r.cnCharWidth=xK("国",t);var a=r.ascCharWidth=xK("a",t);r.placeholder=vz(i.placeholder,"");for(var s=e=Math.max(0,e-1),l=0;l<o&&s>=a;l++)s-=a;var u=xK(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 x8(e,t){var n=t.containerWidth,i=t.font,r=t.contentWidth;if(!n)return"";var o=xK(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=xK(e=e.substr(0,s),i)}return""===e&&(e=t.placeholder),e}var x9=function(){},x7=function(e){this.tokens=[],e&&(this.tokens=e)},be=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]};function bt(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=x5(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=bi(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 x9;if(y.styleName=r,y.text=v,y.isLineHolder=!v&&!s,"number"==typeof l.width?y.width=l.width:y.width=a?a[m]:xK(v,c),m||h)u.push(new x7([y]));else{var x=(u[u.length-1]||(u[0]=new x7)).tokens,b=x.length;1===b&&x[0].isLineHolder?x[0]=y:(v||!b||s)&&x.push(y)}}}var bn=vS(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function bi(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=xK(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))||!!bn[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 br(e,t){return null==e&&(e=0),null==t&&(t=0),[e,t]}function bo(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function ba(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function bs(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function bl(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 bu(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var bc=function(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])};function bh(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 bd(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 bp(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function bf(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}function bg(e){return e>5e-5||e<-5e-5}var bm=[],bv=[],by=xE(),bx=Math.abs,bb=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 bg(this.rotation)||bg(this.x)||bg(this.y)||bg(this.scaleX-1)||bg(this.scaleY-1)||bg(this.skewX)||bg(this.skewY)},t.prototype.updateTransform=function(){var e,t=this.parent&&this.parent.transform,n=this.needLocalTransform(),i=this.transform;if(!(n||t)){i&&(xL(i),this.invTransform=null);return}i=i||xE(),n?this.getLocalTransform(i):xL(i),t&&(n?xN(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(bm);var n=bm[0]<0?-1:1,i=bm[1]<0?-1:1,r=((bm[0]-n)*t+n)/bm[0]||0,o=((bm[1]-i)*t+i)/bm[1]||0;e[0]*=r,e[1]*=r,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||xE(),xF(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||xE(),xN(bv,e.invTransform,t),t=bv);var n=this.originX,i=this.originY;(n||i)&&(by[4]=n,by[5]=i,xN(bv,t,by),bv[4]-=n,bv[5]-=i,t=bv),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&&bd(n,n,i),n},t.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],i=this.transform;return i&&bd(n,n,i),n},t.prototype.getLineScale=function(){var e=this.transform;return e&&bx(e[0]-1)>1e-10&&bx(e[3]-1)>1e-10?Math.sqrt(bx(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){for(var t=this,n=e,i=0;i<bw.length;i++){var r=bw[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&&xz(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}(),bw=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"],bS={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-bS.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*bS.bounceIn(2*e):.5*bS.bounceOut(2*e-1)+.5}},b_=Math.pow,bC=Math.sqrt,bM=bC(3),bA=1/3,bk=br(),bT=br(),bI=br();function bD(e){return e>-1e-8&&e<1e-8}function bO(e){return e>1e-8||e<-1e-8}function bR(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 bP(e,t,n,i,r){var o=1-r;return 3*(((t-e)*o+2*(n-t)*r)*o+(i-n)*r*r)}function bE(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(bD(c)&&bD(h))if(bD(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(bD(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=bC(g),x=c*s+1.5*a*(-h+y),b=c*s+1.5*a*(-h-y),f=(-s-((x=x<0?-b_(-x,bA):b_(x,bA))+(b=b<0?-b_(-b,bA):b_(b,bA))))/(3*a);f>=0&&f<=1&&(o[p++]=f)}else{var w=Math.acos((2*c*s-3*a*h)/(2*bC(c*c*c)))/3,S=bC(c),_=Math.cos(w),f=(-s-2*S*_)/(3*a),v=(-s+S*(_+bM*Math.sin(w)))/(3*a),C=(-s+S*(_-bM*Math.sin(w)))/(3*a);f>=0&&f<=1&&(o[p++]=f),v>=0&&v<=1&&(o[p++]=v),C>=0&&C<=1&&(o[p++]=C)}}return p}function bL(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(bD(a)){if(bO(o)){var u=-s/o;u>=0&&u<=1&&(r[l++]=u)}}else{var c=o*o-4*a*s;if(bD(c))r[0]=-o/(2*a);else if(c>0){var h=bC(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 bN(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 bB(e,t,n,i){var r=1-i;return r*(r*e+2*i*t)+i*i*n}function bz(e,t,n,i){return 2*((1-i)*(t-e)+i*(n-t))}function bF(e,t,n){var i=e+n-2*t;return 0===i?.5:(e-t)/i}function bV(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 bj=/cubic-bezier\(([0-9,\.e ]+)\)/;function bH(e){var t=e&&bj.exec(e);if(t){var n=t[1].split(","),i=+vW(n[0]),r=+vW(n[1]),o=+vW(n[2]),a=+vW(n[3]);if(isNaN(i+r+o+a))return;var s=[];return function(e){return e<=0?0:e>=1?1:bE(0,i,o,1,e,s)&&bR(0,r,a,1,s[0])}}}var bW=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||vQ,this.ondestroy=e.ondestroy||vQ,this.onrestart=e.onrestart||vQ,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=vT(e)?e:bS[e]||bH(e)},e}(),b$={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 bG(e){return(e=Math.round(e))<0?0:e>255?255:e}function bU(e){return e<0?0:e>1?1:e}function bq(e){return e.length&&"%"===e.charAt(e.length-1)?bG(parseFloat(e)/100*255):bG(parseInt(e,10))}function bY(e){return e.length&&"%"===e.charAt(e.length-1)?bU(parseFloat(e)/100):bU(parseFloat(e))}function bZ(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 bX(e,t,n,i,r){return e[0]=t,e[1]=n,e[2]=i,e[3]=r,e}function bK(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var bQ=new xI(20),bJ=null;function b0(e,t){bJ&&bK(bJ,t),bJ=bQ.put(e,bJ||t.slice())}function b1(e,t){if(e){t=t||[];var n=bQ.get(e);if(n)return bK(t,n);var i=(e+="").replace(/ /g,"").toLowerCase();if(i in b$)return bK(t,b$[i]),b0(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?(bX(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),b0(e,t),t):void bX(t,0,0,0,1)}if(7===r||9===r){var o=parseInt(i.slice(1,7),16);return o>=0&&o<=0xffffff?(bX(t,(0xff0000&o)>>16,(65280&o)>>8,255&o,9===r?parseInt(i.slice(7),16)/255:1),b0(e,t),t):void bX(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?bX(t,+u[0],+u[1],+u[2],1):bX(t,0,0,0,1);c=bY(u.pop());case"rgb":if(u.length>=3)return bX(t,bq(u[0]),bq(u[1]),bq(u[2]),3===u.length?c:bY(u[3])),b0(e,t),t;return void bX(t,0,0,0,1);case"hsla":if(4!==u.length)return void bX(t,0,0,0,1);return u[3]=bY(u[3]),b2(u,t),b0(e,t),t;case"hsl":if(3!==u.length)return void bX(t,0,0,0,1);return b2(u,t),b0(e,t),t;default:return}}bX(t,0,0,0,1)}}function b2(e,t){var n=(parseFloat(e[0])%360+360)%360/360,i=bY(e[1]),r=bY(e[2]),o=r<=.5?r*(i+1):r+i-r*i,a=2*r-o;return bX(t=t||[],bG(255*bZ(a,o,n+1/3)),bG(255*bZ(a,o,n)),bG(255*bZ(a,o,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}function b5(e,t){var n=b1(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 b8(n,4===n.length?"rgba":"rgb")}}function b3(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]=bG((i=c[0],i+(h[0]-i)*d)),n[1]=bG((r=c[1],r+(h[1]-r)*d)),n[2]=bG((o=c[2],o+(h[2]-o)*d)),n[3]=bU((a=c[3],a+(h[3]-a)*d)),n}}function b4(e,t,n,i){var r,o=b1(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]=bY(n)),null!=i&&(o[2]=bY(i)),b8(b2(o),"rgba")}function b6(e,t){var n=b1(e);if(n&&null!=t)return n[3]=bU(t),b8(n,"rgba")}function b8(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 b9(e,t){var n=b1(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var b7=new xI(100);function we(e){if(vI(e)){var t=b7.get(e);return t||(t=b5(e,-.1),b7.put(e,t)),t}if(vN(e)){var n=vg({},e);return n.colorStops=vw(e.colorStops,function(e){return{offset:e.offset,color:b5(e.color,-.1)}}),n}return e}ys.hasGlobalWindow&&vT(window.btoa);var wt=Array.prototype.slice;function wn(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 wi(e,t,n,i){for(var r=t.length,o=0;o<r;o++)e[o]=t[o]+n[o]*i;return e}function wr(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 wo(e){if(vx(e)){var t=e.length;if(vx(e[0])){for(var n=[],i=0;i<t;i++)n.push(wt.call(e[i]));return n}return wt.call(e)}return e}function wa(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 ws(e){return 4===e||5===e}function wl(e){return 1===e||2===e}var wu=[0,0,0,0],wc=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(vx(t)){var l=vx(t&&t[0])?2:1;a=l,(1!==l||vO(t[0]))&&(2!==l||vO(t[0][0]))||(o=!0)}else if(vO(t)&&t==t)a=0;else if(vI(t))if(isNaN(+t)){var u=b1(t);u&&(s=u,a=3)}else a=0;else if(vN(t)){var c=vg({},s);(c.colorStops=vw(t.colorStops,function(e){return{offset:e.offset,color:b1(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=vT(n)?n:bS[n]||bH(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=wl(i),l=ws(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]:wt.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=wi([],n[u].value,p,-1):wl(i)&&(n[u].additiveValue=1===i?wi([],n[u].value,p,-1):wr([],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?wu:e[c];if((wl(s)||h)&&!m&&(m=this._additiveValue=[]),this.discrete)e[c]=g<1?i.rawValue:r.rawValue;else if(wl(s))1===s?wn(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(ws(s)){var v,y,x,b,w,S=i[a],_=r[a],C=4===s;(e[c]={type:C?"linear":"radial",x:(v=S.x,(_.x-v)*g+v),y:(y=S.y,(_.y-y)*g+y),colorStops:vw(S.colorStops,function(e,t){var n,i=_.colorStops[t];return{offset:(n=e.offset,(i.offset-n)*g+n),color:wa(wn([],e.color,i.color,g))}}),global:_.global},C)?(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)wn(m,i[a],r[a],g),o||(e[c]=wa(m));else{var M,A=(M=i[a],(r[a]-M)*g+M);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?(b1(e[n],wu),wi(wu,wu,i,1),e[n]=wa(wu)):1===t?wi(e[n],e[n],i,1):2===t&&wr(e[n],e[n],i,1)},e}(),wh=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)?vd("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,vC(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 wc(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=wa(l))}else l=this._target[a];if(null==l)continue;e>0&&s.addKeyframe(0,wo(l),i),this._trackKeys.push(a)}s.addKeyframe(e,wo(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 bW({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 vw(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]=wo(s.rawValue))}}}},e.prototype.__changeFinalValue=function(e,t){t=t||vC(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}(),wd=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}(),wp=1;ys.hasGlobalWindow&&(wp=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var wf=wp,wg="#333",wm="#ccc",wv="__zr_normal__",wy=bw.concat(["ignore"]),wb=vS(bw,function(e,t){return e[t]=!0,e},{ignore:!1}),ww={},wS=new xZ(0,0,0,0),w_=function(){function e(e){this.id=vh++,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?wS.copy(n.layoutRect):wS.copy(this.getBoundingRect()),i||wS.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(ww,n,wS):x3(ww,n,wS),r.x=ww.x,r.y=ww.y,o=ww.align,a=ww.verticalAlign;var u=n.origin;if(u&&null!=n.rotation){var c=void 0,h=void 0;"center"===u?(c=.5*wS.width,h=.5*wS.height):(c=x5(u[0],wS.width),h=x5(u[1],wS.height)),l=!0,r.originX=-r.x+c+(i?0:wS.x),r.originY=-r.y+h+(i?0:wS.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()?wm:wg},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof t&&b1(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,b8(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||{},vg(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(vR(e))for(var n=vC(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===wv)){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,wy)},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(wv,!1,e)},e.prototype.useState=function(e,t,n,i){var r,o=e===wv;if(this.hasState()||!o){var a=this.currentStates,s=this.stateTransition;if(!(vv(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 vd("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=vv(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=vv(i,e),o=vv(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];vg(n,r),r.textConfig&&vg(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=vg({},i?this.textConfig:n.textConfig),vg(this.textConfig,t.textConfig)):a&&n.textConfig&&(this.textConfig=n.textConfig);for(var s={},l=!1,u=0;u<wy.length;u++){var c=wy[u],h=r&&wb[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 bb,this._attachComponent(e),this._textContent=e,this.markRedraw())},e.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),vg(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 wh(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=vv(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){wC(this,e,t,n)},e.prototype.animateFrom=function(e,t,n){wC(this,e,t,n,!0)},e.prototype._transitionState=function(e,t,n,i){for(var r=wC(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 wC(e,t,n,i,r){var o=[];!function e(t,n,i,r,o,a,s,l){for(var u=vC(r),c=o.duration,h=o.delay,d=o.additive,p=o.setToFinal,f=!vR(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(!vR(x)||vx(x)||vN(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 _=vv(g,S);g.splice(_,1)}}if(o.force||(b=(m=v_(m,function(e){var t,n;return!((t=r[e])===(n=i[e])||vx(t)&&vx(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 C=void 0,M=void 0,A=void 0;if(l){M={},p&&(C={});for(var w=0;w<b;w++){var y=m[w];M[y]=i[y],p?C[y]=r[y]:i[y]=r[y]}}else if(p){A={};for(var w=0;w<b;w++){var y=m[w];A[y]=wo(i[y]),function(e,t,n){if(vx(t[n]))if(vx(e[n])||(e[n]=[]),vE(t[n])){var i=t[n].length;e[n].length!==i&&(e[n]=new t[n].constructor(i),wM(e[n],t[n],i))}else{var r=t[n],o=e[n],a=r.length;if(vx(r[0]))for(var s=r[0].length,l=0;l<a;l++)o[l]?wM(o[l],r[l],s):o[l]=Array.prototype.slice.call(r[l]);else wM(o,r,a);o.length=r.length}else e[n]=t[n]}(i,r,y)}}var S=new wh(i,!1,!1,d?v_(g,function(e){return e.targetName===n}):null);S.targetName=n,o.scope&&(S.scope=o.scope),p&&C&&S.whenWithKeys(0,C,m),A&&S.whenWithKeys(0,A,m),S.whenWithKeys(null==c?500:c,l?M: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 wM(e,t,n){for(var i=0;i<n;i++)e[i]=t[i]}vy(w_,wd),vy(w_,bb);var wA="__zr_style_"+Math.round(10*Math.random()),wk={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},wT={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};wk[wA]=!0;var wI=["z","z2","invisible"],wD=["invisible"],wO=function(e){var t;function n(t){return e.call(this,t)||this}return xA(n,e),n.prototype._init=function(t){for(var n=vC(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,wR.copy(r.getBoundingRect()),r.transform&&wR.applyTransform(r.transform),wP.width=o,wP.height=a,!wR.intersect(wP))||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 xZ(0,0,0,0)),t?xZ.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 xZ(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:vg(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 vZ(wk,e)},n.prototype.useStyle=function(e){e[wA]||(e=this.createStyle(e)),this.__inHover?this.__hoverStyle=e:this.style=e,this.dirtyStyle()},n.prototype.isStyleObject=function(e){return e[wA]},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,wI)},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=vC(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=vC(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?wD:wI,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 vg(e,t),e},n.prototype.getAnimationStyleProps=function(){return wT},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}(w_),wR=new xZ(0,0,0,0),wP=new xZ(0,0,0,0),wE=Math.min,wL=Math.max,wN=Math.sin,wB=Math.cos,wz=2*Math.PI,wF=br(),wV=br(),wj=br();function wH(e,t,n,i,r,o){r[0]=wE(e,n),r[1]=wE(t,i),o[0]=wL(e,n),o[1]=wL(t,i)}var wW=[],w$=[],wG={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},wU=[],wq=[],wY=[],wZ=[],wX=[],wK=[],wQ=Math.min,wJ=Math.max,w0=Math.cos,w1=Math.sin,w2=Math.abs,w5=Math.PI,w3=2*w5,w4="u">typeof Float32Array,w6=[];function w8(e){return Math.round(e/w5*1e8)/1e8%2*w5}function w9(e,t){var n=w8(e[0]);n<0&&(n+=w3);var i=n-e[0],r=e[1];r+=i,!t&&r-n>=w3?r=n+w3:t&&n-r>=w3?r=n-w3:!t&&n>r?r=n+(w3-w8(n-r)):t&&n<r&&(r=n-(w3-w8(r-n))),e[0]=n,e[1]=r}var w7=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=w2(n/wf/e)||0,this._uy=w2(n/wf/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(wG.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=w2(e-this._xi),i=w2(t-this._yi),r=n>this._ux||i>this._uy;if(this.addData(wG.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(wG.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(wG.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(),w6[0]=i,w6[1]=r,w9(w6,o),i=w6[0];var a=(r=w6[1])-i;return this.addData(wG.A,e,t,n,n,i,a,0,+!o),this._ctx&&this._ctx.arc(e,t,n,i,r,o),this._xi=w0(r)*n+e,this._yi=w1(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(wG.R,e,t,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(wG.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)&&w4&&(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();w4&&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,w4&&this._len>11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){wY[0]=wY[1]=wX[0]=wX[1]=Number.MAX_VALUE,wZ[0]=wZ[1]=wK[0]=wK[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 wG.M:n=r=t[e++],i=o=t[e++],wX[0]=r,wX[1]=o,wK[0]=r,wK[1]=o;break;case wG.L:wH(n,i,t[e],t[e+1],wX,wK),n=t[e++],i=t[e++];break;case wG.C:!function(e,t,n,i,r,o,a,s,l,u){var c=bL(e,n,r,a,wW);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=bR(e,n,r,a,wW[h]);l[0]=wE(d,l[0]),u[0]=wL(d,u[0])}c=bL(t,i,o,s,w$);for(var h=0;h<c;h++){var p=bR(t,i,o,s,w$[h]);l[1]=wE(p,l[1]),u[1]=wL(p,u[1])}l[0]=wE(e,l[0]),u[0]=wL(e,u[0]),l[0]=wE(a,l[0]),u[0]=wL(a,u[0]),l[1]=wE(t,l[1]),u[1]=wL(t,u[1]),l[1]=wE(s,l[1]),u[1]=wL(s,u[1])}(n,i,t[e++],t[e++],t[e++],t[e++],t[e],t[e+1],wX,wK),n=t[e++],i=t[e++];break;case wG.Q:!function(e,t,n,i,r,o,a,s){var l=wL(wE(bF(e,n,r),1),0),u=wL(wE(bF(t,i,o),1),0),c=bB(e,n,r,l),h=bB(t,i,o,u);a[0]=wE(e,r,c),a[1]=wE(t,o,h),s[0]=wL(e,r,c),s[1]=wL(t,o,h)}(n,i,t[e++],t[e++],t[e],t[e+1],wX,wK),n=t[e++],i=t[e++];break;case wG.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=w0(d)*c+l,o=w1(d)*h+u),function(e,t,n,i,r,o,a,s,l){var u=Math.abs(r-o);if(u%wz<1e-4&&u>1e-4){s[0]=e-n,s[1]=t-i,l[0]=e+n,l[1]=t+i;return}if(wF[0]=wB(r)*n+e,wF[1]=wN(r)*i+t,wV[0]=wB(o)*n+e,wV[1]=wN(o)*i+t,bp(s,wF,wV),bf(l,wF,wV),(r%=wz)<0&&(r+=wz),(o%=wz)<0&&(o+=wz),r>o&&!a?o+=wz:r<o&&a&&(r+=wz),a){var c=o;o=r,r=c}for(var h=0;h<o;h+=Math.PI/2)h>r&&(wj[0]=wB(h)*n+e,wj[1]=wN(h)*i+t,bp(s,wj,s),bf(l,wj,l))}(l,u,c,h,d,p,f,wX,wK),n=w0(p)*c+l,i=w1(p)*h+u;break;case wG.R:wH(r=n=t[e++],o=i=t[e++],r+t[e++],o+t[e++],wX,wK);break;case wG.Z:n=r,i=o}bp(wY,wY,wX),bf(wZ,wZ,wK)}return 0===e&&(wY[0]=wY[1]=wZ[0]=wZ[1]=0),new xZ(wY[0],wY[1],wZ[0]-wY[0],wZ[1]-wY[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 wG.M:r=a=e[h++],o=s=e[h++];break;case wG.L:var g=e[h++],m=e[h++],v=g-r,y=m-o;(w2(v)>n||w2(y)>i||h===t-1)&&(f=Math.sqrt(v*v+y*y),r=g,o=m);break;case wG.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=bR(e,n,r,a,d),f=bR(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 wG.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=bB(e,n,r,c),d=bB(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 wG.A:var _=e[h++],C=e[h++],M=e[h++],A=e[h++],k=e[h++],T=e[h++],I=T+k;h+=1,p&&(a=w0(k)*M+_,s=w1(k)*A+C),f=wJ(M,A)*wQ(w3,Math.abs(T)),r=w0(I)*M+_,o=w1(I)*A+C;break;case wG.R:a=r=e[h++],s=o=e[h++],f=2*e[h++]+2*e[h++];break;case wG.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!==wG.L&&x>0&&(e.lineTo(c,h),x=0),w){case wG.M:n=r=d[b++],i=o=d[b++],e.moveTo(r,o);break;case wG.L:a=d[b++],s=d[b++];var _=w2(a-r),C=w2(s-o);if(_>p||C>f){if(m){var M=l[y++];if(v+M>u){var A=(u-v)/M;e.lineTo(r*(1-A)+a*A,o*(1-A)+s*A);break t}v+=M}e.lineTo(a,s),r=a,o=s,x=0}else{var k=_*_+C*C;k>x&&(c=a,h=s,x=k)}break;case wG.C:var T=d[b++],I=d[b++],D=d[b++],O=d[b++],R=d[b++],P=d[b++];if(m){var M=l[y++];if(v+M>u){var A=(u-v)/M;bN(r,T,D,R,A,wU),bN(o,I,O,P,A,wq),e.bezierCurveTo(wU[1],wq[1],wU[2],wq[2],wU[3],wq[3]);break t}v+=M}e.bezierCurveTo(T,I,D,O,R,P),r=R,o=P;break;case wG.Q:var T=d[b++],I=d[b++],D=d[b++],O=d[b++];if(m){var M=l[y++];if(v+M>u){var A=(u-v)/M;bV(r,T,D,A,wU),bV(o,I,O,A,wq),e.quadraticCurveTo(wU[1],wq[1],wU[2],wq[2]);break t}v+=M}e.quadraticCurveTo(T,I,D,O),r=D,o=O;break;case wG.A:var E=d[b++],L=d[b++],N=d[b++],B=d[b++],z=d[b++],F=d[b++],V=d[b++],j=!d[b++],H=N>B?N:B,W=w2(N-B)>.001,$=z+F,G=!1;if(m){var M=l[y++];v+M>u&&($=z+F*(u-v)/M,G=!0),v+=M}if(W&&e.ellipse?e.ellipse(E,L,N,B,V,z,$,j):e.arc(E,L,H,z,$,j),G)break t;S&&(n=w0(z)*N+E,i=w1(z)*B+L),r=w0($)*N+E,o=w1($)*B+L;break;case wG.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 M=l[y++];if(v+M>u){var Y=u-v;e.moveTo(a,s),e.lineTo(a+wQ(Y,U),s),(Y-=U)>0&&e.lineTo(a+U,s+wQ(Y,q)),(Y-=q)>0&&e.lineTo(a+wJ(U-Y,0),s+q),(Y-=U)>0&&e.lineTo(a,s+wJ(q-Y,0));break t}v+=M}e.rect(a,s,U,q);break;case wG.Z:if(m){var M=l[y++];if(v+M>u){var A=(u-v)/M;e.lineTo(r*(1-A)+n*A,o*(1-A)+i*A);break t}v+=M}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=wG,t.initDefaultProps=void((e=t.prototype)._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0),t}();function Se(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 St=2*Math.PI;function Sn(e){return(e%=St)<0&&(e+=St),e}var Si=2*Math.PI;function Sr(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 So=w7.CMD,Sa=2*Math.PI,Ss=[-1,-1,-1],Sl=[-1,-1];function Su(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,_,C,M,A,k,T,I=s[f++],D=1===f;switch(I===So.M&&f>1&&!n&&(u+=Sr(c,h,d,p,i,r)),D&&(c=s[f],h=s[f+1],d=c,p=h),I){case So.M:d=s[f++],p=s[f++],c=d,h=p;break;case So.L:if(n){if(Se(c,h,s[f],s[f+1],t,i,r))return!0}else u+=Sr(c,h,s[f],s[f+1],i,r)||0;c=s[f++],h=s[f++];break;case So.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;bk[0]=l,bk[1]=u;for(var v=0;v<1;v+=.05)bT[0]=bR(e,n,r,a,v),bT[1]=bR(t,i,o,s,v),(p=bc(bk,bT))<m&&(c=v,m=p);m=1/0;for(var y=0;y<32&&!(g<1e-4);y++)h=c-g,d=c+g,bT[0]=bR(e,n,r,a,h),bT[1]=bR(t,i,o,s,h),p=bc(bT,bk),h>=0&&p<m?(c=h,m=p):(bI[0]=bR(e,n,r,a,d),bI[1]=bR(t,i,o,s,d),f=bc(bI,bk),d<=1&&f<m?(c=d,m=f):g*=.5);return bC(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=bE(t,i,o,s,u,Ss);if(0===c)return 0;for(var h=0,d=-1,p=void 0,f=void 0,g=0;g<c;g++){var m=Ss[g],v=0===m||1===m?.5:1;bR(e,n,r,a,m)<l||(d<0&&(d=bL(t,i,o,s,Sl),Sl[1]<Sl[0]&&d>1&&function(){var e=Sl[0];Sl[0]=Sl[1],Sl[1]=e}(),p=bR(t,i,o,s,Sl[0]),d>1&&(f=bR(t,i,o,s,Sl[1]))),2===d?m<Sl[0]?h+=p<t?v:-v:m<Sl[1]?h+=f<p?v:-v:h+=s<f?v:-v:m<Sl[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 So.Q:if(n){if(_=c,C=h,M=s[f++],A=s[f++],k=s[f],T=s[f+1],0!==t&&(!(r>C+t)||!(r>A+t)||!(r>T+t))&&(!(r<C-t)||!(r<A-t)||!(r<T-t))&&(!(i>_+t)||!(i>M+t)||!(i>k+t))&&(!(i<_-t)||!(i<M-t)||!(i<k-t))&&function(e,t,n,i,r,o,a,s){var l,u=.005,c=1/0;bk[0]=a,bk[1]=s;for(var h=0;h<1;h+=.05){bT[0]=bB(e,n,r,h),bT[1]=bB(t,i,o,h);var d=bc(bk,bT);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;bT[0]=bB(e,n,r,f),bT[1]=bB(t,i,o,f);var d=bc(bT,bk);if(f>=0&&d<c)l=f,c=d;else{bI[0]=bB(e,n,r,g),bI[1]=bB(t,i,o,g);var m=bc(bI,bk);g<=1&&m<c?(l=g,c=m):u*=.5}}return bC(c)}(_,C,M,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(bD(o)){if(bO(a)){var u=-s/a;u>=0&&u<=1&&(r[l++]=u)}}else{var c=a*a-4*o*s;if(bD(c)){var u=-a/(2*o);u>=0&&u<=1&&(r[l++]=u)}else if(c>0){var h=bC(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,Ss);if(0===l)return 0;var u=bF(t,i,o);if(u>=0&&u<=1){for(var c=0,h=bB(t,i,o,u),d=0;d<l;d++){var p=0===Ss[d]||1===Ss[d]?.5:1,f=bB(e,n,r,Ss[d]);f<a||(Ss[d]<u?c+=h<t?p:-p:c+=o<h?p:-p)}return c}var p=0===Ss[0]||1===Ss[0]?.5:1,f=bB(e,n,r,Ss[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 So.A:var O=s[f++],R=s[f++],P=s[f++],E=s[f++],L=s[f++],N=s[f++];f+=1;var B=!!(1-s[f++]);o=Math.cos(L)*P+O,a=Math.sin(L)*E+R,D?(d=o,p=a):u+=Sr(c,h,o,a,i,r);var z=(i-O)*E/P+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)%Si<1e-4)return!0;if(o){var c=i;i=Sn(r),r=Sn(c)}else i=Sn(i),r=Sn(r);i>r&&(r+=Si);var h=Math.atan2(l,s);return h<0&&(h+=Si),h>=i&&h<=r||h+Si>=i&&h+Si<=r}(O,R,E,L,L+N,B,t,z,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);Ss[0]=-l,Ss[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=Sa-1e-4){i=0,r=Sa;var c=o?1:-1;return a>=Ss[0]+e&&a<=Ss[1]+e?c:0}if(i>r){var h=i;i=r,r=h}i<0&&(i+=Sa,r+=Sa);for(var d=0,p=0;p<2;p++){var f=Ss[p];if(f+e>a){var g=Math.atan2(s,f),c=o?1:-1;g<0&&(g=Sa+g),(g>=i&&g<=r||g+Sa>=i&&g+Sa<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),d+=c)}}return d}(O,R,E,L,L+N,B,z,r);c=Math.cos(L+N)*P+O,h=Math.sin(L+N)*E+R;break;case So.R:d=c=s[f++],p=h=s[f++];var F=s[f++],V=s[f++];if(o=d+F,a=p+V,n){if(Se(d,p,o,p,t,i,r)||Se(o,p,o,a,t,i,r)||Se(o,a,d,a,t,i,r)||Se(d,a,d,p,t,i,r))return!0}else u+=Sr(o,p,o,a,i,r),u+=Sr(d,a,d,p,i,r);break;case So.Z:if(n){if(Se(c,h,d,p,t,i,r))return!0}else u+=Sr(c,h,d,p,i,r);c=d,h=p}}return n||1e-4>Math.abs(h-p)||(u+=Sr(c,h,d,p,i,r)||0),0!==u}var Sc=vm({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},wk),Sh={style:vm({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},wT.style)},Sd=bw.concat(["invisible","culling","z","z2","zlevel","parent"]);let Sp=function(e){var t;function n(t){return e.call(this,t)||this}return xA(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<Sd.length;++s)r[Sd[s]]=this[Sd[s]];r.__dirty|=1}else this._decalEl&&(this._decalEl=null)},n.prototype.getDecalElement=function(){return this._decalEl},n.prototype._init=function(t){var n=vC(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?vg(this.style,a):this.useStyle(a):"shape"===o?vg(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(vI(e)){var t=b9(e,0);return t>.5?wg:t>.2?"#eee":wm}else if(e)return wm}return wg},n.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(vI(t)){var n=this.__zr;if(!!(n&&n.isDarkMode())==.4>b9(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 w7(!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)),Su(o,a/s,!0,e,t)))return!0}if(this.hasFill())return Su(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:vg(n,e),this.dirtyShape(),this},n.prototype.shapeChanged=function(){return!!(4&this.__dirty)},n.prototype.createStyle=function(e){return vZ(Sc,e)},n.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=vg({},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=vg({},i.shape),vg(s,n.shape)):(s=vg({},r?this.shape:i.shape),vg(s,n.shape)):l&&(s=i.shape),s)if(o){this.shape=vg({},this.shape);for(var u={},c=vC(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 Sh},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 xA(n,t),n.prototype.getDefaultStyle=function(){return vp(e.style)},n.prototype.getDefaultShape=function(){return vp(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}(wO);var Sf=vm({strokeFirst:!0,font:m8,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},Sc),Sg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xA(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 vZ(Sf,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=xJ(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}(wO);Sg.prototype.type="tspan";var Sm=vm({x:0,y:0},wk),Sv={style:vm({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},wT.style)},Sy=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xA(t,e),t.prototype.createStyle=function(e){return vZ(Sm,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 Sv},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new xZ(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(wO);Sy.prototype.type="image";let Sx=Sy;var Sb=Math.round;function Sw(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&&(Sb(2*i)===Sb(2*r)&&(e.x1=e.x2=S_(i,s,!0)),Sb(2*o)===Sb(2*a)&&(e.y1=e.y2=S_(o,s,!0))),e}}function SS(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=S_(i,s,!0),e.y=S_(r,s,!0),e.width=Math.max(S_(i+o,s,!1)-e.x,+(0!==o)),e.height=Math.max(S_(r+a,s,!1)-e.y,+(0!==a))),e}}function S_(e,t,n){if(!t)return e;var i=Sb(2*e);return(i+Sb(t))%2==0?i/2:(i+(n?1:-1))/2}var SC=function(){this.x=0,this.y=0,this.width=0,this.height=0},SM={},SA=function(e){function t(t){return e.call(this,t)||this}return xA(t,e),t.prototype.getDefaultShape=function(){return new SC},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=SS(SM,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}(Sp);SA.prototype.type="rect";let Sk=SA;var ST={fill:"#000"},SI={style:vm({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},wT.style)},SD=function(e){function t(t){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=ST,n.attr(t),n}return xA(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,SL(e=this.style),vb(e.rich,SL),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 xZ(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||ST},t.prototype.setTextContent=function(e){},t.prototype._mergeStyle=function(e,t){if(!t)return e;var n=t.rich,i=e.rich||n&&{};return vg(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=vC(t),i=0;i<n.length;i++){var r=n[i];e[r]=e[r]||{},vg(e[r],t[r])}},t.prototype.getAnimationStyleProps=function(){return SI},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||m8,n=e.padding,i=function(e,t){null!=e&&(e+="");var n,i=t.overflow,r=t.padding,o=t.font,a=x2(o),s=vz(t.lineHeight,a),l=!!t.backgroundColor,u="truncate"===t.lineOverflow,c=t.width,h=(n=null!=c&&("break"===i||"breakAll"===i)?e?bi(e,t.font,c,"breakAll"===i,0).lines:[]:e?e.split("\n"):[]).length*s,d=vz(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=x6(c,o,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),g=0;g<n.length;g++)n[g]=x8(n[g],f);for(var m=d,v=0,g=0;g<n.length;g++)v=Math.max(xK(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}}(SF(e),e),r=SV(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=x1(p,i.contentHeight,g);if(r||n){var y=x0(d,s,f),x=x1(p,a,g);r&&this._renderBackground(e,e,y,x,s,a)}v+=c/2,n&&(m=Sz(d,f,n),"top"===g?v+=n[0]:"bottom"===g&&(v-=n[2]));for(var b=0,w=!1,S=SB("fill"in e?e.fill:(w=!0,h.fill)),_=SN("stroke"in e?e.stroke:o||h.autoStroke&&!w?null:(b=2,h.stroke)),C=e.textShadowBlur>0,M=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(Sg),I=T.createStyle();T.useStyle(I),I.text=u[k],I.x=m,I.y=v,f&&(I.textAlign=f),I.textBaseline="middle",I.opacity=e.opacity,I.strokeFirst=!0,C&&(I.shadowBlur=e.textShadowBlur||0,I.shadowColor=e.textShadowColor||"transparent",I.shadowOffsetX=e.textShadowOffsetX||0,I.shadowOffsetY=e.textShadowOffsetY||0),I.stroke=_,I.fill=S,_&&(I.lineWidth=e.lineWidth||b,I.lineDash=e.lineDash,I.lineDashOffset=e.lineDashOffset||0),I.font=t,SE(I,e),v+=c,M&&T.setBoundingRect(new xZ(x0(I.x,e.width,I.textAlign),x1(I.y,A,I.textBaseline),l,A))}},t.prototype._updateRichTexts=function(){var e=this.style,t=function(e,t){var n,i=new be;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=x4.lastIndex=0;null!=(n=x4.exec(e));){var u=n.index;u>l&&bt(i,e.substring(l,u),t,s),bt(i,n[2],t,s,n[1]),l=x4.lastIndex}l<e.length&&bt(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]||{},C=S.textPadding=_.padding,M=C?C[1]+C[3]:0,A=S.font=_.font||t.font;S.contentHeight=x2(A);var k=vz(_.height,S.contentHeight);if(S.innerHeight=k,C&&(k+=C[0]+C[2]),S.height=k,S.lineHeight=vF(_.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,I=null==T||"auto"===T;if("string"==typeof T&&"%"===T.charAt(T.length-1))S.percentWidth=T,c.push(S),S.contentWidth=xK(S.text,A);else{if(I){var D=_.backgroundColor,O=D&&D.image;O&&xP(O=function(e){if("string"!=typeof e)return e;var t=xD.get(e);return t&&t.image}(O))&&(S.width=Math.max(S.width,O.width*k/O.height))}var R=f&&null!=r?r-b:null;null!=R&&R<S.width?!I||R<M?(S.text="",S.width=S.contentWidth=0):(S.text=function(e,t,n,i,r){if(!t)return"";var o=(e+"").split("\n");r=x6(t,n,i,r);for(var a=0,s=o.length;a<s;a++)o[a]=x8(o[a],r);return o.join("\n")}(S.text,R-M,A,t.ellipsis,{minChar:t.truncateMinChar}),S.width=S.contentWidth=xK(S.text,A)):S.contentWidth=xK(S.text,A)}S.width+=M,b+=S.width,_&&(x=Math.max(x,S.lineHeight))}m(y,b,x)}i.outerWidth=i.width=vz(r,d),i.outerHeight=i.height=vz(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],P=S.percentWidth;S.width=parseInt(P,10)/100*i.width}return i}(SF(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=x0(a,i,u),d=x1(s,r,c),p=h,f=d;o&&(p+=o[3],f+=o[0]);var g=p+n;SV(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,C=p,M=g,A=b-1,k=void 0;_<b&&(!(k=x[_]).align||"left"===k.align);)this._placeToken(k,e,w,f,C,"left",m),S-=k.width,C+=k.width,_++;for(;A>=0&&"right"===(k=x[A]).align;)this._placeToken(k,e,w,f,M,"right",m),S-=k.width,M-=k.width,A--;for(C+=(n-(C-p)-(g-M)-S)/2;_<=A;)k=x[_],this._placeToken(k,e,w,f,C+k.width/2,"center",m),C+=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&&SV(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=Sz(r,o,h),u-=e.height/2-h[0]-e.innerHeight/2);var d=this._getOrCreateChild(Sg),p=d.createStyle();d.useStyle(p);var f=this._defaultStyle,g=!1,m=0,v=SB("fill"in s?s.fill:"fill"in t?t.fill:(g=!0,f.fill)),y=SN("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||m8,p.opacity=vF(s.opacity,t.opacity,1),SE(p,s),y&&(p.lineWidth=vF(s.lineWidth,t.lineWidth,m),p.lineDash=vz(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 xZ(x0(p.x,b,p.textAlign),x1(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(Sk)).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=vz(e.fillOpacity,1)}else if(h){(s=this._getOrCreateChild(Sx)).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=vz(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=vF(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&&vW(i)||e.textFont||e.font},t}(wO),SO={left:!0,right:1,center:1},SR={top:1,bottom:1,middle:1},SP=["fontStyle","fontWeight","fontSize","fontFamily"];function SE(e,t){for(var n=0;n<SP.length;n++){var i=SP[n],r=t[i];null!=r&&(e[i]=r)}}function SL(e){if(e){e.font=SD.makeFont(e);var t=e.align;"middle"===t&&(t="center"),e.align=null==t||SO[t]?t:"left";var n=e.verticalAlign;"center"===n&&(n="middle"),e.verticalAlign=null==n||SR[n]?n:"top",e.padding&&(e.padding=vj(e.padding))}}function SN(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function SB(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function Sz(e,t,n){return"right"===t?e-n[1]:"center"===t?e+n[3]/2-n[1]/2:e+n[3]}function SF(e){var t=e.text;return null!=t&&(t+=""),t}function SV(e){return!!(e.backgroundColor||e.lineHeight||e.borderWidth&&e.borderColor)}let Sj=SD;var SH=yb(),SW=function(e,t,n,i){if(i){var r=SH(i);r.dataIndex=n,r.dataType=t,r.seriesIndex=e,r.ssrType="chart","group"===i.type&&i.traverse(function(i){var r=SH(i);r.seriesIndex=e,r.dataIndex=n,r.dataType=t,r.ssrType="chart"})}},S$=1,SG={},SU=yb(),Sq=yb(),SY=["emphasis","blur","select"],SZ=["normal","emphasis","blur","select"],SX="highlight",SK="downplay",SQ="select",SJ="unselect",S0="toggleSelect";function S1(e){return null!=e&&"none"!==e}function S2(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function S5(e){S2(e,"emphasis",2)}function S3(e){2===e.hoverState&&S2(e,"normal",0)}function S4(e){S2(e,"blur",1)}function S6(e){1===e.hoverState&&S2(e,"normal",0)}function S8(e){e.selected=!0}function S9(e){e.selected=!1}function S7(e,t,n){t(e,n),e.isGroup&&e.traverse(function(e){t(e,n)})}function _e(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 _t(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&&vv(t,"select")>=0,r=!1;if(e instanceof Sp){var o=SU(e),a=i&&o.selectFill||o.normalFill,s=i&&o.selectStroke||o.normalStroke;if(S1(a)||S1(s)){var l=(n=n||{}).style||{};"inherit"===l.fill?(r=!0,n=vg({},n),(l=vg({},l)).fill=a):!S1(l.fill)&&S1(a)?(r=!0,n=vg({},n),(l=vg({},l)).fill=we(a)):!S1(l.stroke)&&S1(s)&&(r||(n=vg({},n),l=vg({},l)),l.stroke=we(s)),n.style=l}}if(n&&null==n.z2){r||(n=vg({},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=vv(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=vg({},n),a=vg({opacity:i?r:.1*o.opacity},a),n.style=a),n;else if("select"===e){var l=s;if(l&&null==l.z2){l=vg({},l);var u=this.z2SelectLift;l.z2=this.z2+(null!=u?u:9)}return l}}return s}function _n(e){e.stateProxy=_t;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=_t),n&&(n.stateProxy=_t)}function _i(e,t){_s(e,t)||e.__highByOuter||S7(e,S5)}function _r(e,t){_s(e,t)||e.__highByOuter||S7(e,S3)}function _o(e,t){e.__highByOuter|=1<<(t||0),S7(e,S5)}function _a(e,t){(e.__highByOuter&=~(1<<(t||0)))||S7(e,S3)}function _s(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function _l(e){var t=e.getModel(),n=[],i=[];t.eachComponent(function(t,r){var o=Sq(r),a="series"===t,s=a?e.getViewOfSeriesModel(r):e.getViewOfComponentModel(r);a||i.push(s),o.isBlured&&(s.group.traverse(function(e){S6(e)}),a&&n.push(r)),o.isBlured=!1}),vb(i,function(e){e&&e.toggleBlurSeries&&e.toggleBlurSeries(n,!1,t)})}function _u(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&&S7(i,S6)}}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||S4(e)}),vx(t))o(e.getData(),t);else if(vR(t))for(var h=vC(t),d=0;d<h.length;d++)o(e.getData(h[d]),t[h[d]]);l.push(e),Sq(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 _c(e,t,n){if(null!=e&&null!=t){var i=n.getModel().getComponent(e,t);if(i){Sq(i).isBlured=!0;var r=n.getViewOfComponentModel(i);r&&r.focusBlurEnabled&&r.group.traverse(function(e){S4(e)})}}}function _h(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"===SH(l[u]).focus){r=!0;break}return{focusSelf:r,dispatchers:l}}function _d(e){vb(e.getAllData(),function(t){var n=t.data,i=t.type;n.eachItemGraphicEl(function(t,n){e.isSelected(n,i)?S7(t,S8):S7(t,S9)})})}function _p(e,t,n){var i,r,o,a;_y(e,!0),S7(e,_n),i=e,r=t,o=n,a=SH(i),null!=r?(a.focus=r,a.blurScope=o):a.focus&&(a.focus=null)}function _f(e,t,n,i){i?_y(e,!1):_p(e,t,n)}var _g=["emphasis","blur","select"],_m={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function _v(e,t,n,i){n=n||"itemStyle";for(var r=0;r<_g.length;r++){var o=_g[r],a=t.getModel([o,n]);e.ensureState(o).style=i?i(a):a[_m[n]]()}}function _y(e,t){var n=!1===t;e.highDownSilentOnTouch&&(e.__highDownSilentOnTouch=e.highDownSilentOnTouch),(!n||e.__highDownDispatcher)&&(e.__highByOuter=e.__highByOuter||0,e.__highDownDispatcher=!n)}function _x(e){return!!(e&&e.__highDownDispatcher)}function _b(e){var t=e.type;return t===SQ||t===SJ||t===S0}function _w(e){var t=e.type;return t===SX||t===SK}var _S=yb();function __(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=vz(i.duration,200),c=vz(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)),vT(h)&&(h=h(n,r)),vT(u)&&(u=u(n)),{duration:u||0,delay:h,easing:c}}function _C(e,t,n,i,r,o,a){var s,l=!1;vT(r)?(a=o,o=r,r=null):vR(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=__(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 _M(e,t,n,i,r,o){_C("update",e,t,n,i,r,o)}function _A(e,t,n,i,r,o){_C("enter",e,t,n,i,r,o)}function _k(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 _T(e,t,n,i,r,o){_k(e)||_C("leave",e,t,n,i,r,o)}function _I(e,t,n,i){e.removeTextContent(),e.removeTextGuideLine(),_T(e,{style:{opacity:0}},t,n,i)}function _D(e,t,n){function i(){e.parent&&e.parent.remove(e)}e.isGroup?e.traverse(function(e){e.isGroup||_I(e,t,n,i)}):_I(e,t,n,i)}function _O(e){_S(e).oldStyle=e.style}var _R={};function _P(e,t){for(var n=0;n<SY.length;n++){var i=SY[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 _E(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=vT(e.defaultText)?e.defaultText(o,e,n):e.defaultText);for(var l={normal:i},u=0;u<SY.length;u++){var c=SY[u],h=t[c];l[c]=vz(r?r.getFormattedLabel(o,c,null,a,h&&h.get("formatter")):null,i)}return l}function _L(e,t,n,i){n=n||_R;for(var r=e instanceof Sj,o=!1,a=0;a<SZ.length;a++){var s=t[SZ[a]];if(s&&s.getShallow("show")){o=!0;break}}var l=r?e:e.getTextContent();if(o){!r&&(l||(l=new Sj,e.setTextContent(l)),e.stateProxy&&(l.stateProxy=e.stateProxy));var u=_E(n,t),c=t.normal,h=!!c.getShallow("show"),d=_B(c,i&&i.normal,n,!1,!r);d.text=u.normal,r||e.setTextConfig(_z(c,n,!1));for(var a=0;a<SY.length;a++){var p=SY[a],s=t[p];if(s){var f=l.ensureState(p),g=!!vz(s.getShallow("show"),h);g!==h&&(f.ignore=!g),f.style=_B(s,i&&i[p],n,!0,!r),f.style.text=u[p],r||(e.ensureState(p).textConfig=_z(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&&(_$(l).setLabelText=function(e){var i=_E(n,t,e);_P(l,i)})}else l&&(l.ignore=!0);e.dirty()}function _N(e,t){t=t||"label";for(var n={normal:e.getModel(t)},i=0;i<SY.length;i++){var r=SY[i];n[r]=e.getModel([r,t])}return n}function _B(e,t,n,i,r){var o={};return function(e,t,n,i,r){n=n||_R;var o,a=t.ecModel,s=a&&a.option.textStyle,l=function(e){for(var t;e&&e!==e.ecModel;){var n=(e.option||_R).rich;if(n){t=t||{};for(var i=vC(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]);_H(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),_H(e,t,s,n,i,r,!0,!1)}(o,e,n,i,r),t&&vg(o,t),o}function _z(e,t,n){t=t||{};var i,r={},o=e.getShallow("rotate"),a=vz(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 _F=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],_V=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],_j=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function _H(e,t,n,i,r,o,a,s){n=!r&&n||_R;var l=i&&i.inheritColor,u=t.getShallow("color"),c=t.getShallow("textBorderColor"),h=vz(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=vz(t.getShallow("textBorderWidth"),n.textBorderWidth);null!=d&&(e.lineWidth=d);var p=vz(t.getShallow("textBorderType"),n.textBorderType);null!=p&&(e.lineDash=p);var f=vz(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<_F.length;g++){var m=_F[g],v=vz(t.getShallow(m),n[m]);null!=v&&(e[m]=v)}for(var g=0;g<_V.length;g++){var m=_V[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<_j.length;g++){var m=_j[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 _W(e,t){var n=t&&t.getModel("textStyle");return vW([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 _$=yb();function _G(e,t,n,i){if(e){var r=_$(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 _U=["textStyle","color"],_q=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],_Y=new Sj,_Z=function(){function e(){}return e.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(_U):null)},e.prototype.getFont=function(){return _W({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<_q.length;n++)t[_q[n]]=this.getShallow(_q[n]);return _Y.useStyle(t),_Y.update(),_Y.getBoundingRect()},e}(),_X=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],_K=xS(_X),_Q=function(){function e(){}return e.prototype.getLineStyle=function(e){return _K(this,e)},e}(),_J=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],_0=xS(_J),_1=function(){function e(){}return e.prototype.getItemStyle=function(e,t){return _0(this,e,t)},e}(),_2=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){vf(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(vp(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(!ys.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}();xm(_2),w=["__\0is_clz",xy++].join("_"),_2.prototype[w]=!0,_2.isInstance=function(e){return!!(e&&e[w])},vy(_2,_Q),vy(_2,_1),vy(_2,xC),vy(_2,_Z);var _5=Math.round(10*Math.random());function _3(e){return[e||"",_5++].join("_")}function _4(e,t){return vf(vf({},e,!0),t,!0)}var _6=Math.log(2);function _8(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)/_6);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]*_8(e,t-1,c,u,r|f,o),p++)}return o[a]=h,h}function _9(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=_8(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)*_8(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 _7="___zrEVENTSAVED",Ce=[];function Ct(e,t,n,i,r){if(t.getBoundingClientRect&&ys.domSupported&&!Cn(t)){var o=t[_7]||(t[_7]={}),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?_9(s,a):_9(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 Cn(e){return"CANVAS"===e.nodeName.toUpperCase()}var Ci=/([&<>"'])/g,Cr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Co(e){return null==e?"":(e+"").replace(Ci,function(e,t){return Cr[t]})}var Ca={},Cs={},Cl=ys.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage||"EN").toUpperCase().indexOf("ZH")>-1?"ZH":"EN";function Cu(e,t){Cs[e=e.toUpperCase()]=new _2(t),Ca[e]=t}Cu("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:". "}}}}),Cu("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 Cc={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}"},Ch="{yyyy}-{MM}-{dd}",Cd={year:"{yyyy}",month:"{yyyy}-{MM}",day:Ch,hour:Ch+" "+Cc.hour,minute:Ch+" "+Cc.minute,second:Ch+" "+Cc.second,millisecond:Cc.none},Cp=["year","month","day","hour","minute","second","millisecond"],Cf=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Cg(e,t){return e+="","0000".substr(0,t-e.length)+e}function Cm(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 Cv(e,t,n,i){var r=v7(e),o=r[Cb(n)](),a=r[Cw(n)]()+1,s=Math.floor((a-1)/3)+1,l=r[CS(n)](),u=r["get"+(n?"UTC":"")+"Day"](),c=r[C_(n)](),h=(c-1)%12+1,d=r[CC(n)](),p=r[CM(n)](),f=r[CA(n)](),g=(i instanceof _2?i:Cs[i||Cl]||Cs.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,Cg(o%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,m[a-1]).replace(/{MMM}/g,v[a-1]).replace(/{MM}/g,Cg(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,Cg(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,y[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Cg(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,Cg(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,Cg(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,Cg(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,Cg(f,3)).replace(/{S}/g,f+"")}function Cy(e,t){var n=v7(e),i=n[Cw(t)]()+1,r=n[CS(t)](),o=n[C_(t)](),a=n[CC(t)](),s=n[CM(t)](),l=0===n[CA(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 Cx(e,t,n){var i=vO(e)?v7(e):e;switch(t=t||Cy(e,n)){case"year":return i[Cb(n)]();case"half-year":return+(i[Cw(n)]()>=6);case"quarter":return Math.floor((i[Cw(n)]()+1)/4);case"month":return i[Cw(n)]();case"day":return i[CS(n)]();case"half-day":return i[C_(n)]()/24;case"hour":return i[C_(n)]();case"minute":return i[CC(n)]();case"second":return i[CM(n)]();case"millisecond":return i[CA(n)]()}}function Cb(e){return e?"getUTCFullYear":"getFullYear"}function Cw(e){return e?"getUTCMonth":"getMonth"}function CS(e){return e?"getUTCDate":"getDate"}function C_(e){return e?"getUTCHours":"getHours"}function CC(e){return e?"getUTCMinutes":"getMinutes"}function CM(e){return e?"getUTCSeconds":"getSeconds"}function CA(e){return e?"getUTCMilliseconds":"getMilliseconds"}function Ck(e){return e?"setUTCMonth":"setMonth"}function CT(e){return e?"setUTCDate":"setDate"}function CI(e){return e?"setUTCHours":"setHours"}function CD(e){return e?"setUTCMinutes":"setMinutes"}function CO(e){return e?"setUTCSeconds":"setSeconds"}function CR(e){return e?"setUTCMilliseconds":"setMilliseconds"}function CP(e){if(isNaN(yi(e)))return vI(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function CE(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 CL(e,t,n){function i(e){return e&&vW(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?v7(e):e;if(!isNaN(+s))return Cv(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===t)return vD(e)?i(e):vO(e)&&r(e)?e+"":"-";var l=yi(e);return r(l)?CP(l):vD(e)?i(e):"boolean"==typeof e?e+"":"-"}var CN=["a","b","c","d","e","f","g"],CB=function(e,t){return"{"+e+(null==t?"":t)+"}"};function Cz(e,t,n){vk(t)||(t=[t]);var i=t.length;if(!i)return"";for(var r=t[0].$vars||[],o=0;o<r.length;o++){var a=CN[o];e=e.replace(CB(a),CB(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(CB(CN[l],s),n?Co(u):u)}return e}function CF(e,t){return t=t||"transparent",vI(e)?e:vR(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function CV(e,t){if("_blank"===t||"blank"===t){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}var Cj=["left","right","top","bottom","width","height"],CH=[["width","left","right"],["height","top","bottom"]];function CW(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 C$(e,t,n){n=vj(n||0);var i=t.width,r=t.height,o=v1(e.left,i),a=v1(e.top,r),s=v1(e.right,i),l=v1(e.bottom,r),u=v1(e.width,i),c=v1(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 xZ(o+n[3],a+n[0],u,c);return f.margin=n,f}function CG(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 xZ(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=C$(vm({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 CU(e){var t=e.layoutMode||e.constructor.layoutMode;return vR(t)?t:t?{type:t}:null}function Cq(e,t,n){var i=n&&n.ignoreSize;vk(i)||(i=[i,i]);var r=a(CH[0],0),o=a(CH[1],1);function a(n,r){var o={},a=0,u={},c=0;if(vb(n,function(t){u[t]=e[t]}),vb(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){vb(e,function(e){t[e]=n[e]})}u(CH[0],e,r),u(CH[1],e,o)}function CY(e){var t,n;return t={},(n=e)&&t&&vb(Cj,function(e){n.hasOwnProperty(e)&&(t[e]=n[e])}),t}vA(CW,"vertical"),vA(CW,"horizontal");var CZ=yb(),CX=function(e){var t;function n(t,n,i){var r=e.call(this,t,n,i)||this;return r.uid=_3("ec_cpt_model"),r}return xd(n,e),n.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},n.prototype.mergeDefaultAndTheme=function(e,t){var n=CU(this),i=n?CY(e):{};vf(e,t.getTheme().get(this.mainType)),vf(e,this.getDefaultOption()),n&&Cq(e,i,n)},n.prototype.mergeOption=function(e,t){vf(this.option,e,!0);var n=CU(this);n&&Cq(this.option,e,n)},n.prototype.optionUpdated=function(e,t){},n.prototype.getDefaultOption=function(){var e=this.constructor;if(!(e&&e[xf]))return e.defaultOption;var t=CZ(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=vf(o,n[a],!0);t.defaultOption=o}return t.defaultOption},n.prototype.getReferringComponents=function(e,t){return yA(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}(_2);xv(CX,_2),xw(CX),S={},CX.registerSubTypeDefaulter=function(e,t){S[xg(e).main]=t},CX.determineSubType=function(e,t){var n=t.type;if(!n){var i=xg(e).main;CX.hasSubTypes(e)&&S[i]&&(n=S[i](t))}return n};var CK=function(e){var t=[];return vb(CX.getClassesByMainType(e),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=vw(t,function(e){return xg(e).main}),"dataset"!==e&&0>=vv(t,"dataset")&&t.unshift("dataset"),t};function CQ(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}CX.topologicalTravel=function(e,t,n,i){if(e.length){var r,o,a,s=(o={},a=[],vb(r=t,function(e){var t,n,i,s=CQ(o,e),l=(t=s.originalDeps=CK(e),n=r,i=[],vb(t,function(e){vv(n,e)>=0&&i.push(e)}),i);s.entryCount=l.length,0===s.entryCount&&a.push(e),vb(l,function(t){0>vv(s.predecessor,t)&&s.predecessor.push(t);var n=CQ(o,t);0>vv(n.successor,t)&&n.successor.push(e)})}),{graph:o,noEntryList:a}),l=s.graph,u=s.noEntryList,c={};for(vb(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]),vb(d.successor,p?g:f)}vb(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 CJ=yb();yb();var C0=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,CJ,yc(this.get("color",!0)),this.get("colorLayer",!0),e,t,n)},e.prototype.clearColorPalette=function(){var e,t;e=this,(t=CJ)(e).paletteIdx=0,t(e).paletteNameMap={}},e}(),C1=function(){var e;function t(e,t){var n=y$(e)?e:yU(e);this._source=n;var i=this._data=n.data;n.sourceFormat===yE&&(this._offset=0,this._dimSize=t,this._data=i),F(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(){F=function(e,r,o){var a=o.sourceFormat,s=o.seriesLayoutBy,l=o.startIndex,u=o.dimensionsDefine;vg(e,z[C9(a,s)]),a===yE?(e.getItem=t,e.count=i,e.fillStorage=n):(e.getItem=vM(function(e,t){return C5[C9(e,t)]}(a,s),null,r,l,u),e.count=vM(function(e,t){return C4[C9(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={})[yO+"_"+yN]={pure:!0,appendData:r},e[yO+"_row"]={pure:!0,appendData:function(){throw Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[yR]={pure:!0,appendData:r},e[yP]={pure:!0,appendData:function(e){var t=this._data;vb(e,function(e,n){for(var i=t[n]||(t[n]=[]),r=0;r<(e||[]).length;r++)i.push(e[r])})}},e[yD]={appendData:r},e[yE]={persistent:!1,pure:!0,appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},z=e}(),t}(),C2=function(e,t,n,i){return e[i]},C5=((L={})[yO+"_"+yN]=function(e,t,n,i){return e[i+t]},L[yO+"_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[yR]=C2,L[yP]=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[yD]=C2,L),C3=function(e,t,n){return e.length},C4=((N={})[yO+"_"+yN]=function(e,t,n){return Math.max(0,e.length-t)},N[yO+"_row"]=function(e,t,n){var i=e[0];return i?Math.max(0,i.length-t):0},N[yR]=C3,N[yP]=function(e,t,n){var i=e[n[0].name];return i?i.length:0},N[yD]=C3,N),C6=function(e,t,n){return e[t]},C8=((B={})[yO]=C6,B[yR]=function(e,t,n){return e[n]},B[yP]=C6,B[yD]=function(e,t,n){var i=yp(e);return i instanceof Array?i[t]:i},B[yE]=C6,B);function C9(e,t){return e===yO?e+"_"+t:e}function C7(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 C8[o](i,a,s)}var l=i;return o===yD&&(l=yp(i)),l}}}var Me=/\{@(.+?)\}/g,Mt=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&&vk(s.value)&&(s.value=s.value[i]),r||(r=a.getItemModel(e).get("normal"===t?["label","formatter"]:[t,"label","formatter"])),vT(r))?(s.status=t,s.dimensionIndex=i,r(s)):vI(r)?Cz(r,s).replace(Me,function(t,n){var i=n.length,r=n;"["===r.charAt(0)&&"]"===r.charAt(i-1)&&(r=+r.slice(1,i-1));var s=C7(a,e,r);if(o&&vk(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 C7(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function Mn(e){var t,n;return vR(e)?e.type&&(n=e):t=e,{text:t,frag:n}}function Mi(e){return new Mr(e)}var Mr=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(vk(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){Mo.reset(t,n,i,r),this._callingProgress=e,this._callingProgress({start:t,end:n,count:n-t,next:Mo.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),vk(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}(),Mo=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 Ma(e){throw Error(e)}function Ms(e,t){var n=t&&t.type;return"ordinal"===n?e:("time"!==n||vO(e)||null==e||"-"===e||(e=+v7(e)),null==e||""===e?NaN:+e)}vY({number:function(e){return parseFloat(e)},time:function(e){return+v7(e)},trim:function(e){return vI(e)?vW(e):e}});var Ml={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){vO(t)||Ma(""),this._opFn=Ml[e],this._rvalFloat=yi(t)}).prototype.evaluate=function(e){return vO(e)?this._opFn(e,this._rvalFloat):this._opFn(yi(e),this._rvalFloat)};var Mu=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=vO(e)?e:yi(e),i=vO(t)?t:yi(t),r=isNaN(n),o=isNaN(i);if(r&&(n=this._incomparable),o&&(i=this._incomparable),r&&o){var a=vI(e),s=vI(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=yi(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=yi(e)===this._rvalFloat)}return this._isEQ?t:!t};var Mc=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 Ms(e,t)},e}();function Mh(e){return Mm(e.sourceFormat)||Ma(""),e.data}function Md(e){var t=e.sourceFormat,n=e.data;if(Mm(t)||Ma(""),t===yO){for(var i=[],r=0,o=n.length;r<o;r++)i.push(n[r].slice());return i}if(t===yR){for(var i=[],r=0,o=n.length;r<o;r++)i.push(vg({},n[r]));return i}}function Mp(e,t,n){if(null!=n){if(vO(n)||!isNaN(n)&&!vK(t,n))return e[n];else if(vK(t,n))return t[n]}}function Mf(e){return vp(e)}var Mg=vY();function Mm(e){return e===yO||e===yR}var Mv="undefined",My=typeof Uint32Array===Mv?Array:Uint32Array,Mx=typeof Uint16Array===Mv?Array:Uint16Array,Mb=typeof Int32Array===Mv?Array:Int32Array,Mw=typeof Float64Array===Mv?Array:Float64Array,MS={float:Mw,int:Mb,ordinal:Array,number:Array,time:Mw};function M_(e){return e>65535?My:Mx}function MC(){return[1/0,-1/0]}function MM(e,t,n,i,r){var o=MS[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 MA=function(){function e(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=vY()}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=[],yX(i),this._dimensions=vw(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 MS[t||"float"](this._rawCount),this._rawExtent[r]=MC(),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]=MC());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];MM(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=vw(o,function(e){return e.property}),u=0;u<a;u++){var c=o[u];s[u]||(s[u]=MC()),MM(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=M_(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(M_(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=vC(e),r=i.length;if(!r)return this;var o=t.count(),a=new(M_(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 C=i[_],m=h[C][w];(m<e[C][0]||m>e[C][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]]=MC();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(M_(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 C=-1,M=0,v=b;v<w;v++){var y=this.getRawIndex(v),x=a[y];if(isNaN(x)){M++,C<0&&(C=y);continue}(i=Math.abs((S-g)*(x-_)-(S-v)*(m-_)))>n&&(n=i,r=y)}M>0&&M<w-b&&(h[l++]=Math.min(C,r),r=Math.max(C,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]=MC(),h=new(M_(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=MC();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&&vS(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=vp(this._extent),e._rawExtent=vp(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 Ms(e[i],this._dimensions[i])}V={arrayRows:e,objectRows:function(e,t,n,i){return Ms(e[t],this._dimensions[i])},keyedColumns:e,original:function(e,t,n,i){var r=e&&(null==e.value?e:e.value);return Ms(r instanceof Array?r[i]:r,this._dimensions[i])},typedArray:function(e,t,n,i){return e[i]}}}(),e}(),Mk=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(MI(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=vE(o=n.get("data",!0))?yE:yD,t=[];var u=this._getSourceMetaRawOption()||{},c=s&&s.metaRawOption||{},h=vz(u.seriesLayoutBy,c.seriesLayoutBy)||null,d=vz(u.sourceHeader,c.sourceHeader),p=vz(u.dimensions,c.dimensions);e=h!==c.seriesLayoutBy||!!d!=!!c.sourceHeader||p?[yG(o,{seriesLayoutBy:h,sourceHeader:d,dimensions:p},a)]:[]}else if(r){var f=this._applyTransform(i);e=f.sourceList,t=f.upstreamSignList}else e=[yG(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&&MD("");var a=[],s=[];return(vb(e,function(e){e.prepareSource();var t=e.getSource(o||0);null==o||t||MD(""),a.push(t),s.push(e._getVersionSign())}),r)?n=function(e,t,n){var i=yc(e),r=i.length;r||Ma("");for(var o=0;o<r;o++)t=function(e,t){t.length||Ma(""),vR(e)||Ma("");var n=e.type,i=Mg.get(n);i||Ma("");var r=vw(t,function(e){return function(e,t){var n=new Mc,i=e.data,r=n.sourceFormat=e.sourceFormat,o=e.startIndex;e.seriesLayoutBy!==yN&&Ma("");var a=[],s={},l=e.dimensionsDefine;if(l)vb(l,function(e,t){var n=e.name,i={index:t,name:n,displayName:e.displayName};a.push(i),null!=n&&(vK(s,n)&&Ma(""),s[n]=i)});else for(var u=0;u<e.dimensionsDetectedCount||0;u++)a.push({index:u});var c=C5[C9(r,yN)];t.__isBuiltIn&&(n.getRawDataItem=function(e){return c(i,o,a,e)},n.getRawData=vM(Mh,null,e)),n.cloneRawData=vM(Md,null,e),n.count=vM(C4[C9(r,yN)],null,i,o,a);var h=C8[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=vM(Mp,null,a,s),n.cloneAllDimensionInfo=vM(Mf,null,a),n}(e,i)});return vw(yc(i.transform({upstream:r[0],upstreamList:r,config:vp(e.config)})),function(e,n){vR(e)||Ma(""),e.data||Ma(""),Mm(yq(e.data))||Ma("");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:yN,sourceHeader:o,dimensions:r.metaRawOption.dimensions}}else i={seriesLayoutBy:yN,sourceHeader:0,dimensions:e.dimensions};return yG(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 yW({data:(t=a[0]).data,sourceFormat:t.sourceFormat,seriesLayoutBy:t.seriesLayoutBy,dimensionsDefine:vp(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];MI(this._sourceHost)&&a?o=a._innerGetDataStore(e,t,n):(o=new MA).initData(new C1(t,e.length),e),r[n]=o}return o},e.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(MI(e)){var t=yV(e);return t?[t.getSourceManager()]:[]}return vw(e.get("transform",!0)||e.get("fromTransformResult",!0)?yA(e.ecModel,"dataset",{index:e.get("fromDatasetIndex",!0),id:e.get("fromDatasetId",!0)},yC).models:[],function(e){return e.getSourceManager()})},e.prototype._getSourceMetaRawOption=function(){var e,t,n,i=this._sourceHost;return MI(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 MT(e){e.option.transform&&(e.option.transform[v$]=!0)}function MI(e){return"series"===e.mainType}function MD(e){throw Error(e)}var MO="line-height:1";function MR(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:"+Co(i+"")+"px;color:"+Co(n)+";font-weight:"+Co(r+""),valueStyle:"font-size:"+Co(a+"")+"px;color:"+Co(o)+";font-weight:"+Co(s+"")}:{nameStyle:{fontSize:i,fill:n,fontWeight:r},valueStyle:{fontSize:a,fill:o,fontWeight:s}}}var MP=[0,10,20,30],ME=["","\n","\n\n","\n\n\n"];function ML(e,t){return t.type=e,t}function MN(e){return"section"===e.type}function MB(e,t,n,i){var r,o=t.noHeader,a={html:MP[r=function e(t){if(MN(t)){var n=0,i=t.blocks.length,r=i>1||i>0&&!t.noHeader;return vb(t.blocks,function(t){var i=e(t);i>=n&&(n=i+ +(r&&(!i||MN(t)&&!t.noHeader)))}),n}return 0}(t)],richText:ME[r]},s=[],l=t.blocks||[];vH(!l||vk(l)),l=l||[];var u=e.orderMode;if(t.sortBlocks&&u){l=l.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(vK(c,u)){var h=new Mu(c[u],null);l.sort(function(e,t){return h.evaluate(e.sortParam,t.sortParam)})}else"seriesDesc"===u&&l.reverse()}vb(l,function(n,r){var o=t.valueFormatter,l=(MN(n)?MB:Mz)(o?vg(vg({},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):MV(s.join(""),o?n:a.html);if(o)return d;var p=CL(t.header,"ordinal",e.useUTC),f=MR(i,e.renderMode).nameStyle;return"richText"===e.renderMode?Mj(e,p,f)+a.richText+d:MV('<div style="'+f+";"+MO+';">'+Co(p)+"</div>"+d,n)}function Mz(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 vw(e=vk(e)?e:[e],function(e,t){return CL(e,vk(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?"":CL(l,"ordinal",u),w=t.valueType,S=a?[]:c(t.value,t.dataIndex),_=!s||!o,C=!s&&o,M=MR(i,r),A=M.nameStyle,k=M.valueStyle;return"richText"===r?(s?"":x)+(o?"":Mj(e,b,A))+(a?"":(h=e,d=S,p=_,f=C,g=[k],p&&g.push({padding:[0,0,0,f?10:20],align:"right"}),h.markupStyleCreator.wrapRichTextStyle(vk(d)?d.join(" "):d,g))):MV((s?"":x)+(o?"":'<span style="'+A+";"+(s?"":"margin-left:2px")+'">'+Co(b)+"</span>")+(a?"":(m=S,v=_,y=C,'<span style="'+(v?"float:right;margin-left:"+(y?"10px":"20px"):"")+";"+k+'">'+vw(m=vk(m)?m:[m],function(e){return Co(e)}).join("&nbsp;&nbsp;")+"</span>")),n)}}function MF(e,t,n,i,r,o){if(e)return(MN(e)?MB:Mz)({useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,o)}function MV(e,t){return'<div style="margin: '+t+"px 0 0;"+MO+';">'+e+'<div style="clear:both"></div></div>'}function Mj(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function MH(e,t){var n=e.get("padding");return null!=n?n:"richText"===t?[8,10]:10}var MW=function(){function e(){this.richTextStyles={},this._nextStyleNameId=yr()}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=vI(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:'+Co(a)+";"+(r||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+Co(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 vI(c)?c:(this.richTextStyles[u]=c.style,c.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};vk(t)?vb(t,function(e){return vg(n,e)}):vg(n,t);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},e}(),M$=yb();function MG(e,t){return e.getName(t)||e.getId(t)}var MU=function(e){var t;function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return xd(n,e),n.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=Mi({count:MY,reset:MZ}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(M$(this).sourceManager=new Mk(this)).prepareSource();var i=this.getInitialData(e,n);MK(i,this),this.dataTask.context.data=i,M$(this).dataBeforeProcessed=i,Mq(this),this._initSelectedMapFromData(i)},n.prototype.mergeDefaultAndTheme=function(e,t){var n=CU(this),i=n?CY(e):{},r=this.subType;CX.hasClass(r)&&(r+="Series"),vf(e,t.getTheme().get(this.subType)),vf(e,this.getDefaultOption()),yh(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&Cq(e,i,n)},n.prototype.mergeOption=function(e,t){e=vf(this.option,e,!0),this.fillDataTextStyle(e.data);var n=CU(this);n&&Cq(this.option,e,n);var i=M$(this).sourceManager;i.dirty(),i.prepareSource();var r=this.getInitialData(e,t);MK(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,M$(this).dataBeforeProcessed=r,Mq(this),this._initSelectedMapFromData(r)},n.prototype.fillDataTextStyle=function(e){if(e&&!vE(e))for(var t=["show"],n=0;n<e.length;n++)e[n]&&e[n].label&&yh(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=MJ(this);if(!t)return M$(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=MJ(this);if(t){var n=t.context;n.outputData=e,t!==this.dataTask&&(n.data=e)}M$(this).data=e},n.prototype.getEncode=function(){var e=this.get("encode",!0);if(e)return vY(e)},n.prototype.getSourceManager=function(){return M$(this).sourceManager},n.prototype.getSource=function(){return this.getSourceManager().getSource()},n.prototype.getRawData=function(){return M$(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=vk(h),p=CF(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=vS(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(ML("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:e,valueType:n.type})):(s.push(e),l.push(n.type)))}return i.length?vb(i,function(e){c(C7(o,n,e),e)}):vb(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=C7(l,a,u[0]),n=g.type}else r=t=d?h[0]:h;var m=yv(o),v=m&&o.name||"",y=l.getName(a),x=s?v:y;return ML("section",{header:v,noHeader:s||!m,sortParam:r,blocks:[ML("nameValue",{markerType:"item",markerColor:p,name:x,noName:!vW(x),value:t,valueType:n,dataIndex:a})].concat(i||[])})}({series:this,dataIndex:e,multipleSeries:t})},n.prototype.isAnimationEnabled=function(){var e=this.ecModel;if(ys.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=C0.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=MG(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=vC(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[MG(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){vR(r.selectedMap)||(r.selectedMap={});for(var s=r.selectedMap,l=0;l<a;l++){var u=t[l],c=MG(e,u);s[c]=!0,this._selectedDataIndicesMap[c]=e.getRawIndex(u)}}else if("single"===o||!0===o){var h=t[a-1],c=MG(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 CX.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}(CX);function Mq(e){var t,n,i,r=e.name;yv(e)||(e.name=(n=(t=e.getRawData()).mapDimensionsAll("seriesName"),i=[],vb(n,function(e){var n=t.getDimensionInfo(e);n.displayName&&i.push(n.displayName)}),i.join(" ")||r))}function MY(e){return e.model.getRawData().count()}function MZ(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),MX}function MX(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function MK(e,t){vb(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,vA(MQ,t))})}function MQ(e,t){var n=MJ(e);return n&&n.setOutputEnd((t||this).count()),t}function MJ(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 M0(e){return null==e?0:e.length||1}function M1(e){return e}vy(MU,Mt),vy(MU,C0),xv(MU,CX);var M2=function(){function e(e,t,n,i,r,o){this._old=e,this._new=t,this._oldKeyGetter=n||M1,this._newKeyGetter=i||M1,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=M0(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=M0(l),h=M0(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=M0(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=M0(s);0===l?(t[a]=o,r&&n.push(a)):1===l?t[a]=[s,o]:s.push(o)}}},e}(),M5=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 M3(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}let M4=function(e){this.otherDims={},null!=e&&vg(this,e)};var M6=vR,M8="u"<typeof Int32Array?Array:Int32Array,M9=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],M7=["_approximateExtent"],Ae=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;y0(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=vI(c)?new M4({name:c}):c instanceof M4?c:new M4(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=vY();vb(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(vO(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 MA&&(g=e),!g){var v=this.dimensions,y=y$(e)||vx(e)?new C1(e,v.length):e;g=new MA;var x=vw(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=vY(),l=[],u=[],c={},vb(i.dimensions,function(e){var t=i.getDimensionInfo(e),n=t.coordDim;if(n){var r,o=t.coordDimIndex;M3(a,n)[o]=e,t.isExtraCoord||(s.set(n,1),"ordinal"!==(r=t.type)&&"time"!==r&&(l[0]=e),M3(c,n)[o]=i.getDimensionIndex(t.name)),t.defaultTooltip&&u.push(e)}yI.each(function(e,n){var i=M3(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=vw(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 M5(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!==yE&&!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===yD&&!n.pure)for(var o=[],a=e;a<t;a++){var s,l=n.getItem(a,o);if(!(!this.hasItemOption&&vR(s=l))||s instanceof Array||(this.hasItemOption=!0),l){var u=l.name;null==i[a]&&null!=u&&(i[a]=ym(u,null));var c=l.id;null==r[a]&&null!=c&&(r[a]=ym(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){M6(e)?vg(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 vk(e)?i.getValues(vw(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){vT(e)&&(n=t,t=e,e=[]);var i=n||this,r=vw($(e),this._getStoreDimIndex,this);this._store.each(r,i?vM(t,i):t)},e.prototype.filterSelf=function(e,t,n){vT(e)&&(n=t,t=e,e=[]);var i=n||this,r=vw($(e),this._getStoreDimIndex,this);return this._store=this._store.filter(r,i?vM(t,i):t),this},e.prototype.selectRange=function(e){var t=this,n={},i=vC(e),r=[];return vb(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){vT(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=vw($(e),this._getStoreDimIndex,this),a=U(this);return a._store=this._store.map(o,r?vM(t,r):t),a},e.prototype.modify=function(e,t,n,i){var r=n||i||this,o=vw($(e),this._getStoreDimIndex,this);this._store.modify(o,r?vM(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 _2(this.getRawDataItem(e),t,t&&t.ecModel)},e.prototype.diff=function(e){var t=this;return new M2(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||{},M6(e)?vg(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&&(vk(r=this.getVisual(t))?r=r.slice():M6(r)&&(r=vg({},r)),i[t]=r),r},e.prototype.setItemVisual=function(e,t,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,M6(t)?vg(i,t):i[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){M6(e)?vg(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?vg(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){SW(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){vb(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:vw(this.dimensions,this._getDimInfo,this),this.hostModel)),G(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];vT(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(vV(arguments)))})},e.internalField=void(j=function(e){var t=e._invertedIndicesMap;vb(t,function(n,i){var r=e._dimInfos[i],o=r.ordinalMeta,a=e._store;if(o){n=t[i]=new M8(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 ym(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},$=function(e){return vk(e)||(e=null!=e?[e]:[]),e},U=function(t){var n=new e(t._schema?t._schema:vw(t.dimensions,t._getDimInfo,t),t.hostModel);return G(n,t),n},G=function(e,t){vb(M9.concat(t.__wrappedMethods||[]),function(n){t.hasOwnProperty(n)&&(e[n]=t[n])}),e.__wrappedMethods=t.__wrappedMethods,vb(M7,function(n){e[n]=vp(t[n])}),e._calculationInfo=vg({},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 At(e,t){y$(e)||(e=yU(e));var n,i,r,o,a,s=(t=t||{}).coordDimensions||[],l=t.dimensionsDefine||e.dimensionsDefine||[],u=vY(),c=[],h=(n=e,i=s,r=l,o=t.dimensionsCount,a=Math.max(n.dimensionsDetectedCount||1,i.length,r.length,o||0),vb(i,function(e){var t;vR(e)&&(t=e.dimsDef)&&(a=Math.max(a,t.length))}),a),d=t.canOmitUnusedDimensions&&h>30,p=l===e.dimensionsDefine,f=p?y2(e):y1(l),g=t.encodeDefine;!g&&t.encodeDefaulter&&(g=t.encodeDefaulter(e,h));for(var m=vY(g),v=new Mb(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=vR(n)?n:{name:n},r=new M4,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=yc(e).slice();if(1===n.length&&!vI(n[0])&&n[0]<0)return void m.set(t,!1);var i=m.set(t,[]);vb(n,function(e,n){var r=vI(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!=yI.get(t)?e.otherDims[t]=n:(e.coordDim=t,e.coordDimIndex=n,u.set(t,!0))}vb(s,function(e){if(vI(e))r=e,i={};else{var t,n,i,r=(i=e).name,o=i.ordinalMeta;i.ordinalMeta=null,(i=vg({},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=yc(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++)}vb(a,function(e,o){var a=x(e);if(p&&null!=i.type&&(a.type=i.type),w(vm(a,i),r,o),null==a.name&&t){var s=t[o];vR(s)||(s={name:s}),a.name=a.displayName=s.name,a.defaultTooltip=s.defaultTooltip}n&&vm(a.otherDims,n)})}});var S=t.generateCoord,_=t.generateCoordCount,C=null!=_;_=S?_||1:0;var M=S||"value";function A(e){null==e.name&&(e.name=e.coordDim)}if(d)vb(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}(M,u,C),T.coordDimIndex=0,(!S||_<=0)&&(T.isExtraCoord=!0),_--),A(T),null==T.type&&(1===yj(e,k)||T.isExtraCoord&&(null!=T.otherDims.itemName||null!=T.otherDims.seriesName))&&(T.type="ordinal")}return function(e){for(var t=vY(),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 yJ({source:e,dimensions:c,fullDimensionCount:h,dimensionOmitted:d})}var An={},Ai=function(){function e(){this._coordinateSystems=[]}return e.prototype.create=function(e,t){var n=[];vb(An,function(i,r){var o=i.create(e,t);n=n.concat(o||[])}),this._coordinateSystems=n},e.prototype.update=function(e,t){vb(this._coordinateSystems,function(n){n.update&&n.update(e,t)})},e.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},e.register=function(e,t){An[e]=t},e.get=function(e){return An[e]},e}(),Ar=function(e){this.coordSysDims=[],this.axisMap=vY(),this.categoryAxisMap=vY(),this.coordSysName=e},Ao={cartesian2d:function(e,t,n,i){var r=e.getReferringComponents("xAxis",yC).models[0],o=e.getReferringComponents("yAxis",yC).models[0];t.coordSysDims=["x","y"],n.set("x",r),n.set("y",o),Aa(r)&&(i.set("x",r),t.firstCategoryDimIndex=0),Aa(o)&&(i.set("y",o),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,n,i){var r=e.getReferringComponents("singleAxis",yC).models[0];t.coordSysDims=["single"],n.set("single",r),Aa(r)&&(i.set("single",r),t.firstCategoryDimIndex=0)},polar:function(e,t,n,i){var r=e.getReferringComponents("polar",yC).models[0],o=r.findAxisModel("radiusAxis"),a=r.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),Aa(o)&&(i.set("radius",o),t.firstCategoryDimIndex=0),Aa(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();vb(o.parallelAxisIndex,function(e,o){var s=r.getComponent("parallelAxis",e),l=a[o];n.set(l,s),Aa(s)&&(i.set(l,s),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=o))})}};function Aa(e){return"category"===e.get("type")}let As=function(e,t,n){n=n||{};var i,r,o,a,s,l,u,c,h=t.getSourceManager(),d=!1;e?(d=!0,c=yU(e)):d=(c=h.getSource()).sourceFormat===yD;var p=function(e){var t=e.get("coordinateSystem"),n=new Ar(t),i=Ao[t];if(i)return i(e,n,n.axisMap,n.categoryAxisMap),n}(t),f=(r=t.get("coordinateSystem"),o=Ai.get(r),p&&p.coordSysDims&&(i=vw(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=vT(g)?g:g?vA(yz,f,t):null,v=At(c,{coordDimensions:f,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:m,canOmitUnusedDimensions:!d}),y=(a=v.dimensions,s=n.createInvertedIndices,p&&vb(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;y0(t.schema)?(i=(r=t.schema).dimensions,o=t.store):i=t;var d=!!(e&&e.get("stack"));if(vb(i,function(e,t){vI(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;vb(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 Ae(v,t);w.setCalculationInfo(b);var S=null!=y&&function(e){if(e.sourceFormat===yD)return!vk(yp(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 Al=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.getInitialData=function(e,t){return As(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)vb(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}(MU);MU.registerClass(Al);var Au=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.getInitialData=function(){return As(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=_4(Al.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}(Al),Ac=function(e){function t(t){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(t),n}return xA(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=vv(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=vv(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 xZ(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?(xZ.applyTransform(t,s,l),(r=r||t.clone()).union(t)):(r=r||s.clone()).union(s)}}return r||t},t}(w_);Ac.prototype.type="group";let Ah=Ac;var Ad=w7.CMD,Ap=[[],[],[]],Af=Math.sqrt,Ag=Math.atan2,Am=Math.sqrt,Av=Math.sin,Ay=Math.cos,Ax=Math.PI;function Ab(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Aw(e,t){return(e[0]*t[0]+e[1]*t[1])/(Ab(e)*Ab(t))}function AS(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(Aw(e,t))}function A_(e,t,n,i,r,o,a,s,l,u,c){var h=Ax/180*l,d=Ay(h)*(e-n)/2+Av(h)*(t-i)/2,p=-1*Av(h)*(e-n)/2+Ay(h)*(t-i)/2,f=d*d/(a*a)+p*p/(s*s);f>1&&(a*=Am(f),s*=Am(f));var g=(r===o?-1:1)*Am((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+Ay(h)*m-Av(h)*v,x=(t+i)/2+Av(h)*m+Ay(h)*v,b=AS([1,0],[(d-m)/a,(p-v)/s]),w=[(d-m)/a,(p-v)/s],S=[(-1*d-m)/a,(-1*p-v)/s],_=AS(w,S);if(-1>=Aw(w,S)&&(_=Ax),Aw(w,S)>=1&&(_=0),_<0){var C=Math.round(_/Ax*1e6)/1e6;_=2*Ax+C%2*Ax}c.addData(u,y,x,a,s,b,_,h,o)}var AC=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,AM=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g,AA=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xA(t,e),t.prototype.applyTransform=function(e){},t}(Sp);function Ak(e){return null!=e.setData}function AT(e,t){var n=function(e){var t,n=new w7;if(!e)return n;var i=0,r=0,o=0,a=0,s=w7.CMD,l=e.match(AC);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(AM)||[],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,C=i,M=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,C=p[m++],M=p[m++],i=p[m++],r=p[m++],n.addData(d,v,y,C,M,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,C=i+p[m++],M=r+p[m++],i+=p[m++],r+=p[m++],n.addData(d,v,y,C,M,i,r);break;case"Q":C=p[m++],M=p[m++],i=p[m++],r=p[m++],d=s.Q,n.addData(d,C,M,i,r);break;case"q":C=p[m++]+i,M=p[m++]+r,i+=p[m++],r+=p[m++],d=s.Q,n.addData(d,C,M,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++],C=i,M=r,i=p[m++],A_(C,M,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++],C=i,M=r,i+=p[m++],A_(C,M,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=vg({},t);return i.buildPath=function(e){if(Ak(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=Ad.M,h=Ad.C,d=Ad.L,p=Ad.R,f=Ad.A,g=Ad.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=Af(t[0]*t[0]+t[1]*t[1]),x=Af(t[2]*t[2]+t[3]*t[3]),b=Ag(-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++],bd(s,s,t),l[o++]=s[0],l[o++]=s[1],s[0]+=l[r++],s[1]+=l[r++],bd(s,s,t),l[o++]=s[0],l[o++]=s[1]}for(a=0;a<i;a++){var w=Ap[a];w[0]=l[r++],w[1]=l[r++],bd(w,w,t),l[o++]=w[0],l[o++]=w[1]}}e.increaseVersion()}}(n,e),this.dirtyShape()},i}var AI=function(){this.cx=0,this.cy=0,this.r=0},AD=function(e){function t(t){return e.call(this,t)||this}return xA(t,e),t.prototype.getDefaultShape=function(){return new AI},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}(Sp);AD.prototype.type="circle";let AO=AD;var AR=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},AP=function(e){function t(t){return e.call(this,t)||this}return xA(t,e),t.prototype.getDefaultShape=function(){return new AR},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}(Sp);AP.prototype.type="ellipse";let AE=AP;var AL=Math.PI,AN=2*AL,AB=Math.sin,Az=Math.cos,AF=Math.acos,AV=Math.atan2,Aj=Math.abs,AH=Math.sqrt,AW=Math.max,A$=Math.min;function AG(e,t,n,i,r,o,a){var s=e-n,l=t-i,u=(a?o:-o)/AH(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)*AH(AW(0,w*w*b-S*S)),C=(S*x-y*_)/b,M=(-S*y-x*_)/b,A=(S*x+y*_)/b,k=(-S*y+x*_)/b,T=C-m,I=M-v,D=A-m,O=k-v;return T*T+I*I>D*D+O*O&&(C=A,M=k),{cx:C,cy:M,x0:-c,y0:-h,x1:C*(r/w-1),y1:M*(r/w-1)}}var AU=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},Aq=function(e){function t(t){return e.call(this,t)||this}return xA(t,e),t.prototype.getDefaultShape=function(){return new AU},t.prototype.buildPath=function(e,t){!function(e,t){var n,i=AW(t.r,0),r=AW(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=Aj(u-l),f=p>AN&&p%AN;if(f>1e-4&&(p=f),i>1e-4)if(p>AN-1e-4)e.moveTo(c+i*Az(l),h+i*AB(l)),e.arc(c,h,i,l,u,!d),r>1e-4&&(e.moveTo(c+r*Az(u),h+r*AB(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,C=void 0,M=void 0,A=void 0,k=void 0,T=void 0,I=void 0,D=void 0,O=i*Az(l),R=i*AB(l),P=r*Az(u),E=r*AB(u),L=p>1e-4;if(L){var N=t.cornerRadius;N&&(g=(n=function(e){var t;if(vk(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=Aj(i-r)/2;if(x=A$(B,v),b=A$(B,y),w=A$(B,g),S=A$(B,m),M=_=AW(x,b),A=C=AW(w,S),(_>1e-4||C>1e-4)&&(k=i*Az(u),T=i*AB(u),I=r*Az(l),D=r*AB(l),p<AL)){var z=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,R,I,D,k,T,P,E);if(z){var F=O-z[0],V=R-z[1],j=k-z[0],H=T-z[1],W=1/AB(AF((F*j+V*H)/(AH(F*F+V*V)*AH(j*j+H*H)))/2),$=AH(z[0]*z[0]+z[1]*z[1]);M=A$(_,(i-$)/(W+1)),A=A$(C,(r-$)/(W-1))}}}if(L)if(M>1e-4){var G=A$(v,M),U=A$(y,M),q=AG(I,D,O,R,i,G,d),Y=AG(k,T,P,E,i,U,d);e.moveTo(c+q.cx+q.x0,h+q.cy+q.y0),M<_&&G===U?e.arc(c+q.cx,h+q.cy,M,AV(q.y0,q.x0),AV(Y.y0,Y.x0),!d):(G>0&&e.arc(c+q.cx,h+q.cy,G,AV(q.y0,q.x0),AV(q.y1,q.x1),!d),e.arc(c,h,i,AV(q.cy+q.y1,q.cx+q.x1),AV(Y.cy+Y.y1,Y.cx+Y.x1),!d),U>0&&e.arc(c+Y.cx,h+Y.cy,U,AV(Y.y1,Y.x1),AV(Y.y0,Y.x0),!d))}else e.moveTo(c+O,h+R),e.arc(c,h,i,l,u,!d);else e.moveTo(c+O,h+R);if(r>1e-4&&L)if(A>1e-4){var G=A$(g,A),U=A$(m,A),q=AG(P,E,k,T,r,-U,d),Y=AG(O,R,I,D,r,-G,d);e.lineTo(c+q.cx+q.x0,h+q.cy+q.y0),A<C&&G===U?e.arc(c+q.cx,h+q.cy,A,AV(q.y0,q.x0),AV(Y.y0,Y.x0),!d):(U>0&&e.arc(c+q.cx,h+q.cy,U,AV(q.y0,q.x0),AV(q.y1,q.x1),!d),e.arc(c,h,r,AV(q.cy+q.y1,q.cx+q.x1),AV(Y.cy+Y.y1,Y.cx+Y.x1),d),G>0&&e.arc(c+Y.cx,h+Y.cy,G,AV(Y.y1,Y.x1),AV(Y.y0,Y.x0),!d))}else e.lineTo(c+P,h+E),e.arc(c,h,r,u,l,d);else e.lineTo(c+P,h+E)}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}(Sp);Aq.prototype.type="sector";let AY=Aq;var AZ=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},AX=function(e){function t(t){return e.call(this,t)||this}return xA(t,e),t.prototype.getDefaultShape=function(){return new AZ},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}(Sp);AX.prototype.type="ring";let AK=AX;function AQ(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++)bp(a,a,e[d]),bf(s,s,e[d]);bp(a,a,i[0]),bf(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];ba(u,o,r),bs(u,u,t);var m=bu(g,r),v=bu(g,o),y=m+v;0!==y&&(m/=y,v/=y),bs(c,u,-m),bs(h,u,v);var x=bo([],g,c),b=bo([],g,h);i&&(bf(x,x,a),bp(x,x,s),bf(b,b,a),bp(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 AJ=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},A0=function(e){function t(t){return e.call(this,t)||this}return xA(t,e),t.prototype.getDefaultShape=function(){return new AJ},t.prototype.buildPath=function(e,t){AQ(e,t,!0)},t}(Sp);A0.prototype.type="polygon";let A1=A0;var A2=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},A5=function(e){function t(t){return e.call(this,t)||this}return xA(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new A2},t.prototype.buildPath=function(e,t){AQ(e,t,!1)},t}(Sp);A5.prototype.type="polyline";let A3=A5;var A4={},A6=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},A8=function(e){function t(t){return e.call(this,t)||this}return xA(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new A6},t.prototype.buildPath=function(e,t){if(this.subPixelOptimize){var n,i,r,o,a=Sw(A4,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}(Sp);A8.prototype.type="line";let A9=A8;var A7=[],ke=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function kt(e,t,n){var i=e.cpx2,r=e.cpy2;return null!=i||null!=r?[(n?bP:bR)(e.x1,e.cpx1,e.cpx2,e.x2,t),(n?bP:bR)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(n?bz:bB)(e.x1,e.cpx1,e.x2,t),(n?bz:bB)(e.y1,e.cpy1,e.y2,t)]}var kn=function(e){function t(t){return e.call(this,t)||this}return xA(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new ke},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&&(bV(n,a,r,c,A7),a=A7[1],r=A7[2],bV(i,s,o,c,A7),s=A7[1],o=A7[2]),e.quadraticCurveTo(a,s,r,o)):(c<1&&(bN(n,a,l,r,c,A7),a=A7[1],l=A7[2],r=A7[3],bN(i,s,u,o,c,A7),s=A7[1],u=A7[2],o=A7[3]),e.bezierCurveTo(a,s,l,u,r,o)))},t.prototype.pointAt=function(e){return kt(this.shape,e,!1)},t.prototype.tangentAt=function(e){var t=kt(this.shape,e,!0);return bl(t,t)},t}(Sp);kn.prototype.type="bezier-curve";let ki=kn;var kr=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},ko=function(e){function t(t){return e.call(this,t)||this}return xA(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new kr},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}(Sp);ko.prototype.type="arc";let ka=ko,ks=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="compound",t}return xA(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),Sp.prototype.getBoundingRect.call(this)},t}(Sp);var kl=function(){function e(e){this.colorStops=e||[]}return e.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},e}();let ku=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 xA(t,e),t}(kl),kc=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 xA(t,e),t}(kl);var kh=[0,0],kd=[0,0],kp=new xV,kf=new xV;let kg=function(){function e(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new xV;for(var n=0;n<2;n++)this._axes[n]=new xV;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);xV.sub(i[0],n[1],n[0]),xV.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(kp.set(1/0,1/0),kf.set(0,0),!this._intersectCheckOneSide(this,e,kp,kf,i,1)&&(n=!1,i)||!this._intersectCheckOneSide(e,this,kp,kf,i,-1)&&(n=!1,i))?n:(i||xV.copy(t,n?kp:kf),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,kh),this._getProjMinMaxOnAxis(s,t._corners,kd),kh[1]<kd[0]||kh[0]>kd[1]){if(a=!1,r)return a;var u=Math.abs(kd[0]-kh[1]),c=Math.abs(kh[0]-kd[1]);Math.min(u,c)>i.len()&&(u<c?xV.scale(i,l,-u*o):xV.scale(i,l,c*o))}else if(n){var u=Math.abs(kd[0]-kh[1]),c=Math.abs(kh[0]-kd[1]);Math.min(u,c)<n.len()&&(u<c?xV.scale(n,l,u*o):xV.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 km=[];let kv=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 xA(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 xZ(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(km)),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}(wO);var ky=Math.max,kx=Math.min,kb={};function kw(e){return Sp.extend(e)}var kS=function(e,t){var n=AT(e,t),i=AA;function r(e){var t=i.call(this,e)||this;return t.applyTransform=n.applyTransform,t.buildPath=n.buildPath,t}return xA(r,i),r};function k_(e,t){return kS(e,t)}function kC(e,t){kb[e]=t}function kM(e){if(kb.hasOwnProperty(e))return kb[e]}function kA(e,t,n,i){var r=new AA(AT(e,t));return n&&("center"===i&&(n=kT(n,r.getBoundingRect())),kD(r,n)),r}function kk(e,t,n){var i=new Sx({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(kT(t,r))}}});return i}function kT(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 kI=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 Sp(t);return a.createPathProxy(),a.buildPath=function(e){if(Ak(e)){e.appendPath(n);var t=e.getContext();t&&e.rebuildPath(t,1)}},a};function kD(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function kO(e,t){return Sw(e,e,{lineWidth:t}),e}function kR(e){return SS(e.shape,e.shape,e.style),e}var kP=S_;function kE(e,t){for(var n=xL([]);e&&e!==t;)xN(n,e.getLocalTransform(),n),e=e.parent;return n}function kL(e,t,n){return t&&!vx(t)&&(t=bb.getLocalTransform(t)),n&&(t=xF([],t)),bd([],e,t)}function kN(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=kL(o,t,n))[0])>Math.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function kB(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)),_M(e,i,n,SH(e).dataIndex)}}})}function o(e){var t={x:e.x,y:e.y,rotation:e.rotation};return null!=e.shape&&(t.shape=vg({},e.shape)),t}}function kz(e,t){return vw(e,function(e){var n=e[0];n=kx(n=ky(n,t.x),t.x+t.width);var i=e[1];return[n,i=kx(i=ky(i,t.y),t.y+t.height)]})}function kF(e,t){var n=ky(e.x,t.x),i=kx(e.x+e.width,t.x+t.width),r=ky(e.y,t.y),o=kx(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 kV(e,t,n){var i=vg({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),vm(r,n),new Sx(i)):kA(e.replace("path://",""),i,n,"center")}function kj(e,t,n,i,r){for(var o=0,a=r[r.length-1];o<r.length;o++){var s=r[o];if(kH(e,t,n,i,s[0],s[1],a[0],a[1]))return!0;a=s}}function kH(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 kW(e){var t=e.itemTooltipOption,n=e.componentModel,i=e.itemName,r=vI(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&&vb(vC(l),function(e){vK(s,e)||(s[e]=l[e],s.$vars.push(e))});var u=SH(e.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:i,option:vm({content:i,formatterParams:s},r)}}function k$(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function kG(e,t){if(e)if(vk(e))for(var n=0;n<e.length;n++)k$(e[n],t);else k$(e,t)}kb.circle=AO,kb.ellipse=AE,kb.sector=AY,kb.ring=AK,kb.polygon=A1,kb.polyline=A3,kb.rect=Sk,kb.line=A9,kb.bezierCurve=ki,kb.arc=ka;var kU="\0__throttleOriginMethod",kq="\0__throttleRate",kY="\0__throttleType";function kZ(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 kX(e,t,n,i){var r=e[t];if(r){var o=r[kU]||r,a=r[kY];if(r[kq]!==n||a!==i){if(null==n||!i)return e[t]=o;(r=e[t]=kZ(o,n,"debounce"===i))[kU]=o,r[kY]=i,r[kq]=n}return r}}function kK(e,t){var n=e[t];n&&n[kU]&&(n.clear&&n.clear(),e[t]=n[kU])}function kQ(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 Sk({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=vT(r)?function(e){r(e,h)}:null;_A(h,{shape:{width:l,height:u,x:a,y:s}},n,null,i,g)}return h}function kJ(e,t,n){var i=e.getArea(),r=v2(i.r0,1),o=v2(i.r,1),a=new AY({shape:{cx:v2(e.cx,1),cy:v2(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,_A(a,{shape:{endAngle:i.endAngle,r:o}},n)),a}function k0(e,t,n,i,r){if(e){if("polar"===e.type)return kJ(e,t,n);else if("cartesian2d"===e.type)return kQ(e,t,n,i,r)}return null}var k1=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},k2=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return xd(t,e),t.prototype.getDefaultShape=function(){return new k1},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}(Sp),k5=yb(),k3=y4(),k4=function(){function e(){this.group=new Ah,this.uid=_3("viewChart"),this.renderTask=Mi({plan:k9,reset:k7}),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&&k8(r,i,"emphasis")},e.prototype.downplay=function(e,t,n,i){var r=e.getData(i&&i.dataType);r&&k8(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){kG(this.group,e)},e.markUpdateMethod=function(e,t){k5(e).updateMethod=t},e.protoInitialize=void(e.prototype.type="chart"),e}();function k6(e,t,n){e&&_x(e)&&("emphasis"===t?_o:_a)(e,n)}function k8(e,t,n){var i,r,o=yx(e,t),a=t&&null!=t.highlightKey?(null==(r=SG[i=t.highlightKey])&&S$<=32&&(r=SG[i]=S$++),r):null;null!=o?vb(yc(o),function(t){k6(e.getItemGraphicEl(t),n,a)}):e.eachItemGraphicEl(function(e){k6(e,n,a)})}function k9(e){return k3(e.model)}function k7(e){var t=e.model,n=e.ecModel,i=e.api,r=e.payload,o=t.pipelineContext.progressiveRender,a=e.view,s=r&&k5(r).updateMethod,l=o?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](t,n,i,r),Te[l]}xm(k4,["dispose"]),xw(k4);var Te={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 Tt(e,t){return e.type===t}function Tn(e,t){var n=e.mapDimensionsAll("defaultedLabel"),i=n.length;if(1===i){var r=C7(e,t,n[0]);return null!=r?r+"":null}if(i){for(var o=[],a=0;a<n.length;a++)o.push(C7(e,t,n[a]));return o.join(" ")}}function Ti(e,t){var n=e.mapDimensionsAll("defaultedLabel");if(!vk(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 Tr(e,t,n){return t*Math.sin(e)*(n?-1:1)}function To(e,t,n){return t*Math.cos(e)*(n?1:-1)}function Ta(e,t,n){var i=e.get("borderRadius");if(null==i)return n?{cornerRadius:0}:null;vk(i)||(i=[i,i,i,i]);var r=Math.abs(t.r||0-t.r0||0);return{cornerRadius:vw(i,function(e){return x5(e,r)})}}var Ts=Math.max,Tl=Math.min,Tu=function(e){function t(){var n=e.call(this)||this;return n.type=t.type,n._isFirstFrame=!0,n}return xd(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){kG(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(Tt(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=Tv[l.type](a,e),s=(t=l,n=r,i=o,new("polar"===t.type?AY:Sk)({shape:TC(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=Tv[l.type](a,t,n);if(g&&S(t),a.hasValue(t)&&Tm[l.type](i)){var s=!1;d&&(s=Tc[l.type](p,i));var m=Th[l.type](e,a,t,i,r,c,u.model,!1,f);h&&(m.forceLabelAnimation=!0),Tx(m,a,t,n,i,e,r,"polar"===l.type),b?m.attr({shape:i}):h?Td(h,c,m,i,t,r,!1,!1):_A(m,{shape:i},e,t),a.setItemGraphicEl(t,m),o.add(m),m.ignore=s}}).update(function(t,n){var i=a.getItemModel(t),_=Tv[l.type](a,t,i);if(g){var C=void 0;0===x.length?C=S(n):((C=x[n]).useStyle(m.getItemStyle()),"cartesian2d"===l.type?C.setShape("r",v):C.setShape("cornerRadius",v),y[t]=C);var M=Tv[l.type](a,t);_M(C,{shape:TC(r,M,l)},c,t)}var A=s.getItemGraphicEl(n);if(!a.hasValue(t)||!Tm[l.type](_))return void o.remove(A);var k=!1;if(d&&(k=Tc[l.type](p,_))&&o.remove(A),A?_O(A):A=Th[l.type](e,a,t,_,r,c,u.model,!!A,f),h&&(A.forceLabelAnimation=!0),w){var T=A.getTextContent();if(T){var I=_$(T);null!=I.prevValue&&(I.prevValue=I.value)}}else Tx(A,a,t,i,_,e,r,"polar"===l.type);b?A.attr({shape:_}):h?Td(h,c,A,_,t,r,!0,w):_M(A,{shape:_},e,t,null),a.setItemGraphicEl(t,A),A.ignore=k,o.add(A)}).remove(function(t){var n=s.getItemGraphicEl(t);n&&_D(n,e,t)}).execute();var _=this._backgroundGroup||(this._backgroundGroup=new Ah);_.removeAll();for(var C=0;C<y.length;++C)_.add(y[C]);o.add(_),this._backgroundEls=y,this._data=a},t.prototype._renderLarge=function(e,t,n){this._clear(),TS(e,this.group),this._updateLargeClip(e)},t.prototype._incrementalRenderLarge=function(e,t){this._removeBackground(),TS(t,this.group,this._progressiveEls,!0)},t.prototype._updateLargeClip=function(e){var t=e.get("clip",!0)&&k0(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:vw(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){_D(t,e,SH(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}(k4),Tc={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=Ts(t.x,e.x),s=Tl(t.x+t.width,r),l=Ts(t.y,e.y),u=Tl(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=Tl(t.r,e.r),o=Ts(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}},Th={cartesian2d:function(e,t,n,i,r,o,a,s,l){var u=new Sk({shape:vg({},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?k2:AY,d=new h({shape:i,z2:1});if(d.name="item",u=Ty(r),c=h===k2,d.calculateTextPosition=function(e,t,n){var i=t.position;if(!i||i instanceof Array)return x3(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)+Tr(f,o+v,!1),w=l+p*x(f)+To(f,o+v,!1),S="right",_="middle";break;case"insideStartAngle":b=s+p*y(f)+Tr(f,-o+v,!1),w=l+p*x(f)+To(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)+Tr(g,o+v,!0),w=l+p*x(g)+To(g,o+v,!0),S="left",_="middle";break;case"insideEndAngle":b=s+p*y(g)+Tr(g,-o+v,!0),w=l+p*x(g)+To(g,-o+v,!0),S="right",_="middle";break;default:return x3(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?_M:_A)(d,{shape:g},o)}return d}};function Td(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?_M:_A)(n,{shape:l},t,r,null),(a?_M:_A)(n,{shape:u},t?e.baseAxis.model:null,r)}function Tp(e,t){for(var n=0;n<t.length;n++)if(!isFinite(e[t[n]]))return!0;return!1}var Tf=["x","y","width","height"],Tg=["cx","cy","r","startAngle","endAngle"],Tm={cartesian2d:function(e){return!Tp(e,Tf)},polar:function(e){return!Tp(e,Tg)}},Tv={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 Ty(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 Tx(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=Ta(i.getModel("itemStyle"),u,!0);vg(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=_N(i);_L(e,f,{labelFetcher:o,labelDataIndex:n,defaultText:Tn(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(vO(i))return e.setTextConfig({rotation:i});if(vk(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,Ty(a),i.get(["label","rotate"]))}_G(g,f,o.getRawValue(n),function(e){return Ti(t,e)});var v=i.getModel(["emphasis"]);_f(e,v.get("focus"),v.get("blurScope"),v.get("disabled")),_v(e,i),null!=r.startAngle&&null!=r.endAngle&&r.startAngle===r.endAngle&&(e.style.fill="none",e.style.stroke="none",vb(e.states,function(e){e.style&&(e.style.fill=e.style.stroke="none")}))}var Tb=function(){},Tw=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return xd(t,e),t.prototype.getDefaultShape=function(){return new Tb},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}(Sp);function TS(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 Tw({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 Tw({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")),SH(h).seriesIndex=e.seriesIndex,e.get("silent")||(h.on("mousedown",T_),h.on("mousemove",T_)),n&&n.push(h)}var T_=kZ(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);SH(this).dataIndex=t>=0?t:null},30,!1);function TC(e,t,n){if(Tt(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 TM=Sp.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()}}),TA=Sp.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()}}),Tk=Sp.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()}}),TT=Sp.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()}}),TI={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}},TD={};vb({line:A9,rect:Sk,roundRect:Sk,square:Sk,circle:AO,diamond:TA,pin:Tk,arrow:TT,triangle:TM},function(e,t){TD[t]=new e});var TO=Sp.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var i=x3(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=TD[i];r||(r=TD[i="rect"]),TI[i](t.x,t.y,t.width,t.height,r.shape),r.buildPath(e,r.shape,n)}}});function TR(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 TP(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://")?kk(e.slice(8),new xZ(t,n,i,r),a?"center":"cover"):0===e.indexOf("path://")?kA(e.slice(7),{},new xZ(t,n,i,r),a?"center":"cover"):new TO({shape:{symbolType:e,x:t,y:n,width:i,height:r}})).__isEmptyBrush=l,s.setColor=TR,o&&s.setColor(o),s}function TE(e){return vk(e)||(e=[+e,+e]),[e[0]||0,e[1]||0]}function TL(e,t){if(null!=e)return vk(e)||(e=[e,e]),[v1(e[0],t[0])||0,v1(vz(e[1],e[0]),t[1])||0]}var TN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return xd(t,e),t.prototype.getInitialData=function(e){return As(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new Ah,n=TP("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=TP(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}(MU),TB=function(e){function t(t,n,i,r){var o=e.call(this)||this;return o.updateData(t,n,i,r),o}return xd(t,e),t.prototype._createSymbol=function(e,t,n,i,r){this.removeAll();var o=TP(e,-1,-1,2,2,null,r);o.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),o.drift=Tz,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(){_o(this.childAt(0))},t.prototype.downplay=function(){_a(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):_M(h,d,a,n),_O(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,_A(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=_N(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=TL(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 Sx){var S=f.style;f.useStyle(vg({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},b))}else f.__isEmptyBrush?f.useStyle(vg({},b)):f.useStyle(b),f.style.decal=null,f.setColor(w,r&&r.symbolInnerColor),f.style.strokeNoScale=!0;var _=e.getItemVisual(t,"liftZ"),C=this._z2;null!=_?null==C&&(this._z2=f.z2,f.z2+=_):null!=C&&(f.z2=C,this._z2=null);var M=r&&r.useNameLabel;_L(f,h,{labelFetcher:g,labelDataIndex:t,defaultText:function(t){return M?e.getName(t):Tn(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),_f(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=SH(this).dataIndex,o=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&_T(a,{style:{opacity:0}},t,{dataIndex:r,removeOpt:o,cb:function(){i.removeTextContent()}})}else i.removeTextContent();_T(i,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:r,cb:e,removeOpt:o})},t.getSymbolSize=function(e,t){return TE(e.getItemVisual(t,"symbolSize"))},t}(Ah);function Tz(e,t){this.parent.drift(e,t)}function TF(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 TV(e){return null==e||vR(e)||(e={isIgnore:e}),e||{}}function Tj(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:_N(t),cursorStyle:t.get("cursor")}}var TH=function(){function e(e){this.group=new Ah,this._SymbolCtor=e||TB}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=TV(t);var n=this.group,i=e.hostModel,r=this._data,o=this._SymbolCtor,a=t.disableAnimation,s=Tj(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(TF(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(!TF(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):_M(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=Tj(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=TV(n);for(var r=e.start;r<e.end;r++){var o=t.getItemLayout(r);if(TF(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){kG(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 TW(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]:vO(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=vw(e.dimensions,function(e){return t.mapDimension(e)}),m=!1,v=t.getCalculationInfo("stackResultDimension");return y5(t,g[0])&&(m=!0,g[0]=v),y5(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 T$(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 TG=Math.min,TU=Math.max;function Tq(e,t){return isNaN(e)||isNaN(t)}function TY(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(Tq(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 C=m+1;if(l)for(;Tq(S,_)&&C<i;)C++,w+=o,S=t[2*w],_=t[2*w+1];var M=.5,A=0,k=0,T=void 0,I=void 0;if(C>=i||Tq(S,_))p=v,f=y;else{A=S-u,k=_-c;var D=v-u,O=S-v,R=y-c,P=_-y,E=void 0,L=void 0;if("x"===s){E=Math.abs(D),L=Math.abs(O);var N=A>0?1:-1;p=v-N*E*a,f=y,T=v+N*L*a,I=y}else if("y"===s){E=Math.abs(R),L=Math.abs(P);var B=k>0?1:-1;p=v,f=y-B*E*a,T=v,I=y+B*L*a}else E=Math.sqrt(D*D+R*R),p=v-A*a*(1-(M=(L=Math.sqrt(O*O+P*P))/(L+E))),f=y-k*a*(1-M),T=v+A*a*M,I=y+k*a*M,T=TG(T,TU(S,v)),I=TG(I,TU(_,y)),T=TU(T,TG(S,v)),I=TU(I,TG(_,y)),A=T-v,k=I-y,p=v-A*E/L,f=y-k*E/L,p=TG(p,TU(u,v)),f=TG(f,TU(c,y)),p=TU(p,TG(u,v)),f=TU(f,TG(c,y)),A=v-p,k=y-f,T=v+A*L/E,I=y+k*L/E}e.bezierCurveTo(h,d,p,f,v,y),h=T,d=I}else e.lineTo(v,y)}u=v,c=y,g+=o}return m}var TZ=function(){this.smooth=0,this.smoothConstraint=!0},TX=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polyline",n}return xd(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new TZ},t.prototype.buildPath=function(e,t){var n=t.points,i=0,r=n.length/2;if(t.connectNulls){for(;r>0&&Tq(n[2*r-2],n[2*r-1]);r--);for(;i<r&&Tq(n[2*i],n[2*i+1]);i++);}for(;i<r;)i+=TY(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=w7.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?bE(n,c,d,f,e,s):bE(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?bR(i,h,p,g,b):bR(n,c,d,f,b);return a?[e,v]:[v,e]}}n=f,i=g}}},t}(Sp),TK=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(t,e),t}(TZ),TQ=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polygon",n}return xd(t,e),t.prototype.getDefaultShape=function(){return new TK},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&&Tq(n[2*o-2],n[2*o-1]);o--);for(;r<o&&Tq(n[2*r],n[2*r+1]);r++);}for(;r<o;){var s=TY(e,n,r,o,o,1,t.smooth,a,t.connectNulls);TY(e,i,r+s-1,s,o,-1,t.stackedOnSmooth,a,t.connectNulls),r+=s+1,e.closePath()}},t}(Sp);function TJ(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return;return!0}}function T0(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 T1(e,t){var n=T0(e),i=n[0],r=n[1],o=T0(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 T2(e){return vO(e)?e:.5*!!e}function T5(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 T3(e,t){return[e[2*t],e[2*t+1]]}function T4(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t<SY.length;t++)if(e.get([SY[t],"endLabel","show"]))return!0;return!1}function T6(e,t,n,i){if(!Tt(t,"cartesian2d"))return kJ(t,n,i);var r=i.getModel("endLabel"),o=r.get("valueAnimation"),a=i.getData(),s={lastFrameIndex:0},l=T4(i)?function(n,i){e._endLabelOnDuring(n,i,a,s,o,r,t)}:null,u=t.getBaseAxis().isHorizontal(),c=kQ(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 T8=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(t,e),t.prototype.init=function(){var e=new Ah,t=new TH;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=TW(o,s,x),w=y&&function(e,t,n){if(!n.valueDim)return[];for(var i=t.count(),r=y9(2*i),o=0;o<i;o++){var a=T$(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"),C=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*TB.getSymbolSize(t,a)[+!!e.isHorizontal()]>i)return!1;return!0}(o,t))){var a=t.mapDimension(o.dim),s={};return vb(o.getViewLabels(),function(e){s[o.scale.getRawOrdinalNumber(e.tickValue)]=1}),function(e){return!s.hasOwnProperty(t.get(a,e))}}}}(e,s,o),M=this._data;M&&M.eachItemGraphicEl(function(e,t){e.__temp&&(a.remove(e),M.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=vw(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=b1(t[s]),c=b1(t[l]),h=a-s;return b8([bG((n=u[0],n+(c[0]-n)*h)),bG((i=u[1],i+(c[1]-i)*h)),bG((r=u[2],r+(c[2]-r)*h)),bU((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";vb(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 ku(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,CF(k));var T=m.getClipPath();T?_A(T,{shape:T6(this,o,!1,e).shape},e):m.setClipPath(T6(this,o,!0,e)),S&&p.updateData(s,{isIgnore:C,clipShape:i,disableAnimation:!0,getSymbolPoint:function(e){return[c[2*e],c[2*e+1]]}}),TJ(this._stackedOnPoints,w)&&TJ(this._points,c)||(v?this._doUpdateAnimation(s,w,o,n,A,x,_):(A&&(c=T5(c,o,A,_),w&&(w=T5(w,o,A,_))),f.setShape({points:c}),g&&g.setShape({points:c,stackedOnPoints:w})))}else S&&p.updateData(s,{isIgnore:C,clipShape:i,disableAnimation:!0,getSymbolPoint:function(e){return[c[2*e],c[2*e+1]]}}),v&&this._initSymbolLabelAnimation(s,o,i),A&&(c=T5(c,o,A,_),w&&(w=T5(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,CF(k)),m.setClipPath(T6(this,o,!0,e));var I=e.getModel("emphasis"),D=I.get("focus"),O=I.get("blurScope"),R=I.get("disabled");f.useStyle(vm(l.getLineStyle(),{fill:"none",stroke:k,lineJoin:"bevel"})),_v(f,e,"lineStyle"),f.style.lineWidth>0&&"bolder"===e.get(["emphasis","lineStyle","width"])&&(f.getState("emphasis").style.lineWidth=+f.style.lineWidth+1),SH(f).seriesIndex=e.seriesIndex,_f(f,D,O,R);var P=T2(e.get("smooth")),E=e.get("smoothMonotone");if(f.setShape({smooth:P,smoothMonotone:E,connectNulls:_}),g){var L=s.getCalculationInfo("stackedOnSeries"),N=0;g.useStyle(vm(u.getAreaStyle(),{fill:k,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),L&&(N=T2(L.get("smooth"))),g.setShape({smooth:P,stackedOnSmooth:N,smoothMonotone:E,connectNulls:_}),_v(g,e,"areaStyle"),SH(g).seriesIndex=e.seriesIndex,_f(g,D,O,R)}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){SH(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=yx(r,i);if(this._changePolyState("emphasis"),o instanceof Array||null==o||!(o>=0))k4.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 TB(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=yx(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 k4.prototype.downplay.call(this,e,t,n,i)},t.prototype._changePolyState=function(e){var t=this._polygon;_e(this._polyline,e),t&&_e(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new TX({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 TQ({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");vT(l)&&(l=l(null));var u=s.get("animationDelay")||0,c=vT(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=vT(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(T4(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 Sj({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&&(_L(l,_N(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:h,defaultText:function(e,t,n){return null!=n?Ti(s,n):Tn(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,C=_[1]-_[0],M=void 0;if(C>=1){if(C>1&&!h){var A=T3(u,_[0]);s.attr({x:A[0]+x,y:A[1]+b}),r&&(M=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&&(M=yT(n,d,k,T,S.t))}i.lastFrameIndex=_[0]}else{var I=1===e||i.lastFrameIndex>0?_[0]:0,A=T3(u,I);r&&(M=c.getRawValue(I)),s.attr({x:A[0]+x,y:A[1]+b})}if(r){var D=_$(s);"function"==typeof D.setLabelText&&D.setLabelText(M)}}},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=TW(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],C=m[w+1],M=v[S],A=v[S+1];(isNaN(_)||isNaN(C))&&(_=M,C=A),l.push(_,C),u.push(M,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,I=r.dataToPoint([t.get(T[0],k),t.get(T[1],k)]);S=2*k,l.push(I[0],I[1]),u.push(v[S],v[S+1]);var D=T$(g,r,t,k);c.push(D[0],D[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,R=y9(O),P=y9(O),E=y9(O),L=y9(O),N=[],y=0;y<p.length;y++){var B=p[y],z=2*y,F=2*B;R[z]=l[F],R[z+1]=l[F+1],P[z]=u[F],P[z+1]=u[F+1],E[z]=c[F],E[z+1]=c[F+1],L[z]=h[F],L[z+1]=h[F+1],N[y]=d[B]}return{current:R,next:P,stackedOnCurrent:E,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=T5(c.current,n,r,a),d=T5(c.stackedOnCurrent,n,r,a),p=T5(c.next,n,r,a),f=T5(c.stackedOnNext,n,r,a)),T1(h,p)>3e3||l&&T1(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(),_M(s,g,u),l&&(l.setShape({points:h,stackedOnPoints:d}),l.stopAnimation(),_M(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}(k4);function T9(e,t){return{seriesType:e,plan:y4(),reset:function(e){var n=e.getData(),i=e.coordinateSystem,r=e.pipelineContext,o=t||r.large;if(i){var a=vw(i.dimensions,function(e){return n.mapDimension(e)}).slice(0,2),s=a.length,l=n.getCalculationInfo("stackResultDimension");y5(n,a[0])&&(a[0]=l),y5(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&&y9(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 T7=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},Ie=function(e){function t(t){var n=e.call(this,t)||this;return n.type="pointer",n}return xd(t,e),t.prototype.getDefaultShape=function(){return new T7},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}(Sp);function It(e,t){var n=null==e?"":e+"";return t&&(vI(t)?n=t.replace("{value}",n):vT(t)&&(n=t(e))),n}var In=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(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:v1(i[0],n.getWidth()),cy:v1(i[1],n.getHeight()),r:v1(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")?k2:AY,h=u.get("show"),d=u.getModel("lineStyle"),p=d.get("width"),f=[s,l];w9(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(),vb(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=v1(v.get("length"),f),_=v1(y.get("length"),f),C=o,M=(a-o)/b,A=M/w,k=v.getModel("lineStyle").getLineStyle(),T=y.getModel("lineStyle").getLineStyle(),I=v.get("distance"),D=0;D<=b;D++){if(u=Math.cos(C),c=Math.sin(C),v.get("show")){var O=I?I+l:l,R=new A9({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&&R.setStyle({stroke:i(D/b)}),h.add(R)}if(x.get("show")){var O=x.get("distance")+I,P=It(v2(D/b*(m-g)+g),x.get("formatter")),E=i(D/b),L=u*(f-S-O)+d,N=c*(f-S-O)+p,B=x.get("rotate"),z=0;"radial"===B?(z=-C+2*Math.PI)>Math.PI/2&&(z+=Math.PI):"tangential"===B?z=-C-Math.PI/2:vO(B)&&(z=B*Math.PI/180),0===z?h.add(new Sj({style:_B(x,{text:P,x:L,y:N,verticalAlign:c<-.8?"top":c>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:E}),silent:!0})):h.add(new Sj({style:_B(x,{text:P,x:L,y:N,verticalAlign:"middle",align:"center"},{inheritColor:E}),silent:!0,originX:L,originY:N,rotation:z}))}if(y.get("show")&&D!==b){var O=y.get("distance");O=O?O+l:l;for(var F=0;F<=w;F++){var V=new A9({shape:{x1:(u=Math.cos(C))*(f-O)+d,y1:(c=Math.sin(C))*(f-O)+p,x2:u*(f-_-O)+d,y2:c*(f-_-O)+p},silent:!0,style:T});"auto"===T.stroke&&V.setStyle({stroke:i((D+F/w)/b)}),h.add(V),C+=A}C-=A}else C+=M}},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=v1(o.get("width"),r.r),s=v1(o.get("length"),r.r),l=e.get(["pointer","icon"]),u=o.get("offsetCenter"),c=v1(u[0],r.r),h=v1(u[1],r.r),d=o.get("keepAspect");return(i=l?TP(l,c-a/2,h-s,a,s,null,d):new Ie({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")?k2:AY,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);_A(i,{rotation:-((isNaN(+n)?w[0]:v0(n,b,w,!0))+Math.PI/2)},e),u.add(i),m.setItemGraphicEl(t,i)}if(g){var r=_(t,o);_A(r,{shape:{endAngle:v0(n,b,w,f.get("clip"))}},e),u.add(r),SW(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,_M(s,{rotation:-((isNaN(+i)?w[0]:v0(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);_M(y,{shape:{endAngle:v0(i,b,w,f.get("clip"))}},e),u.add(y),SW(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 Sx){var c=s.style;s.useStyle(vg({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(v0(m.get(v,e),b,[0,1],!0))),s.z2EmphasisLift=0,_v(s,t),_f(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,_v(h,t),_f(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=TP(r,t.cx-i/2+v1(o[0],t.r),t.cy-i/2+v1(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 Ah,h=[],d=[],p=e.isAnimationEnabled(),f=e.get(["pointer","showAbove"]);a.diff(this._data).add(function(e){h[e]=new Sj({silent:!0}),d[e]=new Sj({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 Ah,m=i(v0(o,[l,u],[0,1],!0)),v=n.getModel("title");if(v.get("show")){var y=v.get("offsetCenter"),x=r.cx+v1(y[0],r.r),b=r.cy+v1(y[1],r.r),w=h[t];w.attr({z2:2*!f,style:_B(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"),C=r.cx+v1(_[0],r.r),M=r.cy+v1(_[1],r.r),A=v1(S.get("width"),r.r),k=v1(S.get("height"),r.r),T=e.get(["progress","show"])?a.getItemVisual(t,"style").fill:m,w=d[t],I=S.get("formatter");w.attr({z2:2*!f,style:_B(S,{x:C,y:M,text:It(o,I),width:isNaN(A)?null:A,height:isNaN(k)?null:k,align:"center",verticalAlign:"middle"},{inheritColor:T})}),_G(w,{normal:S},o,function(e){return It(e,I)}),p&&function(e,t,n,i,r){var o=_$(e);if(o.valueAnimation&&o.prevValue!==o.value){var a=o.defaultInterpolatedText,s=vz(o.interpolatedValue,o.prevValue),l=o.value;e.percent=0,(null==o.prevValue?_A:_M)(e,{percent:1},i,t,null,function(i){var u=yT(n,o.precision,s,l,i);o.interpolatedValue=1===i?null:u,_P(e,_E({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 It(a?a.interpolatedValue:o,I)}}),g.add(w)}c.add(g)}),this.group.add(c),this._titleEls=h,this._detailEls=d},t.type="gauge",t}(k4);function Ii(e,t,n){t=vk(t)&&{coordDimensions:t}||vg({encodeDefine:e.getEncode()},t);var i=e.getSource(),r=new Ae(At(i,t).dimensions,e);return r.initData(i,n),r}var Ir=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="itemStyle",n}return xd(t,e),t.prototype.getInitialData=function(e,t){return Ii(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}(MU);function Io(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=yx(l,r.fromActionPayload);n.trigger(o,{type:o,seriesId:e.id,name:vk(u)?l.getName(u[0]):l.getName(u),selected:vI(i)?i:vg({},i)})}})}var Ia=2*Math.PI,Is=Math.PI/180;function Il(e,t){return C$(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function Iu(e,t){var n,i,r=Il(e,t),o=e.get("center"),a=e.get("radius");vk(a)||(a=[0,a]);var s=v1(r.width,t.getWidth()),l=v1(r.height,t.getHeight()),u=Math.min(s,l),c=v1(a[0],u/2),h=v1(a[1],u/2),d=e.coordinateSystem;if(d){var p=d.dataToPoint(o);n=p[0]||0,i=p[1]||0}else vk(o)||(o=[o,o]),n=v1(o[0],s)+r.x,i=v1(o[1],l)+r.y;return{cx:n,cy:i,r0:c,r:h}}function Ic(e,t,n){t.eachSeriesByType(e,function(e){var t=e.getData(),i=t.mapDimension("value"),r=Il(e,n),o=Iu(e,n),a=o.cx,s=o.cy,l=o.r,u=o.r0,c=-e.get("startAngle")*Is,h=e.get("endAngle"),d=e.get("padAngle")*Is;h="auto"===h?c-Ia:-h*Is;var p=e.get("minAngle")*Is+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;w9(S,!v),c=S[0];var C=Math.abs((h=S[1])-c),M=C,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:C/f)<p?(i=p,M-=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?v0(e,b,[u,l]):l}),k=r}),M<Ia&&f)if(M<=.001){var T=C/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=M/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 Ih(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))}w7.CMD;var Id=new xV,Ip=new xV,If=new xV,Ig=new xV,Im=new xV,Iv=[],Iy=new xV;function Ix(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 Ib(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=bu(i[0],i[1]),o=bu(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=bh([],i[1],i[0],a/r),l=bh([],i[1],i[2],a/o),u=bh([],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 Iw=Math.PI/180;function IS(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;I_(l,p,!0),l.label.x=h}}}function I_(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 IC(e){return"center"===e.position}var IM=function(e){function t(t,n,i){var r=e.call(this)||this;r.z2=2;var o=new Sj;return r.setTextContent(o),r.updateData(t,n,i,!0),r}return xd(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=vg(Ta(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?(_A(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,_A(this,{shape:{r:s.r}},r,t)):null!=n?(this.setShape({startAngle:n,endAngle:n}),_A(this,{shape:{startAngle:s.startAngle,endAngle:s.endAngle}},r,t)):(this.shape.endAngle=s.startAngle,_M(this,{shape:{endAngle:s.endAngle}},r,t))}else _O(this),_M(this,{shape:l},r,t);this.useStyle(e.getItemVisual(t,"style")),_v(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=vg({r:s.r+(a.get("scale")&&a.get("scaleSize")||0)},Ta(a.getModel("itemStyle"),s)),vg(this.ensureState("select"),{x:d,y:p,shape:Ta(o.getModel(["select","itemStyle"]),s)}),vg(this.ensureState("blur"),{shape:Ta(o.getModel(["blur","itemStyle"]),s)});var g=this.getTextGuideLine(),m=this.getTextContent();g&&vg(g.ensureState("select"),{x:d,y:p}),vg(m.ensureState("select"),{x:d,y:p}),_f(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;_L(this,_N(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 A3,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<SZ.length;l++){var u=SZ[l],c=t[u],h="normal"===u;if(c){var d=c.get("show");if((h?s:vz(r.states[u]&&r.states[u].ignore,s))||!vz(d,a)){var p=h?i:i&&i.states[u];p&&(p.ignore=!0),i&&Ix(i,!0,u,c);continue}!i&&(i=new A3,e.setTextGuideLine(i),h||!s&&a||Ix(i,!0,"normal",t.normal),e.stateProxy&&(i.stateProxy=e.stateProxy)),Ix(i,!1,u,c)}}if(i){vm(i.style,n),i.style.fill=null;var f=o.get("showAbove");(e.textGuideLineConfig=e.textGuideLineConfig||{}).showAbove=f||!1,i.buildPath=Ib}}(this,function(e,t){t=t||"labelLine";for(var n={normal:e.getModel(t)},i=0;i<SY.length;i++){var r=SY[i];n[r]=e.getModel([r,t])}return n}(i),{stroke:a,opacity:vF(r.get(["lineStyle","opacity"]),s,1)})}},t}(AY),IA=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return xd(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 AY({shape:Iu(e,n)});c.useStyle(e.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=c,s.add(c)}o.diff(a).add(function(e){var t=new IM(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){_D(a.getItemGraphicEl(t),e,t)}).execute(),function(e){var t,n,i=e.getData(),r=[],o=!1,a=(e.get("minShowLabelAngle")||0)*Iw,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"),C=v1(b.get("edgeDistance"),u),M=b.get("bleedMargin"),A=x.getModel("labelLine"),k=A.get("length");k=v1(k,u);var T=A.get("length2");if(T=v1(T,u),Math.abs(m.endAngle-m.startAngle)<a){vb(v.states,p),v.ignore=!0,y&&(vb(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 I=(m.startAngle+m.endAngle)/2,D=Math.cos(I),O=Math.sin(I);t=m.cx,n=m.cy;var R="inside"===w||"inner"===w;if("center"===w)s=m.cx,h=m.cy,f="center";else{var P=(R?(m.r+m.r0)/2*D:m.r*D)+t,E=(R?(m.r+m.r0)/2*O:m.r*O)+n;if(s=P+3*D,h=E+3*O,!R){var L=P+D*(k+l-m.r),N=E+O*(k+l-m.r),B=L+(D<0?-1:1)*T;s="edge"===_?D<0?c+C:c+u-C:B+(D<0?-S:S),h=N,d=[[P,E],[L,N],[B,N]]}f=R?"center":"edge"===_?D>0?"right":"left":D>0?"left":"right"}var z=Math.PI,F=0,V=b.get("rotate");if(vO(V))F=z/180*V;else if("center"===w)F=0;else if("radial"===V||!0===V)F=D<0?-I+z:-I;else if("tangential"===V&&"outside"!==w&&"outer"!==w){var j=Math.atan2(D,O);j<0&&(j=2*z+j),O>0&&(j=z+j),F=j-z}if(o=!!F,v.x=s,v.y=h,v.rotation=F,v.setStyle({verticalAlign:"middle"}),R){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 $=(v.style.margin||0)+2.1;W.y-=$/2,W.height+=$,r.push({label:v,labelLine:y,position:w,len:k,len2:T,minTurnAngle:A.get("minTurnAngle"),maxSurfaceAngle:A.get("maxSurfaceAngle"),surfaceNormal:new xV(D,O),linePoints:d,textAlign:f,labelDistance:S,labelAlignTo:_,edgeDistance:C,bleedMargin:M,rect:W,unconstrainedWidth:W.width,labelStyleWidth:v.style.width})}g.setTextConfig({inside:R})}}),!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;IC(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(!IC(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,I_(f,m)}}IS(u,t,n,i,1,r,o,a,s,h),IS(l,t,n,i,-1,r,o,a,s,c);for(var d=0;d<e.length;d++){var f=e[d];if(!IC(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&&(vb(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?(vb(v.states,p),v.ignore=!0):(!function(e,t){if(t<=180&&t>0){t=t/180*Math.PI,Id.fromArray(e[0]),Ip.fromArray(e[1]),If.fromArray(e[2]),xV.sub(Ig,Id,Ip),xV.sub(Im,If,Ip);var n=Ig.len(),i=Im.len();if(!(n<.001)&&!(i<.001)&&(Ig.scale(1/n),Im.scale(1/i),Math.cos(t)<Ig.dot(Im))){var r=Ih(Ip.x,Ip.y,If.x,If.y,Id.x,Id.y,Iv,!1);Iy.fromArray(Iv),Iy.scaleAndAdd(Im,r/Math.tan(Math.PI-t));var o=If.x!==Ip.x?(Iy.x-Ip.x)/(If.x-Ip.x):(Iy.y-Ip.y)/(If.y-Ip.y);if(isNaN(o))return;o<0?xV.copy(Iy,Ip):o>1&&xV.copy(Iy,If),Iy.toArray(e[1])}}}(b,g.minTurnAngle),function(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,Id.fromArray(e[0]),Ip.fromArray(e[1]),If.fromArray(e[2]),xV.sub(Ig,Ip,Id),xV.sub(Im,If,Ip);var i=Ig.len(),r=Im.len();if(!(i<.001)&&!(r<.001)&&(Ig.scale(1/i),Im.scale(1/r),Ig.dot(t)<Math.cos(n))){var o=Ih(Ip.x,Ip.y,If.x,If.y,Id.x,Id.y,Iv,!1);Iy.fromArray(Iv);var a=Math.PI/2,s=a+Math.acos(Im.dot(t))-n;if(s>=a)xV.copy(Iy,If);else{Iy.scaleAndAdd(Im,o/Math.tan(Math.PI/2-s));var l=If.x!==Ip.x?(Iy.x-Ip.x)/(If.x-Ip.x):(Iy.y-Ip.y)/(If.y-Ip.y);if(isNaN(l))return;l<0?xV.copy(Iy,Ip):l>1&&xV.copy(Iy,If)}Iy.toArray(e[1])}}}(b,g.surfaceNormal,g.maxSurfaceAngle),v.setShape({points:b}),m.__hostTarget.textGuideLineConfig={anchor:new xV(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}(k4),Ik=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}(),IT=yb(),II=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new Ik(vM(this.getData,this),vM(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return Ii(this,{coordDimensions:["value"],encodeDefaulter:vA(yF,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),i=IT(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=vS(e,function(e,t){return e+(isNaN(t)?0:t)},0);if(0===n)return[];for(var i=Math.pow(10,t),r=vw(e,function(e){return(isNaN(e)?0:e)/n*i*100}),o=100*i,a=vw(r,function(e){return Math.floor(e)}),s=vS(a,function(e,t){return e+t},0),l=vw(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 vw(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){yh(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}(MU),ID=function(e,t){this.target=e,this.topTarget=t&&t.topTarget},IO=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 ID(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 ID(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 ID(s,e),"dragleave",e.event),a&&a!==s&&this.handler.dispatchToElement(new ID(a,e),"dragenter",e.event))}},e.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new ID(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new ID(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},e}(),IR=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,IP=[],IE=ys.browser.firefox&&39>+ys.browser.version.split(".")[0];function IL(e,t,n,i){return n=n||{},i?IN(e,t,n):IE&&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):IN(e,t,n),n}function IN(e,t,n){if(ys.domSupported&&e.getBoundingClientRect){var i=t.clientX,r=t.clientY;if(Cn(e)){var o=e.getBoundingClientRect();n.zrX=i-o.left,n.zrY=r-o.top;return}if(Ct(IP,e,i,r)){n.zrX=IP[0],n.zrY=IP[1];return}}n.zrX=n.zrY=0}function IB(e){return e||window.event}function Iz(e,t,n){if(null!=(t=IB(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&&IL(e,r,t,n)}else{IL(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&&IR.test(t.type)&&(t.which=1&a?1:2&a?3:4&a?2:0),t}function IF(e,t,n,i){e.addEventListener(t,n,i)}var IV=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function Ij(e){return 2===e.which||3===e.which}var IH=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=IL(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 I$)if(I$.hasOwnProperty(t)){var n=I$[t](this._track,e);if(n)return n}},e}();function IW(e){var t=e[1][0]-e[0][0],n=e[1][1]-e[0][1];return Math.sqrt(t*t+n*n)}var I$={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=IW(i)/IW(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}}}}},IG="silent";function IU(){IV(this.event)}var Iq=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handler=null,t}return xA(t,e),t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(wd),IY=function(e,t){this.x=e,this.y=t},IZ=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],IX=new xZ(0,0,0,0),IK=function(e){function t(t,n,i,r,o){var a=e.call(this)||this;return a._hovered=new IY(0,0),a.storage=t,a.painter=n,a.painterRoot=r,a._pointerSize=o,i=i||new Iq,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new IO(a),a}return xA(t,e),t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(vb(IZ,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=IJ(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 IY(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 IY(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:IU};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 IY(e,t);if(IQ(i,r,e,t,n),this._pointerSize&&!r.target){for(var o=[],a=this._pointerSize,s=a/2,l=new xZ(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||(IX.copy(c.getBoundingRect()),c.transform&&IX.applyTransform(c.transform),IX.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(IQ(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 IH);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 IY;o.target=i.target,this.dispatchToElement(o,r,i.event)}},t}(wd);function IQ(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||IG}return!1}(a,n,i))&&(t.topTarget||(t.topTarget=a),s!==IG)){t.target=a;break}}}function IJ(e,t,n){var i=e.painter;return t<0||t>i.getWidth()||n<0||n>i.getHeight()}function I0(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 I1(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 I2(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 I5(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 I3(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=I0(e,n,i,t),I1(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=I5(e[c],e,l,u,0,t);l+=d,0==(u-=d)||0!==(h=I2(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=I5(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=I2(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-I5(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-I2(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=I0(e,n,i,t))<s){var l=r;l>s&&(l=s),I1(e,n,n+l,n+o,t),o=l}a.pushRun(n,o),a.mergeRuns(),r-=o,n+=o}while(0!==r);a.forceMergeRuns()}}vb(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(e){IK.prototype[e]=function(t){var n,i,r=t.zrX,o=t.zrY,a=IJ(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||bu(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,e,t)}});var I4=!1;function I6(){I4||(I4=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function I8(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var I9=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=I8}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,I3(n,I8)},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)&&(I6(),e.z=0),isNaN(e.z2)&&(I6(),e.z2=0),isNaN(e.zlevel)&&(I6(),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=vv(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 I7(){return new Date().getTime()}Y=ys.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var De=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 xA(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=I7()-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=I7(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=I7(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=I7()-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 wh(e,t.loop);return this.addAnimator(n),n},t}(wd),Dt=ys.domSupported,Dn=(C={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},M=vw(_=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],function(e){var t=e.replace("mouse","pointer");return C.hasOwnProperty(t)?t:e}),{mouse:_,touch:["touchstart","touchend","touchmove"],pointer:M}),Di=["mousemove","mouseup"],Dr=["pointermove","pointerup"],Do=!1;function Da(e){var t=e.pointerType;return"pen"===t||"touch"===t}function Ds(e){e&&(e.zrByTouch=!0)}function Dl(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 Du=function(e,t){this.stopPropagation=vQ,this.stopImmediatePropagation=vQ,this.preventDefault=vQ,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY},Dc={mousedown:function(e){e=Iz(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=Iz(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=Iz(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){Dl(this,(e=Iz(this.dom,e)).toElement||e.relatedTarget)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){Do=!0,e=Iz(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){Do||(e=Iz(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){Ds(e=Iz(this.dom,e)),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Dc.mousemove.call(this,e),Dc.mousedown.call(this,e)},touchmove:function(e){Ds(e=Iz(this.dom,e)),this.handler.processGesture(e,"change"),Dc.mousemove.call(this,e)},touchend:function(e){Ds(e=Iz(this.dom,e)),this.handler.processGesture(e,"end"),Dc.mouseup.call(this,e),new Date-this.__lastTouchMoment<300&&Dc.click.call(this,e)},pointerdown:function(e){Dc.mousedown.call(this,e)},pointermove:function(e){Da(e)||Dc.mousemove.call(this,e)},pointerup:function(e){Dc.mouseup.call(this,e)},pointerout:function(e){Da(e)||Dc.mouseout.call(this,e)}};vb(["click","dblclick","contextmenu"],function(e){Dc[e]=function(t){t=Iz(this.dom,t),this.trigger(e,t)}});var Dh={pointermove:function(e){Da(e)||Dh.mousemove.call(this,e)},pointerup:function(e){Dh.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 Dd(e,t,n,i){e.mounted[t]=n,e.listenerOpts[t]=i,IF(e.domTarget,t,n,i)}function Dp(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 Df=function(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t},Dg=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 Df(t,Dc),Dt&&(o._globalHandlerScope=new Df(document,Dh)),r=(i=o._localHandlerScope).domHandlers,ys.pointerEventsSupported?vb(Dn.pointer,function(e){Dd(i,e,function(t){r[e].call(o,t)})}):(ys.touchEventsSupported&&vb(Dn.touch,function(e){Dd(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)})}),vb(Dn.mouse,function(e){Dd(i,e,function(t){t=IB(t),i.touching||r[e].call(o,t)})})),o}return xA(t,e),t.prototype.dispose=function(){Dp(this._localHandlerScope),Dt&&Dp(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,Dt&&this.__pointerCapturing^e){this.__pointerCapturing=e;var t=this._globalHandlerScope;e?function(e,t){ys.pointerEventsSupported?vb(Dr,n):ys.touchEventsSupported||vb(Di,n);function n(n){Dd(t,n,function(i){if(!Dl(e,(i=IB(i)).target)){var r;r=i,i=Iz(e.dom,new Du(e,r),!0),t.domHandlers[n].call(e,i)}},{capture:!0})}}(this,t):Dp(t)}},t}(wd),Dm={},Dv={},Dy=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 I9,a=n.renderer||"canvas";Dm[a]||(a=vC(Dm)[0]),n.useDirtyRect=null!=n.useDirtyRect&&n.useDirtyRect;var s=new Dm[a](t,o,n,e),l=n.ssr||s.ssrOnly;this.storage=o,this.painter=s;var u=ys.node||ys.worker||l?null:new Dg(s.getViewportRoot(),s.root),c=n.useCoarsePointer;(null==c||"auto"===c?ys.touchEventsSupported:!!c)&&(i=vz(n.pointerSize,44)),this.handler=new IK(o,s,u,s.root,i),this.animation=new De({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>b9(e,1);if(e.colorStops){for(var t=e.colorStops,n=0,i=t.length,r=0;r<i;r++)n+=b9(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=I7();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var i=I7();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 Ah&&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 Dv[e]}},e}();function Dx(e,t){var n=new Dy(vh++,e,t);return Dv[n.id]=n,n}var Db="";"u">typeof navigator&&(Db=navigator.platform||"");var Dw="rgba(0, 0, 0, 0.2)";let DS={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Dw,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Dw,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Dw,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Dw,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Dw,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Dw,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Db.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 D_=vY(),DC="\0_ec_inner",DM=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(t,e),t.prototype.init=function(e,t,n,i,r,o){i=i||{},this.option=null,this._theme=new _2(i),this._locale=new _2(r),this._optionManager=o},t.prototype.setOption=function(e,t,n){var i=DT(t);this._optionManager.setOption(e,n,i),this._resetOption(null,i)},t.prototype.resetOption=function(e,t){return this._resetOption(e,DT(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&&vb(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=vY(),s=t&&t.replaceMergeMainTypeMap;yB(this).datasetMap=vY(),vb(e,function(e,t){null!=e&&(CX.hasClass(t)?t&&(o.push(t),a.set(t,!0)):n[t]=null==n[t]?vp(e):vf(n[t],e,!0))}),s&&s.each(function(e,t){CX.hasClass(t)&&!a.get(t)&&(o.push(t),a.set(t,!0))}),CX.topologicalTravel(o,CX.getAllClassMainTypes(),function(t){var o,a,l,u,c,h,d,p,f,g,m,v,y,x,b,w,S,_,C,M,A=function(e,t,n){var i=D_.get(t);if(!i)return n;var r=i(e);return r?n.concat(r):n}(this,t,yc(e[t])),k=i.get(t),T=k?s&&s.get(t)?"replaceMerge":"normalMerge":"replaceAll",I=(y=k,x=A,b="normalMerge"===T,w="replaceMerge"===T,S="replaceAll"===T,y=y||[],x=(x||[]).slice(),_=vY(),vb(x,function(e,t){if(!vR(e)){x[t]=null;return}}),C=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||yy(o)?null:o,newOption:null,keyInfo:null,brandNew:null})}return i}(y,_,T),(b||w)&&(o=C,a=y,l=_,vb(u=x,function(e,t){if(e&&null!=e.id){var n=yg(e.id),i=l.get(n);if(null!=i){var r=o[i];vH(!r.newOption,'Duplicated option on id "'+n+'".'),r.newOption=e,r.existing=a[i],u[t]=null}}})),b&&(c=C,vb(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)&&!yy(e)&&!yy(i)&&yf("name",i,e)){c[n].newOption=e,h[t]=null;return}}})),b||w?(d=C,p=x,f=w,vb(p,function(e){if(e){for(var t,n=0;(t=d[n])&&(t.newOption||yy(t.existing)||t.existing&&null!=e.id&&!yf("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=C,vb(x,function(e){g.push({newOption:e,brandNew:!0,existing:null,keyInfo:null})})),m=C,v=vY(),vb(m,function(e){var t=e.existing;t&&v.set(t.id,e)}),vb(m,function(e){var t=e.newOption;vH(!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={})}),vb(m,function(e,t){var n=e.existing,i=e.newOption,r=e.keyInfo;if(vR(i)){if(r.name=null!=i.name?yg(i.name):n?n.name:yl+t,n)r.id=yg(n.id);else if(null!=i.id)r.id=yg(i.id);else{var o=0;do r.id="\0"+r.name+"\0"+o++;while(v.get(r.id))}v.set(r.id,e)}}),C);vb(I,function(e){var n,i,r,o,a=e.newOption;vR(a)&&(e.keyInfo.mainType=t,e.keyInfo.subType=(n=t,i=a,r=e.existing,o=CX,i.type?i.type:r?r.subType:o.determineSubType(n,i)))}),n[t]=null,i.set(t,null),r.set(t,0);var D=[],O=[],R=0;vb(I,function(e,n){var i=e.existing,r=e.newOption;if(r){var o="series"===t,a=CX.getClass(t,e.keyInfo.subType,!o);if(!a)return;if("tooltip"===t){if(M)return;M=!0}if(i&&i.constructor===a)i.name=e.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1);else{var s=vg({componentIndex:n},e.keyInfo);vg(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?(D.push(i.option),O.push(i),R++):(D.push(void 0),O.push(void 0))},this),n[t]=D,i.set(t,O),r.set(t,R),"series"===t&&Z(this)},this),this._seriesIndices||Z(this)},t.prototype.getOption=function(){var e=vp(this.option);return vb(e,function(t,n){if(CX.hasClass(n)){for(var i=yc(t),r=i.length,o=!1,a=r-1;a>=0;a--)i[a]&&!yy(i[a])?o=!0:(i[a]=null,!o&&r--);i.length=r,e[n]=i}}),delete e[DC],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=[],vb(yc(i),function(e){a[e]&&t.push(a[e])})):t=null!=r?DA("id",r,a):null!=o?DA("name",o,a):v_(a,function(e){return!!e}),Dk(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=Dk(l?this.queryComponents(l):v_(this._componentsMap.get(s),function(e){return!!e}),e),e.filter?v_(o,e.filter):o},t.prototype.eachComponent=function(e,t,n){var i=this._componentsMap;if(vT(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=vI(e)?i.get(e):vR(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=ym(e,null);return v_(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 v_(this._componentsMap.get("series"),function(t){return!!t&&t.subType===e})},t.prototype.getSeries=function(){return v_(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),vb(this._seriesIndices,function(n){var i=this._componentsMap.get("series")[n];e.call(t,i,n)},this)},t.prototype.eachRawSeries=function(e,t){vb(this._componentsMap.get("series"),function(n){n&&e.call(t,n,n.componentIndex)})},t.prototype.eachSeriesByType=function(e,t,n){X(this),vb(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 vb(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=[];vb(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=vY(n)},t.prototype.restoreData=function(e){Z(this);var t=this._componentsMap,n=[];t.each(function(e,t){CX.hasClass(t)&&n.push(t)}),CX.topologicalTravel(n,CX.getAllClassMainTypes(),function(n){vb(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=[];vb(e._componentsMap.get("series"),function(e){e&&t.push(e.componentIndex)}),e._seriesIndicesMap=vY(t)},X=function(e){},K=function(e,t){e.option={},e.option[DC]=1,e._componentsMap=vY({series:[]}),e._componentsCount=vY();var n,i,r,o=t.aria;vR(o)&&null==o.enabled&&(o.enabled=!0),n=t,i=e._theme.option,r=n.color&&!n.colorLayer,vb(i,function(e,t){("colorLayer"!==t||!r)&&(CX.hasClass(t)||("object"==typeof e?n[t]=n[t]?vf(n[t],e,!1):vp(e):null==n[t]&&(n[t]=e)))}),vf(t,DS,!1),e._mergeOption(t,null)}),t}(_2);function DA(e,t,n){if(vk(t)){var i=vY();return vb(t,function(e){null!=e&&null!=ym(e,null)&&i.set(e,!0)}),v_(n,function(t){return t&&i.get(t[e])})}var r=ym(t,null);return v_(n,function(t){return t&&null!=r&&t[e]===r})}function Dk(e,t){return t.hasOwnProperty("subType")?v_(e,function(e){return e&&e.subType===t.subType}):e}function DT(e){var t=vY();return e&&vb(yc(e.replaceMerge),function(e){t.set(e,!0)}),{replaceMergeMainTypeMap:t}}vy(DM,C0);var DI=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"];let DD=function(e){vb(DI,function(t){this[t]=vM(e[t],e)},this)};var DO=/^(min|max)?(.+)$/,DR=function(){function e(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return e.prototype.setOption=function(e,t,n){e&&(vb(yc(e.series),function(e){e&&e.data&&vE(e.data)&&(e.data[v$]=!0)}),vb(yc(e.dataset),function(e){e&&e.source&&vE(e.source)&&(e.source[v$]=!0)})),e=vp(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){vb(t,function(t){t(e,n)})}return a?(r=a).timeline||(r.timeline=s):((h||c)&&(e.options=e.media=null),r=e),c&&vk(u)&&vb(u,function(e){e&&e.option&&(e.query?o.push(e):i||(i=e))}),d(r),vb(l,function(e){return d(e)}),vb(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=[],vp(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=vp(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 vb(e,function(e,t){var n=t.match(DO);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=vw(s,function(e){return vp(-1===e?a.option:o[e].option)})),this._currentMediaIndices=s,l},e}(),DP=vR,DE=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function DL(e){var t=e&&e.itemStyle;if(t)for(var n=0,i=DE.length;n<i;n++){var r=DE[n],o=t.normal,a=t.emphasis;o&&o[r]&&(e[r]=e[r]||{},e[r].normal?vf(e[r].normal,o[r]):e[r].normal=o[r],o[r]=null),a&&a[r]&&(e[r]=e[r]||{},e[r].emphasis?vf(e[r].emphasis,a[r]):e[r].emphasis=a[r],a[r]=null)}}function DN(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,vm(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 DB(e){DN(e,"itemStyle"),DN(e,"lineStyle"),DN(e,"areaStyle"),DN(e,"label"),DN(e,"labelLine"),DN(e,"upperLabel"),DN(e,"edgeLabel")}function Dz(e,t){var n=DP(e)&&e[t],i=DP(n)&&n.textStyle;if(i)for(var r=0,o=yd.length;r<o;r++){var a=yd[r];i.hasOwnProperty(a)&&(n[a]=i[a])}}function DF(e){e&&(DB(e),Dz(e,"label"),e.emphasis&&Dz(e.emphasis,"label"))}function DV(e){return vk(e)?e:e?[e]:[]}function Dj(e){return(vk(e)?e[0]:e)||{}}function DH(e){e&&vb(DW,function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])})}var DW=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],D$=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],DG=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function DU(e){var t=e&&e.itemStyle;if(t)for(var n=0;n<DG.length;n++){var i=DG[n][1],r=DG[n][0];null!=t[i]&&(t[r]=t[i])}}function Dq(e){e&&"edge"===e.alignTo&&null!=e.margin&&null==e.edgeDistance&&(e.edgeDistance=e.margin)}function DY(e){e&&e.downplay&&!e.blur&&(e.blur=e.downplay)}function DZ(e,t){var n;vb(DV(e.series),function(e){DP(e)&&function(e){if(DP(e)){DL(e),DB(e),Dz(e,"label"),Dz(e,"upperLabel"),Dz(e,"edgeLabel"),e.emphasis&&(Dz(e.emphasis,"label"),Dz(e.emphasis,"upperLabel"),Dz(e.emphasis,"edgeLabel"));var t=e.markPoint;t&&(DL(t),DF(t));var n=e.markLine;n&&(DL(n),DF(n));var i=e.markArea;i&&DF(i);var r=e.data;if("graph"===e.type){r=r||e.nodes;var o=e.links||e.edges;if(o&&!vE(o))for(var a=0;a<o.length;a++)DF(o[a]);vb(e.categories,function(e){DB(e)})}if(r&&!vE(r))for(var a=0;a<r.length;a++)DF(r[a]);if((t=e.markPoint)&&t.data)for(var s=t.data,a=0;a<s.length;a++)DF(s[a]);if((n=e.markLine)&&n.data)for(var l=n.data,a=0;a<l.length;a++)vk(l[a])?(DF(l[a][0]),DF(l[a][1])):DF(l[a]);"gauge"===e.type?(Dz(e,"axisLabel"),Dz(e,"title"),Dz(e,"detail")):"treemap"===e.type?(DN(e.breadcrumb,"itemStyle"),vb(e.levels,function(e){DB(e)})):"tree"===e.type&&DB(e.leaves)}}(e)}),n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"],t&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),vb(n,function(t){vb(DV(e[t]),function(e){e&&(Dz(e,"axisLabel"),Dz(e.axisPointer,"label"))})}),vb(DV(e.parallel),function(e){var t=e&&e.parallelAxisDefault;Dz(t,"axisLabel"),Dz(t&&t.axisPointer,"label")}),vb(DV(e.calendar),function(e){DN(e,"itemStyle"),Dz(e,"dayLabel"),Dz(e,"monthLabel"),Dz(e,"yearLabel")}),vb(DV(e.radar),function(e){Dz(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)}),vb(DV(e.geo),function(e){DP(e)&&(DF(e),vb(DV(e.regions),function(e){DF(e)}))}),vb(DV(e.timeline),function(e){DF(e),DN(e,"label"),DN(e,"itemStyle"),DN(e,"controlStyle",!0);var t=e.data;vk(t)&&vb(t,function(e){vR(e)&&(DN(e,"label"),DN(e,"itemStyle"))})}),vb(DV(e.toolbox),function(e){DN(e,"iconStyle"),vb(e.feature,function(e){DN(e,"iconStyle")})}),Dz(Dj(e.axisPointer),"label"),Dz(Dj(e.tooltip).axisPointer,"label"),e.series=yc(e.series),vb(e.series,function(e){if(vR(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),Dq(e.label);var n=e.data;if(n&&!vE(n))for(var i=0;i<n.length;i++)Dq(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){DU(e),DU(e.backgroundStyle),DU(e.emphasis);var n=e.data;if(n&&!vE(n))for(var i=0;i<n.length;i++)"object"==typeof n[i]&&(DU(n[i]),DU(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)),DY(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,DY)}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&&vm(e,e.mapLocation));null!=e.hoverAnimation&&(e.emphasis=e.emphasis||{},e.emphasis&&null==e.emphasis.scale&&(e.emphasis.scale=e.hoverAnimation)),DH(e)}}),e.dataRange&&(e.visualMap=e.dataRange),vb(D$,function(t){var n=e[t];n&&(vk(n)||(n=[n]),vb(n,function(e){DH(e)}))})}function DX(e){vb(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(v3(e),v3(t)),i=e+t;return n>20?i:v2(i,n)}(p,v),f=v;break}}}return i[0]=p,i[1]=f,i})})}var DK=function(){function e(){this.group=new Ah,this.uid=_3("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}();xm(DK),xw(DK);var DQ=yb(),DJ={itemStyle:xS(_J,!0),lineStyle:xS(_X,!0)},D0={lineStyle:"stroke",itemStyle:"fill"};function D1(e,t){var n=e.visualStyleMapper||DJ[t];return n||(console.warn("Unknown style type '"+t+"'."),DJ.itemStyle)}function D2(e,t){var n=e.visualDrawType||D0[t];return n||(console.warn("Unknown style type '"+t+"'."),"fill")}var D5=new _2,D3=Math.PI,D4=function(){function e(e,t,n,i){this._stageTaskMap=vY(),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=vY();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;vb(this._allHandlers,function(i){var r=e.get(i.uid)||e.set(i.uid,{});vH(!(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))}vb(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=vY(),s=e.seriesType,l=e.getTargetSeries;function u(t){var s=t.uid,l=a.set(s,o&&o.get(s)||Mi({plan:Oe,reset:Ot,count:Or}));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||Mi({reset:D6});o.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:r};var a=o.agentStubMap,s=o.agentStubMap=vY(),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,Mi({reset:D8,onDirty:D7})));n.context={model:e,overallProgress:c},n.agent=o,n.__block=c,r._pipe(e,n)}vH(!e.createOnAllSeries,""),l?n.eachRawSeriesByType(l,d):u?u(n,i).each(d):(c=!1,vb(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 vT(e)&&(e={overallReset:e,seriesType:function(e){Q=null;try{e(Oo,Oa)}catch(e){}return Q}(e)}),e.uid=_3("stageHandler"),t&&(e.visualType=t),e},e}();function D6(e){e.overallReset(e.ecModel,e.api,e.payload)}function D8(e){return e.overallProgress&&D9}function D9(){this.agent.dirty(),this.getDownstream().dirty()}function D7(){this.agent&&this.agent.dirty()}function Oe(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function Ot(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=yc(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?vw(t,function(e,t){return Oi(t)}):On}var On=Oi(0);function Oi(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 Or(e){return e.data.count()}var Oo={},Oa={};function Os(e,t){for(var n in t.prototype)e[n]=vQ}Os(Oo,DM),Os(Oa,DD),Oo.eachSeriesByType=Oo.eachRawSeriesByType=function(e){Q=e},Oo.eachComponent=function(e){"series"===e.mainType&&e.subType&&(Q=e.subType)};var Ol=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],Ou="#B9B8CE",Oc="#100C2A",Oh=function(){return{axisLine:{lineStyle:{color:Ou}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},Od=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],Op={darkMode:!0,color:Od,backgroundColor:Oc,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:Ou}},textStyle:{color:Ou},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:Ou}},dataZoom:{borderColor:"#71708A",textStyle:{color:Ou},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:Ou}},timeline:{lineStyle:{color:Ou},label:{color:Ou},controlStyle:{color:Ou,borderColor:Ou}},calendar:{itemStyle:{color:Oc},dayLabel:{color:Ou},monthLabel:{color:Ou},yearLabel:{color:Ou}},timeAxis:Oh(),logAxis:Oh(),valueAxis:Oh(),categoryAxis:Oh(),line:{symbol:"circle"},graph:{color:Od},gauge:{title:{color:Ou},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:Ou},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};Op.categoryAxis.splitLine.show=!1;var Of=function(){function e(){}return e.prototype.normalizeQuery=function(e){var t={},n={},i={};if(vI(e)){var r=xg(e);t.mainType=r.main||null,t.subType=r.sub||null}else{var o=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};vb(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}(),Og=["symbol","symbolSize","symbolRotate","symbolOffset"],Om=Og.concat(["symbolKeepAspect"]);function Ov(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 Oy(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 Ox(e,t,n){for(var i;e&&(!t(e)||(i=e,!n));)e=e.__hostTarget||e.parent;return i}var Ob=Math.round(9*Math.random()),Ow="function"==typeof Object.defineProperty,OS=function(){function e(){this._id="__ec_inner_"+Ob++}return e.prototype.get=function(e){return this._guard(e)[this._id]},e.prototype.set=function(e,t){var n=this._guard(e);return Ow?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 O_(e){return isFinite(e)}function OC(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=O_(a)?a:.5,s=O_(s)?s:.5,l=l>=0&&O_(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=O_(u)?u:0,c=O_(c)?c:1,h=O_(h)?h:0,d=O_(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 OM(e){return parseInt(e,10)}function OA(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]||OM(s[i])||OM(e.style[i]))-(OM(s[o])||0)-(OM(s[a])||0)|0}function Ok(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]:vO(t)?[t]:vk(t)?t:null:null),o=i.lineDashOffset;if(r){var a=i.strokeNoScale&&e.getLineScale?e.getLineScale():1;a&&1!==a&&(r=vw(r,function(e){return e/a}),o/=a)}return[r,o]}var OT=new w7(!0);function OI(e){var t=e.stroke;return null!=t&&"none"!==t&&e.lineWidth>0}function OD(e){return"string"==typeof e&&"none"!==e}function OO(e){var t=e.fill;return null!=t&&"none"!==t}function OR(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 OP(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 OE(e,t,n){var i=xO(t.image,t.__image,n);if(xP(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)*vJ),o.scaleSelf(t.scaleX||1,t.scaleY||1),r.setTransform(o)}return r}}var OL=["shadowBlur","shadowOffsetX","shadowOffsetY"],ON=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function OB(e,t,n,i,r){var o=!1;if(!i&&t===(n=n||{}))return!1;if(i||t.opacity!==n.opacity){OV(e,r),o=!0;var a=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(a)?wk.opacity:a}(i||t.blend!==n.blend)&&(o||(OV(e,r),o=!0),e.globalCompositeOperation=t.blend||wk.blend);for(var s=0;s<OL.length;s++){var l=OL[s];(i||t[l]!==n[l])&&(o||(OV(e,r),o=!0),e[l]=e.dpr*(t[l]||0))}return(i||t.shadowColor!==n.shadowColor)&&(o||(OV(e,r),o=!0),e.shadowColor=t.shadowColor||wk.shadowColor),o}function Oz(e,t,n,i,r){var o=Oj(t,r.inHover),a=i?null:n&&Oj(n,r.inHover)||{};if(o===a)return!1;var s=OB(e,o,a,i,r);if((i||o.fill!==a.fill)&&(s||(OV(e,r),s=!0),OD(o.fill)&&(e.fillStyle=o.fill)),(i||o.stroke!==a.stroke)&&(s||(OV(e,r),s=!0),OD(o.stroke)&&(e.strokeStyle=o.stroke)),(i||o.opacity!==a.opacity)&&(s||(OV(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||(OV(e,r),s=!0),e.lineWidth=l)}for(var u=0;u<ON.length;u++){var c=ON[u],h=c[0];(i||o[h]!==a[h])&&(s||(OV(e,r),s=!0),e[h]=o[h]||c[1])}return s}function OF(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 OV(e,t){t.batchFill&&e.fill(),t.batchStroke&&e.stroke(),t.batchFill="",t.batchStroke=""}function Oj(e,t){return t&&e.__hoverStyle||e.style}function OH(e,t){OW(e,t,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function OW(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&&(OV(e,n),e.restore(),u=l=!0,n.prevElClipPaths=null,n.allClipped=!1,n.prevEl=null),a&&a.length){OV(e,n),e.save();for(var c=!1,h=0;h<a.length;h++){var d=a[h];c=c||d.isZeroArea(),OF(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 Sp&&t.autoBatch&&(v=OO(m=t.style),y=OI(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||OV(e,n):(OV(e,n),OF(e,t));var g=Oj(t,n.inHover);if(t instanceof Sp)1!==n.lastDrawType&&(u=!0,n.lastDrawType=1),Oz(e,t,p,u,n),f&&(n.batchFill||n.batchStroke)||e.beginPath(),function(e,t,n,i){var r,o,a,s=OI(n),l=OO(n),u=n.strokePercent,c=u<1,h=!t.path;(!t.silent||c)&&h&&t.createPathProxy();var d=t.path||OT,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,C=void 0;(m||v)&&(C=t.getBoundingRect()),m&&(b=p?OC(e,f,C):t.__canvasFillGradient,t.__canvasFillGradient=b),v&&(w=p?OC(e,g,C):t.__canvasStrokeGradient,t.__canvasStrokeGradient=w),y&&(S=p||!t.__canvasFillPattern?OE(e,f,t):t.__canvasFillPattern,t.__canvasFillPattern=S),x&&(_=p||!t.__canvasStrokePattern?OE(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 M=t.getGlobalScale();d.setScale(M[0],M[1],t.segmentIgnoreThreshold),e.setLineDash&&n.lineDash&&(o=(r=Ok(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&&OP(e,n),l&&OR(e,n)):(l&&OR(e,n),s&&OP(e,n))),o&&e.setLineDash([])}(e,t,g,f),f&&(n.batchFill=g.fill||"",n.batchStroke=g.stroke||"");else if(t instanceof Sg){3!==n.lastDrawType&&(u=!0,n.lastDrawType=3),Oz(e,t,p,u,n);var m,v,y,x,b,w=g.text;if(null!=w&&(w+=""),w){e.font=g.font||m8,e.textAlign=g.textAlign,e.textBaseline=g.textBaseline;var S=void 0,_=void 0;e.setLineDash&&g.lineDash&&(S=(b=Ok(t))[0],_=b[1]),S&&(e.setLineDash(S),e.lineDashOffset=_),g.strokeFirst?(OI(g)&&e.strokeText(w,g.x,g.y),OO(g)&&e.fillText(w,g.x,g.y)):(OO(g)&&e.fillText(w,g.x,g.y),OI(g)&&e.strokeText(w,g.x,g.y)),S&&e.setLineDash([])}}else t instanceof Sx?(2!==n.lastDrawType&&(u=!0,n.lastDrawType=2),r=u,OB(e,Oj(t,n.inHover),p&&Oj(p,n.inHover),r,n),function(e,t,n){var i=t.__image=xO(n.image,t.__image,t,t.onload);if(i&&xP(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(),OW(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(),OW(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&&OV(e,n),t.innerAfterBrush(),t.afterBrush&&t.afterBrush(),n.prevEl=t,t.__dirty=0,t.__isRendered=!0}var O$=new OS,OG=new xI(100),OU=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function Oq(e,t){if("none"===e)return null;var n=t.getDevicePixelRatio(),i=t.getZr(),r="svg"===i.painter.type;e.dirty&&O$.delete(e);var o=O$.get(e);if(o)return o;var a=vm(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<OU.length;++u){var c=a[OU[u]];if(null!=c&&!vk(c)&&!vI(c)&&!vO(c)&&"boolean"!=typeof c){l=!1;break}s.push(c)}if(l){t=s.join(",")+(r?"-svg":"");var h=OG.get(t);h&&(r?e.svgElement=h:e.image=h)}var d=function e(t){if(!t||0===t.length)return[[0,0]];if(vO(t)){var n=Math.ceil(t);return[[n,n]]}for(var i=!0,r=0;r<t.length;++r)if(!vO(t[r])){i=!1;break}if(i)return e([t]);for(var o=[],r=0;r<t.length;++r)if(vO(t[r])){var n=Math.ceil(t[r]);o.push([n,n])}else{var n=vw(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(vO(e)){var t=Math.ceil(e);return[t,t]}var n=vw(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(vI(t))return[[t]];for(var n=!0,i=0;i<t.length;++i)if(!vI(t[i])){n=!1;break}if(n)return e([t]);for(var r=[],i=0;i<t.length;++i)vI(t[i])?r.push([t[i]]):r.push(t[i]);return r}(a.symbol),g=vw(d,function(e){return OY(e)}),m=OY(p),v=!r&&m7.createCanvas(),y=r&&{tag:"g",attrs:{},key:"dcl",children:[]},x=function(){for(var e=1,t=0,n=g.length;t<n;++t)e=yo(e,g[t]);for(var i=1,t=0,n=f.length;t<n;++t)i=yo(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,C=g+d[c][b]*_,M=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=TP(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 OH(o,h)}(C,M,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&&OG.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,O$.set(e,s),e.dirty=!1,s}function OY(e){for(var t=0,n=0;n<e.length;++n)t+=e[n];return e.length%2==1?2*t:t}var OZ=new wd,OX={},OK="__flagInMainProcess",OQ="__pendingUpdate",OJ="__needsUpdateStatus",O0=/^[a-zA-Z0-9_]+$/,O1="__connectUpdateStatus";function O2(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.isDisposed()?void this.id:O3(this,e,t)}}function O5(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return O3(this,e,t)}}function O3(e,t,n){return n[0]=n[0]&&n[0].toLowerCase(),wd.prototype[t].apply(e,n)}var O4=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(t,e),t}(wd),O6=O4.prototype;O6.on=O5("on"),O6.off=O5("off");var O8=function(e){function t(t,n,i){var r=e.call(this,new Of)||this;r._chartsViews=[],r._chartsMap={},r._componentsViews=[],r._componentsMap={},r._pendingActions=[],i=i||{},vI(n)&&(n=Ro[n]),r._dom=t,i.ssr;var o=r._zr=Dx(t,{renderer:i.renderer||"canvas",devicePixelRatio:i.devicePixelRatio,width:i.width,height:i.height,ssr:i.ssr,useDirtyRect:vz(i.useDirtyRect,!1),useCoarsePointer:vz(i.useCoarsePointer,"auto"),pointerSize:i.pointerSize});r._ssr=i.ssr,r._throttledZrFlush=kZ(vM(o.flush,o),17),(n=vp(n))&&DZ(n,!0),r._theme=n,r._locale=function(e){if(!vI(e))return vf(vp(e),vp(Ca.EN),!1);var t=Ca[e.toUpperCase()]||{};return"ZH"===e||"EN"===e?vp(t):vf(vp(t),vp(Ca.EN),!1)}(i.locale||Cl),r._coordSysMgr=new Ai;var a=r._api=ep(r);function s(e,t){return e.__prio-t.__prio}return I3(Rr,s),I3(Rn,s),r._scheduler=new D4(r,a,Rn,Rr),r._messageCenter=new O4,r._initEvents(),r.resize=vM(r.resize,r),o.animation.on("frame",r._onframe,r),el(o,r),eu(o,r),r[v$]=!0,r}return xd(t,e),t.prototype._onframe=function(){if(!this._disposed){em(this);var e=this._scheduler;if(this[OQ]){var t=this[OQ].silent;this[OK]=!0;try{J(this),en.update.call(this,null,this[OQ].updateParams)}catch(e){throw this[OK]=!1,this[OQ]=null,e}this._zr.flush(),this[OK]=!1,this[OQ]=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[OK]){if(this._disposed)return void this.id;if(vR(t)&&(n=t.lazyUpdate,i=t.silent,r=t.replaceMerge,o=t.transition,t=t.notMerge),this[OK]=!0,!this._model||t){var i,r,o,a=new DR(this._api),s=this._theme,l=this._model=new DM;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(e,{replaceMerge:r},Ri);var u={seriesTransition:o,optionChanged:!0};if(n)this[OQ]={silent:i,updateParams:u},this[OK]=!1,this.getZr().wakeUp();else{try{J(this),en.update.call(this,null,u)}catch(e){throw this[OQ]=null,this[OK]=!1,e}this._ssr||this._zr.flush(),this[OQ]=null,this[OK]=!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||ys.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(ys.svgSupported){var e=this._zr;return vb(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;vb(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 vb(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(!Rl[n])return this.getDataURL(e);var a=o,s=o,l=-o,u=-o,c=[],h=e&&e.pixelRatio||this.getDevicePixelRatio();vb(Rs,function(o,h){if(o.group===n){var d=t?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(vp(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=m7.createCanvas(),g=Dx(f,{renderer:t?"svg":"canvas"});if(g.resize({width:d,height:p}),!t)return e.connectedBackgroundColor&&g.add(new Sk({shape:{x:0,y:0,width:d,height:p},style:{fill:e.connectedBackgroundColor}})),vb(c,function(e){var t=new Sx({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 vb(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:(vb(yS(this._model,e),function(e,i){i.indexOf("Models")>=0&&vb(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=yS(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?Ov(i,r,t):Oy(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;vb(O7,function(e){var t=function(t){var n,r=i.getModel(),o=t.target;if("globalout"===e?n={}:o&&Ox(o,function(e){var t=SH(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=vg({},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)}),vb(Rt,function(e,t){i._messageCenter.on(t,function(e){this.trigger(t,e)},i)}),vb(["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?(Io("map","selectchanged",t,i,e),Io("pie","selectchanged",t,i,e)):"select"===e.fromAction?(Io("map","selected",t,i,e),Io("pie","selected",t,i,e)):"unselect"===e.fromAction&&(Io("map","unselected",t,i,e),Io("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()&&yk(this.getDom(),Rh,"");var e=this._api,t=this._model;vb(this._componentsViews,function(n){n.dispose(t,e)}),vb(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 Rs[this.id]},t.prototype.resize=function(e){if(!this[OK]){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[OQ]&&(null==i&&(i=this[OQ].silent),n=!0,this[OQ]=null),this[OK]=!0;try{n&&J(this),en.update.call(this,{type:"resize",animation:vg({duration:0},e&&e.animation)})}catch(e){throw this[OK]=!1,e}this[OK]=!1,ea.call(this,i),es.call(this,i)}}},t.prototype.showLoading=function(e,t){if(this._disposed)return void this.id;if(vR(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),Ra[e]){var n=Ra[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=vg({},e);return t.type=Rt[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed)return void this.id;if((vR(t)||(t={silent:!!t}),Re[e.type])&&this._model){if(this[OK])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&&ys.browser.weChat&&this._throttledZrFlush(),ea.call(this,n),es.call(this,n)}},t.prototype.updateLabelLayout=function(){OZ.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(!_k(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&&!_k(e)){if(e instanceof Sp&&((n=SU(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=xg(e.type);(c=new(t?DK.getClass(h.main,h.sub):k4.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 vb([].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=vY(),vb(yc(u),function(e){var t=ym(e,null);null!=t&&o.set(t,!0)})),a&&a.eachComponent(l,function(t){if(!(o&&null!=o.get(t.id))){if(_w(n))if(t instanceof MU)n.type!==SX||n.notBlur||t.get(["emphasis","disabled"])||function(e,t,n){var i=e.seriesIndex,r=e.getData(t.dataType);if(r){var o=yx(r,t);o=(vk(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=SH(a);_u(i,u.focus,u.blurScope,n)}else{var c=e.get(["emphasis","focus"]),h=e.get(["emphasis","blurScope"]);null!=c&&_u(i,c,h,n)}}}(t,n,e._api);else{var i=_h(t.mainType,t.componentIndex,n.name,e._api),r=i.focusSelf,a=i.dispatchers;n.type===SX&&r&&!n.notBlur&&_c(t.mainType,t.componentIndex,e._api),a&&vb(a,function(e){n.type===SX?_o(e):_a(e)})}else if(_b(n)&&t instanceof MU){if(e._api,_b(n)){var s=n.dataType,l=yx(t.getData(s),n);vk(l)||(l=[l]),t[n.type===S0?"toggleSelect":n.type===SQ?"select":"unselect"](l,s)}_d(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),OZ.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=vY();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),OZ.trigger("afterupdate",i,r)}},updateView:function(t){var n=this._model;n&&(n.setUpdatePayload(t),k4.markUpdateMethod(t,"updateView"),e(n),this._scheduler.performVisualTasks(n,t,{setDirty:!0}),ec(this,n,this._api,t,{}),OZ.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()}),k4.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)}),OZ.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=yS(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=Re[o],l=s.actionInfo,u=(l.update||"update").split(":"),c=u.pop(),h=null!=u[0]&&xg(u[0]);this[OK]=!0;var d=[e],p=!1;e.batch&&(p=!0,d=vw(e.batch,function(t){return(t=vm(vg({},t),e)).batch=null,t}));var f=[],g=_b(e),m=_w(e);if(m&&_l(this._api),vb(d,function(t){if((n=(n=s.action(t,i._model,i._api))||vg({},t)).type=l.event||n.type,f.push(n),m){var r=y_(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[OQ]?(J(this),en.update.call(this,e),this[OQ]=null):en[c].call(this,e)}catch(e){throw this[OK]=!1,e}if(n=p?{type:l.event||o,escapeConnect:a,batch:f}:f[0],this[OK]=!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){vb(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[OQ]||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=Ox(e.target,_x);s&&(n=t._api,o=(r=_h((i=SH(s)).componentMainType,i.componentIndex,i.componentHighDownName,n)).dispatchers,a=r.focusSelf,o?(a&&_c(i.componentMainType,i.componentIndex,n),vb(o,function(t){return _i(t,e)})):(_u(i.seriesIndex,i.focus,i.blurScope,n),"self"===i.focus&&_c(i.componentMainType,i.componentIndex,n),_i(s,e)),eg(t))}).on("mouseout",function(e){var n,i,r,o=Ox(e.target,_x);o&&(_l(n=t._api),(r=_h((i=SH(o)).componentMainType,i.componentIndex,i.componentHighDownName,n).dispatchers)?vb(r,function(t){return _r(t,e)}):_r(o,e),eg(t))}).on("click",function(e){var n=Ox(e.target,function(e){return null!=SH(e).dataIndex},!0);if(n){var i=n.selected?"unselect":"select",r=SH(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);I3(a,function(e,t){return e.zlevel===t.zlevel?e.z-t.z:e.zlevel-t.zlevel}),vb(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),vb(e._chartsViews,function(e){e.__alive=!1}),ed(e,t,n,i,r),vb(e._chartsViews,function(e){e.__alive||e.remove(t,n)})},eh=function(e,t,o,a,s,l){vb(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=vg(s||{},{updatedSeries:t.getSeries()}),OZ.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)}),_d(t)}),p.unfinished=f||p.unfinished,OZ.trigger("series:layoutlabels",t,o,s),OZ.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"))||ys.node||ys.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)})}}),OZ.trigger("series:afterupdate",t,o,s)},eg=function(e){e[OJ]=!0,e.getZr().wakeUp()},em=function(e){e[OJ]&&(e.getZr().storage.traverse(function(e){_k(e)||t(e)}),e[OJ]=!1)},ep=function(e){return new(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return xd(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){_o(t,n),eg(e)},n.prototype.leaveEmphasis=function(t,n){_a(t,n),eg(e)},n.prototype.enterBlur=function(t){S7(t,S4),eg(e)},n.prototype.leaveBlur=function(t){S7(t,S6),eg(e)},n.prototype.enterSelect=function(t){S7(t,S8),eg(e)},n.prototype.leaveSelect=function(t){S7(t,S9),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}(DD))(e)},ef=function(e){function t(e,t){for(var n=0;n<e.length;n++)e[n][O1]=t}vb(Rt,function(n,i){e._messageCenter.on(i,function(n){if(Rl[e.group]&&0!==e[O1]&&(!n||!n.escapeConnect)){var i=e.makeActionFromEvent(n),r=[];vb(Rs,function(t){t!==e&&t.group===e.group&&r.push(t)}),t(r,0),vb(r,function(e){1!==e[O1]&&e.dispatchAction(i)}),t(r,2)}})})}}(),t}(wd),O9=O8.prototype;O9.on=O2("on"),O9.off=O2("off"),O9.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 O7=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"],Re={},Rt={},Rn=[],Ri=[],Rr=[],Ro={},Ra={},Rs={},Rl={},Ru=new Date-0,Rc=new Date-0,Rh="_echarts_instance_";function Rd(e){0>vv(Ri,e)&&Ri.push(e)}function Rp(e,t){Ry(Rn,e,t,2e3)}function Rf(e,t){OZ.on(e,t)}function Rg(e,t,n){vT(t)&&(n=t,t="");var i=vR(e)?e.type:[e,e={event:t}][0];e.event=(e.event||i).toLowerCase(),Rt[t=e.event]||(vH(O0.test(i)&&O0.test(t)),Re[i]||(Re[i]={action:n,actionInfo:e}),Rt[t]=i)}function Rm(e,t){Ry(Rr,e,t,3e3,"visual")}var Rv=[];function Ry(e,t,n,i,r){if((vT(t)||vR(t))&&(n=t,t=i),!(vv(Rv,n)>=0)){Rv.push(n);var o=D4.wrapStageHandler(n,r);o.__prio=t,o.__raw=n,e.push(o)}}Rm(2e3,{createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",r=e.getModel(i),o=D1(e,i)(r),a=r.getShallow("decal");a&&(n.setVisual("decal",a),a.dirty=!0);var s=D2(e,i),l=o[s],u=vT(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||vT(o.fill)?h:o.fill,o.stroke="auto"===o.stroke||vT(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=vg({},o);r[s]=u(i),t.setItemVisual(n,"style",r)}}}}),Rm(4500,{createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",r=D1(e,i),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[i]){D5.option=n[i];var a=r(D5);vg(e.ensureUniqueItemVisual(t,"style"),a),D5.option.decal&&(e.setItemVisual(t,"decal",D5.option.decal),D5.option.decal.dirty=!0),o in a&&e.setItemVisual(t,"colorFromPalette",!1)}}:null}}}}),Rm(4500,{performRawSeries:!0,overallReset:function(e){var t=vY();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)),DQ(e).scope=r}}),e.eachSeries(function(t){if(!(t.isColorBySeries()||e.isSeriesFiltered(t))){var n=t.getRawData(),i={},r=t.getData(),o=DQ(t).scope,a=t.visualStyleAccessPath||"itemStyle",s=D2(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)}})}})}}),Rm(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<Og.length;a++){var s=Og[a],l=e.get(s);vT(l)?(o=!0,r[s]=l):i[s]=l}if(i.symbol=i.symbol||e.defaultSymbol,n.setVisual(vg({legendIcon:e.legendIcon||i.symbol,symbolKeepAspect:e.get("symbolKeepAspect")},i)),!t.isSeriesFiltered(e)){var u=vC(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}}}}}),Rm(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<Om.length;i++){var r=Om[i],o=n.getShallow(r,!0);null!=o&&e.setItemVisual(t,r,o)}}:null}}}),Rm(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=Oq(n,t))});var r=i.getVisual("decal");r&&(i.getVisual("style").decal=Oq(r,t))}})}),Rd(DZ),Rp(900,function(e){var t=vY();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(DX)}),Ra.default=function(e,t){vm(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 Ah,r=new Sk({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});i.add(r);var o=new Sj({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 Sk({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});return i.add(a),t.showSpinner&&((n=new ka({shape:{startAngle:-D3/2,endAngle:-D3/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*D3/2}).start("circularInOut"),n.animateShape(!0).when(1e3,{startAngle:3*D3/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},Rg({type:SX,event:SX,update:SX},vQ),Rg({type:SK,event:SK,update:SK},vQ),Rg({type:SQ,event:SQ,update:SQ},vQ),Rg({type:SJ,event:SJ,update:SJ},vQ),Rg({type:S0,event:S0,update:S0},vQ),Ro.light={color:Ol,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],Ol]},Ro.dark=Op;var Rx=[],Rb={registerPreprocessor:Rd,registerProcessor:Rp,registerPostInit:function(e){Rf("afterinit",e)},registerPostUpdate:function(e){Rf("afterupdate",e)},registerUpdateLifecycle:Rf,registerAction:Rg,registerCoordinateSystem:function(e,t){Ai.register(e,t)},registerLayout:function(e,t){Ry(Rr,e,t,1e3,"layout")},registerVisual:Rm,registerTransform:function(e){var t=(e=vp(e)).type;t||Ma("");var n=t.split(":");2!==n.length&&Ma("");var i=!1;"echarts"===n[0]&&(t=n[1],i=!0),e.__isBuiltIn=i,Mg.set(t,e)},registerLoading:function(e,t){Ra[e]=t},registerMap:function(e,t,n){var i=OX.registerMap;i&&i(e,t,n)},registerImpl:function(e,t){OX[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:CX,ComponentView:DK,SeriesModel:MU,ChartView:k4,registerComponentModel:function(e){CX.registerClass(e)},registerComponentView:function(e){DK.registerClass(e)},registerSeriesModel:function(e){MU.registerClass(e)},registerChartView:function(e){k4.registerClass(e)},registerSubTypeDefaulter:function(e,t){CX.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){Dm[e]=t}};function Rw(e){vk(e)?vb(e,function(e){Rw(e)}):vv(Rx,e)>=0||(Rx.push(e),vT(e)&&(e={install:e}),e.install(Rb))}var RS=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return xd(t,e),t.prototype.getInitialData=function(e,t){return As(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}(MU),R_=function(){},RC=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return xd(t,e),t.prototype.getDefaultShape=function(){return new R_},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 xZ(a-r/2,s-o/2,l-a+r,u-s+o)}return e},t}(Sp),RM=function(){function e(){this.group=new Ah}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 RC({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=TP(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=SH(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}(),RA=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(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=T9("").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 RM:new TH,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}(k4),Rk=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(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}(CX),RT=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}(),RI=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",yC).models[0]},t.type="cartesian2dAxis",t}(CX);vy(RI,RT);var RD={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)"]}}},RO=vf({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},RD),RR=vf({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}}},RD),RP=vf({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},RR),RE=vm({logBase:10},RR);let RL={category:RO,value:RR,time:RP,log:RE};var RN=0,RB=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++RN}return e.createByAxisModel=function(t){var n=t.option,i=n.data,r=i&&vw(i,Rz);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(!vI(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=vY(this.categories))},e}();function Rz(e){return vR(e)&&null!=e.value?e.value:e+""}var RF={value:1,category:1,time:1,log:1};function RV(e,t,n,i){vb(RF,function(r,o){var a=vf(vf({},RL[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 xd(n,e),n.prototype.mergeDefaultAndTheme=function(e,t){var n=CU(this),i=n?CY(e):{};vf(e,t.getTheme().get(o+"Axis")),vf(e,this.getDefaultOption()),e.type=Rj(e),n&&Cq(e,i,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=RB.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",Rj)}function Rj(e){return e.type||(e.data?"category":"value")}var RH=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 RW(e){return"interval"===e.type||"log"===e.type}function R$(e){var t=Math.pow(10,ye(e)),n=e/t;return n?2===n?n=3:3===n?n=5:n*=2:n=1,v2(n*t)}xw(RH);function RG(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function RU(e,t){return e>=t[0]&&e<=t[1]}function Rq(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function RY(e,t){return e*(t[1]-t[0])+t[0]}var RZ=function(e){function t(t){var n=e.call(this,t)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new RB({})),vk(i)&&(i=new RB({categories:vw(i,function(e){return vR(e)?e.value:e})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return xd(t,e),t.prototype.parse=function(e){return null==e?NaN:vI(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return RU(e=this.parse(e),this._extent)&&null!=this._ordinalMeta.categories[e]},t.prototype.normalize=function(e){return Rq(e=this._getTickNumber(this.parse(e)),this._extent)},t.prototype.scale=function(e){return e=Math.round(RY(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}(RH);RH.registerClass(RZ);var RX=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 xd(t,e),t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return RU(e,this._extent)},t.prototype.normalize=function(e){return Rq(e,this._extent)},t.prototype.scale=function(e){return RY(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=v3(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:v2(i[0]-t,r)}):o.push({value:n[0]}));for(var a=i[0];a<=i[1]&&(o.push({value:a}),(a=v2(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:v2(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=v2(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=v3(e.value)||0:"auto"===n&&(n=this._intervalPrecision),CP(v2(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=yt((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=v3(u)+2,o=l.niceTickExtent=[v2(Math.ceil(i[0]/u)*u,c),v2(Math.floor(i[1]/u)*u,c)],a=i,isFinite(o[0])||(o[0]=a[0]),isFinite(o[1])||(o[1]=a[1]),RG(o,0,a),RG(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]=v2(Math.floor(t[0]/i)*i)),e.fixMax||(t[1]=v2(Math.ceil(t[1]/i)*i))},t.prototype.setNiceExtent=function(e,t){this._niceExtent=[e,t]},t.type="interval",t}(RH);RH.registerClass(RX);var RK=function(e,t,n,i){for(;n<i;){var r=n+i>>>1;e[r][1]<t?n=r+1:i=r}return n},RQ=function(e){function t(t){var n=e.call(this,t)||this;return n.type="time",n}return xd(t,e),t.prototype.getLabel=function(e){var t=this.getSetting("useUTC");return Cv(e.value,Cd[function(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(Cm(this._minLevelUnit))]||Cd.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(vI(n))o=n;else if(vT(n))o=n(e.value,t,{level:e.level});else{var a=vg({},Cc);if(e.level>0)for(var s=0;s<Cp.length;++s)a[Cp[s]]="{primary|"+a[Cp[s]]+"}";var l=n?!1===n.inherit?n:vm(n,a):a,u=Cy(e.value,r);if(l[u])o=l[u];else if(l.inherit){for(var c=Cf.indexOf(u),s=c-1;s>=0;--s)if(l[u]){o=l[u];break}o=o||a.none}if(vk(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 Cv(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<Cf.length&&r++<1e4;++u){var c,h=Cm(Cf[u]);if((c=Cf[u])===Cm(c)&&(!function(e,r,o){var a=[],s=!r.length;if(!function(e,t,n,i){var r=v7(t),o=v7(n),a=function(e){return Cx(r,e,i)===Cx(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")}}(Cm(e),i[0],i[1],n)){s&&(r=[{value:function(e,t,n){var i=new Date(e);switch(Cm(t)){case"year":case"month":i[Ck(n)](0);case"day":i[CT(n)](1);case"hour":i[CI(n)](0);case"minute":i[CD(n)](0);case"second":i[CO(n)](0),i[CR(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=Cb(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=Cw(n),m=Ck(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=CS(n),m=CT(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=C_(n),m=CI(n);break;case"minute":f=R0(t,!0),g=CC(n),m=CD(n);break;case"second":f=R0(t,!1),g=CM(n),m=CO(n);break;case"millisecond":f=yt(t,!0),g=CA(n),m=CR(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])}}(Cf[u],o[o.length-1]||[],a),h!==(Cf[u+1]?Cm(Cf[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===Cf[u]))break}a=[]}}for(var m=v_(vw(o,function(e){return v_(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=RJ.length,a=Math.min(RK(RJ,this._approxInterval,0,o),o-1);this._interval=RJ[a][1],this._minLevelUnit=RJ[Math.max(a-1,0)][0]},t.prototype.parse=function(e){return vO(e)?e:+v7(e)},t.prototype.contain=function(e){return RU(this.parse(e),this._extent)},t.prototype.normalize=function(e){return Rq(this.parse(e),this._extent)},t.prototype.scale=function(e){return RY(e,this._extent)},t.type="time",t}(RX),RJ=[["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 R0(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}RH.registerClass(RQ);var R1=RH.prototype,R2=RX.prototype,R5=Math.floor,R3=Math.ceil,R4=Math.pow,R6=Math.log,R8=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new RX,t._interval=0,t}return xd(t,e),t.prototype.getTicks=function(e){var t=this._originalScale,n=this._extent,i=t.getExtent();return vw(R2.getTicks.call(this,e),function(e){var t=e.value,r=v2(R4(this.base,t));return r=t===n[0]&&this._fixMin?v2(r,v3(i[0])):r,{value:r=t===n[1]&&this._fixMax?v2(r,v3(i[1])):r}},this)},t.prototype.setExtent=function(e,t){var n=R6(this.base);e=R6(Math.max(0,e))/n,t=R6(Math.max(0,t))/n,R2.setExtent.call(this,e,t)},t.prototype.getExtent=function(){var e,t,n=this.base,i=R1.getExtent.call(this);i[0]=R4(n,i[0]),i[1]=R4(n,i[1]);var r=this._originalScale.getExtent();return this._fixMin&&(i[0]=(e=i[0],v2(e,v3(r[0])))),this._fixMax&&(i[1]=(t=i[1],v2(t,v3(r[1])))),i},t.prototype.unionExtent=function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=R6(e[0])/R6(t),e[1]=R6(e[1])/R6(t),R1.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,ye(n));for(e/n*i<=.5&&(i*=10);!isNaN(i)&&1>Math.abs(i)&&Math.abs(i)>0;)i*=10;var r=[v2(R3(t[0]/i)*i),v2(R5(t[1]/i)*i)];this._interval=i,this._niceExtent=r}},t.prototype.calcNiceExtent=function(e){R2.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 RU(e=R6(e)/R6(this.base),this._extent)},t.prototype.normalize=function(e){return Rq(e=R6(e)/R6(this.base),this._extent)},t.prototype.scale=function(e){return e=RY(e,this._extent),R4(this.base,e)},t.type="log",t}(RH),R9=R8.prototype;R9.getMinorTicks=R2.getMinorTicks,R9.getLabel=R2.getLabel,RH.registerClass(R8);var R7=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);vT(r)?this._modelMinNum=Pi(e,r({min:n[0],max:n[1]})):"dataMin"!==r&&(this._modelMinNum=Pi(e,r));var o=this._modelMaxRaw=t.get("max",!0);if(vT(o)?this._modelMaxNum=Pi(e,o({min:n[0],max:n[1]})):"dataMax"!==o&&(this._modelMaxNum=Pi(e,o)),i)this._axisDataLen=t.getCategories().length;else{var a=t.get("boundaryGap"),s=vk(a)?a:[a||0,a||0];"boolean"==typeof s[0]||"boolean"==typeof s[1]?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[x5(s[0],1),x5(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[Pt[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){this[Pe[e]]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),Pe={min:"_determinedMin",max:"_determinedMax"},Pt={min:"_dataMin",max:"_dataMax"};function Pn(e,t,n){var i=e.rawExtentInfo;return i||(i=new R7(e,t,n),e.rawExtentInfo=i),i}function Pi(e,t){return null==t?null:t!=t?NaN:e.parse(t)}function Pr(e,t){var n=e.type,i=Pn(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=xn("bar",a),l=!1;if(vb(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[xt(t)]}(i,n.axis);if(void 0===a)return{min:e,max:t};var s=1/0;vb(a,function(e){s=Math.min(e.offset,s)});var l=-1/0;vb(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,xi(s));r=u.min,o=u.max}}return{extent:[r,o],fixMin:i.minFixed,fixMax:i.maxFixed}}function Po(e,t){var n=Pr(e,t),i=n.extent,r=t.get("splitNumber");e instanceof R8&&(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 Pa(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)}:vI(t)?function(n){var i=e.scale.getLabel(n);return t.replace("{value}",null!=i?i:"")}:vT(t)?function(i,r){return null!=n&&(r=i.value-n),t(Ps(e,i),r,null!=i.level?{level:i.level}:null)}:function(t){return e.scale.getLabel(t)}}function Ps(e,t){return"category"===e.type?e.scale.getLabel(t):t.value}function Pl(e){var t=e.get("interval");return null==t?"auto":t}function Pu(e){return"category"===e.type&&0===Pl(e.getLabelModel())}function Pc(e,t){var n={};return vb(e.mapDimensionsAll(t),function(t){n[y3(e,t)]=!0}),vC(n)}var Ph=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 vw(this._dimList,function(e){return this._axes[e]},this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),v_(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}(),Pd=["x","y"];function Pp(e){return"interval"===e.type||"time"===e.type}var Pf=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=Pd,t}return xd(t,e),t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,t=this.getAxis("y").scale;if(Pp(e)&&Pp(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=xF([],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 xZ(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 bd(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 bd(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 xZ(i,r,o,a)},t}(Ph),Pg=yb();function Pm(e,t){var n,i,r,o,a=Pv(e,"labels"),s=Pl(t),l=Py(a,s);return l||(vT(s)?r=Pw(e,s):(o="auto"===s?null!=(i=Pg(n=e).autoInterval)?i:Pg(n).autoInterval=n.calculateCategoryInterval():s,r=Pb(e,o)),Px(a,s,{labels:r,labelCategoryInterval:o}))}function Pv(e,t){return Pg(e)[t]||(Pg(e)[t]=[])}function Py(e,t){for(var n=0;n<e.length;n++)if(e[n].key===t)return e[n].value}function Px(e,t,n){return e.push({key:t,value:n}),n}function Pb(e,t,n){var i=Pa(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=Pu(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 Pw(e,t,n){var i=e.scale,r=Pa(e),o=[];return vb(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 PS=[0,1];function P_(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}var PC=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 xd(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 v4(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&&P_(n=n.slice(),i.count()),v0(e,PS,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&P_(n=n.slice(),i.count());var r=v0(e,n,PS,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=Pv(e,"ticks"),o=Pl(t),a=Py(r,o);if(a)return a;if((!t.get("show")||e.scale.isBlank())&&(n=[]),vT(o))n=Pw(e,o,!0);else if("auto"===o){var s=Pm(e,e.getLabelModel());i=s.labelCategoryInterval,n=vw(s.labels,function(e){return e.tickValue})}else n=Pb(e,i=o,!0);return Px(r,o,{ticks:n,tickCategoryInterval:i})}(this,t):{ticks:vw(this.scale.getTicks(),function(e){return e.value})}).ticks,i=vw(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;vb(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=v2(e),t=v2(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),vw(this.scale.getMinorTicks(e),function(e){return vw(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=Pm(e,t),!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n):(i=this,r=i.scale.getTicks(),o=Pa(i),{labels:vw(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=Pa(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=xJ(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=Pg(e.model),_=e.getExtent(),C=S.lastAutoInterval,M=S.lastTickCount;return null!=C&&null!=M&&1>=Math.abs(C-w)&&1>=Math.abs(M-l)&&C>w&&S.axisExtent0===_[0]&&S.axisExtent1===_[1]?w=C:(S.lastTickCount=l,S.lastAutoInterval=w,S.axisExtent0=_[0],S.axisExtent1=_[1]),w}(this)},e}());function PM(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),vB(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 PA(e){return"cartesian2d"===e.get("coordinateSystem")}function Pk(e){var t={xAxisModel:null,yAxisModel:null};return vb(t,function(n,i){var r=i.replace(/Model$/,""),o=e.getReferringComponents(r,yC).models[0];t[i]=o}),t}var PT=Math.log,PI=function(){function e(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Pd,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=vC(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;RW(l)&&s.get("alignTicks")&&null==s.get("interval")?r.push(a):(Po(l,s),RW(l)&&(t=a))}r.length&&(t||Po((t=r.pop()).scale,t.model),vb(r,function(e){!function(e,t,n){var i=RX.prototype,r=i.getTicks.call(n),o=i.getTicks.call(n,!0),a=r.length-1,s=i.getInterval.call(n),l=Pr(e,t),u=l.extent,c=l.fixMin,h=l.fixMax;if("log"===e.type){var d=PT(e.base);u=[PT(u[0])/d,PT(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=R$(f),m=u[0]+f*a;else if(h)for(g=u[1]-f*a;g>u[0]&&isFinite(g)&&isFinite(u[0]);)f=R$(f),g=u[1]-f*a;else{e.getTicks().length-1>a&&(f=R$(f));var v=f*a;(g=v2((m=Math.ceil(u[1]/f)*f)-v))<0&&u[0]>=0?(g=0,m=v2(v)):m>0&&u[1]<=0&&(m=0,g=-v2(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={};vb(n.x,function(e){PO(n,"y",e,r)}),vb(n.y,function(e){PO(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=C$(i,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var a=this._axesList;function s(){vb(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&&(vb(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 RZ?o.count():(t=o.getTicks()).length;var s=e.getLabelModel(),l=Pa(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 xZ(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()),vb(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]}vR(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",yC).models[0],o=e.yAxisModel||i&&i.getReferringComponents("yAxis",yC).models[0],a=e.gridModel,s=this._coordsList;return i?0>vv(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(PD(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 PC(t,function(e,t){if(t=t||e.get("type"))switch(t){case"category":return new RZ({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new RQ({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(RH.getClass(t)||RX)}}(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,vb(a.x,function(t,n){vb(a.y,function(r,o){var a="x"+n+"y"+o,s=new Pf(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){vb(Pc(e,t.dim),function(n){t.scale.unionExtentFromData(e,n)})}vb(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(PA(e)){var i=Pk(e),r=i.xAxisModel,o=i.yAxisModel;if(PD(r,t)&&PD(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 vb(this.getCartesians(),function(i){var r=null!=e&&"auto"!==e?i.getAxis(e):i.getBaseAxis(),o=i.getOtherAxis(r);0>vv(t,r)&&t.push(r),0>vv(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(PA(e)){var t=Pk(e),n=t.xAxisModel,i=t.yAxisModel;e.coordinateSystem=n.getCoordSysModel().coordinateSystem.getCartesian(n.componentIndex,i.componentIndex)}}),i},e.dimensions=Pd,e}();function PD(e,t){return e.getCoordSysModel()===t}function PO(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)PR(o[l])&&(r=o[l]);else for(var u in o)if(o.hasOwnProperty(u)&&PR(o[u])&&!i[c(o[u])]){r=o[u];break}r&&(i[c(r)]=!0)}function c(e){return e.dim+"_"+e.index}}function PR(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 PP=Math.PI,PE=function(){function e(e,t){this.group=new Ah,this.opt=t,this.axisModel=e,vm(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new Ah({x:t.position[0],y:t.position[1],rotation:t.rotation});n.updateTransform(),this._transformGroup=n}return e.prototype.hasBuilder=function(e){return!!PL[e]},e.prototype.add=function(e){PL[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=v6(t-e);return v8(o)?(r=n>0?"top":"bottom",i="center"):v8(o-PP)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=o>0&&o<PP?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}(),PL={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&&(bd(s,s,a),bd(l,l,a));var c=vg({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new A9({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});kO(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"]);vI(d)&&(d=[d,d]),(vI(p)||vO(p))&&(p=[p,p]);var f=TL(t.get(["axisLine","symbolOffset"])||0,p),g=p[0],m=p[1];vb([{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=TP(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=PF(r.getTicksCoords(),t.transform,l,vm(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(!(!vB(i.axisLabelShow,n.get(["axisLabel","show"]))||r.scale.isBlank())){var o=n.getModel("axisLabel"),a=o.get("margin"),s=r.getViewLabels(),l=(vB(i.labelRotate,o.get("rotate"))||0)*PP/180,u=PE.innerTextLayout(i.rotation,l,i.labelDirection),c=n.getCategories&&n.getCategories(!0),h=[],d=PE.isLabelSilent(n),p=n.get("triggerEvent");return vb(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];vR(x)&&x.textStyle&&(y=new _2(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,_=vz(y.getShallow("alignMinLabel",!0),S),C=vz(y.getShallow("alignMaxLabel",!0),S),M=y.getShallow("verticalAlign",!0)||y.getShallow("baseline",!0)||u.textVerticalAlign,A=vz(y.getShallow("verticalAlignMinLabel",!0),M),k=vz(y.getShallow("verticalAlignMaxLabel",!0),M),T=new Sj({x:w,y:i.labelOffset+i.labelDirection*a,rotation:u.rotation,silent:d,z2:10+(l.level||0),style:_B(y,{text:m,align:0===f?_:f===s.length-1?C:S,verticalAlign:0===f?A:f===s.length-1?k:M,fill:vT(b)?b("category"===r.type?v:"value"===r.type?g+"":g,f):b})});if(T.anid="label_"+g,p){var I=PE.makeAxisEventDataBase(n);I.targetType="axisLabel",I.value=v,I.tickIndex=f,"category"===r.type&&(I.dataIndex=g),SH(T).eventData=I}t.add(T),T.updateTransform(),h.push(T),e.add(T),T.decomposeTransform()}),h}}(n,i,t,e);(function(e,t,n){if(!Pu(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?(PN(o),PN(u)):PB(o,a)&&(i?(PN(a),PN(c)):(PN(o),PN(u))),!1===r?(PN(s),PN(h)):PB(l,s)&&(r?(PN(l),PN(d)):(PN(s),PN(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=vm(s.getLineStyle(),vm(n.getModel("axisTick").getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])})),c=0;c<a.length;c++)for(var h=PF(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 xZ(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 kg(f.localRect,f.transform)),h||(h=new kg(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 kg(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}(vw(o,function(e){return{label:e,priority:e.z2,defaultAttr:{ignore:e.ignore}}})))},axisName:function(e,t,n,i){var r,o,a=vB(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,Pz(m)?e.labelOffset+v*x:0],_=t.get("nameRotate");null!=_&&(_=_*PP/180),Pz(m)?r=PE.innerTextLayout(e.rotation,null!=_?_:e.rotation,v):(s=e.rotation,l=m,u=_||0,c=b,p=v6(u-s),f=c[0]>c[1],g="start"===l&&!f||"start"!==l&&f,v8(p-PP/2)?(d=g?"bottom":"top",h="center"):v8(p-1.5*PP)?(d=g?"top":"bottom",h="center"):(d="middle",h=p<1.5*PP&&p>PP/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 C=y.getFont(),M=t.get("nameTruncate",!0)||{},A=M.ellipsis,k=vB(e.nameTruncateMaxWidth,M.maxWidth,o),T=new Sj({x:S[0],y:S[1],rotation:r.rotation,silent:PE.isLabelSilent(t),style:_B(y,{text:a,font:C,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(kW({el:T,componentModel:t,itemName:a}),T.__fullText=a,T.anid="name",t.get("triggerEvent")){var I=PE.makeAxisEventDataBase(t);I.targetType="axisName",I.name=a,SH(T).eventData=I}i.add(T),T.updateTransform(),n.add(T),T.decomposeTransform()}}};function PN(e){e&&(e.ignore=!0)}function PB(e,t){var n=e&&e.getBoundingRect().clone(),i=t&&t.getBoundingRect().clone();if(n&&i){var r=xL([]);return xz(r,r,-e.rotation),n.applyTransform(xN([],r,e.getLocalTransform())),i.applyTransform(xN([],r,t.getLocalTransform())),n.intersect(i)}}function Pz(e){return"middle"===e||"center"===e}function PF(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&&(bd(a,a,t),bd(s,s,t));var c=new A9({shape:{x1:a[0],y1:a[1],x2:s[0],y2:s[1]},style:i,z2:2,autoBatch:!0,silent:!0});kO(c.shape,c.style.lineWidth),c.anid=r+"_"+e[l].tickValue,o.push(c)}return o}function PV(e,t){return"all"===e||vk(e)&&vv(e,t)>=0||e===t}function Pj(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[PW(e)]}function PH(e){return!!e.get(["handle","show"])}function PW(e){return e.type+"||"+e.id}var P$={},PG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.render=function(t,n,i,r){this.axisPointerClass&&function(e){var t=Pj(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=PH(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=Pj(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){P$[e]=t},t.getAxisPointerClass=function(e){return e&&P$[e]},t.type="axis",t}(DK),PU=yb(),Pq=["axisLine","axisTickLabel","axisName"],PY=["splitArea","splitLine","minorSplitLine"],PZ=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="CartesianAxisPointer",n}return xd(t,e),t.prototype.render=function(t,n,i,r){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Ah,this.group.add(this._axisGroup),t.get("show")){var a=t.getCoordSysModel(),s=PM(a,t),l=new PE(t,vg({handleAutoShown:function(e){for(var n=a.coordinateSystem.getCartesians(),i=0;i<n.length;i++)if(RW(n[i].getOtherAxis(t.axis).scale))return!0;return!1}},s));vb(Pq,l.add,l),this._axisGroup.add(l.getGroup()),vb(PY,function(e){t.get([e,"show"])&&PX[e](this,this._axisGroup,t,a)},this),r&&"changeAxisOrder"===r.type&&r.isInitSort||kB(o,this._axisGroup,t),e.prototype.render.call(this,t,n,i,r)}},t.prototype.remove=function(){PU(this).splitAreaColors=null},t.type="cartesianAxis",t}(PG),PX={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=vk(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 A9({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:vm({stroke:s[v]},f),silent:!0});kO(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 A9({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});kO(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=PU(e).splitAreaColors,d=vY(),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=vk(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 Sk({anid:null!=_?"area_"+_:null,shape:{x:x,y:b,width:w,height:S},style:vm({fill:s[p]},v),autoBatch:!0,silent:!0})),p=(p+1)%c}PU(e).splitAreaColors=d}}}(e,t,n,i)}},PK=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.type="xAxis",t}(PZ),PQ=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=PK.type,t}return xd(t,e),t.type="yAxis",t}(PZ),PJ=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="grid",t}return xd(t,e),t.prototype.render=function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new Sk({shape:e.coordinateSystem.getRect(),style:vm({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))},t.type="grid",t}(DK),P0={offset:0};function P1(e){e.registerComponentView(PJ),e.registerComponentModel(Rk),e.registerCoordinateSystem("cartesian2d",PI),RV(e,"x",RI,P0),RV(e,"y",RI,P0),e.registerComponentView(PK),e.registerComponentView(PQ),e.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}var P2={color:"fill",borderColor:"stroke"},P5={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},P3=yb(),P4=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(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 As(null,this)},t.prototype.getDataParams=function(t,n,i){var r=e.prototype.getDataParams.call(this,t,n);return i&&(r.info=P3(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}(MU);function P6(e,t){return t=t||[0,0],vw(["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 P8(e,t){return t=t||[0,0],vw([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 P9(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 P7(e,t){return t=t||[0,0],vw(["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 Ee(e,t){t&&(t.font=t.textFont||t.font,vK(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),vK(t,"textAlign")&&(e.align=t.textAlign),vK(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),vK(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),vK(t,"textWidth")&&(e.width=t.textWidth),vK(t,"textHeight")&&(e.height=t.textHeight),vK(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),vK(t,"textPadding")&&(e.padding=t.textPadding),vK(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),vK(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),vK(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),vK(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),vK(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),vK(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),vK(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function Et(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";En(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,vb(t.rich,function(e){En(e,e)}),e}function En(e,t){t&&(vK(t,"fill")&&(e.textFill=t.fill),vK(t,"stroke")&&(e.textStroke=t.fill),vK(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),vK(t,"font")&&(e.font=t.font),vK(t,"fontStyle")&&(e.fontStyle=t.fontStyle),vK(t,"fontWeight")&&(e.fontWeight=t.fontWeight),vK(t,"fontSize")&&(e.fontSize=t.fontSize),vK(t,"fontFamily")&&(e.fontFamily=t.fontFamily),vK(t,"align")&&(e.textAlign=t.align),vK(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),vK(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),vK(t,"width")&&(e.textWidth=t.width),vK(t,"height")&&(e.textHeight=t.height),vK(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),vK(t,"padding")&&(e.textPadding=t.padding),vK(t,"borderColor")&&(e.textBorderColor=t.borderColor),vK(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),vK(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),vK(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),vK(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),vK(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),vK(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),vK(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),vK(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),vK(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),vK(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var Ei={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},Er=vC(Ei);vS(bw,function(e,t){return e[t]=1,e},{}),bw.join(", ");var Eo=["","style","shape","extra"],Ea=yb();function Es(e,t,n,i,r){var o=e+"Animation",a=__(e,i,r)||{},s=Ea(t).userDuring;return a.duration>0&&(a.during=s?vM(Ed,{el:t,userDuring:s}):null,a.setToFinal=!0,a.scope=e),vg(a,n[o]),a}function El(e,t,n,i){if(e){var r=e.parent,o=Ea(e).leaveToProps;if(o){var a=Es("update",e,t,n,0);a.done=function(){r.remove(e),i&&i()},e.animateTo(o,a)}else r.remove(e),i&&i()}}function Eu(e){return"all"===e}var Ec={},Eh={setTransform:function(e,t){return Ec.el[e]=t,this},getTransform:function(e){return Ec.el[e]},setShape:function(e,t){var n=Ec.el;return(n.shape||(n.shape={}))[e]=t,n.dirtyShape&&n.dirtyShape(),this},getShape:function(e){var t=Ec.el.shape;if(t)return t[e]},setStyle:function(e,t){var n=Ec.el,i=n.style;return i&&(i[e]=t,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(e){var t=Ec.el.style;if(t)return t[e]},setExtra:function(e,t){return(Ec.el.extra||(Ec.el.extra={}))[e]=t,this},getExtra:function(e){var t=Ec.el.extra;if(t)return t[e]}};function Ed(){var e=this.el;if(e){var t=Ea(e).userDuring,n=this.userDuring;if(t!==n){this.el=this.userDuring=null;return}Ec.el=e,n(Eh)}}function Ep(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]={}),Eu(l))vg(r,a);else for(var u=yc(l),c=0;c<u.length;c++){var h=u[c],d=a[h];r[h]=d}else if(Eu(s)||vv(s,e)>=0){r||(r=i[e]={});for(var p=vC(a),c=0;c<p.length;c++){var f,g,h=p[c],d=a[h];f=o[h],g=d,(vx(f)?f!==g:null!=f&&isFinite(f))&&(r[h]=d)}}}}}function Ef(e,t,n){var i=t[e];if(i)for(var r=n[e]={},o=vC(i),a=0;a<o.length;a++){var s=o[a];r[s]=wo(i[s])}}var Eg=yb(),Em=["percent","easing","shape","style","extra"],Ev="emphasis",Ey="normal",Ex="blur",Eb="select",Ew=[Ey,Ev,Ex,Eb],ES={normal:["itemStyle"],emphasis:[Ev,"itemStyle"],blur:[Ex,"itemStyle"],select:[Eb,"itemStyle"]},E_={normal:["label"],emphasis:[Ev,"label"],blur:[Ex,"label"],select:[Eb,"label"]},EC=["x","y"],EM={normal:{},emphasis:{},blur:{},select:{}},EA={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:vM(P6,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:vM(P8,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:vM(P9,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:vM(P7,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 Ek(e){return e instanceof Sp}function ET(e){return e instanceof wO}var EI=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.render=function(e,t,n,i){this._progressiveEls=null;var r=this._data,o=e.getData(),a=this.group,s=EP(e,o,t,n);r||a.removeAll(),o.diff(r).add(function(t){EE(n,null,t,s(t,i),e,a,o)}).remove(function(t){var n=r.getItemGraphicEl(t);n&&El(n,P3(n).option,e)}).update(function(t,l){EE(n,r.getItemGraphicEl(l),t,s(t,i),e,a,o)}).execute();var l=e.get("clip",!0)?k0(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=EP(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=EE(null,null,u,a(u,r),t,this.group,o);c&&(c.traverse(l),s.push(c))}},t.prototype.eachRendered=function(e){kG(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}(k4);function ED(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=EW(i);P3(t=kA(o,null,r,i.layout||"center")).customPathData=o}else if("image"===n)P3(t=new Sx({})).customImagePath=e.style.image;else if("text"===n)t=new Sj({});else if("group"===n)t=new Ah;else if("compoundPath"===n)throw Error('"compoundPath" is not supported yet.');else{var a=kM(n);a||Ma(""),t=new a}return P3(t).customGraphicType=n,t.name=e.name,t.z2EmphasisLift=1,t.z2SelectLift=1,t}function EO(e,t,n,i,r,o,a){t.stopAnimation("keyframe"),t.attr(Eg(t));var s=r&&r.normal.cfg;s&&t.setTextConfig(s),i&&null==i.transition&&(i.transition=EC);var l=i&&i.style;if(l){"text"===t.type&&(vK(l,"textFill")&&(l.fill=l.textFill),vK(l,"textStroke")&&(l.stroke=l.textStroke));var u=void 0,c=Ek(t)?l.decal:null;e&&c&&(c.dirty=!0,u=Oq(c,e)),l.__decalPattern=u}if(ET(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=Ea(e),h=t.style;c.userDuring=t.during;var d={},p={};if(function(e,t){for(var n=0;n<Er.length;n++){var i=Er[n],r=Ei[i],o=e[i];o&&(t[r[0]]=o[0],t[r[1]]=o[1])}for(var n=0;n<bw.length;n++){var a=bw[n];null!=e[a]&&(t[a]=e[a])}}(t,p),Ef("shape",t,p),Ef("extra",t,p),!s&&u&&(function(e,t,n){for(var i=t.transition,r=Eu(i)?bw:yc(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),Ep("shape",e,t,d),Ep("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&&!Eu(a)){var l=yc(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&&(Eu(s)||Eu(a)||vv(s,"style")>=0)){var d=e.getAnimationStyleProps(),p=d?d.style:null;if(p){r||(r=i.style={});for(var f=vC(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,vK(o=t,"silent")&&(r.silent=o.silent),vK(o,"ignore")&&(r.ignore=o.ignore),r instanceof wO&&vK(o,"invisible")&&(r.invisible=o.invisible),r instanceof Sp&&vK(o,"autoBatch")&&(r.autoBatch=o.autoBatch),u)if(s){var f={};vb(Eo,function(e){var n=e?t[e]:t;n&&n.enterFrom&&(e&&(f[e]=f[e]||{}),vg(e?f[e]:f,n.enterFrom))});var g=Es("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=Es("update",m,v,x,y);w.duration>0&&m.animateFrom(b,w)}}(function(e,t){for(var n=Ea(e).leaveToProps,i=0;i<Eo.length;i++){var r=Eo[i],o=r?t[r]:t;o&&o.leaveTo&&(n||(n=Ea(e).leaveToProps={}),r&&(n[r]=n[r]||{}),vg(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(vk(n))return void vb(n,function(n){e(t,n,i)});var r=n.keyframes,o=n.duration;if(i&&null==o){var a=__("enter",i,0);o=a&&a.duration}if(r&&o){var s=Eg(t);vb(Eo,function(e){var i;e&&!t[e]||(r.sort(function(e,t){return e.percent-t.percent}),vb(r,function(r){var a=t.animators,l=e?r[e]:r;if(l){var u=vC(l);if(e||(u=v_(u,function(e){return 0>vv(Em,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;vb(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 ER(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),_n(o)}}function EP(e,t,n,i){var r,o,a,s,l=e.get("renderItem"),u=e.coordinateSystem,c={};u&&(c=u.prepareCustoms?u.prepareCustoms(u):EA[u.type](u));for(var h=vm({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,Ey).getItemStyle();null!=o&&(l.fill=o),null!=s&&(l.opacity=s);var u={inheritColor:vI(o)?o:"#000"},c=w(i,Ey),h=_B(c,null,u,!1,!0);h.text=c.getShallow("show")?vz(e.getFormattedLabel(i,Ey),Tn(t,i)):null;var d=_z(c,u,!1);return _(n,l),l=Et(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,Ev).getItemStyle(),o=w(i,Ev),s=_B(o,null,null,!0,!0);s.text=o.getShallow("show")?vF(e.getFormattedLabel(i,Ev),e.getFormattedLabel(i,Ey),Tn(t,i)):null;var l=_z(o,null,!0);return _(n,r),r=Et(r,s,l),n&&S(r,n),r.legacy=!0,r},visual:function(e,n){if(null==n&&(n=a),vK(P2,e)){var i=t.getItemVisual(n,"style");return i?i[P2[e]]:null}if(vK(P5,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(vm({bandWidth:r,axisKey:i,stackId:y7+o},e));for(var a=xr(t),s=[],o=0;o<e.count;o++){var l=a[i][y7+o];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}}(vm({axis:u.getBaseAxis()},e))},currentSeriesIndices:function(){return n.getCurrentSeriesIndices()},font:function(e){return _W(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={},vb(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<Ew.length;v++){var y=Ew[v];g[y]=e.getModel(ES[y]),m[y]=e.getModel(E_[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(ES[n])):x(e).getModel(ES[n]):g[n]}function w(e,n){return t.hasItemOption?e===a?f[n]||(f[n]=x(e).getModel(E_[n])):x(e).getModel(E_[n]):m[n]}return function(e,n){return a=e,s=null,p={},f={},l&&l(vm({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:n?n.type:null},d),h)};function S(e,t){for(var n in t)vK(t,n)&&(e[n]=t[n])}function _(e,t){e&&(e.textFill&&(t.textFill=e.textFill),e.textPosition&&(t.textPosition=e.textPosition))}}function EE(e,t,n,i,r,o,a){if(!i)return void o.remove(t);var s=EL(e,t,n,i,r,o);return s&&a.setItemGraphicEl(n,s),s&&_f(s,i.focus,i.blurScope,i.emphasisDisabled),s}function EL(e,t,n,i,r,o){var a,s=-1,l=t;t&&EN(t,i,r)&&(s=vv(o.childrenRef(),t),t=null);var u=!t,c=t;c?c.clearStates():(c=ED(i),l&&((a=c).copyTransform(l),ET(a)&&ET(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,Ek(a)&&Ek(l)&&a.setShape(l.shape)))),!1===i.morph?c.disableMorphing=!0:c.disableMorphing&&(c.disableMorphing=!1),EM.normal.cfg=EM.normal.conOpt=EM.emphasis.cfg=EM.emphasis.conOpt=EM.blur.cfg=EM.blur.conOpt=EM.select.cfg=EM.select.conOpt=null,EM.isLegacy=!1,function(e,t,n,i,r,o){if(!e.isGroup){EB(n,null,o),EB(n,Ev,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=ED(a),e.setTextContent(c)),EO(null,c,t,a,null,i,r);for(var h=a&&a.style,d=0;d<Ew.length;d++){var p=Ew[d];if(p!==Ey){var f=o[p].conOpt;ER(p,c,f,EF(a,f,p),null)}}h?c.dirty():c.markRedraw()}}}}(c,n,i,r,u,EM),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&&EN(a,o,i)&&(a=null),a||(a=ED(o),e.setClipPath(a)),EO(null,a,t,o,null,i,r)}}(c,n,i,r,u),EO(e,c,n,i,EM,r,u),vK(i,"info")&&(P3(c).info=i.info);for(var h=0;h<Ew.length;h++){var d=Ew[h];if(d!==Ey){var p=Ez(i,d),f=EF(i,p,d);ER(d,c,p,f,EM)}}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<Ew.length;x++)!function(e,t,n){var i=n===Ey,r=i?t:Ez(t,n),o=r?r.z2:null;null!=o&&((i?e:e.ensureState(n)).z2=o||0)}(g,i,Ew[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 M2((f={api:e,oldChildren:t.children()||[],newChildren:o||[],dataIndex:n,seriesModel:r,group:t}).oldChildren,f.newChildren,EV,EV,f).add(Ej).update(Ej).remove(EH).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),EL(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&&El(m,P3(g).option,v)}}}(e,c,n,i,r),s>=0?o.replaceAt(c,s):o.add(c),c}function EN(e,t,n){var i,r=P3(e),o=t.type,a=t.shape,s=t.style;return n.isUniversalTransitionEnabled()||null!=o&&o!==r.customGraphicType||"path"===o&&(i=a)&&(vK(i,"pathData")||vK(i,"d"))&&EW(a)!==r.customPathData||"image"===o&&vK(s,"image")&&s.image!==r.customImagePath}function EB(e,t,n){var i,r,o=t?Ez(e,t):e,a=t?EF(e,o,Ev):e.style,s=e.type,l=o?o.textConfig:null,u=e.textContent,c=u?t?Ez(u,t):u:null;if(a&&(n.isLegacy||(i=!!l,r=!!c,a&&(a.legacy||!1!==a.legacy&&!i&&!r&&"tspan"!==s&&("text"===s||vK(a,"text")))))){n.isLegacy=!0;var h=function(e,t,n){var i,r,o;if("text"===t)o=e;else{o={},vK(e,"text")&&(o.text=e.text),vK(e,"rich")&&(o.rich=e.rich),vK(e,"textFill")&&(o.fill=e.textFill),vK(e,"textStroke")&&(o.stroke=e.textStroke),vK(e,"fontFamily")&&(o.fontFamily=e.fontFamily),vK(e,"fontSize")&&(o.fontSize=e.fontSize),vK(e,"fontStyle")&&(o.fontStyle=e.fontStyle),vK(e,"fontWeight")&&(o.fontWeight=e.fontWeight),r={type:"text",style:o,silent:!0},i={};var a=vK(e,"textPosition");n?i.position=a?e.textPosition:"inside":a&&(i.position=e.textPosition),vK(e,"textPosition")&&(i.position=e.textPosition),vK(e,"textOffset")&&(i.offset=e.textOffset),vK(e,"textRotation")&&(i.rotation=e.textRotation),vK(e,"textDistance")&&(i.distance=e.textDistance)}return Ee(o,e),vb(o.rich,function(e){Ee(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 Ez(e,t){return t?e?e[t]:null:e}function EF(e,t,n){var i=t&&t.style;return null==i&&n===Ev&&e&&(i=e.styleEmphasis),i}function EV(e,t){var n=e&&e.name;return null!=n?n:"e\0\0"+t}function Ej(e,t){var n=this.context,i=null!=e?n.newChildren[e]:null,r=null!=t?n.oldChildren[t]:null;EL(n.api,r,n.dataIndex,i,n.seriesModel,n.group)}function EH(e){var t=this.context,n=t.oldChildren[e];n&&El(n,P3(n).option,t.seriesModel)}function EW(e){return e&&(e.pathData||e.d)}var E$=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=m7.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,C=4*Math.floor(255*v);if(v>0){var M=o(v)?s:l;v>0&&(v=v*_+S),x[b++]=M[C],x[b++]=M[C+1],x[b++]=M[C+2],x[b++]=M[C+3]*v*256}else b+=4}return h.putImageData(y,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=m7.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 EG(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}var EU=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(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()):EG(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&&(EG(r)?this.render(t,n,i):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(t,i,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){kG(this._progressiveEls||this.group,e)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,i,r){var o,a,s,l,u=e.coordinateSystem,c=Tt(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=_N(e),b=e.getModel("emphasis"),w=b.get("focus"),S=b.get("blurScope"),_=b.get("disabled"),C=c?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],M=n;M<i;M++){var A=void 0,k=f.getItemVisual(M,"style");if(c){var T=f.get(C[0],M),I=f.get(C[1],M);if(isNaN(f.get(C[2],M))||isNaN(T)||isNaN(I)||T<s[0]||T>s[1]||I<l[0]||I>l[1])continue;var D=u.dataToPoint([T,I]);A=new Sk({shape:{x:D[0]-o/2,y:D[1]-a/2,width:o,height:a},style:k})}else{if(isNaN(f.get(C[1],M)))continue;A=new Sk({z2:1,shape:u.dataToRect([f.get(C[0],M)]).contentShape,style:k})}if(f.hasItemOption){var O=f.getItemModel(M),R=O.getModel("emphasis");g=R.getModel("itemStyle").getItemStyle(),m=O.getModel(["blur","itemStyle"]).getItemStyle(),v=O.getModel(["select","itemStyle"]).getItemStyle(),y=O.get(["itemStyle","borderRadius"]),w=R.get("focus"),S=R.get("blurScope"),_=R.get("disabled"),x=_N(O)}A.shape.r=y;var P=e.getRawValue(M),E="-";P&&null!=P[2]&&(E=P[2]+""),_L(A,x,{labelFetcher:e,labelDataIndex:M,defaultOpacity:k.opacity,defaultText:E}),A.ensureState("emphasis").style=g,A.ensureState("blur").style=m,A.ensureState("select").style=v,_f(A,w,S,_),A.incremental=r,r&&(A.states.emphasis.hoverLayer=!0),p.add(A),f.setItemGraphicEl(M,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 E$;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")],C=p.mapArray(_,function(t,n,i){var r=e.dataToPoint([t,n]);return r[0]-=v,r[1]-=y,r.push(i),r}),M=n.getExtent(),A="visualMap.continuous"===n.type?(r=n.option.range,o=M[1]-M[0],r=[(r[0]-M[0])/o,(r[1]-M[0])/o],function(e){return e>=r[0]&&e<=r[1]}):(a=n.getPieceList(),s=n.option.selected,l=M[1]-M[0],u=(a=vw(a,function(e){return{interval:[(e.interval[0]-M[0])/l,(e.interval[1]-M[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(C,w,S,h.color.getNormalizer(),{inRange:h.color.getColorMapper(),outOfRange:d.color.getColorMapper()},A);var k=new Sx({style:{width:w,height:S,x:v,y:y,image:f.canvas},silent:!0});this.group.add(k)},t.type="heatmap",t}(k4),Eq=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.getInitialData=function(e,t){return As(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var e=Ai.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}(MU),EY=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return xd(t,e),t.prototype.init=function(t,n,i){e.prototype.init.call(this,t,n,i),this._sourceManager=new Mk(this),MT(this)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),MT(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type="dataset",t.defaultOption={seriesLayoutBy:yN},t}(CX),EZ=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return xd(t,e),t.type="dataset",t}(DK),EX=["x","y","radius","angle","single"],EK=["cartesian2d","polar","singleAxis"];function EQ(e){return e+"Axis"}function EJ(e){var t=e.ecModel,n={infoList:[],infoMap:vY()};return e.eachTargetAxis(function(e,i){var r=t.getComponent(EQ(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 E0=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}(),E1=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 xd(t,e),t.prototype.init=function(e,t,n){var i=E2(e);this.settledOption=i,this.mergeDefaultAndTheme(e,n),this._doInit(i)},t.prototype.mergeOption=function(e){var t=E2(e);vf(this.option,e,!0),vf(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;vb([["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=vY();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 vb(EX,function(n){var i=this.getReferringComponents(EQ(n),yM);if(i.specified){t=!0;var r=new E0;vb(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 E0;if(o.add(r.componentIndex),e.set(n,o),i=!1,"x"===n||"y"===n){var a=r.getReferringComponents("grid",yC).models[0];a&&vb(t,function(e){r.componentIndex!==e.componentIndex&&a===e.getReferringComponents("grid",yC).models[0]&&o.add(e.componentIndex)})}}}i&&vb(EX,function(t){if(i){var r=n.findComponents({mainType:EQ(t),filter:function(e){return"category"===e.get("type",!0)}});if(r[0]){var o=new E0;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");vb([["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(EQ(t),n))},this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each(function(n,i){vb(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(EQ(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;vb([["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;vb(["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}(CX);function E2(e){var t={};return vb(["start","end","startValue","endValue","throttle"],function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}var E5=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.type="dataZoom.inside",t.defaultOption=_4(E1.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(E1),E3=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.render=function(e,t,n,i){this.dataZoomModel=e,this.ecModel=t,this.api=n},t.type="dataZoom",t}(DK);function E4(e,t,n,i,r,o){e=e||0;var a,s=n[1]-n[0];if(null!=r&&(r=E8(r,[0,s])),null!=o&&(o=Math.max(o,null!=r?r:0)),"all"===i){var l=Math.abs(t[1]-t[0]);l=E8(l,[0,s]),r=o=E8(l,[r,o]),i=0}t[0]=E8(t[0],n),t[1]=E8(t[1],n);var u=E6(t,i);t[i]+=e;var c=r||0,h=n.slice();return u.sign<0?h[0]+=c:h[1]-=c,t[i]=E8(t[i],h),a=E6(t,i),null!=r&&(a.sign!==u.sign||a.span<r)&&(t[1-i]=t[i]+u.sign*r),a=E6(t,i),null!=o&&a.span>o&&(t[1-i]=t[i]+a.sign*o),t}function E6(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 E8(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var E9="\0_ec_interaction_mutex";function E7(e){return e[E9]||(e[E9]={})}Rg({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},vQ);var Le=function(e){function t(t){var n=e.call(this)||this;n._zr=t;var i=vM(n._mousedownHandler,n),r=vM(n._mousemoveHandler,n),o=vM(n._mouseupHandler,n),a=vM(n._mousewheelHandler,n),s=vM(n._pinchHandler,n);return n.enable=function(e,n){this.disable(),this._opt=vm(vp(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 xd(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(!Ij(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||!Li("moveOnMouseMove",e,this._opt)||"pinch"===e.gestureEvent||E7(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&&IV(e.event),Ln(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){Ij(e)||(this._dragging=!1)},t.prototype._mousewheelHandler=function(e){var t=Li("zoomOnMouseWheel",e,this._opt),n=Li("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;Lt(this,"zoom","zoomOnMouseWheel",e,{scale:i>0?s:1/s,originX:o,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(i);Lt(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(!E7(this._zr).globalPan){var t=e.pinchScale>1?1.1:1/1.1;Lt(this,"zoom",null,e,{scale:t,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})}},t}(wd);function Lt(e,t,n,i,r){e.pointerChecker&&e.pointerChecker(i,r.originX,r.originY)&&(IV(i.event),Ln(e,t,n,i,r))}function Ln(e,t,n,i,r){r.isAvailableBehavior=vM(Li,null,n,i),e.trigger(t,r)}function Li(e,t,n){var i=n[e];return!e||i&&(!vI(i)||t.event[i+"Key"])}var Lr=yb();function Lo(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function La(e,t){e.isDisposed()||e.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:t})}function Ls(e,t,n,i){return e.coordinateSystem.containPoint([n,i])}var Ll=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return xd(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:vM(Lu.pan,this),zoom:vM(Lu.zoom,this),scrollMove:vM(Lu.scrollMove,this)},Lr(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=Lr(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||Lo(n,a))}}}(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(E3),Lu={zoom:function(e,t,n,i){var r=this.range,o=r.slice(),a=e.axisModels[0];if(a){var s=Lh[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(E4(0,o,[0,100],0,c.minSpan,c.maxSpan),this.range=o,r[0]!==o[0]||r[1]!==o[1])return o}},pan:Lc(function(e,t,n,i,r,o){var a=Lh[i]([o.oldX,o.oldY],[o.newX,o.newY],t,r,n);return a.signal*(e[1]-e[0])*a.pixel/a.pixelLength}),scrollMove:Lc(function(e,t,n,i,r,o){return Lh[i]([0,0],[o.scrollDelta,o.scrollDelta],t,r,n).signal*(e[1]-e[0])*o.scrollDelta})};function Lc(e){return function(t,n,i,r){var o=this.range,a=o.slice(),s=t.axisModels[0];if(s&&(E4(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 Lh={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}},Ld=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(vv(EK,t.get("coordinateSystem"))>=0){var n=EQ(this._dimName),i=t.getReferringComponents(n,yC).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 vp(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=[];vb(["start","end"],function(l,u){var c=e[l],h=e[l+"Value"];"percent"===r[u]?(null==c&&(c=o[u]),h=i.parse(v0(c,o,n))):(t=!0,c=v0(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}),v5(s),v5(a);var l=this._minMaxSpan;function u(e,t,n,r,o){var a=o?"Span":"ValueSpan";E4(0,e,n,"all",l["min"+a],l["max"+a]);for(var s=0;s<2;s++)t[s]=v0(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],vb(a,function(e){var t;t=e.getData(),t&&vb(Pc(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=Pn((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&&vb(i,function(e){var t=e.getData(),i=t.mapDimensionsAll(n);if(i.length){if("weakFilter"===r){var a=t.getStore(),s=vw(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 vb(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)}});vb(i,function(e){t.setApproximateExtent(o,e)})}})}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;vb(["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=v0(n[0]+o,n,[0,100],!0):null!=r&&(o=v0(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=v4(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 Lp={getTargetSeries:function(e){function t(t){e.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(i,r){var o=e.getComponent(EQ(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 Ld(t,i,o,e),n.push(r.__dzAxisProxy))});var i=vY();return vb(n,function(e){vb(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 Lf=!1;function Lg(e){Lf||(Lf=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,Lp),e.registerAction("dataZoom",function(e,t){vb(function(e,t){var n,i=vY(),r=[],o=vY();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 Lm(e){Lg(e),e.registerComponentModel(E5),e.registerComponentView(Ll),e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(e,t){var n=Lr(t),i=n.coordSysRecordMap||(n.coordSysRecordMap=vY());i.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(e){vb(EJ(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:vA(Ls,r),dispatchAction:vA(La,t),dataZoomInfoMap:null,controller:null}).controller=new Le(t.getZr()),vb(["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=vY())).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 Lo(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),kX(e,"dispatchAction",a.model.get("throttle",!0),"fixRate")})})}var Lv=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=_4(E1.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}(E1),Ly="horizontal",Lx="vertical",Lb=["line","bar","candlestick","scatter"],Lw={easing:"cubicOut",duration:100,delay:0},LS=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return xd(t,e),t.prototype.init=function(e,t){this.api=t,this._onBrush=vM(this._onBrush,this),this._onBrushEnd=vM(this._onBrushEnd,this)},t.prototype.render=function(t,n,i,r){if(e.prototype.render.apply(this,arguments),kX(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(){kK(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 Ah;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===Ly?{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=CY(e.option);vb(["right","top","width","height"],function(e){"ph"===a[e]&&(a[e]=o[e])});var s=C$(a,r);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===Lx&&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!==Ly||r?n===Ly&&r?{scaleY:a?1:-1,scaleX:-1}:n!==Lx||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 Sk({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var r=new Sk({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:vM(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:v0(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 Ah,i=new A1({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new A3({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){vb(t.getAxisProxy(r,o).getTargetSeriesModels(),function(t){if(!e&&!(!0!==n&&0>vv(Lb,t.get("type")))){var a,s=i.getComponent(EQ(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 Sk({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});r.add(c),r.add(new Sk({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)"}})),vb([0,1],function(t){var o=a.get("handleIcon");!TD[o]&&0>o.indexOf("path://")&&0>o.indexOf("image://")&&(o="path://"+o);var s=TP(o,-1,0,2,2,null,!0);s.attr({cursor:L_(this._orient),draggable:!0,drift:vM(this._onDragMove,this,t),ondragend:vM(this._onDragEnd,this),onmouseover:vM(this._showDataInfo,this,!0),onmouseout:vM(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=a.get("handleSize");this._handleHeight=v1(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(),_p(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 Sj({silent:!0,invisible:!0,style:_B(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=v1(a.get("moveHandleSize"),o[1]),p=t.moveHandle=new Sk({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=TP(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 Sk({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:L_(this._orient),drift:vM(this._onDragMove,this,"all"),ondragstart:vM(this._showDataInfo,this,!0),ondragend:vM(this._onDragEnd,this),onmouseover:vM(this._showDataInfo,this,!0),onmouseout:vM(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[v0(e[0],[0,100],t,!0),v0(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];E4(t,i,r,n.get("zoomLock")?"all":e,null!=o.minSpan?v0(o.minSpan,a,r,!0):null,null!=o.maxSpan?v0(o.maxSpan,a,r,!0):null);var s=this._range,l=this._range=v5([v0(i[0],r,a,!0),v0(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=v5(n.slice()),r=this._size;vb([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 Sk,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=v5(this._handleEnds.slice());function h(e){var t=kE(n.handles[e].parent,this.group),a=kN(0===e?"right":"left",t),s=this._handleWidth/2+5,l=kL([c[e]+(0===e?-s:s),this._size[1]/2],t);i[e].setStyle({x:l[0],y:l[1],verticalAlign:r===Ly?"middle":a,align:r===Ly?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 vT(i)?i(e,o):vI(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,IV(i.event);var r=kL([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 xV(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=v5([v0(n.x,i,r,!0),v0(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&&(IV(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 Sk({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?Lw:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=EJ(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}(E3);function L_(e){return"vertical"===e?"ns-resize":"ew-resize"}function LC(e){e.registerComponentModel(Lv),e.registerComponentView(LS),Lg(e)}var LM=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 xd(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"]),vk(t)&&vb(t,function(e,i){var r;vI(e)&&(e={type:e}),t[i]=vf(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&&yv(i)&&t.push(i.name)}),this._availableNames=n;var i=this.get("data")||t,r=vY(),o=vw(i,function(e){return((vI(e)||vO(e))&&(e={name:e}),r.get(e.name))?null:(r.set(e.name,!0),new _2(e,this,this.ecModel))},this);this._data=v_(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")&&vb(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;vb(e,function(e){t[e.get("name",!0)]=!0})},t.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;vb(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])&&vv(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}(CX);function LA(e,t){var n=vj(t.get("padding")),i=t.getItemStyle(["color","opacity"]);return i.fill=t.get("backgroundColor"),e=new Sk({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 Lk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return xd(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new Ah),this.group.add(this._selectorGroup=new Ah),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=C$(l,u,c),d=this.layoutInner(e,r,h,i,a,s),p=C$(vm({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=LA(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=vY(),u=t.get("selectedMode"),c=[];n.eachRawSeries(function(e){e.get("legendHoverLink")||c.push(e.id)}),vb(t.getData(),function(r,o){var a=r.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var h=new Ah;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",vA(LT,a,null,i,c)).on("mouseover",vA(LD,d.name,null,i,c)).on("mouseout",vA(LO,d.name,null,i,c)),n.ssr&&v.eachChild(function(e){var t=SH(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=b1(p.fill);g&&0===g[3]&&(g[3]=.2,p=vg(vg({},p),{fill:b8(g,"rgba")}));var m=this._createItem(s,a,o,r,t,e,{},p,f,u,i);m.on("click",vA(LT,null,a,i,c)).on("mouseover",vA(LD,null,a,i,c)).on("mouseout",vA(LO,null,a,i,c)),n.ssr&&m.eachChild(function(e){var t=SH(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();vb(e,function(e){var i=e.type,r=new Sj({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});o.add(r),_L(r,{normal:t.getModel("selectorLabel"),emphasis:t.getModel(["emphasis","selectorLabel"])},{defaultText:e.title}),_p(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)),vb(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?Oq(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 Ah,b=i.getModel("textStyle");if(vT(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,_,C="inherit"===v&&e.getData().getVisual("symbol")?"inherit"===g?e.getData().getVisual("symbolRotate"):g:0;x.add(((_=TP(S=(w={itemWidth:d,itemHeight:p,icon:l,iconRotate:C,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 M=r.get("formatter"),A=t;vI(M)&&M?A=M.replace("{name}",null!=t?t:""):vT(M)&&(A=M(t));var k=f?b.getTextColor():i.get("inactiveColor");x.add(new Sj({style:_B(b,{text:A,x:"left"===o?d+5:-5,y:p/2,fill:k,align:o,verticalAlign:"middle"},{inheritColor:k})}));var T=new Sk({shape:x.getBoundingRect(),style:{fill:"transparent"}}),I=i.getModel("tooltip");return I.get("show")&&kW({el:T,componentModel:r,itemName:t,itemTooltipOption:I.option}),x.add(T),x.eachChild(function(e){e.silent=!0}),T.silent=!u,this.getContentGroup().add(x),_p(x),x.__legendDataIndex=n,x},t.prototype.layoutInner=function(e,t,n,i,r,o){var a=this.getContentGroup(),s=this.getSelectorGroup();CW(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();CW("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}(DK);function LT(e,t,n,i){LO(e,t,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),LD(e,t,n,i)}function LI(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 LD(e,t,n,i){LI(n)||n.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:i})}function LO(e,t,n,i){LI(n)||n.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:i})}function LR(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 LP(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)),vb(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 LE(e){e.registerComponentModel(LM),e.registerComponentView(Lk),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,LR),e.registerSubTypeDefaulter("legend",function(){return"plain"}),e.registerAction("legendToggleSelect","legendselectchanged",vA(LP,"toggleSelected")),e.registerAction("legendAllSelect","legendselectall",vA(LP,"allSelect")),e.registerAction("legendInverseSelect","legendinverseselect",vA(LP,"inverseSelect")),e.registerAction("legendSelect","legendselected",vA(LP,"select")),e.registerAction("legendUnSelect","legendunselected",vA(LP,"unSelect"))}var LL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,i){var r=CY(t);e.prototype.init.call(this,t,n,i),LN(this,t,r)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),LN(this,this.option,t)},t.type="legend.scroll",t.defaultOption=_4(LM.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}(LM);function LN(e,t,n){var i=e.getOrient(),r=[1,1];r[i.index]=0,Cq(t,n,{type:"box",ignoreSize:!!r})}var LB=["width","height"],Lz=["x","y"],LF=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 xd(t,e),t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new Ah),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Ah)},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=vk(c)?c:[c,c];p("pagePrev",0);var d=n.getModel("pageTextStyle");function p(e,t){var i=kV(n.get("pageIcons",!0)[n.getOrient().name][t],{onclick:vM(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 Sj({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=LB[s],u=Lz[s],c=LB[1-s],h=Lz[1-s];r&&CW("horizontal",a,e.get("selectorItemGap",!0));var d=e.get("selectorButtonGap",!0),p=a.getBoundingRect(),f=[-p.x,-p.y],g=vp(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;CW(e.get("orient"),l,e.get("itemGap"),i?n.width:null,i?null:n.height),CW("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=vz(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 Sk({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&&_M(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;vb(["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",vI(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=LB[r],a=Lz[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}(Lk);function LV(e){Rw(LE),e.registerComponentModel(LL),e.registerComponentView(LF),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 Lj=yb();function LH(e,t,n,i){!function e(t,n){if(!(vR(t)&&vR(n)))return t===n;var i=!0;return vb(n,function(n,r){i=i&&e(t[r],n)}),!!i}(Lj(n).lastProp,i)&&(Lj(n).lastProp=i,t?_M(n,i,e):(n.stopAnimation(),n.attr(i)))}function LW(e,t){e[t.get(["label","show"])?"show":"hide"]()}function L$(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function LG(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 LU(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:Ps(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};vb(i,function(e){var t=n.getSeriesByIndex(e.seriesIndex),i=e.dataIndexInside,r=t&&t.getDataParams(i);r&&s.seriesData.push(r)}),vI(a)?o=a.replace("{value}",o):vT(a)&&(o=a(s))}return o}function Lq(e,t,n){var i=xE();return xz(i,i,n.rotation),xB(i,i,n.position),kL([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}var LY=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(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,_,C=n.axis,M=C.grid,A=i.get("type"),k=LZ(M,C).getOtherAxis(C).getGlobalExtent(),T=C.toGlobalCoord(C.dataToCoord(t,!0));if(A&&"none"!==A){var I,D,O,R=(D=i.get("type"),O=i.getModel(D+"Style"),"line"===D?(I=O.getLineStyle()).fill=null:"shadow"===D&&((I=O.getAreaStyle()).stroke=null),I),P=LX[A](C,T,k);P.style=R,e.graphicKey=P.type,e.pointer=P}var E=PM(M.model,n);h=PE.innerTextLayout(E.rotation,0,E.labelDirection),E.labelMargin=i.get(["label","margin"]),d={position:Lq(n.axis,t,E),align:h.textAlign,verticalAlign:h.textVerticalAlign},p=LU(i.get("value"),n.axis,n.ecModel,i.get("seriesDataIndices"),{precision:i.get(["label","precision"]),formatter:i.get(["label","formatter"])}),g=vj((f=i.getModel("label")).get("padding")||0),v=xJ(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:_B(f,{text:p,font:m,fill:f.getTextColor(),padding:g,backgroundColor:_}),z2:10}},t.prototype.getHandleTransform=function(e,t,n){var i=PM(t.axis.grid.model,t,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=Lq(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=LZ(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=vA(LH,t,c);this.updatePointerEl(a,l,h),this.updateLabelEl(a,l,h,t)}else a=this._group=new Ah,this.createPointerEl(a,l,e,t),this.createLabelEl(a,l,e,t),n.getZr().add(a);LG(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=Pj(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=Lj(e).pointerEl=new ex[r.type](vp(t.pointer));e.add(o)}},e.prototype.createLabelEl=function(e,t,n,i){if(t.label){var r=Lj(e).labelEl=new Sj(vp(t.label));e.add(r),LW(r,i)}},e.prototype.updatePointerEl=function(e,t,n){var i=Lj(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=Lj(e).labelEl;r&&(r.setStyle(t.label.style),n(r,{x:t.label.x,y:t.label.y}),LW(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=kV(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){IV(e.event)},onmousedown:vM(this._onHandleDragMove,this,0,0),drift:vM(this._onHandleDragMove,this),ondragend:vM(this._onHandleDragEnd,this)}),i.add(r)),LG(r,n,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");vk(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,kX(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},e.prototype._moveHandleToValue=function(e,t){LH(this._axisPointerModel,!t&&this._moveAnimation,this._handle,L$(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(L$(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(L$(i)),Lj(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),kK(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 LZ(e,t){var n={};return n[t.dim+"AxisIndex"]=t.index,e.getCartesian(n)}var LX={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=LK(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=LK(e))||0],y:i[1-o],width:r[o],height:r[1-o]})}}};function LK(e){return+("x"!==e.dim)}var LQ=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(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}(CX),LJ=yb();function L0(e,t,n){if(!ys.node){var i=t.getZr();LJ(i).records||(LJ(i).records={}),function(e,t){LJ(e).initialized||(LJ(e).initialized=!0,n("click",vA(L2,"click")),n("mousemove",vA(L2,"mousemove")),n("globalout",L1));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});vb(LJ(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),(LJ(i).records[e]||(LJ(i).records[e]={})).handler=n}}function L1(e,t,n){e.handler("leave",null,n)}function L2(e,t,n,i){t.handler(e,n,i)}function L5(e,t){if(!ys.node){var n=t.getZr();(LJ(n).records||{})[e]&&(LJ(n).records[e]=null)}}var L3=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.render=function(e,t,n){var i=t.getComponent("tooltip"),r=e.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";L0("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){L5("axisPointer",t)},t.prototype.dispose=function(e,t){L5("axisPointer",t)},t.type="axisPointer",t}(DK);function L4(e,t){var n,i=[],r=e.seriesIndex;if(null==r||!(n=t.getSeriesByIndex(r)))return{point:[]};var o=n.getData(),a=yx(o,e);if(null==a||a<0||vk(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(vw(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 L6=yb();function L8(e,t,n){var i=e.currTrigger,r=[e.x,e.y],o=e.dispatchAction||vM(n.dispatchAction,n),a=t.getComponent("axisPointer").coordSysAxesInfo;if(a){Nn(r)&&(r=L4({seriesIndex:e.seriesIndex,dataIndex:e.dataIndex},t).point);var s,l,u,c,h,d,p,f,g,m,v,y=Nn(r),x=e.axesInfo,b=a.axesInfo,w="leave"===i||Nn(r),S={},_={},C={list:[],map:{}},M={showPointer:vA(L7,_),showTooltip:vA(Ne,C)};vb(a.coordSysMap,function(e,t){var n=y||e.containPoint(r);vb(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&&L9(e,a,M,!1,S)}})});var A={};return vb(b,function(e,t){var n=e.linkGroup;n&&!_[t]&&vb(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,Nt(t),Nt(e)))),A[e.key]=o}})}),vb(A,function(e,t){L9(b[t],e,M,!0,S)}),s=_,l=b,u=S.axesInfo=[],vb(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(Nn(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})}(C,r,e,o),c=b,d=(h=n).getZr(),p="axisPointerLastHighlights",f=L6(d)[p]||{},g=L6(d)[p]={},vb(c,function(e,t){var n=e.axisPointerModel.option;"show"===n.status&&e.triggerEmphasis&&vb(n.seriesDataIndices,function(e){g[e.seriesIndex+" | "+e.dataIndex]=e})}),m=[],v=[],vb(f,function(e,t){g[t]||v.push(e)}),vb(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 L9(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,vb(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),vb(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&&vg(r,g[0]),!i&&e.snap&&o.containData(m)&&null!=m&&(t=m),n.showPointer(e,t,g),n.showTooltip(e,f,m)}}function L7(e,t,n,i){e[t.key]={value:n,payloadBatch:i}}function Ne(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=PW(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 Nt(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 Nn(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}function Ni(e){PG.registerAxisPointerClass("CartesianAxisPointer",LY),e.registerComponentModel(LQ),e.registerComponentView(L3),e.registerPreprocessor(function(e){if(e){e.axisPointer&&0!==e.axisPointer.length||(e.axisPointer={});var t=e.axisPointer.link;t&&!vk(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=[],vb(o.getCoordinateSystems(),function(e){if(e.axisPointerEnabled){var t=PW(e.model),n=i.coordSysAxesInfo[t]={};i.coordSysMap[t]=e;var o=e.model.getModel("tooltip",a);if(vb(e.getAxes(),vA(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)&&vb(d.baseAxes,vA(p,!h||"cross",c)),h&&vb(d.otherAxes,vA(p,"cross",!1))}}function p(t,a,c){var h=c.model.getModel("axisPointer",s),d=h.get("show");if(d&&("auto"!==d||t||PH(h))){null==a&&(a=h.get("triggerTooltip"));var p=(h=t?function(e,t,n,i,r,o){var a=t.getModel("axisPointer"),s={};vb(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(e){s[e]=vp(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&&vm(l,c.textStyle)}}return e.model.getModel("axisPointer",new _2(s,n,i))}(c,o,s,r,t,a):h).get("snap"),f=h.get("triggerEmphasis"),g=PW(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:PH(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(PV(o[i+"AxisId"],n.id)||PV(o[i+"AxisIndex"],n.componentIndex)||PV(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)&&vb(c.coordSysAxesInfo[PW(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"},L8)}var Nr=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 xd(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}(CX),No=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(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=vz(e.get("textBaseline"),e.get("textVerticalAlign")),l=new Sj({style:_B(r,{text:e.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=e.get("subtext"),h=new Sj({style:_B(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(){CV(d,"_"+e.get("target"))}),p&&h.on("click",function(){CV(p,"_"+e.get("subtarget"))}),SH(l).eventData=SH(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=C$(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 Sk({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}(DK),Na=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.type="dataZoom.select",t}(E1),Ns=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.type="dataZoom.select",t}(E3);function Nl(e){e.registerComponentModel(Na),e.registerComponentView(Ns),Lg(e)}var Nu=function(){},Nc={},Nh=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;vb(this.option.feature,function(e,n){var i=Nc[n];i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(t)),vf(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}(CX),Nd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(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=[];vb(h,function(e,t){p.push(t)}),new M2(this._featureNames||[],p).add(f).update(f).remove(vA(f,null)).execute(),this._featureNames=p,o=e.getBoxLayoutParams(),a=e.get("padding"),l=C$(o,s={width:n.getWidth(),height:n.getHeight()},a),CW(e.get("orient"),r,e.get("itemGap"),l.width,l.height),CG(r,o,s,a),r.add(LA(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&&!vT(s)&&t){var l=s.style||(s.style={}),c=xJ(t,Sj.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],C=p[a],M=h[_],A=new _2(M,e,e.ecModel);if(i&&null!=i.newTitle&&i.featureName===_&&(M.title=i.newTitle),_&&!C){if(0===_.indexOf("my"))S={onclick:A.option.onclick,featureName:_};else{var k=Nc[_];if(!k)return;S=new k}d[_]=S}else if(!(S=d[C]))return;S.uid=_3("toolbox-feature"),S.model=A,S.ecModel=t,S.api=n;var T=S instanceof Nu;if(!_&&C){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 Nu&&l.getIcons?l.getIcons():s.get("icon"),b=s.get("title")||{},vI(x)?(g={})[f]=x:g=x,vI(b)?(m={})[f]=b:m=b,w=s.iconPaths={},vb(g,function(i,o){var a=kV(i,{},{x:-u/2,y:-u/2,width:u,height:u});a.setStyle(v.getItemStyle()),a.ensureState("emphasis").style=y.getItemStyle();var h=new Sj({style:{text:m[o],align:y.get("textAlign"),borderRadius:y.get("textBorderRadius"),padding:y.get("textPadding"),fill:null,font:_W({fontStyle:y.get("textFontStyle"),fontFamily:y.get("textFontFamily"),fontSize:y.get("textFontSize"),fontWeight:y.get("textFontWeight")},t)},ignore:!0});a.setTextContent(h),kW({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])?_o:_a)(a),r.add(a),a.on("click",vM(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?_o:_a)(i[e])},S instanceof Nu&&S.render&&S.render(A,t,n,i)}},t.prototype.updateView=function(e,t,n,i){vb(this._features,function(e){e instanceof Nu&&e.updateView&&e.updateView(e.model,t,n,i)})},t.prototype.remove=function(e,t){vb(this._features,function(n){n instanceof Nu&&n.remove&&n.remove(e,t)}),this.group.removeAll()},t.prototype.dispose=function(e,t){vb(this._features,function(n){n instanceof Nu&&n.dispose&&n.dispose(e,t)})},t.type="toolbox",t}(DK),Np=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(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=ys.browser;if(vT(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}(Nu),Nf="__ec_magicType_stack__",Ng=[["line","bar"],["stack"]],Nm=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return vb(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(Nv[n]){var a={series:[]};vb(Ng,function(e){vv(e,n)>=0&&vb(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=Nv[n](t,i,e,r);o&&(vm(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,yC).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=vf({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}(Nu),Nv={line:function(e,t,n,i){if("bar"===e)return vf({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 vf({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")===Nf;if("line"===e||"bar"===e)return i.setIconStatus("stack",r?"normal":"emphasis"),vf({id:t,stack:r?"":Nf},i.get(["option","stack"])||{},!0)}};Rg({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var Ny=Array(60).join("-");function Nx(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var Nb=RegExp("[ ]+","g"),Nw=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(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:v_([(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=[],vb(o,function(e,t){var n=e.categoryAxis,i=e.valueAxis.dim,r=[" "].concat(vw(e.series,function(e){return e.name})),o=[n.model.getCategories()];vb(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"+Ny+"\n\n")),vw(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"+Ny+"\n\n")],function(e){return!!e.replace(/[\n\t\s]/g,"")}).join("\n\n"+Ny+"\n\n"),meta:s.meta};if(vT(g)){var y=g(t.getOption());vI(y)?p.innerHTML=y:vL(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"),C=document.createElement("div");S+=";background-color:"+u.get("buttonColor")+";color:"+u.get("buttonTextColor");var M=this;function A(){l.removeChild(c),M._dom=null}IF(_,"click",A),IF(C,"click",function(){var e,n,i,r;if(null==m&&null!=g||null!=m&&null==g)return void A();try{vT(m)?e=m(p,t.getOption()):(n=f.value,i=n.split(RegExp("\n*"+Ny+"\n*","g")),r={series:[]},vb(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=Nx(t.shift()).split(Nb),i=[],r=vw(n,function(e){return{name:e,data:[]}}),o=0;o<t.length;o++){var a=Nx(t[o]).split(Nb);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=Nx(t.shift()),i=[],r=0;r<t.length;r++){var o=Nx(t[r]);if(o){var a=o.split(Nb),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],C.innerHTML=d[2],C.style.cssText=_.style.cssText=S,u.get("readOnly")||w.appendChild(C),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}(Nu);Rg({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(e,t){var n=[];vb(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,vw(r,function(e,t){var n=o&&o[t];if(!vR(n)||vk(n))return e;vR(e)&&!vk(e)||(e={value:e});var i=null!=n.name&&null==e.name;return e=vm(e,n),i&&delete e.name,e}))})}else n.push(vg({type:"scatter"},e))}),t.mergeOption(vm({series:n},e.newOption))});var NS=yb();function N_(e){var t=NS(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var NC=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(t,e),t.prototype.onclick=function(e,t){NS(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}(Nu);Rg({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var NM=Math.min,NA=Math.max,Nk=Math.pow,NT="globalPan",NI={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},ND={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},NO={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},NR=0,NP=function(e){function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},n._zr=t,n.group=new Ah,n._uid="brushController_"+NR++,vb(N6,function(e,t){this._handlers[t]=vM(e,this)},n),n}return xd(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,E7(n)[NT]=t),vb(this._handlers,function(e,t){n.on(t,e)}),this._brushType=e.brushType,this._brushOption=vf(vp(NO),e,!0)},t.prototype._doDisableBrush=function(){var e,t,n=this._zr;e=this._uid,(t=E7(n))[NT]===e&&(t[NT]=null),vb(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={};vb(e,function(e){t[e.panelId]=vp(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=vw(e,function(e){return vf(vp(NO),e,!0)});var t=this._covers,n=this._covers=[],i=this,r=this._creatingCover;return new M2(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]):NL(i,NE(i,s));Nz(i,l)}}},t.prototype.unmount=function(){return this.enableBrush(!1),NH(this),this._zr.remove(this.group),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(wd);function NE(e,t){var n=N9[t.brushType].createCover(e,t);return n.__brushOption=t,NB(n,t),e.group.add(n),n}function NL(e,t){var n=NF(t);return n.endCreating&&(n.endCreating(e,t),NB(t,t.__brushOption)),t}function NN(e,t){var n=t.__brushOption;NF(t).updateCoverShape(e,t,n.range,n)}function NB(e,t){var n=t.z;null==n&&(n=1e4),e.traverse(function(e){e.z=n,e.z2=n})}function Nz(e,t){NF(t).updateCommon(e,t),NN(e,t)}function NF(e){return N9[e.__brushOption.brushType]}function NV(e,t,n){var i,r=e._panels;if(!r)return!0;var o=e._transform;return vb(r,function(e){e.isTargetByCursor(t,n,o)&&(i=e)}),i}function Nj(e,t){var n=e._panels;if(!n)return!0;var i=t.__brushOption.panelId;return null==i||n[i]}function NH(e){var t=e._covers,n=t.length;return vb(t,function(t){e.group.remove(t)},e),t.length=0,!!n}function NW(e,t){var n=vw(e._covers,function(e){var t=e.__brushOption,n=vp(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}});e.trigger("brush",{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function N$(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function NG(e,t,n,i){var r=new Ah;return r.add(new Sk({name:"main",style:NZ(n),silent:!0,draggable:!0,cursor:"move",drift:vA(NQ,e,t,r,["n","s","w","e"]),ondragend:vA(NW,t,{isEnd:!0})})),vb(i,function(n){r.add(new Sk({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:vA(NQ,e,t,r,n),ondragend:vA(NW,t,{isEnd:!0})}))}),r}function NU(e,t,n,i){var r=i.brushStyle.lineWidth||0,o=NA(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;NY(e,t,"main",a,s,f,g),i.transformable&&(NY(e,t,"w",l,u,o,v),NY(e,t,"e",d,u,o,v),NY(e,t,"n",l,u,m,o),NY(e,t,"s",l,p,m,o),NY(e,t,"nw",l,u,o,o),NY(e,t,"ne",d,u,o,o),NY(e,t,"sw",l,p,o,o),NY(e,t,"se",d,p,o,o))}function Nq(e,t){var n=t.__brushOption,i=n.transformable,r=t.childAt(0);r.useStyle(NZ(n)),r.attr({silent:!i,cursor:i?"move":"default"}),vb([["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?NK(e,n[0]):(("e"===(a=[NK(r=e,(o=n)[0]),NK(r,o[1])])[0]||"w"===a[0])&&a.reverse(),a.join(""));s&&s.attr({silent:!i,invisible:!i,cursor:i?ND[l]+"-resize":null})})}function NY(e,t,n,i,r,o,a){var s,l,u,c=t.childOfName(n);c&&c.setShape((l=NM((s=N1(e,t,[[i,r],[i+o,r+a]]))[0][0],s[1][0]),{x:l,y:u=NM(s[0][1],s[1][1]),width:NA(s[0][0],s[1][0])-l,height:NA(s[0][1],s[1][1])-u}))}function NZ(e){return vm({strokeNoScale:!0},e.brushStyle)}function NX(e,t,n,i){var r=[NM(e,n),NM(t,i)],o=[NA(e,n),NA(t,i)];return[[r[0],o[0]],[r[1],o[1]]]}function NK(e,t){return({left:"w",right:"e",top:"n",bottom:"s"})[kN({w:"left",e:"right",n:"top",s:"bottom"}[t],kE(e.group))]}function NQ(e,t,n,i,r,o){var a=n.__brushOption,s=e.toRectRange(a.range),l=N0(t,r,o);vb(i,function(e){var t=NI[e];s[t[0]][t[1]]+=l[t[0]]}),a.range=e.fromRectRange(NX(s[0][0],s[1][0],s[0][1],s[1][1])),Nz(t,n),NW(t,{isEnd:!1})}function NJ(e,t,n,i){var r=t.__brushOption.range,o=N0(e,n,i);vb(r,function(e){e[0]+=o[0],e[1]+=o[1]}),Nz(e,t),NW(e,{isEnd:!1})}function N0(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 N1(e,t,n){var i=Nj(e,t);return i&&!0!==i?i.clipPath(n,e._transform):vp(n)}function N2(e){var t=e.event;t.preventDefault&&t.preventDefault()}function N5(e,t,n){return e.childOfName("main").contain(t,n)}function N3(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 Nk(r*r+o*o,.5)>6}(e)||o){if(a&&!o){"single"===s.brushMode&&NH(e);var l=vp(s);l.brushType=N4(l.brushType,a),l.panelId=!0===a?null:a.panelId,o=e._creatingCover=NE(e,l),e._covers.push(o)}if(o){var u=N9[N4(e._brushType,a)];o.__brushOption.range=u.getCreatingRange(N1(e,o,e._track)),i&&(NL(e,o),u.updateCommon(e,o)),NN(e,o),r={isEnd:i}}}else i&&"single"===s.brushMode&&s.removeOnClick&&NV(e,t,n)&&NH(e)&&(r={isEnd:i,removeOnClick:!0});return r}function N4(e,t){return"auto"===e?t.defaultBrushType:e}var N6={mousedown:function(e){if(this._dragging)N8(this,e);else if(!e.target||!e.target.draggable){N2(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=NV(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=NV(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)&&N9[h.brushType].contain(l[c],n[0],n[1]))return}u&&s.setCursorStyle("crosshair")}}(this,e,i),this._dragging){N2(e);var r=N3(this,e,i,!1);r&&NW(this,r)}},mouseup:function(e){N8(this,e)}};function N8(e,t){if(e._dragging){N2(t);var n=t.offsetX,i=t.offsetY,r=e.group.transformCoordToLocal(n,i),o=N3(e,t,r,!0);e._dragging=!1,e._track=[],e._creatingCover=null,o&&NW(e,o)}}var N9={lineX:N7(0),lineY:N7(1),rect:{createCover:function(e,t){function n(e){return e}return NG({toRectRange:n,fromRectRange:n},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=N$(e);return NX(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,i){NU(e,t,n,i)},updateCommon:Nq,contain:N5},polygon:{createCover:function(e,t){var n=new Ah;return n.add(new A3({name:"main",style:NZ(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new A1({name:"main",draggable:!0,drift:vA(NJ,e,t),ondragend:vA(NW,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,i){t.childAt(0).setShape({points:N1(e,t,n)})},updateCommon:Nq,contain:N5}};function N7(e){return{createCover:function(t,n){return NG({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=N$(t);return[NM(n[0][e],n[1][e]),NA(n[0][e],n[1][e])]},updateCoverShape:function(t,n,i,r){var o,a=Nj(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(),NU(t,n,l,r)},updateCommon:Nq,contain:N5}}var Be={axisPointer:1,tooltip:1,brush:1};function Bt(e){return xZ.create(e)}var Bn=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],Bi=function(){function e(e,t,n){var i=this;this._targetInfoList=[];var r=Bo(t,e);vb(Ba,function(e,t){(!n||!n.include||vv(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=Bu[e.brushType](0,n,t);e.__rangeOffset={offset:Bh[e.brushType](i.values,e.range,[1,1]),xyMinMax:i.xyMinMax}}}),e},e.prototype.matchOutputRanges=function(e,t,n){vb(e,function(e){var i=this.findTargetInfo(e,t);i&&!0!==i&&vb(i.coordSyses,function(i){var r=Bu[e.brushType](1,i,e.range,!0);n(e,r.values,i,t)})},this)},e.prototype.setInputRanges=function(e,t){vb(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=Bu[e.brushType](0,n.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?Bh[e.brushType](l.values,u.offset,(i=l.xyMinMax,r=u.xyMinMax,o=Bp(i),a=Bp(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 vw(this._targetInfoList,function(n){var i,r,o,a,s=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:(i=Bt(i=s),function(e){return kz(e,i)}),isTargetByCursor:(r=n.coordSysModel,o=Bt(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||!!Be.hasOwnProperty(i.mainType)||!a||a.model===r)}),getLinearBrushOtherExtent:(a=Bt(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&&vv(i.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,i=Bo(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<Bs.length;s++)if(Bs[s](i,o))return o}return!0},e}();function Br(e){return e[0]>e[1]&&e.reverse(),e}function Bo(e,t){return yS(e,t,{includeMainTypes:Bn})}var Ba={grid:function(e,t){var n=e.xAxisModels,i=e.yAxisModels,r=e.gridModels,o=vY(),a={},s={};(n||i||r)&&(vb(n,function(e){var t=e.axis.grid.model;o.set(t.id,t),a[t.id]=!0}),vb(i,function(e){var t=e.axis.grid.model;o.set(t.id,t),s[t.id]=!0}),vb(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=[];vb(r.getCartesians(),function(e,t){(vv(n,e.getAxis("x").model)>=0||vv(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:Bl.grid,xAxisDeclared:a[e.id],yAxisDeclared:s[e.id]})}))},geo:function(e,t){vb(e.geoModels,function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:Bl.geo})})}},Bs=[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}],Bl={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(kE(e)),t}},Bu={lineX:vA(Bc,0),lineY:vA(Bc,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=[Br([r[0],o[0]]),Br([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:vw(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 Bc(e,t,n,i){var r=n.getAxis(["x","y"][e]),o=Br(vw([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 Bh={lineX:vA(Bd,0),lineY:vA(Bd,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 vw(e,function(e,i){return[e[0]-n[0]*t[i][0],e[1]-n[1]*t[i][1]]})}};function Bd(e,t,n,i){return[t[0]-i[e]*n[0],t[1]-i[e]*n[1]]}function Bp(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var Bf=yu+"toolbox-dataZoom_",Bg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xd(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 NP(n.getZr()),this._brushController.on("brush",vM(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 Bi(Bv(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",N_(d).length>1?"emphasis":"normal")},t.prototype.onclick=function(e,t,n){Bm[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 Bi(Bv(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=N_(n),vb(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=E4(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=[];vb(e,function(e,n){t.push(vp(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}(Nu),Bm={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=N_(this.ecModel))[e.length-1],e.length>1&&e.pop(),n={},vb(t,function(t,i){for(var r=e.length-1;r>=0;r--)if(t=e[r][i]){n[i]=t;break}}),n))}};function Bv(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=yS(e,Bv(i));return vb(o.xAxisModels,function(e){return a(e,"xAxis","xAxisIndex")}),vb(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:Bf+t+o};a[n]=o,r.push(a)}},vH(null==D_.get("dataZoom")&&A),D_.set("dataZoom",A);var By=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(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}(CX);function Bx(e){var t=e.get("confine");return null!=t?!!t:"richText"===e.get("renderMode")}function Bb(e){if(ys.domSupported){for(var t=document.documentElement.style,n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n]}}var Bw=Bb(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function BS(e,t){if(!e)return t;t=CE(t,!0);var n=e.indexOf(t);return(e=-1===n?t:"-"+e.slice(0,n)+"-"+t).toLowerCase()}var B_=BS(Bb(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),BC=BS(Bw,"transform"),BM="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(ys.transform3dSupported?"will-change:transform;":"");function BA(e,t,n){var i=e.toFixed(0)+"px",r=t.toFixed(0)+"px";if(!ys.transformSupported)return n?"top:"+r+";left:"+i+";":[["top",r],["left",i]];var o=ys.transform3dSupported,a="translate"+(o?"3d":"")+"("+i+","+r+(o?",0":"")+")";return n?"top:0;left:0;"+BC+":"+a+";":[["top",0],["left",0],[Bw,a]]}function Bk(e,t,n,i,r){var o=t&&t.painter;if(n){var a=o&&o.getViewportRoot();a&&Ct(Ce,a,i,r,!0)&&Ct(e,n,Ce[0],Ce[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 BT=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,ys.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&&(vI(r)?document.querySelector(r):vL(r)?r:vT(r)&&r(e.getDom()));Bk(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;Iz(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,C=_.style,M=this._styleCoord;_.innerHTML?C.cssText=BM+(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=MH(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+=ys.transformSupported?","+BC+f:",left"+f+",top"+f),B_+":"+g)),a&&r.push("background-color:"+a),vb(["width","color","radius"],function(t){var n="border-"+t,i=CE(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),vb(["decoration","align"],function(e){var t=h.get(e);t&&m.push("text-"+e+":"+t)}),m.join(";"))),null!=d&&r.push("padding:"+vj(d).join("px ")+"px"),r.join(";")+";")+BA(M[0],M[1],!0)+"border-color:"+CF(t)+";"+(e.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):C.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(vI(r)&&"item"===n.get("trigger")&&!Bx(n)&&(a=function(e,t,n){if(!vI(n)||"inside"===n)return"";var i,r,o=e.get("backgroundColor"),a=e.get("borderWidth");t=CF(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=BC+":";vv(["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)),vI(e))o.innerHTML=e+a;else if(e){o.innerHTML="",vk(e)||(e=[e]);for(var s=0;s<e.length;s++)vL(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(Bk(n,this._zr,this._container,e,t),null!=n[0]&&null!=n[1]){var i=this.el.style;vb(BA(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",ys.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(vM(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}(),BI=function(){function e(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),BR(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;vR(e)&&Ma(""),this.el&&this._zr.remove(this.el);var a=n.getModel("textStyle");this.el=new Sj({style:{rich:t.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:i,textShadowColor:a.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:MH(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),vb(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(e){o.el.style[e]=n.get(e)}),vb(["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=BO(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;BR(i,this._zr,e,t),e=i[0],t=i[1];var r=n.style,o=BD(r.borderWidth||0),a=BO(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(vM(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){this._zr.remove(this.el)},e}();function BD(e){return Math.max(0,e)}function BO(e){var t=BD(e.shadowBlur||0),n=BD(e.shadowOffsetX||0),i=BD(e.shadowOffsetY||0);return{left:BD(t-n),right:BD(t+n),top:BD(t-i),bottom:BD(t+i)}}function BR(e,t,n,i){e[0]=n,e[1]=i,e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var BP=new Sk({shape:{x:-1,y:-1,width:2,height:2}}),BE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.init=function(e,t){if(!ys.node&&t.getDom()){var n,i=e.getComponent("tooltip"),r=this._renderMode="auto"===(n=i.get("renderMode"))?ys.domSupported?"html":"richText":n||"html";this._tooltipContent="richText"===r?new BI(t):new BT(t,{appendTo:i.get("appendToBody",!0)?"body":i.get("appendTo",!0)})}},t.prototype.render=function(e,t,n){if(!ys.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")?kX(this,"_updatePosition",50,"fixRate"):kK(this,"_updatePosition")}},t.prototype._initGlobalListener=function(){var e=this._tooltipModel.get("triggerOn");L0("itemTooltip",this._api,vM(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&&!ys.node&&n.getDom()){var r=BN(i,n);this._ticket="";var o=i.dataByCoordSys,a=function(e,t,n){var i,r=y_(e).queryOptionMap,o=r.keys()[0];if(o&&"series"!==o){var a=yA(t,o,r.get(o),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a&&(n.getViewOfComponentModel(a).group.traverse(function(t){var n=SH(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)BP.x=i.x,BP.y=i.y,BP.update(),SH(BP).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:BP},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=L4(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(BN(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"===BL([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"===SH(n).ssrType)return;this._lastDataByCoordSys=null,Ox(n,function(e){return null!=SH(e).dataIndex?(i=e,!0):null!=SH(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=vM(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=BL([t.tooltipOption],i),a=this._renderMode,s=[],l=ML("section",{blocks:[],noHeader:!0}),u=[],c=new MW;vb(e,function(e){vb(e.dataByAxis,function(e){var t=n.getComponent(e.axisDim+"Axis",e.axisIndex),r=e.value;if(t&&null!=r){var o=LU(r,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),h=ML("section",{header:o,noHeader:!vW(o),sortBlocks:!0,blocks:[]});l.blocks.push(h),vb(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=Ps(t.axis,{value:r}),f.axisValueLabel=o,f.marker=c.makeTooltipMarker("item",CF(f.color),a);var g=Mn(d.formatTooltip(p,!0,null)),m=g.frag;if(m){var v=BL([d],i).get("valueFormatter");h.blocks.push(v?vg({valueFormatter:v},m):m)}g.text&&u.push(g.text),s.push(f)}})}})}),l.blocks.reverse(),u.reverse();var h=t.position,d=MF(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=SH(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=BL([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 MW;g.marker=m.makeTooltipMarker("item",CF(g.color),h);var v=Mn(s.formatTooltip(l,!1,u)),y=p.get("order"),x=p.get("valueFormatter"),b=v.frag,w=b?MF(x?vg({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=SH(t),r=i.tooltipConfig.option||{};if(vI(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=BL(a,this._tooltipModel,l?{position:l}:null),c=u.get("content"),h=Math.random()+"",d=new MW;this._showOrMove(u,function(){var n=vp(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(vI(c)){var p=e.ecModel.get("useUTC"),f=vk(n)?n[0]:n,g=f&&f.axisType&&f.axisType.indexOf("time")>=0;h=c,g&&(h=Cv(f.axisValue,h,p)),h=Cz(h,n,!0)}else if(vT(c)){var m=vM(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||vk(t)?{color:i||("html"===this._renderMode?"#fff":"none")}:vk(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),vT(t)&&(t=t([n,i],o,r.el,d,{viewSize:[s,l],contentSize:u.slice()})),vk(t))n=v1(t[0],s),i=v1(t[1],l);else if(vR(t)){var p=t;p.width=u[0],p.height=u[1];var f=C$(p,{width:s,height:l});n=f.x,i=f.y,c=null,h=null}else if(vI(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,_,C,M,g=(m=n,v=i,y=r,x=s,b=l,w=c?null:20,S=h?null:20,C=(_=y.getSize())[0],M=_[1],null!=w&&(m+C+w+2>x?m-=C+w:m+=w),null!=S&&(v+M+S>b?v-=M+S:v+=S),[m,v]);n=g[0],i=g[1]}if(c&&(n-=BB(c)?u[0]/2:"right"===c?u[0]:0),h&&(i-=BB(h)?u[1]/2:"bottom"===h?u[1]:0),Bx(e)){var A,k,T,I,D,O,R,P,g=(A=n,k=i,T=r,I=s,D=l,R=(O=T.getSize())[0],P=O[1],A=Math.min(A+R,I)-R,k=Math.min(k+P,D)-P,[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&&vb(n,function(n,o){var a=n.dataByAxis||[],s=(e[o]||{}).dataByAxis||[];(r=r&&a.length===s.length)&&vb(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)&&vb(a,function(e,t){var n=l[t];r=r&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),i&&vb(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){!ys.node&&t.getDom()&&(kK(this,"_updatePosition"),this._tooltipContent.dispose(),L5("itemTooltip",t))},t.type="tooltip",t}(DK);function BL(e,t,n){var i,r=t.ecModel;n?(i=new _2(n,r,r),i=new _2(t.option,i,r)):i=t;for(var o=e.length-1;o>=0;o--){var a=e[o];a&&(a instanceof _2&&(a=a.get("tooltip",!0)),vI(a)&&(a={formatter:a}),a&&(i=new _2(a,i,r)))}return i}function BN(e,t){return e.dispatchAction||vM(t.dispatchAction,t)}function BB(e){return"center"===e||"middle"===e}var Bz={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 BF=function(e,t,n){var i=vp((Bz[e]||{})[t]);return n&&vk(i)?i[i.length-1]:i};var BV=function(){function e(t){var n,i,r=t.mappingMethod,o=t.type,a=this.option=vp(t);this.type=o,this.mappingMethod=r,this._normalizeData=BX[r];var s=e.visualHandlers[o];this.applyVisual=s.applyVisual,this.getColorMapper=s.getColorMapper,this._normalizedToVisual=s._normalizedToVisual[r],"piecewise"===r?(Bj(a),i=(n=a).pieceList,n.hasSpecialVisual=!1,vb(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(vb(t,function(e,t){n[e]=t}),!vk(i)){var r=[];vR(i)?vb(i,function(e,t){var i=n[t];r[null!=i?i:-1]=e}):r[-1]=i,i=BZ(e,r)}for(var o=t.length-1;o>=0;o--)null==i[o]&&(delete n[t[o]],t.pop())}(a):Bj(a,!0):(vH("linear"!==r||a.dataExtent),Bj(a))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return vM(this._normalizeData,this)},e.listVisualTypes=function(){return vC(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){vR(e)?vb(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,i){var r,o=vk(t)?[]:vR(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&&vb(e.visualHandlers,function(e,r){t.hasOwnProperty(r)&&(i[r]=t[r],n=!0)}),n?i:null},e.prepareVisualTypes=function(e){if(vk(e))e=e.slice();else{if(!vR(e))return[];var t=[];vb(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||vI(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:B$("color"),getColorMapper:function(){var e=this.option;return vM("category"===e.mappingMethod?function(e,t){return t||(e=this._normalizeData(e)),BG.call(this,e)}:function(t,n,i){var r=!!i;return n||(t=this._normalizeData(t)),i=b3(t,e.parsedVisual,i),r?i:b8(i,"rgba")},this)},_normalizedToVisual:{linear:function(e){return b8(b3(e,this.option.parsedVisual),"rgba")},category:BG,piecewise:function(e,t){var n=BY.call(this,t);return null==n&&(n=b8(b3(e,this.option.parsedVisual),"rgba")),n},fixed:BU}},colorHue:BH(function(e,t){return b4(e,t)}),colorSaturation:BH(function(e,t){return b4(e,null,t)}),colorLightness:BH(function(e,t){return b4(e,null,null,t)}),colorAlpha:BH(function(e,t){return b6(e,t)}),decal:{applyVisual:B$("decal"),_normalizedToVisual:{linear:null,category:BG,piecewise:null,fixed:null}},opacity:{applyVisual:B$("opacity"),_normalizedToVisual:Bq([0,1])},liftZ:{applyVisual:B$("liftZ"),_normalizedToVisual:{linear:BU,category:BU,piecewise:BU,fixed:BU}},symbol:{applyVisual:function(e,t,n){n("symbol",this.mapValueToVisual(e))},_normalizedToVisual:{linear:BW,category:BG,piecewise:function(e,t){var n=BY.call(this,t);return null==n&&(n=BW.call(this,e)),n},fixed:BU}},symbolSize:{applyVisual:B$("symbolSize"),_normalizedToVisual:Bq([0,1])}},e}();function Bj(e,t){var n=e.visual,i=[];vR(n)?vb(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]),BZ(e,i)}function BH(e){return{applyVisual:function(t,n,i){var r=this.mapValueToVisual(t);i("color",e(n("color"),r))},_normalizedToVisual:Bq([0,1])}}function BW(e){var t=this.option.visual;return t[Math.round(v0(e,[0,1],[0,t.length-1],!0))]||{}}function B$(e){return function(t,n,i){i(e,this.mapValueToVisual(t))}}function BG(e){var t=this.option.visual;return t[this.option.loop&&-1!==e?e%t.length:e]}function BU(){return this.option.visual[0]}function Bq(e){return{linear:function(t){return v0(t,e,this.option.visual,!0)},category:BG,piecewise:function(t,n){var i=BY.call(this,n);return null==i&&(i=v0(t,e,this.option.visual,!0)),i},fixed:BU}}function BY(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var i=BV.findPieceIndex(e,n),r=n[i];if(r&&r.visual)return r.visual[this.type]}}function BZ(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=vw(t,function(e){return b1(e)||[0,0,0,1]})),t}var BX={linear:function(e){return v0(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=BV.findPieceIndex(e,t,!0);if(null!=n)return v0(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:vQ};function BK(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function BQ(e,t,n){var i={};return vb(t,function(t){var r,o=i[t]=((r=function(){}).prototype.__hidden=r.prototype,new r);vb(e[t],function(e,i){if(BV.isValidType(i)){var r={type:i,visual:e};n&&n(r,t),o[i]=new BV(r),"opacity"===i&&((r=vp(r)).type="colorAlpha",o.__hidden.__alphaForOpacity=new BV(r))}})}),i}var BJ=BV.mapVisual,B0=BV.eachVisual,B1=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 xd(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||(vb(n=this.replacableOptionKeys,function(t){e.hasOwnProperty(t)&&BK(e[t])&&(i=!0)}),i&&vb(n,function(t){e.hasOwnProperty(t)&&BK(e[t])?r[t]=vp(e[t]):delete r[t]})),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=vM(e,this),this.controllerVisuals=BQ(this.option.controller,t,e),this.targetVisuals=BQ(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=yc(e),t},t.prototype.eachTargetSeries=function(e,t){vb(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||["<",">"],vk(e)&&(e=e.slice(),i=!0);var l=t?e:i?[u(e[0]),u(e[1])]:u(e);if(vI(s))return s.replace("{value}",i?l[0]:l).replace("{value2}",i?l[1]:l);if(vT(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=v5([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={});vf(i,n),vf(r,n);var o=this.isCategory();function a(n){vk(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]={},vb(i,function(e,t){if(BV.isValidType(t)){var n=BF(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";vb(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&&vp(t)||(o?r:[r])),null==l.symbolSize&&(l.symbolSize=n&&vp(n)||(o?s[0]:[s[0],s[0]])),l.symbol=BJ(l.symbol,function(e){return"none"===e?r:e});var u=l.symbolSize;if(null!=u){var c=-1/0;B0(u,function(e){e>c&&(c=e)}),l.symbolSize=BJ(u,function(e){return v0(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}(CX),B2=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(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):vk(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),vb(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=v5((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=B5(this,"outOfRange",this.getExtent()),n=B5(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=_4(B1.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}(B1);function B5(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 B3=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 xd(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=vj(t.get("padding")||0),i=e.getBoundingRect();e.add(new Sk({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 vb(BV.prepareVisualTypes(l),function(i){var r=l[i];n.convertOpacityToAlpha&&"opacity"===i&&(i="colorAlpha",r=l.__alphaForOpacity),BV.dependsOn(i,t)&&r&&r.applyVisual(e,a,s)}),o[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api;CG(e,t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},t.prototype.doRender=function(e,t,n,i){},t.type="visualMap",t}(DK),B4=[["left","right","width"],["top","bottom","height"]];function B6(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=B4[a],l=[0,null,10],u={},c=0;c<3;c++)u[B4[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=C$(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 B8(e,t){return vb(e||[],function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")}),e}var B9=Math.min,B7=Math.max,ze=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 xd(t,e),t.prototype.init=function(t,n){e.prototype.init.call(this,t,n),this._hoverLinkFromSeriesMouseOver=vM(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=vM(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 Sj({style:_B(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=B6(t,this.api,i),s=n.mainGroup=this._createBarGroup(a),l=new Ah;s.add(l),l.add(n.outOfRange=zt()),l.add(n.inRange=zt(null,o?zi(this._orient):null,vM(this._dragHandle,this,"all",!1),vM(this._dragHandle,this,"all",!0))),l.setClipPath(new Sk({shape:{x:0,y:0,width:i[0],height:i[1],r:3}}));var u=t.textStyleModel.getTextRect("国"),c=B7(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=vM(this._dragHandle,this,n,!1),s=vM(this._dragHandle,this,n,!0),l=x5(e.get("handleSize"),i[0]),u=TP(e.get("handleIcon"),-l/2,-l/2,l,l,null,!0),c=zi(this._orient);u.attr({cursor:c,draggable:!0,drift:a,ondragend:s,onmousemove:function(e){IV(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(),_y(u,!0),t.add(u);var h=new Sj({cursor:c,draggable:!0,drift:a,onmousemove:function(e){IV(e.event)},ondragend:s,style:_B(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=x5(e.get("indicatorSize"),n[0]),a=TP(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 Sx){var l=a.style;a.useStyle(vg({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 Sj({silent:!0,invisible:!0,style:_B(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():zn(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=[v0(t[0],n,i,!0),v0(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]];E4(t,i,r,e,0);var o=n.getExtent();this._dataInterval=[v0(i[0],r,o,!0),v0(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 ku(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 Ah("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();vb([0,1],function(l){var u=r[l];u.setStyle("fill",t.handlesColor[l]),u.y=e[l];var c=v0(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=kL(n.handleLabelPoints[l],kE(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=v0(e,o,s,!0),p=a[0]-h/2,f={x:u.x,y:u.y};u.y=d,u.x=p;var g=kL(l.indicatorLabelPoint,kE(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]=B9(B7(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=B9(B7(u[0],e),u[1]);var h=(r=n,o=c,a=u,s=6,(l=r.get("hoverLinkDataSize"))&&(s=v0(l,o,a,!0)/2),s),d=[e-h,e+h],p=v0(e,u,c,!0),f=[v0(d[0],u,c,!0),v0(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||zn(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=ym(e[i].seriesId,null);if(null==o)return;for(var a=yc(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",B8(v[0],n)),this._dispatchHighDown("highlight",B8(v[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){if(Ox(e.target,function(e){var n=SH(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",B8(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=kE(t,i?null:this.group);return vk(e)?kL(e,r,n):kN(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}(B3);function zt(e,t,n,i){return new A1({shape:{points:e},draggable:!!n,cursor:t,drift:n,onmousemove:function(e){IV(e.event)},ondragend:i})}function zn(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function zi(e){return"vertical"===e?"ns-resize":"ew-resize"}var zr={type:"selectDataRange",event:"dataRangeSelected",update:"update"},zo=function(e,t){t.eachComponent({mainType:"visualMap",query:e},function(t){t.setSelected(e.selected)})},za=[{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=vM(t.getValueState,t),a=t.getDataDimensionIndex(e.getData()),s={},vb(i,function(e){var t=BV.prepareVisualTypes(r[e]);s[e]=t}),{progress:function(e,t){function n(e){return Ov(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(vM(zs,null,e,t))||{stops:[],outerColors:[]},o=t.getDataDimensionIndex(n);o>=0&&(r.dimension=o,i.push(r))}}),e.getData().setVisual("visualMeta",i)}}];function zs(e,t,n,i){for(var r=t.targetVisuals[i],o=BV.prepareVisualTypes(r),a={color:Oy(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 zl(e){var t=e&&e.visualMap;vk(t)||(t=t?[t]:[]),vb(t,function(e){if(e){zu(e,"splitList")&&!zu(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&vk(t)&&vb(t,function(e){vR(e)&&(zu(e,"start")&&!zu(e,"min")&&(e.min=e.start),zu(e,"end")&&!zu(e,"max")&&(e.max=e.end))})}})}function zu(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var zc=!1;function zh(e){zc||(zc=!0,e.registerSubTypeDefaulter("visualMap",function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}),e.registerAction(zr,zo),vb(za,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(zl))}function zd(e){e.registerComponentModel(B2),e.registerComponentView(ze),zh(e)}var zp=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return xd(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],zf[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=vp(r)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=vw(this._pieceList,function(e){return e=vp(e),"inRange"!==t&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},i=BV.listVisualTypes(),r=this.isCategory();function o(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}vb(t.pieces,function(e){vb(i,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),vb(n,function(e,n){var i=!1;vb(this.stateList,function(e){i=i||o(t,e,n)||o(t.target,e,n)},this),i||vb(this.stateList,function(e){(t[e]||(t[e]={}))[n]=BF(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,vb(i,function(e,t){var n=this.getSelectedMapKey(e);r.hasOwnProperty(n)||(r[n]=!0)},this),"single"===n.selectedMode){var o=!1;vb(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=vp(e)},t.prototype.getValueState=function(e){var t=BV.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){BV.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 vb(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=_4(B1.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}(B1),zf={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]}),yn(e),vb(e,function(e,t){e.index=t,e.text=this.formatValueText(e.interval)},this)},categories:function(e){var t=this.option;vb(t.categories,function(t){e.push({text:this.formatValueText(t,!0),value:t})},this),zg(t,e)},pieces:function(e){var t=this.option;vb(t.pieces,function(t,n){vR(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=BV.retrieveVisuals(t),e.push(i)},this),zg(t,e),yn(e),vb(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 zg(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}var zm=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(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=vB(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,c,a),vb(l.viewPieceList,function(i){var l=i.piece,u=new Ah;u.onclick=vM(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 Sj({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),CW(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:B8(i.findTargetDataIndices(t),i)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return B6(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 Ah,a=this.visualMapModel.textStyleModel;o.add(new Sj({style:_B(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=vw(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(TP(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=vp(n.selected),o=t.getSelectedMapKey(e);"single"===i||!0===i?(r[o]=!0,vb(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}(B3);function zv(e){e.registerComponentModel(zp),e.registerComponentView(zm),zh(e)}function zy(e,t){if(!e)return!1;for(var n=vk(e)?e:[e],i=0;i<n.length;i++)if(n[i]&&n[i][t])return!0;return!1}function zx(e){yh(e,"label",["show"])}var zb=yb(),zw=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.createdBySelf=!1,n}return xd(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},t.prototype.isAnimationEnabled=function(){if(ys.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=zb(e)[r];if(!n||!n.data){zb(e)[r]=null;return}o?o._mergeOption(n,t,!0):(i&&zx(n),vb(n.data,function(e){e instanceof Array?(zx(e[0]),zx(e[1])):zx(e)}),vg(o=this.createMarkerModelFromSeries(n,this,t),{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),o.__hostSeries=e),zb(e)[r]=o},this)},t.prototype.formatTooltip=function(e,t,n){var i=this.getData(),r=this.getRawValue(e),o=i.getName(e);return ML("section",{header:this.name,blocks:[ML("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 zb(e)[t]},t.type="marker",t.dependencies=["series","grid","polar","geo"],t}(CX);vy(zw,Mt.prototype);var zS=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(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}(zw);function z_(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function zC(e,t,n,i,r,o){var a=[],s=y5(t,i)?t.getCalculationInfo("stackResultDimension"):i,l=zD(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=v3(t.get(i,u));return(h=Math.min(h,20))>=0&&(a[o]=+a[o].toFixed(h)),[a,c]}var zM={min:vA(zC,"min"),max:vA(zC,"max"),average:vA(zC,"average"),median:vA(zC,"median")};function zA(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)))&&!vk(t.coord)&&vk(o)){var a=zk(t,i,r,e);if((t=vp(t)).type&&zM[t.type]&&a.baseAxis&&a.valueAxis){var s=vv(o,a.baseAxis.dim),l=vv(o,a.valueAxis.dim),u=zM[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&&vk(o))for(var c=t.coord,h=0;h<2;h++)zM[c[h]]&&(c[h]=zD(i,i.mapDimension(o[h]),c[h]));else t.coord=[];return t}}function zk(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 zT(e,t){return!e||!e.containData||!t.coord||!!z_(t)||e.containData(t.coord)}function zI(e,t){return e?function(e,n,i,r){return Ms(r<2?e.coord&&e.coord[r]:e.value,t[r])}:function(e,n,i,r){return Ms(e.value,t[r])}}function zD(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 zO=yb(),zR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.init=function(){this.markerGroupMap=vY()},t.prototype.render=function(e,t,n){var i=this,r=this.markerGroupMap;r.each(function(e){zO(e).keep=!1}),t.eachSeries(function(e){var r=zw.getMarkerModelFromSeries(e,i.type);r&&i.renderSeries(e,r,t,n)}),r.each(function(e){zO(e).keep||i.group.remove(e.group)})},t.prototype.markKeep=function(e){zO(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;vb(e,function(e){var i=zw.getMarkerModelFromSeries(e,n.type);i&&i.getData().eachItemGraphicEl(function(e){e&&(t?S7(e,S4):S7(e,S6))})})},t.type="marker",t}(DK),zP=yb(),zE=function(e,t,n,i){var r=i[0],o=i[1];if(r&&o){var a=zA(e,r),s=zA(e,o),l=a.coord,u=s.coord;l[0]=vB(l[0],-1/0),l[1]=vB(l[1],-1/0),u[0]=vB(u[0],1/0),u[1]=vB(u[1],1/0);var c=function(e){for(var t=e[0],n=1,i=e.length;n<i;n++)t=vf(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 zL(e){return!isNaN(e)&&!isFinite(e)}function zN(e,t,n,i){var r=1-e;return zL(t[r])&&zL(n[r])}function zB(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(Tt(e,"cartesian2d"))return!!(n&&i&&(zN(1,n,i,e)||zN(0,n,i,e)))||!e||!e.containZone||!r.coord||!o.coord||!!z_(r)||!!z_(o)||e.containZone(r.coord,o.coord);return zT(e,r)||zT(e,o)}function zz(e,t,n,i,r){var o,a=i.coordinateSystem,s=e.getItemModel(t),l=v1(s.get(n[0]),r.getWidth()),u=v1(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(Tt(a,"cartesian2d")){var y=a.getAxis("x"),x=a.getAxis("y"),g=e.get(n[0],t),m=e.get(n[1],t);zL(g)?o[0]=y.toGlobalCoord(y.getExtent()[+("x0"!==n[0])]):zL(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 zF=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],zV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=zw.getMarkerModelFromSeries(e,"markArea");if(t){var i=t.getData();i.each(function(t){var r=vw(zF,function(r){return zz(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 Ah});this.group.add(l.group),this.markKeep(l);var u=function(e,t,n){if(e){var i,r,o=vw(e&&e.dimensions,function(e){var n=t.getData();return vg(vg({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})});i=new Ae(r=vw(["x0","y0","x1","y1"],function(e,t){return{name:e,type:o[t%2].type}}),n)}else i=new Ae(r=[{name:"value",type:"float"}],n);var a=vw(n.get("data"),vA(zE,t,e,n));e&&(a=v_(a,vA(zB,e)));var s=e?function(e,t,n,i){return Ms(e.coord[Math.floor(i/2)][i%2],r[i])}:function(e,t,n,i){return Ms(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=vw(zF,function(n){return zz(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))];v5(h),v5(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=Oy(a,"color");!f.fill&&(f.fill=g,vI(f.fill)&&(f.fill=b6(f.fill,.4))),f.stroke||(f.stroke=g),u.setItemVisual(t,"style",f)}),u.diff(zP(l).data).add(function(e){var t=u.getItemLayout(e);if(!t.allClipped){var n=new A1({shape:{points:t.points}});u.setItemGraphicEl(e,n),l.group.add(n)}}).update(function(e,n){var i=zP(l).data.getItemGraphicEl(n),r=u.getItemLayout(e);r.allClipped?i&&l.group.remove(i):(i?_M(i,{shape:{points:r.points}},t,e):i=new A1({shape:{points:r.points}}),u.setItemGraphicEl(e,i),l.group.add(i))}).remove(function(e){var t=zP(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")),_L(e,_N(i),{labelFetcher:t,labelDataIndex:n,defaultText:u.getName(n)||"",inheritColor:vI(r.fill)?b6(r.fill,1):"#000"}),_v(e,i),_f(e,null,null,i.get(["emphasis","disabled"])),SH(e).dataModel=t}),zP(l).data=u,l.group.silent=t.get("silent")||e.get("silent")},t.type="markArea",t}(zR),zj=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(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}(zw),zH=A9.prototype,zW=ki.prototype,z$=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};function zG(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}xd(function(){return null!==k&&k.apply(this,arguments)||this},k=z$);var zU=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-line",n}return xd(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new z$},t.prototype.buildPath=function(e,t){zG(t)?zH.buildPath.call(this,e,t):zW.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return zG(this.shape)?zH.pointAt.call(this,e):zW.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=zG(t)?[t.x2-t.x1,t.y2-t.y1]:zW.tangentAt.call(this,e);return bl(n,n)},t}(Sp),zq=["fromSymbol","toSymbol"];function zY(e){return"_"+e+"Type"}function zZ(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=TE(r),u=TL(a||0,l);return i+l+u+(o||"")+(s||"")}function zX(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=TE(r),u=TL(a||0,l),c=TP(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 zK(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 zQ=function(e){function t(t,n,i){var r=e.call(this)||this;return r._createLine(t,n,i),r}return xd(t,e),t.prototype._createLine=function(e,t,n){var i,r,o=e.hostModel,a=(i=e.getItemLayout(t),zK((r=new zU({name:"line",subPixelOptimize:!0})).shape,i),r);a.shape.percent=0,_A(a,{shape:{percent:1}},o,t),this.add(a),vb(zq,function(n){var i=zX(n,e,t);this.add(i),this[zY(n)]=zZ(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:{}};zK(a.shape,o),_M(r,a,i,t),vb(zq,function(n){var i=zZ(n,e,t),r=zY(n);if(this[r]!==i){this.remove(this.childOfName(n));var o=zX(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=_N(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,vb(zq,function(e){var t=this.childOfName(e);if(t){t.setColor(g),t.style.opacity=f.opacity;for(var n=0;n<SY.length;n++){var i=SY[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);_L(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)?v2(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");vk(x)||(x=[x,x]),v.__labelDistance=x}this.setTextConfig({position:null,local:!0,inside:!1}),_f(this,c,h,u)},t.prototype.highlight=function(){_o(this)},t.prototype.downplay=function(){_a(this)},t.prototype.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName("line");zK(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=ba([],l,s);if(bl(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}(Ah),zJ=function(){function e(e){this.group=new Ah,this._LineCtor=e||zQ}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=z0(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=z0(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(z2(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){kG(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,n){if(z2(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);z2(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 z0(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:_N(t)}}function z1(e){return isNaN(e[0])||isNaN(e[1])}function z2(e){return e&&!z1(e[0])&&!z1(e[1])}var z5=yb(),z3=function(e,t,n,i){var r,o=e.getData();if(vk(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=vB(i.yAxis,i.xAxis);else{var u=zk(i,o,t,e);s=u.valueAxis;var c=y3(o,u.valueDataDim);l=zD(o,c,a)}var h=+("x"!==s.dim),d=1-h,p=vp(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&&vO(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=[zA(e,r[0]),zA(e,r[1]),vg({},r[2])];return m[2].type=m[2].type||null,vf(m[2],m[0]),vf(m[2],m[1]),m};function z4(e){return!isNaN(e)&&!isFinite(e)}function z6(e,t,n,i){var r=1-e,o=i.dimensions[e];return z4(t[r])&&z4(n[r])&&t[e]===n[e]&&i.getAxis(o).containData(t[e])}function z8(e,t){if("cartesian2d"===e.type){var n=t[0].coord,i=t[1].coord;if(n&&i&&(z6(1,n,i,e)||z6(0,n,i,e)))return!0}return zT(e,t[0])&&zT(e,t[1])}function z9(e,t,n,i,r){var o,a=i.coordinateSystem,s=e.getItemModel(t),l=v1(s.get("x"),r.getWidth()),u=v1(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(Tt(a,"cartesian2d")){var p=a.getAxis("x"),f=a.getAxis("y"),c=a.dimensions;z4(e.get(c[0],t))?o[0]=p.toGlobalCoord(p.getExtent()[+!n]):z4(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 z7=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=zw.getMarkerModelFromSeries(e,"markLine");if(t){var i=t.getData(),r=z5(t).from,o=z5(t).to;r.each(function(t){z9(r,t,!0,e,n),z9(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 zJ);this.group.add(v.group);var y=(r=p,o=e,a=t,l=new Ae(s=r?vw(r&&r.dimensions,function(e){return vg(vg({},o.getData().getDimensionInfo(o.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:"value",type:"float"}],a),u=new Ae(s,a),c=new Ae([],a),h=vw(a.get("data"),vA(z3,o,r,a)),r&&(h=v_(h,vA(z8,r))),d=zI(!!r,s),l.initData(vw(h,function(e){return e[0]}),null,d),u.initData(vw(h,function(e){return e[1]}),null,d),c.initData(vw(h,function(e){return e[2]})),c.hasItemOption=!0,{from:l,to:u,line:c}),x=y.from,b=y.to,w=y.line;z5(t).from=x,z5(t).to=b,t.setData(w);var S=t.get("symbol"),_=t.get("symbolSize"),C=t.get("symbolRotate"),M=t.get("symbolOffset");function A(t,n,r){var o=t.getItemModel(n);z9(t,n,r,e,i);var a=o.getModel("itemStyle").getItemStyle();null==a.fill&&(a.fill=Oy(g,"color")),t.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:vz(o.get("symbolOffset",!0),M[+!r]),symbolRotate:vz(o.get("symbolRotate",!0),C[+!r]),symbolSize:vz(o.get("symbolSize"),_[+!r]),symbol:vz(o.get("symbol",!0),S[+!r]),style:a})}vk(S)||(S=[S,S]),vk(_)||(_=[_,_]),vk(C)||(C=[C,C]),vk(M)||(M=[M,M]),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){SH(e).dataModel=t,e.traverse(function(e){SH(e).dataModel=t})}),this.markKeep(v),v.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(zR),Fe=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(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}(zw);function Ft(e,t,n){var i=t.coordinateSystem;e.each(function(r){var o,a=e.getItemModel(r),s=v1(a.get("x"),n.getWidth()),l=v1(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 Fn=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return xd(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=zw.getMarkerModelFromSeries(e,"markPoint");t&&(Ft(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 TH),m=(r=h,o=e,a=t,l=new Ae(s=r?vw(r&&r.dimensions,function(e){return vg(vg({},o.getData().getDimensionInfo(o.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:"value",type:"float"}],a),u=vw(a.get("data"),vA(zA,o)),r&&(u=v_(u,vA(zT,r))),c=zI(!!r,s),l.initData(u,null,c),l);t.setData(m),Ft(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(vT(i)||vT(r)||vT(o)||vT(a)){var l=t.getRawValue(e),u=t.getDataParams(e);vT(i)&&(i=i(l,u)),vT(r)&&(r=r(l,u)),vT(o)&&(o=o(l,u)),vT(a)&&(a=a(l,u))}var c=n.getModel("itemStyle").getItemStyle(),h=Oy(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){SH(e).dataModel=t})}),this.markKeep(g),g.group.silent=t.get("silent")||e.get("silent")},t.type="markPoint",t}(zR);function Fi(e,t,n){var i=m7.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 Fr=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||wf,"string"==typeof t?r=Fi(t,n,i):vR(t)&&(t=(r=t).id),o.id=t,o.dom=r;var a=r.style;return a&&(vX(r),r.onselectstart=function(){return!1},a.padding="0",a.margin="0",a.borderWidth="0"),o.painter=n,o.dpr=i,o}return xA(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=Fi("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 xZ(0,0,0,0);function u(e){if(!(!e.isFinite()||e.isZero()))if(0===o.length){var t=new xZ(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 xZ(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 xZ(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;vN(t)?(a=(t.global||t.__width===i&&t.__height===o)&&t.__canvasGradient||OC(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=OE(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&&vb(n,function(e){d(e.x*u,e.y*u,e.width*u,e.height*u)})},t}(wd),Fo=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=vg({},n||{}),this.dpr=n.devicePixelRatio||wf,this._singleCanvas=r,this.root=e,e.style&&(vX(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 Fr(e,this,this.dpr);u.__builtin__=!0,u.initContext(),a[314159]=u,u.zlevel=314159,o.push(314159),this._domRoot=e}else{this._width=OA(e,0,n),this._height=OA(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(),OW(t,a,r,o===n-1))}t&&t.restore()}},e.prototype.getHoverLayer=function(){return this.getLayer(1e5)},e.prototype.paintOne=function(e,t){OH(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 ys.wxa&&vb(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))&&(OW(a,e,r,o),e.setPrevPaintRect(s))}else OW(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 Fr("zr_"+e,this,this.dpr)).zlevel=e,n.__builtin__=!0,this._layerConfig[e]?vf(n,this._layerConfig[e],!0):this._layerConfig[e-.01]&&vf(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__||vd("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,vb(this._layers,function(e){e.setUnpainted()})},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?vf(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)&&vf(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(vv(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=OA(r,0,i),t=OA(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 Fr("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++)OW(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}();Rw([function(e){e.registerComponentModel(EY),e.registerComponentView(EZ)},function(e){Rw(Lm),Rw(LC)},function(e){Rw(LE),Rw(LV)},function(e){e.registerChartView(Tu),e.registerSeriesModel(Au),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,vA(xo,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,{seriesType:"bar",plan:y4(),reset:function(e){if(xa(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=y5(n,u)&&!!n.getCalculationInfo("stackedOnSeries"),d=o.isHorizontal(),p=(t=o).toGlobalCoord(t.dataToCoord(+("log"===t.type))),f=xs(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&&y9(3*r),u=f&&l&&y9(3*r),c=f&&y9(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),C=w.get(s,n),M=p,A=void 0;h&&(A=_-w.get(a,n));var k=void 0,T=void 0,I=void 0,D=void 0;if(d){var O=i.dataToPoint([_,C]);if(h){var R=i.dataToPoint([A,C]);M=R[0]}k=M,T=O[1]+y,I=O[0]-M,D=v,Math.abs(I)<g&&(I=(I<0?-1:1)*g)}else{var O=i.dataToPoint([C,_]);if(h){var R=i.dataToPoint([C,A]);M=R[1]}k=O[0]+y,T=M,I=v,Math.abs(D=O[1]-M)<g&&(D=(D<=0?-1:1)*g)}f?(o[S]=k,o[S+1]=T,o[S+2]=d?I:D,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:I,height:D}),S+=3}f&&t.setLayout({largePoints:o,largeDataIndices:c,largeBackgroundPoints:u,valueAxisHorizontal:d})}}}}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,xc("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(T8),e.registerSeriesModel(TN),e.registerLayout(T9("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,xc("line"))},function(e){e.registerChartView(In),e.registerSeriesModel(Ir)},function(e){var t;e.registerChartView(IA),e.registerSeriesModel(II),t=e.registerAction,vb([["pieToggleSelect","toggleSelect"],["pieSelect","select"],["pieUnSelect","unselect"]],function(e){t(e[0],function(t,n,i){var r,o;t=vg({},t),i.dispatchAction(vg(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(vA(Ic,"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!vO(i)||!!isNaN(i)||!(i<0)})}})},function(e){Rw(P1),e.registerSeriesModel(RS),e.registerChartView(RA),e.registerLayout(T9("scatter"))},function(e){e.registerChartView(EI),e.registerSeriesModel(P4)},function(e){e.registerChartView(EU),e.registerSeriesModel(Eq)},function(e){Rw(P1),Rw(Ni)},function(e){e.registerComponentModel(Nr),e.registerComponentView(No)},function(e){e.registerComponentModel(Nh),e.registerComponentView(Nd),Nc.saveAsImage=Np,Nc.magicType=Nm,Nc.dataView=Nw,Nc.dataZoom=Bg,Nc.restore=NC,Rw(Nl)},function(e){Rw(Ni),e.registerComponentModel(By),e.registerComponentView(BE),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},vQ),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},vQ)},function(e){e.registerPainter("canvas",Fo)},function(e){Rw(zd),Rw(zv)},function(e){e.registerComponentModel(zS),e.registerComponentView(zV),e.registerPreprocessor(function(e){zy(e.series,"markArea")&&(e.markArea=e.markArea||{})})},function(e){e.registerComponentModel(zj),e.registerComponentView(z7),e.registerPreprocessor(function(e){zy(e.series,"markLine")&&(e.markLine=e.markLine||{})})},function(e){e.registerComponentModel(Fe),e.registerComponentView(Fn),e.registerPreprocessor(function(e){zy(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}]);let Fa=["click","dblclick","mousedown","mousemove","mouseup","mouseover","mouseout","globalout","contextmenu"],Fs=["datazoom","downplay","highlight"],Fl=(0,ew.memo)(function({option:e,theme:t,renderer:n,sx:i,style:r,onEvents:o,_instance:a,syncGroup:s,onChartInitialized:l}){let u=(0,ew.useRef)(e),c=(0,ew.useRef)(e),h=(0,ew.useRef)(null),d=(0,ew.useRef)(null);return(0,ew.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 Rs[e.getAttribute?e.getAttribute(Rh):e[Rh]]}(e);if(r)return r}var o=new O8(e,t,n);return o.id="ec_"+Ru++,Rs[o.id]=o,i&&yk(e,Rh,o.id),ef(o),OZ.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,ew.useEffect)(()=>{d.current&&s&&(d.current.group=s,function(e){if(vk(e)){var t=e;e=null,vb(t,function(t){null!=t.group&&(e=t.group)}),e=e||"g_"+Rc++,vb(t,function(t){t.group=e})}Rl[e]=!0}([d.current]))},[s,d]),(0,ew.useEffect)(()=>{void 0===c.current||ou(c.current,e)||d.current&&(d.current.setOption(e,!0),c.current=e)},[e]),(0,ew.useLayoutEffect)(()=>{let e=gt(()=>{d.current&&d.current.resize()},200);return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[]),(0,ew.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,Fa.includes(i))?e.on(t,t=>n(t,e)):(r=t,Fs.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,ew.useEffect)(()=>{gt(()=>{d.current&&d.current.resize()},200,{leading:!0})()},[i,r]),(0,eb.jsx)(uw.A,{ref:h,sx:i,style:r})});var Fu=n(17157);function Fc(e,t){return function(n){let i=new Date(Number(n));return e>15768e7?(0,Fu.formatWithTimeZone)(i,"yyyy",t):e>15552e6?(0,Fu.formatWithTimeZone)(i,"MMM yyyy",t):e>864e6?(0,Fu.formatWithTimeZone)(i,"dd.MM",t):e>1728e5?(0,Fu.formatWithTimeZone)(i,"dd.MM HH:mm",t):(0,Fu.formatWithTimeZone)(i,"HH:mm",t)}}var Fh=n(34007);function Fd(e){let{error:t}=e;return(0,eb.jsx)(Fh.A,{severity:"error",children:t.message})}var Fp=n(77440);let Ff=[{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 Fg({value:e,onChange:t}){return(0,eb.jsx)(gE,{label:"Font Size",control:(0,eb.jsx)(gF,{value:Ff.find(t=>t.value===e),options:Ff,getOptionLabel:e=>e.label,onChange:(e,{value:n})=>{t(n)},disableClearable:!0})})}function Fm({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)(eH.A,{direction:"row",gap:1,sx:{marginLeft:"auto"},...u,children:"read"===e?(0,eb.jsxs)(eb.Fragment,{children:[o&&(0,eb.jsx)(eV.A,{disabled:i,variant:"contained",onClick:()=>o("update"),children:"Edit"}),s&&(0,eb.jsx)(eV.A,{color:"error",disabled:i,variant:"outlined",onClick:s,children:"Delete"}),l&&(a||s)&&(0,eb.jsx)(fz.A,{orientation:"vertical",flexItem:!0,sx:{borderColor:e=>e.palette.grey["500"],"&.MuiDivider-root":{marginLeft:2,marginRight:1}}}),l&&(0,eb.jsx)(eV.A,{color:"secondary",variant:"outlined",onClick:l,children:n})]}):(0,eb.jsxs)(eb.Fragment,{children:[a&&(0,eb.jsx)(eV.A,{variant:"contained",disabled:!r,onClick:a,children:t}),l&&(0,eb.jsx)(eV.A,{color:"secondary",variant:"outlined",onClick:l,children:n})]})})}let Fv=0;class Fy{constructor(e,t){this.from=e,this.to=t}}class Fx{constructor(e={}){this.id=Fv++,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=FS.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}Fx.closedBy=new Fx({deserialize:e=>e.split(" ")}),Fx.openedBy=new Fx({deserialize:e=>e.split(" ")}),Fx.group=new Fx({deserialize:e=>e.split(" ")}),Fx.isolate=new Fx({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw RangeError("Invalid value for isolate: "+e);return e||"auto"}}),Fx.contextHash=new Fx({perNode:!0}),Fx.lookAhead=new Fx({perNode:!0}),Fx.mounted=new Fx({perNode:!0});class Fb{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[Fx.mounted.id]}}let Fw=Object.create(null);class FS{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):Fw,n=!!e.top|2*!!e.skipped|4*!!e.error|8*(null==e.name),i=new FS(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(Fx.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(Fx.group),i=-1;i<(n?n.length:0);i++){let r=t[i<0?e.name:n[i]];if(r)return r}}}}FS.none=new FS("",Object.create(null),0,8);class F_{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 FS(n.name,i,n.id,n.flags):n)}return new F_(t)}}let FC=new WeakMap,FM=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 FA{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=Fb.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 FF(this.topNode,e)}cursorAt(e,t=0,n=0){let i=new FF(FC.get(this)||this.topNode);return i.moveTo(e,t),FC.set(this,i._tree),i}get topNode(){return new FR(this,0,0,null)}resolve(e,t=0){let n=FD(FC.get(this)||this.topNode,e,t,!1);return FC.set(this,n),n}resolveInner(e,t=0){let n=FD(FM.get(this)||this.topNode,e,t,!0);return FM.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 FR?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=Fb.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let a=new FR(o.tree,o.overlay[0].from+e.from,-1,e);(r||(r=[i])).push(FD(a,t,n,!1))}}return r?FB(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:FW(FS.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new FA(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new FA(FS.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 Fk(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=[Fx.contextHash,o];a=a?[e].concat(a):[e]}if(r>25){let e=[Fx.lookAhead,r];a=a?[e].concat(a):[e]}return new FA(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],C,M,A=y-t;if(x-y<=r&&(M=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(M.size-M.skip),n=s.pos-M.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}(M.start,e,r);C=new FT(e,x-M.start,i),A=M.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 FT(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 FA){if(!a&&s.type==e&&s.length==r)return s;(l=s.prop(Fx.lookAhead))&&(o=i[a]+s.length+l)}return d(e,n,i,r,o,t)}}(_,S);C=FW(_,n,o,0,n.length,0,x-y,e,e)}else C=d(_,n,o,x-y,w-x,S)}p.push(C),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 FA(l[e.topID],p.reverse(),f.reverse(),g)}(e)}}FA.empty=new FA(FS.none,[],[],0);class Fk{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 Fk(this.buffer,this.index)}}class FT{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return FS.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&&(!FI(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 FT(r,o,this.set)}}function FI(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 FD(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 FR&&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 FR&&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 FO{cursor(e=0){return new FF(this,e)}getChild(e,t=null,n=null){let i=FP(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return FP(this,e,t,n)}resolve(e,t=0){return FD(this,e,t,!1)}resolveInner(e,t=0){return FD(this,e,t,!0)}matchContext(e){return FE(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 FR extends FO{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 FA&&(c=Fb.get(l))&&!c.overlay&&c.bracketed&&n>=u&&n<=u+l.length||FI(i,n,u,u+l.length)){if(l instanceof FT){if(r&ev.ExcludeBuffers)continue;let a=l.findChild(0,l.buffer.length,t,n-u,i);if(a>-1)return new FN(new FL(o,l,e,u),null,a)}else if(r&ev.IncludeAnonymous||!l.type.isAnonymous||FV(l)){let a;if(!(r&ev.IgnoreMounts)&&(a=Fb.get(l))&&!a.overlay)return new FR(a.tree,u,e,o);let s=new FR(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=Fb.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 FR(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 FP(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 FE(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 FL{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class FN extends FO{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 FN(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 FN(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 FN(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 FN(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 FA(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function FB(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 FR&&n.index<0?null:n.parent,r=e.slice();return i?r[t]=i:r.splice(t,1),new Fz(r,n)}class Fz{constructor(e,t){this.heads=e,this.node=t}get next(){return FB(this.heads)}}class FF{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 FR)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 FR?(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 FT||!e.type.isAnonymous||FV(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 FN(this.buffer,t,this.stack[e]);return this.bufferNode=new FN(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 FE(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 FE(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 FV(e){return e.children.some(e=>e instanceof FT||!e.type.isAnonymous||FV(e))}let Fj=new WeakMap;function FH(e,t){if(!e.isAnonymous||t instanceof FT||t.type!=e)return 1;let n=Fj.get(t);if(null==n){for(let i of(n=1,t.children)){if(i.type!=e||!(i instanceof FA)){n=1;break}n+=FH(e,i)}Fj.set(t,n)}return n}function FW(e,t,n,i,r,o,a,s,l){let u=0;for(let n=i;n<r;n++)u+=FH(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=FH(e,n[u]);for(u++;u<a;u++){let t=FH(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(FW(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 F${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 F$(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 F$(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 FG{startParse(e,t,n){return"string"==typeof e&&(e=new FU(e)),n=n?n.length?n.map(e=>new Fy(e.from,e.to)):[new Fy(0,0)]:[new Fy(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 FU{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 Fx({perNode:!0});class Fq{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 Fq(e,[],t,n,n,0,[],0,i?new FY(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 Fq(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 FZ(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 FY(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 FY{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class FZ{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 FX{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 FX(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 FX(this.stack,this.pos,this.index)}}function FK(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 FQ{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}let FJ=new FQ;class F0{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FJ,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=FJ,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 F1{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;F2(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}function F2(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=F5(n,i,t);return r<0||F5(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 F5(e,t,n){for(let i=t,r;65535!=(r=e[i]);i++)if(r==n)return i-t;return -1}F1.prototype.contextual=F1.prototype.fallback=F1.prototype.extend=!1,(class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?FK(e):e}token(e,t){let n=e.pos,i=0;for(;;){let n=e.next<0,r=e.resolveOffset(1,1);if(F2(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=F1.prototype.fallback=F1.prototype.extend=!1;let F3="u">typeof process&&process.env&&/\bparse\b/.test(process.env.LOG),F4=null;function F6(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 F8{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?F6(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?F6(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 FA){if(o==e){if(o<this.safeFrom)return null;let e=o+r.length;if(e<=this.safeTo){let t=r.prop(Fx.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 F9{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new FQ)}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 FQ).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 FQ,{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=Vi(a,s+2);else{0==i&&2==a[s+1]&&(i=this.putAction(Vi(a,s+2),t,n,i));break}a[s]==t&&(i=this.putAction(Vi(a,s+1),t,n,i))}return i}}class F7{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 F0(t,i),this.tokens=new F9(e,this.stream),this.topTerm=e.top[1];let{from:r}=i[0];this.stacks=[Fq.start(this,e.top[0],r)],this.fragments=n.length&&this.stream.end-r>4*e.bufferLength?new F8(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 F3&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw F3&&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 F3&&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=F3?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(Fx.contextHash)||0)==n))return e.useNode(a,i),F3&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(a.type.id)})`),!0;if(!(a instanceof FA)||0==a.children.length||a.positions[0]>0)break;let s=a.children[0];if(s instanceof FA&&0==a.positions[0])a=s;else break}}let a=r.stateSlot(e.state,4);if(a>0)return e.reduce(a),F3&&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),F3&&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 Ve(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=F3?this.stackID(a)+" -> ":"";if(a.deadEnd&&(r||(r=!0,a.restart(),F3&&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()&&(F3&&console.log(h+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));e++)F3&&(h=this.stackID(c)+" -> ");for(let e of a.recoverByInsert(s))F3&&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),F3&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(s)})`),Ve(a,n)):(!i||i.score<c.score)&&(i=c)}return i}stackToTree(e){return e.close(),FA.build({buffer:FX.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=(F4||(F4=new WeakMap)).get(e);return t||F4.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function Ve(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 Vt{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}class Vn extends FG{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=Fx[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 F_(t.map((t,r)=>FS.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=FK(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(Vr),this.states=FK(e.states,Uint32Array),this.data=FK(e.stateData),this.goto=FK(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new F1(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 F7(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=Vi(n,r+2)];else if(2==n[r+1])return Vi(n,r+2);else break;if(o==t||0==o)return Vi(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=Vi(this.data,n+2);else break;i=t(Vi(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=Vi(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(Vn.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]=Vr(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 Vt(e,n,i)}static deserialize(e){return new Vn(e)}}function Vi(e,t){return e[t]|e[t+1]<<16}function Vr(e){if(e.external){let t=+!!e.extend;return(n,i)=>e.external(n,i)<<1|t}return e.get}let Vo=0;class Va{constructor(e,t,n,i){this.name=e,this.set=t,this.base=n,this.modified=i,this.id=Vo++}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 Va&&(t=e),null==t?void 0:t.base)throw Error("Can not derive from a modified tag");let n=new Va("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 Vl(e);return e=>e.modified.indexOf(t)>-1?e:Vl.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let Vs=0;class Vl{constructor(e){this.name=e,this.instances=[],this.id=Vs++}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 Va(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(Vl.get(t,e));return r}}function Vu(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 Vh(i,r,a>0?n.slice(0,a):null);t[s]=l.sort(t[s])}}return Vc.add(t)}let Vc=new Fx({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 Vh(r.tags,r.mode,r.context);n?n.next=o:i=o,n=o}return i}});class Vh{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 Vd(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}}Vh.empty=new Vh([],2,null);class Vp{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(Vc);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||Vh.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(Fx.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 Vf=Va.define,Vg=Vf(),Vm=Vf(),Vv=Vf(Vm),Vy=Vf(Vm),Vx=Vf(),Vb=Vf(Vx),Vw=Vf(Vx),VS=Vf(),V_=Vf(VS),VC=Vf(),VM=Vf(),VA=Vf(),Vk=Vf(VA),VT=Vf(),VI={comment:Vg,lineComment:Vf(Vg),blockComment:Vf(Vg),docComment:Vf(Vg),name:Vm,variableName:Vf(Vm),typeName:Vv,tagName:Vf(Vv),propertyName:Vy,attributeName:Vf(Vy),className:Vf(Vm),labelName:Vf(Vm),namespace:Vf(Vm),macroName:Vf(Vm),literal:Vx,string:Vb,docString:Vf(Vb),character:Vf(Vb),attributeValue:Vf(Vb),number:Vw,integer:Vf(Vw),float:Vf(Vw),bool:Vf(Vx),regexp:Vf(Vx),escape:Vf(Vx),color:Vf(Vx),url:Vf(Vx),keyword:VC,self:Vf(VC),null:Vf(VC),atom:Vf(VC),unit:Vf(VC),modifier:Vf(VC),operatorKeyword:Vf(VC),controlKeyword:Vf(VC),definitionKeyword:Vf(VC),moduleKeyword:Vf(VC),operator:VM,derefOperator:Vf(VM),arithmeticOperator:Vf(VM),logicOperator:Vf(VM),bitwiseOperator:Vf(VM),compareOperator:Vf(VM),updateOperator:Vf(VM),definitionOperator:Vf(VM),typeOperator:Vf(VM),controlOperator:Vf(VM),punctuation:VA,separator:Vf(VA),bracket:Vk,angleBracket:Vf(Vk),squareBracket:Vf(Vk),paren:Vf(Vk),brace:Vf(Vk),content:VS,heading:V_,heading1:Vf(V_),heading2:Vf(V_),heading3:Vf(V_),heading4:Vf(V_),heading5:Vf(V_),heading6:Vf(V_),contentSeparator:Vf(VS),list:Vf(VS),quote:Vf(VS),emphasis:Vf(VS),strong:Vf(VS),link:Vf(VS),monospace:Vf(VS),strikethrough:Vf(VS),inserted:Vf(),deleted:Vf(),changed:Vf(),invalid:Vf(),meta:VT,documentMeta:Vf(VT),annotation:Vf(VT),processingInstruction:Vf(VT),definition:Va.defineModifier("definition"),constant:Va.defineModifier("constant"),function:Va.defineModifier("function"),standard:Va.defineModifier("standard"),local:Va.defineModifier("local"),special:Va.defineModifier("special")};for(let e in VI){let t=VI[e];t instanceof Va&&(t.name=e)}Vd([{tag:VI.link,class:"tok-link"},{tag:VI.heading,class:"tok-heading"},{tag:VI.emphasis,class:"tok-emphasis"},{tag:VI.strong,class:"tok-strong"},{tag:VI.keyword,class:"tok-keyword"},{tag:VI.atom,class:"tok-atom"},{tag:VI.bool,class:"tok-bool"},{tag:VI.url,class:"tok-url"},{tag:VI.labelName,class:"tok-labelName"},{tag:VI.inserted,class:"tok-inserted"},{tag:VI.deleted,class:"tok-deleted"},{tag:VI.literal,class:"tok-literal"},{tag:VI.string,class:"tok-string"},{tag:VI.number,class:"tok-number"},{tag:[VI.regexp,VI.escape,VI.special(VI.string)],class:"tok-string2"},{tag:VI.variableName,class:"tok-variableName"},{tag:VI.local(VI.variableName),class:"tok-variableName tok-local"},{tag:VI.definition(VI.variableName),class:"tok-variableName tok-definition"},{tag:VI.special(VI.variableName),class:"tok-variableName2"},{tag:VI.definition(VI.propertyName),class:"tok-propertyName tok-definition"},{tag:VI.typeName,class:"tok-typeName"},{tag:VI.namespace,class:"tok-namespace"},{tag:VI.className,class:"tok-className"},{tag:VI.macroName,class:"tok-macroName"},{tag:VI.propertyName,class:"tok-propertyName"},{tag:VI.operator,class:"tok-operator"},{tag:VI.comment,class:"tok-comment"},{tag:VI.meta,class:"tok-meta"},{tag:VI.invalid,class:"tok-invalid"},{tag:VI.punctuation,class:"tok-punctuation"}]);let VD=Vu({String:VI.string,Number:VI.number,"True False":VI.bool,PropertyName:VI.propertyName,Null:VI.null,", :":VI.separator,"[ ]":VI.squareBracket,"{ }":VI.brace}),VO=Vn.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:[VD],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}),VR=[],VP=[],VE="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<VE.length;e++)(e%2?VP:VR).push(t+=VE[e]);function VL(e){return e>=127462&&e<=127487}function VN(e,t,n){if(t==e.length)return t;t&&Vz(e.charCodeAt(t))&&VF(e.charCodeAt(t-1))&&t--;let i=VB(e,t);for(t+=VV(i);t<e.length;){let r=VB(e,t);if(8205==i||8205==r||n&&function(e){if(e<768)return!1;for(let t=0,n=VR.length;;){let i=t+n>>1;if(e<VR[i])n=i;else{if(!(e>=VP[i]))return!0;t=i+1}if(t==n)return!1}}(r))t+=VV(r),i=r;else if(VL(r)){let n=0,i=t-2;for(;i>=0&&VL(VB(e,i));)n++,i-=2;if(n%2==0)break;t+=2}else break}return t}function VB(e,t){let n=e.charCodeAt(t);if(!VF(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return Vz(i)?(n-55296<<10)+(i-56320)+65536:n}function Vz(e){return e>=56320&&e<57344}function VF(e){return e>=55296&&e<56320}function VV(e){return e<65536?1:2}class Vj{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]=VZ(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),VW.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]=VZ(this,e,t);let n=[];return this.decompose(e,t,n,0),VW.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 VG(this),r=new VG(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 VG(this,e)}iterRange(e,t=this.length){return new VU(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 Vq(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 VH(e):VW.from(VH.split(e,[])):Vj.empty}}class VH extends Vj{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 VY(i,a,n,o);i=a+1,n++}}decompose(e,t,n,i){var r;let o=e<=0&&t>=this.length?this:new VH((r=this.text,V$(r,[""],e,t)),Math.min(t,this.length)-Math.max(0,e));if(1&i){let e=n.pop(),t=V$(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new VH(t,e.length+o.length));else{let e=t.length>>1;n.push(new VH(t.slice(0,e)),new VH(t.slice(e)))}}else n.push(o)}replace(e,t,n){var i;if(!(n instanceof VH))return super.replace(e,t,n);[e,t]=VZ(this,e,t);let r=V$(this.text,V$(n.text,(i=this.text,V$(i,[""],0,e))),t),o=this.length+n.length-(t-e);return r.length<=32?new VH(r,o):VW.from(VH.split(r,[]),o)}sliceString(e,t=this.length,n="\n"){[e,t]=VZ(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 VH(n,i)),n=[],i=-1);return i>-1&&t.push(new VH(n,i)),t}}class VW extends Vj{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]=VZ(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 VW(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]=VZ(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 VW))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 VH(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]:VW.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 VW)for(let n of t.children)e(n);else t.lines>o&&(s>o||!s)?(c(),a.push(t)):t instanceof VH&&s&&(n=u[u.length-1])instanceof VH&&t.lines+n.lines<=32?(s+=t.lines,l+=t.length+1,u[u.length-1]=new VH(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 VW(a,t)}}function V$(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}Vj.empty=new VH([""],0);class VG{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 VH?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 VH?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 VH){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 VH?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 VU{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new VG(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 Vq{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&&(Vj.prototype[Symbol.iterator]=function(){return this.iter()},VG.prototype[Symbol.iterator]=VU.prototype[Symbol.iterator]=Vq.prototype[Symbol.iterator]=function(){return this});class VY{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 VZ(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function VX(e,t,n=!0,i=!0){return function(e,t,n=!0,i=!0){return(n?VN:function(e,t,n){for(;t>1;){let i=VN(e,t-2,n);if(i<t)return i;t--}return 0})(e,t,i)}(e,t,n,i)}function VK(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 VQ(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function VJ(e){return e<65536?1:2}let V0=/\r\n?|\n/;var V1=((I=V1||(V1={}))[I.Simple=0]="Simple",I[I.TrackDel=1]="TrackDel",I[I.TrackBefore=2]="TrackBefore",I[I.TrackAfter=3]="TrackAfter",I);class V2{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){V6(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 V2(e)}composeDesc(e){return this.empty?e:e.empty?this:V9(this,e)}mapDesc(e,t=!1){return e.empty?this:V8(this,e,t)}mapPos(e,t=-1,n=V1.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!=V1.Simple&&l>=e&&(n==V1.TrackDel&&i<e&&l>e||n==V1.TrackBefore&&i<e||n==V1.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 V2(e)}static create(e){return new V2(e)}}class V5 extends V2{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 V6(this,(t,n,i,r,o)=>e=e.replace(i,i+(n-t),o),!1),e}mapDesc(e,t=!1){return V8(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(Vj.empty);n.push(o?e.slice(r,r+o):Vj.empty)}r+=o}return new V5(t,n)}compose(e){return this.empty?e:e.empty?this:V9(this,e,!0)}map(e,t=!1){return e.empty?this:V8(this,e,t,!0)}iterChanges(e,t=!1){V6(this,e,t)}get desc(){return V2.create(this.sections)}filter(e){let t=[],n=[],i=[],r=new V7(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);V3(i,e,-1);let o=-1==r.ins?-1:0==r.off?r.ins:0;V3(t,e,o),o>0&&V4(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);V3(t,e,-1),V3(i,e,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(e),a+=e}}return{changes:new V5(t,n),filtered:V2.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&&V3(i,t-o,-1);let n=new V5(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 V5){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?Vj.of(u.split(n||V0)):u:Vj.empty,h=c.length;if(e==a&&0==h)return;e<o&&s(),e>o&&V3(i,e-o,-1),V3(i,a-e,h),V4(r,i,c),o=a}}(e),s(!a),a}static empty(e){return new V5(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(Vj.empty);n[i]=Vj.of(r.slice(1)),t.push(r[0],n[i].length)}}return new V5(t,n)}static createSet(e,t){return new V5(e,t)}}function V3(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 V4(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(Vj.empty);e.push(n)}}function V6(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=Vj.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 V8(e,t,n,i=!1){let r=[],o=i?[]:null,a=new V7(e),s=new V7(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);V3(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(V3(r,s.ins,-1);t;){let n=Math.min(a.len,t);a.ins>=0&&e<a.i&&a.len<=n&&(V3(r,0,a.ins),o&&V4(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;V3(r,t,e<a.i?a.ins:0),o&&e<a.i&&V4(o,r,a.text),e=a.i,a.forward(a.len-n)}else if(a.done&&s.done)return o?V5.createSet(r,o):V2.create(r);else throw Error("Mismatched change set lengths")}function V9(e,t,n=!1){let i=[],r=n?[]:null,o=new V7(e),a=new V7(t);for(let e=!1;;)if(o.done&&a.done)return r?V5.createSet(i,r):V2.create(i);else if(0==o.ins)V3(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;V3(i,t,n,e),r&&n&&V4(r,i,a.text)}else -1==a.ins?(V3(i,o.off?0:o.len,t,e),r&&V4(r,i,o.textBit(t))):(V3(i,o.off?0:o.len,a.off?0:a.ins,e),r&&!a.off&&V4(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 V3(i,0,a.ins,e),r&&V4(r,i,a.text),a.next()}class V7{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?Vj.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?Vj.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 je{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 je(n,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return jt.range(e,t,void 0,void 0,n);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return jt.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 jt.range(e.anchor,e.head)}static create(e,t,n,i){return new je(e,t,n,i)}}class jt{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:jt.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 jt([this.main],0)}addRange(e,t=!0){return jt.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,jt.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 jt(e.ranges.map(e=>je.fromJSON(e)),e.main)}static single(e,t=e){return new jt([jt.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 jt.normalized(e.slice(),t);n=r.to}return new jt(e,t)}static cursor(e,t=0,n,i){return je.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?je.create(t,e,32|o,n):je.create(e,t,o,n)}static undirectionalRange(e,t){return je.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?jt.range(a,o):jt.range(o,a))}}return new jt(e,t)}}function jn(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let ji=0;class jr{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=ji++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new jr(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(!e.combine?jo:(e,t)=>e===t),!!e.static,e.enables)}of(e){return new ja([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new ja(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new ja(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function jo(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class ja{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=ji++}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)||jl(e,u)){let t=n(e);if(a?!js(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=jy(t,l);if(this.dependencies.every(n=>n instanceof jr?t.facet(n)===e.facet(n):!(n instanceof jc)||t.field(n,!1)==e.field(n,!1))||(a?js(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 js(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 jl(e,t){let n=!1;for(let i of t)1&jv(e,i)&&(n=!0);return n}let ju=jr.define({static:!0});class jc{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 jc(ji++,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(ju).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(ju),r=n.facet(ju),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,ju.of({field:this,create:e})]}get extension(){return this}}function jh(e){return t=>new jp(t,e)}let jd={highest:jh(0),high:jh(1),default:jh(2),low:jh(3),lowest:jh(4)};class jp{constructor(e,t){this.inner=e,this.prec=t}}class jf{of(e){return new jg(this,e)}reconfigure(e){return jf.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class jg{constructor(e,t){this.compartment=e,this.inner=t}}class jm{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 jg&&o.delete(t.compartment)}if(s.set(t,n),Array.isArray(t))for(let i of t)e(i,n);else if(t instanceof jg){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 jp)e(t.inner,t.prec);else if(t instanceof jc)a[n].push(t),t.provides&&e(t.provides,n);else if(t instanceof ja)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 jc?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,jo(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=jy(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)jv(e,t);return e.values[a]=s(e),1},update(e,n){if(!jl(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=jl(e,i),l=r.config.facets[t.id],u=r.facet(t);if(l&&!o&&jo(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 jm(e,c,p.map(e=>e(h)),h,d,u)}}function jv(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 jy(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let jx=jr.define(),jb=jr.define({combine:e=>e.some(e=>e),static:!0}),jw=jr.define({combine:e=>e.length?e[0]:void 0,static:!0}),jS=jr.define(),j_=jr.define(),jC=jr.define(),jM=jr.define({combine:e=>!!e.length&&e[0]});class jA{constructor(e,t){this.type=e,this.value=t}static define(){return new jk}}class jk{of(e){return new jA(this,e)}}class jT{constructor(e){this.map=e}of(e){return new jI(this,e)}}class jI{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 jI(this.type,t)}is(e){return this.type==e}static define(e={}){return new jT(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}}jI.reconfigure=jI.define(),jI.appendConfig=jI.define();class jD{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&&jn(n,t.newLength),r.some(e=>e.type==jD.time)||(this.annotations=r.concat(jD.time.of(Date.now())))}static create(e,t,n,i,r,o){return new jD(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(jD.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function jO(e,t,n){var i;let r,o,a;return n?(r=t.changes,o=V5.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:jI.mapEffects(e.effects,r).concat(jI.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function jR(e,t,n){let i=t.selection,r=jE(t.annotations);return t.userEvent&&(r=r.concat(jD.userEvent.of(t.userEvent))),{changes:t.changes instanceof V5?t.changes:V5.of(t.changes||[],n,e.facet(jw)),selection:i&&(i instanceof jt?i:jt.single(i.anchor,i.head)),effects:jE(t.effects),annotations:r,scrollIntoView:!!t.scrollIntoView}}jD.time=jA.define(),jD.userEvent=jA.define(),jD.addToHistory=jA.define(),jD.remote=jA.define();let jP=[];function jE(e){return null==e?jP:Array.isArray(e)?e:[e]}var jL=((D=jL||(jL={}))[D.Word=0]="Word",D[D.Space=1]="Space",D[D.Other=2]="Other",D);let jN=/[\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 jB{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++)jv(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 jv(this,n),jy(this,n)}update(...e){return function e(t,n,i){let r=jR(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=jO(r,jR(t,n[e],o?r.changes.newLength:t.doc.length),o)}let o=jD.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return function(e){let t=e.startState,n=t.facet(jC),i=e;for(let r=n.length-1;r>=0;r--){let o=n[r](e);o&&Object.keys(o).length&&(i=jO(i,jR(t,o,e.changes.newLength),!0))}return i==e?e:jD.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(jS)){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=V5.empty(n.doc.length);else{let n=t.changes.filter(i);e=n.changes,r=n.filtered.mapDesc(n.changes).invertedDesc}t=jD.create(n,e,t.selection&&t.selection.map(r),jI.mapEffects(t.effects,r),t.annotations,t.scrollIntoView)}let r=n.facet(j_);for(let i=r.length-1;i>=0;i--){let o=r[i](t);t=o instanceof jD?o:Array.isArray(o)&&1==o.length&&o[0]instanceof jD?o[0]:e(n,jE(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(jf.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(jI.reconfigure)?(n=null,i=t.value):t.is(jI.appendConfig)&&(n=null,i=jE(i).concat(t.value));t=n?e.startState.values.slice():new jB(n=jm.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(jb)?e.newSelection:e.newSelection.asSingle();new jB(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:jt.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=jE(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=jI.mapEffects(o,l).concat(jI.mapEffects(jE(a.effects),u))}return{changes:i,selection:jt.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof V5?e:V5.of(e,this.doc.length,this.facet(jB.lineSeparator))}toText(e){return Vj.of(e.split(this.facet(jB.lineSeparator)||V0))}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:(jv(this,t),jy(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 jc&&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 jB.create({doc:e.doc,selection:jt.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=jm.resolve(e.extensions||[],new Map),n=e.doc instanceof Vj?e.doc:Vj.of((e.doc||"").split(t.staticFacet(jB.lineSeparator)||V0)),i=e.selection?e.selection instanceof jt?e.selection:jt.single(e.selection.anchor,e.selection.head):jt.single(0);return jn(i,n.length),t.staticFacet(jb)||(i=i.asSingle()),new jB(t,n,i,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(jB.tabSize)}get lineBreak(){return this.facet(jB.lineSeparator)||"\n"}get readOnly(){return this.facet(jM)}phrase(e,...t){for(let t of this.facet(jB.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(jx))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 jL.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()||jN.test(n)))return!0}return!1}(e))return jL.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return jL.Word;return jL.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=VX(t,o,!1);if(r(t.slice(e,o))!=jL.Word)break;o=e}for(;a<i;){let e=VX(t,a);if(r(t.slice(a,e))!=jL.Word)break;a=e}return o==a?null:jt.range(o+n,a+n)}}function jz(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}jB.allowMultipleSelections=jb,jB.tabSize=jr.define({combine:e=>e.length?e[0]:4}),jB.lineSeparator=jw,jB.readOnly=jM,jB.phrases=jr.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])}}),jB.languageData=jx,jB.changeFilter=jS,jB.transactionFilter=j_,jB.transactionExtender=jC,jf.reconfigure=jI.define();class jF{eq(e){return this==e}range(e,t=e){return jj.create(e,t,this)}}function jV(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}jF.prototype.startSide=jF.prototype.endSide=0,jF.prototype.point=!1,jF.prototype.mapMode=V1.TrackDel;class jj{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new jj(e,t,n)}}function jH(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class jW{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 jW(i,r,n,a):null,pos:o}}}class j${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 j$(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(jH)),this.isEmpty)return t.length?j$.of(t):this;let a=new jq(this,null,-1).goto(0),s=0,l=[],u=new jG;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(jj.create(a.from,a.to,a.value)),a.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?j$.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 j$(n,t,r||j$.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 jY.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return jY.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=jU(o,a,n),l=new jX(o,s,r),u=new jX(a,s,r);n.iterGaps((e,t,n)=>jK(l,e,u,t,n,i)),n.empty&&0==n.length&&jK(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=jU(r,o),s=new jX(r,a,0).goto(n),l=new jX(o,a,0).goto(n);for(;;){if(s.to!=l.to||!jQ(s.active,l.active)||s.point&&(!l.point||!jV(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 jX(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 jG;for(let i of e instanceof jj?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let i=e[n];if(jH(t,i)>0)return e.slice().sort(jH);t=i}return e}(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return j$.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=j$.empty;i=i.nextLayer)t=new j$(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}j$.empty=new j$([],[],null,-1),j$.empty.nextLayer=j$.empty;class jG{finishChunk(e){this.chunks.push(new jW(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 jG)).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(j$.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=j$.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function jU(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 jq{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 jY{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 jq(o,t,n,r));return 1==i.length?i[0]:new jY(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--)jZ(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--)jZ(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(),jZ(this.heap,0)}}}function jZ(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 jX{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=jY.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){jJ(this.active,e),jJ(this.activeTo,e),jJ(this.activeRank,e),this.minActive=j1(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++;j0(this.active,t,n),j0(this.activeTo,t,i),j0(this.activeRank,t,r),e&&j0(e,t,this.cursor.from),this.minActive=j1(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&&jJ(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 jK(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&&jV(e.point,n.point)&&jQ(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(s,h,e.point,n.point),t=!1):(t&&o.boundChange(s),h>s&&!jQ(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 jQ(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!jV(e[n],t[n]))return!1;return!0}function jJ(e,t){for(let n=t,i=e.length-1;n<i;n++)e[n]=e[n+1];e.pop()}function j0(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function j1(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 j2(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=VX(e,r));return i}function j5(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=VX(e,i)}return!0===i?-1:e.length}let j3="u"<typeof Symbol?"__ͼ":Symbol.for("ͼ"),j4="u"<typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),j6="u">typeof globalThis?globalThis:"u">typeof window?window:{};class j8{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=j6[j3]||1;return j6[j3]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let i=e[j4],r=n&&n.nonce;i?r&&i.setNonce(r):i=new j7(e,r),i.mount(Array.isArray(t)?t:[t],e)}}let j9=new Map;class j7{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let t=j9.get(n);if(t)return e[j4]=t;this.sheet=new i.CSSStyleSheet,j9.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[j4]=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 He={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:"'"},Ht={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Hn="u">typeof navigator&&/Mac/.test(navigator.platform),Hi="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Hr=0;Hr<10;Hr++)He[48+Hr]=He[96+Hr]=String(Hr);for(var Hr=1;Hr<=24;Hr++)He[Hr+111]="F"+Hr;for(var Hr=65;Hr<=90;Hr++)He[Hr]=String.fromCharCode(Hr+32),Ht[Hr]=String.fromCharCode(Hr);for(var Ho in He)Ht.hasOwnProperty(Ho)||(Ht[Ho]=He[Ho]);function Ha(){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 Hs="u">typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},Hl="u">typeof document?document:{documentElement:{style:{}}},Hu=/Edge\/(\d+)/.exec(Hs.userAgent),Hc=/MSIE \d/.test(Hs.userAgent),Hh=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Hs.userAgent),Hd=!!(Hc||Hh||Hu),Hp=!Hd&&/gecko\/(\d+)/i.test(Hs.userAgent),Hf=!Hd&&/Chrome\/(\d+)/.exec(Hs.userAgent),Hg="webkitFontSmoothing"in Hl.documentElement.style,Hm=!Hd&&/Apple Computer/.test(Hs.vendor),Hv=Hm&&(/Mobile\/\w+/.test(Hs.userAgent)||Hs.maxTouchPoints>2);var Hy={mac:Hv||/Mac/.test(Hs.platform),windows:/Win/.test(Hs.platform),linux:/Linux|X11/.test(Hs.platform),ie:Hd,ie_version:Hc?Hl.documentMode||6:Hh?+Hh[1]:Hu?+Hu[1]:0,gecko:Hp,gecko_version:Hp?+(/Firefox\/(\d+)/.exec(Hs.userAgent)||[0,0])[1]:0,chrome:!!Hf,chrome_version:Hf?+Hf[1]:0,ios:Hv,android:/Android\b/.test(Hs.userAgent),webkit:Hg,webkit_version:Hg?+(/\bAppleWebKit\/(\d+)/.exec(Hs.userAgent)||[0,0])[1]:0,safari:Hm,safari_version:Hm?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Hs.userAgent)||[0,0])[1]:0,tabSize:null!=Hl.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function Hx(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 Hb=Object.create(null);function Hw(e,t,n){if(e==t)return!0;e||(e=Hb),t||(t=Hb);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 HS(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 H_{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 HC=((O=HC||(HC={}))[O.Text=0]="Text",O[O.WidgetBefore=1]="WidgetBefore",O[O.WidgetAfter=2]="WidgetAfter",O[O.WidgetRange=3]="WidgetRange",O);class HM extends jF{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 HA(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 HT(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}=HI(e,t);n=(r?t?-3e8:-1:5e8)-1,i=(o?t?2e8:1:-6e8)+1}return new HT(e,n,i,t,e.widget||null,!0)}static line(e){return new Hk(e)}static set(e,t=!1){return j$.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}HM.none=j$.empty;class HA extends HM{constructor(e){let{start:t,end:n}=HI(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Hx(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Hb}eq(e){return this==e||e instanceof HA&&this.tagName==e.tagName&&Hw(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw RangeError("Mark decorations may not be empty");return super.range(e,t)}}HA.prototype.point=!1;class Hk extends HM{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Hk&&this.spec.class==e.spec.class&&Hw(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)}}Hk.prototype.mapMode=V1.TrackBefore,Hk.prototype.point=!0;class HT extends HM{constructor(e,t,n,i,r,o){super(t,n,r,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?V1.TrackBefore:V1.TrackAfter:V1.TrackDel}get type(){return this.startSide!=this.endSide?HC.WidgetRange:this.startSide<=0?HC.WidgetBefore:HC.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){var t,n;return e instanceof HT&&(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 HI(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 HD(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)}HT.prototype.point=!0;class HO extends jF{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(e){return e==this||e instanceof HO&&this.tagName==e.tagName&&Hw(this.attributes,e.attributes)}static create(e){return new HO(e.tagName,e.attributes||Hb,null==e.rank?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return j$.of(e,t)}}function HR(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function HP(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function HE(e,t){if(!t.anchorNode)return!1;try{return HP(e,t.anchorNode)}catch(e){return!1}}function HL(e){return 3==e.nodeType?Hq(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function HN(e,t,n,i){return!!n&&(HF(e,t,n,i,-1)||HF(e,t,n,i,1))}function HB(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function Hz(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function HF(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:HV(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=HB(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?HV(e):0}}}function HV(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Hj(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function HH(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 HW(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}}HO.prototype.startSide=HO.prototype.endSide=-1;class H${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?HV(t):0),n,Math.min(e.focusOffset,n?HV(n):0))}set(e,t,n,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=i}}let HG=null;function HU(e){if(e.setActive)return e.setActive();if(HG)return e.focus(HG);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==HG?{get preventScroll(){return HG={preventScroll:!0},!0}}:void 0),!HG){HG=!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 Hq(e,t,n=t){let i=r||(r=document.createRange());return i.setEnd(e,n),i.setStart(e,t),i}function HY(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 HZ(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 HX(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=HV(n=n.childNodes[i-1])}else{if(!n.parentNode||Hz(n))return null;i=HB(n),n=n.parentNode}}function HK(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||Hz(n))return null;i=HB(n)+1,n=n.parentNode}}Hy.safari&&Hy.safari_version>=26&&(HG=!1);class HQ{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new HQ(e.parentNode,HB(e),t)}static after(e,t){return new HQ(e.parentNode,HB(e)+1,t)}}var HJ=((R=HJ||(HJ={}))[R.LTR=0]="LTR",R[R.RTL=1]="RTL",R);let H0=HJ.LTR,H1=HJ.RTL;function H2(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}let H5=H2("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),H3=H2("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),H4=Object.create(null),H6=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);H4[t]=n,H4[n]=-t}function H8(e){return e<=247?H5[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?H3[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}let H9=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class H7{get dir(){return this.level%2?H1:H0}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 We=[];function Wt(e){return[new H7(0,e,0)]}let Wn="",Wi=jr.define(),Wr=jr.define(),Wo=jr.define(),Wa=jr.define(),Ws=jr.define(),Wl=jr.define(),Wu=jr.define(),Wc=jr.define(),Wh=jr.define(),Wd=jr.define({combine:e=>e.some(e=>e)}),Wp=jr.define({combine:e=>e.some(e=>e)}),Wf=jr.define();class Wg{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 Wg(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 Wg(jt.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}let Wm=jI.define({map:(e,t)=>e.map(t)}),Wv=jI.define();function Wy(e,t,n){let i=e.facet(Wa);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 Wx=jr.define({combine:e=>!e.length||e[0]}),Wb=0,Ww=jr.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 WS{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(Ww.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Ww.of({plugin:this,arg:e}))}static define(e,t){let{eventHandlers:n,eventObservers:i,provide:r,decorations:o}=t||{};return new WS(Wb++,e,n,i,e=>{let t=[];return o&&t.push(WA.of(t=>{let n=t.plugin(e);return n?o(n):HM.none})),r&&t.push(r(e)),t})}static fromClass(e,t){return WS.define((t,n)=>new e(t,n),t)}}class W_{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(Wy(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){Wy(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){Wy(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}let WC=jr.define(),WM=jr.define(),WA=jr.define(),Wk=jr.define(),WT=jr.define(),WI=jr.define(),WD=jr.define();function WO(e,t){let n=e.state.facet(WD);if(!n.length)return n;let i=n.map(t=>t instanceof Function?t(e):t),r=[];return j$.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=H8(e.charCodeAt(i));if(1==t)break;if(2==t||4==t)return H1}return H0}(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 WR=jr.define();function WP(e){let t=0,n=0,i=0,r=0;for(let o of e.state.facet(WR)){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 WE=jr.define();class WL{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}join(e){return new WL(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 WL(s,u,a,l))}return n}}class WN{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=V5.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 WL(e,t,n,r))),this.changedRanges=i}static create(e,t,n){return new WN(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 WB=[];class Wz{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 WB}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=HB(this.dom),i=this.length?e>0:t>0;return new HQ(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 Wj)return e;return null}static get(e){return e.cmTile}}class WF extends Wz{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=WV(i);else t.insertBefore(a.dom,i);n=a.dom}for(i=n?n.nextSibling:t.firstChild,r&&i&&(r.written=!0);i;)i=WV(i);this.length=o}}function WV(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Wj extends WF{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=Wz.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 WH)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 WH extends WF{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 WH(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class WW extends WF{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let i=new WW(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=HL(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 HQ(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 HQ(e.dom,0);e==n.tile&&(o=!0)}}return new HQ(this.dom,0)}}class W$ extends WF{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new W$(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class WG extends Wz{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?!(Hy.chrome||Hy.gecko)&&(e?(i--,o=1):r<n&&(r++,o=-1)):t<0?i--:r<n&&r++;let a=Hq(this.dom,i,r).getClientRects();if(!a.length)return null;let s=a[(o?o<0:t>=0)?0:a.length-1];return Hy.safari&&!o&&0==s.width&&(s=Array.prototype.find.call(a,e=>e.width)||s),o?Hj(s,o<0):s||null}static of(e,t){let n=new WG(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class WU extends Wz{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 Hj(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 Hj(n,!i)}}get overrideDOMText(){if(!this.length)return Vj.empty;let{root:e}=this;if(!e)return Vj.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 WU(r,n,e,i)}}class Wq extends Wz{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 Vj.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class WY{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 WZ{constructor(e,t,n,i){this.from=e,this.to=t,this.wrapper=n,this.rank=i}}class WX{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 WG(a.dom,a.text+e)).parent=o):o.append(i||WG.of(e,null==(r=this.cache.find(WG))?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)?W5(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 W$&&r.mark.eq(n.mark))r.dom!=n.dom&&r.setDOM(W5(n.dom)),i=r;else{if(this.cache.reused.get(n)){let e=Wz.get(n.dom);e&&e.setDOM(W5(n.dom))}let e=W$.of(n.mark,n.dom);i.append(e),i=e}this.cache.reused.set(n,2)}let r=Wz.get(e.text);r&&this.cache.reused.set(r,2);let o=new WG(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=W2);let i=WW.start(e,t||(null==(n=this.cache.find(WW))?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 W$&&a.mark.eq(o))i=a,t--;else{let e=W$.of(o,null==(n=this.cache.find(W$,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||!W1(this.curLine,!1)||"BR"!=e.dom.nodeName&&e.isWidget()&&!(Hy.ios&&W1(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(W4,0,32)||new WU(W4.toDOM(),0,W4,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 WZ(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 WH&&i.wrapper.eq(n.wrapper))t=i;else{let i=WH.of(n.wrapper,null==(e=this.cache.find(WH,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(Wq,void 0,1);return n&&(n.flags=t),n||new Wq(t)}flushBuffer(){this.afterWidget&&!(32&this.afterWidget.flags)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class WK{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 WQ=[WU,WW,WG,W$,Wq,WH,Wj];for(let e=0;e<WQ.length;e++)WQ[e].bucket=e;class WJ{constructor(e){this.view=e,this.buckets=WQ.map(()=>[]),this.index=WQ.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 WU(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 W0{constructor(e,t,n,i,r){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=r,this.openWidget=!1,this.openMarks=0,this.cache=new WJ(e),this.text=new WK(e.state.doc),this.builder=new WX(this.cache,new Wj(e,e.contentDOM),j$.iter(n)),this.cache.reused.set(t,2),this.old=new WY(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 W$&&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?WU.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 Wq)this.cache.add(e);else{if(!(e instanceof W$))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 W$&&i.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?i.length&&(i.length=r=0):e instanceof W$&&(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=j$.spans(this.decorations,e,t,{point:(e,t,o,a,s,l)=>{var u,c,h;if(o instanceof HT){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?W3.block:W3.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)||WU.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&&Hx(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=Wz.get(i);if(i==this.view.contentDOM)break;e instanceof W$?t.push(e):(null==e?void 0:e.isLine())?n=e:e instanceof WH||("DIV"!=i.nodeName||n||i==this.view.contentDOM?n||t.push(W$.of(new HA({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 WW(i,W2))}return{line:n,marks:t}}}function W1(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 W2={class:"cm-line"};function W5(e){let t=Wz.get(e);return t&&t.setDOM(e.cloneNode()),e}class W3 extends H_{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}}W3.inline=new W3("span"),W3.block=new W3("div");let W4=new class extends H_{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class W6{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=HM.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 Wj(e,e.contentDOM),this.updateInner([new WL(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=W9(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 WL(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 WL(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,(Hy.ie||Hy.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 W7,j$.compare(r,o,a,h),h.changes);y.length&&(p=WL.extendWithRanges(p,y));let x=(s=v,l=this.blockWrappers,u=e.changes,d=new $e,j$.compare(s,l,u,d),d.changes);return x.length&&(p=WL.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 W0(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&Wz.get(t.text)&&i.cache.reused.set(Wz.get(t.text),2),this.tile=i.run(e,t),W8(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=Hy.chrome||Hy.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 $t&&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(Wv)&&(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(Wx)||i.tabIndex>-1)&&HE(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)),Hy.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 HQ(e,0),s=!0}let h=this.view.observer.selectionRange;!s&&h.focusNode&&(HN(u.node,u.offset,h.anchorNode,h.anchorOffset)&&HN(c.node,c.offset,h.focusNode,h.focusOffset)||this.suppressWidgetCursorChange(h,l))||(this.view.observer.ignore(()=>{Hy.android&&Hy.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=HR(this.view.root);if(e)if(l.empty){if(Hy.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?HX:HK)(u.node,u.offset);t&&(u=new HQ(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 HQ(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new HQ(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&HN(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=HR(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==HV(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&&!Wz.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 $t?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=VX(t.text,n);if(e==n)return null;let i=Hq(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==HJ.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 WH)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?HL(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?HJ.RTL:HJ.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=HL(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=HL(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(HM.replace({widget:new $t(i),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!r)break;n=r.to+1}return HM.set(e)}updateDeco(){let e=1,t=this.view.state.facet(WA).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,i=this.view.state.facet(WT).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(j$.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(Wk).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(Wf))try{if(t(this.view,e.range,e))return!0}catch(e){Wy(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=WP(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}=HH(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==HJ.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(){W8(this.tile)}}function W8(e,t){let n=null==t?void 0:t.get(e);if(1!=n)for(let i of(null==n&&e.destroy(),e.children))W8(i,t)}function W9(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=HX(n.focusNode,n.focusOffset),r=HK(n.focusNode,n.focusOffset),o=i||r;if(r&&i&&r.node!=i.node){let t=Wz.get(r.node);if(!t||t.isText()&&t.text!=r.node.nodeValue)o=r;else if(e.docView.lastCompositionAfterCursor){let e=Wz.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 W7=class{constructor(){this.changes=[]}compareRange(e,t){HD(e,t,this.changes)}comparePoint(e,t){HD(e,t,this.changes)}boundChange(e){HD(e,e,this.changes)}};class $e{constructor(){this.changes=[]}compareRange(e,t){HD(e,t,this.changes)}comparePoint(){}boundChange(e){HD(e,e,this.changes)}}class $t extends H_{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 $n(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==HC.Text&&(e.type!=r.type||(n<0?r.from<t:r.to>t)))&&(e=r)}}return e||i}return i}function $i(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=H7.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=VX(e.text,a,l.forward(r,n));(c<l.from||c>l.to)&&(c=u),Wn=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?jt.cursor(h.side(!r,n)+e.from,h.forward(r,n)?1:-1,h.level):jt.cursor(c+e.from,l.forward(r,n)?-1:1,l.level)}(r,o,a,s,n),u=Wn;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 $r(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 $o(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=$r(e,r.from,0);t!=r.from&&(o=jt.cursor(t,-1))}else{let t=$r(e,r.from,-1),n=$r(e,r.to,1);(t!=r.from||n!=r.to)&&(o=r.undirectional?jt.undirectionalRange(r.from,r.to):jt.range(r.from==r.anchor?t:n,r.from==r.head?t:n))}o&&(n||(n=t.ranges.slice()),n[i]=o)}return n?jt.create(n,t.mainIndex):t}function $a(e,t,n){let i=$r(e.state.facet(WI).map(t=>t(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:jt.cursor(i,i<n.from?1:-1)}class $s{constructor(e,t){this.pos=e,this.assoc=t}}function $l(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 $s(0,1);if(l>e.viewState.docHeight)return new $s(e.state.doc.length,-1);if(u=e.elementAtHeight(l),null==i)break;if(u.type==HC.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==HC.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+j5(a,o,e.state.tabSize)}(e,r,u,a,s);return new $s(t,t==u.from?1:-1)}}if(u.type!=HC.Text)return l<(u.top+u.bottom)/2?new $s(u.from,1):new $s(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 $u(e,a,s,e.textDirectionAt(u.from)).scanTile(c,u.from)}class $u{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[H7.find(i,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:i}=this.bidiSpansAt(e);return i[H7.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==HJ.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)==HJ.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=VX(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 Hq(e.dom,r,o).getClientRects()});return i.after?new $s(n[i.i+1],-1):new $s(n[i.i],1)}scanTile(e,t){if(!e.length)return new $s(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:Hq(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 $s(n[i.i+1],-1):new $s(o,1)}}class $c{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(jB.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=Wz.get(i),o=i.nextSibling;if(o==t){(null==r?void 0:r.breakAfter)&&!o&&n!=this.view.contentDOM&&this.lineBreak();break}let a=Wz.get(o);(r&&a?r.breakAfter:(r?r.breakAfter:Hz(i))||Hz(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=Wz.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=Wz.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<HV(t))return!1;if(t==e)return!0;n=HB(t)+1,t=t.parentNode}}(e,n.node,n.offset)?0:t))}}class $h{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class $d{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 $h(n,i)),(r!=n||o!=i)&&t.push(new $h(r,o))),t}(e),n=new $c(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?jt.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||!HP(e.contentDOM,t.focusNode)?a.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),i=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!HP(e.contentDOM,t.anchorNode)?a.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((Hy.ios||Hy.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(jt.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=jt.create([jt.cursor(n,i)])}else this.newSel=jt.single(i,n)}}}function $p(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||Hy.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:Vj.of(t.text.slice(o.from-e,c).split("￿"))}:(h=$g(u,t.text,s-e,l))&&(Hy.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:Vj.of(t.text.slice(h.from,h.toB).split("￿"))})}else i&&(!e.hasFocus&&r.facet(Wx)||$m(i,o))&&(i=null);if(!n&&!i)return!1;if((Hy.mac||Hy.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=jt.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:Vj.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)}:Hy.chrome&&n&&n.from==n.to&&n.from==o.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(i&&(i=jt.single(i.main.anchor-1,i.main.head-1)),n={from:o.from,to:o.to,insert:Vj.of([" "])}),n)return $f(e,n,i,a);if(!i||$m(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=$o(r.facet(WI).map(t=>t(e)),i))),e.dispatch({selection:i,scrollIntoView:t,userEvent:n}),!0}}function $f(e,t,n,i=-1){let r;if(Hy.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(Hy.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&&HY(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)&&HY(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&HY(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=$r(r.facet(WI).map(t=>t(e)),i,n);t.from==s&&(a=s)}if(a>-1)i={changes:t,selection:jt.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&&W9(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?jt.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(Wl).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function $g(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 $m(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class $v{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,Hy.safari&&e.contentDOM.addEventListener("input",()=>null),Hy.gecko&&function(e){$V.has(e)||($V.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=Wz.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($y(t.value,r))}if(r)for(let e in r){let i=r[e];i&&n(e).observers.push($y(t.value,i))}}for(let e in $C)n(e).handlers.push($C[e]);for(let e in $M)n(e).observers.push($M[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>$w.indexOf(e.keyCode)&&(this.tabFocusMode=-1),Hy.android&&Hy.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(Hy.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&($x.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||$b.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&&Hy.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,HY(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&!e.synthetic&&(this.composing>0||!!(Hy.safari&&!Hy.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 $y(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(e){Wy(n.state,e)}}}let $x=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],$b="dthko",$w=[16,17,18,20,91,92,224,225];function $S(e){return .7*Math.max(0,e)+8}class $_{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=HW(e.contentDOM),this.atoms=e.state.facet(WI).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(jB.allowMultipleSelections)&&function(e,t){let n=e.state.facet(Wi);return n.length?n[0](t):Hy.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=HR(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==$E(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=WP(this.view);e.clientX-l.left<=r+6?n=-$S(r-e.clientX):e.clientX+l.right>=a-6&&(n=$S(e.clientX-a)),e.clientY-l.top<=o+6?i=-$S(o-e.clientY):e.clientY+l.bottom>=s-6&&(i=$S(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=$o(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 $C=Object.create(null),$M=Object.create(null),$A=Hy.ie&&Hy.ie_version<15||Hy.ios&&Hy.webkit_version<604;function $k(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function $T(e,t){t=$k(e.state,Wc,t);let{state:n}=e,i,r=1,o=n.toText(t),a=o.lines==n.selection.ranges.length;if(null!=$N&&n.selection.ranges.every(e=>e.empty)&&$N==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:jt.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:jt.cursor(e.from+t.length)}}):n.replaceSelection(o);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function $I(e,t,n,i){if(1==i)return jt.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 jt.cursor(t);0==o?n=1:o==r.length&&(n=-1);let a=o,s=o;n<0?a=VX(r.text,o,!1):s=VX(r.text,o);let l=i(r.text.slice(a,s));for(;a>0;){let e=VX(r.text,a,!1);if(i(r.text.slice(e,a))!=l)break;a=e}for(;s<r.length;){let e=VX(r.text,s);if(i(r.text.slice(s,e))!=l)break;s=e}return jt.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++,jt.undirectionalRange(a,s)}}$M.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},$M.wheel=$M.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},$C.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),$M.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")},$M.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},$C.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(Wo))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=$E(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=$I(n,s.pos,s.assoc,o);if(r.pos!=s.pos&&!t){let e=$I(n,r.pos,r.assoc,o),t=Math.min(e.from,u.from),i=Math.max(e.to,u.to);u=t<u.from?jt.range(t,i,u.assoc):jt.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 jt.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):jt.create([u])}}),s){let n=!e.hasFocus;e.inputState.startMouseSelection(new $_(e,t,s,n)),n&&e.observer.ignore(()=>{HU(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 $D=Hy.ie&&Hy.ie_version<=11,$O=null,$R=0,$P=0;function $E(e){if(!$D)return e.detail;let t=$O,n=$P;return $O=e,$P=Date.now(),$R=!t||n>Date.now()-400&&2>Math.abs(t.clientX-e.clientX)&&2>Math.abs(t.clientY-e.clientY)?($R+1)%3:1}function $L(e,t,n,i){let r;if(!(n=$k(e.state,Wc,n)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,s=i&&a&&((r=e.state.facet(Wr)).length?r[0](t):Hy.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}$C.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=jt.undirectionalRange(e,t))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",$k(e.state,Wh,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},$C.dragend=e=>(e.inputState.draggedContent=null,!1),$C.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&&$L(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 $L(e,t,n,!0),!0}return!1},$C.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=$A?null:t.clipboardData;return n?($T(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(),$T(e,n.value)},50)}(e),!1)};let $N=null;$C.copy=$C.cut=(e,t)=>{if(!HE(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:$k(e,Wh,t.join(e.lineBreak)),ranges:n,linewise:i}}(e.state);if(!n&&!r)return!1;$N=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=$A?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 $B=jA.define();function $z(e,t){let n=[];for(let i of e.facet(Wu)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:$B.of(!0)}):null}function $F(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=$z(e.state,t);n?e.dispatch(n):e.update([])}},10)}$M.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),$F(e)},$M.blur=e=>{e.observer.clearSelectionRange(),$F(e)},$M.compositionstart=$M.compositionupdate=e=>{!e.observer.editContext&&(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},$M.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,Hy.chrome&&Hy.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},$M.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},$C.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 $f(e,{from:n,to:o,insert:e.state.toText(i)},null),!0}}if(Hy.chrome&&Hy.android&&(r=$x.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 Hy.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),Hy.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>$M.compositionend(e,t),20),!1};let $V=new Set,$j=["pre-wrap","normal","pre-line","break-spaces"],$H=!1;class $W{constructor(e){this.lineWrapping=e,this.doc=Vj.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 $j.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=$j.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 $${constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class $G{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?HC.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 HT?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 $G(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var $U=((P=$U||($U={}))[P.ByPos=0]="ByPos",P[P.ByHeight=1]="ByHeight",P[P.ByPosNoHeight=2]="ByPosNoHeight",P);class $q{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&&($H=!0),this.height=e)}replace(e,t,n){return $q.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,$U.ByPosNoHeight,n.setDoc(t),0,0),d=h.to>=l?h:r.lineAt(l,$U.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,$U.ByPosNoHeight,n,0,0));u+=h.from-s,s=h.from;let p=$1.build(n.setDoc(o),e,u,c);r=$Y(r,r.replace(s,l,p))}return r.updateHeight(n,0)}static empty(){return new $K(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 $J($q.of(e.slice(0,t)),o,$q.of(e.slice(n)))}}function $Y(e,t){return e==t?e:(e.constructor!=t.constructor&&($H=!0),t)}$q.prototype.size=1;let $Z=HM.replace({});class $X extends $q{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new $G(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 $G(i,0,n,this.spaceAbove,$Z):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,$U.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 $K extends $X{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 $G(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 $K||i instanceof $Q&&4&i.flags)&&10>Math.abs(this.length-i.length)?(i instanceof $Q?i=new $K(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):$q.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 $Q extends $q{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 $G(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 $G(s,l,n+a*i,a,0)}}lineAt(e,t,n,i,r){if(t==$U.ByHeight)return this.blockAt(e,n,i,r);if(t==$U.ByPosNoHeight){let{from:t,to:i}=n.doc.lineAt(e);return new $G(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 $G(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 $G(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 $Q?n[n.length-1]=new $Q(e.length+i):n.push(null,new $Q(i-1))}if(e>0){let t=n[0];t instanceof $Q?n[0]=new $Q(e+t.length):n.unshift(new $Q(e-1),null)}return $q.of(n)}decomposeLeft(e,t){t.push(new $Q(e-1),null)}decomposeRight(e,t){t.push(null,new $Q(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 $Q(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 $K(t,r,s);l.outdated=!1,n.push(l),o+=t+1}o<=r&&n.push(null,new $Q(r-o).updateHeight(e,o));let s=$q.of(n);return(a<0||Math.abs(s.height-this.height)>=.001||Math.abs(a-this.heightMetrics(e,t).perLine)>=.001)&&($H=!0),$Y(this,s)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class $J extends $q{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==$U.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==$U.ByPosNoHeight?$U.ByPosNoHeight:$U.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,$U.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&&$0(r,o-1),t<this.length){let e=r.length;this.decomposeRight(t,r),$0(r,e)}return $q.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?$q.of(this.break?[e,null,t]:[e,t]):(this.left=$Y(this.left,e),this.right=$Y(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 $0(e,t){let n,i;null==e[t]&&(n=e[t-1])instanceof $Q&&(i=e[t+1])instanceof $Q&&e.splice(t-1,3,new $Q(n.length+1+i.length))}class $1{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 $K?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new $K(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 $X(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 $K(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new $Q(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 $K)return e;let t=new $K(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 $K||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new $K(0,-1,0));let n=e;for(let e of this.nodes)e instanceof $K&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,i){let r=new $1(n,e);return j$.spans(t,n,i,r,0),r.finish(n)}}class $2{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,i){(e<t||n&&n.heightRelevant||i&&i.heightRelevant)&&HD(e,t,this.changes,5)}}class $5{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 HM.replace({widget:new $3(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class $3 extends H_{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 $4{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=$7,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=HJ.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(WM).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new $W(n),this.stateDeco=Ge(t),this.heightMap=$q.empty().applyChanges(this.stateDeco,Vj.empty,this.heightOracle.setDoc(t.doc),[new WL(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=HM.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 $6(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?$7:new Gt(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(Gn(e,this.scaler))})}update(e,t=null){var n,i;let r;this.state=e.state;let o=this.stateDeco;this.stateDeco=Ge(this.state);let a=e.changedRanges,s=WL.extendWithRanges(a,(n=this.stateDeco,i=e?e.changes:V5.empty(this.state.doc.length),r=new $2,j$.compare(o,n,i,r,0),r.changes)),l=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);$H=!1,this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=l||$H)&&(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(Wp)&&(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?HJ.RTL:HJ.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}=HH(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=HW(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=HZ(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)),$H=!1,this.viewports)){let n=t.from==this.viewport.from?e:i.docView.measureVisibleLineHeights(t);this.heightMap=(l?$q.empty().applyChanges(this.stateDeco,Vj.empty,this.heightOracle,[new WL(0,0,0,i.state.doc.length)]):this.heightMap).updateHeight(a,0,l,new $$(t.from,n))}$H&&(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 $6(i.lineAt(o-1e3*n,$U.ByHeight,r,0,0).from,i.lineAt(a+(1-n)*1e3,$U.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,$U.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 $6(i.lineAt(a-500,$U.ByHeight,r,0,0).from,i.lineAt(a+n+500,$U.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 $6(this.heightMap.lineAt(n,$U.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,$U.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,$U.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,$U.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 $5(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!=HJ.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(jt.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 $5(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!=HC.Text)return;let f=(r=t.from,a=t.to,l=this.stateDeco,h=[],d=r,p=0,j$.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=$9(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=$8(f,e),c=$8(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=$9(f,g),t=((h-l)/2+a)/o;n=e-t,r=e+t}else n=(l-a)/o,r=(h+a)/o;u=$8(f,n),c=$8(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=$9(i,n)-$9(i,t);return this.heightOracle.lineWrapping?e.height*r:i.total*this.heightOracle.charWidth*r}updateLineGaps(e){$5.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=HM.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=[];j$.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)||Gn(this.heightMap.lineAt(e,$U.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)||Gn(this.heightMap.lineAt(this.scaler.fromDOM(e),$U.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 Gn(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 $6{constructor(e,t){this.from=e,this.to=t}}function $8({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 $9(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 $7={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};function Ge(e){let t=e.facet(WA).filter(e=>"function"!=typeof e),n=e.facet(WT).filter(e=>"function"!=typeof e);return n.length&&t.push(j$.join(n)),t}class Gt{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,$U.ByPos,e,0,0).top,a=t.lineAt(r,$U.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 Gt&&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 Gn(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new $G(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(e=>Gn(e,t)):e._content)}let Gi=jr.define({combine:e=>e.join(" ")}),Gr=jr.define({combine:e=>e.indexOf(!0)>-1}),Go=j8.newName(),Ga=j8.newName(),Gs=j8.newName(),Gl={"&light":"."+Ga,"&dark":"."+Gs};function Gu(e,t,n){return new j8(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 Gc=Gu("."+Go,{"&":{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"}},Gl),Gh={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Gd=Hy.ie&&Hy.ie_version<=11;class Gp{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new H$,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);(Hy.ie&&Hy.ie_version<=11||Hy.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&&Hy.android&&!1!==e.constructor.EDIT_CONTEXT&&!(Hy.chrome&&Hy.chrome_version<126)&&(this.editContext=new Gm(e),e.state.facet(Wx)&&(e.contentDOM.editContext=this.editContext.editContext)),Gd&&(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(Wx)?n.root.activeElement!=this.dom:!HE(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}(Hy.ie&&Hy.ie_version<=11||Hy.android&&Hy.chrome)&&!n.state.selection.main.empty&&i.focusNode&&HN(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=HR(e.root);if(!t)return!1;let n=Hy.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 Gg(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?Gg(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let i=HE(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,HV(n));;)if(i){if(1!=n.nodeType)return!1;let e=n.childNodes[i-1];"false"==e.contentEditable?i--:i=HV(n=e)}else{if(n==e)return!0;i=HB(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,Gh),Gd&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Gd&&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&&HY(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&&HE(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 $d(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=$p(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!$m(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=Gf(t,e.previousSibling||e.target.previousSibling,-1),i=Gf(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(Wx)!=e.state.facet(Wx)&&(e.view.contentDOM.editContext=e.state.facet(Wx)?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 Gf(e,t,n){for(;t;){let i=Wz.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 Gg(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 HN(a.node,a.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}class Gm{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=$g(e.state.sliceDoc(a,s),n.text,(l?i.from:i.to)-a,l?"end":null);if(!u){let t=jt.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));$m(t,i)||e.dispatch({selection:t,userEvent:"select"});return}let c={from:u.from+a,to:u.toA+a,insert:Vj.of(n.text.slice(u.from,u.toB).split("\n"))};if((Hy.mac||Hy.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(c={from:a,to:s,insert:Vj.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let t=this.to-this.from+(c.to-c.from+c.insert.length);$f(e,c,jt.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(HM.mark({attributes:{style:e}}).range(r,o))}}}e.dispatch({effects:Wv.of(HM.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=HR(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 Gv{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 $4(this,e.state||jB.create(e)),e.scrollTo&&e.scrollTo.is(Wm)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ww).map(e=>new W_(e)),this.plugins))t.update(this);this.observer=new Gp(this),this.inputState=new $v(this),this.inputState.ensureHandlers(this.plugins),this.docView=new W6(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 jD?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($B))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,(s=$z(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(jB.phrases)!=this.state.facet(jB.phrases))return this.setState(r);i=WN.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(Gv.cursorScrollMargin);c=new Wg(e.empty?e:jt.cursor(e.head,e.head>e.anchor?-1:1),"nearest","nearest",i,n)}for(let e of t.effects)e.is(Wm)&&(c=e.value.clip(this.state))}this.viewState.update(i,c),this.bidiCache=Gb.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(WE)!=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(Gi)!=i.state.facet(Gi)&&(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(Ws))try{e(i)}catch(e){Wy(this.state,e,"update listener")}(s||u)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),u&&!$p(this,u)&&l.force&&HY(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 $4(this,e),this.plugins=e.facet(Ww).map(e=>new W_(e)),this.pluginMap.clear(),this.plugins))t.update(this);this.docView.destroy(),this.docView=new W6(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(Ww),n=e.state.facet(Ww);if(t!=n){let i=[];for(let r of n){let n=t.indexOf(r);if(n<0)i.push(new W_(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){Wy(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(HZ(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 Wy(this.state,e),Gx}}),u=WN.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]!=Gx)try{let t=s[e];t.write&&t.write(l[e],this)}catch(e){Wy(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(Ws))e(t)}get themeClasses(){return Go+" "+(this.state.facet(Gr)?Gs:Ga)+" "+this.state.facet(Gi)}updateAttrs(){let e=Gw(this,WC,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Wx)?"true":"false",class:"cm-content",style:`${Hy.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Gw(this,WM,t);let n=this.observer.ignore(()=>{let n=HS(this.contentDOM,this.contentAttrs,t),i=HS(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(Gv.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(WE);let e=this.state.facet(Gv.cspNonce);j8.mount(this.root,this.styleModules.concat(Gc).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 $a(this,e,$i(this,e,t,n))}moveByGroup(e,t){return $a(this,e,$i(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==jL.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 jt.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=$n(e,t.head,t.assoc||-1),o=i&&r.type==HC.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==HJ.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(null!=a)return jt.cursor(a,n?-1:1)}return jt.cursor(n?r.to:r.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return $a(this,e,function(e,t,n,i){let r=t.head,o=n?1:-1;if(r==(n?e.state.doc.length:0))return jt.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=$l(e,{x:h,y:i},!1,o);if(n?i>l.bottom:i<l.top)return jt.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 jt.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=$l(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),$l(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 Hj(n,r[H7.find(r,e-i.from,-1,t)].dir==HJ.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(Wd)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Gy)return Wt(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=WO(this,e))))return i.order;n||(n=WO(this,e));let i=function(e,t,n){if(!e)return[new H7(0,0,+(t==H1))];if(t==H0&&!n.length&&!H9.test(e))return Wt(e.length);if(n.length)for(;e.length>We.length;)We[We.length]=256;let i=[],r=+(t!=H0);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=H8(e.charCodeAt(t));512==r?r=n:8==r&&4==i&&(r=16),We[t]=4==r?2:r,7&r&&(i=r),n=r}for(let e=a,t=l,i=l;e<s;e++){let r=We[e];if(128==r)e<s-1&&t==We[e+1]&&24&t?r=We[e]=t:We[e]=256;else if(64==r){let r=e+1;for(;r<s&&64==We[r];)r++;let o=e&&8==t||r<n&&8==We[r]?1==i?1:8:256;for(let t=e;t<r;t++)We[t]=o;e=r-1}else 8==r&&1==i&&(We[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=H4[n=e.charCodeAt(t)])if(i<0){for(let e=s-3;e>=0;e-=3)if(H6[e+1]==-i){let n=H6[e+2],i=2&n?r:4&n?1&n?o:r:0;i&&(We[t]=We[H6[e]]=i),s=e;break}}else if(189==H6.length)break;else H6[s++]=t,H6[s++]=n,H6[s++]=l;else if(2==(a=We[t])||1==a){let e=a==r;l=+!e;for(let t=s-3;t>=0;t-=3){let n=H6[t+2];if(2&n)break;if(e)H6[t+2]|=2;else{if(4&n)break;H6[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=We[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==We[a])a++;else break;let u=1==o,c=u==((a<t?We[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),We[--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=We[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(We[e]==u)break a;else break}h++,p?p.push(t):(t.from>c&&l.push(new H7(c,t.from,f)),e(n,t.direction==H0!=!(f%2)?o+1:o,a,t.inner,t.from,t.to,l),c=t.to),g=t.to}else if(g==r||(i?We[g]!=u:We[g]==u))break;else g++;p?t(n,c,g,o+1,a,p,l):c<g&&l.push(new H7(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=We[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(We[e-1]==u)break a;else break}p?p.push(t):(t.to<c&&l.push(new H7(t.to,c,f)),e(n,t.direction==H0!=!(f%2)?o+1:o,a,t.inner,t.from,t.to,l),c=t.from),g=t.from}else if(g==i||(r?We[g-1]!=u:We[g-1]==u))break;else g--;p?t(n,g,c,o+1,a,p,l):g<c&&l.push(new H7(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 Gb(e.from,e.to,t,n,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Hy.safari&&(null==(e=this.inputState)?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{HU(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 Wm.of(new Wg("number"==typeof e?jt.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 Wm.of(new Wg(jt.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 WS.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return WS.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=j8.newName(),i=[Gi.of(n),WE.of(Gu(`.${n}`,e))];return t&&t.dark&&i.push(Gr.of(!0)),i}static baseTheme(e){return jd.lowest(WE.of(Gu("."+Go,e,Gl)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),i=n&&Wz.get(n)||Wz.get(e);return(null==(t=null==i?void 0:i.root)?void 0:t.view)||null}}Gv.styleModule=WE,Gv.inputHandler=Wl,Gv.clipboardInputFilter=Wc,Gv.clipboardOutputFilter=Wh,Gv.scrollHandler=Wf,Gv.focusChangeEffect=Wu,Gv.perLineTextDirection=Wd,Gv.exceptionSink=Wa,Gv.updateListener=Ws,Gv.editable=Wx,Gv.mouseSelectionStyle=Wo,Gv.dragMovesSelection=Wr,Gv.clickAddsSelectionRange=Wi,Gv.decorations=WA,Gv.blockWrappers=Wk,Gv.outerDecorations=WT,Gv.atomicRanges=WI,Gv.bidiIsolatedRanges=WD,Gv.cursorScrollMargin=jr.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}}}),Gv.scrollMargins=WR,Gv.darkTheme=Gr,Gv.cspNonce=jr.define({combine:e=>e.length?e[0]:""}),Gv.contentAttributes=WM,Gv.editorAttributes=WC,Gv.lineWrapping=Gv.contentAttributes.of({class:"cm-lineWrapping"}),Gv.announce=jI.define();let Gy=4096,Gx={};class Gb{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:HJ.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 Gb(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function Gw(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&&Hx(o,n)}return n}let GS=Hy.mac?"mac":Hy.windows?"win":Hy.linux?"linux":"key";function G_(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 GC=jd.default(Gv.domEventHandlers({keydown:(e,t)=>GD(Gk(t.state),e,t,"editor")})),GM=jr.define({enables:GC}),GA=new WeakMap;function Gk(e){let t=e.facet(GM),n=GA.get(t);return n||GA.set(t,n=function(e,t=GS){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=GT={view:t,prefix:n,scope:e};return setTimeout(()=>{GT==i&&(GT=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,GI))}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 GT=null,GI=null;function GD(e,t,n,i){var r;GI=t;let o=("Esc"==(r=!(Hn&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Hi&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?Ht:He)[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=VJ(VK(o,0))==o.length&&" "!=o,s="",l=!1,u=!1,c=!1;GT&&GT.view==n&&GT.scope==i&&(s=GT.prefix+" ",0>$w.indexOf(t.keyCode)&&(u=!0,GT=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+G_(o,t,!a)])?l=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Hy.windows&&t.ctrlKey&&t.altKey)&&!(Hy.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(f=He[t.keyCode])&&f!=o?d(p[s+G_(f,t,!0)])?l=!0:t.shiftKey&&(g=Ht[t.keyCode])!=o&&g!=f&&d(p[s+G_(g,t,!1)])&&(l=!0):a&&t.shiftKey&&d(p[s+G_(o,t,!0)])&&(l=!0),!l&&d(p._any)&&(l=!0)),u&&(l=!0),l&&c&&t.stopPropagation(),GI=null,l}class GO{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==HJ.LTR,a=e.contentDOM,s=a.getBoundingClientRect(),l=GR(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=$n(e,i,1),f=$n(e,r,-1),g=p.type==HC.Text?p:null,m=f.type==HC.Text?f:null;if(g&&(e.lineWrapping||p.widgetLineBreaks)&&(g=GP(e,i,1,g)),m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=GP(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==HC.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 GO(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==HJ.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=GR(e);return[new GO(t,i.left-r.left,i.top-r.top,null,i.bottom-i.top)]}}}function GR(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==HJ.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function GP(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 GE{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(GL)!=e.state.facet(GL)&&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(GL);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,Hy.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}let GL=jr.define();function GN(e){return[WS.define(t=>new GE(t,e)),GL.of(e)]}let GB=jr.define({combine:e=>jz(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function Gz(e){return e.startState.facet(GB)!=e.state.facet(GB)}let GF=GN({above:!0,markers(e){let{state:t}=e,n=t.facet(GB),i=[];for(let r of t.selection.ranges){let o=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(o&&Hy.ios&&n.iosSelectionHandles)){let t=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=r.empty?r:jt.cursor(r.head,r.assoc);for(let r of GO.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=Gz(e);return n&&GV(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){GV(t.state,e)},class:"cm-cursorLayer"});function GV(e,t){t.style.animationDuration=e.facet(GB).cursorBlinkRate+"ms"}let Gj=GN({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 GO.forRange(e,"cm-selectionBackground",n))t.push(i);if(Hy.ios&&!n.empty&&e.state.facet(GB).iosSelectionHandles){for(let i of GO.forRange(e,"cm-selectionHandle cm-selectionHandle-start",jt.cursor(n.from,1)))t.push(i);for(let i of GO.forRange(e,"cm-selectionHandle cm-selectionHandle-end",jt.cursor(n.to,1)))t.push(i)}return t},update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||Gz(e),class:"cm-selectionLayer"}),GH=jd.highest(Gv.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"}}}})),GW=jI.define({map:(e,t)=>null==e?null:t.mapPos(e)}),G$=jc.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(GW)?t.value:e,e))}),GG=WS.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(G$);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(G$)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(G$),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(G$)!=e&&this.view.dispatch({effects:GW.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 GU(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 Gq{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 jG,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))GU(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 GU(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 GY=null!=/x/.unicode?"gu":"g",GZ=RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]",GY),GX={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"},GK=null,GQ=jr.define({combine(e){let t=jz(e,{render:null,specialChars:GZ,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==GK&&"u">typeof document&&document.body){let t=document.body.style;GK=(null!=(e=t.tabSize)?e:t.MozTabSize)!=null}return GK||!1}())&&(t.specialChars=RegExp(" |"+t.specialChars.source,GY)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,GY)),t}}),GJ=null;class G0 extends H_{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")+" "+(GX[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 G1 extends H_{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 G2=HM.line({class:"cm-activeLine"}),G5=WS.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(G2.range(r.from)),t=r.from)}return HM.set(n)}},{decorations:e=>e.decorations});class G3 extends H_{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?HL(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),i=Hj(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 G4(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):j2(o.text,e.state.tabSize,r-o.from);return{line:o.number,col:s,off:a}}let G6={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},G8={style:"cursor: crosshair"},G9="-10000px";class G7{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 Ue(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}let Ut=jr.define({combine:e=>{var t,n,i;return{position:Hy.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)||Ue}}}),Un=new WeakMap,Ui=WS.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(Ut);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 G7(e,Us,(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(Ut);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=G9,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(Hy.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=WP(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(Ut).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=G9;continue}let p=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,f=7*!!p,g=d.right-d.left,m=null!=(t=Un.get(u))?t:d.bottom-d.top,v=u.offset||Ua,y=this.view.textDirection==HJ.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=G9;continue}Un.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",Ur(c,(x-e.parent.left)/r)):(c.style.top=S/o+"px",Ur(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=G9}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Ur(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}let Uo=Gv.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"}}}),Ua={x:0,y:0},Us=jr.define({enables:[Ui,Uo]}),Ul=jr.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class Uu{static create(e){return new Uu(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new G7(e,Ul,(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 Uc=Us.compute([Ul],e=>{let t=e.facet(Ul);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:Uu.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),Uh=jr.define();class Ud{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==HJ.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=>Wy(e.state,t,"hover tooltip"))}else o(r)}get tooltip(){let e=this.view.plugin(Ui),t=e?e.manager.tooltips.findIndex(e=>e.create==Uu.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 Up(e,t){let n=e.plugin(Ui);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}let Uf=jI.define(),Ug=jr.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 Um(e,t){let n=e.plugin(Uv),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}let Uv=WS.fromClass(class{constructor(e){this.input=e.state.facet(Ub),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(Ug);for(let n of(this.top=new Uy(e,!0,t.topContainer),this.bottom=new Uy(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(Ug);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Uy(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Uy(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(Ub);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=>Gv.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Uy{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=Ux(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Ux(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 Ux(e){let t=e.nextSibling;return e.remove(),t}let Ub=jr.define({enables:Uv}),Uw=jc.define({create:()=>[],update(e,t){for(let n of t.effects)n.is(US)?e=[n.value].concat(e):n.is(U_)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>Ub.computeN([e],t=>t.field(e))}),US=jI.define(),U_=jI.define();class UC extends jF{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}UC.prototype.elementClass="",UC.prototype.toDOM=void 0,UC.prototype.mapMode=V1.TrackBefore,UC.prototype.startSide=UC.prototype.endSide=-1,UC.prototype.point=!0;let UM=jr.define(),UA=jr.define(),Uk={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>j$.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},UT=jr.define();function UI(e){return[UO(),UT.of({...Uk,...e})]}let UD=jr.define({combine:e=>e.some(e=>e)});function UO(e){let t=[UR];return e&&!1===e.fixed&&t.push(UD.of(!0)),t}let UR=WS.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(UT).map(t=>new UN(e,t)),this.fixed=!e.state.facet(UD),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(UD)!=!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=j$.iter(this.view.state.facet(UM),this.view.viewport.from),i=[],r=this.gutters.map(e=>new UL(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==HC.Text&&t){for(let e of(UE(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==HC.Text)for(let t of(UE(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(UT),n=e.state.facet(UT),i=e.docChanged||e.heightChanged||e.viewportChanged||!j$.eq(e.startState.facet(UM),e.state.facet(UM),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 UN(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=>Gv.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==HJ.LTR?{left:i,right:r}:{right:i,left:r}})});function UP(e){return Array.isArray(e)?e:[e]}function UE(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class UL{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=j$.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 UB(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=[];UE(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(UA)){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 UN{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=UP(t.markers(e)),t.initialSpacer&&(this.spacer=new UB(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=UP(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!j$.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 UB{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 Uz=jr.define(),UF=jr.define(),UV=jr.define({combine:e=>jz(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 Uj extends UC{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function UH(e,t){return e.state.facet(UV).formatNumber(t,e.state)}let UW=UT.compute([UV],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(Uz),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new Uj(UH(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let i of e.state.facet(UF)){let r=i(e,t,n);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(UV)!=e.state.facet(UV),initialSpacer:e=>new Uj(UH(e,U$(e.state.doc.lines))),updateSpacer(e,t){let n=UH(t.view,U$(t.view.state.doc.lines));return n==e.number?e:new Uj(n)},domEventHandlers:e.facet(UV).domEventHandlers,side:"before"}));function U$(e){let t=9;for(;t<e;)t=10*t+9;return t}let UG=new class extends UC{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},UU=UM.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(UG.range(r)))}return j$.of(t)}),Uq=new Fx,UY=new Fx;class UZ{constructor(e,t,n=[],i=""){this.data=e,this.name=i,jB.prototype.hasOwnProperty("tree")||Object.defineProperty(jB.prototype,"tree",{get(){return UQ(this)}}),this.parser=t,this.extension=[U8.of(this),jB.languageData.of((e,t,n)=>{let i=UX(e,t,n),r=i.type.prop(Uq);if(!r)return[];let o=e.facet(r),a=i.type.prop(UY);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 UX(e,t,n).type.prop(Uq)==this.data}findRegions(e){let t=e.facet(U8);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(Uq)==this.data)return void n.push({from:t,to:t+e.length});let r=e.prop(Fx.mounted);if(r){if(r.tree.prop(Uq)==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 FA&&i(r,e.positions[n]+t)}};return i(UQ(e),0),n}get allowsNesting(){return!0}}function UX(e,t,n){let i=e.facet(U8),r=UQ(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}UZ.setState=jI.define();class UK extends UZ{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){var t;let n=(t=e.languageData,jr.define({combine:t?e=>e.concat(t):void 0}));return new UK(n,e.parser.configure({props:[Uq.add(e=>e.isTop?n:void 0)]}),e.name)}configure(e,t){return new UK(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function UQ(e){let t=e.field(UZ.state,!1);return t?t.tree:FA.empty}class UJ{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 U0=null;class U1{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 U1(e,t,[],FA.empty,0,n,[],null)}startParse(){return this.parser.startParse(new UJ(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=FA.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(F$.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(F$.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=U0;U0=this;try{return e()}finally{U0=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=U2(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=F$.applyChanges(n,t),i=FA.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 U1(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=U2(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 FG{createParse(t,n,i){let r=i[0].from,o=i[i.length-1].to;return{parsedPos:r,advance(){let t=U0;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 FA(FS.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 U0}}function U2(e,t,n){return F$.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class U5{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 U5(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=U1.create(e.facet(U8).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new U5(n)}}UZ.state=jc.define({create:U5.init,update(e,t){for(let e of t.effects)if(e.is(UZ.setState))return e.value;return t.startState.facet(U8)!=t.state.facet(U8)?U5.init(t.state):e.apply(t)}});let U3=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"u">typeof requestIdleCallback&&(U3=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let U4="u">typeof navigator&&(null==(ey=navigator.scheduling)?void 0:ey.isInputPending)?()=>navigator.scheduling.isInputPending():null,U6=WS.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(UZ.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(UZ.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=U3(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(UZ.state);if(r.tree==r.context.tree&&r.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!U4?Math.max(25,e.timeRemaining()-5):1e9),a=r.context.treeLen<i&&n.doc.length>i+1e3,s=r.context.work(()=>U4&&U4()||Date.now()>o,i+1e5*!a);this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:UZ.setState.of(new U5(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=>Wy(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()}}}),U8=jr.define({combine:e=>e.length?e[0]:null,enables:e=>[UZ.state,U6,Gv.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class U9{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}let U7=jr.define(),qe=jr.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 qt(e){let t=e.facet(qe);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function qn(e,t){let n="",i=e.tabSize,r=e.facet(qe)[0];if(" "==r){for(;t>=i;)n+=" ",t-=i;r=" "}for(let e=0;e<t;e++)n+=r;return n}function qi(e,t){for(let n of(e instanceof jB&&(e=new qr(e)),e.state.facet(U7))){let i=n(e,t);if(void 0!==i)return i}let n=UQ(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 qa(i,e,n)}(e,n,t):null}class qr{constructor(e,t={}){this.state=e,this.options=t,this.unit=qt(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 j2(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 qo=new Fx;function qa(e,t,n){for(let i=e;i;i=i.next){let e=function(e){let t=e.type.prop(qo);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(Fx.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?qs:null}(i.node);if(e)return e(ql.create(t,n,i))}return 0}function qs(){return 0}class ql extends qr{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 ql(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 qa(this.context.next,this.base,this.pos)}}function qu({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}let qc=jr.define(),qh=new Fx;function qd(e,t,n){for(let i of e.facet(qc)){let r=i(e,t,n);if(r)return r}return function(e,t,n){let i=UQ(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(qh);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 qp(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 qf=jI.define({map:qp}),qg=jI.define({map:qp});function qm(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 qv=jc.define({create:()=>HM.none,update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,n)=>e=qy(e,t,n)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(qf)&&!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(qg)&&(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(qC),r=n.map(e=>(i?HM.replace({widget:new qT(i(t.state,e))}):qk).range(e.from,e.to));e=e.update({add:r})}return t.selection&&(e=qy(e,t.selection.main.head)),e},provide:e=>Gv.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(qk.range(i,r))}return HM.set(t,!0)}});function qy(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 qx(e,t,n){var i;let r=null;return null==(i=e.field(qv,!1))||i.between(t,n,(e,t)=>{(!r||r.from>e)&&(r={from:e,to:t})}),r}function qb(e,t){return e.field(qv,!1)?t:t.concat(jI.appendConfig.of(qM()))}function qw(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return Gv.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}let qS=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of qm(e)){let n=qd(e.state,t.from,t.to);if(n)return e.dispatch({effects:qb(e.state,[qf.of(n),qw(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(qv,!1))return!1;let t=[];for(let n of qm(e)){let i=qx(e.state,n.from,n.to);i&&t.push(qg.of(i),qw(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=qd(t,r.from,r.to);o&&n.push(qf.of(o)),i=(o?e.lineBlockAt(o.to):r).to+1}return n.length&&e.dispatch({effects:qb(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(qv,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(qg.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],q_={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},qC=jr.define({combine:e=>jz(e,q_)});function qM(e){let t=[qv,qO];return e&&t.push(qC.of(e)),t}function qA(e,t){let{state:n}=e,i=n.facet(qC),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),i=qx(e.state,n.from,n.to);i&&e.dispatch({effects:qg.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 qk=HM.replace({widget:new class extends H_{toDOM(e){return qA(e,null)}}});class qT extends H_{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return qA(e,this.value)}}let qI={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class qD extends UC{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 qO=Gv.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 qR{constructor(e,t){let n;function i(e){let t=j8.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 UZ?e=>e.prop(Uq)==o.data:o?e=>e==o:void 0,this.style=Vd(e.map(e=>({tag:e.tag,class:e.class||i(Object.assign({},e,{tag:null}))})),{all:r}).style,this.module=n?new j8(n):null,this.themeType=t.themeType}static define(e,t){return new qR(e,t||{})}}let qP=jr.define(),qE=jr.define({combine:e=>e.length?[e[0]]:null});function qL(e){let t=e.facet(qP);return t.length?t:e.facet(qE)}function qN(e,t){let n=[qB],i;return e instanceof qR&&(e.module&&n.push(Gv.styleModule.of(e.module)),i=e.themeType),(null==t?void 0:t.fallback)?n.push(qE.of(e)):i?n.push(qP.computeN([Gv.darkTheme],t=>t.facet(Gv.darkTheme)==("dark"==i)?[e]:[])):n.push(qP.of(e)),n}let qB=jd.high(WS.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=UQ(e.state),this.decorations=this.buildDeco(e,qL(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=UQ(e.state),n=qL(e.state),i=n!=qL(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 HM.none;let n=new jG;for(let{from:i,to:r}of e.visibleRanges)!function(e,t,n,i=0,r=e.length){let o=new Vp(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]=HM.mark({class:i})))},i,r);return n.finish()}},{decorations:e=>e.decorations})),qz=qR.define([{tag:VI.meta,color:"#404740"},{tag:VI.link,textDecoration:"underline"},{tag:VI.heading,textDecoration:"underline",fontWeight:"bold"},{tag:VI.emphasis,fontStyle:"italic"},{tag:VI.strong,fontWeight:"bold"},{tag:VI.strikethrough,textDecoration:"line-through"},{tag:VI.keyword,color:"#708"},{tag:[VI.atom,VI.bool,VI.url,VI.contentSeparator,VI.labelName],color:"#219"},{tag:[VI.literal,VI.inserted],color:"#164"},{tag:[VI.string,VI.deleted],color:"#a11"},{tag:[VI.regexp,VI.escape,VI.special(VI.string)],color:"#e40"},{tag:VI.definition(VI.variableName),color:"#00f"},{tag:VI.local(VI.variableName),color:"#30a"},{tag:[VI.typeName,VI.namespace],color:"#085"},{tag:VI.className,color:"#167"},{tag:[VI.special(VI.variableName),VI.macroName],color:"#256"},{tag:VI.definition(VI.propertyName),color:"#00c"},{tag:VI.comment,color:"#940"},{tag:VI.invalid,color:"#f00"}]),qF=Gv.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),qV="()[]{}",qj=jr.define({combine:e=>jz(e,{afterCursor:!0,brackets:qV,maxScanDistance:1e4,renderMatch:q$})}),qH=HM.mark({class:"cm-matchingBracket"}),qW=HM.mark({class:"cm-nonmatchingBracket"});function q$(e){let t=[],n=e.matched?qH:qW;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 qG(e){let t=[],n=e.facet(qj);for(let i of e.selection.ranges){if(!i.empty)continue;let r=qX(e,i.head,-1,n)||i.head>0&&qX(e,i.head-1,1,n)||n.afterCursor&&(qX(e,i.head,1,n)||i.head<e.doc.length&&qX(e,i.head+1,-1,n));r&&(t=t.concat(n.renderMatch(r,e)))}return HM.set(t,!0)}let qU=[WS.fromClass(class{constructor(e){this.paused=!1,this.decorations=qG(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=qG(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),qF],qq=new Fx;function qY(e,t,n){let i=e.prop(t<0?Fx.openedBy:Fx.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 qZ(e){let t=e.type.prop(qq);return t?t(e.node):e}function qX(e,t,n,i={}){let r=i.maxScanDistance||1e4,o=i.brackets||qV,a=UQ(e),s=a.resolveInner(t,n);for(let e=s;e;e=e.parent){let i=qY(e.type,n,o);if(i&&e.from<e.to){let r=qZ(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=qZ(l);return{start:a,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(qY(l.type,e,r))s++;else if(qY(l.type,-e,r)){if(0==s){let e=qZ(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 qK=Object.create(null),qQ=[FS.none],qJ=[],q0=Object.create(null),q1=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"]])q1[e]=function(e,t){let n=[];for(let i of t.split(" ")){let t=[];for(let n of i.split(".")){let i=e[n]||VI[n];i?"function"==typeof i?t.length?t=t.map(i):q2(n,`Modifier ${n} used at start of tag`):t.length?q2(n,`Tag ${n} used as modifier`):t=Array.isArray(i)?i:[i]:q2(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=q0[r];if(o)return o.id;let a=q0[r]=FS.define({id:qQ.length,name:i,props:[Vu({[i]:n})]});return qQ.push(a),a.id}(qK,t);function q2(e,t){qJ.indexOf(e)>-1||(qJ.push(e),console.warn(t))}HJ.RTL,HJ.LTR;let q5=UK.define({name:"json",parser:VO.configure({props:[qo.add({Object:qu({except:/^\s*\}/}),Array:qu({except:/^\s*\]/})}),qh.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 q3{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class q4{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let i=n.facet(Yl).markerFilter;i&&(e=i(e,n));let r=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new jG,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=Yy(a);if(h)o.add(t,t,HM.widget({widget:new Yd(d),diagnostics:a.slice()}));else{let e=a.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");o.add(t,n,HM.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 q4(h,t,q6(h))}}function q6(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 q3(i.from,n,i.diagnostic)}else i=new q3(e,n,t||r.diagnostics[0])}),i}function q8(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(Yl).hideOn(e,n,i);if(null!=r)return r;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(q7))||e.changes.touchesRange(o.from,Math.max(o.to,i)))}function q9(e,t){return e.field(Yn,!1)?t:t.concat(jI.appendConfig.of(YA))}let q7=jI.define(),Ye=jI.define(),Yt=jI.define(),Yn=jc.define({create:()=>new q4(HM.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=q6(n,e.selected.diagnostic,r)||q6(n,null,r)}!n.size&&r&&t.state.facet(Yl).autoPanel&&(r=null),e=new q4(n,r,i)}for(let n of t.effects)if(n.is(q7)){let i=t.state.facet(Yl).autoPanel?n.value.length?Yf.open:null:e.panel;e=q4.init(n.value,i,t.state)}else n.is(Ye)?e=new q4(e.diagnostics,n.value?Yf.open:null,e.selected):n.is(Yt)&&(e=new q4(e.diagnostics,e.panel,n.value));return e},provide:e=>[Ub.from(e,e=>e.panel),Gv.decorations.from(e,e=>e.diagnostics)]}),Yi=HM.mark({class:"cm-lintRange cm-lintRange-active"});function Yr(e,t){return Ha("ul",{class:"cm-tooltip-lint"},t.map(t=>Yh(e,t,!1)))}let Yo=e=>{let t=e.state.field(Yn,!1);return!!t&&!!t.panel&&(e.dispatch({effects:Ye.of(!1)}),!0)},Ya=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(Yn,!1);t&&t.panel||e.dispatch({effects:q9(e.state,[Ye.of(!0)])});let n=Um(e,Yf.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(Yn,!1);if(!t)return!1;let n=e.state.selection.main,i=q6(t.diagnostics,null,n.to+1);return(!!i||!!(i=q6(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(Uh).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:YM,until:e=>e.docChanged||e.newSelection.main.head<i.from||e.newSelection.main.head>i.to}),!0)}}],Ys=WS.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(Yl);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(Yl);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:q9(n,[q7.of(i)])}))},e=>{Wy(this.view.state,e)})}}update(e){let t=e.state.facet(Yl);(e.docChanged||t!=e.startState.facet(Yl)||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)}}),Yl=jr.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...jz(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Yu,tooltipFilter:Yu,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 Yu(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function Yc(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 Yh(e,t,n){var i;let r=n?Yc(t.actions):[];return Ha("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Ha("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=q6(e.state.field(Yn).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),Ha("u",s.slice(l,l+1)),s.slice(l+1)];return Ha("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&&Ha("div",{class:"cm-diagnosticSource"},t.source))}class Yd extends H_{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Ha("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Yp{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(0xffffffff*Math.random()).toString(16),this.dom=Yh(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Yf{constructor(e){this.view=e,this.items=[];let t=t=>{if(!t.ctrlKey&&!t.altKey&&!t.metaKey){if(27==t.keyCode)Yo(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=Yc(n.actions);for(let r=0;r<i.length;r++)if(i[r].toUpperCase().charCodeAt(0)==t.keyCode){let t=q6(this.view.state.field(Yn).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=Ha("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:n}),this.dom=Ha("div",{class:"cm-panel-lint"},this.list,Ha("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Yo(this.view)},"\xd7")),this.update()}get selectedIndex(){let e=this.view.state.field(Yn).selected;if(!e)return -1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return -1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Yn),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 Yp(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 Yp(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=q6(this.view.state.field(Yn).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:Yt.of(t)})}static open(e){return new Yf(e)}}function Yg(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 Ym(e){return Yg(`<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 Yv=Gv.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:Ym("#f11")},".cm-lintRange-warning":{backgroundImage:Ym("orange")},".cm-lintRange-info":{backgroundImage:Ym("#999")},".cm-lintRange-hint":{backgroundImage:Ym("#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 Yy(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 Yx extends UC{constructor(e){super(),this.diagnostics=e,this.severity=Yy(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(Yk).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:YS.of({pos:r.from,above:!1,clip:!1,create:()=>({dom:Yr(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(Y_)&&e.dispatch({effects:YS.of(null)})}},window.addEventListener("mousemove",i)}let{hoverTime:r}=e.state.facet(Yk),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 Yb=UI({class:"cm-gutter-lint",markers:e=>e.state.field(Yw),widgetMarker:(e,t,n)=>{let i=[];return e.state.field(Yw).between(n.from,n.to,(e,t,r)=>{e>n.from&&e<n.to&&i.push(...r.diagnostics)}),i.length?new Yx(i):null}}),Yw=jc.define({create:()=>j$.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(Yk).markerFilter;for(let i of t.effects)if(i.is(q7)){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 Yx(n[e]).range(+e));return j$.of(i,!0)}(t.state.doc,r.slice(0))}return e}}),YS=jI.define(),Y_=jc.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=q8(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(YS)?t.value:e,e)),provide:e=>Us.from(e)}),YC=Gv.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:Yg('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:Yg('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:Yg('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),YM=function(e,t={}){let n=jI.define(),i=new WeakMap,r=jc.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,V1.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(Uf)&&!t.value||t.value==r)&&(e=[]);return e.length&&a&&i.set(e,a),e},provide:e=>Ul.from(e)}),o=WS.define(o=>new Ud(o,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,o,Uh.of(o),Uc]}}(function(e,t,n){let{diagnostics:i}=e.state.field(Yn),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(Yl).tooltipFilter;return(r&&s&&(r=s(r,e.state)),r)?{pos:o,end:a,above:!0,create:()=>({dom:Yr(e,r)})}:null},{hideOn:q8}),YA=[Yn,Gv.decorations.compute([Yn],e=>{let{selected:t,panel:n}=e.field(Yn);return t&&n&&t.from!=t.to?HM.set([Yi.range(t.from,t.to)]):HM.none}),YM,Yv],Yk=jr.define({combine:e=>jz(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});var YT=n(49257);function YI(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 YD=YI(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=YP(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),YO=YI(YE,0),YR=YI((e,t)=>YE(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 YP(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}function YE(e,t,n=t.selection.ranges){let i=n.map(e=>YP(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 YL=jA.define(),YN=jA.define(),YB=jr.define(),Yz=jr.define({combine:e=>jz(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)})}),YF=jc.define({create:()=>YQ.empty,update(e,t){let n=t.state.facet(Yz),i=t.annotation(YL);if(i){let r=YG.fromTransaction(t,i.selection),o=i.side,a=0==o?e.undone:e.done;return a=r?YU(a,a.length,n.minDepth,r):YZ(a,t.startState.selection),new YQ(0==o?i.rest:a,0==o?a:i.rest)}let r=t.annotation(YN);if(("full"==r||"before"==r)&&(e=e.isolate()),!1===t.annotation(jD.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=YG.fromTransaction(t),a=t.annotation(jD.time),s=t.annotation(jD.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 YQ(e.done.map(YG.fromJSON),e.undone.map(YG.fromJSON))});function YV(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(YF,!1);if(!r)return!1;let o=r.pop(e,n,t);return!!o&&(i(o),!0)}}let Yj=YV(0,!1),YH=YV(1,!1),YW=YV(0,!0),Y$=YV(1,!0);class YG{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 YG(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 YG(e.changes&&V5.fromJSON(e.changes),[],e.mapped&&V2.fromJSON(e.mapped),e.startSelection&&jt.fromJSON(e.startSelection),e.selectionsAfter.map(jt.fromJSON))}static fromTransaction(e,t){let n=YY;for(let t of e.startState.facet(YB)){let i=t(e);i.length&&(n=n.concat(i))}return!n.length&&e.changes.empty?null:new YG(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,YY)}static selection(e){return new YG(void 0,YY,void 0,void 0,e)}}function YU(e,t,n,i){let r=e.slice(t+1>n+20?t-n-1:0,t);return r.push(i),r}function Yq(e,t){return e.length?t.length?e.concat(t):e:t}let YY=[];function YZ(e,t){if(!e.length)return[YG.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),YU(e,e.length-1,1e9,n.setSelAfter(i)))}}function YX(e,t){if(!e.length)return e;let n=e.length,i=YY;for(;n;){let r=function(e,t,n){let i=Yq(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):YY,n);if(!e.changes)return YG.selection(i);let r=e.changes.map(t),o=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(o):o;return new YG(r,jI.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?[YG.selection(i)]:YY}let YK=/^(input\.type|delete)($|\.)/;class YQ{constructor(e,t,n=0,i){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new YQ(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 YQ(u=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||YK.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)?YU(u,u.length-1,i.minDepth,new YG(e.changes.compose(c.changes),Yq(jI.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,YY)):YU(u,u.length,i.minDepth,e),YY,t,n)}addSelection(e,t,n,i){var r;let o=this.done.length?this.done[this.done.length-1].selectionsAfter:YY;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 YQ(YZ(this.done,e),this.undone,t,n)}addMapping(e){return new YQ(YX(this.done,e),YX(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:YL.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?YY:i.slice(0,i.length-1);return r.mapped&&(n=YX(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:YL.of({side:e,rest:n,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}YQ.empty=new YQ(YY,YY);let YJ=[{key:"Mod-z",run:Yj,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:YH,preventDefault:!0},{linux:"Ctrl-Shift-z",run:YH,preventDefault:!0},{key:"Mod-u",run:YW,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Y$,preventDefault:!0}];function Y0(e,t){return jt.create(e.ranges.map(t),e.mainIndex)}function Y1(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Y2({state:e,dispatch:t},n){let i=Y0(e.selection,n);return!i.eq(e.selection,!0)&&(t(Y1(e,i)),!0)}function Y5(e,t){return jt.cursor(t?e.to:e.from)}function Y3(e,t){return Y2(e,n=>n.empty?e.moveByChar(n,t):Y5(n,t))}function Y4(e){return e.textDirectionAt(e.state.selection.main.head)==HJ.LTR}let Y6=e=>Y3(e,!Y4(e)),Y8=e=>Y3(e,Y4(e));function Y9(e,t){return Y2(e,n=>n.empty?e.moveByGroup(n,t):Y5(n,t))}function Y7(e,t,n){let i,r,o=UQ(e).resolveInner(t.head),a=n?Fx.closedBy:Fx.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?qX(e,o.from,1):qX(e,o.to,-1))&&i.matched?n?i.end.to:i.end.from:n?o.to:o.from,jt.cursor(r,n?-1:1)}function Ze(e,t){return Y2(e,n=>{if(!n.empty)return Y5(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}"u">typeof Intl&&Intl.Segmenter;let Zt=e=>Ze(e,!1),Zn=e=>Ze(e,!0);function Zi(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,i=0,r;if(t){for(let t of e.state.facet(Gv.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 Zr(e,t){let n,i=Zi(e),{state:r}=e,o=Y0(r.selection,n=>n.empty?e.moveVertically(n,t,i.height):Y5(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=Gv.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-s}))}return e.dispatch(Y1(r,o),{effects:n}),!0}let Zo=e=>Zr(e,!1),Za=e=>Zr(e,!0);function Zs(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=jt.cursor(i.from+n))}return r}function Zl(e,t,n){let i=Y0(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=jt.range(e.head,e.anchor));let i=n(e);return jt.range(e.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return!i.eq(e.state.selection)&&(e.dispatch(Y1(e.state,i)),!0)}function Zu(e,t){return Zl(e,t,n=>e.moveByChar(n,t))}let Zc=e=>Zu(e,!Y4(e)),Zh=e=>Zu(e,Y4(e));function Zd(e,t){return Zl(e,t,n=>e.moveByGroup(n,t))}function Zp(e,t){return Zl(e,t,n=>e.moveVertically(n,t))}let Zf=e=>Zp(e,!1),Zg=e=>Zp(e,!0);function Zm(e,t){return Zl(e,t,n=>e.moveVertically(n,t,Zi(e).height))}let Zv=e=>Zm(e,!1),Zy=e=>Zm(e,!0),Zx=({state:e,dispatch:t})=>(t(Y1(e,{anchor:0})),!0),Zb=({state:e,dispatch:t})=>(t(Y1(e,{anchor:e.doc.length})),!0),Zw=({state:e,dispatch:t})=>(t(Y1(e,{anchor:e.selection.main.anchor,head:0})),!0),ZS=({state:e,dispatch:t})=>(t(Y1(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function Z_(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(Y1(n,jt.create(r,r.length-1))),!0)}function ZC(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=ZM(e,a,!1)):a>r&&(n="delete.forward",a=ZM(e,a,!0)),r=Math.min(r,a),o=Math.max(o,a)}else r=ZM(e,r,!1),o=ZM(e,o,!0);return r==o?{range:i}:{changes:{from:r,to:o},range:jt.cursor(r,r<i.head?-1:1)}});return!r.changes.empty&&(e.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?Gv.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function ZM(e,t,n){if(e instanceof Gv)for(let i of e.state.facet(Gv.atomicRanges).map(t=>t(e)))i.between(t,t,(e,i)=>{e<t&&i>t&&(t=n?i:e)});return t}let ZA=(e,t,n)=>ZC(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=j2(s,o.tabSize)%qt(o)||qt(o);for(let t=0;t<e&&" "==s[s.length-1-t];t++)r--;l=r}else(l=VX(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=VX(a.text,l-a.from,!1,!1)+a.from);return l}),Zk=e=>ZA(e,!1,!0),ZT=e=>ZA(e,!0,!1),ZI=(e,t)=>ZC(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=VX(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}),ZD=e=>ZI(e,!1);function ZO(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 ZR(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let t of ZO(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(jt.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(jt.range(n.anchor-a,n.head-a))}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:jt.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function ZP(e,t,n){if(e.readOnly)return!1;let i=[];for(let t of ZO(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 ZE=ZN(!1),ZL=ZN(!0);function ZN(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=UQ(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(Fx.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 qr(t,{simulateBreak:i,simulateDoubleBreak:!!a}),l=qi(s,i);for(null==l&&(l=j2(/^\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=["",qn(t,l)];return a&&u.push(qn(t,s.lineIndent(o.from,-1))),{changes:{from:i,to:r,insert:Vj.of(u)},range:jt.cursor(i+1+u[1].length)}});return n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function ZB(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:jt.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}let Zz=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(ZB(e,(t,n)=>{n.push({from:t.from,insert:e.facet(qe)})}),{userEvent:"input.indent"})),!0),ZF=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(ZB(e,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=j2(i,e.tabSize),o=0,a=qn(e,Math.max(0,r-qt(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),ZV=[{key:"Ctrl-b",run:Y6,shift:Zc,preventDefault:!0},{key:"Ctrl-f",run:Y8,shift:Zh},{key:"Ctrl-p",run:Zt,shift:Zf},{key:"Ctrl-n",run:Zn,shift:Zg},{key:"Ctrl-a",run:e=>Y2(e,t=>jt.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>Zl(e,!1,t=>jt.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>Y2(e,t=>jt.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>Zl(e,!0,t=>jt.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:ZT},{key:"Ctrl-h",run:Zk},{key:"Ctrl-k",run:e=>ZC(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:ZD},{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:Vj.of(["",""])},range:jt.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:VX(i.text,n-i.from,!1)+i.from,o=n==i.to?n+1:VX(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:jt.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Za}],Zj=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>Y2(e,t=>Y7(e.state,t,!Y4(e))),shift:e=>{let t=!Y4(e);return Zl(e,t,n=>Y7(e.state,n,t))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>Y2(e,t=>Y7(e.state,t,Y4(e))),shift:e=>{let t=Y4(e);return Zl(e,t,n=>Y7(e.state,n,t))}},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>ZR(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>ZP(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>ZR(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>ZP(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>Z_(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>Z_(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=jt.create([n.main]):n.main.empty||(i=jt.create([jt.cursor(n.main.head)])),!!i&&(t(Y1(e,i)),!0)}},{key:"Mod-Enter",run:ZL},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=ZO(e).map(({from:t,to:n})=>jt.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:jt.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=Y0(e.selection,t=>{let n=UQ(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 jt.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(Y1(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:ZF},{key:"Mod-]",run:Zz},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new qr(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=ZB(e,(t,r,o)=>{let a=qi(i,t.from);if(null==a)return;/\S/.test(t.text)||(a=0);let s=/^\s*/.exec(t.text)[0],l=qn(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(ZO(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),i=Y0(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=Y0(e.selection,t=>{let i=qX(e,t.head,-1)||qX(e,t.head,1)||t.head>0&&qX(e,t.head-1,1)||t.head<e.doc.length&&qX(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 jt.cursor(r)}),!!n&&(t(Y1(e,i)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=YP(e.state,n.from);return i.line?YD(e):!!i.block&&YR(e)}},{key:"Alt-A",run:YO},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:Y6,shift:Zc,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>Y9(e,!Y4(e)),shift:e=>Zd(e,!Y4(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>Y2(e,t=>Zs(e,t,!Y4(e))),shift:e=>{let t=!Y4(e);return Zl(e,t,n=>Zs(e,n,t))},preventDefault:!0},{key:"ArrowRight",run:Y8,shift:Zh,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>Y9(e,Y4(e)),shift:e=>Zd(e,Y4(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>Y2(e,t=>Zs(e,t,Y4(e))),shift:e=>{let t=Y4(e);return Zl(e,t,n=>Zs(e,n,t))},preventDefault:!0},{key:"ArrowUp",run:Zt,shift:Zf,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Zx,shift:Zw},{mac:"Ctrl-ArrowUp",run:Zo,shift:Zv},{key:"ArrowDown",run:Zn,shift:Zg,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Zb,shift:ZS},{mac:"Ctrl-ArrowDown",run:Za,shift:Zy},{key:"PageUp",run:Zo,shift:Zv},{key:"PageDown",run:Za,shift:Zy},{key:"Home",run:e=>Y2(e,t=>Zs(e,t,!1)),shift:e=>Zl(e,!1,t=>Zs(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:Zx,shift:Zw},{key:"End",run:e=>Y2(e,t=>Zs(e,t,!0)),shift:e=>Zl(e,!0,t=>Zs(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:Zb,shift:ZS},{key:"Enter",run:ZE,shift:ZE},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Zk,shift:Zk,preventDefault:!0},{key:"Delete",run:ZT,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ZD,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>ZI(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>ZC(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=>ZC(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(ZV.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),ZH={key:"Tab",run:Zz,shift:ZF},ZW="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class Z${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(ZW(e)):ZW,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 VK(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=VQ(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=VJ(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&&(Z$.prototype[Symbol.iterator]=function(){return this});let ZG={from:-1,to:-1,match:/.*/.exec(""),precise:!0},ZU="gm"+(null==/x/.unicode?"":"u");class Zq{constructor(e,t,n,i=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=ZG,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new ZX(e,t,n,i,r);this.re=new RegExp(t,ZU+((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=ZK(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=ZK(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 ZY=new WeakMap;class ZZ{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let i=ZY.get(e);if(!i||i.from>=n||i.to<=t){let i=new ZZ(t,e.sliceString(t,n));return ZY.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)),ZY.set(e,new ZZ(o,r)),new ZZ(t,r.slice(t-o,n-o))}}class ZX{constructor(e,t,n,i,r){this.text=e,this.to=r,this.done=!1,this.value=ZG,this.matchPos=ZK(e,i),this.re=new RegExp(t,ZU+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=ZZ.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=ZK(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=ZZ.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function ZK(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&&(Zq.prototype[Symbol.iterator]=ZX.prototype[Symbol.iterator]=function(){return this});let ZQ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ZJ=jr.define({combine:e=>jz(e,ZQ,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),Z0=HM.mark({class:"cm-selectionMatch"}),Z1=HM.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Z2(e,t,n,i){return(0==n||e(t.sliceDoc(n-1,n))!=jL.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=jL.Word)}let Z5=WS.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(ZJ),{state:n}=e,i=n.selection;if(i.ranges.length>1)return HM.none;let r=i.main,o,a=null;if(r.empty){if(!t.highlightWordAroundCursor)return HM.none;let e=n.wordAt(r.head);if(!e)return HM.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 HM.none;if(t.wholeWords){var s,l,u;if(o=n.sliceDoc(r.from,r.to),!(Z2(a=n.charCategorizer(r.head),n,r.from,r.to)&&(s=a,l=r.from,u=r.to,s(n.sliceDoc(l,l+1))==jL.Word&&s(n.sliceDoc(u-1,u))==jL.Word)))return HM.none}else if(!(o=n.sliceDoc(r.from,r.to)))return HM.none}let c=[];for(let i of e.visibleRanges){let e=new Z$(n.doc,o,i.from,i.to);for(;!e.next().done;){let{from:i,to:o}=e.value;if((!a||Z2(a,n,i,o))&&(r.empty&&i<=r.from&&o>=r.to?c.push(Z1.range(i,o)):(i>=r.to||o<=r.from)&&c.push(Z0.range(i,o)),c.length>t.maxMatches))return HM.none}}return HM.set(c)}},{decorations:e=>e.decorations}),Z3=Gv.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Z4=jr.define({combine:e=>jz(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new XC(e),scrollToMatch:e=>Gv.scrollIntoView(e)})});class Z6{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,ZU),!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 Xi(this):new Z7(this)}getCursor(e,t=0,n){let i=e.doc?e:jB.create({doc:e});return null==n&&(n=i.doc.length),this.regexp?Xe(this,i,t,n):Z9(this,i,t,n)}}class Z8{constructor(e){this.spec=e}}function Z9(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(Xt(n,e-i))!=jL.Word||s(Xn(n,e-i))!=jL.Word)&&(s(Xn(n,t-i))!=jL.Word||s(Xt(n,t-i))!=jL.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 Z$(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:e=>e.toLowerCase(),l)}class Z7 extends Z8{constructor(e){super(e)}nextMatch(e,t,n){let i=Z9(this.spec,e,n,e.doc.length).nextOverlapping();if(i.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);i=Z9(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=Z9(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=Z9(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=Z9(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 Xe(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(Xt(n.input,n.index))!=jL.Word||a(Xn(n.input,n.index))!=jL.Word)&&(a(Xn(n.input,n.index+n[0].length))!=jL.Word||a(Xt(n.input,n.index+n[0].length))!=jL.Word)),e.test&&(r=e.test,o=s,s=(e,n,i)=>(!o||o(e,n,i))&&r(i[0],t,e,n)),new Zq(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:s},n,i)}function Xt(e,t){return e.slice(VX(e,t,!1),t)}function Xn(e,t){return e.slice(t,VX(e,t))}class Xi extends Z8{nextMatch(e,t,n){let i=Xe(this.spec,e,n,e.doc.length).next();return i.done&&(i=Xe(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=Xe(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=Xe(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=Xe(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 Xr=jI.define(),Xo=jI.define(),Xa=jc.define({create:e=>new Xs(Xy(e).create(),null),update(e,t){for(let n of t.effects)n.is(Xr)?e=new Xs(n.value.create(),e.panel):n.is(Xo)&&(e=new Xs(e.query,n.value?Xv:null));return e},provide:e=>Ub.from(e,e=>e.panel)});class Xs{constructor(e,t){this.query=e,this.panel=t}}let Xl=HM.mark({class:"cm-searchMatch"}),Xu=HM.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Xc=WS.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Xa))}update(e){let t=e.state.field(Xa);(t!=e.startState.field(Xa)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return HM.none;let{view:n}=this,i=new jG;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?Xu:Xl)})}return i.finish()}},{decorations:e=>e.decorations});function Xh(e){return t=>{let n=t.state.field(Xa,!1);return n&&n.query.spec.valid?e(t,n):Xw(t)}}let Xd=Xh((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=jt.single(i.from,i.to),o=e.state.facet(Z4);return e.dispatch({selection:r,effects:[Xk(e,i),o.scrollToMatch(r.main,e)],userEvent:"select.search"}),Xb(e),!0}),Xp=Xh((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let o=jt.single(r.from,r.to),a=e.state.facet(Z4);return e.dispatch({selection:o,effects:[Xk(e,r),a.scrollToMatch(o.main,e)],userEvent:"select.search"}),Xb(e),!0}),Xf=Xh((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:jt.create(n.map(e=>jt.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),Xg=Xh((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(Gv.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=jt.single(a.from,a.to).map(h),c.push(Xk(e,a)),c.push(n.facet(Z4).scrollToMatch(l.main,e))),e.dispatch({changes:h,selection:l,effects:c,userEvent:"input.replace"}),!0}),Xm=Xh((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:Gv.announce.of(i),userEvent:"input.replace.all"}),!0});function Xv(e){return e.state.facet(Z4).createPanel(e)}function Xy(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(Z4);return new Z6({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 Xx(e){let t=Um(e,Xv);return t&&t.dom.querySelector("[main-field]")}function Xb(e){let t=Xx(e);t&&t==e.root.activeElement&&t.select()}let Xw=e=>{let t=e.state.field(Xa,!1);if(t&&t.panel){let n=Xx(e);if(n&&n!=e.root.activeElement){let i=Xy(e.state,t.query.spec);i.valid&&e.dispatch({effects:Xr.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[Xo.of(!0),t?Xr.of(Xy(e.state,t.query.spec)):jI.appendConfig.of(XI)]});return!0},XS=e=>{let t=e.state.field(Xa,!1);if(!t||!t.panel)return!1;let n=Um(e,Xv);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Xo.of(!1)}),!0},X_=[{key:"Mod-f",run:Xw,scope:"editor search-panel"},{key:"F3",run:Xd,shift:Xp,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Xd,shift:Xp,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:XS,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 Z$(e.doc,e.sliceDoc(i,r));!t.next().done;){if(o.length>1e3)return!1;t.value.from==i&&(a=o.length),o.push(jt.range(t.value.from,t.value.to))}return t(e.update({selection:jt.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=Ha("form"),t.input){let e=Ha("input",t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add("cm-textfield"),e.name||(e.name="input"),i.appendChild(Ha("label",(t.label||"")+": ",e))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Ha("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=Ha("div",i,Ha("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(Uw,!1)?e.dispatch({effects:US.of(r)}):e.dispatch({effects:jI.appendConfig.of(Uw.init(()=>[r]))}),{close:o=U_.of(r),result:i.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(Uw).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=jt.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[l,Gv.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=jt.create(n.ranges.map(t=>e.wordAt(t.head)||jt.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 Z$(e.doc,t,i[i.length-1].to);;)if(r.next(),r.done){if(n)return null;r=new Z$(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(jt.range(r.from,r.to),!1),effects:Gv.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class XC{constructor(e){this.view=e;let t=this.query=e.state.field(Xa).query.spec;function n(e,t,n){return Ha("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=Ha("input",{value:t.search,placeholder:XM(e,"Find"),"aria-label":XM(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ha("input",{value:t.replace,placeholder:XM(e,"Replace"),"aria-label":XM(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ha("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Ha("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Ha("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=Ha("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>Xd(e),[XM(e,"next")]),n("prev",()=>Xp(e),[XM(e,"previous")]),n("select",()=>Xf(e),[XM(e,"all")]),Ha("label",null,[this.caseField,XM(e,"match case")]),Ha("label",null,[this.reField,XM(e,"regexp")]),Ha("label",null,[this.wordField,XM(e,"by word")]),...e.state.readOnly?[]:[Ha("br"),this.replaceField,n("replace",()=>Xg(e),[XM(e,"replace")]),n("replaceAll",()=>Xm(e),[XM(e,"replace all")])],Ha("button",{name:"close",onclick:()=>XS(e),"aria-label":XM(e,"close"),type:"button"},["\xd7"])])}commit(){let e=new Z6({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:Xr.of(e)}))}keydown(e){var t;(t=this.view,GD(Gk(t.state),e,t,"search-panel"))?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Xp:Xd)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),Xg(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(Xr)&&!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(Z4).top}}function XM(e,t){return e.state.phrase(t)}let XA=/[\s\.,:;?!]/;function Xk(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(!XA.test(s[e+1])&&XA.test(s[e])){s=s.slice(e);break}}if(a!=r){for(let e=s.length-1;e>s.length-30;e--)if(!XA.test(s[e-1])&&XA.test(s[e])){s=s.slice(0,e);break}}return Gv.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${i.number}.`)}let XT=Gv.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"}}),XI=[Xa,jd.low(Xc),XT];class XD{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=UQ(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(XE(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 XO(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 XR{constructor(e,t,n,i){this.completion=e,this.source=t,this.match=n,this.score=i}}function XP(e){return e.selection.main.from}function XE(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 XL=jA.define(),XN=new WeakMap;function XB(e){if(!Array.isArray(e))return e;let t=XN.get(e);return t||XN.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=XO(t)+XO(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 Xz=jI.define(),XF=jI.define();class XV{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=VK(e,t),i=VJ(n);this.chars.push(n);let r=e.slice(t,t+i),o=r.toUpperCase();this.folded.push(VK(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=VK(e,0),r=VJ(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=VK(e,r);(o==t[l]||o==n[l])&&(i[l++]=r),r+=VJ(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=VK(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=VQ(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+=VJ(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?VJ(VK(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 Xj{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 XH=jr.define({combine:e=>jz(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:X$,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=>XW(e(n),t(n)),optionClass:(e,t)=>n=>XW(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function XW(e,t){return e?t?e+" "+t:e:t}function X$(e,t,n,i,r,o){let a=e.textDirection==HJ.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 XG=jI.define();function XU(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 Xq{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(XH);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=XU(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:XG.of(t)}),n.preventDefault())}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(XH).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:XF.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=XU(r.length,o,e.state.facet(XH).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=XU(t.options.length,t.selected,this.view.state.facet(XH).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=>Wy(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(XH).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 XY(e){return 100*(e.boost||0)+10*!!e.apply+5*!!e.info+ +!!e.type}class XZ{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 XZ(this.options,XJ(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(XH);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 XR(t,i.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(i.from,i.to),s,l=a.filterStrict?new Xj(n):new XV(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 XR(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?XY(e.completion)>XY(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(XH).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 XZ(a,XJ(n,s),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:X8,above:r.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(e){return new XZ(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new XZ(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class XX{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new XX(X0,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(XH),i=(n.override||t.languageDataAt("autocomplete",XP(t)).map(XB)).map(t=>(this.active.find(e=>e.source==t)||new X2(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(X3));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=XZ.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 X2(e.source,0):e)),e.effects))a.is(XG)&&(r=r&&r.setSelected(a.value,this.id));return i==this.active&&r==this.open?this:new XX(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?XK:XQ}}let XK={"aria-autocomplete":"list"},XQ={};function XJ(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let X0=[];function X1(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(XL);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 X2{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=X1(e,t),i=this;for(let t of((8&n||16&n&&this.touches(e))&&(i=new X2(i.source,0)),4&n&&0==i.state&&(i=new X2(this.source,1)),i=i.updateFor(e,n),e.effects))if(t.is(Xz))i=new X2(i.source,1,t.value);else if(t.is(XF))i=new X2(i.source,0);else if(t.is(X3))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(XP(e.state))}}class X5 extends X2{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=XP(e.state);if(a>o||!i||2&t&&(XP(e.startState)==this.from||a<this.limit))return new X2(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):XE(e,!0).test(r)}(i.validFor,e.state,r,o)?i.update&&(i=i.update(i,r,o,new XD(e.state,a,!1)))?new X5(this.source,this.explicit,s,i,i.from,null!=(n=i.to)?n:XP(e.state)):new X2(this.source,1,this.explicit):new X5(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 X5(this.source,this.explicit,e.mapPos(this.limit),t,e.mapPos(this.from),e.mapPos(this.to,1)):new X2(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}let X3=jI.define({map:(e,t)=>e.map(e=>e.map(t))}),X4=jc.define({create:()=>XX.start(),update:(e,t)=>e.update(t),provide:e=>[Us.from(e,e=>e.tooltip),Gv.contentAttributes.from(e,e=>e.attrs)]});function X6(e,t){let n=t.completion.apply||t.completion.label,i=e.state.field(X4).active.find(e=>e.source==t.source);return i instanceof X5&&("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:jt.cursor(s.from+o+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}(e.state,n,i.from,i.to),annotations:XL.of(t.completion)}):n(e,t.completion,i.from,i.to),!0)}let X8=e=>new Xq(e,X4,X6);function X9(e,t="option"){return n=>{let i=n.state.field(X4,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(XH).interactionDelay)return!1;let r=1,o;"page"==t&&(o=Up(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:XG.of(s)}),!0}}let X7=e=>!!e.state.field(X4,!1)&&(e.dispatch({effects:Xz.of(!0)}),!0);class Ke{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}let Kt=WS.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(X4).active))t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(X4),n=e.state.facet(XH);if(!e.selectionSet&&!e.docChanged&&e.startState.field(X4)==t)return;let i=e.transactions.some(e=>{let t=X1(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){Wy(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(Xz)))&&(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(X4);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(XH).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=XP(t),i=new XD(t,n,e.explicit,this.view),r=new Ke(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:XF.of(null)}),Wy(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(XH).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(XH),i=this.view.state.field(X4);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=XP(o.updates.length?o.updates[0].startState:this.view.state),r=Math.min(i,o.done.from+ +!o.active.explicit),a=new X5(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 X2(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:X3.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(X4,!1);if(t&&t.tooltip&&this.view.state.facet(XH).closeOnBlur){let n=t.open&&Up(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:XF.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:Xz.of(!1)}),20),this.composing=0}}}),Kn="object"==typeof navigator&&/Win/.test(navigator.platform),Ki=jd.highest(Gv.domEventHandlers({keydown(e,t){let n=t.state.field(X4,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(Kn&&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&&X6(t,i),!1}})),Kr=Gv.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"}}}),Ko={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ka=jI.define({map(e,t){let n=t.mapPos(e,-1,V1.TrackAfter);return null==n?void 0:n}}),Ks=new class extends jF{};Ks.startSide=1,Ks.endSide=-1;let Kl=jc.define({create:()=>j$.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(Ka)&&(e=e.update({add:[Ks.range(n.value,n.value+1)]}));return e}}),Ku="()[]{}<>\xab\xbb\xbb\xab[]{}";function Kc(e){for(let t=0;t<Ku.length;t+=2)if(Ku.charCodeAt(t)==e)return Ku.charAt(t+1);return VQ(e<128?e:e+1)}function Kh(e,t){return e.languageDataAt("closeBrackets",t)[0]||Ko}let Kd="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),Kp=Gv.inputHandler.of((e,t,n,i)=>{if((Kd?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||2==i.length&&1==VJ(VK(i,0))||t!=r.from||n!=r.to)return!1;let o=function(e,t){let n=Kh(e,e.selection.main.head),i=n.brackets||Ko.brackets;for(let r of i){let o=Kc(VK(r,0));if(t==r)return o==r?function(e,t,n,i){let r=i.stringPrefixes||Ko.stringPrefixes,o=null,a=e.changeByRange(i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:Ka.of(i.to+t.length),range:jt.range(i.anchor+t.length,i.head+t.length)};let a=i.head,s=Km(e.doc,a),l;if(s==t){if(Kv(e,a))return{changes:{insert:t+t,from:a},effects:Ka.of(a+t.length),range:jt.cursor(a+t.length)};else if(Kg(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:jt.cursor(a+i.length)}}}else if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(l=Ky(e,a-2*t.length,r))>-1&&Kv(e,l))return{changes:{insert:t+t+t+t,from:a},effects:Ka.of(a+t.length),range:jt.cursor(a+t.length)};else if(e.charCategorizer(a)(s)!=jL.Word&&Ky(e,a,r)>-1&&!function(e,t,n,i){let r=UQ(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:Ka.of(a+t.length),range:jt.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:Ka.of(o.to+t.length),range:jt.range(o.anchor+t.length,o.head+t.length)};let a=Km(e.doc,o.head);return!a||/\s/.test(a)||i.indexOf(a)>-1?{changes:{insert:t+n,from:o.head},effects:Ka.of(o.head+t.length),range:jt.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,r,o,n.before||Ko.before);if(t==o&&Kg(e,e.selection.main.from))return function(e,t){let n=null,i=e.changeByRange(i=>i.empty&&Km(e.doc,i.head)==t?{changes:{from:i.head,to:i.head+t.length,insert:t},range:jt.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)}),Kf=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Kh(e,e.selection.main.head).brackets||Ko.brackets,i=null,r=e.changeByRange(t=>{if(t.empty){var r,o;let i,a=(r=e.doc,o=t.head,VJ(VK(i=r.sliceString(o-2,o),0))==i.length?i:i.slice(1));for(let i of n)if(i==a&&Km(e.doc,t.head)==Kc(VK(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:jt.cursor(t.head-i.length)}}return{range:i=t}});return i||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function Kg(e,t){let n=!1;return e.field(Kl).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function Km(e,t){let n=e.sliceString(t,t+2);return n.slice(0,VJ(VK(n,0)))}function Kv(e,t){let n=UQ(e).resolveInner(t+1);return n.parent&&n.from==t}function Ky(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=jL.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))!=jL.Word)return n}return -1}let Kx=[{key:"Ctrl-Space",run:X7},{mac:"Alt-`",run:X7},{mac:"Alt-i",run:X7},{key:"Escape",run:e=>{let t=e.state.field(X4,!1);return!!t&&!!t.active.some(e=>0!=e.state)&&(e.dispatch({effects:XF.of(null)}),!0)}},{key:"ArrowDown",run:X9(!0)},{key:"ArrowUp",run:X9(!1)},{key:"PageDown",run:X9(!0,"page")},{key:"PageUp",run:X9(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(X4,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(XH).interactionDelay)&&X6(e,t.open.options[t.open.selected])}}],Kb=jd.highest(GM.computeN([XH],e=>e.facet(XH).defaultKeymap?[Kx]:[]));var Kw=function(e){let t;void 0===e&&(e={});var n=e.crosshairCursor,i=[];!1!==e.closeBracketsKeymap&&(i=i.concat(Kf)),!1!==e.defaultKeymap&&(i=i.concat(Zj)),!1!==e.searchKeymap&&(i=i.concat(X_)),!1!==e.historyKeymap&&(i=i.concat(YJ)),!1!==e.foldKeymap&&(i=i.concat(qS)),!1!==e.completionKeymap&&(i=i.concat(Kx)),!1!==e.lintKeymap&&(i=i.concat(Ya));var r=[];return!1!==e.lineNumbers&&r.push(function(e={}){return[UV.of(e),UO(),UW]}()),!1!==e.highlightActiveLineGutter&&r.push(UU),!1!==e.highlightSpecialChars&&r.push(function(e={}){return[GQ.of(e),GJ||(GJ=WS.fromClass(class{constructor(e){this.view=e,this.decorations=HM.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(GQ)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new Gq({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,o=VK(t[0],0);if(9==o){let e=r.lineAt(i),t=n.state.tabSize,o=j2(e.text,t,i-e.from);return HM.replace({widget:new G1((t-o%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=HM.replace({widget:new G0(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(GQ);e.startState.facet(GQ)!=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[YF,Yz.of(e),Gv.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?Yj:"historyRedo"==e.inputType?YH:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&r.push(function(e={}){let t={...qI,...e},n=new qD(t,!0),i=new qD(t,!1),r=WS.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(U8)!=e.state.facet(U8)||e.startState.field(qv,!1)!=e.state.field(qv,!1)||UQ(e.startState)!=UQ(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new jG;for(let r of e.viewportLineBlocks){let o=qx(e.state,r.from,r.to)?i:qd(e.state,r.from,r.to)?n:null;o&&t.add(r.from,r.from,o)}return t.finish()}}),{domEventHandlers:o}=t;return[r,UI({class:"cm-foldGutter",markers(e){var t;return(null==(t=e.plugin(r))?void 0:t.markers)||j$.empty},initialSpacer:()=>new qD(t,!1),domEventHandlers:{...o,click:(e,t,n)=>{if(o.click&&o.click(e,t,n))return!0;let i=qx(e.state,t.from,t.to);if(i)return e.dispatch({effects:qg.of(i)}),!0;let r=qd(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:qf.of(r)}),!0)}}}),qM()]}()),!1!==e.drawSelection&&r.push(function(e={}){return[GB.of(e),GF,Gj,GH,Wp.of(!0)]}()),!1!==e.dropCursor&&r.push([G$,GG]),!1!==e.allowMultipleSelections&&r.push(jB.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&r.push(jB.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=qi(a,t.from);if(null==n)continue;let i=/^\s*/.exec(t.text)[0],r=qn(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(qN(qz,{fallback:!0})),!1!==e.bracketMatching&&r.push(function(e={}){return[qj.of(e),qU]}()),!1!==e.closeBrackets&&r.push([Kp,Kl]),!1!==e.autocompletion&&r.push(function(e={}){return[Ki,X4,XH.of(e),Kt,Kb,Kr]}()),!1!==e.rectangularSelection&&r.push((t=e=>e.altKey&&0==e.button,Gv.mouseSelectionStyle.of((e,n)=>{let i,r;return t(n)?(i=G4(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=G4(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(jt.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=j5(n.text,a,e.tabSize,!0);if(i<0)o.push(jt.cursor(n.to));else{let t=j5(n.text,s,e.tabSize);o.push(jt.range(n.from+i,n.from+t))}}}return o}(e.state,i,a);return s.length?o?jt.create(s.concat(r.ranges)):jt.create(s):r}}:null):null}))),!1!==(void 0!==n&&n)&&r.push(function(e={}){let[t,n]=G6[e.key||"Alt"],i=WS.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,Gv.contentAttributes.of(e=>{var t;return(null==(t=e.plugin(i))?void 0:t.isDown)?G8:null})]}()),!1!==e.highlightActiveLine&&r.push(G5),!1!==e.highlightSelectionMatches&&r.push([Z3,Z5]),e.tabSize&&"number"==typeof e.tabSize&&r.push(qe.of(" ".repeat(e.tabSize))),r.concat([GM.of(i.flat())]).filter(Boolean)};let KS="#e06c75",K_="#abb2bf",KC="#7d8799",KM="#d19a66",KA="#2c313a",Kk="#282c34",KT="#353a42",KI="#528bff",KD=[Gv.theme({"&":{color:K_,backgroundColor:Kk},".cm-content":{caretColor:KI},".cm-cursor, .cm-dropCursor":{borderLeftColor:KI},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:K_},".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:Kk,color:KC,border:"none"},".cm-activeLineGutter":{backgroundColor:KA},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:KT},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:KT,borderBottomColor:KT},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:KA,color:K_}}},{dark:!0}),qN(qR.define([{tag:VI.keyword,color:"#c678dd"},{tag:[VI.name,VI.deleted,VI.character,VI.propertyName,VI.macroName],color:KS},{tag:[VI.function(VI.variableName),VI.labelName],color:"#61afef"},{tag:[VI.color,VI.constant(VI.name),VI.standard(VI.name)],color:KM},{tag:[VI.definition(VI.name),VI.separator],color:K_},{tag:[VI.typeName,VI.className,VI.number,VI.changed,VI.annotation,VI.modifier,VI.self,VI.namespace],color:"#e5c07b"},{tag:[VI.operator,VI.operatorKeyword,VI.url,VI.escape,VI.regexp,VI.link,VI.special(VI.string)],color:"#56b6c2"},{tag:[VI.meta,VI.comment],color:KC},{tag:VI.strong,fontWeight:"bold"},{tag:VI.emphasis,fontStyle:"italic"},{tag:VI.strikethrough,textDecoration:"line-through"},{tag:VI.link,color:KC,textDecoration:"underline"},{tag:VI.heading,fontWeight:"bold",color:KS},{tag:[VI.atom,VI.bool,VI.special(VI.variableName)],color:KM},{tag:[VI.processingInstruction,VI.string,VI.inserted],color:"#98c379"},{tag:VI.invalid,color:"#ffffff"}]))];var KO=Gv.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),KR=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(GM.of([ZH])),h&&("boolean"==typeof h?d.unshift(Kw()):d.unshift(Kw(h))),u&&d.unshift((t=WS.fromClass(class{constructor(e){this.view=e,this.placeholder=u?HM.set([HM.widget({widget:new G3(u),side:1}).range(0)]):HM.none}get decorations(){return this.view.state.doc.length?HM.none:this.placeholder}},{decorations:e=>e.decorations}),"string"==typeof u?[t,Gv.contentAttributes.of({"aria-placeholder":u})]:t)),s){case"light":d.push(KO);break;case"dark":d.push(KD);break;case"none":break;default:d.push(s)}return!1===(void 0===r||r)&&d.push(Gv.editable.of(!1)),void 0!==o&&o&&d.push(jB.readOnly.of(!0)),[...d]};class KP{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 KE{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 KL=null,KN=jA.define(),KB=[],Kz=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],KF=(0,ew.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,_,C,M,A,k,T,I,D,O,R,P,E,L,N,B,z,F,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,eS=e.root,e_=e.initialState,eC=(0,YT.A)(e,Kz),eM=(0,ew.useRef)(null),eA=(i=(n={root:eS,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:e_}).value,r=n.selection,o=n.onChange,a=n.onStatistics,s=n.onCreateEditor,l=n.onUpdate,c=void 0===(u=n.extensions)?KB: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,M=void 0===(C=n.maxWidth)?null:C,k=void 0===(A=n.placeholder)?"":A,I=void 0===(T=n.editable)||T,O=void 0!==(D=n.readOnly)&&D,P=void 0===(R=n.indentWithTab)||R,L=void 0===(E=n.basicSetup)||E,N=n.root,B=n.initialState,F=(z=(0,ew.useState)())[0],V=z[1],H=(j=(0,ew.useState)())[0],W=j[1],G=($=(0,ew.useState)())[0],U=$[1],q=(0,ew.useState)(()=>({current:null}))[0],Y=(0,ew.useState)(()=>({current:null}))[0],Z=Gv.theme({"&":{height:g,minHeight:v,maxHeight:x,width:w,minWidth:_,maxWidth:M},"& .cm-scroller":{height:"100% !important"}}),X=[Gv.updateListener.of(e=>{e.docChanged&&"function"==typeof o&&!e.transactions.some(e=>e.annotation(KN))&&(q.current?q.current.reset():(q.current=new KP(()=>{if(Y.current){var e=Y.current;Y.current=null,e()}q.current=null},200),("u"<typeof window?new KE:(!KL&&(KL=new KE),KL)).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,...KR({theme:p,editable:I,readOnly:O,placeholder:k,indentWithTab:P,basicSetup:L})],l&&"function"==typeof l&&X.push(Gv.updateListener.of(l)),X=X.concat(c),(0,ew.useLayoutEffect)(()=>{if(F&&!G){var e={doc:i,selection:r,extensions:X},t=B?jB.fromJSON(B.json,e,B.fields):jB.create(e);if(U(t),!H){var n=new Gv({state:t,parent:F,root:N});W(n),s&&s(n,t)}}return()=>{H&&(U(void 0),W(void 0))}},[F,G]),(0,ew.useEffect)(()=>{n.container&&V(n.container)},[n.container]),(0,ew.useEffect)(()=>()=>{H&&(H.destroy(),W(void 0)),q.current&&(q.current.cancel(),q.current=null)},[H]),(0,ew.useEffect)(()=>{h&&H&&H.focus()},[h,H]),(0,ew.useEffect)(()=>{H&&H.dispatch({effects:jI.reconfigure.of(X)})},[p,c,g,v,x,w,_,M,k,I,O,P,L,o,l]),(0,ew.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:[KN.of(!0)]})};t?Y.current=n:n()}}},[i,H]),{state:G,setState:U,view:H,setView:W,container:F,setContainer:V}),ek=eA.state,eT=eA.view,eI=eA.container,eD=eA.setContainer;(0,ew.useImperativeHandle)(t,()=>({editor:eM.current,state:ek,view:eT}),[eM,eI,ek,eT]);var eO=(0,ew.useCallback)(e=>{eM.current=e,eD(e)},[eD]);if("string"!=typeof J)throw Error("value must be typeof string but got "+typeof J);return(0,eb.jsx)("div",(0,oM.A)({ref:eO,className:("string"==typeof el?"cm-theme-"+el:"cm-theme")+(K?" "+K:"")},eC))});function KV(e){let t=(0,ub.A)(),n="dark"===t.palette.mode,[i,r]=(0,ew.useState)(()=>JSON.stringify(e.value,null,2)),[o,a]=(0,ew.useState)(i);return(0,eb.jsx)(KF,{...e,style:{border:`1px solid ${t.palette.divider}`},theme:n?"dark":"light",extensions:[new U9(q5),function(e,t={}){return[Yl.of({source:e,config:t}),Ys,YA]}(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[Yk.of(e),Yw,Yb,YC,Y_]}()],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})}KF.displayName="CodeMirror";var Kj=n(10740);let KH=e=>{let{mode:t,url:n,name:i,newTabOpen:r,renderVariables:o,tooltip:a}=e;return(0,eb.jsxs)(eH.A,{direction:"column",gap:2,flexGrow:1,children:[(0,eb.jsx)(gn,{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)(eH.A,{gap:1,direction:"inline"===t?"row":"column",children:[i&&(0,eb.jsx)(gn,{sx:{flexGrow:"1"},label:i.label,onChange:i?.onChange,placeholder:i?.placeholder,value:i?.value}),a&&(0,eb.jsx)(gn,{sx:{flexGrow:"1"},label:a.label,onChange:a?.onChange,placeholder:a?.placeholder,value:a?.value})]}),(0,eb.jsxs)(eH.A,{direction:"row",gap:1,children:[o&&(0,eb.jsx)(Kj.A,{label:o.label,control:(0,eb.jsx)(pU,{checked:o.value,onChange:e=>{o?.onChange(e.target.checked)}})}),(0,eb.jsx)(Kj.A,{label:r.label,control:(0,eb.jsx)(pU,{checked:r.value,onChange:e=>{r?.onChange(e.target.checked)}})})]})]})},KW=[{id:"value",label:"Value"},{id:"percentage",label:"Percentage"}];function K$({disablePercentageMode:e,onChange:t,value:n="value"}){return(0,eb.jsx)(gE,{label:"Mode",control:(0,eb.jsx)(gF,{value:KW.find(e=>e.id===n),options:KW,getOptionLabel:e=>e.label,getOptionDisabled:t=>"percentage"===t.id&&e,onChange:(e,{id:n})=>{t(n)},disableClearable:!0})})}var KG=n(69402);function KU(e){return(0,eP.Ay)("MuiSkeleton",e)}(0,eR.A)("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);let Kq=(0,KG.keyframes)`
6
+ 0% {
7
+ opacity: 1;
8
+ }
9
+
10
+ 50% {
11
+ opacity: 0.4;
12
+ }
13
+
14
+ 100% {
15
+ opacity: 1;
16
+ }
17
+ `,KY=(0,KG.keyframes)`
18
+ 0% {
19
+ transform: translateX(-100%);
20
+ }
21
+
22
+ 50% {
23
+ /* +0.5s of delay between each loop */
24
+ transform: translateX(100%);
25
+ }
26
+
27
+ 100% {
28
+ transform: translateX(100%);
29
+ }
30
+ `,KZ="string"!=typeof Kq?(0,KG.css)`
31
+ animation: ${Kq} 2s ease-in-out 0.5s infinite;
32
+ `:null,KX="string"!=typeof KY?(0,KG.css)`
33
+ &::after {
34
+ animation: ${KY} 2s linear 0.5s infinite;
35
+ }
36
+ `:null,KK=(0,eT.A)("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],!1!==n.animation&&t[n.animation],n.hasChildren&&t.withChildren,n.hasChildren&&!n.width&&t.fitContent,n.hasChildren&&!n.height&&t.heightAuto]}})((0,eI.A)(({theme:e})=>{let t=String(e.shape.borderRadius).match(/[\d.\-+]*\s*(.*)/)[1]||"px",n=parseFloat(e.shape.borderRadius);return{display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:(0,eM.X4)(e.palette.text.primary,"light"===e.palette.mode?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${n}${t}/${Math.round(n/.6*10)/10}${t}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:({ownerState:e})=>e.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:e})=>e.hasChildren&&!e.width,style:{maxWidth:"fit-content"}},{props:({ownerState:e})=>e.hasChildren&&!e.height,style:{height:"auto"}},{props:{animation:"pulse"},style:KZ||{animation:`${Kq} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient(
37
+ 90deg,
38
+ transparent,
39
+ ${(e.vars||e).palette.action.hover},
40
+ transparent
41
+ )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:KX||{"&::after":{animation:`${KY} 2s linear 0.5s infinite`}}}]}})),KQ=ew.forwardRef(function(e,t){let n=(0,eO.b)({props:e,name:"MuiSkeleton"}),{animation:i="pulse",className:r,component:o="span",height:a,style:s,variant:l="text",width:u,...c}=n,h={...n,animation:i,component:o,variant:l,hasChildren:!!c.children},d=(e=>{let{classes:t,variant:n,animation:i,hasChildren:r,width:o,height:a}=e;return(0,eC.A)({root:["root",n,i,r&&"withChildren",r&&!o&&"fitContent",r&&!a&&"heightAuto"]},KU,t)})(h);return(0,eb.jsx)(KK,{as:o,ref:t,className:(0,e_.A)(d.root,r),ownerState:h,...c,style:{width:u,height:a,...s}})});function KJ(e){let{message:t}=e;return(0,eb.jsx)(eH.A,{sx:{height:"100%",alignItems:"center",justifyContent:"center"},children:(0,eb.jsx)(fO.A,{children:t})})}function K0(e){let{resource:t}=e;return(0,eb.jsx)(KJ,{message:`No ${t}`})}function K1(e){let{variant:t="rounded"}=e;return(0,eb.jsx)(eH.A,{sx:{height:"100%",alignItems:"center",justifyContent:"center",px:1},children:(0,eb.jsx)(KQ,{variant:t,width:"100%",height:"30%","aria-label":"Loading..."})})}let K2=[{id:"asc",label:"Ascending"},{id:"desc",label:"Descending"}];function K5({onChange:e,value:t="desc"}){return(0,eb.jsx)(gE,{label:"Sort",control:(0,eb.jsx)(gF,{value:K2.find(e=>e.id===t),options:K2,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function K3({onChange:e,value:t,...n}){let i=t=>{e(t)};return(0,eb.jsxs)(eF,{"aria-label":"Sort",...n,children:[(0,eb.jsx)(eV.A,{onClick:()=>i(void 0),variant:void 0===t?"contained":"outlined",children:"None"}),(0,eb.jsx)(eV.A,{onClick:()=>i("asc"),variant:"asc"===t?"contained":"outlined",children:"Asc"}),(0,eb.jsx)(eV.A,{onClick:()=>i("desc"),variant:"desc"===t?"contained":"outlined",children:"Desc"})]})}var K4=n(61375),K6=n(31729);let K8=(0,n(68335).A)();var K9=n(86742),K7=n(86067);function Qe({inputRef:e,label:t,color:n,value:i,mode:r,onChange:o,onColorChange:a,onBlur:s,onDelete:l}){let[u,c]=(0,ew.useState)(0);return(0,eb.jsxs)(eH.A,{flex:1,direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,eb.jsx)(uy,{label:t,color:n,onColorChange:a}),(0,eb.jsx)(gI.A,{htmlFor:t,children:t}),(0,eb.jsx)(e$.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)(uw.A,{paddingX:1,children:"%"}):void 0}},u),(0,eb.jsx)(eW.A,{"aria-label":`delete threshold ${t}`,size:"small",onClick:l,children:(0,eb.jsx)(K7,{})})]})}function Qt({thresholds:e,onChange:t,hideDefault:n,disablePercentMode:i}){let{thresholds:{defaultColor:r,palette:o}}=ty(),a=e?.defaultColor??r,s=e?.steps,l=(0,ew.useRef)(null),u=(0,ew.useRef)(!1);(0,ew.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,uS.jM)(e,e=>{e.steps=n}))}};return(0,eb.jsxs)(gN,{title:"Thresholds",icon:(0,eb.jsx)(gO,{description:"Add threshold",children:(0,eb.jsx)(eW.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,uS.jM)(e,e=>{e.steps=[{value:10}]})):t((0,uS.jM)(e,e=>{let t=e.steps;if(t?.length){let e=t[t.length-1],n=o[t.length]??Qn();t.push({color:n,value:(e?.value??0)+10})}else t&&t.push({value:10})}))},children:(0,eb.jsx)(K9,{})})}),children:[(0,eb.jsx)(gE,{label:"Mode",description:"Percentage means thresholds relative to min & max",control:(0,eb.jsxs)(K4.A,{exclusive:!0,disabled:i,value:e?.mode??"absolute",onChange:(n,i)=>{let r="percent"===i?"percent":void 0;void 0!==e?t((0,uS.jM)(e,e=>{e.mode=r})):t({mode:r})},sx:{height:"36px",marginLeft:"auto"},children:[(0,eb.jsx)(K6.A,{"aria-label":"absolute",value:"absolute",sx:{fontWeight:500},children:"Absolute"}),(0,eb.jsx)(K6.A,{"aria-label":"percent",value:"percent",sx:{fontWeight:500},children:"Percent"})]})}),s&&s.map((n,i)=>(0,eb.jsx)(Qe,{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,uS.jM)(e,e=>{if(void 0!==e.steps){let t=e.steps[i];t&&(t.color=n)}}))},onChange:n=>{void 0!==e&&t((0,uS.jM)(e,e=>{let t=e.steps?.[i];t&&(t.value=Number(n.target.value))}))},onDelete:()=>{void 0!==e&&t((0,uS.jM)(e,e=>{e.steps&&e.steps.splice(i,1)}))},onBlur:c},i)).reverse(),!n&&(0,eb.jsxs)(K8,{flex:1,direction:"row",alignItems:"center",spacing:1,children:[(0,eb.jsx)(uy,{label:"default",color:a,onColorChange:n=>{void 0!==e?t((0,uS.jM)(e,e=>{e.defaultColor=n})):t({defaultColor:n})}}),(0,eb.jsx)(fO.A,{children:"Default"})]})]})}let Qn=()=>"#"+Math.floor(0x1000000*Math.random()).toString(16).padStart(6,"0");var Qi=n(24300),Qr=n(26684),Qo=n(51327),Qa=n(87169);function Qs({props:e,name:t}){return(0,Qo.A)({props:e,name:t,defaultTheme:Qa.A,themeId:mW.A})}let Ql=["localeText"],Qu=ew.createContext(null),Qc=function(e){let{localeText:t}=e,n=(0,YT.A)(e,Ql),{utils:i,localeText:r}=ew.useContext(Qu)??{utils:void 0,localeText:void 0},{children:o,dateAdapter:a,dateFormats:s,dateLibInstance:l,adapterLocale:u,localeText:c}=Qs({props:n,name:"MuiLocalizationProvider"}),h=ew.useMemo(()=>(0,oM.A)({},c,r,t),[c,r,t]),d=ew.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(`
42
+ `));return e},[a,u,s,l,i]),p=ew.useMemo(()=>d?{minDate:d.date("1900-01-01T00:00:00.000"),maxDate:d.date("2099-12-31T00:00:00.000")}:null,[d]),f=ew.useMemo(()=>({utils:d,defaultDates:p,localeText:h}),[p,d,h]);return(0,eb.jsx)(Qu.Provider,{value:f,children:o})};var Qh=n(62688),Qd=n.n(Qh);let Qp={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,oM.A)({},Qp);let Qf=()=>{let e=ew.useContext(Qu);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=ew.useMemo(()=>(0,oM.A)({},Qp,e.localeText),[e.localeText]);return ew.useMemo(()=>(0,oM.A)({},e,{localeText:t}),[e,t])},Qg=e=>{let t=Qf().utils,n=ew.useRef(void 0);return void 0===n.current&&(n.current=t.date(void 0,e)),n.current},Qm=(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))},Qv=({date:e,disableFuture:t,disablePast:n,maxDate:i,minDate:r,isDateDisabled:o,utils:a,timezone:s})=>{let l=Qm(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},Qy=(e,t,n)=>null!=t&&e.isValid(t)?t:n,Qx=(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},Qb=(e,t,n)=>"date"===n?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),Qw=(e,t)=>{let n=e.setHours(e.date(),"am"===t?2:14);return e.format(n,"meridiem")},QS=["year","month","day"],Q_=e=>QS.includes(e);var QC=n(33868),QM=n(87034),QA=n(22857);let Qk=(0,pE.A)((0,eb.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),QT=(0,pE.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"),QI=(0,pE.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,pE.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,pE.A)((0,eb.jsxs)(ew.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 QD=(0,pE.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"),QO=(0,pE.A)((0,eb.jsxs)(ew.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"),QR=(0,pE.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 QP(e){return(0,eP.Ay)("MuiDateTimePickerTabs",e)}(0,eR.A)("MuiDateTimePickerTabs",["root"]);let QE=(0,eT.A)(QM.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}`,[`& .${QA.A.indicator}`]:{bottom:"auto",top:0}}})),QL=function(e){let t=Qs({props:e,name:"MuiDateTimePickerTabs"}),{dateIcon:n=(0,eb.jsx)(QD,{}),onViewChange:i,timeIcon:r=(0,eb.jsx)(QO,{}),view:o,hidden:a="u"<typeof window||window.innerHeight<667,className:s,sx:l}=t,u=Qf().localeText,c=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"]},QP,t)})(t);return a?null:(0,eb.jsxs)(QE,{ownerState:t,variant:"fullWidth",value:Q_(o)?"date":"time",onChange:(e,t)=>{i("date"===t?"day":"hours")},className:(0,e_.A)(s,c.root),sx:l,children:[(0,eb.jsx)(QC.A,{value:"date","aria-label":u.dateTableLabel,icon:(0,eb.jsx)(ew.Fragment,{children:n})}),(0,eb.jsx)(QC.A,{value:"time","aria-label":u.timeTableLabel,icon:(0,eb.jsx)(ew.Fragment,{children:r})})]})};function QN(e){return(0,eP.Ay)("MuiPickersToolbarText",e)}let QB=(0,eR.A)("MuiPickersToolbarText",["root","selected"]),Qz=["className","selected","value"],QF=(0,eT.A)(fO.A,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${QB.selected}`]:t.selected}]})(({theme:e})=>({transition:e.transitions.create("color"),color:(e.vars||e).palette.text.secondary,[`&.${QB.selected}`]:{color:(e.vars||e).palette.text.primary}})),QV=ew.forwardRef(function(e,t){let n=Qs({props:e,name:"MuiPickersToolbarText"}),{className:i,value:r}=n,o=(0,YT.A)(n,Qz),a=(e=>{let{classes:t,selected:n}=e;return(0,eC.A)({root:["root",n&&"selected"]},QN,t)})(n);return(0,eb.jsx)(QF,(0,oM.A)({ref:t,className:(0,e_.A)(a.root,i),component:"span"},o,{children:r}))});function Qj(e){return(0,eP.Ay)("MuiPickersToolbar",e)}let QH=(0,eR.A)("MuiPickersToolbar",["root","content"]),QW=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],Q$=(0,eT.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"}}]})),QG=(0,eT.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"}}]}),QU=ew.forwardRef(function(e,t){let n=Qs({props:e,name:"MuiPickersToolbar"}),{children:i,className:r,toolbarTitle:o,hidden:a,titleId:s}=n,l=(0,YT.A)(n,QW),u=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"],content:["content"]},Qj,t)})(n);return a?null:(0,eb.jsxs)(Q$,(0,oM.A)({ref:t,className:(0,e_.A)(u.root,r),ownerState:n},l,{children:[(0,eb.jsx)(fO.A,{color:"text.secondary",variant:"overline",id:s,children:o}),(0,eb.jsx)(QG,{className:u.content,ownerState:n,children:i})]}))}),Qq=["align","className","selected","typographyClassName","value","variant","width"],QY=(0,eT.A)(eV.A,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,minWidth:16,textTransform:"none"}),QZ=ew.forwardRef(function(e,t){let n=Qs({props:e,name:"MuiPickersToolbarButton"}),{align:i,className:r,selected:o,typographyClassName:a,value:s,variant:l,width:u}=n,c=(0,YT.A)(n,Qq),h=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"]},Qj,t)})(n);return(0,eb.jsx)(QY,(0,oM.A)({variant:"text",ref:t,className:(0,e_.A)(h.root,r)},u?{sx:{width:u}}:{},c,{children:(0,eb.jsx)(QV,{align:i,className:a,variant:l,value:s,selected:o})}))});function QX(e){return(0,eP.Ay)("MuiDateTimePickerToolbar",e)}let QK=(0,eR.A)("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),QQ=["hours","minutes","seconds"],QJ=e=>QQ.includes(e),Q0=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?"am"===t?e-12:e+12:e,Q1=(e,t)=>3600*t.getHours(e)+60*t.getMinutes(e)+t.getSeconds(e),Q2=(e,t)=>(n,i)=>e?t.isAfter(n,i):Q1(n,t)>Q1(i,t);function Q5(e,t,n,i){let r=Qf().utils;return{meridiemMode:e?r.getHours(e)>=12?"pm":"am":null,handleMeridiemChange:ew.useCallback(o=>{var a;let s;n(null==e?null:(a=!!t,s=Q0(r.getHours(e),o,a),r.setHours(e,s)),i??"partial")},[t,e,n,i,r])}}let Q3=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],Q4=(0,eT.A)(QU,{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}`,[`& .${QH.content} .${QB.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}}]})),Q6=(0,eT.A)("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(e,t)=>t.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),Q8=(0,eT.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"}}]}),Q9=(0,eT.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}}]}),Q7=(0,eT.A)(QV,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),Je=(0,eT.A)("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${QK.ampmLabel}`]:t.ampmLabel},{[`&.${QK.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${QK.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function Jt(e){let t=Qs({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,YT.A)(t,Q3),y=(0,p2.I)(),x=(0,oM.A)({},t,{isRtl:y}),b=Qf().utils,{meridiemMode:w,handleMeridiemChange:S}=Q5(r,n,o),_=!!(n&&!i),C="desktop"===f,M=Qf().localeText,A=(e=>{let{classes:t,isLandscape:n,isRtl:i}=e;return(0,eC.A)({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",i&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",i&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},QX,t)})(x),k=g??M.dateTimePickerToolbarTitle,T=ew.useMemo(()=>r?u?b.formatByString(r,u):b.format(r,"shortDate"):c,[r,u,c,b]);return(0,eb.jsxs)(Q4,(0,oM.A)({isLandscape:s,className:(0,e_.A)(A.root,m),toolbarTitle:k},v,{ownerState:x,children:[(0,eb.jsxs)(Q6,{className:A.dateContainer,ownerState:x,children:[h.includes("year")&&(0,eb.jsx)(QZ,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:"year"===a,value:r?b.format(r,"year"):"–"}),h.includes("day")&&(0,eb.jsx)(QZ,{tabIndex:-1,variant:C?"h5":"h4",onClick:()=>l("day"),selected:"day"===a,value:T})]}),(0,eb.jsxs)(Q8,{className:A.timeContainer,ownerState:x,children:[(0,eb.jsxs)(Q9,{className:A.timeDigitsContainer,ownerState:x,children:[h.includes("hours")&&(0,eb.jsxs)(ew.Fragment,{children:[(0,eb.jsx)(QZ,{variant:C?"h5":"h3",width:C&&!s?48:void 0,onClick:()=>l("hours"),selected:"hours"===a,value:r?n?b.format(r,"hours12h"):b.format(r,"hours24h"):"--"}),(0,eb.jsx)(Q7,{variant:C?"h5":"h3",value:":",className:A.separator,ownerState:x}),(0,eb.jsx)(QZ,{variant:C?"h5":"h3",width:C&&!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)(ew.Fragment,{children:[(0,eb.jsx)(Q7,{variant:C?"h5":"h3",value:":",className:A.separator,ownerState:x}),(0,eb.jsx)(QZ,{variant:C?"h5":"h3",width:C&&!s?48:void 0,onClick:()=>l("seconds"),selected:"seconds"===a,value:r?b.format(r,"seconds"):"--"})]})]}),_&&!C&&(0,eb.jsxs)(Je,{className:A.ampmSelection,ownerState:x,children:[(0,eb.jsx)(QZ,{variant:"subtitle2",selected:"am"===w,typographyClassName:A.ampmLabel,value:Qw(b,"am"),onClick:p?void 0:()=>S("am"),disabled:d}),(0,eb.jsx)(QZ,{variant:"subtitle2",selected:"pm"===w,typographyClassName:A.ampmLabel,value:Qw(b,"pm"),onClick:p?void 0:()=>S("pm"),disabled:d})]}),n&&C&&(0,eb.jsx)(QZ,{variant:"h5",onClick:()=>l("meridiem"),selected:"meridiem"===a,value:r&&w?Qw(b,w):"--",width:48})]})]}))}var Jn=n(54553),Ji=n(77893);function Jr(e){return(0,eP.Ay)("MuiPickersArrowSwitcher",e)}(0,eR.A)("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);let Jo=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],Ja=["ownerState"],Js=["ownerState"],Jl=(0,eT.A)("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),Ju=(0,eT.A)("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),Jc=(0,eT.A)(eW.A,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),Jh=ew.forwardRef(function(e,t){let n=(0,p2.I)(),i=Qs({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,YT.A)(i,Jo),y=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},Jr,t)})(i),x=a?.previousIconButton??Jc,b=(0,Ji.A)({elementType:x,externalSlotProps:s?.previousIconButton,additionalProps:{size:"medium",title:g,"aria-label":g,disabled:d,edge:"end",onClick:f},ownerState:(0,oM.A)({},i,{hidden:p}),className:(0,e_.A)(y.button,y.previousIconButton)}),w=a?.nextIconButton??Jc,S=(0,Ji.A)({elementType:w,externalSlotProps:s?.nextIconButton,additionalProps:{size:"medium",title:h,"aria-label":h,disabled:l,edge:"start",onClick:c},ownerState:(0,oM.A)({},i,{hidden:u}),className:(0,e_.A)(y.button,y.nextIconButton)}),_=a?.leftArrowIcon??QT,C=(0,Ji.A)({elementType:_,externalSlotProps:s?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:i,className:y.leftArrowIcon}),M=(0,YT.A)(C,Ja),A=a?.rightArrowIcon??QI,k=(0,Ji.A)({elementType:A,externalSlotProps:s?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:i,className:y.rightArrowIcon}),T=(0,YT.A)(k,Js);return(0,eb.jsxs)(Jl,(0,oM.A)({ref:t,className:(0,e_.A)(y.root,o),ownerState:i},v,{children:[(0,eb.jsx)(x,(0,oM.A)({},b,{children:n?(0,eb.jsx)(A,(0,oM.A)({},T)):(0,eb.jsx)(_,(0,oM.A)({},M))})),r?(0,eb.jsx)(fO.A,{variant:"subtitle1",component:"span",id:m,children:r}):(0,eb.jsx)(Ju,{className:y.spacer,ownerState:i}),(0,eb.jsx)(w,(0,oM.A)({},S,{children:n?(0,eb.jsx)(_,(0,oM.A)({},M)):(0,eb.jsx)(A,(0,oM.A)({},T))}))]}))});var Jd=n(83183),Jp=n(89369);function Jf({onChange:e,onViewChange:t,openTo:n,view:i,views:r,autoFocus:o,focusedView:a,onFocusedViewChange:s}){let l=ew.useRef(n),u=ew.useRef(r),c=ew.useRef(r.includes(n)?n:r[0]),[h,d]=(0,Jp.A)({name:"useViews",state:"view",controlled:i,default:c.current}),p=ew.useRef(o?h:null),[f,g]=(0,Jp.A)({name:"useViews",state:"focusedView",controlled:a,default:p.current});ew.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,Jd.A)((e,t)=>{t?g(e):g(t=>e===t?null:t),s?.(e,t)}),b=(0,Jd.A)(e=>{x(e,!0),e!==h&&(d(e),t&&t(e))}),w=(0,Jd.A)(()=>{y&&b(y)}),S=(0,Jd.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 Jg=(0,eT.A)("div")({overflow:"hidden",width:320,maxHeight:336,display:"flex",flexDirection:"column",margin:"0 auto"});function Jm(e){return(0,eP.Ay)("MuiTimeClock",e)}function Jv(e){return(0,eP.Ay)("MuiClockPointer",e)}(0,eR.A)("MuiTimeClock",["root","arrowSwitcher"]),(0,eR.A)("MuiClockPointer",["root","thumb"]);let Jy=["className","hasSelected","isInner","type","viewValue"],Jx=(0,eT.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"])}}]})),Jb=(0,eT.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 Jw(e){let t,n=Qs({props:e,name:"MuiClockPointer"}),{className:i,isInner:r,type:o,viewValue:a}=n,s=(0,YT.A)(n,Jy),l=ew.useRef(o);ew.useEffect(()=>{l.current=o},[o]);let u=(0,oM.A)({},n,{shouldAnimate:l.current!==o}),c=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"],thumb:["thumb"]},Jv,t)})(u);return(0,eb.jsx)(Jx,(0,oM.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,e_.A)(c.root,i),ownerState:u},s,{children:(0,eb.jsx)(Jb,{ownerState:u,className:c.thumb})}))}let JS=110,J_=110,JC=JS,JM=0,JA=JC-JS,Jk=JM-J_,JT=(e,t,n)=>{let i=t-JS,r=n-J_,o=180/Math.PI*(Math.atan2(JA,Jk)-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 JI(e){return(0,eP.Ay)("MuiClock",e)}(0,eR.A)("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);let JD=(0,eT.A)("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)})),JO=(0,eT.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"}),JR=(0,eT.A)("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),JP=(0,eT.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"}}}]}),JE=(0,eT.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%)"})),JL=(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}}}]}),JN=(0,eT.A)(eW.A,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})(({theme:e})=>(0,oM.A)({},JL(e,"am"),{position:"absolute",left:8})),JB=(0,eT.A)(eW.A,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})(({theme:e})=>(0,oM.A)({},JL(e,"pm"),{position:"absolute",right:8})),Jz=(0,eT.A)(fO.A,{name:"MuiClock",slot:"meridiemText",overridesResolver:(e,t)=>t.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function JF(e){let t=Qs({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=Qf().utils,w=Qf().localeText,S=ew.useRef(!1),_=(e=>{let{classes:t,meridiemMode:n}=e;return(0,eC.A)({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton","am"===n&&"selected"],pmButton:["pmButton","pm"===n&&"selected"],meridiemText:["meridiemText"]},JI,t)})(t),C=l(f,p),M=!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}=JT(6*n,e,t);return i*n%60})(i,r,c):((e,t,n)=>{let{value:i,distance:r}=JT(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")},I=ew.useMemo(()=>"hours"===p||f%5==0,[p,f]),D="minutes"===p?c:1,O=ew.useRef(null);(0,mz.A)(()=>{r&&O.current.focus()},[r]);let R=e=>Math.max(g,Math.min(m,e)),P=e=>(e+(m+1))%(m+1);return(0,eb.jsxs)(JD,{className:(0,e_.A)(_.root,x),children:[(0,eb.jsxs)(JO,{className:_.clock,children:[(0,eb.jsx)(JP,{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}),!C&&(0,eb.jsxs)(ew.Fragment,{children:[(0,eb.jsx)(JE,{className:_.pin}),null!=a&&(0,eb.jsx)(Jw,{type:p,viewValue:f,isInner:M,hasSelected:I})]}),(0,eb.jsx)(JR,{"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(P(f+D),"partial"),e.preventDefault();break;case"ArrowDown":A(P(f-D),"partial"),e.preventDefault();break;case"PageUp":A(R(f+5),"partial"),e.preventDefault();break;case"PageDown":A(R(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)(ew.Fragment,{children:[(0,eb.jsx)(JN,{onClick:y?void 0:()=>s("am"),disabled:v||null===u,ownerState:t,className:_.amButton,title:Qw(b,"am"),children:(0,eb.jsx)(Jz,{variant:"caption",className:_.meridiemText,children:Qw(b,"am")})}),(0,eb.jsx)(JB,{disabled:v||null===u,onClick:y?void 0:()=>s("pm"),ownerState:t,className:_.pmButton,title:Qw(b,"pm"),children:(0,eb.jsx)(Jz,{variant:"caption",className:_.meridiemText,children:Qw(b,"pm")})})]})]})}function JV(e){return(0,eP.Ay)("MuiClockNumber",e)}let Jj=(0,eR.A)("MuiClockNumber",["root","selected","disabled"]),JH=["className","disabled","index","inner","label","selected"],JW=(0,eT.A)("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${Jj.disabled}`]:t.disabled},{[`&.${Jj.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},[`&.${Jj.selected}`]:{color:(e.vars||e).palette.primary.contrastText},[`&.${Jj.disabled}`]:{pointerEvents:"none",color:(e.vars||e).palette.text.disabled},variants:[{props:{inner:!0},style:(0,oM.A)({},e.typography.body2,{color:(e.vars||e).palette.text.secondary})}]}));function J$(e){let t=Qs({props:e,name:"MuiClockNumber"}),{className:n,disabled:i,index:r,inner:o,label:a,selected:s}=t,l=(0,YT.A)(t,JH),u=(e=>{let{classes:t,selected:n,disabled:i}=e;return(0,eC.A)({root:["root",n&&"selected",i&&"disabled"]},JV,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)(JW,(0,oM.A)({className:(0,e_.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 JG=({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)(J$,{label:o,id:s?r:void 0,index:a+1,inner:!1,disabled:n(e),selected:s,"aria-label":i(o)},e)})},JU=({timezone:e,value:t,defaultValue:n,referenceDate:i,onChange:r,valueManager:o})=>{let a,s=Qf().utils,l=ew.useRef(n),u=t??l.current??o.emptyValue,c=ew.useMemo(()=>o.getTimezone(s,u),[s,o,u]),h=(0,Jd.A)(e=>null==c?e:o.setTimezone(s,c,e));return a=e||c||(i?s.getTimezone(i):"default"),{value:ew.useMemo(()=>o.setTimezone(s,a,u),[o,s,a,u]),handleValueChange:(0,Jd.A)((e,...t)=>{let n=h(e);r?.(n,...t)}),timezone:a}},Jq=({name:e,timezone:t,value:n,defaultValue:i,referenceDate:r,onChange:o,valueManager:a})=>{let[s,l]=(0,Jp.A)({name:e,state:"value",controlled:n,default:i??a.emptyValue});return JU({timezone:t,value:s,defaultValue:void 0,referenceDate:r,onChange:(0,Jd.A)((e,...t)=>{l(e),o?.(e,...t)}),valueManager:a})},JY={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},JZ=(e,t,n)=>{if(t===JY.year)return e.startOfYear(n);if(t===JY.month)return e.startOfMonth(n);if(t===JY.day)return e.startOfDay(n);let i=n;return t<JY.minutes&&(i=e.setMinutes(i,0)),t<JY.seconds&&(i=e.setSeconds(i,0)),t<JY.milliseconds&&(i=e.setMilliseconds(i,0)),i},JX=(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.
43
+ 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}},JK=(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))},JQ=(e,t,n,i)=>{switch(n){case"month":return Qx(e,e.date(void 0,t)).map(t=>e.formatByString(t,i));case"weekDay":return JK(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[]}},JJ=["0","1","2","3","4","5","6","7","8","9"],J0=(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("")},J1=(e,t)=>"0"===t[0]?e:e.split("").map(e=>t[Number(e)]).join(""),J2=(e,t)=>{let n=J0(e,t);return" "!==n&&!Number.isNaN(Number(n))},J5=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},J3=(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=J5(o,r.maxLength)),J1(o,i)},J4=(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(J0(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},J6=(e,t,n,i)=>e.formatByString(e.parse(t,n),i),J8=(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")}},J9=(e,t)=>{},J7={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},eee=(e,t,n,i,r)=>[...n].sort((e,t)=>J7[e.type]-J7[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=JK(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),eet=(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},een=["value","referenceDate"],eei={emptyValue:null,getTodayValue:Qb,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,i=(0,YT.A)(e,een);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():JZ(t,n,Qb(t,i));null!=e.minDate&&t.isAfterDay(e.minDate,o)&&(o=JZ(t,n,e.minDate)),null!=e.maxDate&&t.isBeforeDay(e.maxDate,o)&&(o=JZ(t,n,e.maxDate));let a=Q2(e.disableIgnoringDatePartForTimeValidation??!1,t);return null!=e.minTime&&a(e.minTime,o)&&(o=JZ(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:Qm(t,o,e.minTime))),null!=e.maxTime&&a(o,e.maxTime)&&(o=JZ(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:Qm(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)},eer={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=J4(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)},eeo=["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"],eea=(0,eT.A)(Jg,{name:"MuiTimeClock",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",position:"relative"}),ees=(0,eT.A)(Jh,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),eel=["hours","minutes"],eeu=ew.forwardRef(function(e,t){let n=Qf().utils,i=Qs({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=eel,openTo:_,onViewChange:C,focusedView:M,onFocusedViewChange:A,className:k,disabled:T,readOnly:I,timezone:D}=i,O=(0,YT.A)(i,eeo),{value:R,handleValueChange:P,timezone:E}=Jq({name:"TimeClock",timezone:D,value:u,defaultValue:c,referenceDate:h,onChange:b,valueManager:eei}),L=(({value:e,referenceDate:t,utils:n,props:i,timezone:r})=>{let o=ew.useMemo(()=>eei.getInitialReferenceValue({value:e,utils:n,props:i,referenceDate:t,granularity:JY.day,timezone:r,getTodayDate:()=>Qb(n,r,"date")}),[]);return e??o})({value:R,referenceDate:h,utils:n,props:i,timezone:E}),N=Qf().localeText,B=Qg(E),{view:z,setView:F,previousView:V,nextView:j,setValueAndGoToNextView:H}=Jf({view:w,views:S,openTo:_,onViewChange:C,onChange:P,focusedView:M,onFocusedViewChange:A}),{meridiemMode:W,handleMeridiemChange:$}=Q5(L,r,H),G=ew.useCallback((e,t)=>{let i=Q2(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=Q0(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,Jn.A)(),q=ew.useMemo(()=>{switch(z){case"hours":{let e,t=(e,t)=>{let i=Q0(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)(J$,{id:u?r:void 0,index:t,inner:l,selected:u,disabled:i(t),label:a,"aria-label":n(a)},t))}return s})({value:R,utils:n,ampm:r,onChange:t,getClockNumberText:N.hoursClockNumberText,isDisabled:e=>T||G(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:JG({utils:n,value:e,onChange:t,getClockNumberText:N.minutesClockNumberText,isDisabled:e=>T||G(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:JG({utils:n,value:e,onChange:t,getClockNumberText:N.secondsClockNumberText,isDisabled:e=>T||G(e,"seconds"),selectedId:U}),viewRange:[0,59]}}default:throw Error("You must provide the type for ClockView")}},[z,n,R,r,N.hoursClockNumberText,N.minutesClockNumberText,N.secondsClockNumberText,W,H,L,G,U,T]),Y=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"],arrowSwitcher:["arrowSwitcher"]},Jm,t)})(i);return(0,eb.jsxs)(eea,(0,oM.A)({ref:t,className:(0,e_.A)(Y.root,k),ownerState:i},O,{children:[(0,eb.jsx)(JF,(0,oM.A)({autoFocus:a??!!M,ampmInClock:o&&S.includes("hours"),value:R,type:z,ampm:r,minutesStep:v,isTimeDisabled:G,meridiemMode:W,handleMeridiemChange:$,selectedId:U,disabled:T,readOnly:I},q)),x&&(0,eb.jsx)(ees,{className:Y.arrowSwitcher,slots:s,slotProps:l,onGoToPrevious:()=>F(V),isPreviousDisabled:!V,previousLabel:N.openPreviousView,onGoToNext:()=>F(j),isNextDisabled:!j,nextLabel:N.openNextView,ownerState:i})]}))}),eec=({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:C,showViewSwitcher:M,disableIgnoringDatePartForTimeValidation:A,timezone:k})=>(0,eb.jsx)(eeu,{view:e,onViewChange:t,focusedView:n&&QJ(n)?n:null,onFocusedViewChange:i,views:r.filter(QJ),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:C,showViewSwitcher:M,disableIgnoringDatePartForTimeValidation:A,timezone:k}),eeh=({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=Qy(i.utils,e.minDate,i.defaultDates.minDate),h=Qy(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}};eeh.valueManager=eei;let eed=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:i,maxDate:r,disableFuture:o,disablePast:a,timezone:s})=>{let l=Qf();return ew.useCallback(u=>null!==eeh({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 eep=n(44394),eef=n(96313);let eeg=e=>(0,eP.Ay)("MuiPickersFadeTransitionGroup",e);(0,eR.A)("MuiPickersFadeTransitionGroup",["root"]);let eem=(0,eT.A)(eep.A,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function eev(e){let t=Qs({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:i,reduceAnimations:r,transKey:o}=t,a=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"]},eeg,t)})(t),s=(0,ub.A)();return r?n:(0,eb.jsx)(eem,{className:(0,e_.A)(a.root,i),children:(0,eb.jsx)(eef.A,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:s.transitions.duration.enteringScreen,enter:s.transitions.duration.enteringScreen,exit:0},children:n},o)})}var eey=n(95591);function eex(e){return(0,eP.Ay)("MuiPickersDay",e)}let eeb=(0,eR.A)("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),eew=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],eeS=({theme:e})=>(0,oM.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,eM.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,eM.X4)(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${eeb.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${eeb.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}},[`&.${eeb.disabled}:not(.${eeb.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${eeb.disabled}&.${eeb.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(.${eeb.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),ee_=(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]},eeC=(0,eT.A)(uM.A,{name:"MuiPickersDay",slot:"Root",overridesResolver:ee_})(eeS),eeM=(0,eT.A)("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:ee_})(({theme:e})=>(0,oM.A)({},eeS({theme:e}),{opacity:0,pointerEvents:"none"})),eeA=()=>{},eek=ew.forwardRef(function(e,t){let n=Qs({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=eeA,onBlur:p=eeA,onKeyDown:f=eeA,onMouseDown:g=eeA,onMouseEnter:m=eeA,outsideCurrentMonth:v,selected:y=!1,showDaysOutsideCurrentMonth:x=!1,children:b,today:w=!1}=n,S=(0,YT.A)(n,eew),_=(0,oM.A)({},n,{autoFocus:i,disabled:a,disableHighlightToday:s,disableMargin:l,selected:y,showDaysOutsideCurrentMonth:x,today:w}),C=(e=>{let{selected:t,disableMargin:n,disableHighlightToday:i,today:r,disabled:o,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:s,classes:l}=e,u=a&&!s;return(0,eC.A)({root:["root",t&&!u&&"selected",o&&"disabled",!n&&"dayWithMargin",!i&&r&&"today",a&&s&&"dayOutsideMonth",u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},eex,l)})(_),M=Qf().utils,A=ew.useRef(null),k=(0,eey.A)(A,t);return((0,mz.A)(()=>{!i||a||u||v||A.current.focus()},[i,a,u,v]),v&&!x)?(0,eb.jsx)(eeM,{className:(0,e_.A)(C.root,C.hiddenDaySpacingFiller,r),ownerState:_,role:S.role}):(0,eb.jsx)(eeC,(0,oM.A)({className:(0,e_.A)(C.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||M.format(o,"dayOfMonth")}))}),eeT=ew.memo(eek);var eeI=n(7490);function eeD(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var eeO=n(64863),eeR=function(e,t){return e&&t&&t.split(" ").forEach(function(t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=eeD(e.className,t):e.setAttribute("class",eeD(e.className&&e.className.baseVal||"",t))})},eeP=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,eeI.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,eeO.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&&eeR(e,i),r&&eeR(e,r),o&&eeR(e,o)},n.render=function(){var e=this.props,t=(e.classNames,(0,YT.A)(e,["classNames"]));return eS().createElement(mU.Ay,(0,oM.A)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(eS().Component);eeP.defaultProps={classNames:""},eeP.propTypes={};let eeE=e=>(0,eP.Ay)("MuiPickersSlideTransition",e),eeL=(0,eR.A)("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),eeN=["children","className","reduceAnimations","slideDirection","transKey","classes"],eeB=(0,eT.A)(eep.A,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${eeL["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${eeL["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${eeL.slideEnterActive}`]:t.slideEnterActive},{[`.${eeL.slideExit}`]:t.slideExit},{[`.${eeL["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${eeL["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},[`& .${eeL["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${eeL["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${eeL.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${eeL.slideExit}`]:{transform:"translate(0%)"},[`& .${eeL["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${eeL["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}}),eez=e=>(0,eP.Ay)("MuiDayCalendar",e);(0,eR.A)("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);let eeF=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],eeV=["ownerState"],eej=(0,eT.A)("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),eeH=(0,eT.A)("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),eeW=(0,eT.A)(fO.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})),ee$=(0,eT.A)(fO.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})),eeG=(0,eT.A)(fO.A,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>(0,oM.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"})),eeU=(0,eT.A)("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:240}),eeq=(0,eT.A)(function(e){let t=Qs({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:i,reduceAnimations:r,transKey:o}=t,a=(0,YT.A)(t,eeN),s=(e=>{let{classes:t,slideDirection:n}=e,i={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return(0,eC.A)(i,eeE,t)})(t),l=(0,ub.A)();if(r)return(0,eb.jsx)("div",{className:(0,e_.A)(s.root,i),children:n});let u={exit:s.exit,enterActive:s.enterActive,enter:s.enter,exitActive:s.exitActive};return(0,eb.jsx)(eeB,{className:(0,e_.A)(s.root,i),childFactory:e=>ew.cloneElement(e,{classNames:u}),role:"presentation",children:(0,eb.jsx)(eeP,(0,oM.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}),eeY=(0,eT.A)("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),eeZ=(0,eT.A)("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:"2px 0",display:"flex",justifyContent:"center"});function eeX(e){let{parentProps:t,day:n,focusableDay:i,selectedDays:r,isDateDisabled:o,currentMonthNumber:a,isViewFocused:s}=e,l=(0,YT.A)(e,eeF),{disabled:u,disableHighlightToday:c,isMonthSwitchingAnimating:h,showDaysOutsideCurrentMonth:d,slots:p,slotProps:f,timezone:g}=t,m=Qf().utils,v=Qg(g),y=null!==i&&m.isSameDay(n,i),x=r.some(e=>m.isSameDay(e,n)),b=m.isSameDay(n,v),w=p?.day??eeT,S=(0,Ji.A)({elementType:w,externalSlotProps:f?.day,additionalProps:(0,oM.A)({disableHighlightToday:c,showDaysOutsideCurrentMonth:d,role:"gridcell",isAnimating:h,"data-timestamp":m.toJsDate(n).valueOf()},l),ownerState:(0,oM.A)({},t,{day:n,selected:x})}),_=(0,YT.A)(S,eeV),C=ew.useMemo(()=>u||o(n),[u,o,n]),M=ew.useMemo(()=>m.getMonth(n)!==a,[m,n,a]),A=ew.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=ew.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,oM.A)({},_,{day:n,disabled:C,autoFocus:s&&y,today:b,outsideCurrentMonth:M,isFirstVisibleCell:A,isLastVisibleCell:k,selected:x,tabIndex:y?0:-1,"aria-selected":x,"aria-current":b?"date":void 0}))}function eeK(e){let t,n=Qs({props:e,name:"MuiDayCalendar"}),i=Qf().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:C=e=>i.format(e,"weekdayShort").charAt(0).toUpperCase(),hasFocus:M,onFocusedViewChange:A,gridLabelId:k,displayWeekNumber:T,fixedWeekNumber:I,autoFocus:D,timezone:O}=n,R=Qg(O),P=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},eez,t)})(n),E=(0,p2.I)(),L=eed({shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:_,minDate:x,maxDate:b,disablePast:v,disableFuture:y,timezone:O}),N=Qf().localeText,[B,z]=(0,Jp.A)({name:"DayCalendar",state:"hasFocus",controlled:M,default:D??!1}),[F,V]=ew.useState(()=>l||R),j=(0,Jd.A)(e=>{d||c(e)}),H=e=>{L(e)||(r(e),V(e),A?.(!0),z(!0))},W=(0,Jd.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,E?1:-1),r=i.addMonths(t,E?1:-1);H(Qv({utils:i,date:n,minDate:E?n:i.startOfMonth(r),maxDate:E?i.endOfMonth(r):n,isDateDisabled:L,timezone:O})||n),e.preventDefault();break}case"ArrowRight":{let n=i.addDays(t,E?-1:1),r=i.addMonths(t,E?-1:1);H(Qv({utils:i,date:n,minDate:E?i.startOfMonth(r):n,maxDate:E?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()}}),$=(0,Jd.A)((e,t)=>H(t)),G=(0,Jd.A)((e,t)=>{B&&i.isSameDay(F,t)&&A?.(!1)}),U=i.getMonth(a),q=i.getYear(a),Y=ew.useMemo(()=>s.filter(e=>!!e).map(e=>i.startOfDay(e)),[i,s]),Z=`${q}-${U}`,X=ew.useMemo(()=>ew.createRef(),[Z]),K=ew.useMemo(()=>{let e=i.startOfMonth(a),t=i.endOfMonth(a);return L(F)||i.isAfterDay(F,t)||i.isBeforeDay(F,e)?Qv({utils:i,date:F,minDate:e,maxDate:t,disablePast:v,disableFuture:y,isDateDisabled:L,timezone:O}):F},[a,y,v,F,L,i,O]),Q=ew.useMemo(()=>{let e=i.getWeekArray(a),t=i.addMonths(a,1);for(;I&&e.length<I;){let n=i.getWeekArray(t),r=i.isSameDay(e[e.length-1][0],n[0][0]);n.slice(+!!r).forEach(t=>{e.length<I&&e.push(t)}),t=i.addMonths(t,1)}return e},[a,I,i]);return(0,eb.jsxs)(eej,{role:"grid","aria-labelledby":k,className:P.root,children:[(0,eb.jsxs)(eeH,{role:"row",className:P.header,children:[T&&(0,eb.jsx)(ee$,{variant:"caption",role:"columnheader","aria-label":N.calendarWeekNumberHeaderLabel,className:P.weekNumberLabel,children:N.calendarWeekNumberHeaderText}),(t=i.startOfWeek(R),[0,1,2,3,4,5,6].map(e=>i.addDays(t,e))).map((e,t)=>(0,eb.jsx)(eeW,{variant:"caption",role:"columnheader","aria-label":i.format(e,"weekday"),className:P.weekDayLabel,children:C(e)},t.toString()))]}),u?(0,eb.jsx)(eeU,{className:P.loadingContainer,children:f()}):(0,eb.jsx)(eeq,(0,oM.A)({transKey:Z,onExited:h,reduceAnimations:p,slideDirection:g,className:(0,e_.A)(o,P.slideTransition)},m,{nodeRef:X,children:(0,eb.jsx)(eeY,{ref:X,role:"rowgroup",className:P.monthContainer,children:Q.map((e,t)=>(0,eb.jsxs)(eeZ,{role:"row",className:P.weekContainer,"aria-rowindex":t+1,children:[T&&(0,eb.jsx)(eeG,{className:P.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)(eeX,{parentProps:n,day:e,selectedDays:Y,focusableDay:K,onKeyDown:W,onFocus:$,onBlur:G,onDaySelect:j,isDateDisabled:L,currentMonthNumber:U,isViewFocused:B,"aria-colindex":t+1},e.toString()))]},`week-${e[0]}`))})}))]})}function eeQ(e){return(0,eP.Ay)("MuiPickersMonth",e)}let eeJ=(0,eR.A)("MuiPickersMonth",["root","monthButton","disabled","selected"]),ee0=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],ee1=(0,eT.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%"}}]}),ee2=(0,eT.A)("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${eeJ.disabled}`]:t.disabled},{[`&.${eeJ.selected}`]:t.selected}]})(({theme:e})=>(0,oM.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,eM.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,eM.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${eeJ.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${eeJ.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),ee5=ew.memo(function(e){let t=Qs({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,YT.A)(t,ee0),y=ew.useRef(null),x=(e=>{let{disabled:t,selected:n,classes:i}=e;return(0,eC.A)({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},eeQ,i)})(t);(0,mz.A)(()=>{n&&y.current?.focus()},[n]);let b=g?.monthButton??ee2,w=(0,Ji.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)(ee1,(0,oM.A)({className:(0,e_.A)(x.root,i),ownerState:t},v,{children:(0,eb.jsx)(b,(0,oM.A)({},w))}))});function ee3(e){return(0,eP.Ay)("MuiMonthCalendar",e)}(0,eR.A)("MuiMonthCalendar",["root"]);let ee4=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],ee6=(0,eT.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"}),ee8=ew.forwardRef(function(e,t){let n,i,r,o=(n=Qf().utils,i=Qf().defaultDates,r=Qs({props:e,name:"MuiMonthCalendar"}),(0,oM.A)({disableFuture:!1,disablePast:!1},r,{minDate:Qy(n,r.minDate,i.minDate),maxDate:Qy(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:C,slots:M,slotProps:A}=o,k=(0,YT.A)(o,ee4),{value:T,handleValueChange:I,timezone:D}=Jq({name:"MonthCalendar",timezone:_,value:s,defaultValue:l,referenceDate:u,onChange:g,valueManager:eei}),O=Qg(D),R=(0,p2.I)(),P=Qf().utils,E=ew.useMemo(()=>eei.getInitialReferenceValue({value:T,utils:P,props:o,timezone:D,referenceDate:u,granularity:JY.month}),[]),L=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"]},ee3,t)})(o),N=ew.useMemo(()=>P.getMonth(O),[P,O]),B=ew.useMemo(()=>null!=T?P.getMonth(T):null,[T,P]),[z,F]=ew.useState(()=>B||P.getMonth(E)),[V,j]=(0,Jp.A)({name:"MonthCalendar",state:"hasFocus",controlled:b,default:y??!1}),H=(0,Jd.A)(e=>{j(e),w&&w(e)}),W=ew.useCallback(e=>{let t=P.startOfMonth(d&&P.isAfter(O,f)?O:f),n=P.startOfMonth(h&&P.isBefore(O,p)?O:p),i=P.startOfMonth(e);return!!(P.isBefore(i,t)||P.isAfter(i,n))||!!m&&m(i)},[h,d,p,f,O,m,P]),$=(0,Jd.A)((e,t)=>{v||I(P.setMonth(T??E,t))}),G=(0,Jd.A)(e=>{!W(P.setMonth(T??E,e))&&(F(e),H(!0),x&&x(e))});ew.useEffect(()=>{F(e=>null!==B&&e!==B?B:e)},[B]);let U=(0,Jd.A)((e,t)=>{switch(e.key){case"ArrowUp":G((12+t-3)%12),e.preventDefault();break;case"ArrowDown":G((12+t+3)%12),e.preventDefault();break;case"ArrowLeft":G((12+t+(R?1:-1))%12),e.preventDefault();break;case"ArrowRight":G((12+t+(R?-1:1))%12),e.preventDefault()}}),q=(0,Jd.A)((e,t)=>{G(t)}),Y=(0,Jd.A)((e,t)=>{z===t&&H(!1)});return(0,eb.jsx)(ee6,(0,oM.A)({ref:t,className:(0,e_.A)(L.root,a),ownerState:o,role:"radiogroup","aria-labelledby":C},k,{children:Qx(P,T??E).map(e=>{let t=P.getMonth(e),n=P.format(e,"monthShort"),i=P.format(e,"month"),r=c||W(e);return(0,eb.jsx)(ee5,{selected:t===B,value:t,onClick:$,onKeyDown:U,autoFocus:V&&t===z,disabled:r,tabIndex:t!==z||r?-1:0,onFocus:q,onBlur:Y,"aria-current":N===t?"date":void 0,"aria-label":i,monthsPerRow:S,slots:M,slotProps:A,children:n},n)})}))});function ee9(e){return(0,eP.Ay)("MuiPickersYear",e)}let ee7=(0,eR.A)("MuiPickersYear",["root","yearButton","selected","disabled"]),ete=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],ett=(0,eT.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%"}}]}),etn=(0,eT.A)("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${ee7.disabled}`]:t.disabled},{[`&.${ee7.selected}`]:t.selected}]})(({theme:e})=>(0,oM.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,eM.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,eM.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${ee7.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${ee7.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),eti=ew.memo(function(e){let t=Qs({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,YT.A)(t,ete),v=ew.useRef(null),y=(e=>{let{disabled:t,selected:n,classes:i}=e;return(0,eC.A)({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},ee9,i)})(t);(0,mz.A)(()=>{n&&v.current?.focus()},[n]);let x=f?.yearButton??etn,b=(0,Ji.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)(ett,(0,oM.A)({className:(0,e_.A)(y.root,i),ownerState:t},m,{children:(0,eb.jsx)(x,(0,oM.A)({},b))}))});function etr(e){return(0,eP.Ay)("MuiYearCalendar",e)}(0,eR.A)("MuiYearCalendar",["root"]);let eto=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],eta=(0,eT.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"}),ets=ew.forwardRef(function(e,t){let n,i,r,o=(n=Qf().utils,i=Qf().defaultDates,r=Qs({props:e,name:"MuiYearCalendar"}),(0,oM.A)({disablePast:!1,disableFuture:!1},r,{yearsPerRow:r.yearsPerRow??3,minDate:Qy(n,r.minDate,i.minDate),maxDate:Qy(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:C,gridLabelId:M,slots:A,slotProps:k}=o,T=(0,YT.A)(o,eto),{value:I,handleValueChange:D,timezone:O}=Jq({name:"YearCalendar",timezone:C,value:l,defaultValue:u,referenceDate:c,onChange:m,valueManager:eei}),R=Qg(O),P=(0,p2.I)(),E=Qf().utils,L=ew.useMemo(()=>eei.getInitialReferenceValue({value:I,utils:E,props:o,timezone:O,referenceDate:c,granularity:JY.year}),[]),N=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"]},etr,t)})(o),B=ew.useMemo(()=>E.getYear(R),[E,R]),z=ew.useMemo(()=>null!=I?E.getYear(I):null,[I,E]),[F,V]=ew.useState(()=>z||E.getYear(L)),[j,H]=(0,Jp.A)({name:"YearCalendar",state:"hasFocus",controlled:b,default:a??!1}),W=(0,Jd.A)(e=>{H(e),w&&w(e)}),$=ew.useCallback(e=>!!(p&&E.isBeforeYear(e,R)||d&&E.isAfterYear(e,R)||g&&E.isBeforeYear(e,g)||f&&E.isAfterYear(e,f))||!!y&&y(E.startOfYear(e)),[d,p,f,g,R,y,E]),G=(0,Jd.A)((e,t)=>{v||D(E.setYear(I??L,t))}),U=(0,Jd.A)(e=>{$(E.setYear(I??L,e))||(V(e),W(!0),x?.(e))});ew.useEffect(()=>{V(e=>null!==z&&e!==z?z:e)},[z]);let q="desc"!==S?+_:-1*_,Y=P&&"asc"===S||!P&&"desc"===S?-1:1,Z=(0,Jd.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,Jd.A)((e,t)=>{U(t)}),K=(0,Jd.A)((e,t)=>{F===t&&W(!1)}),Q=ew.useRef(null),J=(0,eey.A)(t,Q);ew.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=E.getYearRange([g,f]);return"desc"===S&&ee.reverse(),(0,eb.jsx)(eta,(0,oM.A)({ref:J,className:(0,e_.A)(N.root,s),ownerState:o,role:"radiogroup","aria-labelledby":M},T,{children:ee.map(e=>{let t=E.getYear(e),n=h||$(e);return(0,eb.jsx)(eti,{selected:t===z,value:t,onClick:G,onKeyDown:Z,autoFocus:j&&t===F,disabled:n,tabIndex:t!==F||n?-1:0,onFocus:X,onBlur:K,"aria-current":B===t?"date":void 0,yearsPerRow:_,slots:A,slotProps:k,children:E.format(e,"year")},E.format(e,"year"))})}))}),etl=e=>(0,eP.Ay)("MuiPickersCalendarHeader",e),etu=(0,eR.A)("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),etc=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],eth=["ownerState"],etd=(0,eT.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}),etp=(0,eT.A)("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>(0,oM.A)({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),etf=(0,eT.A)("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),etg=(0,eT.A)(eW.A,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${etu.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),etm=(0,eT.A)(Qk,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),etv=ew.forwardRef(function(e,t){let n=Qf().localeText,i=Qf().utils,r=Qs({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,YT.A)(r,etc),_=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},etl,t)})(r),C=o?.switchViewButton??etg,M=(0,Ji.A)({elementType:C,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(g)},ownerState:r,className:_.switchViewButton}),A=o?.switchViewIcon??etm,k=(0,Ji.A)({elementType:A,externalSlotProps:a?.switchViewIcon,ownerState:r,className:_.switchViewIcon}),T=(0,YT.A)(k,eth),I=function(e,{disableFuture:t,maxDate:n,timezone:i}){let r=Qf().utils;return ew.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}),D=function(e,{disablePast:t,minDate:n,timezone:i}){let r=Qf().utils;return ew.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)(etd,(0,oM.A)({},S,{ownerState:r,className:(0,e_.A)(_.root,x),ref:t,children:[(0,eb.jsxs)(etp,{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)(eev,{reduceAnimations:m,transKey:O,children:(0,eb.jsx)(etf,{id:y,ownerState:r,className:_.label,children:O})}),v.length>1&&!l&&(0,eb.jsx)(C,(0,oM.A)({},M,{children:(0,eb.jsx)(A,(0,oM.A)({},T))}))]}),(0,eb.jsx)(eef.A,{in:"day"===g,appear:!m,enter:!m,children:(0,eb.jsx)(Jh,{slots:o,slotProps:a,onGoToPrevious:()=>p(i.addMonths(s,-1),"right"),isPreviousDisabled:D,previousLabel:n.previousMonth,onGoToNext:()=>p(i.addMonths(s,1),"left"),isNextDisabled:I,nextLabel:n.nextMonth})})]}))}),ety="u">typeof navigator&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),etx=ety&&ety[1]?parseInt(ety[1],10):null,etb=ety&&ety[2]?parseInt(ety[2],10):null,etw=etx&&etx<10||etb&&etb<13||!1,etS=e=>(0,eP.Ay)("MuiDateCalendar",e);(0,eR.A)("MuiDateCalendar",["root","viewTransitionContainer"]);let et_=["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"],etC=(0,eT.A)(Jg,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:336}),etM=(0,eT.A)(eev,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),etA=ew.forwardRef(function(e,t){let n,i,r,o,a=Qf().utils,s=(0,Jn.A)(),l=(n=Qf().utils,i=Qf().defaultDates,r=m$("@media (prefers-reduced-motion: reduce)",{defaultMatches:!1})||etw,o=Qs({props:e,name:"MuiDateCalendar"}),(0,oM.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:Qy(n,o.minDate,i.minDate),maxDate:Qy(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:C,openTo:M,className:A,disabled:k,readOnly:T,minDate:I,maxDate:D,disableHighlightToday:O,focusedView:R,onFocusedViewChange:P,showDaysOutsideCurrentMonth:E,fixedWeekNumber:L,dayOfWeekFormatter:N,slots:B,slotProps:z,loading:F,renderLoading:V,displayWeekNumber:j,yearsOrder:H,yearsPerRow:W,monthsPerRow:$,timezone:G}=l,U=(0,YT.A)(l,et_),{value:q,handleValueChange:Y,timezone:Z}=Jq({name:"DateCalendar",timezone:G,value:h,defaultValue:d,referenceDate:p,onChange:m,valueManager:eei}),{view:X,setView:K,focusedView:Q,setFocusedView:J,goToNextView:ee,setValueAndGoToNextView:et}=Jf({view:_,views:C,openTo:M,onChange:Y,onViewChange:c,autoFocus:u,focusedView:R,onFocusedViewChange:P}),{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=Qf().utils,f=ew.useRef((t=!!c,(e,n)=>{switch(n.type){case"changeMonth":return(0,oM.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,oM.A)({},e,{currentMonth:i})}case"finishMonthSwitchingAnimation":return(0,oM.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,oM.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=ew.useMemo(()=>eei.getInitialReferenceValue({value:n,utils:p,timezone:d,props:e,referenceDate:i,granularity:JY.day}),[i,d]),[m,v]=ew.useReducer(f,{isMonthSwitchingAnimating:!1,focusedDay:g,currentMonth:p.startOfMonth(g),slideDirection:"left"});ew.useEffect(()=>{v({type:"changeMonthTimezone",newTimezone:p.getTimezone(g)})},[g,p]);let y=ew.useCallback(e=>{v((0,oM.A)({type:"changeMonth"},e)),u&&u(e.newMonth)},[u]),x=ew.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=eed({shouldDisableDate:h,minDate:l,maxDate:s,disableFuture:r,disablePast:o,timezone:d}),w=ew.useCallback(()=>{v({type:"finishMonthSwitchingAnimation"})},[]);return{referenceDate:g,calendarState:m,changeMonth:x,changeFocusedDay:(0,Jd.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:I,maxDate:D,shouldDisableDate:b,disablePast:g,disableFuture:f,timezone:Z}),eu=k&&q||I,ec=k&&q||D,eh=`${s}-grid-label`,ed=null!==Q,ep=B?.calendarHeader??etv,ef=(0,Ji.A)({elementType:ep,externalSlotProps:z?.calendarHeader,additionalProps:{views:C,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,Jd.A)(e=>{let t=a.startOfMonth(e),n=a.endOfMonth(e),i=es(e)?Qv({utils:a,date:e,minDate:a.isBefore(I,t)?t:I,maxDate:a.isAfter(D,n)?n:D,disablePast:g,disableFuture:f,isDateDisabled:es,timezone:Z}):e;i?(et(i,"finish"),y?.(t)):(ee(),eo(t)),er(i,!0)}),em=(0,Jd.A)(e=>{let t=a.startOfYear(e),n=a.endOfYear(e),i=es(e)?Qv({utils:a,date:e,minDate:a.isBefore(I,t)?t:I,maxDate:a.isAfter(D,n)?n:D,disablePast:g,disableFuture:f,isDateDisabled:es,timezone:Z}):e;i?(et(i,"finish"),v?.(i)):(ee(),eo(t)),er(i,!0)}),ev=(0,Jd.A)(e=>e?Y(Qm(a,e,q??en),"finish",X):Y(e,"finish",X));ew.useEffect(()=>{null!=q&&a.isValid(q)&&eo(q)},[q]);let ey=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},etS,t)})(l),ex={disablePast:g,disableFuture:f,maxDate:D,minDate:I},eS={disableHighlightToday:O,readOnly:T,disabled:k,timezone:Z,gridLabelId:eh,slots:B,slotProps:z},eM=ew.useRef(X);ew.useEffect(()=>{eM.current!==X&&(Q===eM.current&&J(X,!0),eM.current=X)},[Q,J,X]);let eA=ew.useMemo(()=>[q],[q]);return(0,eb.jsxs)(etC,(0,oM.A)({ref:t,className:(0,e_.A)(ey.root,A),ownerState:l},U,{children:[(0,eb.jsx)(ep,(0,oM.A)({},ef,{slots:B,slotProps:z})),(0,eb.jsx)(etM,{reduceAnimations:x,className:ey.viewTransitionContainer,transKey:X,ownerState:l,children:(0,eb.jsxs)("div",{children:["year"===X&&(0,eb.jsx)(ets,(0,oM.A)({},ex,eS,{value:q,onChange:em,shouldDisableYear:S,hasFocus:ed,onFocusedViewChange:e=>J("year",e),yearsOrder:H,yearsPerRow:W,referenceDate:en})),"month"===X&&(0,eb.jsx)(ee8,(0,oM.A)({},ex,eS,{hasFocus:ed,className:A,value:q,onChange:eg,shouldDisableMonth:w,onFocusedViewChange:e=>J("month",e),monthsPerRow:$,referenceDate:en})),"day"===X&&(0,eb.jsx)(eeK,(0,oM.A)({},ei,ex,eS,{onMonthSwitchingAnimationEnd:el,onFocusedDayChange:er,reduceAnimations:x,selectedDays:eA,onSelectedDaysChange:ev,shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:S,hasFocus:ed,onFocusedViewChange:e=>J("day",e),showDaysOutsideCurrentMonth:E,fixedWeekNumber:L,dayOfWeekFormatter:N,displayWeekNumber:j,loading:F,renderLoading:V}))]})})]}))}),etk=({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:C,slotProps:M,loading:A,renderLoading:k,disableHighlightToday:T,readOnly:I,disabled:D,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:R,sx:P,autoFocus:E,fixedWeekNumber:L,displayWeekNumber:N,timezone:B})=>(0,eb.jsx)(etA,{view:e,onViewChange:t,views:n.filter(Q_),focusedView:i&&Q_(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:C,slotProps:M,loading:A,renderLoading:k,disableHighlightToday:T,readOnly:I,disabled:D,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:R,sx:P,autoFocus:E,fixedWeekNumber:L,displayWeekNumber:N,timezone:B});function etT(e){let{props:t,validator:n,value:i,timezone:r,onError:o}=e,a=Qf(),s=ew.useRef(n.valueManager.defaultErrorState),l=n({adapter:a,value:i,timezone:r,props:t}),u=n.valueManager.hasError(l);return ew.useEffect(()=>{o&&!n.valueManager.isSameError(l,s.current)&&o(l,i),s.current=l},[n,o,l,i]),{validationError:l,hasValidationError:u,getValidationErrorForNewValue:(0,Jd.A)(e=>n({adapter:a,value:e,timezone:r,props:t}))}}let etI=["className","sx"],etD=(e=document)=>{let t=e.activeElement;return t?t.shadowRoot?etD(t.shadowRoot):t:null};function etO(){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 etR(e){return(0,eP.Ay)("MuiPickersLayout",e)}let etP=(0,eR.A)("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),etE=["onAccept","onClear","onCancel","onSetToday","actions"];function etL(e){let{onAccept:t,onClear:n,onCancel:i,onSetToday:r,actions:o}=e,a=(0,YT.A)(e,etE),s=Qf().localeText;if(null==o||0===o.length)return null;let l=o?.map(e=>{switch(e){case"clear":return(0,eb.jsx)(eV.A,{onClick:n,children:s.clearButtonLabel},e);case"cancel":return(0,eb.jsx)(eV.A,{onClick:i,children:s.cancelButtonLabel},e);case"accept":return(0,eb.jsx)(eV.A,{onClick:t,children:s.okButtonLabel},e);case"today":return(0,eb.jsx)(eV.A,{onClick:r,children:s.todayButtonLabel},e);default:return null}});return(0,eb.jsx)(gw.A,(0,oM.A)({},a,{children:l}))}var etN=n(76477),etB=n(79223),etz=n(6835);function etF(e){return(0,eP.Ay)("MuiListItem",e)}function etV(e){return(0,eP.Ay)("MuiListItemSecondaryAction",e)}(0,eR.A)("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]),(0,eR.A)("MuiListItemSecondaryAction",["root","disableGutters"]);let etj=(0,eT.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}}]}),etH=ew.forwardRef(function(e,t){let n=(0,eO.b)({props:e,name:"MuiListItemSecondaryAction"}),{className:i,...r}=n,o=ew.useContext(uT.A),a={...n,disableGutters:o.disableGutters},s=(e=>{let{disableGutters:t,classes:n}=e;return(0,eC.A)({root:["root",t&&"disableGutters"]},etV,n)})(a);return(0,eb.jsx)(etj,{className:(0,e_.A)(s.root,i),ownerState:a,ref:t,...r})});etH.muiName="ListItemSecondaryAction";let etW=(0,eT.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,eI.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:{[`& > .${uD.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}}]}))),et$=(0,eT.A)("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),etG=ew.forwardRef(function(e,t){let n=(0,eO.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=ew.useContext(uT.A),w=ew.useMemo(()=>({dense:d||b.dense||!1,alignItems:i,disableGutters:p}),[i,b.dense,d,p]),S=ew.useRef(null),_=ew.Children.toArray(r),C=_.length&&(0,etz.A)(_[_.length-1],["ListItemSecondaryAction"]),M={...n,alignItems:i,dense:w.dense,disableGutters:p,disablePadding:f,divider:g,hasSecondaryAction:C},A=(e=>{let{alignItems:t,classes:n,dense:i,disableGutters:r,disablePadding:o,divider:a,hasSecondaryAction:s}=e;return(0,eC.A)({root:["root",i&&"dense",!r&&"gutters",!o&&"padding",a&&"divider","flex-start"===t&&"alignItemsFlexStart",s&&"secondaryAction"],container:["container"]},etF,n)})(M),k=(0,uk.A)(S,t),T=y.root||s.Root||etW,I=v.root||l.root||{},D={className:(0,e_.A)(A.root,I.className,o),...x},O=a||"li";return C?(O=D.component||a?O:"div","li"===u&&("li"===O?O="div":"li"===D.component&&(D.component="div")),(0,eb.jsx)(uT.A.Provider,{value:w,children:(0,eb.jsxs)(et$,{as:u,className:(0,e_.A)(A.container,c),ref:k,ownerState:M,...h,children:[(0,eb.jsx)(T,{...I,...!(0,etB.A)(T)&&{as:O,ownerState:{...M,...I.ownerState}},...D,children:_}),_.pop()]})})):(0,eb.jsx)(uT.A.Provider,{value:w,children:(0,eb.jsxs)(T,{...I,as:O,ref:k,...!(0,etB.A)(T)&&{ownerState:{...M,...I.ownerState}},...D,children:[_,m&&(0,eb.jsx)(etH,{children:m})]})})});var etU=n(47601);let etq=["items","changeImportance","isLandscape","onChange","isValid"],etY=["getValue"];function etZ(e){let{items:t,changeImportance:n="accept",onChange:i,isValid:r}=e,o=(0,YT.A)(e,etq);if(null==t||0===t.length)return null;let a=t.map(e=>{let{getValue:t}=e,o=(0,YT.A)(e,etY),a=t({isValid:r});return(0,oM.A)({},o,{label:o.label,onClick:()=>{i(a,n,o)},disabled:!r(a)})});return(0,eb.jsx)(etN.A,(0,oM.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)(etG,{children:(0,eb.jsx)(etU.A,(0,oM.A)({},e))},e.id??e.label))}))}let etX=(0,eT.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",[`& .${etP.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${etP.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${etP.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${etP.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${etP.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${etP.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${etP.shortcuts}`]:{gridColumn:3}}}]}),etK=(0,eT.A)("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),etQ=ew.forwardRef(function(e,t){let n=Qs({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,eC.A)({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},etR,t)})(e),b=v?.actionBar??etL,w=(0,Ji.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,oM.A)({},e,{wrapperVariant:t})}),S=(0,eb.jsx)(b,(0,oM.A)({},w)),_=v?.toolbar,C=(0,Ji.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,oM.A)({},e,{wrapperVariant:t})}),M=null!==C.view&&_?(0,eb.jsx)(_,(0,oM.A)({},C)):null,A=v?.tabs,k=a&&A?(0,eb.jsx)(A,(0,oM.A)({view:a,onViewChange:l,className:x.tabs},y?.tabs)):null,T=v?.shortcuts??etZ,I=(0,Ji.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:M,content:m,tabs:k,actionBar:S,shortcuts:a&&T?(0,eb.jsx)(T,(0,oM.A)({},I)):null}})(n),{sx:l,className:u,isLandscape:c,wrapperVariant:h}=n,d=(e=>{let{isLandscape:t,classes:n}=e;return(0,eC.A)({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},etR,n)})(n);return(0,eb.jsxs)(etX,{ref:t,sx:l,className:(0,e_.A)(d.root,u),ownerState:n,children:[c?s:i,c?i:s,(0,eb.jsx)(etK,{className:d.contentWrapper,children:"desktop"===h?(0,eb.jsxs)(ew.Fragment,{children:[r,o]}):(0,eb.jsxs)(ew.Fragment,{children:[o,r]})}),a]})}),etJ=["props","ref"],et0=(0,eT.A)(etQ)(({theme:e})=>({overflow:"hidden",minWidth:320,backgroundColor:(e.vars||e).palette.background.paper})),et1=({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=Q2(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}};et1.valueManager=eei;let et2=({adapter:e,value:t,timezone:n,props:i})=>{let r=eeh({adapter:e,value:t,timezone:n,props:i});return null!==r?r:et1({adapter:e,value:t,timezone:n,props:i})};et2.valueManager=eei;let et5=ew.forwardRef(function(e,t){let n,i,r,o,a,s=(n=Qf().utils,i=Qf().defaultDates,o=(r=Qs({props:e,name:"MuiStaticDateTimePicker"})).ampm??n.is12HourCycleInCurrentLocale(),a=ew.useMemo(()=>r.localeText?.toolbarTitle==null?r.localeText:(0,oM.A)({},r.localeText,{dateTimePickerToolbarTitle:r.localeText.toolbarTitle}),[r.localeText]),(0,oM.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:Qy(n,r.minDateTime??r.minDate,i.minDate),maxDate:Qy(n,r.maxDateTime??r.maxDate,i.maxDate),minTime:r.minDateTime??r.minTime,maxTime:r.maxDateTime??r.maxTime,slots:(0,oM.A)({toolbar:Jt,tabs:QL},r.slots),slotProps:(0,oM.A)({},r.slotProps,{toolbar:(0,oM.A)({ampm:o},r.slotProps?.toolbar)})})),l=s.displayStaticWrapperAs??"mobile",u=s.ampmInClock??"desktop"===l,c=(0,oM.A)({day:etk,month:etk,year:etk,hours:eec,minutes:eec,seconds:eec},s.viewRenderers),{renderPicker:h}=(e=>{let{props:t,ref:n}=e,i=(0,YT.A)(e,etJ),{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}=ew.useRef(l),{current:p}=ew.useRef(void 0!==s),[f,g]=ew.useState(c),m=Qf().utils,v=Qf(),{isOpen:y,setIsOpen:x}=(({open:e,onOpen:t,onClose:n})=>{let i=ew.useRef("boolean"==typeof e).current,[r,o]=ew.useState(!1);return ew.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:ew.useCallback(e=>{i||o(e),e&&t&&t(),!e&&n&&n()},[i,t,n])}})(e),{timezone:b,value:w,handleValueChange:S}=JU({timezone:c,value:s,defaultValue:d,referenceDate:h,onChange:a,valueManager:t}),[_,C]=ew.useState(()=>{let e;return{draft:e=void 0!==w?w:void 0!==d?d:t.emptyValue,lastPublishedValue:e,lastCommittedValue:e,lastControlledValue:s,hasBeenModifiedSinceMount:!1}}),M=t.getTimezone(m,_.draft);f!==c&&(g(c),c&&M&&c!==M&&C(e=>(0,oM.A)({},e,{draft:t.setTimezone(m,c,e.draft)})));let{getValidationErrorForNewValue:A}=etT({props:e,validator:r,timezone:b,value:_.draft,onError:e.onError}),k=(0,Jd.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);C(t=>(0,oM.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);C(t=>(0,oM.A)({},t,{lastControlledValue:s},e?{}:{lastCommittedValue:w,lastPublishedValue:w,draft:w,hasBeenModifiedSinceMount:!0}))}let T=(0,Jd.A)(()=>{k({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),I=(0,Jd.A)(()=>{k({value:_.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),D=(0,Jd.A)(()=>{k({value:_.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),O=(0,Jd.A)(()=>{k({value:_.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),R=(0,Jd.A)(()=>{k({value:t.getTodayValue(m,b,n),name:"setValueFromAction",pickerAction:"today"})}),P=(0,Jd.A)(e=>{e.preventDefault(),x(!0)}),E=(0,Jd.A)(e=>{e?.preventDefault(),x(!1)}),L=(0,Jd.A)((e,t="partial")=>k({name:"setValueFromView",value:e,selectionState:t})),N=(0,Jd.A)((e,t,n)=>k({name:"setValueFromShortcut",value:e,changeImportance:t,shortcut:n})),B=(0,Jd.A)((e,t)=>k({name:"setValueFromField",value:e,context:t})),z={onClear:T,onAccept:I,onDismiss:D,onCancel:O,onSetToday:R,onOpen:P,onClose:E},F={value:_.draft,onChange:B},V=ew.useMemo(()=>t.cleanValue(m,_.draft),[m,t,_.draft]),j=(0,oM.A)({},z,{value:V,onChange:L,onSelectShortcut:N,isValid:n=>{let i=r({adapter:v,value:n,timezone:b,props:e});return!t.hasError(i)}}),H=ew.useMemo(()=>({onOpen:P,onClose:E,open:y}),[y,E,P]);return{open:y,fieldProps:F,viewProps:{value:V,onChange:L,onClose:E,open:y},layoutProps:j,actions:z,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,YT.A)(e,etI),{view:m,setView:v,defaultView:y,focusedView:x,setFocusedView:b,setValueAndGoToNextView:w}=Jf({view:u,views:c,openTo:h,onChange:a,onViewChange:d,autoFocus:i}),{hasUIView:S,viewModeLookup:_}=ew.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]),C=ew.useMemo(()=>c.reduce((e,t)=>null!=p[t]&&QJ(t)?e+1:e,0),[p,c]),M=_[m],A=(0,Jd.A)(()=>"UI"===M),[k,T]=ew.useState("UI"===M?m:null);return k!==m&&"UI"===_[m]&&T(m),(0,mz.A)(()=>{"field"===M&&s&&(l(),setTimeout(()=>{o?.current?.setSelectedSections(m),o?.current?.focusField(m)}))},[m]),(0,mz.A)(()=>{if(!s)return;let e=m;"field"===M&&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,oM.A)({},g,n,t,{views:c,timezone:f,onChange:w,view:k,onViewChange:v,focusedView:x,onFocusedViewChange:b,showViewSwitcher:C>1,timeViewsCount:C});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]=ew.useState(etO);return(0,mz.A)(()=>{let e=()=>{r(etO())};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,p2.I)();return{layoutProps:(0,oM.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 ew.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,oM.A)({},i,{props:t,autoFocusView:c??!1,additionalViewProps:{},wrapperVariant:u})),p=o?.layout??et0;return{renderPicker:()=>(0,eb.jsx)(Qc,{localeText:r,children:(0,eb.jsx)(p,(0,oM.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,e_.A)(s,a?.layout?.className),ref:n,children:d()}))})}})({props:(0,oM.A)({},s,{viewRenderers:c,displayStaticWrapperAs:l,ampmInClock:u,yearsPerRow:s.yearsPerRow??("mobile"===l?3:4),slotProps:(0,oM.A)({},s.slotProps,{tabs:(0,oM.A)({hidden:"desktop"===l},s.slotProps?.tabs),toolbar:(0,oM.A)({hidden:"desktop"===l,ampmInClock:u},s.slotProps?.toolbar)})}),valueManager:eei,valueType:"date-time",validator:et2,ref:t});return h()});et5.propTypes={ampm:Qd().bool,ampmInClock:Qd().bool,autoFocus:Qd().bool,className:Qd().string,dayOfWeekFormatter:Qd().func,defaultValue:Qd().object,disabled:Qd().bool,disableFuture:Qd().bool,disableHighlightToday:Qd().bool,disableIgnoringDatePartForTimeValidation:Qd().bool,disablePast:Qd().bool,displayStaticWrapperAs:Qd().oneOf(["desktop","mobile"]),displayWeekNumber:Qd().bool,fixedWeekNumber:Qd().number,loading:Qd().bool,localeText:Qd().object,maxDate:Qd().object,maxDateTime:Qd().object,maxTime:Qd().object,minDate:Qd().object,minDateTime:Qd().object,minTime:Qd().object,minutesStep:Qd().number,monthsPerRow:Qd().oneOf([3,4]),onAccept:Qd().func,onChange:Qd().func,onClose:Qd().func,onError:Qd().func,onMonthChange:Qd().func,onViewChange:Qd().func,onYearChange:Qd().func,openTo:Qd().oneOf(["day","hours","minutes","month","seconds","year"]),orientation:Qd().oneOf(["landscape","portrait"]),readOnly:Qd().bool,reduceAnimations:Qd().bool,referenceDate:Qd().object,renderLoading:Qd().func,shouldDisableDate:Qd().func,shouldDisableMonth:Qd().func,shouldDisableTime:Qd().func,shouldDisableYear:Qd().func,showDaysOutsideCurrentMonth:Qd().bool,slotProps:Qd().object,slots:Qd().object,sx:Qd().oneOfType([Qd().arrayOf(Qd().oneOfType([Qd().func,Qd().object,Qd().bool])),Qd().func,Qd().object]),timezone:Qd().string,value:Qd().object,view:Qd().oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:Qd().shape({day:Qd().func,hours:Qd().func,minutes:Qd().func,month:Qd().func,seconds:Qd().func,year:Qd().func}),views:Qd().arrayOf(Qd().oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:Qd().oneOf(["asc","desc"]),yearsPerRow:Qd().oneOf([3,4])};let et3=({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=JX(e,a),u=J8(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=J1(J5(J0(d,r),p),r))}return(0,oM.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})},et4=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,oM.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(et3((0,oM.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,oM.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,oM.A)({},e,{sections:i}))},et6=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,C=ew.useRef(null),M=(0,eey.A)(i,C),A=Qf().localeText,k=Qf().utils,T=(0,Jn.A)(),[I,D]=ew.useState(!1),O=ew.useMemo(()=>({syncSelectionToDOM:()=>{let e;if(!C.current)return;let t=document.getSelection();if(!t)return;if(null==g){t.rangeCount>0&&C.current.getRoot().contains(t.getRangeAt(0).startContainer)&&t.removeAllRanges(),I&&C.current.getRoot().blur();return}if(!C.current.getRoot().contains(etD(document)))return;let n=new window.Range;e="all"===g?C.current.getRoot():"empty"===m.sections[g].type?C.current.getSectionContainer(g):C.current.getSectionContent(g),n.selectNodeContents(e),e.focus(),t.removeAllRanges(),t.addRange(n)},getActiveSectionIndexFromDOM:()=>{let e=etD(document);return e&&C.current&&C.current.getRoot().contains(e)?C.current.getSectionIndexFromDOMElement(e):null},focusField:(e=0)=>{if(!C.current||null!=O.getActiveSectionIndexFromDOM())return;let t=eet(e,m.sections);D(!0),C.current.getSectionContent(t).focus()},setSelectedSections:e=>{if(!C.current)return;let t=eet(e,m.sections);D(null!==("all"===t?0:t)),f(e)},isFieldFocused:()=>{let e=etD(document);return!!C.current&&C.current.getRoot().contains(e)}}),[g,f,m.sections,I]),R=(0,Jd.A)(e=>{if(!C.current)return;let t=m.sections[e];C.current.getSectionContent(e).innerHTML=t.value||t.placeholder,O.syncSelectionToDOM()}),P=(0,Jd.A)((e,...t)=>{!e.isDefaultPrevented()&&C.current&&(D(!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)}):I?C.current.getRoot().contains(e.target)||f(w.startIndex):(D(!0),f(w.startIndex)))}),E=(0,Jd.A)(e=>{if(s?.(e),!C.current||"all"!==g)return;let t=e.target.textContent??"";C.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,Jd.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,Jd.A)((...e)=>{a?.(...e),I||!C.current||(D(!0),null==C.current.getSectionIndexFromDOMElement(etD(document))&&f(w.startIndex))}),B=(0,Jd.A)((...e)=>{r?.(...e),setTimeout(()=>{if(!C.current)return;let e=etD(document);C.current.getRoot().contains(e)||(D(!1),f(null))})}),z=(0,Jd.A)(e=>t=>{t.isDefaultPrevented()||f(e)}),F=(0,Jd.A)(e=>{e.preventDefault()}),V=(0,Jd.A)(e=>()=>{f(e)}),j=(0,Jd.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,Jd.A)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="none"}),W=(0,Jd.A)(e=>{if(!C.current)return;let t=e.target,i=t.textContent??"",r=C.current.getSectionIndexFromDOMElement(t),o=m.sections[r];if(n||!C.current)return void R(r);if(0===i.length){if(""===o.value)return void R(r);let t=e.nativeEvent.inputType;return"insertParagraph"===t||"insertLineBreak"===t?void R(r):(p(),void v())}d({keyPressed:i,sectionIndex:r}),R(r)});(0,mz.A)(()=>{if(I&&C.current){if("all"===g)C.current.getRoot().focus();else if("number"==typeof g){let e=C.current.getSectionContent(g);e&&e.focus()}}},[g,I]);let $=ew.useMemo(()=>m.sections.reduce((e,t)=>(e[t.type]=_[t.type]({currentDate:null,contentType:t.contentType,format:t.format}),e),{}),[_,m.sections]),G="all"===g,U=ew.useMemo(()=>m.sections.map((e,i)=>{let r=!G&&!t&&!n;return{container:{"data-sectionindex":i,onClick:z(i)},content:{tabIndex:G||i>0?-1:0,contentEditable:!G&&!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":$[e.type].minimum,"aria-valuemax":$[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(ew.version,10)>=17?"enterKeyHint":"enterkeyhint"]:r?"next":void 0,children:e.value||e.placeholder,onInput:W,onPaste:j,onFocus:V(i),onDragOver:H,onMouseUp:F,inputMode:"letter"===e.contentType?"text":"numeric"},before:{children:e.startSeparator},after:{children:e.endSeparator}}}),[m.sections,V,j,H,W,z,F,t,n,G,A,k,$,T]),q=(0,Jd.A)(e=>{b(e.target.value)}),Y=ew.useMemo(()=>S?"":h.getV7HiddenInputValueFromSections(m.sections),[S,m.sections,h]);return ew.useEffect(()=>{if(null==C.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&&C.current&&C.current.getSectionContent(w.startIndex).focus()},[]),{interactions:O,returnedValue:{autoFocus:c,readOnly:n,focused:u??I,sectionListRef:M,onBlur:B,onClick:P,onFocus:N,onInput:E,onPaste:L,enableAccessibleFieldDOMStructure:!0,elements:U,tabIndex:0===g?-1:0,contentEditable:G,value:Y,onChange:q,areAllSectionsEmpty:S}}},et8=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),et9=e=>{let t=(0,p2.I)(),n=ew.useRef(void 0),i=ew.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:C,getSectionsFromValue:M,areAllSectionsEmpty:A,localizedDigits:k}=e,T=ew.useRef(null),I=(0,eey.A)(l,T),D=ew.useMemo(()=>((e,t,n)=>{let i=0,r=+!!n,o=[];for(let a=0;a<e.length;a+=1){let s=e[a],l=J4(s,n?"input-rtl":"input-ltr",t),u=`${s.startSeparator}${l}${s.endSeparator}`,c=et8(u).length,h=u.length,d=et8(l),p=r+(""===d?0:l.indexOf(d[0]))+s.startSeparator.length,f=p+d.length;o.push((0,oM.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=ew.useMemo(()=>({syncSelectionToDOM:()=>{if(!T.current)return;if(null==d){T.current.scrollLeft&&(T.current.scrollLeft=0);return}if(T.current!==etD(document))return;let e=T.current.scrollTop;if("all"===d)T.current.select();else{let e=D[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===etD(document)&&T.current.setSelectionRange(t,n),clearTimeout(i.current),i.current=setTimeout(()=>{T.current&&T.current===etD(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<=D[0].startInInput?1:D.findIndex(t=>t.startInInput-t.startSeparator.length>e);return -1===n?D.length-1:n-1},focusField:(e=0)=>{etD(document)!==T.current&&(T.current?.focus(),C(e))},setSelectedSections:e=>C(e),isFieldFocused:()=>T.current===etD(document)}),[T,d,D,C]),R=()=>{let e,t=T.current.selectionStart??0;C(-1===(e=t<=D[0].startInInput||t>=D[D.length-1].endInInput?1:D.findIndex(e=>e.startInInput-e.startSeparator.length>t))?D.length-1:e-1)},P=(0,Jd.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?C("all"):R())})}),E=(0,Jd.A)((e,...t)=>{e.isDefaultPrevented()||(o?.(e,...t),R())}),L=(0,Jd.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,Jd.A)((...e)=>{s?.(...e),C(null)}),B=(0,Jd.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=et8(a);if("all"===d&&C(p),null==p||o)return void b(o?r:s);if("all"===d&&1===s.length)n=s;else{let e=et8(g.getV6InputValueFromSections(D,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=D[p];if(i<o.start||e.length-r-1>o.end)return;let a=s.length-e.length+o.end-et8(o.endSeparator||"").length;n=s.slice(o.start+et8(o.startSeparator||"").length,a)}if(0===n.length){navigator.userAgent.toLowerCase().includes("android")&&_(a),y(),w();return}v({keyPressed:n,sectionIndex:p})}),z=ew.useMemo(()=>void 0!==u?u:g.getV6InputValueFromSections(M(m.emptyValue),k,t),[u,g,M,m.emptyValue,k,t]),F=ew.useMemo(()=>f.tempValueStrAndroid??g.getV6InputValueFromSections(f.sections,k,t),[f.sections,g,f.tempValueStrAndroid,k,t]);return ew.useEffect(()=>(T.current&&T.current===etD(document)&&C("all"),()=>{clearTimeout(n.current),clearTimeout(i.current)}),[]),{interactions:O,returnedValue:{readOnly:c,onBlur:N,onClick:E,onFocus:P,onPaste:L,inputRef:I,enableAccessibleFieldDOMStructure:!1,placeholder:z,inputMode:ew.useMemo(()=>null==p||"letter"===f.sections[p].contentType?"text":"numeric",[p,f.sections]),autoComplete:"off",value:!(T.current&&T.current===etD(document))&&A?"":F,onChange:B}}},et7=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],ene=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],ent=["minDateTime","maxDateTime"];[...et7,...ene,...ent];let enn=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],eni=["clearable","onClear","InputProps","sx","slots","slotProps"],enr=["ownerState"];var eno=n(54227),ena=n(75472);function ens(e){return(0,eP.Ay)("MuiPickersTextField",e)}(0,eR.A)("MuiPickersTextField",["root","focused","disabled","error","required"]);var enl=n(42872);function enu(e){return(0,eP.Ay)("MuiPickersInputBase",e)}let enc=(0,eR.A)("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function enh(e){return(0,eP.Ay)("MuiPickersOutlinedInput",e)}let end=(0,oM.A)({},enc,(0,eR.A)("MuiPickersOutlinedInput",["root","notchedOutline","input"])),enp=["children","className","label","notched","shrink"],enf=(0,eT.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}}),eng=(0,eT.A)("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),enm=(0,eT.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 env(e){let{className:t,label:n}=e,i=(0,YT.A)(e,enp),r=null!=n&&""!==n,o=(0,oM.A)({},e,{withLabel:r});return(0,eb.jsx)(enf,(0,oM.A)({"aria-hidden":!0,className:t},i,{ownerState:o,children:(0,eb.jsx)(enm,{ownerState:o,children:r?(0,eb.jsx)(eng,{children:n}):(0,eb.jsx)(eng,{className:"notranslate",children:"​"})})}))}var eny=n(85235);function enx(e){return(0,eP.Ay)("MuiPickersSectionList",e)}let enb=(0,eR.A)("MuiPickersSectionList",["root","section","sectionContent"]),enw=["slots","slotProps","elements","sectionListRef"],enS=(0,eT.A)("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),en_=(0,eT.A)("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),enC=(0,eT.A)("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),enM=(0,eT.A)("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"});function enA(e){let{slots:t,slotProps:n,element:i,classes:r}=e,o=t?.section??en_,a=(0,Ji.A)({elementType:o,externalSlotProps:n?.section,externalForwardedProps:i.container,className:r.section,ownerState:{}}),s=t?.sectionContent??enM,l=(0,Ji.A)({elementType:s,externalSlotProps:n?.sectionContent,externalForwardedProps:i.content,additionalProps:{suppressContentEditableWarning:!0},className:r.sectionContent,ownerState:{}}),u=t?.sectionSeparator??enC,c=(0,Ji.A)({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:i.before,ownerState:{position:"before"}}),h=(0,Ji.A)({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:i.after,ownerState:{position:"after"}});return(0,eb.jsxs)(o,(0,oM.A)({},a,{children:[(0,eb.jsx)(u,(0,oM.A)({},c)),(0,eb.jsx)(s,(0,oM.A)({},l)),(0,eb.jsx)(u,(0,oM.A)({},h))]}))}let enk=ew.forwardRef(function(e,t){let n=Qs({props:e,name:"MuiPickersSectionList"}),{slots:i,slotProps:r,elements:o,sectionListRef:a}=n,s=(0,YT.A)(n,enw),l=(e=>{let{classes:t}=e;return(0,eC.A)({root:["root"],section:["section"],sectionContent:["sectionContent"]},enx,t)})(n),u=ew.useRef(null),c=(0,eey.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};ew.useImperativeHandle(a,()=>({getRoot:()=>h("getRoot"),getSectionContainer:e=>h("getSectionContainer").querySelector(`.${enb.section}[data-sectionindex="${e}"]`),getSectionContent:e=>h("getSectionContent").querySelector(`.${enb.section}[data-sectionindex="${e}"] .${enb.sectionContent}`),getSectionIndexFromDOMElement(e){let t=h("getSectionIndexFromDOMElement");if(null==e||!t.contains(e))return null;let n=null;return(e.classList.contains(enb.section)?n=e:e.classList.contains(enb.sectionContent)&&(n=e.parentElement),null==n)?null:Number(n.dataset.sectionindex)}}));let d=i?.root??enS,p=(0,Ji.A)({elementType:d,externalSlotProps:r?.root,externalForwardedProps:s,additionalProps:{ref:c,suppressContentEditableWarning:!0},className:l.root,ownerState:{}});return(0,eb.jsx)(d,(0,oM.A)({},p,{children:p.contentEditable?o.map(({content:e,before:t,after:n})=>`${t.children}${e.children}${n.children}`).join(""):(0,eb.jsx)(ew.Fragment,{children:o.map((e,t)=>(0,eb.jsx)(enA,{slots:i,slotProps:r,element:e,classes:l},t))})}))}),enT=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],enI=(0,eT.A)("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>(0,oM.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%"}}]})),enD=(0,eT.A)(enS,{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}}]})),enO=(0,eT.A)(en_,{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"})),enR=(0,eT.A)(enM,{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"})),enP=(0,eT.A)(enC,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),enE=(0,eT.A)("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})((0,oM.A)({},{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"})),enL=ew.forwardRef(function(e,t){let n=Qs({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,YT.A)(n,enT),C=ew.useRef(null),M=(0,eey.A)(t,C),A=(0,eey.A)(b?.ref,w),k=(0,p2.I)(),T=(0,enl.A)();if(!T)throw Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");ew.useEffect(()=>{T&&T.setAdornedStart(!!u)},[T,u]),ew.useEffect(()=>{T&&(r?T.onEmpty():T.onFilled())},[T,r]);let I=(0,oM.A)({},n,T,{isRtl:k}),D=(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,eny.A)(s)}`,"small"===l&&"inputSizeSmall",!!c&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return(0,eC.A)(h,enu,r)})(I),O=h?.root||enI,R=(0,Ji.A)({elementType:O,externalSlotProps:d?.root,externalForwardedProps:_,additionalProps:{"aria-invalid":T.error,ref:M},className:D.root,ownerState:I}),P=h?.input||enD;return(0,eb.jsxs)(O,(0,oM.A)({},R,{children:[u,(0,eb.jsx)(enk,{sectionListRef:S,elements:i,contentEditable:p,tabIndex:f,className:D.sectionsContainer,onFocus:e=>{T.disabled?e.stopPropagation():T.onFocus?.(e)},onBlur:T.onBlur,onInput:g,onPaste:m,onKeyDown:v,slots:{root:P,section:enO,sectionContent:enR,sectionSeparator:enP},slotProps:{root:{ownerState:I},sectionContent:{className:enc.sectionContent},sectionSeparator:({position:e})=>({className:"before"===e?enc.sectionBefore:enc.sectionAfter})}}),l,c?c((0,oM.A)({},T)):null,(0,eb.jsx)(enE,(0,oM.A)({name:y,className:D.input,value:o,onChange:a,id:s,"aria-hidden":"true",tabIndex:-1,readOnly:x,required:T.required,disabled:T.disabled},b,{ref:A}))]}))}),enN=["label","autoFocus","ownerState","notched"],enB=(0,eT.A)(enI,{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 .${end.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${end.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${end.focused} .${end.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${end.disabled}`]:{[`& .${end.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${end.error} .${end.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:{[`&.${end.focused}:not(.${end.error}) .${end.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}}))}}),enz=(0,eT.A)(enD,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),enF=ew.forwardRef(function(e,t){let n=Qs({props:e,name:"MuiPickersOutlinedInput"}),{label:i,ownerState:r,notched:o}=n,a=(0,YT.A)(n,enN),s=(0,enl.A)(),l=(0,oM.A)({},n,r,s,{color:s?.color||"primary"}),u=(e=>{let{classes:t}=e,n=(0,eC.A)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},enh,t);return(0,oM.A)({},t,n)})(l);return(0,eb.jsx)(enL,(0,oM.A)({slots:{root:enB,input:enz},renderSuffix:e=>(0,eb.jsx)(env,{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)(ew.Fragment,{children:[i," ","*"]}):i,ownerState:l})},a,{label:i,classes:u,ref:t}))});enF.muiName="Input";var enV=n(57867);function enj(e){return(0,eP.Ay)("MuiPickersFilledInput",e)}let enH=(0,oM.A)({},enc,(0,eR.A)("MuiPickersFilledInput",["root","underline","input"])),enW=["label","autoFocus","disableUnderline","ownerState"],en$=(0,eT.A)(enI,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>(0,enV.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}},[`&.${enH.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n},[`&.${enH.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"},[`&.${enH.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${enH.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(.${enH.disabled}, .${enH.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${enH.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:12}},{props:({endAdornment:e})=>!!e,style:{paddingRight:12}}]}}),enG=(0,eT.A)(enD,{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}}]}),enU=ew.forwardRef(function(e,t){let n=Qs({props:e,name:"MuiPickersFilledInput"}),{label:i,disableUnderline:r=!1,ownerState:o}=n,a=(0,YT.A)(n,enW),s=(0,enl.A)(),l=(e=>{let{classes:t,disableUnderline:n}=e,i=(0,eC.A)({root:["root",!n&&"underline"],input:["input"]},enj,t);return(0,oM.A)({},t,i)})((0,oM.A)({},n,o,s,{color:s?.color||"primary"}));return(0,eb.jsx)(enL,(0,oM.A)({slots:{root:en$,input:enG},slotProps:{root:{disableUnderline:r}}},a,{label:i,classes:l,ref:t}))});function enq(e){return(0,eP.Ay)("MuiPickersFilledInput",e)}enU.muiName="Input";let enY=(0,oM.A)({},enc,(0,eR.A)("MuiPickersInput",["root","input"])),enZ=["label","autoFocus","disableUnderline","ownerState"],enX=(0,eT.A)(enI,{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"},[`&.${enY.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${enY.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(.${enY.disabled}, .${enY.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${enY.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),enK=ew.forwardRef(function(e,t){let n=Qs({props:e,name:"MuiPickersInput"}),{label:i,disableUnderline:r=!1,ownerState:o}=n,a=(0,YT.A)(n,enZ),s=(0,enl.A)(),l=(e=>{let{classes:t,disableUnderline:n}=e,i=(0,eC.A)({root:["root",!n&&"underline"],input:["input"]},enq,t);return(0,oM.A)({},t,i)})((0,oM.A)({},n,o,s,{disableUnderline:r,color:s?.color||"primary"}));return(0,eb.jsx)(enL,(0,oM.A)({slots:{root:enX}},a,{label:i,classes:l,ref:t}))});enK.muiName="Input";let enQ=["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"],enJ={standard:enK,filled:enU,outlined:enF},en0=(0,eT.A)(gT.A,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),en1=ew.forwardRef(function(e,t){let n=Qs({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:C,contentEditable:M,focused:A,value:k,onChange:T,fullWidth:I,id:D,name:O,helperText:R,FormHelperTextProps:P,label:E,InputLabelProps:L}=n,N=(0,YT.A)(n,enQ),B=ew.useRef(null),z=(0,eey.A)(t,B),F=(0,Jn.A)(D),V=R&&F?`${F}-helper-text`:void 0,j=E&&F?`${F}-label`:void 0,H=(0,oM.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,eC.A)({root:["root",t&&!n&&"focused",n&&"disabled",r&&"required"]},ens,i)})(H),$=enJ[u];return(0,eb.jsxs)(en0,(0,oM.A)({className:(0,e_.A)(W.root,o),ref:z,focused:A,onFocus:i,onBlur:r,disabled:s,variant:u,error:l,color:a,fullWidth:I,required:c,ownerState:H},N,{children:[(0,eb.jsx)(eno.A,(0,oM.A)({htmlFor:F,id:j},L,{children:E})),(0,eb.jsx)($,(0,oM.A)({elements:g,areAllSectionsEmpty:m,onClick:v,onKeyDown:y,onKeyUp:x,onInput:w,onPaste:b,endAdornment:S,startAdornment:_,tabIndex:C,contentEditable:M,value:k,onChange:T,id:F,fullWidth:I,inputProps:d,inputRef:p,sectionListRef:f,label:E,name:O,role:"group","aria-labelledby":j,"aria-describedby":V,"aria-live":V?"polite":void 0},h)),R&&(0,eb.jsx)(ena.A,(0,oM.A)({id:V},P,{children:R}))]}))}),en2=["enableAccessibleFieldDOMStructure"],en5=["InputProps","readOnly"],en3=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],en4=["slots","slotProps","InputProps","inputProps"],en6=ew.forwardRef(function(e,t){let n=Qs({props:e,name:"MuiDateTimeField"}),{slots:i,slotProps:r,InputProps:o,inputProps:a}=n,s=(0,YT.A)(n,en4),l=i?.textField??(e.enableAccessibleFieldDOMStructure?en1:e$.A),u=(0,Ji.A)({elementType:l,externalSlotProps:r?.textField,externalForwardedProps:s,ownerState:n,additionalProps:{ref:t}});u.inputProps=(0,oM.A)({},a,u.inputProps),u.InputProps=(0,oM.A)({},o,u.InputProps);let c=(e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=(0,YT.A)(e,en2);if(t){let{InputProps:e,readOnly:t}=n,i=(0,YT.A)(n,en5);return(0,oM.A)({},i,{InputProps:(0,oM.A)({},e??{},{readOnly:t})})}let{onPaste:i,onKeyDown:r,inputMode:o,readOnly:a,InputProps:s,inputProps:l,inputRef:u}=n,c=(0,YT.A)(n,en3);return(0,oM.A)({},c,{InputProps:(0,oM.A)({},s??{},{readOnly:a}),inputProps:(0,oM.A)({},l??{},{inputMode:o,onPaste:i,onKeyDown:r,ref:u})})})((e=>{let t,n,i,r,o,{forwardedProps:a,internalProps:s}=(t=Qf().utils,n=Qf().defaultDates,i=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.keyboardDateTime12h:t.formats.keyboardDateTime24h,r=(0,oM.A)({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??i,disableIgnoringDatePartForTimeValidation:!!(e.minDateTime||e.maxDateTime),minDate:Qy(t,e.minDateTime??e.minDate,n.minDate),maxDate:Qy(t,e.maxDateTime??e.maxDate,n.maxDate),minTime:e.minDateTime??e.minTime,maxTime:e.maxDateTime??e.maxTime}),o="date-time",ew.useMemo(()=>{let e=(0,oM.A)({},r),t={},n=n=>{e.hasOwnProperty(n)&&(t[n]=e[n],delete e[n])};return enn.forEach(n),et7.forEach(n),ene.forEach(n),ent.forEach(n),{forwardedProps:e,internalProps:t}},[r,o]));return(e=>{let t=Qf().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,p2.I)(),m=(e=>{let t=Qf().utils,n=Qf().localeText,i=Qf(),r=(0,p2.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:_}=JU({timezone:x,value:c,defaultValue:h,referenceDate:d,onChange:p,valueManager:o}),C=ew.useMemo(()=>{let e;return e=t.date(void 0),"0"===t.formatByString(t.setSeconds(e,0),"s")?JJ:Array.from({length:10}).map((n,i)=>t.formatByString(t.setSeconds(e,i),"s"))},[t]),M=ew.useMemo(()=>((e,t,n)=>{let i=e.date(void 0,n),r=e.endOfYear(i),o=e.endOfDay(i),{maxDaysInMonth:a,longestMonth:s}=Qx(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=JK(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 J0(e.formatByString(e.endOfDay(i),n),t)!==r.toString()?{minimum:1,maximum:Number(J0(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,C,w),[t,C,w]),A=ew.useCallback((e,i=null)=>a.getSectionsFromValue(t,e,i,e=>et4({utils:t,localeText:n,localizedDigits:C,format:f,date:e,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:r})),[a,f,n,C,r,y,t,g,b]),[k,T]=ew.useState(()=>{let e=A(S);J9(e,s);let n={sections:e,value:S,referenceValue:o.emptyValue,tempValueStrAndroid:null},i=Math.max(...e.map(e=>JY[e.type]??1)),r=o.getInitialReferenceValue({referenceDate:d,value:S,utils:t,props:u,granularity:i,timezone:w});return(0,oM.A)({},n,{referenceValue:r})}),[I,D]=(0,Jp.A)({controlled:m,default:null,name:"useField",state:"selectedSections"}),O=e=>{D(e),v?.(e)},R=ew.useMemo(()=>eet(I,k.sections),[I,k.sections]),P="all"===R?0:R,E=({value:e,referenceValue:n,sections:r})=>{if(T(t=>(0,oM.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,oM.A)({},n[e],{value:t,modified:!0}),n};return ew.useEffect(()=>{let e=A(k.value);J9(e,s),T(t=>(0,oM.A)({},t,{sections:e}))},[f,t.locale,r]),ew.useEffect(()=>{o.areValuesEqual(t,k.value,S)&&o.getTimezone(t,k.value)===o.getTimezone(t,S)||T(e=>(0,oM.A)({},e,{value:S,referenceValue:a.updateReferenceValue(t,S,e.referenceValue),sections:A(S)}))},[S]),{state:k,activeSectionIndex:P,parsedSelectedSections:R,setSelectedSections:O,clearValue:()=>{E({value:o.emptyValue,referenceValue:k.referenceValue,sections:A(o.emptyValue)})},clearActiveSection:()=>{if(null==P)return;let e=k.sections[P],n=a.getActiveDateManager(t,k,e),i=n.getSections(k.sections).filter(e=>""!==e.value).length===+(""!==e.value),r=L(P,""),o=i?null:t.getInvalidDate(),s=n.getNewValuesFromNewActiveDate(o);E((0,oM.A)({},s,{sections:r}))},updateSectionValue:({activeSection:e,newSectionValue:n,shouldGoToNextSection:i})=>{let r,o;i&&P<k.sections.length-1&&O(P+1);let s=a.getActiveDateManager(t,k,e),l=L(P,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(J4(a,"non-input",n)))}let a=r.join(" "),s=o.join(" ");return e.parse(s,a)})(t,u,C);if(null!=c&&t.isValid(c)){let e=eee(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?E((0,oM.A)({},r,{sections:l})):T(e=>(0,oM.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=et4({utils:t,localeText:n,localizedDigits:C,format:f,date:o,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:r});return eee(t,o,a,i,!1)}),o=a.updateReferenceValue(t,i,k.referenceValue);E({value:i,referenceValue:o,sections:A(i,k.sections)})},setTempAndroidValueStr:e=>T(t=>(0,oM.A)({},t,{tempValueStrAndroid:e})),getSectionsFromValue:A,sectionsValueBoundaries:M,localizedDigits:C,timezone:w}})(e),{state:v,activeSectionIndex:y,parsedSelectedSections:x,setSelectedSections:b,clearValue:w,clearActiveSection:S,updateSectionValue:_,setTempAndroidValueStr:C,sectionsValueBoundaries:M,localizedDigits:A,timezone:k}=m,T=(({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:i,setTempAndroidValueStr:r,timezone:o})=>{let a=Qf().utils,[s,l]=ew.useState(null),u=(0,Jd.A)(()=>l(null));ew.useEffect(()=>{null!=s&&e[s.sectionIndex]?.type!==s.sectionType&&u()},[e,s,u]),ew.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,Jd.A)(s=>{var l;let u,h,d,p=e[s.sectionIndex],f=J2(s.keyPressed,i)?(l=(0,oM.A)({},s,{keyPressed:J1(s.keyPressed,i)}),u=(e,t)=>{let r=J0(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:J3(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=J8(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=J6(a,i.sectionValue,"MM",t.format);return(0,oM.A)({},i,{sectionValue:r})}if("weekDay"===t.type){let n=u(e,t);if(null!=n.saveQuery)return n;let i=JK(a,t.format)[Number(n.sectionValue)-1];return(0,oM.A)({},n,{sectionValue:i})}return{saveQuery:!1}},e=>J2(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=>JQ(a,o,t.type,e);if("letter"===t.contentType)return h(t.format,r(t.format),e);if(n&&null!=i&&"letter"===JX(a,n).contentType){let t=r(n),o=h(n,t,e);return null!=o.saveQuery?{saveQuery:!1}:(0,oM.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=>J6(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:M,localizedDigits:A,setTempAndroidValueStr:C,timezone:k}),{resetCharacterQuery:I}=T,D=p.areValuesEqual(t,v.value,p.emptyValue),O=o?et6:et9,R=ew.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:P,interactions:E}=O((0,oM.A)({},e,m,T,{areAllSectionsEmpty:D,sectionOrder:R})),L=(0,Jd.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(R.startIndex);else if("all"===x)b(R.endIndex);else{let e=R.neighbors[x].rightIndex;null!==e&&b(e)}break;case"ArrowLeft"===e.key:if(e.preventDefault(),null==x)b(R.endIndex);else if("all"===x)b(R.startIndex);else{let e=R.neighbors[x].leftIndex;null!==e&&b(e)}break;case"Delete"===e.key:if(e.preventDefault(),s)break;null==x||"all"===x?w():S(),I();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(J0(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)?J3(e,d.minimum+(i-d.maximum-1)%(d.maximum-d.minimum+1),d,o,n):i<d.minimum?J3(e,d.maximum-(d.minimum-i-1)%(d.maximum-d.minimum+1),d,o,n):J3(e,i,d,o,n)}let d=JQ(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,M,A,i.date,{minutesStep:r});_({activeSection:n,newSectionValue:o,shouldGoToNextSection:!1})}}});(0,mz.A)(()=>{E.syncSelectionToDOM()});let{hasValidationError:N}=etT({props:n,validator:f,timezone:k,value:v.value,onError:n.onError}),B=ew.useMemo(()=>void 0!==u?u:N,[N,u]);ew.useEffect(()=>{B||null!=y||I()},[v.referenceValue,y,B]),ew.useEffect(()=>{null!=v.tempValueStrAndroid&&null!=y&&(I(),S())},[v.sections]),ew.useImperativeHandle(i,()=>({getSections:()=>v.sections,getActiveSectionIndex:E.getActiveSectionIndexFromDOM,setSelectedSections:E.setSelectedSections,focusField:E.focusField,isFieldFocused:E.isFieldFocused}));let z={onKeyDown:L,onClear:(0,Jd.A)((e,...t)=>{e.preventDefault(),h?.(e,...t),w(),E.isFieldFocused()?b(R.startIndex):E.focusField(0)}),error:B,clearable:!!(c&&!D&&!s&&!a)};return(0,oM.A)({},e.forwardedProps,z,{disabled:a,readOnly:s},P)})({forwardedProps:a,internalProps:s,valueManager:eei,fieldValueManager:eer,validator:et2,valueType:"date-time"})})(u)),h=(e=>{let t=Qf().localeText,{clearable:n,onClear:i,InputProps:r,sx:o,slots:a,slotProps:s}=e,l=(0,YT.A)(e,eni),u=a?.clearButton??eW.A,c=(0,Ji.A)({elementType:u,externalSlotProps:s?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),h=(0,YT.A)(c,enr),d=a?.clearIcon??QR,p=(0,Ji.A)({elementType:d,externalSlotProps:s?.clearIcon,ownerState:{}});return(0,oM.A)({},l,{InputProps:(0,oM.A)({},r,{endAdornment:(0,eb.jsxs)(ew.Fragment,{children:[n&&(0,eb.jsx)(fj.A,{position:"end",sx:{marginRight:r?.endAdornment?-1:-1.5},children:(0,eb.jsx)(u,(0,oM.A)({},h,{onClick:i,children:(0,eb.jsx)(d,(0,oM.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,oM.A)({},c,{slots:i,slotProps:r}));return(0,eb.jsx)(l,(0,oM.A)({},h))});var en8=n(65130),en9=n(43628),en7=n(47196),eie=n(54266),eit=n(54708),ein=n(38086),eii=n(16299),eir=n(85910),eio=n(44766),eia=n(65043),eis=n(72710),eil=n(96962),eiu=n(47918),eic=n(54354),eih=n(8151),eid=n(91733),eip=n(99042),eif=n(89321),eig=n(51148),eim=n(55578),eiv=n(18463),eiy=n(54752),eix=n(36163),eib=n(28850),eiw=n(45350),eiS=n(67619),ei_=n(39270),eiC=n(56756),eiM=n(268),eiA=n(12282),eik=n(41042),eiT=n(38267),eiI=n(47025),eiD=n(30118),eiO=n(84253),eiR=n(98608),eiP=n(8643),eiE=n(18109),eiL=n(19681),eiN=n(73206),eiB=n(53819),eiz=n(96058),eiF=n(682),eiV=n(67671);let eij={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"},eiH={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 eiW{constructor(e){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=eij,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,oM.A)({},eiH,n),this.longFormatters=i,this.lib=r||"date-fns"}}class ei$ extends eiW{constructor({locale:e,formats:t}={}){super({locale:e??eiV.c,formats:t,longFormatters:eis.m}),this.parse=(e,t)=>""===e?null:(0,eiA.qg)(e,t,new Date,{locale:this.locale}),this.isValid=e=>null!=e&&(0,eiM.f)(e),this.format=(e,t)=>this.formatByString(e,this.formats[t]),this.formatByString=(e,t)=>(0,eil.GP)(e,t,{locale:this.locale}),this.isEqual=(e,t)=>null===e&&null===t||null!==e&&null!==t&&(0,eib.n)(e,t),this.isSameYear=(e,t)=>(0,eiS.s)(e,t),this.isSameMonth=(e,t)=>(0,ei_.t)(e,t),this.isSameDay=(e,t)=>(0,eiw.r)(e,t),this.isSameHour=(e,t)=>(0,eiC.l)(e,t),this.isAfter=(e,t)=>(0,eiy.d)(e,t),this.isAfterYear=(e,t)=>(0,eiy.d)(e,(0,eia.Q)(t)),this.isAfterDay=(e,t)=>(0,eiy.d)(e,(0,eir.D)(t)),this.isBefore=(e,t)=>(0,eix.Y)(e,t),this.isBeforeYear=(e,t)=>(0,eix.Y)(e,this.startOfYear(t)),this.isBeforeDay=(e,t)=>(0,eix.Y)(e,this.startOfDay(t)),this.isWithinRange=(e,[t,n])=>(0,eiF.v)(e,{start:t,end:n}),this.startOfYear=e=>(0,eiz.D)(e),this.startOfMonth=e=>(0,eiL.w)(e),this.startOfWeek=e=>(0,eiB.k)(e,{locale:this.locale}),this.startOfDay=e=>(0,eiE.o)(e),this.endOfYear=e=>(0,eia.Q)(e),this.endOfMonth=e=>(0,eiN.p)(e),this.endOfWeek=e=>(0,eio.$)(e,{locale:this.locale}),this.endOfDay=e=>(0,eir.D)(e),this.addYears=(e,t)=>(0,eii.e)(e,t),this.addMonths=(e,t)=>(0,ein.P)(e,t),this.addWeeks=(e,t)=>(0,eit.J)(e,t),this.addDays=(e,t)=>(0,en8.f)(e,t),this.addHours=(e,t)=>(0,eie.L)(e,t),this.addMinutes=(e,t)=>(0,en7.z)(e,t),this.addSeconds=(e,t)=>(0,en9.p)(e,t),this.getYear=e=>(0,eiv.C)(e),this.getMonth=e=>(0,eip.t)(e),this.getDate=e=>(0,eiu.p)(e),this.getHours=e=>(0,eih.q)(e),this.getMinutes=e=>(0,eid.O)(e),this.getSeconds=e=>(0,eif.S)(e),this.getMilliseconds=e=>(0,eig.D)(e),this.setYear=(e,t)=>(0,eiP.i)(e,t),this.setMonth=(e,t)=>(0,eiD.Z)(e,t),this.setDate=(e,t)=>(0,eik.X)(e,t),this.setHours=(e,t)=>(0,eiT.a)(e,t),this.setMinutes=(e,t)=>(0,eiI.g)(e,t),this.setSeconds=(e,t)=>(0,eiO.g)(e,t),this.setMilliseconds=(e,t)=>(0,eiR.$)(e,t),this.getDaysInMonth=e=>(0,eic.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,eim.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 eiG="yyyy-MM-dd HH:mm:ss";function eiU(e,t){let n,i;return e?(0,nW.bB)(e)?e.pastDuration:(n=oo(e.start,eiG,t),i=oo(e.end,eiG,t),`${n} - ${i}`):"Custom Time Range"}let eiq=({initialTimeRange:e,onChange:t,onCancel:n,timeZone:i})=>{let r=["local","browser"].includes(i.toLowerCase())?Intl.DateTimeFormat().resolvedOptions().timeZone:i,[o,a]=(0,ew.useState)(e),[s,l]=(0,ew.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,n$.isValid)(e)&&(0,n$.isValid)(t)?!!(0,n$.isBefore)(e,t)||(console.error("End Time is before Start Time"),!1):(console.error("Invalid Date"),!1))return n};return(0,eb.jsx)(Qc,{dateAdapter:ei$,children:(0,eb.jsxs)(eH.A,{spacing:2,sx:e=>({padding:e.spacing(1,0,2)}),children:[s&&(0,eb.jsxs)(uw.A,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,eb.jsx)(fO.A,{variant:"h3",padding:1,paddingLeft:2,children:"Select Start Time"}),(0,eb.jsx)(et5,{timezone:r,displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:new oi(o.start,r),onChange:e=>{null!==e&&c(e)},onAccept:()=>{l(!1)}})]}),!s&&(0,eb.jsxs)(uw.A,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,eb.jsx)(fO.A,{variant:"h3",padding:1,paddingLeft:2,children:"Select End Time"}),(0,eb.jsx)(et5,{timezone:r,displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:new oi(o.end,r),minDateTime:new oi(o.start,r),onChange:e=>{null!==e&&h(e)},onAccept:e=>{null!==e&&(l(!0),h(e))}})]}),(0,eb.jsxs)(eH.A,{direction:"row",alignItems:"center",gap:1,pl:1,pr:1,children:[(0,eb.jsx)(Fp.ErrorBoundary,{FallbackComponent:Fd,children:(0,eb.jsx)(en6,{"data-testid":"start_time_input",timezone:r,label:"Start Time",value:new oi(o.start,r),onChange:e=>{e&&c(e)},onBlur:()=>d(),format:eiG})}),(0,eb.jsx)(Fp.ErrorBoundary,{FallbackComponent:Fd,children:(0,eb.jsx)(en6,{"data-testid":"end_time_input",timezone:r,label:"End Time",value:new oi(o.end,r),onChange:e=>{e&&h(e)},onBlur:()=>d(),format:eiG})})]}),(0,eb.jsxs)(eH.A,{direction:"row",sx:{padding:e=>e.spacing(0,1)},gap:1,children:[(0,eb.jsx)(eV.A,{variant:"contained",onClick:()=>{let e;(e=d())&&t(e)},fullWidth:!0,children:"Apply"}),(0,eb.jsx)(eV.A,{variant:"outlined",onClick:()=>n(),fullWidth:!0,children:"Cancel"})]})]})})};function eiY({value:e,timeOptions:t,onChange:n,height:i,showCustomTimeRange:r=!0,timeZone:o,timeZoneOptions:a,onTimeZoneChange:s}){let l,{timeZone:u}=uv(),c=o??u,h=(0,ew.useRef)(),[d,p]=(0,ew.useState)(!1),f=(0,ew.useMemo)(()=>(0,nW.bB)(e)?(0,nW.b5)(e):e,[e]),g=(0,ew.useMemo)(()=>{var t;return{value:t=(0,nW.bB)(e)?void 0:e,display:eiU(t,c)}},[e,c]),[m,v]=(0,ew.useState)(!1),y=a??nU(),[x,b]=(0,ew.useState)(null),w=y.find(e=>e.value===c)?.display??c,S=oa(c),_=oa("local"),C=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)(tf.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)(uw.A,{sx:{p:1,minWidth:260},onClick:e=>{e.stopPropagation()},children:(0,eb.jsx)(gF,{options:C,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)(e$.A,{...e,placeholder:"Search timezones",size:"small"})})})}),(0,eb.jsx)(tf.Ay,{anchorEl:h.current,anchorOrigin:{vertical:"bottom",horizontal:"center"},open:d,onClose:()=>p(!1),sx:e=>({padding:e.spacing(2)}),children:(0,eb.jsx)(eiq,{initialTimeRange:f,onChange:e=>{n(e),p(!1),v(!1)},onCancel:()=>p(!1),timeZone:c})}),(0,eb.jsx)(uw.A,{ref:h,children:(0,eb.jsxs)(pK.A,{open:m,value:eiU(e,c),onClick:()=>v(!m),IconComponent:Qi,renderValue:()=>(0,eb.jsxs)(eH.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,eb.jsx)("span",{children:t.find(t=>eiU(t.value,c)===eiU(e,c))?.display??eiU(e,c)}),S!==_&&(0,eb.jsxs)(uw.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)(pX.A,{disableRipple:!0,onClick:e=>{e.preventDefault(),e.stopPropagation()},sx:{cursor:"default","&:hover":{backgroundColor:"transparent"},py:.5,px:1},children:(0,eb.jsxs)(uw.A,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[(0,eb.jsxs)(uw.A,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,eb.jsx)(uw.A,{sx:{typography:"subtitle1"},children:"Time Range"}),(0,eb.jsxs)(uw.A,{sx:{color:"text.secondary",typography:"caption",mt:.25},children:["Timezone: ",w]})]}),(0,eb.jsx)(uw.A,{sx:{display:"flex",alignItems:"center",pr:1,ml:1.5},children:(0,eb.jsx)(eW.A,{size:"small","aria-label":"Select timezone",onClick:e=>{e.preventDefault(),e.stopPropagation(),b(e.currentTarget)},children:(0,eb.jsx)(Qr,{fontSize:"small"})})})]})}),t.map((e,t)=>(0,eb.jsx)(pX.A,{value:eiU(e.value,c),onClick:()=>{n(e.value)},children:e.display},t)),r&&(0,eb.jsx)(pX.A,{value:eiU(g.value,c),onClick:()=>p(!0),children:g.display})]})})]})}function eiZ({value:e,onChange:t,timeZoneOptions:n,variant:i="standard",heightPx:r,...o}){let a,s=(0,ew.useMemo)(()=>n??nU(),[n]);r&&(a="number"==typeof r?`${r}px`:r);let l=(0,ew.useMemo)(()=>({minWidth:"compact"===i?"80px":"150px",...a&&{lineHeight:a,paddingY:0},...o.sx}),[i,a,o.sx]);return(0,eb.jsx)(pK.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)(pX.A,{value:e.value,children:e.display},e.value))})}function eiX(e){let{markerColor:t,sx:n}=e;return(0,eb.jsx)(uw.A,{sx:rP({display:"inline-block",width:"11px",height:"11px",borderRadius:"2px",marginRight:1,verticalAlign:"top"},n),style:{backgroundColor:t}})}function eiK(e){let{formattedY:t,markerColor:n,metricName:i,metricLabels:r}=e;return(0,eb.jsxs)(eH.A,{spacing:.5,children:[(0,eb.jsxs)(uw.A,{sx:e=>({display:"flex",height:"16px",flexDirection:"row",alignItems:"center",justifyContent:"left",color:e.palette.common.white,fontSize:"11px"}),children:[(0,eb.jsx)(eiX,{markerColor:n,sx:{marginTop:.25}}),(0,eb.jsxs)(uw.A,{component:"span",children:[i,(0,eb.jsx)(uw.A,{component:"span",sx:e=>({color:e.palette.common.white,fontWeight:700,paddingLeft:"2px"}),children:t})]})]}),(0,eb.jsx)(fz.A,{sx:e=>({borderColor:e.palette.grey["500"]})}),(0,eb.jsx)(uw.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)(uw.A,{sx:{display:"flex",gap:"4px"},children:[(0,eb.jsx)(fO.A,{sx:{fontSize:"11px"},children:i}),(0,eb.jsx)(fO.A,{sx:e=>({color:e.palette.common.white,fontWeight:700,fontSize:"11px"}),children:r})]},e)}})})]})}let eiQ=375,eiJ=650,ei0=650,ei1=500,ei2=.75,ei5=8,ei3=750,ei4="nearby series showing in tooltip",ei6="emphasized series showing as bold in tooltip",ei8="#2E313E",ei9=new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}),ei7={coords:{plotCanvas:{x:0,y:0},zrender:{x:0,y:0},target:null},chartWidth:0},ere=[],ert=()=>{let[e,t]=(0,ew.useState)(null);return(0,ew.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},ern={wrapLabels:!0,enablePinning:!0},eri="Click chart to pin",err="Click chart to unpin";function ero(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)(eiK,{formattedY:n,metricName:e,metricLabels:l,markerColor:i})}let u=t.replace(/[,]/g,", ");return(0,eb.jsxs)(uw.A,{sx:{display:"table-row",paddingTop:.5},children:[(0,eb.jsxs)(uw.A,{sx:{display:"table-cell",maxWidth:"520px"},children:[(0,eb.jsx)(eiX,{markerColor:i,sx:{marginTop:.5}}),(0,eb.jsx)(uw.A,{component:"span",sx:e=>({display:"inline-block",width:"calc(100% - 20px)",minWidth:150,maxWidth:ei1,overflow:"hidden",color:e.palette.common.white,fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular,textOverflow:"ellipsis",whiteSpace:a?"normal":"nowrap"}),"aria-label":o?ei6:ei4,children:u})]}),(0,eb.jsx)(uw.A,{sx:e=>({display:"table-cell",paddingLeft:1.5,textAlign:"right",verticalAlign:"top",fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular}),children:n})]})}var era=n(36961);function ers(e,t,n){return e[t]?e[t][0]?e[t][0][n]:e[t][n]:"contentBoxSize"===t?e.contentRect["inlineSize"===n?"width":"height"]:void 0}function erl(e,t,n,i,r){if(null===e||(null!==t&&(e=t),void 0===e.plotCanvas.x))return;let o=n>0?n:ei0,a=i>0?i:eiJ,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,ei5/2))}else l+o>window.innerHeight+window.scrollY&&(l=Math.max(window.innerHeight+window.scrollY-o-16,ei5/2));return s+a>window.innerWidth&&(s=e.page.x-a-32),s<32&&(s=32),l<ei5/2&&(l=ei5/2),`translate3d(${s}px, ${l}px, 0)`}function eru(e,t,n){return{minWidth:eiQ,maxWidth:eiJ,maxHeight:(n?n-ei5:void 0)??ei0,padding:0,position:"absolute",top:0,left:0,backgroundColor:e.palette.designSystem?.grey[800]??ei8,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 erc(e,t){try{let n=t.convertToPixel("grid",[e,0]);return n?.[0]??null}catch{return null}}function erh(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 erd(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=erc(e,n);if(null===l)return 20;if(null!==a&&null!==s){let e=erc(a,n)??l,t=erc(s,n)??l;i=(l+e)/2,r=(l+t)/2}else if(null!==a){let e=erc(a,n)??l;i=(l+e)/2,r=l+(l-i)}else{if(null===s)return 20;let e=erc(s,n)??l;r=(l+e)/2,i=l-(r-l)}return Math.max(1,r-i)}function erp(e,t,n,i){let r=t/Math.max(1,i),o=n-t/2+e*r;return{left:o,right:o+r}}function erf(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 erg=5.5,erm=30,erv=5;function ery(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 ere;let h=rO(e[0]?.values,u);if(null===h)return ere;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??erc(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=erd(n,d,l),m=erc(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,C=0;for(let e=0;e<y.length;e++){let t=y[e];if(t&&t[0]===n){_=e,C=t[0],c=t[1];break}}if(-1===_||null==c)continue;let M=!1,A=c,k=1/0;if("line"===x)if(A=erh(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]);M=t<=s,k=t}else{let e=Math.abs(A-i);M=e<=a,k=e}}catch{let e=Math.abs(A-i);M=e<=a,k=e}else{let e=Math.abs(A-i);M=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=erp(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=erf(h.get(e)??0,A=erh(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),M=!0}M&&u.push({seriesIdx:d,datumIdx:_,seriesId:w,seriesName:b,date:n,markerColor:S,x:C,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=ra(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 rI(r,a,s,l,u,c),d}(f,g,o,a,r,v)}function erx(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=erw({valueToCheck:s,baseValue:v,percentage:Math.max(h>erv?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=ra(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 erb({mousePos:e,pinnedPos:t,data:n,seriesMapping:i,chart:r,format:o,seriesFormatMap:a,showAllSeries:s=!1}){if(void 0===r||null===e)return ere;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 ere;let u=e.plotCanvas.y,c=e.plotCanvas.x,h=rT(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=erS({yInterval:l,totalSeries:n.length,showAllSeries:s}),p=i.some(e=>void 0!==e.yAxisIndex&&e.yAxisIndex>0);return ery(n,i,h,d,r,o,a,p?u:void 0,c)}return ere}function erw({valueToCheck:e,baseValue:t,percentage:n}){let i=n/100*t;return e>=t-i&&e<=t+i}function erS({yInterval:e,totalSeries:t,showAllSeries:n=!1}){if(n)return 10*e;let i=.3*e;return t>erv?Math.max(i,e*erm/t):Math.max(i,e*erg)}function er_(e){let{series:t,wrapLabels:n}=e,i=(0,ew.useMemo)(()=>null===t?null:t.sort((e,t)=>e.y>t.y?-1:1),[t]);return null===t||null===i?null:(0,eb.jsx)(uw.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)(ero,{seriesName:r,y:o,formattedY:a,markerColor:s,totalSeries:i.length,wrapLabels:n,emphasizeText:l},u)})})}var erC=n(68003),erM=n(4491),erA=n(29917);let erk=(0,ew.memo)(function({nearbySeries:e,totalSeries:t,isTooltipPinned:n,showAllSeries:i,enablePinning:r=!0,onShowAllClick:o,onUnpinClick:a}){let s,l,u,{formatWithUserTimeZone:c}=uv(),h=e[0]?.date??null;if(null===h)return null;let d=r&&t>5;return(0,eb.jsxs)(uw.A,{sx:e=>({width:"100%",maxWidth:eiJ,padding:e.spacing(1.5,2,.5,2),backgroundColor:e.palette.designSystem?.grey[800]??ei8,position:"sticky",top:0,left:0}),children:[(0,eb.jsxs)(uw.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)(uw.A,{children:[(0,eb.jsx)(fO.A,{variant:"caption",sx:e=>({color:e.palette.common.white}),children:l}),(0,eb.jsx)(fO.A,{variant:"caption",children:(0,eb.jsx)("strong",{children:u})})]})),(0,eb.jsxs)(eH.A,{direction:"row",gap:1,sx:{marginLeft:"auto"},children:[d&&(0,eb.jsxs)(eH.A,{direction:"row",gap:.5,alignItems:"center",sx:{textAlign:"right"},children:[(0,eb.jsx)(fO.A,{sx:{fontSize:11},children:"Show All"}),(0,eb.jsx)(erC.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)(eH.A,{direction:"row",alignItems:"center",children:[(0,eb.jsx)(fO.A,{sx:{marginRight:.5,fontSize:11,verticalAlign:"middle"},children:n?err:eri}),n?(0,eb.jsx)(erM,{onClick:()=>{void 0!==a&&a()},sx:{fontSize:16,cursor:"pointer"}}):(0,eb.jsx)(erA,{sx:{fontSize:16}})]})]})]}),(0,eb.jsx)(fz.A,{sx:e=>({width:"100%",borderColor:e.palette.grey["500"]})})]})}),erT=(0,ew.memo)(function({containerId:e,chartRef:t,data:n,seriesMapping:i,enablePinning:r=!0,wrapLabels:o,format:a,seriesFormatMap:s,onUnpinClick:l,pinnedPos:u}){var c,h,d,p,f,g,m,v,y,x,b,w,S,_,C,M,A;let[k,T]=(0,ew.useState)(!1),I=(0,ew.useRef)(),D=(0,ew.useRef)(null),O=ert(),{height:R,width:P,ref:E}=(void 0===c&&(c={}),h=c.onResize,(d=(0,ew.useRef)(void 0)).current=h,p=c.round||Math.round,f=(0,ew.useRef)(),m=(g=(0,ew.useState)({width:void 0,height:void 0}))[0],v=g[1],y=(0,ew.useRef)(!1),(0,ew.useEffect)(function(){return y.current=!1,function(){y.current=!0}},[]),x=(0,ew.useRef)({width:void 0,height:void 0}),b=(0,ew.useCallback)(function(e){return f.current&&f.current.box===c.box&&f.current.round===p||(f.current={box:c.box,round:p,instance:new ResizeObserver(function(e){var t=e[0],n="border-box"===c.box?"borderBoxSize":"device-pixel-content-box"===c.box?"devicePixelContentBoxSize":"contentBoxSize",i=ers(t,n,"inlineSize"),r=ers(t,n,"blockSize"),o=i?p(i):void 0,a=r?p(r):void 0;if(x.current.width!==o||x.current.height!==a){var s={width:o,height:a};x.current.width=o,x.current.height=a,d.current?d.current(s):y.current||v(s)}})}),f.current.instance.observe(e,{box:c.box}),function(){f.current&&f.current.instance.unobserve(e)}},[c.box,p]),w=c.ref,S=(0,ew.useRef)(null),(_=(0,ew.useRef)(null)).current=w,C=(0,ew.useRef)(null),(0,ew.useEffect)(function(){M()}),M=(0,ew.useCallback)(function(){var e=C.current,t=_.current,n=e||(t?t instanceof Element?t:t.current:null);S.current&&S.current.element===n&&S.current.subscriber===b||(S.current&&S.current.cleanup&&S.current.cleanup(),S.current={element:n,subscriber:b,cleanup:n?b(n):void 0})},[b]),(0,ew.useEffect)(function(){return function(){S.current&&S.current.cleanup&&(S.current.cleanup(),S.current=null)}},[]),A=(0,ew.useCallback)(function(e){C.current=e,M()},[M]),(0,ew.useMemo)(function(){return{ref:A,width:m.width,height:m.height}},[A,m.width,m.height])),L=null!==u&&r,N=(0,ew.useCallback)(e=>{D.current=e,E(e)},[E]),B=e?document.querySelector(e):void 0;if((0,ew.useLayoutEffect)(()=>{if(null===O)return;let e=D.current;if(!e)return;let t=e.getBoundingClientRect();if(0===t.height||0===t.width)return;let n=erl(O,u,t.height,t.width,B);n&&n!==I.current&&(I.current=n,e.style.transform=n)}),null===O||null===O.target||null===n||null===u&&"CANVAS"!==O.target.tagName)return null;let z=t.current,F=B?B.getBoundingClientRect().height:void 0;I.current=erl(O,u,R??0,P??0,B);let V=erb({mousePos:O,data:n,seriesMapping:i,pinnedPos:u,chart:z,format:a,seriesFormatMap:s,showAllSeries:k});if(0===V.length)return null;let j=n.length;return(0,eb.jsx)(era.A,{container:B,children:(0,eb.jsx)(uw.A,{ref:N,sx:e=>eru(e,u,F),style:{transform:I.current},children:(0,eb.jsxs)(eH.A,{spacing:.5,children:[(0,eb.jsx)(erk,{nearbySeries:V,totalSeries:j,enablePinning:r,isTooltipPinned:L,showAllSeries:k,onShowAllClick:e=>T(e),onUnpinClick:l}),(0,eb.jsx)(er_,{series:V,wrapLabels:o})]})})})}),erI=(0,eT.A)(eV.A)(({theme:e})=>({padding:e.spacing(.5),minWidth:"auto"})),erD=(0,ew.forwardRef)(function(e,t){return(0,eb.jsx)(erI,{ref:t,variant:"outlined",color:"secondary",...e})}),erO=Object.entries(ro).map(([e,t])=>({...t,id:e,group:t.group||"Decimal"})).filter(e=>!e.disableSelectorOption);function erR({value:e,onChange:t,disabled:n=!1,...i}){let r=ro[e?.unit||"decimal"];return(0,eb.jsx)(gF,{value:{id:e?.unit||"decimal",...r},options:erO,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)(e$.A,{...i,slotProps:{input:{...e,endAdornment:(0,eb.jsxs)(eb.Fragment,{children:[e.endAdornment,(0,eb.jsx)(fj.A,{position:"end",children:(0,eb.jsx)(eW.A,{size:"small","aria-label":"clear unit",onClick:()=>t(void 0),disabled:n,tabIndex:-1,children:(0,eb.jsx)(f6,{fontSize:"small"})})})]})}}}),...i})}let erP=[{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 erE({value:e,onChange:t,disabled:n=!1}){var i;let r=rg(e),o=rm(e);return(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(gE,{label:"Short values",control:(0,eb.jsx)(erC.A,{checked:!!o&&n9(e.shortValues),onChange:(n,i)=>{o&&t({...e,shortValues:i})},disabled:!o})}),(0,eb.jsx)(gE,{label:"Unit",control:(0,eb.jsx)(erR,{value:e,onChange:e=>{t(e||{unit:"decimal"})},disabled:n})}),(0,eb.jsx)(gE,{label:"Decimals",control:(0,eb.jsx)(gF,{value:(i=e.decimalPlaces,erP.find(e=>e.decimalPlaces===i)),options:erP,getOptionLabel:e=>e.label,onChange:(n,i)=>(({decimalPlaces:n})=>{r&&t({...e,decimalPlaces:n})})(i),disabled:!r,disableClearable:!0})})]})}function erL({name:e,height:t}){return(0,eb.jsx)(uw.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)(fO.A,{variant:"body1","aria-label":"y axis label",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})}var erN=n(74626);let erB=oy((0,erN.A)({}),{echartsTheme:{textStyle:{fontFamily:"Lato"},categoryAxis:{splitLine:{show:!1}},timeAxis:{splitLine:{show:!1}},bar:{barCategoryGap:2}}}),erz={chartsTheme:erB,enablePinning:!1,enableSyncGrouping:!0,lastTooltipPinnedCoords:null,setLastTooltipPinnedCoords:()=>null};var erF=n(52855);let erV={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,[`& .${erF.A.icon}`]:{color:e.palette.error.main}}:{...e.typography.body1,backgroundColor:e.palette.error.light,color:e.palette.error.dark,[`& .${erF.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,[`& .${erF.A.icon}`]:{color:e.palette.info.main}}:{...e.typography.body1,backgroundColor:e.palette.info.light,color:e.palette.info.dark,[`& .${erF.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,[`& .${erF.A.icon}`]:{color:e.palette.success.main}}:{...e.typography.body1,backgroundColor:e.palette.success.light,color:e.palette.success.dark,[`& .${erF.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,[`& .${erF.A.icon}`]:{color:e.palette.warning.main}}:{...e.typography.body1,backgroundColor:e.palette.warning.light,color:e.palette.warning.dark,[`& .${erF.A.icon}`]:{color:e.palette.warning.main}},root:{["& ."+n(82561).A.root]:{textDecoration:"underline"}}}},erj={styleOverrides:{root:({theme:e})=>({backgroundColor:e.palette.background.default})}},erH={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"},erW="#FFFFFF",er$={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"},erG={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"},erU={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"},erq={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"},erY={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"},erZ=e=>"light"===e?{main:erH["500"],dark:erH["600"],light:erH["50"]}:{main:erH["400"],dark:erH["800"],light:erH["200"]},erX={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"}},erK=({theme:e})=>({..."light"===e.palette.mode?{}:{backgroundImage:"unset",backgroundColor:e.palette.designSystem.grey[800]}});function erQ(e,t={},n=!1){var i,r;let o;return(0,erN.A)({palette:function(e){let t,n,i,r;return{mode:e,primary:erZ(e),secondary:"light"===e?{main:er$["600"],dark:er$["900"],light:er$["100"]}:{main:erW,dark:erW,light:erW},grey:"light"===e?{50:er$["50"],100:er$["100"],200:er$["200"],300:er$["300"],400:er$["400"],500:er$["500"],600:er$["600"],700:er$["700"],800:er$["800"],900:er$["900"],950:er$["950"]}:{50:er$["950"],100:er$["900"],200:er$["800"],300:er$["700"],400:er$["600"],500:er$["500"],600:er$["400"],700:er$["300"],800:er$["200"],900:er$["100"],950:er$["50"]},background:(t=erH["150"],n="rgba(21, 23, 33, 0.75)","light"===e?{navigation:t,overlay:n,default:erW,paper:er$["50"],code:er$["50"],tooltip:er$["100"],lighter:er$["50"],border:er$["100"]}:{navigation:t,overlay:n,default:er$["900"],paper:er$["850"],code:er$["800"],tooltip:er$["600"],lighter:er$["700"],border:er$["600"]}),text:(i=er$["800"],r=er$["300"],"light"===e?{navigation:i,accent:r,primary:er$["800"],secondary:er$["700"],disabled:er$["300"],link:erH["500"],linkHover:erH["600"]}:{navigation:i,accent:r,primary:erW,secondary:er$["50"],disabled:er$["600"],link:erH["400"],linkHover:erH["500"]}),error:"light"===e?{main:erY["500"],dark:erY["600"],light:erY["50"]}:{main:erY["400"],dark:erY["800"],light:erY["300"]},warning:"light"===e?{main:erU["500"],dark:erU["700"],light:erU["50"]}:{main:erU["400"],dark:erU["800"],light:erU["300"]},info:erZ(e),success:"light"===e?{main:erG["500"],dark:erG["700"],light:erG["50"]}:{main:erG["400"],dark:erG["800"],light:erG["300"]},common:{white:erW,black:"#000000"},designSystem:{blue:erH,green:erG,grey:er$,orange:erU,purple:erq,red:erY}}}(e),typography:erX,mixins:{},components:(i=e,r=n,o={MuiAlert:erV,MuiFormControl:{defaultProps:{size:"small"}},MuiPaper:erj,MuiTextField:{defaultProps:{size:"small"}},MuiDrawer:{styleOverrides:{paper:erK}},MuiDialog:{styleOverrides:{paper:erK}},MuiPopover:{styleOverrides:{paper:erK}}},r?o:{MuiCssBaseline:{styleOverrides:{body:{colorScheme:i}}},...o}),...t})}var erJ=n(87275),er0=n(11061),er1=n(78536),er2=n(1355);function er5({value:e,onChange:t}){return(0,eb.jsxs)(eH.A,{direction:"row",children:[(0,eb.jsx)(gB.A,{freeSolo:!0,multiple:!0,id:"join-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,eb.jsx)(e$.A,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,i)=>{t({...e,spec:{...e.spec,columns:i}})}}),(0,eb.jsx)(Kj.A,{label:"Enabled",labelPlacement:"start",control:(0,eb.jsx)(erC.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function er3({value:e,onChange:t}){return(0,eb.jsxs)(eH.A,{direction:"row",gap:1,alignItems:"center",children:[(0,eb.jsx)(gB.A,{freeSolo:!0,multiple:!0,id:"merge-columns-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,eb.jsx)(e$.A,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,i)=>{t({...e,spec:{...e.spec,columns:i}})}}),(0,eb.jsx)(gn,{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)(Kj.A,{label:"Enabled",labelPlacement:"start",control:(0,eb.jsx)(erC.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function er4({value:e,onChange:t}){return(0,eb.jsxs)(eH.A,{direction:"row",children:[(0,eb.jsx)(gn,{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)(Kj.A,{label:"Enabled",labelPlacement:"start",control:(0,eb.jsx)(erC.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function er6({value:e,onChange:t}){return(0,eb.jsx)(eH.A,{direction:"row",children:(0,eb.jsx)(Kj.A,{label:"Enabled",labelPlacement:"start",control:(0,eb.jsx)(erC.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})})}function er8({value:e,onChange:t,...n}){return(0,eb.jsxs)(eH.A,{gap:2,sx:{width:"100%"},mt:1,...n,children:[(0,eb.jsxs)(gn,{select:!0,label:"Kind",value:e.kind,onChange:n=>t({...e,kind:n}),children:[(0,eb.jsx)(pX.A,{value:"JoinByColumnValue",children:(0,eb.jsxs)(eH.A,{children:[(0,eb.jsx)(fO.A,{children:"Join by column value"}),(0,eb.jsx)(fO.A,{variant:"caption",children:"Regroup rows with equal cell value in a column"})]})}),(0,eb.jsx)(pX.A,{value:"MergeColumns",children:(0,eb.jsxs)(eH.A,{children:[(0,eb.jsx)(fO.A,{children:"Merge columns"}),(0,eb.jsx)(fO.A,{variant:"caption",children:"Multiple columns are merged to one column"})]})}),(0,eb.jsx)(pX.A,{value:"MergeIndexedColumns",children:(0,eb.jsxs)(eH.A,{children:[(0,eb.jsx)(fO.A,{children:"Merge indexed columns"}),(0,eb.jsx)(fO.A,{variant:"caption",children:"Indexed columns are merged to one column"})]})}),(0,eb.jsx)(pX.A,{value:"MergeSeries",children:(0,eb.jsxs)(eH.A,{children:[(0,eb.jsx)(fO.A,{children:"Merge series"}),(0,eb.jsx)(fO.A,{variant:"caption",children:"Series will be merged by their labels"})]})})]}),"JoinByColumnValue"===e.kind&&(0,eb.jsx)(er5,{value:e,onChange:t}),"MergeColumns"===e.kind&&(0,eb.jsx)(er3,{value:e,onChange:t}),"MergeIndexedColumns"===e.kind&&(0,eb.jsx)(er4,{value:e,onChange:t}),"MergeSeries"===e.kind&&(0,eb.jsx)(er6,{value:e,onChange:t})]})}function er9({index:e,value:t,isCollapsed:n,onChange:i,onCollapse:r,onDelete:o,...a}){return(0,eb.jsxs)(eH.A,{...a,children:[(0,eb.jsxs)(eH.A,{direction:"row",alignItems:"center",borderBottom:1,borderColor:e=>e.palette.divider,justifyContent:"space-between",gap:4,children:[(0,eb.jsxs)(eH.A,{direction:"row",gap:1,children:[(0,eb.jsx)(eW.A,{"data-testid":`transform-toggle#${e}`,size:"small",onClick:()=>r(!n),children:n?(0,eb.jsx)(er0,{}):(0,eb.jsx)(erJ,{})}),(0,eb.jsx)(fO.A,{variant:"overline",component:"h4",sx:{textTransform:"none"},children:t.kind?(0,eb.jsx)("span",{children:(0,eb.jsx)("strong",{children:rw[t.kind]})}):(0,eb.jsx)("strong",{children:"Select a transformation kind"})})]}),(0,eb.jsxs)(eH.A,{direction:"row",gap:1,children:[n&&(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(f3,{title:t.spec?.disabled?"Enable transformation":"Disable transformation",placement:"top",children:(0,eb.jsx)(eW.A,{size:"small",sx:{marginLeft:"auto"},onClick:function(){i({...t,spec:{...t.spec,disabled:!t.spec?.disabled}})},children:t.spec?.disabled?(0,eb.jsx)(er1,{}):(0,eb.jsx)(er2,{})})}),(0,eb.jsx)(fz.A,{flexItem:!0,orientation:"vertical",variant:"middle"})]}),(0,eb.jsx)(f3,{title:"Remove transformation",placement:"top",children:(0,eb.jsx)(eW.A,{size:"small",sx:{marginLeft:"auto"},onClick:o,children:(0,eb.jsx)(K7,{})})})]})]}),!n&&(0,eb.jsx)(er8,{value:t,onChange:i})]})}function er7({value:e,onChange:t,...n}){let[i,r]=(0,ew.useState)(e.map(()=>!0));return(0,eb.jsxs)(eH.A,{gap:1,...n,children:[e.map((n,o)=>(0,eb.jsx)(er9,{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)(eV.A,{variant:"contained",startIcon:(0,eb.jsx)(K9,{}),sx:{marginTop:1},onClick:function(){let n=[...e];n.push({kind:"",spec:{}}),t(n),r(e=>(e.push(!1),[...e]))},children:"Add Transformation"})]})}function eoe(e){let{value:t,onChange:n,timeOptions:i,height:r}=e,o=(0,ew.useMemo)(()=>{if(t&&!i.some(e=>e.value.pastDuration===t))return(0,eb.jsx)(pX.A,{value:t,children:t})},[i,t]);return(0,eb.jsx)(gT.A,{children:(0,eb.jsx)(uw.A,{children:(0,eb.jsxs)(pK.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)(pX.A,{value:e.value.pastDuration,children:e.display},t)),o]})})})}function eot({repeatItems:e,maxPer:t,gap:n,renderItem:i,containerSx:r,rowSx:o}){let{rows:a,perRow:s}=(0,ew.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)(uw.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)(uw.A,{sx:[{display:"flex",gap:`${n}px`},...Array.isArray(o)?o:[o]],children:e.map((e,r)=>(0,eb.jsx)(uw.A,{sx:{width:`calc((100% - ${n*(s-1)}px) / ${s})`,overflow:"hidden"},children:i(e,{rowIndex:t,colIndex:r})},`${t}-${r}`))},t))})}var eon=n(54381);let eoi=({mapping:e,onChange:t,...n})=>{switch(e.kind){case"Value":return(0,eb.jsx)(eH.A,{gap:1,direction:"row",...n,children:(0,eb.jsx)(e$.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)(eH.A,{gap:1,direction:"row",...n,children:[(0,eb.jsx)(e$.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)(e$.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)(eH.A,{gap:1,direction:"row",...n,children:(0,eb.jsx)(e$.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)(eH.A,{gap:1,direction:"row",...n,children:(0,eb.jsxs)(e$.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)(pX.A,{value:"empty",children:(0,eb.jsxs)(eH.A,{children:[(0,eb.jsx)(fO.A,{children:"Empty"}),(0,eb.jsx)(fO.A,{variant:"caption",children:"Matches empty string"})]})}),(0,eb.jsx)(pX.A,{value:"null",children:(0,eb.jsxs)(eH.A,{children:[(0,eb.jsx)(fO.A,{children:"Null"}),(0,eb.jsx)(fO.A,{variant:"caption",children:"Matches null or undefined"})]})}),(0,eb.jsx)(pX.A,{value:"NaN",children:(0,eb.jsxs)(eH.A,{children:[(0,eb.jsx)(fO.A,{children:"NaN"}),(0,eb.jsx)(fO.A,{variant:"caption",children:"Matches Not a Number value"})]})}),(0,eb.jsx)(pX.A,{value:"true",children:(0,eb.jsxs)(eH.A,{children:[(0,eb.jsx)(fO.A,{children:"True"}),(0,eb.jsx)(fO.A,{variant:"caption",children:"Matches true boolean"})]})}),(0,eb.jsx)(pX.A,{value:"false",children:(0,eb.jsxs)(eH.A,{children:[(0,eb.jsx)(fO.A,{children:"False"}),(0,eb.jsx)(fO.A,{variant:"caption",children:"Matches false boolean"})]})})]})});default:return null}},eor=({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)(eon.A,{container:!0,spacing:2,...i,children:[(0,eb.jsx)(eon.A,{size:{xs:5},children:(0,eb.jsxs)(eH.A,{direction:"row",gap:1,width:"100%",children:[(0,eb.jsxs)(e$.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)(pX.A,{value:"Value",children:(0,eb.jsxs)(eH.A,{children:[(0,eb.jsx)(fO.A,{children:"Value"}),"Value"!==e.kind&&(0,eb.jsx)(fO.A,{variant:"caption",children:"Matches an exact text value"})]})}),(0,eb.jsx)(pX.A,{value:"Range",children:(0,eb.jsxs)(eH.A,{children:[(0,eb.jsx)(fO.A,{children:"Range"}),"Range"!==e.kind&&(0,eb.jsx)(fO.A,{variant:"caption",children:"Matches against a numerical range"})]})}),(0,eb.jsx)(pX.A,{value:"Regex",children:(0,eb.jsxs)(eH.A,{children:[(0,eb.jsx)(fO.A,{children:"Regex"}),"Regex"!==e.kind&&(0,eb.jsx)(fO.A,{variant:"caption",children:"Matches against a regular expression"})]})}),(0,eb.jsx)(pX.A,{value:"Misc",children:(0,eb.jsxs)(eH.A,{children:[(0,eb.jsx)(fO.A,{children:"Misc"}),"Misc"!==e.kind&&(0,eb.jsx)(fO.A,{variant:"caption",children:"Matches against empty, null and NaN values"})]})})]}),(0,eb.jsx)(eoi,{width:"100%",mapping:e,onChange:n=>t({...e,...n})})]})}),(0,eb.jsx)(eon.A,{size:{xs:4},children:(0,eb.jsx)(e$.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)(eon.A,{size:{xs:1},children:(0,eb.jsx)(eH.A,{direction:"row",justifyContent:"center",gap:1,children:e.spec?.result?.color?(0,eb.jsx)(uy,{label:"Color",color:e.spec.result.color??"#000",onColorChange:r,onClear:()=>r(void 0)}):(0,eb.jsx)(eW.A,{onClick:()=>r("#000"),children:(0,eb.jsx)(K9,{})})})}),(0,eb.jsx)(eon.A,{size:{xs:1},textAlign:"end",children:(0,eb.jsx)(f3,{title:"Remove mapping settings",placement:"top",children:(0,eb.jsx)(eW.A,{size:"small",sx:{marginLeft:"auto"},onClick:n,children:(0,eb.jsx)(K7,{})})})})]})},eoo=({mappings:e,onChange:t})=>{let[n,i]=(0,ew.useState)(e);return(0,eb.jsxs)(eH.A,{spacing:1,children:[(0,eb.jsxs)(eon.A,{container:!0,spacing:2,children:[(0,eb.jsx)(eon.A,{size:{xs:5},children:(0,eb.jsx)(fO.A,{variant:"subtitle1",children:"Condition"})}),(0,eb.jsx)(eon.A,{size:{xs:4},children:(0,eb.jsx)(fO.A,{variant:"subtitle1",children:"Display Text"})}),(0,eb.jsx)(eon.A,{size:{xs:1},textAlign:"center",children:(0,eb.jsx)(fO.A,{variant:"subtitle1",children:"Color"})}),(0,eb.jsx)(eon.A,{size:{xs:1}})]}),(0,eb.jsx)(eH.A,{gap:1.5,divider:(0,eb.jsx)(fz.A,{flexItem:!0,orientation:"horizontal"}),children:n.map((e,r)=>(0,eb.jsx)(eor,{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)(eV.A,{variant:"contained",startIcon:(0,eb.jsx)(K9,{}),sx:{marginTop:1},onClick:function(){let e=[...n];e.push({kind:"Value",spec:{result:{value:""}}}),i(e),t(e)},children:"Add value mappings"})]})}}}]);