@perses-dev/heatmap-chart-plugin 0.5.0 → 0.6.0-beta.2

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 (94) hide show
  1. package/__mf/js/{HeatMapChart.6c4e6e06.js → HeatMapChart.6613b45e.js} +7 -7
  2. package/__mf/js/async/121.e63b0807.js +2 -0
  3. package/__mf/js/async/362.8b36602d.js +1 -0
  4. package/__mf/js/async/392.f80b3f92.js +2 -0
  5. package/__mf/js/async/470.6b4b5f7b.js +2 -0
  6. package/__mf/js/async/569.8e18ce20.js +71 -0
  7. package/__mf/js/async/888.52ddc939.js +1 -0
  8. package/__mf/js/async/941.ea6b3111.js +2 -0
  9. package/__mf/js/async/963.9dc879ab.js +1 -0
  10. package/__mf/js/async/{980.03e0a41f.js → 980.f28cf53e.js} +2 -2
  11. package/__mf/js/async/{__federation_expose_HeatMapChart.b3d43042.js → __federation_expose_HeatMapChart.a270bda0.js} +2 -2
  12. package/__mf/js/{main.bec55b3a.js → main.4b170e45.js} +3 -3
  13. package/lib/HeatMapChart.d.ts +3 -3
  14. package/lib/HeatMapChart.d.ts.map +1 -1
  15. package/lib/HeatMapChart.js +2 -2
  16. package/lib/HeatMapChart.js.map +1 -1
  17. package/lib/bootstrap.js +2 -2
  18. package/lib/components/HeatMapChart.d.ts +4 -4
  19. package/lib/components/HeatMapChart.d.ts.map +1 -1
  20. package/lib/components/HeatMapChart.js +8 -8
  21. package/lib/components/HeatMapChart.js.map +1 -1
  22. package/lib/components/HeatMapChartOptionsEditorSettings.d.ts +2 -2
  23. package/lib/components/HeatMapChartOptionsEditorSettings.d.ts.map +1 -1
  24. package/lib/components/HeatMapChartOptionsEditorSettings.js +6 -6
  25. package/lib/components/HeatMapChartOptionsEditorSettings.js.map +1 -1
  26. package/lib/components/HeatMapChartPanel.d.ts +4 -4
  27. package/lib/components/HeatMapChartPanel.d.ts.map +1 -1
  28. package/lib/components/HeatMapChartPanel.js +6 -6
  29. package/lib/components/HeatMapChartPanel.js.map +1 -1
  30. package/lib/components/HeatMapTooltip.d.ts +3 -3
  31. package/lib/components/HeatMapTooltip.d.ts.map +1 -1
  32. package/lib/components/HeatMapTooltip.js +2 -2
  33. package/lib/components/HeatMapTooltip.js.map +1 -1
  34. package/lib/components/index.js +3 -3
  35. package/lib/components/index.js.map +1 -1
  36. package/lib/getPluginModule.d.ts +1 -1
  37. package/lib/getPluginModule.d.ts.map +1 -1
  38. package/lib/getPluginModule.js +3 -1
  39. package/lib/getPluginModule.js.map +1 -1
  40. package/lib/heat-map-chart-model.d.ts +3 -3
  41. package/lib/heat-map-chart-model.d.ts.map +1 -1
  42. package/lib/heat-map-chart-model.js.map +1 -1
  43. package/lib/index-federation.js +1 -1
  44. package/lib/index.js +4 -4
  45. package/lib/index.js.map +1 -1
  46. package/lib/setup-tests.d.ts +1 -1
  47. package/lib/setup-tests.d.ts.map +1 -1
  48. package/lib/setup-tests.js +2 -2
  49. package/lib/setup-tests.js.map +1 -1
  50. package/lib/utils/data-transform.d.ts +2 -2
  51. package/lib/utils/data-transform.d.ts.map +1 -1
  52. package/lib/utils/data-transform.js +1 -1
  53. package/lib/utils/data-transform.js.map +1 -1
  54. package/lib/utils/get-formatted-axis-label.js +1 -1
  55. package/lib/utils/index.js +3 -3
  56. package/lib/utils/index.js.map +1 -1
  57. package/lib/utils/thresholds.d.ts +1 -1
  58. package/lib/utils/thresholds.d.ts.map +1 -1
  59. package/lib/utils/thresholds.js.map +1 -1
  60. package/mf-manifest.json +18 -18
  61. package/mf-stats.json +18 -18
  62. package/package.json +10 -10
  63. package/__mf/js/async/121.c8aa4904.js +0 -2
  64. package/__mf/js/async/392.97acdaa7.js +0 -2
  65. package/__mf/js/async/470.c23991fd.js +0 -2
  66. package/__mf/js/async/535.e475e67c.js +0 -1
  67. package/__mf/js/async/695.a3b5a24f.js +0 -71
  68. package/__mf/js/async/888.6a71bc7f.js +0 -1
  69. package/__mf/js/async/941.86aff2f9.js +0 -2
  70. package/__mf/js/async/963.ddc66183.js +0 -1
  71. package/lib/cjs/HeatMapChart.js +0 -40
  72. package/lib/cjs/bootstrap.js +0 -26
  73. package/lib/cjs/components/HeatMapChart.js +0 -227
  74. package/lib/cjs/components/HeatMapChartOptionsEditorSettings.js +0 -140
  75. package/lib/cjs/components/HeatMapChartPanel.js +0 -227
  76. package/lib/cjs/components/HeatMapTooltip.js +0 -57
  77. package/lib/cjs/components/index.js +0 -32
  78. package/lib/cjs/env.d.js +0 -14
  79. package/lib/cjs/getPluginModule.js +0 -39
  80. package/lib/cjs/heat-map-chart-model.js +0 -80
  81. package/lib/cjs/index-federation.js +0 -55
  82. package/lib/cjs/index.js +0 -47
  83. package/lib/cjs/setup-tests.js +0 -19
  84. package/lib/cjs/utils/data-transform.js +0 -46
  85. package/lib/cjs/utils/get-formatted-axis-label.js +0 -48
  86. package/lib/cjs/utils/index.js +0 -32
  87. package/lib/cjs/utils/thresholds.js +0 -34
  88. /package/__mf/css/async/{695.85c2cbf6.css → 569.85c2cbf6.css} +0 -0
  89. /package/__mf/js/async/{121.c8aa4904.js.LICENSE.txt → 121.e63b0807.js.LICENSE.txt} +0 -0
  90. /package/__mf/js/async/{392.97acdaa7.js.LICENSE.txt → 392.f80b3f92.js.LICENSE.txt} +0 -0
  91. /package/__mf/js/async/{470.c23991fd.js.LICENSE.txt → 470.6b4b5f7b.js.LICENSE.txt} +0 -0
  92. /package/__mf/js/async/{695.a3b5a24f.js.LICENSE.txt → 569.8e18ce20.js.LICENSE.txt} +0 -0
  93. /package/__mf/js/async/{941.86aff2f9.js.LICENSE.txt → 941.ea6b3111.js.LICENSE.txt} +0 -0
  94. /package/__mf/js/async/{980.03e0a41f.js.LICENSE.txt → 980.f28cf53e.js.LICENSE.txt} +0 -0
@@ -0,0 +1,71 @@
1
+ /*! For license information please see 569.8e18ce20.js.LICENSE.txt */
2
+ (self.chunk_HeatMapChart_0_6_0_beta_2=self.chunk_HeatMapChart_0_6_0_beta_2||[]).push([["569"],{98025(e,t,n){"use strict";n.r(t),n.d(t,{capitalize:()=>i.A,requirePropFactory:()=>p,unstable_useId:()=>m.A,debounce:()=>s.A,setRef:()=>f,unstable_useEnhancedEffect:()=>g.A,useEventCallback:()=>x.A,unsupportedProp:()=>v,ownerWindow:()=>h.A,deprecatedPropType:()=>l,mergeSlotProps:()=>w.A,isMuiElement:()=>u.A,useControlled:()=>y.A,ownerDocument:()=>d.A,createChainedFunction:()=>o,unstable_memoTheme:()=>c.A,unstable_ClassNameGenerator:()=>S,useForkRef:()=>b.A,createSvgIcon:()=>a.A});var r=n(71027),i=n(24726);let o=n(37605).A;var a=n(22402),s=n(55403);let l=function(e,t){return()=>null};var u=n(6835),c=n(23434),d=n(1092),h=n(63025);let p=function(e,t){return()=>null},f=n(71849).A;var g=n(54382),m=n(63392);let v=function(e,t,n,r,i){return null};var y=n(2203),x=n(32398),b=n(29424),w=n(64606);let S={configure:e=>{r.A.configure(e)}}},63392(e,t,n){"use strict";n.d(t,{A:()=>r});let r=n(54553).A},70158(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.bindAll=void 0;var i=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:r(r({},t),{options:r(r({},o(n)),o(t.options))});return(0,i.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,r=t.listener,i=t.options;return e.addEventListener(n,r,i),function(){e.removeEventListener(n,r,i)}}},96907(e,t,n){"use strict";t.bindAll=t.bind=void 0;var r=n(96844);Object.defineProperty(t,"bind",{enumerable:!0,get:function(){return r.bind}});var i=n(70158);Object.defineProperty(t,"bindAll",{enumerable:!0,get:function(){return i.bindAll}})},1416(e,t,n){e.exports=n(99138)(n(41433),"DataView")},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 r=n(90369),i=n(79912),o=n(23767);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},78499(e,t,n){e.exports=n(99138)(n(41433),"WeakMap")},61414(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},78740(e){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},57260(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},74403(e,t,n){var r=n(78740),i=n(6397);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},22122(e,t,n){var r=n(42032),i=n(22934);e.exports=function e(t,n,o,a,s){return t===n||(null!=t&&null!=n&&(i(t)||i(n))?r(t,n,o,a,e,s):t!=t&&n!=n)}},42032(e,t,n){var r=n(86469),i=n(44075),o=n(64622),a=n(62677),s=n(31201),l=n(6397),u=n(30492),c=n(47995),d="[object Arguments]",h="[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?h:s(e),w=x?h:s(t);b=b==d?p:b,w=w==d?p:w;var S=b==p,A=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 r),y||c(e)?i(e,t,n,g,m,v):o(e,t,b,n,g,m,v);if(!(1&n)){var M=S&&f.call(e,"__wrapped__"),k=A&&f.call(t,"__wrapped__");if(M||k){var T=M?e.value():e,_=k?t.value():t;return v||(v=new r),m(T,_,n,g,v)}}return!!C&&(v||(v=new r),a(e,t,n,g,m,v))}},81452(e,t,n){var r=n(67499),i=n(9566),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},68812(e,t,n){var r=n(62140),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},79151(e){e.exports=function(e,t){return e.has(t)}},44075(e,t,n){var r=n(61527),i=n(57260),o=n(79151);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var h=l.get(e),p=l.get(t);if(h&&p)return h==t&&p==e;var f=-1,g=!0,m=2&n?new r: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(!i(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 r=n(32781),i=n(28944),o=n(39316),a=n(44075),s=n(90953),l=n(15851),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,h){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||!d(new i(e),new i(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&r;if(p||(p=l),e.size!=t.size&&!f)break;var g=h.get(e);if(g)return g==t;r|=2,h.set(e,t);var m=a(p(e),p(t),r,u,d,h);return h.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},62677(e,t,n){var r=n(90966),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!l)return!1;for(var d=c;d--;){var h=u[d];if(!(l?h in t:i.call(t,h)))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;++d<c;){var v=e[h=u[d]],y=t[h];if(o)var x=l?o(y,v,h,t,e,s):o(v,y,h,e,t,s);if(!(void 0===x?v===y||a(v,y,n,o,s):x)){g=!1;break}m||(m="constructor"==h)}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}},90966(e,t,n){var r=n(74403),i=n(88876),o=n(31178);e.exports=function(e){return r(e,o,i)}},88876(e,t,n){var r=n(61414),i=n(53629),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;e.exports=a?function(e){return null==e?[]:r(a(e=Object(e)),function(t){return o.call(e,t)})}:i},31201(e,t,n){var r=n(1416),i=n(91955),o=n(42616),a=n(60157),s=n(78499),l=n(87148),u=n(81485),c="[object Map]",d="[object Promise]",h="[object Set]",p="[object WeakMap]",f="[object DataView]",g=u(r),m=u(i),v=u(o),y=u(a),x=u(s),b=l;(r&&b(new r(new ArrayBuffer(1)))!=f||i&&b(new i)!=c||o&&b(o.resolve())!=d||a&&b(new a)!=h||s&&b(new s)!=p)&&(b=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return f;case m:return c;case v:return d;case y:return h;case x:return p}return t}),e.exports=b},90953(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},9566(e,t,n){e.exports=n(51019)(Object.keys,Object)},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}},62140(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},46177(e,t,n){var r=n(58953),i=n(43664),o=n(95378),a=Math.max,s=Math.min;e.exports=function(e,t,n){var l,u,c,d,h,p,f=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=l,r=u;return l=u=void 0,f=t,d=e.apply(r,n)}function x(e){var n=e-p,r=e-f;return void 0===p||n>=t||n<0||m&&r>=c}function b(){var e,n,r,o=i();if(x(o))return w(o);h=setTimeout(b,(e=o-p,n=o-f,r=t-e,m?s(r,c-n):r))}function w(e){return(h=void 0,v&&l)?y(e):(l=u=void 0,d)}function S(){var e,n=i(),r=x(n);if(l=arguments,u=this,p=n,r){if(void 0===h)return f=e=p,h=setTimeout(b,t),g?y(e):d;if(m)return clearTimeout(h),h=setTimeout(b,t),y(p)}return void 0===h&&(h=setTimeout(b,t)),d}return t=o(t)||0,r(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!==h&&clearTimeout(h),f=0,l=p=u=h=void 0},S.flush=function(){return void 0===h?d:w(i())},S}},18264(e,t,n){var r=n(22122);e.exports=function(e,t){return r(e,t)}},75414(e,t,n){var r=n(87148),i=n(22934);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},31178(e,t,n){var r=n(31163),i=n(81452),o=n(18330);e.exports=function(e){return o(e)?r(e):i(e)}},43664(e,t,n){var r=n(41433);e.exports=function(){return r.Date.now()}},53629(e){e.exports=function(){return[]}},95378(e,t,n){var r=n(68812),i=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(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):s.test(e)?a:+e}},24300(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).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")},87275(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z","ChevronDown")},11061(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z","ChevronRight")},29618(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).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")},7800(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z","Close")},98029(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z","Delete")},86067(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z","DeleteOutline")},53064(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z","Drag")},26684(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).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 r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).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 r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).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")},17366(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z","InformationOutline")},98599(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).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 r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z","Pin")},29917(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12M8.8,14L10,12.8V4H14V12.8L15.2,14H8.8Z","PinOutline")},86742(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z","Plus")},16979(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).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 r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).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 r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M16,5V18H21V5M4,18H9V5H4M10,18H15V5H10V18Z","ViewColumn")},1448(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(98025),i=n(62540);t.default=function(e,t){return(0,r.createSvgIcon)((0,i.jsx)("path",{d:e}),t)}},40362(e,t,n){"use strict";var r=n(56441);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){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:i};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 r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(t);function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var i={error:null},o=function(e){function t(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state=i,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var o=t.prototype;return o.reset=function(){this.setState(i)},o.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},o.componentDidUpdate=function(e,t){var n,r,i,o,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(void 0===(n=e.resetKeys)&&(n=[]),void 0===(r=s)&&(r=[]),n.length!==r.length||n.some(function(e,t){return!Object.is(e,r[t])}))&&(null==(i=(o=this.props).onResetKeysChange)||i.call(o,e.resetKeys,s),this.reset())},o.render=function(){var e=this.state.error,t=this.props,r=t.fallbackRender,i=t.FallbackComponent,o=t.fallback;if(null!==e){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(n.isValidElement(o))return o;if("function"==typeof r)return r(a);if(i)return n.createElement(i,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),r=t[0],i=t[1];if(null!=e)throw e;if(null!=r)throw r;return i},e.withErrorBoundary=function(e,t){var r=function(r){return n.createElement(o,t,n.createElement(e,r))};return r.displayName="withErrorBoundary("+(e.displayName||e.name||"Unknown")+")",r},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(70451))},23420(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function i(){r.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;r<i;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],i=[];if(r&&t)for(var o=0,a=r.length;o<a;o++)r[o].fn!==t&&r[o].fn._!==t&&i.push(r[o]);return i.length?n[e]=i: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 r(){var i=[{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:i,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 d(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 h(e){return e.map(function(e){var t=e.types.map(y);return(e.restParam?"...":"")+t.join("|")}).join(",")}function p(e){var t=P(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,r=u(t.types[1].name).test;return function(e){return n(e)||r(e)}}var i=t.types.map(function(e){return u(e.name).test});return function(e){for(var t=0;t<i.length;t++)if(i[t](e))return!0;return!1}}function m(e,t){return t<e.params.length?e.params[t]:p(e.params)?P(e.params):null}function v(e,t,n){var r=m(e,t);return(r?n?r.types.filter(x):r.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 r,i,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((i=b(s,o)).length>0){var u=d(t[o]);return(r=TypeError("Unexpected type of argument in function "+a+" (expected: "+i.join(" or ")+", actual: "+u+", index: "+o+")")).data={category:"wrongType",fn:a,index:o,actual:u,expected:i},r}}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(r=TypeError("Too few arguments in function "+a+" (expected: "+(i=b(s,o)).join(" or ")+", index: "+t.length+")")).data={category:"tooFewArgs",fn:a,index:t.length,expected:i},r;var h=Math.max.apply(null,c);return t.length>h?(r=TypeError("Too many arguments in function "+a+" (expected: "+h+", actual: "+t.length+")")).data={category:"tooManyArgs",fn:a,index:t.length,expectedLength:h}:(r=TypeError('Arguments of type "'+t.join(", ")+'" do not match any of the defined signatures of function '+a+".")).data={category:"mismatch",actual:t.map(d)},r}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 A(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,r,i=Math.min(e.params.length,t.params.length);if(0!=(r=e.params.some(f)-t.params.some(f)))return r;for(n=0;n<i;n++)if(0!=(r=f(e.params[n])-f(t.params[n])))return r;for(n=0;n<i;n++)if(0!==(r=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:A(e)-A(t)}(e.params[n],t.params[n])))return r;return e.params.length-t.params.length}function M(e){var t,n,r,i,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],r=a[0],function(e){return t(e)?r(e):e};case 2:return t=o[0],n=o[1],r=a[0],i=a[1],function(e){return t(e)?r(e):n(e)?i(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 k(e,t){return function e(n,r,i){if(!(r<n.length))return[i.map(function(e,t){return{types:e,restParam:t===n.length-1&&p(n)}})];var o,a=n[r],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,r+1,i.concat([t]))})}(e,0,[])}function T(e,r){if(0===Object.keys(r).length)throw SyntaxError("No signatures provided");var i,o=[];Object.keys(r).map(function(e){var t,n,i;return t=r[e],n=l.conversions,i=[],(""!==e.trim()&&(i=e.split(",").map(D).map(function(e,t,r){var i,o,a,s,l,d,h,p,f=(i=n,o=l=((s=0===e.indexOf("..."))?e.length>3?e.slice(3):"any":e).split("|").map(D).filter(O).filter(I),a={},i.forEach(function(e){-1!==o.indexOf(e.from)||-1===o.indexOf(e.to)||a[e.from]||(a[e.from]=e)}),d=Object.keys(a).map(function(e){return a[e]}),h=l.map(function(e){var t=u(e);return{name:e,typeIndex:c(t),test:t.test,conversion:null,conversionIndex:-1}}),p=d.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:h.concat(p),restParam:s});if(f.restParam&&t!==r.length-1)throw SyntaxError('Unexpected rest parameter "'+e+'": only allowed for the last parameter');return f})),i.some(E))?null:{params:i,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),r=0;r<n;r++)if(!function(e,t){for(var n,r=0;r<e.length;r++)if(n=e[r],-1!==t.indexOf(n))return!0;return!1}(v(e,r,!0),v(t,r,!0)))return!1;var i=e.params.length,o=t.params.length,a=p(e.params),s=p(t.params);return a?s?i===o:o>=i:s?i>=o:i===o}(t,e)});if(t)throw TypeError('Conflicting signatures "'+h(t.params)+'" and "'+h(e.params)+'".');o.push(e)});var a=B(o,function(e){return(e?k(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),d=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,r;if(p(e)){var i,o=(t=(i=e).slice(0,i.length-1).map(g)).length,a=g(P(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]),r=g(e[1]),function(e){return n(e[0])&&r(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,A=d?g(a[1].params[0]):t,T=m?g(a[2].params[0]):t,_=y?g(a[3].params[0]):t,z=x?g(a[4].params[0]):t,F=b?g(a[5].params[0]):t,j=s?g(a[0].params[1]):t,V=d?g(a[1].params[1]):t,H=m?g(a[2].params[1]):t,$=y?g(a[3].params[1]):t,W=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 r=p(e),i=e.map(M);n=function(){for(var e=[],n=r?arguments.length-1:arguments.length,o=0;o<n;o++)e[o]=i[o](arguments[o]);return r&&(e[n]=arguments[n].map(i[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=d?U[1]:n,X=m?U[2]:n,Z=y?U[3]:n,K=x?U[4]:n,Q=b?U[5]:n,J=s?a[0].params.length:-1,ee=d?a[1].params.length:-1,et=m?a[2].params.length:-1,en=y?a[3].params.length:-1,er=x?a[4].params.length:-1,ei=b?a[5].params.length:-1,eo=6*!!(s&&d&&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)&&j(n)?q.apply(e,arguments):arguments.length===ee&&A(t)&&V(n)?Y.apply(e,arguments):arguments.length===et&&T(t)&&H(n)?X.apply(e,arguments):arguments.length===en&&_(t)&&$(n)?Z.apply(e,arguments):arguments.length===er&&z(t)&&W(n)?K.apply(e,arguments):arguments.length===ei&&F(t)&&G(n)?Q.apply(e,arguments):es.apply(e,arguments)};try{Object.defineProperty(el,"name",{value:e})}catch(e){}return i={},a.forEach(function(e){e.params.some(f)||k(e.params,!0).forEach(function(t){i[h(t)]=e.fn})}),el.signatures=i,el}function _(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 E(e){return 0===e.types.length}function P(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 r=e[n];if(("object"==typeof r.signatures||"string"==typeof r.signature)&&""!==r.name){if(""===t)t=r.name;else if(t!==r.name){var i=Error("Function names do not match (expected: "+t+", actual: "+r.name+")");throw i.data={actual:r.name,expected:t},i}}}return t}function F(e){var t,n={};function r(e,r){if(n.hasOwnProperty(e)&&r!==n[e])throw(t=Error('Signature "'+e+'" is defined twice')).data={signature:e},t}for(var i=0;i<e.length;i++){var o=e[i];if("object"==typeof o.signatures)for(var a in o.signatures)o.signatures.hasOwnProperty(a)&&(r(a,o.signatures[a]),n[a]=o.signatures[a]);else if("string"==typeof o.signature)r(o.signature,o),n[o.signature]=o;else throw(t=TypeError("Function is no typed-function (index: "+i+")")).data={index:i},t}return n}return(l=T("typed",{"string, Object":T,Object:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return T(z(t),e)},"...Function":function(e){return T(z(e),F(e))},"string, ...Function":function(e,t){return T(e,F(t))}})).create=r,l.types=i,l.conversions=s,l.ignore=a,l.onMismatch=_,l.throwMismatchError=_,l.createError=w,l.convert=function(e,t){var n=d(e);if(t===n)return e;for(var r=0;r<l.conversions.length;r++){var i=l.conversions[r];if(i.from===n&&i.to===t)return i.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,r=0;r<n.length;r++)n[r]=n[r].trim()}else if(Array.isArray(t))n=t;else throw TypeError("String array or a comma separated string expected");var i=n.join(","),o=e.signatures[i];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()},27072(e,t,n){"use strict";let r,i;n.r(t),n.d(t,{generateChartsTheme:()=>oF,DensitySelector:()=>yZ,applyMergeIndexedColumnsTransform:()=>o$,interpolateSelectionIndividual:()=>oB,DragButton:()=>xU,TimeRangeSelector:()=>Yw,getFormatterStats:()=>nX,OptionsEditorGrid:()=>ya,TOOLTIP_MAX_HEIGHT:()=>YT,useMousePosition:()=>Yz,TextOverlay:()=>V3,isValidLegendSize:()=>nH,isValidLegendMode:()=>nV,isDateUnit:()=>ia,parseVariables:()=>i_,UnitSelector:()=>Xi,PERCENT_UNIT_CONFIG:()=>rj,RepeatGrid:()=>XL,PERCENT_GROUP_CONFIG:()=>rz,YAxisLabel:()=>Xs,replaceVariablesForDisplay:()=>iO,TOOLTIP_MIN_WIDTH:()=>YM,useId:()=>iS,getTitleAction:()=>nL,getYBuffer:()=>Y4,PINNED_CROSSHAIR_SERIES_NAME:()=>nw,getPixelXFromGrid:()=>YU,getFormattedAxisLabel:()=>o_,clearHighlightedSeries:()=>ig,FALLBACK_CHART_WIDTH:()=>YO,restoreChart:()=>ip,FormatControls:()=>Xa,transformData:()=>oG,getTimeSeriesValues:()=>uR,DEFAULT_LEGEND:()=>n$,OptionsEditorControl:()=>yo,formatDecimal:()=>rY,DiscardChangesConfirmationDialog:()=>vJ,formatTime:()=>n3,SelectionProvider:()=>ta,TimeChartTooltip:()=>Xe,legendModes:()=>nz,EMPTY_TOOLTIP_DATA:()=>YB,isThroughputUnit:()=>ii,applyJoinTransform:()=>oV,TextField:()=>vu,SeriesInfo:()=>YH,getClosestTimestamp:()=>ix,DropIndicator:()=>yK,applyMergeColumnsTransform:()=>oH,isTemperatureUnit:()=>is,limitDecimalPlaces:()=>nQ,useSnackbar:()=>ny,dateFormatOptionsWithTimeZone:()=>oM,calculateBarYBounds:()=>YZ,DEFAULT_COLUMN_HEIGHT:()=>40,parseVariablesAndFormat:()=>iI,getCommonTimeScale:()=>uE,isBytesUnit:()=>r7,ModeSelector:()=>VK,OptionsEditorColumn:()=>v9,DECIMAL_UNIT_CONFIG:()=>rq,DEFAULT_PINNED_CROSSHAIR:()=>nS,TEMPERATURE_GROUP_CONFIG:()=>r$,NoDataOverlay:()=>V6,getResourceExtendedDisplayName:()=>uN,InterpolationFormat:()=>iA,ErrorBoundary:()=>Ig.ErrorBoundary,hasDataFieldPatterns:()=>i$,CURRENCY_UNIT_CONFIG:()=>rN,ToolbarIconButton:()=>Xn,DEFAULT_TOOLTIP_CONFIG:()=>YF,TRANSFORM_TEXT:()=>il,calculateBarBandwidth:()=>YY,ItemActionsProvider:()=>te,isWithinPercentageRange:()=>Y5,OPTIMIZED_MODE_SERIES_LIMIT:()=>1e3,legendPositions:()=>nB,TIME_GROUP_CONFIG:()=>n0,defaultCursorData:()=>YN,createTimezoneAwareAxisFormatter:()=>It,RefreshIntervalPicker:()=>XP,legendSizes:()=>nF,BITS_GROUP_CONFIG:()=>rT,TOOLTIP_LABELS_MAX_WIDTH:()=>Y_,applyValueMapping:()=>oj,UNIT_GROUP_CONFIG:()=>r0,batchDispatchNearbySeriesActions:()=>iv,DEFAULT_COLUMN_WIDTH:()=>150,getGMTOffset:()=>oT,getPointInGrid:()=>im,InfoTooltip:()=>yn,AlignSelector:()=>ev,JSONEditor:()=>VH,CURRENCY_GROUP_CONFIG:()=>rL,TooltipHeader:()=>Y7,SeriesMarker:()=>YA,FontSizeSelector:()=>Iv,THROUGHPUT_UNIT_CONFIG:()=>rK,DEFAULT_COLUMN_MAX_WIDTH:()=>1e3,TOOLTIP_PADDING:()=>YD,TimeZoneContext:()=>uB,TimeZoneProvider:()=>uz,useDeepMemo:()=>oR,TransformsEditor:()=>XE,combineSx:()=>iw,getFormatterFromCache:()=>nY,applyMergeSeriesTransform:()=>oW,Legend:()=>vC,Dialog:()=>vQ,getFormattedMultipleYAxes:()=>ic,replaceVariables:()=>iD,DECIMAL_GROUP_CONFIG:()=>rU,getResourceDisplayName:()=>uL,SnackbarProvider:()=>nv,formatBytes:()=>rR,getUnitConfig:()=>r5,LoadingOverlay:()=>V8,formatWithTimeZone:()=>ok,legacyCheckforNearbySeries:()=>Y1,replaceVariable:()=>ik,UNIT_CONFIG:()=>r1,testChartsTheme:()=>Xl,TOOLTIP_ADJUST_Y_POS_MULTIPLIER:()=>YI,interpolate:()=>iM,THROUGHPUT_GROUP_CONFIG:()=>rX,BYTES_UNIT_CONFIG:()=>rO,useChartsTheme:()=>e9,calculateBarSegmentBounds:()=>YX,checkCrosshairPinnedStatus:()=>iy,mockChartsContext:()=>Xu,checkforNearbyTimeSeries:()=>Y0,TOOLTIP_DATE_FORMAT:()=>YL,hasDecimalPlaces:()=>nK,isCurrencyUnit:()=>io,DEFAULT_COLUMN_MIN_WIDTH:()=>60,handleMoveUp:()=>xW,ContentWithLegend:()=>vk,OptionsEditorGroup:()=>ys,isUnitWithDecimalPlaces:()=>it,SeriesLabelsStack:()=>YC,getDateAndTime:()=>oI,getTableCellLayout:()=>fn,ChartsThemeContext:()=>e6,TooltipContent:()=>Y3,isValidTraceId:()=>uP,formatCurrency:()=>rB,ValueMappingsEditor:()=>X5,BYTES_GROUP_CONFIG:()=>rD,interpolateSelectionBatch:()=>oz,isLegendItemVisuallySelected:()=>u0,getFormattedAxis:()=>iu,getClosestTimestampInFullDataset:()=>ib,ChartsProvider:()=>e3,TimeZoneSelector:()=>YS,LinkEditorForm:()=>VX,SortSelector:()=>V7,formatValue:()=>r2,persesColumnsToTanstackColumns:()=>fr,NEARBY_SERIES_DESCRIPTION:()=>YR,calculateVisualYForSeries:()=>Yq,hasIndexedPatterns:()=>iH,ColorPicker:()=>e2,useItemActions:()=>tr,getUnitGroup:()=>r4,formatThroughput:()=>rQ,getTheme:()=>XS,shouldShortenValues:()=>nZ,MIN_STEP_INTERVAL_MS:()=>uO,buildRelativeTimeOption:()=>nE,useSelection:()=>tu,TEMPERATURE_UNIT_CONFIG:()=>rW,SortSelectorButtons:()=>He,formatBits:()=>rI,getTimeZoneOptions:()=>nP,DYNAMIC_NEARBY_SERIES_MULTIPLIER:()=>YQ,isUnitWithShortValues:()=>ir,getTooltipStyles:()=>YG,interpolateHeaders:()=>oL,ErrorAlert:()=>If,OptionsColorPicker:()=>uj,getUnitGroupConfig:()=>r3,TOOLTIP_BG_COLOR_FALLBACK:()=>YP,TOOLTIP_MAX_WIDTH:()=>Yk,DragAndDropElement:()=>xH,extractFieldNames:()=>iW,isBitsUnit:()=>ie,SHOW_FEWER_SERIES_LIMIT:()=>YJ,TIME_UNIT_CONFIG:()=>n1,INCREASE_NEARBY_SERIES_MULTIPLIER:()=>YK,isPercentUnit:()=>r8,getLegendSize:()=>nU,getSubmitText:()=>nN,handleMoveDown:()=>xG,PIN_TOOLTIP_HELP_TEXT:()=>Yj,Table:()=>vx,typography:()=>Xb,formatPercent:()=>rV,assembleTransform:()=>YW,formatTemperature:()=>rG,useTimeZone:()=>uF,createRegexFromString:()=>oP,hasBatchPatterns:()=>iV,PersesTimeToIntlTime:()=>n2,parseFormat:()=>iz,FormActions:()=>Iy,getNearbySeriesData:()=>Y2,useMemoized:()=>oO,isValidLegendPosition:()=>nj,getLegendMode:()=>nG,EMPHASIZED_SERIES_DESCRIPTION:()=>YE,replaceDataFields:()=>iF,Drawer:()=>bt,getLegendPosition:()=>nW,BITS_UNIT_CONFIG:()=>r_,EChart:()=>_7,isTimeUnit:()=>r6,useChartsContext:()=>e8,interpolateQueryParams:()=>oN,UNPIN_TOOLTIP_HELP_TEXT:()=>YV,DateTimeRangePicker:()=>Yb,SettingsAutocomplete:()=>yY,ThresholdsEditor:()=>Hg,isDecimalUnit:()=>r9,enableDataZoom:()=>ih,replaceDataFieldsBatch:()=>ij,useDragAndDropMonitor:()=>xV,useLocalStorage:()=>id,isRegexPattern:()=>oE});var o,a,s,l,u,c,d,h,p,f,g,m,v,y,x,b,w,S,A,C,M,k,T,_=n(62540),I=n(70451),D=n.n(I),O=n(11750),R=n(81023),E=n(59238);function P(e){return I.Children.toArray(e).filter(e=>I.isValidElement(e))}var L=n(24726),N=n(77308),B=n(23434),z=n(26952),F=n(72052),j=n(29009),V=n(46733);function H(e){return(0,V.Ay)("MuiButtonGroup",e)}let $=(0,j.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"]),W=I.createContext({}),G=I.createContext(void 0),U=(0,N.A)("div",{name:"MuiButtonGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${$.grouped}`]:t.grouped},{[`& .${$.grouped}`]:t[`grouped${(0,L.A)(n.orientation)}`]},{[`& .${$.grouped}`]:t[`grouped${(0,L.A)(n.variant)}`]},{[`& .${$.grouped}`]:t[`grouped${(0,L.A)(n.variant)}${(0,L.A)(n.orientation)}`]},{[`& .${$.grouped}`]:t[`grouped${(0,L.A)(n.variant)}${(0,L.A)(n.color)}`]},{[`& .${$.firstButton}`]:t.firstButton},{[`& .${$.lastButton}`]:t.lastButton},{[`& .${$.middleButton}`]:t.middleButton},t.root,t[n.variant],!0===n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,"vertical"===n.orientation&&t.vertical]}})((0,B.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",[`& .${$.lastButton},& .${$.middleButton}`]:{borderTopRightRadius:0,borderTopLeftRadius:0},[`& .${$.firstButton},& .${$.middleButton}`]:{borderBottomRightRadius:0,borderBottomLeftRadius:0}}},{props:{orientation:"horizontal"},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${$.lastButton},& .${$.middleButton}`]:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}},{props:{variant:"text",orientation:"horizontal"},style:{[`& .${$.firstButton},& .${$.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)"}`,[`&.${$.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:"text",orientation:"vertical"},style:{[`& .${$.firstButton},& .${$.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)"}`,[`&.${$.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter((0,z.A)()).flatMap(([t])=>[{props:{variant:"text",color:t},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.5)`:(0,E.X4)(e.palette[t].main,.5)}}}]),{props:{variant:"outlined",orientation:"horizontal"},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderRightColor:"transparent","&:hover":{borderRightColor:"currentColor"}},[`& .${$.lastButton},& .${$.middleButton}`]:{marginLeft:-1}}},{props:{variant:"outlined",orientation:"vertical"},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderBottomColor:"transparent","&:hover":{borderBottomColor:"currentColor"}},[`& .${$.lastButton},& .${$.middleButton}`]:{marginTop:-1}}},{props:{variant:"contained",orientation:"horizontal"},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderRight:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${$.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:"contained",orientation:"vertical"},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderBottom:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${$.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter((0,z.A)(["dark"])).map(([t])=>({props:{variant:"contained",color:t},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderColor:(e.vars||e).palette[t].dark}}}))],[`& .${$.grouped}`]:{minWidth:40,boxShadow:"none",props:{variant:"contained"},style:{"&:hover":{boxShadow:"none"}}}}))),q=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiButtonGroup"}),{children:r,className:i,color:o="primary",component:a="div",disabled:s=!1,disableElevation:l=!1,disableFocusRipple:u=!1,disableRipple:c=!1,fullWidth:d=!1,orientation:h="horizontal",size:p="medium",variant:f="outlined",...g}=n,m={...n,color:o,component:a,disabled:s,disableElevation:l,disableFocusRipple:u,disableRipple:c,fullWidth:d,orientation:h,size:p,variant:f},v=(e=>{let{classes:t,color:n,disabled:r,disableElevation:i,fullWidth:o,orientation:a,variant:s}=e,l={root:["root",s,a,o&&"fullWidth",i&&"disableElevation",`color${(0,L.A)(n)}`],grouped:["grouped",`grouped${(0,L.A)(a)}`,`grouped${(0,L.A)(s)}`,`grouped${(0,L.A)(s)}${(0,L.A)(a)}`,`grouped${(0,L.A)(s)}${(0,L.A)(n)}`,r&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,R.A)(l,H,t)})(m),y=I.useMemo(()=>({className:v.grouped,color:o,disabled:s,disableElevation:l,disableFocusRipple:u,disableRipple:c,fullWidth:d,size:p,variant:f}),[o,s,l,u,c,d,p,f,v.grouped]),x=P(r),b=x.length;return(0,_.jsx)(U,{as:a,role:"group",className:(0,O.A)(v.root,i),ref:t,ownerState:m,...g,children:(0,_.jsx)(W.Provider,{value:y,children:x.map((e,t)=>{let n,r;return(0,_.jsx)(G.Provider,{value:(n=0===t,r=t===b-1,n&&r?"":n?v.firstButton:r?v.lastButton:v.middleButton),children:e},t)})})})});var Y=n(52215),X=n(63392),Z=n(83926),K=n(1337),Q=n(91785);function J(e){return(0,V.Ay)("MuiCircularProgress",e)}(0,j.A)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);let ee=(0,Q.i7)`
3
+ 0% {
4
+ transform: rotate(0deg);
5
+ }
6
+
7
+ 100% {
8
+ transform: rotate(360deg);
9
+ }
10
+ `,et=(0,Q.i7)`
11
+ 0% {
12
+ stroke-dasharray: 1px, 200px;
13
+ stroke-dashoffset: 0;
14
+ }
15
+
16
+ 50% {
17
+ stroke-dasharray: 100px, 200px;
18
+ stroke-dashoffset: -15px;
19
+ }
20
+
21
+ 100% {
22
+ stroke-dasharray: 1px, 200px;
23
+ stroke-dashoffset: -126px;
24
+ }
25
+ `,en="string"!=typeof ee?(0,Q.AH)`
26
+ animation: ${ee} 1.4s linear infinite;
27
+ `:null,er="string"!=typeof et?(0,Q.AH)`
28
+ animation: ${et} 1.4s ease-in-out infinite;
29
+ `:null,ei=(0,N.A)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`color${(0,L.A)(n.color)}`]]}})((0,B.A)(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:en||{animation:`${ee} 1.4s linear infinite`}},...Object.entries(e.palette).filter((0,z.A)()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),eo=(0,N.A)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),ea=(0,N.A)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.circle,t[`circle${(0,L.A)(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})((0,B.A)(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink,style:er||{animation:`${et} 1.4s ease-in-out infinite`}}]}))),es=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiCircularProgress"}),{className:r,color:i="primary",disableShrink:o=!1,size:a=40,style:s,thickness:l=3.6,value:u=0,variant:c="indeterminate",...d}=n,h={...n,color:i,disableShrink:o,size:a,thickness:l,value:u,variant:c},p=(e=>{let{classes:t,variant:n,color:r,disableShrink:i}=e,o={root:["root",n,`color${(0,L.A)(r)}`],svg:["svg"],circle:["circle",`circle${(0,L.A)(n)}`,i&&"circleDisableShrink"]};return(0,R.A)(o,J,t)})(h),f={},g={},m={};if("determinate"===c){let e=2*Math.PI*((44-l)/2);f.strokeDasharray=e.toFixed(3),m["aria-valuenow"]=Math.round(u),f.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,g.transform="rotate(-90deg)"}return(0,_.jsx)(ei,{className:(0,O.A)(p.root,r),style:{width:a,height:a,...g,...s},ownerState:h,ref:t,role:"progressbar",...m,...d,children:(0,_.jsx)(eo,{className:p.svg,ownerState:h,viewBox:"22 22 44 44",children:(0,_.jsx)(ea,{className:p.circle,style:f,ownerState:h,cx:44,cy:44,r:(44-l)/2,fill:"none",strokeWidth:l})})})});function el(e){return(0,V.Ay)("MuiButton",e)}let eu=(0,j.A)("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),ec=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],ed=(0,N.A)(K.A,{shouldForwardProp:e=>(0,Z.A)(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${(0,L.A)(n.color)}`],t[`size${(0,L.A)(n.size)}`],t[`${n.variant}Size${(0,L.A)(n.size)}`],"inherit"===n.color&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})((0,B.A)(({theme:e})=>{let t="light"===e.palette.mode?e.palette.grey[300]:e.palette.grey[800],n="light"===e.palette.mode?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${eu.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${eu.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${eu.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${eu.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter((0,z.A)()).map(([t])=>({props:{color:t},style:{"--variant-textColor":(e.vars||e).palette[t].main,"--variant-outlinedColor":(e.vars||e).palette[t].main,"--variant-outlinedBorder":e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.5)`:(0,E.X4)(e.palette[t].main,.5),"--variant-containedColor":(e.vars||e).palette[t].contrastText,"--variant-containedBg":(e.vars||e).palette[t].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[t].dark,"--variant-textBg":e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,E.X4)(e.palette[t].main,e.palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[t].main,"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,E.X4)(e.palette[t].main,e.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,E.X4)(e.palette.text.primary,e.palette.action.hoverOpacity),"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,E.X4)(e.palette.text.primary,e.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${eu.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${eu.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${eu.loading}`]:{color:"transparent"}}}]}})),eh=(0,N.A)("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${(0,L.A)(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...ec]})),ep=(0,N.A)("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${(0,L.A)(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...ec]})),ef=(0,N.A)("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),eg=(0,N.A)("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(e,t)=>t.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),em=I.forwardRef(function(e,t){let n=I.useContext(W),r=I.useContext(G),i=(0,Y.A)(n,e),o=(0,F.b)({props:i,name:"MuiButton"}),{children:a,color:s="primary",component:l="button",className:u,disabled:c=!1,disableElevation:d=!1,disableFocusRipple:h=!1,endIcon:p,focusVisibleClassName:f,fullWidth:g=!1,id:m,loading:v=null,loadingIndicator:y,loadingPosition:x="center",size:b="medium",startIcon:w,type:S,variant:A="text",...C}=o,M=(0,X.A)(m),k=y??(0,_.jsx)(es,{"aria-labelledby":M,color:"inherit",size:16}),T={...o,color:s,component:l,disabled:c,disableElevation:d,disableFocusRipple:h,fullWidth:g,loading:v,loadingIndicator:k,loadingPosition:x,size:b,type:S,variant:A},D=(e=>{let{color:t,disableElevation:n,fullWidth:r,size:i,variant:o,loading:a,loadingPosition:s,classes:l}=e,u={root:["root",a&&"loading",o,`${o}${(0,L.A)(t)}`,`size${(0,L.A)(i)}`,`${o}Size${(0,L.A)(i)}`,`color${(0,L.A)(t)}`,n&&"disableElevation",r&&"fullWidth",a&&`loadingPosition${(0,L.A)(s)}`],startIcon:["icon","startIcon",`iconSize${(0,L.A)(i)}`],endIcon:["icon","endIcon",`iconSize${(0,L.A)(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},c=(0,R.A)(u,el,l);return{...l,...c}})(T),E=(w||v&&"start"===x)&&(0,_.jsx)(eh,{className:D.startIcon,ownerState:T,children:w||(0,_.jsx)(eg,{className:D.loadingIconPlaceholder,ownerState:T})}),P=(p||v&&"end"===x)&&(0,_.jsx)(ep,{className:D.endIcon,ownerState:T,children:p||(0,_.jsx)(eg,{className:D.loadingIconPlaceholder,ownerState:T})}),N="boolean"==typeof v?(0,_.jsx)("span",{className:D.loadingWrapper,style:{display:"contents"},children:v&&(0,_.jsx)(ef,{className:D.loadingIndicator,ownerState:T,children:k})}):null;return(0,_.jsxs)(ed,{ownerState:T,className:(0,O.A)(n.className,D.root,u,r||""),component:l,disabled:c||v,focusRipple:!h,focusVisibleClassName:(0,O.A)(D.focusVisible,f),ref:t,type:S,id:v?M:m,...C,classes:D,children:[E,"end"!==x&&N,a,"end"===x&&N,P]})});function ev({onChange:e,value:t="left",...n}){let r=t=>{e(t)};return(0,_.jsxs)(q,{"aria-label":"Alignement",...n,children:[(0,_.jsx)(em,{onClick:()=>r("left"),variant:"left"===t?"contained":"outlined",children:"Left"},"left"),(0,_.jsx)(em,{onClick:()=>r("center"),variant:"center"===t?"contained":"outlined",children:"Center"},"center"),(0,_.jsx)(em,{onClick:()=>r("right"),variant:"right"===t?"contained":"outlined",children:"Right"},"right")]})}var ey=n(315);function ex(e){return(0,V.Ay)("MuiIconButton",e)}let eb=(0,j.A)("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),ew=(0,N.A)(K.A,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.loading&&t.loading,"default"!==n.color&&t[`color${(0,L.A)(n.color)}`],n.edge&&t[`edge${(0,L.A)(n.edge)}`],t[`size${(0,L.A)(n.size)}`]]}})((0,B.A)(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,E.X4)(e.palette.action.active,e.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),(0,B.A)(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter((0,z.A)()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter((0,z.A)()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.vars?`rgba(${(e.vars||e).palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,E.X4)((e.vars||e).palette[t].main,e.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${eb.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${eb.loading}`]:{color:"transparent"}}))),eS=(0,N.A)("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),eA=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiIconButton"}),{edge:r=!1,children:i,className:o,color:a="default",disabled:s=!1,disableFocusRipple:l=!1,size:u="medium",id:c,loading:d=null,loadingIndicator:h,...p}=n,f=(0,X.A)(c),g=h??(0,_.jsx)(es,{"aria-labelledby":f,color:"inherit",size:16}),m={...n,edge:r,color:a,disabled:s,disableFocusRipple:l,loading:d,loadingIndicator:g,size:u},v=(e=>{let{classes:t,disabled:n,color:r,edge:i,size:o,loading:a}=e,s={root:["root",a&&"loading",n&&"disabled","default"!==r&&`color${(0,L.A)(r)}`,i&&`edge${(0,L.A)(i)}`,`size${(0,L.A)(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return(0,R.A)(s,ex,t)})(m);return(0,_.jsxs)(ew,{id:d?f:c,className:(0,O.A)(v.root,o),centerRipple:!0,focusRipple:!l,disabled:s||d,ref:t,...p,ownerState:m,children:["boolean"==typeof d&&(0,_.jsx)("span",{className:v.loadingWrapper,style:{display:"contents"},children:(0,_.jsx)(eS,{className:v.loadingIndicator,ownerState:m,children:d&&g})}),i]})});var eC=n(93648),eM=n(29618),ek=n(98029);function eT(){return(eT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function e_(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}function eI(e){var t=(0,I.useRef)(e),n=(0,I.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var eD,eO=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},eR=function(e){return"touches"in e},eE=function(e){return e&&e.ownerDocument.defaultView||self},eP=function(e,t,n){var r=e.getBoundingClientRect(),i=eR(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:eO((i.pageX-(r.left+eE(e).pageXOffset))/r.width),top:eO((i.pageY-(r.top+eE(e).pageYOffset))/r.height)}},eL=function(e){eR(e)||e.preventDefault()},eN=D().memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,i=e_(e,["onMove","onKey","onEnd"]),o=(0,I.useRef)(null),a=eI(t),s=eI(n),l=eI(r),u=(0,I.useRef)(null),c=(0,I.useRef)(!1),d=(0,I.useMemo)(function(){var e=function(e){eL(e),(eR(e)?e.touches.length>0:e.buttons>0)&&o.current?a(eP(o.current,e,u.current)):(n(!1),l())},t=function(){n(!1),l()};function n(n){var r=c.current,i=eE(o.current),a=n?i.addEventListener:i.removeEventListener;a(r?"touchmove":"mousemove",e),a(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(eL(t),(!c.current||eR(t))&&r)){if(eR(t)){c.current=!0;var i=t.changedTouches||[];i.length&&(u.current=i[0].identifier)}r.focus(),a(eP(r,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]),h=d[0],p=d[1],f=d[2],g=d[3];return(0,I.useEffect)(function(){return g},[g]),D().createElement("div",eT({},i,{onTouchStart:h,onMouseDown:h,className:"react-colorful__interactive",ref:o,onKeyDown:p,onKeyUp:f,tabIndex:0,role:"slider"}))}),eB=function(e){return e.filter(Boolean).join(" ")},ez=function(e){var t=e.color,n=e.left,r=e.top,i=eB(["react-colorful__pointer",e.className]);return D().createElement("div",{className:i,style:{top:100*(void 0===r?.5:r)+"%",left:100*n+"%"}},D().createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},eF=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},ej=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?eF(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?eF(parseInt(e.substring(6,8),16)/255,2):1}},eV=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:eF(e.h),s:eF(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:eF(i/2),a:eF(r,2)}},eH=function(e){var t=eV(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},e$=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:eF(255*[r,s,a,a,l,r][u]),g:eF(255*[l,r,r,s,a,a][u]),b:eF(255*[a,a,l,r,r,s][u]),a:eF(i,2)}},eW=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},eG=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=i<1?eW(eF(255*i)):"";return"#"+eW(t)+eW(n)+eW(r)+o},eU=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:eF(60*(s<0?s+6:s)),s:eF(o?a/o*100:0),v:eF(o/255*100),a:i}},eq=D().memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,i=eB(["react-colorful__hue",e.className]);return D().createElement("div",{className:i},D().createElement(eN,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:eO(t+360*e.left,0,360)})},onEnd:r,"aria-label":"Hue","aria-valuenow":eF(t),"aria-valuemax":"360","aria-valuemin":"0"},D().createElement(ez,{className:"react-colorful__hue-pointer",left:t/360,color:eH({h:t,s:100,v:100,a:1})})))}),eY=D().memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,i={backgroundColor:eH({h:t.h,s:100,v:100,a:1})};return D().createElement("div",{className:"react-colorful__saturation",style:i},D().createElement(eN,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:eO(t.s+100*e.left,0,100),v:eO(t.v-100*e.top,0,100)})},onEnd:r,"aria-label":"Color","aria-valuetext":"Saturation "+eF(t.s)+"%, Brightness "+eF(t.v)+"%"},D().createElement(ez,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:eH(t)})))}),eX=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},eZ="u">typeof window?I.useLayoutEffect:I.useEffect,eK=new Map,eQ=function(e){eZ(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!eK.has(t)){var r=t.createElement("style");r.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}',eK.set(t,r);var i=eD||n.nc;i&&r.setAttribute("nonce",i),t.head.appendChild(r)}},[])},eJ=function(e){var t,n,r,i,o,a,s,l=e.className,u=e.colorModel,c=e.color,d=void 0===c?u.defaultColor:c,h=e.onChange,p=e.onChangeEnd,f=e_(e,["className","colorModel","color","onChange","onChangeEnd"]),g=(0,I.useRef)(null);eQ(g);var m=(t=eI(h),n=eI(p),i=(r=(0,I.useState)(function(){return u.toHsva(d)}))[0],o=r[1],a=(0,I.useRef)({color:d,hsva:i}),s=(0,I.useRef)(!1),(0,I.useEffect)(function(){if(!u.equal(d,a.current.color)){var e=u.toHsva(d);a.current={hsva:e,color:d},o(e),s.current=!1}},[d,u]),(0,I.useEffect)(function(){var e;eX(i,a.current.hsva)||u.equal(e=u.fromHsva(i),a.current.color)||(a.current={hsva:i,color:e},t(e),s.current=!0)},[i,u,t]),[i,(0,I.useCallback)(function(e){o(function(t){return Object.assign({},t,e)})},[]),(0,I.useCallback)(function(){s.current&&(s.current=!1,n(a.current.color))},[n])]),v=m[0],y=m[1],x=m[2],b=eB(["react-colorful",l]);return D().createElement("div",eT({},f,{ref:g,className:b}),D().createElement(eY,{hsva:v,onChange:y,onChangeEnd:x}),D().createElement(eq,{hue:v.h,onChange:y,onChangeEnd:x,className:"react-colorful__last-control"}))},e0={defaultColor:"000",toHsva:function(e){return eU(ej(e))},fromHsva:function(e){return eG(e$({h:e.h,s:e.s,v:e.v,a:1}))},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||eX(ej(e),ej(t))}},e1=function(e){return D().createElement(eJ,eT({},e,{colorModel:e0}))};let e2=({color:e,onChange:t,onClear:n,palette:r})=>{let[i,o]=(0,I.useState)(e),a=e=>{o(e),t?.(e)};return(0,_.jsxs)(ey.A,{spacing:1,children:[(0,_.jsx)(e1,{color:e,onChange:a,style:{width:"100%"}}),(0,_.jsx)(ey.A,{direction:"row",flexWrap:"wrap",justifyContent:"space-evenly",width:"200px",children:r&&r.map((e,t)=>(0,_.jsx)(eA,{size:"small","aria-label":`change color to ${e}`,sx:{color:e},onClick:()=>a(e),children:(0,_.jsx)(eM,{})},t))}),(0,_.jsxs)(ey.A,{direction:"row",gap:1,alignItems:"center",children:[(0,_.jsx)(eC.A,{inputProps:{"aria-label":"enter hex color"},fullWidth:!0,value:i,onChange:e=>{let n=e.target.value.replace(/([^0-9A-F]+)/gi,"").substring(0,8);o(`#${n}`),e5(e.target.value)&&t?.(e.target.value)}}),n&&(0,_.jsx)(eA,{onClick:n,children:(0,_.jsx)(ek,{})})]})]})},e5=(e,t)=>{let n=/^#?([0-9A-F]{3,8})$/i.exec(e),r=n&&n[1]?n[1].length:0;return 3===r||6===r||!!t&&4===r||!!t&&8===r};var e4=n(91823);function e3(e){let{children:t,chartsTheme:n,enablePinning:r=!1,enableSyncGrouping:i=!0}=e,[o,a]=(0,I.useState)(null),s=(0,I.useMemo)(()=>({chartsTheme:n,enablePinning:r,lastTooltipPinnedCoords:o,enableSyncGrouping:i,setLastTooltipPinnedCoords:a}),[n,r,i,o,a]);return(0,_.jsx)(e6.Provider,{value:s,children:t})}let e6=(0,I.createContext)(void 0);function e8(){let e=(0,I.useContext)(e6);if(void 0===e)throw Error("No ChartsThemeContext found. Did you forget a Provider?");return e}function e9(){return e8().chartsTheme}let e7=(0,I.createContext)(void 0);function te({children:e}){let[t,n]=(0,I.useState)(new Map),r=(0,I.useCallback)((e,t,r)=>{n(n=>{let i=new Map(n),o=i.get(e)||{loading:!1};if(void 0!==r){let n=new Map(o.itemStatuses||new Map),a=n.get(r)||{loading:!1};n.set(r,{...a,...t}),i.set(e,{...o,itemStatuses:n})}else i.set(e,{...o,...t});return i})},[]),i=(0,I.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,I.useMemo)(()=>({actionStatuses:t,setActionStatus:r,clearActionStatus:i}),[t,r,i]);return(0,_.jsx)(e7.Provider,{value:o,children:e})}let tt=()=>{},tn={actionStatuses:new Map,setActionStatus:tt,clearActionStatus:tt,hasContext:!1};function tr(){let e=(0,I.useContext)(e7);return(0,I.useMemo)(()=>e?{...e,hasContext:!0}:tn,[e])}let ti=(0,I.createContext)(void 0),to=(e,t)=>t;function ta({children:e}){let[t,n]=(0,I.useState)(new Map),r=(0,I.useRef)(to),i=(0,I.useCallback)(e=>{r.current=e},[]),o=(0,I.useCallback)(e=>{let t=new Map;e.forEach(({item:e,id:n})=>t.set(n,e)),n(t)},[]),a=(0,I.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.has(t)?r.delete(t):r.set(t,e),r})},[]),s=(0,I.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),l=(0,I.useCallback)(()=>n(new Map),[]),u=(0,I.useCallback)((e,n)=>t.has(r.current(e,n)),[t]),c=(0,I.useMemo)(()=>({selectionMap:t,setSelection:o,toggleSelection:a,removeFromSelection:s,clearSelection:l,isSelected:u,registerGetId:i}),[t,o,a,s,l,u,i]);return(0,_.jsx)(ti.Provider,{value:c,children:e})}let ts=()=>{},tl={selectionMap:new Map,setSelection:ts,toggleSelection:ts,removeFromSelection:ts,clearSelection:ts,isSelected:()=>!1,hasContext:!1};function tu(e){let t=(0,I.useContext)(ti);return(0,I.useEffect)(()=>{t&&e?.getId&&t.registerGetId(e.getId)},[t,e?.getId]),(0,I.useMemo)(()=>{if(!t)return tl;let{registerGetId:e,...n}=t;return{...n,hasContext:!0}},[t])}var tc=n(20231),td=n.n(tc);let th=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=function e(t){var n,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=" "),i+=r);else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}(e))&&(r&&(r+=" "),r+=t);return r},tp={data:""},tf=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,tg=/\/\*[^]*?\*\/| +/g,tm=/\n+/g,tv=(e,t)=>{let n="",r="",i="";for(let o in e){let a=e[o];"@"==o[0]?"i"==o[1]?n=o+" "+a+";":r+="f"==o[1]?tv(a,o):o+"{"+tv(a,"k"==o[1]?"":t)+"}":"object"==typeof a?r+=tv(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(),i+=tv.p?tv.p(o,a):o+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},ty={},tx=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+tx(e[n]);return t}return e};function tb(e){let t,n,r=this||{},i=e.call?e(r.p):e;return((e,t,n,r,i)=>{var o;let a=tx(e),s=ty[a]||(ty[a]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(a));if(!ty[s]){let t=a!==e?e:(e=>{let t,n,r=[{}];for(;t=tf.exec(e.replace(tg,""));)t[4]?r.shift():t[3]?(n=t[3].replace(tm," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(tm," ").trim();return r[0]})(e);ty[s]=tv(i?{["@keyframes "+s]:t}:t,n?"":"."+s)}let l=n&&ty.g;return n&&(ty.g=ty[s]),o=ty[s],l?t.data=t.data.replace(l,o):-1===t.data.indexOf(o)&&(t.data=r?o+t.data:t.data+o),s})(i.unshift?i.raw?(t=[].slice.call(arguments,1),n=r.p,i.reduce((e,r,i)=>{let o=t[i];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?"":tv(e,""):!1===e?"":e}return e+r+(null==o?"":o)},"")):i.reduce((e,t)=>Object.assign(e,t&&t.call?t(r.p):t),{}):i,(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})(r.target),r.g,r.o,r.k)}function tw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tS(e,t,n){return t&&tw(e.prototype,t),n&&tw(e,n),e}function tA(){return(tA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function tC(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function tM(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function tk(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}tb.bind({g:1}),tb.bind({k:1});var tT=function(){return""},t_=D().createContext({enqueueSnackbar:tT,closeSnackbar:tT}),tI="@media (max-width:599.95px)",tD="@media (min-width:600px)",tO=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},tR=function(e){return""+tO(e.vertical)+tO(e.horizontal)},tE=function(e){return!!e||0===e},tP="unmounted",tL="exited",tN="entering",tB="entered",tz="exiting",tF=function(e){function t(t){var n,r=e.call(this,t)||this,i=t.appear;return r.appearStatus=null,t.in?i?(n=tL,r.appearStatus=tN):n=tB:n=t.unmountOnExit||t.mountOnEnter?tP:tL,r.state={status:n},r.nextCallback=null,r}tC(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===tP?{status:tL}: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!==tN&&n!==tB&&(t=tN):(n===tN||n===tB)&&(t=tz)}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===tN?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===tL&&this.setState({status:tP})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.getTimeouts();e||n?(this.props.onEnter&&this.props.onEnter(this.node,e),this.safeSetState({status:tN},function(){t.props.onEntering&&t.props.onEntering(t.node,e),t.onTransitionEnd(r.enter,function(){t.safeSetState({status:tB},function(){t.props.onEntered&&t.props.onEntered(t.node,e)})})})):this.safeSetState({status:tB},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:tz},function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:tL},function(){e.props.onExited&&e.props.onExited(e.node)})})})):this.safeSetState({status:tL},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===tP)return null;var t=this.props;return(0,t.children)(e,tM(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},tS(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}(D().Component);function tj(){}function tV(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function tH(e,t){return(0,I.useMemo)(function(){return null==e&&null==t?null:function(n){tV(e,n),tV(t,n)}},[e,t])}function t$(e){var t=e.timeout,n=e.style,r=void 0===n?{}:n,i=e.mode;return{duration:"object"==typeof t?t[i]||0:t,easing:r.transitionTimingFunction,delay:r.transitionDelay}}tF.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:tj,onEntering:tj,onEntered:tj,onExit:tj,onExiting:tj,onExited:tj};var tW=function(e){e.scrollTop=e.scrollTop},tG=function(e){return Math.round(e)+"ms"};function tU(e,t){void 0===e&&(e=["all"]);var n=t||{},r=n.duration,i=void 0===r?300:r,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 i?i:tG(i))+" "+a+" "+("string"==typeof l?l:tG(l))}).join(",")}function tq(e){return(e&&e.ownerDocument||document).defaultView||window}function tY(e,t){if(t){var n=function(e,t){var n,r=t.getBoundingClientRect(),i=tq(t);if(t.fakeTransform)n=t.fakeTransform;else{var o=i.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("+(i.innerWidth+a-r.left)+"px)";case"right":return"translateX(-"+(r.left+r.width-a)+"px)";case"up":return"translateY("+(i.innerHeight+s-r.top)+"px)";default:return"translateY(-"+(r.top+r.height-s)+"px)"}}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}}var tX=(0,I.forwardRef)(function(e,t){var n=e.children,r=e.direction,i=void 0===r?"down":r,o=e.in,a=e.style,s=e.timeout,l=void 0===s?0:s,u=e.onEnter,c=e.onEntered,d=e.onExit,h=e.onExited,p=tM(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),f=(0,I.useRef)(null),g=tH(n.ref,f),m=tH(g,t),v=(0,I.useCallback)(function(){f.current&&tY(i,f.current)},[i]);return(0,I.useEffect)(function(){if(!o&&"down"!==i&&"right"!==i){var e=function(e,t){var n;function r(){for(var r=this,i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(n),n=setTimeout(function(){e.apply(r,o)},t)}return void 0===t&&(t=166),r.clear=function(){clearTimeout(n)},r}(function(){f.current&&tY(i,f.current)}),t=tq(f.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}},[i,o]),(0,I.useEffect)(function(){o||v()},[o,v]),(0,I.createElement)(tF,Object.assign({appear:!0,nodeRef:f,onEnter:function(e,t){tY(i,e),tW(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=t$({timeout:l,mode:"enter",style:tA({},a,{transitionTimingFunction:t})});e.style.webkitTransition=tU("-webkit-transform",n),e.style.transition=tU("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=t$({timeout:l,mode:"exit",style:tA({},a,{transitionTimingFunction:t})});e.style.webkitTransition=tU("-webkit-transform",n),e.style.transition=tU("transform",n),tY(i,e),d&&d(e)},onExited:function(e){e.style.webkitTransition="",e.style.transition="",h&&h(e)},in:o,timeout:l},p),function(e,t){return(0,I.cloneElement)(n,tA({ref:m,style:tA({visibility:"exited"!==e||o?void 0:"hidden"},a,{},n.props.style)},t))})});tX.displayName="Slide";var tZ=function(e){return D().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))},tK={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:D().createElement(function(){return D().createElement(tZ,null,D().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:D().createElement(function(){return D().createElement(tZ,null,D().createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},null),error:D().createElement(function(){return D().createElement(tZ,null,D().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:D().createElement(function(){return D().createElement(tZ,null,D().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:tX,transitionDuration:{enter:225,exit:195}},tQ=function(e,t){var n=function(e){return"number"==typeof e||null===e};return n(e)?e:n(t)?t:tK.autoHideDuration},tJ=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"])?tA({},tK.transitionDuration,{},n(t,["object"])&&t,{},e):n(t,["string","number"])?t:n(t,["object"])?tA({},tK.transitionDuration,{},t):tK.transitionDuration};function t0(e){return Object.entries(e).reduce(function(e,t){var n,r=t[0],i=t[1];return tA({},e,((n={})[r]=tb(i),n))},{})}var t1="notistack-CollapseWrapper",t2=t0({root:{height:0},entered:{height:"auto"}}),t5=(0,I.forwardRef)(function(e,t){var n=e.children,r=e.in,i=e.onExited,o=(0,I.useRef)(null),a=(0,I.useRef)(null),s=tH(t,a),l=function(){return o.current?o.current.clientHeight:0};return(0,I.createElement)(tF,{in:r,unmountOnExit:!0,onEnter:function(e){e.style.height="0px"},onEntered:function(e){e.style.height="auto"},onEntering:function(e){var t=l(),n=t$({timeout:175,mode:"enter"}),r=n.duration,i=n.easing;e.style.transitionDuration="string"==typeof r?r:r+"ms",e.style.height=t+"px",e.style.transitionTimingFunction=i||""},onExit:function(e){e.style.height=l()+"px"},onExited:i,onExiting:function(e){tW(e);var t=t$({timeout:175,mode:"exit"}),n=t.duration,r=t.easing;e.style.transitionDuration="string"==typeof n?n:n+"ms",e.style.height="0px",e.style.transitionTimingFunction=r||""},nodeRef:a,timeout:175},function(e,t){return(0,I.createElement)("div",Object.assign({ref:s,className:th(t2.root,"entered"===e&&t2.entered),style:tA({pointerEvents:"all",overflow:"hidden",minHeight:"0px",transition:tU("height")},"entered"===e&&{overflow:"visible"},{},"exited"===e&&!r&&{visibility:"hidden"})},t),(0,I.createElement)("div",{ref:o,className:t1,style:{display:"flex",width:"100%"}},n))})});t5.displayName="Collapse";var t4={right:"left",left:"right",bottom:"up",top:"down"},t3=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 r;return tA({},t,((r={})[n]=e[n],r))},{})},t6=function(){};function t8(e,t){return e.reduce(function(e,n){return null==n?e:function(){for(var r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=[].concat(i);t&&-1===a.indexOf(t)&&a.push(t),e.apply(this,a),n.apply(this,a)}},t6)}var t9="u">typeof window?I.useLayoutEffect:I.useEffect;function t7(e){var t=(0,I.useRef)(e);return t9(function(){t.current=e}),(0,I.useCallback)(function(){return t.current.apply(void 0,arguments)},[])}var ne=(0,I.forwardRef)(function(e,t){var n=e.children,r=e.className,i=e.autoHideDuration,o=e.disableWindowBlurListener,a=void 0!==o&&o,s=e.onClose,l=e.id,u=e.open,c=e.SnackbarProps,d=void 0===c?{}:c,h=(0,I.useRef)(),p=t7(function(){s&&s.apply(void 0,arguments)}),f=t7(function(e){s&&null!=e&&(h.current&&clearTimeout(h.current),h.current=setTimeout(function(){p(null,"timeout",l)},e))});(0,I.useEffect)(function(){return u&&f(i),function(){h.current&&clearTimeout(h.current)}},[u,i,f]);var g=function(){h.current&&clearTimeout(h.current)},m=(0,I.useCallback)(function(){null!=i&&f(.5*i)},[i,f]);return(0,I.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,I.createElement)("div",Object.assign({ref:t},d,{className:th("notistack-Snackbar",r),onMouseEnter:function(e){d.onMouseEnter&&d.onMouseEnter(e),g()},onMouseLeave:function(e){d.onMouseLeave&&d.onMouseLeave(e),m()}}),n)});ne.displayName="Snackbar";var nt=t0({root:((st={display:"flex",flexWrap:"wrap",flexGrow:1})[tD]={flexGrow:"initial",minWidth:"288px"},st)}),nn=(0,I.forwardRef)(function(e,t){var n=e.className,r=tM(e,["className"]);return D().createElement("div",Object.assign({ref:t,className:th(nt.root,n)},r))});nn.displayName="SnackbarContent";var nr=t0({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"}}),ni="notistack-snackbar",no=(0,I.forwardRef)(function(e,t){var n=e.id,r=e.message,i=e.action,o=e.iconVariant,a=e.variant,s=e.hideIconVariant,l=e.style,u=e.className,c=o[a],d=i;return"function"==typeof d&&(d=d(n)),D().createElement(nn,{ref:t,role:"alert","aria-describedby":ni,style:l,className:th("notistack-MuiContent","notistack-MuiContent-"+a,nr.root,nr[a],u,!s&&c&&nr.lessPadding)},D().createElement("div",{id:ni,className:nr.message},s?null:c,r),d&&D().createElement("div",{className:nr.action},d))});no.displayName="MaterialDesignContent";var na=(0,I.memo)(no),ns=t0({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),nl=function(e){var t,n=(0,I.useRef)(),r=(0,I.useState)(!0),i=r[0],o=r[1],a=t8([e.snack.onClose,e.onClose]),s=(0,I.useCallback)(function(){n.current=setTimeout(function(){o(function(e){return!e})},125)},[]);(0,I.useEffect)(function(){return function(){n.current&&clearTimeout(n.current)}},[]);var l=e.snack,u=e.classes,c=e.Component,d=(0,I.useMemo)(function(){return t3(u)},[u]),h=l.open,p=l.SnackbarProps,f=l.TransitionComponent,g=l.TransitionProps,m=l.transitionDuration,v=l.disableWindowBlurListener,y=l.content,x=tM(l,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),b=tA({direction:"center"!==(t=x.anchorOrigin).horizontal?t4[t.horizontal]:t4[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 r;return tA({},t,((r={})[n]=t8([e.snack[n],e[n]],x.id),r))},{});return D().createElement(t5,{in:i,onExited:S.onExited},D().createElement(ne,{open:h,id:x.id,disableWindowBlurListener:v,autoHideDuration:x.autoHideDuration,className:th(ns.wrappedRoot,d.root,d["anchorOrigin"+tR(x.anchorOrigin)]),SnackbarProps:p,onClose:a},D().createElement(f,Object.assign({},b,{appear:!0,in:h,onExit:S.onExit,onExited:s,onEnter:S.onEnter,onEntered:t8([S.onEntered,function(){e.snack.requestClose&&a(null,"instructed",e.snack.id)}],x.id)}),w||D().createElement(void 0===c?na:c,Object.assign({},x)))))},nu=20,nc=6,nd=2,nh="."+t1,np=t0({root:((sn={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:tU(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"})[nh]={padding:nc+"px 0px",transition:"padding 300ms ease 0ms"},sn.maxWidth="calc(100% - "+2*nu+"px)",sn[tI]={width:"100%",maxWidth:"calc(100% - 32px)"},sn),rootDense:((sr={})[nh]={padding:nd+"px 0px"},sr),top:{top:nu-nc+"px",flexDirection:"column"},bottom:{bottom:nu-nc+"px",flexDirection:"column-reverse"},left:((si={left:nu+"px"})[tD]={alignItems:"flex-start"},si[tI]={left:"16px"},si),right:((so={right:nu+"px"})[tD]={alignItems:"flex-end"},so[tI]={right:"16px"},so),center:((sa={left:"50%",transform:"translateX(-50%)"})[tD]={alignItems:"center"},sa)}),nf=(0,I.memo)(function(e){var t=e.classes,n=void 0===t?{}:t,r=e.anchorOrigin,i=e.dense,o=e.children,a=th("notistack-SnackbarContainer",np[r.vertical],np[r.horizontal],np.root,n.containerRoot,n["containerAnchorOrigin"+tR(r)],i&&np.rootDense);return D().createElement("div",{className:a},o)}),ng=function(e){return!("string"==typeof e||(0,I.isValidElement)(e))},nm=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 r,i=ng(e)?e:t,o=ng(e)?e.message:e,a=i.key,s=i.preventDuplicate,l=tM(i,["key","preventDuplicate"]),u=tE(a),c=u?a:new Date().getTime()+Math.random(),d=(r=n.props,function(e,t){return(void 0===t&&(t=!1),t)?tA({},tK[e],{},r[e],{},l[e]):"autoHideDuration"===e?tQ(l.autoHideDuration,r.autoHideDuration):"transitionDuration"===e?tJ(l.transitionDuration,r.transitionDuration):l[e]||r[e]||tK[e]}),h=tA({id:c},l,{message:o,open:!0,entered:!1,requestClose:!1,persist:d("persist"),action:d("action"),content:d("content"),variant:d("variant"),anchorOrigin:d("anchorOrigin"),disableWindowBlurListener:d("disableWindowBlurListener"),autoHideDuration:d("autoHideDuration"),hideIconVariant:d("hideIconVariant"),TransitionComponent:d("TransitionComponent"),transitionDuration:d("transitionDuration"),TransitionProps:d("TransitionProps",!0),iconVariant:d("iconVariant",!0),style:d("style",!0),SnackbarProps:d("SnackbarProps",!0),className:th(n.props.className,l.className)});return h.persist&&(h.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},r=e.queue.findIndex(t)>-1,i=e.snacks.findIndex(t)>-1;if(r||i)return e}return n.handleDisplaySnack(tA({},e,{queue:[].concat(e.queue,[h])}))}),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?tA({},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,r=!1;e.snacks.reduce(function(e,t){return e+(t.open&&t.persist?1:0)},0)===n.maxSnack&&(r=!0);var i=e.snacks.map(function(e){return t||e.persist&&!r?tA({},e):(t=!0,e.entered)?(e.onClose&&e.onClose(null,"maxsnack",e.id),n.props.onClose&&n.props.onClose(null,"maxsnack",e.id),tA({},e,{open:!1})):tA({},e,{requestClose:!0})});return tA({},e,{snacks:i})},n.handleEnteredSnack=function(e,t,r){if(!tE(r))throw Error("handleEnteredSnack Cannot be called with undefined key");n.setState(function(e){return{snacks:e.snacks.map(function(e){return e.id===r?tA({},e,{entered:!0}):tA({},e)})}})},n.handleCloseSnack=function(e,t,r){n.props.onClose&&n.props.onClose(e,t,r);var i=void 0===r;n.setState(function(e){var t=e.snacks,n=e.queue;return{snacks:t.map(function(e){return i||e.id===r?e.entered?tA({},e,{open:!1}):tA({},e,{requestClose:!0}):tA({},e)}),queue:n.filter(function(e){return e.id!==r})}})},n.closeSnackbar=function(e){var t=n.state.snacks.find(function(t){return t.id===e});tE(e)&&t&&t.onClose&&t.onClose(null,"instructed",e),n.handleCloseSnack(null,"instructed",e)},n.handleExitedSnack=function(e,t){if(!tE(t))throw Error("handleExitedSnack Cannot be called with undefined key");n.setState(function(e){var r=n.processQueue(tA({},e,{snacks:e.snacks.filter(function(e){return e.id!==t})}));return 0===r.queue.length?r:n.handleDismissOldest(r)})},n.enqueueSnackbar,n.closeSnackbar,n.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:n.enqueueSnackbar.bind(tk(n)),closeSnackbar:n.closeSnackbar.bind(tk(n))}},n}return tC(t,e),t.prototype.render=function(){var e=this,t=this.state.contextValue,n=this.props,r=n.domRoot,i=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,r=tR(t.anchorOrigin),i=e[r]||[];return tA({},e,((n={})[r]=[].concat(i,[t]),n))},{}),d=Object.keys(c).map(function(t){var n=c[t],r=n[0];return D().createElement(nf,{key:t,dense:a,anchorOrigin:r.anchorOrigin,classes:u},n.map(function(t){return D().createElement(nl,{key:t.id,snack:t,classes:u,Component:l[t.variant],onClose:e.handleCloseSnack,onEnter:e.props.onEnter,onExit:e.props.onExit,onExited:t8([e.handleExitedSnack,e.props.onExited],t.id),onEntered:t8([e.handleEnteredSnack,e.props.onEntered],t.id)})}))});return D().createElement(t_.Provider,{value:t},i,r?(0,tc.createPortal)(d,r):d)},tS(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||tK.maxSnack}}]),t}(I.Component);function nv({children:e,...t}){return(0,_.jsx)(nm,{...t,Components:{error:(0,N.A)(na)(()=>({"&.notistack-MuiContent-error":{whiteSpace:"pre-wrap"}}))},children:e})}function ny(){let{enqueueSnackbar:e,closeSnackbar:t}=(0,I.useContext)(t_),n=nx(e,"error"),r=nx(e,"info"),i=nx(e,"warning"),o=nx(e,"success"),a=(0,I.useCallback)((e,t)=>n(e instanceof Error?e.message:`An unexpected error occurred: ${e}`,t),[n]);return{enqueueSnackbar:e,closeSnackbar:t,errorSnackbar:n,infoSnackbar:r,warningSnackbar:i,successSnackbar:o,exceptionSnackbar:a}}function nx(e,t){return(0,I.useCallback)((n,r)=>e(n,{...r,variant:t}),[e,t])}var nb=n(25632);let nw="Pinned Crosshair",nS={name:nw,type:"line",markLine:{data:[],lineStyle:{type:"dashed",width:2},emphasis:{lineStyle:{width:2,opacity:1}},blur:{lineStyle:{width:2,opacity:1}}}};var nA=n(42636);let nC={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function nM(e){return (t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}let nk={date:nM({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:nM({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:nM({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},nT={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function n_(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):t;r=e.formattingValues[i]||e.formattingValues[t]}else{let t=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;r=e.values[i]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function nI(e){return(t,n={})=>{let r,i=n.width,o=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;let s=a[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}(l,e=>e.test(s)):function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}(l,e=>e.test(s));return r=e.valueCallback?e.valueCallback(u):u,{value:r=n.valueCallback?n.valueCallback(r):r,rest:t.slice(s.length)}}}let nD={code:"en-US",formatDistance:(e,t,n)=>{let r,i=nC[e];if(r="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),n?.addSuffix)if(n.comparison&&n.comparison>0)return"in "+r;else return r+" ago";return r},formatLong:nk,formatRelative:(e,t,n,r)=>nT[e],localize:{ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:n_({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:n_({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:n_({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:n_({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:n_({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(a9={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{let n=e.match(a9.matchPattern);if(!n)return null;let r=n[0],i=e.match(a9.parsePattern);if(!i)return null;let o=a9.valueCallback?a9.valueCallback(i[0]):i[0];return{value:o=t.valueCallback?t.valueCallback(o):o,rest:e.slice(r.length)}}),era:nI({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:nI({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:nI({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:nI({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:nI({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},nO={},nR=["years","months","weeks","days","hours","minutes","seconds"];function nE(e){var t,n;let r,i,o,a;return{value:{pastDuration:e},display:`Last ${t=(0,nA.parseDurationString)(e),n={delimiter:", "},r=n?.locale??nO.locale??nD,i=n?.format??nR,o=n?.zero??!1,a=n?.delimiter??" ",!r.formatDistance?"":i.reduce((e,n)=>{let i=`x${n.replace(/(^.)/,e=>e.toUpperCase())}`,a=t[n];return void 0!==a&&(o||t[n])?e.concat(r.formatDistance(i,a)):e},[]).join(a)}`}}function nP(){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 nL(e,t){return"read"===e?"View":t&&"create"===e?"Add":t||"create"!==e?"update"===e?"Edit":"":"Create"}function nN(e,t){return t&&"create"===e?"Add":t&&"update"===e?"Apply":t?"":"Save"}let nB=["bottom","right"],nz=["list","table"],nF=["small","medium"];function nj(e){return nB.includes(e)}function nV(e){return nz.includes(e)}function nH(e){return nF.includes(e)}let n$={position:"bottom",mode:"list",size:"medium"};function nW(e){return void 0===e?n$.position:nj(e)?e:n$.position}function nG(e){return e&&nV(e)?e:n$.mode}function nU(e){return e&&nH(e)?e:n$.size}let nq=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 nY(e,t,n,r="en-US"){let i=`${e.filter(e=>![void 0,null,"",NaN].includes(e)).join("|")}|${r}`,o=nq.get(t);if(!o)throw Error("No formatter found for the input type");let a=o.get(i);if(a)return a.format;let s=Intl.NumberFormat(r,n);return o?.set(`${i}`,s),s.format}let nX=()=>({countCacheItems:e=>"all"!==e?nq.get(e)?.size??0:Array.from(nq.values()).reduce((e,t)=>e+(t?.size??0),0),getKeys:e=>[...nq.get(e)?.keys()||[]]});function nZ(e){return!1!==e}function nK(e){return"number"==typeof e}function nQ(e){return e&&(e<0?e=0:e>20&&(e=20)),e}let nJ="Time",n0={label:"Time",decimalPlaces:!0},n1={nanoseconds:{group:nJ,label:"Nanoseconds"},microseconds:{group:nJ,label:"Microseconds"},milliseconds:{group:nJ,label:"Milliseconds"},seconds:{group:nJ,label:"Seconds"},minutes:{group:nJ,label:"Minutes"},hours:{group:nJ,label:"Hours"},days:{group:nJ,label:"Days"},weeks:{group:nJ,label:"Weeks"},months:{group:nJ,label:"Months"},years:{group:nJ,label:"Years"}};var n2=((a7={}).nanoseconds="nanosecond",a7.microseconds="microsecond",a7.milliseconds="millisecond",a7.seconds="second",a7.minutes="minute",a7.hours="hour",a7.days="day",a7.weeks="week",a7.months="month",a7.years="year",a7);let n5={years:31536e3,months:2592e3,weeks:604800,days:86400,hours:3600,minutes:60,seconds:1,milliseconds:.001,microseconds:1e-6,nanoseconds:1e-9},n4=["years","months","weeks","days","hours","minutes","seconds","milliseconds","microseconds","nanoseconds"];function n3(e,{unit:t,decimalPlaces:n}){var r;if(0===e)return"0s";let i=function(e,t){let n=e*n5[t],r=n4[0]||"years",i=r,o=n/n5[r];for(i of n4)if((o=n/n5[i])>=1)break;return{value:o,unit:i}}(e,t??"seconds"),o={style:"unit",unit:n2[i.unit],unitDisplay:"months"===(r=i.unit)||"years"===r?"long":"narrow"};return nK(n)?(o.minimumFractionDigits=nQ(n),o.maximumFractionDigits=nQ(n)):o.maximumSignificantDigits=3,nY([o.style,o.unit,o.unitDisplay,o.maximumSignificantDigits,n,t??"seconds"],"time",o,"en-US")(i.value)}var n6="u">typeof globalThis?globalThis:"u">typeof window?window:void 0!==n.g?n.g:"u">typeof self?self:{};function n8(){if(sc)return su;sc=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 su={unformat:function(n,r){let i,o=re(),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 r=+n[0],i=+n[1],o=+n[2];return!isNaN(r)&&!isNaN(i)&&!isNaN(o)}(n,a)){let e,t,r;t=+(e=n.split(":"))[0],r=+e[1],i=+e[2]+60*r+3600*t}else i=function(n,r,i="",o,a,s){if(""!==n)return n===a?0:function n(r,i,o,a,s,l,u){if(!isNaN(+r))return+r;let c="",d=r.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(d!==r)return -1*n(d,i,o,a,s,l);for(let t=0;t<e.length;t++){let u=e[t];if((c=r.replace(RegExp(`([0-9 ])(${u.key})$`),"$1"))!==r)return n(c,i,o,a,s,l)*u.factor}if((c=r.replace("%",""))!==r)return n(c,i,o,a,s,l)/100;let h=parseFloat(r);if(isNaN(h))return;let p=a(h);if(p&&"."!==p&&(c=r.replace(RegExp(`${t(p)}$`),""))!==r)return n(c,i,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=r.replace(t,""))!==r){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,i,o,a,s,l)*e}}}(n.replace(i,"").replace(RegExp(`([0-9])${t(r.thousands)}([0-9])`,"g"),"$1$2").replace(r.decimal,"."),r,i,o,a,s)}(n,a,s,l,u,c);else{if("number"!=typeof n)return;i=n}if(void 0!==i)return i}}}function n9(){if(sh)return sd;sh=1;let e=n8(),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`"}},r={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 i(t){return void 0!==e.unformat(t)}function o(e,t,r,i=!1){let a=Object.keys(e).map(i=>{if(!t[i])return console.error(`${r} Invalid key: ${i}`),!1;let a=e[i],s=t[i];if("string"==typeof s&&(s={type:s}),"format"===s.type){if(!o(a,n,`[Validate ${i}]`,!0))return!1}else if(typeof a!==s.type)return console.error(`${r} ${i} 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(`${r} ${i} invalid value: ${o}`),!1}}return s.restriction&&!s.restriction(a,e)?(console.error(`${r} ${i} invalid value: ${s.message}`),!1):s.validValues&&-1===s.validValues.indexOf(a)?(console.error(`${r} ${i} invalid value: must be among ${JSON.stringify(s.validValues)}, "${a}" provided`),!1):(!s.children||!!o(a,s.children,`[Validate ${i}]`))&&!0});return i||a.push(...Object.keys(t).map(n=>{let i=t[n];if("string"==typeof i&&(i={type:i}),i.mandatory){let t=i.mandatory;if("function"==typeof t&&(t=t(e)),t&&void 0===e[n])return console.error(`${r} Missing mandatory key "${n}"`),!1}return!0})),a.reduce((e,t)=>e&&t,!0)}function a(e){return o(e,n,"[Validate format]")}return sd={validate:function(e,t){let n=i(e),r=a(t);return n&&r},validateFormat:a,validateInput:i,validateLanguage:function(e){return o(e,r,"[Validate language]")}}}var n7=function(e,t={}){var n,r,i,o,a,s;let l,u,c,d,h;if("string"!=typeof e)return e;r=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=r.match(/{([^}]*)}$/))?(t.postfix=u[1],r.slice(0,-u[0].length)):r,t),(c=e.match(/[1-9]+[0-9]*/))&&(t.totalLength=+c[0]),(d=e.split(".")[0].match(/0+/))&&(t.characteristic=d[0].length),-1!==(i=e).indexOf(".")&&(t.optionalCharacteristic=-1===i.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),(h=e.split(".")[1])&&(t.trimMantissa=-1!==h.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 re(){let e;if(sf)return sp;sf=1;let t=sl?ss:(sl=1,ss={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=n9(),r={},i={},o=null,a={};function s(){return i[e]}return r.languages=()=>Object.assign({},i),r.currentLanguage=()=>e,r.currentBytes=()=>s().bytes||{},r.currentCurrency=()=>s().currency,r.currentAbbreviations=()=>s().abbreviations,r.currentDelimiters=()=>s().delimiters,r.currentOrdinal=()=>s().ordinal,r.currentDefaults=()=>Object.assign({},s().defaults,a),r.currentOrdinalDefaultFormat=()=>Object.assign({},r.currentDefaults(),s().ordinalFormat),r.currentByteDefaultFormat=()=>Object.assign({},r.currentDefaults(),s().byteFormat),r.currentPercentageDefaultFormat=()=>Object.assign({},r.currentDefaults(),s().percentageFormat),r.currentCurrencyDefaultFormat=()=>Object.assign({},r.currentDefaults(),s().currencyFormat),r.currentTimeDefaultFormat=()=>Object.assign({},r.currentDefaults(),s().timeFormat),r.setDefaults=e=>{e=n7(e),n.validateFormat(e)&&(a=e)},r.getZeroFormat=()=>o,r.setZeroFormat=e=>o="string"==typeof e?e:null,r.hasZeroFormat=()=>null!==o,r.languageData=e=>{if(e){if(i[e])return i[e];throw Error(`Unknown tag "${e}"`)}return s()},r.registerLanguage=(t,r=!1)=>{if(!n.validateLanguage(t))throw Error("Invalid language data");i[t.languageTag]=t,r&&(e=t.languageTag)},r.setLanguage=(n,r=t.languageTag)=>{if(!i[n]){let t=n.split("-")[0],o=Object.keys(i).find(e=>e.split("-")[0]===t);return i[o]?void(e=o):void(e=r)}e=n},r.registerLanguage(t),e=t.languageTag,sp=r}var rt={exports:{}};(function(e){var t,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,r=Math.ceil,i=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,r=1,i=e.length,o=e[0]+"";r<i;){for(n=14-(t=e[r++]+"").length;n--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function c(e,t){var n,r,i=e.c,o=t.c,a=e.s,s=t.s,l=e.e,u=t.e;if(!a||!s)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=a<0,r=l==u,!i||!o)return r?0:!i^n?1:-1;if(!r)return l>u^n?1:-1;for(a=0,s=(l=i.length)<(u=o.length)?l:u;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^n?1:-1;return l==u?0:l>u^n?1:-1}function d(e,t,n,r){if(e<t||e>n||e!==i(e))throw Error(o+(r||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function h(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 r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}(t=function e(t){var g,m,v,y,x,b,w,S,A,C=z.prototype={constructor:z,toString:null,valueOf:null},M=new z(1),k=20,T=4,_=-7,I=21,D=-1e7,O=1e7,R=!1,E=1,P=0,L={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},N="0123456789abcdefghijklmnopqrstuvwxyz",B=!0;function z(e,t){var r,o,s,l,u,c,h,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 A(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(d(t,2,N.length,"Base"),10==t&&B)return H(f=new z(e),k+f.e+1,T);if(p=String(e),c="number"==typeof e){if(0*e!=0)return A(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(r=N.slice(0,t),l=u=0,h=p.length;u<h;u++)if(0>r.indexOf(o=p.charAt(u))){if("."==o){if(u>l){l=h;continue}}else if(!s&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){s=!0,u=-1,l=0;continue}return A(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(h=p.length;48===p.charCodeAt(--h););if(p=p.slice(u,++h)){if(h-=u,c&&z.DEBUG&&h>15&&(e>0x1fffffffffffff||e!==i(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<h){for(u&&f.c.push(+p.slice(0,u)),h-=14;u<h;)f.c.push(+p.slice(u,u+=14));u=14-(p=p.slice(u)).length}else u-=h;for(;u--;p+="0");f.c.push(+p)}}else f.c=[f.e=0]}function F(e,t,n,r){var i,o,a,s,l;if(null==n?n=T:d(n,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)l=u(e.c),l=1==r||2==r&&(a<=_||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==r||2==r&&(t<=o||o<=_)){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&&i?"-"+l:l}function j(e,t){for(var n,r,i=1,o=new z(e[0]);i<e.length;i++)(r=new z(e[i])).s&&(n=c(o,r))!==t&&(0!==n||o.s!==t)||(o=r);return o}function V(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+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,d,h,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=i((d=f[h=0])/s[a-u-1]%10);else if((h=r((l+1)/14))>=f.length)if(o){for(;f.length<=h;f.push(0));d=p=0,a=1,l%=14,u=l-14+1}else break e;else{for(a=1,d=c=f[h];c>=10;c/=10,a++);l%=14,p=(u=l-14+a)<0?0:i(d/s[a-u-1]%10)}if(o=o||t<0||null!=f[h+1]||(u<0?d:d%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?d/s[a-u]:0:f[h-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=h,c=1,h--):(f.length=h+1,c=s[14-l],f[h]=u>0?i(d/s[a-u]%s[u])*c:0),o)for(;;)if(0==h){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[h]+=c,1e14!=f[h])break;f[h--]=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 $(e){var t,n=e.e;return null===n?e.toString():(t=u(e.c),t=n<=_||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")&&(d(n=e[t],0,1e9,t),k=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(d(n=e[t],0,8,t),T=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(d(n[0],-1e9,0,t),d(n[1],0,1e9,t),_=n[0],I=n[1]):(d(n,-1e9,1e9,t),_=-(I=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)d(n[0],-1e9,-1,t),d(n[1],1,1e9,t),D=n[0],O=n[1];else if(d(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")&&(d(n=e[t],0,9,t),E=n),e.hasOwnProperty(t="POW_PRECISION")&&(d(n=e[t],0,1e9,t),P=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:k,ROUNDING_MODE:T,EXPONENTIAL_AT:[_,I],RANGE:[D,O],CRYPTO:R,MODULO_MODE:E,POW_PRECISION:P,FORMAT:L,ALPHABET:N}},z.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!z.DEBUG)return!0;var t,n,r=e.c,a=e.e,s=e.s;e:if("[object Array]"==({}).toString.call(r)){if((1===s||-1===s)&&a>=-1e9&&a<=1e9&&a===i(a)){if(0===r[0]){if(0===a&&1===r.length)return!0;break e}if((t=(a+1)%14)<1&&(t+=14),String(r[0]).length==t){for(t=0;t<r.length;t++)if((n=r[t])<0||n>=1e14||n!==i(n))break e;if(0!==n)return!0}}}else if(null===r&&null===a&&(null===s||1===s||-1===s))return!0;throw Error(o+"Invalid BigNumber: "+e)},z.maximum=z.max=function(){return j(arguments,-1)},z.minimum=z.min=function(){return j(arguments,1)},g=0x20000000000000*Math.random()&2097151?function(){return i(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,h=[],p=new z(M);if(null==e?e=k:d(e,0,1e9),l=r(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]):(h.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):(h.push(u%1e14),c+=7);c=l/7}else throw R=!1,Error(o+"crypto unavailable");if(!R)for(;c<l;)(u=g())<9e15&&(h[c++]=u%1e14);for(l=h[--c],e%=14,l&&e&&(u=s[14-e],h[c]=i(l/u)*u);0===h[c];h.pop(),c--);if(c<0)h=[a=0];else{for(a=-1;0===h[0];h.splice(0,1),a-=14);for(c=1,u=h[0];u>=10;u/=10,c++);c<14&&(a-=14-c)}return p.e=a,p.c=h,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,r){for(var i,o,a=[0],s=0,l=e.length;s<l;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(n,r,i,o,a){var s,l,c,d,h,p,g,m,v=n.indexOf("."),y=k,x=T;for(v>=0&&(d=P,P=0,n=n.replace(".",""),p=(m=new z(r)).pow(n.length-v),P=d,m.c=t(f(u(p.c),p.e,"0"),10,i,e),m.e=m.c.length),c=d=(g=t(n,r,i,a?(s=N,e):(s=e,N))).length;0==g[--d];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,i)).c,h=p.r,c=p.e),v=g[l=c+y+1],d=i/2,h=h||l<0||null!=g[l+1],h=x<4?(null!=v||h)&&(0==x||x==(p.s<0?3:2)):v>d||v==d&&(4==x||h||6==x&&1&g[l-1]||x==(p.s<0?8:7)),l<1||!g[0])n=h?f(s.charAt(1),-y,s.charAt(0)):s.charAt(0);else{if(g.length=l,h)for(--i;++g[--l]>i;)g[l]=0,l||(++c,g=[1].concat(g));for(d=g.length;!g[--d];);for(v=0,n="";v<=d;n+=s.charAt(g[v++]));n=f(n,c,s.charAt(0))}return n}}(),w=function(){function e(e,t,n){var r,i,o,a,s=0,l=e.length,u=t%1e7,c=t/1e7|0;for(e=e.slice();l--;)r=c*(o=e[l]%1e7)+(a=e[l]/1e7|0)*u,s=((i=u*o+r%1e7*1e7+s)/n|0)+(r/1e7|0)+c*a,e[l]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=+(e[n]<t[n]),e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,o,a,s,u){var c,d,h,p,f,g,m,v,y,x,b,w,S,A,C,M,k,T=r.s==o.s?1:-1,_=r.c,I=o.c;if(!_||!_[0]||!I||!I[0])return new z(!r.s||!o.s||(_?I&&_[0]==I[0]:!I)?NaN:_&&0==_[0]||!I?0*T:T/0);for(y=(v=new z(T)).c=[],T=a+(d=r.e-o.e)+1,u||(u=1e14,d=l(r.e/14)-l(o.e/14),T=T/14|0),h=0;I[h]==(_[h]||0);h++);if(I[h]>(_[h]||0)&&d--,T<0)y.push(1),p=!0;else{for(A=_.length,M=I.length,h=0,T+=2,(f=i(u/(I[0]+1)))>1&&(I=e(I,f,u),_=e(_,f,u),M=I.length,A=_.length),S=M,b=(x=_.slice(0,M)).length;b<M;x[b++]=0);k=[0].concat(k=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=i(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?k: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?k:I,b,u),b=x.length}else 0===c&&(f++,x=[0]);y[h++]=f,x[0]?x[b++]=_[S]||0:(x=[_[S]],b=1)}while((S++<A||null!=x[0])&&T--);p=null!=x[0],y[0]||y.splice(0,1)}if(1e14==u){for(h=1,T=y[0];T>=10;T/=10,h++);H(v,a+(v.e=h+14*d-1)+1,s,p)}else v.e=d,v.r=+p;return v}}(),m=/^(-?)0([xbo])(?=\w[\w.]*$)/i,v=/^([^.]+)\.$/,y=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,b=/^\s*\+(?=[\w.])|^\s+|\s+$/g,A=function(e,t,n,r){var i,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 i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=i?e:t}),r&&(i=r,a=a.replace(v,"$1").replace(y,"0.$1")),t!=a))return new z(a,i);if(z.DEBUG)throw Error(o+"Not a"+(r?" base "+r:"")+" 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,r,i;if(null!=e)return d(e,0,1e9),null==t?t=T:d(t,0,8),H(new z(this),e+this.e+1,t);if(!(n=this.c))return null;if(r=((i=n.length-1)-l(this.e/14))*14,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},C.dividedBy=C.div=function(e,t){return w(this,new z(e,t),k,T)},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,d,p,f,g=this;if((e=new z(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+$(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(+$(g),c?e.s*(2-h(e)):+$(e))),t?f.mod(t):f;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new z(NaN);(a=!d&&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&&h(e)?-0:0,g.e>-1&&(l=1/l),new z(d?1/l:l);P&&(l=r(P/14+2))}for(c?(n=new z(.5),d&&(e.s=1),p=h(e)):p=(s=Math.abs(+$(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=i(s/2)))break;p=s%2}else if(H(e=e.times(n),e.e+1,1),e.e>14)p=h(e);else{if(0==(s=+$(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:(d&&(f=M.div(f)),t?f.mod(t):l?H(f,P,T,u):f)},C.integerValue=function(e){var t=new z(this);return null==e?e=T:d(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,r,i,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,d=e.c;if(!s||!u){if(!c||!d)return c?(e.s=-t,e):new z(d?this:NaN);if(!c[0]||!d[0])return d[0]?(e.s=-t,e):new z(c[0]?this:3==T?-0:0)}if(s=l(s),u=l(u),c=c.slice(),a=s-u){for((o=a<0)?(a=-a,i=c):(u=s,i=d),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(r=(o=(a=c.length)<(t=d.length))?a:t,a=t=0;t<r;t++)if(c[t]!=d[t]){o=c[t]<d[t];break}if(o&&(i=c,c=d,d=i,e.s=-e.s),(t=(r=d.length)-(n=c.length))>0)for(;t--;c[n++]=0);for(t=1e14-1;r>a;){if(c[--r]<d[r]){for(n=r;n&&!c[--n];c[n]=t);--c[n],c[r]+=1e14}c[r]-=d[r]}for(;0==c[0];c.splice(0,1),--u);return c[0]?V(e,c,u):(e.s=3==T?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,t){var n,r;return(e=new z(e,t),this.c&&e.s&&(!e.c||e.c[0]))?e.c&&(!this.c||this.c[0])?(9==E?(r=e.s,e.s=1,n=w(this,e,0,3),e.s=r,n.s*=r):n=w(this,e,0,E),(e=this.minus(n.times(e))).c[0]||1!=E||(e.s=this.s),e):new z(this):new z(NaN)},C.multipliedBy=C.times=function(e,t){var n,r,i,o,a,s,u,c,d,h,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(r=l(this.e/14)+l(e.e/14),e.s*=this.s,(u=m.length)<(h=v.length)&&(g=m,m=v,v=g,i=u,u=h,h=i),i=u+h,g=[];i--;g.push(0));for(i=h;--i>=0;){for(n=0,p=v[i]%1e7,f=v[i]/1e7|0,o=i+(a=u);o>i;)s=f*(c=m[--a]%1e7)+(d=m[a]/1e7|0)*p,n=((c=p*c+s%1e7*1e7+g[o]+n)/1e14|0)+(s/1e7|0)+f*d,g[o--]=c%1e14;g[o]=n}return n?++r:g.splice(0,1),V(e,g,r)},C.negated=function(){var e=new z(this);return e.s=-e.s||null,e},C.plus=function(e,t){var n,r=this.s;if(t=(e=new z(e,t)).s,!r||!t)return new z(NaN);if(r!=t)return e.s=-t,this.minus(e);var i=this.e/14,o=e.e/14,a=this.c,s=e.c;if(!i||!o){if(!a||!s)return new z(r/0);if(!a[0]||!s[0])return s[0]?e:new z(a[0]?this:0*r)}if(i=l(i),o=l(o),a=a.slice(),r=i-o){for(r>0?(o=i,n=s):(r=-r,n=a),n.reverse();r--;n.push(0));n.reverse()}for((r=a.length)-(t=s.length)<0&&(n=s,s=a,a=n,t=r),r=0;t;)r=(a[--t]=a[t]+s[t]+r)/1e14|0,a[t]=1e14===a[t]?0:a[t]%1e14;return r&&(a=[r].concat(a),++o),V(e,a,o)},C.precision=C.sd=function(e,t){var n,r,i;if(null!=e&&!!e!==e)return d(e,1,1e9),null==t?t=T:d(t,0,8),H(new z(this),e,t);if(!(n=this.c))return null;if(r=14*(i=n.length-1)+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&this.e+1>r&&(r=this.e+1),r},C.shiftedBy=function(e){return d(e,-0x1fffffffffffff,0x1fffffffffffff),this.times("1e"+e)},C.squareRoot=C.sqrt=function(){var e,t,n,r,i,o=this.c,a=this.s,s=this.e,c=k+4,d=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(+$(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(i=n,n=d.times(i.plus(w(this,i,c,1))),u(i.c).slice(0,a)===(t=u(n.c)).slice(0,a)){if(n.e<s&&--a,"9999"!=(t=t.slice(a-3,a+1))&&(r||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(H(n,n.e+k+2,1),e=!n.times(n).eq(this));break}if(!r&&(H(i,i.e+k+2,0),i.times(i).eq(this))){n=i;break}c+=4,a+=4,r=1}}return H(n,n.e+k+1,T,e)},C.toExponential=function(e,t){return null!=e&&(d(e,0,1e9),e++),F(this,e,t,1)},C.toFixed=function(e,t){return null!=e&&(d(e,0,1e9),e=e+this.e+1),F(this,e,t)},C.toFormat=function(e,t,n){var r;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(r=this.toFixed(e,t),this.c){var i,a=r.split("."),s=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||"",c=a[0],d=a[1],h=this.s<0,p=h?c.slice(1):c,f=p.length;if(l&&(i=s,s=l,l=i,f-=i),s>0&&f>0){for(i=f%s||s,c=p.substr(0,i);i<f;i+=s)c+=u+p.substr(i,s);l>0&&(c+=u+p.slice(i)),h&&(c="-"+c)}r=d?c+(n.decimalSeparator||"")+((l=+n.fractionGroupSize)?d.replace(RegExp("\\d{"+l+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):c}return(n.prefix||"")+r+(n.suffix||"")},C.toFraction=function(e){var t,n,r,i,a,l,c,d,h,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: ")+$(c));if(!m)return new z(this);for(t=new z(M),h=n=new z(M),r=d=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:h:c,l=O,O=1/0,c=new z(g),d.c[0]=0;p=w(c,t,0,1),1!=(i=n.plus(p.times(r))).comparedTo(e);)n=r,r=i,h=d.plus(p.times(i=h)),d=i,t=c.minus(p.times(i=t)),c=i;return i=w(e.minus(n),r,0,1),d=d.plus(i.times(h)),n=n.plus(i.times(r)),d.s=h.s=this.s,a*=2,f=1>w(h,r,a,T).minus(this).abs().comparedTo(w(d,n,a,T).minus(this).abs())?[h,r]:[d,n],O=l,f},C.toNumber=function(){return+$(this)},C.toPrecision=function(e,t){return null!=e&&d(e,1,1e9),F(this,e,t,2)},C.toString=function(e){var t,n=this,r=n.s,i=n.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(null==e?t=i<=_||i>=I?p(u(n.c),i):f(u(n.c),i,"0"):10===e&&B?t=f(u((n=H(new z(n),k+i+1,T)).c),n.e,"0"):(d(e,2,N.length,"Base"),t=S(f(u(n.c),i,"0"),10,e,r,!0)),r<0&&n.c[0]&&(t="-"+t)),t},C.valueOf=C.toJSON=function(){return $(this)},C._isBigNumber=!0,null!=t&&z.set(t),z}()).default=t.BigNumber=t,rt.exports?rt.exports=t:(e||(e="u">typeof self&&self?self:window),e.BigNumber=t)})(n6);var rn=rt.exports;let rr=re(),ri=n9(),ro={trillion:1e12,billion:1e9,million:1e6,thousand:1e3},ra={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:rs,decimalSuffixes:rl}=rr.currentBytes(),ru={scale:1024,suffixes:rl,marker:"bd"},rc={scale:1024,suffixes:rs,marker:"b"},rd={scale:1e3,suffixes:rl,marker:"d"};function rh(e,t,n){let r=t[0],i=Math.abs(e);if(i>=n){for(let o=1;o<t.length;++o){let a=Math.pow(n,o),s=Math.pow(n,o+1);if(i>=a&&i<s){r=t[o],e/=a;break}}r===t[0]&&(e/=Math.pow(n,t.length-1),r=t[t.length-1])}return{value:e,suffix:r}}function rp(e){let t="";for(let n=0;n<e;n++)t+="0";return t}function rf({instance:e,providedFormat:t,state:n=rr,decimalSeparator:r,defaults:i=n.currentDefaults()}){var o,a,s,l,u;let c,d,h,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({},ra,i,t),x=y.totalLength,b=x?0:y.characteristic,w=y.optionalCharacteristic,S=y.forceAverage,A=y.lowPrecision,C=!!x||!!S||y.average,M=x?-1:C&&void 0===t.mantissa?0:y.mantissa,k=!x&&(void 0===t.optionalMantissa?-1===M:y.optionalMantissa),T=y.trimMantissa,_=y.thousandSeparated,I=y.spaceSeparated,D=y.negative,O=y.forceSign,R=y.exponential,E=y.roundingFunction,P="";if(C){let e=function({value:e,forceAverage:t,lowPrecision:n=!0,abbreviations:r,spaceSeparated:i=!1,totalLength:o=0,roundingFunction:a=Math.round}){let s="",l=Math.abs(e),u=-1;if(t&&r[t]&&ro[t]?(s=r[t],e/=ro[t]):l>=ro.trillion||n&&1===a(l/ro.trillion)?(s=r.trillion,e/=ro.trillion):l<ro.trillion&&l>=ro.billion||n&&1===a(l/ro.billion)?(s=r.billion,e/=ro.billion):l<ro.billion&&l>=ro.million||n&&1===a(l/ro.million)?(s=r.million,e/=ro.million):(l<ro.million&&l>=ro.thousand||n&&1===a(l/ro.thousand))&&(s=r.thousand,e/=ro.thousand),s&&(s=(i?" ":"")+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:A,abbreviations:n.currentAbbreviations(),spaceSeparated:I,roundingFunction:E,totalLength:x});v=e.value,P+=e.abbreviation,x&&(M=e.mantissaPrecision)}if(R){let e=function({value:e,characteristicPrecision:t}){let[n,r]=e.toExponential().split("e"),i=+n;return t&&1<t&&(i*=Math.pow(10,t-1),r-=t-1,r=r>=0?`+${r}`:r),{value:i,abbreviation:`e${r}`}}({value:v,characteristicPrecision:b});v=e.value,P=e.abbreviation+P}let L=function(e,t,n,r,i,o){if(-1===r)return e;let a=function(e,t,n=Math.round){return -1!==e.toString().indexOf("e")?function(e,t){let n=e.toString(),[r,i]=n.split("e"),[o,a=""]=r.split(".");if(+i>0)n=o+a+rp(i-a.length);else{let e=".";e=0>+o?`-0${e}`:`0${e}`;let r=(rp(-i-1)+Math.abs(o)+a).substr(0,t);r.length<t&&(r+=rp(t-r.length)),n=e+r}return+i>0&&t>0&&(n+=`.${rp(t)}`),n}(e,t):new rn(n(+`${e}e+${t}`)/Math.pow(10,t)).toFixed(t)}(t,r,o),[s,l=""]=a.toString().split(".");if(l.match(/^0+$/)&&(n||i))return s;let u=l.match(/0+$/);return i&&u?`${s}.${l.toString().slice(0,u.index)}`:a.toString()}(v.toString(),v,k,M,T,E);return o=L=function(e,t,n,r){let i=e,[o,a]=i.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),i=i.slice(1)),o.length<r){let e=r-o.length;for(let t=0;t<e;t++)i=`0${i}`}return s&&(i=`-${i}`),i.toString()}(L,v,w,b),a=v,s=r,d=(c=n.currentDelimiters()).thousands,s=s||c.decimal,h=c.thousandsSize||3,f=(p=o.toString()).split(".")[0],g=p.split(".")[1],m=a<0&&0===f.indexOf("-"),_&&(m&&(f=f.slice(1)),(function(e,t){let n=[],r=0;for(let i=e;i>0;i--)r===t&&(n.unshift(i),r=0),r++;return n})(f.length,h).forEach((e,t)=>{f=f.slice(0,e+t)+d+f.slice(e+t)}),m&&(f=`-${f}`)),L=p=g?f+s+g:f,(C||R)&&(L+=P),(O||v<0)&&(l=L,L=0===(u=v)?l:0==+l?l.replace("-",""):u>0?`+${l}`:"sign"===D?l:`(${l.replace("-","")})`),L}function rg(e,t){if(!e)return t;let n=Object.keys(e);return 1===n.length&&"output"===n[0]?t:e}function rm(e,t,n){let r=new rn(e._value),i=t;return n.isNumbro(t)&&(i=t._value),i=new rn(i),e._value=r.minus(i).toNumber(),e}let rv=re(),ry=n9(),rx={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&&rM.registerLanguage(t)})}},rb=n8(),rw={format:(...e)=>(function(e,t={},n){if("string"==typeof t&&(t=n7(t)),!ri.validateFormat(t))return"ERROR: invalid format";let r=t.prefix||"",i=t.postfix||"",o=function(e,t,n){var r,i,o;switch(t.output){case"currency":let a,s,l,u,c,d,h,p,f,g;return r=t=rg(t,rr.currentCurrencyDefaultFormat()),a=rr.currentCurrency(),l=Object.assign({},ra,s=Object.assign({},r)),c="",d=!!l.totalLength||!!l.forceAverage||l.average,h=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"===h&&(u=c+p+c),g=rf({instance:e,providedFormat:s,state:rr,decimalSeparator:u}),"prefix"===h&&(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),h&&"postfix"!==h||(g=g+(c=!l.spaceSeparatedAbbreviation&&d?"":c)+p),g;case"percent":let m,v,y;return i=t=rg(t,rr.currentPercentageDefaultFormat()),m=i.prefixSymbol,v=rf({instance:n(100*e._value),providedFormat:i,state:rr}),y=Object.assign({},ra,i),m?`%${y.spaceSeparated?" ":""}${v}`:`${v}${y.spaceSeparated?" ":""}%`;case"byte":return function(e,t,n,r){let i=t.base||"binary",o=Object.assign({},ra,t),{binarySuffixes:a,decimalSuffixes:s}=n.currentBytes(),l={general:{scale:1024,suffixes:s||rl,marker:"bd"},binary:{scale:1024,suffixes:a||rs,marker:"b"},decimal:{scale:1e3,suffixes:s||rl,marker:"d"}}[i],{value:u,suffix:c}=rh(e._value,l.suffixes,l.scale),d=rf({instance:r(u),providedFormat:t,state:n,defaults:n.currentByteDefaultFormat()});return`${d}${o.spaceSeparated?" ":""}${c}`}(e,t=rg(t,rr.currentByteDefaultFormat()),rr,n);case"time":let x,b,w;return t=rg(t,rr.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,A,C,M;return o=t=rg(t,rr.currentOrdinalDefaultFormat()),S=rr.currentOrdinal(),A=Object.assign({},ra,o),C=rf({instance:e,providedFormat:o,state:rr}),M=S(e._value),`${C}${A.spaceSeparated?" ":""}${M}`;default:return rf({instance:e,providedFormat:t,numbro:n})}}(e,t,n);return(o=r+o)+i})(...e,rM),getByteUnit:(...e)=>(function(e){return rh(e._value,ru.suffixes,ru.scale).suffix})(...e),getBinaryByteUnit:(...e)=>(function(e){return rh(e._value,rc.suffixes,rc.scale).suffix})(...e),getDecimalByteUnit:(...e)=>(function(e){return rh(e._value,rd.suffixes,rd.scale).suffix})(...e),formatOrDefault:rg},rS={add:(e,t)=>{let n,r;return n=new rn(e._value),r=t,rM.isNumbro(t)&&(r=t._value),r=new rn(r),e._value=n.plus(r).toNumber(),e},subtract:(e,t)=>rm(e,t,rM),multiply:(e,t)=>{let n,r;return n=new rn(e._value),r=t,rM.isNumbro(t)&&(r=t._value),r=new rn(r),e._value=n.times(r).toNumber(),e},divide:(e,t)=>{let n,r;return n=new rn(e._value),r=t,rM.isNumbro(t)&&(r=t._value),r=new rn(r),e._value=n.dividedBy(r).toNumber(),e},set:(e,t)=>{let n;return n=t,rM.isNumbro(t)&&(n=t._value),e._value=n,e},difference:(e,t)=>{let n;return rm(n=rM(e._value),t,rM),Math.abs(n._value)},BigNumber:rn};class rA{constructor(e){this._value=e}clone(){return rM(this._value)}format(e={}){return rw.format(this,e)}formatCurrency(e){return"string"==typeof e&&(e=n7(e)),(e=rw.formatOrDefault(e,rv.currentCurrencyDefaultFormat())).output="currency",rw.format(this,e)}formatTime(e={}){return e.output="time",rw.format(this,e)}binaryByteUnits(){return rw.getBinaryByteUnit(this)}decimalByteUnits(){return rw.getDecimalByteUnit(this)}byteUnits(){return rw.getByteUnit(this)}difference(e){return rS.difference(this,e)}add(e){return rS.add(this,e)}subtract(e){return rS.subtract(this,e)}multiply(e){return rS.multiply(this,e)}divide(e){return rS.divide(this,e)}set(e){return rS.set(this,rC(e))}value(){return this._value}valueOf(){return this._value}}function rC(e){let t=e;return rM.isNumbro(e)?t=e._value:"string"==typeof e?t=rM.unformat(e):isNaN(e)&&(t=NaN),t}function rM(e){return new rA(rC(e))}rM.version="2.5.0",rM.isNumbro=function(e){return e instanceof rA},rM.language=rv.currentLanguage,rM.registerLanguage=rv.registerLanguage,rM.setLanguage=rv.setLanguage,rM.languages=rv.languages,rM.languageData=rv.languageData,rM.zeroFormat=rv.setZeroFormat,rM.defaultFormat=rv.currentDefaults,rM.setDefaults=rv.setDefaults,rM.defaultCurrencyFormat=rv.currentCurrencyDefaultFormat,rM.validate=ry.validate,rM.loadLanguagesInNode=rx.loadLanguagesInNode,rM.unformat=rb.unformat,rM.BigNumber=rS.BigNumber;var rk=rM&&rM.__esModule&&Object.prototype.hasOwnProperty.call(rM,"default")?rM.default:rM;let rT={label:"Bits",decimalPlaces:!0,shortValues:!0},r_={bits:{group:"Bits",label:"Bits (IEC)"},decbits:{group:"Bits",label:"Bits (SI)"}};function rI(e,{unit:t="bits",shortValues:n,decimalPlaces:r}){let i="decbits"===t;if(!nZ(n)||Math.abs(e)<(i?1e3:1024)){let i={style:"decimal",useGrouping:!0};nK(r)?(i.minimumFractionDigits=nQ(r),i.maximumFractionDigits=nQ(r)):nZ(n)&&(i.maximumSignificantDigits=3);let o=[i.style,i.useGrouping,i.maximumSignificantDigits,r,n,t];return`${nY(o,"bits",i,"en-US")(e)} bits`}return rk(e).format({output:"byte",base:i?"decimal":"binary",spaceSeparated:!0,mantissa:nK(r)?r:2,trimMantissa:!nK(r),optionalMantissa:!nK(r)}).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 rD={label:"Bytes",decimalPlaces:!0,shortValues:!0},rO={bytes:{group:"Bytes",label:"Bytes (IEC)"},decbytes:{group:"Bytes",label:"Bytes (SI)"}};function rR(e,{unit:t="bytes",shortValues:n,decimalPlaces:r}){let i="decbytes"===t;if(!nZ(n)||Math.abs(e)<(i?1e3:1024)){let i={style:"unit",unit:"byte",unitDisplay:"long",useGrouping:!0};return nK(r)?(i.minimumFractionDigits=nQ(r),i.maximumFractionDigits=nQ(r)):nZ(n)&&(i.maximumSignificantDigits=3),nY([i.style,i.unit,i.unitDisplay,i.useGrouping,i.maximumSignificantDigits,r,n,t],"bytes",i,"en-US")(e)}return rk(e).format({output:"byte",base:i?"decimal":"binary",spaceSeparated:!0,mantissa:nK(r)?r:2,trimMantissa:!nK(r),optionalMantissa:!nK(r)})}var rE=n(40224);let rP="Currency",rL={label:"Currency",decimalPlaces:!0},rN={aud:{group:rP,label:"Australian Dollar (A$)"},cad:{group:rP,label:"Canadian Dollar (CA$)"},chf:{group:rP,label:"Swiss Franc (CHF)"},cny:{group:rP,label:"Renminbi (CN\xa5)"},eur:{group:rP,label:"Euro (€)"},gbp:{group:rP,label:"Pound (\xa3)"},hkd:{group:rP,label:"Hong Kong Dollar (HK$)"},inr:{group:rP,label:"Indian Rupee (₹)"},jpy:{group:rP,label:"Yen (\xa5)"},krw:{group:rP,label:"South Korean Won (₩)"},nok:{group:rP,label:"Norwegian Krone (NOK)"},nzd:{group:rP,label:"New Zealand Dollar (NZ$)"},sek:{group:rP,label:"Swedish Krona (SEK)"},sgd:{group:rP,label:"Singapore Dollar (S$)"},usd:{group:rP,label:"US Dollar ($)"}};function rB(e,{unit:t,decimalPlaces:n}){let r={style:"currency",currency:(0,rE.toUpper)(t),currencyDisplay:"symbol"};return nK(n)?(r.minimumFractionDigits=nQ(n),r.maximumFractionDigits=nQ(n)):r.maximumSignificantDigits=3,nY([r.style,r.currency,r.currencyDisplay,r.maximumSignificantDigits,n,t],"currency",r,"en-US")(e)}let rz={label:"percent",decimalPlaces:!0},rF="Percent",rj={percent:{group:rF,label:"Percent (0-100)"},"percent-decimal":{group:rF,label:"Percent (0.0-1.0)"},"%":{disableSelectorOption:!0,group:rF,label:"%"}};function rV(e,{unit:t,decimalPlaces:n}){let r={style:"percent",useGrouping:!0};return nK(n)?(r.minimumFractionDigits=nQ(n),r.maximumFractionDigits=nQ(n)):r.maximumSignificantDigits=3,"percent"===t&&(e/=100),nY([r.style,r.useGrouping,r.maximumSignificantDigits,n,t],"percent",r,"en-US")(e)}let rH="Temperature",r$={label:rH,decimalPlaces:!0},rW={celsius:{group:rH,label:"Celsius (\xb0C)"},fahrenheit:{group:rH,label:"Fahrenheit (\xb0F)"}},rG=(e,{unit:t,decimalPlaces:n})=>{let r={unit:t,style:"unit"};nK(n)?(r.minimumFractionDigits=nQ(n),r.maximumFractionDigits=nQ(n)):r.maximumSignificantDigits=3;let i="celsius"===t?"en-GB":"en-US";return nY([r.style,r.unit,r.maximumSignificantDigits,n,i],"temperature",r,i)(e)},rU={label:"Decimal",decimalPlaces:!0,shortValues:!0},rq={decimal:{group:"Decimal",label:"Decimal"}};function rY(e,{shortValues:t,decimalPlaces:n}){let r={style:"decimal",useGrouping:!0};return nZ(t)&&(r.notation="compact"),nK(n)?(r.minimumFractionDigits=nQ(n),r.maximumFractionDigits=nQ(n)):nZ(t)&&(r.maximumSignificantDigits=3),nY([r.style,r.useGrouping,r.notation,r.maximumSignificantDigits,n],"decimal",r,"en-US")(e)}let rX={label:"Throughput",decimalPlaces:!0},rZ="Throughput",rK={"bits/sec":{group:rZ,label:"Bits/sec (IEC)"},"decbits/sec":{group:rZ,label:"Bits/sec (SI)"},"bytes/sec":{group:rZ,label:"Bytes/sec (IEC)"},"decbytes/sec":{group:rZ,label:"Bytes/sec (SI)"},"counts/sec":{group:rZ,label:"Counts/sec"},"events/sec":{group:rZ,label:"Events/sec"},"messages/sec":{group:rZ,label:"Messages/sec"},"ops/sec":{group:rZ,label:"Ops/sec"},"packets/sec":{group:rZ,label:"Packets/sec"},"reads/sec":{group:rZ,label:"Reads/sec"},"requests/sec":{group:rZ,label:"Requests/sec"},"records/sec":{group:rZ,label:"Records/sec"},"rows/sec":{group:rZ,label:"Rows/sec"},"writes/sec":{group:rZ,label:"Writes/sec"}};function rQ(e,{unit:t,shortValues:n,decimalPlaces:r}){if("bits/sec"===t){let t=1024>Math.abs(e)?"sec":"s";return rI(e,{unit:"bits",shortValues:n,decimalPlaces:r})+"/"+t}if("decbits/sec"===t){let t=1e3>Math.abs(e)?"sec":"s";return rI(e,{unit:"decbits",shortValues:n,decimalPlaces:r})+"/"+t}if("decbytes/sec"===t){let t=1e3>Math.abs(e)?"sec":"s";return rR(e,{unit:"decbytes",shortValues:n,decimalPlaces:r})+"/"+t}if("bytes/sec"===t){let t=1024>Math.abs(e)?"sec":"s";return rR(e,{unit:"bytes",shortValues:n,decimalPlaces:r})+"/"+t}let i={style:"decimal",useGrouping:!0};nZ(n)&&(i.notation="compact"),nK(r)?(i.minimumFractionDigits=nQ(r),i.maximumFractionDigits=nQ(r)):nZ(n)&&(i.maximumSignificantDigits=3);let o=[i.style,i.useGrouping,i.notation,i.maximumSignificantDigits,r,n,t];return`${nY(o,"throughput",i,"en-US")(e)} ${t}`}let rJ="Date",r0={Time:n0,Percent:rz,Decimal:rU,Bytes:rD,Bits:rT,Throughput:rX,Currency:rL,Temperature:r$,Date:{label:"Date & Time"}},r1={...n1,...rj,...rq,...rO,...r_,...rK,...rN,...rW,"datetime-iso":{group:rJ,label:"DateTime (GMT)"},"datetime-us":{group:rJ,label:"DateTime (US-East)"},"datetime-local":{group:rJ,label:"DateTime (Browser Local)"},"date-iso":{group:rJ,label:"Date (GMT)"},"date-us":{group:rJ,label:"Date (US-East)"},"date-local":{group:rJ,label:"Date (Browser Local)"},"time-local":{group:rJ,label:"Time (Browser Local)"},"time-iso":{group:rJ,label:"Time (GMT)"},"time-us":{group:rJ,label:"Time (US-East)"},"relative-time":{group:rJ,label:"Relative Time"},"unix-timestamp":{group:rJ,label:"Unix Timestamp (s)"},"unix-timestamp-ms":{group:rJ,label:"Unix Timestamp (ms)"}};function r2(e,t){if(!t)return e.toString();if(r7(t))return rR(e,t);if(ie(t))return rI(e,t);if(r9(t))return rY(e,t);if(r8(t))return rV(e,t);if(r6(t))return n3(e,t);if(ii(t))return rQ(e,t);if(io(t))return rB(e,t);if(ia(t))return function(e,t={}){let n=Intl.DateTimeFormat().resolvedOptions().timeZone,{unit:r="datetime-local",locale:i=(()=>{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"===r)return(e>1e12?Math.floor(e/1e3):e).toString();if("unix-timestamp-ms"===r)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"===r){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 r=Math.round(t/n);if(Math.abs(r)>=1)return new Intl.RelativeTimeFormat(i,{numeric:"auto"}).format(r,e)}return new Intl.RelativeTimeFormat(i,{numeric:"auto"}).format(0,"second")}let l={timeZone:o};switch(r){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: ${r}`)}return new Intl.DateTimeFormat(i,l).format(s)}(e,t);if(is(t))return rG(e,t);throw Error(`Unknown unit options ${t}`)}function r5(e){return r1[e.unit??"decimal"]}function r4(e){return r5(e).group??"Decimal"}function r3(e){return r0[r5(e).group??"Decimal"]}function r6(e){return"Time"===r4(e)}function r8(e){return"Percent"===r4(e)}function r9(e){return"Decimal"===r4(e)}function r7(e){return"Bytes"===r4(e)}function ie(e){return"Bits"===r4(e)}function it(e){return!!r3(e).decimalPlaces}function ir(e){return!!r3(e).shortValues}function ii(e){return"Throughput"===r4(e)}function io(e){return"Currency"===r4(e)}function ia(e){return"Date"===r4(e)}function is(e){return"Temperature"===r4(e)}let il={JoinByColumnValue:"Join by column value",MergeColumns:"Merge columns",MergeIndexedColumns:"Merge indexed columns",MergeSeries:"Merge series",ExtractColumnFields:"Extract column fields"};function iu(e,t){return[nb({type:"value",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>r2(e,t)}},e)]}function ic(e,t,n,r){let i=[],o=nb({type:"value",position:"left",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>r2(e,t),overflow:"truncate"}},e);i.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=>r2(e,t)},splitLine:{show:!1},show:e?.show};i.push(l),r&&(a+=(o=r2(r[n]??1e3,t),((s=document.createElement("canvas").getContext("2d"))?(s.font="12px sans-serif",s.measureText(o).width):6*o.length)+10))}),i}function id(e,t){let{value:n,setValueAndStore:r}=function(e,t,n){let[r,i]=(0,I.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,I.useCallback)(n=>{i(n),e.setItem(t,JSON.stringify(n))},[i,e,t]);return{value:r,setValue:i,setValueAndStore:o}}(window.localStorage,e,t);return[n,r]}function ih(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 ip(e){e.dispatchAction({type:"restore"})}function ig(e){void 0!==e.dispatchAction&&(e.dispatchAction({type:"unselect"}),e.dispatchAction({type:"downplay"}))}function im(e,t,n){if(void 0===n)return null;let r=[e,t];return n.containPixel("grid",r)?n.convertFromPixel("grid",r):null}function iv(e,t,n,r,i,o){let a=o.length>0?o[o.length-1]:i[i.length-1];void 0!==a&&e.dispatchAction({type:"select",seriesIndex:a.seriesIndex,dataIndex:a.dataIndex,escapeConnect:!0}),e.dispatchAction({type:"downplay"}),r.length>0&&e.dispatchAction({type:"downplay",seriesIndex:r}),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 iy(e){return e[e.length-1]?.name===nw}function ix(e,t){if(void 0===e||void 0===t)return null;let n=null,r=1/0;for(let[i]of e){let e=Math.abs(i-t);e<r&&(n=i,r=e)}return n}function ib(e,t){if(void 0===t)return null;let n=e.length,r=null;for(let i=0;i<n;i++){let o=n>0?e[i]:null;if(!o)break;r=ix(o.values,t)}return r}function iw(...e){return e.flatMap(e=>void 0===e?[]:Array.isArray(e)?e:[e])}function iS(e){void 0===globalThis.useIdValue&&(globalThis.useIdValue=0);let t=(0,I.useRef)(void 0);return void 0===t.current&&(t.current=`${e}-${globalThis.useIdValue++}`),t.current}var iA=((se={}).CSV="csv",se.DISTRIBUTED="distributed",se.DOUBLEQUOTE="doublequote",se.GLOB="glob",se.JSON="json",se.LUCENE="lucene",se.PERCENTENCODE="percentencode",se.PIPE="pipe",se.PROMETHEUS="prometheus",se.RAW="raw",se.REGEX="regex",se.SINGLEQUOTE="singlequote",se.SQLSTRING="sqlstring",se.TEXT="text",se.QUERYPARAM="queryparam",se.REGEX_LITERAL="regexliteral",se);function iC(e){if(!e)return;let t=e.toLowerCase();return Object.values(iA).find(e=>e===t)||void 0}function iM(e,t,n){switch(n){case"csv":case"raw":return e.join(",");case"distributed":{let[n,...r]=e;return`${[n,...r.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 ik(e,t,n,r){let i="$"+t,o="${"+t+(r?":"+r:"")+"}",a="";return Array.isArray(n)&&(a=iM(n,t,r||"prometheus")),"string"==typeof n&&(a=iM([n],t,r||"raw")),(e=e.replaceAll(i,a)).replaceAll(o,a)}let iT=/\$(\w+)|\${(\w+)(?:\.([^:^}]+))?(?::([^}]+))?}/gm;function i_(e){let t,n=new Set;for(;null!==(t=iT.exec(e));)t&&(t[1]?n.add(t[1]):t[2]&&n.add(t[2]));return Array.from(n.values())}function iI(e){let t,n=new Map;for(;null!==(t=iT.exec(e));)if(t){let e;t[4]&&(e=t[4]),t[1]?n.set(t[1],iC(e)):t[2]&&n.set(t[2],iC(e))}return n}function iD(e,t){let n=iI(e),r=Array.from(n.keys()),i=e;return r.toSorted((e,t)=>t.length-e.length).forEach(e=>{let r=t[e];r&&void 0!==r.value&&(i=ik(i,e,r?.value,n.get(e)))}),i}function iO(e,t){let n={};for(let[e,r]of Object.entries(t))n[e]=void 0===r.displayValue?r:{...r,value:r.displayValue};return iD(e,n)}let iR=/\$\{__data\.fields(?:\[(?:"|')([^"']+)(?:"|')\]|\.([a-zA-Z_][a-zA-Z0-9_]*))(?::([a-z]+))?\}/g,iE=/\$\{__data\[(\d+)\]\.fields\[(?:"|')([^"']+)(?:"|')\]\}/g,iP=/\$\{__data\.index\}/g,iL=/\$\{__data\.count\}/g,iN=/("|')?\$\{__data(?::([a-z]+))?\}("|')?/g;function iB(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("."),r=e;for(let e of n){if(null==r||"object"!=typeof r)return"";r=r[e]}return null==r?"":"object"==typeof r?JSON.stringify(r):String(r)}return""}function iz(e){if(!e)return;let t=e.toLowerCase();return Object.values(iA).find(e=>e===t)}function iF(e,t,n={}){let{urlEncode:r=!0,index:i,count:o}=n,a=e,s=[];return void 0!==i&&(a=a.replaceAll(iP,String(i))),void 0!==o&&(a=a.replaceAll(iL,String(o))),a=a.replaceAll(iN,(e,n,r,i)=>{let o=iz(r)??iA.RAW;return o===iA.JSON?JSON.stringify(t):iM(Object.values(t).map(e=>JSON.stringify(e)),"",o)}),iR.lastIndex=0,{text:a=a.replaceAll(iR,(e,n,i,o)=>{let a=n??i??"",l=iB(t,a);""===l&&void 0===t[a]&&s.push(`Field "${a}" not found in data`);let u=iz(o);if(u)return iM([l],a,u);if(r){if(u===iA.RAW)return l;if(u!==iA.QUERYPARAM&&u!==iA.PERCENTENCODE)return encodeURIComponent(l)}return l}),errors:s.length>0?s:void 0}}function ij(e,t,n={}){let{urlEncode:r=!0}=n,i=e,o=[];return i=i.replaceAll(iL,String(t.length)),iE.lastIndex=0,iR.lastIndex=0,{text:i=(i=(i=i.replaceAll(iN,(e,n,r,i)=>{let o=iz(r)??iA.RAW,a=iM(Object.values(t).map(e=>JSON.stringify(e)),"",o);return n&&i?a:`${n??""}${a}${i??""}`})).replaceAll(iE,(e,n,i)=>{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=iB(t[a],i);return""===s&&void 0===t[a][i]&&o.push(`Field "${i}" not found in data at index ${a}`),r?encodeURIComponent(s):s})).replaceAll(iR,(e,n,r,i)=>{let o=n??r??"";return iM(t.map(e=>iB(e,o)),o,iz(i)||iA.CSV)}),errors:o.length>0?o:void 0}}function iV(e){return iE.lastIndex=0,iE.test(e)||/\$\{__data\.fields(?:\[["'][^"']+["']\]|\.[a-zA-Z_][a-zA-Z0-9_]*):[a-z]+\}/.test(e)}function iH(e){return iE.lastIndex=0,iE.test(e)}function i$(e){return iR.lastIndex=0,iE.lastIndex=0,iR.test(e)||iE.test(e)}function iW(e){let t,n=new Set;for(iR.lastIndex=0,iE.lastIndex=0;null!==(t=iR.exec(e));)n.add(t[1]??t[2]);for(;null!==(t=iE.exec(e));)n.add(t[2]);return Array.from(n)}Symbol.for("constructDateFrom");let iG={},iU={};function iq(e,t){try{let n=(iG[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];if(n in iU)return iU[n];return iX(n,n.split(":"))}catch{if(e in iU)return iU[e];let t=e?.match(iY);if(t)return iX(e,t.slice(1));return NaN}}let iY=/([+-]\d\d):?(\d\d)?/;function iX(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return iU[e]=60*n+r>0?60*n+r+i:60*n-r-i}class iZ extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(iq(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)),iJ(this,e)):this.setTime(Date.now())}static tz(e,...t){return t.length?new iZ(...t,e):new iZ(Date.now(),e)}withTimeZone(e){return new iZ(+this,e)}getTimezoneOffset(){let e=-iq(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),iQ(this),+this}[Symbol.for("constructDateFrom")](e){return new iZ(+new Date(e),this.timeZone)}}let iK=/^(get|set)(?!UTC)/;function iQ(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-(60*iq(e.timeZone,e))))}function iJ(e,t){var n;let r=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,i=iq(e.timeZone,e),o=i>0?Math.floor(i):Math.ceil(i),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 r=iq(e.timeZone,t);(r>0?Math.floor(r):Math.ceil(r))===o&&(u=l)}let c=u-o;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);let d=new Date(+e);d.setUTCSeconds(0);let h=s>0?d.getSeconds():(d.getSeconds()-60)%60,p=Math.round(-(60*iq(e.timeZone,e)))%60;(p||h)&&Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+h);let f=iq(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&&i0(e)-r==60*v*1e3&&i0(e,r-60*g*1e3)!==r;if(g!==o&&m&&!y){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+m);let t=iq(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)}iQ(e);let x=(t?r:r+1e3*p)-e.internal;x&&18e5>Math.abs(x)&&(Date.prototype.setTime.call(e,+e+x),iQ(e))}function i0(e,t){let n=new Date(t??+e);return n.setUTCSeconds(n.getUTCSeconds()-Math.round(-(60*iq(e.timeZone,n)))),+n}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!iK.test(e))return;let t=e.replace(iK,"$1UTC");iZ.prototype[t]&&(e.startsWith("get")?iZ.prototype[e]=function(){return this.internal[t]()}:(iZ.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()),iJ(e),+this},iZ.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),iQ(this),+this}))});class i1 extends iZ{static tz(e,...t){return t.length?new i1(...t,e):new i1(Date.now(),e)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(" ")[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${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 i1(+this,e)}[Symbol.for("constructDateFrom")](e){return new i1(+new Date(e),this.timeZone)}}var i2=n(4721);function i5(e){let t=(0,i2.a)(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-n}var i4=n(12015);function i3(e,...t){let n=i4.w.bind(null,e||t.find(e=>"object"==typeof e));return t.map(n)}var i6=n(30439);function i8(e,t){let n=(0,i2.a)(e,t?.in);return n.setHours(0,0,0,0),n}function i9(e,t){let n=(0,i2.a)(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function i7(e,t){let n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??nO.weekStartsOn??nO.locale?.options?.weekStartsOn??0,r=(0,i2.a)(e,t?.in),i=r.getDay();return r.setDate(r.getDate()-(7*(i<n)+i-n)),r.setHours(0,0,0,0),r}function oe(e,t){return i7(e,{...t,weekStartsOn:1})}function ot(e,t){let n=(0,i2.a)(e,t?.in),r=n.getFullYear(),i=(0,i4.w)(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let o=oe(i),a=(0,i4.w)(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);let s=oe(a);return n.getTime()>=o.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function on(e,t){let n,r,i=(0,i2.a)(e,t?.in);return Math.round((oe(i)-(n=ot(i,void 0),(r=(0,i4.w)(i,0)).setFullYear(n,0,4),r.setHours(0,0,0,0),oe(r)))/i6.my)+1}function or(e,t){let n=(0,i2.a)(e,t?.in),r=n.getFullYear(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??nO.firstWeekContainsDate??nO.locale?.options?.firstWeekContainsDate??1,o=(0,i4.w)(t?.in||e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);let a=i7(o,t),s=(0,i4.w)(t?.in||e,0);s.setFullYear(r,0,i),s.setHours(0,0,0,0);let l=i7(s,t);return+n>=+a?r+1:+n>=+l?r:r-1}function oi(e,t){let n,r,i,o=(0,i2.a)(e,t?.in);return Math.round((i7(o,t)-(n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??nO.firstWeekContainsDate??nO.locale?.options?.firstWeekContainsDate??1,r=or(o,t),(i=(0,i4.w)(t?.in||o,0)).setFullYear(r,0,n),i.setHours(0,0,0,0),i7(i,t)))/i6.my)+1}function oo(e,t){let n=Math.abs(e).toString().padStart(t,"0");return(e<0?"-":"")+n}let oa={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return oo("yy"===t?r%100:r,t.length)},M(e,t){let n=e.getMonth();return"M"===t?String(n+1):oo(n+1,2)},d:(e,t)=>oo(e.getDate(),t.length),a(e,t){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>oo(e.getHours()%12||12,t.length),H:(e,t)=>oo(e.getHours(),t.length),m:(e,t)=>oo(e.getMinutes(),t.length),s:(e,t)=>oo(e.getSeconds(),t.length),S(e,t){let n=t.length;return oo(Math.trunc(e.getMilliseconds()*Math.pow(10,n-3)),t.length)}},os={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){let t=e.getFullYear();return n.ordinalNumber(t>0?t:1-t,{unit:"year"})}return oa.y(e,t)},Y:function(e,t,n,r){let i=or(e,r),o=i>0?i:1-i;return"YY"===t?oo(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):oo(o,t.length)},R:function(e,t){return oo(ot(e),t.length)},u:function(e,t){return oo(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return oo(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return oo(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){let r=e.getMonth();switch(t){case"M":case"MM":return oa.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){let r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return oo(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){let i=oi(e,r);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):oo(i,t.length)},I:function(e,t,n){let r=on(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):oo(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):oa.d(e,t)},D:function(e,t,n){let r,i=function(e,t){let[n,r]=i3(void 0,e,t),i=i8(n),o=i8(r);return Math.round((i-i5(i)-(o-i5(o)))/i6.w4)}(r=(0,i2.a)(e,void 0),i9(r))+1;return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):oo(i,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){let i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return oo(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){let i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return oo(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){let r=e.getDay(),i=0===r?7:r;switch(t){case"i":return String(i);case"ii":return oo(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){let r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){let r,i=e.getHours();switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){let r,i=e.getHours();switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return oa.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):oa.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):oo(r,t.length)},k:function(e,t,n){let r=e.getHours();return(0===r&&(r=24),"ko"===t)?n.ordinalNumber(r,{unit:"hour"}):oo(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):oa.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):oa.s(e,t)},S:function(e,t){return oa.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return ou(r);case"XXXX":case"XX":return oc(r);default:return oc(r,":")}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case"x":return ou(r);case"xxxx":case"xx":return oc(r);default:return oc(r,":")}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ol(r,":");default:return"GMT"+oc(r,":")}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ol(r,":");default:return"GMT"+oc(r,":")}},t:function(e,t,n){return oo(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return oo(+e,t.length)}};function ol(e,t=""){let n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return 0===o?n+String(i):n+String(i)+t+oo(o,2)}function ou(e,t){return e%60==0?(e>0?"-":"+")+oo(Math.abs(e)/60,2):oc(e,t)}function oc(e,t=""){let n=Math.abs(e);return(e>0?"-":"+")+oo(Math.trunc(n/60),2)+t+oo(n%60,2)}let od=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},oh=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},op={p:oh,P:(e,t)=>{let n,r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return od(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",od(i,t)).replace("{{time}}",oh(o,t))}},of=/^D+$/,og=/^Y+$/,om=["D","DD","YY","YYYY"];function ov(e,t,n){var r,i,o;let a,s=(r=e,i=t,o=n,a="Y"===r[0]?"years":"days of the month",`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${i}\`) for formatting ${a} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(s),om.includes(e))throw RangeError(s)}function oy(e){return!(!(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))&&"number"!=typeof e||isNaN(+(0,i2.a)(e)))}let ox=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ob=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ow=/^'([^]*?)'?$/,oS=/''/g,oA=/[a-zA-Z]/;function oC(e,t,n){let r=n?.locale??nO.locale??nD,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??nO.firstWeekContainsDate??nO.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??nO.weekStartsOn??nO.locale?.options?.weekStartsOn??0,a=(0,i2.a)(e,n?.in);if(!oy(a))throw RangeError("Invalid time value");let s=t.match(ob).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,op[t])(e,r.formatLong):e}).join("").match(ox).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let t=e[0];if("'"===t){var n;let t;return{isToken:!1,value:(t=(n=e).match(ow))?t[1].replace(oS,"'"):n}}if(os[t])return{isToken:!0,value:e};if(t.match(oA))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});r.localize.preprocessor&&(s=r.localize.preprocessor(a,s));let l={firstWeekContainsDate:i,weekStartsOn:o,locale:r};return s.map(i=>{if(!i.isToken)return i.value;let o=i.value;return(!n?.useAdditionalWeekYearTokens&&og.test(o)||!n?.useAdditionalDayOfYearTokens&&of.test(o))&&ov(o,t,String(e)),(0,os[o[0]])(a,o,r.localize,l)}).join("")}function oM(e,t){if(t){let n=t.toLowerCase();if("local"!==n&&"browser"!==n)return{...e,timeZone:"utc"===n?"UTC":t}}return e}function ok(e,t,n){let r,i=n?.toLowerCase();if(!n||"local"===i||"browser"===i)return oC(e,t);return oC(e,t,{in:(r="utc"===i?"UTC":n,e=>i1.tz(r,+new Date(e)))})}function oT(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 o_(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 oI=(e,t)=>{if(!e)return{formattedDate:"",formattedTime:""};let n=new Date(e);return{formattedDate:t?t(n,"MMM dd, yyyy"):oC(n,"MMM dd, yyyy"),formattedTime:t?t(n,"HH:mm:ss"):oC(n,"HH:mm:ss")}};var oD=n(18264);function oO(e,t){let n=(0,I.useRef)(),r=!0;for(let e=0;e<t.length;e++)if(n.current?.deps[e]!==t[e]){r=!1;break}return(void 0===n.current||!1===r)&&(n.current={value:e(),deps:t}),n.current.value}function oR(e,t){let n=(0,I.useRef)();return(void 0===n.current||!1===oD(t,n.current.deps))&&(n.current={value:e(),deps:t}),n.current.value}function oE(e){return!!e?.startsWith("/")}function oP(e){if(!e)throw Error("Input string cannot be empty");if(!oE(e))return RegExp(`^${e}$`);let t=e.match(/^\/(.+)\/([gimy]*)$/);if(!t)throw Error(`Invalid regular expression format: ${e}`);let[,n="",r=""]=t;try{return new RegExp(n,r)}catch(e){throw Error(`Failed to create RegExp ${e}`,{cause:e})}}function oL(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=iD(i,t);return n}function oN(e,t){let n={};for(let[r,i]of Object.entries(e))Array.isArray(i)?n[r]=i.map(e=>iD(e,t)):n[r]=function e(t,n){if(Array.isArray(t))return t.map(t=>e(t,n));for(let[e,r]of iI(t)){let i,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)i=o.value;else if(u)try{let e=oP(o.customAllValue),t=a.filter(t=>e.test(t.value)).map(e=>e.value);i=t.length>0?t:s}catch{i=s}if(i&&(!r||r===iA.QUERYPARAM)){let o="$"+e,a=r?"${"+e+":"+r+"}":"${"+e+"}";return i.map(e=>{let r=t;return iD(r=(r=r.replaceAll(a,e)).replaceAll(o,e),n)})}}return iD(t,n)}(i,t);return n}function oB(e,t,n,r,i){let o=iF(e,t,{index:n,count:r}),a=o.text,s=[];return o.errors&&s.push(...o.errors.map(e=>e.replace("in data","in selection data"))),i&&(a=iD(a,i)),{text:a,errors:s.length>0?s:void 0}}function oz(e,t,n){let r=ij(e,t),i=r.text,o=[];return r.errors&&o.push(...r.errors.map(e=>e.replace("in data","in selection data"))),n&&(i=iD(i,n)),{text:i,errors:o.length>0?o:void 0}}function oF(e,t){let n=e.palette.text?.primary??"#222";return nb({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 oj(e,t=[]){if(!t.length)return{value:e};let n={value:e};return t.forEach(t=>{switch(t.kind){case"Value":{let r=t.spec;String(r.value)===String(e)&&(n.value=r.result.value||n.value,n.color=r.result.color);break}case"Range":{let r=t.spec;if(void 0===r.from&&void 0===r.to)break;let i=void 0!==r.from?r.from:-1/0,o=void 0!==r.to?r.to:1/0;e>=i&&e<=o&&(n.value=r.result.value||n.value,n.color=r.result.color);break}case"Regex":{let r=t.spec,i=e.toString();if(!r.pattern)break;let o=oP(r.pattern);i.match(o)&&null!==r.result.value&&(n.value=i.replace(o,r.result.value.toString()||"")||n.value,n.color=r.result.color);break}case"Misc":{let r=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}})(r.value,e)&&(n.value=r.result.value||n.value,n.color=r.result.color)}}}),n}function oV(e,t){if(0===t.length)return e;let n={};for(let r of e){let e=Object.keys(r).filter(e=>t.includes(e)).map(e=>r[e]).join("|"),i=n[e];i?n[e]={...i,...r}:n[e]={...r}}return Object.values(n)}function oH(e,t,n){let r=[];for(let i of e){let e=Object.keys(i).filter(e=>t.includes(e)),o={};for(let t of e)o[t]=i[t],delete i[t];for(let t of e)r.push({...i,[n]:o[t]});0===e.length&&r.push(i)}return r}function o$(e,t){let n=[];for(let r of e){let e=Object.keys(r).filter(e=>RegExp("^(("+t+" #\\d+)|("+t+"))$").test(e)),i={};for(let t of e)i[t]=r[t],delete r[t];for(let o of e)n.push({...r,[t]:i[o]});0===e.length&&n.push(r)}return n}function oW(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=o$(t,e);return oV(t,n)}function oG(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=oV(n,e.spec.columns));break;case"MergeIndexedColumns":e.spec.column&&(n=o$(n,e.spec.column));break;case"MergeColumns":e.spec.columns&&e.spec.columns.length>0&&e.spec.name&&(n=oH(n,e.spec.columns,e.spec.name));break;case"MergeSeries":n=oW(n)}return n.map(e=>Object.keys(e).toSorted().reduce((t,n)=>(t[n]=e[n],t),{}))}var oU=n(68102);function oq(e){return"number"==typeof e}function oY(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 oX(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function oZ(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function oK(e){return e&&!0===e.constructor.prototype.isUnit||!1}function oQ(e){return"string"==typeof e}var oJ=Array.isArray;function o0(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function o1(e){return Array.isArray(e)||o0(e)}function o2(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function o5(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function o4(e){return e&&!0===e.constructor.prototype.isRange||!1}function o3(e){return e&&!0===e.constructor.prototype.isIndex||!1}function o6(e){return"boolean"==typeof e}function o8(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function o9(e){return e&&!0===e.constructor.prototype.isHelp||!1}function o7(e){return"function"==typeof e}function ae(e){return e instanceof Date}function at(e){return e instanceof RegExp}function an(e){return!!(e&&"object"==typeof e&&e.constructor===Object&&!oX(e)&&!oZ(e))}function ar(e){return null===e}function ai(e){return void 0===e}function ao(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function aa(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function as(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function al(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function au(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function ac(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function ad(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function ah(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function ap(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function af(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function ag(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function am(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function av(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function ay(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function ax(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function ab(e){return e&&!0===e.constructor.prototype.isChain||!1}function aw(e){var t=typeof e;return"object"===t?null===e?"null":Array.isArray(e)?"Array":e instanceof Date?"Date":e instanceof RegExp?"RegExp":oY(e)?"BigNumber":oX(e)?"Complex":oZ(e)?"Fraction":o0(e)?"Matrix":oK(e)?"Unit":o3(e)?"Index":o4(e)?"Range":o8(e)?"ResultSet":af(e)?e.type:ab(e)?"Chain":o9(e)?"Help":"Object":"function"===t?"Function":t}function aS(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 aS(e)});if(e instanceof Date)return new Date(e.valueOf());if(oY(e))return e;if(e instanceof RegExp)throw TypeError("Cannot clone "+e);return aA(e,aS)}function aA(e,t){var n={};for(var r in e)ak(e,r)&&(n[r]=t(e[r]));return n}function aC(e,t){var n,r,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(r=0,i=e.length;r<i;r++)if(!aC(e[r],t[r]))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)||!aC(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}function aM(e,t,n){var r,i=!0;Object.defineProperty(e,t,{get:function(){return i&&(r=n(),i=!1),r},set:function(e){r=e,i=!1},configurable:!0,enumerable:!0})}function ak(e,t){return e&&Object.hasOwnProperty.call(e,t)}function aT(e){return Object.keys(e).map(t=>e[t])}var a_=n(23420);function aI(e,t,n,r){function i(r){var i=function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r],o=e[i];void 0!==o&&(n[i]=o)}return n}(r,t.map(aO));return function(e,t,n){if(!t.filter(e=>{var t;return!((t=e)&&"?"===t[0])}).every(e=>void 0!==n[e])){var r=t.filter(e=>void 0===n[e]);throw Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(r.map(e=>'"'.concat(e,'"')).join(", "),"."))}}(e,t,r),n(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function aD(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function aO(e){return e&&"?"===e[0]?e.slice(1):e}function aR(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}function aE(e,t,n){var r="";if(n){if(n<1)throw Error("size must be in greater than 0");if(!aR(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(!aR(e))throw Error("Value must be an integer");e<0&&(e+=2**n),r="i".concat(n)}var i="";return e<0&&(e=-e,i="-"),"".concat(i).concat({2:"0b",8:"0o",16:"0x"}[t]).concat(e.toString(t)).concat(r)}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,r,i="auto";if(t&&(t.notation&&(i=t.notation),oq(t)?n=t:oq(t.precision)&&(n=t.precision),t.wordSize)&&"number"!=typeof(r=t.wordSize))throw Error('Option "wordSize" must be a number');switch(i){case"fixed":return aN(e,n);case"exponential":return aB(e,n);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=az(aL(e),t),r=n.exponent,i=n.coefficients,o=r%3==0?r:r<0?r-3-r%3:r-r%3;if(oq(t))for(;t>i.length||r-o+1>i.length;)i.push(0);else for(var a=Math.abs(r-o)-(i.length-1),s=0;s<a;s++)i.push(0);for(var l=Math.abs(r-o),u=1;l>0;)u++,l--;var c=i.slice(u).join(""),d=oq(t)&&c.length||c.match(/[1-9]/)?"."+c:"",h=i.slice(0,u).join("")+d+"e"+(r>=0?"+":"")+o.toString();return n.sign+h}(e,n);case"bin":return aE(e,2,r);case"oct":return aE(e,8,r);case"hex":return aE(e,16,r);case"auto":return(function(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=n&&void 0!==n.lowerExp?n.lowerExp:-3,i=n&&void 0!==n.upperExp?n.upperExp:5,o=aL(e),a=t?az(o,t):o;if(a.exponent<r||a.exponent>=i)return aB(e,t);var s=a.coefficients,l=a.exponent;s.length<t&&(s=s.concat(aF(t-s.length))),s=s.concat(aF(l-s.length+1+(s.length<t?t-s.length:0))),s=aF(-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 "'+i+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function aL(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw SyntaxError("Invalid number "+e);var n=t[1],r=t[2],i=parseFloat(t[4]||"0"),o=r.indexOf(".");i+=-1!==o?o-1:r.length-1;var a=r.replace(".","").replace(/^0*/,function(e){return i-=e.length,""}).replace(/0*$/,"").split("").map(function(e){return parseInt(e)});return 0===a.length&&(a.push(0),i++),{sign:n,coefficients:a,exponent:i}}function aN(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=aL(e),r="number"==typeof t?az(n,n.exponent+1+t):n,i=r.coefficients,o=r.exponent+1,a=o+(t||0);return i.length<a&&(i=i.concat(aF(a-i.length))),o<0&&(i=aF(-o+1).concat(i),o=1),o<i.length&&i.splice(o,0,0===o?"0.":"."),r.sign+i.join("")}function aB(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=aL(e),r=t?az(n,t):n,i=r.coefficients,o=r.exponent;i.length<t&&(i=i.concat(aF(t-i.length)));var a=i.shift();return r.sign+a+(i.length>0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function az(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){var i=t-1;for(r[i]++;10===r[i];)r.pop(),0===i&&(r.unshift(0),n.exponent++,i++),i--,r[i]++}return n}function aF(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}var aj=Number.EPSILON||2220446049250313e-31;function aV(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 r=Math.abs(e-t);return r<aj||r<=Math.max(Math.abs(e),Math.abs(t))*n}return!1}function aH(e,t,n){var r=new e.constructor(2),i="";if(n){if(n<1)throw Error("size must be in greater than 0");if(!aR(n))throw Error("size must be an integer");if(e.greaterThan(r.pow(n-1).sub(1))||e.lessThan(r.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(r.pow(n))),i="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw Error("Base ".concat(t," not supported "))}}function a$(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function aW(e,t){var n=function(e,t){var n;if("number"==typeof e)return aP(e,t);if(oY(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?d=t:t.precision&&(d=t.precision),t.wordSize)&&"number"!=typeof(h=t.wordSize))throw Error('Option "wordSize" must be a number');switch(n){case"fixed":return r=e,i=d,r.toFixed(i);case"exponential":return a$(e,d);case"engineering":return o=e,a=d,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 aH(e,2,h);case"oct":return aH(e,8,h);case"hex":return aH(e,16,h);case"auto":var r,i,o,a,s,l,u,c,d,h,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(d),m=g.e;return(m>=p&&m<f?g.toFixed():a$(e,d)).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 aW(t,n);for(var r="[",i=t.length,o=0;o<i;o++)0!==o&&(r+=", "),r+=e(t[o],n);return r+"]"}(e,t);if(oQ(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+'": '+aW(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 aG(e,t,n){if(!(this instanceof aG))throw SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=Error().stack}function aU(e,t,n){if(!(this instanceof aU))throw SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=Error().stack}function aq(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function aY(e,t){if(0===t.length){if(Array.isArray(e))throw new aG(e.length,0)}else!function e(t,n,r){var i,o=t.length;if(o!==n[r])throw new aG(o,n[r]);if(r<n.length-1){var a=r+1;for(i=0;i<o;i++){if(!Array.isArray(t[i]))throw new aG(n.length-1,n.length,"<");e(t[i],n,a)}}else for(i=0;i<o;i++)if(Array.isArray(t[i]))throw new aG(n.length+1,n.length,">")}(e,t,0)}function aX(e,t){if(!oq(e)||!aR(e))throw TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new aU(e,t)}function aZ(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(!oq(e)||!aR(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+aW(t)+")")}),function e(t,n,r,i){var o,a,s=t.length,l=n[r],u=Math.min(s,l);if(t.length=l,r<n.length-1){var c=r+1;for(o=0;o<u;o++)Array.isArray(a=t[o])||(a=[a],t[o]=a),e(a,n,c,i);for(o=u;o<l;o++)a=[],t[o]=a,e(a,n,c,i)}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]=i}}(e,t,0,void 0!==n?n:0),e}function aK(e,t){var n=aQ(e),r=e.slice(),i=e.indexOf(-1);if(e.indexOf(-1,i+1)>=0)throw Error("More than one wildcard in sizes");if(i>=0)if(t%n==0)r[i]=-t/n;else throw Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);return r}function aQ(e){return e.reduce((e,t)=>e*t,1)}function aJ(e,t,n,r){var i=r||aq(e);if(n)for(var o=0;o<n;o++)e=[e],i.unshift(1);for(e=function e(t,n,r){var i,o;if(Array.isArray(t)){var a=r+1;for(i=0,o=t.length;i<o;i++)t[i]=e(t[i],n,a)}else for(var s=r;s<n;s++)t=[t];return t}(e,t,0);i.length<t;)i.push(1);return e}function a0(e,t){for(var n,r=0,i=0;i<e.length;i++){var o=e[i],a=Array.isArray(o);if(0===i&&a&&(r=o.length),a&&o.length!==r)return;var s=a?a0(o,t):t(o);if(void 0===n)n=s;else if(n!==s)return"mixed"}return n}function a1(e,t){return -1!==e.indexOf(t)}function a2(e,t,n,r){if(!(this instanceof a2))throw SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(null!=r?"-"+r:"")+" expected)",this.stack=Error().stack}aG.prototype=RangeError(),aG.prototype.constructor=RangeError,aG.prototype.name="DimensionError",aG.prototype.isDimensionError=!0,aU.prototype=RangeError(),aU.prototype.constructor=RangeError,aU.prototype.name="IndexError",aU.prototype.isIndexError=!0,a2.prototype=Error(),a2.prototype.constructor=Error,a2.prototype.name="ArgumentsError",a2.prototype.isArgumentsError=!0;var a5={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null},a4=["Matrix","Array"],a3=["number","BigNumber","Fraction"];function a6(e,t,n){var r;void 0!==e[t]&&(r=e[t],-1===n.indexOf(r))&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+n.map(e=>JSON.stringify(e)).join(", ")+".")}function a8(e,t){var n,r,i,o=(0,oU.A)({},a5,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:oq,isComplex:oX,isBigNumber:oY,isFraction:oZ,isUnit:oK,isString:oQ,isArray:oJ,isMatrix:o0,isCollection:o1,isDenseMatrix:o2,isSparseMatrix:o5,isRange:o4,isIndex:o3,isBoolean:o6,isResultSet:o8,isHelp:o9,isFunction:o7,isDate:ae,isRegExp:at,isObject:an,isNull:ar,isUndefined:ai,isAccessorNode:ao,isArrayNode:aa,isAssignmentNode:as,isBlockNode:al,isConditionalNode:au,isConstantNode:ac,isFunctionAssignmentNode:ad,isFunctionNode:ah,isIndexNode:ap,isNode:af,isObjectNode:ag,isOperatorNode:am,isParenthesisNode:av,isRangeNode:ay,isSymbolNode:ax,isChain:ab}).on=(r=new a_).on.bind(r),n.off=r.off.bind(r),n.once=r.once.bind(r),n.emit=r.emit.bind(r),n);a.config=function(e,t){function n(n){if(!n)return aA(e,aS);var r=aA(e,aS);a6(n,"matrix",a4),a6(n,"number",a3),function e(t,n){if(Array.isArray(n))throw TypeError("Arrays are not supported by deepExtend");for(var r in n)if(ak(n,r)&&!(r in Object.prototype)&&!(r in Function.prototype))if(n[r]&&n[r].constructor===Object)void 0===t[r]&&(t[r]={}),t[r]&&t[r].constructor===Object?e(t[r],n[r]):t[r]=n[r];else if(Array.isArray(n[r]))throw TypeError("Arrays are not supported by deepExtend");else t[r]=n[r];return t}(e,n);var i=aA(e,aS);return t("config",i,r,aA(n,aS)),i}return n.MATRIX_OPTIONS=a4,n.NUMBER_OPTIONS=a3,Object.keys(a5).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 r(e,n){n&&"function"==typeof n.transform?(t.expression.transform[e]=n.transform,ak(a,e)||(t.expression.mathWithTransform[e]=n.transform)):(delete t.expression.transform[e],ak(a,e)||(t.expression.mathWithTransform[e]=n))}function i(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 a2("import",u,1,2);l||(l={});var c={};for(var d in!function e(t,n,r){if(Array.isArray(n))n.forEach(n=>e(t,n));else if("object"==typeof n)for(var i in n)ak(n,i)&&e(t,n[i],i);else if(aD(n)||void 0!==r){var a=aD(n)?o(n)?n.fn+".transform":n.fn:r;if(ak(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(ak(c,d)){var h,p=c[d];if(aD(p))!function(r,s){var l,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.fn;if(a1(u,"."))throw Error("Factory name should not contain a nested path. Name: "+JSON.stringify(u));var c=o(r)?t.expression.transform:t,d=u in t.expression.transform,h=ak(c,u)?c[u]:void 0,p=function(){var n={};r.dependencies.map(aO).forEach(e=>{if(a1(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=r(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===h||s.override)return o;if(i(h)&&i(o))return e(h,o);if(s.silent)return h;throw Error('Cannot import "'+u+'": already exists')};r.meta&&!1===r.meta.lazy?c[u]=p():aM(c,u,p),h&&d?function(e){delete t.expression.transform[e],ak(a,e)?delete t.expression.mathWithTransform[e]:t.expression.mathWithTransform[e]=t[e]}(u):!o(r)&&(-1!==(l=r).fn.indexOf(".")||ak(a,l.fn)||l.meta&&l.meta.isClass)||aM(t.expression.mathWithTransform,u,()=>c[u]),n[u]=r,t.emit("import",u,p)}(p,l);else{if("function"==typeof(h=p)||"number"==typeof h||"string"==typeof h||"boolean"==typeof h||null===h||oK(h)||oX(h)||oY(h)||oZ(h)||o0(h)||Array.isArray(h))!function(o,a,s){var l;if(s.wrap&&"function"==typeof a&&(a=function(e){var n=function(){for(var n=[],r=0,i=arguments.length;r<i;r++){var o=arguments[r];n[r]=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})),i(t[o])&&i(a)){a=s.override?e(o,a.signatures):e(t[o],a),t[o]=a,delete n[o],r(o,a),t.emit("import",o,function(){return a});return}if(void 0===t[o]||s.override){t[o]=a,delete n[o],r(o,a),t.emit("import",o,function(){return a});return}if(!s.silent)throw Error('Cannot import "'+o+'": already exists')}(d,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",()=>{aT(s).forEach(e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&l(e,{override:!0})})}),a.create=a8.bind(null,e),a.factory=aI,a.import(aT((function e(t,n){for(var r in t)if(ak(t,r)){var i=t[r];"object"==typeof i&&null!==i?e(i,n):n[r]=i}}(e,i={}),i))),a.ArgumentsError=a2,a.DimensionError=aG,a.IndexError=aU,a}var a9,a7,se,st,sn,sr,si,so,sa,ss,sl,su,sc,sd,sh,sp,sf,sg,sm,sv="0123456789abcdef",sy="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",sx="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",sb={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},sw=!0,sS="[DecimalError] ",sA=sS+"Invalid argument: ",sC=sS+"Precision limit exceeded",sM=sS+"crypto unavailable",sk="[object Decimal]",sT=Math.floor,s_=Math.pow,sI=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,sD=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,sO=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,sR=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,sE=sy.length-1,sP=sx.length-1,sL={toStringTag:sk};function sN(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;t<i;t++)(n=7-(r=e[t]+"").length)&&(o+=sq(n)),o+=r;(n=7-(r=(a=e[t])+"").length)&&(o+=sq(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function sB(e,t,n){if(e!==~~e||e<t||e>n)throw Error(sA+e)}function sz(e,t,n,r){var i,o,a,s;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),o=s_(10,7-t),s=e[i]%o|0,null==r?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[i+1]/o/100|0)==s_(10,t-2)-1||(s==o/2||0==s)&&(e[i+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=(r||n<4)&&9999==s||!r&&n>3&&4999==s):a=((r||n<4)&&s+1==o||!r&&n>3&&s+1==o/2)&&(e[i+1]/o/1e3|0)==s_(10,t-3)-1,a}function sF(e,t,n){for(var r,i,o=[0],a=0,s=e.length;a<s;){for(i=o.length;i--;)o[i]*=t;for(o[0]+=sv.indexOf(e.charAt(a++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}sL.absoluteValue=sL.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),sV(e)},sL.ceil=function(){return sV(new this.constructor(this),this.e+1,2)},sL.clampedTo=sL.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(sA+t);return 0>this.cmp(e)?e:this.cmp(t)>0?t:new n(this)},sL.comparedTo=sL.cmp=function(e){var t,n,r,i,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=(r=o.length)<(i=a.length)?r:i;t<n;++t)if(o[t]!==a[t])return o[t]>a[t]^s<0?1:-1;return r===i?0:r>i^s<0?1:-1},sL.cosine=sL.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r,i;if(t.isZero())return t;(r=t.d.length)<32?i=(1/s2(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10"),e.precision+=n,t=s1(e,1,t.times(i),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}(r,s5(r,n)),r.precision=e,r.rounding=t,sV(2==sm||3==sm?n.neg():n,e,t,!0)):new r(1):new r(NaN)},sL.cubeRoot=sL.cbrt=function(){var e,t,n,r,i,o,a,s,l,u,c=this.constructor;if(!this.isFinite()||this.isZero())return new c(this);for(sw=!1,(o=this.s*s_(this.s*this,1/3))&&Math.abs(o)!=1/0?r=new c(o.toString()):(n=sN(this.d),(o=((e=this.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=s_(n,1/3),e=sT((e+1)/3)-(e%3==(e<0?-1:2)),(r=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(r=sj((u=(l=(s=r).times(s).times(s)).plus(this)).plus(this).times(s),u.plus(l),a+2,1),sN(s.d).slice(0,a)===(n=sN(r.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(sV(r,e+1,1),t=!r.times(r).times(r).eq(this));break}if(!i&&(sV(s,e+1,0),s.times(s).times(s).eq(this))){r=s;break}a+=4,i=1}return sw=!0,sV(r,e,c.rounding,t)},sL.decimalPlaces=sL.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=((e=t.length-1)-sT(this.e/7))*7,e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},sL.dividedBy=sL.div=function(e){return sj(this,new this.constructor(e))},sL.dividedToIntegerBy=sL.divToInt=function(e){var t=this.constructor;return sV(sj(this,new t(e),0,1,1),t.precision,t.rounding)},sL.equals=sL.eq=function(e){return 0===this.cmp(e)},sL.floor=function(){return sV(new this.constructor(this),this.e+1,3)},sL.greaterThan=sL.gt=function(e){return this.cmp(e)>0},sL.greaterThanOrEqualTo=sL.gte=function(e){var t=this.cmp(e);return 1==t||0===t},sL.hyperbolicCosine=sL.cosh=function(){var e,t,n,r,i,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,r=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?t=(1/s2(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=s1(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 sV(o,a.precision=n,a.rounding=r,!0)},sL.hyperbolicSine=sL.sinh=function(){var e,t,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=s1(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=s1(o,2,i=i.times(1/s2(5,e)),i,!0);for(var a,s=new o(5),l=new o(16),u=new o(20);e--;)a=i.times(i),i=i.times(s.plus(a.times(l.times(a).plus(u))))}return o.precision=t,o.rounding=n,sV(i,t,n,!0)},sL.hyperbolicTangent=sL.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,sj(this.sinh(),this.cosh(),n.precision=e,n.rounding=t)):new n(this.s)},sL.inverseCosine=sL.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return -1!==n?0===n?e.isNeg()?sG(t,r,i):new t(0):new t(NaN):e.isZero()?sG(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2))},sL.inverseHyperbolicCosine=sL.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,sw=!1,n=n.times(n).minus(1).sqrt().plus(n),sw=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},sL.inverseHyperbolicSine=sL.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,sw=!1,n=n.times(n).plus(1).sqrt().plus(n),sw=!0,r.precision=e,r.rounding=t,n.ln())},sL.inverseHyperbolicTangent=sL.atanh=function(){var e,t,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,Math.max(r=i.sd(),e)<-(2*i.e)-1)?sV(new o(i),e,t,!0):(o.precision=n=r-i.e,i=sj(i.plus(1),new o(1).minus(i),n+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5)):new o(NaN)},sL.inverseSine=sL.asin=function(){var e,t,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==t)?0===t?((e=sG(o,n+4,r).times(.5)).s=i.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2))},sL.inverseTangent=sL.atan=function(){var e,t,n,r,i,o,a,s,l,u=this,c=u.constructor,d=c.precision,h=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);else if(u.abs().eq(1)&&d+4<=sP)return(a=sG(c,d+4,h).times(.25)).s=u.s,a}else{if(!u.s)return new c(NaN);if(d+4<=sP)return(a=sG(c,d+4,h).times(.5)).s=u.s,a}for(c.precision=s=d+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(sw=!1,t=Math.ceil(s/7),r=1,l=u.times(u),a=new c(u),i=u;-1!==e;)if(i=i.times(l),o=a.minus(i.div(r+=2)),i=i.times(l),void 0!==(a=o.plus(i.div(r+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return n&&(a=a.times(2<<n-1)),sw=!0,sV(a,c.precision=d,c.rounding=h,!0)},sL.isFinite=function(){return!!this.d},sL.isInteger=sL.isInt=function(){return!!this.d&&sT(this.e/7)>this.d.length-2},sL.isNaN=function(){return!this.s},sL.isNegative=sL.isNeg=function(){return this.s<0},sL.isPositive=sL.isPos=function(){return this.s>0},sL.isZero=function(){return!!this.d&&0===this.d[0]},sL.lessThan=sL.lt=function(e){return 0>this.cmp(e)},sL.lessThanOrEqualTo=sL.lte=function(e){return 1>this.cmp(e)},sL.logarithm=sL.log=function(e){var t,n,r,i,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)i=!0;else{for(r=n[0];r%10==0;)r/=10;i=1!==r}if(sw=!1,sz((s=sj(o=sQ(this,a=u+5),t?sW(l,a+10):sQ(e,a),a,1)).d,r=u,c))do if(a+=10,s=sj(o=sQ(this,a),t?sW(l,a+10):sQ(e,a),a,1),!i){+sN(s.d).slice(r+1,r+15)+1==1e14&&(s=sV(s,u+1,0));break}while(sz(s.d,r+=10,c));return sw=!0,sV(s,u,c)},sL.minus=sL.sub=function(e){var t,n,r,i,o,a,s,l,u,c,d,h,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,h=e.d,s=p.precision,l=p.rounding,!u[0]||!h[0]){if(h[0])e.s=-e.s;else{if(!u[0])return new p(3===l?-0:0);e=new p(this)}return sw?sV(e,s,l):e}if(n=sT(e.e/7),c=sT(this.e/7),u=u.slice(),o=c-n){for((d=o<0)?(t=u,o=-o,a=h.length):(t=h,n=c,a=u.length),o>(r=Math.max(Math.ceil(s/7),a)+2)&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for((d=(r=u.length)<(a=h.length))&&(a=r),r=0;r<a;r++)if(u[r]!=h[r]){d=u[r]<h[r];break}o=0}for(d&&(t=u,u=h,h=t,e.s=-e.s),a=u.length,r=h.length-a;r>0;--r)u[a++]=0;for(r=h.length;r>o;){if(u[--r]<h[r]){for(i=r;i&&0===u[--i];)u[i]=1e7-1;--u[i],u[r]+=1e7}u[r]-=h[r]}for(;0===u[--a];)u.pop();for(;0===u[0];u.shift())--n;return u[0]?(e.d=u,e.e=s$(u,n),sw?sV(e,s,l):e):new p(3===l?-0:0)},sL.modulo=sL.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])?(sw=!1,9==n.modulo?(t=sj(this,e.abs(),0,3,1),t.s*=e.s):t=sj(this,e,0,n.modulo,1),t=t.times(e),sw=!0,this.minus(t)):sV(new n(this),n.precision,n.rounding):new n(NaN)},sL.naturalExponential=sL.exp=function(){return sK(this)},sL.naturalLogarithm=sL.ln=function(){return sQ(this)},sL.negated=sL.neg=function(){var e=new this.constructor(this);return e.s=-e.s,sV(e)},sL.plus=sL.add=function(e){var t,n,r,i,o,a,s,l,u,c,d=this.constructor;if(e=new d(e),!this.d||!e.d)return this.s&&e.s?this.d||(e=new d(e.d||this.s===e.s?this:NaN)):e=new d(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.minus(e);if(u=this.d,c=e.d,s=d.precision,l=d.rounding,!u[0]||!c[0])return c[0]||(e=new d(this)),sw?sV(e,s,l):e;if(o=sT(this.e/7),r=sT(e.e/7),u=u.slice(),i=o-r){for(i<0?(n=u,i=-i,a=c.length):(n=c,r=o,a=u.length),i>(a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((a=u.length)-(i=c.length)<0&&(i=a,n=c,c=u,u=n),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/1e7|0,u[i]%=1e7;for(t&&(u.unshift(t),++r),a=u.length;0==u[--a];)u.pop();return e.d=u,e.e=s$(u,r),sw?sV(e,s,l):e},sL.precision=sL.sd=function(e){var t;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(sA+e);return this.d?(t=sU(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},sL.round=function(){var e=this.constructor;return sV(new e(this),this.e+1,e.rounding)},sL.sine=sL.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:s1(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=s1(e,2,t=t.times(1/s2(5,n)),t);for(var i,o=new e(5),a=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(s))));return t}(r,s5(r,n)),r.precision=e,r.rounding=t,sV(sm>2?n.neg():n,e,t,!0)):new r(NaN)},sL.squareRoot=sL.sqrt=function(){var e,t,n,r,i,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(sw=!1,0==(l=Math.sqrt(+this))||l==1/0?(((t=sN(a)).length+s)%2==0&&(t+="0"),l=Math.sqrt(t),s=sT((s+1)/2)-(s<0||s%2),r=new u(t=l==1/0?"5e"+s:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+s)):r=new u(l.toString()),n=(s=u.precision)+3;;)if(r=(o=r).plus(sj(this,o,n+2,1)).times(.5),sN(o.d).slice(0,n)===(t=sN(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(sV(r,s+1,1),e=!r.times(r).eq(this));break}if(!i&&(sV(o,s+1,0),o.times(o).eq(this))){r=o;break}n+=4,i=1}return sw=!0,sV(r,s,u.rounding,e)},sL.tangent=sL.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=sj(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,sV(2==sm||4==sm?n.neg():n,e,t,!0)):new r(NaN)},sL.times=sL.mul=function(e){var t,n,r,i,o,a,s,l,u,c=this.constructor,d=this.d,h=(e=new c(e)).d;if(e.s*=this.s,!d||!d[0]||!h||!h[0])return new c(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:!d||!h?e.s/0:0*e.s);for(n=sT(this.e/7)+sT(e.e/7),(l=d.length)<(u=h.length)&&(o=d,d=h,h=o,a=l,l=u,u=a),o=[],r=a=l+u;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,i=l+r;i>r;)s=o[i]+h[r]*d[i-r-1]+t,o[i--]=s%1e7|0,t=s/1e7|0;o[i]=(o[i]+t)%1e7|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=s$(o,n),sw?sV(e,c.precision,c.rounding):e},sL.toBinary=function(e,t){return s4(this,2,e,t)},sL.toDecimalPlaces=sL.toDP=function(e,t){var n=this,r=n.constructor;return(n=new r(n),void 0===e)?n:(sB(e,0,1e9),void 0===t?t=r.rounding:sB(t,0,8),sV(n,e+n.e+1,t))},sL.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=sH(r,!0):(sB(e,0,1e9),void 0===t?t=i.rounding:sB(t,0,8),n=sH(r=sV(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},sL.toFixed=function(e,t){var n,r,i=this.constructor;return void 0===e?n=sH(this):(sB(e,0,1e9),void 0===t?t=i.rounding:sB(t,0,8),n=sH(r=sV(new i(this),e+this.e+1,t),!1,e+r.e+1)),this.isNeg()&&!this.isZero()?"-"+n:n},sL.toFraction=function(e){var t,n,r,i,o,a,s,l,u,c,d,h,p=this.d,f=this.constructor;if(!p)return new f(this);if(u=n=new f(1),r=l=new f(0),a=(o=(t=new f(r)).e=sU(p)-this.e-1)%7,t.d[0]=s_(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(sA+s);e=s.gt(t)?o>0?t:u:s}for(sw=!1,s=new f(sN(p)),c=f.precision,f.precision=o=7*p.length*2;d=sj(s,t,0,1,1),1!=(i=n.plus(d.times(r))).cmp(e);)n=r,r=i,i=u,u=l.plus(d.times(i)),l=i,i=t,t=s.minus(d.times(i)),s=i;return i=sj(e.minus(n),r,0,1,1),l=l.plus(i.times(u)),n=n.plus(i.times(r)),l.s=u.s=this.s,h=1>sj(u,r,o,1).minus(this).abs().cmp(sj(l,n,o,1).minus(this).abs())?[u,r]:[l,n],f.precision=c,sw=!0,h},sL.toHexadecimal=sL.toHex=function(e,t){return s4(this,16,e,t)},sL.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:sB(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]?(sw=!1,n=sj(n,e,0,t,1).times(e),sw=!0,sV(n)):(e.s=n.s,n=e),n},sL.toNumber=function(){return+this},sL.toOctal=function(e,t){return s4(this,8,e,t)},sL.toPower=sL.pow=function(e){var t,n,r,i,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(s_(+s,u));if((s=new l(s)).eq(1))return s;if(r=l.precision,o=l.rounding,e.eq(1))return sV(s,r,o);if((t=sT(e.e/7))>=e.d.length-1&&(n=u<0?-u:u)<=0x1fffffffffffff)return i=sY(l,s,n,r),e.s<0?new l(1).div(i):sV(i,r,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=s_(+s,u))&&isFinite(n)?new l(n+"").e:sT(u*(Math.log("0."+sN(s.d))/Math.LN10+s.e+1)))>l.maxE+1||t<l.minE-1?new l(t>0?a/0:0):(sw=!1,l.rounding=s.s=1,n=Math.min(12,(t+"").length),(i=sK(e.times(sQ(s,r+n)),r)).d&&sz((i=sV(i,r+5,1)).d,r,o)&&(t=r+10,+sN((i=sV(sK(e.times(sQ(s,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=sV(i,r+1,0))),i.s=a,sw=!0,l.rounding=o,sV(i,r,o))},sL.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=sH(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(sB(e,1,1e9),void 0===t?t=i.rounding:sB(t,0,8),n=sH(r=sV(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},sL.toSignificantDigits=sL.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(sB(e,1,1e9),void 0===t?t=n.rounding:sB(t,0,8)),sV(new n(this),e,t)},sL.toString=function(){var e=this.constructor,t=sH(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()&&!this.isZero()?"-"+t:t},sL.truncated=sL.trunc=function(){return sV(new this.constructor(this),this.e+1,1)},sL.valueOf=sL.toJSON=function(){var e=this.constructor,t=sH(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()?"-"+t:t};var sj=function(){function e(e,t,n){var r,i=0,o=e.length;for(e=e.slice();o--;)r=e[o]*t+i,e[o]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=+(e[n]<t[n]),e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,a,s,l){var u,c,d,h,p,f,g,m,v,y,x,b,w,S,A,C,M,k,T,_,I=r.constructor,D=r.s==i.s?1:-1,O=r.d,R=i.d;if(!O||!O[0]||!R||!R[0])return new I(!r.s||!i.s||(O?R&&O[0]==R[0]:!R)?NaN:O&&0==O[0]||!R?0*D:D/0);for(l?(p=1,c=r.e-i.e):(l=1e7,p=7,c=sT(r.e/p)-sT(i.e/p)),T=R.length,M=O.length,y=(v=new I(D)).d=[],d=0;R[d]==(O[d]||0);d++);if(R[d]>(O[d]||0)&&c--,null==o?(S=o=I.precision,a=I.rounding):S=s?o+(r.e-i.e)+1:o,S<0)y.push(1),f=!0;else{if(S=S/p+2|0,d=0,1==T){for(h=0,R=R[0],S++;(d<M||h)&&S--;d++)A=h*l+(O[d]||0),y[d]=A/R|0,h=A%R|0;f=h||d<M}else{for((h=l/(R[0]+1)|0)>1&&(R=e(R,h,l),O=e(O,h,l),T=R.length,M=O.length),C=T,b=(x=O.slice(0,T)).length;b<T;)x[b++]=0;(_=R.slice()).unshift(0),k=R[0],R[1]>=l/2&&++k;do h=0,(u=t(R,x,T,b))<0?(w=x[0],T!=b&&(w=w*l+(x[1]||0)),(h=w/k|0)>1?(h>=l&&(h=l-1),m=(g=e(R,h,l)).length,b=x.length,1==(u=t(g,x,m,b))&&(h--,n(g,T<m?_:R,m,l))):(0==h&&(u=h=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,T,b))<1&&(h++,n(x,T<b?_:R,b,l))),b=x.length):0===u&&(h++,x=[0]),y[d++]=h,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,sg=f;else{for(d=1,h=y[0];h>=10;h/=10)d++;v.e=d+c*p-1,sV(v,s?o+v.e+1:o,a,f)}return v}}();function sV(e,t,n,r){var i,o,a,s,l,u,c,d,h,p=e.constructor;e:if(null!=t){if(!(d=e.d))return e;for(i=1,s=d[0];s>=10;s/=10)i++;if((o=t-i)<0)o+=7,a=t,l=(c=d[h=0])/s_(10,i-a-1)%10|0;else if((h=Math.ceil((o+1)/7))>=(s=d.length))if(r){for(;s++<=h;)d.push(0);c=l=0,i=1,o%=7,a=o-7+1}else break e;else{for(i=1,c=s=d[h];s>=10;s/=10)i++;o%=7,l=(a=o-7+i)<0?0:c/s_(10,i-a-1)%10|0}if(r=r||t<0||void 0!==d[h+1]||(a<0?c:c%s_(10,i-a-1)),u=n<4?(l||r)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?a>0?c/s_(10,i-a):0:d[h-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,u?(t-=e.e+1,d[0]=s_(10,(7-t%7)%7),e.e=-t||0):d[0]=e.e=0,e;if(0==o?(d.length=h,s=1,h--):(d.length=h+1,s=s_(10,7-o),d[h]=a>0?(c/s_(10,i-a)%s_(10,a)|0)*s:0),u)for(;;)if(0==h){for(o=1,a=d[0];a>=10;a/=10)o++;for(a=d[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(e.e++,1e7==d[0]&&(d[0]=1));break}else{if(d[h]+=s,1e7!=d[h])break;d[h--]=0,s=1}for(o=d.length;0===d[--o];)d.pop()}return sw&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function sH(e,t,n){if(!e.isFinite())return sJ(e);var r,i=e.e,o=sN(e.d),a=o.length;return t?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+sq(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+sq(-i-1)+o,n&&(r=n-a)>0&&(o+=sq(r))):i>=a?(o+=sq(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+sq(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=sq(r))),o}function s$(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function sW(e,t,n){if(t>sE)throw sw=!0,n&&(e.precision=n),Error(sC);return sV(new e(sy),t,1,!0)}function sG(e,t,n){if(t>sP)throw Error(sC);return sV(new e(sx),t,n,!0)}function sU(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 sq(e){for(var t="";e--;)t+="0";return t}function sY(e,t,n,r){var i,o=new e(1),a=Math.ceil(r/7+4);for(sw=!1;;){if(n%2&&s3((o=o.times(t)).d,a)&&(i=!0),0===(n=sT(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}s3((t=t.times(t)).d,a)}return sw=!0,o}function sX(e){return 1&e.d[e.d.length-1]}function sZ(e,t,n){for(var r,i,o=new e(t[0]),a=0;++a<t.length;){if(!(i=new e(t[a])).s){o=i;break}((r=o.cmp(i))===n||0===r&&o.s===n)&&(o=i)}return o}function sK(e,t){var n,r,i,o,a,s,l,u=0,c=0,d=0,h=e.constructor,p=h.rounding,f=h.precision;if(!e.d||!e.d[0]||e.e>17)return new h(e.d?!e.d[0]?1:e.s<0?0:1/0:e.s?e.s<0?0:e:0/0);for(null==t?(sw=!1,l=f):l=t,s=new h(.03125);e.e>-2;)e=e.times(s),d+=5;for(l+=r=Math.log(s_(2,d))/Math.LN10*2+5|0,n=o=a=new h(1),h.precision=l;;){if(o=sV(o.times(e),l,1),n=n.times(++c),sN((s=a.plus(sj(o,n,l,1))).d).slice(0,l)===sN(a.d).slice(0,l)){for(i=d;i--;)a=sV(a.times(a),l,1);if(null!=t)return h.precision=f,a;if(!(u<3&&sz(a.d,l-r,p,u)))return sV(a,h.precision=f,p,sw=!0);h.precision=l+=10,n=o=s=new h(1),c=0,u++}a=s}}function sQ(e,t){var n,r,i,o,a,s,l,u,c,d,h,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?(sw=!1,c=y):c=t,m.precision=c+=10,r=(n=sN(g)).charAt(0),!(15e14>Math.abs(o=f.e)))return u=sW(m,c+2,y).times(o+""),f=sQ(new m(r+"."+n.slice(1)),c-10).plus(u),m.precision=y,null==t?sV(f,y,v,sw=!0):f;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=sN((f=f.times(e)).d)).charAt(0),p++;for(o=f.e,r>1?(f=new m("0."+n),o++):f=new m(r+"."+n.slice(1)),d=f,l=a=f=sj(f.minus(1),f.plus(1),c,1),h=sV(f.times(f),c,1),i=3;;){if(a=sV(a.times(h),c,1),sN((u=l.plus(sj(a,new m(i),c,1))).d).slice(0,c)===sN(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(sW(m,c+2,y).times(o+""))),l=sj(l,new m(p),c,1),null!=t)return m.precision=y,l;if(!sz(l.d,c-10,v,s))return sV(l,m.precision=y,v,sw=!0);m.precision=c+=10,u=a=f=sj(d.minus(1),d.plus(1),c,1),h=sV(f.times(f),c,1),i=s=1}l=u,i+=2}}function sJ(e){return String(e.s*e.s/0)}function s0(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%7,n<0&&(r+=7),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=7;r<i;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=i;for(;r--;)t+="0";e.d.push(+t),sw&&(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 s1(e,t,n,r,i){var o,a,s,l,u=e.precision,c=Math.ceil(u/7);for(sw=!1,l=n.times(n),s=new e(r);;){if(a=sj(s.times(l),new e(t++*t++),u,1),s=i?r.plus(a):r.minus(a),r=sj(a.times(l),new e(t++*t++),u,1),void 0!==(a=s.plus(r)).d[c]){for(o=c;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=r,r=a,a=o}return sw=!0,a.d.length=c+1,a}function s2(e,t){for(var n=e;--t;)n*=e;return n}function s5(e,t){var n,r=t.s<0,i=sG(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return sm=r?4:1,t;if((n=t.divToInt(i)).isZero())sm=r?3:2;else{if((t=t.minus(n.times(i))).lte(o))return sm=sX(n)?r?2:3:r?4:1,t;sm=sX(n)?r?1:4:r?3:2}return t.minus(i).abs()}function s4(e,t,n,r){var i,o,a,s,l,u,c,d,h,p=e.constructor,f=void 0!==n;if(f?(sB(n,1,1e9),void 0===r?r=p.rounding:sB(r,0,8)):(n=p.precision,r=p.rounding),e.isFinite()){for(a=(c=sH(e)).indexOf("."),f?(i=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):i=t,a>=0&&(c=c.replace(".",""),(h=new p(1)).e=c.length-a,h.d=sF(sH(h),10,i),h.e=h.d.length),o=l=(d=sF(c,10,i)).length;0==d[--l];)d.pop();if(d[0]){if(a<0?o--:((e=new p(e)).d=d,e.e=o,d=(e=sj(e,h,n,r,0,i)).d,o=e.e,u=sg),a=d[n],s=i/2,u=u||void 0!==d[n+1],u=r<4?(void 0!==a||u)&&(0===r||r===(e.s<0?3:2)):a>s||a===s&&(4===r||u||6===r&&1&d[n-1]||r===(e.s<0?8:7)),d.length=n,u)for(;++d[--n]>i-1;)d[n]=0,n||(++o,d.unshift(1));for(l=d.length;!d[l-1];--l);for(a=0,c="";a<l;a++)c+=sv.charAt(d[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=(d=sF(c,i,t)).length;!d[l-1];--l);for(a=1,c="1.";a<l;a++)c+=sv.charAt(d[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=sJ(e);return e.s<0?"-"+c:c}function s3(e,t){if(e.length>t)return e.length=t,!0}function s6(e){return new this(e).abs()}function s8(e){return new this(e).acos()}function s9(e){return new this(e).acosh()}function s7(e,t){return new this(e).plus(t)}function le(e){return new this(e).asin()}function lt(e){return new this(e).asinh()}function ln(e){return new this(e).atan()}function lr(e){return new this(e).atanh()}function li(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,o=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?sG(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=sG(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(sj(e,t,o,1)),t=sG(this,o,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(sj(e,t,o,1)):(n=sG(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function lo(e){return new this(e).cbrt()}function la(e){return sV(e=new this(e),e.e+1,2)}function ls(e,t,n){return new this(e).clamp(t,n)}function ll(e){if(!e||"object"!=typeof e)throw Error(sS+"Object expected");var t,n,r,i=!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],i&&(this[n]=sb[n]),void 0!==(r=e[n]))if(sT(r)===r&&r>=o[t+1]&&r<=o[t+2])this[n]=r;else throw Error(sA+n+": "+r);if(n="crypto",i&&(this[n]=sb[n]),void 0!==(r=e[n]))if(!0===r||!1===r||0===r||1===r)if(r)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(sM);else this[n]=!1;else throw Error(sA+n+": "+r);return this}function lu(e){return new this(e).cos()}function lc(e){return new this(e).cosh()}function ld(e,t){return new this(e).div(t)}function lh(e){return new this(e).exp()}function lp(e){return sV(e=new this(e),e.e+1,3)}function lf(){var e,t,n=new this(0);for(e=0,sw=!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 sw=!0,new this(1/0);n=t}return sw=!0,n.sqrt()}function lg(e){return e instanceof lN||e&&e.toStringTag===sk||!1}function lm(e){return new this(e).ln()}function lv(e,t){return new this(e).log(t)}function ly(e){return new this(e).log(2)}function lx(e){return new this(e).log(10)}function lb(){return sZ(this,arguments,-1)}function lw(){return sZ(this,arguments,1)}function lS(e,t){return new this(e).mod(t)}function lA(e,t){return new this(e).mul(t)}function lC(e,t){return new this(e).pow(t)}function lM(e){var t,n,r,i,o=0,a=new this(1),s=[];if(void 0===e?e=this.precision:sB(e,1,1e9),r=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));o<r;)(i=t[o])>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);o<r;)(i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((127&t[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,o):(s.push(i%1e7),o+=4);o=r/4}else throw Error(sM);else for(;o<r;)s[o++]=1e7*Math.random()|0;for(r=s[--o],e%=7,r&&e&&(i=s_(10,7-e),s[o]=(r/i|0)*i);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(r=1,i=s[0];i>=10;i/=10)r++;r<7&&(n-=7-r)}return a.e=n,a.d=s,a}function lk(e){return sV(e=new this(e),e.e+1,this.rounding)}function lT(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function l_(e){return new this(e).sin()}function lI(e){return new this(e).sinh()}function lD(e){return new this(e).sqrt()}function lO(e,t){return new this(e).sub(t)}function lR(){var e=0,t=arguments,n=new this(t[0]);for(sw=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return sw=!0,sV(n,this.precision,this.rounding)}function lE(e){return new this(e).tan()}function lP(e){return new this(e).tanh()}function lL(e){return sV(e=new this(e),e.e+1,1)}sL[Symbol.for("nodejs.util.inspect.custom")]=sL.toString,sL[Symbol.toStringTag]="Decimal";var lN=sL.constructor=function e(t){var n,r,i;function o(e){var t,n,r;if(!(this instanceof o))return new o(e);if(this.constructor=o,lg(e)){this.s=e.s,sw?!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"==(r=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++;sw?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 s0(this,e.toString())}if("string"===r)return 45===(n=e.charCodeAt(0))?(e=e.slice(1),this.s=-1):(43===n&&(e=e.slice(1)),this.s=1),sR.test(e)?s0(this,e):function(e,t){var n,r,i,o,a,s,l,u,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),sR.test(t))return s0(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(sD.test(t))n=16,t=t.toLowerCase();else if(sI.test(t))n=2;else if(sO.test(t))n=8;else throw Error(sA+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,r=e.constructor,a&&(o=(s=(t=t.replace(".","")).length)-o,i=sY(r,new r(n),o,2*o)),o=c=(u=sF(t,n,1e7)).length-1;0===u[o];--o)u.pop();return o<0?new r(0*e.s):(e.e=s$(u,c),e.d=u,sw=!1,a&&(e=sj(e,i,4*s)),l&&(e=e.times(54>Math.abs(l)?s_(2,l):lN.pow(2,l))),sw=!0,e)}(this,e);if("bigint"===r)return e<0?(e=-e,this.s=-1):this.s=1,s0(this,e.toString());throw Error(sA+e)}if(o.prototype=sL,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=ll,o.clone=e,o.isDecimal=lg,o.abs=s6,o.acos=s8,o.acosh=s9,o.add=s7,o.asin=le,o.asinh=lt,o.atan=ln,o.atanh=lr,o.atan2=li,o.cbrt=lo,o.ceil=la,o.clamp=ls,o.cos=lu,o.cosh=lc,o.div=ld,o.exp=lh,o.floor=lp,o.hypot=lf,o.ln=lm,o.log=lv,o.log10=lx,o.log2=ly,o.max=lb,o.min=lw,o.mod=lS,o.mul=lA,o.pow=lC,o.random=lM,o.round=lk,o.sign=lT,o.sin=l_,o.sinh=lI,o.sqrt=lD,o.sub=lO,o.sum=lR,o.tan=lE,o.tanh=lP,o.trunc=lL,void 0===t&&(t={}),t&&!0!==t.defaults)for(n=0,i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"];n<i.length;)t.hasOwnProperty(r=i[n++])||(t[r]=this[r]);return o.config(t),o}(sb);sy=new lN(sy),sx=new lN(sx);var lB={createBigNumberClass:aI("BigNumber",["?on","config"],e=>{var{on:t,config:n}=e,r=lN.clone({precision:n.precision,modulo:lN.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t("config",function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})}),r},{isClass:!0})},lz={createMatrixClass:aI("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})},lF={MatrixDependencies:lz,createDenseMatrixClass:aI("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&&!oQ(t))throw Error("Invalid datatype: "+t);if(o0(e))"DenseMatrix"===e.type?(this._data=aS(e._data),this._size=aS(e._size)):(this._data=e.toArray(),this._size=e.size()),this._datatype=t||e._datatype;else if(e&&oJ(e.data)&&oJ(e.size))this._data=e.data,this._size=e.size,aY(this._data,this._size),this._datatype=t||e.datatype;else if(oJ(e))this._data=function e(t){for(var n=0,r=t.length;n<r;n++){var i=t[n];oJ(i)?t[n]=e(i):i&&!0===i.isMatrix&&(t[n]=e(i.valueOf()))}return t}(e),this._size=aq(this._data),aY(this._data,this._size),this._datatype=t;else if(e)throw TypeError("Unsupported type of data ("+aw(e)+")");else this._data=[],this._size=[0],this._datatype=t}function r(e,t,n){if(0===t.length){for(var r=e._data;oJ(r);)r=r[0];return r}return e._size=t.slice(0),e._data=aZ(e._data,e._size,n),e}function i(e,t,n){for(var i=e._size.slice(0),o=!1;i.length<t.length;)i.push(0),o=!0;for(var a=0,s=t.length;a<s;a++)t[a]>i[a]&&(i[a]=t[a],o=!0);o&&r(e,i,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 a0(this._data,aw)},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,r){switch(arguments.length){case 1:return function(e,t){if(!o3(t))throw TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var r=t.size();if(r.length!==e._size.length)throw new aG(r.length,e._size.length);for(var i=t.min(),o=t.max(),a=0,s=e._size.length;a<s;a++)aX(i[a],e._size[a]),aX(o[a],e._size[a]);return new n(function e(t,n,r,i){var o=i===r-1,a=n.dimension(i);return o?a.map(function(e){return aX(e,t.length),t[e]}).valueOf():a.map(function(o){return aX(o,t.length),e(t[o],n,r,i+1)}).valueOf()}(e._data,t,r.length,0),e._datatype)}(this,e);case 2:case 3:return function(e,t,n,r){if(!t||!0!==t.isIndex)throw TypeError("Invalid index");var o,a=t.size(),s=t.isScalar();if(o0(n)?(o=n.size(),n=n.valueOf()):o=aq(n),s){if(0!==o.length)throw TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(a.length<e._size.length)throw new aG(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=aJ(n,a.length,u,o)}if(!aC(a,o))throw new aG(a,o,">");i(e,t.max().map(function(e){return e+1}),r);var c=a.length;!function e(t,n,r,i,o){var a=o===i-1,s=n.dimension(o);a?s.forEach(function(e,n){aX(e),t[e]=r[n[0]]}):s.forEach(function(a,s){aX(a),e(t[a],n,r[s[0]],i,o+1)})}(e._data,t,n,c,0)}return e}(this,e,t,r);default:throw SyntaxError("Wrong number of arguments")}},n.prototype.get=function(e){if(!oJ(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new aG(e.length,this._size.length);for(var t=0;t<e.length;t++)aX(e[t],this._size[t]);for(var n=this._data,r=0,i=e.length;r<i;r++){var o=e[r];aX(o,n.length),n=n[o]}return n},n.prototype.set=function(e,t,n){if(!oJ(e))throw TypeError("Array expected");if(e.length<this._size.length)throw new aG(e.length,this._size.length,"<");i(this,e.map(function(e){return e+1}),n);var r,o,a,s=this._data;for(r=0,o=e.length-1;r<o;r++)aX(a=e[r],s.length),s=s[a];return aX(a=e[e.length-1],s.length),s[a]=t,this},n.prototype.resize=function(e,t,n){if(!o1(e))throw TypeError("Array or Matrix expected");var i=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);return r(n?this.clone():this,i,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),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw TypeError("Array expected");if(0===t.length)throw new aG(0,r,"!=");var i=aQ(t=aK(t,r));if(r!==i)throw new aG(i,r,"!=");try{return function(e,t){for(var n,r=e,i=t.length-1;i>0;i--){var o=t[i];n=[];for(var a=r.length/o,s=0;s<a;s++)n.push(r.slice(s*o,(s+1)*o));r=n}return r}(n,t)}catch(e){if(e instanceof aG)throw new aG(i,r,"!=");throw e}}(n._data,e);var r=n._size.reduce((e,t)=>e*t);return n._size=aK(e,r),n},n.prototype.clone=function(){return new n({data:aS(this._data),size:aS(this._size),datatype:this._datatype})},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(e){var t=this,r=function n(r,i){return oJ(r)?r.map(function(e,t){return n(e,i.concat(t))}):e(r,i,t)}(this._data,[]),i=void 0!==this._datatype?a0(r,aw):void 0;return new n(r,i)},n.prototype.forEach=function(e){var t=this;!function n(r,i){oJ(r)?r.forEach(function(e,t){n(e,i.concat(t))}):e(r,i,t)}(this._data,[])},n.prototype[Symbol.iterator]=function*(){var e=function* e(t,n){if(oJ(t))for(var r=0;r<t.length;r++)yield*e(t[r],n.concat(r));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=[],r=this.size();if(2!==r.length)throw TypeError("Rows can only be returned for a 2D matrix.");for(var i=this._data,o=function(r){var o=i.map(e=>[e[r]]);t.push(new n(o,e._datatype))},a=0;a<r[1];a++)o(a);return t},n.prototype.toArray=function(){return aS(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(e){return aW(this._data,e)},n.prototype.toString=function(){return aW(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(oY(e)&&(e=e.toNumber()),!oq(e)||!aR(e))throw TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,r=e<0?-e:0,i=Math.min(this._size[0]-r,this._size[1]-t),o=[],a=0;a<i;a++)o[a]=this._data[a+r][a+t];return new n({data:o,size:[i],datatype:this._datatype})},n.diagonal=function(e,t,r,i){if(!oJ(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(oY(e)&&(e=e.toNumber()),!oq(e)||!aR(e)||e<1)throw Error("Size values must be positive integers");return e}),r){if(oY(r)&&(r=r.toNumber()),!oq(r)||!aR(r))throw TypeError("The parameter k must be an integer number")}else r=0;var o,a=r>0?r:0,s=r<0?-r:0,l=e[0],u=e[1],c=Math.min(l-s,u-a);if(oJ(t)){if(t.length!==c)throw Error("Invalid value array length");o=function(e){return t[e]}}else if(o0(t)){var d=t.size();if(1!==d.length||d[0]!==c)throw Error("Invalid matrix length");o=function(e){return t.get([e])}}else o=function(){return t};i||(i=oY(o(0))?o(0).mul(0):0);var h=[];if(e.length>0){h=aZ(h,e,i);for(var p=0;p<c;p++)h[p+s][p+a]=o(p)}return new n({data:h,size:[l,u]})},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(e,t){if(!oq(e)||!aR(e)||!oq(t)||!aR(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return aX(e,this._size[0]),aX(t,this._size[0]),n._swapRows(e,t,this._data),this},n._swapRows=function(e,t,n){var r=n[e];n[e]=n[t],n[t]=r},n},{isClass:!0})};let lj=Math.cosh||function(e){return 1e-9>Math.abs(e)?1-e:(Math.exp(e)+Math.exp(-e))*.5},lV=Math.sinh||function(e){return 1e-9>Math.abs(e)?e:(Math.exp(e)-Math.exp(-e))*.5},lH=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))},l$=function(){throw SyntaxError("Invalid Param")};function lW(e,t){let n=Math.abs(e),r=Math.abs(t);return 0===e?Math.log(r):0===t?Math.log(n):n<3e3&&r<3e3?.5*Math.log(e*e+t*t):.5*Math.log((e*=.5)*e+(t*=.5)*t)+Math.LN2}let lG={re:0,im:0},lU=function(e,t){if(null==e)lG.re=lG.im=0;else if(void 0!==t)lG.re=e,lG.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)lG.re=e.re,lG.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return lq.INFINITY;lG.re=e.abs*Math.cos(e.arg),lG.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return lq.INFINITY;lG.re=e.r*Math.cos(e.phi),lG.im=e.r*Math.sin(e.phi)}else 2===e.length?(lG.re=e[0],lG.im=e[1]):l$();break;case"string":lG.im=lG.re=0;let n=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),r=1,i=0;null===n&&l$();for(let e=0;e<n.length;e++){let t=n[e];" "===t||" "===t||"\n"===t||("+"===t?r++:"-"===t?i++:("i"===t||"I"===t?(r+i===0&&l$()," "===n[e+1]||isNaN(n[e+1])?lG.im+=parseFloat((i%2?"-":"")+"1"):(lG.im+=parseFloat((i%2?"-":"")+n[e+1]),e++)):((r+i===0||isNaN(t))&&l$(),"i"===n[e+1]||"I"===n[e+1]?(lG.im+=parseFloat((i%2?"-":"")+t),e++):lG.re+=parseFloat((i%2?"-":"")+t)),r=i=0))}r+i>0&&l$();break;case"number":lG.im=0,lG.re=e;break;default:l$()}return isNaN(lG.re)||isNaN(lG.im),lG};function lq(e,t){if(!(this instanceof lq))return new lq(e,t);let n=lU(e,t);this.re=n.re,this.im=n.im}lq.prototype={re:0,im:0,sign:function(){let e=lH(this.re,this.im);return new lq(this.re/e,this.im/e)},add:function(e,t){let n=lU(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?lq.NAN:lq.INFINITY:new lq(this.re+n.re,this.im+n.im)},sub:function(e,t){let n=lU(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?lq.NAN:lq.INFINITY:new lq(this.re-n.re,this.im-n.im)},mul:function(e,t){let n=lU(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,a=0===n.re&&0===n.im;return r&&a||i&&o?lq.NAN:r||i?lq.INFINITY:0===n.im&&0===this.im?new lq(this.re*n.re,0):new lq(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){let n=lU(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,a=0===n.re&&0===n.im;if(o&&a||r&&i)return lq.NAN;if(a||r)return lq.INFINITY;if(o||i)return lq.ZERO;if(0===n.im)return new lq(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 lq((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 lq((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){let n=lU(e,t),r=0===this.re&&0===this.im;if(0===n.re&&0===n.im)return lq.ONE;if(0===n.im){if(0===this.im&&this.re>0)return new lq(Math.pow(this.re,n.re),0);else if(0===this.re)switch((n.re%4+4)%4){case 0:return new lq(Math.pow(this.im,n.re),0);case 1:return new lq(0,Math.pow(this.im,n.re));case 2:return new lq(-Math.pow(this.im,n.re),0);case 3:return new lq(0,-Math.pow(this.im,n.re))}}if(r&&n.re>0)return lq.ZERO;let i=Math.atan2(this.im,this.re),o=lW(this.re,this.im),a=Math.exp(n.re*o-n.im*i),s=n.im*o+n.re*i;return new lq(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 lq(Math.sqrt(e),0);else return new lq(0,Math.sqrt(-e));let n=Math.sqrt(.5*(lH(e,t)+Math.abs(e))),r=Math.abs(t)/(2*n);return e>=0?new lq(n,t<0?-r:r):new lq(r,t<0?-n:n)},exp:function(){let e=Math.exp(this.re);return 0===this.im?new lq(e,0):new lq(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){let e,t=this.re,n=this.im;return new lq(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 lq(Math.log(e),0):new lq(lW(e,t),Math.atan2(t,e))},abs:function(){return lH(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let e=this.re,t=this.im;return new lq(Math.sin(e)*lj(t),Math.cos(e)*lV(t))},cos:function(){let e=this.re,t=this.im;return new lq(Math.cos(e)*lj(t),-Math.sin(e)*lV(t))},tan:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)+lj(t);return new lq(Math.sin(e)/n,lV(t)/n)},cot:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)-lj(t);return new lq(-Math.sin(e)/n,lV(t)/n)},sec:function(){let e=this.re,t=this.im,n=.5*lj(2*t)+.5*Math.cos(2*e);return new lq(Math.cos(e)*lj(t)/n,Math.sin(e)*lV(t)/n)},csc:function(){let e=this.re,t=this.im,n=.5*lj(2*t)-.5*Math.cos(2*e);return new lq(Math.sin(e)*lj(t)/n,-Math.cos(e)*lV(t)/n)},asin:function(){let e=this.re,t=this.im,n=new lq(t*t-e*e+1,-2*e*t).sqrt(),r=new lq(n.re-t,n.im+e).log();return new lq(r.im,-r.re)},acos:function(){let e=this.re,t=this.im,n=new lq(t*t-e*e+1,-2*e*t).sqrt(),r=new lq(n.re-t,n.im+e).log();return new lq(Math.PI/2-r.im,r.re)},atan:function(){let e=this.re,t=this.im;if(0===e){if(1===t)return new lq(0,1/0);if(-1===t)return new lq(0,-1/0)}let n=e*e+(1-t)*(1-t),r=new lq((1-t*t-e*e)/n,-2*e/n).log();return new lq(-.5*r.im,.5*r.re)},acot:function(){let e=this.re,t=this.im;if(0===t)return new lq(Math.atan2(1,e),0);let n=e*e+t*t;return 0!==n?new lq(e/n,-t/n).atan():new lq(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 lq(0,1/0);let n=e*e+t*t;return 0!==n?new lq(e/n,-t/n).acos():new lq(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 lq(Math.PI/2,1/0);let n=e*e+t*t;return 0!==n?new lq(e/n,-t/n).asin():new lq(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){let e=this.re,t=this.im;return new lq(lV(e)*Math.cos(t),lj(e)*Math.sin(t))},cosh:function(){let e=this.re,t=this.im;return new lq(lj(e)*Math.cos(t),lV(e)*Math.sin(t))},tanh:function(){let e=2*this.re,t=2*this.im,n=lj(e)+Math.cos(t);return new lq(lV(e)/n,Math.sin(t)/n)},coth:function(){let e=2*this.re,t=2*this.im,n=lj(e)-Math.cos(t);return new lq(lV(e)/n,-Math.sin(t)/n)},csch:function(){let e=this.re,t=this.im,n=Math.cos(2*t)-lj(2*e);return new lq(-2*lV(e)*Math.cos(t)/n,2*lj(e)*Math.sin(t)/n)},sech:function(){let e=this.re,t=this.im,n=Math.cos(2*t)+lj(2*e);return new lq(2*lj(e)*Math.cos(t)/n,-2*lV(e)*Math.sin(t)/n)},asinh:function(){let e=this.re,t=this.im;if(0===t){if(0===e)return new lq(0,0);let t=Math.abs(e),n=Math.log(t+Math.sqrt(t*t+1));return new lq(e<0?-n:n,0)}let n=new lq(e*e-t*t+1,2*e*t).sqrt();return new lq(e+n.re,t+n.im).log()},acosh:function(){let e=this.re,t=this.im;if(0===t){if(e>1)return new lq(Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1)),0);if(e<-1){let t=Math.sqrt(e*e-1);return new lq(Math.log(-e+t),Math.PI)}return new lq(0,Math.acos(e))}let n=new lq(e-1,t).sqrt(),r=new lq(e+1,t).sqrt();return new lq(e+n.re*r.re-n.im*r.im,t+n.re*r.im+n.im*r.re).log()},atanh:function(){let e=this.re,t=this.im;if(0===t)return 0===e?new lq(0,0):1===e?new lq(1/0,0):-1===e?new lq(-1/0,0):-1<e&&e<1?new lq(.5*Math.log((1+e)/(1-e)),0):e>1?new lq(.5*Math.log((e+1)/(e-1)),-Math.PI/2):new lq(.5*Math.log(-((1+e)/(1-e))),Math.PI/2);let n=1-e,r=1+e,i=n*n+t*t;if(0===i)return new lq(-1!==e?e/0:0,0!==t?t/0:0);let o=(r*n-t*t)/i,a=(t*n+r*t)/i;return new lq(lW(o,a)/2,Math.atan2(a,o)/2)},acoth:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new lq(0,Math.PI/2);let n=e*e+t*t;return 0!==n?new lq(e/n,-t/n).atanh():new lq(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 lq(1/0,0);let t=1/e;return new lq(Math.log(t+Math.sqrt(t*t+1)),0)}let n=e*e+t*t;return 0!==n?new lq(e/n,-t/n).asinh():new lq(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){let e=this.re,t=this.im;if(this.isZero())return lq.INFINITY;let n=e*e+t*t;return 0!==n?new lq(e/n,-t/n).acosh():new lq(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return lq.INFINITY;if(this.isInfinite())return lq.ZERO;let e=this.re,t=this.im,n=e*e+t*t;return new lq(e/n,-t/n)},conjugate:function(){return new lq(this.re,-this.im)},neg:function(){return new lq(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new lq(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new lq(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new lq(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){let n=lU(e,t);return Math.abs(n.re-this.re)<=lq.EPSILON&&Math.abs(n.im-this.im)<=lq.EPSILON},clone:function(){return new lq(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<lq.EPSILON&&(e=0),Math.abs(t)<lq.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()}},lq.ZERO=new lq(0,0),lq.ONE=new lq(1,0),lq.I=new lq(0,1),lq.PI=new lq(Math.PI,0),lq.E=new lq(Math.E,0),lq.INFINITY=new lq(1/0,1/0),lq.NAN=new lq(NaN,NaN),lq.EPSILON=1e-15;var lY=aI("Complex",[],()=>(lq.prototype.type="Complex",lq.prototype.isComplex=!0,lq.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},lq.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},lq.prototype.format=function(e){var t=this.im,n=this.re,r=aP(this.re,e),i=aP(this.im,e),o=oq(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?r:0===n?1===t?"i":-1===t?"-i":i+"i":t<0?-1===t?r+" - i":r+" - "+i.substring(1)+"i":1===t?r+" + i":r+" + "+i+"i"},lq.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if("object"==typeof t)return lq(t);throw TypeError("Input has to be an object with r and phi keys.");case 2:var n=arguments[0],r=arguments[1];if(oq(n)){if(oK(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),oq(r))return new lq({r:n,phi:r});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")}},lq.prototype.valueOf=lq.prototype.toString,lq.fromJSON=function(e){return new lq(e)},lq.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},lq),{isClass:!0}),lX={s:1,n:0,d:1};function lZ(e,t){if(isNaN(e=parseInt(e,10)))throw l5();return e*t}function lK(e,t){if(0===t)throw l2();var n=Object.create(l1.prototype);n.s=e<0?-1:1;var r=l0(e=e<0?-e:e,t);return n.n=e/r,n.d=t/r,n}function lQ(e){for(var t={},n=e,r=2,i=4;i<=n;){for(;n%r==0;)n/=r,t[r]=(t[r]||0)+1;i+=1+2*r++}return n!==e?n>1&&(t[n]=(t[n]||0)+1):t[e]=(t[e]||0)+1,t}var lJ=function(e,t){var n,r=0,i=1,o=1,a=0,s=0,l=0,u=1,c=1,d=0,h=1,p=1,f=1;if(null==e);else if(void 0!==t){if(o=(r=e)*(i=t),r%1!=0||i%1!=0)throw l4()}else switch(typeof e){case"object":if("d"in e&&"n"in e)r=e.n,i=e.d,"s"in e&&(r*=e.s);else if(0 in e)r=e[0],1 in e&&(i=e[1]);else throw l5();o=r*i;break;case"number":if(e<0&&(o=e,e=-e),e%1==0)r=e;else if(e>0){for(e>=1&&(c=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=c);h<=1e7&&f<=1e7;){if(e===(n=(d+p)/(h+f))){h+f<=1e7?(r=d+p,i=h+f):f>h?(r=p,i=f):(r=d,i=h);break}e>n?(d+=p,h+=f):(p+=d,f+=h),h>1e7?(r=p,i=f):(r=d,i=h)}r*=c}else(isNaN(e)||isNaN(t))&&(i=r=NaN);break;case"string":if(null===(h=e.match(/\d+|./g)))throw l5();if("-"===h[d]?(o=-1,d++):"+"===h[d]&&d++,h.length===d+1?s=lZ(h[d++],o):"."===h[d+1]||"."===h[d]?("."!==h[d]&&(a=lZ(h[d++],o)),(++d+1===h.length||"("===h[d+1]&&")"===h[d+3]||"'"===h[d+1]&&"'"===h[d+3])&&(s=lZ(h[d],o),u=Math.pow(10,h[d].length),d++),("("===h[d]&&")"===h[d+2]||"'"===h[d]&&"'"===h[d+2])&&(l=lZ(h[d+1],o),c=Math.pow(10,h[d+1].length)-1,d+=3)):"/"===h[d+1]||":"===h[d+1]?(s=lZ(h[d],o),u=lZ(h[d+2],1),d+=3):"/"===h[d+3]&&" "===h[d+1]&&(a=lZ(h[d],o),s=lZ(h[d+2],o),u=lZ(h[d+4],1),d+=5),h.length<=d){o=r=l+(i=u*c)*a+c*s;break}default:throw l5()}if(0===i)throw l2();lX.s=o<0?-1:1,lX.n=Math.abs(r),lX.d=Math.abs(i)};function l0(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function l1(e,t){if(lJ(e,t),!(this instanceof l1))return lK(lX.s*lX.n,lX.d);e=l0(lX.d,lX.n),this.s=lX.s,this.n=lX.n/e,this.d=lX.d/e}var l2=function(){return Error("Division by Zero")},l5=function(){return Error("Invalid argument")},l4=function(){return Error("Parameters must be integer")};l1.prototype={s:1,n:0,d:1,abs:function(){return lK(this.n,this.d)},neg:function(){return lK(-this.s*this.n,this.d)},add:function(e,t){return lJ(e,t),lK(this.s*this.n*lX.d+lX.s*this.d*lX.n,this.d*lX.d)},sub:function(e,t){return lJ(e,t),lK(this.s*this.n*lX.d-lX.s*this.d*lX.n,this.d*lX.d)},mul:function(e,t){return lJ(e,t),lK(this.s*lX.s*this.n*lX.n,this.d*lX.d)},div:function(e,t){return lJ(e,t),lK(this.s*lX.s*this.n*lX.d,this.d*lX.n)},clone:function(){return lK(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new l1(NaN);if(void 0===e)return lK(this.s*this.n%this.d,1);if(lJ(e,t),0===lX.n&&0===this.d)throw l2();return lK(this.s*(lX.d*this.n)%(lX.n*this.d),lX.d*this.d)},gcd:function(e,t){return lJ(e,t),lK(l0(lX.n,this.n)*l0(lX.d,this.d),lX.d*this.d)},lcm:function(e,t){return(lJ(e,t),0===lX.n&&0===this.n)?lK(0,1):lK(lX.n*this.n,l0(lX.n,this.n)*l0(lX.d,this.d))},ceil:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new l1(NaN):lK(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 l1(NaN):lK(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 l1(NaN):lK(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return lJ(e,t),lK(this.s*Math.round(this.n*lX.d/(this.d*lX.n))*lX.n,lX.d)},inverse:function(){return lK(this.s*this.d,this.n)},pow:function(e,t){if(lJ(e,t),1===lX.d)if(lX.s<0)return lK(Math.pow(this.s*this.d,lX.n),Math.pow(this.n,lX.n));else return lK(Math.pow(this.s*this.n,lX.n),Math.pow(this.d,lX.n));if(this.s<0)return null;var n=lQ(this.n),r=lQ(this.d),i=1,o=1;for(var a in n)if("1"!==a){if("0"===a){i=0;break}if(n[a]*=lX.n,n[a]%lX.d!=0)return null;n[a]/=lX.d,i*=Math.pow(a,n[a])}for(var a in r)if("1"!==a){if(r[a]*=lX.n,r[a]%lX.d!=0)return null;r[a]/=lX.d,o*=Math.pow(a,r[a])}return lX.s<0?lK(o,i):lK(i,o)},equals:function(e,t){return lJ(e,t),this.s*this.n*lX.d==lX.s*lX.n*this.d},compare:function(e,t){lJ(e,t);var n=this.s*this.n*lX.d-lX.s*lX.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(),r=1;r<n.length;r++){for(var i=lK(n[r-1],1),o=r-2;o>=0;o--)i=i.inverse().add(n[o]);if(Math.abs(i.sub(t).valueOf())<e)return i.mul(this.s)}return this},divisible:function(e,t){return lJ(e,t),!(!(lX.n*this.d)||this.n*lX.d%(lX.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,n="",r=this.n,i=this.d;return this.s<0&&(n+="-"),1===i?n+=r:(e&&(t=Math.floor(r/i))>0&&(n+=t,n+=" ",r%=i),n+=r,n+="/",n+=i),n},toLatex:function(e){var t,n="",r=this.n,i=this.d;return this.s<0&&(n+="-"),1===i?n+=r:(e&&(t=Math.floor(r/i))>0&&(n+=t,r%=i),n+="\\frac{",n+=r,n+="}{",n+=i,n+="}"),n},toContinued:function(){var e,t=this.n,n=this.d,r=[];if(isNaN(t)||isNaN(n))return r;do r.push(Math.floor(t/n)),e=t%n,t=n,n=e;while(1!==t);return r},toString:function(e){var t=this.n,n=this.d;if(isNaN(t)||isNaN(n))return"NaN";e=e||15;var r=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),i=function(e,t){for(var n=1,r=function(e,t,n){for(var r=1;t>0;e=e*e%n,t>>=1)1&t&&(r=r*e%n);return r}(10,t,e),i=0;i<300;i++){if(n===r)return i;n=10*n%e,r=10*r%e}return 0}(n,r),o=this.s<0?"-":"";if(o+=t/n|0,t%=n,(t*=10)&&(o+="."),r){for(var a=i;a--;)o+=t/n|0,t%=n,t*=10;o+="(";for(var a=r;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 l3=aI("Fraction",[],()=>(l1.prototype.type="Fraction",l1.prototype.isFraction=!0,l1.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},l1.fromJSON=function(e){return new l1(e)},l1),{isClass:!0}),l6=n(42915);function l8(e,t){return!!e&&"object"==typeof e&&(!!ak(l7,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function l9(e){return"object"==typeof e&&e&&e.constructor===Object}var l7={length:!0,name:!0},ue={toString:!0,valueOf:!0,toLocaleString:!0};class ut{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){var t,n,r=this.wrappedObject;if(l9(r)&&l8(r,e))return r[e];if("function"==typeof r[e]&&(t=r,n=e,!(null==t||"function"!=typeof t[n]||ak(t,n)&&Object.getPrototypeOf&&n in Object.getPrototypeOf(t))&&(ak(ue,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(l9(e)&&l8(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 un(e){return!!e&&(e instanceof Map||e instanceof ut||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}var ur=function(){return ur=l6.create,l6};function ui(e){throw Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function uo(e){throw Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function ua(e){throw Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var us={BigNumberDependencies:lB,ComplexDependencies:{createComplexClass:lY},DenseMatrixDependencies:lF,FractionDependencies:{createFractionClass:l3},createTyped:aI("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],function(e){var{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:i}=e,o=ur();return o.types=[{name:"number",test:oq},{name:"Complex",test:oX},{name:"BigNumber",test:oY},{name:"Fraction",test:oZ},{name:"Unit",test:oK},{name:"string",test:oQ},{name:"Chain",test:ab},{name:"Array",test:oJ},{name:"Matrix",test:o0},{name:"DenseMatrix",test:o2},{name:"SparseMatrix",test:o5},{name:"Range",test:o4},{name:"Index",test:o3},{name:"boolean",test:o6},{name:"ResultSet",test:o8},{name:"Help",test:o9},{name:"function",test:o7},{name:"Date",test:ae},{name:"RegExp",test:at},{name:"null",test:ar},{name:"undefined",test:ai},{name:"AccessorNode",test:ao},{name:"ArrayNode",test:aa},{name:"AssignmentNode",test:as},{name:"BlockNode",test:al},{name:"ConditionalNode",test:au},{name:"ConstantNode",test:ac},{name:"FunctionNode",test:ah},{name:"FunctionAssignmentNode",test:ad},{name:"IndexNode",test:ap},{name:"Node",test:af},{name:"ObjectNode",test:ag},{name:"OperatorNode",test:am},{name:"ParenthesisNode",test:av},{name:"RangeNode",test:ay},{name:"SymbolNode",test:ax},{name:"Map",test:un},{name:"Object",test:an}],o.conversions=[{from:"number",to:"BigNumber",convert:function(e){if(t||ui(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||uo(e),new n(e,0)}},{from:"number",to:"string",convert:function(e){return e+""}},{from:"BigNumber",to:"Complex",convert:function(e){return n||uo(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||uo(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||ua(e);var t=new i(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||ui(e);try{return new t(e)}catch(t){throw Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){i||ua(e);try{return new i(e)}catch(t){throw Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){n||uo(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||ui(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||ua(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return r||function(){throw Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}],o})},ul="equalScalar",uu=aI(ul,["typed","config"],e=>{var{typed:t,config:n}=e;return t(ul,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return aV(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 r=e.minus(t).abs();if(r.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return r.lte(i.times(n))}return!1}(e,t,n.epsilon)},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){var r;return r=n.epsilon,aV(e.re,t.re,r)&&aV(e.im,t.im,r)},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw Error("Cannot compare units with different base");return this(e.value,t.value)}})});aI(ul,["typed","config"],e=>{var{typed:t,config:n}=e;return t(ul,{"number, number":function(e,t){return aV(e,t,n.epsilon)}})});var uc={typedDependencies:us,createEqualScalar:uu},ud=aI("SparseMatrix",["typed","equalScalar","Matrix"],e=>{var{typed:t,equalScalar:n,Matrix:r}=e;function i(e,t){if(!(this instanceof i))throw SyntaxError("Constructor must be called with the new operator");if(t&&!oQ(t))throw Error("Invalid datatype: "+t);if(o0(e)){var n,r,a;n=this,r=e,a=t,"SparseMatrix"===r.type?(n._values=r._values?aS(r._values):void 0,n._index=aS(r._index),n._ptr=aS(r._ptr),n._size=aS(r._size),n._datatype=a||r._datatype):o(n,r.valueOf(),a||r._datatype)}else if(e&&oJ(e.index)&&oJ(e.ptr)&&oJ(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(oJ(e))o(this,e,t);else if(e)throw TypeError("Unsupported type of data ("+aw(e)+")");else this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}function o(e,r,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;var o=r.length,a=0,s=n,l=0;if(oQ(i)&&(s=t.find(n,[i,i])||n,l=t.convert(0,i)),o>0){var u=0;do{e._ptr.push(e._index.length);for(var c=0;c<o;c++){var d=r[c];if(oJ(d)){if(0===u&&a<d.length&&(a=d.length),u<d.length){var h=d[u];s(h,l)||(e._values.push(h),e._index.push(c))}}else 0===u&&a<1&&(a=1),s(d,l)||(e._values.push(d),e._index.push(c))}u++}while(u<a)}e._ptr.push(e._index.length),e._size=[o,a]}function a(e,t,n,r){if(n-t==0)return n;for(var i=t;i<n;i++)if(r[i]===e)return i;return t}function s(e,t,n,r,i,o,a){i.splice(e,0,r),o.splice(e,0,t);for(var s=n+1;s<a.length;s++)a[s]++}function l(e,r,i,o){var a,s,l,u=o||0,c=n,d=0;oQ(e._datatype)&&(c=t.find(n,[e._datatype,e._datatype])||n,d=t.convert(0,e._datatype),u=t.convert(u,e._datatype));var h=!c(u,d),p=e._size[0],f=e._size[1];if(i>f){for(s=f;s<i;s++)if(e._ptr[s]=e._values.length,h)for(a=0;a<p;a++)e._values.push(u),e._index.push(a);e._ptr[i]=e._values.length}else i<f&&(e._ptr.splice(i+1,f-i),e._values.splice(e._ptr[i],e._values.length),e._index.splice(e._ptr[i],e._index.length));if(f=i,r>p){if(h){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<r;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(r<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])>r-1&&(e._values.splice(l,1),e._index.splice(l,1),v++)}e._ptr[s]=e._values.length}return e._size[0]=r,e._size[1]=i,e}function u(e,t,n,r,i){var o,a,s=r[0],l=r[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],d=n[a+1],h=c;h<d;h++)u[o=t[h]][a]=e?i?aS(e[h]):e[h]:1;return u}return i.prototype=new r,i.prototype.createSparseMatrix=function(e,t){return new i(e,t)},i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return a0(this._values,aw)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(e,t){return new i(e,t)},i.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},i.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(!o3(t))throw TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var n,r,o,a,s=t.size();if(s.length!==e._size.length)throw new aG(s.length,e._size.length);var l=t.min(),u=t.max();for(n=0,r=e._size.length;n<r;n++)aX(l[n],e._size[n]),aX(u[n],e._size[n]);var c=e._values,d=e._index,h=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=h[e],a=h[e+1];o<a;o++)!0===g[n=d[o]]&&(y.push(m[n]),v&&v.push(c[o]))}),x.push(y.length),new i({values:v,index:y,ptr:x,size:s,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,n,r){if(!t||!0!==t.isIndex)throw TypeError("Invalid index");var i,o=t.size(),a=t.isScalar();if(o0(n)?(i=n.size(),n=n.toArray()):i=aq(n),a){if(0!==i.length)throw TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(1!==o.length&&2!==o.length)throw new aG(o.length,e._size.length,"<");if(i.length<o.length){for(var s=0,l=0;1===o[s]&&1===i[s];)s++;for(;1===o[s];)l++,s++;n=aJ(n,o.length,l,i)}if(!aC(o,i))throw new aG(o,i,">");if(1===o.length)t.dimension(0).forEach(function(t,i){aX(t),e.set([t,0],n[i[0]],r)});else{var u=t.dimension(0),c=t.dimension(1);u.forEach(function(t,i){aX(t),c.forEach(function(o,a){aX(o),e.set([t,o],n[i[0]][a[0]],r)})})}}return e}(this,e,t,n);default:throw SyntaxError("Wrong number of arguments")}},i.prototype.get=function(e){if(!oJ(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new aG(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];aX(t,this._size[0]),aX(n,this._size[1]);var r=a(t,this._ptr[n],this._ptr[n+1],this._index);return r<this._ptr[n+1]&&this._index[r]===t?this._values[r]:0},i.prototype.set=function(e,r,i){if(!oJ(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new aG(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],d=this._size[1],h=n,p=0;oQ(this._datatype)&&(h=t.find(n,[this._datatype,this._datatype])||n,p=t.convert(0,this._datatype)),(o>c-1||u>d-1)&&(l(this,Math.max(o+1,c),Math.max(u+1,d),i),c=this._size[0],d=this._size[1]),aX(o,c),aX(u,d);var f=a(o,this._ptr[u],this._ptr[u+1],this._index);return f<this._ptr[u+1]&&this._index[f]===o?h(r,p)?function(e,t,n,r,i){n.splice(e,1),r.splice(e,1);for(var o=t+1;o<i.length;o++)i[o]--}(f,u,this._values,this._index,this._ptr):this._values[f]=r:s(f,o,u,r,this._values,this._index,this._ptr),this},i.prototype.resize=function(e,t,n){if(!o1(e))throw TypeError("Array or Matrix expected");var r=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);if(2!==r.length)throw Error("Only two dimensions matrix are supported");return r.forEach(function(e){if(!oq(e)||!aR(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+aW(r)+")")}),l(n?this.clone():this,r[0],r[1],t)},i.prototype.reshape=function(e,t){if(!oJ(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(!oq(t)||!aR(t)||t<=-2||0===t)throw TypeError("Invalid size, must contain positive integers or -1 (size: "+aW(e)+")")});var n=this._size[0]*this._size[1],r=(e=aK(e,n))[0]*e[1];if(n!==r)throw Error("Reshaping sparse matrix will result in the wrong number of elements");var i=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return i;for(var o=[],l=0;l<i._ptr.length;l++)for(var u=0;u<i._ptr[l+1]-i._ptr[l];u++)o.push(l);for(var c=i._values.slice(),d=i._index.slice(),h=0;h<i._index.length;h++){var p=d[h],f=o[h],g=p*i._size[1]+f;o[h]=g%e[1],d[h]=Math.floor(g/e[1])}i._values.length=0,i._index.length=0,i._ptr.length=e[1]+1,i._size=e.slice();for(var m=0;m<i._ptr.length;m++)i._ptr[m]=0;for(var v=0;v<c.length;v++){var y=d[v],x=o[v],b=c[v];s(a(y,i._ptr[x],i._ptr[x+1],i._index),y,x,b,i._values,i._index,i._ptr)}return i},i.prototype.clone=function(){return new i({values:this._values?aS(this._values):void 0,index:aS(this._index),ptr:aS(this._ptr),size:aS(this._size),datatype:this._datatype})},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(e,r){if(!this._values)throw Error("Cannot invoke map on a Pattern only matrix");var o=this;return function(e,r,o,a,s){var l=[],u=[],c=[],d=n,h=0;oQ(e._datatype)&&(d=t.find(n,[e._datatype,e._datatype])||n,h=t.convert(0,e._datatype));for(var p=function(e,t,n){e=a(e,t,n),d(e,h)||(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<=r&&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<=r;w++)p(w in x?x[w]:0,w-0,f-0)}}return c.push(l.length),new i({values:l,index:u,ptr:c,size:[r-0+1,o-0+1]})}(this,this._size[0]-1,this._size[1]-1,function(t,n,r){return e(t,[n,r],o)},r)},i.prototype.forEach=function(e,t){if(!this._values)throw Error("Cannot invoke forEach on a Pattern only matrix");for(var n=this._size[0],r=this._size[1],i=0;i<r;i++){var o=this._ptr[i],a=this._ptr[i+1];if(t)for(var s=o;s<a;s++){var l=this._index[s];e(this._values[s],[l,i],this)}else{for(var u={},c=o;c<a;c++)u[this._index[c]]=this._values[c];for(var d=0;d<n;d++)e(d in u?u[d]:0,[d,i],this)}}},i.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],r=this._ptr[t+1],i=n;i<r;i++){var o=this._index[i];yield{value:this._values[i],index:[o,t]}}},i.prototype.toArray=function(){return u(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return u(this._values,this._index,this._ptr,this._size,!1)},i.prototype.format=function(e){for(var t=this._size[0],n=this._size[1],r=this.density(),i="Sparse Matrix ["+aW(t,e)+" x "+aW(n,e)+"] density: "+aW(r,e)+"\n",o=0;o<n;o++)for(var a=this._ptr[o],s=this._ptr[o+1],l=a;l<s;l++)i+="\n ("+aW(this._index[l],e)+", "+aW(o,e)+") ==> "+(this._values?aW(this._values[l],e):"X");return i},i.prototype.toString=function(){return aW(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(e){if(e){if(oY(e)&&(e=e.toNumber()),!oq(e)||!aR(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,r=this._size[0],o=this._size[1],a=Math.min(r-n,o-t),s=[],l=[],u=[];u[0]=0;for(var c=t;c<o&&s.length<a;c++)for(var d=this._ptr[c],h=this._ptr[c+1],p=d;p<h;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 i({values:s,index:l,ptr:u,size:[a,1]})},i.fromJSON=function(e){return new i(e)},i.diagonal=function(e,r,o,a,s){if(!oJ(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(oY(e)&&(e=e.toNumber()),!oq(e)||!aR(e)||e<1)throw Error("Size values must be positive integers");return e}),o){if(oY(o)&&(o=o.toNumber()),!oq(o)||!aR(o))throw TypeError("The parameter k must be an integer number")}else o=0;var l,u=n,c=0;oQ(s)&&(u=t.find(n,[s,s])||n,c=t.convert(0,s));var d=o>0?o:0,h=o<0?-o:0,p=e[0],f=e[1],g=Math.min(p-h,f-d);if(oJ(r)){if(r.length!==g)throw Error("Invalid value array length");l=function(e){return r[e]}}else if(o0(r)){var m=r.size();if(1!==m.length||m[0]!==g)throw Error("Invalid matrix length");l=function(e){return r.get([e])}}else l=function(){return r};for(var v=[],y=[],x=[],b=0;b<f;b++){x.push(v.length);var w=b-d;if(w>=0&&w<g){var S=l(w);u(S,c)||(y.push(w+h),v.push(S))}}return x.push(v.length),new i({values:v,index:y,ptr:x,size:[p,f]})},i.prototype.swapRows=function(e,t){if(!oq(e)||!aR(e)||!oq(t)||!aR(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return aX(e,this._size[0]),aX(t,this._size[0]),i._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(e,t,n,r,i){for(var o=r[e],a=r[e+1],s=o;s<a;s++)i(n[s],t[s])},i._swapRows=function(e,t,n,r,i,o){for(var s=0;s<n;s++){var l=o[s],u=o[s+1],c=a(e,l,u,i),d=a(t,l,u,i);if(c<u&&d<u&&i[c]===e&&i[d]===t){if(r){var h=r[c];r[c]=r[d],r[d]=h}continue}if(c<u&&i[c]===e&&(d>=u||i[d]!==t)){var p=r?r[c]:void 0;i.splice(d,0,t),r&&r.splice(d,0,p),i.splice(d<=c?c+1:c,1),r&&r.splice(d<=c?c+1:c,1);continue}if(d<u&&i[d]===t&&(c>=u||i[c]!==e)){var f=r?r[d]:void 0;i.splice(c,0,e),r&&r.splice(c,0,f),i.splice(c<=d?d+1:d,1),r&&r.splice(c<=d?d+1:d,1)}}},i},{isClass:!0}),uh="matrix",up={DenseMatrixDependencies:lF,MatrixDependencies:lz,SparseMatrixDependencies:{MatrixDependencies:lz,equalScalarDependencies:uc,typedDependencies:us,createSparseMatrixClass:ud},typedDependencies:us,createMatrix:aI(uh,["typed","Matrix","DenseMatrix","SparseMatrix"],e=>{var{typed:t,Matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(uh,{"":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 r(e,n);if("sparse"===t)return new i(e,n);throw TypeError("Unknown matrix type "+JSON.stringify(t)+".")}})},uf="zeros",ug=aI(uf,["typed","config","matrix","BigNumber"],e=>{var{typed:t,config:n,matrix:r,BigNumber:i}=e;return t(uf,{"":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,r){oY(e)&&(n=!0,r[t]=e.toNumber())}),n)?new i(0):0;if(e.forEach(function(e){if("number"!=typeof e||!aR(e)||e<0)throw Error("Parameters in function zeros must be positive integers")}),t){var a=r(t);return e.length>0?a.resize(e,o):a}var s=[];return e.length>0?aZ(s,e,o):s}}),um=aI("algorithm11",["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i,o){var a,s=e._values,l=e._index,u=e._ptr,c=e._size,d=e._datatype;if(!s)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=c[0],p=c[1],f=n,g=0,m=i;"string"==typeof d&&(a=d,f=t.find(n,[a,a]),g=t.convert(0,a),r=t.convert(r,a),m=t.find(i,[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],A=w;A<S;A++){var C=l[A],M=o?m(r,s[A]):m(s[A],r);f(M,g)||(y.push(C),v.push(M))}}return x[p]=y.length,e.createSparseMatrix({values:v,index:y,ptr:x,size:[h,p],datatype:a})}}),uv=aI("algorithm12",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:n}=e;return function(e,r,i,o){var a,s=e._values,l=e._index,u=e._ptr,c=e._size,d=e._datatype;if(!s)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=c[0],p=c[1],f=i;"string"==typeof d&&(a=d,r=t.convert(r,a),f=t.find(i,[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 A=l[S];m[A]=s[S],v[A]=x}for(var C=0;C<h;C++)0===y&&(g[C]=[]),v[C]===x?g[C][y]=o?f(r,m[C]):f(m[C],r):g[C][y]=o?f(r,0):f(0,r)}return new n({data:g,size:[h,p],datatype:a})}}),uy=aI("algorithm14",["typed"],e=>{var{typed:t}=e;return function(e,n,r,i){var o,a=e._data,s=e._size,l=e._datatype,u=r;"string"==typeof l&&(o=l,n=t.convert(n,o),u=t.find(r,[o,o]));var c=s.length>0?function e(t,n,r,i,o,a,s){var l=[];if(n===r.length-1)for(var u=0;u<i;u++)l[u]=s?t(a,o[u]):t(o[u],a);else for(var c=0;c<i;c++)l[c]=e(t,n+1,r,r[n+1],o[c],a,s);return l}(u,0,s,s[0],a,n,i):[];return e.createDenseMatrix({data:c,size:aS(s),datatype:o})}});function ux(e,t){var n;if(!aR(e)||!aR(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 ub(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!aR(t)||t<0||t>15)throw Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(aN(e,t))}ux.signature="number, number";var uw="Number of decimals in function round must be an integer",uS="round",uA=aI(uS,["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],e=>{var{typed:t,matrix:n,equalScalar:r,zeros:i,BigNumber:o,DenseMatrix:a}=e,s=um({typed:t,equalScalar:r}),l=uv({typed:t,DenseMatrix:a}),u=uy({typed:t});return t(uS,{number:ub,"number, number":ub,"number, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(uw);return new o(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw TypeError(uw);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(uw);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(uw);return e.toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw TypeError(uw);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(uw);return e.round(t.toNumber())},"Array | Matrix":function(e){return function e(t,n,r){return t&&"function"==typeof t.map?t.map(function(t){return e(t,n,r)}):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 r(e,0)?i(t.size(),t.storage()):l(t,e,this,!0)},"number | Complex | BigNumber | Fraction, DenseMatrix":function(e,t){return r(e,0)?i(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()}})}),uC=aI("algorithm01",["typed"],e=>{var{typed:t}=e;return function(e,n,r,i){var o,a,s=e._data,l=e._size,u=e._datatype,c=n._values,d=n._index,h=n._ptr,p=n._size,f=n._datatype;if(l.length!==p.length)throw new aG(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(r,[v,v]):r,x=[];for(o=0;o<g;o++)x[o]=[];var b=[],w=[];for(a=0;a<m;a++){for(var S=a+1,A=h[a],C=h[a+1],M=A;M<C;M++)b[o=d[M]]=i?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})}}),uM=aI("algorithm04",["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i){var o,a,s,l,u,c,d=e._values,h=e._index,p=e._ptr,f=e._size,g=e._datatype,m=r._values,v=r._index,y=r._ptr,x=r._size,b=r._datatype;if(f.length!==x.length)throw new aG(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],A=n,C=0,M=i;"string"==typeof g&&g===b&&(o=g,A=t.find(n,[o,o]),C=t.convert(0,o),M=t.find(i,[o,o]));var k=d&&m?[]:void 0,T=[],_=[],I=d&&m?[]:void 0,D=d&&m?[]:void 0,O=[],R=[];for(s=0;s<S;s++){_[s]=T.length;var E=s+1;for(u=p[s],c=p[s+1],l=u;l<c;l++)a=h[l],T.push(a),O[a]=E,I&&(I[a]=d[l]);for(u=y[s],c=y[s+1],l=u;l<c;l++)if(O[a=v[l]]===E){if(I){var P=M(I[a],m[l]);A(P,C)?O[a]=null:I[a]=P}}else T.push(a),R[a]=E,D&&(D[a]=m[l]);if(I&&D)for(l=_[s];l<T.length;)O[a=T[l]]===E?(k[l]=I[a],l++):R[a]===E?(k[l]=D[a],l++):T.splice(l,1)}return _[S]=T.length,e.createSparseMatrix({values:k,index:T,ptr:_,size:[w,S],datatype:o})}}),uk=aI("algorithm10",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:n}=e;return function(e,r,i,o){var a,s=e._values,l=e._index,u=e._ptr,c=e._size,d=e._datatype;if(!s)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=c[0],p=c[1],f=i;"string"==typeof d&&(a=d,r=t.convert(r,a),f=t.find(i,[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 A=l[S];m[A]=s[S],v[A]=x}for(var C=0;C<h;C++)0===y&&(g[C]=[]),v[C]===x?g[C][y]=o?f(r,m[C]):f(m[C],r):g[C][y]=r}return new n({data:g,size:[h,p],datatype:a})}}),uT=aI("algorithm13",["typed"],e=>{var{typed:t}=e;return function(e,n,r){var i,o=e._data,a=e._size,s=e._datatype,l=n._data,u=n._size,c=n._datatype,d=[];if(a.length!==u.length)throw new aG(a.length,u.length);for(var h=0;h<a.length;h++){if(a[h]!==u[h])throw RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+u+")");d[h]=a[h]}var p=r;"string"==typeof s&&s===c&&(i=s,p=t.find(r,[i,i]));var f=d.length>0?function e(t,n,r,i,o,a){var s=[];if(n===r.length-1)for(var l=0;l<i;l++)s[l]=t(o[l],a[l]);else for(var u=0;u<i;u++)s[u]=e(t,n+1,r,r[n+1],o[u],a[u]);return s}(p,0,d,d[0],o,l):[];return e.createDenseMatrix({data:f,size:d,datatype:i})}}),u_=aI("gcd",["typed","matrix","equalScalar","BigNumber","DenseMatrix"],e=>{var{typed:t,matrix:n,equalScalar:r,BigNumber:i,DenseMatrix:o}=e,a=uC({typed:t}),s=uM({typed:t,equalScalar:r}),l=uk({typed:t,DenseMatrix:o}),u=uT({typed:t}),c=uy({typed:t});return t("gcd",{"number, number":ux,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw Error("Parameters in function gcd must be integer numbers");for(var n=new i(0);!t.isZero();){var r=e.mod(t);e=t,t=r}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 r=this(e,t),i=0;i<n.length;i++)r=this(r,n[i]);return r}})});let{round:uI}=a8({roundDependencies:{BigNumberDependencies:lB,DenseMatrixDependencies:lF,equalScalarDependencies:uc,matrixDependencies:up,typedDependencies:us,zerosDependencies:{BigNumberDependencies:lB,matrixDependencies:up,typedDependencies:us,createZeros:ug},createRound:uA}}),{gcd:uD}=a8({gcdDependencies:{BigNumberDependencies:lB,DenseMatrixDependencies:lF,equalScalarDependencies:uc,matrixDependencies:up,typedDependencies:us,createGcd:u_}}),uO=10;function uR(e,t){let n=t.startMs,r=e.values,i=[];for(let e of r){for(;n<e[0];)i.push([n,null]),n+=t.stepMs;i.push([n,e[1]]),n+=t.stepMs}for(;n<=t.endMs;)i.push([n,null]),n+=t.stepMs;return i}function uE(e){let t,n,r=[];for(let t of e)if(t&&"timeRange"in t){if(void 0===t||void 0===t.timeRange||void 0===t.stepMs)continue;if(r.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 r=t.values[e];if(void 0===r)continue;let[i]=r,o=new Date(i),a=new Date(i);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(),r=n.end.valueOf(),i=r-e;return{startMs:e,endMs:r,rangeMs:i,stepMs:uO}}if(void 0===n)return;if(1===r.length)t=r[0];else{let e=uD(...r);t=e<uO?uO:e}let i=n.start.valueOf(),o=n.end.valueOf();return{startMs:i,endMs:o,stepMs:t,rangeMs:o-i}}function uP(e){return/^[0-9a-fA-F]+$/.test(e)}function uL(e){return e.spec?.spec?.display?.name?e.spec.spec.display.name:e.spec?.display?.name?e.spec.display.name:e.metadata.name}function uN(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 uB=(0,I.createContext)(void 0);function uz(e){let{children:t,timeZone:n}=e;return(0,_.jsx)(uB.Provider,{value:n,children:t})}function uF(){let e=(0,I.useContext)(uB);return{timeZone:e??"local",formatWithUserTimeZone:(t,n)=>ok(t,n,e),dateFormatOptionsWithUserTimeZone:t=>oM(t,e)}}function uj({label:e,color:t,size:n="small",onColorChange:r,onClear:i}){let[o,a]=(0,I.useState)(null),s=!!o,{thresholds:{defaultColor:l,palette:u}}=e9();return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(uV,{size:n,"aria-label":`change ${e} color`,isSelected:s,iconColor:t,onClick:e=>{a(e.currentTarget)},children:(0,_.jsx)(eM,{})}),(0,_.jsx)(e4.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,_.jsx)(e2,{color:t,palette:[l,...u],onChange:r,onClear:i})})]})}let uV=(0,N.A)(eA,{shouldForwardProp:e=>"isSelected"!==e&&"iconColor"!==e})(({iconColor:e,isSelected:t})=>({backgroundColor:t&&e?`${e}3F`:"undefined",color:e}));var uH=n(56599),u$=n(69722),uW=n(92927),uG=n(20523),uU=n(26041),uq=n(71027),uY=n(74626),uX=n(93724);let uZ=(0,j.A)("MuiBox",["root"]),uK=(0,uY.A)(),uQ=function(e={}){let{themeId:t,defaultTheme:n,defaultClassName:r="MuiBox-root",generateClassName:i}=e,o=(0,u$.Ay)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(uW.A);return I.forwardRef(function(e,a){let s=(0,uU.A)(n),{className:l,component:u="div",...c}=(0,uG.A)(e);return(0,_.jsx)(o,{as:u,ref:a,className:(0,O.A)(l,i?i(r):r),theme:t&&s[t]||s,...c})})}({themeId:uX.A,defaultTheme:uK,defaultClassName:uZ.root,generateClassName:uq.A.generate});var uJ=n(43945);function u0(e,t){return"ALL"!==t&&!!t[e.id]}var u1=n(54382),u2=n(29424),u5=n(67214);function u4(e){return(0,V.Ay)("MuiListItemButton",e)}let u3=(0,j.A)("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),u6=(0,N.A)(K.A,{shouldForwardProp:e=>(0,Z.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,B.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"}},[`&.${u3.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,E.X4)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${u3.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,E.X4)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${u3.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,E.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,E.X4)(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${u3.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${u3.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}}]}))),u8=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiListItemButton"}),{alignItems:r="center",autoFocus:i=!1,component:o="div",children:a,dense:s=!1,disableGutters:l=!1,divider:u=!1,focusVisibleClassName:c,selected:d=!1,className:h,...p}=n,f=I.useContext(u5.A),g=I.useMemo(()=>({dense:s||f.dense||!1,alignItems:r,disableGutters:l}),[r,f.dense,s,l]),m=I.useRef(null);(0,u1.A)(()=>{i&&m.current&&m.current.focus()},[i]);let v={...n,alignItems:r,dense:g.dense,disableGutters:l,divider:u,selected:d},y=(e=>{let{alignItems:t,classes:n,dense:r,disabled:i,disableGutters:o,divider:a,selected:s}=e,l=(0,R.A)({root:["root",r&&"dense",!o&&"gutters",a&&"divider",i&&"disabled","flex-start"===t&&"alignItemsFlexStart",s&&"selected"]},u4,n);return{...n,...l}})(v),x=(0,u2.A)(m,t);return(0,_.jsx)(u5.A.Provider,{value:g,children:(0,_.jsx)(u6,{ref:x,href:p.href||p.to,component:(p.href||p.to)&&"div"===o?"button":o,focusVisibleClassName:(0,O.A)(y.focusVisible,c),ownerState:v,className:(0,O.A)(y.root,h),...p,classes:y,children:a})})});var u9=n(47599),u7=n(88091);function ce(e){return(0,V.Ay)("MuiListItemText",e)}let ct=(0,j.A)("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);var cn=n(73397);let cr=(0,N.A)("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${ct.primary}`]:t.primary},{[`& .${ct.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${u9.A.root}:where(& .${ct.primary})`]:{display:"block"},[`.${u9.A.root}:where(& .${ct.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),ci=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiListItemText"}),{children:r,className:i,disableTypography:o=!1,inset:a=!1,primary:s,primaryTypographyProps:l,secondary:u,secondaryTypographyProps:c,slots:d={},slotProps:h={},...p}=n,{dense:f}=I.useContext(u5.A),g=null!=s?s:r,m=u,v={...n,disableTypography:o,inset:a,primary:!!g,secondary:!!m,dense:f},y=(e=>{let{classes:t,inset:n,primary:r,secondary:i,dense:o}=e;return(0,R.A)({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},ce,t)})(v),x={slots:d,slotProps:{primary:l,secondary:c,...h}},[b,w]=(0,cn.A)("root",{className:(0,O.A)(y.root,i),elementType:cr,externalForwardedProps:{...x,...p},ownerState:v,ref:t}),[S,A]=(0,cn.A)("primary",{className:y.primary,elementType:u7.A,externalForwardedProps:x,ownerState:v}),[C,M]=(0,cn.A)("secondary",{className:y.secondary,elementType:u7.A,externalForwardedProps:x,ownerState:v});return null==g||g.type===u7.A||o||(g=(0,_.jsx)(S,{variant:f?"body2":"body1",component:A?.variant?void 0:"span",...A,children:g})),null==m||m.type===u7.A||o||(m=(0,_.jsx)(C,{variant:"body2",color:"textSecondary",...M,children:m})),(0,_.jsxs)(b,{...w,children:[g,m]})}),co=(0,I.memo)(function({color:e,sx:t,...n}){return(0,_.jsx)(uQ,{...n,sx:iw({height:4,width:16,margin:e=>e.spacing(.5)},t),style:{backgroundColor:e}})}),ca=(0,I.forwardRef)(function({item:e,sx:t,truncateLabel:n,onClick:r,isVisuallySelected:i,onMouseOver:o,onMouseOut:a,index:s,...l},u){let[c,d]=(0,I.useState)(n);return(0,_.jsxs)(u8,{...l,role:"listitem",sx:iw({padding:0,cursor:"pointer"},t),dense:!0,onClick:t=>{r(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:i,ref:u,children:[(0,_.jsx)(uQ,{sx:{display:"flex",alignItems:"center"},children:(0,_.jsx)(co,{color:e.color})}),(0,_.jsx)(ci,{primary:e.label,primaryTypographyProps:{noWrap:c},onMouseOver:function(){n&&d(!1)},onMouseOut:function(){n&&d(!0)}})]})}),cs=(0,I.memo)(ca);function cl({height:e,items:t,selectedItems:n,onLegendItemClick:r,onItemMouseOver:i,onItemMouseOut:o}){return(0,_.jsx)(uQ,{component:"ul",sx:{width:"100%",height:e,padding:[0,1,0,0],overflowY:"scroll",margin:0},children:t.map((e,t)=>(0,_.jsx)(cs,{item:e,index:t,isVisuallySelected:u0(e,n),onMouseOver:i,onMouseOut:o,onClick:r,sx:{width:"auto",float:"left",paddingRight:1.5}},e.id))})}function cu(e){e()}function cc(e,t){return n=>e(t(n))}function cd(e){return void 0!==e}function ch(){}function cp(e,t){return t(e)}function cf(...e){return e}function cg(e){e(2)}function cm(e){return e(4)}function cv(e,t){return e(1,e=>t(0,e))}function cy(e,t){let n=e(1,e=>{n(),t(e)});return n}function cx(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function cb(e,t){return e===t}function cw(e=cb){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function cS(e){return t=>n=>{e(n)&&t(n)}}function cA(e){return t=>cc(t,e)}function cC(e){return t=>()=>{t(e)}}function cM(e,...t){let n=function(...e){return t=>e.reduceRight(cp,t)}(...t);return(t,r)=>{switch(t){case 2:cg(e);return;case 1:return e(1,n(r))}}}function ck(e,t){return n=>r=>{n(t=e(t,r))}}function cT(e){return t=>n=>{e>0?e--:t(n)}}function c_(e){let t=null,n;return r=>i=>{t=i,n||(n=setTimeout(()=>{n=void 0,r(t)},e))}}function cI(...e){let t=Array.from({length:e.length}),n=0,r=null,i=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!==i&&n===i&&r&&(r(),r=null)})}),e=>o=>{let a=()=>{e([o].concat(t))};n===i?a():r=a}}function cD(e){let t=e,n=cR();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function cO(e,t){var n;return n=cD(t),cv(e,n),n}function cR(){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 cE(e){var t;return t=cR(),cv(e,t),t}let cP={singleton:!0};function cL(e,t=[],n=cP){let{singleton:r}=n;return{constructor:e,dependencies:t,id:cN(),singleton:r}}let cN=()=>Symbol("id");function cB(...e){let t=cR(),n=Array.from({length:e.length}),r=0,i=2**e.length-1;return e.forEach((e,o)=>{let a=2**o;e(1,e=>{n[o]=e,(r|=a)===i&&t(0,n)})}),function(e,o){switch(e){case 2:return void cg(t);case 1:return r===i&&o(n),t(1,o)}}}function cz(e,t=cb){return cM(e,cw(t))}function cF(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(cu)}}(...e.map(e=>e(1,n)))}}}let cj=1,cV={0:"debug",3:"error",[cj]:"log",2:"warn"},cH=cL(()=>{let e=cD(3);return{log:cD((t,n,r=cj)=>{r>=((typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL??cm(e))&&console[cV[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0}),c$=new WeakMap;function cW(e){return"self"in e?e.document.documentElement:e}function cG(e){c$.delete(cW(e))}function cU(e,t){return!function(e){let t=cW(e),n=c$.get(t);if(void 0!==n)return n;let r="rtl"===t.ownerDocument.defaultView.getComputedStyle(t).direction;return c$.set(t,r),r}(e)?t:-t}function cq(e,t,n){return cY(e,t,n).callbackRef}function cY(e,t,n){let r=D().useRef(null),i=D().useMemo(()=>"u">typeof ResizeObserver?new ResizeObserver(t=>{let r=()=>{let n=t[0].target;null!==n.offsetParent&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return{callbackRef:e=>{e&&t?(i?.observe(e),r.current=e):(r.current&&i?.unobserve(r.current),r.current=null)},ref:r}}function cX(e,t,n,r,i,o,a,s,l){return cY(D().useCallback(n=>{let l,u=function(e,t,n,r){let i=e.length;if(0===i)return null;let o=[];for(let a=0;a<i;a++){let i=e.item(a);if(void 0===i.dataset.index)continue;let s=parseInt(i.dataset.index,10),l=parseFloat(i.dataset.knownSize),u=t(i,n);if(0===u&&r("Zero-sized element, this should not happen",{child:i},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",i),c=n.parentElement;for(;void 0===c.dataset.virtuosoScroller;)c=c.parentElement;let d=c.lastElementChild?.dataset.viewportType==="window";d&&(l=c.ownerDocument.defaultView);let h=a?s?a.scrollWidth:a.scrollHeight:d?s?l.document.documentElement.scrollWidth:l.document.documentElement.scrollHeight:s?c.scrollWidth:c.scrollHeight,p=a?s?a.offsetWidth:a.offsetHeight:d?s?l.innerWidth:l.innerHeight:s?c.offsetWidth:c.offsetHeight;r({scrollHeight:h,scrollTop:Math.max(a?s?cU(a,a.scrollLeft):a.scrollTop:d?s?cU(l,l.scrollX||l.document.documentElement.scrollLeft):l.scrollY||l.document.documentElement.scrollTop:s?cU(c,c.scrollLeft):c.scrollTop,0),viewportHeight:p}),o?.(s?cZ("column-gap",getComputedStyle(n).columnGap,i):cZ("row-gap",getComputedStyle(n).rowGap,i)),null!==u&&e(u)},[e,t,i,o,a,r,s]),n,l)}function cZ(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 cK(e,t,n){let r=D().useRef(null),i=D().useCallback(n=>{let i,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),i=n+t.scrollTop}else{let e=a.current.ownerDocument.defaultView;o=e.innerHeight-Math.max(0,s.top),i=s.top+e.scrollY}r.current={listHeight:s.height,offsetTop:i,visibleHeight:o,visibleWidth:l},e(r.current)},[e,t]),{callbackRef:o,ref:a}=cY(i,!0,n),s=D().useCallback(()=>{i(a.current)},[i,a]);return D().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 cQ=cL(()=>{let e=cR(),t=cR(),n=cD(0),r=cR(),i=cD(0),o=cR(),a=cR(),s=cD(0),l=cD(0),u=cD(0),c=cD(0),d=cR(),h=cR(),p=cD(!1),f=cD(!1),g=cD(!1);return cv(cM(e,cA(({scrollTop:e})=>e)),t),cv(cM(e,cA(({scrollHeight:e})=>e)),a),cv(t,i),{deviation:n,fixedFooterHeight:u,fixedHeaderHeight:l,footerHeight:c,headerHeight:s,horizontalDirection:f,scrollBy:h,scrollContainerState:e,scrollHeight:a,scrollingInProgress:p,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:o}},[],{singleton:!0}),cJ={lvl:0};function c0(e,t){let n=e.length;if(0===n)return[];let{index:r,value:i}=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:r,value:i}),r=n,i=s}return o.push({end:1/0,start:r,value:i}),o}function c1(e){return e===cJ}function c2(e,t){if(!c1(e))return t===e.k?e.v:t<e.k?c2(e.l,t):c2(e.r,t)}function c5(e,t,n="k"){if(c1(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){let r=c5(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return c5(e.l,t,n)}function c4(e,t,n){return c1(e)?de(t,n,1):t===e.k?c9(e,{k:t,v:n}):t<e.k?dn(dt(c9(e,{l:c4(e.l,t,n)}))):dn(dt(c9(e,{r:c4(e.r,t,n)})))}function c3(e,t,n){if(c1(e))return[];let r=c5(e,t)[0];return c0(function e(t,n,r){if(c1(t))return[];let{k:i,l:o,r:a,v:s}=t,l=[];return i>n&&(l=l.concat(e(o,n,r))),i>=n&&i<=r&&l.push({k:i,v:s}),i<=r&&(l=l.concat(e(a,n,r))),l}(e,r,n),({k:e,v:t})=>({index:e,value:t}))}function c6(e){return c1(e)?[]:[...c6(e.l),{k:e.k,v:e.v},...c6(e.r)]}function c8(e){let{l:t,lvl:n,r:r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(c7(t))return dt(c9(e,{lvl:n-1}));if(!c1(t)&&!c1(t.r))return c9(t.r,{l:c9(t,{r:t.r.l}),lvl:n,r:c9(e,{l:t.r.r,lvl:n-1})});throw Error("Unexpected empty nodes")}if(c7(e))return dn(c9(e,{lvl:n-1}));if(!c1(r)&&!c1(r.l)){let t=r.l,i=c7(t)?r.lvl-1:r.lvl;return c9(t,{l:c9(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:dn(c9(r,{l:t.r,lvl:i}))})}throw Error("Unexpected empty nodes")}function c9(e,t){return de(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 c7(e){return c1(e)||e.lvl>e.r.lvl}function de(e,t,n,r=cJ,i=cJ){return{k:e,l:r,lvl:n,r:i,v:t}}function dt(e){let{l:t}=e;return c1(t)||t.lvl!==e.lvl?e:c9(t,{r:c9(e,{l:t.r})})}function dn(e){let{lvl:t,r:n}=e;return c1(n)||c1(n.r)||n.lvl!==t||n.r.lvl!==t?e:c9(n,{l:c9(e,{r:n.l}),lvl:t+1})}function dr(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function di(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}let da=cL(()=>({recalcInProgress:cD(!1)}),[],{singleton:!0});function ds(e,t,n,r=0){let i=e.length-1;for(;r<=i;){let o=Math.floor((r+i)/2),a=n(e[o],t);if(0===a)return o;if(-1===a){if(i-r<2)return o-1;i=o-1}else{if(i===r)return o;r=o+1}}throw Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function dl(e,t){return Math.round(e.getBoundingClientRect()[t])}function du(e){return!c1(e.groupOffsetTree)}function dc({index:e},t){return t===e?0:t<e?-1:1}function dd({offset:e},t){return t===e?0:t<e?-1:1}function dh(e,t,n){if(0===t.length)return 0;let{index:r,offset:i,size:o}=t[ds(t,e,dc)],a=e-r,s=o*a+(a-1)*n+i;return s>0?s+n:s}function dp(e,t){if(!du(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function df(e,t,n){if(void 0!==e.groupIndex)return t.groupIndices[e.groupIndex]+1;let r=dp("LAST"===e.index?n:e.index,t);return Math.max(0,Math.min(n,r))}function dg(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,0);let o=e.sizeTree,a=o,s=0;if(n.length>0&&c1(o)&&2===t.length){let e=t[0].size,r=t[1].size;a=n.reduce((t,n)=>c4(c4(t,n,e),n+1,r),a)}else[a,s]=function(e,t){let n=c1(e)?0:1/0;for(let r of t){let{endIndex:t,size:i,startIndex:o}=r;if(n=Math.min(n,o),c1(e)){e=c4(e,0,i);continue}let a=c3(e,o-1,t+1);if(a.some(function(e){let{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}(r)))continue;let s=!1,l=!1;for(let{end:n,start:r,value:o}of a)s?(t>=r||i===o)&&(e=function e(t,n){if(c1(t))return cJ;let{k:r,l:i,r:o}=t;if(n===r){if(c1(i))return o;if(c1(o))return i;let[e,n]=function e(t){return c1(t.r)?[t.k,t.v]:e(t.r)}(i);return c8(c9(t,{k:e,l:function e(t){return c1(t.r)?t.l:c8(c9(t,{r:e(t.r)}))}(i),v:n}))}return n<r?c8(c9(t,{l:e(i,n)})):c8(c9(t,{r:e(o,n)}))}(e,r)):(l=o!==i,s=!0),n>t&&t>=r&&o!==i&&(e=c4(e,t+1,o));l&&(e=c4(e,o,i))}return[e,n]}(a,t);if(a===o)return e;let{lastIndex:l,lastOffset:u,lastSize:c,offsetTree:d}=dv(e.offsetTree,s,a,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>c4(e,t,dh(t,d,i)),cJ),lastIndex:l,lastOffset:u,lastSize:c,offsetTree:d,sizeTree:a}}function dm(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n!==e)}function dv(e,t,n,r){let i=e,o=0,a=0,s=0,l=0;if(0===t)i=[];else{l=ds(i,t-1,dc),s=i[l].offset;let e=c5(n,t-1);o=e[0],a=e[1],i.length&&i[l].size===c5(n,t)[1]&&(l-=1),i=i.slice(0,l+1)}for(let{start:e,value:l}of c3(n,t,1/0)){let t=e-o,n=t*a+s+t*r;i.push({index:e,offset:n,size:l}),o=e,s=n,a=l}return{lastIndex:o,lastOffset:s,lastSize:a,offsetTree:i}}function dy(e){return{index:e.index,value:e}}let dx={offsetHeight:"height",offsetWidth:"width"},db=cL(([{log:e},{recalcInProgress:t}])=>{let n=cR(),r=cR(),i=cO(r,0),o=cR(),a=cR(),s=cD(0),l=cD([]),u=cD(void 0),c=cD(void 0),d=cD(void 0),h=cD(void 0),p=cD((e,t)=>dl(e,dx[t])),f=cD(void 0),g=cD(0),m={groupIndices:[],groupOffsetTree:cJ,lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:cJ},v=cO(cM(n,cI(l,e,g),ck(dg,m),cw()),m),y=cO(cM(l,cw(),ck((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),cA(({prev:e})=>e)),[]);cv(cM(l,cS(e=>e.length>0),cI(v,g),cA(([e,t,n])=>{let r=e.reduce((e,r,i)=>c4(e,r,dh(r,t.offsetTree,n)||i),cJ);return{...t,groupIndices:e,groupOffsetTree:r}})),v),cv(cM(r,cI(v),cS(([e,{lastIndex:t}])=>e<t),cA(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),cv(u,c);let x=cO(cM(u,cA(e=>void 0===e)),!0);cv(cM(c,cS(e=>void 0!==e&&c1(cm(v).sizeTree)),cA(e=>{let t=cm(d),n=cm(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),cv(cM(h,cS(e=>void 0!==e&&e.length>0&&c1(cm(v).sizeTree)),cA(e=>{let t=[],n=e[0],r=0;for(let i=1;i<e.length;i++){let o=e[i];o!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=o,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),cv(cM(l,cI(d,c),cS(([,e,t])=>void 0!==e&&void 0!==t),cA(([e,t,n])=>{let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=e[i+1];r.push({startIndex:o,endIndex:o,size:t}),void 0!==a&&r.push({startIndex:o+1,endIndex:a-1,size:n})}return r})),n);let b=cE(cM(n,cI(v),ck(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:m}),cA(e=>e.changed)));cM(s,ck((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),cA(e=>e.diff))(1,e=>{let{groupIndices:n}=cm(v);if(e>0)t(0,!0),o(0,e+dm(e,n));else if(e<0){let t=cm(y);t.length>0&&(e-=dm(-e,t)),a(0,e)}}),cM(s,cI(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=cE(o);cv(cM(o,cI(v),cA(([e,t])=>{let n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){let n=c2(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;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+s-1,size:i,startIndex:e+1}),a++,o+=s+1}let s=c6(t.sizeTree);return o!==e&&s.shift(),s.reduce((t,{k:n,v:r})=>{let i=t.ranges;return 0!==t.prevSize&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return c6(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:i,ranges:[]}).ranges})),n);let S=cE(cM(a,cI(v,g),cA(([e,{offsetTree:t},n])=>dh(-e,t,n))));return cv(cM(a,cI(v,g),cA(([e,t,n])=>{if(t.groupIndices.length>0){if(c1(t.sizeTree))return t;let r=cJ,i=cm(y),o=0,a=0,s=0;for(;o<-e;){s=i[a];let e=i[a+1]-s-1;a++,o+=e+1}return r=c6(t.sizeTree).reduce((t,{k:n,v:r})=>c4(t,Math.max(0,n+e),r),r),o!==-e&&(r=c4(r,0,c2(t.sizeTree,s)),r=c4(r,1,c5(t.sizeTree,-e+1)[1])),{...t,sizeTree:r,...dv(t.offsetTree,0,r,n)}}let r=c6(t.sizeTree).reduce((t,{k:n,v:r})=>c4(t,Math.max(0,n+e),r),cJ);return{...t,sizeTree:r,...dv(t.offsetTree,0,r,n)}})),v),{beforeUnshiftWith:w,data:f,defaultItemSize:c,firstItemIndex:s,fixedItemSize:u,fixedGroupSize:d,gap:g,groupIndices:l,heightEstimates:h,itemSize:p,listRefresh:b,shiftWith:a,shiftWithOffset:S,sizeRanges:n,sizes:v,statefulTotalCount:i,totalCount:r,trackItemSizes:x,unshiftWith:o}},cf(cH,da),{singleton:!0});function dw(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}let dS=cL(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{let o=cR(),a=cR(),s=cE(cM(o,cA(dw)));return cv(cM(s,cA(e=>e.totalCount)),n),cv(cM(s,cA(e=>e.groupIndices)),e),cv(cM(cB(i,t,r),cS(([e,t])=>du(t)),cA(([e,t,n])=>c5(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),cw(),cA(e=>[e])),a),{groupCounts:o,topItemsIndexes:a}},cf(db,cQ)),dA=cL(([{log:e}])=>{let t=cD(!1),n=cE(cM(t,cS(e=>e),cw()));return t(1,t=>{t&&cm(e)("props updated",{},0)}),{didMount:n,propsReady:t}},cf(cH),{singleton:!0}),dC="u">typeof document&&"scrollBehavior"in document.documentElement.style;function dM(e){let t="number"==typeof e?{index:e}:{...e};return t.align||(t.align="start"),t.behavior&&dC||(t.behavior="auto"),void 0===t.offset&&(t.offset=0),t}let dk=cL(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:o,footerHeight:a,headerHeight:s,scrollingInProgress:l,scrollTo:u,smoothScrollTargetReached:c,viewportHeight:d},{log:h}])=>{let p=cR(),f=cR(),g=cD(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 cv(cM(p,cI(n,d,r,g,s,a,h),cI(e,o,i),cA(([[e,n,r,i,o,a,s,u],d,h,g])=>{let b=dM(e),{align:w,behavior:S,offset:A}=b,C=i-1,M=df(b,n,C),k=dh(M,n.offsetTree,d)+a;"end"===w?(k+=h+c5(n.sizeTree,M)[1]-r+g,M===C&&(k+=s)):"center"===w?k+=(h+c5(n.sizeTree,M)[1]-r+g)/2:k-=o,void 0!==A&&0!==A&&(k+=A);let T=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=cy(c,()=>{T(e)})}else m=cy(cM(t,e=>{let t=setTimeout(()=>{e(!1)},150);return n=>{n&&(e(!0),clearTimeout(t))}}),T);return v=setTimeout(()=>{x()},1200),l(0,!0),u("scrolling from index to",{behavior:S,index:M,top:k},0),{behavior:S,top:k}})),u),{scrollTargetReached:f,scrollToIndex:p,topListHeight:g}},cf(db,cQ,cH),{singleton:!0});function dT(e,t){0===e?t():requestAnimationFrame(()=>{dT(e-1,t)})}function d_(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 dI(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 dD=cL(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:o},{didMount:a}])=>{let s=cD(!0),l=cD(0),u=cD(!0);return cv(cM(a,cI(l),cS(([e,t])=>!dI(t)),cC(!1)),s),cv(cM(a,cI(l),cS(([e,t])=>!dI(t)),cC(!1)),u),cM(cB(t,a),cI(s,n,e,u),cS(([[,e],t,{sizeTree:n},r,i])=>e&&(!c1(n)||cd(r))&&!t&&!i),cI(l))(1,([,e])=>{if(void 0===e){s(0,!0),u(0,!0);return}cy(i,()=>{u(0,!0)}),dT(4,()=>{cy(r,()=>{s(0,!0)}),o(0,e)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:l,scrolledToInitialItem:s}},cf(db,cQ,dk,dA),{singleton:!0});function dO(e,t){return 1.01>Math.abs(e-t)}let dR="down",dE={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},dP=cL(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:o}])=>{let a=cD(!1),s=cD(!0),l=cR(),u=cR(),c=cD(4),d=cD(0),h=cO(cM(cF(cM(cz(i),cT(1),cC(!0)),cM(cz(i),cT(1),cC(!1),cx(100))),cw()),!1),p=cO(cM(cF(cM(n,cC(!0)),cM(n,cC(!1),cx(200))),cw()),!1);cv(cM(cB(cz(i),cz(d)),cA(([e,t])=>e<=t),cw()),s),cv(cM(s,c_(50)),u);let f=cE(cM(cB(r,cz(o),cz(t),cz(e),cz(c)),ck((e,[{scrollHeight:t,scrollTop:n},r,i,o,a])=>{let s={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-a){let t,r;return n>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-n):(t="SIZE_DECREASED",r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:s}}return{atBottom:!1,notAtBottomBecause:s.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:s}},dE),cw((e,t)=>void 0!==e&&e.atBottom===t.atBottom))),g=cO(cM(r,ck((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(!dO(e.scrollHeight,t)){let i=t-(n+r)<1;return e.scrollTop!==n&&i?{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}),cS(e=>e.changed),cA(e=>e.jump)),0);cv(cM(f,cA(e=>e.atBottom)),a),cv(cM(a,c_(50)),l);let m=cD(dR);cv(cM(r,cA(({scrollTop:e})=>e),cw(),ck((e,t)=>cm(p)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?"up":dR,prevScrollTop:t},{direction:dR,prevScrollTop:0}),cA(e=>e.direction)),m),cv(cM(r,c_(50),cC("none")),m);let v=cD(0);return cv(cM(h,cS(e=>!e),cC(0)),v),cv(cM(i,c_(100),cI(h),cS(([e,t])=>t),ck(([e,t],[n])=>[t,n],[0,0]),cA(([e,t])=>t-e)),v),{atBottomState:f,atBottomStateChange:l,atBottomThreshold:c,atTopStateChange:u,atTopThreshold:d,isAtBottom:a,isAtTop:s,isScrolling:h,lastJumpDueToItemResize:g,scrollDirection:m,scrollVelocity:v}},cf(cQ)),dL="bottom",dN="none";function dB(e,t,n){return"number"==typeof e?"up"===n&&"top"===t||n===dR&&t===dL?e:0:"up"===n?"top"===t?e.main:e.reverse:t===dL?e.main:e.reverse}function dz(e,t){return"number"==typeof e?e:e[t]??0}let dF=cL(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{let o=cR(),a=cD(0),s=cD(0),l=cD(0),u=cO(cM(cB(cz(r),cz(i),cz(n),cz(o,di),cz(l),cz(a),cz(t),cz(e),cz(s)),cA(([e,t,n,[r,i],o,a,s,l,u])=>{let c=e-l,d=Math.max(n-c,0),h=dN,p=dz(u,"top"),f=dz(u,dL);return r-=l,r+=n+s,i+=n+s,r>e+(a+s)-p&&(h="up"),(i-=l)<e-d+t+f&&(h=dR),h!==dN?[Math.max(c-n-dB(o,"top",h)-p,0),c-d-s+t+dB(o,dL,h)+f]:null}),cS(e=>null!==e),cw(di)),[0,0]);return{increaseViewportBy:s,listBoundary:o,overscan:l,topListHeight:a,visibleRange:u}},cf(cQ),{singleton:!0}),dj={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function dV(e,t,n,r,i,o){let{lastIndex:a,lastOffset:s,lastSize:l}=i,u=0,c=0;if(e.length>0){u=e[0].offset;let t=e[e.length-1];c=t.offset+t.size}let d=n-a,h=u,p=s+d*l+(d-1)*r-c;return{bottom:c,firstItemIndex:o,items:d$(e,i,o),offsetBottom:p,offsetTop:u,top:h,topItems:d$(t,i,o),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function dH(e,t,n,r,i,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=d_(t,s);return dV(Array.from({length:s}).map((e,t)=>({data:o[t+l],index:t+l,offset:0,size:0})),[],s,i,n,r)}function d$(e,t,n){if(0===e.length)return[];if(!du(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));let r=e[0].index,i=e[e.length-1].index,o=[],a=c3(t.groupOffsetTree,r,i),s,l=0;for(let r of e){let e;(!s||s.end<r.index)&&(s=a.shift(),l=t.groupIndices.indexOf(s.start)),e=r.index===s.start?{index:l,type:"group"}:{groupIndex:l,index:r.index-(l+1)+n},o.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return o}function dW(e,t){return void 0===e?0:"number"==typeof e?e:e[t]??0}let dG=cL(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},o,{listBoundary:a,topListHeight:s,visibleRange:l},{initialTopMostItemIndex:u,scrolledToInitialItem:c},{topListHeight:d},h,{didMount:p},{recalcInProgress:f}])=>{let g=cD([]),m=cD(0),v=cR(),y=cD(0);cv(o.topItemsIndexes,g);let x=cO(cM(cB(p,f,cz(l,di),cz(i),cz(r),cz(u),c,cz(g),cz(t),cz(n),cz(y),e),cS(([e,t,,n,,,,,,,,r])=>{let i=void 0!==r&&r.length!==n;return e&&!t&&!i}),cA(([,,[e,t],n,r,i,o,a,s,l,u,c])=>{var d;let{offsetTree:h,sizeTree:p}=r,f=cm(m);if(0===n)return{...dj,totalCount:n};if(0===e&&0===t)return 0===f?{...dj,totalCount:n}:dH(f,i,r,s,l,c||[]);if(c1(p))return f>0?null:dV(function(e,t,n){if(du(t)){let r=dp(e,t);return[{index:c5(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}(d_(i,n),r,c),[],n,l,r,s);let g=[];if(a.length>0){let e=a[0],t=a[a.length-1],n=0;for(let r of c3(p,e,t)){let i=r.value,o=Math.max(r.start,e),a=Math.min(r.end,t);for(let e=o;e<=a;e++)g.push({data:c?.[e],index:e,offset:n,size:i}),n+=i}}if(!o)return dV([],g,n,l,r,s);let v=a.length>0?a[a.length-1]+1:0,y=function(e,t,n,r=0){let i,o;return r>0&&(t=Math.max(t,e[ds(e,r,dc)].offset)),c0((i=ds(e,t,dd),o=ds(e,n,dd,i),e.slice(i,o+1)),dy)}(h,e,t,v);if(0===y.length)return null;let x=n-1,b=((n=>{for(let r of y){let i=r.value,o=i.offset,a=r.start,s=i.size;if(i.offset<e){let t=(a+=Math.floor((e-i.offset+l)/(s+l)))-r.start;o+=t*s+t*l}a<v&&(o+=(v-a)*s,a=v);let u=Math.min(r.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}})(d=[]),d),w=dW(u,"top"),S=dW(u,dL);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=[],r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){let t=c3(p,i,i)[0]?.value??e.size;r-=t+l,n.unshift({data:c?.[i],index:i,offset:r,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 r=t.index+1;r<=t.index+e;r++){let e=c3(p,r,r)[0]?.value??t.size;b.push({data:c?.[r],index:r,offset:n,size:e}),n+=e+l}}}return dV(b,g,n,l,r,s)}),cS(e=>null!==e),cw()),dj);cv(cM(e,cS(cd),cA(e=>e?.length)),i),cv(cM(x,cA(e=>e.topListHeight)),d),cv(d,s),cv(cM(x,cA(e=>[e.top,e.bottom])),a),cv(cM(x,cA(e=>e.items)),v);let b=cE(cM(x,cS(({items:e})=>e.length>0),cI(i,e),cS(([{items:e},t])=>e[e.length-1].originalIndex===t-1),cA(([,e,t])=>[e-1,t]),cw(di),cA(([e])=>e))),w=cE(cM(x,c_(200),cS(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),cA(({items:e})=>e[0].index),cw())),S=cE(cM(x,cS(({items:e})=>e.length>0),cA(({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}}),cw(dr)));return{endReached:b,initialItemCount:m,itemsRendered:v,listState:x,minOverscanItemCount:y,rangeChanged:S,startReached:w,topItemsIndexes:g,...h}},cf(db,dS,dF,dD,dk,dP,dA,da),{singleton:!0}),dU=cL(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{let o=cR(),a=cO(cM(cB(n,e,r,t,i),cA(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return cv(cz(a),o),{totalListHeight:a,totalListHeightChanged:o}},cf(cQ,dG),{singleton:!0}),dq=cL(([{viewportHeight:e},{totalListHeight:t}])=>{let n=cD(!1),r=cO(cM(cB(n,e,t),cS(([e])=>e),cA(([,e,t])=>Math.max(0,e-t)),c_(0),cw()),0);return{alignToBottom:n,paddingTopAddition:r}},cf(cQ,dU),{singleton:!0}),dY=cL(()=>({context:cD(null)})),dX=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:o,viewportTop:a})=>t<a?{...i,align:n??"start",...void 0===r?{}:{behavior:r}}:e>o?{...i,align:n??"end",...void 0===r?{}:{behavior:r}}:null,dZ=cL(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:o,scrollingInProgress:a,scrollTop:s,viewportHeight:l},{scrollToIndex:u}])=>{let c=cR();return cv(cM(c,cI(t,l,n,o,i,r,s),cI(e),cA(([[e,t,n,r,i,o,s,l],u])=>{let{calculateViewLocation:c=dX,done:d,...h}=e,p=df(e,t,r-1),f=dh(p,t.offsetTree,u)+i+o,g=c({itemBottom:f+c5(t.sizeTree,p)[1],itemTop:f,locationParams:h,viewportBottom:l+n-s,viewportTop:l+o});return null===g?d?.():d&&cy(cM(a,cS(e=>!e),cT(cm(a)?1:2)),d),g}),cS(e=>null!==e)),u),{scrollIntoView:c}},cf(db,cQ,dk,dG,cH),{singleton:!0});function dK(e){return!1!==e&&("smooth"===e?"smooth":"auto")}let dQ=cL(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:o},{scrollToIndex:a},{scrolledToInitialItem:s},{didMount:l,propsReady:u},{log:c},{scrollingInProgress:d},{context:h},{scrollIntoView:p}])=>{let f=cD(!1),g=cR(),m=null;function v(e){a(0,{align:"end",behavior:e,index:"LAST"})}function y(e){setTimeout(cy(i,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&null===m&&(cm(c)("scrolling to bottom due to increased size",{},0),v("auto"))}),100)}cM(cB(cM(cz(t),cT(1)),l),cI(cz(f),o,s,d),cA(([[e,t],n,r,i,o])=>{let a,s=t&&i,l="auto";return s&&(a=r||o,l="function"==typeof n?dK(n(a)):a&&dK(n),s=s&&!1!==l),{followOutputBehavior:l,shouldFollow:s,totalCount:e}}),cS(({shouldFollow:e})=>e))(1,({followOutputBehavior:t,totalCount:r})=>{null!==m&&(m(),m=null),void 0===cm(n)?m=cy(e,()=>{cm(c)("following output to ",{totalCount:r},0),v(t),m=null}):requestAnimationFrame(()=>{cm(c)("following output to ",{totalCount:r},0),v(t)})}),cM(cB(cz(f),t,u),cS(([e,,t])=>!1!==e&&t),ck(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),cS(({refreshed:e})=>e),cI(f,t))(1,([,e])=>{cm(s)&&y(!1!==e)}),g(1,()=>{y(!1!==cm(f))}),cB(cz(f),i)(1,([e,t])=>{!1===e||t.atBottom||"VIEWPORT_HEIGHT_DECREASING"!==t.notAtBottomBecause||v("auto")});let x=cD(null),b=cR();return cv(cF(cM(cz(r),cA(e=>e?.length??0)),cM(cz(t))),b),cM(cB(cM(b,cT(1)),l),cI(cz(x),s,d,h),cA(([[e,t],n,r,i,o])=>t&&r&&n?.({context:o,totalCount:e,scrollingInProgress:i})),cS(e=>!!e),c_(0))(1,t=>{null!==m&&(m(),m=null),void 0===cm(n)?m=cy(e,()=>{cm(c)("scrolling into view",{}),p(0,t),m=null}):requestAnimationFrame(()=>{cm(c)("scrolling into view",{}),p(0,t)})}),{autoscrollToBottom:g,followOutput:f,scrollIntoViewOnChange:x}},cf(db,dP,dk,dD,dA,cH,cQ,dY,dZ)),dJ=cL(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:o,listState:a},{didMount:s}])=>(cv(cM(s,cI(o),cS(([,e])=>0!==e),cI(i,r,t,n,e),cA(([[,e],t,n,r,i,o=[]])=>dH(e,t,n,r,i,o))),a),{}),cf(db,dD,dG,dA),{singleton:!0}),d0=cL(([{didMount:e},{scrollTo:t},{listState:n}])=>{let r=cD(0);return cM(e,cI(r),cS(([,e])=>0!==e),cA(([,e])=>({top:e})))(1,e=>{cy(cM(n,cT(1),cS(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{t(0,e)})})}),{initialScrollTop:r}},cf(dA,cQ,dG),{singleton:!0}),d1=cL(([{scrollVelocity:e}])=>{let t=cD(!1),n=cR(),r=cD(!1);return cv(cM(e,cI(r,t,n),cS(([e,t])=>!1!==t&&void 0!==t),cA(([e,t,n,r])=>{let{enter:i,exit:o}=t;if(n){if(o(e,r))return!1}else if(i(e,r))return!0;return n}),cw()),t),cM(cB(t,e,n),cI(r))(1,([[e,t,n],r])=>{e&&!1!==r&&void 0!==r&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},cf(dP),{singleton:!0}),d2=cL(([{scrollContainerState:e,scrollTo:t}])=>{let n=cR(),r=cR(),i=cR(),o=cD(!1),a=cD(void 0);return cv(cM(cB(n,r),cA(([{scrollTop:e,viewportHeight:t},{offsetTop:n,listHeight:r}])=>({scrollHeight:r,scrollTop:Math.max(0,e-n),viewportHeight:t}))),e),cv(cM(t,cI(r),cA(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:a,useWindowScroll:o,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},cf(cQ)),d5=cL(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:o},{useWindowScroll:a,windowScrollContainerState:s,windowViewportRect:l}])=>{let u=cR(),c=cD(void 0),d=cD(null),h=cD(null);return cv(s,d),cv(l,h),cM(u,cI(t,r,a,d,h,n))(1,([e,t,n,r,i,o,a])=>{let s=c6(t.sizeTree).map(({k:e,v:t},n,r)=>{let i=r[n+1];return{endIndex:void 0===i?1/0:i.k-1,size:t,startIndex:e}});r&&null!==i&&null!==o&&(n=i.scrollTop-o.offsetTop),e({ranges:s,scrollTop:n-=a})}),cv(cM(c,cS(cd),cA(d4)),i),cv(cM(o,cI(c),cS(([,e])=>void 0!==e),cw(),cA(([,e])=>e.ranges)),e),{getState:u,restoreStateFrom:c}},cf(db,cQ,dD,dA,d2));function d4(e){return{align:"start",index:0,offset:e.scrollTop}}let d3=cL(([{topItemsIndexes:e}])=>{let t=cD(0);return cv(cM(t,cS(e=>e>=0),cA(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},cf(dG));function d6(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}let d8=d6(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),d9=cL(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:o,lastJumpDueToItemResize:a,scrollDirection:s},{listState:l},{beforeUnshiftWith:u,gap:c,shiftWithOffset:d,sizes:h},{log:p},{recalcInProgress:f}])=>{let g=cE(cM(l,cI(a),ck(([,e,t,n],[{bottom:r,items:i,offsetBottom:o,totalCount:a},s])=>{let l=r+o,u=0;return t===a&&e.length>0&&i.length>0&&(0===i[0].originalIndex&&0===e[0].originalIndex||0!=(u=l-n)&&(u+=s)),[u,i,a,l]},[0,[],0,0]),cS(([e])=>0!==e),cI(r,s,n,i,p,f),cS(([,e,t,n,,,r])=>!r&&!n&&0!==e&&"up"===t),cA(([[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 cM(g,cI(e,o))(1,([t,n,r])=>{r&&d8()?e(0,n-t):m(-t)}),cM(cB(cO(o,!1),e,f),cS(([e,t,n])=>!e&&!n&&0!==t),cA(([e,t])=>t),c_(1))(1,m),cv(cM(d,cA(e=>({top:-e}))),t),cM(u,cI(h,c),cA(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{if(0===t.length)return e*(n+i);let o=0,a=c2(r,0),s=0,l=0;for(;s<e;){s++,o+=a;let r=t.length===l+1?1/0:t[l+1]-t[l]-1;s+r>e&&(o-=a,r=e-s+1),s+=r,o+=r*(n+i),l++}return o}))(1,n=>{e(0,n),requestAnimationFrame(()=>{t(0,{top:n}),requestAnimationFrame(()=>{e(0,0),f(0,!1)})})}),{deviation:e}},cf(cQ,dP,dG,db,cH,da)),d7=cL(([e,t,n,r,i,o,a,s,l,u,c])=>({...e,...t,...n,...r,...i,...o,...a,...s,...l,...u,...c}),cf(dF,dJ,dA,d1,dU,d0,dq,d2,dZ,cH,dY)),he=cL(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:o,groupIndices:a,heightEstimates:s,itemSize:l,sizeRanges:u,sizes:c,statefulTotalCount:d,totalCount:h,trackItemSizes:p},{initialItemFinalLocationReached:f,initialTopMostItemIndex:g,scrolledToInitialItem:m},v,y,x,b,{scrollToIndex:w},S,{topItemCount:A},{groupCounts:C},M])=>{let{listState:k,minOverscanItemCount:T,topItemsIndexes:_,rangeChanged:I,...D}=b;return cv(I,M.scrollSeekRangeChanged),cv(cM(M.windowViewportRect,cA(e=>e.visibleHeight)),v.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:o,groupCounts:C,heightEstimates:s,initialItemFinalLocationReached:f,initialTopMostItemIndex:g,scrolledToInitialItem:m,sizeRanges:u,topItemCount:A,topItemsIndexes:_,totalCount:h,...x,groupIndices:a,itemSize:l,listState:k,minOverscanItemCount:T,scrollToIndex:w,statefulTotalCount:d,trackItemSizes:p,rangeChanged:I,...D,...M,...v,sizes:c,...y}},cf(db,dD,cQ,d5,dQ,dG,dk,d9,d3,dS,d7)),ht=typeof document>"u"?D().useEffect:D().useLayoutEffect;function hn(e,t,n){let r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),o=Object.keys(t.methods||{}),a=Object.keys(t.events||{}),s=D().createContext({});function l(e,n){for(let i of(void 0!==e.propsReady&&(0,e.propsReady)(0,!1),r))(0,e[t.required[i]])(0,n[i]);for(let r of i)r in n&&(0,e[t.optional[r]])(0,n[r]);void 0!==e.propsReady&&(0,e.propsReady)(0,!0)}function u(e){return a.reduce((n,r)=>{var i;let o,a,s;return n[r]=(i=e[t.events[r]],s=()=>o?.(),function(e,t){switch(e){case 1:return t?a===t?void 0:(s(),a=t,o=i(1,t)):(s(),ch);case 2:s(),a=null;return}}),n},{})}return{Component:D().forwardRef(function(c,d){var h;let{children:p,...f}=c,[g]=D().useState(()=>{var t;let n,r;return n=new Map,l(t=(r=({constructor:e,dependencies:t,id:i,singleton:o})=>{if(o&&n.has(i))return n.get(i);let a=e(t.map(e=>r(e)));return o&&n.set(i,a),a})(e),f),t}),[m]=D().useState(()=>u(g));return ht(()=>{for(let e of a)e in f&&(0,m[e])(1,f[e]);return()=>{Object.values(m).map(cg)}},[f,m,g]),ht(()=>{l(g,f)}),D().useImperativeHandle(d,(h=o.reduce((e,n)=>(e[n]=e=>{(0,g[t.methods[n]])(0,e)},e),{}),()=>h)),(0,_.jsx)(s.Provider,{value:g,children:void 0===n?p:(0,_.jsx)(n,{...function(e,t){let n={},r={},i=0,o=e.length;for(;i<o;)r[e[i]]=1,i+=1;for(let e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}([...r,...i,...a],f),children:p})})}),useEmitter:(e,t)=>{let n=D().useContext(s)[e];ht(()=>n(1,t),[t,n])},useEmitterValue:parseInt(D().version,10)>=18?e=>{let t=D().useContext(s)[e],n=D().useCallback(e=>t(1,e),[t]);return D().useSyncExternalStore(n,()=>cm(t),()=>cm(t))}:e=>{let t=D().useContext(s)[e],[n,r]=D().useState(()=>cm(t));return ht(()=>t(1,e=>{e!==n&&r(()=>e)}),[t,n]),n},usePublisher:e=>{let t=D().useContext(s);return D().useCallback(n=>{(0,t[e])(0,n)},[t,e])}}}let hr=D().createContext(void 0),hi=D().createContext(void 0),ho="-webkit-sticky",ha="sticky",hs=d6(()=>{if(typeof document>"u")return ha;let e=document.createElement("div");return e.style.position=ho,e.style.position===ho?ho:ha}),hl=typeof document>"u"?D().useEffect:D().useLayoutEffect;function hu(e){return"self"in e}function hc(e,t,n,r=ch,i,o){let a=D().useRef(null),s=D().useRef(null),l=D().useRef(null),u=D().useCallback(n=>{let r,i,a,u=n.target;if("body"in u||hu(u)){let e=hu(u)?u:u.defaultView;a=!0===o?cU(e,e.scrollX):e.scrollY,r=!0===o?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=!0===o?e.innerWidth:e.innerHeight}else a=!0===o?cU(u,u.scrollLeft):u.scrollTop,r=!0===o?u.scrollWidth:u.scrollHeight,i=!0===o?u.offsetWidth:u.offsetHeight;let c=()=>{e({scrollHeight:r,scrollTop:Math.max(a,0),viewportHeight:i})};!0===n.suppressFlushSync?c():td().flushSync(c),null!==s.current&&(a===s.current||a<=0||a===r-i)&&(s.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,o]);return D().useEffect(()=>{let e=i??a.current;return cG(e),r(i??a.current),u({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",u,{passive:!0}),()=>{cG(e),r(null),e.removeEventListener("scroll",u)}},[a,u,n,r,i]),{scrollByCallback:function(e){!0===o&&(e={...void 0===e.behavior?{}:{behavior:e.behavior},...void 0===e.top?{}:{left:cU(a.current,e.top)}}),a.current.scrollBy(e)},scrollerRef:a,scrollToCallback:function(n){let r,i,u,c=a.current;if(!c||(!0===o?"offsetWidth"in c&&0===c.offsetWidth:"offsetHeight"in c&&0===c.offsetHeight))return;let d="smooth"===n.behavior;hu(c)?(i=Math.max(dl(c.document.documentElement,!0===o?"width":"height"),!0===o?c.document.documentElement.scrollWidth:c.document.documentElement.scrollHeight),r=!0===o?c.innerWidth:c.innerHeight,u=!0===o?cU(c,c.scrollX):c.scrollY):(i=c[!0===o?"scrollWidth":"scrollHeight"],r=dl(c,!0===o?"width":"height"),u=!0===o?cU(c,c.scrollLeft):c.scrollTop);let h=i-r;if(void 0===n.top)return void c.scrollTo(n);let p=Math.ceil(Math.max(Math.min(h,n.top),0));if(n.top=p,dO(r,i)||p===u){e({scrollHeight:i,scrollTop:u,viewportHeight:r}),d&&t(!0);return}d?(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:cU(c,p)}),c.scrollTo(n)}}}function hd(e){return e}let hh=cL(()=>{let e=cD(e=>`Item ${e}`),t=cD(e=>`Group ${e}`),n=cD({}),r=cD(hd),i=cD("div"),o=cD(ch),a=(e,t=null)=>cO(cM(n,cA(t=>t[e]),cw()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:a("EmptyPlaceholder"),FooterComponent:a("Footer"),GroupComponent:a("Group","div"),groupContent:t,HeaderComponent:a("Header"),HeaderFooterTag:i,ItemComponent:a("Item","div"),itemContent:e,ListComponent:a("List","div"),ScrollerComponent:a("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TopItemListComponent:a("TopItemList")}}),hp=cL(([e,t])=>({...e,...t}),cf(he,hh)),hf=({height:e})=>(0,_.jsx)("div",{style:{height:e}}),hg={overflowAnchor:"none",position:hs(),zIndex:1},hm={overflowAnchor:"none"},hv={...hm,display:"inline-block",height:"100%"},hy=D().memo(function({showTopList:e=!1}){let t=hL("listState"),n=hN("sizeRanges"),r=hL("useWindowScroll"),i=hL("customScrollParent"),o=hN("windowScrollContainerState"),a=hN("scrollContainerState"),s=hL("itemContent"),l=hL("context"),u=hL("groupContent"),c=hL("trackItemSizes"),d=hL("itemSize"),h=hL("log"),p=hN("gap"),f=hL("horizontalDirection"),{callbackRef:g}=cX(n,d,c,e?ch:i||r?o:a,h,p,i,f,hL("skipAnimationFrameInResizeObserver")),[m,v]=D().useState(0);hP("deviation",e=>{m!==e&&v(e)});let y=hL("EmptyPlaceholder"),x=hL("ScrollSeekPlaceholder")??hf,b=hL("ListComponent"),w=hL("ItemComponent"),S=hL("GroupComponent"),A=hL("computeItemKey"),C=hL("isSeeking"),M=hL("groupIndices").length>0,k=hL("alignToBottom"),T=hL("initialItemFinalLocationReached"),O=e?{}:{boxSizing:"border-box",...f?{display:"inline-block",height:"100%",marginInlineStart:0===m?k?"auto":0:m,paddingInlineEnd:t.offsetBottom,paddingInlineStart:t.offsetTop,whiteSpace:"nowrap"}:{marginTop:0===m?k?"auto":0:m,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...T?{}:{visibility:"hidden"}};return e||0!==t.totalCount||null==y?(0,_.jsx)(b,{...hC(b,l),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:g,style:O,children:(e?t.topItems:t.items).map(e=>{let n=e.originalIndex,r=A(n+t.firstItemIndex,e.data,l);return C?(0,I.createElement)(x,{...hC(x,l),height:e.size,index:e.index,key:r,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?(0,I.createElement)(S,{...hC(S,l),"data-index":n,"data-item-index":e.index,"data-known-size":e.size,key:r,style:hg},u(e.index,l)):(0,I.createElement)(w,{...hC(w,l),...hM(w,e.data),"data-index":n,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:f?hv:hm},M?s(e.index,e.groupIndex,e.data,l):s(e.index,e.data,l))})}):(0,_.jsx)(y,{...hC(y,l)})}),hx={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},hb={outline:"none",overflowX:"auto",position:"relative"},hw=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),hS=(e,t,n=0)=>({...hw(e),position:t?"relative":"absolute",top:t?-n:0}),hA={position:hs(),top:0,width:"100%",zIndex:1};function hC(e,t){if("string"!=typeof e)return{context:t}}function hM(e,t){return{item:"string"==typeof e?void 0:t}}let hk=D().memo(function(){let e=hL("HeaderComponent"),t=hN("headerHeight"),n=hL("HeaderFooterTag"),r=cq(D().useMemo(()=>e=>{t(dl(e,"height"))},[t]),!0,hL("skipAnimationFrameInResizeObserver")),i=hL("context");return null!=e?(0,_.jsx)(n,{ref:r,children:(0,_.jsx)(e,{...hC(e,i)})}):null}),hT=D().memo(function(){let e=hL("FooterComponent"),t=hN("footerHeight"),n=hL("HeaderFooterTag"),r=cq(D().useMemo(()=>e=>{t(dl(e,"height"))},[t]),!0,hL("skipAnimationFrameInResizeObserver")),i=hL("context");return null!=e?(0,_.jsx)(n,{ref:r,children:(0,_.jsx)(e,{...hC(e,i)})}):null});function h_({useEmitter:e,useEmitterValue:t,usePublisher:n}){return D().memo(function({children:r,style:i,context:o,...a}){let s=n("scrollContainerState"),l=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),c=t("scrollerRef"),d=t("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:p,scrollToCallback:f}=hc(s,u,l,c,void 0,d);return e("scrollTo",f),e("scrollBy",h),(0,_.jsx)(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...d?hb:hx,...i},tabIndex:0,...a,...hC(l,o),children:r})})}function hI({useEmitter:e,useEmitterValue:t,usePublisher:n}){return D().memo(function({children:r,style:i,context:o,...a}){let s=n("windowScrollContainerState"),l=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),c=t("totalListHeight"),d=t("deviation"),h=t("customScrollParent"),p=D().useRef(null),{scrollByCallback:f,scrollerRef:g,scrollToCallback:m}=hc(s,u,l,t("scrollerRef"),h);return hl(()=>(g.current=h??p.current?.ownerDocument.defaultView,()=>{g.current=null}),[g,h]),e("windowScrollTo",m),e("scrollBy",f),(0,_.jsx)(l,{ref:p,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...0===c?void 0:{height:c+d}},...a,...hC(l,o),children:r})})}let hD=({children:e})=>{let t=D().useContext(hr),n=hN("viewportHeight"),r=hN("fixedItemHeight"),i=hL("alignToBottom"),o=hL("horizontalDirection"),a=cq(D().useMemo(()=>cc(n,e=>dl(e,o?"width":"height")),[n,o]),!0,hL("skipAnimationFrameInResizeObserver"));return D().useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,_.jsx)("div",{"data-viewport-type":"element",ref:a,style:hw(i),children:e})},hO=({children:e})=>{let t=D().useContext(hr),n=hN("windowViewportRect"),r=hN("fixedItemHeight"),i=hL("customScrollParent"),o=hL("useWindowScroll"),a=hL("topListHeight"),s=cK(n,i,hL("skipAnimationFrameInResizeObserver")),l=hL("alignToBottom");return D().useEffect(()=>{t&&(r(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,_.jsx)("div",{"data-viewport-type":"window",ref:s,style:hS(l,o,a),children:e})},hR=({children:e})=>{let t=hL("TopItemListComponent")??"div",n=hL("headerHeight"),r={...hA,marginTop:`${n}px`},i=hL("context");return(0,_.jsx)(t,{style:r,...hC(t,i),children:e})},{Component:hE,useEmitter:hP,useEmitterValue:hL,usePublisher:hN}=hn(hp,{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"}},D().memo(function(e){let t=hL("useWindowScroll"),n=hL("topItemsIndexes").length>0,r=hL("customScrollParent"),i=hL("context");return(0,_.jsxs)(r||t?hz:hB,{...e,context:i,children:[n&&(0,_.jsx)(hR,{children:(0,_.jsx)(hy,{showTopList:!0})}),(0,_.jsxs)(r||t?hO:hD,{children:[(0,_.jsx)(hk,{}),(0,_.jsx)(hy,{}),(0,_.jsx)(hT,{})]})]})})),hB=h_({useEmitter:hP,useEmitterValue:hL,usePublisher:hN}),hz=hI({useEmitter:hP,useEmitterValue:hL,usePublisher:hN}),hF=cL(()=>{let e=cD(e=>(0,_.jsxs)("td",{children:["Item $",e]})),t=cD(null),n=cD(e=>(0,_.jsxs)("td",{colSpan:1e3,children:["Group ",e]})),r=cD(null),i=cD(null),o=cD({}),a=cD(hd),s=cD(ch),l=(e,t=null)=>cO(cM(o,cA(t=>t[e]),cw()),t);return{components:o,computeItemKey:a,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:i,fixedHeaderContent:r,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")}}),hj=cL(([e,t])=>({...e,...t}),cf(he,hF)),hV=({height:e})=>(0,_.jsx)("tr",{children:(0,_.jsx)("td",{style:{height:e}})}),hH=({height:e})=>(0,_.jsx)("tr",{children:(0,_.jsx)("td",{style:{border:0,height:e,padding:0}})}),h$={overflowAnchor:"none"},hW={position:hs(),zIndex:2,overflowAnchor:"none"},hG=D().memo(function({showTopList:e=!1}){let t=hK("listState"),n=hK("computeItemKey"),r=hK("firstItemIndex"),i=hK("context"),o=hK("isSeeking"),a=hK("fixedHeaderHeight"),s=hK("groupIndices").length>0,l=hK("itemContent"),u=hK("groupContent"),c=hK("ScrollSeekPlaceholder")??hV,d=hK("GroupComponent"),h=hK("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+r,t.data,i),m=e?0===f?0:p[f-1]:0;return o?(0,I.createElement)(c,{...hC(c,i),height:t.size,index:t.index,key:g,type:t.type||"item"}):"group"===t.type?(0,I.createElement)(d,{...hC(d,i),"data-index":f,"data-item-index":t.index,"data-known-size":t.size,key:g,style:{...hW,top:a}},u(t.index,i)):(0,I.createElement)(h,{...hC(h,i),...hM(h,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?{...hW,top:a+m}:h$},s?l(t.index,t.groupIndex,t.data,i):l(t.index,t.data,i))})}),hU=D().memo(function(){let e=hK("listState"),t=hK("topItemsIndexes").length>0,n=hQ("sizeRanges"),r=hK("useWindowScroll"),i=hK("customScrollParent"),o=hQ("windowScrollContainerState"),a=hQ("scrollContainerState"),s=hK("trackItemSizes"),{callbackRef:l,ref:u}=cX(n,hK("itemSize"),s,i||r?o:a,hK("log"),void 0,i,!1,hK("skipAnimationFrameInResizeObserver")),[c,d]=D().useState(0);hZ("deviation",e=>{c!==e&&(u.current.style.marginTop=`${e}px`,d(e))});let h=hK("EmptyPlaceholder"),p=hK("FillerRow")??hH,f=hK("TableBodyComponent"),g=hK("paddingTopAddition"),m=hK("statefulTotalCount"),v=hK("context");if(0===m&&null!=h)return(0,_.jsx)(h,{...hC(h,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,_.jsx)(p,{context:v,height:x},"padding-top"):null,S=b>0?(0,_.jsx)(p,{context:v,height:b},"padding-bottom"):null;return(0,_.jsxs)(f,{"data-testid":"virtuoso-item-list",ref:l,...hC(f,v),children:[w,t&&(0,_.jsx)(hG,{showTopList:!0}),(0,_.jsx)(hG,{}),S]})}),hq=({children:e})=>{let t=D().useContext(hr),n=hQ("viewportHeight"),r=hQ("fixedItemHeight"),i=cq(D().useMemo(()=>cc(n,e=>dl(e,"height")),[n]),!0,hK("skipAnimationFrameInResizeObserver"));return D().useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,_.jsx)("div",{"data-viewport-type":"element",ref:i,style:hw(!1),children:e})},hY=({children:e})=>{let t=D().useContext(hr),n=hQ("windowViewportRect"),r=hQ("fixedItemHeight"),i=hK("customScrollParent"),o=hK("useWindowScroll"),a=cK(n,i,hK("skipAnimationFrameInResizeObserver"));return D().useEffect(()=>{t&&(r(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,_.jsx)("div",{"data-viewport-type":"window",ref:a,style:hS(!1,o),children:e})},{Component:hX,useEmitter:hZ,useEmitterValue:hK,usePublisher:hQ}=hn(hj,{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"}},D().memo(function(e){let t=hK("useWindowScroll"),n=hK("customScrollParent"),r=hQ("fixedHeaderHeight"),i=hQ("fixedFooterHeight"),o=hK("fixedHeaderContent"),a=hK("fixedFooterContent"),s=hK("context"),l=cq(D().useMemo(()=>cc(r,e=>dl(e,"height")),[r]),!0,hK("skipAnimationFrameInResizeObserver")),u=cq(D().useMemo(()=>cc(i,e=>dl(e,"height")),[i]),!0,hK("skipAnimationFrameInResizeObserver")),c=n||t?h0:hJ,d=n||t?hY:hq,h=hK("TableComponent"),p=hK("TableHeadComponent"),f=hK("TableFooterComponent"),g=o?(0,_.jsx)(p,{ref:l,style:{position:"sticky",top:0,zIndex:2},...hC(p,s),children:o()},"TableHead"):null,m=a?(0,_.jsx)(f,{ref:u,style:{bottom:0,position:"sticky",zIndex:1},...hC(f,s),children:a()},"TableFoot"):null;return(0,_.jsx)(c,{...e,...hC(c,s),children:(0,_.jsx)(d,{children:(0,_.jsxs)(h,{style:{borderSpacing:0,overflowAnchor:"none"},...hC(h,s),children:[g,(0,_.jsx)(hU,{},"TableBody"),m]})})})})),hJ=h_({useEmitter:hZ,useEmitterValue:hK,usePublisher:hQ}),h0=hI({useEmitter:hZ,useEmitterValue:hK,usePublisher:hQ}),h1={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},h2={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:h5,floor:h4,max:h3,min:h6,round:h8}=Math;function h9(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:null===n?null:n[r+e],index:r+e}))}function h7(e,t){return void 0!==e&&e.width===t.width&&e.height===t.height}function pe(e,t){return void 0!==e&&e.column===t.column&&e.row===t.row}let pt=cL(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:o,scrollBy:a,scrollContainerState:s,scrollTo:l,scrollTop:u,smoothScrollTargetReached:c,viewportHeight:d},h,p,{didMount:f,propsReady:g},{customScrollParent:m,useWindowScroll:v,windowScrollContainerState:y,windowScrollTo:x,windowViewportRect:b},w])=>{let S=cD(0),A=cD(0),C=cD(h1),M=cD({height:0,width:0}),k=cD({height:0,width:0}),T=cR(),_=cR(),I=cD(0),D=cD(null),O=cD({column:0,row:0}),R=cR(),E=cR(),P=cD(!1),L=cD(0),N=cD(!0),B=cD(!1),z=cD(!1);cM(f,cI(L),cS(([e,t])=>!dI(t)))(1,()=>{N(0,!1)}),cM(cB(f,N,k,M,L,B),cS(([e,t,n,r,,i])=>e&&!t&&0!==n.height&&0!==r.height&&!i))(1,([,,,,e])=>{void 0===e?N(0,!0):(B(0,!0),dT(1,()=>{T(0,e)}),cy(cM(u),()=>{t(0,[0,0]),N(0,!0)}))}),cv(cM(E,cS(e=>null!=e&&e.scrollTop>0),cC(0)),A),cM(f,cI(E),cS(([,e])=>null!=e))(1,([,e])=>{e&&(M(0,e.viewport),k(0,e.item),O(0,e.gap),e.scrollTop>0&&(P(0,!0),cy(cM(u,cT(1)),e=>{P(0,!1)}),l(0,{top:e.scrollTop})))}),cv(cM(M,cA(({height:e})=>e)),d),cv(cM(cB(cz(M,h7),cz(k,h7),cz(O,(e,t)=>void 0!==e&&e.column===t.column&&e.row===t.row),cz(u)),cA(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),R),cv(cM(cB(cz(S),r,cz(O,pe),cz(k,h7),cz(M,h7),cz(D),cz(A),cz(P),cz(N),cz(L)),cS(([,,,,,,,e])=>!e),cA(([e,[t,n],r,i,o,a,s,,l,u])=>{let c,d,{column:h,row:p}=r,{height:f,width:g}=i,{width:m}=o;if(0===s&&(0===e||0===m))return h1;if(0===g){var v;let t=d_(u,e),n=t+Math.max(s-1,0);return v=h9(t,n,a),{...h2,items:v}}let y=pn(m,g,h);l?0===t&&0===n&&s>0?(c=0,d=s-1):(c=y*h4((t+p)/(f+p)),d=h6(e-1,h3(d=y*h5((n+p)/(f+p))-1,y-1)),c=h6(d,h3(0,c))):(c=0,d=-1);let x=h9(c,d,a),{bottom:b,top:w}=pr(o,r,i,x),S=h5(e/y);return{bottom:b,itemHeight:f,items:x,itemWidth:g,offsetBottom:S*f+(S-1)*p-b,offsetTop:w,top:w}})),C),cv(cM(D,cS(e=>null!==e),cA(e=>e.length)),S),cv(cM(cB(M,k,C,O),cS(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),cA(([e,t,{items:n},r])=>{let{bottom:i,top:o}=pr(e,r,t,n);return[o,i]}),cw(di)),t);let F=cD(!1);cv(cM(u,cI(F),cA(([e,t])=>t||0!==e)),F);let j=cE(cM(cB(C,S),cS(([{items:e}])=>e.length>0),cI(F),cS(([[e,t],n])=>{let r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&r}),cA(([[,e]])=>e-1),cw())),V=cE(cM(cz(C),cS(({items:e})=>e.length>0&&0===e[0].index),cC(0),cw())),H=cE(cM(cz(C),cI(P),cS(([{items:e},t])=>e.length>0&&!t),cA(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),cw(dr),c_(0)));cv(H,p.scrollSeekRangeChanged),cv(cM(T,cI(M,k,S,O),cA(([e,t,n,r,i])=>{let o=dM(e),{align:a,behavior:s,offset:l}=o,u=o.index;"LAST"===u&&(u=r-1);let c=pi(t,i,n,u=h3(0,u,h6(r-1,u)));return"end"===a?c=h8(c-t.height+n.height):"center"===a&&(c=h8(c-t.height/2+n.height/2)),void 0!==l&&0!==l&&(c+=l),{behavior:s,top:c}})),l);let $=cO(cM(C,cA(e=>e.offsetBottom+e.bottom)),0);return cv(cM(b,cA(e=>({height:e.visibleHeight,width:e.visibleWidth}))),M),{customScrollParent:m,data:D,deviation:I,footerHeight:i,gap:O,headerHeight:o,increaseViewportBy:e,initialItemCount:A,itemDimensions:k,overscan:n,restoreStateFrom:E,scrollBy:a,scrollContainerState:s,scrollHeight:_,scrollTo:l,scrollToIndex:T,scrollTop:u,smoothScrollTargetReached:c,totalCount:S,useWindowScroll:v,viewportDimensions:M,windowScrollContainerState:y,windowScrollTo:x,windowViewportRect:b,...p,gridState:C,horizontalDirection:z,initialTopMostItemIndex:L,totalListHeight:$,...h,endReached:j,propsReady:g,rangeChanged:H,startReached:V,stateChanged:R,stateRestoreInProgress:P,...w}},cf(dF,cQ,dP,d1,dA,d2,cH));function pn(e,t,n){return h3(1,h4((e+n)/(h4(t)+n)))}function pr(e,t,n,r){let{height:i}=n;if(void 0===i||0===r.length)return{bottom:0,top:0};let o=pi(e,t,n,r[0].index);return{bottom:pi(e,t,n,r[r.length-1].index)+i,top:o}}function pi(e,t,n,r){let i=h4(r/pn(e.width,n.width,t.column)),o=i*n.height+h3(0,i-1)*t.row;return o>0?o+t.row:o}let po=cL(()=>{let e=cD(e=>`Item ${e}`),t=cD({}),n=cD(null),r=cD("virtuoso-grid-item"),i=cD("virtuoso-grid-list"),o=cD(hd),a=cD("div"),s=cD(ch),l=(e,n=null)=>cO(cM(t,cA(t=>t[e]),cw()),n),u=cD(!1),c=cD(!1);return cv(cz(c),u),{components:t,computeItemKey:o,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:l("Item","div"),itemContent:e,listClassName:i,ListComponent:l("List","div"),readyStateChanged:u,reportReadyState:c,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),pa=cL(([e,t])=>({...e,...t}),cf(pt,po)),ps=D().memo(function(){let e=pp("gridState"),t=pp("listClassName"),n=pp("itemClassName"),r=pp("itemContent"),i=pp("computeItemKey"),o=pp("isSeeking"),a=pf("scrollHeight"),s=pp("ItemComponent"),l=pp("ListComponent"),u=pp("ScrollSeekPlaceholder"),c=pp("context"),d=pf("itemDimensions"),h=pf("gap"),p=pp("log"),f=pp("stateRestoreInProgress"),g=pf("reportReadyState"),m=cq(D().useMemo(()=>e=>{a(e.parentElement.parentElement.scrollHeight);let t=e.firstChild;if(null!==t){let{height:e,width:n}=t.getBoundingClientRect();d({height:e,width:n})}h({column:pv("column-gap",getComputedStyle(e).columnGap,p),row:pv("row-gap",getComputedStyle(e).rowGap,p)})},[a,d,h,p]),!0,!1);return hl(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),f?null:(0,_.jsx)(l,{className:t,ref:m,...hC(l,c),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(t=>{let a=i(t.index,t.data,c);return o?(0,_.jsx)(u,{...hC(u,c),height:e.itemHeight,index:t.index,width:e.itemWidth},a):(0,I.createElement)(s,{...hC(s,c),className:n,"data-index":t.index,key:a},r(t.index,t.data,c))})})}),pl=D().memo(function(){let e=pp("HeaderComponent"),t=pf("headerHeight"),n=pp("headerFooterTag"),r=cq(D().useMemo(()=>e=>{t(dl(e,"height"))},[t]),!0,!1),i=pp("context");return null!=e?(0,_.jsx)(n,{ref:r,children:(0,_.jsx)(e,{...hC(e,i)})}):null}),pu=D().memo(function(){let e=pp("FooterComponent"),t=pf("footerHeight"),n=pp("headerFooterTag"),r=cq(D().useMemo(()=>e=>{t(dl(e,"height"))},[t]),!0,!1),i=pp("context");return null!=e?(0,_.jsx)(n,{ref:r,children:(0,_.jsx)(e,{...hC(e,i)})}):null}),pc=({children:e})=>{let t=D().useContext(hi),n=pf("itemDimensions"),r=pf("viewportDimensions"),i=cq(D().useMemo(()=>e=>{r(e.getBoundingClientRect())},[r]),!0,!1);return D().useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),(0,_.jsx)("div",{ref:i,style:hw(!1),children:e})},pd=({children:e})=>{let t=D().useContext(hi),n=pf("windowViewportRect"),r=pf("itemDimensions"),i=pp("customScrollParent"),o=pp("useWindowScroll"),a=cK(n,i,!1);return D().useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),(0,_.jsx)("div",{ref:a,style:hS(!1,o),children:e})},{useEmitter:ph,useEmitterValue:pp,usePublisher:pf}=hn(pa,{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"}},D().memo(function({...e}){let t=pp("useWindowScroll"),n=pp("customScrollParent"),r=n||t?pm:pg,i=n||t?pd:pc,o=pp("context");return(0,_.jsx)(r,{...e,...hC(r,o),children:(0,_.jsxs)(i,{children:[(0,_.jsx)(pl,{}),(0,_.jsx)(ps,{}),(0,_.jsx)(pu,{})]})})})),pg=h_({useEmitter:ph,useEmitterValue:pp,usePublisher:pf}),pm=hI({useEmitter:ph,useEmitterValue:pp,usePublisher:pf});function pv(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 py({items:e,height:t,width:n,selectedItems:r,onLegendItemClick:i,onItemMouseOver:o,onItemMouseOut:a}){let s=e.length>5;return(0,_.jsx)(hE,{style:{height:t,width:n},data:e,itemContent:(e,t)=>(0,_.jsx)(cs,{item:t,index:e,truncateLabel:s,isVisuallySelected:u0(t,r),onClick:i,onMouseOver:o,onMouseOut:a,sx:{width:"100%",wordBreak:"break-word",overflow:"hidden"}},t.id),role:"list"})}function px(e,t){return"function"==typeof e?e(t):e}function pb(e,t){return n=>{t.setState(t=>({...t,[e]:px(n,t[e])}))}}function pw(e){return e instanceof Function}function pS(e,t,n){let r,i=[];return o=>{let a,s;n.key&&n.debug&&(a=Date.now());let l=e(o);if(!(l.length!==i.length||l.some((e,t)=>i[t]!==e)))return r;if(i=l,n.key&&n.debug&&(s=Date.now()),r=t(...l),null==n||null==n.onChange||n.onChange(r),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,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
30
+ font-size: .6rem;
31
+ font-weight: bold;
32
+ color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return r}}function pA(e,t,n,r){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:r}}let pC="debugHeaders";function pM(e,t,n){var r;let i={id:null!=(r=n.id)?r: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(i),e},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(i,e)}),i}function pk(e,t,n,r){var i,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 i={depth:t,id:[r,`${t}`].filter(Boolean).join("_"),headers:[]},o=[];e.forEach(e=>{let a,s=[...o].reverse()[0],l=e.column.depth===i.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 i=pM(n,a,{id:[r,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});i.subHeaders.push(e),o.push(i)}i.headers.push(e),e.headerGroup=i}),l.push(i),t>0&&u(o,t-1)};u(t.map((e,t)=>pM(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,r=[0];return e.subHeaders&&e.subHeaders.length?(r=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:i}=e;t+=n,r.push(i)})):t=1,n+=Math.min(...r),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(null!=(i=null==(o=l[0])?void 0:o.headers)?i:[]),l}let pT=(e,t,n,r,i,o,a)=>{let s={id:t,index:r,original:n,depth:i,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,r),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,r):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,r;return e=s.subRows,t=e=>e.subRows,n=[],(r=e=>{e.forEach(e=>{n.push(e);let i=t(e);null!=i&&i.length&&r(i)})})(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:pS(()=>[e.getAllLeafColumns()],t=>t.map(t=>{var n;let r;return n=t.id,r={id:`${s.id}_${t.id}`,row:s,column:t,getValue:()=>s.getValue(n),renderValue:()=>{var t;return null!=(t=r.getValue())?t:e.options.renderFallbackValue},getContext:pS(()=>[e,t,s,r],(e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue}),pA(e.options,"debugCells","cell.getContext"))},e._features.forEach(n=>{null==n.createCell||n.createCell(r,t,s,e)},{}),r}),pA(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:pS(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),pA(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},p_=(e,t,n)=>{var r,i;let o=null==n||null==(r=n.toString())?void 0:r.toLowerCase();return!!(null==(i=e.getValue(t))||null==(i=i.toString())||null==(i=i.toLowerCase())?void 0:i.includes(o))};p_.autoRemove=e=>pz(e);let pI=(e,t,n)=>{var r;return!!(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.includes(n))};pI.autoRemove=e=>pz(e);let pD=(e,t,n)=>{var r;return(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.toLowerCase())===(null==n?void 0:n.toLowerCase())};pD.autoRemove=e=>pz(e);let pO=(e,t,n)=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)};pO.autoRemove=e=>pz(e);let pR=(e,t,n)=>!n.some(n=>{var r;return!(null!=(r=e.getValue(t))&&r.includes(n))});pR.autoRemove=e=>pz(e)||!(null!=e&&e.length);let pE=(e,t,n)=>n.some(n=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)});pE.autoRemove=e=>pz(e)||!(null!=e&&e.length);let pP=(e,t,n)=>e.getValue(t)===n;pP.autoRemove=e=>pz(e);let pL=(e,t,n)=>e.getValue(t)==n;pL.autoRemove=e=>pz(e);let pN=(e,t,n)=>{let[r,i]=n,o=e.getValue(t);return o>=r&&o<=i};pN.resolveFilterValue=e=>{let[t,n]=e,r="number"!=typeof t?parseFloat(t):t,i="number"!=typeof n?parseFloat(n):n,o=null===t||Number.isNaN(r)?-1/0:r,a=null===n||Number.isNaN(i)?1/0:i;if(o>a){let e=o;o=a,a=e}return[o,a]},pN.autoRemove=e=>pz(e)||pz(e[0])&&pz(e[1]);let pB={includesString:p_,includesStringSensitive:pI,equalsString:pD,arrIncludes:pO,arrIncludesAll:pR,arrIncludesSome:pE,equals:pP,weakEquals:pL,inNumberRange:pN};function pz(e){return null==e||""===e}function pF(e,t,n){return!!e&&!!e.autoRemove&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}let pj={sum:(e,t,n)=>n.reduce((t,n)=>{let r=n.getValue(e);return t+("number"==typeof r?r:0)},0),min:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(r>n||void 0===r&&n>=n)&&(r=n)}),r},max:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(r<n||void 0===r&&n>=n)&&(r=n)}),r},extent:(e,t,n)=>{let r,i;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(void 0===r?n>=n&&(r=i=n):(r>n&&(r=n),i<n&&(i=n)))}),[r,i]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(t=>{let i=t.getValue(e);null!=i&&(i*=1)>=i&&(++n,r+=i)}),n)return r/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 r=Math.floor(n.length/2),i=n.sort((e,t)=>e-t);return n.length%2!=0?i[r]:(i[r-1]+i[r])/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},pV=()=>({left:[],right:[]}),pH={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},p$=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),pW=null;function pG(e){return"touchstart"===e.type}function pU(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}let pq=()=>({pageIndex:0,pageSize:10}),pY=()=>({top:[],bottom:[]}),pX=(e,t,n,r,i)=>{var o;let a=i.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&null!=(o=a.subRows)&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(t=>pX(e,t.id,n,r,i))};function pZ(e,t){let n=e.getState().rowSelection,r=[],i={},o=function(e,t){return e.map(e=>{var t;let a=pK(e,n);if(a&&(r.push(e),i[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:r,rowsById:i}}function pK(e,t){var n;return null!=(n=t[e.id])&&n}function pQ(e,t,n){var r;if(!(null!=(r=e.subRows)&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(e=>{if((!o||i)&&(e.getCanSelect()&&(pK(e,t)?o=!0:i=!1),e.subRows&&e.subRows.length)){let n=pQ(e,t);"all"===n?o=!0:("some"===n&&(o=!0),i=!1)}}),i?"all":!!o&&"some"}let pJ=/([0-9]+)/gm;function p0(e,t){return e===t?0:e>t?1:-1}function p1(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function p2(e,t){let n=e.split(pJ).filter(Boolean),r=t.split(pJ).filter(Boolean);for(;n.length&&r.length;){let e=n.shift(),t=r.shift(),i=parseInt(e,10),o=parseInt(t,10),a=[i,o].sort();if(isNaN(a[0])){if(e>t)return 1;if(t>e)return -1;continue}if(isNaN(a[1]))return isNaN(i)?-1:1;if(i>o)return 1;if(o>i)return -1}return n.length-r.length}let p5={alphanumeric:(e,t,n)=>p2(p1(e.getValue(n)).toLowerCase(),p1(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>p2(p1(e.getValue(n)),p1(t.getValue(n))),text:(e,t,n)=>p0(p1(e.getValue(n)).toLowerCase(),p1(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>p0(p1(e.getValue(n)),p1(t.getValue(n))),datetime:(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},basic:(e,t,n)=>p0(e.getValue(n),t.getValue(n))},p4=[{createTable:e=>{e.getHeaderGroups=pS(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,a;let s=null!=(o=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?o:[],l=null!=(a=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?a:[];return pk(t,[...s,...n.filter(e=>!(null!=r&&r.includes(e.id))&&!(null!=i&&i.includes(e.id))),...l],e)},pA(e.options,pC,"getHeaderGroups")),e.getCenterHeaderGroups=pS(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>pk(t,n=n.filter(e=>!(null!=r&&r.includes(e.id))&&!(null!=i&&i.includes(e.id))),e,"center"),pA(e.options,pC,"getCenterHeaderGroups")),e.getLeftHeaderGroups=pS(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;return pk(t,null!=(i=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?i:[],e,"left")},pA(e.options,pC,"getLeftHeaderGroups")),e.getRightHeaderGroups=pS(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;return pk(t,null!=(i=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?i:[],e,"right")},pA(e.options,pC,"getRightHeaderGroups")),e.getFooterGroups=pS(()=>[e.getHeaderGroups()],e=>[...e].reverse(),pA(e.options,pC,"getFooterGroups")),e.getLeftFooterGroups=pS(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),pA(e.options,pC,"getLeftFooterGroups")),e.getCenterFooterGroups=pS(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),pA(e.options,pC,"getCenterFooterGroups")),e.getRightFooterGroups=pS(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),pA(e.options,pC,"getRightFooterGroups")),e.getFlatHeaders=pS(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),pA(e.options,pC,"getFlatHeaders")),e.getLeftFlatHeaders=pS(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),pA(e.options,pC,"getLeftFlatHeaders")),e.getCenterFlatHeaders=pS(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),pA(e.options,pC,"getCenterFlatHeaders")),e.getRightFlatHeaders=pS(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),pA(e.options,pC,"getRightFlatHeaders")),e.getCenterLeafHeaders=pS(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),pA(e.options,pC,"getCenterLeafHeaders")),e.getLeftLeafHeaders=pS(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),pA(e.options,pC,"getLeftLeafHeaders")),e.getRightLeafHeaders=pS(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),pA(e.options,pC,"getRightLeafHeaders")),e.getLeafHeaders=pS(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var r,i,o,a,s,l;return[...null!=(r=null==(i=e[0])?void 0:i.headers)?r:[],...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()},pA(e.options,pC,"getLeafHeaders"))}},{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:pb("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,r;let i=e.columns;return null==(n=i.length?i.some(e=>e.getIsVisible()):null==(r=t.getState().columnVisibility)?void 0:r[e.id])||n},e.getCanHide=()=>{var n,r;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(r=t.options.enableHiding)||r)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=pS(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),pA(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=pS(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],pA(t.options,"debugRows","getVisibleCells"))},createTable:e=>{let t=(t,n)=>pS(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),pA(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:pb("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=pS(e=>[pU(t,e)],t=>t.findIndex(t=>t.id===e.id),pA(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return(null==(r=pU(t,n)[0])?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;let i=pU(t,n);return(null==(r=i[i.length-1])?void 0:r.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=pS(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>r=>{let i=[];if(null!=e&&e.length){let t=[...e],n=[...r];for(;n.length&&t.length;){let e=t.shift(),r=n.findIndex(t=>t.id===e);r>-1&&i.push(n.splice(r,1)[0])}i=[...i,...n]}else i=r;var o=i;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]},pA(e.options,"debugTable","_getOrderColumnsFn"))}},{getInitialState:e=>({columnPinning:pV(),...e}),getDefaultOptions:e=>({onColumnPinningChange:pb("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{let r=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,i,o,a,s,l;return"right"===n?{left:(null!=(o=null==e?void 0:e.left)?o:[]).filter(e=>!(null!=r&&r.includes(e))),right:[...(null!=(a=null==e?void 0:e.right)?a:[]).filter(e=>!(null!=r&&r.includes(e))),...r]}:"left"===n?{left:[...(null!=(s=null==e?void 0:e.left)?s:[]).filter(e=>!(null!=r&&r.includes(e))),...r],right:(null!=(l=null==e?void 0:e.right)?l:[]).filter(e=>!(null!=r&&r.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=r&&r.includes(e))),right:(null!=(i=null==e?void 0:e.right)?i:[]).filter(e=>!(null!=r&&r.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,r,i;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(r=null!=(i=t.options.enableColumnPinning)?i:t.options.enablePinning)||r)}),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(e=>null==r?void 0:r.includes(e)),a=n.some(e=>null==i?void 0:i.includes(e));return o?"left":!!a&&"right"},e.getPinnedIndex=()=>{var n,r;let i=e.getIsPinned();return i?null!=(n=null==(r=t.getState().columnPinning)||null==(r=r[i])?void 0:r.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=pS(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let r=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!r.includes(e.column.id))},pA(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=pS(()=>[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"})),pA(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=pS(()=>[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"})),pA(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?pV():null!=(n=null==(r=e.initialState)?void 0:r.columnPinning)?n:pV())},e.getIsSomeColumnsPinned=t=>{var n,r,i;let o=e.getState().columnPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(r=o.left)?void 0:r.length)||(null==(i=o.right)?void 0:i.length))},e.getLeftLeafColumns=pS(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),pA(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=pS(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),pA(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=pS(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let r=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!r.includes(e.id))},pA(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:pb("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0],r=null==n?void 0:n.getValue(e.id);return"string"==typeof r?pB.includesString:"number"==typeof r?pB.inNumberRange:"boolean"==typeof r||null!==r&&"object"==typeof r?pB.equals:Array.isArray(r)?pB.arrIncludes:pB.weakEquals},e.getFilterFn=()=>{var n,r;return pw(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(r=t.options.filterFns)?void 0:r[e.columnDef.filterFn])?n:pB[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(r=t.options.enableColumnFilters)||r)&&(null==(i=t.options.enableFilters)||i)&&!!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,r;return null!=(n=null==(r=t.getState().columnFilters)?void 0:r.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{var r,i;let o=e.getFilterFn(),a=null==t?void 0:t.find(t=>t.id===e.id),s=px(n,a?a.value:void 0);if(pF(o,s,e))return null!=(r=null==t?void 0:t.filter(t=>t.id!==e.id))?r:[];let l={id:e.id,value:s};return a?null!=(i=null==t?void 0:t.map(t=>t.id===e.id?l:t))?i:[]: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 r;return null==(r=px(t,e))?void 0:r.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&pF(t.getFilterFn(),e.value,t))&&!0})})},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.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:pb("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;let r=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof r||"number"==typeof r}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,i,o;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(r=t.options.enableGlobalFilter)||r)&&(null==(i=t.options.enableFilters)||i)&&(null==(o=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||o)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>pB.includesString,e.getGlobalFilterFn=()=>{var t,n;let{globalFilterFn:r}=e.options;return pw(r)?r:"auto"===r?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[r])?t:pB[r]},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:pb("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),r=!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 p5.datetime;if("string"==typeof n&&(r=!0,n.split(pJ).length>1))return p5.alphanumeric}return r?p5.text:p5.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,r;if(!e)throw Error();return pw(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(r=t.options.sortingFns)?void 0:r[e.columnDef.sortingFn])?n:p5[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{let i=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=[],d=o?n:"desc"===i;if("toggle"!=(s=null!=a&&a.length&&e.getCanMultiSort()&&r?l?"toggle":"add":null!=a&&a.length&&u!==a.length-1?"replace":l?"toggle":"replace")||o||i||(s="remove"),"add"===s){var h;(c=[...a,{id:e.id,desc:d}]).splice(0,c.length-(null!=(h=t.options.maxMultiSortColCount)?h:Number.MAX_SAFE_INTEGER))}else c="toggle"===s?a.map(t=>t.id===e.id?{...t,desc:d}:t):"remove"===s?a.filter(t=>t.id!==e.id):[{id:e.id,desc:d}];return c})},e.getFirstSortDir=()=>{var n,r;return(null!=(n=null!=(r=e.columnDef.sortDescFirst)?r:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;let o=e.getFirstSortDir(),a=e.getIsSorted();return a?(a===o||null!=(r=t.options.enableSortingRemoval)&&!r||!!n&&null!=(i=t.options.enableMultiRemove)&&!i)&&("desc"===a?"asc":"desc"):o},e.getCanSort=()=>{var n,r;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(r=t.options.enableSorting)||r)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return null!=(n=null!=(r=e.columnDef.enableMultiSort)?r:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;let r=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!r&&(r.desc?"desc":"asc")},e.getSortIndex=()=>{var n,r;return null!=(n=null==(r=t.getState().sorting)?void 0:r.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 r=>{n&&(null==r.persist||r.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(r))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.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:pb("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,r;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(r=t.options.enableGrouping)||r)&&(!!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],r=null==n?void 0:n.getValue(e.id);return"number"==typeof r?pj.sum:"[object Date]"===Object.prototype.toString.call(r)?pj.extent:void 0},e.getAggregationFn=()=>{var n,r;if(!e)throw Error();return pw(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(r=t.options.aggregationFns)?void 0:r[e.columnDef.aggregationFn])?n:pj[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.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 r=t.getColumn(n);return null!=r&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{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:pb("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t)return void e._queue(()=>{t=!0});if(null!=(r=null!=(i=e.options.autoResetAll)?i:e.options.autoResetExpanded)?r:!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,r;e.setExpanded(t?{}:null!=(n=null==(r=e.initialState)?void 0:r.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(r=>{var i;let o=!0===r||!!(null!=r&&r[e.id]),a={};if(!0===r?Object.keys(t.getRowModel().rowsById).forEach(e=>{a[e]=!0}):a=r,n=null!=(i=n)?i:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){let{[e.id]:t,...n}=a;return n}return r})},e.getIsExpanded=()=>{var n;let r=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===r||(null==r?void 0:r[e.id]))},e.getCanExpand=()=>{var n,r,i;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(r=t.options.enableExpanding)||r)&&!!(null!=(i=e.subRows)&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)n=(r=t.getRow(r.parentId,!0)).getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},{getInitialState:e=>({...e,pagination:{...pq(),...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:pb("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t)return void e._queue(()=>{t=!0});if(null!=(r=null!=(i=e.options.autoResetAll)?i:e.options.autoResetPageIndex)?r:!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=>px(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?pq():null!=(n=e.initialState.pagination)?n:pq())},e.setPageIndex=t=>{e.setPagination(n=>{let r=px(t,n.pageIndex);return r=Math.max(0,Math.min(r,void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1)),{...n,pageIndex:r}})},e.resetPageIndex=t=>{var n,r;e.setPageIndex(t?0:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageIndex)?n:0)},e.resetPageSize=t=>{var n,r;e.setPageSize(t?10:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,px(t,e.pageSize)),r=Math.floor(e.pageSize*e.pageIndex/n);return{...e,pageIndex:r,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{var r;let i=px(t,null!=(r=e.options.pageCount)?r:-1);return"number"==typeof i&&(i=Math.max(-1,i)),{...n,pageCount:i}}),e.getPageOptions=pS(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},pA(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:pY(),...e}),getDefaultOptions:e=>({onRowPinningChange:pb("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{let o=r?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],a=new Set([...i?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],e.id,...o]);t.setRowPinning(e=>{var t,r,i,o,s,l;return"bottom"===n?{top:(null!=(i=null==e?void 0:e.top)?i:[]).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!=(r=null==e?void 0:e.bottom)?r:[]).filter(e=>!(null!=a&&a.has(e)))}})},e.getCanPin=()=>{var n;let{enableRowPinning:r,enablePinning:i}=t.options;return"function"==typeof r?r(e):null==(n=null!=r?r:i)||n},e.getIsPinned=()=>{let n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(e=>null==r?void 0:r.includes(e)),a=n.some(e=>null==i?void 0:i.includes(e));return o?"top":!!a&&"bottom"},e.getPinnedIndex=()=>{var n,r;let i=e.getIsPinned();if(!i)return -1;let o=null==(n="top"===i?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(r=null==o?void 0:o.indexOf(e.id))?r:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?pY():null!=(n=null==(r=e.initialState)?void 0:r.rowPinning)?n:pY())},e.getIsSomeRowsPinned=t=>{var n,r,i;let o=e.getState().rowPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(r=o.top)?void 0:r.length)||(null==(i=o.bottom)?void 0:i.length))},e._getPinnedRows=(t,n,r)=>{var i;return(null==(i=e.options.keepPinnedRows)||i?(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:r}))},e.getTopRows=pS(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),pA(e.options,"debugRows","getTopRows")),e.getBottomRows=pS(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),pA(e.options,"debugRows","getBottomRows")),e.getCenterRows=pS(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let r=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!r.has(e.id))},pA(e.options,"debugRows","getCenterRows"))}},{getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:pb("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 r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(e=>{e.getCanSelect()&&(r[e.id]=!0)}):i.forEach(e=>{delete r[e.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let r=void 0!==t?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(t=>{pX(i,t.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=pS(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?pZ(e,n):{rows:[],flatRows:[],rowsById:{}},pA(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=pS(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?pZ(e,n):{rows:[],flatRows:[],rowsById:{}},pA(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=pS(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?pZ(e,n):{rows:[],flatRows:[],rowsById:{}},pA(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),r=!!(t.length&&Object.keys(n).length);return r&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),r=!!t.length;return r&&t.some(e=>!n[e.id])&&(r=!1),r},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,r)=>{let i=e.getIsSelected();t.setRowSelection(o=>{var a;if(n=void 0!==n?n:!i,e.getCanSelect()&&i===n)return o;let s={...o};return pX(s,e.id,n,null==(a=null==r?void 0:r.selectChildren)||a,t),s})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return pK(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return"some"===pQ(e,n)},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return"all"===pQ(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 r;t&&e.toggleSelected(null==(r=n.target)?void 0:r.checked)}}}},{getDefaultColumnDef:()=>pH,getInitialState:e=>({columnSizing:{},columnSizingInfo:p$(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:pb("columnSizing",e),onColumnSizingInfoChange:pb("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;let o=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:pH.minSize,null!=(r=null!=o?o:e.columnDef.size)?r:pH.size),null!=(i=e.columnDef.maxSize)?i:pH.maxSize)},e.getStart=pS(e=>[e,pU(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),pA(t.options,"debugColumns","getStart")),e.getAfter=pS(e=>[e,pU(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),pA(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>{var n,r;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(r=t.options.enableColumnResizing)||r)},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 r;t+=null!=(r=e.column.getSize())?r: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 r=t.getColumn(e.column.id),i=null==r?void 0:r.getCanResize();return o=>{if(!r||!i||(null==o.persist||o.persist(),pG(o)&&o.touches&&o.touches.length>1))return;let a=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[r.id,r.getSize()]],l=pG(o)?Math.round(o.touches[0].clientX):o.clientX,u={},c=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var r,i;let o="rtl"===t.options.columnResizeDirection?-1:1,a=(n-(null!=(r=null==e?void 0:e.startOffset)?r:0))*o,s=Math.max(a/(null!=(i=null==e?void 0:e.startSize)?i: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})))},d=e=>{c("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||("u">typeof document?document:null),p={moveHandler:e=>c("move",e.clientX),upHandler:e=>{null==h||h.removeEventListener("mousemove",p.moveHandler),null==h||h.removeEventListener("mouseup",p.upHandler),d(e.clientX)}},f={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),c("move",e.touches[0].clientX),!1),upHandler:e=>{var t;null==h||h.removeEventListener("touchmove",f.moveHandler),null==h||h.removeEventListener("touchend",f.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(null==(t=e.touches[0])?void 0:t.clientX)}},g=!!function(){if("boolean"==typeof pW)return pW;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 pW=e}()&&{passive:!1};pG(o)?(null==h||h.addEventListener("touchmove",f.moveHandler,g),null==h||h.addEventListener("touchend",f.upHandler,g)):(null==h||h.addEventListener("mousemove",p.moveHandler,g),null==h||h.addEventListener("mouseup",p.upHandler,g)),t.setColumnSizingInfo(e=>({...e,startOffset:l,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.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?p$():null!=(n=e.initialState.columnSizingInfo)?n:p$())},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 p3(e){let t=[],n=e=>{var r;t.push(e),null!=(r=e.subRows)&&r.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}let p6={À:"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"},p8=RegExp(Object.keys(p6).join("|"),"g"),p9={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function p7(e,t,n){let r;return(e=fe(e,n),(t=fe(t,n)).length>e.length)?p9.NO_MATCH:e===t?p9.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase())===(t=t.toLowerCase())?p9.EQUAL:e.startsWith(t)?p9.STARTS_WITH:e.includes(` ${t}`)?p9.WORD_STARTS_WITH:e.includes(t)?p9.CONTAINS:1===t.length?p9.NO_MATCH:(r="",e.split(" ").forEach(e=>{e.split("-").forEach(e=>{r+=e.substr(0,1)})}),r).includes(t)?p9.ACRONYM:function(e,t){var n;let r,i=0,o=0;function a(e,t,n){for(let r=n,o=t.length;r<o;r++)if(t[r]===e)return i+=1,r+1;return -1}let s=a(t[0],e,0);if(s<0)return p9.NO_MATCH;o=s;for(let n=1,r=t.length;n<r;n++)if(!((o=a(t[n],e,o))>-1))return p9.NO_MATCH;return n=o-s,r=i/t.length,p9.MATCHES+1/n*r}(e,t)}function fe(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(p8,e=>p6[e])),e}let ft={maxRanking:1/0,minRanking:-1/0};function fn(e,t,{isHeader:n,isLastColumn:r,isFirstColumn:i,defaultColumnHeight:o}={}){var a,s;let l=e.spacing(1),u=e.spacing(1.25),c=e.spacing(2),d=i?c:u,h=r?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),d=i?c:u,h=r?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),d=i?c:u,h=r?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} ${h} ${l} ${d}`,height:g,fontSize:f,lineHeight:p}}function fr(e,t){return e.map(({width:e,align:n,headerDescription:r,cellDescription:i,enableSorting:o,dataLink:a,enableResizing:s,...l})=>{var u,c,d,h,p,f,g;let m=s??t?.enableResizing??!1,v="auto"===e||void 0===e?(u=m,c=t?.minWidth,d=t?.maxWidth,u?{size:150,minSize:c??60,maxSize:d??1e3}:{size:0,minSize:0,maxSize:0}):(h=m,p=e,f=t?.minWidth,g=t?.maxWidth,h?{size:p,minSize:f??60,maxSize:g??1e3}:{size:p});return{...l,...v,enableSorting:!!o,enableResizing:m,meta:{align:n,headerDescription:r,cellDescription:i,dataLink:a}}})}var fi=n(32560),fo=n(22402);let fa=(0,fo.A)((0,_.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"),fs=(0,fo.A)((0,_.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"),fl=(0,fo.A)((0,_.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 fu(e){return(0,V.Ay)("MuiCheckbox",e)}let fc=(0,j.A)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]);var fd=n(64606);let fh=(0,N.A)(fi.A,{shouldForwardProp:e=>(0,Z.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,L.A)(n.size)}`],"default"!==n.color&&t[`color${(0,L.A)(n.color)}`]]}})((0,B.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,E.X4)(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter((0,z.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,E.X4)(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter((0,z.A)()).map(([t])=>({props:{color:t},style:{[`&.${fc.checked}, &.${fc.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${fc.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),fp=(0,_.jsx)(fs,{}),ff=(0,_.jsx)(fa,{}),fg=(0,_.jsx)(fl,{}),fm=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiCheckbox"}),{checkedIcon:r=fp,color:i="primary",icon:o=ff,indeterminate:a=!1,indeterminateIcon:s=fg,inputProps:l,size:u="medium",disableRipple:c=!1,className:d,slots:h={},slotProps:p={},...f}=n,g=a?s:o,m=a?s:r,v={...n,disableRipple:c,color:i,indeterminate:a,size:u},y=(e=>{let{classes:t,indeterminate:n,color:r,size:i}=e,o={root:["root",n&&"indeterminate",`color${(0,L.A)(r)}`,`size${(0,L.A)(i)}`]},a=(0,R.A)(o,fu,t);return{...t,...a}})(v),x=p.input??l,[b,w]=(0,cn.A)("root",{ref:t,elementType:fh,className:(0,O.A)(y.root,d),shouldForwardComponentProp:!0,externalForwardedProps:{slots:h,slotProps:p,...f},ownerState:v,additionalProps:{type:"checkbox",icon:I.cloneElement(g,{fontSize:g.props.fontSize??u}),checkedIcon:I.cloneElement(m,{fontSize:m.props.fontSize??u}),disableRipple:c,slots:h,slotProps:{input:(0,fd.A)("function"==typeof x?x(v):x,{"data-indeterminate":a})}}});return(0,_.jsx)(b,{...w,classes:y})});function fv({color:e,density:t,...n}){let r="compact"===t;return(0,_.jsx)(fm,{size:r?"small":"medium",...n,focusRipple:!1,tabIndex:-1,sx:{color:e,padding:e=>e.spacing(r?.25:.5),position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)","&.Mui-checked":{color:e},"&.Mui-focusVisible":{background:e?(0,E.X4)(e,.5):void 0},"& .MuiSvgIcon-root":{fontSize:r?16:18}}})}let fy=I.createContext();function fx(e){return(0,V.Ay)("MuiTableRow",e)}let fb=(0,j.A)("MuiTableRow",["root","selected","hover","head","footer"]),fw=(0,N.A)("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})((0,B.A)(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${fb.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${fb.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,E.X4)(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,E.X4)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)}}}))),fS=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiTableRow"}),{className:r,component:i="tr",hover:o=!1,selected:a=!1,...s}=n,l=I.useContext(fy),u={...n,component:i,hover:o,selected:a,head:l&&"head"===l.variant,footer:l&&"footer"===l.variant},c=(e=>{let{classes:t,selected:n,hover:r,head:i,footer:o}=e;return(0,R.A)({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},fx,t)})(u);return(0,_.jsx)(fw,{as:i,ref:t,className:(0,O.A)(c.root,r),role:"tr"===i?null:"row",ownerState:u,...s})});var fA=n(76746);function fC(e){return(0,V.Ay)("MuiDivider",e)}let fM=(0,j.A)("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),fk=(0,j.A)("MuiListItemIcon",["root","alignItemsFlexStart"]);function fT(e){return(0,V.Ay)("MuiMenuItem",e)}let f_=(0,j.A)("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),fI=(0,N.A)(K.A,{shouldForwardProp:e=>(0,Z.A)(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})((0,B.A)(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${f_.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,E.X4)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${f_.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,E.X4)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${f_.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,E.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,E.X4)(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${f_.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${f_.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${fM.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${fM.inset}`]:{marginLeft:52},[`& .${ct.root}`]:{marginTop:0,marginBottom:0},[`& .${ct.inset}`]:{paddingLeft:36},[`& .${fk.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${fk.root} svg`]:{fontSize:"1.25rem"}}}]}))),fD=I.forwardRef(function(e,t){let n,r=(0,F.b)({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:a=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:u,role:c="menuitem",tabIndex:d,className:h,...p}=r,f=I.useContext(u5.A),g=I.useMemo(()=>({dense:a||f.dense||!1,disableGutters:l}),[f.dense,a,l]),m=I.useRef(null);(0,u1.A)(()=>{i&&m.current&&m.current.focus()},[i]);let v={...r,dense:g.dense,divider:s,disableGutters:l},y=(e=>{let{disabled:t,dense:n,divider:r,disableGutters:i,selected:o,classes:a}=e,s=(0,R.A)({root:["root",n&&"dense",t&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},fT,a);return{...a,...s}})(r),x=(0,u2.A)(m,t);return r.disabled||(n=void 0!==d?d:-1),(0,_.jsx)(u5.A.Provider,{value:g,children:(0,_.jsx)(fI,{ref:x,role:c,tabIndex:n,component:o,focusVisibleClassName:(0,O.A)(y.focusVisible,u),className:(0,O.A)(y.root,h),...p,ownerState:v,classes:y})})});var fO=n(76795);let fR=I.createContext();function fE(e){return(0,V.Ay)("MuiTableCell",e)}let fP=(0,j.A)("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),fL=(0,N.A)("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`size${(0,L.A)(n.size)}`],"normal"!==n.padding&&t[`padding${(0,L.A)(n.padding)}`],"inherit"!==n.align&&t[`align${(0,L.A)(n.align)}`],n.stickyHeader&&t.stickyHeader]}})((0,B.A)(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid
33
+ ${"light"===e.palette.mode?(0,E.a)((0,E.X4)(e.palette.divider,1),.88):(0,E.e$)((0,E.X4)(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${fP.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:e})=>e.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),fN=I.forwardRef(function(e,t){let n,r=(0,F.b)({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:a,padding:s,scope:l,size:u,sortDirection:c,variant:d,...h}=r,p=I.useContext(fR),f=I.useContext(fy),g=f&&"head"===f.variant,m=l;"td"===(n=a||(g?"th":"td"))?m=void 0:!m&&g&&(m="col");let v=d||f&&f.variant,y={...r,align:i,component:n,padding:s||(p&&p.padding?p.padding:"normal"),size:u||(p&&p.size?p.size:"medium"),sortDirection:c,stickyHeader:"head"===v&&p&&p.stickyHeader,variant:v},x=(e=>{let{classes:t,variant:n,align:r,padding:i,size:o,stickyHeader:a}=e,s={root:["root",n,a&&"stickyHeader","inherit"!==r&&`align${(0,L.A)(r)}`,"normal"!==i&&`padding${(0,L.A)(i)}`,`size${(0,L.A)(o)}`]};return(0,R.A)(s,fE,t)})(y),b=null;return c&&(b="asc"===c?"ascending":"descending"),(0,_.jsx)(fL,{as:n,ref:t,className:(0,O.A)(x.root,o),"aria-sort":b,scope:m,ownerState:y,...h})});function fB(e){return(0,V.Ay)("MuiToolbar",e)}(0,j.A)("MuiToolbar",["root","gutters","regular","dense"]);let fz=(0,N.A)("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})((0,B.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}]}))),fF=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiToolbar"}),{className:r,component:i="div",disableGutters:o=!1,variant:a="regular",...s}=n,l={...n,component:i,disableGutters:o,variant:a},u=(e=>{let{classes:t,disableGutters:n,variant:r}=e;return(0,R.A)({root:["root",!n&&"gutters",r]},fB,t)})(l);return(0,_.jsx)(fz,{as:i,className:(0,O.A)(u.root,r),ref:t,ownerState:l,...s})});var fj=n(35216);let fV=(0,fo.A)((0,_.jsx)("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),fH=(0,fo.A)((0,_.jsx)("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),f$=(0,fo.A)((0,_.jsx)("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),fW=(0,fo.A)((0,_.jsx)("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),fG=I.forwardRef(function(e,t){let{backIconButtonProps:n,count:r,disabled:i=!1,getItemAriaLabel:o,nextIconButtonProps:a,onPageChange:s,page:l,rowsPerPage:u,showFirstButton:c,showLastButton:d,slots:h={},slotProps:p={},...f}=e,g=(0,fj.I)(),m=h.firstButton??eA,v=h.lastButton??eA,y=h.nextButton??eA,x=h.previousButton??eA,b=h.firstButtonIcon??fW,w=h.lastButtonIcon??f$,S=h.nextButtonIcon??fH,A=h.previousButtonIcon??fV,C=g?v:m,M=g?y:x,k=g?x:y,T=g?m:v,I=g?p.lastButton:p.firstButton,D=g?p.nextButton:p.previousButton,O=g?p.previousButton:p.nextButton,R=g?p.firstButton:p.lastButton;return(0,_.jsxs)("div",{ref:t,...f,children:[c&&(0,_.jsx)(C,{onClick:e=>{s(e,0)},disabled:i||0===l,"aria-label":o("first",l),title:o("first",l),...I,children:g?(0,_.jsx)(w,{...p.lastButtonIcon}):(0,_.jsx)(b,{...p.firstButtonIcon})}),(0,_.jsx)(M,{onClick:e=>{s(e,l-1)},disabled:i||0===l,color:"inherit","aria-label":o("previous",l),title:o("previous",l),...D??n,children:g?(0,_.jsx)(S,{...p.nextButtonIcon}):(0,_.jsx)(A,{...p.previousButtonIcon})}),(0,_.jsx)(k,{onClick:e=>{s(e,l+1)},disabled:i||-1!==r&&l>=Math.ceil(r/u)-1,color:"inherit","aria-label":o("next",l),title:o("next",l),...O??a,children:g?(0,_.jsx)(A,{...p.previousButtonIcon}):(0,_.jsx)(S,{...p.nextButtonIcon})}),d&&(0,_.jsx)(T,{onClick:e=>{s(e,Math.max(0,Math.ceil(r/u)-1))},disabled:i||l>=Math.ceil(r/u)-1,"aria-label":o("last",l),title:o("last",l),...R,children:g?(0,_.jsx)(b,{...p.firstButtonIcon}):(0,_.jsx)(w,{...p.lastButtonIcon})})]})});function fU(e){return(0,V.Ay)("MuiTablePagination",e)}let fq=(0,j.A)("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]),fY=(0,N.A)(fN,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})((0,B.A)(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),fX=(0,N.A)(fF,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${fq.actions}`]:t.actions,...t.toolbar})})((0,B.A)(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${fq.actions}`]:{flexShrink:0,marginLeft:20}}))),fZ=(0,N.A)("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),fK=(0,N.A)("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})((0,B.A)(({theme:e})=>({...e.typography.body2,flexShrink:0}))),fQ=(0,N.A)(fO.A,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${fq.selectIcon}`]:t.selectIcon,[`& .${fq.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${fq.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),fJ=(0,N.A)(fD,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),f0=(0,N.A)("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})((0,B.A)(({theme:e})=>({...e.typography.body2,flexShrink:0})));function f1({from:e,to:t,count:n}){return`${e}–${t} of ${-1!==n?n:`more than ${t}`}`}function f2(e){return`Go to ${e} page`}let f5=I.forwardRef(function(e,t){let n,r=(0,F.b)({props:e,name:"MuiTablePagination"}),{ActionsComponent:i=fG,backIconButtonProps:o,colSpan:a,component:s=fN,count:l,disabled:u=!1,getItemAriaLabel:c=f2,labelDisplayedRows:d=f1,labelRowsPerPage:h="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:A={},slots:C={},...M}=r,k=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},fU,t)})(r),T=A?.select??x,D=T.native?"option":fJ;(s===fN||"td"===s)&&(n=a||1e3);let E=(0,X.A)(T.id),P=(0,X.A)(T.labelId),L={slots:C,slotProps:A},[N,B]=(0,cn.A)("root",{ref:t,className:k.root,elementType:fY,externalForwardedProps:{...L,component:s,...M},ownerState:r,additionalProps:{colSpan:n}}),[z,j]=(0,cn.A)("toolbar",{className:k.toolbar,elementType:fX,externalForwardedProps:L,ownerState:r}),[V,H]=(0,cn.A)("spacer",{className:k.spacer,elementType:fZ,externalForwardedProps:L,ownerState:r}),[$,W]=(0,cn.A)("selectLabel",{className:k.selectLabel,elementType:fK,externalForwardedProps:L,ownerState:r,additionalProps:{id:P}}),[G,U]=(0,cn.A)("select",{className:k.select,elementType:fQ,externalForwardedProps:L,ownerState:r}),[q,Y]=(0,cn.A)("menuItem",{className:k.menuItem,elementType:D,externalForwardedProps:L,ownerState:r}),[Z,K]=(0,cn.A)("displayedRows",{className:k.displayedRows,elementType:f0,externalForwardedProps:L,ownerState:r});return(0,_.jsx)(N,{...B,children:(0,_.jsxs)(z,{...j,children:[(0,_.jsx)(V,{...H}),y.length>1&&(0,_.jsx)($,{...W,children:h}),y.length>1&&(0,_.jsx)(G,{variant:"standard",...!T.variant&&{input:S||(S=(0,_.jsx)(fA.Ay,{}))},value:v,onChange:g,id:E,labelId:P,...T,classes:{...T.classes,root:(0,O.A)(k.input,k.selectRoot,(T.classes||{}).root),select:(0,O.A)(k.select,(T.classes||{}).select),icon:(0,O.A)(k.selectIcon,(T.classes||{}).icon)},disabled:u,...U,children:y.map(e=>(0,I.createElement)(q,{...Y,key:e.label?e.label:e,value:e.value?e.value:e},e.label?e.label:e))}),(0,_.jsx)(Z,{...K,children:d({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,_.jsx)(i,{className:k.actions,backIconButtonProps:o,count:l,nextIconButtonProps:p,onPageChange:f,page:m,rowsPerPage:v,showFirstButton:b,showLastButton:w,slotProps:A.actions,slots:C.actions,getItemAriaLabel:c,disabled:u})]})})}),f4={row:0,column:0},f3=new Set(["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"]);function f6(e){return(0,V.Ay)("MuiTable",e)}(0,j.A)("MuiTable",["root","stickyHeader"]);let f8=(0,N.A)("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})((0,B.A)(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:e})=>e.stickyHeader,style:{borderCollapse:"separate"}}]}))),f9="table",f7=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiTable"}),{className:r,component:i=f9,padding:o="normal",size:a="medium",stickyHeader:s=!1,...l}=n,u={...n,component:i,padding:o,size:a,stickyHeader:s},c=(e=>{let{classes:t,stickyHeader:n}=e;return(0,R.A)({root:["root",n&&"stickyHeader"]},f6,t)})(u),d=I.useMemo(()=>({padding:o,size:a,stickyHeader:s}),[o,a,s]);return(0,_.jsx)(fR.Provider,{value:d,children:(0,_.jsx)(f8,{as:i,role:i===f9?null:"table",ref:t,className:(0,O.A)(c.root,r),ownerState:u,...l})})}),ge=(0,N.A)(f7)(({theme:e})=>({tableLayout:"fixed",borderCollapse:"separate",backgroundColor:e.palette.background.default})),gt={compact:"small",standard:"medium",comfortable:"medium"},gn=(0,I.forwardRef)(function({density:e,...t},n){return(0,_.jsx)(ge,{...t,tabIndex:-1,size:gt[e],ref:n,sx:{width:"100%"}})});function gr(e){return(0,V.Ay)("MuiTableBody",e)}(0,j.A)("MuiTableBody",["root"]);let gi=(0,N.A)("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),go={variant:"body"},ga="tbody",gs=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiTableBody"}),{className:r,component:i=ga,...o}=n,a={...n,component:i},s=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"]},gr,t)})(a);return(0,_.jsx)(fy.Provider,{value:go,children:(0,_.jsx)(gi,{className:(0,O.A)(s.root,r),as:i,ref:t,role:i===ga?null:"rowgroup",ownerState:a,...o})})}),gl=(0,I.forwardRef)(function(e,t){return(0,_.jsx)(gs,{...e,ref:t})});var gu=n(93399);function gc(e){return(0,V.Ay)("MuiLink",e)}let gd=(0,j.A)("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]);var gh=n(95279);let gp={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},gf=(0,N.A)(u7.A,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`underline${(0,L.A)(n.underline)}`],"button"===n.component&&t.button]}})((0,B.A)(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:e,ownerState:t})=>"always"===e&&"inherit"!==t.color,style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(e.palette).filter((0,z.A)()).map(([t])=>({props:{underline:"always",color:t},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.4)`:(0,E.X4)(e.palette[t].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:(0,E.X4)(e.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.secondaryChannel} / 0.4)`:(0,E.X4)(e.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${gd.focusVisible}`]:{outline:"auto"}}}]}))),gg=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiLink"}),r=(0,uH.A)(),{className:i,color:o="primary",component:a="a",onBlur:s,onFocus:l,TypographyClasses:u,underline:c="always",variant:d="inherit",sx:h,...p}=n,[f,g]=I.useState(!1),m={...n,color:o,component:a,focusVisible:f,underline:c,variant:d},v=(e=>{let{classes:t,component:n,focusVisible:r,underline:i}=e,o={root:["root",`underline${(0,L.A)(i)}`,"button"===n&&"button",r&&"focusVisible"]};return(0,R.A)(o,gc,t)})(m);return(0,_.jsx)(gf,{color:o,className:(0,O.A)(v.root,i),classes:u,component:a,onBlur:e=>{(0,gu.A)(e.target)||g(!1),s&&s(e)},onFocus:e=>{(0,gu.A)(e.target)&&g(!0),l&&l(e)},ref:t,ownerState:m,variant:d,...p,sx:[...void 0===gp[o]?[{color:o}]:[],...Array.isArray(h)?h:[h]],style:{...p.style,..."always"===c&&"inherit"!==o&&!gp[o]&&{"--Link-underlineColor":(({theme:e,ownerState:t})=>{let n=t.color,r=(0,gh.Yn)(e,`palette.${n}.main`,!1)||(0,gh.Yn)(e,`palette.${n}`,!1)||t.color,i=(0,gh.Yn)(e,`palette.${n}.mainChannel`)||(0,gh.Yn)(e,`palette.${n}Channel`);return"vars"in e&&i?`rgba(${i} / 0.4)`:(0,E.X4)(r,.4)})({theme:r,ownerState:m})}}})}),gm=(0,N.A)(fN)(({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 gv({children:e,density:t,variant:n,width:r,defaultColumnHeight:i,focusState:o="none",onFocusTrigger:a,isFirstColumn:s,isLastColumn:l,description:u,align:c,color:d,backgroundColor:h,dataLink:p,adjacentCellsValuesMap:f,...g}){let m=(0,uH.A)(),v=(0,I.useRef)(),y="head"===n;(0,I.useEffect)(()=>{"trigger-focus"===o&&v.current&&v.current.focus()},[o]);let x=e=>{a?.(e)},b=(0,I.useMemo)(()=>{if(p){if(f&&i$(p.url)){let{text:e}=iF(p.url,f,{urlEncode:!0});return{...p,url:e}}return p}},[p,f]);return(0,_.jsx)(gm,{...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:r},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:`${h??m.palette.background.default} !important`,outline:`solid 1px ${m.palette.info.main}`,outlineOffset:"-1px"}},ref:v,children:(0,_.jsx)(uQ,{id:"original-cell",sx:{...fn(m,t,{isHeader:y,isLastColumn:l,isFirstColumn:s,defaultColumnHeight:i}),position:"relative",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexDirection:"inherit"},style:{backgroundColor:h??"inherit",color:d??"inherit"},title:u,"aria-label":u,textAlign:c,children:b?(0,_.jsx)(gg,{href:b.url,target:b.targetBlank?"_blank":"_self",rel:b.targetBlank?"noopener noreferrer":void 0,children:e}):e})})}function gy(e){return(0,V.Ay)("MuiTableFooter",e)}(0,j.A)("MuiTableFooter",["root"]);let gx=(0,N.A)("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-footer-group"}),gb={variant:"footer"},gw="tfoot",gS=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiTableFooter"}),{className:r,component:i=gw,...o}=n,a={...n,component:i},s=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"]},gy,t)})(a);return(0,_.jsx)(fy.Provider,{value:gb,children:(0,_.jsx)(gx,{as:i,className:(0,O.A)(s.root,r),ref:t,role:i===gw?null:"rowgroup",ownerState:a,...o})})}),gA=(0,I.forwardRef)(function(e,t){return(0,_.jsx)(gS,{...e,ref:t})});function gC(e){return(0,V.Ay)("MuiTableHead",e)}(0,j.A)("MuiTableHead",["root"]);let gM=(0,N.A)("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),gk={variant:"head"},gT="thead",g_=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiTableHead"}),{className:r,component:i=gT,...o}=n,a={...n,component:i},s=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"]},gC,t)})(a);return(0,_.jsx)(fy.Provider,{value:gk,children:(0,_.jsx)(gM,{as:i,className:(0,O.A)(s.root,r),ref:t,role:i===gT?null:"rowgroup",ownerState:a,...o})})}),gI=(0,I.forwardRef)(function(e,t){return(0,_.jsx)(g_,{...e,ref:t})}),gD=(0,fo.A)((0,_.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");function gO(e){return(0,V.Ay)("MuiTableSortLabel",e)}let gR=(0,j.A)("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc","directionDesc","directionAsc"]),gE=(0,N.A)(K.A,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.active&&t.active]}})((0,B.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,[`& .${gR.icon}`]:{opacity:.5}},[`&.${gR.active}`]:{color:(e.vars||e).palette.text.primary,[`& .${gR.icon}`]:{opacity:1,color:(e.vars||e).palette.text.secondary}}}))),gP=(0,N.A)("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,t[`iconDirection${(0,L.A)(n.direction)}`]]}})((0,B.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)"}}]}))),gL=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiTableSortLabel"}),{active:r=!1,children:i,className:o,direction:a="asc",hideSortIcon:s=!1,IconComponent:l=gD,slots:u={},slotProps:c={},...d}=n,h={...n,active:r,direction:a,hideSortIcon:s,IconComponent:l},p=(e=>{let{classes:t,direction:n,active:r}=e,i={root:["root",r&&"active",`direction${(0,L.A)(n)}`],icon:["icon",`iconDirection${(0,L.A)(n)}`]};return(0,R.A)(i,gO,t)})(h),f={slots:u,slotProps:c},[g,m]=(0,cn.A)("root",{elementType:gE,externalForwardedProps:f,ownerState:h,className:(0,O.A)(p.root,o),ref:t}),[v,y]=(0,cn.A)("icon",{elementType:gP,externalForwardedProps:f,ownerState:h,className:p.icon});return(0,_.jsxs)(g,{disableRipple:!0,component:"span",...m,...d,children:[i,s&&!r?null:(0,_.jsx)(v,{as:l,...y})]})}),gN=(0,N.A)("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,"vertical"===n.orientation&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&"vertical"===n.orientation&&t.withChildrenVertical,"right"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignRight,"left"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignLeft]}})((0,B.A)(({theme:e})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:(0,E.X4)(e.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:e})=>!!e.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:e})=>e.children&&"vertical"!==e.orientation,style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:e})=>"vertical"===e.orientation&&e.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:e})=>"right"===e.textAlign&&"vertical"!==e.orientation,style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:e})=>"left"===e.textAlign&&"vertical"!==e.orientation,style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),gB=(0,N.A)("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.wrapper,"vertical"===n.orientation&&t.wrapperVertical]}})((0,B.A)(({theme:e})=>({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}))),gz=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiDivider"}),{absolute:r=!1,children:i,className:o,orientation:a="horizontal",component:s=i||"vertical"===a?"div":"hr",flexItem:l=!1,light:u=!1,role:c="hr"!==s?"separator":void 0,textAlign:d="center",variant:h="fullWidth",...p}=n,f={...n,absolute:r,component:s,flexItem:l,light:u,orientation:a,role:c,textAlign:d,variant:h},g=(e=>{let{absolute:t,children:n,classes:r,flexItem:i,light:o,orientation:a,textAlign:s,variant:l}=e;return(0,R.A)({root:["root",t&&"absolute",l,o&&"light","vertical"===a&&"vertical",i&&"flexItem",n&&"withChildren",n&&"vertical"===a&&"withChildrenVertical","right"===s&&"vertical"!==a&&"textAlignRight","left"===s&&"vertical"!==a&&"textAlignLeft"],wrapper:["wrapper","vertical"===a&&"wrapperVertical"]},fC,r)})(f);return(0,_.jsx)(gN,{as:s,className:(0,O.A)(g.root,o),role:c,ref:t,ownerState:f,"aria-orientation":"separator"===c&&("hr"!==s||"vertical"===a)?a:void 0,...p,children:i?(0,_.jsx)(gB,{className:g.wrapper,ownerState:f,children:i}):null})});function gF({onSort:e,sortDirection:t,nextSortDirection:n,children:r,resizeConfig:i,...o}){let a=!!e,s=(0,_.jsx)(u7.A,{noWrap:!0,variant:"inherit",component:"div",color:"inherit",children:r}),l=!!t;return(0,_.jsxs)(gv,{...o,children:[a?(0,_.jsx)(gL,{onClick:e,direction:l?t:n,active:l,sx:{verticalAlign:"unset",maxWidth:"100%","&:focus-visible":{[`& .${gR.icon}`]:{opacity:l?1:.5}}},children:s}):s,i&&(0,_.jsx)(uQ,{onMouseDown:e=>{2===e.detail?i.resetSizeHandler():i.resizeHandler(e)},onTouchStart:i.resizeHandler,sx:{position:"absolute",height:"100%",top:0,right:"4px",cursor:"col-resize"},children:(0,_.jsx)(gz,{flexItem:!0,orientation:"vertical",sx:e=>({backgroundColor:i.isResizing?e.palette.action.active:e.palette.divider,borderRadius:"2px",borderWidth:"2px",height:"100%",touchAction:"none",transform:"translateX(4px)",userSelect:"none"})})})]})}gz&&(gz.muiSkipListHighlight=!0);let gj=(0,I.forwardRef)(function(e,t){return(0,_.jsx)(fS,{...e,ref:t,sx:{backgroundColor:e=>e.palette.background.default,"&:hover":{backgroundColor:e=>(0,E.X4)(e.palette.primary.main,e.palette.action.hoverOpacity)}}})});var gV=n(88404),gH=n(42872);function g$(e){return(0,V.Ay)("MuiInputAdornment",e)}let gW=(0,j.A)("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]),gG=(0,N.A)("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`position${(0,L.A)(n.position)}`],!0===n.disablePointerEvents&&t.disablePointerEvents,t[n.variant]]}})((0,B.A)(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${gW.positionStart}&:not(.${gW.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),gU=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiInputAdornment"}),{children:r,className:i,component:o="div",disablePointerEvents:a=!1,disableTypography:s=!1,position:l,variant:u,...c}=n,d=(0,gH.A)()||{},h=u;u&&d.variant,d&&!h&&(h=d.variant);let p={...n,hiddenLabel:d.hiddenLabel,size:d.size,disablePointerEvents:a,position:l,variant:h},f=(e=>{let{classes:t,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:a}=e,s={root:["root",n&&"disablePointerEvents",i&&`position${(0,L.A)(i)}`,a,r&&"hiddenLabel",o&&`size${(0,L.A)(o)}`]};return(0,R.A)(s,g$,t)})(p);return(0,_.jsx)(gV.A.Provider,{value:null,children:(0,_.jsx)(gG,{as:o,ownerState:p,className:(0,O.A)(f.root,i),ref:t,...c,children:"string"!=typeof r||s?(0,_.jsxs)(I.Fragment,{children:["start"===l?A||(A=(0,_.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,r]}):(0,_.jsx)(u7.A,{color:"textSecondary",children:r})})})});var gq=n(3725),gY=n(30443),gX=n(46823),gZ=n(95591),gK=n(31789),gQ=n(10713);function gJ(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function g0(e){var t=gJ(e).Element;return e instanceof t||e instanceof Element}function g1(e){var t=gJ(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function g2(e){if("u"<typeof ShadowRoot)return!1;var t=gJ(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}var g5=Math.max,g4=Math.min,g3=Math.round;function g6(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function g8(){return!/^((?!chrome|android).)*safari/i.test(g6())}function g9(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&g1(e)&&(i=e.offsetWidth>0&&g3(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&g3(r.height)/e.offsetHeight||1);var a=(g0(e)?gJ(e):window).visualViewport,s=!g8()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/i,u=(r.top+(s&&a?a.offsetTop:0))/o,c=r.width/i,d=r.height/o;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l,x:l,y:u}}function g7(e){var t=gJ(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function me(e){return e?(e.nodeName||"").toLowerCase():null}function mt(e){return((g0(e)?e.ownerDocument:e.document)||window.document).documentElement}function mn(e){return g9(mt(e)).left+g7(e).scrollLeft}function mr(e){return gJ(e).getComputedStyle(e)}function mi(e){var t=mr(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function mo(e){var t=g9(e),n=e.offsetWidth,r=e.offsetHeight;return 1>=Math.abs(t.width-n)&&(n=t.width),1>=Math.abs(t.height-r)&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function ma(e){return"html"===me(e)?e:e.assignedSlot||e.parentNode||(g2(e)?e.host:null)||mt(e)}function ms(e,t){void 0===t&&(t=[]);var n,r=function e(t){return["html","body","#document"].indexOf(me(t))>=0?t.ownerDocument.body:g1(t)&&mi(t)?t:e(ma(t))}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=gJ(r),a=i?[o].concat(o.visualViewport||[],mi(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(ms(ma(a)))}function ml(e){return g1(e)&&"fixed"!==mr(e).position?e.offsetParent:null}function mu(e){for(var t=gJ(e),n=ml(e);n&&["table","td","th"].indexOf(me(n))>=0&&"static"===mr(n).position;)n=ml(n);return n&&("html"===me(n)||"body"===me(n)&&"static"===mr(n).position)?t:n||function(e){var t=/firefox/i.test(g6());if(/Trident/i.test(g6())&&g1(e)&&"fixed"===mr(e).position)return null;var n=ma(e);for(g2(n)&&(n=n.host);g1(n)&&0>["html","body"].indexOf(me(n));){var r=mr(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var mc="bottom",md="right",mh="left",mp="auto",mf=["top",mc,md,mh],mg="start",mm="viewport",mv="popper",my=mf.reduce(function(e,t){return e.concat([t+"-"+mg,t+"-end"])},[]),mx=[].concat(mf,[mp]).reduce(function(e,t){return e.concat([t,t+"-"+mg,t+"-end"])},[]),mb=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"],mw={placement:"bottom",modifiers:[],strategy:"absolute"};function mS(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}var mA={passive:!0};function mC(e){return e.split("-")[0]}function mM(e){return e.split("-")[1]}function mk(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function mT(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?mC(i):null,a=i?mM(i):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case"top":t={x:s,y:n.y-r.height};break;case mc:t={x:s,y:n.y+n.height};break;case md:t={x:n.x+n.width,y:l};break;case mh:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=o?mk(o):null;if(null!=u){var c="y"===u?"height":"width";switch(a){case mg:t[u]=t[u]-(n[c]/2-r[c]/2);break;case"end":t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}var m_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function mI(e){var t,n,r,i,o,a,s,l=e.popper,u=e.popperRect,c=e.placement,d=e.variation,h=e.offsets,p=e.position,f=e.gpuAcceleration,g=e.adaptive,m=e.roundOffsets,v=e.isFixed,y=h.x,x=void 0===y?0:y,b=h.y,w=void 0===b?0:b,S="function"==typeof m?m({x:x,y:w}):{x:x,y:w};x=S.x,w=S.y;var A=h.hasOwnProperty("x"),C=h.hasOwnProperty("y"),M=mh,k="top",T=window;if(g){var _=mu(l),I="clientHeight",D="clientWidth";_===gJ(l)&&"static"!==mr(_=mt(l)).position&&"absolute"===p&&(I="scrollHeight",D="scrollWidth"),("top"===c||(c===mh||c===md)&&"end"===d)&&(k=mc,w-=(v&&_===T&&T.visualViewport?T.visualViewport.height:_[I])-u.height,w*=f?1:-1),(c===mh||("top"===c||c===mc)&&"end"===d)&&(M=md,x-=(v&&_===T&&T.visualViewport?T.visualViewport.width:_[D])-u.width,x*=f?1:-1)}var O=Object.assign({position:p},g&&m_),R=!0===m?(t={x:x,y:w},n=gJ(l),r=t.x,i=t.y,{x:g3(r*(o=n.devicePixelRatio||1))/o||0,y:g3(i*o)/o||0}):{x:x,y:w};return(x=R.x,w=R.y,f)?Object.assign({},O,((s={})[k]=C?"0":"",s[M]=A?"0":"",s.transform=1>=(T.devicePixelRatio||1)?"translate("+x+"px, "+w+"px)":"translate3d("+x+"px, "+w+"px, 0)",s)):Object.assign({},O,((a={})[k]=C?w+"px":"",a[M]=A?x+"px":"",a.transform="",a))}var mD={left:"right",right:"left",bottom:"top",top:"bottom"};function mO(e){return e.replace(/left|right|bottom|top/g,function(e){return mD[e]})}var mR={start:"end",end:"start"};function mE(e){return e.replace(/start|end/g,function(e){return mR[e]})}function mP(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&g2(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function mL(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function mN(e,t,n){var r,i,o,a,s,l,u,c,d,h;return t===mm?mL(function(e,t){var n=gJ(e),r=mt(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=g8();(u||!u&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+mn(e),y:l}}(e,n)):g0(t)?((r=g9(t,!1,"fixed"===n)).top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r):mL((i=mt(e),a=mt(i),s=g7(i),l=null==(o=i.ownerDocument)?void 0:o.body,u=g5(a.scrollWidth,a.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),c=g5(a.scrollHeight,a.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),d=-s.scrollLeft+mn(i),h=-s.scrollTop,"rtl"===mr(l||a).direction&&(d+=g5(a.clientWidth,l?l.clientWidth:0)-u),{width:u,height:c,x:d,y:h}))}function mB(){return{top:0,right:0,bottom:0,left:0}}function mz(e){return Object.assign({},mB(),e)}function mF(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}function mj(e,t){void 0===t&&(t={});var n,r,i,o,a,s,l,u,c=t,d=c.placement,h=void 0===d?e.placement:d,p=c.strategy,f=void 0===p?e.strategy:p,g=c.boundary,m=c.rootBoundary,v=c.elementContext,y=void 0===v?mv:v,x=c.altBoundary,b=c.padding,w=void 0===b?0:b,S=mz("number"!=typeof w?w:mF(w,mf)),A=e.rects.popper,C=e.elements[void 0!==x&&x?y===mv?"reference":mv:y],M=(n=g0(C)?C:C.contextElement||mt(e.elements.popper),r=void 0===g?"clippingParents":g,i=void 0===m?mm:m,l=(s=[].concat("clippingParents"===r?(o=ms(ma(n)),!g0(a=["absolute","fixed"].indexOf(mr(n).position)>=0&&g1(n)?mu(n):n)?[]:o.filter(function(e){return g0(e)&&mP(e,a)&&"body"!==me(e)})):[].concat(r),[i]))[0],(u=s.reduce(function(e,t){var r=mN(n,t,f);return e.top=g5(r.top,e.top),e.right=g4(r.right,e.right),e.bottom=g4(r.bottom,e.bottom),e.left=g5(r.left,e.left),e},mN(n,l,f))).width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u),k=g9(e.elements.reference),T=mT({reference:k,element:A,strategy:"absolute",placement:h}),_=mL(Object.assign({},A,T)),I=y===mv?_:k,D={top:M.top-I.top+S.top,bottom:I.bottom-M.bottom+S.bottom,left:M.left-I.left+S.left,right:I.right-M.right+S.right},O=e.modifiersData.offset;if(y===mv&&O){var R=O[h];Object.keys(D).forEach(function(e){var t=[md,mc].indexOf(e)>=0?1:-1,n=["top",mc].indexOf(e)>=0?"y":"x";D[e]+=R[n]*t})}return D}function mV(e,t,n){return g5(e,g4(t,n))}function mH(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function m$(e){return["top",md,mc,mh].some(function(t){return e[t]>=0})}var mW=(s=void 0===(a=(o={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,l=gJ(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(e){e.addEventListener("scroll",n.update,mA)}),s&&l.addEventListener("resize",n.update,mA),function(){o&&u.forEach(function(e){e.removeEventListener("scroll",n.update,mA)}),s&&l.removeEventListener("resize",n.update,mA)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=mT({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=n.adaptive,o=n.roundOffsets,a=void 0===o||o,s={placement:mC(t.placement),variation:mM(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:void 0===r||r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,mI(Object.assign({},s,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:void 0===i||i,roundOffsets:a})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,mI(Object.assign({},s,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];g1(i)&&me(i)&&(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});g1(r)&&me(r)&&(Object.assign(r.style,o),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=mx.reduce(function(e,n){var r,i,a,s,l,u;return e[n]=(r=t.rects,a=[mh,"top"].indexOf(i=mC(n))>=0?-1:1,l=(s="function"==typeof o?o(Object.assign({},r,{placement:n})):o)[0],u=s[1],l=l||0,u=(u||0)*a,[mh,md].indexOf(i)>=0?{x:u,y:l}:{x:l,y:u}),e},{}),s=a[t.placement],l=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,f=void 0===p||p,g=n.allowedAutoPlacements,m=t.options.placement,v=mC(m)===m,y=l||(v||!f?[mO(m)]:function(e){if(mC(e)===mp)return[];var t=mO(e);return[mE(e),t,mE(t)]}(m)),x=[m].concat(y).reduce(function(e,n){var r,i,o,a,s,l,h,p,m,v,y,x;return e.concat(mC(n)===mp?(i=(r={placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:g}).placement,o=r.boundary,a=r.rootBoundary,s=r.padding,l=r.flipVariations,p=void 0===(h=r.allowedAutoPlacements)?mx:h,0===(y=(v=(m=mM(i))?l?my:my.filter(function(e){return mM(e)===m}):mf).filter(function(e){return p.indexOf(e)>=0})).length&&(y=v),Object.keys(x=y.reduce(function(e,n){return e[n]=mj(t,{placement:n,boundary:o,rootBoundary:a,padding:s})[mC(n)],e},{})).sort(function(e,t){return x[e]-x[t]})):n)},[]),b=t.rects.reference,w=t.rects.popper,S=new Map,A=!0,C=x[0],M=0;M<x.length;M++){var k=x[M],T=mC(k),_=mM(k)===mg,I=["top",mc].indexOf(T)>=0,D=I?"width":"height",O=mj(t,{placement:k,boundary:c,rootBoundary:d,altBoundary:h,padding:u}),R=I?_?md:mh:_?mc:"top";b[D]>w[D]&&(R=mO(R));var E=mO(R),P=[];if(o&&P.push(O[T]<=0),s&&P.push(O[R]<=0,O[E]<=0),P.every(function(e){return e})){C=k,A=!1;break}S.set(k,P)}if(A)for(var L=f?3:1,N=function(e){var t=x.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return C=t,"break"},B=L;B>0&&"break"!==N(B);B--);t.placement!==C&&(t.modifiersData[r]._skip=!0,t.placement=C,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=n.altAxis,a=n.boundary,s=n.rootBoundary,l=n.altBoundary,u=n.padding,c=n.tether,d=void 0===c||c,h=n.tetherOffset,p=void 0===h?0:h,f=mj(t,{boundary:a,rootBoundary:s,padding:u,altBoundary:l}),g=mC(t.placement),m=mM(t.placement),v=!m,y=mk(g),x="x"===y?"y":"x",b=t.modifiersData.popperOffsets,w=t.rects.reference,S=t.rects.popper,A="function"==typeof p?p(Object.assign({},t.rects,{placement:t.placement})):p,C="number"==typeof A?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),M=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(b){if(void 0===i||i){var T,_="y"===y?"top":mh,I="y"===y?mc:md,D="y"===y?"height":"width",O=b[y],R=O+f[_],E=O-f[I],P=d?-S[D]/2:0,L=m===mg?w[D]:S[D],N=m===mg?-S[D]:-w[D],B=t.elements.arrow,z=d&&B?mo(B):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:mB(),j=F[_],V=F[I],H=mV(0,w[D],z[D]),$=v?w[D]/2-P-H-j-C.mainAxis:L-H-j-C.mainAxis,W=v?-w[D]/2+P+H+V+C.mainAxis:N+H+V+C.mainAxis,G=t.elements.arrow&&mu(t.elements.arrow),U=G?"y"===y?G.clientTop||0:G.clientLeft||0:0,q=null!=(T=null==M?void 0:M[y])?T:0,Y=mV(d?g4(R,O+$-q-U):R,O,d?g5(E,O+W-q):E);b[y]=Y,k[y]=Y-O}if(void 0!==o&&o){var X,Z,K="x"===y?"top":mh,Q="x"===y?mc:md,J=b[x],ee="y"===x?"height":"width",et=J+f[K],en=J-f[Q],er=-1!==["top",mh].indexOf(g),ei=null!=(Z=null==M?void 0:M[x])?Z:0,eo=er?et:J-w[ee]-S[ee]-ei+C.altAxis,ea=er?J+w[ee]+S[ee]-ei-C.altAxis:en,es=d&&er?(X=mV(eo,J,ea))>ea?ea:X:mV(d?eo:et,J,d?ea:en);b[x]=es,k[x]=es-J}t.modifiersData[r]=k}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=mC(n.placement),l=mk(s),u=[mh,md].indexOf(s)>=0?"height":"width";if(o&&a){var c,d=(c=i.padding,mz("number"!=typeof(c="function"==typeof c?c(Object.assign({},n.rects,{placement:n.placement})):c)?c:mF(c,mf))),h=mo(o),p="y"===l?"top":mh,f="y"===l?mc:md,g=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],m=a[l]-n.rects.reference[l],v=mu(o),y=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,x=d[p],b=y-h[u]-d[f],w=y/2-h[u]/2+(g/2-m/2),S=mV(x,w,b);n.modifiersData[r]=((t={})[l]=S,t.centerOffset=S-w,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null==r||("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&mP(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=mj(t,{elementContext:"reference"}),s=mj(t,{altBoundary:!0}),l=mH(a,r),u=mH(s,i,o),c=m$(l),d=m$(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}}]}).defaultModifiers)?[]:a,u=void 0===(l=o.defaultOptions)?mw:l,function(e,t,n){void 0===n&&(n=u);var r,i,o={placement:"bottom",orderedModifiers:[],options:Object.assign({},mw,u),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],l=!1,c={state:o,setOptions:function(n){var r,i,l,h,p,f,g="function"==typeof n?n(o.options):n;d(),o.options=Object.assign({},u,o.options,g),o.scrollParents={reference:g0(e)?ms(e):e.contextElement?ms(e.contextElement):[],popper:ms(t)};var m=(i=Object.keys(r=[].concat(s,o.options.modifiers).reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{})).map(function(e){return r[e]}),l=new Map,h=new Set,p=[],i.forEach(function(e){l.set(e.name,e)}),i.forEach(function(e){h.has(e.name)||function e(t){h.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!h.has(t)){var n=l.get(t);n&&e(n)}}),p.push(t)}(e)}),f=p,mb.reduce(function(e,t){return e.concat(f.filter(function(e){return e.phase===t}))},[]));return o.orderedModifiers=m.filter(function(e){return e.enabled}),o.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=e.effect;if("function"==typeof r){var i=r({state:o,name:t,instance:c,options:void 0===n?{}:n});a.push(i||function(){})}}),c.update()},forceUpdate:function(){if(!l){var e=o.elements,t=e.reference,n=e.popper;if(mS(t,n)){o.rects={reference:(r=mu(n),i="fixed"===o.options.strategy,a=g1(r),h=g1(r)&&(u=g3((s=r.getBoundingClientRect()).width)/r.offsetWidth||1,d=g3(s.height)/r.offsetHeight||1,1!==u||1!==d),p=mt(r),f=g9(t,h,i),g={scrollLeft:0,scrollTop:0},m={x:0,y:0},(a||!a&&!i)&&(("body"!==me(r)||mi(p))&&(g=function(e){return e!==gJ(e)&&g1(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:g7(e)}(r)),g1(r)?(m=g9(r,!0),m.x+=r.clientLeft,m.y+=r.clientTop):p&&(m.x=mn(p))),{x:f.left+g.scrollLeft-m.x,y:f.top+g.scrollTop-m.y,width:f.width,height:f.height}),popper:mo(n)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach(function(e){return o.modifiersData[e.name]=Object.assign({},e.data)});for(var r,i,a,s,u,d,h,p,f,g,m,v=0;v<o.orderedModifiers.length;v++){if(!0===o.reset){o.reset=!1,v=-1;continue}var y=o.orderedModifiers[v],x=y.fn,b=y.options,w=void 0===b?{}:b,S=y.name;"function"==typeof x&&(o=x({state:o,options:w,name:S,instance:c})||o)}}}},update:(r=function(){return new Promise(function(e){c.forceUpdate(),e(o)})},function(){return i||(i=new Promise(function(e){Promise.resolve().then(function(){i=void 0,e(r())})})),i}),destroy:function(){d(),l=!0}};if(!mS(e,t))return c;function d(){a.forEach(function(e){return e()}),a=[]}return c.setOptions(n).then(function(e){!l&&n.onFirstUpdate&&n.onFirstUpdate(e)}),c}),mG=n(77893),mU=n(36961);function mq(e){return(0,V.Ay)("MuiPopper",e)}function mY(e){return"function"==typeof e?e():e}(0,j.A)("MuiPopper",["root"]);let mX={},mZ=I.forwardRef(function(e,t){let{anchorEl:n,children:r,direction:i,disablePortal:o,modifiers:a,open:s,placement:l,popperOptions:u,popperRef:c,slotProps:d={},slots:h={},TransitionProps:p,ownerState:f,...g}=e,m=I.useRef(null),v=(0,gZ.A)(m,t),y=I.useRef(null),x=(0,gZ.A)(y,c),b=I.useRef(x);(0,gK.A)(()=>{b.current=x},[x]),I.useImperativeHandle(c,()=>y.current,[]);let w=function(e,t){if("ltr"===t)return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(l,i),[S,A]=I.useState(w),[C,M]=I.useState(mY(n));I.useEffect(()=>{y.current&&y.current.forceUpdate()}),I.useEffect(()=>{n&&M(mY(n))},[n]),(0,gK.A)(()=>{if(!C||!s)return;let e=[{name:"preventOverflow",options:{altBoundary:o}},{name:"flip",options:{altBoundary:o}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:e})=>{A(e.placement)}}];null!=a&&(e=e.concat(a)),u&&null!=u.modifiers&&(e=e.concat(u.modifiers));let t=mW(C,m.current,{placement:w,...u,modifiers:e});return b.current(t),()=>{t.destroy(),b.current(null)}},[C,o,a,s,u,w]);let k={placement:S};null!==p&&(k.TransitionProps=p);let T=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"]},mq,t)})(e),D=h.root??"div",O=(0,mG.A)({elementType:D,externalSlotProps:d.root,externalForwardedProps:g,additionalProps:{role:"tooltip",ref:v},ownerState:e,className:T.root});return(0,_.jsx)(D,{...O,children:"function"==typeof r?r(k):r})}),mK=I.forwardRef(function(e,t){let n,{anchorEl:r,children:i,container:o,direction:a="ltr",disablePortal:s=!1,keepMounted:l=!1,modifiers:u,open:c,placement:d="bottom",popperOptions:h=mX,popperRef:p,style:f,transition:g=!1,slotProps:m={},slots:v={},...y}=e,[x,b]=I.useState(!0);if(!l&&!c&&(!g||x))return null;if(o)n=o;else if(r){let e=mY(r);n=e&&void 0!==e.nodeType?(0,gQ.A)(e).body:(0,gQ.A)(null).body}let w=!c&&l&&(!g||x)?"none":void 0,S=g?{in:c,onEnter:()=>{b(!1)},onExited:()=>{b(!0)}}:void 0;return(0,_.jsx)(mU.A,{disablePortal:s,container:n,children:(0,_.jsx)(mZ,{anchorEl:r,direction:a,disablePortal:s,modifiers:u,ref:t,open:g?!x:c,placement:d,popperOptions:h,popperRef:p,slotProps:m,slots:v,...y,style:{position:"fixed",top:0,left:0,display:w,...f},TransitionProps:S,children:i})})}),mQ=(0,N.A)(mK,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),mJ=I.forwardRef(function(e,t){let n=(0,fj.I)(),{anchorEl:r,component:i,components:o,componentsProps:a,container:s,disablePortal:l,keepMounted:u,modifiers:c,open:d,placement:h,popperOptions:p,popperRef:f,transition:g,slots:m,slotProps:v,...y}=(0,F.b)({props:e,name:"MuiPopper"}),x=m?.root??o?.Root,b={anchorEl:r,container:s,disablePortal:l,keepMounted:u,modifiers:c,open:d,placement:h,popperOptions:p,popperRef:f,transition:g,...y};return(0,_.jsx)(mQ,{as:i,direction:n?"rtl":"ltr",slots:{root:x},slotProps:v??a,...b,ref:t})});var m0=n(32398),m1=n(2203);function m2(e){return(0,V.Ay)("MuiTooltip",e)}let m5=(0,j.A)("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),m4=(0,N.A)(mJ,{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,B.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"] .${m5.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${m5.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${m5.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${m5.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${m5.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${m5.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${m5.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${m5.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),m3=(0,N.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,L.A)(n.placement.split("-")[0])}`]]}})((0,B.A)(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:(0,E.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,[`.${m5.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${m5.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${m5.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${m5.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:{[`.${m5.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${m5.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${m5.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${m5.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${m5.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${m5.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${m5.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${m5.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${m5.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${m5.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),m6=(0,N.A)("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})((0,B.A)(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:(0,E.X4)(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}))),m8=!1,m9=new gq.E,m7={x:0,y:0};function ve(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}let vt=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiTooltip"}),{arrow:r=!1,children:i,classes:o,components:a={},componentsProps:s={},describeChild:l=!1,disableFocusListener:u=!1,disableHoverListener:c=!1,disableInteractive:d=!1,disableTouchListener:h=!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:A="bottom",PopperComponent:C,PopperProps:M={},slotProps:k={},slots:T={},title:D,TransitionComponent:E,TransitionProps:P,...N}=n,B=I.isValidElement(i)?i:(0,_.jsx)("span",{children:i}),z=(0,uH.A)(),j=(0,fj.I)(),[V,H]=I.useState(),[$,W]=I.useState(null),G=I.useRef(!1),U=d||m,q=(0,gq.A)(),Y=(0,gq.A)(),Z=(0,gq.A)(),K=(0,gq.A)(),[Q,J]=(0,m1.A)({controlled:S,default:!1,name:"Tooltip",state:"open"}),ee=Q,et=(0,X.A)(v),en=I.useRef(),er=(0,m0.A)(()=>{void 0!==en.current&&(document.body.style.WebkitUserSelect=en.current,en.current=void 0),K.clear()});I.useEffect(()=>er,[er]);let ei=e=>{m9.clear(),m8=!0,J(!0),w&&!ee&&w(e)},eo=(0,m0.A)(e=>{m9.start(800+y,()=>{m8=!1}),J(!1),b&&ee&&b(e),q.start(z.transitions.duration.shortest,()=>{G.current=!1})}),ea=e=>{G.current&&"touchstart"!==e.type||(V&&V.removeAttribute("title"),Y.clear(),Z.clear(),p||m8&&f?Y.start(m8?f:p,()=>{ei(e)}):ei(e))},es=e=>{Y.clear(),Z.start(y,()=>{eo(e)})},[,el]=I.useState(!1),eu=e=>{(0,gu.A)(e.target)||(el(!1),es(e))},ec=e=>{V||H(e.currentTarget),(0,gu.A)(e.target)&&(el(!0),ea(e))},ed=e=>{G.current=!0;let t=B.props;t.onTouchStart&&t.onTouchStart(e)};I.useEffect(()=>{if(ee)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){"Escape"===e.key&&eo(e)}},[eo,ee]);let eh=(0,u2.A)((0,gY.A)(B),H,t);D||0===D||(ee=!1);let ep=I.useRef(),ef={},eg="string"==typeof D;l?(ef.title=ee||!eg||c?null:D,ef["aria-describedby"]=ee?et:null):(ef["aria-label"]=eg?D:null,ef["aria-labelledby"]=ee&&!eg?et:null);let em={...ef,...N,...B.props,className:(0,O.A)(N.className,B.props.className),onTouchStart:ed,ref:eh,...m?{onMouseMove:e=>{let t=B.props;t.onMouseMove&&t.onMouseMove(e),m7={x:e.clientX,y:e.clientY},ep.current&&ep.current.update()}}:{}},ev={};h||(em.onTouchStart=e=>{ed(e),Z.clear(),q.clear(),er(),en.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",K.start(g,()=>{document.body.style.WebkitUserSelect=en.current,ea(e)})},em.onTouchEnd=e=>{B.props.onTouchEnd&&B.props.onTouchEnd(e),er(),Z.start(x,()=>{eo(e)})}),!c&&(em.onMouseOver=ve(ea,em.onMouseOver),em.onMouseLeave=ve(es,em.onMouseLeave),U||(ev.onMouseOver=ea,ev.onMouseLeave=es)),!u&&(em.onFocus=ve(ec,em.onFocus),em.onBlur=ve(eu,em.onBlur),U||(ev.onFocus=ec,ev.onBlur=eu));let ey={...n,isRtl:j,arrow:r,disableInteractive:U,placement:A,PopperComponentProp:C,touch:G.current},ex="function"==typeof k.popper?k.popper(ey):k.popper,eb=I.useMemo(()=>{let e=[{name:"arrow",enabled:!!$,options:{element:$,padding:4}}];return M.popperOptions?.modifiers&&(e=e.concat(M.popperOptions.modifiers)),ex?.popperOptions?.modifiers&&(e=e.concat(ex.popperOptions.modifiers)),{...M.popperOptions,...ex?.popperOptions,modifiers:e}},[$,M.popperOptions,ex?.popperOptions]),ew=(e=>{let{classes:t,disableInteractive:n,arrow:r,touch:i,placement:o}=e,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${(0,L.A)(o.split("-")[0])}`],arrow:["arrow"]};return(0,R.A)(a,m2,t)})(ey),eS="function"==typeof k.transition?k.transition(ey):k.transition,eA={slots:{popper:a.Popper,transition:a.Transition??E,tooltip:a.Tooltip,arrow:a.Arrow,...T},slotProps:{arrow:k.arrow??s.arrow,popper:{...M,...ex??s.popper},tooltip:k.tooltip??s.tooltip,transition:{...P,...eS??s.transition}}},[eC,eM]=(0,cn.A)("popper",{elementType:m4,externalForwardedProps:eA,ownerState:ey,className:(0,O.A)(ew.popper,M?.className)}),[ek,eT]=(0,cn.A)("transition",{elementType:gX.A,externalForwardedProps:eA,ownerState:ey}),[e_,eI]=(0,cn.A)("tooltip",{elementType:m3,className:ew.tooltip,externalForwardedProps:eA,ownerState:ey}),[eD,eO]=(0,cn.A)("arrow",{elementType:m6,className:ew.arrow,externalForwardedProps:eA,ownerState:ey,ref:W});return(0,_.jsxs)(I.Fragment,{children:[I.cloneElement(B,em),(0,_.jsx)(eC,{as:C??mJ,placement:A,anchorEl:m?{getBoundingClientRect:()=>({top:m7.y,left:m7.x,right:m7.x,bottom:m7.y,width:0,height:0})}:V,popperRef:ep,open:!!V&&ee,id:et,transition:!0,...ev,...eM,popperOptions:eb,children:({TransitionProps:e})=>(0,_.jsx)(ek,{timeout:z.transitions.duration.shorter,...e,...eT,children:(0,_.jsxs)(e_,{...eI,children:[D,r?(0,_.jsx)(eD,{...eO}):null]})})})]})});var vn=n(58597),vr=n(7800),vi=n(98599),vo=n(16979),va=n(9323),vs=n(12933),vl=n(46177);let vu=(0,I.forwardRef)(function({debounceMs:e=250,value:t,onChange:n,...r},i){let[o,a]=(0,I.useState)(t),s=(0,I.useCallback)(e=>{n?.(e)},[n]),l=(0,I.useMemo)(()=>vl(s,e),[e,s]);return(0,_.jsx)(eC.A,{ref:i,value:o,onChange:function(e){a(e.target.value),l(e.target.value)},...r})});function vc({isSearchEnabled:e,globalFilter:t,onGlobalFilterChange:n,isColumnFilterEnabled:r,columns:i,width:o,columnFilterMenuMaxHeight:a=400,isExpandAllEnabled:s,isAllExpanded:l,onExpandAllChange:u}){let[c,d]=(0,I.useState)(null),h=!!c,[p,f]=(0,I.useState)(0),g=(0,I.useCallback)(()=>{n(""),f(e=>e+1)},[n]);return e||r||s?(0,_.jsxs)(ey.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,_.jsx)(vu,{placeholder:"Search...",value:t,onChange:n,variant:"standard",slotProps:{htmlInput:{"aria-label":"search table"},input:{startAdornment:(0,_.jsx)(gU,{position:"start",children:(0,_.jsx)(vi,{fontSize:"small"})}),endAdornment:""!==t&&(0,_.jsx)(gU,{position:"end",children:(0,_.jsx)(eA,{onClick:g,children:(0,_.jsx)(vr,{fontSize:"small"})})})}},sx:{flexGrow:1}},p),s&&(0,_.jsx)(vt,{title:l?"Collapse all":"Expand all",children:(0,_.jsx)(eA,{onClick:u,color:"info","aria-label":l?"collapse all rows":"expand all rows",children:l?(0,_.jsx)(vo,{}):(0,_.jsx)(va,{})})}),r&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(eA,{onClick:e=>d(e.currentTarget),"aria-haspopup":"listbox","aria-expanded":h,color:"info",children:(0,_.jsx)(vs,{})}),(0,_.jsx)(vn.A,{anchorEl:c,open:h,onClose:()=>d(null),slotProps:{list:{dense:!0}},sx:{maxHeight:a},children:i.map(e=>{let t=e.columnDef.header,n="string"==typeof t?t:e.id;return(0,_.jsxs)(fD,{disabled:!e.getCanHide(),onClick:e.getCanHide()?e.getToggleVisibilityHandler():void 0,dense:!0,children:[(0,_.jsx)(fm,{checked:e.getIsVisible(),disabled:!e.getCanHide(),size:"small",disableRipple:!0,sx:{p:0,mr:1}}),(0,_.jsx)(ci,{primary:n})]},e.id)})})]})]}):null}function vd(e){return(0,V.Ay)("MuiTableContainer",e)}vu.displayName="TextField",(0,j.A)("MuiTableContainer",["root"]);let vh=(0,N.A)("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"}),vp=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiTableContainer"}),{className:r,component:i="div",...o}=n,a={...n,component:i},s=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"]},vd,t)})(a);return(0,_.jsx)(vh,{ref:t,as:i,className:(0,O.A)(s.root,r),ownerState:a,...o})}),vf=(0,I.forwardRef)(function(e,t){return(0,_.jsx)(vp,{...e,tabIndex:-1,ref:t,sx:iw({flexGrow:1},e.sx)})});function vg({width:e,height:t,density:n,defaultColumnWidth:r,defaultColumnHeight:i,onRowClick:o,onRowMouseOver:a,onRowMouseOut:s,rows:l,columns:u,headers:c,columnSizing:d,columnSizingInfo:h,cellConfigs:p,pagination:f,onPaginationChange:g,rowCount:m,toolbarConfig:v}){let y=(0,I.useRef)(null),x=(0,I.useRef)({startIndex:0,endIndex:0}),b=function({visibleRange:e,virtualTable:t,maxRows:n,maxColumns:r}){return function({maxRows:e,maxColumns:t,onActiveCellChange:n}){let[r,i]=(0,I.useState)(f4),[o,a]=(0,I.useState)(!1);return{activeCell:r,isActive:o,onTableKeyDown:(0,I.useCallback)(r=>{let o=r.key;(f3.has(o)||"Home"===o||"End"===o||"PageDown"===o||"PageUp"===o)&&i(i=>{let a=i.row,s=i.column;"ArrowRight"===o&&s<t-1?(r.preventDefault(),s+=1):"ArrowLeft"===o&&s>0?(r.preventDefault(),s-=1):"ArrowDown"===o&&a<e-1?(r.preventDefault(),a+=1):"ArrowUp"===o&&a>0?(r.preventDefault(),a-=1):"Home"===o?(r.preventDefault(),a=0,s=0):"End"===o&&(r.preventDefault(),a=e-1,s=t-1);let l={column:s,row:a},u=n?.(r,i,l)||l;return u.row===i.row&&u.column===i.column?i:u})},[t,e,n]),onCellFocus:e=>{e.column===r.column&&e.row===r.row&&o||(a(!0),i(e))},onTableBlur:(0,I.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||(a(!1),i(f4))},[])}}({maxRows:n,maxColumns:r,onActiveCellChange:(r,i,o)=>{let a=r.key,s=o&&(i.column!==o.column||i.row!==o.row),l=o?.row??i.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){r.preventDefault();let o=i.row;return o=Math.min(n-1,e.current.endIndex+1),t.current?.scrollToIndex({index:o-1,align:"start"}),{row:o,column:i.column}}else if("PageUp"===a){let n=i.row;return n=Math.max(0,e.current.startIndex-1),t.current?.scrollToIndex({index:n-1,align:"end"}),{row:n,column:i.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,I.useMemo)(()=>({Scroller:vf,Table:t=>(0,_.jsx)(gn,{...t,width:e,density:n,onKeyDown:b.onTableKeyDown,onBlur:b.onTableBlur}),TableHead:gI,TableFoot:gA,TableRow:({item:e,...t})=>{let r=l[t["data-index"]];if(!r)return null;let i={id:r.id,index:r.index};return(0,_.jsx)(gj,{...t,onClick:e=>o(e,r.id),density:n,onMouseOver:e=>{a?.(e,i)},onMouseOut:e=>{s?.(e,i)}})},TableBody:gl}),[n,b.onTableKeyDown,b.onTableBlur,o,s,a,l,e]),A=(e,t)=>{f&&g&&g({...f,pageIndex:t})},C=e=>{f&&g&&g({pageIndex:0,pageSize:parseInt(e.target.value,10)})},M=(0,I.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},[h,d,c]);return(0,_.jsxs)(uQ,{style:{width:e,height:t,...M},children:[(0,_.jsx)(vc,{...v,width:e}),(0,_.jsx)(hX,{ref:y,totalCount:l.length,components:S,rangeChanged:e=>{x.current=e},fixedHeaderContent:()=>(0,_.jsx)(_.Fragment,{children:c.map(e=>(0,_.jsx)(gj,{density:n,children:e.headers.map((e,t,o)=>{var a,s,l,u,c;let d,h=e.column,p={row:0,column:t},f=h.getIsSorted(),g=h.getNextSortingOrder();return(0,_.jsx)(gF,{onSort:h.getCanSort()?h.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)`:h.getSize()||r,defaultColumnHeight:i,align:h.columnDef.meta?.align,variant:"head",density:n,description:h.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=h.columnDef.header,s=e.getContext(),a?"function"==typeof(u=l=a)&&(d=Object.getPrototypeOf(u)).prototype&&d.prototype.isReactComponent||"function"==typeof l||"object"==typeof(c=l)&&"symbol"==typeof c.$$typeof&&["react.memo","react.forward_ref"].includes(c.$$typeof.description)?I.createElement(a,s):a:null)},e.id)})},e.id))}),fixedFooterContent:f?()=>(0,_.jsx)(fS,{sx:{backgroundColor:e=>e.palette.background.default},children:(0,_.jsx)(f5,{colSpan:u.length,count:m,page:f.pageIndex,rowsPerPage:f.pageSize,onPageChange:A,onRowsPerPageChange:C})}):void 0,itemContent:e=>{let t=l[e];return t?(0,_.jsx)(_.Fragment,{children:t.getVisibleCells().map((o,a,s)=>{let l,u={row:e+1,column:a},c=o.getContext(),d=p?.[c.cell.id],h=o.column.columnDef.cell,f="function"==typeof h?h(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,_.jsx)(gv,{"data-testid":o.id,title:l||d?.text||f,width:o.column.getCanResize()?`calc(var(--col-${o.column.id}-size) * 1px)`:o.column.getSize()||r,defaultColumnHeight:i,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:d?.textColor??void 0,backgroundColor:d?.backgroundColor??void 0,dataLink:o.column.columnDef.meta?.dataLink,adjacentCellsValuesMap:m,children:d?.text||f},o.id)})}):null}})]})}let vm=(e,t)=>`${t}`,vv={},vy=[];function vx({data:e,columns:t,cellConfigs:n,density:r="standard",defaultColumnWidth:i=150,defaultColumnHeight:o="auto",checkboxSelection:a,onRowSelectionChange:s,onSortingChange:l,getCheckboxColor:u,getRowId:c=vm,rowSelection:d=vv,sorting:h=vy,getItemActions:p,hasItemActions:f,pagination:g,onPaginationChange:m,rowSelectionVariant:v="standard",getSubRows:y,hiddenColumns:x,tableToolbarConfig:b,columnResizeMode:w="onChange",defaultColumnConfig:S,...A}){let C=(0,uH.A)(),M=!!y,[k,T]=(0,I.useState)({}),{globalFilter:D,setGlobalFilter:O,fuzzySearchOptions:R}=function(e,t,n,r){let[i,o]=(0,I.useState)(""),[a,s]=(0,I.useState)(n),l=(0,I.useCallback)(e=>{o(t=>(t?t&&!e&&r(a):(s(n),r(!0)),e))},[n,a,r]);return{globalFilter:i,setGlobalFilter:l,fuzzySearchOptions:{filterFns:{fuzzy:(e,n,r,i)=>{let o=function(e,t,n){var r;if((n=n||{}).threshold=null!=(r=n.threshold)?r:p9.MATCHES,!n.accessors){let r=p7(e,t,n);return{rankedValue:e,rank:r,accessorIndex:-1,accessorThreshold:n.threshold,passed:r>=n.threshold}}let i=function(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r],o="function"==typeof i?ft:{...ft,...i},a=function(e,t){let n=t;"object"==typeof t&&(n=t.accessor);let r=n(e);return null==r?[]:Array.isArray(r)?r:[String(r)]}(e,i);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:p9.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let e=0;e<i.length;e++){let r=i[e],a=p7(r.itemValue,t,n),{minRanking:s,maxRanking:l,threshold:u=n.threshold}=r.attributes;a<s&&a>=p9.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=r.itemValue)}return o}(e.getValue(n),r,{threshold:p9[t]});return i({itemRank:o}),o.passed}},globalFilterFn:e?"fuzzy":void 0,getFilteredRowModel:e?e=>pS(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{var i,o,a,s,l,u,c,d,h,p;let f,g,m,v,y,x,b,w,S,A;if(!t.rows.length||!(null!=n&&n.length)&&!r){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 r=e.getColumn(t.id);if(!r)return;let i=r.getFilterFn();i&&C.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})});let k=(null!=n?n:[]).map(e=>e.id),T=e.getGlobalFilterFn(),_=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());r&&T&&_.length&&(k.push("__global__"),_.forEach(e=>{var t;M.push({id:e.id,filterFn:T,resolvedValue:null!=(t=null==T.resolveFilterValue?void 0:T.resolveFilterValue(r))?t:r})}));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 i=t.rows,o=e=>{for(let t=0;t<k.length;t++)if(!1===e.columnFilters[k[t]])return!1;return!0},e.options.filterFromLeafRows?(a=i,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 i=0;i<e.length;i++){var r;let o=e[i],a=pT(l,o.id,o.original,o.index,o.depth,void 0,o.parentId);if(a.columnFilters=o.columnFilters,null!=(r=o.subRows)&&r.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=i,d=o,b=[],w={},S=null!=(p=(h=e).options.maxLeafRowFilterDepth)?p:100,{rows:(A=function(e,t){void 0===t&&(t=0);let n=[];for(let i=0;i<e.length;i++){let o=e[i];if(d(o)){var r;if(null!=(r=o.subRows)&&r.length&&t<S){let e=pT(h,o.id,o.original,o.index,o.depth,void 0,o.parentId);e.subRows=A(o.subRows,t+1),o=e}n.push(o),b.push(o),w[o.id]=o}}return n})(c),flatRows:b,rowsById:w})},pA(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex())):void 0,filterFromLeafRows:e,onGlobalFilterChange:l}}}(b?.isSearchEnabled,b?.fuzzyMatchThreshold??"CONTAINS",k,T),[E,P]=(0,I.useState)(x?.reduce((e,t)=>({...e,[t]:!1}),{})??{}),L=(0,I.useCallback)((e,t,n)=>{"standard"===v||n?t.toggleSelected():t.getIsSelected()&&!e.getIsAllRowsSelected()?e.toggleAllRowsSelected():s?.({[t.id]:!0})},[s,v]),N=(0,I.useCallback)((e,t,n)=>{let r=e.nativeEvent&&(e.nativeEvent instanceof MouseEvent||e.nativeEvent instanceof KeyboardEvent)?e.nativeEvent:void 0;L(t,n,!!r?.metaKey||!!r?.shiftKey)},[L]),B=(0,I.useMemo)(()=>({id:"itemActions",header:"Actions",cell:({row:e})=>(0,_.jsx)(ey.A,{direction:"row",alignItems:"center",children:p?.({id:e.id,data:e.original})}),enableSorting:!1,enableResizing:!1}),[p]),z=(0,I.useMemo)(()=>({id:"checkboxRowSelect",size:28,header:({table:e})=>(0,_.jsx)(fv,{checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler(),color:C.palette.text.primary,density:r}),cell:({row:e,table:t})=>(0,_.jsx)(fv,{checked:e.getIsSelected(),indeterminate:e.getIsSomeSelected(),onChange:n=>{N(n,t,e)},color:u?.(e.original),density:r}),enableSorting:!1,enableResizing:!1}),[C.palette.text.primary,r,u,N]),F=function(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=I.useState(()=>({current:function(e){var t,n;let r=[...p4,...null!=(t=e._features)?t:[]],i={_features:r},o=i._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(i)),{}),a={...null!=(n=e.initialState)?n:{}};i._features.forEach(e=>{var t;a=null!=(t=null==e.getInitialState?void 0:e.getInitialState(a))?t:a});let s=[],l=!1,u={_features:r,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:()=>{i.setState(i.initialState)},setOptions:e=>{var t;t=px(e,i.options),i.options=i.options.mergeOptions?i.options.mergeOptions(o,t):{...o,...t}},getState:()=>i.options.state,setState:e=>{null==i.options.onStateChange||i.options.onStateChange(e)},_getRowId:(e,t,n)=>{var r;return null!=(r=null==i.options.getRowId?void 0:i.options.getRowId(e,t,n))?r:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?i.getPrePaginationRowModel():i.getRowModel()).rowsById[e];if(!n&&!(n=i.getCoreRowModel().rowsById[e]))throw Error();return n},_getDefaultColumnDef:pS(()=>[i.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},...i._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},pA(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>i.options.columns,getAllColumns:pS(()=>[i._getColumnDefs()],e=>{let t=function(e,n,r){return void 0===r&&(r=0),e.map(e=>{let o=function(e,t,n,r){var i,o;let a,s={...e._getDefaultColumnDef(),...t},l=s.accessorKey,u=null!=(i=null!=(o=s.id)?o:l?"function"==typeof String.prototype.replaceAll?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)?i:"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:r,depth:n,columnDef:s,columns:[],getFlatColumns:pS(()=>[!0],()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},pA(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:pS(()=>[e._getOrderColumnsFn()],e=>{var t;return null!=(t=c.columns)&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},pA(e.options,"debugColumns","column.getLeafColumns"))};for(let t of e._features)null==t.createColumn||t.createColumn(c,e);return c}(i,e,r,n);return o.columns=e.columns?t(e.columns,o,r+1):[],o})};return t(e)},pA(e,"debugColumns","getAllColumns")),getAllFlatColumns:pS(()=>[i.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),pA(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:pS(()=>[i.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),pA(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:pS(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),pA(e,"debugColumns","getAllLeafColumns")),getColumn:e=>i._getAllFlatColumnsById()[e]};Object.assign(i,u);for(let e=0;e<i._features.length;e++){let t=i._features[e];null==t||null==t.createTable||t.createTable(i)}return i}(t)})),[r,i]=I.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{i(t),null==e.onStateChange||e.onStateChange(t)}})),n.current}({data:e,columns:(0,I.useMemo)(()=>{let e=fr(t,S);return f&&e.unshift(B),a&&e.unshift(z),e},[t,S,f,a,B,z]),getRowId:c,getCoreRowModel:e=>pS(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},r=function(t,i,o){void 0===i&&(i=0);let a=[];for(let l=0;l<t.length;l++){let u=pT(e,e._getRowId(t[l],l,o),t[l],l,i,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=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},pA(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex())),getSortedRowModel:e=>pS(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(null!=t&&t.length))return n;let r=e.getState().sorting,i=[],o=r.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 r=0;r<o.length;r+=1){var n;let i=o[r],s=a[i.id],l=s.sortUndefined,u=null!=(n=null==i?void 0:i.desc)&&n,c=0;if(l){let n=e.getValue(i.id),r=t.getValue(i.id),o=void 0===n,a=void 0===r;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,i.id)),0!==c)return u&&(c*=-1),s.invertSorting&&(c*=-1),c}return e.index-t.index}),t.forEach(e=>{var t;i.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))}),t};return{rows:s(n.rows),flatRows:i,rowsById:n.rowsById}},pA(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex())),getPaginationRowModel:g?e=>pS(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{let r;if(!n.rows.length)return n;let{pageSize:i,pageIndex:o}=t,{rows:a,flatRows:s,rowsById:l}=n,u=i*o;a=a.slice(u,u+i),(r=e.options.paginateExpandedRows?{rows:a,flatRows:s,rowsById:l}:p3({rows:a,flatRows:s,rowsById:l})).flatRows=[];let c=e=>{r.flatRows.push(e),e.subRows.length&&e.subRows.forEach(c)};return r.rows.forEach(c),r},pA(e.options,"debugTable","getPaginationRowModel")):void 0,manualPagination:!g,enableRowSelection:!!a,onRowSelectionChange:e=>{let t="function"==typeof e?e(d):e;s?.(t)},onSortingChange:e=>{let t="function"==typeof e?e(h):e;l?.(t)},onColumnVisibilityChange:P,getSubRows:y,getExpandedRowModel:M?e=>pS(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(e,t,n)=>t.rows.length&&(!0===e||Object.keys(null!=e?e:{}).length)&&n?p3(t):t,pA(e.options,"debugTable","getExpandedRowModel")):void 0,...R,sortDescFirst:!0,columnResizeMode:w,onExpandedChange:T,state:{rowSelection:d,sorting:h,globalFilter:b?.isSearchEnabled?D:void 0,columnVisibility:E,...g?{pagination:g}:{},expanded:k}}),j=(0,I.useCallback)((e,t)=>{let n=F.getRow(t);L(F,n,e.metaKey||e.shiftKey)},[L,F]);return(0,_.jsx)(vg,{...A,density:r,defaultColumnWidth:i,defaultColumnHeight:o,onRowClick:j,rows:F.getRowModel().rows,columns:F.getVisibleFlatColumns(),columnSizing:F.getState().columnSizing,columnSizingInfo:F.getState().columnSizingInfo,headers:F.getHeaderGroups(),cellConfigs:n,pagination:g,onPaginationChange:m,rowCount:F.getRowCount(),toolbarConfig:{isSearchEnabled:b?.isSearchEnabled,globalFilter:D,onGlobalFilterChange:O,isColumnFilterEnabled:b?.isColumnFilterEnabled,columns:F.getAllColumns(),columnFilterMenuMaxHeight:b?.columnFilterMenuMaxHeight,isExpandAllEnabled:M,isAllExpanded:F.getIsAllRowsExpanded(),onExpandAllChange:F.getToggleAllRowsExpandedHandler()}})}let vb=[{accessorKey:"label",header:"Name",enableSorting:!0,enableResizing:!0,cell:({getValue:e})=>(0,_.jsx)("span",{title:e(),children:e()})}],vw=e=>e.id,vS=e=>e.color;function vA({items:e,selectedItems:t,onSelectedItemsChange:n,onItemMouseOver:r,onItemMouseOut:i,height:o,width:a,columns:s=[],sorting:l,onSortingChange:u}){let c=(0,I.useMemo)(()=>"string"!=typeof t?t:e.reduce((e,t,n)=>(e[vw(t,n)]=!0,e),{}),[t,e]),d=(0,I.useMemo)(()=>{let e=Math.max(a-(s?.reduce((e,t)=>e+("number"==typeof t.width?t.width:150),0)??0)-45,60*vb.length)/vb.length;return[...vb.map(t=>({...t,width:e})),...s]},[s,a]);return(0,_.jsx)(vx,{height:o,width:a,rowSelection:c,onRowSelectionChange:n,onRowMouseOver:r,onRowMouseOut:i,sorting:l,onSortingChange:u,data:e,columns:d,density:"compact",defaultColumnWidth:"auto",getRowId:vw,getCheckboxColor:vS,checkboxSelection:!0,rowSelectionVariant:"legend"})}function vC({width:e,height:t,options:n,data:r,selectedItems:i,onSelectedItemsChange:o,onItemMouseOver:a,onItemMouseOut:s,tableProps:l}){let u,c=(e,t)=>{let n=e.metaKey||e.shiftKey;o((0,uJ.produce)(i,e=>{if("ALL"===e)return{[t]:!0};let r=!!e[t];return n?(r?delete e[t]:e[t]=!0,e):r?"ALL":{[t]:!0}}))},d=nG(n.mode),h=r.length>=500,p={height:t,items:r,selectedItems:i,onLegendItemClick:c,onItemMouseOver:a,onItemMouseOut:s};return(u="table"===d?(0,_.jsx)(vA,{...p,onSelectedItemsChange:o,width:e,...l}):"right"===n.position||h?(0,_.jsx)(py,{...p,width:e,onLegendItemClick:c}):(0,_.jsx)(cl,{...p,onLegendItemClick:c}),"right"===n.position)?(0,_.jsx)(uQ,{style:{width:e,height:t},sx:{position:"absolute",top:0,right:0,backgroundColor:e=>`${e.palette.background.default}`},children:u}):(0,_.jsx)(uQ,{style:{width:e,height:t},sx:{position:"absolute",bottom:0,backgroundColor:e=>`${e.palette.background.default}`},children:u})}let vM={medium:{bottom:6,right:250},small:{bottom:4,right:150}};function vk({children:e,legendProps:t,width:n,height:r,spacing:i=0,legendSize:o,minChildrenWidth:a=100,minChildrenHeight:s=100}){let{content:l,legend:u,margin:c}=function({width:e,height:t,legendProps:n,legendSize:r,minChildrenHeight:i,minChildrenWidth:o,spacing:a,theme:s}){let l,u,c=n?.options,d={legend:{show:!1,width:0,height:0},content:{width:e,height:t},margin:{right:0,bottom:0}};if(!c)return d;let{position:h}=c;if("list"===nG(c.mode))l="right"===h?200:e,u=40,"right"===h?u=t:t>=300&&(u=100);else{let i=fn(s,"compact"),o=(n?.tableProps?.columns||[]).reduce((e,t)=>("number"==typeof t.width&&(e+=t.width),e),0);l="right"===h?vM[r].right+o:e;let a=Math.min(vM[r].bottom,n.data.length+1);u="bottom"===h?a*i.height:t}let p="right"===h?e-l-a:e,f="bottom"===h?t-u-a:t;return"right"===h&&p<o||"bottom"===h&&f<i?d:{legend:{width:l,height:u,show:!0},content:{width:p,height:f},margin:{right:"right"===h?a:0,bottom:"bottom"===h?a:0}}}({width:n,height:r,legendProps:t,minChildrenHeight:s,minChildrenWidth:a,spacing:i,theme:(0,uH.A)(),legendSize:nU(o)});return(0,_.jsxs)(uQ,{style:{width:n,height:r},sx:{position:"relative",overflow:"hidden"},children:[(0,_.jsx)(uQ,{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,_.jsx)(vC,{...t,height:u.height,width:u.width})]})}function vT(e){return(0,V.Ay)("MuiDialogTitle",e)}let v_=(0,j.A)("MuiDialogTitle",["root"]),vI=I.createContext({}),vD=(0,N.A)(u7.A,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),vO=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiDialogTitle"}),{className:r,id:i,...o}=n,a=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"]},vT,t)})(n),{titleId:s=i}=I.useContext(vI);return(0,_.jsx)(vD,{component:"h2",className:(0,O.A)(a.root,r),ownerState:n,ref:t,variant:"h6",id:i??s,...o})});function vR(e){return(0,V.Ay)("MuiDialogContent",e)}(0,j.A)("MuiDialogContent",["root","dividers"]);let vE=(0,N.A)("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})((0,B.A)(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:e})=>e.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${v_.root} + &`]:{paddingTop:0}}}]}))),vP=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiDialogContent"}),{className:r,dividers:i=!1,...o}=n,a={...n,dividers:i},s=(e=>{let{classes:t,dividers:n}=e;return(0,R.A)({root:["root",n&&"dividers"]},vR,t)})(a);return(0,_.jsx)(vE,{className:(0,O.A)(s.root,r),ownerState:a,ref:t,...o})});var vL=n(54553),vN=n(10972),vB=n(96313),vz=n(11502);function vF(e){return(0,V.Ay)("MuiDialog",e)}let vj=(0,j.A)("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]);var vV=n(32309);let vH=(0,N.A)(vV.A,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),v$=(0,N.A)(vN.A,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),vW=(0,N.A)("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.container,t[`scroll${(0,L.A)(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),vG=(0,N.A)(vz.A,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`scrollPaper${(0,L.A)(n.scroll)}`],t[`paperWidth${(0,L.A)(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})((0,B.A)(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:"px"===e.breakpoints.unit?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${vj.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(e=>"xs"!==e).map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${vj.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${vj.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),vU=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiDialog"}),r=(0,uH.A)(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":o,"aria-labelledby":a,"aria-modal":s=!0,BackdropComponent:l,BackdropProps:u,children:c,className:d,disableEscapeKeyDown:h=!1,fullScreen:p=!1,fullWidth:f=!1,maxWidth:g="sm",onBackdropClick:m,onClick:v,onClose:y,open:x,PaperComponent:b=vz.A,PaperProps:w={},scroll:S="paper",slots:A={},slotProps:C={},TransitionComponent:M=vB.A,transitionDuration:k=i,TransitionProps:T,...D}=n,E={...n,disableEscapeKeyDown:h,fullScreen:p,fullWidth:f,maxWidth:g,scroll:S},P=(e=>{let{classes:t,scroll:n,maxWidth:r,fullWidth:i,fullScreen:o}=e,a={root:["root"],container:["container",`scroll${(0,L.A)(n)}`],paper:["paper",`paperScroll${(0,L.A)(n)}`,`paperWidth${(0,L.A)(String(r))}`,i&&"paperFullWidth",o&&"paperFullScreen"]};return(0,R.A)(a,vF,t)})(E),N=I.useRef(),B=(0,vL.A)(a),z=I.useMemo(()=>({titleId:B}),[B]),j={slots:{transition:M,...A},slotProps:{transition:T,paper:w,backdrop:u,...C}},[V,H]=(0,cn.A)("root",{elementType:v$,shouldForwardComponentProp:!0,externalForwardedProps:j,ownerState:E,className:(0,O.A)(P.root,d),ref:t}),[$,W]=(0,cn.A)("backdrop",{elementType:vH,shouldForwardComponentProp:!0,externalForwardedProps:j,ownerState:E}),[G,U]=(0,cn.A)("paper",{elementType:vG,shouldForwardComponentProp:!0,externalForwardedProps:j,ownerState:E,className:(0,O.A)(P.paper,w.className)}),[q,Y]=(0,cn.A)("container",{elementType:vW,externalForwardedProps:j,ownerState:E,className:(0,O.A)(P.container)}),[X,Z]=(0,cn.A)("transition",{elementType:vB.A,externalForwardedProps:j,ownerState:E,additionalProps:{appear:!0,in:x,timeout:k,role:"presentation"}});return(0,_.jsx)(V,{closeAfterTransition:!0,slots:{backdrop:$},slotProps:{backdrop:{transitionDuration:k,as:l,...W}},disableEscapeKeyDown:h,onClose:y,open:x,onClick:e=>{v&&v(e),N.current&&(N.current=null,m&&m(e),y&&y(e,"backdropClick"))},...H,...D,children:(0,_.jsx)(X,{...Z,children:(0,_.jsx)(q,{onMouseDown:e=>{N.current=e.target===e.currentTarget},...Y,children:(0,_.jsx)(G,{as:b,elevation:24,role:"dialog","aria-describedby":o,"aria-labelledby":B,"aria-modal":s,...U,children:(0,_.jsx)(vI.Provider,{value:z,children:c})})})})})});function vq(e){return(0,V.Ay)("MuiDialogActions",e)}(0,j.A)("MuiDialogActions",["root","spacing"]);let vY=(0,N.A)("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),vX=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiDialogActions"}),{className:r,disableSpacing:i=!1,...o}=n,a={...n,disableSpacing:i},s=(e=>{let{classes:t,disableSpacing:n}=e;return(0,R.A)({root:["root",!n&&"spacing"]},vq,t)})(a);return(0,_.jsx)(vY,{className:(0,O.A)(s.root,r),ownerState:a,ref:t,...o})}),vZ=(0,N.A)("form")({overflowY:"auto",display:"flex",flexDirection:"column"}),vK=e=>({position:"absolute",top:e.spacing(.5),right:e.spacing(.5)}),vQ=({children:e,...t})=>(0,_.jsx)(vU,{...t,children:e});vQ.Header=({children:e,onClose:t,...n})=>(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(vO,{style:{textOverflow:"ellipsis",overflow:"hidden"},...n,children:e}),t&&(0,_.jsx)(eA,{"aria-label":"Close",onClick:t,sx:vK,children:(0,_.jsx)(vr,{})})]}),vQ.Form=vZ,vQ.Content=({children:e,sx:t,...n})=>(0,_.jsx)(vP,{dividers:!0,...n,sx:iw({minWidth:"500px",textWrap:"balance"},t),children:e}),vQ.PrimaryButton=({children:e,...t})=>(0,_.jsx)(em,{variant:"contained",type:"submit",...t,children:e}),vQ.SecondaryButton=({children:e,...t})=>(0,_.jsx)(em,{variant:"outlined",color:"secondary",...t,children:e}),vQ.Actions=vX;let vJ=e=>{let{description:t,isOpen:n,onCancel:r,onDiscardChanges:i}=e;return(0,_.jsxs)(vQ,{open:n,"aria-labelledby":"discard-dialog",children:[(0,_.jsx)(vQ.Header,{children:"Discard Changes"}),(0,_.jsx)(vQ.Content,{children:t}),(0,_.jsxs)(vQ.Actions,{children:[(0,_.jsx)(em,{variant:"contained",onClick:i,children:"Discard Changes"}),(0,_.jsx)(em,{variant:"outlined",color:"secondary",onClick:r,children:"Cancel"})]})]})};var v0=n(85351);let v1=I.createContext();function v2(e){return(0,V.Ay)("MuiGrid",e)}let v5=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],v4=(0,j.A)("MuiGrid",["root","container","item","zeroMinWidth",...[0,1,2,3,4,5,6,7,8,9,10].map(e=>`spacing-xs-${e}`),...["column-reverse","column","row-reverse","row"].map(e=>`direction-xs-${e}`),...["nowrap","wrap-reverse","wrap"].map(e=>`wrap-xs-${e}`),...v5.map(e=>`grid-xs-${e}`),...v5.map(e=>`grid-sm-${e}`),...v5.map(e=>`grid-md-${e}`),...v5.map(e=>`grid-lg-${e}`),...v5.map(e=>`grid-xl-${e}`)]);function v3({breakpoints:e,values:t}){let n="";Object.keys(t).forEach(e=>{""===n&&0!==t[e]&&(n=e)});let r=Object.keys(e).sort((t,n)=>e[t]-e[n]);return r.slice(0,r.indexOf(n))}let v6=(0,N.A)("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e,{container:r,direction:i,item:o,spacing:a,wrap:s,zeroMinWidth:l,breakpoints:u}=n,c=[];r&&(c=function(e,t,n={}){if(!e||e<=0)return[];if("string"==typeof e&&!Number.isNaN(Number(e))||"number"==typeof e)return[n[`spacing-xs-${String(e)}`]];let r=[];return t.forEach(t=>{let i=e[t];Number(i)>0&&r.push(n[`spacing-${t}-${String(i)}`])}),r}(a,u,t));let d=[];return u.forEach(e=>{let r=n[e];r&&d.push(t[`grid-${e}-${String(r)}`])}),[t.root,r&&t.container,o&&t.item,l&&t.zeroMinWidth,...c,"row"!==i&&t[`direction-xs-${String(i)}`],"wrap"!==s&&t[`wrap-xs-${String(s)}`],...d]}})(({ownerState:e})=>({boxSizing:"border-box",...e.container&&{display:"flex",flexWrap:"wrap",width:"100%"},...e.item&&{margin:0},...e.zeroMinWidth&&{minWidth:0},..."wrap"!==e.wrap&&{flexWrap:e.wrap}}),function({theme:e,ownerState:t}){let n=(0,v0.kW)({values:t.direction,breakpoints:e.breakpoints.values});return(0,v0.NI)({theme:e},n,e=>{let t={flexDirection:e};return e.startsWith("column")&&(t[`& > .${v4.item}`]={maxWidth:"none"}),t})},function({theme:e,ownerState:t}){let{container:n,rowSpacing:r}=t,i={};if(n&&0!==r){let t,n=(0,v0.kW)({values:r,breakpoints:e.breakpoints.values});"object"==typeof n&&(t=v3({breakpoints:e.breakpoints.values,values:n})),i=(0,v0.NI)({theme:e},n,(n,r)=>{let i=e.spacing(n);return"0px"!==i?{marginTop:`calc(-1 * ${i})`,[`& > .${v4.item}`]:{paddingTop:i}}:t?.includes(r)?{}:{marginTop:0,[`& > .${v4.item}`]:{paddingTop:0}}})}return i},function({theme:e,ownerState:t}){let{container:n,columnSpacing:r}=t,i={};if(n&&0!==r){let t,n=(0,v0.kW)({values:r,breakpoints:e.breakpoints.values});"object"==typeof n&&(t=v3({breakpoints:e.breakpoints.values,values:n})),i=(0,v0.NI)({theme:e},n,(n,r)=>{let i=e.spacing(n);if("0px"!==i){let e=`calc(-1 * ${i})`;return{width:`calc(100% + ${i})`,marginLeft:e,[`& > .${v4.item}`]:{paddingLeft:i}}}return t?.includes(r)?{}:{width:"100%",marginLeft:0,[`& > .${v4.item}`]:{paddingLeft:0}}})}return i},function({theme:e,ownerState:t}){let n;return e.breakpoints.keys.reduce((r,i)=>{let o={};if(t[i]&&(n=t[i]),!n)return r;if(!0===n)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if("auto"===n)o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{let a=(0,v0.kW)({values:t.columns,breakpoints:e.breakpoints.values}),s="object"==typeof a?a[i]:a;if(null==s)return r;let l=`${Math.round(n/s*1e8)/1e6}%`,u={};if(t.container&&t.item&&0!==t.columnSpacing){let n=e.spacing(t.columnSpacing);if("0px"!==n){let e=`calc(${l} + ${n})`;u={flexBasis:e,maxWidth:e}}}o={flexBasis:l,flexGrow:0,maxWidth:l,...u}}return 0===e.breakpoints.values[i]?Object.assign(r,o):r[e.breakpoints.up(i)]=o,r},{})}),v8=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiGrid"}),{breakpoints:r}=(0,uH.A)(),i=(0,uG.A)(n),{className:o,columns:a,columnSpacing:s,component:l="div",container:u=!1,direction:c="row",item:d=!1,rowSpacing:h,spacing:p=0,wrap:f="wrap",zeroMinWidth:g=!1,...m}=i,v=I.useContext(v1),y=u?a||12:v,x={},b={...m};r.keys.forEach(e=>{null!=m[e]&&(x[e]=m[e],delete b[e])});let w={...i,columns:y,container:u,direction:c,item:d,rowSpacing:h||p,columnSpacing:s||p,wrap:f,zeroMinWidth:g,spacing:p,...x,breakpoints:r.keys},S=(e=>{let{classes:t,container:n,direction:r,item:i,spacing:o,wrap:a,zeroMinWidth:s,breakpoints:l}=e,u=[];n&&(u=function(e,t){if(!e||e<=0)return[];if("string"==typeof e&&!Number.isNaN(Number(e))||"number"==typeof e)return[`spacing-xs-${String(e)}`];let n=[];return t.forEach(t=>{let r=e[t];if(Number(r)>0){let e=`spacing-${t}-${String(r)}`;n.push(e)}}),n}(o,l));let c=[];l.forEach(t=>{let n=e[t];n&&c.push(`grid-${t}-${String(n)}`)});let d={root:["root",n&&"container",i&&"item",s&&"zeroMinWidth",...u,"row"!==r&&`direction-xs-${String(r)}`,"wrap"!==a&&`wrap-xs-${String(a)}`,...c]};return(0,R.A)(d,v2,t)})(w);return(0,_.jsx)(v1.Provider,{value:y,children:(0,_.jsx)(v6,{ownerState:w,className:(0,O.A)(S.root,o),as:l,ref:t,...b})})}),v9=({children:e})=>(0,_.jsx)(v8,{item:!0,xs:4,children:(0,_.jsx)(ey.A,{spacing:3,children:e})});var v7=n(67987),ye=n(9799),yt=n(17366);let yn=({id:e,title:t,description:n,placement:r,children:i,enterDelay:o,enterNextDelay:a})=>{let s=(0,_.jsx)("span",{children:i});return(0,_.jsx)(yi,{arrow:!0,id:e,placement:r??"top",title:(0,_.jsx)(yr,{title:t,description:n}),enterDelay:o??500,enterNextDelay:a??500,children:s})},yr=({title:e,description:t})=>(0,_.jsxs)(_.Fragment,{children:[e&&(0,_.jsx)(u7.A,{variant:"body2",sx:e=>({color:e.palette.text.primary,fontWeight:e.typography.fontWeightMedium}),children:e}),(0,_.jsx)(u7.A,{variant:"caption",sx:e=>({color:e.palette.text.primary,whiteSpace:"pre-line"}),children:t})]}),yi=(0,N.A)(({className:e,...t})=>(0,_.jsx)(vt,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${m5.tooltip}`]:{backgroundColor:e.palette.background.tooltip,color:e.palette.text.primary,maxWidth:"300px",padding:e.spacing(1),boxShadow:e.shadows[1]},[`& .${m5.arrow}`]:{color:e.palette.background.tooltip}})),yo=({label:e,control:t,description:n})=>{let r=iS("EditorSectionControl"),i=`${r}-control`,o=`${r}-label`;return(0,_.jsx)(v7.A,{children:(0,_.jsxs)(ey.A,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,_.jsxs)(ey.A,{direction:"row",alignItems:"center",justifyContent:"center",children:[(0,_.jsx)(ye.A,{id:o,htmlFor:i,children:e}),n&&(0,_.jsx)(yn,{description:n,enterDelay:100,children:(0,_.jsx)(eA,{size:"small",sx:e=>({borderRadius:e.shape.borderRadius,padding:"4x",margin:"0 2px"}),children:(0,_.jsx)(yt,{"aria-describedby":"info-tooltip","aria-hidden":!1,fontSize:"inherit",sx:{color:e=>e.palette.grey[700]}})})})]}),(0,_.jsxs)(uQ,{sx:{width:"180px",textAlign:"right"},children:[" ",D().cloneElement(t,{id:i,"aria-labelledby":o})]})]})})},ya=({children:e})=>(0,_.jsx)(v8,{container:!0,spacing:8,children:e}),ys=({title:e,children:t,icon:n})=>(0,_.jsxs)(uQ,{children:[(0,_.jsxs)(uQ,{display:"flex",borderBottom:1,borderColor:"grey.300",marginBottom:e=>e.spacing(1),children:[(0,_.jsx)(u7.A,{variant:"overline",component:"h4",children:e}),n&&(0,_.jsx)(uQ,{sx:{marginLeft:"auto"},children:n})]}),(0,_.jsx)(ey.A,{spacing:1,children:t})]});var yl=n(89369),yu=n(83183),yc=n(71849);function yd(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function yh(e={}){let{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:i="any",stringify:o,trim:a=!1}=e;return(e,{inputValue:s,getOptionLabel:l})=>{let u=a?s.trim():s;n&&(u=u.toLowerCase()),t&&(u=yd(u));let c=u?e.filter(e=>{let r=(o||l)(e);return n&&(r=r.toLowerCase()),t&&(r=yd(r)),"start"===i?r.startsWith(u):r.includes(u)}):e;return"number"==typeof r?c.slice(0,r):c}}let yp=yh(),yf=e=>null!==e.current&&e.current.parentElement?.contains(document.activeElement),yg=[];function ym(e,t,n){if(t||null==e)return"";let r=n(e);return"string"==typeof r?r:""}let yv=function(e){var t;let n,{unstable_isActiveElementInListbox:r=yf,unstable_classNamePrefix:i="Mui",autoComplete:o=!1,autoHighlight:a=!1,autoSelect:s=!1,blurOnSelect:l=!1,clearOnBlur:u=!e.freeSolo,clearOnEscape:c=!1,componentName:d="useAutocomplete",defaultValue:h=e.multiple?yg:null,disableClearable:p=!1,disableCloseOnSelect:f=!1,disabled:g,disabledItemsFocusable:m=!1,disableListWrap:v=!1,filterOptions:y=yp,filterSelectedOptions:x=!1,freeSolo:b=!1,getOptionDisabled:w,getOptionKey:S,getOptionLabel:A=e=>e.label??e,groupBy:C,handleHomeEndKeys:M=!e.freeSolo,id:k,includeInputInList:T=!1,inputValue:_,isOptionEqualToValue:D=(e,t)=>e===t,multiple:O=!1,onChange:R,onClose:E,onHighlightChange:P,onInputChange:L,onOpen:N,open:B,openOnFocus:z=!1,options:F,readOnly:j=!1,selectOnFocus:V=!e.freeSolo,value:H}=e,$=(0,vL.A)(k),W=A;W=e=>{let t=A(e);return"string"!=typeof t?String(t):t};let G=I.useRef(!1),U=I.useRef(!0),q=I.useRef(null),Y=I.useRef(null),[X,Z]=I.useState(null),[K,Q]=I.useState(-1),J=a?0:-1,ee=I.useRef(J),et=I.useRef(ym(h??H,O,W)).current,[en,er]=(0,yl.A)({controlled:H,default:h,name:d}),[ei,eo]=(0,yl.A)({controlled:_,default:et,name:d,state:"inputValue"}),[ea,es]=I.useState(!1),el=I.useCallback((e,t,n)=>{if(!(O?en.length<t.length:null!==t)&&!u)return;let r=ym(t,O,W);ei!==r&&(eo(r),L&&L(e,r,n))},[W,ei,O,L,eo,u,en]),[eu,ec]=(0,yl.A)({controlled:B,default:!1,name:d,state:"open"}),[ed,eh]=I.useState(!0),ep=!O&&null!=en&&ei===W(en),ef=eu&&!j,eg=ef?y(F.filter(e=>!(x&&(O?en:[en]).some(t=>null!==t&&D(e,t)))),{inputValue:ep&&ed?"":ei,getOptionLabel:W}):[],em=(t={filteredOptions:eg,value:en,inputValue:ei},n=I.useRef({}),I.useEffect(()=>{n.current=t}),n.current);I.useEffect(()=>{let e=en!==em.value;ea&&!e||(!b||e)&&el(null,en,"reset")},[en,el,ea,em.value,b]);let ev=eu&&eg.length>0&&!j,ey=(0,yu.A)(e=>{-1===e?q.current.focus():X.querySelector(`[data-tag-index="${e}"]`).focus()});I.useEffect(()=>{O&&K>en.length-1&&(Q(-1),ey(-1))},[en,O,K,ey]);let ex=(0,yu.A)(({event:e,index:t,reason:n})=>{if(ee.current=t,-1===t?q.current.removeAttribute("aria-activedescendant"):q.current.setAttribute("aria-activedescendant",`${$}-option-${t}`),P&&["mouse","keyboard","touch"].includes(n)&&P(e,-1===t?null:eg[t],n),!Y.current)return;let r=Y.current.querySelector(`[role="option"].${i}-focused`);r&&(r.classList.remove(`${i}-focused`),r.classList.remove(`${i}-focusVisible`));let o=Y.current;if("listbox"!==Y.current.getAttribute("role")&&(o=Y.current.parentElement.querySelector('[role="listbox"]')),!o)return;if(-1===t){o.scrollTop=0;return}let a=Y.current.querySelector(`[data-option-index="${t}"]`);if(a&&(a.classList.add(`${i}-focused`),"keyboard"===n&&a.classList.add(`${i}-focusVisible`),o.scrollHeight>o.clientHeight&&"mouse"!==n&&"touch"!==n)){let e=o.clientHeight+o.scrollTop,t=a.offsetTop+a.offsetHeight;t>e?o.scrollTop=t-o.clientHeight:a.offsetTop-a.offsetHeight*(1.3*!!C)<o.scrollTop&&(o.scrollTop=a.offsetTop-a.offsetHeight*(1.3*!!C))}}),eb=(0,yu.A)(({event:e,diff:t,direction:n="next",reason:r})=>{if(!ef)return;let i=function(e,t){if(!Y.current||e<0||e>=eg.length)return -1;let n=e;for(;;){let r=Y.current.querySelector(`[data-option-index="${n}"]`),i=!m&&(!r||r.disabled||"true"===r.getAttribute("aria-disabled"));if(r&&r.hasAttribute("tabindex")&&!i)return n;if((n="next"===t?(n+1)%eg.length:(n-1+eg.length)%eg.length)===e)return -1}}((()=>{let e=eg.length-1;if("reset"===t)return J;if("start"===t)return 0;if("end"===t)return e;let n=ee.current+t;return n<0?-1===n&&T?-1:v&&-1!==ee.current||Math.abs(t)>1?0:e:n>e?n===e+1&&T?-1:v||Math.abs(t)>1?e:0:n})(),n);if(ex({index:i,reason:r,event:e}),o&&"reset"!==t)if(-1===i)q.current.value=ei;else{let e=W(eg[i]);q.current.value=e,0===e.toLowerCase().indexOf(ei.toLowerCase())&&ei.length>0&&q.current.setSelectionRange(ei.length,e.length)}}),ew=I.useCallback(()=>{if(!ef)return;let e=(()=>{var e;if(-1!==ee.current&&em.filteredOptions&&em.filteredOptions.length!==eg.length&&em.inputValue===ei&&(O?en.length===em.value.length&&em.value.every((e,t)=>W(en[t])===W(e)):(e=em.value,(e?W(e):"")===(en?W(en):"")))){let e=em.filteredOptions[ee.current];if(e)return eg.findIndex(t=>W(t)===W(e))}return -1})();if(-1!==e){ee.current=e;return}let t=O?en[0]:en;if(0===eg.length||null==t)return void eb({diff:"reset"});if(Y.current){if(null!=t){let e=eg[ee.current];if(O&&e&&-1!==en.findIndex(t=>D(e,t)))return;let n=eg.findIndex(e=>D(e,t));-1===n?eb({diff:"reset"}):ex({index:n});return}if(ee.current>=eg.length-1)return void ex({index:eg.length-1});ex({index:ee.current})}},[eg.length,!O&&en,x,eb,ex,ef,ei,O]),eS=(0,yu.A)(e=>{(0,yc.A)(Y,e),e&&ew()});I.useEffect(()=>{ew()},[ew]);let eA=e=>{!eu&&(ec(!0),eh(!0),N&&N(e))},eC=(e,t)=>{eu&&(ec(!1),E&&E(e,t))},eM=(e,t,n,r)=>{if(O){if(en.length===t.length&&en.every((e,n)=>e===t[n]))return}else if(en===t)return;R&&R(e,t,n,r),er(t)},ek=I.useRef(!1),eT=(e,t,n="selectOption",r="options")=>{let i=n,o=t;if(O){let e=(o=Array.isArray(en)?en.slice():[]).findIndex(e=>D(t,e));-1===e?o.push(t):"freeSolo"!==r&&(o.splice(e,1),i="removeOption")}el(e,o,i),eM(e,o,i,{option:t}),f||e&&(e.ctrlKey||e.metaKey)||eC(e,i),(!0===l||"touch"===l&&ek.current||"mouse"===l&&!ek.current)&&q.current.blur()},e_=(e,t)=>{if(!O)return;""===ei&&eC(e,"toggleInput");let n=K;-1===K?""===ei&&"previous"===t&&(n=en.length-1):((n+="next"===t?1:-1)<0&&(n=0),n===en.length&&(n=-1)),Q(n=function(e,t){if(-1===e)return -1;let n=e;for(;;){if("next"===t&&n===en.length||"previous"===t&&-1===n)return -1;let e=X.querySelector(`[data-tag-index="${n}"]`);if(e&&e.hasAttribute("tabindex")&&!e.disabled&&"true"!==e.getAttribute("aria-disabled"))return n;n+="next"===t?1:-1}}(n,t)),ey(n)},eI=e=>{G.current=!0,eo(""),L&&L(e,"","clear"),eM(e,O?[]:null,"clear")},eD=e=>{es(!0),z&&!G.current&&eA(e)},eO=e=>{r(Y)?q.current.focus():(es(!1),U.current=!0,G.current=!1,s&&-1!==ee.current&&ef?eT(e,eg[ee.current],"blur"):s&&b&&""!==ei?eT(e,ei,"blur","freeSolo"):u&&el(e,en,"blur"),eC(e,"blur"))},eR=e=>{let t=e.target.value;ei!==t&&(eo(t),eh(!1),L&&L(e,t,"input")),""===t?p||O||eM(e,null,"clear"):eA(e)},eE=e=>{let t=Number(e.currentTarget.getAttribute("data-option-index"));ee.current!==t&&ex({event:e,index:t,reason:"mouse"})},eP=e=>{ex({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"touch"}),ek.current=!0},eL=e=>{let t=Number(e.currentTarget.getAttribute("data-option-index"));eT(e,eg[t],"selectOption"),ek.current=!1},eN=e=>{eu?eC(e,"toggleInput"):eA(e)},eB=e=>{e.currentTarget.contains(e.target)&&e.target.getAttribute("id")!==$&&e.preventDefault()},ez=e=>{e.currentTarget.contains(e.target)&&(q.current.focus(),V&&U.current&&q.current.selectionEnd-q.current.selectionStart==0&&q.current.select(),U.current=!1)},eF=e=>{g||""!==ei&&eu||eN(e)},ej=b&&ei.length>0;ej=ej||(O?en.length>0:null!==en);let eV=eg;return C&&(eV=eg.reduce((e,t,n)=>{let r=C(t);return e.length>0&&e[e.length-1].group===r?e[e.length-1].options.push(t):e.push({key:n,index:n,group:r,options:[t]}),e},[])),g&&ea&&eO(),{getRootProps:(e={})=>({...e,onKeyDown:t=>{if(e.onKeyDown&&e.onKeyDown(t),!t.defaultMuiPrevented&&(-1===K||["ArrowLeft","ArrowRight"].includes(t.key)||(Q(-1),ey(-1)),229!==t.which))switch(t.key){case"Home":ef&&M&&(t.preventDefault(),eb({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":ef&&M&&(t.preventDefault(),eb({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),eb({diff:-5,direction:"previous",reason:"keyboard",event:t}),eA(t);break;case"PageDown":t.preventDefault(),eb({diff:5,direction:"next",reason:"keyboard",event:t}),eA(t);break;case"ArrowDown":t.preventDefault(),eb({diff:1,direction:"next",reason:"keyboard",event:t}),eA(t);break;case"ArrowUp":t.preventDefault(),eb({diff:-1,direction:"previous",reason:"keyboard",event:t}),eA(t);break;case"ArrowLeft":e_(t,"previous");break;case"ArrowRight":e_(t,"next");break;case"Enter":if(-1!==ee.current&&ef){let e=eg[ee.current],n=!!w&&w(e);if(t.preventDefault(),n)return;eT(t,e,"selectOption"),o&&q.current.setSelectionRange(q.current.value.length,q.current.value.length)}else b&&""!==ei&&!1===ep&&(O&&t.preventDefault(),eT(t,ei,"createOption","freeSolo"));break;case"Escape":ef?(t.preventDefault(),t.stopPropagation(),eC(t,"escape")):c&&(""!==ei||O&&en.length>0)&&(t.preventDefault(),t.stopPropagation(),eI(t));break;case"Backspace":if(O&&!j&&""===ei&&en.length>0){let e=-1===K?en.length-1:K,n=en.slice();n.splice(e,1),eM(t,n,"removeOption",{option:en[e]})}break;case"Delete":if(O&&!j&&""===ei&&en.length>0&&-1!==K){let e=en.slice();e.splice(K,1),eM(t,e,"removeOption",{option:en[K]})}}},onMouseDown:eB,onClick:ez}),getInputLabelProps:()=>({id:`${$}-label`,htmlFor:$}),getInputProps:()=>({id:$,value:ei,onBlur:eO,onFocus:eD,onChange:eR,onMouseDown:eF,"aria-activedescendant":ef?"":null,"aria-autocomplete":o?"both":"list","aria-controls":ev?`${$}-listbox`:void 0,"aria-expanded":ev,autoComplete:"off",ref:q,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:g}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:eI}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:eN}),getTagProps:({index:e})=>({key:e,"data-tag-index":e,tabIndex:-1,...!j&&{onDelete:t=>{let n=en.slice();n.splice(e,1),eM(t,n,"removeOption",{option:en[e]})}}}),getListboxProps:()=>({role:"listbox",id:`${$}-listbox`,"aria-labelledby":`${$}-label`,ref:eS,onMouseDown:e=>{e.preventDefault()}}),getOptionProps:({index:e,option:t})=>{let n=(O?en:[en]).some(e=>null!=e&&D(t,e)),r=!!w&&w(t);return{key:S?.(t)??W(t),tabIndex:-1,role:"option",id:`${$}-option-${e}`,onMouseMove:eE,onClick:eL,onTouchStart:eP,"data-option-index":e,"aria-disabled":r,"aria-selected":n}},id:$,inputValue:ei,value:en,dirty:ej,expanded:ef&&X,popupOpen:ef,focused:ea||-1!==K,anchorEl:X,setAnchorEl:Z,focusedTag:K,groupedOptions:eV}};function yy(e){return(0,V.Ay)("MuiListSubheader",e)}(0,j.A)("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);let yx=(0,N.A)("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${(0,L.A)(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})((0,B.A)(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:72}},{props:({ownerState:e})=>!e.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),yb=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiListSubheader"}),{className:r,color:i="default",component:o="li",disableGutters:a=!1,disableSticky:s=!1,inset:l=!1,...u}=n,c={...n,color:i,component:o,disableGutters:a,disableSticky:s,inset:l},d=(e=>{let{classes:t,color:n,disableGutters:r,inset:i,disableSticky:o}=e,a={root:["root","default"!==n&&`color${(0,L.A)(n)}`,!r&&"gutters",i&&"inset",!o&&"sticky"]};return(0,R.A)(a,yy,t)})(c);return(0,_.jsx)(yx,{as:o,className:(0,O.A)(d.root,r),ref:t,ownerState:c,...u})});yb&&(yb.muiSkipListHighlight=!0);let yw=(0,fo.A)((0,_.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function yS(e){return(0,V.Ay)("MuiChip",e)}let yA=(0,j.A)("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),yC=(0,N.A)("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e,{color:r,iconColor:i,clickable:o,onDelete:a,size:s,variant:l}=n;return[{[`& .${yA.avatar}`]:t.avatar},{[`& .${yA.avatar}`]:t[`avatar${(0,L.A)(s)}`]},{[`& .${yA.avatar}`]:t[`avatarColor${(0,L.A)(r)}`]},{[`& .${yA.icon}`]:t.icon},{[`& .${yA.icon}`]:t[`icon${(0,L.A)(s)}`]},{[`& .${yA.icon}`]:t[`iconColor${(0,L.A)(i)}`]},{[`& .${yA.deleteIcon}`]:t.deleteIcon},{[`& .${yA.deleteIcon}`]:t[`deleteIcon${(0,L.A)(s)}`]},{[`& .${yA.deleteIcon}`]:t[`deleteIconColor${(0,L.A)(r)}`]},{[`& .${yA.deleteIcon}`]:t[`deleteIcon${(0,L.A)(l)}Color${(0,L.A)(r)}`]},t.root,t[`size${(0,L.A)(s)}`],t[`color${(0,L.A)(r)}`],o&&t.clickable,o&&"default"!==r&&t[`clickableColor${(0,L.A)(r)})`],a&&t.deletable,a&&"default"!==r&&t[`deletableColor${(0,L.A)(r)}`],t[l],t[`${l}${(0,L.A)(r)}`]]}})((0,B.A)(({theme:e})=>{let t="light"===e.palette.mode?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:16,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${yA.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${yA.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${yA.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${yA.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${yA.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${yA.icon}`]:{marginLeft:5,marginRight:-6},[`& .${yA.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:(0,E.X4)(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:(0,E.X4)(e.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${yA.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${yA.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter((0,z.A)(["contrastText"])).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main,color:(e.vars||e).palette[t].contrastText,[`& .${yA.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t].contrastTextChannel} / 0.7)`:(0,E.X4)(e.palette[t].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t].contrastText}}}})),{props:e=>e.iconColor===e.color,style:{[`& .${yA.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:e=>e.iconColor===e.color&&"default"!==e.color,style:{[`& .${yA.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${yA.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,E.X4)(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}},...Object.entries(e.palette).filter((0,z.A)(["dark"])).map(([t])=>({props:{color:t,onDelete:!0},style:{[`&.${yA.focusVisible}`]:{background:(e.vars||e).palette[t].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,E.X4)(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${yA.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,E.X4)(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter((0,z.A)(["dark"])).map(([t])=>({props:{color:t,clickable:!0},style:{[`&:hover, &.${yA.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${"light"===e.palette.mode?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${yA.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${yA.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${yA.avatar}`]:{marginLeft:4},[`& .${yA.avatarSmall}`]:{marginLeft:2},[`& .${yA.icon}`]:{marginLeft:4},[`& .${yA.iconSmall}`]:{marginLeft:2},[`& .${yA.deleteIcon}`]:{marginRight:5},[`& .${yA.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter((0,z.A)()).map(([t])=>({props:{variant:"outlined",color:t},style:{color:(e.vars||e).palette[t].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.7)`:(0,E.X4)(e.palette[t].main,.7)}`,[`&.${yA.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,E.X4)(e.palette[t].main,e.palette.action.hoverOpacity)},[`&.${yA.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.focusOpacity})`:(0,E.X4)(e.palette[t].main,e.palette.action.focusOpacity)},[`& .${yA.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.7)`:(0,E.X4)(e.palette[t].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t].main}}}}))]}})),yM=(0,N.A)("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{let{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${(0,L.A)(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function yk(e){return"Backspace"===e.key||"Delete"===e.key}let yT=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiChip"}),{avatar:r,className:i,clickable:o,color:a="default",component:s,deleteIcon:l,disabled:u=!1,icon:c,label:d,onClick:h,onDelete:p,onKeyDown:f,onKeyUp:g,size:m="medium",variant:v="filled",tabIndex:y,skipFocusWhenDisabled:x=!1,...b}=n,w=I.useRef(null),S=(0,u2.A)(w,t),A=e=>{e.stopPropagation(),p&&p(e)},C=!1!==o&&!!h||o,M=C||p?K.A:s||"div",k={...n,component:M,disabled:u,size:m,color:a,iconColor:I.isValidElement(c)&&c.props.color||a,onDelete:!!p,clickable:C,variant:v},T=(e=>{let{classes:t,disabled:n,size:r,color:i,iconColor:o,onDelete:a,clickable:s,variant:l}=e,u={root:["root",l,n&&"disabled",`size${(0,L.A)(r)}`,`color${(0,L.A)(i)}`,s&&"clickable",s&&`clickableColor${(0,L.A)(i)}`,a&&"deletable",a&&`deletableColor${(0,L.A)(i)}`,`${l}${(0,L.A)(i)}`],label:["label",`label${(0,L.A)(r)}`],avatar:["avatar",`avatar${(0,L.A)(r)}`,`avatarColor${(0,L.A)(i)}`],icon:["icon",`icon${(0,L.A)(r)}`,`iconColor${(0,L.A)(o)}`],deleteIcon:["deleteIcon",`deleteIcon${(0,L.A)(r)}`,`deleteIconColor${(0,L.A)(i)}`,`deleteIcon${(0,L.A)(l)}Color${(0,L.A)(i)}`]};return(0,R.A)(u,yS,t)})(k),D=M===K.A?{component:s||"div",focusVisibleClassName:T.focusVisible,...p&&{disableRipple:!0}}:{},E=null;p&&(E=l&&I.isValidElement(l)?I.cloneElement(l,{className:(0,O.A)(l.props.className,T.deleteIcon),onClick:A}):(0,_.jsx)(yw,{className:(0,O.A)(T.deleteIcon),onClick:A}));let P=null;r&&I.isValidElement(r)&&(P=I.cloneElement(r,{className:(0,O.A)(T.avatar,r.props.className)}));let N=null;return c&&I.isValidElement(c)&&(N=I.cloneElement(c,{className:(0,O.A)(T.icon,c.props.className)})),(0,_.jsxs)(yC,{as:M,className:(0,O.A)(T.root,i),disabled:!!C&&!!u||void 0,onClick:h,onKeyDown:e=>{e.currentTarget===e.target&&yk(e)&&e.preventDefault(),f&&f(e)},onKeyUp:e=>{e.currentTarget===e.target&&p&&yk(e)&&p(e),g&&g(e)},ref:S,tabIndex:x&&u?-1:y,ownerState:k,...D,...b,children:[P||N,(0,_.jsx)(yM,{className:(0,O.A)(T.label),ownerState:k,children:d}),E]})});var y_=n(63095),yI=n(35931),yD=n(8323),yO=n(52131);let yR=(0,fo.A)((0,_.jsx)("path",{d:"M19 6.41L17.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"}),"Close");var yE=n(94886);function yP(e){return(0,V.Ay)("MuiAutocomplete",e)}let yL=(0,j.A)("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]),yN=(0,N.A)("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e,{fullWidth:r,hasClearIcon:i,hasPopupIcon:o,inputFocused:a,size:s}=n;return[{[`& .${yL.tag}`]:t.tag},{[`& .${yL.tag}`]:t[`tagSize${(0,L.A)(s)}`]},{[`& .${yL.inputRoot}`]:t.inputRoot},{[`& .${yL.input}`]:t.input},{[`& .${yL.input}`]:a&&t.inputFocused},t.root,r&&t.fullWidth,o&&t.hasPopupIcon,i&&t.hasClearIcon]}})({[`&.${yL.focused} .${yL.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${yL.clearIndicator}`]:{visibility:"visible"}},[`& .${yL.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${yL.inputRoot}`]:{[`.${yL.hasPopupIcon}&, .${yL.hasClearIcon}&`]:{paddingRight:30},[`.${yL.hasPopupIcon}.${yL.hasClearIcon}&`]:{paddingRight:56},[`& .${yL.input}`]:{width:0,minWidth:30}},[`& .${y_.A.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${y_.A.root}.${yI.A.sizeSmall}`]:{[`& .${y_.A.input}`]:{padding:"2px 4px 3px 0"}},[`& .${yD.A.root}`]:{padding:9,[`.${yL.hasPopupIcon}&, .${yL.hasClearIcon}&`]:{paddingRight:39},[`.${yL.hasPopupIcon}.${yL.hasClearIcon}&`]:{paddingRight:65},[`& .${yL.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${yL.endAdornment}`]:{right:9}},[`& .${yD.A.root}.${yI.A.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${yL.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${yO.A.root}`]:{paddingTop:19,paddingLeft:8,[`.${yL.hasPopupIcon}&, .${yL.hasClearIcon}&`]:{paddingRight:39},[`.${yL.hasPopupIcon}.${yL.hasClearIcon}&`]:{paddingRight:65},[`& .${yO.A.input}`]:{padding:"7px 4px"},[`& .${yL.endAdornment}`]:{right:9}},[`& .${yO.A.root}.${yI.A.sizeSmall}`]:{paddingBottom:1,[`& .${yO.A.input}`]:{padding:"2.5px 4px"}},[`& .${yI.A.hiddenLabel}`]:{paddingTop:8},[`& .${yO.A.root}.${yI.A.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${yL.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${yO.A.root}.${yI.A.hiddenLabel}.${yI.A.sizeSmall}`]:{[`& .${yL.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${yL.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${yL.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${yL.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${yL.inputRoot}`]:{flexWrap:"wrap"}}}]}),yB=(0,N.A)("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),yz=(0,N.A)(eA,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),yF=(0,N.A)(eA,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),yj=(0,N.A)(mJ,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${yL.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})((0,B.A)(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),yV=(0,N.A)(vz.A,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})((0,B.A)(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),yH=(0,N.A)("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})((0,B.A)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),y$=(0,N.A)("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})((0,B.A)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),yW=(0,N.A)("ul",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})((0,B.A)(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${yL.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${yL.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${yL.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,E.X4)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${yL.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,E.X4)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${yL.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,E.X4)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}}))),yG=(0,N.A)(yb,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})((0,B.A)(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),yU=(0,N.A)("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,[`& .${yL.option}`]:{paddingLeft:24}}),yq=I.forwardRef(function(e,t){let n,r=(0,F.b)({props:e,name:"MuiAutocomplete"}),{autoComplete:i=!1,autoHighlight:o=!1,autoSelect:a=!1,blurOnSelect:s=!1,ChipProps:l,className:u,clearIcon:c=C||(C=(0,_.jsx)(yR,{fontSize:"small"})),clearOnBlur:d=!r.freeSolo,clearOnEscape:h=!1,clearText:p="Clear",closeText:f="Close",componentsProps:g,defaultValue:m=r.multiple?[]:null,disableClearable:v=!1,disableCloseOnSelect:y=!1,disabled:x=!1,disabledItemsFocusable:b=!1,disableListWrap:w=!1,disablePortal:S=!1,filterOptions:A,filterSelectedOptions:k=!1,forcePopupIcon:T="auto",freeSolo:D=!1,fullWidth:E=!1,getLimitTagsText:P=e=>`+${e}`,getOptionDisabled:N,getOptionKey:B,getOptionLabel:z,isOptionEqualToValue:j,groupBy:V,handleHomeEndKeys:H=!r.freeSolo,id:$,includeInputInList:W=!1,inputValue:G,limitTags:U=-1,ListboxComponent:q,ListboxProps:Y,loading:X=!1,loadingText:Z="Loading…",multiple:K=!1,noOptionsText:Q="No options",onChange:J,onClose:ee,onHighlightChange:et,onInputChange:en,onOpen:er,open:ei,openOnFocus:eo=!1,openText:ea="Open",options:es,PaperComponent:el,PopperComponent:eu,popupIcon:ec=M||(M=(0,_.jsx)(yE.A,{})),readOnly:ed=!1,renderGroup:eh,renderInput:ep,renderOption:ef,renderTags:eg,selectOnFocus:em=!r.freeSolo,size:ev="medium",slots:ey={},slotProps:ex={},value:eb,...ew}=r,{getRootProps:eS,getInputProps:eA,getInputLabelProps:eC,getPopupIndicatorProps:eM,getClearProps:ek,getTagProps:eT,getListboxProps:e_,getOptionProps:eI,value:eD,dirty:eO,expanded:eR,id:eE,popupOpen:eP,focused:eL,focusedTag:eN,anchorEl:eB,setAnchorEl:ez,inputValue:eF,groupedOptions:ej}=yv({...r,componentName:"Autocomplete"}),eV=!v&&!x&&eO&&!ed,eH=(!D||!0===T)&&!1!==T,{onMouseDown:e$}=eA(),{ref:eW,...eG}=e_(),eU=z||(e=>e.label??e),eq={...r,disablePortal:S,expanded:eR,focused:eL,fullWidth:E,getOptionLabel:eU,hasClearIcon:eV,hasPopupIcon:eH,inputFocused:-1===eN,popupOpen:eP,size:ev},eY=(e=>{let{classes:t,disablePortal:n,expanded:r,focused:i,fullWidth:o,hasClearIcon:a,hasPopupIcon:s,inputFocused:l,popupOpen:u,size:c}=e,d={root:["root",r&&"expanded",i&&"focused",o&&"fullWidth",a&&"hasClearIcon",s&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${(0,L.A)(c)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return(0,R.A)(d,yP,t)})(eq),eX={slots:{paper:el,popper:eu,...ey},slotProps:{chip:l,listbox:Y,...g,...ex}},[eZ,eK]=(0,cn.A)("listbox",{elementType:yW,externalForwardedProps:eX,ownerState:eq,className:eY.listbox,additionalProps:eG,ref:eW}),[eQ,eJ]=(0,cn.A)("paper",{elementType:vz.A,externalForwardedProps:eX,ownerState:eq,className:eY.paper}),[e0,e1]=(0,cn.A)("popper",{elementType:mJ,externalForwardedProps:eX,ownerState:eq,className:eY.popper,additionalProps:{disablePortal:S,style:{width:eB?eB.clientWidth:null},role:"presentation",anchorEl:eB,open:eP}});if(K&&eD.length>0){let e=e=>({className:eY.tag,disabled:x,...eT(e)});n=eg?eg(eD,e,eq):eD.map((t,n)=>{let{key:r,...i}=e({index:n});return(0,_.jsx)(yT,{label:eU(t),size:ev,...i,...eX.slotProps.chip},r)})}if(U>-1&&Array.isArray(n)){let e=n.length-U;!eL&&e>0&&(n=n.splice(0,U)).push((0,_.jsx)("span",{className:eY.tag,children:P(e)},n.length))}let e2=eh||(e=>(0,_.jsxs)("li",{children:[(0,_.jsx)(yG,{className:eY.groupLabel,ownerState:eq,component:"div",children:e.group}),(0,_.jsx)(yU,{className:eY.groupUl,ownerState:eq,children:e.children})]},e.key)),e5=ef||((e,t)=>{let{key:n,...r}=e;return(0,_.jsx)("li",{...r,children:eU(t)},n)}),e4=(e,t)=>{let n=eI({option:e,index:t});return e5({...n,className:eY.option},e,{selected:n["aria-selected"],index:t,inputValue:eF},eq)},e3=eX.slotProps.clearIndicator,e6=eX.slotProps.popupIndicator;return(0,_.jsxs)(I.Fragment,{children:[(0,_.jsx)(yN,{ref:t,className:(0,O.A)(eY.root,u),ownerState:eq,...eS(ew),children:ep({id:eE,disabled:x,fullWidth:!0,size:"small"===ev?"small":void 0,InputLabelProps:eC(),InputProps:{ref:ez,className:eY.inputRoot,startAdornment:n,onMouseDown:e=>{e.target===e.currentTarget&&e$(e)},...(eV||eH)&&{endAdornment:(0,_.jsxs)(yB,{className:eY.endAdornment,ownerState:eq,children:[eV?(0,_.jsx)(yz,{...ek(),"aria-label":p,title:p,ownerState:eq,...e3,className:(0,O.A)(eY.clearIndicator,e3?.className),children:c}):null,eH?(0,_.jsx)(yF,{...eM(),disabled:x,"aria-label":eP?f:ea,title:eP?f:ea,ownerState:eq,...e6,className:(0,O.A)(eY.popupIndicator,e6?.className),children:ec}):null]})}},inputProps:{className:eY.input,disabled:x,readOnly:ed,...eA()}})}),eB?(0,_.jsx)(yj,{as:e0,...e1,children:(0,_.jsxs)(yV,{as:eQ,...eJ,children:[X&&0===ej.length?(0,_.jsx)(yH,{className:eY.loading,ownerState:eq,children:Z}):null,0!==ej.length||D||X?null:(0,_.jsx)(y$,{className:eY.noOptions,ownerState:eq,role:"presentation",onMouseDown:e=>{e.preventDefault()},children:Q}),ej.length>0?(0,_.jsx)(eZ,{as:q,...eK,children:ej.map((e,t)=>V?e2({key:e.key,group:e.group,children:e.options.map((t,n)=>e4(t,e.index+n))}):e4(e,t))}):null]})}):null]})});function yY({options:e,renderInput:t=e=>(0,_.jsx)(eC.A,{...e}),id:n,"aria-labelledby":r,...i}){let o=e=>e.label??e.id;return(0,_.jsx)(yq,{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":r}}),renderOption:({key:e,...t},n)=>(0,_.jsx)("li",{...t,children:(0,_.jsxs)("div",{children:[(0,_.jsx)(u7.A,{variant:"body1",component:"div",children:o(n)}),n.description&&(0,_.jsx)(u7.A,{variant:"body2",component:"div",sx:{color:e=>e.palette.text.secondary},children:n.description})]})},e),filterOptions:yh({stringify:e=>`${o(e)} ${e.description||""}`}),...i})}let yX=[{id:"compact",label:"Compact"},{id:"standard",label:"Standard"},{id:"comfortable",label:"Comfortable"}];function yZ({onChange:e,value:t="standard"}){return(0,_.jsx)(yo,{label:"Density",control:(0,_.jsx)(yY,{value:yX.find(e=>e.id===t),options:yX,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function yK(){return(0,_.jsxs)(ey.A,{direction:"row",alignItems:"center",children:[(0,_.jsx)(uQ,{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,_.jsx)(uQ,{sx:{content:'""',height:2,background:e=>e.palette.info.main,width:"100%"}})]})}function yQ(e){return(yQ="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 yJ(e,t,n){var r;return(r=function(e,t){if("object"!=yQ(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=yQ(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==yQ(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function y1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y0(Object(n),!0).forEach(function(t){yJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var y2={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)}},y5=Symbol("closestEdge");function y4(e){var t;return null!=(t=e[y5])?t:null}function y3(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y6(e,t){if(e){if("string"==typeof e)return y3(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)?y3(e,t):void 0}}function y8(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 r,i,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=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||y6(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 y9(){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 y7=n(96907),xe="data-pdnd-honey-pot";function xt(e){return e instanceof Element&&e.hasAttribute(xe)}function xn(e){var t=y8(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?xt(n)?null!=r?r:null:n:null}var xr={inset:"unset",border:"none",padding:0,margin:0,overflow:"visible",color:"inherit",background:"transparent"};function xi(e){var t=null;return function(){if(!t){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];t={result:e.apply(this,r)}}return t.result}}var xo=xi(function(){return"u">typeof HTMLElement&&"function"==typeof HTMLElement.prototype.showPopover});function xa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xa(Object(n),!0).forEach(function(t){yJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xl(e){var t,n,r,i,o={x:Math.min((i={x:Math.max((r={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(r.y,0)}).x,window.innerWidth-2),y:Math.min(i.y,window.innerHeight-2)};return DOMRect.fromRect({x:o.x,y:o.y,width:2,height:2})}function xu(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 xc(e){return function(e){if(Array.isArray(e))return y3(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||y6(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 xd=xi(function(){return navigator.userAgent.includes("Firefox")}),xh=xi(function(){var e=navigator.userAgent;return e.includes("AppleWebKit")&&!e.includes("Chrome")}),xp={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};if(!("u"<typeof window)&&xh()){var xf=xg();(0,y7.bindAll)(window,[{type:"dragstart",listener:function(){xf.enterCount=0,xf.isOverWindow=!0}},{type:"drop",listener:xm},{type:"dragend",listener:xm},{type:"dragenter",listener:function(e){xf.isOverWindow||0!==xf.enterCount||(e[xp.isEnteringWindow]=!0),xf.isOverWindow=!0,xf.enterCount++}},{type:"dragleave",listener:function(e){xf.enterCount--,xf.isOverWindow&&0===xf.enterCount&&(e[xp.isLeavingWindow]=!0,xf.isOverWindow=!1)}}],{capture:!0})}function xg(){return{enterCount:0,isOverWindow:!1}}function xm(){xf=xg()}function xv(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 xy=(c=function(e){return e()},d=[],h=null,(p=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];d=t,h||(h=requestAnimationFrame(function(){h=null,c.apply(void 0,d)}))}).cancel=function(){h&&(cancelAnimationFrame(h),h=null)},p),xx=(f=null,{schedule:function(e){f={frameId:requestAnimationFrame(function(){f=null,e()}),fn:e}},flush:function(){f&&(cancelAnimationFrame(f.frameId),f.fn(),f=null)}}),xb={isActive:!1};function xw(){return!xb.isActive}function xS(e){var t,n=e.event,r=null==(t=e.current[0])?void 0:t.dropEffect;null!=r&&n.dataTransfer&&(n.dataTransfer.dropEffect=r)}var xA=function(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(xw()){var o,a,s=function(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=xv(t);if("external"===n.startedFrom)return{input:i,dropTargets:[]};var o=r({input:i,source:n.payload,target:t.target,current:[]});return{input:i,dropTargets:o}}({event:t,dragType:n,getDropTargetsOver:r});xb.isActive=!0;var l={current:s};xS({event:t,current:s.dropTargets});var u=function(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function o(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,a={current:n,previous:i,initial:n};o({eventName:"onGenerateDragPreview",payload:{source:t,location:a,nativeSetDragImage:r}}),xx.schedule(function(){o({eventName:"onDragStart",payload:{source:t,location:a}})})},dragUpdate:function(e){var r=e.current;xx.flush(),xy.cancel(),o({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;xy(function(){xx.flush(),o({eventName:"onDrag",payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,a=e.updatedSourcePayload;xx.flush(),xy.cancel(),o({eventName:"onDrop",payload:{source:null!=a?a:t,location:{current:r,previous:i,initial:n}}})}}}({source:n.payload,dispatchEvent:i,initial:s}),c=(0,y7.bindAll)(window,[{type:"dragover",listener:function(e){h(e),u.drag({current:l.current})}},{type:"dragenter",listener:h},{type:"dragleave",listener:function(e){(function(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return"dragleave"===n&&(xh()?!!xh()&&t.hasOwnProperty(xp.isLeavingWindow):null==r||(xd()?"nodeName"in r&&r.ownerDocument!==document:r instanceof HTMLIFrameElement))})({dragLeave:e})&&(d({input:l.current.input,dropTargets:[]}),"external"===n.startedFrom&&p())}},{type:"drop",listener:function(e){(l.current={dropTargets:l.current.dropTargets,input:xv(e)},l.current.dropTargets.length)?(e.preventDefault(),xS({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:xv(e)},p()}}].concat(xc([{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 d(e){var t=function(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}({current:l.current.dropTargets,next:e.dropTargets});l.current=e,t&&u.dragUpdate({current:l.current})}function h(e){var t=xv(e),i=r({target:xt(e.target)?xn({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:l.current.dropTargets});i.length&&(e.preventDefault(),xS({event:e,current:i})),d({dropTargets:i,input:t})}function p(){l.current.dropTargets.length&&d({dropTargets:[],input:l.current.input}),u.drop({current:l.current,updatedSourcePayload:null}),f()}function f(){xb.isActive=!1,c()}},xC=new Map;function xM(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function xk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xk(Object(n),!0).forEach(function(t){yJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x_(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 xI(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)?xI(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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 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 xI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xD(e){return e.slice(0).reverse()}function xO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var xE=xi(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),xP="text/plain",xL=new WeakMap,xN=(g=null,{bindEvents:function(){return g=null,(0,y7.bind)(window,{type:"pointermove",listener:function(e){g={x:e.clientX,y:e.clientY}},options:{capture:!0}})},getOnPostDispatch:function(){var e=null;return function(t){var n=t.eventName,r=t.payload;if("onDragStart"===n){var i,o,a,s=r.location.initial.input,l=null!=g?g:{x:s.clientX,y:s.clientY};(i=document.createElement("div")).setAttribute(xe,"true"),xo()&&i.setAttribute("popover","manual"),o=xl({client:l}),Object.assign(i.style,xs(xs({position:"fixed"},xo()?xr:{zIndex:0x7fffffff}),{},{backgroundColor:"transparent",padding:0,margin:0,boxSizing:"border-box",pointerEvents:"auto"},xu({clientRect:o}))),document.body.appendChild(i),xo()&&i.showPopover(),a=(0,y7.bind)(window,{type:"pointermove",listener:function(e){o=xl({client:{x:e.clientX,y:e.clientY}}),Object.assign(i.style,xu({clientRect:o}))},options:{capture:!0}}),e=function(e){var t,n,r,s=e.current;if(a(),n=(t={client:s,clientRect:o}).client,r=t.clientRect,n.x>=r.x&&n.x<=r.x+r.width&&n.y>=r.y&&n.y<=r.y+r.height)return void i.remove();function l(){u(),i.remove()}var u=(0,y7.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=r.location.current.input;null==(u=e)||u({current:{x:c.clientX,y:c.clientY}}),e=null,g=null}}}}),xB=function(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=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(r){var i=r.eventName,o=r.payload;if("onGenerateDragPreview"===i){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 xO(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)?xO(e,void 0):void 0}}(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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 i,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,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw i}}}}(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 d,h=u[c];t.active.has(h)&&(null==(d=h[i])||d.call(h,o))}"onDrop"===i&&(t.active.clear(),t=null)}},monitorForConsumers:function(r){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xR(Object(n),!0).forEach(function(t){yJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},r);return e.add(i),n(i),xi(function(){e.delete(i),t&&t.active.delete(i)})}}}(),s=function(e){var t=e.typeKey,n=e.defaultDropEffect,r=new WeakMap,i="data-drop-target-for-".concat(t),o="[".concat(i,"]");function a(e){var t,n=e.eventName,i=e.payload,o=x_(i.location.current.dropTargets);try{for(o.s();!(t=o.n()).done;){var a,s=t.value,l=r.get(s.element),u=xT(xT({},i),{},{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,i=new Set(n.location.current.dropTargets.map(function(e){return e.element})),o=new Set,a=x_(n.location.previous.dropTargets);try{for(a.s();!(t=a.n()).done;){var s,l,u=t.value;o.add(u.element);var c=r.get(u.element),d=i.has(u.element),h=xT(xT({},n),{},{self:u});null==c||null==(s=c.onDropTargetChange)||s.call(c,h),d||null==c||null==(l=c.onDragLeave)||l.call(c,h)}}catch(e){a.e(e)}finally{a.f()}var p,f=x_(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=xT(xT({},n),{},{self:v}),x=r.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 xi(y9(xM(e.element,{attribute:i,value:"true"}),(r.set(e.element,e),function(){return r.delete(e.element)})))},getIsOver:function(e){var t=e.source,i=e.target,a=e.input,s=e.current,l=function e(t){var i,a,s,l,u=t.source,c=t.target,d=t.input,h=t.result,p=void 0===h?[]:h;if(null==c)return p;if(!(c instanceof Element))return c instanceof Node?e({source:u,target:c.parentElement,input:d,result:p}):p;var f=c.closest(o);if(null==f)return p;var g=r.get(f);if(null==g)return p;var m={input:d,source:u,element:g.element};if(g.canDrop&&!g.canDrop(m))return e({source:u,target:g.element.parentElement,input:d,result:p});var v=null!=(i=null==(a=g.getData)?void 0:a.call(g,m))?i:{},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:d,result:[].concat(xc(p),[x])})}({source:t,target:i,input:a});if(l.length>=s.length)return l;for(var u=xD(s),c=xD(l),d=[],h=0;h<u.length;h++){var p,f=u[h],g=c[h];if(null!=g){d.push(g);continue}var m=d[h-1],v=u[h-1];if((null==m?void 0:m.element)!==(null==v?void 0:v.element))break;var y=r.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;d.push(xT(xT({},f),{},{isActiveDueToStickiness:!0}))}return xD(d)},dispatchEvent:function(e){s[e.eventName](e)}}}({typeKey:t,defaultDropEffect:o});function l(e){null==r||r(e),s.dispatchEvent(e),a.dispatchEvent(e),null==i||i(e)}function u(e){xA({event:e.event,dragType:e.dragType,getDropTargetsOver:s.getIsOver,dispatchEvent:l})}return{registerUsage:function(){var e,r;return r=function(e){var t=e.typeKey,n=e.mount,r=xC.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return xC.set(t,i),i}(e={typeKey:t,mount:function(){return n({canStart:xw,start:u})}}),function(){r.usageCount--,r.usageCount>0||(r.unmount(),xC.delete(e.typeKey))}},dropTarget:s.dropTargetForConsumers,monitor:a.monitorForConsumers}}({typeKey:"element",defaultDropEffect:"move",mount:function(e){return y9(xN.bindEvents(),(0,y7.bind)(document,{type:"dragstart",listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n,r,i,o,a,s,l=t.target;if(l instanceof HTMLElement){var u=xL.get(l);if(u){var c=xv(t),d={element:u.element,dragHandle:null!=(n=u.dragHandle)?n:null,input:c};if(u.canDrag&&!u.canDrag(d))return void t.preventDefault();if(u.dragHandle){var h=xn({x:c.clientX,y:c.clientY});if(!u.dragHandle.contains(h))return void t.preventDefault()}var p=null!=(r=null==(i=u.getInitialDataForExternal)?void 0:i.call(u,d))?r:null;if(p)for(var f=0,g=Object.entries(p);f<g.length;f++){var m=y8(g[f],2),v=m[0],y=m[1];t.dataTransfer.setData(v,null!=y?y:"")}!xE()||t.dataTransfer.types.includes(xP)||t.dataTransfer.types.includes("text/uri-list")||t.dataTransfer.setData(xP,"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,d))?a:{}};e.start({event:t,dragType:{type:"element",payload:x,startedFrom:"internal"}})}}}}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;null==(t=xL.get(i.source.element))||null==(n=t[r])||n.call(t,i)},onPostDispatch:xN.getOnPostDispatch()}),xz=xB.dropTarget,xF=xB.monitor;let xj={type:"idle"};function xV({elements:e,accessKey:t,axis:n="vertical",onChange:r}){return(0,I.useEffect)(()=>xF({onDrop({location:i,source:o}){var a,s;let l=i.current.dropTargets[0];if(!l)return;let u=o.data,c=l.data,d=e.findIndex(e=>e[t]===u[t]),h=e.findIndex(e=>e[t]===c[t]);h<0||d<0||r(function(e){var t=e.list,n=e.startIndex,r=e.finishIndex;if(-1===n||-1===r)return Array.from(t);var i=Array.from(t),o=y8(i.splice(n,1),1)[0];return i.splice(r,0,o),i}({list:(a={list:e,startIndex:d,indexOfTarget:h,closestEdgeOfTarget:y4(c),axis:n}).list,startIndex:s=a.startIndex,finishIndex:function(e){var t=e.startIndex,n=e.closestEdgeOfTarget,r=e.indexOfTarget,i=e.axis;if(-1===t||-1===r||t===r)return t;if(null==n)return r;var o="vertical"===i&&"bottom"===n||"horizontal"===i&&"right"===n;return t<r?o?r:r-1:o?r+1:r}({closestEdgeOfTarget:a.closestEdgeOfTarget,startIndex:s,indexOfTarget:a.indexOfTarget,axis:a.axis})}))}}),[t,n,e,r])}function xH({children:e,data:t}){let n=(0,I.useRef)(null),[r,i]=(0,I.useState)(xj);return(0,I.useEffect)(()=>{let e=n.current;if(e){var r;return y9((r={element:e,getInitialData:()=>t,onDragStart(){i({type:"is-dragging"})},onDrop(){i(xj)}},xi(y9(xB.registerUsage(),(xL.set(r.element,r),function(){xL.delete(r.element)}),xM(r.element,{attribute:"draggable",value:"true"})))),xz({element:e,canDrop:({source:t})=>t.element!==e,getData:({input:n})=>{var r,i,o,a,s,l,u,c,d;return a=(r={element:e,input:n,allowedEdges:["top","bottom"]}).element,s=r.input,l=r.allowedEdges,u={x:s.clientX,y:s.clientY},c=a.getBoundingClientRect(),d=null!=(i=null==(o=l.map(function(e){return{edge:e,value:y2[e](c,u)}}).sort(function(e,t){return e.value-t.value})[0])?void 0:o.edge)?i:null,y1(y1({},t),{},yJ({},y5,d))},getIsSticky:()=>!0,onDragEnter({self:e}){i({type:"is-dragging-over",closestEdge:y4(e.data)})},onDrag({self:e}){let t=y4(e.data);i(e=>"is-dragging-over"===e.type&&e.closestEdge===t?e:{type:"is-dragging-over",closestEdge:t})},onDragLeave(){i(xj)},onDrop(){i(xj)}}))}},[t]),(0,_.jsxs)(ey.A,{ref:n,spacing:1,style:{opacity:"is-dragging"===r.type?.5:"unset"},children:["is-dragging-over"===r.type&&"top"===r.closestEdge?(0,_.jsx)(yK,{}):null,e,"is-dragging-over"===r.type&&"bottom"===r.closestEdge?(0,_.jsx)(yK,{}):null]})}var x$=n(53064);function xW(e,t){let n=t.indexOf(e);if(0===n)return t;let r=[...t];return r.splice(n,1),r.splice(n-1,0,e),r}function xG(e,t){let n=t.indexOf(e);if(n===t.length-1)return t;let r=[...t];return r.splice(n,1),r.splice(n+1,0,e),r}let xU=(0,I.forwardRef)(function({onMoveUp:e,onMoveDown:t,onMoveLeft:n,onMoveRight:r,menuSx:i,...o},a){let[s,l]=(0,I.useState)(null),u=!!s;function c(e){l(null),e?.()}return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(eA,{...o,ref:a,"aria-label":"move","aria-haspopup":!0,"aria-expanded":u,size:"small",onClick:function(e){l(e.currentTarget)},children:(0,_.jsx)(x$,{})}),(e||t||n||r)&&(0,_.jsxs)(vn.A,{id:"drag-button-menu",MenuListProps:{"aria-labelledby":"drag-button-menu"},anchorEl:s,open:u,onClose:()=>c(void 0),sx:i,children:[e&&(0,_.jsx)(fD,{onClick:()=>c(e),children:"Move Up"}),t&&(0,_.jsx)(fD,{onClick:()=>c(t),children:"Move Down"}),n&&(0,_.jsx)(fD,{onClick:()=>c(n),children:"Move Left"}),r&&(0,_.jsx)(fD,{onClick:()=>c(r),children:"Move Right"}),r&&(0,_.jsx)(fD,{onClick:()=>c(r),children:"Move Right"})]})]})});var xq=n(70320),xY=n(45827);let xX={...I}.useSyncExternalStore;function xZ(e={}){let{themeId:t}=e;return function(e,n={}){let r=(0,xY.A)();r&&t&&(r=r[t]||r);let i="u">typeof window&&void 0!==window.matchMedia,{defaultMatches:o=!1,matchMedia:a=i?window.matchMedia:null,ssrMatchMedia:s=null,noSsr:l=!1}=(0,xq.A)({name:"MuiUseMediaQuery",props:n,theme:r}),u="function"==typeof e?e(r):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!==xX?function(e,t,n,r,i){let o=I.useCallback(()=>t,[t]),a=I.useMemo(()=>{if(i&&n)return()=>n(e).matches;if(null!==r){let{matches:t}=r(e);return()=>t}return o},[o,e,r,i,n]),[s,l]=I.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 xX(l,s,a)}:function(e,t,n,r,i){let[o,a]=I.useState(()=>i&&n?n(e).matches:r?r(e).matches:t);return(0,gK.A)(()=>{if(!n)return;let t=n(e),r=()=>{a(t.matches)};return r(),t.addEventListener("change",r),()=>{t.removeEventListener("change",r)}},[e,n]),o})(u,o,a,s,l)}}xZ();let xK=xZ({themeId:uX.A});var xQ=n(46477),xJ=n(55403),x0=n(32494),x1=n(63025);function x2(e,t,n){let r=function(e,t,n){let r,i=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),a=(0,x1.A)(t);if(t.fakeTransform)r=t.fakeTransform;else{let e=a.getComputedStyle(t);r=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("transform")}let s=0,l=0;if(r&&"none"!==r&&"string"==typeof r){let e=r.split("(")[1].split(")")[0].split(",");s=parseInt(e[4],10),l=parseInt(e[5],10)}return"left"===e?o?`translateX(${o.right+s-i.left}px)`:`translateX(${a.innerWidth+s-i.left}px)`:"right"===e?o?`translateX(-${i.right-o.left-s}px)`:`translateX(-${i.left+i.width-s}px)`:"up"===e?o?`translateY(${o.bottom+l-i.top}px)`:`translateY(${a.innerHeight+l-i.top}px)`:o?`translateY(-${i.top-o.top+i.height-l}px)`:`translateY(-${i.top+i.height-l}px)`}(e,t,"function"==typeof n?n():n);r&&(t.style.webkitTransform=r,t.style.transform=r)}let x5=I.forwardRef(function(e,t){let n=(0,uH.A)(),r={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},i={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:s,container:l,direction:u="down",easing:c=r,in:d,onEnter:h,onEntered:p,onEntering:f,onExit:g,onExited:m,onExiting:v,style:y,timeout:x=i,TransitionComponent:b=xQ.Ay,...w}=e,S=I.useRef(null),A=(0,u2.A)((0,gY.A)(s),S,t),C=e=>t=>{e&&(void 0===t?e(S.current):e(S.current,t))},M=C((e,t)=>{x2(u,e,l),(0,x0.q)(e),h&&h(e,t)}),k=C((e,t)=>{let r=(0,x0.c)({timeout:x,style:y,easing:c},{mode:"enter"});e.style.webkitTransition=n.transitions.create("-webkit-transform",{...r}),e.style.transition=n.transitions.create("transform",{...r}),e.style.webkitTransform="none",e.style.transform="none",f&&f(e,t)}),T=C(p),D=C(v),O=C(e=>{let t=(0,x0.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),x2(u,e,l),g&&g(e)}),R=C(e=>{e.style.webkitTransition="",e.style.transition="",m&&m(e)}),E=I.useCallback(()=>{S.current&&x2(u,S.current,l)},[u,l]);return I.useEffect(()=>{if(d||"down"===u||"right"===u)return;let e=(0,xJ.A)(()=>{S.current&&x2(u,S.current,l)}),t=(0,x1.A)(S.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[u,d,l]),I.useEffect(()=>{d||E()},[d,E]),(0,_.jsx)(b,{nodeRef:S,onEnter:M,onEntered:T,onEntering:k,onExit:O,onExited:R,onExiting:D,addEndListener:e=>{o&&o(S.current,e)},appear:a,in:d,timeout:x,...w,children:(e,{ownerState:t,...n})=>I.cloneElement(s,{ref:A,style:{visibility:"exited"!==e||d?void 0:"hidden",...y,...s.props.style},...n})})});function x4(e){return(0,V.Ay)("MuiDrawer",e)}(0,j.A)("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);let x3=(e,t)=>{let{ownerState:n}=e;return[t.root,("permanent"===n.variant||"persistent"===n.variant)&&t.docked,t.modal]},x6=(0,N.A)(vN.A,{name:"MuiDrawer",slot:"Root",overridesResolver:x3})((0,B.A)(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),x8=(0,N.A)("div",{shouldForwardProp:Z.A,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:x3})({flex:"0 0 auto"}),x9=(0,N.A)(vz.A,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`paperAnchor${(0,L.A)(n.anchor)}`],"temporary"!==n.variant&&t[`paperAnchorDocked${(0,L.A)(n.anchor)}`]]}})((0,B.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}`}}]}))),x7={left:"right",right:"left",top:"down",bottom:"up"},be=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiDrawer"}),r=(0,uH.A)(),i=(0,fj.I)(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{anchor:a="left",BackdropProps:s,children:l,className:u,elevation:c=16,hideBackdrop:d=!1,ModalProps:{BackdropProps:h,...p}={},onClose:f,open:g=!1,PaperProps:m={},SlideProps:v,TransitionComponent:y,transitionDuration:x=o,variant:b="temporary",slots:w={},slotProps:S={},...A}=n,C=I.useRef(!1);I.useEffect(()=>{C.current=!0},[]);let M=function({direction:e},t){return"rtl"===e&&["left","right"].includes(t)?x7[t]:t}({direction:i?"rtl":"ltr"},a),k={...n,anchor:a,elevation:c,open:g,variant:b,...A},T=(e=>{let{classes:t,anchor:n,variant:r}=e,i={root:["root",`anchor${(0,L.A)(n)}`],docked:[("permanent"===r||"persistent"===r)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${(0,L.A)(n)}`,"temporary"!==r&&`paperAnchorDocked${(0,L.A)(n)}`]};return(0,R.A)(i,x4,t)})(k),D={slots:{transition:y,...w},slotProps:{paper:m,transition:v,...S,backdrop:(0,fd.A)(S.backdrop||{...s,...h},{transitionDuration:x})}},[E,P]=(0,cn.A)("root",{ref:t,elementType:x6,className:(0,O.A)(T.root,T.modal,u),shouldForwardComponentProp:!0,ownerState:k,externalForwardedProps:{...D,...A,...p},additionalProps:{open:g,onClose:f,hideBackdrop:d,slots:{backdrop:D.slots.backdrop},slotProps:{backdrop:D.slotProps.backdrop}}}),[N,B]=(0,cn.A)("paper",{elementType:x9,shouldForwardComponentProp:!0,className:(0,O.A)(T.paper,m.className),ownerState:k,externalForwardedProps:D,additionalProps:{elevation:"temporary"===b?c:0,square:!0}}),[z,j]=(0,cn.A)("docked",{elementType:x8,ref:t,className:(0,O.A)(T.root,T.docked,u),ownerState:k,externalForwardedProps:D,additionalProps:A}),[V,H]=(0,cn.A)("transition",{elementType:x5,ownerState:k,externalForwardedProps:D,additionalProps:{in:g,direction:x7[M],timeout:x,appear:C.current}}),$=(0,_.jsx)(N,{...B,children:l});if("permanent"===b)return(0,_.jsx)(z,{...j,children:$});let W=(0,_.jsx)(V,{...H,children:$});return"persistent"===b?(0,_.jsx)(z,{...j,children:W}):(0,_.jsx)(E,{...P,children:W})}),bt=({anchor:e="right",isOpen:t,onClose:n,PaperProps:r,children:i,...o})=>{let a=xK("(max-width:1080px)");return(0,_.jsx)(be,{...o,open:t,onClose:n,anchor:e,PaperProps:{...r,sx:iw({width:a?"100%":"1080px",overflow:"hidden"},r?.sx)},"aria-hidden":!t,children:i})};var bn=n(4884),br=n(30730),bi={average:function(e){for(var t=0,n=0,r=0;r<e.length;r++)!isNaN(e[r])&&(t+=e[r],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,r=0;r<e.length;r++){var i=e[r],o=Math.abs(i);o>t&&(t=o,n=i)}return isFinite(n)?n:NaN},nearest:function(e){return e[0]}},bo=function(e){return Math.round(e.length/2)};function ba(e){return{seriesType:e,reset:function(e,t,n){var r=e.getData(),i=e.get("sampling"),o=e.coordinateSystem,a=r.count();if(a>10&&"cartesian2d"===o.type&&i){var s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),c=n.getDevicePixelRatio(),d=Math.round(a/(Math.abs(u[1]-u[0])*(c||1)));if(isFinite(d)&&d>1){"lttb"===i&&e.setData(r.lttbDownSample(r.mapDimension(l.dim),1/d));var h=void 0;(0,bn.Kg)(i)?h=bi[i]:(0,bn.Tn)(i)&&(h=i),h&&e.setData(r.downSample(r.mapDimension(l.dim),1/d,h,bo))}}}}}var bs=n(31831),bl=n(9971),bu=n(43059),bc=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.getInitialData=function(e,t){return(0,bu.A)(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,t,n){var r=this.coordinateSystem;if(r&&r.clampData){var i=r.clampData(e),o=r.dataToPoint(i);if(n)(0,bn.__)(r.getAxes(),function(e,n){if("category"===e.type&&null!=t){var r=e.getTicksCoords(),a=e.getTickModel().get("alignWithLabel"),s=i[n],l="x1"===t[n]||"y1"===t[n];if(l&&!a&&(s+=1),!(r.length<2)){if(2===r.length){o[n]=e.toGlobalCoord(e.getExtent()[+!!l]);return}for(var u=void 0,c=void 0,d=1,h=0;h<r.length;h++){var p=r[h].coord,f=h===r.length-1?r[h-1].tickValue+d:r[h].tickValue;if(f===s){c=p;break}if(f<s)u=p;else if(null!=u&&f>s){c=(p+u)/2;break}1===h&&(d=f-r[0].tickValue)}null==c&&(u?u&&(c=r[r.length-1].coord):c=r[0].coord),o[n]=e.toGlobalCoord(c)}}});else{var a=this.getData(),s=a.getLayout("offset"),l=a.getLayout("size"),u=+!r.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}(bl.A);bl.A.registerClass(bc);var bd=n(3818),bh=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.getInitialData=function(){return(0,bu.A)(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=(0,bd.G_)(bc.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}(bc),bp=n(33317),bf=n(79620),bg=n(45001),bm=n(68532),bv=n(63811),by=n(23917),bx=n(35032),bb=n(72059),bw=n(73394),bS=n(89425),bA=n(55037),bC=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},bM=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return(0,bs.C6)(t,e),t.prototype.getDefaultShape=function(){return new bC},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r0||0,0),o=Math.max(t.r,0),a=(o-i)*.5,s=i+a,l=t.startAngle,u=t.endAngle,c=t.clockwise,d=2*Math.PI,h=c?u-l<d:l-u<d;h||(l=u-(c?d:-d));var p=Math.cos(l),f=Math.sin(l),g=Math.cos(u),m=Math.sin(u);h?(e.moveTo(p*i+n,f*i+r),e.arc(p*s+n,f*s+r,a,-Math.PI+l,l,!c)):e.moveTo(p*o+n,f*o+r),e.arc(n,r,o,l,u,!c),e.arc(g*s+n,m*s+r,a,u-2*Math.PI,u-Math.PI,!c),0!==i&&e.arc(n,r,i,u,l,c)},t}(bp.Ay),bk=n(31440);function bT(e,t){return e.type===t}var b_=n(18538),bI=n(23960);function bD(e,t,n){return t*Math.sin(e)*(n?-1:1)}function bO(e,t,n){return t*Math.cos(e)*(n?1:-1)}function bR(e,t,n){var r=e.get("borderRadius");if(null==r)return n?{cornerRadius:0}:null;(0,bn.cy)(r)||(r=[r,r,r,r]);var i=Math.abs(t.r||0-t.r0||0);return{cornerRadius:(0,bn.Tj)(r,function(e){return(0,bI.lo)(e,i)})}}var bE=Math.max,bP=Math.min,bL=function(e){function t(){var n=e.call(this)||this;return n.type=t.type,n._isFirstFrame=!0,n}return(0,bs.C6)(t,e),t.prototype.render=function(e,t,n,r){this._model=e,this._removeOnRenderedListener(n),this._updateDrawMode(e);var i=e.get("coordinateSystem");("cartesian2d"===i||"polar"===i)&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,r))},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){(0,bg.traverseElements)(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,r){var i,o=this.group,a=e.getData(),s=this._data,l=e.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?i=u.isHorizontal():"polar"===l.type&&(i="angle"===u.dim);var c=e.isAnimationEnabled()?e:null,d=function(e,t){var n=e.get("realtimeSort",!0),r=t.getBaseAxis();if(n&&"category"===r.type&&"cartesian2d"===t.type)return{baseAxis:r,otherAxis:t.getOtherAxis(r)}}(e,l);d&&this._enableRealtimeSort(d,a,n);var h=e.get("clip",!0)||d,p=function(e,t){var n=e.getArea&&e.getArea();if(bT(e,"cartesian2d")){var r=e.getBaseAxis();if("category"!==r.type||!r.onBand){var i=t.getLayout("bandWidth");r.isHorizontal()?(n.x-=i,n.width+=2*i):(n.y-=i,n.height+=2*i)}}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=r&&r.isInitSort,w=r&&"changeAxisOrder"===r.type;function S(e){var t,n,r,o=b$[l.type](a,e),s=(t=l,n=i,r=o,new("polar"===t.type?by.A:bv.A)({shape:bZ(n,r,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),r=b$[l.type](a,t,n);if(g&&S(t),a.hasValue(t)&&bH[l.type](r)){var s=!1;h&&(s=bN[l.type](p,r));var m=bB[l.type](e,a,t,r,i,c,u.model,!1,f);d&&(m.forceLabelAnimation=!0),bG(m,a,t,n,r,e,i,"polar"===l.type),b?m.attr({shape:r}):d?bz(d,c,m,r,t,i,!1,!1):(0,bm.LW)(m,{shape:r},e,t),a.setItemGraphicEl(t,m),o.add(m),m.ignore=s}}).update(function(t,n){var r=a.getItemModel(t),A=b$[l.type](a,t,r);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=b$[l.type](a,t),k=bZ(i,M,l);(0,bm.oi)(C,{shape:k},c,t)}var T=s.getItemGraphicEl(n);if(!a.hasValue(t)||!bH[l.type](A))return void o.remove(T);var _=!1;if(h&&(_=bN[l.type](p,A))&&o.remove(T),T?(0,bm.ap)(T):T=bB[l.type](e,a,t,A,i,c,u.model,!!T,f),d&&(T.forceLabelAnimation=!0),w){var I=T.getTextContent();if(I){var D=(0,bw.Lu)(I);null!=D.prevValue&&(D.prevValue=D.value)}}else bG(T,a,t,r,A,e,i,"polar"===l.type);b?T.attr({shape:A}):d?bz(d,c,T,A,t,i,!0,w):(0,bm.oi)(T,{shape:A},e,t,null),a.setItemGraphicEl(t,T),T.ignore=_,o.add(T)}).remove(function(t){var n=s.getItemGraphicEl(t);n&&(0,bm.t5)(n,e,t)}).execute();var A=this._backgroundGroup||(this._backgroundGroup=new bf.A);A.removeAll();for(var C=0;C<y.length;++C)A.add(y[C]);o.add(A),this._backgroundEls=y,this._data=a},t.prototype._renderLarge=function(e,t,n){this._clear(),bY(e,this.group),this._updateLargeClip(e)},t.prototype._incrementalRenderLarge=function(e,t){this._removeBackground(),bY(t,this.group,this._progressiveEls,!0)},t.prototype._updateLargeClip=function(e){var t=e.get("clip",!0)&&(0,bA.Ip)(e.coordinateSystem,!1,e),n=this.group;t?n.setClipPath(t):n.removeClipPath()},t.prototype._enableRealtimeSort=function(e,t,n){var r=this;if(t.count()){var i=e.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(t,e,n),this._isFirstFrame=!1;else{var o=function(e){var n=t.getItemGraphicEl(e),r=n&&n.shape;return r&&Math.abs(i.isHorizontal()?r.height:r.width)||0};this._onRendered=function(){r._updateSortWithinSameData(t,o,i,n)},n.getZr().on("rendered",this._onRendered)}}},t.prototype._dataSort=function(e,t,n){var r=[];return e.each(e.mapDimension(t.dim),function(e,t){var i=n(t);i=null==i?NaN:i,r.push({dataIndex:t,mappedValue:i,ordinalNumber:e})}),r.sort(function(e,t){return t.mappedValue-e.mappedValue}),{ordinalNumbers:(0,bn.Tj)(r,function(e){return e.ordinalNumber})}},t.prototype._isOrderChangedWithinSameData=function(e,t,n){for(var r=n.scale,i=e.mapDimension(n.dim),o=Number.MAX_VALUE,a=0,s=r.getOrdinalMeta().categories.length;a<s;++a){var l=e.rawIndexOf(i,r.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,r=n.getExtent(),i=Math.max(0,r[0]),o=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=o;++i)if(e.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,r){if(this._isOrderChangedWithinSameData(e,t,n)){var i=this._dataSort(e,n,t);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:i}))}},t.prototype._dispatchInitSort=function(e,t,n){var r=t.baseAxis,i=this._dataSort(e,r,function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)});n.dispatchAction({type:"changeAxisOrder",componentType:r.dim+"Axis",isInitSort:!0,axisId:r.index,sortInfo:i})},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){(0,bm.t5)(t,e,(0,bx.z)(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}(bk.A),bN={cartesian2d:function(e,t){var n=t.width<0?-1:1,r=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,o=e.y+e.height,a=bE(t.x,e.x),s=bP(t.x+t.width,i),l=bE(t.y,e.y),u=bP(t.y+t.height,o),c=s<a,d=u<l;return t.x=c&&a>i?s:a,t.y=d&&l>o?u:l,t.width=c?0:s-a,t.height=d?0:u-l,n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height),c||d},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}var i=bP(t.r,e.r),o=bE(t.r0,e.r0);t.r=i,t.r0=o;var a=i-o<0;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}return a}},bB={cartesian2d:function(e,t,n,r,i,o,a,s,l){var u=new bv.A({shape:(0,bn.X$)({},r),z2:1});return u.__dataIndex=n,u.name="item",o&&(u.shape[i?"height":"width"]=0),u},polar:function(e,t,n,r,i,o,a,s,l){var u,c,d=!i&&l?bM:by.A,h=new d({shape:r,z2:1});if(h.name="item",u=bW(i),c=d===bM,h.calculateTextPosition=function(e,t,n){var r=t.position;if(!r||r instanceof Array)return(0,bI.X4)(e,t,n);var i=u(r),o=null!=t.distance?t.distance:5,a=this.shape,s=a.cx,l=a.cy,d=a.r,h=a.r0,p=(d+h)/2,f=a.startAngle,g=a.endAngle,m=(f+g)/2,v=c?Math.abs(d-h)/2:0,y=Math.cos,x=Math.sin,b=s+d*y(f),w=l+d*x(f),S="left",A="top";switch(i){case"startArc":b=s+(h-o)*y(m),w=l+(h-o)*x(m),S="center",A="top";break;case"insideStartArc":b=s+(h+o)*y(m),w=l+(h+o)*x(m),S="center",A="bottom";break;case"startAngle":b=s+p*y(f)+bD(f,o+v,!1),w=l+p*x(f)+bO(f,o+v,!1),S="right",A="middle";break;case"insideStartAngle":b=s+p*y(f)+bD(f,-o+v,!1),w=l+p*x(f)+bO(f,-o+v,!1),S="left",A="middle";break;case"middle":b=s+p*y(m),w=l+p*x(m),S="center",A="middle";break;case"endArc":b=s+(d+o)*y(m),w=l+(d+o)*x(m),S="center",A="bottom";break;case"insideEndArc":b=s+(d-o)*y(m),w=l+(d-o)*x(m),S="center",A="top";break;case"endAngle":b=s+p*y(g)+bD(g,o+v,!0),w=l+p*x(g)+bO(g,o+v,!0),S="left",A="middle";break;case"insideEndAngle":b=s+p*y(g)+bD(g,-o+v,!0),w=l+p*x(g)+bO(g,-o+v,!0),S="right",A="middle";break;default:return(0,bI.X4)(e,t,n)}return(e=e||{}).x=b,e.y=w,e.align=S,e.verticalAlign=A,e},o){var p=h.shape,f=i?"r":"endAngle",g={};p[f]=i?r.r0:r.startAngle,g[f]=r[f],(s?bm.oi:bm.LW)(h,{shape:g},o)}return h}};function bz(e,t,n,r,i,o,a,s){o?(u={x:r.x,width:r.width},l={y:r.y,height:r.height}):(u={y:r.y,height:r.height},l={x:r.x,width:r.width}),s||(a?bm.oi:bm.LW)(n,{shape:l},t,i,null);var l,u,c=t?e.baseAxis.model:null;(a?bm.oi:bm.LW)(n,{shape:u},c,i)}function bF(e,t){for(var n=0;n<t.length;n++)if(!isFinite(e[t[n]]))return!0;return!1}var bj=["x","y","width","height"],bV=["cx","cy","r","startAngle","endAngle"],bH={cartesian2d:function(e){return!bF(e,bj)},polar:function(e){return!bF(e,bV)}},b$={cartesian2d:function(e,t,n){var r,i,o,a=e.getItemLayout(t),s=n?(r=n,i=a,(o=r.get(["itemStyle","borderColor"]))&&"none"!==o?Math.min(r.get(["itemStyle","borderWidth"])||0,isNaN(i.width)?Number.MAX_VALUE:Math.abs(i.width),isNaN(i.height)?Number.MAX_VALUE:Math.abs(i.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 r=e.getItemLayout(t);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function bW(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 bG(e,t,n,r,i,o,a,s){var l=t.getItemVisual(n,"style");if(s){if(!o.get("roundCap")){var u=e.shape,c=bR(r.getModel("itemStyle"),u,!0);(0,bn.X$)(u,c),e.setShape(u)}}else{var d=r.get(["itemStyle","borderRadius"])||0;e.setShape("r",d)}e.useStyle(l);var h=r.getShallow("cursor");h&&e.attr("cursor",h);var p=s?a?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":a?i.height>=0?"bottom":"top":i.width>=0?"right":"left",f=(0,bw.lx)(r);(0,bw.qM)(e,f,{labelFetcher:o,labelDataIndex:n,defaultText:(0,b_.i)(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var g=e.getTextContent();if(s&&g){var m=r.get(["label","position"]);e.textConfig.inside="middle"===m||null,function(e,t,n,r){if((0,bn.Et)(r))return e.setTextConfig({rotation:r});if((0,bn.cy)(t))return e.setTextConfig({rotation:0});var i,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":i=(a+s)/2;break;case"startAngle":case"insideStartAngle":i=a;break;case"endAngle":case"insideEndAngle":i=s;break;default:e.setTextConfig({rotation:0});return}var u=1.5*Math.PI-i;"middle"===l&&u>Math.PI/2&&u<1.5*Math.PI&&(u-=Math.PI),e.setTextConfig({rotation:u})}(e,"outside"===m?p:m,bW(a),r.get(["label","rotate"]))}(0,bw.Oh)(g,f,o.getRawValue(n),function(e){return(0,b_.T)(t,e)});var v=r.getModel(["emphasis"]);(0,bb.Lm)(e,v.get("focus"),v.get("blurScope"),v.get("disabled")),(0,bb.Mx)(e,r),null!=i.startAngle&&null!=i.endAngle&&i.startAngle===i.endAngle&&(e.style.fill="none",e.style.stroke="none",(0,bn.__)(e.states,function(e){e.style&&(e.style.fill=e.style.stroke="none")}))}var bU=function(){},bq=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return(0,bs.C6)(t,e),t.prototype.getDefaultShape=function(){return new bU},t.prototype.buildPath=function(e,t){for(var n=t.points,r=this.baseDimIdx,i=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l<n.length;l+=3)a[r]=s,a[i]=n[l+2],o[r]=n[l+r],o[i]=n[l+i],e.rect(o[0],o[1],a[0],a[1])},t}(bp.Ay);function bY(e,t,n,r){var i=e.getData(),o=+!!i.getLayout("valueAxisHorizontal"),a=i.getLayout("largeDataIndices"),s=i.getLayout("size"),l=e.getModel("backgroundStyle"),u=i.getLayout("largeBackgroundPoints");if(u){var c=new bq({shape:{points:u},incremental:!!r,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 d=new bq({shape:{points:i.getLayout("largePoints")},incremental:!!r,ignoreCoarsePointer:!0,z2:1});d.baseDimIdx=o,d.largeDataIndices=a,d.barWidth=s,t.add(d),d.useStyle(i.getVisual("style")),(0,bx.z)(d).seriesIndex=e.seriesIndex,e.get("silent")||(d.on("mousedown",bX),d.on("mousemove",bX)),n&&n.push(d)}var bX=(0,bS.nF)(function(e){var t=function(e,t,n){for(var r=e.baseDimIdx,i=1-r,o=e.shape.points,a=e.largeDataIndices,s=[],l=[],u=e.barWidth,c=0,d=o.length/3;c<d;c++){var h=3*c;if(l[r]=u,l[i]=o[h+2],s[r]=o[h+r],s[i]=o[h+i],l[i]<0&&(s[i]+=l[i],l[i]=-l[i]),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);(0,bx.z)(this).dataIndex=t>=0?t:null},30,!1);function bZ(e,t,n){if(bT(n,"cartesian2d")){var r=n.getArea();return{x:e?t.x:r.x,y:e?r.y:t.y,width:e?t.width:r.width,height:e?r.height:t.height}}var r=n.getArea();return{cx:r.cx,cy:r.cy,r0:e?r.r0:t.r0,r:e?r.r:t.r,startAngle:e?t.startAngle:0,endAngle:e?t.endAngle:2*Math.PI}}var bK=n(60253),bQ=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return(0,bs.C6)(t,e),t.prototype.getInitialData=function(e){return(0,bu.A)(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new bf.A,n=(0,bK.v5)("line",0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);t.add(n),n.setStyle(e.lineStyle);var r=this.getData().getVisual("symbol"),i=this.getData().getVisual("symbolRotate"),o="none"===r?"circle":r,a=.8*e.itemHeight,s=(0,bK.v5)(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?i: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}(bl.A),bJ=n(64586),b0=function(e){function t(t,n,r,i){var o=e.call(this)||this;return o.updateData(t,n,r,i),o}return(0,bs.C6)(t,e),t.prototype._createSymbol=function(e,t,n,r,i){this.removeAll();var o=(0,bK.v5)(e,-1,-1,2,2,null,i);o.attr({z2:100,culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),o.drift=b1,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(){(0,bb.HY)(this.childAt(0))},t.prototype.downplay=function(){(0,bb.SD)(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,r,i){this.silent=!1;var o=e.getItemVisual(n,"symbol")||"circle",a=e.hostModel,s=t.getSymbolSize(e,n),l=o!==this._symbolType,u=i&&i.disableAnimation;if(l){var c=e.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,e,n,s,c)}else{var d=this.childAt(0);d.silent=!1;var h={scaleX:s[0]/2,scaleY:s[1]/2};u?d.attr(h):bm.oi(d,h,a,n),(0,bm.ap)(d)}if(this._updateCommon(e,n,s,r,i),l){var d=this.childAt(0);if(!u){var h={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,bm.LW(d,h,a,n)}}u&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(e,t,n,r,i){var o,a,s,l,u,c,d,h,p,f=this.childAt(0),g=e.hostModel;if(r&&(o=r.emphasisItemStyle,a=r.blurItemStyle,s=r.selectItemStyle,l=r.focus,u=r.blurScope,d=r.labelStatesModels,h=r.hoverScale,p=r.cursorStyle,c=r.emphasisDisabled),!r||e.hasItemOption){var m=r&&r.itemModel?r.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"),d=(0,bw.lx)(m),h=v.getShallow("scale"),p=m.getShallow("cursor")}var y=e.getItemVisual(t,"symbolRotate");f.attr("rotation",(y||0)*Math.PI/180||0);var x=(0,bK.hV)(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 bJ.Ay){var S=f.style;f.useStyle((0,bn.X$)({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},b))}else f.__isEmptyBrush?f.useStyle((0,bn.X$)({},b)):f.useStyle(b),f.style.decal=null,f.setColor(w,i&&i.symbolInnerColor),f.style.strokeNoScale=!0;var A=e.getItemVisual(t,"liftZ"),C=this._z2;null!=A?null==C&&(this._z2=f.z2,f.z2+=A):null!=C&&(f.z2=C,this._z2=null);var M=i&&i.useNameLabel;(0,bw.qM)(f,d,{labelFetcher:g,labelDataIndex:t,defaultText:function(t){return M?e.getName(t):(0,b_.i)(e,t)},inheritColor:w,defaultOpacity:b.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var k=f.ensureState("emphasis");k.style=o,f.ensureState("select").style=s,f.ensureState("blur").style=a;var T=null==h||!0===h?Math.max(1.1,3/this._sizeY):isFinite(h)&&h>0?+h:1;k.scaleX=this._sizeX*T,k.scaleY=this._sizeY*T,this.setSymbolScale(1),(0,bb.Lm)(this,l,u,c)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var r=this.childAt(0),i=(0,bx.z)(this).dataIndex,o=n&&n.animation;if(this.silent=r.silent=!0,n&&n.fadeLabel){var a=r.getTextContent();a&&bm.Nz(a,{style:{opacity:0}},t,{dataIndex:i,removeOpt:o,cb:function(){r.removeTextContent()}})}else r.removeTextContent();bm.Nz(r,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:i,cb:e,removeOpt:o})},t.getSymbolSize=function(e,t){return(0,bK.xU)(e.getItemVisual(t,"symbolSize"))},t}(bf.A);function b1(e,t){this.parent.drift(e,t)}function b2(e,t,n,r){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(r.isIgnore&&r.isIgnore(n))&&!(r.clipShape&&!r.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(n,"symbol")}function b5(e){return null==e||(0,bn.Gv)(e)||(e={isIgnore:e}),e||{}}function b4(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:(0,bw.lx)(t),cursorStyle:t.get("cursor")}}var b3=function(){function e(e){this.group=new bf.A,this._SymbolCtor=e||b0}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=b5(t);var n=this.group,r=e.hostModel,i=this._data,o=this._SymbolCtor,a=t.disableAnimation,s=b4(e),l={disableAnimation:a},u=t.getSymbolPoint||function(t){return e.getItemLayout(t)};i||n.removeAll(),e.diff(i).add(function(r){var i=u(r);if(b2(e,i,r,t)){var a=new o(e,r,s,l);a.setPosition(i),e.setItemGraphicEl(r,a),n.add(a)}}).update(function(c,d){var h=i.getItemGraphicEl(d),p=u(c);if(!b2(e,p,c,t))return void n.remove(h);var f=e.getItemVisual(c,"symbol")||"circle",g=h&&h.getSymbolType&&h.getSymbolType();if(!h||g&&g!==f)n.remove(h),(h=new o(e,c,s,l)).setPosition(p);else{h.updateData(e,c,s,l);var m={x:p[0],y:p[1]};a?h.attr(m):bm.oi(h,m,r)}n.add(h),e.setItemGraphicEl(c,h)}).remove(function(e){var t=i.getItemGraphicEl(e);t&&t.fadeOut(function(){n.remove(t)},r)}).execute(),this._getSymbolPoint=u,this._data=e},e.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(t,n){var r=e._getSymbolPoint(n);t.setPosition(r),t.markRedraw()})},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=b4(e),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){function r(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=b5(n);for(var i=e.start;i<e.end;i++){var o=t.getItemLayout(i);if(b2(t,o,i,n)){var a=new this._SymbolCtor(t,i,this._seriesScope);a.traverse(r),a.setPosition(o),this.group.add(a),t.setItemGraphicEl(i,a),this._progressiveEls.push(a)}}},e.prototype.eachRendered=function(e){bg.traverseElements(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}(),b6=n(41402);function b8(e,t,n){var r,i,o,a,s=e.getBaseAxis(),l=e.getOtherAxis(s),u=(r=l,i=n,o=0,a=r.scale.getExtent(),"start"===i?o=a[0]:"end"===i?o=a[1]:(0,bn.Et)(i)&&!isNaN(i)?o=i:a[0]>0?o=a[0]:a[1]<0&&(o=a[1]),o),c=s.dim,d=l.dim,h=t.mapDimension(d),p=t.mapDimension(c),f=+("x"===d||"radius"===d),g=(0,bn.Tj)(e.dimensions,function(e){return t.mapDimension(e)}),m=!1,v=t.getCalculationInfo("stackResultDimension");return(0,b6.sJ)(t,g[0])&&(m=!0,g[0]=v),(0,b6.sJ)(t,g[1])&&(m=!0,g[1]=v),{dataDimsForPoint:g,valueStart:u,valueAxisDim:d,baseAxisDim:c,stacked:!!m,valueDim:h,baseDim:p,baseDataOffset:f,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}}function b9(e,t,n,r){var i=NaN;e.stacked&&(i=n.get(n.getCalculationInfo("stackedOverDimension"),r)),isNaN(i)&&(i=e.valueStart);var o=e.baseDataOffset,a=[];return a[o]=n.get(e.baseDim,r),a[1-o]=i,t.dataToPoint(a)}var b7=n(30095),we=n(87142),wt=n(51484),wn=n(84124),wr=n(77324),wi=n(26989),wo=Math.min,wa=Math.max;function ws(e,t){return isNaN(e)||isNaN(t)}function wl(e,t,n,r,i,o,a,s,l){for(var u,c,d,h,p,f,g=n,m=0;m<r;m++){var v=t[2*g],y=t[2*g+1];if(g>=i||g<0)break;if(ws(v,y)){if(l){g+=o;continue}break}if(g===n)e[o>0?"moveTo":"lineTo"](v,y),d=v,h=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],A=t[2*w+1];S===v&&A===y&&m<r;)m++,w+=o,g+=o,S=t[2*w],A=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(;ws(S,A)&&C<r;)C++,w+=o,S=t[2*w],A=t[2*w+1];var M=.5,k=0,T=0,_=void 0,I=void 0;if(C>=r||ws(S,A))p=v,f=y;else{k=S-u,T=A-c;var D=v-u,O=S-v,R=y-c,E=A-y,P=void 0,L=void 0;if("x"===s){P=Math.abs(D),L=Math.abs(O);var N=k>0?1:-1;p=v-N*P*a,f=y,_=v+N*L*a,I=y}else if("y"===s){P=Math.abs(R),L=Math.abs(E);var B=T>0?1:-1;p=v,f=y-B*P*a,_=v,I=y+B*L*a}else P=Math.sqrt(D*D+R*R),p=v-k*a*(1-(M=(L=Math.sqrt(O*O+E*E))/(L+P))),f=y-T*a*(1-M),_=v+k*a*M,I=y+T*a*M,_=wo(_,wa(S,v)),I=wo(I,wa(A,y)),_=wa(_,wo(S,v)),I=wa(I,wo(A,y)),k=_-v,T=I-y,p=v-k*P/L,f=y-T*P/L,p=wo(p,wa(u,v)),f=wo(f,wa(c,y)),p=wa(p,wo(u,v)),f=wa(f,wo(c,y)),k=v-p,T=y-f,_=v+k*L/P,I=y+T*L/P}e.bezierCurveTo(d,h,p,f,v,y),d=_,h=I}else e.lineTo(v,y)}u=v,c=y,g+=o}return m}var wu=function(){this.smooth=0,this.smoothConstraint=!0},wc=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polyline",n}return(0,bs.C6)(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new wu},t.prototype.buildPath=function(e,t){var n=t.points,r=0,i=n.length/2;if(t.connectNulls){for(;i>0&&ws(n[2*i-2],n[2*i-1]);i--);for(;r<i&&ws(n[2*r],n[2*r+1]);r++);}for(;r<i;)r+=wl(e,n,r,i,i,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,r,i=this.path.data,o=wr.A.CMD,a="x"===t,s=[],l=0;l<i.length;){var u=i[l++],c=void 0,d=void 0,h=void 0,p=void 0,f=void 0,g=void 0,m=void 0;switch(u){case o.M:n=i[l++],r=i[l++];break;case o.L:if(c=i[l++],d=i[l++],(m=a?(e-n)/(c-n):(e-r)/(d-r))<=1&&m>=0){var v=a?(d-r)*m+r:(c-n)*m+n;return a?[e,v]:[v,e]}n=c,r=d;break;case o.C:c=i[l++],d=i[l++],h=i[l++],p=i[l++],f=i[l++],g=i[l++];var y=a?(0,wi._E)(n,c,h,f,e,s):(0,wi._E)(r,d,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?(0,wi.Yb)(r,d,p,g,b):(0,wi.Yb)(n,c,h,f,b);return a?[e,v]:[v,e]}}n=f,r=g}}},t}(bp.Ay),wd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,bs.C6)(t,e),t}(wu),wh=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polygon",n}return(0,bs.C6)(t,e),t.prototype.getDefaultShape=function(){return new wd},t.prototype.buildPath=function(e,t){var n=t.points,r=t.stackedOnPoints,i=0,o=n.length/2,a=t.smoothMonotone;if(t.connectNulls){for(;o>0&&ws(n[2*o-2],n[2*o-1]);o--);for(;i<o&&ws(n[2*i],n[2*i+1]);i++);}for(;i<o;){var s=wl(e,n,i,o,o,1,t.smooth,a,t.connectNulls);wl(e,r,i+s-1,s,o,-1,t.stackedOnSmooth,a,t.connectNulls),i+=s+1,e.closePath()}},t}(bp.Ay),wp=n(3306),wf=n(34196);function wg(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return;return!0}}function wm(e){for(var t=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<e.length;){var a=e[o++],s=e[o++];isNaN(a)||(t=Math.min(a,t),r=Math.max(a,r)),isNaN(s)||(n=Math.min(s,n),i=Math.max(s,i))}return[[t,n],[r,i]]}function wv(e,t){var n=wm(e),r=n[0],i=n[1],o=wm(t),a=o[0],s=o[1];return Math.max(Math.abs(r[0]-a[0]),Math.abs(r[1]-a[1]),Math.abs(i[0]-s[0]),Math.abs(i[1]-s[1]))}function wy(e){return bn.Et(e)?e:.5*!!e}function wx(e,t,n,r){var i=t.getBaseAxis(),o=+("x"!==i.dim&&"radius"!==i.dim),a=[],s=0,l=[],u=[],c=[],d=[];if(r){for(s=0;s<e.length;s+=2)isNaN(e[s])||isNaN(e[s+1])||d.push(e[s],e[s+1]);e=d}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 h=(u[o]+c[o])/2,p=[];l[o]=p[o]=h,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 wb(e,t){return[e[2*t],e[2*t+1]]}function ww(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t<bb.BV.length;t++)if(e.get([bb.BV[t],"endLabel","show"]))return!0;return!1}function wS(e,t,n,r){if(!bT(t,"cartesian2d"))return(0,bA.Mi)(t,n,r);var i=r.getModel("endLabel"),o=i.get("valueAnimation"),a=r.getData(),s={lastFrameIndex:0},l=ww(r)?function(n,r){e._endLabelOnDuring(n,r,a,s,o,i,t)}:null,u=t.getBaseAxis().isHorizontal(),c=(0,bA.SM)(t,n,r,function(){var t=e._endLabel;t&&n&&null!=s.originalX&&t.attr({x:s.originalX,y:s.originalY})},l);if(!r.get("clip",!0)){var d=c.shape,h=Math.max(d.width,d.height);u?(d.y-=h,d.height+=2*h):(d.x-=h,d.width+=2*h)}return l&&l(1,c),c}var wA=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,bs.C6)(t,e),t.prototype.init=function(){var e=new bf.A,t=new b3;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},t.prototype.render=function(e,t,n){var r,i=this,o=e.coordinateSystem,a=this.group,s=e.getData(),l=e.getModel("lineStyle"),u=e.getModel("areaStyle"),c=s.getLayout("points")||[],d="polar"===o.type,h=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=b8(o,s,x),w=y&&function(e,t,n){if(!n.valueDim)return[];for(var r=t.count(),i=(0,b7.J)(2*r),o=0;o<r;o++){var a=b9(n,e,t,o);i[2*o]=a[0],i[2*o+1]=a[1]}return i}(o,s,b),S=e.get("showSymbol"),A=e.get("connectNulls"),C=S&&!d&&function(e,t,n){var r=e.get("showAllSymbol"),i="auto"===r;if(!r||i){var o=n.getAxesByScale("ordinal")[0];if(o&&!(i&&function(e,t){var n=e.getExtent(),r=Math.abs(n[1]-n[0])/e.scale.count();isNaN(r)&&(r=0);for(var i=t.count(),o=Math.max(1,Math.round(i/5)),a=0;a<i;a+=o)if(1.5*b0.getSymbolSize(t,a)[+!!e.isHorizontal()]>r)return!1;return!0}(o,t))){var a=t.mapDimension(o.dim),s={};return bn.__(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 k=!d&&e.get("step");o&&o.getArea&&e.get("clip",!0)&&(null!=(r=o.getArea()).width?(r.x-=.1,r.y-=.1,r.width+=.2,r.height+=.2):r.r0&&(r.r0-=.5,r.r+=.5)),this._clipShapeForSymbol=r;var T=function(e,t,n){var r,i,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"===(r=s&&s.coordDim)||"y"===r){i=o[a];break}}if(!i)return;var l=t.getAxis(r),u=bn.Tj(i.stops,function(e){return{coord:l.toGlobalCoord(l.dataToCoord(e.value)),color:e.color}}),c=u.length,d=i.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),d.reverse());var h=function(e,t){var n,r,i=[],o=e.length;function a(e,t,n){var r=e.coord,i=(n-r)/(t.coord-r);return{coord:n,color:(0,wf.Cc)(i,[e.color,t.color])}}for(var s=0;s<o;s++){var l=e[s],u=l.coord;if(u<0)n=l;else if(u>t){r?i.push(a(r,l,t)):n&&i.push(a(n,l,0),a(n,l,t));break}else n&&(i.push(a(n,l,0)),n=null),i.push(l),r=l}return i}(u,"x"===r?n.getWidth():n.getHeight()),p=h.length;if(!p&&c)return u[0].coord<0?d[1]?d[1]:u[c-1].color:d[0]?d[0]:u[0].color;var f=h[0].coord-10,g=h[p-1].coord+10,m=g-f;if(m<.001)return"transparent";bn.__(h,function(e){e.offset=(e.coord-f)/m}),h.push({offset:p?h[p-1].offset:.5,color:d[1]||"transparent"}),h.unshift({offset:p?h[0].offset:.5,color:d[0]||"transparent"});var v=new we.A(0,0,0,0,h,!0);return v[r]=f,v[r+"2"]=g,v}}(s,o,n)||s.getVisual("style")[s.getVisual("drawType")];if(f&&h.type===o.type&&k===this._step){y&&!g?g=this._newPolygon(c,w):g&&!y&&(m.remove(g),g=this._polygon=null),d||this._initOrUpdateEndLabel(e,o,(0,wp.he)(T));var _=m.getClipPath();if(_){var I=wS(this,o,!1,e);bm.LW(_,{shape:I.shape},e)}else m.setClipPath(wS(this,o,!0,e));S&&p.updateData(s,{isIgnore:C,clipShape:r,disableAnimation:!0,getSymbolPoint:function(e){return[c[2*e],c[2*e+1]]}}),wg(this._stackedOnPoints,w)&&wg(this._points,c)||(v?this._doUpdateAnimation(s,w,o,n,k,x,A):(k&&(c=wx(c,o,k,A),w&&(w=wx(w,o,k,A))),f.setShape({points:c}),g&&g.setShape({points:c,stackedOnPoints:w})))}else S&&p.updateData(s,{isIgnore:C,clipShape:r,disableAnimation:!0,getSymbolPoint:function(e){return[c[2*e],c[2*e+1]]}}),v&&this._initSymbolLabelAnimation(s,o,r),k&&(c=wx(c,o,k,A),w&&(w=wx(w,o,k,A))),f=this._newPolyline(c),y?g=this._newPolygon(c,w):g&&(m.remove(g),g=this._polygon=null),d||this._initOrUpdateEndLabel(e,o,(0,wp.he)(T)),m.setClipPath(wS(this,o,!0,e));var D=e.getModel("emphasis"),O=D.get("focus"),R=D.get("blurScope"),E=D.get("disabled");f.useStyle(bn.NT(l.getLineStyle(),{fill:"none",stroke:T,lineJoin:"bevel"})),(0,bb.Mx)(f,e,"lineStyle"),f.style.lineWidth>0&&"bolder"===e.get(["emphasis","lineStyle","width"])&&(f.getState("emphasis").style.lineWidth=+f.style.lineWidth+1),(0,bx.z)(f).seriesIndex=e.seriesIndex,(0,bb.Lm)(f,O,R,E);var P=wy(e.get("smooth")),L=e.get("smoothMonotone");if(f.setShape({smooth:P,smoothMonotone:L,connectNulls:A}),g){var N=s.getCalculationInfo("stackedOnSeries"),B=0;g.useStyle(bn.NT(u.getAreaStyle(),{fill:T,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),N&&(B=wy(N.get("smooth"))),g.setShape({smooth:P,stackedOnSmooth:B,smoothMonotone:L,connectNulls:A}),(0,bb.Mx)(g,e,"areaStyle"),(0,bx.z)(g).seriesIndex=e.seriesIndex,(0,bb.Lm)(g,O,R,E)}var z=function(e){i._changePolyState(e)};s.eachItemGraphicEl(function(e){e&&(e.onHoverStateChange=z)}),this._polyline.onHoverStateChange=z,this._data=s,this._coordSys=o,this._stackedOnPoints=w,this._points=c,this._step=k,this._valueOrigin=x,e.get("triggerLineEvent")&&(this.packEventData(e,f),g&&this.packEventData(e,g))},t.prototype.packEventData=function(e,t){(0,bx.z)(t).eventData={componentType:"series",componentSubType:"line",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"line"}},t.prototype.highlight=function(e,t,n,r){var i=e.getData(),o=wn.le(i,r);if(this._changePolyState("emphasis"),o instanceof Array||null==o||!(o>=0))bk.A.prototype.highlight.call(this,e,t,n,r);else{var a=i.getLayout("points"),s=i.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,d=e.get("z")||0;(s=new b0(i,o)).x=l,s.y=u,s.setZ(c,d);var h=s.getSymbolPath().getTextContent();h&&(h.zlevel=c,h.z=d,h.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}},t.prototype.downplay=function(e,t,n,r){var i=e.getData(),o=wn.le(i,r);if(this._changePolyState("normal"),null!=o&&o>=0){var a=i.getItemGraphicEl(o);a&&(a.__temp?(i.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else bk.A.prototype.downplay.call(this,e,t,n,r)},t.prototype._changePolyState=function(e){var t=this._polygon;(0,bb.Pk)(this._polyline,e),t&&(0,bb.Pk)(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new wc({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 wh({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var r,i,o=t.getBaseAxis(),a=o.inverse;"cartesian2d"===t.type?(r=o.isHorizontal(),i=!1):"polar"===t.type&&(r="angle"===o.dim,i=!0);var s=e.hostModel,l=s.get("animationDuration");bn.Tn(l)&&(l=l(null));var u=s.get("animationDelay")||0,c=bn.Tn(u)?u(null):u;e.eachItemGraphicEl(function(e,o){if(e){var s=[e.x,e.y],d=void 0,h=void 0,p=void 0;if(n)if(i){var f=t.pointToCoord(s);r?(d=n.startAngle,h=n.endAngle,p=-f[1]/180*Math.PI):(d=n.r0,h=n.r,p=f[0])}else r?(d=n.x,h=n.x+n.width,p=e.x):(d=n.y+n.height,h=n.y,p=e.y);var g=h===d?0:(p-d)/(h-d);a&&(g=1-g);var m=bn.Tn(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 r=e.getModel("endLabel");if(ww(e)){var i,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 wt.Ay({z2:200})).ignoreClip=!0,l.setTextContent(this._endLabel),l.disableLabelAnimation=!0);var d=function(e){for(var t,n,r=e.length/2;r>0&&(t=e[2*r-2],n=e[2*r-1],isNaN(t)||isNaN(n));r--);return r-1}(u);d>=0&&((0,bw.qM)(l,(0,bw.lx)(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:d,defaultText:function(e,t,n){return null!=n?(0,b_.T)(s,n):(0,b_.i)(s,e)},enableTextSetter:!0},(o=(i=t.getBaseAxis()).isHorizontal(),a=i.inverse,{normal:{align:r.get("align")||(o?a?"right":"left":"center"),verticalAlign:r.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,r,i,o,a){var s=this._endLabel,l=this._polyline;if(s){e<1&&null==r.originalX&&(r.originalX=s.x,r.originalY=s.y);var u=n.getLayout("points"),c=n.hostModel,d=c.get("connectNulls"),h=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 r,i,o=e.length/2,a=+("x"!==n),s=0,l=-1,u=0;u<o;u++)if(!(isNaN(i=e[2*u+a])||isNaN(e[2*u+1-a]))){if(0===u){r=i;continue}if(r<=t&&i>=t||r>=t&&i<=t){l=u;break}s=u,r=i}return{range:[s,l],t:(t-r)/(i-r)}}(u,y,w),A=S.range,C=A[1]-A[0],M=void 0;if(C>=1){if(C>1&&!d){var k=wb(u,A[0]);s.attr({x:k[0]+x,y:k[1]+b}),i&&(M=c.getRawValue(A[0]))}else{var k=l.getPointOn(y,w);k&&s.attr({x:k[0]+x,y:k[1]+b});var T=c.getRawValue(A[0]),_=c.getRawValue(A[1]);i&&(M=wn.Il(n,h,T,_,S.t))}r.lastFrameIndex=A[0]}else{var I=1===e||r.lastFrameIndex>0?A[0]:0,k=wb(u,I);i&&(M=c.getRawValue(I)),s.attr({x:k[0]+x,y:k[1]+b})}if(i){var D=(0,bw.Lu)(s);"function"==typeof D.setLabelText&&D.setLabelText(M)}}},t.prototype._doUpdateAnimation=function(e,t,n,r,i,o,a){var s=this._polyline,l=this._polygon,u=e.hostModel,c=function(e,t,n,r,i,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=[],d=[],h=[],p=[],f=[],g=b8(i,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 A=m[w],C=m[w+1],M=v[S],k=v[S+1];(isNaN(A)||isNaN(C))&&(A=M,C=k),l.push(A,C),u.push(M,k),c.push(n[w],n[w+1]),d.push(r[S],r[S+1]),f.push(t.getRawIndex(x.idx1));break;case"+":var T=x.idx,_=g.dataDimsForPoint,I=i.dataToPoint([t.get(_[0],T),t.get(_[1],T)]);S=2*T,l.push(I[0],I[1]),u.push(v[S],v[S+1]);var D=b9(g,i,t,T);c.push(D[0],D[1]),d.push(r[S],r[S+1]),f.push(t.getRawIndex(T));break;case"-":b=!1}b&&(h.push(x),p.push(p.length))}p.sort(function(e,t){return f[e]-f[t]});for(var O=l.length,R=(0,b7.J)(O),E=(0,b7.J)(O),P=(0,b7.J)(O),L=(0,b7.J)(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],E[z]=u[F],E[z+1]=u[F+1],P[z]=c[F],P[z+1]=c[F+1],L[z]=d[F],L[z+1]=d[F+1],N[y]=h[B]}return{current:R,next:E,stackedOnCurrent:P,stackedOnNext:L,status:N}}(this._data,e,this._stackedOnPoints,t,this._coordSys,this._valueOrigin),d=c.current,h=c.stackedOnCurrent,p=c.next,f=c.stackedOnNext;if(i&&(d=wx(c.current,n,i,a),h=wx(c.stackedOnCurrent,n,i,a),p=wx(c.next,n,i,a),f=wx(c.stackedOnNext,n,i,a)),wv(d,p)>3e3||l&&wv(h,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=d;var g={shape:{points:p}};c.current!==d&&(g.shape.__points=c.next),s.stopAnimation(),bm.oi(s,g,u),l&&(l.setShape({points:d,stackedOnPoints:h}),l.stopAnimation(),bm.oi(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,r=2*m[t].ptIdx;n.x=e[r],n.y=e[r+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,r){e.__temp&&(t.remove(e),n.setItemGraphicEl(r,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},t.type="line",t}(bk.A),wC=n(65132);function wM(e,t){return{seriesType:e,plan:(0,wC.A)(),reset:function(e){var n=e.getData(),r=e.coordinateSystem,i=e.pipelineContext,o=t||i.large;if(r){var a=(0,bn.Tj)(r.dimensions,function(e){return n.mapDimension(e)}).slice(0,2),s=a.length,l=n.getCalculationInfo("stackResultDimension");(0,b6.sJ)(n,a[0])&&(a[0]=l),(0,b6.sJ)(n,a[1])&&(a[1]=l);var u=n.getStore(),c=n.getDimensionIndex(a[0]),d=n.getDimensionIndex(a[1]);return s&&{progress:function(e,t){for(var n=e.end-e.start,i=o&&(0,b7.J)(n*s),a=[],l=[],h=e.start,p=0;h<e.end;h++){var f=void 0;if(1===s){var g=u.get(c,h);f=r.dataToPoint(g,null,l)}else a[0]=u.get(c,h),a[1]=u.get(d,h),f=r.dataToPoint(a,null,l);o?(i[p++]=f[0],i[p++]=f[1]):t.setItemLayout(h,f.slice())}o&&t.setLayout("points",i)}}}}}}var wk=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},wT=function(e){function t(t){var n=e.call(this,t)||this;return n.type="pointer",n}return(0,bs.C6)(t,e),t.prototype.getDefaultShape=function(){return new wk},t.prototype.buildPath=function(e,t){var n=Math.cos,r=Math.sin,i=t.r,o=t.width,a=t.angle,s=t.x-n(a)*o*(o>=i/3?1:2),l=t.y-r(a)*o*(o>=i/3?1:2);a=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+n(a)*o,t.y+r(a)*o),e.lineTo(t.x+n(t.angle)*i,t.y+r(t.angle)*i),e.lineTo(t.x-n(a)*o,t.y-r(a)*o),e.lineTo(s,l)},t}(bp.Ay),w_=n(28887),wI=n(21916);function wD(e,t){var n=null==e?"":e+"";return t&&((0,bn.Kg)(t)?n=t.replace("{value}",n):(0,bn.Tn)(t)&&(n=t(e))),n}var wO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.render=function(e,t,n){this.group.removeAll();var r,i,o=e.get(["axisLine","lineStyle","color"]),a=(r=e.get("center"),i=Math.min(n.getWidth(),n.getHeight()),{cx:(0,wI.lo)(r[0],n.getWidth()),cy:(0,wI.lo)(r[1],n.getHeight()),r:(0,wI.lo)(e.get("radius"),i/2)});this._renderMain(e,t,n,o,a),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,r,i){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")?bM:by.A,d=u.get("show"),h=u.getModel("lineStyle"),p=h.get("width"),f=[s,l];(0,wr.q)(f,!a),s=f[0];for(var g=(l=f[1])-s,m=s,v=[],y=0;d&&y<r.length;y++){var x=new c({shape:{startAngle:m,endAngle:l=s+g*Math.min(Math.max(r[y][0],0),1),cx:i.cx,cy:i.cy,clockwise:a,r0:i.r-p,r:i.r},silent:!0});x.setStyle({fill:r[y][1]}),x.setStyle(h.getLineStyle(["color","width"])),v.push(x),m=l}v.reverse(),(0,bn.__)(v,function(e){return o.add(e)});var b=function(e){var t;if(e<=0)return r[0][1];for(t=0;t<r.length;t++)if(r[t][0]>=e&&(0===t?0:r[t-1][0])<e)return r[t][1];return r[t-1][1]};this._renderTicks(e,t,n,b,i,s,l,a,p),this._renderTitleAndDetail(e,t,n,b,i),this._renderAnchor(e,i),this._renderPointer(e,t,n,b,i,s,l,a,p)},t.prototype._renderTicks=function(e,t,n,r,i,o,a,s,l){for(var u,c,d=this.group,h=i.cx,p=i.cy,f=i.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=(0,wI.lo)(v.get("length"),f),A=(0,wI.lo)(y.get("length"),f),C=o,M=(a-o)/b,k=M/w,T=v.getModel("lineStyle").getLineStyle(),_=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 w_.A({shape:{x1:u*(f-O)+h,y1:c*(f-O)+p,x2:u*(f-S-O)+h,y2:c*(f-S-O)+p},style:T,silent:!0});"auto"===T.stroke&&R.setStyle({stroke:r(D/b)}),d.add(R)}if(x.get("show")){var O=x.get("distance")+I,E=wD((0,wI.LI)(D/b*(m-g)+g),x.get("formatter")),P=r(D/b),L=u*(f-S-O)+h,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:(0,bn.Et)(B)&&(z=B*Math.PI/180),0===z?d.add(new wt.Ay({style:(0,bw.VB)(x,{text:E,x:L,y:N,verticalAlign:c<-.8?"top":c>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:P}),silent:!0})):d.add(new wt.Ay({style:(0,bw.VB)(x,{text:E,x:L,y:N,verticalAlign:"middle",align:"center"},{inheritColor:P}),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++){u=Math.cos(C),c=Math.sin(C);var j=new w_.A({shape:{x1:u*(f-O)+h,y1:c*(f-O)+p,x2:u*(f-A-O)+h,y2:c*(f-A-O)+p},silent:!0,style:_});"auto"===_.stroke&&j.setStyle({stroke:r((D+F/w)/b)}),d.add(j),C+=k}C-=k}else C+=M}},t.prototype._renderPointer=function(e,t,n,r,i,o,a,s,l){var u=this.group,c=this._data,d=this._progressEls,h=[],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 r,o=m.getItemModel(t).getModel("pointer"),a=(0,wI.lo)(o.get("width"),i.r),s=(0,wI.lo)(o.get("length"),i.r),l=e.get(["pointer","icon"]),u=o.get("offsetCenter"),c=(0,wI.lo)(u[0],i.r),d=(0,wI.lo)(u[1],i.r),h=o.get("keepAspect");return(r=l?(0,bK.v5)(l,c-a/2,d-s,a,s,null,h):new wT({shape:{angle:-Math.PI/2,width:a,r:s,x:c,y:d}})).rotation=-(n+Math.PI/2),r.x=i.cx,r.y=i.cy,r}function A(e,t){var n=f.get("roundCap")?bM:by.A,r=f.get("overlap"),a=r?f.get("width"):l/m.count(),u=r?i.r-a:i.r-(e+1)*a,c=r?i.r:i.r-e*a,d=new n({shape:{startAngle:o,endAngle:t,cx:i.cx,cy:i.cy,clockwise:s,r0:u,r:c}});return r&&(d.z2=x-m.get(v,e)%x),d}(g||p)&&(m.diff(c).add(function(t){var n=m.get(v,t);if(p){var r=S(t,o);bm.LW(r,{rotation:-((isNaN(+n)?w[0]:(0,wI.Cb)(n,b,w,!0))+Math.PI/2)},e),u.add(r),m.setItemGraphicEl(t,r)}if(g){var i=A(t,o),a=f.get("clip");bm.LW(i,{shape:{endAngle:(0,wI.Cb)(n,b,w,a)}},e),u.add(i),(0,bx.a)(e.seriesIndex,m.dataType,t,i),h[t]=i}}).update(function(t,n){var r=m.get(v,t);if(p){var i=c.getItemGraphicEl(n),a=i?i.rotation:o,s=S(t,a);s.rotation=a,bm.oi(s,{rotation:-((isNaN(+r)?w[0]:(0,wI.Cb)(r,b,w,!0))+Math.PI/2)},e),u.add(s),m.setItemGraphicEl(t,s)}if(g){var l=d[n],y=A(t,l?l.shape.endAngle:o),x=f.get("clip");bm.oi(y,{shape:{endAngle:(0,wI.Cb)(r,b,w,x)}},e),u.add(y),(0,bx.a)(e.seriesIndex,m.dataType,t,y),h[t]=y}}).execute(),m.each(function(e){var t=m.getItemModel(e),n=t.getModel("emphasis"),i=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 bJ.Ay){var c=s.style;s.useStyle((0,bn.X$)({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",r((0,wI.Cb)(m.get(v,e),b,[0,1],!0))),s.z2EmphasisLift=0,(0,bb.Mx)(s,t),(0,bb.Lm)(s,i,o,a)}if(g){var d=h[e];d.useStyle(m.getItemVisual(e,"style")),d.setStyle(t.getModel(["progress","itemStyle"]).getItemStyle()),d.z2EmphasisLift=0,(0,bb.Mx)(d,t),(0,bb.Lm)(d,i,o,a)}}),this._progressEls=h)},t.prototype._renderAnchor=function(e,t){var n=e.getModel("anchor");if(n.get("show")){var r=n.get("size"),i=n.get("icon"),o=n.get("offsetCenter"),a=n.get("keepAspect"),s=(0,bK.v5)(i,t.cx-r/2+(0,wI.lo)(o[0],t.r),t.cy-r/2+(0,wI.lo)(o[1],t.r),r,r,null,a);s.z2=+!!n.get("showAbove"),s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,r,i){var o=this,a=e.getData(),s=a.mapDimension("value"),l=+e.get("min"),u=+e.get("max"),c=new bf.A,d=[],h=[],p=e.isAnimationEnabled(),f=e.get(["pointer","showAbove"]);a.diff(this._data).add(function(e){d[e]=new wt.Ay({silent:!0}),h[e]=new wt.Ay({silent:!0})}).update(function(e,t){d[e]=o._titleEls[t],h[e]=o._detailEls[t]}).execute(),a.each(function(t){var n=a.getItemModel(t),o=a.get(s,t),g=new bf.A,m=r((0,wI.Cb)(o,[l,u],[0,1],!0)),v=n.getModel("title");if(v.get("show")){var y=v.get("offsetCenter"),x=i.cx+(0,wI.lo)(y[0],i.r),b=i.cy+(0,wI.lo)(y[1],i.r),w=d[t];w.attr({z2:2*!f,style:(0,bw.VB)(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 A=S.get("offsetCenter"),C=i.cx+(0,wI.lo)(A[0],i.r),M=i.cy+(0,wI.lo)(A[1],i.r),k=(0,wI.lo)(S.get("width"),i.r),T=(0,wI.lo)(S.get("height"),i.r),_=e.get(["progress","show"])?a.getItemVisual(t,"style").fill:m,w=h[t],I=S.get("formatter");w.attr({z2:2*!f,style:(0,bw.VB)(S,{x:C,y:M,text:wD(o,I),width:isNaN(k)?null:k,height:isNaN(T)?null:T,align:"center",verticalAlign:"middle"},{inheritColor:_})}),(0,bw.Oh)(w,{normal:S},o,function(e){return wD(e,I)}),p&&(0,bw.xb)(w,t,a,e,{getFormattedLabel:function(e,t,n,r,i,a){return wD(a?a.interpolatedValue:o,I)}}),g.add(w)}c.add(g)}),this.group.add(c),this._titleEls=d,this._detailEls=h},t.type="gauge",t}(bk.A),wR=n(85337),wE=n(15764);function wP(e,t,n){t=(0,bn.cy)(t)&&{coordDimensions:t}||(0,bn.X$)({encodeDefine:e.getEncode()},t);var r=e.getSource(),i=(0,wR.A)(r,t).dimensions,o=new wE.A(i,e);return o.initData(r,n),o}var wL=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="itemStyle",n}return(0,bs.C6)(t,e),t.prototype.getInitialData=function(e,t){return wP(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}(bl.A),wN=n(1514),wB=n(10675),wz=2*Math.PI,wF=Math.PI/180;function wj(e,t){return wB.dV(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function wV(e,t){var n,r,i=wj(e,t),o=e.get("center"),a=e.get("radius");bn.cy(a)||(a=[0,a]);var s=(0,wI.lo)(i.width,t.getWidth()),l=(0,wI.lo)(i.height,t.getHeight()),u=Math.min(s,l),c=(0,wI.lo)(a[0],u/2),d=(0,wI.lo)(a[1],u/2),h=e.coordinateSystem;if(h){var p=h.dataToPoint(o);n=p[0]||0,r=p[1]||0}else bn.cy(o)||(o=[o,o]),n=(0,wI.lo)(o[0],s)+i.x,r=(0,wI.lo)(o[1],l)+i.y;return{cx:n,cy:r,r0:c,r:d}}function wH(e,t,n){t.eachSeriesByType(e,function(e){var t=e.getData(),r=t.mapDimension("value"),i=wj(e,n),o=wV(e,n),a=o.cx,s=o.cy,l=o.r,u=o.r0,c=-e.get("startAngle")*wF,d=e.get("endAngle"),h=e.get("padAngle")*wF;d="auto"===d?c-wz:-d*wF;var p=e.get("minAngle")*wF+h,f=0;t.each(r,function(e){!isNaN(e)&&f++});var g=t.getSum(r),m=Math.PI/(g||f)*2,v=e.get("clockwise"),y=e.get("roseType"),x=e.get("stillShowZeroSum"),b=t.getDataExtent(r);b[0]=0;var w=v?1:-1,S=[c,d],A=w*h/2;(0,wr.q)(S,!v),c=S[0];var C=Math.abs((d=S[1])-c),M=C,k=0,T=c;if(t.setLayout({viewRect:i,r:l}),t.each(r,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});(r="area"!==y?0===g&&x?m:e*m:C/f)<p?(r=p,M-=p):k+=e;var r,i=T+w*r,o=0,c=0;h>r?c=o=T+w*r/2:(o=T+A,c=i-A),t.setItemLayout(n,{angle:r,startAngle:o,endAngle:c,clockwise:v,cx:a,cy:s,r0:u,r:y?(0,wI.Cb)(e,b,[u,l]):l}),T=i}),M<wz&&f)if(M<=.001){var _=C/f;t.each(r,function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n);r.angle=_;var i=0,o=0;_<h?o=i=c+w*(n+.5)*_:(i=c+w*n*_+A,o=c+w*(n+1)*_-A),r.startAngle=i,r.endAngle=o}})}else m=M/k,T=c,t.each(r,function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n),i=r.angle===p?p:e*m,o=0,a=0;i<h?a=o=T+w*i/2:(o=T+A,a=T+w*i-A),r.startAngle=o,r.endAngle=a,T+=w*i}})})}var w$=n(88297),wW=n(45400),wG=n(28535);function wU(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=Math.sqrt(l*l+u*u),d=((i-e)*(l/=c)+(o-t)*(u/=c))/c;s&&(d=Math.min(Math.max(d,0),1)),d*=c;var h=a[0]=e+d*l,p=a[1]=t+d*u;return Math.sqrt((h-i)*(h-i)+(p-o)*(p-o))}wr.A.CMD;var wq=new wW.A,wY=new wW.A,wX=new wW.A,wZ=new wW.A,wK=new wW.A,wQ=[],wJ=new wW.A;function w0(e,t,n,r){var i="normal"===n,o=i?e:e.ensureState(n);o.ignore=t;var a=r.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=r.getModel("lineStyle").getLineStyle();i?e.useStyle(s):o.style=s}function w1(e,t){var n=t.smooth,r=t.points;if(r)if(e.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=wG.xg(r[0],r[1]),o=wG.xg(r[1],r[2]);if(!i||!o){e.lineTo(r[1][0],r[1][1]),e.lineTo(r[2][0],r[2][1]);return}var a=Math.min(i,o)*n,s=wG.Cc([],r[1],r[0],a/i),l=wG.Cc([],r[1],r[2],a/o),u=wG.Cc([],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],r[2][0],r[2][1])}else for(var c=1;c<r.length;c++)e.lineTo(r[c][0],r[c][1])}var w2=n(14230),w5=n(51690),w4=Math.PI/180;function w3(e,t,n,r,i,o,a,s,l,u){if(!(e.length<2)){for(var c=e.length,d=0;d<c;d++)if("outer"===e[d].position&&"labelLine"===e[d].labelAlignTo){var h=e[d].label.x-u;e[d].linePoints[1][0]+=h,e[d].label.x=u}(function(e,t,n,r,i){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,d=[],h=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);d.push(m),h+=m,u=g.y+g[t]}h>0&&i&&w(-h/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(-a),s<0&&A(s),c}function x(){a=v.rect.y-n,s=r-y.rect.y-y.rect[t]}function b(e,t,n){if(e<0){var r=Math.min(t,-e);if(r>0){w(r*n,0,l);var i=r+e;i<0&&S(-i*n,1)}else S(-e*n,1)}}function w(t,n,r){0!==t&&(c=!0);for(var i=n;i<r;i++){var o=e[i],a=o.rect;a.y+=t,o.label.y+=t}}function S(n,r){for(var i=[],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);i.push(u),o+=u}if(o){var c=Math.min(Math.abs(n)/o,r);if(n>0)for(var a=0;a<l-1;a++){var d=i[a]*c;w(d,0,a+1)}else for(var a=l-1;a>0;a--){var d=i[a-1]*c;w(-d,a,l)}}}function A(e){for(var t=e<0?-1:1,n=Math.ceil((e=Math.abs(e))/(l-1)),r=0;r<l-1;r++)if(t>0?w(n,0,r+1):w(-n,l-r-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 d=l.label.x-t-l.len2*i,h=r+l.len;u.rB=Math.abs(d)<h?Math.sqrt(c*c/(1-d*d/h/h)):h,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=r+l.len,d=t+(Math.sqrt(c*c*(1-Math.abs(u*u/a)))+l.len2)*i,h=d-l.label.x,p=l.targetTextWidth-h*i;w6(l,p,!0),l.label.x=d}}}function w6(e,t,n){if(void 0===n&&(n=!1),null==e.labelStyleWidth){var r=e.label,i=r.style,o=e.rect,a=i.backgroundColor,s=i.padding,l=s?s[1]+s[3]:0,u=i.overflow,c=o.width+(a?0:l);if(t<c||n){var d=o.height;if(u&&u.match("break")){r.setStyle("backgroundColor",null),r.setStyle("width",t-l);var h=r.getBoundingRect();r.setStyle("width",Math.ceil(h.width)),r.setStyle("backgroundColor",a)}else{var p=t-l,f=t<c?p:n?p>e.unconstrainedWidth?null:p:null;r.setStyle("width",f)}var g=r.getBoundingRect();o.width=g.width;var m=(r.style.margin||0)+2.1;o.height=g.height+m,o.y-=(o.height-d)/2}}}function w8(e){return"center"===e.position}var w9=function(e){function t(t,n,r){var i=e.call(this)||this;i.z2=2;var o=new wt.Ay;return i.setTextContent(o),i.updateData(t,n,r,!0),i}return(0,bs.C6)(t,e),t.prototype.updateData=function(e,t,n,r){var i=e.hostModel,o=e.getItemModel(t),a=o.getModel("emphasis"),s=e.getItemLayout(t),l=(0,bn.X$)(bR(o.getModel("itemStyle"),s,!0),s);if(isNaN(l.startAngle))return void this.setShape(l);if(r){this.setShape(l);var u=i.getShallow("animationType");i.ecModel.ssr?(bm.LW(this,{scaleX:0,scaleY:0},i,{dataIndex:t,isFrom:!0}),this.originX=l.cx,this.originY=l.cy):"scale"===u?(this.shape.r=s.r0,bm.LW(this,{shape:{r:s.r}},i,t)):null!=n?(this.setShape({startAngle:n,endAngle:n}),bm.LW(this,{shape:{startAngle:s.startAngle,endAngle:s.endAngle}},i,t)):(this.shape.endAngle=s.startAngle,bm.oi(this,{shape:{endAngle:s.endAngle}},i,t))}else(0,bm.ap)(this),bm.oi(this,{shape:l},i,t);this.useStyle(e.getItemVisual(t,"style")),(0,bb.Mx)(this,o);var c=(s.startAngle+s.endAngle)/2,d=i.get("selectedOffset"),h=Math.cos(c)*d,p=Math.sin(c)*d,f=o.getShallow("cursor");f&&this.attr("cursor",f),this._updateLabel(i,e,t),this.ensureState("emphasis").shape=(0,bn.X$)({r:s.r+(a.get("scale")&&a.get("scaleSize")||0)},bR(a.getModel("itemStyle"),s)),(0,bn.X$)(this.ensureState("select"),{x:h,y:p,shape:bR(o.getModel(["select","itemStyle"]),s)}),(0,bn.X$)(this.ensureState("blur"),{shape:bR(o.getModel(["blur","itemStyle"]),s)});var g=this.getTextGuideLine(),m=this.getTextContent();g&&(0,bn.X$)(g.ensureState("select"),{x:h,y:p}),(0,bn.X$)(m.ensureState("select"),{x:h,y:p}),(0,bb.Lm)(this,a.get("focus"),a.get("blurScope"),a.get("disabled"))},t.prototype._updateLabel=function(e,t,n){var r=t.getItemModel(n),i=r.getModel("labelLine"),o=t.getItemVisual(n,"style"),a=o&&o.fill,s=o&&o.opacity;(0,bw.qM)(this,(0,bw.lx)(r),{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 w$.A,this.setTextGuideLine(c)),function(e,t,n){var r=e.getTextGuideLine(),i=e.getTextContent();if(!i){r&&e.removeTextGuideLine();return}for(var o=t.normal,a=o.get("show"),s=i.ignore,l=0;l<bb.wV.length;l++){var u=bb.wV[l],c=t[u],d="normal"===u;if(c){var h=c.get("show");if((d?s:(0,bn.bZ)(i.states[u]&&i.states[u].ignore,s))||!(0,bn.bZ)(h,a)){var p=d?r:r&&r.states[u];p&&(p.ignore=!0),r&&w0(r,!0,u,c);continue}!r&&(r=new w$.A,e.setTextGuideLine(r),d||!s&&a||w0(r,!0,"normal",t.normal),e.stateProxy&&(r.stateProxy=e.stateProxy)),w0(r,!1,u,c)}}if(r){(0,bn.NT)(r.style,n),r.style.fill=null;var f=o.get("showAbove");(e.textGuideLineConfig=e.textGuideLineConfig||{}).showAbove=f||!1,r.buildPath=w1}}(this,function(e,t){t=t||"labelLine";for(var n={normal:e.getModel(t)},r=0;r<bb.BV.length;r++){var i=bb.BV[r];n[i]=e.getModel([i,t])}return n}(r),{stroke:a,opacity:(0,bn.WV)(i.get(["lineStyle","opacity"]),s,1)})}},t}(by.A),w7=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return(0,bs.C6)(t,e),t.prototype.render=function(e,t,n,r){var i,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&&(i=l.startAngle)}if(this._emptyCircleSector&&s.remove(this._emptyCircleSector),0===o.count()&&e.get("showEmptyCircle")){var c=new by.A({shape:wV(e,n)});c.useStyle(e.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=c,s.add(c)}o.diff(a).add(function(e){var t=new w9(o,e,i);o.setItemGraphicEl(e,t),s.add(t)}).update(function(e,t){var n=a.getItemGraphicEl(t);n.updateData(o,e,i),n.off("click"),s.add(n),o.setItemGraphicEl(e,n)}).remove(function(t){var n=a.getItemGraphicEl(t);bm.t5(n,e,t)}).execute(),function(e){var t,n,r=e.getData(),i=[],o=!1,a=(e.get("minShowLabelAngle")||0)*w4,s=r.getLayout("viewRect"),l=r.getLayout("r"),u=s.width,c=s.x,d=s.y,h=s.height;function p(e){e.ignore=!0}r.each(function(e){var s,d,h,f,g=r.getItemGraphicEl(e),m=g.shape,v=g.getTextContent(),y=g.getTextGuideLine(),x=r.getItemModel(e),b=x.getModel("label"),w=b.get("position")||x.get(["emphasis","label","position"]),S=b.get("distanceToLabelLine"),A=b.get("alignTo"),C=(0,wI.lo)(b.get("edgeDistance"),u),M=b.get("bleedMargin"),k=x.getModel("labelLine"),T=k.get("length");T=(0,wI.lo)(T,u);var _=k.get("length2");if(_=(0,wI.lo)(_,u),Math.abs(m.endAngle-m.startAngle)<a){(0,bn.__)(v.states,p),v.ignore=!0,y&&((0,bn.__)(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,d=m.cy,f="center";else{var E=(R?(m.r+m.r0)/2*D:m.r*D)+t,P=(R?(m.r+m.r0)/2*O:m.r*O)+n;if(s=E+3*D,d=P+3*O,!R){var L=E+D*(T+l-m.r),N=P+O*(T+l-m.r),B=L+(D<0?-1:1)*_;s="edge"===A?D<0?c+C:c+u-C:B+(D<0?-S:S),d=N,h=[[E,P],[L,N],[B,N]]}f=R?"center":"edge"===A?D>0?"right":"left":D>0?"left":"right"}var z=Math.PI,F=0,j=b.get("rotate");if((0,bn.Et)(j))F=z/180*j;else if("center"===w)F=0;else if("radial"===j||!0===j)F=D<0?-I+z:-I;else if("tangential"===j&&"outside"!==w&&"outer"!==w){var V=Math.atan2(D,O);V<0&&(V=2*z+V),O>0&&(V=z+V),F=V-z}if(o=!!F,v.x=s,v.y=d,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 $=v.getBoundingRect().clone();$.applyTransform(v.getComputedTransform());var W=(v.style.margin||0)+2.1;$.y-=W/2,$.height+=W,i.push({label:v,labelLine:y,position:w,len:T,len2:_,minTurnAngle:k.get("minTurnAngle"),maxSurfaceAngle:k.get("maxSurfaceAngle"),surfaceNormal:new wW.A(D,O),linePoints:h,textAlign:f,labelDistance:S,labelAlignTo:A,edgeDistance:C,bleedMargin:M,rect:$,unconstrainedWidth:$.width,labelStyleWidth:v.style.width})}g.setTextConfig({inside:R})}}),!o&&e.get("avoidLabelOverlap")&&function(e,t,n,r,i,o,a,s){for(var l=[],u=[],c=Number.MAX_VALUE,d=-Number.MAX_VALUE,h=0;h<e.length;h++){var p=e[h].label;w8(e[h])||(p.x<t?(c=Math.min(c,p.x),l.push(e[h])):(d=Math.max(d,p.x),u.push(e[h])))}for(var h=0;h<e.length;h++){var f=e[h];if(!w8(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+i-f.edgeDistance-g[2][0]-f.labelDistance:"labelLine"===f.labelAlignTo?p.x<t?c-a-f.bleedMargin:a+i-d-f.bleedMargin:p.x<t?p.x-a-f.bleedMargin:a+i-p.x-f.bleedMargin,f.targetTextWidth=m,w6(f,m)}}w3(u,t,n,r,1,i,o,a,s,d),w3(l,t,n,r,-1,i,o,a,s,c);for(var h=0;h<e.length;h++){var f=e[h];if(!w8(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+i-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}}}(i,t,n,l,u,h,c,d);for(var f=0;f<i.length;f++){var g=i[f],m=g.label,v=g.labelLine,y=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:g.textAlign}),y&&((0,bn.__)(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?((0,bn.__)(v.states,p),v.ignore=!0):(!function(e,t){if(t<=180&&t>0){t=t/180*Math.PI,wq.fromArray(e[0]),wY.fromArray(e[1]),wX.fromArray(e[2]),wW.A.sub(wZ,wq,wY),wW.A.sub(wK,wX,wY);var n=wZ.len(),r=wK.len();if(!(n<.001)&&!(r<.001)&&(wZ.scale(1/n),wK.scale(1/r),Math.cos(t)<wZ.dot(wK))){var i=wU(wY.x,wY.y,wX.x,wX.y,wq.x,wq.y,wQ,!1);wJ.fromArray(wQ),wJ.scaleAndAdd(wK,i/Math.tan(Math.PI-t));var o=wX.x!==wY.x?(wJ.x-wY.x)/(wX.x-wY.x):(wJ.y-wY.y)/(wX.y-wY.y);if(isNaN(o))return;o<0?wW.A.copy(wJ,wY):o>1&&wW.A.copy(wJ,wX),wJ.toArray(e[1])}}}(b,g.minTurnAngle),function(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,wq.fromArray(e[0]),wY.fromArray(e[1]),wX.fromArray(e[2]),wW.A.sub(wZ,wY,wq),wW.A.sub(wK,wX,wY);var r=wZ.len(),i=wK.len();if(!(r<.001)&&!(i<.001)&&(wZ.scale(1/r),wK.scale(1/i),wZ.dot(t)<Math.cos(n))){var o=wU(wY.x,wY.y,wX.x,wX.y,wq.x,wq.y,wQ,!1);wJ.fromArray(wQ);var a=Math.PI/2,s=a+Math.acos(wK.dot(t))-n;if(s>=a)wW.A.copy(wJ,wX);else{wJ.scaleAndAdd(wK,o/Math.tan(Math.PI/2-s));var l=wX.x!==wY.x?(wJ.x-wY.x)/(wX.x-wY.x):(wJ.y-wY.y)/(wX.y-wY.y);if(isNaN(l))return;l<0?wW.A.copy(wJ,wY):l>1&&wW.A.copy(wJ,wX)}wJ.toArray(e[1])}}}(b,g.surfaceNormal,g.maxSurfaceAngle),v.setShape({points:b}),m.__hostTarget.textGuideLineConfig={anchor:new wW.A(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 r=e[0]-n.cx,i=e[1]-n.cy,o=Math.sqrt(r*r+i*i);return o<=n.r&&o>=n.r0}},t.type="pie",t}(bk.A),Se=n(88569),St=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}(),Sn=wn.$r(),Sr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,bs.C6)(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new St(bn.oI(this.getData,this),bn.oI(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return wP(this,{coordDimensions:["value"],encodeDefaulter:bn.cF(Se.ln,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),r=Sn(n),i=r.seats;if(!i){var o=[];n.each(n.mapDimension("value"),function(e){o.push(e)}),i=r.seats=(0,wI.kM)(o,n.hostModel.get("percentPrecision"))}var a=e.prototype.getDataParams.call(this,t);return a.percent=i[t]||0,a.$vars.push("percent"),a},t.prototype._defaultLabelLine=function(e){wn.M5(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}(bl.A),Si=n(74653),So=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return(0,bs.C6)(t,e),t.prototype.getInitialData=function(e,t){return(0,bu.A)(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}(bl.A),Sa=function(){},Ss=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return(0,bs.C6)(t,e),t.prototype.getDefaultShape=function(){return new Sa},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(e,t){var n,r=t.points,i=t.size,o=this.symbolProxy,a=o.shape,s=e.getContext?e.getContext():e,l=s&&i[0]<4,u=this.softClipShape;if(l){this._ctx=s;return}for(this._ctx=null,n=this._off;n<r.length;){var c=r[n++],d=r[n++];!(isNaN(c)||isNaN(d))&&(!u||u.contain(c,d))&&(a.x=c-i[0]/2,a.y=d-i[1]/2,a.width=i[0],a.height=i[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,r=t.size,i=this._ctx,o=this.softClipShape;if(i){for(e=this._off;e<n.length;){var a=n[e++],s=n[e++];!(isNaN(a)||isNaN(s))&&(!o||o.contain(a,s))&&i.fillRect(a-r[0]/2,s-r[1]/2,r[0],r[1])}this.incremental&&(this._off=e,this.notClear=!0)}},t.prototype.findDataIndex=function(e,t){for(var n=this.shape,r=n.points,i=n.size,o=Math.max(i[0],4),a=Math.max(i[1],4),s=r.length/2-1;s>=0;s--){var l=2*s,u=r[l]-o/2,c=r[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),r=this.getBoundingRect();return(e=n[0],t=n[1],r.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,r=t.size,i=r[0],o=r[1],a=1/0,s=1/0,l=-1/0,u=-1/0,c=0;c<n.length;){var d=n[c++],h=n[c++];a=Math.min(d,a),l=Math.max(d,l),s=Math.min(h,s),u=Math.max(h,u)}e=this._rect=new w5.A(a-i/2,s-o/2,l-a+i,u-s+o)}return e},t}(bp.Ay),Sl=function(){function e(){this.group=new bf.A}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,r=4*e.startIndex*2;t=new Float32Array(t.buffer,r,n)}e.setShape("points",t),e.reset()})},e.prototype.incrementalPrepareUpdate=function(e){this._clear()},e.prototype.incrementalUpdate=function(e,t,n){var r=this._newAdded[0],i=t.getLayout("points"),o=r&&r.shape.points;if(o&&o.length<2e4){var a=o.length,s=new Float32Array(a+i.length);s.set(o),s.set(i,a),r.endIndex=e.end,r.setShape({points:s})}else{this._newAdded=[];var l=this._create();l.startIndex=e.start,l.endIndex=e.end,l.incremental=!0,l.setShape({points:i}),this._setCommon(l,t,n)}},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new Ss({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},e.prototype._setCommon=function(e,t,n){var r=t.hostModel;n=n||{};var i=t.getVisual("symbolSize");e.setShape("size",i instanceof Array?i:[i,i]),e.softClipShape=n.clipShape||null,e.symbolProxy=(0,bK.v5)(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<4;e.useStyle(r.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var a=t.getVisual("style"),s=a&&a.fill;s&&e.setColor(s);var l=(0,bx.z)(e);l.seriesIndex=r.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}(),Su=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.render=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).updateData(r,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).incrementalPrepareUpdate(r),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 r=e.getData();if(this.group.dirty(),!this._finished||r.count()>1e4)return{update:!0};var i=wM("").reset(e,t,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout(r)},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,r=t.pipelineContext.large;return n&&r===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=r?new Sl:new b3,this._isLargeDraw=r,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}(bk.A),Sc=n(43583),Sd=n(36805),Sh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,bs.C6)(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}(Sd.A),Sp=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}(),Sf=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,bs.C6)(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",wn.US).models[0]},t.type="cartesian2dAxis",t}(Sd.A);bn.co(Sf,Sp);var Sg={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)"]}}},Sm=bn.h1({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},Sg),Sv=bn.h1({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}}},Sg),Sy=bn.h1({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Sv),Sx=bn.NT({logBase:10},Sv);let Sb={category:Sm,value:Sv,time:Sy,log:Sx};var Sw=0,SS=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++Sw}return e.createByAxisModel=function(t){var n=t.option,r=n.data,i=r&&(0,bn.Tj)(r,SA);return new e({categories:i,needCollect:!i,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(!(0,bn.Kg)(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var r=this._getOrCreateMap();return null==(t=r.get(e))&&(n?(t=this.categories.length,this.categories[t]=e,r.set(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||(this._map=(0,bn.nt)(this.categories))},e}();function SA(e){return(0,bn.Gv)(e)&&null!=e.value?e.value:e+""}var SC={value:1,category:1,time:1,log:1};function SM(e,t,n,r){(0,bn.__)(SC,function(i,o){var a=(0,bn.h1)((0,bn.h1)({},Sb[o],!0),r,!0),s=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t+"Axis."+o,n}return(0,bs.C6)(n,e),n.prototype.mergeDefaultAndTheme=function(e,t){var n=(0,wB.ad)(this),r=n?(0,wB.vs)(e):{},i=t.getTheme();(0,bn.h1)(e,i.get(o+"Axis")),(0,bn.h1)(e,this.getDefaultOption()),e.type=Sk(e),n&&(0,wB.YA)(e,r,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=SS.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",Sk)}function Sk(e){return e.type||(e.data?"category":"value")}var ST=n(18191),S_=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 SI(e){return"interval"===e.type||"log"===e.type}function SD(e){var t=Math.pow(10,(0,wI.NX)(e)),n=e/t;return n?2===n?n=3:3===n?n=5:n*=2:n=1,(0,wI.LI)(n*t)}function SO(e){return(0,wI.XV)(e)+2}function SR(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function SE(e,t){return e>=t[0]&&e<=t[1]}function SP(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function SL(e,t){return e*(t[1]-t[0])+t[0]}ST.tQ(S_);var SN=function(e){function t(t){var n=e.call(this,t)||this;n.type="ordinal";var r=n.getSetting("ordinalMeta");return r||(r=new SS({})),(0,bn.cy)(r)&&(r=new SS({categories:(0,bn.Tj)(r,function(e){return(0,bn.Gv)(e)?e.value:e})})),n._ordinalMeta=r,n._extent=n.getSetting("extent")||[0,r.categories.length-1],n}return(0,bs.C6)(t,e),t.prototype.parse=function(e){return null==e?NaN:(0,bn.Kg)(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return SE(e=this.parse(e),this._extent)&&null!=this._ordinalMeta.categories[e]},t.prototype.normalize=function(e){return SP(e=this._getTickNumber(this.parse(e)),this._extent)},t.prototype.scale=function(e){return e=Math.round(SL(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=[],r=this._ticksByOrdinalNumber=[],i=0,o=this._ordinalMeta.categories.length,a=Math.min(o,t.length);i<a;++i){var s=t[i];n[i]=s,r[s]=i}for(var l=0;i<o;++i){for(;null!=r[l];)l++;n.push(l),r[l]=i}},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}(S_);S_.registerClass(SN);var SB=wI.LI,Sz=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(0,bs.C6)(t,e),t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return SE(e,this._extent)},t.prototype.normalize=function(e){return SP(e,this._extent)},t.prototype.scale=function(e){return SL(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=SO(e)},t.prototype.getTicks=function(e){var t=this._interval,n=this._extent,r=this._niceExtent,i=this._intervalPrecision,o=[];if(!t)return o;n[0]<r[0]&&(e?o.push({value:SB(r[0]-t,i)}):o.push({value:n[0]}));for(var a=r[0];a<=r[1]&&(o.push({value:a}),(a=SB(a+t,i))!==o[o.length-1].value);)if(o.length>1e4)return[];var s=o.length?o[o.length-1].value:r[1];return n[1]>s&&(e?o.push({value:SB(s+t,i)}):o.push({value:n[1]})),o},t.prototype.getMinorTicks=function(e){for(var t=this.getTicks(!0),n=[],r=this.getExtent(),i=1;i<t.length;i++){for(var o=t[i],a=t[i-1],s=0,l=[],u=(o.value-a.value)/e;s<e-1;){var c=SB(a.value+(s+1)*u);c>r[0]&&c<r[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;null==n?n=wI.XV(e.value)||0:"auto"===n&&(n=this._intervalPrecision);var r=SB(e.value,n,!0);return wp.ob(r)},t.prototype.calcNiceTicks=function(e,t,n){e=e||5;var r=this._extent,i=r[1]-r[0];if(isFinite(i)){i<0&&(i=-i,r.reverse());var o,a,s,l,u,c,d,h=(s=e,l={},u=r[1]-r[0],c=l.interval=(0,wI.Cm)(u/s,!0),null!=t&&c<t&&(c=l.interval=t),null!=n&&c>n&&(c=l.interval=n),d=l.intervalPrecision=SO(c),o=l.niceTickExtent=[(0,wI.LI)(Math.ceil(r[0]/c)*c,d),(0,wI.LI)(Math.floor(r[1]/c)*c,d)],a=r,isFinite(o[0])||(o[0]=a[0]),isFinite(o[1])||(o[1]=a[1]),SR(o,0,a),SR(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 r=this._interval;e.fixMin||(t[0]=SB(Math.floor(t[0]/r)*r)),e.fixMax||(t[1]=SB(Math.ceil(t[1]/r)*r))},t.prototype.setNiceExtent=function(e,t){this._niceExtent=[e,t]},t.type="interval",t}(S_);S_.registerClass(Sz);var SF=n(29456),Sj=function(e,t,n,r){for(;n<r;){var i=n+r>>>1;e[i][1]<t?n=i+1:r=i}return n},SV=function(e){function t(t){var n=e.call(this,t)||this;return n.type="time",n}return(0,bs.C6)(t,e),t.prototype.getLabel=function(e){var t=this.getSetting("useUTC");return(0,SF.GP)(e.value,SF.Lm[(0,SF.$9)((0,SF.ym)(this._minLevelUnit))]||SF.Lm.second,t,this.getSetting("locale"))},t.prototype.getFormattedLabel=function(e,t,n){var r=this.getSetting("useUTC"),i=this.getSetting("locale");return(0,SF.X_)(e,t,n,i,r)},t.prototype.getTicks=function(){var e=this._interval,t=this._extent,n=[];if(!e)return n;n.push({value:t[0],level:0});var r=this.getSetting("useUTC"),i=function(e,t,n,r){for(var i=SF.F7,o=0,a=[],s=[],l=0,u=0,c=0;c<i.length&&o++<1e4;++c){var d=(0,SF.ym)(i[c]);if((0,SF.ce)(i[c])&&(!function(e,i,o){var a=[],s=!i.length;if(!function(e,t,n,r){var i=wI._U(t),o=wI._U(n),a=function(e){return(0,SF.g0)(i,e,r)===(0,SF.g0)(o,e,r)},s=function(){return a("year")},l=function(){return s()&&a("month")},u=function(){return l()&&a("day")},c=function(){return u()&&a("hour")},d=function(){return c()&&a("minute")},h=function(){return d()&&a("second")};switch(e){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return d();case"second":return h();case"millisecond":return h()&&a("millisecond")}}((0,SF.ym)(e),r[0],r[1],n)){s&&(i=[{value:function(e,t,n){var r=new Date(e);switch((0,SF.ym)(t)){case"year":case"month":r[(0,SF.xu)(n)](0);case"day":r[(0,SF.ti)(n)](1);case"hour":r[(0,SF.Yd)(n)](0);case"minute":r[(0,SF.KF)(n)](0);case"second":r[(0,SF.ww)(n)](0),r[(0,SF.FP)(n)](0)}return r.getTime()}(new Date(r[0]),e,n)},{value:r[1]}]);for(var l=0;l<i.length-1;l++){var u=i[l].value,c=i[l+1].value;if(u!==c){var d,h,p,f=void 0,g=void 0,m=void 0;switch(e){case"year":f=Math.max(1,Math.round(t/SF.CZ/365)),g=(0,SF.hY)(n),m=(0,SF.tM)(n);break;case"half-year":case"quarter":case"month":f=(d=t/(30*SF.CZ))>6?6:d>3?3:d>2?2:1,g=(0,SF.jJ)(n),m=(0,SF.xu)(n);break;case"week":case"half-week":case"day":f=(h=t/SF.CZ)>16?16:h>7.5?7:h>3.5?4:h>1.5?2:1,g=(0,SF.bP)(n),m=(0,SF.ti)(n);break;case"half-day":case"quarter-day":case"hour":f=(p=t/SF.MA)>12?12:p>6?6:p>3.5?4:p>2?2:1,g=(0,SF.iC)(n),m=(0,SF.Yd)(n);break;case"minute":f=S$(t,!0),g=(0,SF.yB)(n),m=(0,SF.KF)(n);break;case"second":f=S$(t,!1),g=(0,SF.Wf)(n),m=(0,SF.ww)(n);break;case"millisecond":f=wI.Cm(t,!0),g=(0,SF.Zz)(n),m=(0,SF.FP)(n)}!function(e,t,n,i,o,a){for(var s=new Date(t),l=t,u=s[i]();l<n&&l<=r[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])}}(i[c],a[a.length-1]||[],s),d!==(i[c+1]?(0,SF.ym)(i[c+1]):null))){if(s.length){u=l,s.sort(function(e,t){return e.value-t.value});for(var h=[],p=0;p<s.length;++p){var f=s[p].value;(0===p||s[p-1].value!==f)&&(h.push(s[p]),f>=r[0]&&f<=r[1]&&l++)}var g=(r[1]-r[0])/t;if(l>1.5*g&&u>g/1.5||(a.push(h),l>g||e===i[c]))break}s=[]}}for(var m=(0,bn.pb)((0,bn.Tj)(a,function(e){return(0,bn.pb)(e,function(e){return e.value>=r[0]&&e.value<=r[1]&&!e.notAdd})}),function(e){return e.length>0}),v=[],y=m.length-1,c=0;c<m.length;++c)for(var x=m[c],b=0;b<x.length;++b)v.push({value:x[b].value,level:y-c});v.sort(function(e,t){return e.value-t.value});for(var w=[],c=0;c<v.length;++c)(0===c||v[c].value!==v[c-1].value)&&w.push(v[c]);return w}(this._minLevelUnit,this._approxInterval,r,t);return(n=n.concat(i)).push({value:t[1],level:0}),n},t.prototype.calcNiceExtent=function(e){var t=this._extent;if(t[0]===t[1]&&(t[0]-=SF.CZ,t[1]+=SF.CZ),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]-SF.CZ}this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval)},t.prototype.calcNiceTicks=function(e,t,n){e=e||10;var r=this._extent,i=r[1]-r[0];this._approxInterval=i/e,null!=t&&this._approxInterval<t&&(this._approxInterval=t),null!=n&&this._approxInterval>n&&(this._approxInterval=n);var o=SH.length,a=Math.min(Sj(SH,this._approxInterval,0,o),o-1);this._interval=SH[a][1],this._minLevelUnit=SH[Math.max(a-1,0)][0]},t.prototype.parse=function(e){return(0,bn.Et)(e)?e:+wI._U(e)},t.prototype.contain=function(e){return SE(this.parse(e),this._extent)},t.prototype.normalize=function(e){return SP(this.parse(e),this._extent)},t.prototype.scale=function(e){return SL(e,this._extent)},t.type="time",t}(Sz),SH=[["second",SF.OY],["minute",SF.iW],["hour",SF.MA],["quarter-day",6*SF.MA],["half-day",12*SF.MA],["day",1.2*SF.CZ],["half-week",3.5*SF.CZ],["week",7*SF.CZ],["month",31*SF.CZ],["quarter",95*SF.CZ],["half-year",SF.$H/2],["year",SF.$H]];function S$(e,t){return(e/=t?SF.iW:SF.OY)>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}S_.registerClass(SV);var SW=S_.prototype,SG=Sz.prototype,SU=wI.LI,Sq=Math.floor,SY=Math.ceil,SX=Math.pow,SZ=Math.log,SK=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new Sz,t._interval=0,t}return(0,bs.C6)(t,e),t.prototype.getTicks=function(e){var t=this._originalScale,n=this._extent,r=t.getExtent(),i=SG.getTicks.call(this,e);return bn.Tj(i,function(e){var t=e.value,i=wI.LI(SX(this.base,t));return i=t===n[0]&&this._fixMin?SJ(i,r[0]):i,{value:i=t===n[1]&&this._fixMax?SJ(i,r[1]):i}},this)},t.prototype.setExtent=function(e,t){var n=SZ(this.base);e=SZ(Math.max(0,e))/n,t=SZ(Math.max(0,t))/n,SG.setExtent.call(this,e,t)},t.prototype.getExtent=function(){var e=this.base,t=SW.getExtent.call(this);t[0]=SX(e,t[0]),t[1]=SX(e,t[1]);var n=this._originalScale.getExtent();return this._fixMin&&(t[0]=SJ(t[0],n[0])),this._fixMax&&(t[1]=SJ(t[1],n[1])),t},t.prototype.unionExtent=function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=SZ(e[0])/SZ(t),e[1]=SZ(e[1])/SZ(t),SW.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 r=wI.au(n);for(e/n*r<=.5&&(r*=10);!isNaN(r)&&1>Math.abs(r)&&Math.abs(r)>0;)r*=10;var i=[wI.LI(SY(t[0]/r)*r),wI.LI(Sq(t[1]/r)*r)];this._interval=r,this._niceExtent=i}},t.prototype.calcNiceExtent=function(e){SG.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 SE(e=SZ(e)/SZ(this.base),this._extent)},t.prototype.normalize=function(e){return SP(e=SZ(e)/SZ(this.base),this._extent)},t.prototype.scale=function(e){return e=SL(e,this._extent),SX(this.base,e)},t.type="log",t}(S_),SQ=SK.prototype;function SJ(e,t){return SU(e,wI.XV(t))}SQ.getMinorTicks=SG.getMinorTicks,SQ.getLabel=SG.getLabel,S_.registerClass(SK);var S0=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 r=this._isOrdinal="ordinal"===e.type;this._needCrossZero="interval"===e.type&&t.getNeedCrossZero&&t.getNeedCrossZero();var i=this._modelMinRaw=t.get("min",!0);(0,bn.Tn)(i)?this._modelMinNum=S4(e,i({min:n[0],max:n[1]})):"dataMin"!==i&&(this._modelMinNum=S4(e,i));var o=this._modelMaxRaw=t.get("max",!0);if((0,bn.Tn)(o)?this._modelMaxNum=S4(e,o({min:n[0],max:n[1]})):"dataMax"!==o&&(this._modelMaxNum=S4(e,o)),r)this._axisDataLen=t.getCategories().length;else{var a=t.get("boundaryGap"),s=(0,bn.cy)(a)?a:[a||0,a||0];"boolean"==typeof s[0]||"boolean"==typeof s[1]?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[(0,bI.lo)(s[0],1),(0,bI.lo)(s[1],1)]}},e.prototype.calculate=function(){var e=this._isOrdinal,t=this._dataMin,n=this._dataMax,r=this._axisDataLen,i=this._boundaryGapInner,o=e?null:n-t||Math.abs(t),a="dataMin"===this._modelMinRaw?t:this._modelMinNum,s="dataMax"===this._modelMaxRaw?n:this._modelMaxNum,l=null!=a,u=null!=s;null==a&&(a=e?r?0:NaN:t-i[0]*o),null==s&&(s=e?r?r-1:NaN:n+i[1]*o),null!=a&&isFinite(a)||(a=NaN),null!=s&&isFinite(s)||(s=NaN);var c=(0,bn.Yp)(a)||(0,bn.Yp)(s)||e&&!r;this._needCrossZero&&(a>0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var d=this._determinedMin,h=this._determinedMax;return null!=d&&(a=d,l=!0),null!=h&&(s=h,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:c}},e.prototype.modifyDataMinMax=function(e,t){this[S2[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){this[S1[e]]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),S1={min:"_determinedMin",max:"_determinedMax"},S2={min:"_dataMin",max:"_dataMax"};function S5(e,t,n){var r=e.rawExtentInfo;return r||(r=new S0(e,t,n),e.rawExtentInfo=r),r}function S4(e,t){return null==t?null:(0,bn.Yp)(t)?NaN:e.parse(t)}function S3(e,t){var n=e.type,r=S5(e,t,e.getExtent()).calculate();e.setBlank(r.isBlank);var i=r.min,o=r.max,a=t.ecModel;if(a&&"time"===n){var s=(0,br.GL)("bar",a),l=!1;if(bn.__(s,function(e){l=l||e.getBaseAxis()===t.axis}),l){var u=function(e,t,n,r){var i=n.axis.getExtent(),o=i[1]-i[0],a=(0,br.VA)(r,n.axis);if(void 0===a)return{min:e,max:t};var s=1/0;bn.__(a,function(e){s=Math.min(e.offset,s)});var l=-1/0;bn.__(a,function(e){l=Math.max(e.offset+e.width,l)});var u=(s=Math.abs(s))+(l=Math.abs(l)),c=t-e,d=c/(1-(s+l)/o)-c;return t+=l/u*d,{min:e-=s/u*d,max:t}}(i,o,t,(0,br.vq)(s));i=u.min,o=u.max}}return{extent:[i,o],fixMin:r.minFixed,fixMax:r.maxFixed}}function S6(e,t){var n=S3(e,t),r=n.extent,i=t.get("splitNumber");e instanceof SK&&(e.base=t.get("logBase"));var o=e.type,a=t.get("interval"),s="interval"===o||"time"===o;e.setExtent(r[0],r[1]),e.calcNiceExtent({splitNumber:i,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 S8(e){var t=e.getLabelModel().get("formatter"),n="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?function(n,r){return e.scale.getFormattedLabel(n,r,t)}:bn.Kg(t)?function(n){var r=e.scale.getLabel(n);return t.replace("{value}",null!=r?r:"")}:bn.Tn(t)?function(r,i){return null!=n&&(i=r.value-n),t(S9(e,r),i,null!=r.level?{level:r.level}:null)}:function(t){return e.scale.getLabel(t)}}function S9(e,t){return"category"===e.type?e.scale.getLabel(t):t.value}function S7(e){var t=e.get("interval");return null==t?"auto":t}function Ae(e){return"category"===e.type&&0===S7(e.getLabelModel())}function At(e,t){var n={};return bn.__(e.mapDimensionsAll(t),function(t){n[(0,b6.me)(e,t)]=!0}),bn.HP(n)}var An=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 bn.Tj(this._dimList,function(e){return this._axes[e]},this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),bn.pb(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}(),Ar=n(37817),Ai=["x","y"];function Ao(e){return"interval"===e.type||"time"===e.type}var Aa=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=Ai,t}return(0,bs.C6)(t,e),t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,t=this.getAxis("y").scale;if(Ao(e)&&Ao(t)){var n=e.getExtent(),r=t.getExtent(),i=this.dataToPoint([n[0],r[0]]),o=this.dataToPoint([n[1],r[1]]),a=n[1]-n[0],s=r[1]-r[0];if(a&&s){var l=(o[0]-i[0])/a,u=(o[1]-i[1])/s,c=i[0]-n[0]*l,d=i[1]-r[0]*u,h=this._transform=[l,0,0,u,c,d];this._invTransform=(0,Ar.B8)([],h)}}},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),r=this.dataToPoint(t),i=this.getArea(),o=new w5.A(n[0],n[1],r[0]-n[0],r[1]-n[1]);return i.intersect(o)},t.prototype.dataToPoint=function(e,t,n){n=n||[];var r=e[0],i=e[1];if(this._transform&&null!=r&&isFinite(r)&&null!=i&&isFinite(i))return(0,wG.NW)(n,e,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(r,t)),n[1]=a.toGlobalCoord(a.dataToCoord(i,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis("x").scale,r=this.getAxis("y").scale,i=n.getExtent(),o=r.getExtent(),a=n.parse(e[0]),s=r.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(i[0],i[1]),a),Math.max(i[0],i[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(0,wG.NW)(n,e,this._invTransform);var r=this.getAxis("x"),i=this.getAxis("y");return n[0]=r.coordToData(r.toLocalCoord(e[0]),t),n[1]=i.coordToData(i.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(),r=Math.min(t[0],t[1])-e,i=Math.min(n[0],n[1])-e,o=Math.max(t[0],t[1])-r+e,a=Math.max(n[0],n[1])-i+e;return new w5.A(r,i,o,a)},t}(An),As=(0,wn.$r)();function Al(e,t){var n,r,i,o,a=Au(e,"labels"),s=S7(t),l=Ac(a,s);return l||(bn.Tn(s)?i=Ap(e,s):(o="auto"===s?null!=(r=As(n=e).autoInterval)?r:As(n).autoInterval=n.calculateCategoryInterval():s,i=Ah(e,o)),Ad(a,s,{labels:i,labelCategoryInterval:o}))}function Au(e,t){return As(e)[t]||(As(e)[t]=[])}function Ac(e,t){for(var n=0;n<e.length;n++)if(e[n].key===t)return e[n].value}function Ad(e,t,n){return e.push({key:t,value:n}),n}function Ah(e,t,n){var r=S8(e),i=e.scale,o=i.getExtent(),a=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=o[0],c=i.count();0!==u&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var d=Ae(e),h=a.get("showMinLabel")||d,p=a.get("showMaxLabel")||d;h&&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:r(t),rawLabel:i.getLabel(t),tickValue:e})}return p&&f-l!==o[1]&&g(o[1]),s}function Ap(e,t,n){var r=e.scale,i=S8(e),o=[];return bn.__(r.getTicks(),function(e){var a=r.getLabel(e),s=e.value;t(e.value,a)&&o.push(n?s:{formattedLabel:i(e),rawLabel:a,tickValue:s})}),o}var Af=[0,1];function Ag(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}var Am=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n,r)||this;return a.index=0,a.type=i||"value",a.position=o||"bottom",a}return(0,bs.C6)(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]),r=Math.max(t[0],t[1]);return e>=n&&e<=r},e.prototype.containData=function(e){return this.scale.contain(e)},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return(0,wI.hb)(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,r=this.scale;return e=r.normalize(e),this.onBand&&"ordinal"===r.type&&Ag(n=n.slice(),r.count()),(0,wI.Cb)(e,Af,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,r=this.scale;this.onBand&&"ordinal"===r.type&&Ag(n=n.slice(),r.count());var i=(0,wI.Cb)(e,n,Af,t);return this.scale.scale(i)},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,r,i=Au(e,"ticks"),o=S7(t),a=Ac(i,o);if(a)return a;if((!t.get("show")||e.scale.isBlank())&&(n=[]),bn.Tn(o))n=Ap(e,o,!0);else if("auto"===o){var s=Al(e,e.getLabelModel());r=s.labelCategoryInterval,n=bn.Tj(s.labels,function(e){return e.tickValue})}else n=Ah(e,r=o,!0);return Ad(i,o,{ticks:n,tickCategoryInterval:r})}(this,t):{ticks:bn.Tj(this.scale.getTicks(),function(e){return e.value})}).ticks,r=(0,bn.Tj)(n,function(e){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(e):e),tickValue:e}},this);return function(e,t,n,r){var i,o,a=t.length;if(e.onBand&&!n&&a){var s=e.getExtent();if(1===a)t[0].coord=s[0],i=t[1]={coord:s[1]};else{var l=t[a-1].tickValue-t[0].tickValue,u=(t[a-1].coord-t[0].coord)/l;(0,bn.__)(t,function(e){e.coord-=u/2}),o=1+e.scale.getExtent()[1]-t[a-1].tickValue,i={coord:t[a-1].coord+u*o},t.push(i)}var c=s[0]>s[1];d(t[0].coord,s[0])&&(r?t[0].coord=s[0]:t.shift()),r&&d(s[0],t[0].coord)&&t.unshift({coord:s[0]}),d(s[1],i.coord)&&(r?i.coord=s[1]:t.pop()),r&&d(i.coord,s[1])&&t.push({coord:s[1]})}function d(e,t){return e=(0,wI.LI)(e),t=(0,wI.LI)(t),c?e>t:e<t}}(this,r,t.get("alignWithLabel"),e.clamp),r},e.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var e=this.model.getModel("minorTick").get("splitNumber");e>0&&e<100||(e=5);var t=this.scale.getMinorTicks(e);return(0,bn.Tj)(t,function(e){return(0,bn.Tj)(e,function(e){return{coord:this.dataToCoord(e),tickValue:e}},this)},this)},e.prototype.getViewLabels=function(){var e,t,n,r,i,o;return("category"===this.type?(e=this,t=e.getLabelModel(),n=Al(e,t),!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n):(r=this,i=r.scale.getTicks(),o=S8(r),{labels:bn.Tj(i,function(e,t){return{level:e.level,formattedLabel:o(e,t),rawLabel:r.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,r=(n=(t=e).getLabelModel(),{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:n.get("rotate")||0,font:n.getFont()}),i=S8(e),o=(r.axisRotate-r.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],d=e.dataToCoord(c+1)-e.dataToCoord(c),h=Math.abs(d*Math.cos(o)),p=Math.abs(d*Math.sin(o)),f=0,g=0;c<=s[1];c+=u){var m=0,v=0,y=bI.NO(i({value:c}),r.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/h,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=As(e.model),A=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===A[0]&&S.axisExtent1===A[1]?w=C:(S.lastTickCount=l,S.lastAutoInterval=w,S.axisExtent0=A[0],S.axisExtent1=A[1]),w}(this)},e}());function Av(e,t,n){n=n||{};var r=e.coordinateSystem,i=t.axis,o={},a=i.getAxesOnZeroOf()[0],s=i.position,l=a?"onZero":s,u=i.dim,c=r.getRect(),d=[c.x,c.x+c.width,c.y,c.y+c.height],h={left:0,right:1,top:0,bottom:1,onZero:2},p=t.get("offset")||0,f="x"===u?[d[2]-p,d[3]+p]:[d[0]-p,d[1]+p];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));f[h.onZero]=Math.max(Math.min(g,f[1]),f[0])}o.position=["y"===u?f[h[l]]:d[0],"x"===u?f[h[l]]:d[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[h[s]]-f[h.onZero]:0,t.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),bn.Je(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 Ay(e){return"cartesian2d"===e.get("coordinateSystem")}function Ax(e){var t={xAxisModel:null,yAxisModel:null};return bn.__(t,function(n,r){var i=r.replace(/Model$/,""),o=e.getReferringComponents(i,wn.US).models[0];t[r]=o}),t}var Ab=Math.log,Aw=function(){function e(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Ai,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 r(e){var t,n=(0,bn.HP)(e),r=n.length;if(r){for(var i=[],o=r-1;o>=0;o--){var a=e[+n[o]],s=a.model,l=a.scale;SI(l)&&s.get("alignTicks")&&null==s.get("interval")?i.push(a):(S6(l,s),SI(l)&&(t=a))}i.length&&(t||S6((t=i.pop()).scale,t.model),(0,bn.__)(i,function(e){!function(e,t,n){var r=Sz.prototype,i=r.getTicks.call(n),o=r.getTicks.call(n,!0),a=i.length-1,s=r.getInterval.call(n),l=S3(e,t),u=l.extent,c=l.fixMin,d=l.fixMax;if("log"===e.type){var h=Ab(e.base);u=[Ab(u[0])/h,Ab(u[1])/h]}e.setExtent(u[0],u[1]),e.calcNiceExtent({splitNumber:a,fixMin:c,fixMax:d});var p=r.getExtent.call(e);c&&(u[0]=p[0]),d&&(u[1]=p[1]);var f=r.getInterval.call(e),g=u[0],m=u[1];if(c&&d)f=(m-g)/a;else if(c)for(m=u[0]+f*a;m<u[1]&&isFinite(m)&&isFinite(u[1]);)f=SD(f),m=u[0]+f*a;else if(d)for(g=u[1]-f*a;g>u[0]&&isFinite(g)&&isFinite(u[0]);)f=SD(f),g=u[1]-f*a;else{e.getTicks().length-1>a&&(f=SD(f));var v=f*a;m=Math.ceil(u[1]/f)*f,(g=(0,wI.LI)(m-v))<0&&u[0]>=0?(g=0,m=(0,wI.LI)(v)):m>0&&u[1]<=0&&(m=0,g=-(0,wI.LI)(v))}var y=(i[0].value-o[0].value)/s,x=(i[a].value-o[a].value)/s;r.setExtent.call(e,g+f*y,m+f*x),r.setInterval.call(e,f),(y||x)&&r.setNiceExtent.call(e,g+f,m-f)}(e.scale,e.model,t.scale)}))}}this._updateScale(e,this.model),r(n.x),r(n.y);var i={};(0,bn.__)(n.x,function(e){AA(n,"y",e,i)}),(0,bn.__)(n.y,function(e){AA(n,"x",e,i)}),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var r=e.getBoxLayoutParams(),i=!n&&e.get("containLabel"),o=(0,wB.dV)(r,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var a=this._axesList;function s(){(0,bn.__)(a,function(e){var t,n,r,i,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,i=(r=t.getExtent())[0]+r[1],t.toGlobalCoord="x"===t.dim?function(e){return e+n}:function(e){return i-e+n},t.toLocalCoord="x"===t.dim?function(e){return e-n}:function(e){return i-e+n}})}s(),i&&((0,bn.__)(a,function(e){if(!e.model.get(["axisLabel","inside"])){var t=function(e){var t,n,r,i=e.model,o=e.scale;if(!(!i.get(["axisLabel","show"])||o.isBlank())){var a=o.getExtent();n=o instanceof SN?o.count():(t=o.getTicks()).length;var s=e.getLabelModel(),l=S8(e),u=1;n>40&&(u=Math.ceil(n/40));for(var c=0;c<n;c+=u){var d=l(t?t[c]:{value:a[0]+c},c),h=function(e,t){var n=t*Math.PI/180,r=e.width,i=e.height,o=r*Math.abs(Math.cos(n))+Math.abs(i*Math.sin(n)),a=r*Math.abs(Math.sin(n))+Math.abs(i*Math.cos(n));return new w5.A(e.x,e.y,o,a)}(s.getTextRect(d),s.get("rotate")||0);r?r.union(h):r=h}return r}}(e);if(t){var n=e.isHorizontal()?"height":"width",r=e.model.get(["axisLabel","margin"]);o[n]-=t[n]+r,"top"===e.position?o.y+=t.height+r:"left"===e.position&&(o.x+=t.width+r)}}}),s()),(0,bn.__)(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]}(0,bn.Gv)(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var r=0,i=this._coordsList;r<i.length;r++)if(i[r].getAxis("x").index===e||i[r].getAxis("y").index===t)return i[r]},e.prototype.getCartesians=function(){return this._coordsList.slice()},e.prototype.convertToPixel=function(e,t,n){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.dataToPoint(n):r.axis?r.axis.toGlobalCoord(r.axis.dataToCoord(n)):null},e.prototype.convertFromPixel=function(e,t,n){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.pointToData(n):r.axis?r.axis.coordToData(r.axis.toLocalCoord(n)):null},e.prototype._findConvertTarget=function(e){var t,n,r=e.seriesModel,i=e.xAxisModel||r&&r.getReferringComponents("xAxis",wn.US).models[0],o=e.yAxisModel||r&&r.getReferringComponents("yAxis",wn.US).models[0],a=e.gridModel,s=this._coordsList;return r?(t=r.coordinateSystem,0>(0,bn.qh)(s,t)&&(t=null)):i&&o?t=this.getCartesian(i.componentIndex,o.componentIndex):i?n=this.getAxis("x",i.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 r=this,i=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,r){if(AS(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 Am(t,function(e,t){if(t=t||e.get("type"))switch(t){case"category":return new SN({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new SV({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(S_.getClass(t)||Sz)}}(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=i,u.index=r,i._axesList.push(u),a[t][r]=u,s[t]++}}}this._axesMap=a,(0,bn.__)(a.x,function(t,n){(0,bn.__)(a.y,function(i,o){var a="x"+n+"y"+o,s=new Aa(a);s.master=r,s.model=e,r._coordsMap[a]=s,r._coordsList.push(s),s.addAxis(t),s.addAxis(i)})})},e.prototype._updateScale=function(e,t){function n(e,t){(0,bn.__)(At(e,t.dim),function(n){t.scale.unionExtentFromData(e,n)})}(0,bn.__)(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(Ay(e)){var r=Ax(e),i=r.xAxisModel,o=r.yAxisModel;if(AS(i,t)&&AS(o,t)){var a=this.getCartesian(i.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(0,bn.__)(this.getCartesians(),function(r){var i=null!=e&&"auto"!==e?r.getAxis(e):r.getBaseAxis(),o=r.getOtherAxis(i);0>(0,bn.qh)(t,i)&&t.push(i),0>(0,bn.qh)(n,o)&&n.push(o)}),{baseAxes:t,otherAxes:n}},e.create=function(t,n){var r=[];return t.eachComponent("grid",function(i,o){var a=new e(i,t,n);a.name="grid_"+o,a.resize(i,n,!0),i.coordinateSystem=a,r.push(a)}),t.eachSeries(function(e){if(Ay(e)){var t=Ax(e),n=t.xAxisModel,r=t.yAxisModel;e.coordinateSystem=n.getCoordSysModel().coordinateSystem.getCartesian(n.componentIndex,r.componentIndex)}}),r},e.dimensions=Ai,e}();function AS(e,t){return e.getCoordSysModel()===t}function AA(e,t,n,r){n.getAxesOnZeroOf=function(){return i?[i]:[]};var i,o=e[t],a=n.model,s=a.get(["axisLine","onZero"]),l=a.get(["axisLine","onZeroAxisIndex"]);if(s){if(null!=l)AC(o[l])&&(i=o[l]);else for(var u in o)if(o.hasOwnProperty(u)&&AC(o[u])&&!r[c(o[u])]){i=o[u];break}i&&(r[c(i)]=!0)}function c(e){return e.dim+"_"+e.index}}function AC(e){var t,n,r;return e&&"category"!==e.type&&"time"!==e.type&&(n=(t=e.scale.getExtent())[0],r=t[1],!(n>0&&r>0||n<0&&r<0))}var AM=n(25744),Ak=Math.PI,AT=function(){function e(e,t){this.group=new bf.A,this.opt=t,this.axisModel=e,(0,bn.NT)(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new bf.A({x:t.position[0],y:t.position[1],rotation:t.rotation});n.updateTransform(),this._transformGroup=n}return e.prototype.hasBuilder=function(e){return!!A_[e]},e.prototype.add=function(e){A_[e](this.opt,this.axisModel,this.group,this._transformGroup)},e.prototype.getGroup=function(){return this.group},e.innerTextLayout=function(e,t,n){var r,i,o=(0,wI._7)(t-e);return(0,wI.dh)(o)?(i=n>0?"top":"bottom",r="center"):(0,wI.dh)(o-Ak)?(i=n>0?"bottom":"top",r="center"):(i="middle",r=o>0&&o<Ak?n>0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:r,textVerticalAlign:i}},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}(),A_={axisLine:function(e,t,n,r){var i=t.get(["axisLine","show"]);if("auto"===i&&e.handleAutoShown&&(i=e.handleAutoShown("axisLine")),i){var o=t.axis.getExtent(),a=r.transform,s=[o[0],0],l=[o[1],0],u=s[0]>l[0];a&&((0,wG.NW)(s,s,a),(0,wG.NW)(l,l,a));var c=(0,bn.X$)({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),d=new w_.A({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});bg.subPixelOptimizeLine(d.shape,d.style.lineWidth),d.anid="line",n.add(d);var h=t.get(["axisLine","symbol"]);if(null!=h){var p=t.get(["axisLine","symbolSize"]);(0,bn.Kg)(h)&&(h=[h,h]),((0,bn.Kg)(p)||(0,bn.Et)(p))&&(p=[p,p]);var f=(0,bK.hV)(t.get(["axisLine","symbolOffset"])||0,p),g=p[0],m=p[1];(0,bn.__)([{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,r){if("none"!==h[r]&&null!=h[r]){var i=(0,bK.v5)(h[r],-g/2,-m/2,g,m,c.stroke,!0),o=t.r+t.offset,a=u?l:s;i.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(i)}})}}},axisTickLabel:function(e,t,n,r){var i=function(e,t,n,r){var i=n.axis,o=n.getModel("axisTick"),a=o.get("show");if("auto"===a&&r.handleAutoShown&&(a=r.handleAutoShown("axisTick")),!(!a||i.scale.isBlank())){for(var s=o.getModel("lineStyle"),l=r.tickDirection*o.get("length"),u=AR(i.getTicksCoords(),t.transform,l,(0,bn.NT)(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;c<u.length;c++)e.add(u[c]);return u}}(n,r,t,e),o=function(e,t,n,r){var i=n.axis;if(!(!(0,bn.Je)(r.axisLabelShow,n.get(["axisLabel","show"]))||i.scale.isBlank())){var o=n.getModel("axisLabel"),a=o.get("margin"),s=i.getViewLabels(),l=((0,bn.Je)(r.labelRotate,o.get("rotate"))||0)*Ak/180,u=AT.innerTextLayout(r.rotation,l,r.labelDirection),c=n.getCategories&&n.getCategories(!0),d=[],h=AT.isLabelSilent(n),p=n.get("triggerEvent");return(0,bn.__)(s,function(l,f){var g="ordinal"===i.scale.type?i.scale.getRawOrdinalNumber(l.tickValue):l.tickValue,m=l.formattedLabel,v=l.rawLabel,y=o;if(c&&c[g]){var x=c[g];(0,bn.Gv)(x)&&x.textStyle&&(y=new AM.A(x.textStyle,o,n.ecModel))}var b=y.getTextColor()||n.get(["axisLine","lineStyle","color"]),w=i.dataToCoord(g),S=y.getShallow("align",!0)||u.textAlign,A=(0,bn.bZ)(y.getShallow("alignMinLabel",!0),S),C=(0,bn.bZ)(y.getShallow("alignMaxLabel",!0),S),M=y.getShallow("verticalAlign",!0)||y.getShallow("baseline",!0)||u.textVerticalAlign,k=(0,bn.bZ)(y.getShallow("verticalAlignMinLabel",!0),M),T=(0,bn.bZ)(y.getShallow("verticalAlignMaxLabel",!0),M),_=new wt.Ay({x:w,y:r.labelOffset+r.labelDirection*a,rotation:u.rotation,silent:h,z2:10+(l.level||0),style:(0,bw.VB)(y,{text:m,align:0===f?A:f===s.length-1?C:S,verticalAlign:0===f?k:f===s.length-1?T:M,fill:(0,bn.Tn)(b)?b("category"===i.type?v:"value"===i.type?g+"":g,f):b})});if(_.anid="label_"+g,p){var I=AT.makeAxisEventDataBase(n);I.targetType="axisLabel",I.value=v,I.tickIndex=f,"category"===i.type&&(I.dataIndex=g),(0,bx.z)(_).eventData=I}t.add(_),_.updateTransform(),d.push(_),e.add(_),_.decomposeTransform()}),d}}(n,r,t,e);(function(e,t,n){if(!Ae(e.axis)){var r=e.get(["axisLabel","showMinLabel"]),i=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],d=n[n.length-1],h=n[n.length-2];!1===r?(AI(o),AI(u)):AD(o,a)&&(r?(AI(a),AI(c)):(AI(o),AI(u))),!1===i?(AI(s),AI(d)):AD(l,s)&&(i?(AI(l),AI(h)):(AI(s),AI(d)))}})(t,o,i),function(e,t,n,r){var i=n.axis,o=n.getModel("minorTick");if(!(!o.get("show")||i.scale.isBlank())){var a=i.getMinorTicksCoords();if(a.length)for(var s=o.getModel("lineStyle"),l=r*o.get("length"),u=(0,bn.NT)(s.getLineStyle(),(0,bn.NT)(n.getModel("axisTick").getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])})),c=0;c<a.length;c++)for(var d=AR(a[c],t.transform,l,u,"minorticks_"+c),h=0;h<d.length;h++)e.add(d[h])}}(n,r,t,e.tickDirection),t.get(["axisLabel","hideOverlap"])&&function(e){var t=[];e.sort(function(e,t){return t.priority-e.priority});var n=new w5.A(0,0,0,0);function r(e){if(!e.ignore){var t=e.ensureState("emphasis");null==t.ignore&&(t.ignore=!1)}e.ignore=!0}for(var i=0;i<e.length;i++){var o=e[i],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 d=o.obb,h=!1,p=0;p<t.length;p++){var f=t[p];if(n.intersect(f.rect)&&(a&&f.axisAligned||(f.obb||(f.obb=new w2.A(f.localRect,f.transform)),d||(d=new w2.A(s,l)),d.intersect(f.obb)))){h=!0;break}}h?(r(u),c&&r(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 r=e[n];if(!r.defaultAttr.ignore){var i=r.label,o=i.getComputedTransform(),a=i.getBoundingRect(),s=!o||o[1]<1e-5&&o[2]<1e-5,l=i.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 w2.A(a,o):null;t.push({label:i,labelLine:r.labelLine,rect:u,localRect:a,obb:c,priority:r.priority,defaultAttr:r.defaultAttr,layoutOption:r.computedLayoutOption,axisAligned:s,transform:o})}}return t}((0,bn.Tj)(o,function(e){return{label:e,priority:e.z2,defaultAttr:{ignore:e.ignore}}})))},axisName:function(e,t,n,r){var i,o,a=(0,bn.Je)(e.axisName,t.get("name"));if(a){var s,l,u,c,d,h,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,AO(m)?e.labelOffset+v*x:0],A=t.get("nameRotate");null!=A&&(A=A*Ak/180),AO(m)?i=AT.innerTextLayout(e.rotation,null!=A?A:e.rotation,v):(s=e.rotation,l=m,u=A||0,c=b,p=(0,wI._7)(u-s),f=c[0]>c[1],g="start"===l&&!f||"start"!==l&&f,(0,wI.dh)(p-Ak/2)?(h=g?"bottom":"top",d="center"):(0,wI.dh)(p-1.5*Ak)?(h=g?"top":"bottom",d="center"):(h="middle",d=p<1.5*Ak&&p>Ak/2?g?"left":"right":g?"right":"left"),i={rotation:p,textAlign:d,textVerticalAlign:h},null!=(o=e.axisNameAvailableWidth)&&(isFinite(o=Math.abs(o/Math.sin(i.rotation)))||(o=null)));var C=y.getFont(),M=t.get("nameTruncate",!0)||{},k=M.ellipsis,T=(0,bn.Je)(e.nameTruncateMaxWidth,M.maxWidth,o),_=new wt.Ay({x:S[0],y:S[1],rotation:i.rotation,silent:AT.isLabelSilent(t),style:(0,bw.VB)(y,{text:a,font:C,overflow:"truncate",width:T,ellipsis:k,fill:y.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:y.get("align")||i.textAlign,verticalAlign:y.get("verticalAlign")||i.textVerticalAlign}),z2:1});if(bg.setTooltipConfig({el:_,componentModel:t,itemName:a}),_.__fullText=a,_.anid="name",t.get("triggerEvent")){var I=AT.makeAxisEventDataBase(t);I.targetType="axisName",I.name=a,(0,bx.z)(_).eventData=I}r.add(_),_.updateTransform(),n.add(_),_.decomposeTransform()}}};function AI(e){e&&(e.ignore=!0)}function AD(e,t){var n=e&&e.getBoundingRect().clone(),r=t&&t.getBoundingRect().clone();if(n&&r){var i=Ar.D_([]);return Ar.e$(i,i,-e.rotation),n.applyTransform(Ar.lK([],i,e.getLocalTransform())),r.applyTransform(Ar.lK([],i,t.getLocalTransform())),n.intersect(r)}}function AO(e){return"middle"===e||"center"===e}function AR(e,t,n,r,i){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&&((0,wG.NW)(a,a,t),(0,wG.NW)(s,s,t));var c=new w_.A({shape:{x1:a[0],y1:a[1],x2:s[0],y2:s[1]},style:r,z2:2,autoBatch:!0,silent:!0});bg.subPixelOptimizeLine(c.shape,c.style.lineWidth),c.anid=i+"_"+e[l].tickValue,o.push(c)}return o}function AE(e,t){return"all"===e||(0,bn.cy)(e)&&(0,bn.qh)(e,t)>=0||e===t}function AP(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[AN(e)]}function AL(e){return!!e.get(["handle","show"])}function AN(e){return e.type+"||"+e.id}var AB={},Az=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.render=function(t,n,r,i){this.axisPointerClass&&function(e){var t=AP(e);if(t){var n=t.axisPointerModel,r=t.axis.scale,i=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=r.parse(a));var s=AL(n);null==o&&(i.status=s?"show":"hide");var l=r.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),a<l[0]&&(a=l[0]),i.value=a,s&&(i.status=t.axis.scale.isBlank()?"hide":"show")}}(t),e.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(t,r,!0)},t.prototype.updateAxisPointer=function(e,t,n,r){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,r){var i=t.getAxisPointerClass(this.axisPointerClass);if(i){var o,a=(o=AP(e))&&o.axisPointerModel;a?(this._axisPointer||(this._axisPointer=new i)).render(e,a,n,r):this._disposeAxisPointer(n)}},t.prototype._disposeAxisPointer=function(e){this._axisPointer&&this._axisPointer.dispose(e),this._axisPointer=null},t.registerAxisPointerClass=function(e,t){AB[e]=t},t.getAxisPointerClass=function(e){return e&&AB[e]},t.type="axis",t}(Sc.A),AF=(0,wn.$r)(),Aj=["axisLine","axisTickLabel","axisName"],AV=["splitArea","splitLine","minorSplitLine"],AH=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="CartesianAxisPointer",n}return(0,bs.C6)(t,e),t.prototype.render=function(t,n,r,i){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new bf.A,this.group.add(this._axisGroup),t.get("show")){var a=t.getCoordSysModel(),s=Av(a,t),l=new AT(t,bn.X$({handleAutoShown:function(e){for(var n=a.coordinateSystem.getCartesians(),r=0;r<n.length;r++)if(SI(n[r].getOtherAxis(t.axis).scale))return!0;return!1}},s));bn.__(Aj,l.add,l),this._axisGroup.add(l.getGroup()),bn.__(AV,function(e){t.get([e,"show"])&&A$[e](this,this._axisGroup,t,a)},this),i&&"changeAxisOrder"===i.type&&i.isInitSort||bg.groupTransition(o,this._axisGroup,t),e.prototype.render.call(this,t,n,r,i)}},t.prototype.remove=function(){AF(this).splitAreaColors=null},t.type="cartesianAxis",t}(Az),A$={splitLine:function(e,t,n,r){var i=n.axis;if(!i.scale.isBlank()){var o=n.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color");s=bn.cy(s)?s:[s];for(var l=r.coordinateSystem.getRect(),u=i.isHorizontal(),c=0,d=i.getTicksCoords({tickModel:o}),h=[],p=[],f=a.getLineStyle(),g=0;g<d.length;g++){var m=i.toGlobalCoord(d[g].coord);u?(h[0]=m,h[1]=l.y,p[0]=m,p[1]=l.y+l.height):(h[0]=l.x,h[1]=m,p[0]=l.x+l.width,p[1]=m);var v=c++%s.length,y=d[g].tickValue,x=new w_.A({anid:null!=y?"line_"+d[g].tickValue:null,autoBatch:!0,shape:{x1:h[0],y1:h[1],x2:p[0],y2:p[1]},style:bn.NT({stroke:s[v]},f),silent:!0});bg.subPixelOptimizeLine(x.shape,f.lineWidth),t.add(x)}}},minorSplitLine:function(e,t,n,r){var i=n.axis,o=n.getModel("minorSplitLine").getModel("lineStyle"),a=r.coordinateSystem.getRect(),s=i.isHorizontal(),l=i.getMinorTicksCoords();if(l.length)for(var u=[],c=[],d=o.getLineStyle(),h=0;h<l.length;h++)for(var p=0;p<l[h].length;p++){var f=i.toGlobalCoord(l[h][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 w_.A({anid:"minor_line_"+l[h][p].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:c[0],y2:c[1]},style:d,silent:!0});bg.subPixelOptimizeLine(g.shape,d.lineWidth),t.add(g)}},splitArea:function(e,t,n,r){!function(e,t,n,r){var i=n.axis;if(!i.scale.isBlank()){var o=n.getModel("splitArea"),a=o.getModel("areaStyle"),s=a.get("color"),l=r.coordinateSystem.getRect(),u=i.getTicksCoords({tickModel:o,clamp:!0});if(u.length){var c=s.length,d=AF(e).splitAreaColors,h=bn.nt(),p=0;if(d)for(var f=0;f<u.length;f++){var g=d.get(u[f].tickValue);if(null!=g){p=(g+(c-1)*f)%c;break}}var m=i.toGlobalCoord(u[0].coord),v=a.getAreaStyle();s=bn.cy(s)?s:[s];for(var f=1;f<u.length;f++){var y=i.toGlobalCoord(u[f].coord),x=void 0,b=void 0,w=void 0,S=void 0;i.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 A=u[f-1].tickValue;null!=A&&h.set(A,p),t.add(new bv.A({anid:null!=A?"area_"+A:null,shape:{x:x,y:b,width:w,height:S},style:bn.NT({fill:s[p]},v),autoBatch:!0,silent:!0})),p=(p+1)%c}AF(e).splitAreaColors=h}}}(e,t,n,r)}},AW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.type="xAxis",t}(AH),AG=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=AW.type,t}return(0,bs.C6)(t,e),t.type="yAxis",t}(AH),AU=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="grid",t}return(0,bs.C6)(t,e),t.prototype.render=function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new bv.A({shape:e.coordinateSystem.getRect(),style:(0,bn.NT)({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))},t.type="grid",t}(Sc.A),Aq={offset:0};function AY(e){e.registerComponentView(AU),e.registerComponentModel(Sh),e.registerCoordinateSystem("cartesian2d",Aw),SM(e,"x",Sf,Aq),SM(e,"y",Sf,Aq),e.registerComponentView(AW),e.registerComponentView(AG),e.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}var AX=n(96331),AZ=n(46979),AK=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=AZ.yh.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,r,i,o){var a=this._getBrush(),s=this._getGradient(i,"inRange"),l=this._getGradient(i,"outOfRange"),u=this.pointSize+this.blurSize,c=this.canvas,d=c.getContext("2d"),h=e.length;c.width=t,c.height=n;for(var p=0;p<h;++p){var f=e[p],g=f[0],m=f[1],v=r(f[2]);d.globalAlpha=v,d.drawImage(a,g-u,m-u)}if(!c.width||!c.height)return c;for(var y=d.getImageData(0,0,c.width,c.height),x=y.data,b=0,w=x.length,S=this.minOpacity,A=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*A+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 d.putImageData(y,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=AZ.yh.createCanvas()),t=this.pointSize+this.blurSize,n=2*t;e.width=n,e.height=n;var r=e.getContext("2d");return r.clearRect(0,0,n,n),r.shadowOffsetX=n,r.shadowBlur=this.blurSize,r.shadowColor="#000",r.beginPath(),r.arc(-t,t,this.pointSize,0,2*Math.PI,!0),r.closePath(),r.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,r=n[t]||(n[t]=new Uint8ClampedArray(1024)),i=[0,0,0,0],o=0,a=0;a<256;a++)e[t](a/255,!0,i),r[o++]=i[0],r[o++]=i[1],r[o++]=i[2],r[o++]=i[3];return r},e}();function AQ(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}var AJ=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.render=function(e,t,n){t.eachComponent("visualMap",function(t){t.eachTargetSeries(function(n){n===e&&(r=t)})}),this._progressiveEls=null,this.group.removeAll();var r,i=e.coordinateSystem;"cartesian2d"===i.type||"calendar"===i.type?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):AQ(i)&&this._renderOnGeo(i,e,r,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,r){var i=t.coordinateSystem;i&&(AQ(i)?this.render(t,n,r):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(t,r,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){bg.traverseElements(this._progressiveEls||this.group,e)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,r,i){var o,a,s,l,u=e.coordinateSystem,c=bT(u,"cartesian2d");if(c){var d=u.getAxis("x"),h=u.getAxis("y");o=d.getBandWidth()+.5,a=h.getBandWidth()+.5,s=d.scale.getExtent(),l=h.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=(0,bw.lx)(e),b=e.getModel("emphasis"),w=b.get("focus"),S=b.get("blurScope"),A=b.get("disabled"),C=c?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],M=n;M<r;M++){var k=void 0,T=f.getItemVisual(M,"style");if(c){var _=f.get(C[0],M),I=f.get(C[1],M);if(isNaN(f.get(C[2],M))||isNaN(_)||isNaN(I)||_<s[0]||_>s[1]||I<l[0]||I>l[1])continue;var D=u.dataToPoint([_,I]);k=new bv.A({shape:{x:D[0]-o/2,y:D[1]-a/2,width:o,height:a},style:T})}else{if(isNaN(f.get(C[1],M)))continue;k=new bv.A({z2:1,shape:u.dataToRect([f.get(C[0],M)]).contentShape,style:T})}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"),A=R.get("disabled"),x=(0,bw.lx)(O)}k.shape.r=y;var E=e.getRawValue(M),P="-";E&&null!=E[2]&&(P=E[2]+""),(0,bw.qM)(k,x,{labelFetcher:e,labelDataIndex:M,defaultOpacity:T.opacity,defaultText:P}),k.ensureState("emphasis").style=g,k.ensureState("blur").style=m,k.ensureState("select").style=v,(0,bb.Lm)(k,w,S,A),k.incremental=i,i&&(k.states.emphasis.hoverLayer=!0),p.add(k),f.setItemGraphicEl(M,k),this._progressiveEls&&this._progressiveEls.push(k)}},t.prototype._renderOnGeo=function(e,t,n,r){var i,o,a,s,l,u,c,d=n.targetVisuals.inRange,h=n.targetVisuals.outOfRange,p=t.getData(),f=this._hmLayer||this._hmLayer||new AK;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,r.getWidth()),b=Math.min(g.height+g.y,r.getHeight()),w=x-v,S=b-y,A=[p.mapDimension("lng"),p.mapDimension("lat"),p.mapDimension("value")],C=p.mapArray(A,function(t,n,r){var i=e.dataToPoint([t,n]);return i[0]-=v,i[1]-=y,i.push(r),i}),M=n.getExtent(),k="visualMap.continuous"===n.type?(i=n.option.range,o=M[1]-M[0],i=[(i[0]-M[0])/o,(i[1]-M[0])/o],function(e){return e>=i[0]&&e<=i[1]}):(a=n.getPieceList(),s=n.option.selected,l=M[1]-M[0],u=(a=bn.Tj(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,d.color.getNormalizer(),{inRange:d.color.getColorMapper(),outOfRange:h.color.getColorMapper()},k);var T=new bJ.Ay({style:{width:w,height:S,x:v,y:y,image:f.canvas},silent:!0});this.group.add(T)},t.type="heatmap",t}(bk.A),A0=n(51907),A1=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.getInitialData=function(e,t){return(0,bu.A)(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var e=A0.A.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}(bl.A),A2=n(95056),A5=n(66282),A4=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return(0,bs.C6)(t,e),t.prototype.init=function(t,n,r){e.prototype.init.call(this,t,n,r),this._sourceManager=new A5.R(this),(0,A5.A)(this)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),(0,A5.A)(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type="dataset",t.defaultOption={seriesLayoutBy:A2.i_},t}(Sd.A),A3=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return(0,bs.C6)(t,e),t.type="dataset",t}(Sc.A),A6=["x","y","radius","angle","single"],A8=["cartesian2d","polar","singleAxis"];function A9(e){return e+"Axis"}function A7(e){var t=e.ecModel,n={infoList:[],infoMap:(0,bn.nt)()};return e.eachTargetAxis(function(e,r){var i=t.getComponent(A9(e),r);if(i){var o=i.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(i)}}}),n}var Ce=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}(),Ct=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(0,bs.C6)(t,e),t.prototype.init=function(e,t,n){var r=Cn(e);this.settledOption=r,this.mergeDefaultAndTheme(e,n),this._doInit(r)},t.prototype.mergeOption=function(e){var t=Cn(e);(0,bn.h1)(this.option,e,!0),(0,bn.h1)(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;(0,bn.__)([["start","startValue"],["end","endValue"]],function(e,r){"value"===this._rangePropMode[r]&&(t[e[0]]=n[e[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),t=this._targetAxisInfoMap=(0,bn.nt)();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(0,bn.__)(A6,function(n){var r=this.getReferringComponents(A9(n),wn.UW);if(r.specified){t=!0;var i=new Ce;(0,bn.__)(r.models,function(e){i.add(e.componentIndex)}),e.set(n,i)}},this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,r=!0,i="vertical"===t?"y":"x",o=n.findComponents({mainType:i+"Axis"});if(a(o,i),r){var o=n.findComponents({mainType:"singleAxis",filter:function(e){return e.get("orient",!0)===t}});a(o,"single")}function a(t,n){var i=t[0];if(i){var o=new Ce;if(o.add(i.componentIndex),e.set(n,o),r=!1,"x"===n||"y"===n){var a=i.getReferringComponents("grid",wn.US).models[0];a&&(0,bn.__)(t,function(e){i.componentIndex!==e.componentIndex&&a===e.getReferringComponents("grid",wn.US).models[0]&&o.add(e.componentIndex)})}}}r&&(0,bn.__)(A6,function(t){if(r){var i=n.findComponents({mainType:A9(t),filter:function(e){return"category"===e.get("type",!0)}});if(i[0]){var o=new Ce;o.add(i[0].componentIndex),e.set(t,o),r=!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");(0,bn.__)([["start","startValue"],["end","endValue"]],function(r,i){var o=null!=e[r[0]],a=null!=e[r[1]];o&&!a?t[i]="percent":!o&&a?t[i]="value":n?t[i]=n[i]:o&&(t[i]="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(A9(t),n))},this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each(function(n,r){(0,bn.__)(n.indexList,function(n){e.call(t,r,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(A9(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;(0,bn.__)([["start","startValue"],["end","endValue"]],function(r){(null!=e[r[0]]||null!=e[r[1]])&&(t[r[0]]=n[r[0]]=e[r[0]],t[r[1]]=n[r[1]]=e[r[1]])},this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;(0,bn.__)(["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(),r=0;r<n.length;r++)for(var i=n[r],o=this._targetAxisInfoMap.get(i),a=0;a<o.indexList.length;a++){var s=this.getAxisProxy(i,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}(Sd.A);function Cn(e){var t={};return(0,bn.__)(["start","end","startValue","endValue","throttle"],function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}var Cr=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.type="dataZoom.inside",t.defaultOption=(0,bd.G_)(Ct.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(Ct),Ci=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.render=function(e,t,n,r){this.dataZoomModel=e,this.ecModel=t,this.api=n},t.type="dataZoom",t}(Sc.A);function Co(e,t,n,r,i,o){e=e||0;var a,s=n[1]-n[0];if(null!=i&&(i=Cs(i,[0,s])),null!=o&&(o=Math.max(o,null!=i?i:0)),"all"===r){var l=Math.abs(t[1]-t[0]);l=Cs(l,[0,s]),i=o=Cs(l,[i,o]),r=0}t[0]=Cs(t[0],n),t[1]=Cs(t[1],n);var u=Ca(t,r);t[r]+=e;var c=i||0,d=n.slice();return u.sign<0?d[0]+=c:d[1]-=c,t[r]=Cs(t[r],d),a=Ca(t,r),null!=i&&(a.sign!==u.sign||a.span<i)&&(t[1-r]=t[r]+u.sign*i),a=Ca(t,r),null!=o&&a.span>o&&(t[1-r]=t[r]+a.sign*o),t}function Ca(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 Cs(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var Cl=n(16419),Cu=n(77250),Cc=n(31950),Cd="\0_ec_interaction_mutex";function Ch(e){return e[Cd]||(e[Cd]={})}Cc.OH({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},bn.lQ);var Cp=function(e){function t(t){var n=e.call(this)||this;n._zr=t;var r=(0,bn.oI)(n._mousedownHandler,n),i=(0,bn.oI)(n._mousemoveHandler,n),o=(0,bn.oI)(n._mouseupHandler,n),a=(0,bn.oI)(n._mousewheelHandler,n),s=(0,bn.oI)(n._pinchHandler,n);return n.enable=function(e,n){this.disable(),this._opt=(0,bn.NT)((0,bn.o8)(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==e&&(e=!0),(!0===e||"move"===e||"pan"===e)&&(t.on("mousedown",r),t.on("mousemove",i),t.on("mouseup",o)),(!0===e||"scale"===e||"zoom"===e)&&(t.on("mousewheel",a),t.on("pinch",s))},n.disable=function(){t.off("mousedown",r),t.off("mousemove",i),t.off("mouseup",o),t.off("mousewheel",a),t.off("pinch",s)},n}return(0,bs.C6)(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(!Cu.W5(e)){for(var t=e.target;t;){if(t.draggable)return;t=t.__hostTarget||t.parent}var n=e.offsetX,r=e.offsetY;this.pointerChecker&&this.pointerChecker(e,n,r)&&(this._x=n,this._y=r,this._dragging=!0)}},t.prototype._mousemoveHandler=function(e){if(!(!this._dragging||!Cm("moveOnMouseMove",e,this._opt)||"pinch"===e.gestureEvent||Ch(this._zr).globalPan)){var t=e.offsetX,n=e.offsetY,r=this._x,i=this._y;this._x=t,this._y=n,this._opt.preventDefaultMouseMove&&Cu.ds(e.event),Cg(this,"pan","moveOnMouseMove",e,{dx:t-r,dy:n-i,oldX:r,oldY:i,newX:t,newY:n,isAvailableBehavior:null})}},t.prototype._mouseupHandler=function(e){Cu.W5(e)||(this._dragging=!1)},t.prototype._mousewheelHandler=function(e){var t=Cm("zoomOnMouseWheel",e,this._opt),n=Cm("moveOnMouseWheel",e,this._opt),r=e.wheelDelta,i=Math.abs(r),o=e.offsetX,a=e.offsetY;if(0!==r&&(t||n)){if(t){var s=i>3?1.4:i>1?1.2:1.1;Cf(this,"zoom","zoomOnMouseWheel",e,{scale:r>0?s:1/s,originX:o,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(r);Cf(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(r>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:o,originY:a,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){if(!Ch(this._zr).globalPan){var t=e.pinchScale>1?1.1:1/1.1;Cf(this,"zoom",null,e,{scale:t,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})}},t}(Cl.A);function Cf(e,t,n,r,i){e.pointerChecker&&e.pointerChecker(r,i.originX,i.originY)&&(Cu.ds(r.event),Cg(e,t,n,r,i))}function Cg(e,t,n,r,i){i.isAvailableBehavior=(0,bn.oI)(Cm,null,n,r),e.trigger(t,i)}function Cm(e,t,n){var r=n[e];return!e||r&&(!(0,bn.Kg)(r)||t.event[r+"Key"])}var Cv=(0,wn.$r)();function Cy(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function Cx(e,t){e.isDisposed()||e.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:t})}function Cb(e,t,n,r){return e.coordinateSystem.containPoint([n,r])}var Cw=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return(0,bs.C6)(t,e),t.prototype.render=function(t,n,r){var i;(e.prototype.render.apply(this,arguments),t.noTarget())?this._clear():(this.range=t.getPercentRange(),i={pan:(0,bn.oI)(CS.pan,this),zoom:(0,bn.oI)(CS.zoom,this),scrollMove:(0,bn.oI)(CS.scrollMove,this)},Cv(r).coordSysRecordMap.each(function(e){var n=e.dataZoomInfoMap.get(t.uid);n&&(n.getRange=i)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){!function(e,t){for(var n=Cv(e).coordSysRecordMap,r=n.keys(),i=0;i<r.length;i++){var o=r[i],a=n.get(o),s=a.dataZoomInfoMap;if(s){var l=t.uid;s.get(l)&&(s.removeKey(l),s.keys().length||Cy(n,a))}}}(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(Ci),CS={zoom:function(e,t,n,r){var i=this.range,o=i.slice(),a=e.axisModels[0];if(a){var s=CC[t](null,[r.originX,r.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/r.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Co(0,o,[0,100],0,c.minSpan,c.maxSpan),this.range=o,i[0]!==o[0]||i[1]!==o[1])return o}},pan:CA(function(e,t,n,r,i,o){var a=CC[r]([o.oldX,o.oldY],[o.newX,o.newY],t,i,n);return a.signal*(e[1]-e[0])*a.pixel/a.pixelLength}),scrollMove:CA(function(e,t,n,r,i,o){return CC[r]([0,0],[o.scrollDelta,o.scrollDelta],t,i,n).signal*(e[1]-e[0])*o.scrollDelta})};function CA(e){return function(t,n,r,i){var o=this.range,a=o.slice(),s=t.axisModels[0];if(s&&(Co(e(a,s,t,n,r,i),a,[0,100],"all"),this.range=a,o[0]!==a[0]||o[1]!==a[1]))return a}}var CC={grid:function(e,t,n,r,i){var o=n.axis,a={},s=i.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,r,i){var o=n.axis,a={},s=i.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,r,i){var o=n.axis,a=i.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}},CM=bn.__,Ck=wI.Y6,CT=function(){function e(e,t,n,r){this._dimName=e,this._axisIndex=t,this.ecModel=r,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(n=t.get("coordinateSystem"),(0,bn.qh)(A8,n)>=0){var n,r=A9(this._dimName),i=t.getReferringComponents(r,wn.US).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 bn.o8(this._minMaxSpan)},e.prototype.calculateDataWindow=function(e){var t,n=this._dataExtent,r=this.getAxisModel().axis.scale,i=this._dataZoomModel.getRangePropMode(),o=[0,100],a=[],s=[];CM(["start","end"],function(l,u){var c=e[l],d=e[l+"Value"];"percent"===i[u]?(null==c&&(c=o[u]),d=r.parse(wI.Cb(c,o,n))):(t=!0,d=null==d?n[u]:r.parse(d),c=wI.Cb(d,n,o)),s[u]=null==d||isNaN(d)?n[u]:d,a[u]=null==c||isNaN(c)?o[u]:c}),Ck(s),Ck(a);var l=this._minMaxSpan;function u(e,t,n,i,o){var a=o?"Span":"ValueSpan";Co(0,e,n,"all",l["min"+a],l["max"+a]);for(var s=0;s<2;s++)t[s]=wI.Cb(e[s],n,i,!0),o&&(t[s]=r.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,r,i,o,a=this.getTargetSeriesModels();this._dataExtent=(t=this,n=this._dimName,r=[1/0,-1/0],CM(a,function(e){var t;t=e.getData(),t&&bn.__(At(t,n),function(e){var n=t.getApproximateExtent(e);n[0]<r[0]&&(r[0]=n[0]),n[1]>r[1]&&(r[1]=n[1])})}),[(o=S5((i=t.getAxisModel()).axis.scale,i,r).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,r=this.getTargetSeriesModels(),i=e.get("filterMode"),o=this._valueWindow;"none"!==i&&CM(r,function(e){var t=e.getData(),r=t.mapDimensionsAll(n);if(r.length){if("weakFilter"===i){var a=t.getStore(),s=bn.Tj(r,function(e){return t.getDimensionIndex(e)},t);t.filterSelf(function(e){for(var t,n,i,l=0;l<r.length;l++){var u=a.get(s[l],e),c=!isNaN(u),d=u<o[0],h=u>o[1];if(c&&!d&&!h)return!0;c&&(i=!0),d&&(t=!0),h&&(n=!0)}return i&&t&&n})}else CM(r,function(n){if("empty"===i)e.setData(t=t.map(n,function(e){var t;return(t=e)>=o[0]&&t<=o[1]?e:NaN}));else{var r={};r[n]=o,t.selectRange(r)}});CM(r,function(e){t.setApproximateExtent(o,e)})}})}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;CM(["min","max"],function(r){var i=t.get(r+"Span"),o=t.get(r+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?i=wI.Cb(n[0]+o,n,[0,100],!0):null!=i&&(o=wI.Cb(i,[0,100],n,!0)-n[0]),e[r+"Span"]=i,e[r+"ValueSpan"]=o},this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var r=wI.hb(n,[0,500]);r=Math.min(r,20);var i=e.axis.scale.rawExtentInfo;0!==t[0]&&i.setDeterminedMinMax("min",+n[0].toFixed(r)),100!==t[1]&&i.setDeterminedMinMax("max",+n[1].toFixed(r)),i.freeze()}},e}();let C_={getTargetSeries:function(e){function t(t){e.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(r,i){var o=e.getComponent(A9(r),i);t(r,i,o,n)})})}t(function(e,t,n,r){n.__dzAxisProxy=null});var n=[];t(function(t,r,i,o){i.__dzAxisProxy||(i.__dzAxisProxy=new CT(t,r,o,e),n.push(i.__dzAxisProxy))});var r=(0,bn.nt)();return(0,bn.__)(n,function(e){(0,bn.__)(e.getTargetSeriesModels(),function(e){r.set(e.uid,e)})}),r},overallReset:function(e,t){e.eachComponent("dataZoom",function(e){e.eachTargetAxis(function(t,n){e.getAxisProxy(t,n).reset(e)}),e.eachTargetAxis(function(n,r){e.getAxisProxy(n,r).filterData(e,t)})}),e.eachComponent("dataZoom",function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),r=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:r[0],endValue:r[1]})}})}};var CI=!1;function CD(e){CI||(CI=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,C_),e.registerAction("dataZoom",function(e,t){var n=function(e,t){var n,r=(0,bn.nt)(),i=[],o=(0,bn.nt)();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 i=r.get(e);i&&i[n]&&(t=!0)}),t)&&(s(e),n=!0)}function s(e){o.set(e.uid,!0),i.push(e),e.eachTargetAxis(function(e,t){(r.get(e)||r.set(e,[]))[t]=!0})}return i}(t,e);(0,bn.__)(n,function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})}),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function CO(e){CD(e),e.registerComponentModel(Cr),e.registerComponentView(Cw),e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(e,t){var n=Cv(t),r=n.coordSysRecordMap||(n.coordSysRecordMap=(0,bn.nt)());r.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(e){var n=A7(e);(0,bn.__)(n.infoList,function(n){var i,o,a,s=n.model.uid,l=r.get(s)||r.set(s,(a=(o={model:i=n.model,containsPoint:(0,bn.cF)(Cb,i),dispatchAction:(0,bn.cF)(Cx,t),dataZoomInfoMap:null,controller:null}).controller=new Cp(t.getZr()),(0,bn.__)(["pan","zoom","scrollMove"],function(e){a.on(e,function(t){var n=[];o.dataZoomInfoMap.each(function(r){if(t.isAvailableBehavior(r.model.option)){var i=(r.getRange||{})[e],a=i&&i(r.dzReferCoordSysInfo,o.model.mainType,o.controller,t);!r.model.get("disabled",!0)&&a&&n.push({dataZoomId:r.model.id,start:a[0],end:a[1]})}}),n.length&&o.dispatchAction(n)})}),o));(l.dataZoomInfoMap||(l.dataZoomInfoMap=(0,bn.nt)())).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})})}),r.each(function(e){var t,n,i,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 Cy(r,e);var c=(n="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0,l.each(function(e){var r=e.model,a=!r.get("disabled",!0)&&(!r.get("zoomLock",!0)||"move");i[n+a]>i[n+t]&&(t=a),o=o&&r.get("preventDefaultMouseMove",!0)}),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o}});s.enable(c.controlType,c.opt),s.setPointerChecker(e.containsPoint),bS.N(e,"dispatchAction",a.model.get("throttle",!0),"fixRate")})})}var CR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=(0,bd.G_)(Ct.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}(Ct),CE=n(97451),CP=bv.A,CL="horizontal",CN="vertical",CB=["line","bar","candlestick","scatter"],Cz={easing:"cubicOut",duration:100,delay:0},CF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return(0,bs.C6)(t,e),t.prototype.init=function(e,t){this.api=t,this._onBrush=(0,bn.oI)(this._onBrush,this),this._onBrushEnd=(0,bn.oI)(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){if(e.prototype.render.apply(this,arguments),bS.N(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}i&&"dataZoom"===i.type&&i.from===this.uid||this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){bS.IU(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 bf.A;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"),r=this._findCoordRect(),i={width:t.getWidth(),height:t.getHeight()},o=this._orient===CL?{right:i.width-r.x-r.width,top:i.height-30-7-7*!!n,width:r.width,height:30}:{right:7,top:r.y,width:30,height:r.height},a=wB.vs(e.option);(0,bn.__)(["right","top","width","height"],function(e){"ph"===a[e]&&(a[e]=o[e])});var s=wB.dV(a,i);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===CN&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==CL||i?n===CL&&i?{scaleY:a?1:-1,scaleX:-1}:n!==CN||i?{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,r=e.get("brushSelect");n.add(new CP({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var i=new CP({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:(0,bn.oI)(this._onClickPanel,this)}),o=this.api.getZr();r?(i.on("mousedown",this._onBrushStart,this),i.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],e){var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),o=r.getShadowDim&&r.getShadowDim(),a=o&&i.getDimensionInfo(o)?r.getShadowDim():e.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(i!==this._shadowData||a!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var u,c=i.getDataExtent(a),d=(c[1]-c[0])*.3;c=[c[0]-d,c[1]+d];var h=[0,t[1]],p=[0,t[0]],f=[[t[0],0],[0,0]],g=[],m=p[1]/(i.count()-1),v=0,y=Math.round(i.count()/t[0]);i.each([a],function(e,t){if(y>0&&t%y){v+=m;return}var n=null==e||isNaN(e)||""===e,r=n?0:(0,wI.Cb)(e,c,h,!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,r]),g.push([v,r]),v+=m,u=n}),s=this._shadowPolygonPts=f,l=this._shadowPolylinePts=g}this._shadowData=i,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 bf.A,r=new CE.A({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),i=new w$.A({shape:{points:l},segmentIgnoreThreshold:1,style:t.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),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 r=this.ecModel;return t.eachTargetAxis(function(i,o){var a=t.getAxisProxy(i,o).getTargetSeriesModels();(0,bn.__)(a,function(t){if(!e&&!(!0!==n&&0>(0,bn.qh)(CB,t.get("type")))){var a,s=r.getComponent(A9(i),o).axis,l={x:"y",y:"x",radius:"angle",angle:"radius"}[i],u=t.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=t.getData().mapDimension(l),e={thisAxis:s,series:t,thisDim:i,otherDim:l,otherAxisInverse:a}}},this)},this),e}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=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 CP({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});i.add(c),i.add(new CP({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)"}})),(0,bn.__)([0,1],function(t){var o=a.get("handleIcon");!bK.$V[o]&&0>o.indexOf("path://")&&0>o.indexOf("image://")&&(o="path://"+o);var s=(0,bK.v5)(o,-1,0,2,2,null,!0);s.attr({cursor:Cj(this._orient),draggable:!0,drift:(0,bn.oI)(this._onDragMove,this,t),ondragend:(0,bn.oI)(this._onDragEnd,this),onmouseover:(0,bn.oI)(this._showDataInfo,this,!0),onmouseout:(0,bn.oI)(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=a.get("handleSize");this._handleHeight=(0,wI.lo)(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(),(0,bb.iJ)(s);var c=a.get("handleColor");null!=c&&(s.style.fill=c),i.add(n[t]=s);var d=a.getModel("textStyle");e.add(r[t]=new wt.Ay({silent:!0,invisible:!0,style:(0,bw.VB)(d,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:d.getTextColor(),font:d.getFont()}),z2:10}))},this);var d=c;if(u){var h=(0,wI.lo)(a.get("moveHandleSize"),o[1]),p=t.moveHandle=new bv.A({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:h}}),f=.8*h,g=t.moveHandleIcon=(0,bK.v5)(a.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=o[1]+h/2-.5,p.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(o[1]/2,Math.max(h,10));(d=t.moveZone=new bv.A({invisible:!0,shape:{y:o[1]-m,height:h+m}})).on("mouseover",function(){s.enterEmphasis(p)}).on("mouseout",function(){s.leaveEmphasis(p)}),i.add(p),i.add(g),i.add(d)}d.attr({draggable:!0,cursor:Cj(this._orient),drift:(0,bn.oI)(this._onDragMove,this,"all"),ondragstart:(0,bn.oI)(this._showDataInfo,this,!0),ondragend:(0,bn.oI)(this._onDragEnd,this),onmouseover:(0,bn.oI)(this._showDataInfo,this,!0),onmouseout:(0,bn.oI)(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[(0,wI.Cb)(e[0],[0,100],t,!0),(0,wI.Cb)(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];Co(t,r,i,n.get("zoomLock")?"all":e,null!=o.minSpan?(0,wI.Cb)(o.minSpan,a,i,!0):null,null!=o.maxSpan?(0,wI.Cb)(o.maxSpan,a,i,!0):null);var s=this._range,l=this._range=(0,wI.Y6)([(0,wI.Cb)(r[0],i,a,!0),(0,wI.Cb)(r[1],i,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=(0,wI.Y6)(n.slice()),i=this._size;(0,bn.__)([0,1],function(e){var r=t.handles[e],o=this._handleHeight;r.attr({scaleX:o/2,scaleY:o/2,x:n[e]+(e?-1:1),y:i[1]/2-o/2})},this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var o={x:r[0],width:r[1]-r[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,r[0],r[1],i[0]],l=0;l<a.length;l++){var u=a[l],c=u.getClipPath();c||(c=new bv.A,u.setClipPath(c)),c.setShape({x:s[l],y:0,width:s[l+1]-s[l],height:i[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,r=n.handleLabels,i=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=(0,wI.Y6)(this._handleEnds.slice());function d(e){var t=bg.getTransform(n.handles[e].parent,this.group),a=bg.transformDirection(0===e?"right":"left",t),s=this._handleWidth/2+5,l=bg.applyTransform([c[e]+(0===e?-s:s),this._size[1]/2],t);r[e].setStyle({x:l[0],y:l[1],verticalAlign:i===CL?"middle":a,align:i===CL?a:"center",text:o[e]})}d.call(this,0),d.call(this,1)},t.prototype._formatLabel=function(e,t){var n=this.dataZoomModel,r=n.get("labelFormatter"),i=n.get("labelPrecision");(null==i||"auto"===i)&&(i=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(i,20));return(0,bn.Tn)(r)?r(e,o):(0,bn.Kg)(r)?r.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,r){this._dragging=!0,Cu.ds(r.event);var i=this._displayables.sliderGroup.getLocalTransform(),o=bg.applyTransform([t,n],i,!0),a=this._updateInterval(e,o[0]),s=this.dataZoomModel.get("realtime");this._updateView(!s),a&&s&&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 r=this._handleEnds,i=(r[0]+r[1])/2,o=this._updateInterval("all",n[0]-i);this._updateView(),o&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new wW.A(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 r=this._getViewExtent(),i=[0,100];this._range=(0,wI.Y6)([(0,wI.Cb)(n.x,r,i,!0),(0,wI.Cb)(n.x+n.width,r,i,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(Cu.ds(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new CP({silent:!0,style:r.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(i)),i.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),i.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?Cz:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=A7(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:.2*r,y:.2*i,width:.6*r,height:.6*i}}return e},t.type="dataZoom.slider",t}(Ci);function Cj(e){return"vertical"===e?"ns-resize":"ew-resize"}function CV(e){e.registerComponentModel(CR),e.registerComponentView(CF),CD(e)}var CH=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(0,bs.C6)(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"]),bn.cy(t)&&bn.__(t,function(e,r){var i;bn.Kg(e)&&(e={type:e}),t[r]=bn.h1(e,"all"===(i=e.type)?{type:"all",title:n.getLocaleModel().get(["legend","selector","all"])}:"inverse"===i?{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 r=e[n].get("name");if(this.isSelected(r)){this.select(r),t=!0;break}}t||this.select(e[0].get("name"))}},t.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries(function(r){var i,o=r.name;if(n.push(o),r.legendVisualProvider){var a=r.legendVisualProvider.getAllNames();e.isSeriesFiltered(r)||(n=n.concat(a)),a.length?t=t.concat(a):i=!0}else i=!0;i&&(0,wn.O0)(r)&&t.push(r.name)}),this._availableNames=n;var r=this.get("data")||t,i=bn.nt(),o=bn.Tj(r,function(e){return((bn.Kg(e)||bn.Et(e))&&(e={name:e}),i.get(e.name))?null:(i.set(e.name,!0),new AM.A(e,this,this.ecModel))},this);this._data=bn.pb(o,function(e){return!!e})},t.prototype.getData=function(){return this._data},t.prototype.select=function(e){var t=this.option.selected;if("single"===this.get("selectedMode")){var n=this._data;bn.__(n,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;bn.__(e,function(e){t[e.get("name",!0)]=!0})},t.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;bn.__(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])&&bn.qh(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}(Sd.A);function C$(e,t){var n=wp.QX(t.get("padding")),r=t.getItemStyle(["color","opacity"]);return r.fill=t.get("backgroundColor"),e=new bv.A({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:r,silent:!0,z2:-1})}var CW=n(34780),CG=bn.cF,CU=bn.__,Cq=bf.A,CY=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return(0,bs.C6)(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new Cq),this.group.add(this._selectorGroup=new Cq),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 r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var i=e.get("align"),o=e.get("orient");i&&"auto"!==i||(i="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(i,e,t,n,a,o,s);var l=e.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),d=wB.dV(l,u,c),h=this.layoutInner(e,i,d,r,a,s),p=wB.dV(bn.NT({width:h.width,height:h.height},l),u,c);this.group.x=p.x-h.x,this.group.y=p.y-h.y,this.group.markRedraw(),this.group.add(this._backgroundEl=C$(h,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,r,i,o,a){var s=this.getContentGroup(),l=bn.nt(),u=t.get("selectedMode"),c=[];n.eachRawSeries(function(e){e.get("legendHoverLink")||c.push(e.id)}),CU(t.getData(),function(i,o){var a=i.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var d=new Cq;d.newline=!0,s.add(d);return}var h=n.getSeriesByName(a)[0];if(!l.get(a))if(h){var p=h.getData(),f=p.getVisual("legendLineStyle")||{},g=p.getVisual("legendIcon"),m=p.getVisual("style"),v=this._createItem(h,a,o,i,t,e,f,m,g,u,r);v.on("click",CG(CX,a,null,r,c)).on("mouseover",CG(CK,h.name,null,r,c)).on("mouseout",CG(CQ,h.name,null,r,c)),n.ssr&&v.eachChild(function(e){var t=(0,bx.z)(e);t.seriesIndex=h.seriesIndex,t.dataIndex=o,t.ssrType="legend"}),l.set(a,!0)}else n.eachRawSeries(function(s){if(!l.get(a)&&s.legendVisualProvider){var d=s.legendVisualProvider;if(d.containName(a)){var h=d.indexOfName(a),p=d.getItemVisual(h,"style"),f=d.getItemVisual(h,"legendIcon"),g=(0,wf.qg)(p.fill);g&&0===g[3]&&(g[3]=.2,p=bn.X$(bn.X$({},p),{fill:(0,wf.As)(g,"rgba")}));var m=this._createItem(s,a,o,i,t,e,{},p,f,u,r);m.on("click",CG(CX,null,a,r,c)).on("mouseover",CG(CK,null,a,r,c)).on("mouseout",CG(CQ,null,a,r,c)),n.ssr&&m.eachChild(function(e){var t=(0,bx.z)(e);t.seriesIndex=s.seriesIndex,t.dataIndex=o,t.ssrType="legend"}),l.set(a,!0)}}},this)},this),i&&this._createSelector(i,t,r,o,a)},t.prototype._createSelector=function(e,t,n,r,i){var o=this.getSelectorGroup();CU(e,function(e){var r=e.type,i=new wt.Ay({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===r?"legendAllSelect":"legendInverseSelect"})}});o.add(i);var a=t.getModel("selectorLabel"),s=t.getModel(["emphasis","selectorLabel"]);(0,bw.qM)(i,{normal:a,emphasis:s},{defaultText:e.title}),(0,bb.iJ)(i)})},t.prototype._createItem=function(e,t,n,r,i,o,a,s,l,u,c){var d=e.visualDrawType,h=i.get("itemWidth"),p=i.get("itemHeight"),f=i.isSelected(t),g=r.get("symbolRotate"),m=r.get("symbolKeepAspect"),v=r.get("icon"),y=function(e,t,n,r,i,o,a){function s(e,t){"auto"===e.lineWidth&&(e.lineWidth=2*(t.lineWidth>0)),CU(e,function(n,r){"inherit"===e[r]&&(e[r]=t[r])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=0===e.lastIndexOf("empty",0)?"fill":"stroke",d=l.getShallow("decal");u.decal=d&&"inherit"!==d?(0,CW.w)(d,a):r.decal,"inherit"===u.fill&&(u.fill=r[i]),"inherit"===u.stroke&&(u.stroke=r[c]),"inherit"===u.opacity&&(u.opacity=("fill"===i?r:n).opacity),s(u,r);var h=t.getModel("lineStyle"),p=h.getLineStyle();if(s(p,n),"auto"===u.fill&&(u.fill=r.fill),"auto"===u.stroke&&(u.stroke=r.fill),"auto"===p.stroke&&(p.stroke=r.fill),!o){var f=t.get("inactiveBorderWidth"),g=u[c];u.lineWidth="auto"===f?r.lineWidth>0&&g?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),p.stroke=h.get("inactiveColor"),p.lineWidth=h.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}(l=v||l||"roundRect",r,a,s,d,f,c),x=new Cq,b=r.getModel("textStyle");if(bn.Tn(e.getLegendIcon)&&(!v||"inherit"===v))x.add(e.getLegendIcon({itemWidth:h,itemHeight:p,icon:l,iconRotate:g,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}));else{var w,S,A,C="inherit"===v&&e.getData().getVisual("symbol")?"inherit"===g?e.getData().getVisual("symbolRotate"):g:0;x.add((S=(w={itemWidth:h,itemHeight:p,icon:l,iconRotate:C,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}).icon||"roundRect",(A=(0,bK.v5)(S,0,0,w.itemWidth,w.itemHeight,w.itemStyle.fill,w.symbolKeepAspect)).setStyle(w.itemStyle),A.rotation=(w.iconRotate||0)*Math.PI/180,A.setOrigin([w.itemWidth/2,w.itemHeight/2]),S.indexOf("empty")>-1&&(A.style.stroke=A.style.fill,A.style.fill="#fff",A.style.lineWidth=2),A))}var M=i.get("formatter"),k=t;bn.Kg(M)&&M?k=M.replace("{name}",null!=t?t:""):bn.Tn(M)&&(k=M(t));var T=f?b.getTextColor():r.get("inactiveColor");x.add(new wt.Ay({style:(0,bw.VB)(b,{text:k,x:"left"===o?h+5:-5,y:p/2,fill:T,align:o,verticalAlign:"middle"},{inheritColor:T})}));var _=new bv.A({shape:x.getBoundingRect(),style:{fill:"transparent"}}),I=r.getModel("tooltip");return I.get("show")&&bg.setTooltipConfig({el:_,componentModel:i,itemName:t,itemTooltipOption:I.option}),x.add(_),x.eachChild(function(e){e.silent=!0}),_.silent=!u,this.getContentGroup().add(x),(0,bb.iJ)(x),x.__legendDataIndex=n,x},t.prototype.layoutInner=function(e,t,n,r,i,o){var a=this.getContentGroup(),s=this.getSelectorGroup();wB.aP(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(),!i)return a.x=u[0],a.y=u[1],this.group.getBoundingRect();wB.aP("horizontal",s,e.get("selectorItemGap",!0));var c=s.getBoundingRect(),d=[-c.x,-c.y],h=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?d[p]+=l[f]+h:u[p]+=c[f]+h,d[1-p]+=l[g]/2-c[g]/2,s.x=d[0],s.y=d[1],a.x=u[0],a.y=u[1];var v={x:0,y:0};return v[f]=l[f]+h+c[f],v[g]=Math.max(l[g],c[g]),v[m]=Math.min(0,c[m]+d[1-p]),v},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(Sc.A);function CX(e,t,n,r){CQ(e,t,n,r),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),CK(e,t,n,r)}function CZ(e){for(var t,n=e.getZr().storage.getDisplayList(),r=0,i=n.length;r<i&&!(t=n[r].states.emphasis);)r++;return t&&t.hoverLayer}function CK(e,t,n,r){CZ(n)||n.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:r})}function CQ(e,t,n,r){CZ(n)||n.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:r})}function CJ(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 C0(e,t,n){var r,i={},o="toggleSelected"===e;return n.eachComponent("legend",function(n){o&&null!=r?n[r?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?n[e]():(n[e](t.name),r=n.isSelected(t.name));var a=n.getData();(0,bn.__)(a,function(e){var t=e.get("name");if("\n"!==t&&""!==t){var r=n.isSelected(t);i.hasOwnProperty(t)?i[t]=i[t]&&r:i[t]=r}})}),"allSelect"===e||"inverseSelect"===e?{selected:i}:{name:t.name,selected:i}}function C1(e){e.registerComponentModel(CH),e.registerComponentView(CY),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,CJ),e.registerSubTypeDefaulter("legend",function(){return"plain"}),e.registerAction("legendToggleSelect","legendselectchanged",(0,bn.cF)(C0,"toggleSelected")),e.registerAction("legendAllSelect","legendselectall",(0,bn.cF)(C0,"allSelect")),e.registerAction("legendInverseSelect","legendinverseselect",(0,bn.cF)(C0,"inverseSelect")),e.registerAction("legendSelect","legendselected",(0,bn.cF)(C0,"select")),e.registerAction("legendUnSelect","legendunselected",(0,bn.cF)(C0,"unSelect"))}var C2=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,r){var i=(0,wB.vs)(t);e.prototype.init.call(this,t,n,r),C5(this,t,i)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),C5(this,this.option,t)},t.type="legend.scroll",t.defaultOption=(0,bd.G_)(CH.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}(CH);function C5(e,t,n){var r=e.getOrient(),i=[1,1];i[r.index]=0,(0,wB.YA)(t,n,{type:"box",ignoreSize:!!i})}var C4=bf.A,C3=["width","height"],C6=["x","y"],C8=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(0,bs.C6)(t,e),t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new C4),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new C4)},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,r,i,o,a,s){var l=this;e.prototype.renderInner.call(this,t,n,r,i,o,a,s);var u=this._controllerGroup,c=n.get("pageIconSize",!0),d=bn.cy(c)?c:[c,c];p("pagePrev",0);var h=n.getModel("pageTextStyle");function p(e,t){var r=bg.createIcon(n.get("pageIcons",!0)[n.getOrient().name][t],{onclick:bn.oI(l._pageGo,l,e+"DataIndex",n,i)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});r.name=e,u.add(r)}u.add(new wt.Ay({name:"pageText",style:{text:"xx/xx",fill:h.getTextColor(),font:h.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1)},t.prototype.layoutInner=function(e,t,n,r,i,o){var a=this.getSelectorGroup(),s=e.getOrient().index,l=C3[s],u=C6[s],c=C3[1-s],d=C6[1-s];i&&wB.aP("horizontal",a,e.get("selectorItemGap",!0));var h=e.get("selectorButtonGap",!0),p=a.getBoundingRect(),f=[-p.x,-p.y],g=bn.o8(n);i&&(g[l]=n[l]-p[l]-h);var m=this._layoutContentAndController(e,r,g,s,l,c,d,u);if(i){if("end"===o)f[s]+=m[l]+h;else{var v=p[l]+h;f[s]-=v,m[u]-=v}m[l]+=p[l]+h,f[1-s]+=m[d]+m[c]/2-p[c]/2,m[c]=Math.max(m[c],p[c]),m[d]=Math.min(m[d],p[d]+f[1-s]),a.x=f[0],a.y=f[1],a.markRedraw()}return m},t.prototype._layoutContentAndController=function(e,t,n,r,i,o,a,s){var l=this.getContentGroup(),u=this._containerGroup,c=this._controllerGroup;wB.aP(e.get("orient"),l,e.get("itemGap"),r?n.width:null,r?null:n.height),wB.aP("horizontal",c,e.get("pageButtonItemGap",!0));var d=l.getBoundingRect(),h=c.getBoundingRect(),p=this._showController=d[i]>n[i],f=[-d.x,-d.y];t||(f[r]=l[s]);var g=[0,0],m=[-h.x,-h.y],v=bn.bZ(e.get("pageButtonGap",!0),e.get("itemGap",!0));p&&("end"===e.get("pageButtonPosition",!0)?m[r]+=n[i]-h[i]:g[r]+=h[i]+v),m[1-r]+=d[o]/2-h[o]/2,l.setPosition(f),u.setPosition(g),c.setPosition(m);var y={x:0,y:0};if(y[i]=p?n[i]:d[i],y[o]=Math.max(d[o],h[o]),y[a]=Math.min(0,h[a]+m[1-r]),u.__rectSize=n[i],p){var x={x:0,y:0};x[i]=Math.max(n[i]-h[i]-v,0),x[o]=y[o],u.setClipPath(new bv.A({shape:x})),u.__rectSize=x[i]}else c.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return null!=b.pageIndex&&bm.oi(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 r=this._getPageInfo(t)[e];null!=r&&n.dispatchAction({type:"legendScroll",scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;bn.__(["pagePrev","pageNext"],function(r){var i=null!=t[r+"DataIndex"],o=n.childOfName(r);o&&(o.setStyle("fill",i?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),o.cursor=i?"pointer":"default")});var r=n.childOfName("pageText"),i=e.get("pageFormatter"),o=t.pageIndex,a=null!=o?o+1:0,s=t.pageCount;r&&i&&r.setStyle("text",bn.Kg(i)?i.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):i({current:a,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,o=C3[i],a=C6[i],s=this._findTargetItemIndex(t),l=n.children(),u=l[s],c=l.length,d=+!!c,h={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return h;var p=y(u);h.contentPosition[i]=-p.s;for(var f=s+1,g=p,m=p,v=null;f<=c;++f)(!(v=y(l[f]))&&m.e>g.s+r||v&&!x(v,g.s))&&(g=m.i>g.i?m:v)&&(null==h.pageNextDataIndex&&(h.pageNextDataIndex=g.i),++h.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==h.pagePrevDataIndex&&(h.pagePrevDataIndex=g.i),++h.pageCount,++h.pageIndex),g=v;return h;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+r}},t.prototype._findTargetItemIndex=function(e){var t,n;return this._showController?(this.getContentGroup().eachChild(function(r,i){var o=r.__legendDataIndex;null==n&&null!=o&&(n=i),o===e&&(t=i)}),null!=t?t:n):0},t.type="legend.scroll",t}(CY);function C9(e){(0,Si.Y)(C1),e.registerComponentModel(C2),e.registerComponentView(C8),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 C7=(0,wn.$r)(),Me=bn.o8,Mt=bn.oI;function Mn(e,t,n,r){!function e(t,n){if(!(bn.Gv(t)&&bn.Gv(n)))return t===n;var r=!0;return bn.__(n,function(n,i){r=r&&e(t[i],n)}),!!r}(C7(n).lastProp,r)&&(C7(n).lastProp=r,t?bm.oi(n,r,e):(n.stopAnimation(),n.attr(r)))}function Mr(e,t){e[t.get(["label","show"])?"show":"hide"]()}function Mi(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function Mo(e,t,n){var r=t.get("z"),i=t.get("zlevel");e&&e.traverse(function(e){"group"!==e.type&&(null!=r&&(e.z=r),null!=i&&(e.zlevel=i),e.silent=n)})}function Ma(e,t,n,r,i){e=t.scale.parse(e);var o=t.scale.getLabel({value:e},{precision:i.precision}),a=i.formatter;if(a){var s={value:S9(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};bn.__(r,function(e){var t=n.getSeriesByIndex(e.seriesIndex),r=e.dataIndexInside,i=t&&t.getDataParams(r);i&&s.seriesData.push(i)}),bn.Kg(a)?o=a.replace("{value}",o):bn.Tn(a)&&(o=a(s))}return o}function Ms(e,t,n){var r=Ar.vt();return Ar.e$(r,r,n.rotation),Ar.Tl(r,r,n.position),bg.applyTransform([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}var Ml=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,bs.C6)(t,e),t.prototype.makeElOption=function(e,t,n,r,i){var o,a,s,l,u,c,d,h,p,f,g,m,v,y,x,b,w,S,A,C=n.axis,M=C.grid,k=r.get("type"),T=Mu(M,C).getOtherAxis(C).getGlobalExtent(),_=C.toGlobalCoord(C.dataToCoord(t,!0));if(k&&"none"!==k){var I,D,O,R=(D=r.get("type"),O=r.getModel(D+"Style"),"line"===D?(I=O.getLineStyle()).fill=null:"shadow"===D&&((I=O.getAreaStyle()).stroke=null),I),E=Mc[k](C,_,T);E.style=R,e.graphicKey=E.type,e.pointer=E}var P=Av(M.model,n);d=AT.innerTextLayout(P.rotation,0,P.labelDirection),P.labelMargin=r.get(["label","margin"]),h={position:Ms(n.axis,t,P),align:d.textAlign,verticalAlign:d.textVerticalAlign},p=Ma(r.get("value"),n.axis,n.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),f=r.getModel("label"),g=wp.QX(f.get("padding")||0),m=f.getFont(),v=bI.NO(p,m),y=h.position,x=v.width+g[1]+g[3],b=v.height+g[0]+g[2],"right"===(w=h.align)&&(y[0]-=x),"center"===w&&(y[0]-=x/2),"bottom"===(S=h.verticalAlign)&&(y[1]-=b),"middle"===S&&(y[1]-=b/2),o=y,a=x,s=b,u=(l=i).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),(A=f.get("backgroundColor"))&&"auto"!==A||(A=n.get(["axisLine","lineStyle","color"])),e.label={x:y[0],y:y[1],style:(0,bw.VB)(f,{text:p,font:m,fill:f.getTextColor(),padding:g,backgroundColor:A}),z2:10}},t.prototype.getHandleTransform=function(e,t,n){var r=Av(t.axis.grid.model,t,{labelInside:!1});r.labelMargin=n.get(["handle","margin"]);var i=Ms(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,o=i.grid,a=i.getGlobalExtent(!0),s=Mu(o,i).getOtherAxis(i).getGlobalExtent(),l=+("x"!==i.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,d=[c,c];return d[l]=u[l],{x:u[0],y:u[1],rotation:e.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},t}(function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,r){var i=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,r||this._lastValue!==i||this._lastStatus!==o){this._lastValue=i,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,i,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 d=bn.cF(Mn,t,c);this.updatePointerEl(a,l,d),this.updateLabelEl(a,l,d,t)}else a=this._group=new bf.A,this.createPointerEl(a,l,e,t),this.createLabelEl(a,l,e,t),n.getZr().add(a);Mo(a,t,!0),this._renderHandle(i)}},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"),r=e.axis,i="category"===r.type,o=t.get("snap");if(!o&&!i)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(i&&r.getBandWidth()>a)return!0;if(o){var s=AP(e).seriesDataCount,l=r.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},e.prototype.makeElOption=function(e,t,n,r,i){},e.prototype.createPointerEl=function(e,t,n,r){var i=t.pointer;if(i){var o=C7(e).pointerEl=new bg[i.type](Me(t.pointer));e.add(o)}},e.prototype.createLabelEl=function(e,t,n,r){if(t.label){var i=C7(e).labelEl=new wt.Ay(Me(t.label));e.add(i),Mr(i,r)}},e.prototype.updatePointerEl=function(e,t,n){var r=C7(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),n(r,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,r){var i=C7(e).labelEl;i&&(i.setStyle(t.label.style),n(i,{x:t.label.x,y:t.label.y}),Mr(i,r))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t,n=this._axisPointerModel,r=this._api.getZr(),i=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a){i&&r.remove(i),this._handle=null;return}this._handle||(t=!0,i=this._handle=bg.createIcon(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){Cu.ds(e.event)},onmousedown:Mt(this._onHandleDragMove,this,0,0),drift:Mt(this._onHandleDragMove,this),ondragend:Mt(this._onHandleDragEnd,this)}),r.add(i)),Mo(i,n,!1),i.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");bn.cy(s)||(s=[s,s]),i.scaleX=s[0]/2,i.scaleY=s[1]/2,bS.N(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},e.prototype._moveHandleToValue=function(e,t){Mn(this._axisPointerModel,!t&&this._moveAnimation,this._handle,Mi(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(Mi(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(Mi(r)),C7(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,r=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),bS.IU(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 Mu(e,t){var n={};return n[t.dim+"AxisIndex"]=t.index,e.getCartesian(n)}var Mc={line:function(e,t,n){var r,i,o;return{type:"Line",subPixelOptimize:!0,shape:(r=[t,n[0]],i=[t,n[1]],{x1:r[o=(o=Md(e))||0],y1:r[1-o],x2:i[o],y2:i[1-o]})}},shadow:function(e,t,n){var r,i,o,a=Math.max(1,e.getBandWidth()),s=n[1]-n[0];return{type:"Rect",shape:(r=[t-a/2,n[0]],i=[a,s],{x:r[o=(o=Md(e))||0],y:r[1-o],width:i[o],height:i[1-o]})}}};function Md(e){return+("x"!==e.dim)}var Mh=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(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}(Sd.A),Mp=n(35209),Mf=(0,wn.$r)(),Mg=bn.__;function Mm(e,t,n){if(!Mp.A.node){var r=t.getZr();Mf(r).records||(Mf(r).records={}),function(e,t){Mf(e).initialized||(Mf(e).initialized=!0,n("click",bn.cF(My,"click")),n("mousemove",bn.cF(My,"mousemove")),n("globalout",Mv));function n(n,r){e.on(n,function(n){var i,o,a,s,l,u,c,d,h=(i=t,o={showTip:[],hideTip:[]},{dispatchAction:a=function(e){var t=o[e.type];t?t.push(e):(e.dispatchAction=a,i.dispatchAction(e))},pendings:o});Mg(Mf(e).records,function(e){e&&r(e,n,h.dispatchAction)}),s=h.pendings,l=t,c=s.showTip.length,d=s.hideTip.length,c?u=s.showTip[c-1]:d&&(u=s.hideTip[d-1]),u&&(u.dispatchAction=null,l.dispatchAction(u))})}}(r,t),(Mf(r).records[e]||(Mf(r).records[e]={})).handler=n}}function Mv(e,t,n){e.handler("leave",null,n)}function My(e,t,n,r){t.handler(e,n,r)}function Mx(e,t){if(!Mp.A.node){var n=t.getZr();(Mf(n).records||{})[e]&&(Mf(n).records[e]=null)}}var Mb=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.render=function(e,t,n){var r=t.getComponent("tooltip"),i=e.get("triggerOn")||r&&r.get("triggerOn")||"mousemove|click";Mm("axisPointer",n,function(e,t,n){"none"!==i&&("leave"===e||i.indexOf(e)>=0)&&n({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})})},t.prototype.remove=function(e,t){Mx("axisPointer",t)},t.prototype.dispose=function(e,t){Mx("axisPointer",t)},t.type="axisPointer",t}(Sc.A);function Mw(e,t){var n,r=[],i=e.seriesIndex;if(null==i||!(n=t.getSeriesByIndex(i)))return{point:[]};var o=n.getData(),a=wn.le(o,e);if(null==a||a<0||bn.cy(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)r=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(e.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u).dim,d=u.dim,h=+("x"===c||"radius"===c),p=o.mapDimension(d),f=[];f[h]=o.get(p,a),f[1-h]=o.get(o.getCalculationInfo("stackResultDimension"),a),r=l.dataToPoint(f)||[]}else r=l.dataToPoint(o.getValues(bn.Tj(l.dimensions,function(e){return o.mapDimension(e)}),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),r=[g.x+g.width/2,g.y+g.height/2]}return{point:r,el:s}}var MS=(0,wn.$r)();function MA(e,t,n){var r=e.currTrigger,i=[e.x,e.y],o=e.dispatchAction||(0,bn.oI)(n.dispatchAction,n),a=t.getComponent("axisPointer").coordSysAxesInfo;if(a){M_(i)&&(i=Mw({seriesIndex:e.seriesIndex,dataIndex:e.dataIndex},t).point);var s,l,u,c,d,h,p,f,g,m,v,y=M_(i),x=e.axesInfo,b=a.axesInfo,w="leave"===r||M_(i),S={},A={},C={list:[],map:{}},M={showPointer:(0,bn.cF)(MM,A),showTooltip:(0,bn.cF)(Mk,C)};(0,bn.__)(a.coordSysMap,function(e,t){var n=y||e.containPoint(i);(0,bn.__)(a.coordSysAxesInfo[t],function(e,t){var r=e.axis,o=function(e,t){for(var n=0;n<(e||[]).length;n++){var r=e[n];if(t.axis.dim===r.axisDim&&t.axis.model.componentIndex===r.axisIndex)return r}}(x,e);if(!w&&n&&(!x||o)){var a=o&&o.value;null!=a||y||(a=r.pointToData(i)),null!=a&&MC(e,a,M,!1,S)}})});var k={};return(0,bn.__)(b,function(e,t){var n=e.linkGroup;n&&!A[t]&&(0,bn.__)(n.axesInfo,function(t,r){var i=A[r];if(t!==e&&i){var o=i.value;n.mapper&&(o=e.axis.scale.parse(n.mapper(o,MT(t),MT(e)))),k[e.key]=o}})}),(0,bn.__)(k,function(e,t){MC(b[t],e,M,!0,S)}),s=A,l=b,u=S.axesInfo=[],(0,bn.__)(l,function(e,t){var n=e.axisPointerModel.option,r=s[t];r?(e.useHandle||(n.status="show"),n.value=r.value,n.seriesDataIndices=(r.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,r){if(M_(t)||!e.list.length)return r({type:"hideTip"});var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}(C,i,e,o),c=b,h=(d=n).getZr(),p="axisPointerLastHighlights",f=MS(h)[p]||{},g=MS(h)[p]={},(0,bn.__)(c,function(e,t){var n=e.axisPointerModel.option;"show"===n.status&&e.triggerEmphasis&&(0,bn.__)(n.seriesDataIndices,function(e){g[e.seriesIndex+" | "+e.dataIndex]=e})}),m=[],v=[],(0,bn.__)(f,function(e,t){g[t]||v.push(e)}),(0,bn.__)(g,function(e,t){f[t]||m.push(e)}),v.length&&d.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:v}),m.length&&d.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:m}),S}}function MC(e,t,n,r,i){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,d,h,p,f=(a=t,u=(l=(s=e).axis).dim,c=a,d=[],h=Number.MAX_VALUE,p=-1,(0,bn.__)(s.seriesModels,function(e,t){var n,r,i=e.getData().mapDimensionsAll(u);if(e.getAxisTooltipData){var o=e.getAxisTooltipData(i,a,l);r=o.dataIndices,n=o.nestestValue}else{if(!(r=e.getData().indicesOfNearest(i[0],a,"category"===l.type?.5:null)).length)return;n=e.getData().get(i[0],r[0])}if(null!=n&&isFinite(n)){var s=a-n,f=Math.abs(s);f<=h&&((f<h||s>=0&&p<0)&&(h=f,p=s,c=n,d.length=0),(0,bn.__)(r,function(t){d.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:d,snapToValue:c}),g=f.payloadBatch,m=f.snapToValue;g[0]&&null==i.seriesIndex&&(0,bn.X$)(i,g[0]),!r&&e.snap&&o.containData(m)&&null!=m&&(t=m),n.showPointer(e,t,g),n.showTooltip(e,f,m)}}function MM(e,t,n,r){e[t.key]={value:n,payloadBatch:r}}function Mk(e,t,n,r){var i=n.payloadBatch,o=t.axis,a=o.model,s=t.axisPointerModel;if(t.triggerTooltip&&i.length){var l=t.coordSys.model,u=AN(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:r,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function MT(e){var t=e.axis.model,n={},r=n.axisDim=e.axis.dim;return n.axisIndex=n[r+"AxisIndex"]=t.componentIndex,n.axisName=n[r+"AxisName"]=t.name,n.axisId=n[r+"AxisId"]=t.id,n}function M_(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}function MI(e){Az.registerAxisPointerClass("CartesianAxisPointer",Ml),e.registerComponentModel(Mh),e.registerComponentView(Mb),e.registerPreprocessor(function(e){if(e){e.axisPointer&&0!==e.axisPointer.length||(e.axisPointer={});var t=e.axisPointer.link;t&&!(0,bn.cy)(t)&&(e.axisPointer.link=[t])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(e,t){var n,r,i,o,a,s,l,u,c;e.getComponent("axisPointer").coordSysAxesInfo=(r=n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}},i=e,o=t,a=i.getComponent("tooltip"),l=(s=i.getComponent("axisPointer")).get("link",!0)||[],u=[],(0,bn.__)(o.getCoordinateSystems(),function(e){if(e.axisPointerEnabled){var t=AN(e.model),n=r.coordSysAxesInfo[t]={};r.coordSysMap[t]=e;var o=e.model.getModel("tooltip",a);if((0,bn.__)(e.getAxes(),(0,bn.cF)(p,!1,null)),e.getTooltipAxes&&a&&o.get("show")){var c="axis"===o.get("trigger"),d="cross"===o.get(["axisPointer","type"]),h=e.getTooltipAxes(o.get(["axisPointer","axis"]));(c||d)&&(0,bn.__)(h.baseAxes,(0,bn.cF)(p,!d||"cross",c)),d&&(0,bn.__)(h.otherAxes,(0,bn.cF)(p,"cross",!1))}}function p(t,a,c){var d=c.model.getModel("axisPointer",s),h=d.get("show");if(h&&("auto"!==h||t||AL(d))){null==a&&(a=d.get("triggerTooltip"));var p=(d=t?function(e,t,n,r,i,o){var a=t.getModel("axisPointer"),s={};(0,bn.__)(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(e){s[e]=(0,bn.o8)(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"===i){var u=a.get(["label","show"]);if(l.show=null==u||u,!o){var c=s.lineStyle=a.get("crossStyle");c&&(0,bn.NT)(l,c.textStyle)}}return e.model.getModel("axisPointer",new AM.A(s,n,r))}(c,o,s,i,t,a):d).get("snap"),f=d.get("triggerEmphasis"),g=AN(c.model),m=a||p||"category"===c.type,v=r.axesInfo[g]={key:g,axis:c,coordSys:e,axisPointerModel:d,triggerTooltip:a,triggerEmphasis:f,involveSeries:m,snap:p,useHandle:AL(d),seriesModels:[],linkGroup:null};n[g]=v,r.seriesInvolved=r.seriesInvolved||m;var y=function(e,t){for(var n=t.model,r=t.dim,i=0;i<e.length;i++){var o=e[i]||{};if(AE(o[r+"AxisId"],n.id)||AE(o[r+"AxisIndex"],n.componentIndex)||AE(o[r+"AxisName"],n.name))return i}}(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),r=e.get(["tooltip","show"],!0);t&&"none"!==n&&!1!==n&&"item"!==n&&!1!==r&&!1!==e.get(["axisPointer","show"],!0)&&(0,bn.__)(c.coordSysAxesInfo[AN(t.model)],function(n){var r=n.axis;t.getAxis(r.dim)===r&&(n.seriesModels.push(e),null==n.seriesDataCount&&(n.seriesDataCount=0),n.seriesDataCount+=e.getData().count())})})),n)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},MA)}var MD=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(0,bs.C6)(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}(Sd.A),MO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get("show")){var r=this.group,i=e.getModel("textStyle"),o=e.getModel("subtextStyle"),a=e.get("textAlign"),s=bn.bZ(e.get("textBaseline"),e.get("textVerticalAlign")),l=new wt.Ay({style:(0,bw.VB)(i,{text:e.get("text"),fill:i.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=e.get("subtext"),d=new wt.Ay({style:(0,bw.VB)(o,{text:c,fill:o.getTextColor(),y:u.height+e.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),h=e.get("link"),p=e.get("sublink"),f=e.get("triggerEvent",!0);l.silent=!h&&!f,d.silent=!p&&!f,h&&l.on("click",function(){(0,wp.JW)(h,"_"+e.get("target"))}),p&&d.on("click",function(){(0,wp.JW)(p,"_"+e.get("subtarget"))}),(0,bx.z)(l).eventData=(0,bx.z)(d).eventData=f?{componentType:"title",componentIndex:e.componentIndex}:null,r.add(l),c&&r.add(d);var g=r.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=(0,wB.dV)(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"),r.x=v.x,r.y=v.y,r.markRedraw();var y={align:a,verticalAlign:s};l.setStyle(y),d.setStyle(y),g=r.getBoundingRect();var x=v.margin,b=e.getItemStyle(["color","opacity"]);b.fill=e.get("backgroundColor");var w=new bv.A({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});r.add(w)}},t.type="title",t}(Sc.A),MR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.type="dataZoom.select",t}(Ct),ME=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.type="dataZoom.select",t}(Ci);function MP(e){e.registerComponentModel(MR),e.registerComponentView(ME),CD(e)}var ML=function(){},MN={},MB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;bn.__(this.option.feature,function(e,n){var r=MN[n];r&&(r.getDefaultOption&&(r.defaultOption=r.getDefaultOption(t)),bn.h1(e,r.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}(Sd.A),Mz=n(31393),MF=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,bs.C6)(t,e),t.prototype.render=function(e,t,n,r){var i=this.group;if(i.removeAll(),e.get("show")){var o,a,s,l,u=+e.get("itemSize"),c="vertical"===e.get("orient"),d=e.get("feature")||{},h=this._features||(this._features={}),p=[];bn.__(d,function(e,t){p.push(t)}),new Mz.A(this._featureNames||[],p).add(f).update(f).remove(bn.cF(f,null)).execute(),this._featureNames=p,o=e.getBoxLayoutParams(),a=e.get("padding"),s={width:n.getWidth(),height:n.getHeight()},l=(0,wB.dV)(o,s,a),(0,wB.aP)(e.get("orient"),i,e.get("itemGap"),l.width,l.height),(0,wB.m$)(i,o,s,a),i.add(C$(i.getBoundingRect(),e)),c||i.eachChild(function(e){var t=e.__title,r=e.ensureState("emphasis"),o=r.textConfig||(r.textConfig={}),a=e.getTextContent(),s=a&&a.ensureState("emphasis");if(s&&!bn.Tn(s)&&t){var l=s.style||(s.style={}),c=bI.NO(t,wt.Ay.makeFont(l)),d=e.x+i.x,h=e.y+i.y+u,p=!1;h+c.height>n.getHeight()&&(o.position="top",p=!0);var f=p?-5-c.height:u+10;d+c.width/2>n.getWidth()?(o.position=["100%",f],l.align="right"):d-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,A=p[o],C=p[a],M=d[A],k=new AM.A(M,e,e.ecModel);if(r&&null!=r.newTitle&&r.featureName===A&&(M.title=r.newTitle),A&&!C){if(0===A.indexOf("my"))S={onclick:k.option.onclick,featureName:A};else{var T=MN[A];if(!T)return;S=new T}h[A]=S}else if(!(S=h[C]))return;S.uid=(0,bd.$Q)("toolbox-feature"),S.model=k,S.ecModel=t,S.api=n;var _=S instanceof ML;if(!A&&C){_&&S.dispose&&S.dispose(t,n);return}if(!k.get("show")||_&&S.unusable){_&&S.remove&&S.remove(t,n);return}s=k,l=S,f=A,v=s.getModel("iconStyle"),y=s.getModel(["emphasis","iconStyle"]),x=l instanceof ML&&l.getIcons?l.getIcons():s.get("icon"),b=s.get("title")||{},bn.Kg(x)?(g={})[f]=x:g=x,bn.Kg(b)?(m={})[f]=b:m=b,w=s.iconPaths={},bn.__(g,function(r,o){var a=bg.createIcon(r,{},{x:-u/2,y:-u/2,width:u,height:u});a.setStyle(v.getItemStyle()),a.ensureState("emphasis").style=y.getItemStyle();var d=new wt.Ay({style:{text:m[o],align:y.get("textAlign"),borderRadius:y.get("textBorderRadius"),padding:y.get("textPadding"),fill:null,font:(0,bw.c8)({fontStyle:y.get("textFontStyle"),fontFamily:y.get("textFontFamily"),fontSize:y.get("textFontSize"),fontWeight:y.get("textFontWeight")},t)},ignore:!0});a.setTextContent(d),bg.setTooltipConfig({el:a,componentModel:e,itemName:o,formatterParamsExtra:{title:m[o]}}),a.__title=m[o],a.on("mouseover",function(){var t=y.getItemStyle(),r=c?null==e.get("right")&&"right"!==e.get("left")?"right":"left":null==e.get("bottom")&&"bottom"!==e.get("top")?"bottom":"top";d.setStyle({fill:y.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:y.get("textBackgroundColor")}),a.setTextConfig({position:y.get("textPosition")||r}),d.ignore=!e.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){"emphasis"!==s.get(["iconStatus",o])&&n.leaveEmphasis(this),d.hide()}),("emphasis"===s.get(["iconStatus",o])?bb.HY:bb.SD)(a),i.add(a),a.on("click",bn.oI(l.onclick,l,t,n,o)),w[o]=a}),k.setIconStatus=function(e,t){var n=this.option,r=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,r[e]&&("emphasis"===t?bb.HY:bb.SD)(r[e])},S instanceof ML&&S.render&&S.render(k,t,n,r)}},t.prototype.updateView=function(e,t,n,r){bn.__(this._features,function(e){e instanceof ML&&e.updateView&&e.updateView(e.model,t,n,r)})},t.prototype.remove=function(e,t){bn.__(this._features,function(n){n instanceof ML&&n.remove&&n.remove(e,t)}),this.group.removeAll()},t.prototype.dispose=function(e,t){bn.__(this._features,function(n){n instanceof ML&&n.dispose&&n.dispose(e,t)})},t.type="toolbox",t}(Sc.A),Mj=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,bs.C6)(t,e),t.prototype.onclick=function(e,t){var n=this.model,r=n.get("name")||e.get("title.0.text")||"echarts",i="svg"===t.getZr().painter.getType(),o=i?"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=Mp.A.browser;if((0,bn.Tn)(MouseEvent)&&(s.newEdge||!s.ie&&!s.edge)){var l=document.createElement("a");l.download=r+"."+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||i){var c=a.split(","),d=c[0].indexOf("base64")>-1,h=i?decodeURIComponent(c[1]):c[1];d&&(h=window.atob(h));var p=r+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var f=h.length,g=new Uint8Array(f);f--;)g[f]=h.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(h),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=r}},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}(ML),MV="__ec_magicType_stack__",MH=[["line","bar"],["stack"]],M$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,bs.C6)(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return bn.__(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 r,i=this.model,o=i.get(["seriesIndex",n]);if(MW[n]){var a={series:[]};bn.__(MH,function(e){bn.qh(e,n)>=0&&bn.__(e,function(e){i.setIconStatus(e,"normal")})}),i.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(e){var t=e.subType,r=e.id,o=MW[n](t,r,e,i);o&&(bn.NT(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,wn.US).models[0].componentIndex;a[u]=a[u]||[];for(var d=0;d<=c;d++)a[u][c]=a[u][c]||{};a[u][c].boundaryGap="bar"===n}}});var s=n;"stack"===n&&(r=bn.h1({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(s="tiled")),t.dispatchAction({type:"changeMagicType",currentType:s,newOption:a,newTitle:r,featureName:"magicType"})}},t}(ML),MW={line:function(e,t,n,r){if("bar"===e)return bn.h1({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","line"])||{},!0)},bar:function(e,t,n,r){if("line"===e)return bn.h1({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","bar"])||{},!0)},stack:function(e,t,n,r){var i=n.get("stack")===MV;if("line"===e||"bar"===e)return r.setIconStatus("stack",i?"normal":"emphasis"),bn.h1({id:t,stack:i?"":MV},r.get(["option","stack"])||{},!0)}};Cc.OH({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var MG=Array(60).join("-");function MU(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var Mq=RegExp("[ ]+","g"),MY=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,bs.C6)(t,e),t.prototype.onclick=function(e,t){setTimeout(function(){t.dispatchAction({type:"hideTip"})});var n,r,i,o,a,s,l,u=t.getDom(),c=this.model;this._dom&&u.removeChild(this._dom);var d=document.createElement("div");d.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",d.style.backgroundColor=c.get("backgroundColor")||"#fff";var h=document.createElement("h4"),p=c.get("lang")||[];h.innerHTML=p[0]||c.get("title"),h.style.cssText="margin:10px 20px",h.style.color=c.get("textColor");var f=document.createElement("div"),g=document.createElement("textarea");f.style.cssText="overflow:auto";var m=c.get("optionToContent"),v=c.get("contentToOption"),y=(l=(n={},r=[],i=[],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:[]},i.push({axisDim:o.dim,axisIndex:o.index})),n[a].series.push(e)}else r.push(e)}else r.push(e)}),{seriesGroupByCategoryAxis:n,other:r,meta:i}),{value:bn.pb([(o=l.seriesGroupByCategoryAxis,a=[],bn.__(o,function(e,t){var n=e.categoryAxis,r=e.valueAxis.dim,i=[" "].concat(bn.Tj(e.series,function(e){return e.name})),o=[n.model.getCategories()];bn.__(e.series,function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(r),function(e){return e}))});for(var s=[i.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"+MG+"\n\n")),(s=l.other,bn.Tj(s,function(e){var t=e.getRawData(),n=[e.name],r=[];return t.each(t.dimensions,function(){for(var e=arguments.length,i=arguments[e-1],o=t.getName(i),a=0;a<e-1;a++)r[a]=arguments[a];n.push((o?o+" ":"")+r.join(" "))}),n.join("\n")}).join("\n\n"+MG+"\n\n"))],function(e){return!!e.replace(/[\n\t\s]/g,"")}).join("\n\n"+MG+"\n\n"),meta:l.meta});if(bn.Tn(m)){var x=m(t.getOption());bn.Kg(x)?f.innerHTML=x:bn.n_(x)&&f.appendChild(x)}else{g.readOnly=c.get("readOnly");var b=g.style;b.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",b.color=c.get("textColor"),b.borderColor=c.get("textareaBorderColor"),b.backgroundColor=c.get("textareaColor"),g.value=y.value,f.appendChild(g)}var w=y.meta,S=document.createElement("div");S.style.cssText="position:absolute;bottom:5px;left:0;right:0";var A="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",C=document.createElement("div"),M=document.createElement("div");A+=";background-color:"+c.get("buttonColor")+";color:"+c.get("buttonTextColor");var k=this;function T(){u.removeChild(d),k._dom=null}(0,Cu.q2)(C,"click",T),(0,Cu.q2)(M,"click",function(){var e,n,r,i;if(null==v&&null!=m||null!=v&&null==m)return void T();try{bn.Tn(v)?e=v(f,t.getOption()):(n=g.value,r=n.split(RegExp("\n*"+MG+"\n*","g")),i={series:[]},bn.__(r,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=MU(t.shift()).split(Mq),r=[],i=bn.Tj(n,function(e){return{name:e,data:[]}}),o=0;o<t.length;o++){var a=MU(t[o]).split(Mq);r.push(a.shift());for(var s=0;s<a.length;s++)i[s]&&(i[s].data[o]=a[s])}return{series:i,categories:r}}(e),r=w[t],o=r.axisDim+"Axis";r&&(i[o]=i[o]||[],i[o][r.axisIndex]={data:n.categories},i.series=i.series.concat(n.series))}else{var n=function(e){for(var t=e.split(/\n+/g),n=MU(t.shift()),r=[],i=0;i<t.length;i++){var o=MU(t[i]);if(o){var a=o.split(Mq),s="",l=void 0,u=!1;isNaN(a[0])?(u=!0,s=a[0],a=a.slice(1),r[i]={name:s,value:[]},l=r[i].value):l=r[i]=[];for(var c=0;c<a.length;c++)l.push(+a[c]);1===l.length&&(u?r[i].value=l[0]:r[i]=l[0])}}return{name:n,data:r}}(e);i.series.push(n)}}),e=i)}catch(e){throw T(),Error("Data view format error "+e)}e&&t.dispatchAction({type:"changeDataView",newOption:e}),T()}),C.innerHTML=p[1],M.innerHTML=p[2],M.style.cssText=C.style.cssText=A,c.get("readOnly")||S.appendChild(M),S.appendChild(C),d.appendChild(h),d.appendChild(f),d.appendChild(S),f.style.height=u.clientHeight-80+"px",u.appendChild(d),this._dom=d},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}(ML);Cc.OH({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(e,t){var n=[];bn.__(e.newOption.series,function(e){var r=t.getSeriesByName(e.name)[0];if(r){var i,o=r.get("data");n.push({name:e.name,data:(i=e.data,bn.Tj(i,function(e,t){var n=o&&o[t];if(!bn.Gv(n)||bn.cy(n))return e;bn.Gv(e)&&!bn.cy(e)||(e={value:e});var r=null!=n.name&&null==e.name;return e=bn.NT(e,n),r&&delete e.name,e}))})}else n.push(bn.X$({type:"scatter"},e))}),t.mergeOption(bn.NT({series:n},e.newOption))});var MX=bn.__,MZ=(0,wn.$r)();function MK(e){var t=MZ(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var MQ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,bs.C6)(t,e),t.prototype.onclick=function(e,t){MZ(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}(ML);Cc.OH({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var MJ=Math.min,M0=Math.max,M1=Math.pow,M2="globalPan",M5={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},M4={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},M3={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},M6=0,M8=function(e){function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},n._zr=t,n.group=new bf.A,n._uid="brushController_"+M6++,(0,bn.__)(kC,function(e,t){this._handlers[t]=(0,bn.oI)(e,this)},n),n}return(0,bs.C6)(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,Ch(n)[M2]=t),(0,bn.__)(this._handlers,function(e,t){n.on(t,e)}),this._brushType=e.brushType,this._brushOption=(0,bn.h1)((0,bn.o8)(M3),e,!0)},t.prototype._doDisableBrush=function(){var e,t,n=this._zr;e=this._uid,(t=Ch(n))[M2]===e&&(t[M2]=null),(0,bn.__)(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={};(0,bn.__)(e,function(e){t[e.panelId]=(0,bn.o8)(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=(0,bn.Tj)(e,function(e){return(0,bn.h1)((0,bn.o8)(M3),e,!0)});var t=this._covers,n=this._covers=[],r=this,i=this._creatingCover;return new Mz.A(t,e,function(e,t){return o(e.__brushOption,t)},o).add(a).update(a).remove(function(e){t[e]!==i&&r.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]===i)n[o]=t[a];else{var l=n[o]=null!=a?(t[a].__brushOption=s,t[a]):M7(r,M9(r,s));kn(r,l)}}},t.prototype.unmount=function(){return this.enableBrush(!1),ka(this),this._zr.remove(this.group),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(Cl.A);function M9(e,t){var n=kk[t.brushType].createCover(e,t);return n.__brushOption=t,kt(n,t),e.group.add(n),n}function M7(e,t){var n=kr(t);return n.endCreating&&(n.endCreating(e,t),kt(t,t.__brushOption)),t}function ke(e,t){var n=t.__brushOption;kr(t).updateCoverShape(e,t,n.range,n)}function kt(e,t){var n=t.z;null==n&&(n=1e4),e.traverse(function(e){e.z=n,e.z2=n})}function kn(e,t){kr(t).updateCommon(e,t),ke(e,t)}function kr(e){return kk[e.__brushOption.brushType]}function ki(e,t,n){var r,i=e._panels;if(!i)return!0;var o=e._transform;return(0,bn.__)(i,function(e){e.isTargetByCursor(t,n,o)&&(r=e)}),r}function ko(e,t){var n=e._panels;if(!n)return!0;var r=t.__brushOption.panelId;return null==r||n[r]}function ka(e){var t=e._covers,n=t.length;return(0,bn.__)(t,function(t){e.group.remove(t)},e),t.length=0,!!n}function ks(e,t){var n=(0,bn.Tj)(e._covers,function(e){var t=e.__brushOption,n=(0,bn.o8)(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}});e.trigger("brush",{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function kl(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function ku(e,t,n,r){var i=new bf.A;return i.add(new bv.A({name:"main",style:kp(n),silent:!0,draggable:!0,cursor:"move",drift:(0,bn.cF)(km,e,t,i,["n","s","w","e"]),ondragend:(0,bn.cF)(ks,t,{isEnd:!0})})),(0,bn.__)(r,function(n){i.add(new bv.A({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:(0,bn.cF)(km,e,t,i,n),ondragend:(0,bn.cF)(ks,t,{isEnd:!0})}))}),i}function kc(e,t,n,r){var i=r.brushStyle.lineWidth||0,o=M0(i,6),a=n[0][0],s=n[1][0],l=a-i/2,u=s-i/2,c=n[0][1],d=n[1][1],h=c-o+i/2,p=d-o+i/2,f=c-a,g=d-s,m=f+i,v=g+i;kh(e,t,"main",a,s,f,g),r.transformable&&(kh(e,t,"w",l,u,o,v),kh(e,t,"e",h,u,o,v),kh(e,t,"n",l,u,m,o),kh(e,t,"s",l,p,m,o),kh(e,t,"nw",l,u,o,o),kh(e,t,"ne",h,u,o,o),kh(e,t,"sw",l,p,o,o),kh(e,t,"se",h,p,o,o))}function kd(e,t){var n=t.__brushOption,r=n.transformable,i=t.childAt(0);i.useStyle(kp(n)),i.attr({silent:!r,cursor:r?"move":"default"}),(0,bn.__)([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(n){var i,o,a,s=t.childOfName(n.join("")),l=1===n.length?kg(e,n[0]):(("e"===(a=[kg(i=e,(o=n)[0]),kg(i,o[1])])[0]||"w"===a[0])&&a.reverse(),a.join(""));s&&s.attr({silent:!r,invisible:!r,cursor:r?M4[l]+"-resize":null})})}function kh(e,t,n,r,i,o,a){var s,l,u,c=t.childOfName(n);c&&c.setShape((l=MJ((s=kx(e,t,[[r,i],[r+o,i+a]]))[0][0],s[1][0]),{x:l,y:u=MJ(s[0][1],s[1][1]),width:M0(s[0][0],s[1][0])-l,height:M0(s[0][1],s[1][1])-u}))}function kp(e){return(0,bn.NT)({strokeNoScale:!0},e.brushStyle)}function kf(e,t,n,r){var i=[MJ(e,n),MJ(t,r)],o=[M0(e,n),M0(t,r)];return[[i[0],o[0]],[i[1],o[1]]]}function kg(e,t){return({left:"w",right:"e",top:"n",bottom:"s"})[bg.transformDirection({w:"left",e:"right",n:"top",s:"bottom"}[t],bg.getTransform(e.group))]}function km(e,t,n,r,i,o){var a=n.__brushOption,s=e.toRectRange(a.range),l=ky(t,i,o);(0,bn.__)(r,function(e){var t=M5[e];s[t[0]][t[1]]+=l[t[0]]}),a.range=e.fromRectRange(kf(s[0][0],s[1][0],s[0][1],s[1][1])),kn(t,n),ks(t,{isEnd:!1})}function kv(e,t,n,r){var i=t.__brushOption.range,o=ky(e,n,r);(0,bn.__)(i,function(e){e[0]+=o[0],e[1]+=o[1]}),kn(e,t),ks(e,{isEnd:!1})}function ky(e,t,n){var r=e.group,i=r.transformCoordToLocal(t,n),o=r.transformCoordToLocal(0,0);return[i[0]-o[0],i[1]-o[1]]}function kx(e,t,n){var r=ko(e,t);return r&&!0!==r?r.clipPath(n,e._transform):(0,bn.o8)(n)}function kb(e){var t=e.event;t.preventDefault&&t.preventDefault()}function kw(e,t,n){return e.childOfName("main").contain(t,n)}function kS(e,t,n,r){var i,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],r=t[0],i=n[0]-r[0],o=n[1]-r[1];return M1(i*i+o*o,.5)>6}(e)||o){if(a&&!o){"single"===s.brushMode&&ka(e);var l=(0,bn.o8)(s);l.brushType=kA(l.brushType,a),l.panelId=!0===a?null:a.panelId,o=e._creatingCover=M9(e,l),e._covers.push(o)}if(o){var u=kk[kA(e._brushType,a)];o.__brushOption.range=u.getCreatingRange(kx(e,o,e._track)),r&&(M7(e,o),u.updateCommon(e,o)),ke(e,o),i={isEnd:r}}}else r&&"single"===s.brushMode&&s.removeOnClick&&ki(e,t,n)&&ka(e)&&(i={isEnd:r,removeOnClick:!0});return i}function kA(e,t){return"auto"===e?t.defaultBrushType:e}var kC={mousedown:function(e){if(this._dragging)kM(this,e);else if(!e.target||!e.target.draggable){kb(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=ki(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,n=e.offsetY,r=this.group.transformCoordToLocal(t,n);if(!function(e,t,n){if(!(!e._brushType||(r=e,i=t.offsetX,o=t.offsetY,a=r._zr,i<0||i>a.getWidth()||o<0||o>a.getHeight()))){var r,i,o,a,s=e._zr,l=e._covers,u=ki(e,t,n);if(!e._dragging)for(var c=0;c<l.length;c++){var d=l[c].__brushOption;if(u&&(!0===u||d.panelId===u.panelId)&&kk[d.brushType].contain(l[c],n[0],n[1]))return}u&&s.setCursorStyle("crosshair")}}(this,e,r),this._dragging){kb(e);var i=kS(this,e,r,!1);i&&ks(this,i)}},mouseup:function(e){kM(this,e)}};function kM(e,t){if(e._dragging){kb(t);var n=t.offsetX,r=t.offsetY,i=e.group.transformCoordToLocal(n,r),o=kS(e,t,i,!0);e._dragging=!1,e._track=[],e._creatingCover=null,o&&ks(e,o)}}var kk={lineX:kT(0),lineY:kT(1),rect:{createCover:function(e,t){function n(e){return e}return ku({toRectRange:n,fromRectRange:n},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=kl(e);return kf(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,r){kc(e,t,n,r)},updateCommon:kd,contain:kw},polygon:{createCover:function(e,t){var n=new bf.A;return n.add(new w$.A({name:"main",style:kp(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new CE.A({name:"main",draggable:!0,drift:(0,bn.cF)(kv,e,t),ondragend:(0,bn.cF)(ks,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,r){t.childAt(0).setShape({points:kx(e,t,n)})},updateCommon:kd,contain:kw}};function kT(e){return{createCover:function(t,n){return ku({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=kl(t);return[MJ(n[0][e],n[1][e]),M0(n[0][e],n[1][e])]},updateCoverShape:function(t,n,r,i){var o,a=ko(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=[r,o];e&&l.reverse(),kc(t,n,l,i)},updateCommon:kd,contain:kw}}var k_={axisPointer:1,tooltip:1,brush:1};function kI(e){return w5.A.create(e)}var kD=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],kO=function(){function e(e,t,n){var r=this;this._targetInfoList=[];var i=kE(t,e);(0,bn.__)(kP,function(e,t){(!n||!n.include||(0,bn.qh)(n.include,t)>=0)&&e(i,r._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 r=kB[e.brushType](0,n,t);e.__rangeOffset={offset:kF[e.brushType](r.values,e.range,[1,1]),xyMinMax:r.xyMinMax}}}),e},e.prototype.matchOutputRanges=function(e,t,n){(0,bn.__)(e,function(e){var r=this.findTargetInfo(e,t);r&&!0!==r&&(0,bn.__)(r.coordSyses,function(r){var i=kB[e.brushType](1,r,e.range,!0);n(e,i.values,r,t)})},this)},e.prototype.setInputRanges=function(e,t){(0,bn.__)(e,function(e){var n=this.findTargetInfo(e,t);if(e.range=e.range||[],n&&!0!==n){e.panelId=n.panelId;var r,i,o,a,s,l=kB[e.brushType](0,n.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?kF[e.brushType](l.values,u.offset,(r=l.xyMinMax,i=u.xyMinMax,o=kV(r),a=kV(i),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(0,bn.Tj)(this._targetInfoList,function(n){var r,i,o,a,s=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:(r=kI(r=s),function(e){return bg.clipPointsByRect(e,r)}),isTargetByCursor:(i=n.coordSysModel,o=kI(s),function(t,n){var r,a;return o.contain(n[0],n[1])&&(a=(r=e.getComponentByElement(t.topTarget))&&r.coordinateSystem,!r||r===i||!!k_.hasOwnProperty(r.mainType)||!a||a.model===i)}),getLinearBrushOtherExtent:(a=kI(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 r=this.findTargetInfo(e,n);return!0===r||r&&(0,bn.qh)(r.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,r=kE(t,e),i=0;i<n.length;i++){var o=n[i],a=e.panelId;if(a){if(o.panelId===a)return o}else for(var s=0;s<kL.length;s++)if(kL[s](r,o))return o}return!0},e}();function kR(e){return e[0]>e[1]&&e.reverse(),e}function kE(e,t){return(0,wn._e)(e,t,{includeMainTypes:kD})}var kP={grid:function(e,t){var n=e.xAxisModels,r=e.yAxisModels,i=e.gridModels,o=(0,bn.nt)(),a={},s={};(n||r||i)&&((0,bn.__)(n,function(e){var t=e.axis.grid.model;o.set(t.id,t),a[t.id]=!0}),(0,bn.__)(r,function(e){var t=e.axis.grid.model;o.set(t.id,t),s[t.id]=!0}),(0,bn.__)(i,function(e){o.set(e.id,e),a[e.id]=!0,s[e.id]=!0}),o.each(function(e){var i=e.coordinateSystem,o=[];(0,bn.__)(i.getCartesians(),function(e,t){((0,bn.qh)(n,e.getAxis("x").model)>=0||(0,bn.qh)(r,e.getAxis("y").model)>=0)&&o.push(e)}),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:o[0],coordSyses:o,getPanelRect:kN.grid,xAxisDeclared:a[e.id],yAxisDeclared:s[e.id]})}))},geo:function(e,t){(0,bn.__)(e.geoModels,function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:kN.geo})})}},kL=[function(e,t){var n=e.xAxisModel,r=e.yAxisModel,i=e.gridModel;return!i&&n&&(i=n.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],kN={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(bg.getTransform(e)),t}},kB={lineX:(0,bn.cF)(kz,0),lineY:(0,bn.cF)(kz,1),rect:function(e,t,n,r){var i=e?t.pointToData([n[0][0],n[1][0]],r):t.dataToPoint([n[0][0],n[1][0]],r),o=e?t.pointToData([n[0][1],n[1][1]],r):t.dataToPoint([n[0][1],n[1][1]],r),a=[kR([i[0],o[0]]),kR([i[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(e,t,n,r){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:(0,bn.Tj)(n,function(n){var o=e?t.pointToData(n,r):t.dataToPoint(n,r);return i[0][0]=Math.min(i[0][0],o[0]),i[1][0]=Math.min(i[1][0],o[1]),i[0][1]=Math.max(i[0][1],o[0]),i[1][1]=Math.max(i[1][1],o[1]),o}),xyMinMax:i}}};function kz(e,t,n,r){var i=n.getAxis(["x","y"][e]),o=kR((0,bn.Tj)([0,1],function(e){return t?i.coordToData(i.toLocalCoord(r[e]),!0):i.toGlobalCoord(i.dataToCoord(r[e]))})),a=[];return a[e]=o,a[1-e]=[NaN,NaN],{values:o,xyMinMax:a}}var kF={lineX:(0,bn.cF)(kj,0),lineY:(0,bn.cF)(kj,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(0,bn.Tj)(e,function(e,r){return[e[0]-n[0]*t[r][0],e[1]-n[1]*t[r][1]]})}};function kj(e,t,n,r){return[t[0]-r[e]*n[0],t[1]-r[e]*n[1]]}function kV(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var kH=n(20020),k$=bn.__,kW=(0,wn.S_)("toolbox-dataZoom_"),kG=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,bs.C6)(t,e),t.prototype.render=function(e,t,n,r){var i,o,a,s,l,u,c,d,h;this._brushController||(this._brushController=new M8(n.getZr()),this._brushController.on("brush",bn.oI(this._onBrush,this)).mount()),i=e,o=t,a=this,s=r,l=n,u=a._isZoomActive,s&&"takeGlobalCursor"===s.type&&(u="dataZoomSelect"===s.key&&s.dataZoomSelectActive),a._isZoomActive=u,i.setIconStatus("zoom",u?"emphasis":"normal"),c=new kO(kq(i),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:i.getModel("brushStyle").getItemStyle()}),d=e,h=t,d.setIconStatus("back",MK(h).length>1?"emphasis":"normal")},t.prototype.onclick=function(e,t,n){kU[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,r,i,o={},a=this.ecModel;this._brushController.updateCovers([]),new kO(kq(this.model),a,{include:["grid"]}).matchOutputRanges(t,a,function(e,t,n){if("cartesian2d"===n.type){var r=e.brushType;"rect"===r?(s("x",n,t[0]),s("y",n,t[1])):s({lineX:"x",lineY:"y"}[r],n,t)}}),n=a,r=o,i=MK(n),MX(r,function(e,t){for(var r=i.length-1;r>=0&&!i[r][t];r--);if(r<0){var o=n.queryComponents({mainType:"dataZoom",subType:"select",id:t})[0];if(o){var a=o.getPercentRange();i[0][t]={dataZoomId:t,start:a[0],end:a[1]}}}}),i.push(r),this._dispatchZoomAction(o)}function s(e,t,n){var r,i,s,l=t.getAxis(e),u=l.model,c=(r=e,i=u,a.eachComponent({mainType:"dataZoom",subType:"select"},function(e){e.getAxisModel(r,i.componentIndex)&&(s=e)}),s),d=c.findRepresentativeAxisProxy(u).getMinMaxSpan();(null!=d.minValueSpan||null!=d.maxValueSpan)&&(n=Co(0,n.slice(),l.scale.getExtent(),0,d.minValueSpan,d.maxValueSpan)),c&&(o[c.id]={dataZoomId:c.id,startValue:n[0],endValue:n[1]})}},t.prototype._dispatchZoomAction=function(e){var t=[];k$(e,function(e,n){t.push(bn.o8(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}(ML),kU={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=MK(this.ecModel))[e.length-1],e.length>1&&e.pop(),n={},MX(t,function(t,r){for(var i=e.length-1;i>=0;i--)if(t=e[i][r]){n[r]=t;break}}),n))}};function kq(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}(0,kH.S)("dataZoom",function(e){var t=e.getComponent("toolbox",0),n=["feature","dataZoom"];if(t&&null!=t.get(n)){var r=t.getModel(n),i=[],o=kq(r),a=(0,wn._e)(e,o);return k$(a.xAxisModels,function(e){return s(e,"xAxis","xAxisIndex")}),k$(a.yAxisModels,function(e){return s(e,"yAxis","yAxisIndex")}),i}function s(e,t,n){var o=e.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:r.get("filterMode",!0)||"filter",id:kW+t+o};a[n]=o,i.push(a)}});var kY=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(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}(Sd.A),kX=n(26776);function kZ(e){var t=e.get("confine");return null!=t?!!t:"richText"===e.get("renderMode")}function kK(e){if(Mp.A.domSupported){for(var t=document.documentElement.style,n=0,r=e.length;n<r;n++)if(e[n]in t)return e[n]}}var kQ=kK(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),kJ=kK(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function k0(e,t){if(!e)return t;t=(0,wp.Cb)(t,!0);var n=e.indexOf(t);return(e=-1===n?t:"-"+e.slice(0,n)+"-"+t).toLowerCase()}var k1=n(56803),k2=k0(kJ,"transition"),k5=k0(kQ,"transform"),k4="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(Mp.A.transform3dSupported?"will-change:transform;":"");function k3(e,t,n){var r=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!Mp.A.transformSupported)return n?"top:"+i+";left:"+r+";":[["top",i],["left",r]];var o=Mp.A.transform3dSupported,a="translate"+(o?"3d":"")+"("+r+","+i+(o?",0":"")+")";return n?"top:0;left:0;"+k5+":"+a+";":[["top",0],["left",0],[kQ,a]]}function k6(e,t,n,r,i){var o=t&&t.painter;if(n){var a=o&&o.getViewportRoot();a&&(0,kX.lJ)(e,a,n,r,i)}else{e[0]=r,e[1]=i;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 k8=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,Mp.A.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var r=this._zr=e.getZr(),i=t.appendTo,o=i&&((0,bn.Kg)(i)?document.querySelector(i):(0,bn.n_)(i)?i:(0,bn.Tn)(i)&&i(e.getDom()));k6(this._styleCoord,r,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=r.handler,n=r.painter.getViewportRoot();(0,Cu.e0)(n,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,r=this._api.getDom(),i=(t="position",(n=r.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(r))?t?n[t]:n:null),o=r.style;"absolute"!==o.position&&"absolute"!==i&&(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,r,i,o,a,s,l,u,c,d,h,p,f,g,m,v,y,x,b,w,S,A=this.el,C=A.style,M=this._styleCoord;A.innerHTML?C.cssText=k4+(n=!this._firstShow,r=this._longHide,i=[],o=e.get("transitionDuration"),a=e.get("backgroundColor"),s=e.get("shadowBlur"),l=e.get("shadowColor"),u=e.get("shadowOffsetX"),c=e.get("shadowOffsetY"),d=e.getModel("textStyle"),h=(0,k1.CO)(e,"html"),p=u+"px "+c+"px "+s+"px "+l,i.push("box-shadow:"+p),n&&o&&i.push((g="opacity"+(f=" "+o/2+"s cubic-bezier(0.23,1,0.32,1)")+",visibility"+f,r||(f=" "+o+"s cubic-bezier(0.23,1,0.32,1)",g+=Mp.A.transformSupported?","+k5+f:",left"+f+",top"+f),k2+":"+g)),a&&i.push("background-color:"+a),(0,bn.__)(["width","color","radius"],function(t){var n="border-"+t,r=(0,wp.Cb)(n),o=e.get(r);null!=o&&i.push(n+":"+o+("color"===t?"":"px"))}),i.push((m=[],v=d.get("fontSize"),(y=d.getTextColor())&&m.push("color:"+y),m.push("font:"+d.getFont()),v&&m.push("line-height:"+Math.round(3*v/2)+"px"),x=d.get("textShadowColor"),b=d.get("textShadowBlur")||0,w=d.get("textShadowOffsetX")||0,S=d.get("textShadowOffsetY")||0,x&&b&&m.push("text-shadow:"+w+"px "+S+"px "+b+"px "+x),(0,bn.__)(["decoration","align"],function(e){var t=d.get(e);t&&m.push("text-"+e+":"+t)}),m.join(";"))),null!=h&&i.push("padding:"+(0,wp.QX)(h).join("px ")+"px"),i.join(";")+";")+k3(M[0],M[1],!0)+"border-color:"+(0,wp.he)(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,r,i){var o=this.el;if(null==e){o.innerHTML="";return}var a="";if((0,bn.Kg)(i)&&"item"===n.get("trigger")&&!kZ(n)&&(a=function(e,t,n){if(!(0,bn.Kg)(n)||"inside"===n)return"";var r,i,o=e.get("backgroundColor"),a=e.get("borderWidth");t=(0,wp.he)(t);var s=r="left"===(r=n)?"right":"right"===r?"left":"top"===r?"bottom":"top",l=Math.max(1.5*Math.round(a),6),u="",c=k5+":";(0,bn.qh)(["left","right"],s)>-1?(u+="top:50%",c+="translateY(-50%) rotate("+(i="left"===s?-225:-45)+"deg)"):(u+="left:50%",c+="translateX(-50%) rotate("+(i="top"===s?225:45)+"deg)");var d=i*Math.PI/180,h=l+a,p=h*Math.abs(Math.cos(d))+h*Math.abs(Math.sin(d));u+=";"+s+":-"+Math.round(((p-Math.SQRT2*a)/2+Math.SQRT2*a-(p-h)/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,r,i)),(0,bn.Kg)(e))o.innerHTML=e+a;else if(e){o.innerHTML="",(0,bn.cy)(e)||(e=[e]);for(var s=0;s<e.length;s++)(0,bn.n_)(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(k6(n,this._zr,this._container,e,t),null!=n[0]&&null!=n[1]){var r=this.el.style,i=k3(n[0],n[1]);(0,bn.__)(i,function(e){r[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",Mp.A.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((0,bn.oI)(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}(),k9=n(58391),k7=function(){function e(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),Tn(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,r,i){var o=this;bn.Gv(e)&&(0,k9.$8)(""),this.el&&this._zr.remove(this.el);var a=n.getModel("textStyle");this.el=new wt.Ay({style:{rich:t.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:r,textShadowColor:a.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:(0,k1.CO)(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),bn.__(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(e){o.el.style[e]=n.get(e)}),bn.__(["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=Tt(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 r=this._styleCoord;Tn(r,this._zr,e,t),e=r[0],t=r[1];var i=n.style,o=Te(i.borderWidth||0),a=Tt(i);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(bn.oI(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){this._zr.remove(this.el)},e}();function Te(e){return Math.max(0,e)}function Tt(e){var t=Te(e.shadowBlur||0),n=Te(e.shadowOffsetX||0),r=Te(e.shadowOffsetY||0);return{left:Te(t-n),right:Te(t+n),top:Te(t-r),bottom:Te(t+r)}}function Tn(e,t,n,r){e[0]=n,e[1]=r,e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var Tr=n(42345),Ti=n(26889),To=new bv.A({shape:{x:-1,y:-1,width:2,height:2}}),Ta=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.init=function(e,t){if(!Mp.A.node&&t.getDom()){var n=e.getComponent("tooltip"),r=this._renderMode=(0,wn.XJ)(n.get("renderMode"));this._tooltipContent="richText"===r?new k7(t):new k8(t,{appendTo:n.get("appendToBody",!0)?"body":n.get("appendTo",!0)})}},t.prototype.render=function(e,t,n){if(!Mp.A.node&&n.getDom()){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=n;var r=this._tooltipContent;r.update(e),r.setEnterable(e.get("enterable")),this._initGlobalListener(),this._keepShow(),"richText"!==this._renderMode&&e.get("transitionDuration")?(0,bS.N)(this,"_updatePosition",50,"fixRate"):(0,bS.IU)(this,"_updatePosition")}},t.prototype._initGlobalListener=function(){var e=this._tooltipModel.get("triggerOn");Mm("itemTooltip",this._api,(0,bn.oI)(function(t,n,r){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(n,r):"leave"===t&&this._hide(r))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,r=e.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==r&&"click"!==r){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){n.isDisposed()||i.manuallyShowTip(e,t,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,t,n,r){if(r.from!==this.uid&&!Mp.A.node&&n.getDom()){var i=Tl(r,n);this._ticket="";var o=r.dataByCoordSys,a=function(e,t,n){var r,i=(0,wn.HB)(e).queryOptionMap,o=i.keys()[0];if(o&&"series"!==o){var a=(0,wn.JO)(t,o,i.get(o),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a&&(n.getViewOfComponentModel(a).group.traverse(function(t){var n=(0,bx.z)(t).tooltipConfig;if(n&&n.name===e.name)return r=t,!0}),r))return{componentMainType:o,componentIndex:a.componentIndex,el:r}}}(r,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:r.position,positionDefault:"bottom"},i)}else if(r.tooltip&&null!=r.x&&null!=r.y)To.x=r.x,To.y=r.y,To.update(),(0,bx.z)(To).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:To},i);else if(o)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:o,tooltipOption:r.tooltipOption},i);else if(null!=r.seriesIndex){if(this._manuallyAxisShowTip(e,t,n,r))return;var l=Mw(r,t),u=l.point[0],c=l.point[1];null!=u&&null!=c&&this._tryShow({offsetX:u,offsetY:c,target:l.el,position:r.position,positionDefault:"bottom"},i)}else null!=r.x&&null!=r.y&&(n.dispatchAction({type:"updateAxisPointer",x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},i))}},t.prototype.manuallyHideTip=function(e,t,n,r){var i=this._tooltipContent;this._tooltipModel&&i.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,r.from!==this.uid&&this._hide(Tl(r,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,r){var i=r.seriesIndex,o=r.dataIndex,a=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=i&&null!=o&&null!=a){var s=t.getSeriesByIndex(i);if(s&&"axis"===Ts([s.getData().getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:i,dataIndex:o,position:r.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var r,i,o=e.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,e);else if(n){if("legend"===(0,bx.z)(n).ssrType)return;this._lastDataByCoordSys=null,(0,Ti.R)(n,function(e){return null!=(0,bx.z)(e).dataIndex?(r=e,!0):null!=(0,bx.z)(e).tooltipConfig?(i=e,!0):void 0},!0),r?this._showSeriesItemTooltip(e,r,t):i?this._showComponentItemTooltip(e,i,t):this._hide(t)}else this._lastDataByCoordSys=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get("showDelay");t=(0,bn.oI)(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,r=this._tooltipModel,i=[t.offsetX,t.offsetY],o=Ts([t.tooltipOption],r),a=this._renderMode,s=[],l=(0,k1.Qx)("section",{blocks:[],noHeader:!0}),u=[],c=new k1.lb;(0,bn.__)(e,function(e){(0,bn.__)(e.dataByAxis,function(e){var t=n.getComponent(e.axisDim+"Axis",e.axisIndex),i=e.value;if(t&&null!=i){var o=Ma(i,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),d=(0,k1.Qx)("section",{header:o,noHeader:!(0,bn.Bq)(o),sortBlocks:!0,blocks:[]});l.blocks.push(d),(0,bn.__)(e.seriesDataIndices,function(l){var h=n.getSeriesByIndex(l.seriesIndex),p=l.dataIndexInside,f=h.getDataParams(p);if(!(f.dataIndex<0)){f.axisDim=e.axisDim,f.axisIndex=e.axisIndex,f.axisType=e.axisType,f.axisId=e.axisId,f.axisValue=S9(t.axis,{value:i}),f.axisValueLabel=o,f.marker=c.makeTooltipMarker("item",(0,wp.he)(f.color),a);var g=(0,Tr.L)(h.formatTooltip(p,!0,null)),m=g.frag;if(m){var v=Ts([h],r).get("valueFormatter");d.blocks.push(v?(0,bn.X$)({valueFormatter:v},m):m)}g.text&&u.push(g.text),s.push(f)}})}})}),l.blocks.reverse(),u.reverse();var d=t.position,h=o.get("order"),p=(0,k1.Yu)(l,c,a,h,n.get("useUTC"),o.get("textStyle"));p&&u.unshift(p);var f="richText"===a?"\n\n":"<br/>",g=u.join(f);this._showOrMove(o,function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(o,d,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(o,g,s,Math.random()+"",i[0],i[1],d,null,c)})},t.prototype._showSeriesItemTooltip=function(e,t,n){var r=this._ecModel,i=(0,bx.z)(t),o=i.seriesIndex,a=r.getSeriesByIndex(o),s=i.dataModel||a,l=i.dataIndex,u=i.dataType,c=s.getData(u),d=this._renderMode,h=e.positionDefault,p=Ts([c.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,h?{position:h}:null),f=p.get("trigger");if(null==f||"item"===f){var g=s.getDataParams(l,u),m=new k1.lb;g.marker=m.makeTooltipMarker("item",(0,wp.he)(g.color),d);var v=(0,Tr.L)(s.formatTooltip(l,!1,u)),y=p.get("order"),x=p.get("valueFormatter"),b=v.frag,w=b?(0,k1.Yu)(x?(0,bn.X$)({valueFormatter:x},b):b,m,d,y,r.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 r=(0,bx.z)(t),i=r.tooltipConfig.option||{};if((0,bn.Kg)(i)){var o=i;i={content:o,formatter:o}}var a=[i],s=this._ecModel.getComponent(r.componentMainType,r.componentIndex);s&&a.push(s),a.push({formatter:i.content});var l=e.positionDefault,u=Ts(a,this._tooltipModel,l?{position:l}:null),c=u.get("content"),d=Math.random()+"",h=new k1.lb;this._showOrMove(u,function(){var n=(0,bn.o8)(u.get("formatterParams")||{});this._showTooltipContent(u,c,n,d,e.offsetX,e.offsetY,e.position,t,h)}),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,r,i,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 d=t,h=this._getNearestPoint([i,o],n,e.get("trigger"),e.get("borderColor")).color;if(c)if((0,bn.Kg)(c)){var p=e.ecModel.get("useUTC"),f=(0,bn.cy)(n)?n[0]:n,g=f&&f.axisType&&f.axisType.indexOf("time")>=0;d=c,g&&(d=(0,SF.GP)(f.axisValue,d,p)),d=(0,wp.YK)(d,n,!0)}else if((0,bn.Tn)(c)){var m=(0,bn.oI)(function(t,r){t===this._ticket&&(u.setContent(r,l,e,h,a),this._updatePosition(e,a,i,o,u,n,s))},this);this._ticket=r,d=c(n,r,m)}else d=c;u.setContent(d,l,e,h,a),u.show(e,h),this._updatePosition(e,a,i,o,u,n,s)}},t.prototype._getNearestPoint=function(e,t,n,r){return"axis"===n||(0,bn.cy)(t)?{color:r||("html"===this._renderMode?"#fff":"none")}:(0,bn.cy)(t)?void 0:{color:r||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,r,i,o,a){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=i.getSize(),c=e.get("align"),d=e.get("verticalAlign"),h=a&&a.getBoundingRect().clone();if(a&&h.applyTransform(a.transform),(0,bn.Tn)(t)&&(t=t([n,r],o,i.el,h,{viewSize:[s,l],contentSize:u.slice()})),(0,bn.cy)(t))n=(0,wI.lo)(t[0],s),r=(0,wI.lo)(t[1],l);else if((0,bn.Gv)(t)){var p=t;p.width=u[0],p.height=u[1];var f=(0,wB.dV)(p,{width:s,height:l});n=f.x,r=f.y,c=null,d=null}else if((0,bn.Kg)(t)&&a){var g=function(e,t,n,r){var i=n[0],o=n[1],a=Math.ceil(Math.SQRT2*r)+8,s=0,l=0,u=t.width,c=t.height;switch(e){case"inside":s=t.x+u/2-i/2,l=t.y+c/2-o/2;break;case"top":s=t.x+u/2-i/2,l=t.y-o-a;break;case"bottom":s=t.x+u/2-i/2,l=t.y+c+a;break;case"left":s=t.x-i-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,h,u,e.get("borderWidth"));n=g[0],r=g[1]}else{var m,v,y,x,b,w,S,A,C,M,g=(m=n,v=r,y=i,x=s,b=l,w=c?null:20,S=d?null:20,C=(A=y.getSize())[0],M=A[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],r=g[1]}if(c&&(n-=Tu(c)?u[0]/2:"right"===c?u[0]:0),d&&(r-=Tu(d)?u[1]/2:"bottom"===d?u[1]:0),kZ(e)){var k,T,_,I,D,O,R,E,g=(k=n,T=r,_=i,I=s,D=l,R=(O=_.getSize())[0],E=O[1],k=Math.min(k+R,I)-R,T=Math.min(T+E,D)-E,[k=Math.max(k,0),T=Math.max(T,0)]);n=g[0],r=g[1]}i.moveTo(n,r)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===e.length;return i&&(0,bn.__)(n,function(n,o){var a=n.dataByAxis||[],s=(e[o]||{}).dataByAxis||[];(i=i&&a.length===s.length)&&(0,bn.__)(a,function(e,n){var o=s[n]||{},a=e.seriesDataIndices||[],l=o.seriesDataIndices||[];(i=i&&e.value===o.value&&e.axisType===o.axisType&&e.axisId===o.axisId&&a.length===l.length)&&(0,bn.__)(a,function(e,t){var n=l[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),r&&(0,bn.__)(e.seriesDataIndices,function(e){var n=e.seriesIndex,o=t[n],a=r[n];o&&a&&a.data!==o.data&&(i=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=t,!!i},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,t){!Mp.A.node&&t.getDom()&&((0,bS.IU)(this,"_updatePosition"),this._tooltipContent.dispose(),Mx("itemTooltip",t))},t.type="tooltip",t}(Sc.A);function Ts(e,t,n){var r,i=t.ecModel;n?(r=new AM.A(n,i,i),r=new AM.A(t.option,r,i)):r=t;for(var o=e.length-1;o>=0;o--){var a=e[o];a&&(a instanceof AM.A&&(a=a.get("tooltip",!0)),(0,bn.Kg)(a)&&(a={formatter:a}),a&&(r=new AM.A(a,r,i)))}return r}function Tl(e,t){return e.dispatchAction||(0,bn.oI)(t.dispatchAction,t)}function Tu(e){return"center"===e||"middle"===e}var Tc={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 Td=function(e,t,n){var r=bn.o8((Tc[e]||{})[t]);return n&&bn.cy(r)?r[r.length-1]:r};var Th=bn.__,Tp=bn.Gv,Tf=function(){function e(t){var n,r,i=t.mappingMethod,o=t.type,a=this.option=bn.o8(t);this.type=o,this.mappingMethod=i,this._normalizeData=TC[i];var s=e.visualHandlers[o];this.applyVisual=s.applyVisual,this.getColorMapper=s.getColorMapper,this._normalizedToVisual=s._normalizedToVisual[i],"piecewise"===i?(Tg(a),r=(n=a).pieceList,n.hasSpecialVisual=!1,bn.__(r,function(e,t){e.originIndex=t,null!=e.visual&&(n.hasSpecialVisual=!0)})):"category"===i?a.categories?function(e){var t=e.categories,n=e.categoryMap={},r=e.visual;if(Th(t,function(e,t){n[e]=t}),!bn.cy(r)){var i=[];bn.Gv(r)?Th(r,function(e,t){var r=n[t];i[null!=r?r:-1]=e}):i[-1]=r,r=TA(e,i)}for(var o=t.length-1;o>=0;o--)null==r[o]&&(delete n[t[o]],t.pop())}(a):Tg(a,!0):(bn.vA("linear"!==i||a.dataExtent),Tg(a))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return bn.oI(this._normalizeData,this)},e.listVisualTypes=function(){return bn.HP(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){bn.Gv(e)?bn.__(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,r){var i,o=bn.cy(t)?[]:bn.Gv(t)?{}:(i=!0,null);return e.eachVisual(t,function(e,t){var a=n.call(r,e,t);i?o=a:o[t]=a}),o},e.retrieveVisuals=function(t){var n,r={};return t&&Th(e.visualHandlers,function(e,i){t.hasOwnProperty(i)&&(r[i]=t[i],n=!0)}),n?r:null},e.prepareVisualTypes=function(e){if(bn.cy(e))e=e.slice();else{if(!Tp(e))return[];var t=[];Th(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 r,i=1/0,o=0,a=t.length;o<a;o++){var s=t[o].value;if(null!=s){if(s===e||bn.Kg(s)&&s===e+"")return o;n&&A(s,o)}}for(var o=0,a=t.length;o<a;o++){var l,u,c,d,h,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(d=S[0],h=w[0],p=e,d?h<=p:h<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&&A(w[0],o),n&&A(w[1],o)}}if(n)return e===1/0?t.length-1:e===-1/0?0:r;function A(t,n){var o=Math.abs(t-e);o<i&&(i=o,r=n)}},e.visualHandlers={color:{applyVisual:Ty("color"),getColorMapper:function(){var e=this.option;return bn.oI("category"===e.mappingMethod?function(e,t){return t||(e=this._normalizeData(e)),Tx.call(this,e)}:function(t,n,r){var i=!!r;return n||(t=this._normalizeData(t)),r=wf.ad(t,e.parsedVisual,r),i?r:wf.As(r,"rgba")},this)},_normalizedToVisual:{linear:function(e){return wf.As(wf.ad(e,this.option.parsedVisual),"rgba")},category:Tx,piecewise:function(e,t){var n=TS.call(this,t);return null==n&&(n=wf.As(wf.ad(e,this.option.parsedVisual),"rgba")),n},fixed:Tb}},colorHue:Tm(function(e,t){return wf.Yu(e,t)}),colorSaturation:Tm(function(e,t){return wf.Yu(e,null,t)}),colorLightness:Tm(function(e,t){return wf.Yu(e,null,null,t)}),colorAlpha:Tm(function(e,t){return wf.hm(e,t)}),decal:{applyVisual:Ty("decal"),_normalizedToVisual:{linear:null,category:Tx,piecewise:null,fixed:null}},opacity:{applyVisual:Ty("opacity"),_normalizedToVisual:Tw([0,1])},liftZ:{applyVisual:Ty("liftZ"),_normalizedToVisual:{linear:Tb,category:Tb,piecewise:Tb,fixed:Tb}},symbol:{applyVisual:function(e,t,n){n("symbol",this.mapValueToVisual(e))},_normalizedToVisual:{linear:Tv,category:Tx,piecewise:function(e,t){var n=TS.call(this,t);return null==n&&(n=Tv.call(this,e)),n},fixed:Tb}},symbolSize:{applyVisual:Ty("symbolSize"),_normalizedToVisual:Tw([0,1])}},e}();function Tg(e,t){var n=e.visual,r=[];bn.Gv(n)?Th(n,function(e){r.push(e)}):null!=n&&r.push(n),t||1!==r.length||({color:1,symbol:1}).hasOwnProperty(e.type)||(r[1]=r[0]),TA(e,r)}function Tm(e){return{applyVisual:function(t,n,r){var i=this.mapValueToVisual(t);r("color",e(n("color"),i))},_normalizedToVisual:Tw([0,1])}}function Tv(e){var t=this.option.visual;return t[Math.round((0,wI.Cb)(e,[0,1],[0,t.length-1],!0))]||{}}function Ty(e){return function(t,n,r){r(e,this.mapValueToVisual(t))}}function Tx(e){var t=this.option.visual;return t[this.option.loop&&-1!==e?e%t.length:e]}function Tb(){return this.option.visual[0]}function Tw(e){return{linear:function(t){return(0,wI.Cb)(t,e,this.option.visual,!0)},category:Tx,piecewise:function(t,n){var r=TS.call(this,n);return null==r&&(r=(0,wI.Cb)(t,e,this.option.visual,!0)),r},fixed:Tb}}function TS(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var r=Tf.findPieceIndex(e,n),i=n[r];if(i&&i.visual)return i.visual[this.type]}}function TA(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=bn.Tj(t,function(e){return wf.qg(e)||[0,0,0,1]})),t}var TC={linear:function(e){return(0,wI.Cb)(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=Tf.findPieceIndex(e,t,!0);if(null!=n)return(0,wI.Cb)(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:bn.lQ},TM=n(80153),Tk=bn.__;function TT(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function T_(e,t,n){var r={};return Tk(t,function(t){var i,o=r[t]=((i=function(){}).prototype.__hidden=i.prototype,new i);Tk(e[t],function(e,r){if(Tf.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),o[r]=new Tf(i),"opacity"===r&&((i=bn.o8(i)).type="colorAlpha",o.__hidden.__alphaForOpacity=new Tf(i))}})}),r}var TI=Tf.mapVisual,TD=Tf.eachVisual,TO=bn.cy,TR=bn.__,TE=wI.Y6,TP=wI.Cb,TL=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(0,bs.C6)(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n,r,i=this.option;t||(n=this.replacableOptionKeys,bn.__(n,function(t){e.hasOwnProperty(t)&&TT(e[t])&&(r=!0)}),r&&bn.__(n,function(t){e.hasOwnProperty(t)&&TT(e[t])?i[t]=bn.o8(e[t]):delete i[t]})),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=bn.oI(e,this),this.controllerVisuals=T_(this.option.controller,t,e),this.targetVisuals=T_(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=wn.qB(e),t},t.prototype.eachTargetSeries=function(e,t){bn.__(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},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 r,i=this.option,o=i.precision,a=this.dataBound,s=i.formatter;n=n||["<",">"],bn.cy(e)&&(e=e.slice(),r=!0);var l=t?e:r?[u(e[0]),u(e[1])]:u(e);if(bn.Kg(s))return s.replace("{value}",r?l[0]:l).replace("{value2}",r?l[1]:l);if(bn.Tn(s))return r?s(e[0],e[1]):s(e);if(!r)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=TE([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,r=n.length-1;r>=0;r--){var i=n[r],o=e.getDimensionInfo(i);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},r=t.target||(t.target={}),i=t.controller||(t.controller={});bn.h1(r,n),bn.h1(i,n);var o=this.isCategory();function a(n){TO(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get("gradientColor")}}a.call(this,r),a.call(this,i),(function(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},TR(r,function(e,t){if(Tf.isValidType(t)){var n=Td(t,"inactive",o);null!=n&&(i[t]=n,"color"!==t||i.hasOwnProperty("opacity")||i.hasOwnProperty("colorAlpha")||(i.opacity=[0,0]))}}))}).call(this,r,"inRange","outOfRange"),(function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get("inactiveColor"),i=this.getItemSymbol()||"roundRect";TR(this.stateList,function(a){var s=this.itemSize,l=e[a];l||(l=e[a]={color:o?r:[r]}),null==l.symbol&&(l.symbol=t&&bn.o8(t)||(o?i:[i])),null==l.symbolSize&&(l.symbolSize=n&&bn.o8(n)||(o?s[0]:[s[0],s[0]])),l.symbol=TI(l.symbol,function(e){return"none"===e?i:e});var u=l.symbolSize;if(null!=u){var c=-1/0;TD(u,function(e){e>c&&(c=e)}),l.symbolSize=TI(u,function(e){return TP(e,[0,c],[0,s[0]],!0)})}},this)}).call(this,i)},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}(Sd.A),TN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(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):bn.cy(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),bn.__(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=wI.Y6((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 r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)},this),t.push({seriesId:n.id,dataIndex:r})},this),t},t.prototype.getVisualMeta=function(e){var t=TB(this,"outOfRange",this.getExtent()),n=TB(this,"inRange",this.option.range.slice()),r=[];function i(t,n){r.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]&&i(t[a],"outOfRange");for(var u=1;o<s;o++,u=0)u&&r.length&&i(n[o],"outOfRange"),i(n[o],"inRange");for(var u=1;a<l;a++)(!n.length||n[n.length-1]<t[a])&&(u&&(r.length&&i(r[r.length-1].value,"outOfRange"),u=0),i(t[a],"outOfRange"));var c=r.length;return{stops:r,outerColors:[c?r[0].color:"transparent",c?r[c-1].color:"transparent"]}},t.type="visualMap.continuous",t.defaultOption=(0,bd.G_)(TL.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}(TL);function TB(e,t,n){if(n[0]===n[1])return n.slice();for(var r=(n[1]-n[0])/200,i=n[0],o=[],a=0;a<=200&&i<n[1];a++)o.push(i),i+=r;return o.push(n[1]),o}var Tz=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(0,bs.C6)(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,r){(this.visualMapModel=e,!1===e.get("show"))?this.group.removeAll():this.doRender(e,t,n,r)},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=wp.QX(t.get("padding")||0),r=e.getBoundingRect();e.add(new bv.A({z2:-1,silent:!0,shape:{x:r.x-n[3],y:r.y-n[0],width:r.width+n[3]+n[1],height:r.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 r=(n=n||{}).forceState,i=this.visualMapModel,o={};function a(e){return o[e]}function s(e,t){o[e]=t}"color"===t&&(o.color=i.get("contentColor"));var l=i.controllerVisuals[r||i.getValueState(e)],u=Tf.prepareVisualTypes(l);return bn.__(u,function(r){var i=l[r];n.convertOpacityToAlpha&&"opacity"===r&&(r="colorAlpha",i=l.__alphaForOpacity),Tf.dependsOn(r,t)&&i&&i.applyVisual(e,a,s)}),o[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api;wB.m$(e,t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},t.prototype.doRender=function(e,t,n,r){},t.type="visualMap",t}(Sc.A),TF=[["left","right","width"],["top","bottom","height"]];function Tj(e,t,n){var r=e.option,i=r.align;if(null!=i&&"auto"!==i)return i;for(var o={width:t.getWidth(),height:t.getHeight()},a=+("horizontal"===r.orient),s=TF[a],l=[0,null,10],u={},c=0;c<3;c++)u[TF[1-a][c]]=l[c],u[s[c]]=2===c?n[0]:r[s[c]];var d=[["x","width",3],["y","height",0]][a],h=(0,wB.dV)(u,o,r.padding);return s[(h.margin[d[2]]||0)+h[d[0]]+.5*h[d[1]]<.5*o[d[1]]?0:1]}function TV(e,t){return bn.__(e||[],function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")}),e}var TH=wI.Cb,T$=bn.__,TW=Math.min,TG=Math.max,TU=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(0,bs.C6)(t,e),t.prototype.init=function(t,n){e.prototype.init.call(this,t,n),this._hoverLinkFromSeriesMouseOver=bn.oI(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=bn.oI(this._hideIndicator,this)},t.prototype.doRender=function(e,t,n,r){r&&"selectDataRange"===r.type&&r.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 r=t[1-n];r=null!=r?r+"":"";var i=this.visualMapModel,o=i.get("textGap"),a=i.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,d=this.visualMapModel.textStyleModel;this.group.add(new wt.Ay({style:(0,bw.VB)(d,{x:l[0],y:l[1],verticalAlign:"horizontal"===c?"middle":u,align:"horizontal"===c?u:"center",text:r})}))}},t.prototype._renderBar=function(e){var t=this.visualMapModel,n=this._shapes,r=t.itemSize,i=this._orient,o=this._useHandle,a=Tj(t,this.api,r),s=n.mainGroup=this._createBarGroup(a),l=new bf.A;s.add(l),l.add(n.outOfRange=Tq()),l.add(n.inRange=Tq(null,o?TX(this._orient):null,bn.oI(this._dragHandle,this,"all",!1),bn.oI(this._dragHandle,this,"all",!0))),l.setClipPath(new bv.A({shape:{x:0,y:0,width:r[0],height:r[1],r:3}}));var u=t.textStyleModel.getTextRect("国"),c=TG(u.width,u.height);o&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(t,s,0,r,c,i),this._createHandle(t,s,1,r,c,i)),this._createIndicator(t,s,r,c,i),e.add(s)},t.prototype._createHandle=function(e,t,n,r,i,o){var a=bn.oI(this._dragHandle,this,n,!1),s=bn.oI(this._dragHandle,this,n,!0),l=(0,bI.lo)(e.get("handleSize"),r[0]),u=(0,bK.v5)(e.get("handleIcon"),-l/2,-l/2,l,l,null,!0),c=TX(this._orient);u.attr({cursor:c,draggable:!0,drift:a,ondragend:s,onmousemove:function(e){Cu.ds(e.event)}}),u.x=r[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(),(0,bb.ix)(u,!0),t.add(u);var d=this.visualMapModel.textStyleModel,h=new wt.Ay({cursor:c,draggable:!0,drift:a,onmousemove:function(e){Cu.ds(e.event)},ondragend:s,style:(0,bw.VB)(d,{x:0,y:0,text:""})});h.ensureState("blur").style={opacity:.1},h.stateTransition={duration:200},this.group.add(h);var p=[l,0],f=this._shapes;f.handleThumbs[n]=u,f.handleLabelPoints[n]=p,f.handleLabels[n]=h},t.prototype._createIndicator=function(e,t,n,r,i){var o=(0,bI.lo)(e.get("indicatorSize"),n[0]),a=(0,bK.v5)(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 bJ.Ay){var l=a.style;a.useStyle(bn.X$({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=this.visualMapModel.textStyleModel,c=new wt.Ay({silent:!0,invisible:!0,style:(0,bw.VB)(u,{x:0,y:0,text:""})});this.group.add(c);var d=[("horizontal"===i?r/2:6)+n[0]/2,0],h=this._shapes;h.indicator=a,h.indicatorLabel=c,h.indicatorLabelPoint=d,this._firstShowIndicator=!0},t.prototype._dragHandle=function(e,t,n,r){if(this._useHandle){if(this._dragging=!t,!t){var i=this._applyTransform([n,r],this._shapes.mainGroup,!0);this._updateInterval(e,i[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():TY(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},t.prototype._resetInterval=function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),n=e.getExtent(),r=[0,e.itemSize[1]];this._handleEnds=[TH(t[0],n,r,!0),TH(t[1],n,r,!0)]},t.prototype._updateInterval=function(e,t){t=t||0;var n=this.visualMapModel,r=this._handleEnds,i=[0,n.itemSize[1]];Co(t,r,i,e,0);var o=n.getExtent();this._dataInterval=[TH(r[0],i,o,!0),TH(r[1],i,o,!0)]},t.prototype._updateView=function(e){var t=this.visualMapModel,n=t.getExtent(),r=this._shapes,i=[0,t.itemSize[1]],o=e?i:this._handleEnds,a=this._createBarVisual(this._dataInterval,n,o,"inRange"),s=this._createBarVisual(n,n,i,"outOfRange");r.inRange.setStyle({fill:a.barColor}).setShape("points",a.barPoints),r.outOfRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),this._updateHandle(o,a)},t.prototype._createBarVisual=function(e,t,n,r){var i={forceState:r,convertOpacityToAlpha:!0},o=this._makeColorGradient(e,i),a=[this.getControllerVisual(e[0],"symbolSize",i),this.getControllerVisual(e[1],"symbolSize",i)],s=this._createBarPoints(n,a);return{barColor:new we.A(0,0,0,1,o),barPoints:s,handlesColor:[o[0].color,o[o.length-1].color]}},t.prototype._makeColorGradient=function(e,t){var n=[],r=(e[1]-e[0])/100;n.push({color:this.getControllerVisual(e[0],"color",t),offset:0});for(var i=1;i<100;i++){var o=e[0]+r*i;if(o>e[1])break;n.push({color:this.getControllerVisual(o,"color",t),offset:i/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 bf.A("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,r=this.visualMapModel,i=n.handleThumbs,o=n.handleLabels,a=r.itemSize,s=r.getExtent();T$([0,1],function(l){var u=i[l];u.setStyle("fill",t.handlesColor[l]),u.y=e[l];var c=TH(e[l],[0,a[1]],s,!0),d=this.getControllerVisual(c,"symbolSize");u.scaleX=u.scaleY=d/a[0],u.x=a[0]-d/2;var h=bg.applyTransform(n.handleLabelPoints[l],bg.getTransform(u,this.group));o[l].setStyle({x:h[0],y:h[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})},this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,o=i.getExtent(),a=i.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}),d=this.getControllerVisual(e,"symbolSize"),h=TH(e,o,s,!0),p=a[0]-d/2,f={x:u.x,y:u.y};u.y=h,u.x=p;var g=bg.applyTransform(l.indicatorLabelPoint,bg.getTransform(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||"")+i.formatValueText(t),verticalAlign:y?v:"middle",align:y?"center":v});var x={x:p,y:h,style:{fill:c}},b={style:{x:g[0],y:g[1]}};if(i.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 A=0;A<S.length;A++)this.api.enterBlur(S[A])}},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,r=e._applyTransform([t.offsetX,t.offsetY],e._shapes.mainGroup,!0,!0);r[1]=TW(TG(0,r[1]),n[1]),e._doHoverLinkToSeries(r[1],0<=r[0]&&r[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,r=n.itemSize;if(n.option.hoverLink){var i,o,a,s,l,u=[0,r[1]],c=n.getExtent();e=TW(TG(u[0],e),u[1]);var d=(i=n,o=c,a=u,s=6,(l=i.get("hoverLinkDataSize"))&&(s=TH(l,o,a,!0)/2),s),h=[e-d,e+d],p=TH(e,u,c,!0),f=[TH(h[0],u,c,!0),TH(h[1],u,c,!0)];h[0]<u[0]&&(f[0]=-1/0),h[1]>u[1]&&(f[1]=1/0),t&&(f[0]===-1/0?this._showIndicator(p,f[1],"< ",d):f[1]===1/0?this._showIndicator(p,f[0],"> ",d):this._showIndicator(p,p,"≈ ",d));var g=this._hoverLinkDataIndices,m=[];(t||TY(n))&&(m=this._hoverLinkDataIndices=n.findTargetDataIndices(f));var v=wn.D6(g,m);this._dispatchHighDown("downplay",TV(v[0],n)),this._dispatchHighDown("highlight",TV(v[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){if((0,Ti.R)(e.target,function(e){var n=(0,bx.z)(e);if(null!=n.dataIndex)return t=n,!0},!0),t){var t,n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),o=i.getStore().get(r.getDataDimensionIndex(i),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",TV(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,r){var i=bg.getTransform(t,r?null:this.group);return bn.cy(e)?bg.applyTransform(e,i,n):bg.transformDirection(e,i,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}(Tz);function Tq(e,t,n,r){return new CE.A({shape:{points:e},draggable:!!n,cursor:t,drift:n,onmousemove:function(e){Cu.ds(e.event)},ondragend:r})}function TY(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function TX(e){return"vertical"===e?"ns-resize":"ew-resize"}var TZ={type:"selectDataRange",event:"dataRangeSelected",update:"update"},TK=function(e,t){t.eachComponent({mainType:"visualMap",query:e},function(t){t.setSelected(e.selected)})},TQ=[{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent("visualMap",function(t){var r,i,o,a,s,l=e.pipelineContext;!t.isTargetSeries(e)||l&&l.large||n.push((r=t.stateList,i=t.targetVisuals,o=bn.oI(t.getValueState,t),a=t.getDataDimensionIndex(e.getData()),s={},bn.__(r,function(e){var t=Tf.prepareVisualTypes(i[e]);s[e]=t}),{progress:function(e,t){function n(e){return(0,TM.Ez)(t,u,e)}function r(e,n){(0,TM.oZ)(t,u,e,n)}null!=a&&(l=t.getDimensionIndex(a));for(var l,u,c=t.getStore();null!=(u=e.next());){var d=t.getRawDataItem(u);if(!d||!1!==d.visualMap)for(var h=null!=a?c.get(l,u):u,p=o(h),f=i[p],g=s[p],m=0,v=g.length;m<v;m++){var y=g[m];f[y]&&f[y].applyVisual(h,n,r)}}}}))}),n}},{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),r=[];t.eachComponent("visualMap",function(t){if(t.isTargetSeries(e)){var i=t.getVisualMeta(bn.oI(TJ,null,e,t))||{stops:[],outerColors:[]},o=t.getDataDimensionIndex(n);o>=0&&(i.dimension=o,r.push(i))}}),e.getData().setVisual("visualMeta",r)}}];function TJ(e,t,n,r){for(var i=t.targetVisuals[r],o=Tf.prepareVisualTypes(i),a={color:(0,TM.rI)(e.getData(),"color")},s=0,l=o.length;s<l;s++){var u=o[s],c=i["opacity"===u?"__alphaForOpacity":u];c&&c.applyVisual(n,d,h)}return a.color;function d(e){return a[e]}function h(e,t){a[e]=t}}var T0=bn.__;function T1(e){var t=e&&e.visualMap;bn.cy(t)||(t=t?[t]:[]),T0(t,function(e){if(e){T2(e,"splitList")&&!T2(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&bn.cy(t)&&T0(t,function(e){bn.Gv(e)&&(T2(e,"start")&&!T2(e,"min")&&(e.min=e.start),T2(e,"end")&&!T2(e,"max")&&(e.max=e.end))})}})}function T2(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var T5=!1;function T4(e){T5||(T5=!0,e.registerSubTypeDefaulter("visualMap",function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}),e.registerAction(TZ,TK),(0,bn.__)(TQ,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(T1))}function T3(e){e.registerComponentModel(TN),e.registerComponentView(TU),T4(e)}var T6=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return(0,bs.C6)(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],T8[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){"categories"===r?(e.mappingMethod="category",e.categories=bn.o8(i)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=bn.Tj(this._pieceList,function(e){return e=bn.o8(e),"inRange"!==t&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=Tf.listVisualTypes(),i=this.isCategory();function o(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}bn.__(t.pieces,function(e){bn.__(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),bn.__(n,function(e,n){var r=!1;bn.__(this.stateList,function(e){r=r||o(t,e,n)||o(t.target,e,n)},this),r||bn.__(this.stateList,function(e){(t[e]||(t[e]={}))[n]=Td(n,"inRange"===e?"active":"inactive",i)})},this),e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,bn.__(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),"single"===n.selectedMode){var o=!1;bn.__(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(o?i[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=bn.o8(e)},t.prototype.getValueState=function(e){var t=Tf.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(r){var i=[],o=r.getData();o.each(this.getDataDimensionIndex(o),function(t,r){Tf.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},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=["",""],r=this,i=this._pieceList.slice();if(i.length){var o=i[0].interval[0];o!==-1/0&&i.unshift({interval:[-1/0,o]}),(o=i[i.length-1].interval[1])!==1/0&&i.push({interval:[o,1/0]})}else i.push({interval:[-1/0,1/0]});var a=-1/0;return bn.__(i,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(i,o){var a=r.getRepresentValue({interval:i});o||(o=r.getValueState(a));var s=e(a,o);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}},t.type="visualMap.piecewise",t.defaultOption=(0,bd.G_)(TL.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}(TL),T8={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;t.splitNumber=i=Math.max(parseInt(i,10),1);for(var o=(r[1]-r[0])/i;+o.toFixed(n)!==o&&n<5;)n++;t.precision=n,o=+o.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var a=0,s=r[0];a<i;s+=o,a++){var l=a===i-1?r[1]:s+o;e.push({interval:[s,l],close:[1,1]})}t.maxOpen&&e.push({interval:[r[1],1/0],close:[0,0]}),(0,wI.sL)(e),bn.__(e,function(e,t){e.index=t,e.text=this.formatValueText(e.interval)},this)},categories:function(e){var t=this.option;bn.__(t.categories,function(t){e.push({text:this.formatValueText(t,!0),value:t})},this),T9(t,e)},pieces:function(e){var t=this.option;bn.__(t.pieces,function(t,n){bn.Gv(t)||(t={value:t});var r={text:"",index:n};if(null!=t.label&&(r.text=t.label),t.hasOwnProperty("value")){var i=r.value=t.value;r.interval=[i,i],r.close=[1,1]}else{for(var o=r.interval=[],a=r.close=[0,0],s=[1,0,1],l=[-1/0,1/0],u=[],c=0;c<2;c++){for(var d=[["gte","gt","min"],["lte","lt","max"]][c],h=0;h<3&&null==o[c];h++)o[c]=t[d[h]],a[c]=s[h],u[c]=2===h;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]&&(r.value=o[0])}r.visual=Tf.retrieveVisuals(t),e.push(r)},this),T9(t,e),(0,wI.sL)(e),bn.__(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 T9(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}var T7=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get("textGap"),r=t.textStyleModel,i=r.getFont(),o=r.getTextColor(),a=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,c=bn.Je(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,c,a),bn.__(l.viewPieceList,function(r){var l=r.piece,u=new bf.A;u.onclick=bn.oI(this._onItemClick,this,l),this._enableHoverLink(u,r.indexInModelPieceList);var d=t.getRepresentValue(l);if(this._createItemSymbol(u,d,[0,0,s[0],s[1]]),c){var h=this.visualMapModel.getValueState(d);u.add(new wt.Ay({style:{x:"right"===a?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:a,font:i,fill:o,opacity:"outOfRange"===h?.5:1}}))}e.add(u)},this),u&&this._renderEndsText(e,u[1],s,c,a),wB.aP(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 r("highlight")}).on("mouseout",function(){return r("downplay")});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:TV(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return Tj(e,this.api,e.itemSize);var n=t.align;return n&&"auto"!==n||(n="left"),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var o=new bf.A,a=this.visualMapModel.textStyleModel;o.add(new wt.Ay({style:(0,bw.VB)(a,{x:r?"right"===i?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:r?i:"center",text:t})})),e.add(o)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=bn.Tj(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get("text"),r=e.get("orient"),i=e.get("inverse");return("horizontal"===r?i:!i)?t.reverse():n&&(n=n.slice().reverse()),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n){e.add((0,bK.v5)(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,r=n.selectedMode;if(r){var i=bn.o8(n.selected),o=t.getSelectedMapKey(e);"single"===r||!0===r?(i[o]=!0,bn.__(i,function(e,t){i[t]=t===o})):i[o]=!i[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type="visualMap.piecewise",t}(Tz);function _e(e){e.registerComponentModel(T6),e.registerComponentView(T7),T4(e)}function _t(e,t){if(!e)return!1;for(var n=(0,bn.cy)(e)?e:[e],r=0;r<n.length;r++)if(n[r]&&n[r][t])return!0;return!1}function _n(e){(0,wn.M5)(e,"label",["show"])}var _r=(0,wn.$r)(),_i=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.createdBySelf=!1,n}return(0,bs.C6)(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},t.prototype.isAnimationEnabled=function(){if(Mp.A.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,r){var i=this.mainType;n||t.eachSeries(function(e){var n=e.get(this.mainType,!0),o=_r(e)[i];if(!n||!n.data){_r(e)[i]=null;return}o?o._mergeOption(n,t,!0):(r&&_n(n),bn.__(n.data,function(e){e instanceof Array?(_n(e[0]),_n(e[1])):_n(e)}),o=this.createMarkerModelFromSeries(n,this,t),bn.X$(o,{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),o.__hostSeries=e),_r(e)[i]=o},this)},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e),o=r.getName(e);return(0,k1.Qx)("section",{header:this.name,blocks:[(0,k1.Qx)("nameValue",{name:o,value:i,noName:!o,noValue:null==i})]})},t.prototype.getData=function(){return this._data},t.prototype.setData=function(e){this._data=e},t.getMarkerModelFromSeries=function(e,t){return _r(e)[t]},t.type="marker",t.dependencies=["series","grid","polar","geo"],t}(Sd.A);bn.co(_i,Tr.J.prototype);var _o=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},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}(_i),_a=n(47163);function _s(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function _l(e,t,n,r,i,o){var a=[],s=(0,b6.sJ)(t,r)?t.getCalculationInfo("stackResultDimension"):r,l=_f(t,s,e),u=t.indicesOfNearest(s,l)[0];a[i]=t.get(n,u),a[o]=t.get(s,u);var c=t.get(r,u),d=wI.XV(t.get(r,u));return(d=Math.min(d,20))>=0&&(a[o]=+a[o].toFixed(d)),[a,c]}var _u={min:(0,bn.cF)(_l,"min"),max:(0,bn.cF)(_l,"max"),average:(0,bn.cF)(_l,"average"),median:(0,bn.cF)(_l,"median")};function _c(e,t){if(t){var n,r=e.getData(),i=e.coordinateSystem,o=i&&i.dimensions;if(!(!isNaN(parseFloat((n=t).x))&&!isNaN(parseFloat(n.y)))&&!(0,bn.cy)(t.coord)&&(0,bn.cy)(o)){var a=_d(t,r,i,e);if((t=(0,bn.o8)(t)).type&&_u[t.type]&&a.baseAxis&&a.valueAxis){var s=(0,bn.qh)(o,a.baseAxis.dim),l=(0,bn.qh)(o,a.valueAxis.dim),u=_u[t.type](r,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&&(0,bn.cy)(o))for(var c=t.coord,d=0;d<2;d++)_u[c[d]]&&(c[d]=_f(r,r.mapDimension(o[d]),c[d]));else t.coord=[];return t}}function _d(e,t,n,r){var i,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((i=r,o=s.valueDataDim,(a=i.getData().getDimensionInfo(o))&&a.coordDim)),s.baseAxis=n.getOtherAxis(s.valueAxis),s.baseDataDim=t.mapDimension(s.baseAxis.dim)):(s.baseAxis=r.getBaseAxis(),s.valueAxis=n.getOtherAxis(s.baseAxis),s.baseDataDim=t.mapDimension(s.baseAxis.dim),s.valueDataDim=t.mapDimension(s.valueAxis.dim)),s}function _h(e,t){return!e||!e.containData||!t.coord||!!_s(t)||e.containData(t.coord)}function _p(e,t){return e?function(e,n,r,i){var o=i<2?e.coord&&e.coord[i]:e.value;return(0,_a.Pn)(o,t[i])}:function(e,n,r,i){return(0,_a.Pn)(e.value,t[i])}}function _f(e,t,n){if("average"===n){var r=0,i=0;return e.each(t,function(e,t){!isNaN(e)&&(r+=e,i++)}),r/i}return"median"===n?e.getMedian(t):e.getDataExtent(t)[+("max"===n)]}var _g=(0,wn.$r)(),_m=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.init=function(){this.markerGroupMap=(0,bn.nt)()},t.prototype.render=function(e,t,n){var r=this,i=this.markerGroupMap;i.each(function(e){_g(e).keep=!1}),t.eachSeries(function(e){var i=_i.getMarkerModelFromSeries(e,r.type);i&&r.renderSeries(e,i,t,n)}),i.each(function(e){_g(e).keep||r.group.remove(e.group)})},t.prototype.markKeep=function(e){_g(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;(0,bn.__)(e,function(e){var r=_i.getMarkerModelFromSeries(e,n.type);r&&r.getData().eachItemGraphicEl(function(e){e&&(t?(0,bb.QX)(e):(0,bb.JC)(e))})})},t.type="marker",t}(Sc.A),_v=(0,wn.$r)(),_y=function(e,t,n,r){var i=r[0],o=r[1];if(i&&o){var a=_c(e,i),s=_c(e,o),l=a.coord,u=s.coord;l[0]=(0,bn.Je)(l[0],-1/0),l[1]=(0,bn.Je)(l[1],-1/0),u[0]=(0,bn.Je)(u[0],1/0),u[1]=(0,bn.Je)(u[1],1/0);var c=(0,bn.Um)([{},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 _x(e){return!isNaN(e)&&!isFinite(e)}function _b(e,t,n,r){var i=1-e;return _x(t[i])&&_x(n[i])}function _w(e,t){var n=t.coord[0],r=t.coord[1],i={coord:n,x:t.x0,y:t.y0},o={coord:r,x:t.x1,y:t.y1};if(bT(e,"cartesian2d"))return!!(n&&r&&(_b(1,n,r,e)||_b(0,n,r,e)))||!e||!e.containZone||!i.coord||!o.coord||!!_s(i)||!!_s(o)||e.containZone(i.coord,o.coord);return _h(e,i)||_h(e,o)}function _S(e,t,n,r,i){var o,a=r.coordinateSystem,s=e.getItemModel(t),l=wI.lo(s.get(n[0]),i.getWidth()),u=wI.lo(s.get(n[1]),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition){var c=e.getValues(["x0","y0"],t),d=e.getValues(["x1","y1"],t),h=a.clampData(c),p=a.clampData(d),f=[];"x0"===n[0]?f[0]=h[0]>p[0]?d[0]:c[0]:f[0]=h[0]>p[0]?c[0]:d[0],"y0"===n[1]?f[1]=h[1]>p[1]?d[1]:c[1]:f[1]=h[1]>p[1]?c[1]:d[1],o=r.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(bT(a,"cartesian2d")){var y=a.getAxis("x"),x=a.getAxis("y"),g=e.get(n[0],t),m=e.get(n[1],t);_x(g)?o[0]=y.toGlobalCoord(y.getExtent()[+("x0"!==n[0])]):_x(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 _A=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],_C=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=_i.getMarkerModelFromSeries(e,"markArea");if(t){var r=t.getData();r.each(function(t){var i=(0,bn.Tj)(_A,function(i){return _S(r,t,i,e,n)});r.setItemLayout(t,i),r.getItemGraphicEl(t).setShape("points",i)})}},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,o=e.id,a=e.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new bf.A});this.group.add(l.group),this.markKeep(l);var u=function(e,t,n){if(e){var r,i,o=(0,bn.Tj)(e&&e.dimensions,function(e){var n=t.getData(),r=n.getDimensionInfo(n.mapDimension(e))||{};return(0,bn.X$)((0,bn.X$)({},r),{name:e,ordinalMeta:null})});i=(0,bn.Tj)(["x0","y0","x1","y1"],function(e,t){return{name:e,type:o[t%2].type}}),r=new wE.A(i,n)}else i=[{name:"value",type:"float"}],r=new wE.A(i,n);var a=(0,bn.Tj)(n.get("data"),(0,bn.cF)(_y,t,e,n));e&&(a=(0,bn.pb)(a,(0,bn.cF)(_w,e)));var s=e?function(e,t,n,r){var o=e.coord[Math.floor(r/2)][r%2];return(0,_a.Pn)(o,i[r])}:function(e,t,n,r){return(0,_a.Pn)(e.value,i[r])};return r.initData(a,null,s),r.hasItemOption=!0,r}(i,e,t);t.setData(u),u.each(function(t){var n=(0,bn.Tj)(_A,function(n){return _S(u,t,n,e,r)}),o=i.getAxis("x").scale,s=i.getAxis("y").scale,l=o.getExtent(),c=s.getExtent(),d=[o.parse(u.get("x0",t)),o.parse(u.get("x1",t))],h=[s.parse(u.get("y0",t)),s.parse(u.get("y1",t))];wI.Y6(d),wI.Y6(h);var p=!(l[0]>d[1]||l[1]<d[0]||c[0]>h[1]||c[1]<h[0]);u.setItemLayout(t,{points:n,allClipped:!p});var f=u.getItemModel(t).getModel("itemStyle").getItemStyle(),g=(0,TM.rI)(a,"color");!f.fill&&(f.fill=g,(0,bn.Kg)(f.fill)&&(f.fill=wf.hm(f.fill,.4))),f.stroke||(f.stroke=g),u.setItemVisual(t,"style",f)}),u.diff(_v(l).data).add(function(e){var t=u.getItemLayout(e);if(!t.allClipped){var n=new CE.A({shape:{points:t.points}});u.setItemGraphicEl(e,n),l.group.add(n)}}).update(function(e,n){var r=_v(l).data.getItemGraphicEl(n),i=u.getItemLayout(e);i.allClipped?r&&l.group.remove(r):(r?bm.oi(r,{shape:{points:i.points}},t,e):r=new CE.A({shape:{points:i.points}}),u.setItemGraphicEl(e,r),l.group.add(r))}).remove(function(e){var t=_v(l).data.getItemGraphicEl(e);l.group.remove(t)}).execute(),u.eachItemGraphicEl(function(e,n){var r=u.getItemModel(n),i=u.getItemVisual(n,"style");e.useStyle(u.getItemVisual(n,"style")),(0,bw.qM)(e,(0,bw.lx)(r),{labelFetcher:t,labelDataIndex:n,defaultText:u.getName(n)||"",inheritColor:(0,bn.Kg)(i.fill)?wf.hm(i.fill,1):"#000"}),(0,bb.Mx)(e,r),(0,bb.Lm)(e,null,null,r.get(["emphasis","disabled"])),(0,bx.z)(e).dataModel=t}),_v(l).data=u,l.group.silent=t.get("silent")||e.get("silent")},t.type="markArea",t}(_m),_M=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},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}(_i),_k=n(95163),_T=w_.A.prototype,__=_k.A.prototype,_I=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};function _D(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}(0,bs.C6)(function(){return null!==_I&&_I.apply(this,arguments)||this},_I);var _O=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-line",n}return(0,bs.C6)(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new _I},t.prototype.buildPath=function(e,t){_D(t)?_T.buildPath.call(this,e,t):__.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return _D(this.shape)?_T.pointAt.call(this,e):__.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=_D(t)?[t.x2-t.x1,t.y2-t.y1]:__.tangentAt.call(this,e);return wG.S8(n,n)},t}(bp.Ay),_R=["fromSymbol","toSymbol"];function _E(e){return"_"+e+"Type"}function _P(e,t,n){var r=t.getItemVisual(n,e);if(!r||"none"===r)return r;var i=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=bK.xU(i),u=bK.hV(a||0,l);return r+l+u+(o||"")+(s||"")}function _L(e,t,n){var r=t.getItemVisual(n,e);if(r&&"none"!==r){var i=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=bK.xU(i),u=bK.hV(a||0,l),c=bK.v5(r,-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 _N(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 _B=function(e){function t(t,n,r){var i=e.call(this)||this;return i._createLine(t,n,r),i}return(0,bs.C6)(t,e),t.prototype._createLine=function(e,t,n){var r,i,o=e.hostModel,a=(r=e.getItemLayout(t),_N((i=new _O({name:"line",subPixelOptimize:!0})).shape,r),i);a.shape.percent=0,bm.LW(a,{shape:{percent:1}},o,t),this.add(a),(0,bn.__)(_R,function(n){var r=_L(n,e,t);this.add(r),this[_E(n)]=_P(n,e,t)},this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var r=e.hostModel,i=this.childOfName("line"),o=e.getItemLayout(t),a={shape:{}};_N(a.shape,o),bm.oi(i,a,r,t),(0,bn.__)(_R,function(n){var r=_P(n,e,t),i=_E(n);if(this[i]!==r){this.remove(this.childOfName(n));var o=_L(n,e,t);this.add(o)}this[i]=r},this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var r=e.hostModel,i=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,d=n&&n.blurScope;if(!n||e.hasItemOption){var h=e.getItemModel(t),p=h.getModel("emphasis");o=p.getModel("lineStyle").getLineStyle(),a=h.getModel(["blur","lineStyle"]).getLineStyle(),s=h.getModel(["select","lineStyle"]).getLineStyle(),u=p.get("disabled"),c=p.get("focus"),d=p.get("blurScope"),l=(0,bw.lx)(h)}var f=e.getItemVisual(t,"style"),g=f.stroke;i.useStyle(f),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState("emphasis").style=o,i.ensureState("blur").style=a,i.ensureState("select").style=s,(0,bn.__)(_R,function(e){var t=this.childOfName(e);if(t){t.setColor(g),t.style.opacity=f.opacity;for(var n=0;n<bb.BV.length;n++){var r=bb.BV[n],o=i.getState(r);if(o){var a=o.style||{},s=t.ensureState(r),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=r.getRawValue(t);(0,bw.qM)(this,l,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,n){return r.getFormattedLabel(t,n,e.dataType)}},inheritColor:g||"#000",defaultOpacity:f.opacity,defaultText:(null==m?e.getName(t):isFinite(m)?(0,wI.LI)(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");(0,bn.cy)(x)||(x=[x,x]),v.__labelDistance=x}this.setTextConfig({position:null,local:!0,inside:!1}),(0,bb.Lm)(this,c,d,u)},t.prototype.highlight=function(){(0,bb.HY)(this)},t.prototype.downplay=function(){(0,bb.SD)(this)},t.prototype.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName("line");_N(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 r=1,i=this.parent;i;)i.scaleX&&(r/=i.scaleX),i=i.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=wG.jb([],l,s);if(wG.S8(u,u),e&&(e.setPosition(s),S(e,0),e.scaleX=e.scaleY=r*a,e.markRedraw()),t&&(t.setPosition(l),S(t,1),t.scaleX=t.scaleY=r*a,t.markRedraw()),n&&!n.ignore){n.x=n.y=0,n.originX=n.originY=0;var c=void 0,d=void 0,h=n.__labelDistance,p=h[0]*r,f=h[1]*r,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,d="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":w=f,d="top";break;default:w=0,d="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",d=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",d=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=r,n.setStyle({verticalAlign:n.__verticalAlign||d,align:n.__align||c})}}}function S(e,t){var n=e.__specifiedRotation;if(null==n){var r=o.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(r[1],r[0]))}else e.attr("rotation",n)}},t}(bf.A),_z=function(){function e(e){this.group=new bf.A,this._LineCtor=e||_B}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this.group,r=this._lineData;this._lineData=e,r||n.removeAll();var i=_F(e);e.diff(r).add(function(n){t._doAdd(e,n,i)}).update(function(n,o){t._doUpdate(r,e,o,n,i)}).remove(function(e){n.remove(r.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=_F(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 r=e.start;r<e.end;r++)if(_V(t.getItemLayout(r))){var i=new this._LineCtor(t,r,this._seriesScope);i.traverse(n),this.group.add(i),t.setItemGraphicEl(r,i),this._progressiveEls.push(i)}},e.prototype.remove=function(){this.group.removeAll()},e.prototype.eachRendered=function(e){bg.traverseElements(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,n){if(_V(e.getItemLayout(t))){var r=new this._LineCtor(e,t,n);e.setItemGraphicEl(t,r),this.group.add(r)}},e.prototype._doUpdate=function(e,t,n,r,i){var o=e.getItemGraphicEl(n);_V(t.getItemLayout(r))?(o?o.updateData(t,r,i):o=new this._LineCtor(t,r,i),t.setItemGraphicEl(r,o),this.group.add(o)):this.group.remove(o)},e}();function _F(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:(0,bw.lx)(t)}}function _j(e){return isNaN(e[0])||isNaN(e[1])}function _V(e){return e&&!_j(e[0])&&!_j(e[1])}var _H=(0,wn.$r)(),_$=function(e,t,n,r){var i,o=e.getData();if((0,bn.cy)(r))i=r;else{var a=r.type;if("min"===a||"max"===a||"average"===a||"median"===a||null!=r.xAxis||null!=r.yAxis){var s=void 0,l=void 0;if(null!=r.yAxis||null!=r.xAxis)s=t.getAxis(null!=r.yAxis?"y":"x"),l=(0,bn.Je)(r.yAxis,r.xAxis);else{var u=_d(r,o,t,e);s=u.valueAxis;var c=(0,b6.me)(o,u.valueDataDim);l=_f(o,c,a)}var d=+("x"!==s.dim),h=1-d,p=(0,bn.o8)(r),f={coord:[]};p.type=null,p.coord=[],p.coord[h]=-1/0,f.coord[h]=1/0;var g=n.get("precision");g>=0&&(0,bn.Et)(l)&&(l=+l.toFixed(Math.min(g,20))),p.coord[d]=f.coord[d]=l,i=[p,f,{type:a,valueIndex:r.valueIndex,value:l}]}else i=[]}var m=[_c(e,i[0]),_c(e,i[1]),(0,bn.X$)({},i[2])];return m[2].type=m[2].type||null,(0,bn.h1)(m[2],m[0]),(0,bn.h1)(m[2],m[1]),m};function _W(e){return!isNaN(e)&&!isFinite(e)}function _G(e,t,n,r){var i=1-e,o=r.dimensions[e];return _W(t[i])&&_W(n[i])&&t[e]===n[e]&&r.getAxis(o).containData(t[e])}function _U(e,t){if("cartesian2d"===e.type){var n=t[0].coord,r=t[1].coord;if(n&&r&&(_G(1,n,r,e)||_G(0,n,r,e)))return!0}return _h(e,t[0])&&_h(e,t[1])}function _q(e,t,n,r,i){var o,a=r.coordinateSystem,s=e.getItemModel(t),l=wI.lo(s.get("x"),i.getWidth()),u=wI.lo(s.get("y"),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition)o=r.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=a.dimensions,d=e.get(c[0],t),h=e.get(c[1],t);o=a.dataToPoint([d,h])}if(bT(a,"cartesian2d")){var p=a.getAxis("x"),f=a.getAxis("y"),c=a.dimensions;_W(e.get(c[0],t))?o[0]=p.toGlobalCoord(p.getExtent()[+!n]):_W(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 _Y=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=_i.getMarkerModelFromSeries(e,"markLine");if(t){var r=t.getData(),i=_H(t).from,o=_H(t).to;i.each(function(t){_q(i,t,!0,e,n),_q(o,t,!1,e,n)}),r.each(function(e){r.setItemLayout(e,[i.getItemLayout(e),o.getItemLayout(e)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},t.prototype.renderSeries=function(e,t,n,r){var i,o,a,s,l,u,c,d,h,p=e.coordinateSystem,f=e.id,g=e.getData(),m=this.markerGroupMap,v=m.get(f)||m.set(f,new _z);this.group.add(v.group);var y=(i=p,o=e,a=t,s=i?(0,bn.Tj)(i&&i.dimensions,function(e){var t=o.getData().getDimensionInfo(o.getData().mapDimension(e))||{};return(0,bn.X$)((0,bn.X$)({},t),{name:e,ordinalMeta:null})}):[{name:"value",type:"float"}],l=new wE.A(s,a),u=new wE.A(s,a),c=new wE.A([],a),d=(0,bn.Tj)(a.get("data"),(0,bn.cF)(_$,o,i,a)),i&&(d=(0,bn.pb)(d,(0,bn.cF)(_U,i))),h=_p(!!i,s),l.initData((0,bn.Tj)(d,function(e){return e[0]}),null,h),u.initData((0,bn.Tj)(d,function(e){return e[1]}),null,h),c.initData((0,bn.Tj)(d,function(e){return e[2]})),c.hasItemOption=!0,{from:l,to:u,line:c}),x=y.from,b=y.to,w=y.line;_H(t).from=x,_H(t).to=b,t.setData(w);var S=t.get("symbol"),A=t.get("symbolSize"),C=t.get("symbolRotate"),M=t.get("symbolOffset");function k(t,n,i){var o=t.getItemModel(n);_q(t,n,i,e,r);var a=o.getModel("itemStyle").getItemStyle();null==a.fill&&(a.fill=(0,TM.rI)(g,"color")),t.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:(0,bn.bZ)(o.get("symbolOffset",!0),M[+!i]),symbolRotate:(0,bn.bZ)(o.get("symbolRotate",!0),C[+!i]),symbolSize:(0,bn.bZ)(o.get("symbolSize"),A[+!i]),symbol:(0,bn.bZ)(o.get("symbol",!0),S[+!i]),style:a})}(0,bn.cy)(S)||(S=[S,S]),(0,bn.cy)(A)||(A=[A,A]),(0,bn.cy)(C)||(C=[C,C]),(0,bn.cy)(M)||(M=[M,M]),y.from.each(function(e){k(x,e,!0),k(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){(0,bx.z)(e).dataModel=t,e.traverse(function(e){(0,bx.z)(e).dataModel=t})}),this.markKeep(v),v.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(_m),_X=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},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}(_i);function _Z(e,t,n){var r=t.coordinateSystem;e.each(function(i){var o,a=e.getItemModel(i),s=wI.lo(a.get("x"),n.getWidth()),l=wI.lo(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)o=t.getMarkerPosition(e.getValues(e.dimensions,i));else if(r){var u=e.get(r.dimensions[0],i),c=e.get(r.dimensions[1],i);o=r.dataToPoint([u,c])}}else o=[s,l];isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),e.setItemLayout(i,o)})}var _K=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,bs.C6)(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=_i.getMarkerModelFromSeries(e,"markPoint");t&&(_Z(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())},this)},t.prototype.renderSeries=function(e,t,n,r){var i,o,a,s,l,u,c,d=e.coordinateSystem,h=e.id,p=e.getData(),f=this.markerGroupMap,g=f.get(h)||f.set(h,new b3),m=(i=d,o=e,a=t,s=i?(0,bn.Tj)(i&&i.dimensions,function(e){var t=o.getData().getDimensionInfo(o.getData().mapDimension(e))||{};return(0,bn.X$)((0,bn.X$)({},t),{name:e,ordinalMeta:null})}):[{name:"value",type:"float"}],l=new wE.A(s,a),u=(0,bn.Tj)(a.get("data"),(0,bn.cF)(_c,o)),i&&(u=(0,bn.pb)(u,(0,bn.cF)(_h,i))),c=_p(!!i,s),l.initData(u,null,c),l);t.setData(m),_Z(t.getData(),e,r),m.each(function(e){var n=m.getItemModel(e),r=n.getShallow("symbol"),i=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),a=n.getShallow("symbolOffset"),s=n.getShallow("symbolKeepAspect");if((0,bn.Tn)(r)||(0,bn.Tn)(i)||(0,bn.Tn)(o)||(0,bn.Tn)(a)){var l=t.getRawValue(e),u=t.getDataParams(e);(0,bn.Tn)(r)&&(r=r(l,u)),(0,bn.Tn)(i)&&(i=i(l,u)),(0,bn.Tn)(o)&&(o=o(l,u)),(0,bn.Tn)(a)&&(a=a(l,u))}var c=n.getModel("itemStyle").getItemStyle(),d=(0,TM.rI)(p,"color");c.fill||(c.fill=d),m.setItemVisual(e,{symbol:r,symbolSize:i,symbolRotate:o,symbolOffset:a,symbolKeepAspect:s,style:c})}),g.updateData(m),this.group.add(g.group),m.eachItemGraphicEl(function(e){e.traverse(function(e){(0,bx.z)(e).dataModel=t})}),this.markKeep(g),g.group.silent=t.get("silent")||e.get("silent")},t.type="markPoint",t}(_m),_Q=n(72076),_J=n(74915),_0=n(47865),_1=n(54729),_2=n(63154);function _5(e,t,n){var r=AZ.yh.createCanvas(),i=t.getWidth(),o=t.getHeight(),a=r.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=i+"px",a.height=o+"px",r.setAttribute("data-zr-dom-id",e)),r.width=i*n,r.height=o*n,r}var _4=function(e){function t(t,n,r){var i,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,r=r||_Q.Y5,"string"==typeof t?i=_5(t,n,r):bn.Gv(t)&&(t=(i=t).id),o.id=t,o.dom=i;var a=i.style;return a&&(bn.iq(i),i.onselectstart=function(){return!1},a.padding="0",a.margin="0",a.borderWidth="0"),o.painter=n,o.dpr=r,o}return(0,_J.C6)(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=_5("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,r){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var i,o=[],a=this.maxRepaintRectCount,s=!1,l=new w5.A(0,0,0,0);function u(e){if(!(!e.isFinite()||e.isZero()))if(0===o.length){var t=new w5.A(0,0,0,0);t.copy(e),o.push(t)}else{for(var n=!1,r=1/0,i=0,u=0;u<o.length;++u){var c=o[u];if(c.intersect(e)){var d=new w5.A(0,0,0,0);d.copy(c),d.union(e),o[u]=d,n=!0;break}if(s){l.copy(e),l.union(c);var h=e.width*e.height,p=c.width*c.height,f=l.width*l.height-h-p;f<r&&(r=f,i=u)}}if(s&&(o[i].union(e),n=!0),!n){var t=new w5.A(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 d=e[c];if(d){var h=d.shouldBePainted(n,r,!0,!0),p=d.__isRendered&&(d.__dirty&_2.M||!h)?d.getPrevPaintRect():null;p&&u(p);var f=h&&(d.__dirty&_2.M||!d.__isRendered)?d.getPaintRect():null;f&&u(f)}}for(var c=this.__prevStartIndex;c<this.__prevEndIndex;++c){var d=t[c],h=d&&d.shouldBePainted(n,r,!0,!0);if(d&&(!h||!d.__zr)&&d.__isRendered){var p=d.getPrevPaintRect();p&&u(p)}}do{i=!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])?(i=!0,o[c].union(o[g]),o.splice(g,1)):g++;c++}}while(i);return this._paintRects=o,o},t.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},t.prototype.resize=function(e,t){var n=this.dpr,r=this.dom,i=r.style,o=this.domBack;i&&(i.width=e+"px",i.height=t+"px"),r.width=e*n,r.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 r=this.dom,i=this.ctx,o=r.width,a=r.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(r,0,0,o/u,a/u));var d=this.domBack;function h(e,n,r,o){if(i.clearRect(e,n,r,o),t&&"transparent"!==t){var a=void 0;bn.C7(t)?(a=(t.global||t.__width===r&&t.__height===o)&&t.__canvasGradient||(0,_0.Ff)(i,t,{x:0,y:0,width:r,height:o}),t.__canvasGradient=a,t.__width=r,t.__height=o):bn.HE(t)&&(t.scaleX=t.scaleX||u,t.scaleY=t.scaleY||u,a=(0,_1.ZQ)(i,t,{dirty:function(){c.setUnpainted(),c.painter.refresh()}})),i.save(),i.fillStyle=a||t,i.fillRect(e,n,r,o),i.restore()}s&&(i.save(),i.globalAlpha=l,i.drawImage(d,e,n,r,o),i.restore())}!n||s?h(0,0,o,a):n.length&&bn.__(n,function(e){h(e.x*u,e.y*u,e.width*u,e.height*u)})},t}(Cl.A),_3=n(94263),_6=function(){function e(e,t,n,r){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var i=!e.nodeName||"CANVAS"===e.nodeName.toUpperCase();this._opts=n=bn.X$({},n||{}),this.dpr=n.devicePixelRatio||_Q.Y5,this._singleCanvas=i,this.root=e,e.style&&(bn.iq(e),e.innerHTML=""),this.storage=t;var o=this._zlevelList;this._prevDisplayList=[];var a=this._layers;if(i){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 _4(e,this,this.dpr);u.__builtin__=!0,u.initContext(),a[314159]=u,u.zlevel=314159,o.push(314159),this._domRoot=e}else{this._width=(0,_0.YC)(e,0,n),this._height=(0,_0.YC)(e,1,n);var c,d,h,p=this._domRoot=(c=this._width,d=this._height,(h=document.createElement("div")).style.cssText=["position:relative","width:"+c+"px","height:"+d+"px","padding:0;margin:0;border-width:0"].join(";")+";",h);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,r=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,n,e,this._redrawId);for(var i=0;i<r.length;i++){var o=r[i],a=this._layers[o];if(!a.__builtin__&&a.refresh){var s=0===i?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,r=this._hoverlayer;if(r&&r.clear(),n){for(var i={inHover:!0,viewWidth:this._width,viewHeight:this._height},o=0;o<n;o++){var a=e[o];a.__inHover&&(r||(r=this._hoverlayer=this.getLayer(1e5)),t||(t=r.ctx).save(),(0,_1.V$)(t,a,i,o===n-1))}t&&t.restore()}},e.prototype.getHoverLayer=function(){return this.getLayer(1e5)},e.prototype.paintOne=function(e,t){(0,_1.Xi)(e,t)},e.prototype._paintList=function(e,t,n,r){if(this._redrawId===r){n=n||!1,this._updateLayerStatus(e);var i=this._doPaintList(e,t,n),o=i.finished,a=i.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),a&&this._paintHoverList(e),o)this.eachLayer(function(e){e.afterBrush&&e.afterBrush()});else{var s=this;(0,_3.A)(function(){s._paintList(e,t,n,r)})}}},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(r){r.virtual&&e.drawImage(r.dom,0,0,t,n)})},e.prototype._doPaintList=function(e,t,n){for(var r=this,i=[],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)&&i.push(l)}for(var u=!0,c=!1,d=this,h=0;h<i.length;h++)!function(a){var s,l=i[a],h=l.ctx,p=o&&l.createRepaintRects(e,t,d._width,d._height),f=n?l.__startIndex:l.__drawIndex,g=!n&&l.incremental&&Date.now,m=g&&Date.now(),v=l.zlevel===d._zlevelList[0]?d._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:r._width,viewHeight:r._height};for(s=f;s<l.__endIndex;s++){var i=e[s];if(i.__inHover&&(c=!0),r._doPaintEl(i,l,o,t,n,s===l.__endIndex-1),g&&Date.now()-m>15)break}n.prevElClipPaths&&h.restore()};if(p)if(0===p.length)s=l.__endIndex;else for(var b=d.dpr,w=0;w<p.length;++w){var S=p[w];h.save(),h.beginPath(),h.rect(S.x*b,S.y*b,S.width*b,S.height*b),h.clip(),x(S),h.restore()}else h.save(),x(),h.restore();l.__drawIndex=s,l.__drawIndex<l.__endIndex&&(u=!1)}(h);return Mp.A.wxa&&bn.__(this._layers,function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()}),{finished:u,needsRefreshHover:c}},e.prototype._doPaintEl=function(e,t,n,r,i,o){var a=t.ctx;if(n){var s=e.getPaintRect();(!r||s&&s.intersect(r))&&((0,_1.V$)(a,e,i,o),e.setPrevPaintRect(s))}else(0,_1.V$)(a,e,i,o)},e.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=314159);var n=this._layers[e];return n||((n=new _4("zr_"+e,this,this.dpr)).zlevel=e,n.__builtin__=!0,this._layerConfig[e]?bn.h1(n,this._layerConfig[e],!0):this._layerConfig[e-.01]&&bn.h1(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,r=this._zlevelList,i=r.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(i>0&&e>r[0]){for(s=0;s<i-1&&(!(r[s]<e)||!(r[s+1]>e));s++);a=n[r[s]]}if(r.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,r=0;r<n.length;r++){var i=n[r];e.call(t,this._layers[i],i)}},e.prototype.eachBuiltinLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],o=this._layers[i];o.__builtin__&&e.call(t,o,i)}},e.prototype.eachOtherLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],o=this._layers[i];o.__builtin__||e.call(t,o,i)}},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,r,i=1;i<e.length;i++){var o=e[i];if(o.zlevel!==e[i-1].zlevel||o.incremental){this._needsManuallyCompositing=!0;break}}var a=null,s=0;for(r=0;r<e.length;r++){var o=e[r],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__||bn.vV("ZLevel "+l+" has been used by unkown layer "+u.id),u!==a&&(u.__used=!0,u.__startIndex!==r&&(u.__dirty=!0),u.__startIndex=r,u.incremental?u.__drawIndex=-1:u.__drawIndex=r,t(r),a=u),o.__dirty&_2.M&&!o.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=r))}t(r),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,bn.__(this._layers,function(e){e.setUnpainted()})},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?bn.h1(n[e],t,!0):n[e]=t;for(var r=0;r<this._zlevelList.length;r++){var i=this._zlevelList[r];if(i===e||i===e+.01){var o=this._layers[i];bn.h1(o,n[e],!0)}}}},e.prototype.delLayer=function(e){var t=this._layers,n=this._zlevelList,r=t[e];r&&(r.dom.parentNode.removeChild(r.dom),delete t[e],n.splice(bn.qh(n,e),1))},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var r=this._opts,i=this.root;if(null!=e&&(r.width=e),null!=t&&(r.height=t),e=(0,_0.YC)(i,0,r),t=(0,_0.YC)(i,1,r),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 _4("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 r=t.dom.width,i=t.dom.height;this.eachLayer(function(e){e.__builtin__?n.drawImage(e.dom,0,0,r,i):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++){var u=a[s];(0,_1.V$)(n,u,o,s===l-1)}return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e}();(0,Si.Y)([function(e){e.registerComponentModel(A4),e.registerComponentView(A3)},function(e){(0,Si.Y)(CO),(0,Si.Y)(CV)},function(e){(0,Si.Y)(C1),(0,Si.Y)(C9)},function(e){e.registerChartView(bL),e.registerSeriesModel(bh),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,bn.cF(br.Zp,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,(0,br.KF)("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,ba("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(wA),e.registerSeriesModel(bQ),e.registerLayout(wM("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,ba("line"))},function(e){e.registerChartView(wO),e.registerSeriesModel(wL)},function(e){e.registerChartView(w7),e.registerSeriesModel(Sr),(0,wN.I)("pie",e.registerAction),e.registerLayout((0,bn.cF)(wH,"pie")),e.registerProcessor({seriesType:"pie",reset:function(e,t){var n=t.findComponents({mainType:"legend"});if(n&&n.length){var r=e.getData();r.filterSelf(function(e){for(var t=r.getName(e),i=0;i<n.length;i++)if(!n[i].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"),r=n.get(t,e);return!(0,bn.Et)(r)||!!isNaN(r)||!(r<0)})}})},function(e){(0,Si.Y)(AY),e.registerSeriesModel(So),e.registerChartView(Su),e.registerLayout(wM("scatter"))},AX.a,function(e){e.registerChartView(AJ),e.registerSeriesModel(A1)},function(e){(0,Si.Y)(AY),(0,Si.Y)(MI)},function(e){e.registerComponentModel(MD),e.registerComponentView(MO)},function(e){e.registerComponentModel(MB),e.registerComponentView(MF),MN.saveAsImage=Mj,MN.magicType=M$,MN.dataView=MY,MN.dataZoom=kG,MN.restore=MQ,(0,Si.Y)(MP)},function(e){(0,Si.Y)(MI),e.registerComponentModel(kY),e.registerComponentView(Ta),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},bn.lQ),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},bn.lQ)},function(e){e.registerPainter("canvas",_6)},function(e){(0,Si.Y)(T3),(0,Si.Y)(_e)},function(e){e.registerComponentModel(_o),e.registerComponentView(_C),e.registerPreprocessor(function(e){_t(e.series,"markArea")&&(e.markArea=e.markArea||{})})},function(e){e.registerComponentModel(_M),e.registerComponentView(_Y),e.registerPreprocessor(function(e){_t(e.series,"markLine")&&(e.markLine=e.markLine||{})})},function(e){e.registerComponentModel(_X),e.registerComponentView(_K),e.registerPreprocessor(function(e){_t(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}]);let _8=["click","dblclick","mousedown","mousemove","mouseup","mouseover","mouseout","globalout","contextmenu"],_9=["datazoom","downplay","highlight"],_7=(0,I.memo)(function({option:e,theme:t,renderer:n,sx:r,style:i,onEvents:o,_instance:a,syncGroup:s,onChartInitialized:l}){let u=(0,I.useRef)(e),c=(0,I.useRef)(e),d=(0,I.useRef)(null),h=(0,I.useRef)(null);return(0,I.useLayoutEffect)(()=>{if(null!==d.current&&null===h.current&&(h.current=(0,Cc.Ts)(d.current,t,{renderer:n??"canvas"}),void 0!==h.current))return h.current.setOption(u.current,!0),l?.(h.current),void 0!==a&&(a.current=h.current),()=>{null!==h.current&&(h.current.dispose(),h.current=null)}},[a,l,t,n]),(0,I.useEffect)(()=>{h.current&&s&&(h.current.group=s,(0,Cc.Ng)([h.current]))},[s,h]),(0,I.useEffect)(()=>{void 0===c.current||oD(c.current,e)||h.current&&(h.current.setOption(e,!0),c.current=e)},[e]),(0,I.useLayoutEffect)(()=>{let e=vl(()=>{h.current&&h.current.resize()},200);return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[]),(0,I.useEffect)(()=>{let e=h.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 r=t[n]??null;r&&function(t,n){var r,i;"function"==typeof n&&((r=t,_8.includes(r))?e.on(t,t=>n(t,e)):(i=t,_9.includes(i))?e.on(t,e=>n(e)):e.on(t,()=>n(null,e)))}(n,r)}}}(e,o),()=>{if(void 0!==e&&!0!==e.isDisposed())for(let t in o)e.off(t)}},[o]),(0,I.useEffect)(()=>{vl(()=>{h.current&&h.current.resize()},200,{leading:!0})()},[r,i]),(0,_.jsx)(uQ,{ref:d,sx:r,style:i})});var Ie=n(17157);function It(e,t){return function(n){let r=new Date(Number(n));return e>15768e7?(0,Ie.formatWithTimeZone)(r,"yyyy",t):e>15552e6?(0,Ie.formatWithTimeZone)(r,"MMM yyyy",t):e>864e6?(0,Ie.formatWithTimeZone)(r,"dd.MM",t):e>1728e5?(0,Ie.formatWithTimeZone)(r,"dd.MM HH:mm",t):(0,Ie.formatWithTimeZone)(r,"HH:mm",t)}}function In(e){return(0,V.Ay)("MuiAlert",e)}let Ir=(0,j.A)("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),Ii=(0,fo.A)((0,_.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),Io=(0,fo.A)((0,_.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Ia=(0,fo.A)((0,_.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.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"}),"ErrorOutline"),Is=(0,fo.A)((0,_.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Il=(0,N.A)(vz.A,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${(0,L.A)(n.color||n.severity)}`]]}})((0,B.A)(({theme:e})=>{let t="light"===e.palette.mode?E.e$:E.a,n="light"===e.palette.mode?E.a:E.e$;return{...e.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter((0,z.A)(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${r}StandardBg`]:n(e.palette[r].light,.9),[`& .${Ir.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter((0,z.A)(["light"])).map(([n])=>({props:{colorSeverity:n,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${n}Color`]:t(e.palette[n].light,.6),border:`1px solid ${(e.vars||e).palette[n].light}`,[`& .${Ir.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}}})),...Object.entries(e.palette).filter((0,z.A)(["dark"])).map(([t])=>({props:{colorSeverity:t,variant:"filled"},style:{fontWeight:e.typography.fontWeightMedium,...e.vars?{color:e.vars.palette.Alert[`${t}FilledColor`],backgroundColor:e.vars.palette.Alert[`${t}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[t].dark:e.palette[t].main,color:e.palette.getContrastText(e.palette[t].main)}}}))]}})),Iu=(0,N.A)("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Ic=(0,N.A)("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),Id=(0,N.A)("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),Ih={success:(0,_.jsx)(Ii,{fontSize:"inherit"}),warning:(0,_.jsx)(Io,{fontSize:"inherit"}),error:(0,_.jsx)(Ia,{fontSize:"inherit"}),info:(0,_.jsx)(Is,{fontSize:"inherit"})},Ip=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiAlert"}),{action:r,children:i,className:o,closeText:a="Close",color:s,components:l={},componentsProps:u={},icon:c,iconMapping:d=Ih,onClose:h,role:p="alert",severity:f="success",slotProps:g={},slots:m={},variant:v="standard",...y}=n,x={...n,color:s,severity:f,variant:v,colorSeverity:s||f},b=(e=>{let{variant:t,color:n,severity:r,classes:i}=e,o={root:["root",`color${(0,L.A)(n||r)}`,`${t}${(0,L.A)(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return(0,R.A)(o,In,i)})(x),w={slots:{closeButton:l.CloseButton,closeIcon:l.CloseIcon,...m},slotProps:{...u,...g}},[S,A]=(0,cn.A)("root",{ref:t,shouldForwardComponentProp:!0,className:(0,O.A)(b.root,o),elementType:Il,externalForwardedProps:{...w,...y},ownerState:x,additionalProps:{role:p,elevation:0}}),[C,M]=(0,cn.A)("icon",{className:b.icon,elementType:Iu,externalForwardedProps:w,ownerState:x}),[k,T]=(0,cn.A)("message",{className:b.message,elementType:Ic,externalForwardedProps:w,ownerState:x}),[I,D]=(0,cn.A)("action",{className:b.action,elementType:Id,externalForwardedProps:w,ownerState:x}),[E,P]=(0,cn.A)("closeButton",{elementType:eA,externalForwardedProps:w,ownerState:x}),[N,B]=(0,cn.A)("closeIcon",{elementType:yR,externalForwardedProps:w,ownerState:x});return(0,_.jsxs)(S,{...A,children:[!1!==c?(0,_.jsx)(C,{...M,children:c||d[f]||Ih[f]}):null,(0,_.jsx)(k,{...T,children:i}),null!=r?(0,_.jsx)(I,{...D,children:r}):null,null==r&&h?(0,_.jsx)(I,{...D,children:(0,_.jsx)(E,{size:"small","aria-label":a,title:a,color:"inherit",onClick:h,...P,children:(0,_.jsx)(N,{fontSize:"small",...B})})}):null]})});function If(e){let{error:t}=e;return(0,_.jsx)(Ip,{severity:"error",children:t.message})}var Ig=n(77440);let Im=[{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 Iv({value:e,onChange:t}){return(0,_.jsx)(yo,{label:"Font Size",control:(0,_.jsx)(yY,{value:Im.find(t=>t.value===e),options:Im,getOptionLabel:e=>e.label,onChange:(e,{value:n})=>{t(n)},disableClearable:!0})})}function Iy({action:e,submitText:t="Save",cancelText:n="Cancel",isReadonly:r,isValid:i,onActionChange:o,onSubmit:a,onDelete:s,onCancel:l,...u}){return(0,_.jsx)(ey.A,{direction:"row",gap:1,sx:{marginLeft:"auto"},...u,children:"read"===e?(0,_.jsxs)(_.Fragment,{children:[o&&(0,_.jsx)(em,{disabled:r,variant:"contained",onClick:()=>o("update"),children:"Edit"}),s&&(0,_.jsx)(em,{color:"error",disabled:r,variant:"outlined",onClick:s,children:"Delete"}),l&&(a||s)&&(0,_.jsx)(gz,{orientation:"vertical",flexItem:!0,sx:{borderColor:e=>e.palette.grey["500"],"&.MuiDivider-root":{marginLeft:2,marginRight:1}}}),l&&(0,_.jsx)(em,{color:"secondary",variant:"outlined",onClick:l,children:n})]}):(0,_.jsxs)(_.Fragment,{children:[a&&(0,_.jsx)(em,{variant:"contained",disabled:!i,onClick:a,children:t}),l&&(0,_.jsx)(em,{color:"secondary",variant:"outlined",onClick:l,children:n})]})})}let Ix=0;class Ib{constructor(e,t){this.from=e,this.to=t}}class Iw{constructor(e={}){this.id=Ix++,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=IC.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}Iw.closedBy=new Iw({deserialize:e=>e.split(" ")}),Iw.openedBy=new Iw({deserialize:e=>e.split(" ")}),Iw.group=new Iw({deserialize:e=>e.split(" ")}),Iw.isolate=new Iw({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw RangeError("Invalid value for isolate: "+e);return e||"auto"}}),Iw.contextHash=new Iw({perNode:!0}),Iw.lookAhead=new Iw({perNode:!0}),Iw.mounted=new Iw({perNode:!0});class IS{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[Iw.mounted.id]}}let IA=Object.create(null);class IC{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):IA,n=!!e.top|2*!!e.skipped|4*!!e.error|8*(null==e.name),r=new IC(e.name||"",t,e.id,n);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(r)),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 r}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(Iw.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 r of n.split(" "))t[r]=e[n];return e=>{for(let n=e.prop(Iw.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}}IC.none=new IC("",Object.create(null),0,8);class IM{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 r=null;for(let t of e){let e=t(n);if(e){r||(r=Object.assign({},n.props));let t=e[1],i=e[0];i.combine&&i.id in r&&(t=i.combine(r[i.id],t)),r[i.id]=t}}t.push(r?new IC(n.name,r,n.id,n.flags):n)}return new IM(t)}}let Ik=new WeakMap,IT=new WeakMap;(m=k||(k={}))[m.ExcludeBuffers=1]="ExcludeBuffers",m[m.IncludeAnonymous=2]="IncludeAnonymous",m[m.IgnoreMounts=4]="IgnoreMounts",m[m.IgnoreOverlays=8]="IgnoreOverlays",m[m.EnterBracketed=16]="EnterBracketed";class I_{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length)for(let[e,t]of(this.props=Object.create(null),i))this.props["number"==typeof e?e:e.id]=t}toString(){let e=IS.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 IV(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new IV(Ik.get(this)||this.topNode);return r.moveTo(e,t),Ik.set(this,r._tree),r}get topNode(){return new IP(this,0,0,null)}resolve(e,t=0){let n=IR(Ik.get(this)||this.topNode,e,t,!1);return Ik.set(this,n),n}resolveInner(e,t=0){let n=IR(IT.get(this)||this.topNode,e,t,!0);return IT.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof IP?r:r.context.parent;e;e=e.parent)if(e.index<0){let o=e.parent;(i||(i=[r])).push(o.resolve(t,n)),e=o}else{let o=IS.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let a=new IP(o.tree,o.overlay[0].from+e.from,-1,e);(i||(i=[r])).push(IR(a,t,n,!1))}}return i?IF(i):r}(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,o=e.mode||0,a=(o&k.IncludeAnonymous)>0;for(let e=this.cursor(o|k.IncludeAnonymous);;){let o=!1;if(e.from<=i&&e.to>=r&&(!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:IG(IC.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new I_(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new I_(IC.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=1024,reused:o=[],minRepeatType:a=r.types.length}=e,s=Array.isArray(n)?new II(n,n.length):n,l=r.types,u=0,c=0;function d(e,t,n,i,o,a,s,l,u){let c=[],d=[];for(;e.length>i;)c.push(e.pop()),d.push(t.pop()+n-o);e.push(h(r.types[s],c,d,a-o,l-a,u)),t.push(o-n)}function h(e,t,n,r,i,o,a){if(o){let e=[Iw.contextHash,o];a=a?[e].concat(a):[e]}if(i>25){let e=[Iw.lookAhead,i];a=a?[e].concat(a):[e]}return new I_(e,t,n,r,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 A=l[v],C,M,k=y-t;if(x-y<=i&&(M=function(e,t){let n=s.fork(),r=0,o=0,l=0,u=n.end-i,c={size:0,start:0,skip:0};t:for(let i=n.pos-e;n.pos>i;){let e=n.size;if(n.id==t&&e>=0){c.size=r,c.start=o,c.skip=l,l+=4,r+=4,n.next();continue}let s=n.pos-e;if(e<0||s<i||n.start<u)break;let d=4*(n.id>=a),h=n.start;for(n.next();n.pos>s;){if(n.size<0)if(-3==n.size||-4==n.size)d+=4;else break t;else n.id>=a&&(d+=4);n.next()}o=h,r+=e,l+=d}return(t<0||r==e)&&(c.size=r,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,i=e.length;for(;s.pos>n;)i=function e(t,n,r){let{id:i,start:o,end:l,size:d}=s;if(s.next(),d>=0&&i<a){let a=r;if(d>4){let i=s.pos-(d-4);for(;s.pos>i;)r=e(t,n,r)}n[--r]=a,n[--r]=l-t,n[--r]=o-t,n[--r]=i}else -3==d?u=i:-4==d&&(c=i);return r}(M.start,e,i);C=new ID(e,x-M.start,r),k=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-i&&(d(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:r}=s;if(r>4)s.next();else if(u>-1&&t<u)break;else u<0&&(u=n-i),a.push(e,t,n),l++,s.next()}if(l){let t=new Uint16Array(4*l),i=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]-i,t[n++]=a[e+2]-i,t[n++]=n;n.push(new ID(t,a[2]-i,r)),o.push(i-e)}}(y,t,n,o):e(y,t,n,o,l,m+1);if(l>=0&&u>0&&u<n.length&&d(n,o,y,u,y,c,l,w,S),n.reverse(),o.reverse(),l>-1&&u>0){let e=function(e,t){return(n,r,i)=>{let o=0,a=n.length-1,s,l;if(a>=0&&(s=n[a])instanceof I_){if(!a&&s.type==e&&s.length==i)return s;(l=s.prop(Iw.lookAhead))&&(o=r[a]+s.length+l)}return h(e,n,r,i,o,t)}}(A,S);C=IG(A,n,o,0,n.length,0,x-y,e,e)}else C=h(A,n,o,x-y,w-x,S)}p.push(C),f.push(k)}(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 I_(l[e.topID],p.reverse(),f.reverse(),g)}(e)}}I_.empty=new I_(IC.none,[],[],0);class II{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 II(this.buffer,this.index)}}class ID{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return IC.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],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),n==(e+=4))return i;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return i+"("+o.join(",")+")"}findChild(e,t,n,r,i){let{buffer:o}=this,a=-1;for(let s=e;s!=t&&(!IO(i,r,o[s+1],o[s+2])||(a=s,!(n>0)));s=o[s+3]);return a}slice(e,t,n){let r=this.buffer,i=new Uint16Array(t-e),o=0;for(let a=e,s=0;a<t;){i[s++]=r[a++],i[s++]=r[a++]-n;let t=i[s++]=r[a++]-n;i[s++]=r[a++]-e,o=Math.max(o,t)}return new ID(i,o,this.set)}}function IO(e,t,n,r){switch(e){case -2:return n<t;case -1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function IR(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof IP&&e.index<0?null:e.parent;if(!t)return e;e=t}let o=r?0:k.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;a=(r=a).parent)r instanceof IP&&r.index<0&&(null==(i=a.enter(t,n,o))?void 0:i.from)!=r.from&&(e=a);for(;;){let r=e.enter(t,n,o);if(!r)return e;e=r}}class IE{cursor(e=0){return new IV(this,e)}getChild(e,t=null,n=null){let r=IL(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return IL(this,e,t,n)}resolve(e,t=0){return IR(this,e,t,!1)}resolveInner(e,t=0){return IR(this,e,t,!0)}matchContext(e){return IN(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 IP extends IE{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}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,r,i=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(i&k.EnterBracketed&&l instanceof I_&&(c=IS.get(l))&&!c.overlay&&c.bracketed&&n>=u&&n<=u+l.length||IO(r,n,u,u+l.length)){if(l instanceof ID){if(i&k.ExcludeBuffers)continue;let a=l.findChild(0,l.buffer.length,t,n-u,r);if(a>-1)return new Iz(new IB(o,l,e,u),null,a)}else if(i&k.IncludeAnonymous||!l.type.isAnonymous||IH(l)){let a;if(!(i&k.IgnoreMounts)&&(a=IS.get(l))&&!a.overlay)return new IP(a.tree,u,e,o);let s=new IP(l,u,e,o);return i&k.IncludeAnonymous||!s.type.isAnonymous?s:s.nextChild(t<0?l.children.length-1:0,t,n,r,i)}}}if(i&k.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 r;if(!(n&k.IgnoreOverlays)&&(r=IS.get(this._tree))&&r.overlay){let i=e-this.from,o=n&k.EnterBracketed&&r.bracketed;for(let{from:e,to:n}of r.overlay)if((t>0||o?e<=i:e<i)&&(t<0||o?n>=i:n>i))return new IP(r.tree,r.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 IL(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(null!=n){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return o}for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}function IN(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class IB{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class Iz extends IE{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:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return i<0?null:new Iz(this.context,this,i)}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&k.ExcludeBuffers)return null;let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return i<0?null:new Iz(this.context,this,i)}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 Iz(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 Iz(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let o=n.buffer[this.index+1];e.push(n.slice(r,i,o)),t.push(0)}return new I_(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function IF(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof IP&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new Ij(i,n)}class Ij{constructor(e,t){this.heads=e,this.node=t}get next(){return IF(this.heads)}}class IV{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&~k.EnterBracketed,e instanceof IP)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:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return!!e&&(e instanceof IP?(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:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}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&k.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&k.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&k.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:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&k.IncludeAnonymous||e instanceof ID||!e.type.isAnonymous||IH(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)t:for(let r=this.index,i=this.stack.length;i>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=i+1;break t}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new Iz(this.buffer,t,this.stack[e]);return this.bufferNode=new Iz(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return IN(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return IN(this._tree,e,r);let o=n[t.buffer[this.stack[i]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function IH(e){return e.children.some(e=>e instanceof ID||!e.type.isAnonymous||IH(e))}let I$=new WeakMap;function IW(e,t){if(!e.isAnonymous||t instanceof ID||t.type!=e)return 1;let n=I$.get(t);if(null==n){for(let r of(n=1,t.children)){if(r.type!=e||!(r instanceof I_)){n=1;break}n+=IW(e,r)}I$.set(t,n)}return n}function IG(e,t,n,r,i,o,a,s,l){let u=0;for(let n=r;n<i;n++)u+=IW(e,t[n]);let c=Math.ceil(1.5*u/8),d=[],h=[];return!function t(n,r,i,a,s){for(let u=i;u<a;){let i=u,p=r[u],f=IW(e,n[u]);for(u++;u<a;u++){let t=IW(e,n[u]);if(f+t>=c)break;f+=t}if(u==i+1){if(f>c){let e=n[i];t(e.children,e.positions,0,e.children.length,r[i]+s);continue}d.push(n[i])}else{let t=r[u-1]+n[u-1].length-p;d.push(IG(e,n,r,i,u,p,t,null,l))}h.push(p+s-o)}}(t,n,r,i,0),(s||l)(d,h,a)}class IU{constructor(e,t,n,r,i=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|2*!!o}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let r=[new IU(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&r.push(n);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],i=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 IU(e,n,t.tree,t.offset+l,a>0,!!u)}if(t&&r.push(t),o.to>c)break;o=i<e.length?e[i++]:null}if(!u)break;s=u.toA,l=u.toA-u.toB}return r}}class Iq{startParse(e,t,n){return"string"==typeof e&&(e=new IY(e)),n=n?n.length?n.map(e=>new Ib(e.from,e.to)):[new Ib(0,0)]:[new Ib(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}}class IY{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 Iw({perNode:!0});class IX{constructor(e,t,n,r,i,o,a,s,l,u=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,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 r=e.parser.context;return new IX(e,[],t,n,n,0,[],0,r?new IZ(r,r.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,r=65535&e,{parser:i}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=i.dynamicPrecedence(r);if(a&&(this.score+=a),0==n){r<i.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(i.getGoto(this.state,r,!0),this.reducePos),r<i.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,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;r<i.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[r])?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,d=this.bufferBase+this.buffer.length-c;if(r<i.minRepeatTerm||131072&e){let e=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,l,e,d+4,!0)}if(262144&e)this.state=this.stack[s];else{let e=this.stack[s-3];this.state=i.getGoto(e,r,!0)}for(;this.stack.length>s;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,t,n,r=4,i=!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(i&&this.pos!=n){let i=this.buffer.length;if(i>0&&(0!=this.buffer[i-4]||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}else this.buffer.push(e,t,n,r)}shift(e,t,n,r){if(131072&e)this.pushState(65535&e,this.pos);else if((262144&e)==0){let{parser:i}=this.p;this.pos=r;let o=i.stateFlag(e,1);!o&&(r>n||t<=i.maxNode)&&(this.reducePos=r),this.pushState(e,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=i.maxNode&&this.buffer.push(t,n,r,4)}else this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4)}apply(e,t,n,r){65536&e?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,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),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new IX(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,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 IK(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 r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>1&t&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}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,r=65535&t,i=this.stack.length-3*n;if(i<0||0>e.getGoto(this.stack[i],r,!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=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-i;if(n>1){let r=65535&t,i=this.stack.length-3*n;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+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 IZ(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 IZ{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class IK{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 IQ{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 IQ(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 IQ(this.stack,this.pos,this.index)}}function IJ(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let r=0,i=0;r<e.length;){let o=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(126==t){o=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),o+=i,n)break;o*=46}n?n[i++]=o:n=new t(o)}return n}class I0{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}let I1=new I0;class I2{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=I1,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,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}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,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=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)r=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)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}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=I1,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 r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class I5{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;I4(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}function I4(e,t,n,r,i,o){let a=0,s=1<<r,{dialect:l}=n.p.parser;t:for(;(s&e[a])!=0;){let n=e[a+1];for(let r=a+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(l.allows(n)&&(-1==t.token.value||t.token.value==n||function(e,t,n,r){let i=I3(n,r,t);return i<0||I3(n,r,e)<i}(n,t.token.value,i,o))){t.acceptToken(n);break}}let r=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 i=u+c>>1,o=n+i+(i<<1),s=e[o],l=e[o+1]||65536;if(r<s)c=i;else if(r>=l)u=i+1;else{a=e[o+2],t.advance();continue t}}break}}function I3(e,t,n){for(let r=t,i;65535!=(i=e[r]);r++)if(i==n)return r-t;return -1}I5.prototype.contextual=I5.prototype.fallback=I5.prototype.extend=!1,(class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?IJ(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(I4(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(!n&&r++,null==i)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}).prototype.contextual=I5.prototype.fallback=I5.prototype.extend=!1;let I6="u">typeof process&&process.env&&/\bparse\b/.test(process.env.LOG),I8=null;function I9(e,t,n){let r=e.cursor(k.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class I7{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?I9(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?I9(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],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],o=this.start[t]+n.positions[r];if(o>e)return this.nextStart=o,null;if(i instanceof I_){if(o==e){if(o<this.safeFrom)return null;let e=o+i.length;if(e<=this.safeTo){let t=i.prop(Iw.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,o+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+i.length}}}class De{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new I0)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,o=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if((1<<r&o)==0)continue;let l=i[r],u=this.tokens[r];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 r=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>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),n||e.pos!=this.stream.end||((n=new I0).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 I0,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){(1&i)==0?e.value=i>>1:e.extended=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:o}=e.p,{data:a}=o;for(let e=0;e<2;e++)for(let s=o.stateSlot(i,e?2:1);;s+=3){if(65535==a[s])if(1==a[s+1])s=Do(a,s+2);else{0==r&&2==a[s+1]&&(r=this.putAction(Do(a,s+2),t,n,r));break}a[s]==t&&(r=this.putAction(Do(a,s+1),t,n,r))}return r}}class Dt{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,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 I2(t,r),this.tokens=new De(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[IX.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>4*e.bufferLength?new I7(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,r=this.minStackPos,i=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>r)i.push(a);else{if(this.advanceStack(a,i,n))continue;e||(e=[],t=[]),e.push(a);let r=this.tokens.getMainToken(a);t.push(r.value,r.end)}break}}if(!i.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 I6&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw I6&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),SyntaxError("No parse at "+r);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,i);if(n)return I6&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(i.length>e)for(i.sort((e,t)=>t.score-e.score);i.length>e;)i.pop();i.some(e=>e.reducePos>r)&&this.recovering--}else if(i.length>1){n:for(let e=0;e<i.length-1;e++){let t=i[e];for(let n=e+1;n<i.length;n++){let r=i[n];if(t.sameState(r)||t.buffer.length>500&&r.buffer.length>500)if((t.score-r.score||t.buffer.length-r.buffer.length)>0)i.splice(n--,1);else{i.splice(e--,1);continue n}}}i.length>12&&(i.sort((e,t)=>t.score-e.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let e=1;e<i.length;e++)i[e].pos<this.minStackPos&&(this.minStackPos=i[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 r=e.pos,{parser:i}=this,o=I6?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&r>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(r);a;){let r=this.parser.nodeSet.types[a.type.id]==a.type?i.getGoto(e.state,a.type.id):-1;if(r>-1&&a.length&&(!t||(a.prop(Iw.contextHash)||0)==n))return e.useNode(a,r),I6&&console.log(o+this.stackID(e)+` (via reuse of ${i.getName(a.type.id)})`),!0;if(!(a instanceof I_)||0==a.children.length||a.positions[0]>0)break;let s=a.children[0];if(s instanceof I_&&0==a.positions[0])a=s;else break}}let a=i.stateSlot(e.state,4);if(a>0)return e.reduce(a),I6&&console.log(o+this.stackID(e)+` (via always-reduce ${i.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++],d=a==s.length||!n,h=d?e:e.split(),p=this.tokens.mainToken;if(h.apply(l,u,p?p.start:h.pos,c),I6&&console.log(o+this.stackID(h)+` (via ${(65536&l)==0?"shift":`reduce of ${i.getName(65535&l)}`} for ${i.getName(u)} @ ${r}${h==e?"":", split"})`),d)return!0;h.pos>r?t.push(h):n.push(h)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Dn(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let o=0;o<e.length;o++){let a=e[o],s=t[o<<1],l=t[(o<<1)+1],u=I6?this.stackID(a)+" -> ":"";if(a.deadEnd&&(i||(i=!0,a.restart(),I6&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let c=a.split(),d=u;for(let e=0;e<10&&c.forceReduce()&&(I6&&console.log(d+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));e++)I6&&(d=this.stackID(c)+" -> ");for(let e of a.recoverByInsert(s))I6&&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),I6&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(s)})`),Dn(a,n)):(!r||r.score<c.score)&&(r=c)}return r}stackToTree(e){return e.close(),I_.build({buffer:IQ.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=(I8||(I8=new WeakMap)).get(e);return t||I8.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function Dn(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class Dr{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}class Di extends Iq{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]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=Iw[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let o=t[n+-r];for(let a=-r;a>0;a--)i(t[n++],e,o);n++}}}this.nodeSet=new IM(t.map((t,i)=>IC.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:0==i,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=IJ(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(Da),this.states=IJ(e.states,Uint32Array),this.data=IJ(e.stateData),this.goto=IJ(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new I5(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 r=new Dt(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return -1;for(let i=r[t+1];;){let t=r[i++],o=1&t,a=r[i++];if(o&&n)return a;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return a;if(o)return -1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),o;;i+=3){if(65535==(o=n[i]))if(1==n[i+1])o=n[i=Do(n,i+2)];else if(2==n[i+1])return Do(n,i+2);else break;if(o==t||0==o)return Do(n,i+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),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==r;n+=3){if(65535==this.data[n])if(1==this.data[n+1])n=Do(this.data,n+2);else break;r=t(Do(this.data,n+1))}return r}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=Do(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(Di.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,r)=>{let i=e.specializers.find(e=>e.from==n.external);if(!i)return n;let o=Object.assign(Object.assign({},n),{external:i.to});return t.specializers[r]=Da(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 r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;65535!=(i=this.data[n++]);)(r||(r=new Uint8Array(this.maxTerm+1)))[i]=1;return new Dr(e,n,r)}static deserialize(e){return new Di(e)}}function Do(e,t){return e[t]|e[t+1]<<16}function Da(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}let Ds=0;class Dl{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Ds++}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 Dl&&(t=e),null==t?void 0:t.base)throw Error("Can not derive from a modified tag");let n=new Dl("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 Dc(e);return e=>e.modified.indexOf(t)>-1?e:Dc.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let Du=0;class Dc{constructor(e){this.name=e,this.instances=[],this.id=Du++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{var r,i;return n.base==e&&(r=t,i=n.modified,r.length==i.length&&r.every((e,t)=>e==i[t]))});if(n)return n;let r=[],i=new Dl(e.name,r,e,t);for(let e of t)e.instances.push(i);let o=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].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)r.push(Dc.get(t,e));return i}}function Dd(e){let t=Object.create(null);for(let n in e){let r=e[n];for(let e of(Array.isArray(r)||(r=[r]),n.split(" ")))if(e){let n=[],i=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!r)throw RangeError("Invalid path: "+e);if(n.push("*"==r[0]?"":'"'==r[0][0]?JSON.parse(r[0]):r[0]),(t+=r[0].length)==e.length)break;let a=e[t++];if(t==e.length&&"!"==a){i=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 Dp(r,i,a>0?n.slice(0,a):null);t[s]=l.sort(t[s])}}return Dh.add(t)}let Dh=new Iw({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let o=new Dp(i.tags,i.mode,i.context);n?n.next=o:r=o,n=o}return r}});class Dp{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}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 Df(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:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+" "+r:r;break}}return t},scope:r}}Dp.empty=new Dp([],2,null);class Dg{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,r,i){let{type:o,from:a,to:s}=e;if(a>=n||s<=t)return;o.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(o)));let l=r,u=function(e){let t=e.type.prop(Dh);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||Dp.empty,c=function(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+" "+e:e)}return n}(i,u.tags);if(c&&(l&&(l+=" "),l+=c,1==u.mode&&(r+=(r?" ":"")+c)),this.startSpan(Math.max(t,a),l),u.opaque)return;let d=e.tree&&e.tree.prop(Iw.mounted);if(d&&d.overlay){let o=e.node.enter(d.overlay[0].from+a,1),u=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),c=e.firstChild();for(let h=0,p=a;;h++){let f=h<d.overlay.length?d.overlay[h]: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,r,i),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()){d&&(r="");do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),l)}while(e.nextSibling());e.parent()}}}let Dm=Dl.define,Dv=Dm(),Dy=Dm(),Dx=Dm(Dy),Db=Dm(Dy),Dw=Dm(),DS=Dm(Dw),DA=Dm(Dw),DC=Dm(),DM=Dm(DC),Dk=Dm(),DT=Dm(),D_=Dm(),DI=Dm(D_),DD=Dm(),DO={comment:Dv,lineComment:Dm(Dv),blockComment:Dm(Dv),docComment:Dm(Dv),name:Dy,variableName:Dm(Dy),typeName:Dx,tagName:Dm(Dx),propertyName:Db,attributeName:Dm(Db),className:Dm(Dy),labelName:Dm(Dy),namespace:Dm(Dy),macroName:Dm(Dy),literal:Dw,string:DS,docString:Dm(DS),character:Dm(DS),attributeValue:Dm(DS),number:DA,integer:Dm(DA),float:Dm(DA),bool:Dm(Dw),regexp:Dm(Dw),escape:Dm(Dw),color:Dm(Dw),url:Dm(Dw),keyword:Dk,self:Dm(Dk),null:Dm(Dk),atom:Dm(Dk),unit:Dm(Dk),modifier:Dm(Dk),operatorKeyword:Dm(Dk),controlKeyword:Dm(Dk),definitionKeyword:Dm(Dk),moduleKeyword:Dm(Dk),operator:DT,derefOperator:Dm(DT),arithmeticOperator:Dm(DT),logicOperator:Dm(DT),bitwiseOperator:Dm(DT),compareOperator:Dm(DT),updateOperator:Dm(DT),definitionOperator:Dm(DT),typeOperator:Dm(DT),controlOperator:Dm(DT),punctuation:D_,separator:Dm(D_),bracket:DI,angleBracket:Dm(DI),squareBracket:Dm(DI),paren:Dm(DI),brace:Dm(DI),content:DC,heading:DM,heading1:Dm(DM),heading2:Dm(DM),heading3:Dm(DM),heading4:Dm(DM),heading5:Dm(DM),heading6:Dm(DM),contentSeparator:Dm(DC),list:Dm(DC),quote:Dm(DC),emphasis:Dm(DC),strong:Dm(DC),link:Dm(DC),monospace:Dm(DC),strikethrough:Dm(DC),inserted:Dm(),deleted:Dm(),changed:Dm(),invalid:Dm(),meta:DD,documentMeta:Dm(DD),annotation:Dm(DD),processingInstruction:Dm(DD),definition:Dl.defineModifier("definition"),constant:Dl.defineModifier("constant"),function:Dl.defineModifier("function"),standard:Dl.defineModifier("standard"),local:Dl.defineModifier("local"),special:Dl.defineModifier("special")};for(let e in DO){let t=DO[e];t instanceof Dl&&(t.name=e)}Df([{tag:DO.link,class:"tok-link"},{tag:DO.heading,class:"tok-heading"},{tag:DO.emphasis,class:"tok-emphasis"},{tag:DO.strong,class:"tok-strong"},{tag:DO.keyword,class:"tok-keyword"},{tag:DO.atom,class:"tok-atom"},{tag:DO.bool,class:"tok-bool"},{tag:DO.url,class:"tok-url"},{tag:DO.labelName,class:"tok-labelName"},{tag:DO.inserted,class:"tok-inserted"},{tag:DO.deleted,class:"tok-deleted"},{tag:DO.literal,class:"tok-literal"},{tag:DO.string,class:"tok-string"},{tag:DO.number,class:"tok-number"},{tag:[DO.regexp,DO.escape,DO.special(DO.string)],class:"tok-string2"},{tag:DO.variableName,class:"tok-variableName"},{tag:DO.local(DO.variableName),class:"tok-variableName tok-local"},{tag:DO.definition(DO.variableName),class:"tok-variableName tok-definition"},{tag:DO.special(DO.variableName),class:"tok-variableName2"},{tag:DO.definition(DO.propertyName),class:"tok-propertyName tok-definition"},{tag:DO.typeName,class:"tok-typeName"},{tag:DO.namespace,class:"tok-namespace"},{tag:DO.className,class:"tok-className"},{tag:DO.macroName,class:"tok-macroName"},{tag:DO.propertyName,class:"tok-propertyName"},{tag:DO.operator,class:"tok-operator"},{tag:DO.comment,class:"tok-comment"},{tag:DO.meta,class:"tok-meta"},{tag:DO.invalid,class:"tok-invalid"},{tag:DO.punctuation,class:"tok-punctuation"}]);let DR=Dd({String:DO.string,Number:DO.number,"True False":DO.bool,PropertyName:DO.propertyName,Null:DO.null,", :":DO.separator,"[ ]":DO.squareBracket,"{ }":DO.brace}),DE=Di.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:[DR],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}),DP=[],DL=[],DN="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<DN.length;e++)(e%2?DL:DP).push(t+=DN[e]);function DB(e){return e>=127462&&e<=127487}function Dz(e,t,n){if(t==e.length)return t;t&&Dj(e.charCodeAt(t))&&DV(e.charCodeAt(t-1))&&t--;let r=DF(e,t);for(t+=DH(r);t<e.length;){let i=DF(e,t);if(8205==r||8205==i||n&&function(e){if(e<768)return!1;for(let t=0,n=DP.length;;){let r=t+n>>1;if(e<DP[r])n=r;else{if(!(e>=DL[r]))return!0;t=r+1}if(t==n)return!1}}(i))t+=DH(i),r=i;else if(DB(i)){let n=0,r=t-2;for(;r>=0&&DB(DF(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function DF(e,t){let n=e.charCodeAt(t);if(!DV(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Dj(r)?(n-55296<<10)+(r-56320)+65536:n}function Dj(e){return e>=56320&&e<57344}function DV(e){return e>=55296&&e<56320}function DH(e){return e<65536?1:2}class D${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]=DK(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),DG.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=DK(this,e,t);let n=[];return this.decompose(e,t,n,0),DG.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),r=new Dq(this),i=new Dq(e);for(let e=t,o=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(o+=r.value.length,r.done||o>=n)return!0}}iter(e=1){return new Dq(this,e)}iterRange(e,t=this.length){return new DY(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new DX(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 DW(e):DG.from(DW.split(e,[])):D$.empty}}class DW extends D${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,r){for(let i=0;;i++){let o=this.text[i],a=r+o.length;if((t?n:a)>=e)return new DZ(r,a,n,o);r=a+1,n++}}decompose(e,t,n,r){var i;let o=e<=0&&t>=this.length?this:new DW((i=this.text,DU(i,[""],e,t)),Math.min(t,this.length)-Math.max(0,e));if(1&r){let e=n.pop(),t=DU(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new DW(t,e.length+o.length));else{let e=t.length>>1;n.push(new DW(t.slice(0,e)),new DW(t.slice(e)))}}else n.push(o)}replace(e,t,n){var r;if(!(n instanceof DW))return super.replace(e,t,n);[e,t]=DK(this,e,t);let i=DU(this.text,DU(n.text,(r=this.text,DU(r,[""],0,e))),t),o=this.length+n.length-(t-e);return i.length<=32?new DW(i,o):DG.from(DW.split(i,[]),o)}sliceString(e,t=this.length,n="\n"){[e,t]=DK(this,e,t);let r="";for(let i=0,o=0;i<=t&&o<this.text.length;o++){let a=this.text[o],s=i+a.length;i>e&&o&&(r+=n),e<s&&t>i&&(r+=a.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let i of e)n.push(i),r+=i.length+1,32==n.length&&(t.push(new DW(n,r)),n=[],r=-1);return r>-1&&t.push(new DW(n,r)),t}}class DG extends D${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,r){for(let i=0;;i++){let o=this.children[i],a=r+o.length,s=n+o.lines-1;if((t?s:a)>=e)return o.lineInner(e,t,n,r);r=a+1,n=s+1}}decompose(e,t,n,r){for(let i=0,o=0;o<=t&&i<this.children.length;i++){let a=this.children[i],s=o+a.length;if(e<=s&&t>=o){let i=r&(o<=e|2*(s>=t));o>=e&&s<=t&&!i?n.push(a):a.decompose(e-o,t-o,n,i)}o=s+1}}replace(e,t,n){if([e,t]=DK(this,e,t),n.lines<this.lines)for(let r=0,i=0;r<this.children.length;r++){let o=this.children[r],a=i+o.length;if(e>=i&&t<=a){let s=o.replace(e-i,t-i,n),l=this.lines-o.lines+s.lines;if(s.lines<l>>4&&s.lines>l>>6){let i=this.children.slice();return i[r]=s,new DG(i,this.length-(t-e)+n.length)}return super.replace(i,a,s)}i=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=DK(this,e,t);let r="";for(let i=0,o=0;i<this.children.length&&o<=t;i++){let a=this.children[i],s=o+a.length;o>e&&i&&(r+=n),e<s&&t>o&&(r+=a.sliceString(e-o,t-o,n)),o=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof DG))return 0;let n=0,[r,i,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,i+=t){if(r==o||i==a)return n;let s=this.children[r],l=e.children[i];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 DW(n,t)}let r=Math.max(32,n>>5),i=r<<1,o=r>>1,a=[],s=0,l=-1,u=[];function c(){0!=s&&(a.push(1==u.length?u[0]:DG.from(u,l)),l=-1,s=u.length=0)}for(let t of e)!function e(t){let n;if(t.lines>i&&t instanceof DG)for(let n of t.children)e(n);else t.lines>o&&(s>o||!s)?(c(),a.push(t)):t instanceof DW&&s&&(n=u[u.length-1])instanceof DW&&t.lines+n.lines<=32?(s+=t.lines,l+=t.length+1,u[u.length-1]=new DW(n.text.concat(t.text),n.length+1+t.length)):(s+t.lines>r&&c(),s+=t.lines,l+=t.length+1,u.push(t))}(t);return c(),1==a.length?a[0]:new DG(a,t)}}function DU(e,t,n=0,r=1e9){for(let i=0,o=0,a=!0;o<e.length&&i<=r;o++){let s=e[o],l=i+s.length;l>=n&&(l>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),a?(t[t.length-1]+=s,a=!1):t.push(s)),i=l+1}return t}D$.empty=new DW([""],0);class Dq{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 DW?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],o=i>>1,a=r instanceof DW?r.text.length:r.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&i)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof DW){let i=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=0==e?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[o+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof DW?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class DY{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Dq(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:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.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 DX{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=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=r,this.afterBreak=!1),this}get lineBreak(){return!1}}"u">typeof Symbol&&(D$.prototype[Symbol.iterator]=function(){return this.iter()},Dq.prototype[Symbol.iterator]=DY.prototype[Symbol.iterator]=DX.prototype[Symbol.iterator]=function(){return this});class DZ{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}function DK(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function DQ(e,t,n=!0,r=!0){return function(e,t,n=!0,r=!0){return(n?Dz:function(e,t,n){for(;t>1;){let r=Dz(e,t-2,n);if(r<t)return r;t--}return 0})(e,t,r)}(e,t,n,r)}function DJ(e,t){let n=e.charCodeAt(t);if(!(n>=55296&&n<56320)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return r>=56320&&r<57344?(n-55296<<10)+(r-56320)+65536:n}function D0(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function D1(e){return e<65536?1:2}let D2=/\r\n?|\n/;var D5=((v=D5||(D5={}))[v.Simple=0]="Simple",v[v.TrackDel=1]="TrackDel",v[v.TrackBefore=2]="TrackBefore",v[v.TrackAfter=3]="TrackAfter",v);class D4{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,r=0;t<this.sections.length;){let i=this.sections[t++],o=this.sections[t++];o<0?(e(n,r,i),r+=i):r+=o,n+=i}}iterChangedRanges(e,t=!1){D9(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new D4(e)}composeDesc(e){return this.empty?e:e.empty?this:Oe(this,e)}mapDesc(e,t=!1){return e.empty?this:D7(this,e,t)}mapPos(e,t=-1,n=D5.Simple){let r=0,i=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],s=this.sections[o++],l=r+a;if(s<0){if(l>e)return i+(e-r);i+=a}else{if(n!=D5.Simple&&l>=e&&(n==D5.TrackDel&&r<e&&l>e||n==D5.TrackBefore&&r<e||n==D5.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!a)return e==r||t<0?i:i+s;i+=s}r=l}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],o=this.sections[n++],a=r+i;if(o>=0&&r<=t&&a>=e)return!(r<e)||!(a>t)||"cover";r=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}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 D4(e)}static create(e){return new D4(e)}}class D3 extends D4{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 D9(this,(t,n,r,i,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return D7(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,i=0;r<t.length;r+=2){let o=t[r],a=t[r+1];if(a>=0){t[r]=a,t[r+1]=o;let s=r>>1;for(;n.length<s;)n.push(D$.empty);n.push(o?e.slice(i,i+o):D$.empty)}i+=o}return new D3(t,n)}compose(e){return this.empty?e:e.empty?this:Oe(this,e,!0)}map(e,t=!1){return e.empty?this:D7(this,e,t,!0)}iterChanges(e,t=!1){D9(this,e,t)}get desc(){return D4.create(this.sections)}filter(e){let t=[],n=[],r=[],i=new Ot(this);r:for(let o=0,a=0;;){let s=o==e.length?1e9:e[o++];for(;a<s||a==s&&0==i.len;){if(i.done)break r;let e=Math.min(i.len,s-a);D6(r,e,-1);let o=-1==i.ins?-1:0==i.off?i.ins:0;D6(t,e,o),o>0&&D8(n,t,i.text),i.forward(e),a+=e}let l=e[o++];for(;a<l;){if(i.done)break r;let e=Math.min(i.len,l-a);D6(t,e,-1),D6(r,e,-1==i.ins?-1:0==i.off?i.ins:0),i.forward(e),a+=e}}return{changes:new D3(t,n),filtered:D4.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):0==r?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],i=[],o=0,a=null;function s(e=!1){if(!e&&!r.length)return;o<t&&D6(r,t-o,-1);let n=new D3(r,i);a=a?a.compose(n.map(a)):n,r=[],i=[],o=0}return!function e(l){if(Array.isArray(l))for(let t of l)e(t);else if(l instanceof D3){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?D$.of(u.split(n||D2)):u:D$.empty,d=c.length;if(e==a&&0==d)return;e<o&&s(),e>o&&D6(r,e-o,-1),D6(r,a-e,d),D8(i,r,c),o=a}}(e),s(!a),a}static empty(e){return new D3(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if("number"==typeof i)t.push(i,-1);else if(!Array.isArray(i)||"number"!=typeof i[0]||i.some((e,t)=>t&&"string"!=typeof e))throw RangeError("Invalid JSON representation of ChangeSet");else if(1==i.length)t.push(i[0],0);else{for(;n.length<r;)n.push(D$.empty);n[r]=D$.of(i.slice(1)),t.push(i[0],n[r].length)}}return new D3(t,n)}static createSet(e,t){return new D3(e,t)}}function D6(e,t,n,r=!1){if(0==t&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function D8(e,t,n){if(0==n.length)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(D$.empty);e.push(n)}}function D9(e,t,n){let r=e.inserted;for(let i=0,o=0,a=0;a<e.sections.length;){let s=e.sections[a++],l=e.sections[a++];if(l<0)i+=s,o+=s;else{let u=i,c=o,d=D$.empty;for(;u+=s,c+=l,l&&r&&(d=d.append(r[a-2>>1])),!n&&a!=e.sections.length&&!(e.sections[a+1]<0);)s=e.sections[a++],l=e.sections[a++];t(i,u,o,c,d),i=u,o=c}}}function D7(e,t,n,r=!1){let i=[],o=r?[]:null,a=new Ot(e),s=new Ot(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);D6(i,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(D6(i,s.ins,-1);t;){let n=Math.min(a.len,t);a.ins>=0&&e<a.i&&a.len<=n&&(D6(i,0,a.ins),o&&D8(o,i,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;D6(i,t,e<a.i?a.ins:0),o&&e<a.i&&D8(o,i,a.text),e=a.i,a.forward(a.len-n)}else if(a.done&&s.done)return o?D3.createSet(i,o):D4.create(i);else throw Error("Mismatched change set lengths")}function Oe(e,t,n=!1){let r=[],i=n?[]:null,o=new Ot(e),a=new Ot(t);for(let e=!1;;)if(o.done&&a.done)return i?D3.createSet(r,i):D4.create(r);else if(0==o.ins)D6(r,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=r.length;if(-1==o.ins){let n=-1==a.ins?-1:a.off?0:a.ins;D6(r,t,n,e),i&&n&&D8(i,r,a.text)}else -1==a.ins?(D6(r,o.off?0:o.len,t,e),i&&D8(i,r,o.textBit(t))):(D6(r,o.off?0:o.len,a.off?0:a.ins,e),i&&!a.off&&D8(i,r,a.text));e=(o.ins>t||a.ins>=0&&a.len>t)&&(e||r.length>n),o.forward2(t),a.forward(t)}else D6(r,0,a.ins,e),i&&D8(i,r,a.text),a.next()}class Ot{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?D$.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?D$.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 On{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=r}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,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new On(n,r,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return Or.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Or.range(this.anchor,r,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 Or.range(e.anchor,e.head)}static create(e,t,n,r){return new On(e,t,n,r)}}class Or{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Or.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 Or([this.main],0)}addRange(e,t=!0){return Or.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,Or.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 Or(e.ranges.map(e=>On.fromJSON(e)),e.main)}static single(e,t=e){return new Or([Or.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,r=0;r<e.length;r++){let i=e[r];if(i.empty?i.from<=n:i.from<n)return Or.normalized(e.slice(),t);n=i.to}return new Or(e,t)}static cursor(e,t=0,n,r){return On.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n)),r)}static range(e,t,n,r,i){let o=null==r?7:Math.min(6,r);return i||e==t||(i=t<e?1:-1),i&&(o|=i<0?8:16),t<e?On.create(t,e,32|o,n):On.create(e,t,o,n)}static undirectionalRange(e,t){return On.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 r=e[n],i=e[n-1];if(r.empty?r.from<=i.to:r.from<i.to){let o=i.from,a=Math.max(r.to,i.to);n<=t&&t--,e.splice(--n,2,r.anchor>r.head?Or.range(a,o):Or.range(o,a))}}return new Or(e,t)}}function Oi(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let Oo=0;class Oa{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=Oo++,this.default=e([]),this.extensions="function"==typeof i?i(this):i}get reader(){return this}static define(e={}){return new Oa(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(!e.combine?Os:(e,t)=>e===t),!!e.static,e.enables)}of(e){return new Ol([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new Ol(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new Ol(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function Os(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class Ol{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=Oo++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,i=this.id,o=e[i]>>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)||Oc(e,u)){let t=n(e);if(a?!Ou(t,e.values[o],r):!r(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let s,l=t.config.address[i];if(null!=l){let i=Ob(t,l);if(this.dependencies.every(n=>n instanceof Oa?t.facet(n)===e.facet(n):!(n instanceof Oh)||t.field(n,!1)==e.field(n,!1))||(a?Ou(s=n(e),i,r):r(s=n(e),i)))return e.values[o]=i,0}else s=n(e);return e.values[o]=s,1}}}}function Ou(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function Oc(e,t){let n=!1;for(let r of t)1&Ox(e,r)&&(n=!0);return n}let Od=Oa.define({static:!0});class Oh{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(e){let t=new Oh(Oo++,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(Od).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 r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(Od),i=n.facet(Od),o;return(o=r.find(e=>e.field==this))&&o!=i.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,Od.of({field:this,create:e})]}get extension(){return this}}function Op(e){return t=>new Og(t,e)}let Of={highest:Op(0),high:Op(1),default:Op(2),low:Op(3),lowest:Op(4)};class Og{constructor(e,t){this.inner=e,this.prec=t}}class Om{of(e){return new Ov(this,e)}reconfigure(e){return Om.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Ov{constructor(e,t){this.compartment=e,this.inner=t}}class Oy{constructor(e,t,n,r,i,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,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 r,i,o;let a,s,l=[],u=Object.create(null),c=new Map;for(let n of(r=e,i=t,o=c,a=[[],[],[],[],[]],s=new Map,!function e(t,n){let r=s.get(t);if(null!=r){if(r<=n)return;let e=a[r].indexOf(t);e>-1&&a[r].splice(e,1),t instanceof Ov&&o.delete(t.compartment)}if(s.set(t,n),Array.isArray(t))for(let r of t)e(r,n);else if(t instanceof Ov){if(o.has(t.compartment))throw RangeError("Duplicate use of compartment in extensions");let r=i.get(t.compartment)||t.inner;o.set(t.compartment,r),e(r,n)}else if(t instanceof Og)e(t.inner,t.prec);else if(t instanceof Oh)a[n].push(t),t.provides&&e(t.provides,n);else if(t instanceof Ol)a[n].push(t),t.facet.extensions&&e(t.facet.extensions,2);else{let r=t.extension;if(!r)throw Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(r,n)}}(r,2),a.reduce((e,t)=>e.concat(t))))n instanceof Oh?l.push(n):(u[n.facet.id]||(u[n.facet.id]=[])).push(n);let d=Object.create(null),h=[],p=[];for(let e of l)d[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],r=t[0].facet,i=f&&f[e]||[];if(t.every(e=>0==e.type))if(d[r.id]=h.length<<1|1,Os(i,t))h.push(n.facet(r));else{let e=r.combine(t.map(e=>e.value));h.push(n&&r.compare(e,n.facet(r))?n.facet(r):e)}else{for(let e of t)0==e.type?(d[e.id]=h.length<<1|1,h.push(e.value)):(d[e.id]=p.length<<1,p.push(t=>e.dynamicSlot(t)));d[r.id]=p.length<<1,p.push(e=>(function(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),o=r.filter(e=>!(1&e)),a=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let o=Ob(e,r[t]);if(2==i[t])for(let e of o)n.push(e);else n.push(o)}return t.combine(n)}return{create(e){for(let t of r)Ox(e,t);return e.values[a]=s(e),1},update(e,n){if(!Oc(e,o))return 0;let r=s(e);return t.compare(r,e.values[a])?0:(e.values[a]=r,1)},reconfigure(e,i){let o=Oc(e,r),l=i.config.facets[t.id],u=i.facet(t);if(l&&!o&&Os(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,r,t))}}return new Oy(e,c,p.map(e=>e(d)),d,h,u)}}function Ox(e,t){if(1&t)return 2;let n=t>>1,r=e.status[n];if(4==r)throw Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function Ob(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let Ow=Oa.define(),OS=Oa.define({combine:e=>e.some(e=>e),static:!0}),OA=Oa.define({combine:e=>e.length?e[0]:void 0,static:!0}),OC=Oa.define(),OM=Oa.define(),Ok=Oa.define(),OT=Oa.define({combine:e=>!!e.length&&e[0]});class O_{constructor(e,t){this.type=e,this.value=t}static define(){return new OI}}class OI{of(e){return new O_(this,e)}}class OD{constructor(e){this.map=e}of(e){return new OO(this,e)}}class OO{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 OO(this.type,t)}is(e){return this.type==e}static define(e={}){return new OD(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}}OO.reconfigure=OO.define(),OO.appendConfig=OO.define();class OR{constructor(e,t,n,r,i,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=i,this.scrollIntoView=o,this._doc=null,this._state=null,n&&Oi(n,t.newLength),i.some(e=>e.type==OR.time)||(this.annotations=i.concat(OR.time.of(Date.now())))}static create(e,t,n,r,i,o){return new OR(e,t,n,r,i,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(OR.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function OE(e,t,n){var r;let i,o,a;return n?(i=t.changes,o=D3.empty(t.changes.length),a=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(i)),{changes:a,selection:t.selection?t.selection.map(o):null==(r=e.selection)?void 0:r.map(i),effects:OO.mapEffects(e.effects,i).concat(OO.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function OP(e,t,n){let r=t.selection,i=ON(t.annotations);return t.userEvent&&(i=i.concat(OR.userEvent.of(t.userEvent))),{changes:t.changes instanceof D3?t.changes:D3.of(t.changes||[],n,e.facet(OA)),selection:r&&(r instanceof Or?r:Or.single(r.anchor,r.head)),effects:ON(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}OR.time=O_.define(),OR.userEvent=O_.define(),OR.addToHistory=O_.define(),OR.remote=O_.define();let OL=[];function ON(e){return null==e?OL:Array.isArray(e)?e:[e]}var OB=((y=OB||(OB={}))[y.Word=0]="Word",y[y.Space=1]="Space",y[y.Other=2]="Other",y);let Oz=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{r=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class OF{constructor(e,t,n,r,i,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,o&&(o._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)Ox(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 Ox(this,n),Ob(this,n)}update(...e){return function e(t,n,r){let i=OP(t,n.length?n[0]:{},t.doc.length);n.length&&!1===n[0].filter&&(r=!1);for(let e=1;e<n.length;e++){!1===n[e].filter&&(r=!1);let o=!!n[e].sequential;i=OE(i,OP(t,n[e],o?i.changes.newLength:t.doc.length),o)}let o=OR.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(e){let t=e.startState,n=t.facet(Ok),r=e;for(let i=n.length-1;i>=0;i--){let o=n[i](e);o&&Object.keys(o).length&&(r=OE(r,OP(t,o,e.changes.newLength),!0))}return r==e?e:OR.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(r?function(t){let n=t.startState,r=!0;for(let e of n.facet(OC)){let n=e(t);if(!1===n){r=!1;break}Array.isArray(n)&&(r=!0===r?n:function(e,t){let n=[];for(let r=0,i=0;;){let o,a;if(r<e.length&&(i==t.length||t[i]>=e[r]))o=e[r++],a=e[r++];else{if(!(i<t.length))return n;o=t[i++],a=t[i++]}!n.length||n[n.length-1]<o?n.push(o,a):n[n.length-1]<a&&(n[n.length-1]=a)}}(r,n))}if(!0!==r){let e,i;if(!1===r)i=t.changes.invertedDesc,e=D3.empty(n.doc.length);else{let n=t.changes.filter(r);e=n.changes,i=n.filtered.mapDesc(n.changes).invertedDesc}t=OR.create(n,e,t.selection&&t.selection.map(i),OO.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let i=n.facet(OM);for(let r=i.length-1;r>=0;r--){let o=i[r](t);t=o instanceof OR?o:Array.isArray(o)&&1==o.length&&o[0]instanceof OR?o[0]:e(n,ON(o),!1)}return t}(o):o)}(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:r,compartments:i}=n;for(let t of e.effects)t.is(Om.reconfigure)?(n&&(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),n=null),i.set(t.value.compartment,t.value.extension)):t.is(OO.reconfigure)?(n=null,r=t.value):t.is(OO.appendConfig)&&(n=null,r=ON(r).concat(t.value));t=n?e.startState.values.slice():new OF(n=Oy.resolve(r,i,this),this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values;let o=e.startState.facet(OS)?e.newSelection:e.newSelection.asSingle();new OF(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:Or.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],o=ON(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(r);for(let e=0;e<n;e++)i[e]=i[e].map(l);let u=r.mapDesc(s,!0);i.push(a.range.map(u)),r=r.compose(l),o=OO.mapEffects(o,l).concat(OO.mapEffects(ON(a.effects),u))}return{changes:r,selection:Or.create(i,t.mainIndex),effects:o}}changes(e=[]){return e instanceof D3?e:D3.of(e,this.doc.length,this.facet(OF.lineSeparator))}toText(e){return D$.of(e.split(this.facet(OF.lineSeparator)||D2))}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:(Ox(this,t),Ob(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof Oh&&null!=this.config.address[r.id]&&(t[n]=r.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 r=[];if(n){for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let i=n[t],o=e[t];r.push(i.init(e=>i.spec.fromJSON(o,e)))}}return OF.create({doc:e.doc,selection:Or.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Oy.resolve(e.extensions||[],new Map),n=e.doc instanceof D$?e.doc:D$.of((e.doc||"").split(t.staticFacet(OF.lineSeparator)||D2)),r=e.selection?e.selection instanceof Or?e.selection:Or.single(e.selection.anchor,e.selection.head):Or.single(0);return Oi(r,n.length),t.staticFacet(OS)||(r=r.asSingle()),new OF(t,n,r,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(OF.tabSize)}get lineBreak(){return this.facet(OF.lineSeparator)||"\n"}get readOnly(){return this.facet(OT)}phrase(e,...t){for(let t of this.facet(OF.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 r=+(n||1);return!r||r>t.length?e:t[r-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(Ow))for(let o of i(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){var t;let n=this.languageDataAt("wordChars",e);return t=n.length?n[0]:"",e=>{if(!/\S/.test(e))return OB.Space;if(function(e){if(r)return r.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||Oz.test(n)))return!0}return!1}(e))return OB.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return OB.Word;return OB.Other}}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),o=e-n,a=e-n;for(;o>0;){let e=DQ(t,o,!1);if(i(t.slice(e,o))!=OB.Word)break;o=e}for(;a<r;){let e=DQ(t,a);if(i(t.slice(a,e))!=OB.Word)break;a=e}return o==a?null:Or.range(o+n,a+n)}}function Oj(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],o=r[e];if(void 0===o)r[e]=i;else if(o===i||void 0===i);else if(Object.hasOwnProperty.call(n,e))r[e]=n[e](o,i);else throw Error("Config merge conflict for field "+e)}for(let e in t)void 0===r[e]&&(r[e]=t[e]);return r}OF.allowMultipleSelections=OS,OF.tabSize=Oa.define({combine:e=>e.length?e[0]:4}),OF.lineSeparator=OA,OF.readOnly=OT,OF.phrases=Oa.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),OF.languageData=Ow,OF.changeFilter=OC,OF.transactionFilter=OM,OF.transactionExtender=Ok,Om.reconfigure=OO.define();class OV{eq(e){return this==e}range(e,t=e){return O$.create(e,t,this)}}function OH(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}OV.prototype.startSide=OV.prototype.endSide=0,OV.prototype.point=!1,OV.prototype.mapMode=D5.TrackDel;class O${constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new O$(e,t,n)}}function OW(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class OG{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let o=r,a=i.length;;){if(o==a)return o;let r=o+a>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==o)return s>=0?o:a;s>=0?a=r:o=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,i);i<o;i++)if(!1===r(this.from[i]+e,this.to[i]+e,this.value[i]))return!1}map(e,t){let n=[],r=[],i=[],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,d,h;if(u==c){let e=t.mapPos(u,l.startSide,l.mapMode);if(null==e||(d=h=e,l.startSide!=l.endSide&&(h=t.mapPos(u,l.endSide))<d))continue}else if((d=t.mapPos(u,l.startSide))>(h=t.mapPos(c,l.endSide))||d==h&&l.startSide>0&&l.endSide<=0)continue;0>(h-d||l.endSide-l.startSide)||(o<0&&(o=d),l.point&&(a=Math.max(a,h-d)),n.push(l),r.push(d-o),i.push(h-o))}return{mapped:n.length?new OG(r,i,n,a):null,pos:o}}}class OU{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new OU(e,t,n,r)}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:r=0,filterTo:i=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(n&&(t=t.slice().sort(OW)),this.isEmpty)return t.length?OU.of(t):this;let a=new OX(this,null,-1).goto(0),s=0,l=[],u=new Oq;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||r>this.chunkEnd(a.chunkIndex)||i<this.chunkPos[a.chunkIndex])&&u.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||r>a.to||i<a.from||o(a.from,a.to,a.value))&&!u.addInner(a.from,a.to,a.value)&&l.push(O$.create(a.from,a.to,a.value)),a.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?OU.empty:this.nextLayer.update({add:l,filter:o,filterFrom:r,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],a=this.chunk[i],s=e.touchesRange(o,o+a.length);if(!1===s)r=Math.max(r,a.maxPoint),t.push(a),n.push(e.mapPos(o));else if(!0===s){let{mapped:i,pos:s}=a.map(o,e);i&&(r=Math.max(r,i.maxPoint),t.push(i),n.push(s))}}let i=this.nextLayer.map(e);return 0==t.length?i:new OU(n,t,i||OU.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],o=this.chunk[r];if(t>=i&&e<=i+o.length&&!1===o.between(i,e-i,t-i,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return OZ.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return OZ.from(e).goto(t)}static compare(e,t,n,r,i=-1){let o=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),a=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=OY(o,a,n),l=new OQ(o,s,i),u=new OQ(a,s,i);n.iterGaps((e,t,n)=>OJ(l,e,u,t,n,r)),n.empty&&0==n.length&&OJ(l,0,u,0,0,r)}static eq(e,t,n=0,r){null==r&&(r=0x3b9ac9ff);let i=e.filter(e=>!e.isEmpty&&0>t.indexOf(e)),o=t.filter(t=>!t.isEmpty&&0>e.indexOf(t));if(i.length!=o.length)return!1;if(!i.length)return!0;let a=OY(i,o),s=new OQ(i,a,0).goto(n),l=new OQ(o,a,0).goto(n);for(;;){if(s.to!=l.to||!O0(s.active,l.active)||s.point&&(!l.point||!OH(s.point,l.point)))return!1;if(s.to>r)return!0;s.next(),l.next()}}static spans(e,t,n,r,i=-1){let o=new OQ(e,null,i).goto(t),a=t,s=o.openStart;for(;;){let e=Math.min(o.to,n);if(o.point){let n=o.activeForPoint(o.to),i=o.pointFrom<t?n.length+1:o.point.startSide<0?n.length:Math.min(n.length,s);r.point(a,e,o.point,n,i,o.pointRank),s=Math.min(o.openEnd(e),n.length)}else e>a&&(r.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 Oq;for(let r of e instanceof O$?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(OW(t,r)>0)return e.slice().sort(OW);t=r}return e}(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return OU.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=OU.empty;r=r.nextLayer)t=new OU(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}OU.empty=new OU([],[],null,-1),OU.empty.nextLayer=OU.empty;class Oq{finishChunk(e){this.chunks.push(new OG(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 Oq)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&0>(e-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<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(OU.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=OU.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function OY(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let o=r.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))||i.add(e.chunk[t])}return i}class OX{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}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 r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}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 OZ{constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let i=0;i<e.length;i++)for(let o=e[i];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&r.push(new OX(o,t,n,i));return 1==r.length?r[0]:new OZ(r)}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--)OK(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--)OK(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(),OK(this.heap,0)}}}function OK(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),0>n.compare(i))break;e[r]=n,e[t]=i,t=r}}class OQ{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=OZ.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){O1(this.active,e),O1(this.activeTo,e),O1(this.activeRank,e),this.minActive=O5(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;O2(this.active,t,n),O2(this.activeTo,t,r),O2(this.activeRank,t,i),e&&O2(e,t,this.cursor.from),this.minActive=O5(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&0>(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&O1(n,r)}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 OJ(e,t,n,r,i,o){e.goto(t),n.goto(r);let a=r+i,s=r,l=r-t,u=!!o.boundChange;for(let t=!1;;){let r=e.to+l-n.to,i=r||e.endSide-n.endSide,c=i<0?e.to+l:n.to,d=Math.min(c,a);if(e.point||n.point?(e.point&&n.point&&OH(e.point,n.point)&&O0(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(s,d,e.point,n.point),t=!1):(t&&o.boundChange(s),d>s&&!O0(e.active,n.active)&&o.compareRange(s,d,e.active,n.active),u&&d<a&&(r||e.openEnd(c)!=n.openEnd(c))&&(t=!0)),c>a)break;s=c,i<=0&&e.next(),i>=0&&n.next()}}function O0(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!OH(e[n],t[n]))return!1;return!0}function O1(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function O2(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function O5(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)0>(t[i]-r||e[i].endSide-e[n].endSide)&&(n=i,r=t[i]);return n}function O4(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)9==e.charCodeAt(i)?(r+=t-r%t,i++):(r++,i=DQ(e,i));return r}function O3(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=DQ(e,r)}return!0===r?-1:e.length}let O6="u"<typeof Symbol?"__ͼ":Symbol.for("ͼ"),O8="u"<typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),O9="u">typeof globalThis?globalThis:"u">typeof window?window:{};class O7{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}for(let t in e)!function e(t,i,o,a){let s=[],l=/^@(\w+)\b/.exec(t[0]),u=l&&"keyframes"==l[1];if(l&&null==i)return o.push(t[0]+";");for(let n in i){let a=i[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(r(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(" ")+"}")}(r(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=O9[O6]||1;return O9[O6]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let r=e[O8],i=n&&n.nonce;r?i&&r.setNonce(i):r=new Rt(e,i),r.mount(Array.isArray(t)?t:[t],e)}}let Re=new Map;class Rt{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=Re.get(n);if(t)return e[O8]=t;this.sheet=new r.CSSStyleSheet,Re.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[O8]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let o=e[t],a=this.modules.indexOf(o);if(a<i&&a>-1&&(this.modules.splice(a,1),i--,a=-1),-1==a){if(this.modules.splice(i++,0,o),n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],r++)}else{for(;i<a;)r+=this.modules[i++].rules.length;r+=o.rules.length,i++}}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 Rn={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:"'"},Rr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ri="u">typeof navigator&&/Mac/.test(navigator.platform),Ro="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ra=0;Ra<10;Ra++)Rn[48+Ra]=Rn[96+Ra]=String(Ra);for(var Ra=1;Ra<=24;Ra++)Rn[Ra+111]="F"+Ra;for(var Ra=65;Ra<=90;Ra++)Rn[Ra]=String.fromCharCode(Ra+32),Rr[Ra]=String.fromCharCode(Ra);for(var Rs in Rn)Rr.hasOwnProperty(Rs)||(Rr[Rs]=Rn[Rs]);function Rl(){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 r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];"string"==typeof i?e.setAttribute(r,i):null!=i&&(e[r]=i)}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 r=0;r<n.length;r++)e(t,n[r]);else throw RangeError("Unsupported child node: "+n)}(e,arguments[t]);return e}let Ru="u">typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},Rc="u">typeof document?document:{documentElement:{style:{}}},Rd=/Edge\/(\d+)/.exec(Ru.userAgent),Rh=/MSIE \d/.test(Ru.userAgent),Rp=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ru.userAgent),Rf=!!(Rh||Rp||Rd),Rg=!Rf&&/gecko\/(\d+)/i.test(Ru.userAgent),Rm=!Rf&&/Chrome\/(\d+)/.exec(Ru.userAgent),Rv="webkitFontSmoothing"in Rc.documentElement.style,Ry=!Rf&&/Apple Computer/.test(Ru.vendor),Rx=Ry&&(/Mobile\/\w+/.test(Ru.userAgent)||Ru.maxTouchPoints>2);var Rb={mac:Rx||/Mac/.test(Ru.platform),windows:/Win/.test(Ru.platform),linux:/Linux|X11/.test(Ru.platform),ie:Rf,ie_version:Rh?Rc.documentMode||6:Rp?+Rp[1]:Rd?+Rd[1]:0,gecko:Rg,gecko_version:Rg?+(/Firefox\/(\d+)/.exec(Ru.userAgent)||[0,0])[1]:0,chrome:!!Rm,chrome_version:Rm?+Rm[1]:0,ios:Rx,android:/Android\b/.test(Ru.userAgent),webkit:Rv,webkit_version:Rv?+(/\bAppleWebKit\/(\d+)/.exec(Ru.userAgent)||[0,0])[1]:0,safari:Ry,safari_version:Ry?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Ru.userAgent)||[0,0])[1]:0,tabSize:null!=Rc.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function Rw(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 RS=Object.create(null);function RA(e,t,n){if(e==t)return!0;e||(e=RS),t||(t=RS);let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(-1==i.indexOf(o)||e[o]!==t[o]))return!1;return!0}function RC(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,"style"==i?e.style.cssText="":e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,"style"==i?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}class RM{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 Rk=((x=Rk||(Rk={}))[x.Text=0]="Text",x[x.WidgetBefore=1]="WidgetBefore",x[x.WidgetAfter=2]="WidgetAfter",x[x.WidgetRange=3]="WidgetRange",x);class RT extends OV{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new R_(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 RD(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:o}=RO(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new RD(e,n,r,t,e.widget||null,!0)}static line(e){return new RI(e)}static set(e,t=!1){return OU.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}RT.none=OU.empty;class R_ extends RT{constructor(e){let{start:t,end:n}=RO(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Rw(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||RS}eq(e){return this==e||e instanceof R_&&this.tagName==e.tagName&&RA(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw RangeError("Mark decorations may not be empty");return super.range(e,t)}}R_.prototype.point=!1;class RI extends RT{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof RI&&this.spec.class==e.spec.class&&RA(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)}}RI.prototype.mapMode=D5.TrackBefore,RI.prototype.point=!0;class RD extends RT{constructor(e,t,n,r,i,o){super(t,n,i,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?D5.TrackBefore:D5.TrackAfter:D5.TrackDel}get type(){return this.startSide!=this.endSide?Rk.WidgetRange:this.startSide<=0?Rk.WidgetBefore:Rk.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){var t,n;return e instanceof RD&&(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 RO(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!=n?n:t,end:null!=r?r:t}}function RR(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}RD.prototype.point=!0;class RE extends OV{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(e){return e==this||e instanceof RE&&this.tagName==e.tagName&&RA(this.attributes,e.attributes)}static create(e){return new RE(e.tagName,e.attributes||RS,null==e.rank?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return OU.of(e,t)}}function RP(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function RL(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function RN(e,t){if(!t.anchorNode)return!1;try{return RL(e,t.anchorNode)}catch(e){return!1}}function RB(e){return 3==e.nodeType?RX(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function Rz(e,t,n,r){return!!n&&(RV(e,t,n,r,-1)||RV(e,t,n,r,1))}function RF(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function Rj(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function RV(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:RH(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=RF(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType||1==(e=e.childNodes[t+(i<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=i<0?RH(e):0}}}function RH(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function R$(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function RW(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||1>Math.abs(t.width-e.offsetWidth))&&(n=1),(r>.995&&r<1.005||!isFinite(r)||1>Math.abs(t.height-e.offsetHeight))&&(r=1),{scaleX:n,scaleY:r}}function RG(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let o=e.parentNode;o;)if(o==n.body||(!t||r)&&i)break;else if(1==o.nodeType)!i&&o.scrollHeight>o.clientHeight&&(i=o),t&&!r&&o.scrollWidth>o.clientWidth&&(r=o),o=o.assignedSlot||o.parentNode;else if(11==o.nodeType)o=o.host;else break;return{x:r,y:i}}RE.prototype.startSide=RE.prototype.endSide=-1;class RU{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?RH(t):0),n,Math.min(e.focusOffset,n?RH(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let Rq=null;function RY(e){if(e.setActive)return e.setActive();if(Rq)return e.focus(Rq);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==Rq?{get preventScroll(){return Rq={preventScroll:!0},!0}}:void 0),!Rq){Rq=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}function RX(e,t,n=t){let r=i||(i=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function RZ(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let o=new KeyboardEvent("keydown",i);o.synthetic=!0,e.dispatchEvent(o);let a=new KeyboardEvent("keyup",i);return a.synthetic=!0,e.dispatchEvent(a),o.defaultPrevented||a.defaultPrevented}function RK(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 RQ(e,t){for(let n=e,r=t;;)if(3==n.nodeType&&r>0)return{node:n,offset:r};else if(1==n.nodeType&&r>0){if("false"==n.contentEditable)return null;r=RH(n=n.childNodes[r-1])}else{if(!n.parentNode||Rj(n))return null;r=RF(n),n=n.parentNode}}function RJ(e,t){for(let n=e,r=t;;)if(3==n.nodeType&&r<n.nodeValue.length)return{node:n,offset:r};else if(1==n.nodeType&&r<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[r],r=0}else{if(!n.parentNode||Rj(n))return null;r=RF(n)+1,n=n.parentNode}}Rb.safari&&Rb.safari_version>=26&&(Rq=!1);class R0{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new R0(e.parentNode,RF(e),t)}static after(e,t){return new R0(e.parentNode,RF(e)+1,t)}}var R1=((b=R1||(R1={}))[b.LTR=0]="LTR",b[b.RTL=1]="RTL",b);let R2=R1.LTR,R5=R1.RTL;function R4(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}let R3=R4("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),R6=R4("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),R8=Object.create(null),R9=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);R8[t]=n,R8[n]=-t}function R7(e){return e<=247?R3[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?R6[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}let Ee=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Et{get dir(){return this.level%2?R5:R2}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,r){let i=-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;(i<0||(0!=r?r<0?a.from<t:a.to>t:e[i].level>a.level))&&(i=o)}}if(i<0)throw RangeError("Index out of range");return i}}let En=[];function Er(e){return[new Et(0,e,0)]}let Ei="",Eo=Oa.define(),Ea=Oa.define(),Es=Oa.define(),El=Oa.define(),Eu=Oa.define(),Ec=Oa.define(),Ed=Oa.define(),Eh=Oa.define(),Ep=Oa.define(),Ef=Oa.define({combine:e=>e.some(e=>e)}),Eg=Oa.define({combine:e=>e.some(e=>e)}),Em=Oa.define();class Ev{constructor(e,t,n,r,i,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=o}map(e){return e.empty?this:new Ev(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 Ev(Or.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}let Ey=OO.define({map:(e,t)=>e.map(t)}),Ex=OO.define();function Eb(e,t,n){let r=e.facet(El);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}let Ew=Oa.define({combine:e=>!e.length||e[0]}),ES=0,EA=Oa.define({combine:e=>e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})});class EC{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(EA.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(EA.of({plugin:this,arg:e}))}static define(e,t){let{eventHandlers:n,eventObservers:r,provide:i,decorations:o}=t||{};return new EC(ES++,e,n,r,e=>{let t=[];return o&&t.push(E_.of(t=>{let n=t.plugin(e);return n?o(n):RT.none})),i&&t.push(i(e)),t})}static fromClass(e,t){return EC.define((t,n)=>new e(t,n),t)}}class EM{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(Eb(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){Eb(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){Eb(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}let Ek=Oa.define(),ET=Oa.define(),E_=Oa.define(),EI=Oa.define(),ED=Oa.define(),EO=Oa.define(),ER=Oa.define();function EE(e,t){let n=e.state.facet(ER);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return OU.spans(r,t.from,t.to,{point(){},span(e,n,r,o){let a=e-t.from,s=n-t.from,l=i;for(let e=r.length-1;e>=0;e--,o--){let n=r[e].spec.bidiIsolate,i;if(null==n&&(n=function(e,t,n){for(let r=t;r<n;r++){let t=R7(e.charCodeAt(r));if(1==t)break;if(2==t||4==t)return R5}return R2}(t.text,a,s)),o>0&&l.length&&(i=l[l.length-1]).to==a&&i.direction==n)i.to=s,l=i.inner;else{let e={from:a,to:s,direction:n,inner:[]};l.push(e),l=e.inner}}}}),i}let EP=Oa.define();function EL(e){let t=0,n=0,r=0,i=0;for(let o of e.state.facet(EP)){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&&(r=Math.max(r,a.top)),null!=a.bottom&&(i=Math.max(i,a.bottom)))}return{left:t,right:n,top:r,bottom:i}}let EN=Oa.define();class EB{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new EB(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 r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),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 r=0,i=0,o=0;;){let a=Math.min(r<e.length?e[r].fromB:1e9,i<t.length?t[i]:1e9);if(1e9==a)break;let s=a+o,l=a,u=s;for(;;)if(i<t.length&&t[i]<=l){let n=t[i+1];i+=2,l=Math.max(l,n);for(let t=r;t<e.length&&e[t].fromB<=l;t++)o=e[t].toA-e[t].toB;u=Math.max(u,n+o)}else if(r<e.length&&e[r].fromB<=l){let t=e[r++];l=Math.max(l,t.toB),u=Math.max(u,t.toA),o=t.toA-t.toB}else break;n.push(new EB(s,u,a,l))}return n}}class Ez{constructor(e,t,n){for(let r of(this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=D3.empty(this.startState.doc.length),n))this.changes=this.changes.compose(r.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new EB(e,t,n,i))),this.changedRanges=r}static create(e,t,n){return new Ez(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 EF=[];class Ej{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 EF}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 r=e.attributes[n].name;null==t[r]&&e.removeAttribute(r)}for(let n in t){let r=t[n];"style"==n?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}(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=RF(this.dom),r=this.length?e>0:t>0;return new R0(this.parent.dom,n+ +!!r,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 E$)return e;return null}static get(e){return e.cmTile}}class EV extends Ej{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,r,i=(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,r=n?n.nextSibling:t.firstChild,i&&r!=a.dom&&(i.written=!0),a.dom.parentNode==t)for(;r&&r!=a.dom;)r=EH(r);else t.insertBefore(a.dom,r);n=a.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=EH(r);this.length=o}}function EH(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class E$ extends EV{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=Ej.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;(n=n.parent).breakAfter&&i++,r=t.pop()}else{let o=n.children[r++];if(o instanceof EW)t.push(r),n=o,r=0;else{let t=i+o.length,n=e(o,i);if(void 0!==n)return n;i=t+o.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,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,r=e-s),(l>e||e==s&&(t>1?a.length:a.covers(-1)))&&(!i||!a.isWidget()&&i.isWidget())&&(i=a,o=e-s)}}),!n&&!i)throw Error("No tile at position "+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:o}}}class EW extends EV{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 EW(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class EG extends EV{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let r=new EG(t||document.createElement("div"),e);return t&&n||(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,o=null,a=-1;!function e(s,l){for(let u=0,c=0;u<s.children.length&&c<=l;u++){let d=s.children[u],h=c+d.length;h>=l&&(d.isComposite()?e(d,l-c):(!o||o.isHidden&&(t>0||n&&function(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}(o,d)))&&(h>l||32&d.flags)?(o=d,a=l-c):(c<l||16&d.flags&&!d.isHidden)&&(r=d,i=l-c)),c=h}}(this,e);let s=(t<0?r:o)||r||o;return s?{tile:s,offset:s==r?i: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=RB(t);return n[n.length-1]||null}(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new R0(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,16&e.flags?1:32&e.flags?-1:t);let i=n.tile.parent,o=!1;for(let e of i.children){if(o)return new R0(e.dom,0);e==n.tile&&(o=!0)}}return new R0(this.dom,0)}}class EU extends EV{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new EU(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class Eq extends Ej{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 r=e,i=e,o=0;0==e&&t<0||e==n&&t>=0?!(Rb.chrome||Rb.gecko)&&(e?(r--,o=1):i<n&&(i++,o=-1)):t<0?r--:i<n&&i++;let a=RX(this.dom,r,i).getClientRects();if(!a.length)return null;let s=a[(o?o<0:t>=0)?0:a.length-1];return Rb.safari&&!o&&0==s.width&&(s=Array.prototype.find.call(a,e=>e.width)||s),o?R$(s,o<0):s||null}static of(e,t){let n=new Eq(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class EY extends Ej{constructor(e,t,n,r){super(e,t,r),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 r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return R$(this.dom.getBoundingClientRect(),this.length?0==e:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=!!(16&this.flags)||!(32&this.flags)&&e>0;for(let i=r?t.length-1:0;n=t[i],e>0?0!=i:i!=t.length-1&&!(n.top<n.bottom);i+=r?-1:1);return R$(n,!r)}}get overrideDOMText(){if(!this.length)return D$.empty;let{root:e}=this;if(!e)return D$.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,r,i){return!i&&(i=e.toDOM(t),e.editable||(i.contentEditable="false")),new EY(i,n,e,r)}}class EX extends Ej{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 D$.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class EZ{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:o,parents:a}=this;for(;e||t>0;)if(r.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(i==r.children.length){if(!e&&!a.length)break;n&&n.leave(r),o=!!r.breakAfter,({tile:r,index:i}=a.pop()),i++}else{let s=r.children[i],l=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||!1!==n.skip(s,0,s.length)||!s.isComposite)?(o=!!l,i++,e-=s.length):(a.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}else if(i==r.length)o=!!r.breakAfter,({tile:r,index:i}=a.pop()),i++;else if(e){let t=Math.min(e,r.length-i);n&&n.skip(r,i,i+t),e-=t,i+=t}else break;return this.tile=r,this.index=i,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class EK{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}}class EQ{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,r){var i;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 Eq(a.dom,a.text+e)).parent=o):o.append(r||Eq.of(e,null==(i=this.cache.find(Eq))?void 0:i.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)?E3(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof EU&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(E3(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=Ej.get(n.dom);e&&e.setDOM(E3(n.dom))}let e=EU.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=Ej.get(e.text);i&&this.cache.reused.set(i,2);let o=new Eq(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,r.append(o)}addInlineWidget(e,t,n){let r=this.afterWidget&&48&e.flags&&(48&this.afterWidget.flags)==(48&e.flags);r||this.flushBuffer();let i=this.ensureMarks(t,n);r||16&e.flags||i.append(this.getBuffer(1)),i.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=E4);let r=EG.start(e,t||(null==(n=this.cache.find(EG))?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}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 r=this.curLine;for(let i=e.length-1;i>=0;i--){let o=e[i],a;if(t>0&&(a=r.lastChild)&&a instanceof EU&&a.mark.eq(o))r=a,t--;else{let e=EU.of(o,null==(n=this.cache.find(EU,e=>e.mark.eq(o)))?void 0:n.dom);r.append(e),r=e,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!E5(this.curLine,!1)||"BR"!=e.dom.nodeName&&e.isWidget()&&!(Rb.ios&&E5(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(E8,0,32)||new EY(E8.toDOM(),0,E8,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 EK(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&0>(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to);)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let r=t.lastChild;if(n.from<this.pos&&r instanceof EW&&r.wrapper.eq(n.wrapper))t=r;else{let r=EW.of(n.wrapper,null==(e=this.cache.find(EW,e=>e.wrapper.eq(n.wrapper)))?void 0:e.dom);t.append(r),t=r}}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(EX,void 0,1);return n&&(n.flags=t),n||new EX(t)}flushBuffer(){this.afterWidget&&!(32&this.afterWidget.flags)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class EJ{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:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error("Ran out of text content when drawing inline views");this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}let E0=[EY,EG,Eq,EU,EX,EW,E$];for(let e=0;e<E0.length;e++)E0[e].bucket=e;class E1{constructor(e){this.view=e,this.buckets=E0.map(()=>[]),this.index=E0.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 r=e.bucket,i=this.buckets[r],o=this.index[r];for(let e=i.length-1;e>=0;e--){let a=(e+o)%i.length,s=i[a];if((!t||t(s))&&!this.reused.has(s))return i.splice(a,1),a<o&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,o=0;;i++){if(i==r.length){if(o)return null;o=1,i=0}let a=r[i];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(r.splice(i,1),i<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 EY(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 E2{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new E1(e),this.text=new EJ(e.state.doc),this.builder=new EQ(this.cache,new E$(e,e.contentDOM),OU.iter(n)),this.cache.reused.set(t,2),this.old=new EZ(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 r=0,i=0,o=0;;){let a=o<e.length?e[o++]:null,s=a?a.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!o,!a),r=s,i+=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(i,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(i,a.toB)),i=a.toB,r=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=function(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof EU&&t.push(r.mark)}return t}(this.old),i=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?EY.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,r,i),i=r.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),r,i)):this.builder.addText(e.text,r,i,this.cache.reuse(e)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof EX)this.cache.add(e);else{if(!(e instanceof EU))return!1;this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length}this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof EU&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&(r.length=i=0):e instanceof EU&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=0,o=OU.spans(this.decorations,e,t,{point:(e,t,o,a,s,l)=>{var u,c,d;if(o instanceof RD){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(i=a.length,s>a.length)r.continueWidget(t-e);else{let i,l=o.widget||(o.block?E6.block:E6.inline),c=(i=(u=o).isReplace?64*(u.startSide<0)|128*(u.endSide>0):u.startSide>0?32:16,u.block&&(i|=256),i),d=this.cache.findWidget(l,t-e,c)||EY.of(l,this.view,t-e,c);o.block?(o.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(d)):(r.ensureLine(n),r.addInlineWidget(d,a,s))}n=null}else{let e,t;c=n,e=(d=o).spec.attributes,t=d.spec.class,(e||t)&&(c||(c={class:"cm-line"}),e&&Rw(e,c),t&&(c.class+=" "+t)),n=c}t>e&&this.text.skip(t-e)},span:(e,t,o,a)=>{for(let i=e;i<t;){let s=this.text.next(Math.min(512,t-i));null==s?(r.addLineStartIfNotCovered(n),r.addBreak(),i++):(r.ensureLine(n),r.addText(s,o,i==e?a:o.length),i+=s.length),n=null}i=o.length}});this.openWidget=o>i,this.openWidget||r.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 r=e.parentNode;;r=r.parentNode){let e=Ej.get(r);if(r==this.view.contentDOM)break;e instanceof EU?t.push(e):(null==e?void 0:e.isLine())?n=e:e instanceof EW||("DIV"!=r.nodeName||n||r==this.view.contentDOM?n||t.push(EU.of(new R_({tagName:r.nodeName.toLowerCase(),attributes:function(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}(r)}),r)):n=new EG(r,E4))}return{line:n,marks:t}}}function E5(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}let E4={class:"cm-line"};function E3(e){let t=Ej.get(e);return t&&t.setDOM(e.cloneNode()),e}class E6 extends RM{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}}E6.inline=new E6("span"),E6.block=new E6("div");let E8=new class extends RM{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class E9{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=RT.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 E$(e,e.contentDOM),this.updateInner([new EB(0,0,0,e.state.doc.length)],null)}update(e){var t,n,r,i,o,a,s,l,u;let c,d,h,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,r=this.hasComposition,c=!1,r&&n.iterChangedRanges((e,t)=>{e<r.to&&t>r.from&&(c=!0)}),c||e.selectionSet||(f=e.state.selection.main.head)));let g=f>-1?function(e,t,n){let r=Pe(e,n);if(!r)return null;let{node:i,from:o,to:a}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let l=t.invertedDesc;return{range:new EB(l.mapPos(o),l.mapPos(a),o,a),text:i}}(this.view,e.changes,f):null;if(this.domChanged=null,this.hasComposition){let{from:t,to:n}=this.hasComposition;p=new EB(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,(Rb.ie||Rb.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=(i=m,o=this.decorations,a=e.changes,d=new Pt,OU.compare(i,o,a,d),d.changes);y.length&&(p=EB.extendWithRanges(p,y));let x=(s=v,l=this.blockWrappers,u=e.changes,h=new Pn,OU.compare(s,l,u,h),h.changes);return x.length&&(p=EB.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,r=new E2(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&Ej.get(t.text)&&r.cache.reused.set(Ej.get(t.text),2),this.tile=r.run(e,t),E7(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let r=Rb.chrome||Rb.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];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 Pr&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){for(let t of(this.editContextFormatting=this.editContextFormatting.map(e.changes),e.transactions))for(let e of t.effects)e.is(Ex)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){var n;(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,o=i==r,a=!o&&!(this.view.state.facet(Ew)||r.tabIndex>-1)&&RN(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));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)),Rb.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 R0(e,0),s=!0}let d=this.view.observer.selectionRange;!s&&d.focusNode&&(Rz(u.node,u.offset,d.anchorNode,d.anchorOffset)&&Rz(c.node,c.offset,d.focusNode,d.focusOffset)||this.suppressWidgetCursorChange(d,l))||(this.view.observer.ignore(()=>{Rb.android&&Rb.chrome&&r.contains(d.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}(d.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let e=RP(this.view.root);if(e)if(l.empty){if(Rb.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?RQ:RJ)(u.node,u.offset);t&&(u=new R0(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==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(u,c)),this.impreciseAnchor=u.precise?null:new R0(d.anchorNode,d.anchorOffset),this.impreciseHead=c.precise?null:new R0(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Rz(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=RP(e.root),{anchorNode:r,anchorOffset:i}=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(r,i)}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 r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=0==RH(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;0==r&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!Ej.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!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&&(i=!0)}else{let u=l+t.length;if(l<=e&&(n=t,r=e-l,i=u<e),u>=e&&!o&&(o=t,a=e-l,s=l>e),l>e&&o)return!0}}),n||o)?(i&&o?n=null:s&&n&&(o=null),n&&t<0||!o?n.domIn(r,t):o.domIn(a,t)):this.domAtPos(e,t)}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof Pr?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,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 r of t.children){if(r.length>=n){let t=e(r,n);if(t)return t}if((n-=r.length)<0)break}else if(t.isText()&&n<t.length){let e=DQ(t.text,n);if(e==n)return null;let r=RX(t.dom,n,e).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}(t,n):null}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,o=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,s=this.view.textDirection==R1.LTR,l=0,u=(e,c,d)=>{for(let h=0;h<e.children.length&&!(c>r);h++){let r=e.children[h],p=c+r.length,f=r.dom.getBoundingClientRect(),{height:g}=f;if(d&&!h&&(l+=f.top-d.top),r instanceof EW)p>n&&u(r,c,f);else if(c>=n&&(l>0&&t.push(-l),t.push(g+l),l=0,o)){let e=r.dom.lastChild,t=e?RB(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=i,this.minWidthFrom=c,this.minWidthTo=p)}}d&&h==e.children.length-1&&(l+=d.bottom-f.bottom),c=p+r.breakAfter}};return u(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return"rtl"==getComputedStyle(t.dom).direction?R1.RTL:R1.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=RB(r.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,r,i;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=RB(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],o=i?i.from-1:this.view.state.doc.length;if(o>n){let r=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(RT.replace({widget:new Pr(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!i)break;n=i.to+1}return RT.set(e)}updateDeco(){let e=1,t=this.view.state.facet(E_).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,r=this.view.state.facet(ED).map((e,t)=>{let r="function"==typeof e;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(OU.join(r))),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(EI).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(Em))try{if(t(this.view,e.range,e))return!0}catch(e){Eb(this.view.state,e,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,null!=(t=n.assoc)?t:n.empty?0:n.head>n.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=EL(this.view),a={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:s,offsetHeight:l}=this.view.scrollDOM;if(!function(e,t,n,r,i,o,a,s){let l=e.ownerDocument,u=l.defaultView||window;for(let c=e,d=!1;c&&!d;)if(1==c.nodeType){let e,h=c==l.body,p=1,f=1;if(h)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)&&(d=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let t=c.getBoundingClientRect();({scaleX:p,scaleY:f}=RW(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"==i)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 r=t.bottom-t.top,o=e.bottom-e.top;m=("center"==i&&r<=o?t.top+r/2-o/2:"start"==i||"center"==i&&n<0?t.top-a:t.bottom-o+a)-e.top}if("nearest"==r?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"==r?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==r==s?t.left-o:t.right-(e.right-e.left)+o)-e.left,g||m)if(h)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)&&(r="nearest"),n&&1>Math.abs(n-m)&&(i="nearest")}if(h)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==R1.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.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(){E7(this.tile)}}function E7(e,t){let n=null==t?void 0:t.get(e);if(1!=n)for(let r of(null==n&&e.destroy(),e.children))E7(r,t)}function Pe(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=RQ(n.focusNode,n.focusOffset),i=RJ(n.focusNode,n.focusOffset),o=r||i;if(i&&r&&i.node!=r.node){let t=Ej.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)o=i;else if(e.docView.lastCompositionAfterCursor){let e=Ej.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(o=i)}}if(e.docView.lastCompositionAfterCursor=o!=r,!o)return null;let a=t-o.offset;return{from:a,to:a+o.node.nodeValue.length,node:o.node}}let Pt=class{constructor(){this.changes=[]}compareRange(e,t){RR(e,t,this.changes)}comparePoint(e,t){RR(e,t,this.changes)}boundChange(e){RR(e,e,this.changes)}};class Pn{constructor(){this.changes=[]}compareRange(e,t){RR(e,t,this.changes)}comparePoint(){}boundChange(e){RR(e,e,this.changes)}}class Pr extends RM{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 Pi(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==Rk.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function Po(e,t,n,r){let i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),a=e.textDirectionAt(i.from);for(let s=t,l=null;;){let t=function(e,t,n,r,i){var o;let a=r.head-e.from,s=Et.find(t,a,null!=(o=r.bidiLevel)?o:-1,r.assoc),l=t[s],u=l.side(i,n);if(a==u){let e=s+=i?1:-1;if(e<0||e>=t.length)return null;a=(l=t[s=e]).side(!i,n),u=l.side(i,n)}let c=DQ(e.text,a,l.forward(i,n));(c<l.from||c>l.to)&&(c=u),Ei=e.text.slice(Math.min(a,c),Math.max(a,c));let d=s==(i?t.length-1:0)?null:t[s+(i?1:-1)];return d&&c==u&&d.level+ +!i<l.level?Or.cursor(d.side(!i,n)+e.from,d.forward(i,n)?1:-1,d.level):Or.cursor(c+e.from,l.forward(i,n)?-1:1,l.level)}(i,o,a,s,n),u=Ei;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;u="\n",i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(l){if(!l(u))return s}else{if(!r)return t;l=r(u)}s=t}}function Pa(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,o)=>{if(t>e&&t<i){let o=r||n||(t-e<i-t?-1:1);t=o<0?e:i,r=o}});if(!r)return t}}function Ps(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],o=null;if(i.empty){let t=Pa(e,i.from,0);t!=i.from&&(o=Or.cursor(t,-1))}else{let t=Pa(e,i.from,-1),n=Pa(e,i.to,1);(t!=i.from||n!=i.to)&&(o=i.undirectional?Or.undirectionalRange(i.from,i.to):Or.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}o&&(n||(n=t.ranges.slice()),n[r]=o)}return n?Or.create(n,t.mainIndex):t}function Pl(e,t,n){let r=Pa(e.state.facet(EO).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:Or.cursor(r,r<n.from?1:-1)}class Pu{constructor(e,t){this.pos=e,this.assoc=t}}function Pc(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),o=i.top+e.viewState.paddingTop,{x:a,y:s}=t,l=s-o,u;for(;;){if(l<0)return new Pu(0,1);if(l>e.viewState.docHeight)return new Pu(e.state.doc.length,-1);if(u=e.elementAtHeight(l),null==r)break;if(u.type==Rk.Text){if(r<0?u.to<e.viewport.from:u.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?u.from:u.to,r>0?-1:1);if(t&&(r<0?t.top<=l+o:t.bottom>=l+o))break}let t=e.viewState.heightOracle.textHeight/2;l=r>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==Rk.Text){let t=function(e,t,n,r,i){let o=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;o+=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t)*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(n.from,n.to);return n.from+O3(a,o,e.state.tabSize)}(e,i,u,a,s);return new Pu(t,t==u.from?1:-1)}}if(u.type!=Rk.Text)return l<(u.top+u.bottom)/2?new Pu(u.from,1):new Pu(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 Pd(e,a,s,e.textDirectionAt(u.from)).scanTile(c,u.from)}class Pd{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,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:r}=this.bidiSpansAt(e);return r[Et.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Et.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r,i,o=0,a=e.length-1,s=new Set,l=this.bidiIn(e[0],e[a]),u=-1,c=1e9,d;for(;o<a;){let n=a-o,h=o+a>>1;i:if(s.has(h)){let e=o+Math.floor(Math.random()*n);for(let t=0;t<n;t++){if(!s.has(e)){h=e;break i}++e==a&&(e=o)}break}s.add(h);let p=t(h);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)(!r||r.bottom<n.bottom)&&(r=n),s=1;else if(n.top>this.y)(!i||i.top>n.top)&&(i=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=h,c=t,d=n),e&&(s=e<0==(this.baseDir==R1.LTR)?-1:1)}-1==s&&(!l||this.baseDirAt(e[h],1))?a=h:1==s&&(!l||this.baseDirAt(e[h+1],-1))&&(o=h+1)}}}if(!d){if(!i&&!r)return{i:e[0],after:!1};let n=r&&(!i||this.y-r.bottom<i.top-this.y)?r:i;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(c&&!n){let{top:n,bottom:o}=d;if(r&&r.bottom>(n+n+o)/3)return this.y=r.bottom-1,this.scan(e,t,!0);if(i&&i.top<(n+o+o)/3)return this.y=i.top+1,this.scan(e,t,!0)}let h=(l?this.dirAt(e[u],1):this.baseDir)==R1.LTR;return{i:u,after:this.x>(d.left+d.right)/2==h}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=DQ(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,o=n[r+1]-t;return RX(e.dom,i,o).getClientRects()});return r.after?new Pu(n[r.i+1],-1):new Pu(n[r.i],1)}scanTile(e,t){if(!e.length)return new Pu(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 r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return 48&n.flags?null:(1==n.dom.nodeType?n.dom:RX(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],o=n[r.i];return i.isText()?this.scanText(i,o):i.isComposite()?this.scanTile(i,o):r.after?new Pu(n[r.i+1],-1):new Pu(o,1)}}class Ph{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(OF.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+="￿"}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=Ej.get(r),o=r.nextSibling;if(o==t){(null==i?void 0:i.breakAfter)&&!o&&n!=this.view.contentDOM&&this.lineBreak();break}let a=Ej.get(o);(i&&a?i.breakAfter:(i?i.breakAfter:Rj(r))||Rj(o)&&("BR"!=r.nodeName||(null==i?void 0:i.isWidget()))&&this.text.length>e)&&!function(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=Ej.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(),r=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,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,o=1,a;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(a=r.exec(t))&&(i=a.index,o=a[0].length),this.append(t.slice(n,i<0?t.length:i)),i<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=i+o}}readNode(e){let t=Ej.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<RH(t))return!1;if(t==e)return!0;n=RF(t)+1,t=t.parentNode}}(e,n.node,n.offset)?0:t))}}class Pp{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Pf{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:i,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,r,i){if(t.isComposite()){let o=-1,a=-1,s=-1,l=-1;for(let u=0,c=i,d=i;u<t.children.length;u++){let i=t.children[u],h=c+i.length;if(c<n&&h>r)return e(i,n,r,c);if(h>=n&&-1==o&&(o=u,a=c),c>r&&i.dom.parentNode==t.dom){s=u,l=d;break}d=h,c=h+i.breakAfter}return{from:a,to:l<0?i+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:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}(e.docView.tile,t,n,0))){let t=i||o?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new Pp(n,r)),(i!=n||o!=r)&&t.push(new Pp(i,o))),t}(e),n=new Ph(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,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?Or.single(n+t,r+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!RL(e.contentDOM,t.focusNode)?a.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!RL(e.contentDOM,t.anchorNode)?a.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((Rb.ios||Rb.chrome)&&n!=r&&Math.min(n,r)<=a.main.from&&Math.max(n,r)>=a.main.to&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),o=s.from-t,a=s.to-i;(0==o||1==o||0==t)&&(0==a||-1==a||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&a.ranges.length>1)this.newSel=a.replaceRange(Or.range(r,n));else if(e.lineWrapping&&r==n&&!(a.main.empty&&a.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=Or.create([Or.cursor(n,r)])}else this.newSel=Or.single(r,n)}}}function Pg(e,t){let n,{newSel:r}=t,{state:i}=e,o=i.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=o.from,l=null;(8===a||Rb.android&&t.text.length<r-e)&&(s=o.to,l="end");let u=i.doc.sliceString(e,r,"￿"),c,d;!o.empty&&o.from>=e&&o.to<=r&&(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:D$.of(t.text.slice(o.from-e,c).split("￿"))}:(d=Pv(u,t.text,s-e,l))&&(Rb.chrome&&13==a&&d.toB==d.from+2&&"￿￿"==t.text.slice(d.from,d.toB)&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:D$.of(t.text.slice(d.from,d.toB).split("￿"))})}else r&&(!e.hasFocus&&i.facet(Ew)||Py(r,o))&&(r=null);if(!n&&!r)return!1;if((Rb.mac||Rb.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(r&&2==n.insert.length&&(r=Or.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:D$.of([n.insert.toString().replace("."," ")])}):i.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:i.toText(e.inputState.insertingText)}:Rb.chrome&&n&&n.from==n.to&&n.from==o.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(r&&(r=Or.single(r.main.anchor-1,r.main.head-1)),n={from:o.from,to:o.to,insert:D$.of([" "])}),n)return Pm(e,n,r,a);if(!r||Py(r,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)&&(r=Ps(i.facet(EO).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}}function Pm(e,t,n,r=-1){let i;if(Rb.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(Rb.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&&RZ(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==r&&t.insert.length<t.to-t.from&&t.to>o.head)&&RZ(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&RZ(e.contentDOM,"Delete",46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let s=()=>i||(i=function(e,t,n){let r,i=e.state,o=i.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,r=n<0?o.from:o.to,s=Pa(i.facet(EO).map(t=>t(e)),r,n);t.from==s&&(a=s)}if(a>-1)r={changes:t,selection:Or.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?i.sliceDoc(o.from,t.from):"",a=o.to>t.to?i.sliceDoc(t.to,o.to):"";r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+a))}else{let a=i.changes(t),s=n&&n.main.to<=a.newLength?n.main:void 0;if(i.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&&Pe(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 d=o.to-t.to;r=i.changeByRange(n=>{if(n.from==o.from&&n.to==o.to)return{changes:a,range:s||n.map(a)};let r=n.to-d,c=r-l.length;if(e.state.sliceDoc(c,r)!=l||r>=u.from&&c<=u.to)return{range:n};let h=i.changes({from:c,to:r,insert:t.insert}),p=n.to-o.to;return{changes:h,range:s?Or.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(h)}})}else r={changes:a,selection:s&&i.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)),i.update(r,{userEvent:s,scrollIntoView:!0})}(e,t,n));return e.state.facet(Ec).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function Pv(e,t,n,r){let i=Math.min(e.length,t.length),o=0;for(;o<i&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==i&&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"==r){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 Py(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class Px{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,Rb.safari&&e.contentDOM.addEventListener("input",()=>null),Rb.gecko&&function(e){PH.has(e)||(PH.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,r;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(r=Ej.get(n))&&r.isWidget()&&!r.isHidden&&r.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,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(Pb(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(Pb(t.value,r))}}for(let e in Pk)n(e).handlers.push(Pk[e]);for(let e in PT)n(e).observers.push(PT[e]);return t}(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if("scroll"!=e){let i=!t[e].handlers.length,o=n[e];o&&!o.handlers.length!=i&&(r.removeEventListener(e,this.handleEvent),o=null),o||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)"scroll"==e||t[e]||r.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>PA.indexOf(e.keyCode)&&(this.tabFocusMode=-1),Rb.android&&Rb.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(Rb.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(Pw.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||PS.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&&Rb.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,RZ(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&!e.synthetic&&(this.composing>0||!!(Rb.safari&&!Rb.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 Pb(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){Eb(n.state,e)}}}let Pw=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],PS="dthko",PA=[16,17,18,20,91,92,224,225];function PC(e){return .7*Math.max(0,e)+8}class PM{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=RG(e.contentDOM),this.atoms=e.state.facet(EO).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(OF.allowMultipleSelections)&&function(e,t){let n=e.state.facet(Eo);return n.length?n[0](t):Rb.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=RP(e.root);if(!r||0==r.rangeCount)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[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==PN(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,r=0,i=0,o=0,a=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:s}=this.scrollParents.y.getBoundingClientRect());let l=EL(this.view);e.clientX-l.left<=i+6?n=-PC(i-e.clientX):e.clientX+l.right>=a-6&&(n=PC(e.clientX-a)),e.clientY-l.top<=o+6?r=-PC(o-e.clientY):e.clientY+l.bottom>=s-6&&(r=PC(e.clientY-s)),this.setScrollSpeed(n,r)}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=Ps(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 Pk=Object.create(null),PT=Object.create(null),P_=Rb.ie&&Rb.ie_version<15||Rb.ios&&Rb.webkit_version<604;function PI(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function PD(e,t){t=PI(e.state,Eh,t);let{state:n}=e,r,i=1,o=n.toText(t),a=o.lines==n.selection.ranges.length;if(null!=Pz&&n.selection.ranges.every(e=>e.empty)&&Pz==o.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let l=n.toText((a?o.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:l},range:Or.cursor(r.from+l.length)}})}else r=a?n.changeByRange(e=>{let t=o.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Or.cursor(e.from+t.length)}}):n.replaceSelection(o);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}function PO(e,t,n,r){if(1==r)return Or.cursor(t,n);{if(2==r)return function(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(0==i.length)return Or.cursor(t);0==o?n=1:o==i.length&&(n=-1);let a=o,s=o;n<0?a=DQ(i.text,o,!1):s=DQ(i.text,o);let l=r(i.text.slice(a,s));for(;a>0;){let e=DQ(i.text,a,!1);if(r(i.text.slice(e,a))!=l)break;a=e}for(;s<i.length;){let e=DQ(i.text,s);if(r(i.text.slice(s,e))!=l)break;s=e}return Or.undirectionalRange(a+i.from,s+i.from)}(e.state,t,n);let i=e.docView.lineAt(t,n),o=e.state.doc.lineAt(i?i.posAtEnd:t),a=i?i.posAtStart:o.from,s=i?i.posAtEnd:o.to;return s<e.state.doc.length&&s==o.to&&s++,Or.undirectionalRange(a,s)}}PT.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},PT.wheel=PT.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},Pk.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),PT.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")},PT.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},Pk.mousedown=(e,t)=>{var n,r;let i,o,a;if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let s=null;for(let n of e.state.facet(Es))if(s=n(e,t))break;if(s||0!=t.button||(n=e,r=t,i=n.posAndSideAtCoords({x:r.clientX,y:r.clientY},!1),o=PN(r),a=n.state.selection,s={update(e){e.docChanged&&(i.pos=e.changes.mapPos(i.pos),a=a.map(e.changes))},get(e,t,r){let s=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),l,u=PO(n,s.pos,s.assoc,o);if(i.pos!=s.pos&&!t){let e=PO(n,i.pos,i.assoc,o),t=Math.min(e.from,u.from),r=Math.max(e.to,u.to);u=t<u.from?Or.range(t,r,u.assoc):Or.range(r,t,u.assoc)}return t?a.replaceRange(a.main.extend(u.from,u.to,u.assoc)):r&&1==o&&a.ranges.length>1&&(l=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return Or.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:r?a.addRange(u):Or.create([u])}}),s){let n=!e.hasFocus;e.inputState.startMouseSelection(new PM(e,t,s,n)),n&&e.observer.ignore(()=>{RY(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}else e.inputState.setSelectionOrigin("select.pointer");return!1};let PR=Rb.ie&&Rb.ie_version<=11,PE=null,PP=0,PL=0;function PN(e){if(!PR)return e.detail;let t=PE,n=PL;return PE=e,PL=Date.now(),PP=!t||n>Date.now()-400&&2>Math.abs(t.clientX-e.clientX)&&2>Math.abs(t.clientY-e.clientY)?(PP+1)%3:1}function PB(e,t,n,r){let i;if(!(n=PI(e.state,Eh,n)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,s=r&&a&&((i=e.state.facet(Ea)).length?i[0](t):Rb.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}Pk.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=Or.undirectionalRange(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",PI(e.state,Ep,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},Pk.dragend=e=>(e.inputState.draggedContent=null,!1),Pk.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&PB(e,t,r.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)||(r[e]=t.result),o()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return PB(e,t,n,!0),!0}return!1},Pk.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=P_?null:t.clipboardData;return n?(PD(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(),PD(e,n.value)},50)}(e),!1)};let Pz=null;Pk.copy=Pk.cut=(e,t)=>{if(!RN(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=function(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let o=e.doc.lineAt(r);o.number>i&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),i=o.number}r=!0}return{text:PI(e,Ep,t.join(e.lineBreak)),ranges:n,linewise:r}}(e.state);if(!n&&!i)return!1;Pz=i?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=P_?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 r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}(e,n),!1)};let PF=O_.define();function Pj(e,t){let n=[];for(let r of e.facet(Ed)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:PF.of(!0)}):null}function PV(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=Pj(e.state,t);n?e.dispatch(n):e.update([])}},10)}PT.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),PV(e)},PT.blur=e=>{e.observer.clearSelectionRange(),PV(e)},PT.compositionstart=PT.compositionupdate=e=>{!e.observer.editContext&&(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},PT.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,Rb.chrome&&Rb.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},PT.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},Pk.beforeinput=(e,t)=>{var n,r;let i;if(("insertText"==t.inputType||"insertCompositionText"==t.inputType)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),"insertReplacementText"==t.inputType&&e.observer.editContext){let r=null==(n=t.dataTransfer)?void 0:n.getData("text/plain"),i=t.getTargetRanges();if(r&&i.length){let t=i[0],n=e.posAtDOM(t.startContainer,t.startOffset),o=e.posAtDOM(t.endContainer,t.endOffset);return Pm(e,{from:n,to:o,insert:e.state.toText(r)},null),!0}}if(Rb.chrome&&Rb.android&&(i=Pw.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(i.key,i.keyCode),"Backspace"==i.key||"Delete"==i.key)){let t=(null==(r=window.visualViewport)?void 0:r.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 Rb.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),Rb.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>PT.compositionend(e,t),20),!1};let PH=new Set,P$=["pre-wrap","normal","pre-line","break-spaces"],PW=!1;class PG{constructor(e){this.lineWrapping=e,this.doc=D$.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 P$.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(10*r)]||(t=!0,this.heightSamples[Math.floor(10*r)]=!0)}return t}refresh(e,t,n,r,i,o){let a=P$.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=r,this.lineLength=i,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 PU{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Pq{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return"number"==typeof this._content?Rk.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 RD?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 Pq(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var PY=((w=PY||(PY={}))[w.ByPos=0]="ByPos",w[w.ByHeight=1]="ByHeight",w[w.ByPosNoHeight=2]="ByPosNoHeight",w);class PX{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&&(PW=!0),this.height=e)}replace(e,t,n){return PX.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,o=n.doc;for(let a=r.length-1;a>=0;a--){let{fromA:s,toA:l,fromB:u,toB:c}=r[a],d=i.lineAt(s,PY.ByPosNoHeight,n.setDoc(t),0,0),h=d.to>=l?d:i.lineAt(l,PY.ByPosNoHeight,n,0,0);for(c+=h.to-l,l=h.to;a>0&&d.from<=r[a-1].toA;)s=r[a-1].fromA,u=r[a-1].fromB,a--,s<d.from&&(d=i.lineAt(s,PY.ByPosNoHeight,n,0,0));u+=d.from-s,s=d.from;let p=P5.build(n.setDoc(o),e,u,c);i=PZ(i,i.replace(s,l,p))}return i.updateHeight(n,0)}static empty(){return new PJ(0,0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,r=0,i=0;for(;;)if(t==n)if(r>2*i){let i=e[t-1];i.break?e.splice(--t,1,i.left,null,i.right):e.splice(--t,1,i.left,i.right),n+=1+i.break,r-=i.size}else if(i>2*r){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,i-=t.size}else break;else if(r<i){let n=e[t++];n&&(r+=n.size)}else{let t=e[--n];t&&(i+=t.size)}let o=0;return null==e[t-1]?(o=1,t--):null==e[t]&&(o=1,n++),new P1(PX.of(e.slice(0,t)),o,PX.of(e.slice(n)))}}function PZ(e,t){return e==t?e:(e.constructor!=t.constructor&&(PW=!0),t)}PX.prototype.size=1;let PK=RT.replace({});class PQ extends PX{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new Pq(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new Pq(r,0,n,this.spaceAbove,PK):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let o=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(o):o}forEachLine(e,t,n,r,i,o){e<=i+this.length&&t>=i&&o(this.lineAt(0,PY.ByPos,n,r,i))}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,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class PJ extends PQ{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 Pq(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let r=n[0];return 1==n.length&&(r instanceof PJ||r instanceof P0&&4&r.flags)&&10>Math.abs(this.length-r.length)?(r instanceof P0?r=new PJ(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):PX.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(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 P0 extends PX{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,o,a=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);o=t/i,this.length>i+1&&(a=(this.height-t)/(this.length-i-1))}else o=this.height/i;return{firstLine:n,lastLine:r,perLine:o,perChar:a}}blockAt(e,t,n,r){let{firstLine:i,lastLine:o,perLine:a,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),o=t.doc.lineAt(i),l=a+o.length*s,u=Math.max(n,e-l/2);return new Pq(o.from,o.length,u,l,0)}{let r=Math.max(0,Math.min(o-i,Math.floor((e-n)/a))),{from:s,length:l}=t.doc.line(i+r);return new Pq(s,l,n+a*r,a,0)}}lineAt(e,t,n,r,i){if(t==PY.ByHeight)return this.blockAt(e,n,r,i);if(t==PY.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new Pq(t,r-t,0,0,0)}let{firstLine:o,perLine:a,perChar:s}=this.heightMetrics(n,i),l=n.doc.lineAt(e),u=a+l.length*s,c=l.number-o,d=r+a*c+s*(l.from-i-c);return new Pq(l.from,l.length,Math.max(r,Math.min(d,r+this.height-u)),u,0)}forEachLine(e,t,n,r,i,o){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:a,perLine:s,perChar:l}=this.heightMetrics(n,i);for(let u=e,c=r;u<=t;){let t=n.doc.lineAt(u);if(u==e){let n=t.number-a;c+=s*n+l*(e-i-n)}let r=s+l*t.length;o(new Pq(t.from,t.length,c,r,0)),c+=r,u=t.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let e=n[n.length-1];e instanceof P0?n[n.length-1]=new P0(e.length+r):n.push(null,new P0(r-1))}if(e>0){let t=n[0];t instanceof P0?n[0]=new P0(e+t.length):n.unshift(new P0(e-1),null)}return PX.of(n)}decomposeLeft(e,t){t.push(new P0(e-1),null)}decomposeRight(e,t){t.push(null,new P0(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let i=t+this.length;if(r&&r.from<=t+this.length&&r.more){let n=[],o=Math.max(t,r.from),a=-1;for(r.from>t&&n.push(new P0(r.from-t-1).updateHeight(e,t));o<=i&&r.more;){let t=e.doc.lineAt(o).length;n.length&&n.push(null);let i=r.heights[r.index++],s=0;i<0&&(s=-i,i=r.heights[r.index++]),-1==a?a=i:Math.abs(i-a)>=.001&&(a=-2);let l=new PJ(t,i,s);l.outdated=!1,n.push(l),o+=t+1}o<=i&&n.push(null,new P0(i-o).updateHeight(e,o));let s=PX.of(n);return(a<0||Math.abs(s.height-this.height)>=.001||Math.abs(a-this.heightMetrics(e,t).perLine)>=.001)&&(PW=!0),PZ(this,s)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class P1 extends PX{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,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let o=r+this.left.height,a=i+this.left.length+this.break,s=t==PY.ByHeight?e<o:e<a,l=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,o,a);if(this.break||(s?l.to<a:l.from>a))return l;let u=t==PY.ByPosNoHeight?PY.ByPosNoHeight:PY.ByPos;return s?l.join(this.right.lineAt(a,u,n,o,a)):this.left.lineAt(a,u,n,r,i).join(l)}forEachLine(e,t,n,r,i,o){let a=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,o),t>=s&&this.right.forEachLine(e,t,n,a,s,o);else{let l=this.lineAt(s,PY.ByPos,n,r,i);e<l.from&&this.left.forEachLine(e,l.from-1,n,r,i,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 r=this.left.length+this.break;if(t<r)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-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let o=i.length;for(let e of n)i.push(e);if(e>0&&P2(i,o-1),t<this.length){let e=i.length;this.decomposeRight(t,i),P2(i,e)}return PX.of(i)}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,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?PX.of(this.break?[e,null,t]:[e,t]):(this.left=PZ(this.left,e),this.right=PZ(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,r){let{left:i,right:o}=this,a=t+i.length+this.break,s=null;return(r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=a+o.length&&r.more?s=o=o.updateHeight(e,a,n,r):o.updateHeight(e,a,n),s)?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function P2(e,t){let n,r;null==e[t]&&(n=e[t-1])instanceof P0&&(r=e[t+1])instanceof P0&&e.splice(t-1,3,new P0(n.length+1+r.length))}class P5{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 PJ?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new PJ(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 r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new PQ(o,r,n)):(o||i||r>=5)&&this.addLineDeco(r,i,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 PJ(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new P0(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 PJ)return e;let t=new PJ(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 r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.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 PJ||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new PJ(0,-1,0));let n=e;for(let e of this.nodes)e instanceof PJ&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,r){let i=new P5(n,e);return OU.spans(t,n,r,i,0),i.finish(n)}}class P4{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&RR(e,t,this.changes,5)}}class P3{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return RT.replace({widget:new P6(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class P6 extends RM{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 P8{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=Lt,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=R1.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(ET).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new PG(n),this.stateDeco=Ln(t),this.heightMap=PX.empty().applyChanges(this.stateDeco,D$.empty,this.heightOracle.setDoc(t.doc),[new EB(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=RT.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 r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new P9(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?Lt:new Lr(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(Li(e,this.scaler))})}update(e,t=null){var n,r;let i;this.state=e.state;let o=this.stateDeco;this.stateDeco=Ln(this.state);let a=e.changedRanges,s=EB.extendWithRanges(a,(n=this.stateDeco,r=e?e.changes:D3.empty(this.state.doc.length),i=new P4,OU.compare(o,n,r,i,0),i.changes)),l=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);PW=!1,this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=l||PW)&&(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 d=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(d||!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(Eg)&&(this.mustEnforceCursorAssoc=!0)}measure(){var e;let t,n,{view:r}=this,i=r.contentDOM,o=window.getComputedStyle(i),a=this.heightOracle,s=o.whiteSpace;this.defaultTextDirection="rtl"==o.direction?R1.RTL:R1.LTR;let l=this.heightOracle.mustRefreshForWrapping(s)||"refresh"===this.mustMeasureContent,u=i.getBoundingClientRect(),c=l||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let d=0,h=0;if(u.width&&u.height){let{scaleX:e,scaleY:t}=RW(i,u);(e>.005&&Math.abs(this.scaleX-e)>.005||t>.005&&Math.abs(this.scaleY-t)>.005)&&(this.scaleX=e,this.scaleY=t,d|=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,d|=18),this.editorWidth!=r.scrollDOM.clientWidth&&(a.lineWrapping&&(c=!0),this.editorWidth=r.scrollDOM.clientWidth,d|=16);let g=RG(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=RK(this.scrollParent||r.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(),r=e.ownerDocument,i=r.defaultView||window,o=Math.max(0,n.left),a=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(1==t.nodeType){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=r.overflow){let r=n.getBoundingClientRect();o=Math.max(o,r.left),a=Math.min(a,r.right),s=Math.max(s,r.top),l=Math.min(t==e.parentNode?i.innerHeight:l,r.bottom)}t="absolute"==r.position||"fixed"==r.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)}})(i,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=r.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!=r.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=r.scrollDOM.clientHeight,d|=16),c){let e=r.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:i}=r.docView.measureTextSize();(l=t>0&&a.refresh(s,t,n,i,Math.max(5,w/n),e))&&(r.docView.minWidth=0,d|=16)}for(let t of(y>0&&x>0?h=Math.max(y,x):y<0&&x<0&&(h=Math.min(y,x)),PW=!1,this.viewports)){let n=t.from==this.viewport.from?e:r.docView.measureVisibleLineHeights(t);this.heightMap=(l?PX.empty().applyChanges(this.stateDeco,D$.empty,this.heightOracle,[new EB(0,0,0,r.state.doc.length)]):this.heightMap).updateHeight(a,0,l,new PU(t.from,n))}PW&&(d|=2)}let S=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return S&&(2&d&&(d|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),d|=this.updateForViewport()),(2&d||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,r)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,r.docView.enforceCursorAssoc()),d}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)),r=this.heightMap,i=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,s=new P9(r.lineAt(o-1e3*n,PY.ByHeight,i,0,0).from,r.lineAt(a+(1-n)*1e3,PY.ByHeight,i,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=r.lineAt(e,PY.ByPos,i,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 P9(r.lineAt(a-500,PY.ByHeight,i,0,0).from,r.lineAt(a+n+500,PY.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new P9(this.heightMap.lineAt(n,PY.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,PY.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,PY.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,PY.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(0==e||r<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=a+Math.max(10,Math.min(n,250)))&&r>o-2e3&&i<a+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new P3(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,o=r<<1;if(this.defaultTextDirection!=R1.LTR&&!n)return[];let a=[],s=(r,o,l,u)=>{if(o-r<i)return;let c=this.state.selection.main,d=[c.from];for(let e of(c.empty||d.push(c.to),d))if(e>r&&e<o){s(r,e-10,l,u),s(e+10,o,l,u);return}let h=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-r)<i&&Math.abs(e.to-o)<i&&!d.some(t=>e.from<t&&e.to>t));if(!h){if(o<l.to&&t&&n&&t.visibleRanges.some(e=>e.from<=o&&e.to>=o)){let e=t.moveToLineBoundary(Or.cursor(o),!1,!0).head;e>r&&(o=e)}let e=this.gapSize(l,r,o,u),i=n||e<2e6?e:2e6;h=new P3(r,o,e,i)}a.push(h)},l=t=>{var i,a,l;let u,c,d,h,p;if(t.length<o||t.type!=Rk.Text)return;let f=(i=t.from,a=t.to,l=this.stateDeco,d=[],h=i,p=0,OU.spans(l,i,a,{span(){},point(e,t){e>h&&(d.push({from:h,to:e}),p+=e-h),h=t}},20),h<a&&(d.push({from:h,to:a}),p+=a-h),{total:p,ranges:d});if(f.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,i=r/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=g){let r=Le(f,g),o=((this.visibleBottom-this.visibleTop)/2+i)/t.height;e=r-o,n=r+o}else e=(this.visibleTop-t.top-i)/t.height,n=(this.visibleBottom-t.top+i)/t.height;u=P7(f,e),c=P7(f,n)}else{let n,i,o=f.total*this.heightOracle.charWidth,a=r*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,d=this.pixelViewport.right+s;if(null!=g){let e=Le(f,g),t=((d-l)/2+a)/o;n=e-t,i=e+t}else n=(l-a)/o,i=(d+a)/o;u=P7(f,n),c=P7(f,i)}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,r){let i=Le(r,n)-Le(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){P3.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=RT.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=[];OU.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(8&r);t++){let i=this.visibleRanges[t],o=n[t];(i.from!=o.from||i.to!=o.to)&&(r|=4,e&&e.mapPos(i.from,-1)==o.from&&e.mapPos(i.to,1)==o.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Li(this.heightMap.lineAt(e,PY.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)||Li(this.heightMap.lineAt(this.scaler.fromDOM(e),PY.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 Li(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 P9{constructor(e,t){this.from=e,this.to=t}}function P7({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],o=i-n;if(r<=o)return n+r;r-=o}}function Le(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}let Lt={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};function Ln(e){let t=e.facet(E_).filter(e=>"function"!=typeof e),n=e.facet(ED).filter(e=>"function"!=typeof e);return n.length&&t.push(OU.join(n)),t}class Lr{constructor(e,t,n){let r=0,i=0,o=0;for(let a of(this.viewports=n.map(({from:n,to:i})=>{let o=t.lineAt(n,PY.ByPos,e,0,0).top,a=t.lineAt(i,PY.ByPos,e,0,0).bottom;return r+=a-o,{from:n,to:i,top:o,bottom:a,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r),this.viewports))a.domTop=o+(a.top-i)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),i=a.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(e){return e instanceof Lr&&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 Li(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new Pq(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>Li(e,t)):e._content)}let Lo=Oa.define({combine:e=>e.join(" ")}),La=Oa.define({combine:e=>e.indexOf(!0)>-1}),Ls=O7.newName(),Ll=O7.newName(),Lu=O7.newName(),Lc={"&light":"."+Ll,"&dark":"."+Lu};function Ld(e,t,n){return new O7(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 Lh=Ld("."+Ls,{"&":{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"}},Lc),Lp={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Lf=Rb.ie&&Rb.ie_version<=11;class Lg{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new RU,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);(Rb.ie&&Rb.ie_version<=11||Rb.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&&Rb.android&&!1!==e.constructor.EDIT_CONTEXT&&!(Rb.chrome&&Rb.chrome_version<126)&&(this.editContext=new Ly(e),e.state.facet(Ew)&&(e.contentDOM.editContext=this.editContext.editContext)),Lf&&(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,r=this.selectionRange;if(n.state.facet(Ew)?n.root.activeElement!=this.dom:!RN(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Rb.ie&&Rb.ie_version<=11||Rb.android&&Rb.chrome)&&!n.state.selection.main.empty&&r.focusNode&&Rz(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=RP(e.root);if(!t)return!1;let n=Rb.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 Lv(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?Lv(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=RN(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,RH(n));;)if(r){if(1!=n.nodeType)return!1;let e=n.childNodes[r-1];"false"==e.contentEditable?r--:r=RH(n=e)}else{if(n==e)return!0;r=RF(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(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,Lp),Lf&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Lf&&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&&RZ(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,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!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:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&RN(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new Pf(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}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,r=Pg(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!Py(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}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=Lm(t,e.previousSibling||e.target.previousSibling,-1),r=Lm(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):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(Ew)!=e.state.facet(Ew)&&(e.view.contentDOM.editContext=e.state.facet(Ew)?this.editContext.editContext:null))}destroy(){var e,t,n;for(let r of(this.stop(),null==(e=this.intersection)||e.disconnect(),null==(t=this.gapIntersection)||t.disconnect(),null==(n=this.resizeScroll)||n.disconnect(),this.scrollTargets))r.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 Lm(e,t,n){for(;t;){let r=Ej.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function Lv(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor,1);return Rz(a.node,a.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}class Ly{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 r=e.state.selection.main,{anchor:i,head:o}=r,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&&i<this.from?a=i:s==this.to&&i>this.to&&(s=i);let u=Pv(e.state.sliceDoc(a,s),n.text,(l?r.from:r.to)-a,l?"end":null);if(!u){let t=Or.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));Py(t,r)||e.dispatch({selection:t,userEvent:"select"});return}let c={from:u.from+a,to:u.toA+a,insert:D$.of(n.text.slice(u.from,u.toB).split("\n"))};if((Rb.mac||Rb.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(c={from:a,to:s,insert:D$.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let t=this.to-this.from+(c.to-c.from+c.insert.length);Pm(e,c,Or.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 r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);t<o;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),o=this.toEditorPos(e.rangeEnd);if(i<o){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+" ":"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${/thin/i.test(r)?1:2}px`;n.push(RT.mark({attributes:{style:e}}).range(i,o))}}}e.dispatch({effects:Ex.of(RT.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=RP(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,o,a,s,l)=>{if(n)return;let u=l.length-(o-i);if(r&&o>=r.to)if(r.from==i&&r.to==o&&r.insert.eq(l)){r=this.pendingContextChange=null,t+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(i+=t,(o+=t)<=this.from)this.from+=u,this.to+=u;else if(i<this.to){if(i<this.from||o>this.to||this.to-this.from+l.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(o),l.toString()),this.to+=u}t+=u}),r&&!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))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}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 Lx{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 P8(this,e.state||OF.create(e)),e.scrollTo&&e.scrollTo.is(Ey)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(EA).map(e=>new EM(e)),this.plugins))t.update(this);this.observer=new Lg(this),this.inputState=new Px(this),this.inputState.ensureHandlers(this.plugins),this.docView=new E9(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 OR?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,r,i=this.state;for(let t of e){if(t.startState!=i)throw RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=t.state}if(this.destroyed){this.viewState.state=i;return}let o=this.hasFocus,a=0,s=null;e.some(e=>e.annotation(PF))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,(s=Pj(i,o))||(a=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),((u=this.observer.readChange())&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(u=null)):this.observer.clear(),i.facet(OF.phrases)!=this.state.facet(OF.phrases))return this.setState(i);r=Ez.create(this,i,e),r.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:r}=this.state.facet(Lx.cursorScrollMargin);c=new Ev(e.empty?e:Or.cursor(e.head,e.head>e.anchor?-1:1),"nearest","nearest",r,n)}for(let e of t.effects)e.is(Ey)&&(c=e.value.clip(this.state))}this.viewState.update(r,c),this.bidiCache=LS.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(EN)!=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(r.startState.facet(Lo)!=r.state.facet(Lo)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let e of this.state.facet(Eu))try{e(r)}catch(e){Eb(this.state,e,"update listener")}(s||u)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),u&&!Pg(this,u)&&l.force&&RZ(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 P8(this,e),this.plugins=e.facet(EA).map(e=>new EM(e)),this.pluginMap.clear(),this.plugins))t.update(this);this.docView.destroy(),this.docView=new E9(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(EA),n=e.state.facet(EA);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new EM(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,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){Eb(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,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(o<0)if(RK(n||this.win))i=-1,o=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=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 Eb(this.state,e),Lw}}),u=Ez.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]!=Lw)try{let t=s[e];t.write&&t.write(l[e],this)}catch(e){Eb(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=((i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).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)){r+=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(Eu))e(t)}get themeClasses(){return Ls+" "+(this.state.facet(La)?Lu:Ll)+" "+this.state.facet(Lo)}updateAttrs(){let e=LA(this,Ek,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ew)?"true":"false",class:"cm-content",style:`${Rb.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),LA(this,ET,t);let n=this.observer.ignore(()=>{let n=RC(this.contentDOM,this.contentAttrs,t),r=RC(this.dom,this.editorAttrs,e);return n||r});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(Lx.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(EN);let e=this.state.facet(Lx.cspNonce);O7.mount(this.root,this.styleModules.concat(Lh).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 Pl(this,e,Po(this,e,t,n))}moveByGroup(e,t){return Pl(this,e,Po(this,e,t,t=>{var n;let r,i;return n=e.head,i=(r=this.state.charCategorizer(n))(t),e=>{let t=r(e);return i==OB.Space&&(i=t),i==t}}))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return Or.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,r){let i=Pi(e,t.head,t.assoc||-1),o=r&&i.type==Rk.Text&&(e.lineWrapping||i.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head):null;if(o){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),a=e.posAtCoords({x:n==(r==R1.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(null!=a)return Or.cursor(a,n?-1:1)}return Or.cursor(n?i.to:i.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return Pl(this,e,function(e,t,n,r){let i=t.head,o=n?1:-1;if(i==(n?e.state.doc.length:0))return Or.cursor(i,t.assoc);let a=t.goalColumn,s,l=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(i,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(i);null==a&&(a=Math.min(l.right-l.left,e.defaultCharacterWidth*(i-t.from))),s=(o<0?t.top:t.bottom)+c}let d=l.left+a,h=e.viewState.heightOracle.textHeight>>1,p=null!=r?r:h;for(let t=0;;t+=h){let r=s+(p+t)*o,i=Pc(e,{x:d,y:r},!1,o);if(n?r>l.bottom:r<l.top)return Or.cursor(i.pos,i.assoc);let u=e.coordsAtPos(i.pos,i.assoc),c=u?(u.top+u.bottom)/2:0;if(!u||(n?c>s:c<s))return Or.cursor(i.pos,i.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=Pc(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Pc(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 r=this.state.doc.lineAt(e),i=this.bidiSpans(r);return R$(n,i[Et.find(i,e-r.from,-1,t)].dir==R1.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(Ef)||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>Lb)return Er(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||function e(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++){let i=t[r],o=n[r];if(i.from!=o.from||i.to!=o.to||i.direction!=o.direction||!e(i.inner,o.inner))return!1}return!0}(r.isolates,n=EE(this,e))))return r.order;n||(n=EE(this,e));let r=function(e,t,n){if(!e)return[new Et(0,0,+(t==R5))];if(t==R2&&!n.length&&!Ee.test(e))return Er(e.length);if(n.length)for(;e.length>En.length;)En[En.length]=256;let r=[],i=+(t!=R2);return function e(t,n,r,i,o,a,s){let l=n%2?2:1;!function(e,t,n,r,i){for(let o=0;o<=r.length;o++){let a=o?r[o-1].to:t,s=o<r.length?r[o].from:n,l=o?256:i;for(let t=a,n=l,r=l;t<s;t++){let i=R7(e.charCodeAt(t));512==i?i=n:8==i&&4==r&&(i=16),En[t]=4==i?2:i,7&i&&(r=i),n=i}for(let e=a,t=l,r=l;e<s;e++){let i=En[e];if(128==i)e<s-1&&t==En[e+1]&&24&t?i=En[e]=t:En[e]=256;else if(64==i){let i=e+1;for(;i<s&&64==En[i];)i++;let o=e&&8==t||i<n&&8==En[i]?1==r?1:8:256;for(let t=e;t<i;t++)En[t]=o;e=i-1}else 8==i&&1==r&&(En[e]=1);t=i,7&i&&(r=i)}}}(t,o,a,i,l),function(e,t,n,r,i){let o=1==i?2:1;for(let a=0,s=0,l=0;a<=r.length;a++){let u=a?r[a-1].to:t,c=a<r.length?r[a].from:n;for(let t=u,n,r,a;t<c;t++)if(r=R8[n=e.charCodeAt(t)])if(r<0){for(let e=s-3;e>=0;e-=3)if(R9[e+1]==-r){let n=R9[e+2],r=2&n?i:4&n?1&n?o:i:0;r&&(En[t]=En[R9[e]]=r),s=e;break}}else if(189==R9.length)break;else R9[s++]=t,R9[s++]=n,R9[s++]=l;else if(2==(a=En[t])||1==a){let e=a==i;l=+!e;for(let t=s-3;t>=0;t-=3){let n=R9[t+2];if(2&n)break;if(e)R9[t+2]|=2;else{if(4&n)break;R9[t+2]|=4}}}}}(t,o,a,i,l),function(e,t,n,r){for(let i=0,o=r;i<=n.length;i++){let a=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let l=a;l<s;){let a=En[l];if(256==a){let a=l+1;for(;;)if(a==s){if(i==n.length)break;a=n[i++].to,s=i<n.length?n[i].from:t}else if(256==En[a])a++;else break;let u=1==o,c=u==((a<t?En[a]:r)==1)?u?1:2:r;for(let t=a,r=i,o=r?n[r-1].to:e;t>l;)t==o&&(t=n[--r].from,o=r?n[r-1].to:e),En[--t]=c;l=a}else o=a,l++}}}(o,a,i,l),function t(n,r,i,o,a,s,l){let u=o%2?2:1;if(o%2==a%2)for(let c=r,d=0;c<i;){let r=!0,h=!1;if(d==s.length||c<s[d].from){let e=En[c];e!=u&&(r=!1,h=16==e)}let p=r||1!=u?null:[],f=r?o:o+1,g=c;o:for(;;)if(d<s.length&&g==s[d].from){if(h)break;let t=s[d];if(!r)for(let e=t.to,n=d+1;;){if(e==i)break o;if(n<s.length&&s[n].from==e)e=s[n++].to;else if(En[e]==u)break o;else break}d++,p?p.push(t):(t.from>c&&l.push(new Et(c,t.from,f)),e(n,t.direction==R2!=!(f%2)?o+1:o,a,t.inner,t.from,t.to,l),c=t.to),g=t.to}else if(g==i||(r?En[g]!=u:En[g]==u))break;else g++;p?t(n,c,g,o+1,a,p,l):c<g&&l.push(new Et(c,g,f)),c=g}else for(let c=i,d=s.length;c>r;){let i=!0,h=!1;if(!d||c>s[d-1].to){let e=En[c-1];e!=u&&(i=!1,h=16==e)}let p=i||1!=u?null:[],f=i?o:o+1,g=c;o:for(;;)if(d&&g==s[d-1].to){if(h)break;let t=s[--d];if(!i)for(let e=t.from,n=d;;){if(e==r)break o;if(n&&s[n-1].to==e)e=s[--n].from;else if(En[e-1]==u)break o;else break}p?p.push(t):(t.to<c&&l.push(new Et(t.to,c,f)),e(n,t.direction==R2!=!(f%2)?o+1:o,a,t.inner,t.from,t.to,l),c=t.from),g=t.from}else if(g==r||(i?En[g-1]!=u:En[g-1]==u))break;else g--;p?t(n,g,c,o+1,a,p,l):g<c&&l.push(new Et(g,c,f)),c=g}}(t,o,a,n,r,i,s)}(e,i,i,n,0,e.length,r),r}(e.text,t,n);return this.bidiCache.push(new LS(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Rb.safari&&(null==(e=this.inputState)?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{RY(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,r,i,o;return Ey.of(new Ev("number"==typeof e?Or.cursor(e):e,null!=(n=t.y)?n:"nearest",null!=(r=t.x)?r:"nearest",null!=(i=t.yMargin)?i:5,null!=(o=t.xMargin)?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Ey.of(new Ev(Or.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 EC.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return EC.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=O7.newName(),r=[Lo.of(n),EN.of(Ld(`.${n}`,e))];return t&&t.dark&&r.push(La.of(!0)),r}static baseTheme(e){return Of.lowest(EN.of(Ld("."+Ls,e,Lc)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&Ej.get(n)||Ej.get(e);return(null==(t=null==r?void 0:r.root)?void 0:t.view)||null}}Lx.styleModule=EN,Lx.inputHandler=Ec,Lx.clipboardInputFilter=Eh,Lx.clipboardOutputFilter=Ep,Lx.scrollHandler=Em,Lx.focusChangeEffect=Ed,Lx.perLineTextDirection=Ef,Lx.exceptionSink=El,Lx.updateListener=Eu,Lx.editable=Ew,Lx.mouseSelectionStyle=Es,Lx.dragMovesSelection=Ea,Lx.clickAddsSelectionRange=Eo,Lx.decorations=E_,Lx.blockWrappers=EI,Lx.outerDecorations=ED,Lx.atomicRanges=EO,Lx.bidiIsolatedRanges=ER,Lx.cursorScrollMargin=Oa.define({combine:e=>{let t=5,n=5;for(let r of e)"number"==typeof r?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}}),Lx.scrollMargins=EP,Lx.darkTheme=La,Lx.cspNonce=Oa.define({combine:e=>e.length?e[0]:""}),Lx.contentAttributes=ET,Lx.editorAttributes=Ek,Lx.lineWrapping=Lx.contentAttributes.of({class:"cm-lineWrapping"}),Lx.announce=OO.define();let Lb=4096,Lw={};class LS{constructor(e,t,n,r,i,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=o}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:R1.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let o=e[i];o.dir!=r||t.touchesRange(o.from,o.to)||n.push(new LS(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function LA(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],o="function"==typeof t?t(e):t;o&&Rw(o,n)}return n}let LC=Rb.mac?"mac":Rb.windows?"win":Rb.linux?"linux":"key";function LM(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 Lk=Of.default(Lx.domEventHandlers({keydown:(e,t)=>LR(LI(t.state),e,t,"editor")})),LT=Oa.define({enables:Lk}),L_=new WeakMap;function LI(e){let t=e.facet(LT),n=L_.get(t);return n||L_.set(t,n=function(e,t=LC){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(null==n)r[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,r,o,a,s)=>{var l,u;let c=n[e]||(n[e]=Object.create(null)),d=r.split(/ (?!$)/).map(e=>(function(e,t){let n,r,i,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))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else if(/^mod$/i.test(s))"mac"==t?o=!0:r=!0;else throw Error("Unrecognized modifier name: "+s)}return n&&(s="Alt-"+s),r&&(s="Ctrl-"+s),o&&(s="Meta-"+s),i&&(s="Shift-"+s),s})(e,t));for(let t=1;t<d.length;t++){let n=d.slice(0,t).join(" ");i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=LD={view:t,prefix:n,scope:e};return setTimeout(()=>{LD==r&&(LD=null)},4e3),!0}]})}let h=d.join(" ");i(h,!1);let p=c[h]||(c[h]={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 r of e){let e=r.scope?r.scope.split(" "):["editor"];if(r.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:i}=r;for(let t in e)e[t].run.push(e=>i(e,LO))}let i=r[t]||r.key;if(i)for(let t of e)o(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&o(t,"Shift-"+i,r.shift,r.preventDefault,r.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[]))),n}let LD=null,LO=null;function LR(e,t,n,r){var i;LO=t;let o=("Esc"==(i=!(Ri&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Ro&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?Rr:Rn)[t.keyCode]||t.key||"Unidentified")&&(i="Escape"),"Del"==i&&(i="Delete"),"Left"==i&&(i="ArrowLeft"),"Up"==i&&(i="ArrowUp"),"Right"==i&&(i="ArrowRight"),"Down"==i&&(i="ArrowDown"),i),a=D1(DJ(o,0))==o.length&&" "!=o,s="",l=!1,u=!1,c=!1;LD&&LD.view==n&&LD.scope==r&&(s=LD.prefix+" ",0>PA.indexOf(t.keyCode)&&(u=!0,LD=null));let d=new Set,h=e=>{if(e){for(let t of e.run)if(!d.has(t)&&(d.add(t),t(n)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),u=!0)}return!1},p=e[r],f,g;return p&&(h(p[s+LM(o,t,!a)])?l=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Rb.windows&&t.ctrlKey&&t.altKey)&&!(Rb.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(f=Rn[t.keyCode])&&f!=o?h(p[s+LM(f,t,!0)])?l=!0:t.shiftKey&&(g=Rr[t.keyCode])!=o&&g!=f&&h(p[s+LM(g,t,!1)])&&(l=!0):a&&t.shiftKey&&h(p[s+LM(o,t,!0)])&&(l=!0),!l&&h(p._any)&&(l=!0)),u&&(l=!0),l&&c&&t.stopPropagation(),LO=null,l}class LE{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}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 r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==R1.LTR,a=e.contentDOM,s=a.getBoundingClientRect(),l=LP(e),u=a.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),d=s.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),h=s.right-(c?parseInt(c.paddingRight):0),p=Pi(e,r,1),f=Pi(e,i,-1),g=p.type==Rk.Text?p:null,m=f.type==Rk.Text?f:null;if(g&&(e.lineWrapping||p.widgetLineBreaks)&&(g=LL(e,r,1,g)),m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=LL(e,i,-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),r=m?x(null,n.to,m):b(f,!0),i=[];return(g||p).to<(m||f).from-(g&&m?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(v(d,t.bottom,h,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==Rk.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),y(t).concat(i).concat(y(r))}function v(e,n,r,i){return new LE(t,e-l.left,n-l.top,Math.max(0,r-e),i-n)}function y({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(v(n[i],e,n[i+1],t));return r}function x(t,n,r){let i=1e9,a=-1e9,s=[];function l(t,n,l,u,c){let p=e.coordsAtPos(t,t==r.to?-2:2),f=e.coordsAtPos(l,l==r.from?2:-2);p&&f&&(i=Math.min(p.top,f.top,i),a=Math.max(p.bottom,f.bottom,a),c==R1.LTR?s.push(o&&n?d:p.left,o&&u?h:f.right):s.push(!o&&u?d:f.left,!o&&n?h:p.right))}let u=null!=t?t:r.from,c=null!=n?n:r.to;for(let r of e.visibleRanges)if(r.to>u&&r.from<c)for(let i=Math.max(r.from,u),o=Math.min(r.to,c);;){let r=e.state.doc.lineAt(i);for(let a of e.bidiSpans(r)){let e=a.from+r.from,s=a.to+r.from;if(e>=o)break;s>i&&l(Math.max(e,i),null==t&&e<=u,Math.min(s,o),null==n&&s>=c,a.dir)}if((i=r.to+1)>=o)break}return 0==s.length&&l(u,null==t,c,null==n,e.textDirection),{top:i,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 r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let i=LP(e);return[new LE(t,r.left-i.left,r.top-i.top,null,r.bottom-r.top)]}}}function LP(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==R1.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function LL(e,t,n,r){let i=e.coordsAtPos(t,2*n);if(!i)return r;let o=e.dom.getBoundingClientRect(),a=(i.top+i.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?r:{from:Math.max(r.from,Math.min(s,l)),to:Math.min(r.to,Math.max(s,l))}}class LN{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(LB)!=e.state.facet(LB)&&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(LB);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 r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,Rb.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}let LB=Oa.define();function Lz(e){return[EC.define(t=>new LN(t,e)),LB.of(e)]}let LF=Oa.define({combine:e=>Oj(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function Lj(e){return e.startState.facet(LF)!=e.state.facet(LF)}let LV=Lz({above:!0,markers(e){let{state:t}=e,n=t.facet(LF),r=[];for(let i of t.selection.ranges){let o=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(o&&Rb.ios&&n.iosSelectionHandles)){let t=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=i.empty?i:Or.cursor(i.head,i.assoc);for(let i of LE.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=Lj(e);return n&&LH(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){LH(t.state,e)},class:"cm-cursorLayer"});function LH(e,t){t.style.animationDuration=e.facet(LF).cursorBlinkRate+"ms"}let L$=Lz({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let n of r)if(!n.empty)for(let r of LE.forRange(e,"cm-selectionBackground",n))t.push(r);if(Rb.ios&&!n.empty&&e.state.facet(LF).iosSelectionHandles){for(let r of LE.forRange(e,"cm-selectionHandle cm-selectionHandle-start",Or.cursor(n.from,1)))t.push(r);for(let r of LE.forRange(e,"cm-selectionHandle cm-selectionHandle-end",Or.cursor(n.to,1)))t.push(r)}return t},update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||Lj(e),class:"cm-selectionLayer"}),LW=Of.highest(Lx.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"}}}})),LG=OO.define({map:(e,t)=>null==e?null:t.mapPos(e)}),LU=Oh.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(LG)?t.value:e,e))}),Lq=EC.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(LU);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(LU)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(LU),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.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(LU)!=e&&this.view.dispatch({effects:LG.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 LY(e,t,n,r,i){t.lastIndex=0;for(let o=e.iterRange(n,r),a=n,s;!o.next().done;a+=o.value.length)if(!o.lineBreak)for(;s=t.exec(o.value);)i(a+s.index,s)}class LX{constructor(e){const{regexp:t,decoration:n,decorate:r,boundary:i,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,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,r,i)=>{let o=n(e,t,r);o&&i(r,r+e[0].length,o)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=o}createDeco(e){let t=new Oq,n=t.add.bind(t);for(let{from:t,to:r}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 r=[];for(let{from:i,to:o}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}(e,this.maxLength))LY(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return(e.docChanged&&e.changes.iterChanges((t,i,o,a)=>{a>=e.view.viewport.from&&o<=e.view.viewport.to&&(n=Math.min(o,n),r=Math.max(a,r))}),e.viewportMoved||r-n>1e3)?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let o=Math.max(i.from,n),a=Math.min(i.to,r);if(a>=o){let n=e.state.doc.lineAt(o),r=n.to<a?e.state.doc.lineAt(a):n,s=Math.max(i.from,n.from),l=Math.min(i.to,r.to);if(this.boundary){for(;o>n.from;o--)if(this.boundary.test(n.text[o-1-n.from])){s=o;break}for(;a<r.to;a++)if(this.boundary.test(r.text[a-r.from])){l=a;break}}let u=[],c,d=(e,t,n)=>u.push(n.range(e,t));if(n==r)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,d);else LY(e.state.doc,this.regexp,s,l,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:s,filterTo:l,filter:(e,t)=>e<s||t>l,add:u})}}return t}}let LZ=null!=/x/.unicode?"gu":"g",LK=RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]",LZ),LQ={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"},LJ=null,L0=Oa.define({combine(e){let t=Oj(e,{render:null,specialChars:LK,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==LJ&&"u">typeof document&&document.body){let t=document.body.style;LJ=(null!=(e=t.tabSize)?e:t.MozTabSize)!=null}return LJ||!1}())&&(t.specialChars=RegExp(" |"+t.specialChars.source,LZ)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,LZ)),t}}),L1=null;class L2 extends RM{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),r=e.state.phrase("Control character")+" "+(LQ[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class L5 extends RM{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 L4=RT.line({class:"cm-activeLine"}),L3=EC.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 r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(L4.range(i.from)),t=i.from)}return RT.set(n)}},{decorations:e=>e.decorations});class L6 extends RM{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?RB(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=R$(t[0],"rtl"!=n.direction),i=parseInt(n.lineHeight);return r.bottom-r.top>1.5*i?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}}function L8(e,t){var n;let r,i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(i),a=i-o.from,s=a>2e3?-1:a==o.length?(n=t.clientX,(r=e.coordsAtPos(e.viewport.from))?Math.round(Math.abs((r.left-n)/e.defaultCharacterWidth)):-1):O4(o.text,e.state.tabSize,i-o.from);return{line:o.number,col:s,off:a}}let L9={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},L7={style:"cursor: crosshair"},Ne="-10000px";class Nt{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===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<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)o[n]=this.createTooltipView(r,n?o[n-1]:null),a&&(a[n]=!!r.above);else{let r=o[n]=this.tooltipViews[s];a&&(a[n]=t[s]),r.update&&r.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=r,this.tooltips=i,this.tooltipViews=o,!0}}function Nn(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}let Nr=Oa.define({combine:e=>{var t,n,r;return{position:Rb.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==(r=e.find(e=>e.tooltipSpace))?void 0:r.tooltipSpace)||Nn}}}),Ni=new WeakMap,No=EC.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(Nr);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 Nt(e,Nu,(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,r=e.state.facet(Nr);if(r.position!=this.position&&!this.madeAbsolute){for(let e of(this.position=r.position,this.manager.tooltipViews))e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){for(let e of(this.parent&&this.container.remove(),this.parent=r.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),r=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=Ne,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),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(Rb.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 r=this.view.scrollDOM.getBoundingClientRect(),i=EL(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.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(Nr).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:r,scaleX:i,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,d=e.pos[s],h=e.size[s];if(!d||!1!==l.clip&&(d.bottom<=Math.max(n.top,r.top)||d.top>=Math.min(n.bottom,r.bottom)||d.right<Math.max(n.left,r.left)-.1||d.left>Math.min(n.right,r.right)+.1)){c.style.top=Ne;continue}let p=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,f=7*!!p,g=h.right-h.left,m=null!=(t=Ni.get(u))?t:h.bottom-h.top,v=u.offset||Nl,y=this.view.textDirection==R1.LTR,x=h.width>r.right-r.left?y?r.left:r.right-h.width:y?Math.max(r.left,Math.min(d.left-14*!!p+v.x,r.right-g)):Math.min(Math.max(r.left,d.left-g+14*!!p-v.x),r.right-g),b=this.above[s];!l.strictSide&&(b?d.top-m-f-v.y<r.top:d.bottom+m+f+v.y>r.bottom)&&b==r.bottom-d.bottom>d.top-r.top&&(b=this.above[s]=!b);let w=(b?d.top-r.top:r.bottom-d.bottom)-f;if(w<m&&!1!==u.resize){if(w<this.view.defaultLineHeight){c.style.top=Ne;continue}Ni.set(u,m),c.style.height=(m=w)/o+"px"}else c.style.height&&(c.style.height="");let S=b?d.top-m-f-v.y:d.bottom+f+v.y,A=x+g;if(!0!==u.overlap)for(let e of a)e.left<A&&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",Na(c,(x-e.parent.left)/i)):(c.style.top=S/o+"px",Na(c,x/i)),p){let e=d.left+(y?v.x:-v.x)-(x+14-7);p.style.left=e/i+"px"}!0!==u.overlap&&a.push({left:x,top:S,right:A,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=Ne}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Na(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}let Ns=Lx.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"}}}),Nl={x:0,y:0},Nu=Oa.define({enables:[No,Ns]}),Nc=Oa.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class Nd{static create(e){return new Nd(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Nt(e,Nc,(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 r=n[e];if(void 0!==r){if(void 0===t)t=r;else if(t!==r)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 Nh=Nu.compute([Nc],e=>{let t=e.facet(Nc);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:Nd.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),Np=Oa.define();class Nf{constructor(e,t,n,r,i,o){this.view=e,this.source=t,this.field=n,this.locked=r,this.setHover=i,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 r,i=1;if(n.isWidget())r=n.posAtStart;else{if(null==(r=e.posAtCoords(t)))return;let n=e.coordsAtPos(r);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(r)).find(e=>e.from<=r&&e.to>=r),a=o&&o.dir==R1.RTL?-1:1;i=t.x<n.left?-a:a}this.activateHover(e,r,i)}activateHover(e,t,n,r){let i=this.source(e,t,n),o=t=>{if(t&&!(Array.isArray(t)&&!t.length)){let n=Array.isArray(t)?t:[t];r&&this.locked.set(n,r),e.dispatch({effects:this.setHover.of(n)})}};if(i&&"then"in i){let n=this.pending={pos:t};i.then(e=>{this.pending==n&&(this.pending=null,o(e))},t=>Eb(e.state,t,"hover tooltip"))}else o(i)}get tooltip(){let e=this.view.plugin(No),t=e?e.manager.tooltips.findIndex(e=>e.create==Nd.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:r,tooltip:i}=this;if(r.length&&!this.locked.has(r)&&i&&!function(e,t){let{left:n,right:r,top:i,bottom:o}=e.getBoundingClientRect(),a;if(a=e.querySelector(".cm-tooltip-arrow")){let e=a.getBoundingClientRect();i=Math.min(e.top,i),o=Math.max(e.bottom,o)}return t.clientX>=n-4&&t.clientX<=r+4&&t.clientY>=i-4&&t.clientY<=o+4}(i.dom,e)||this.pending){let{pos:i}=r[0]||this.pending,o=null!=(n=null==(t=r[0])?void 0:t.end)?n:i;(i==o?this.view.posAtCoords(this.lastMove)!=i:!function(e,t,n,r,i){let o=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,a)<i)return!1;let s=e.posAtCoords({x:r,y:i},!1);return s>=t&&s<=n}(this.view,i,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:r}=this;!r.length||this.locked.has(r)||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 Ng(e,t){let n=e.plugin(No);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}let Nm=OO.define(),Nv=Oa.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function Ny(e,t){let n=e.plugin(Nx),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}let Nx=EC.fromClass(class{constructor(e){this.input=e.state.facet(NS),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(Nv);for(let n of(this.top=new Nb(e,!0,t.topContainer),this.bottom=new Nb(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(Nv);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Nb(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Nb(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(NS);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],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),r.push(s),(s.top?i:o).push(s)}for(let e of(this.specs=t,this.panels=r,this.top.sync(i),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=>Lx.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Nb{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=Nw(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Nw(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 Nw(e){let t=e.nextSibling;return e.remove(),t}let NS=Oa.define({enables:Nx}),NA=Oh.define({create:()=>[],update(e,t){for(let n of t.effects)n.is(NC)?e=[n.value].concat(e):n.is(NM)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>NS.computeN([e],t=>t.field(e))}),NC=OO.define(),NM=OO.define();class Nk extends OV{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Nk.prototype.elementClass="",Nk.prototype.toDOM=void 0,Nk.prototype.mapMode=D5.TrackBefore,Nk.prototype.startSide=Nk.prototype.endSide=-1,Nk.prototype.point=!0;let NT=Oa.define(),N_=Oa.define(),NI={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>OU.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},ND=Oa.define();function NO(e){return[NE(),ND.of({...NI,...e})]}let NR=Oa.define({combine:e=>e.some(e=>e)});function NE(e){let t=[NP];return e&&!1===e.fixed&&t.push(NR.of(!0)),t}let NP=EC.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(ND).map(t=>new Nz(e,t)),this.fixed=!e.state.facet(NR),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,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(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(NR)!=!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=OU.iter(this.view.state.facet(NT),this.view.viewport.from),r=[],i=this.gutters.map(e=>new NB(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let o of e.type)if(o.type==Rk.Text&&t){for(let e of(NN(n,r,o.from),i))e.line(this.view,o,r);t=!1}else if(o.widget)for(let e of i)e.widget(this.view,o)}else if(e.type==Rk.Text)for(let t of(NN(n,r,e.from),i))t.line(this.view,e,r);else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)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(ND),n=e.state.facet(ND),r=e.docChanged||e.heightChanged||e.viewportChanged||!OU.eq(e.startState.facet(NT),e.state.facet(NT),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new Nz(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),0>i.indexOf(e)&&e.destroy();for(let e of i)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Lx.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||0==n.gutters.length||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==R1.LTR?{left:r,right:i}:{right:r,left:i}})});function NL(e){return Array.isArray(e)?e:[e]}function NN(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class NB{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=OU.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let t=new NF(e,o,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,o,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];NN(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let o=this.gutter;(0!=r.length||o.config.renderEmptyElements)&&this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(N_)){let i=n(e,t.widget,t);i&&(r||(r=[])).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Nz{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,r=>{let i=r.target,o;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();o=(e.top+e.bottom)/2}else o=r.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,a,r)&&r.preventDefault()});this.markers=NL(t.markers(e)),t.initialSpacer&&(this.spacer=new NF(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=NL(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!OU.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 NF{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){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,r)&&this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let i=0,o=0;;){let a=o,s=i<t.length?t[i++]: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(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(l?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),l&&o++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}let Nj=Oa.define(),NV=Oa.define(),NH=Oa.define({combine:e=>Oj(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})});class N$ extends Nk{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function NW(e,t){return e.state.facet(NH).formatNumber(t,e.state)}let NG=ND.compute([NH],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(Nj),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new N$(NW(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let r of e.state.facet(NV)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(NH)!=e.state.facet(NH),initialSpacer:e=>new N$(NW(e,NU(e.state.doc.lines))),updateSpacer(e,t){let n=NW(t.view,NU(t.view.state.doc.lines));return n==e.number?e:new N$(n)},domEventHandlers:e.facet(NH).domEventHandlers,side:"before"}));function NU(e){let t=9;for(;t<e;)t=10*t+9;return t}let Nq=new class extends Nk{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},NY=NT.compute(["selection"],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(Nq.range(i)))}return OU.of(t)}),NX=new Iw,NZ=new Iw;class NK{constructor(e,t,n=[],r=""){this.data=e,this.name=r,OF.prototype.hasOwnProperty("tree")||Object.defineProperty(OF.prototype,"tree",{get(){return N0(this)}}),this.parser=t,this.extension=[N7.of(this),OF.languageData.of((e,t,n)=>{let r=NQ(e,t,n),i=r.type.prop(NX);if(!i)return[];let o=e.facet(i),a=r.type.prop(NZ);if(a){let i=r.resolve(t-r.from,n);for(let t of a)if(t.test(i,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 NQ(e,t,n).type.prop(NX)==this.data}findRegions(e){let t=e.facet(N7);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(NX)==this.data)return void n.push({from:t,to:t+e.length});let i=e.prop(Iw.mounted);if(i){if(i.tree.prop(NX)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof I_&&r(i,e.positions[n]+t)}};return r(N0(e),0),n}get allowsNesting(){return!0}}function NQ(e,t,n){let r=e.facet(N7),i=N0(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,k.ExcludeBuffers|k.EnterBracketed))e.type.isTop&&(i=e);return i}NK.setState=OO.define();class NJ extends NK{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){var t;let n=(t=e.languageData,Oa.define({combine:t?e=>e.concat(t):void 0}));return new NJ(n,e.parser.configure({props:[NX.add(e=>e.isTop?n:void 0)]}),e.name)}configure(e,t){return new NJ(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function N0(e){let t=e.field(NK.state,!1);return t?t.tree:I_.empty}class N1{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 N2=null;class N5{constructor(e,t,n=[],r,i,o,a,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=o,this.skipped=a,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new N5(e,t,[],I_.empty,0,n,[],null)}startParse(){return this.parser.startParse(new N1(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=I_.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 r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(IU.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!=(n=this.parse.stoppedAt)?n:this.state.doc.length,this.tree=r,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(IU.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=N2;N2=this;try{return e()}finally{N2=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=N4(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:i,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,r,i)=>t.push({fromA:e,toA:n,fromB:r,toB:i})),n=IU.applyChanges(n,t),r=I_.empty,i=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),r=e.mapPos(t.to,-1);n<r&&a.push({from:n,to:r})}}return new N5(this.parser,t,n,r,i,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:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=N4(this.fragments,n,r),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 Iq{createParse(t,n,r){let i=r[0].from,o=r[r.length-1].to;return{parsedPos:i,advance(){let t=N2;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new I_(IC.none,[],[],o-i)},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 N2}}function N4(e,t,n){return IU.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class N3{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 N3(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=N5.create(e.facet(N7).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new N3(n)}}NK.state=Oh.define({create:N3.init,update(e,t){for(let e of t.effects)if(e.is(NK.setState))return e.value;return t.startState.facet(N7)!=t.state.facet(N7)?N3.init(t.state):e.apply(t)}});let N6=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"u">typeof requestIdleCallback&&(N6=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let N8="u">typeof navigator&&(null==(T=navigator.scheduling)?void 0:T.isInputPending)?()=>navigator.scheduling.isInputPending():null,N9=EC.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(NK.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(NK.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=N6(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:r}}=this.view,i=n.field(NK.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!N8?Math.max(25,e.timeRemaining()-5):1e9),a=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>N8&&N8()||Date.now()>o,r+1e5*!a);this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:NK.setState.of(new N3(i.context))})),this.chunkBudget>0&&!(s&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>Eb(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()}}}),N7=Oa.define({combine:e=>e.length?e[0]:null,enables:e=>[NK.state,N9,Lx.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class Be{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}let Bt=Oa.define(),Bn=Oa.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 Br(e){let t=e.facet(Bn);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function Bi(e,t){let n="",r=e.tabSize,i=e.facet(Bn)[0];if(" "==i){for(;t>=r;)n+=" ",t-=r;i=" "}for(let e=0;e<t;e++)n+=i;return n}function Bo(e,t){for(let n of(e instanceof OF&&(e=new Ba(e)),e.state.facet(Bt))){let r=n(e,t);if(void 0!==r)return r}let n=N0(e.state);return n.length>=t?function(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return Bl(r,e,n)}(e,n,t):null}class Ba{constructor(e,t={}){this.state=e,this.options=t,this.unit=Br(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;if(null!=r&&r>=n.from&&r<=n.to)if(i&&r==e)return{text:"",from:e};else if(t<0?r<e:r<=e)return{text:n.text.slice(r-n.from),from:r};else return{text:n.text.slice(0,r-n.from),from:n.from};return n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(i+=o-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return O4(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let Bs=new Iw;function Bl(e,t,n){for(let r=e;r;r=r.next){let e=function(e){let t=e.type.prop(Bs);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(Iw.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>(function(e,t,n,r){let i=e.textAfter,o=i.match(/^\s*/)[0].length,a=n&&i.slice(o,o+n.length)==n||r==e.pos+o,s=t?function(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),a=null==i||i<=o.from?o.to:Math.min(o.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.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=i.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?Bu:null}(r.node);if(e)return e(Bc.create(t,n,r))}return 0}function Bu(){return 0}class Bc extends Ba{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 Bc(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 Bl(this.context.next,this.base,this.pos)}}function Bd({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}let Bh=Oa.define(),Bp=new Iw;function Bf(e,t,n){for(let r of e.facet(Bh)){let i=r(e,t,n);if(i)return i}return function(e,t,n){let r=N0(e);if(r.length<n)return null;let i=r.resolveStack(n,1),o=null;for(let a=i;a;a=a.next){let i=a.node;if(i.to<=n||i.from>n)continue;if(o&&i.from<t)break;let s=i.type.prop(Bp);if(s&&(i.to<r.length-50||r.length==e.doc.length||!function(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(o=r)}}return o}(e,t,n)}function Bg(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}let Bm=OO.define({map:Bg}),Bv=OO.define({map:Bg});function By(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 Bx=Oh.define({create:()=>RT.none,update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,n)=>e=Bb(e,t,n)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is(Bm)&&!function(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}(e,r.value.from,r.value.to)?n.push(r.value):r.is(Bv)&&(e=e.update({filter:(e,t)=>r.value.from!=e||r.value.to!=t,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:r}=t.state.facet(Bk),i=n.map(e=>(r?RT.replace({widget:new BD(r(t.state,e))}):BI).range(e.from,e.to));e=e.update({add:i})}return t.selection&&(e=Bb(e,t.selection.main.head)),e},provide:e=>Lx.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 r=e[n++],i=e[n++];if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid JSON for fold state");t.push(BI.range(r,i))}return RT.set(t,!0)}});function Bb(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function Bw(e,t,n){var r;let i=null;return null==(r=e.field(Bx,!1))||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function BS(e,t){return e.field(Bx,!1)?t:t.concat(OO.appendConfig.of(BT()))}function BA(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return Lx.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}let BC=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of By(e)){let n=Bf(e.state,t.from,t.to);if(n)return e.dispatch({effects:BS(e.state,[Bm.of(n),BA(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(Bx,!1))return!1;let t=[];for(let n of By(e)){let r=Bw(e.state,n.from,n.to);r&&t.push(Bv.of(r),BA(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),o=Bf(t,i.from,i.to);o&&n.push(Bm.of(o)),r=(o?e.lineBlockAt(o.to):i).to+1}return n.length&&e.dispatch({effects:BS(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(Bx,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(Bv.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],BM={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Bk=Oa.define({combine:e=>Oj(e,BM)});function BT(e){let t=[Bx,BE];return e&&t.push(Bk.of(e)),t}function B_(e,t){let{state:n}=e,r=n.facet(Bk),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=Bw(e.state,n.from,n.to);r&&e.dispatch({effects:Bv.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}let BI=RT.replace({widget:new class extends RM{toDOM(e){return B_(e,null)}}});class BD extends RM{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return B_(e,this.value)}}let BO={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class BR extends Nk{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 BE=Lx.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 BP{constructor(e,t){let n;function r(e){let t=O7.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const i="string"==typeof t.all?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof NK?e=>e.prop(NX)==o.data:o?e=>e==o:void 0,this.style=Df(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new O7(n):null,this.themeType=t.themeType}static define(e,t){return new BP(e,t||{})}}let BL=Oa.define(),BN=Oa.define({combine:e=>e.length?[e[0]]:null});function BB(e){let t=e.facet(BL);return t.length?t:e.facet(BN)}function Bz(e,t){let n=[BF],r;return e instanceof BP&&(e.module&&n.push(Lx.styleModule.of(e.module)),r=e.themeType),(null==t?void 0:t.fallback)?n.push(BN.of(e)):r?n.push(BL.computeN([Lx.darkTheme],t=>t.facet(Lx.darkTheme)==("dark"==r)?[e]:[])):n.push(BL.of(e)),n}let BF=Of.high(EC.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=N0(e.state),this.decorations=this.buildDeco(e,BB(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=N0(e.state),n=BB(e.state),r=n!=BB(e.startState),{viewport:i}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&o>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return RT.none;let n=new Oq;for(let{from:r,to:i}of e.visibleRanges)!function(e,t,n,r=0,i=e.length){let o=new Dg(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=RT.mark({class:r})))},r,i);return n.finish()}},{decorations:e=>e.decorations})),Bj=BP.define([{tag:DO.meta,color:"#404740"},{tag:DO.link,textDecoration:"underline"},{tag:DO.heading,textDecoration:"underline",fontWeight:"bold"},{tag:DO.emphasis,fontStyle:"italic"},{tag:DO.strong,fontWeight:"bold"},{tag:DO.strikethrough,textDecoration:"line-through"},{tag:DO.keyword,color:"#708"},{tag:[DO.atom,DO.bool,DO.url,DO.contentSeparator,DO.labelName],color:"#219"},{tag:[DO.literal,DO.inserted],color:"#164"},{tag:[DO.string,DO.deleted],color:"#a11"},{tag:[DO.regexp,DO.escape,DO.special(DO.string)],color:"#e40"},{tag:DO.definition(DO.variableName),color:"#00f"},{tag:DO.local(DO.variableName),color:"#30a"},{tag:[DO.typeName,DO.namespace],color:"#085"},{tag:DO.className,color:"#167"},{tag:[DO.special(DO.variableName),DO.macroName],color:"#256"},{tag:DO.definition(DO.propertyName),color:"#00c"},{tag:DO.comment,color:"#940"},{tag:DO.invalid,color:"#f00"}]),BV=Lx.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),BH="()[]{}",B$=Oa.define({combine:e=>Oj(e,{afterCursor:!0,brackets:BH,maxScanDistance:1e4,renderMatch:BU})}),BW=RT.mark({class:"cm-matchingBracket"}),BG=RT.mark({class:"cm-nonmatchingBracket"});function BU(e){let t=[],n=e.matched?BW:BG;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 Bq(e){let t=[],n=e.facet(B$);for(let r of e.selection.ranges){if(!r.empty)continue;let i=BQ(e,r.head,-1,n)||r.head>0&&BQ(e,r.head-1,1,n)||n.afterCursor&&(BQ(e,r.head,1,n)||r.head<e.doc.length&&BQ(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return RT.set(t,!0)}let BY=[EC.fromClass(class{constructor(e){this.paused=!1,this.decorations=Bq(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=Bq(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),BV],BX=new Iw;function BZ(e,t,n){let r=e.prop(t<0?Iw.openedBy:Iw.closedBy);if(r)return r;if(1==e.name.length){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function BK(e){let t=e.type.prop(BX);return t?t(e.node):e}function BQ(e,t,n,r={}){let i=r.maxScanDistance||1e4,o=r.brackets||BH,a=N0(e),s=a.resolveInner(t,n);for(let e=s;e;e=e.parent){let r=BZ(e.type,n,o);if(r&&e.from<e.to){let i=BK(e);if(i&&(n>0?t>=i.from&&t<i.to:t>i.from&&t<=i.to))return function(e,t,n,r,i){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&&r.indexOf(l.type.name)>-1&&l.from<l.to){let e=BK(l);return{start:a,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(BZ(l.type,e,i))s++;else if(BZ(l.type,-e,i)){if(0==s){let e=BK(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,i,r,o)}}return function(e,t,n,r,i,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),d=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)&&r.resolveInner(s+e,1).type==i)if(t%2==0==n>0)d++;else{if(1==d)return{start:u,end:{from:s+e,to:s+e+1},matched:t>>1==l>>1};d--}}n>0&&(e+=o.length)}return c.done?{start:u,matched:!1}:null}(e,t,n,a,s.type,i,o)}let BJ=Object.create(null),B0=[IC.none],B1=[],B2=Object.create(null),B5=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"]])B5[e]=function(e,t){let n=[];for(let r of t.split(" ")){let t=[];for(let n of r.split(".")){let r=e[n]||DO[n];r?"function"==typeof r?t.length?t=t.map(r):B4(n,`Modifier ${n} used at start of tag`):t.length?B4(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:B4(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(e=>e.id),o=B2[i];if(o)return o.id;let a=B2[i]=IC.define({id:B0.length,name:r,props:[Dd({[r]:n})]});return B0.push(a),a.id}(BJ,t);function B4(e,t){B1.indexOf(e)>-1||(B1.push(e),console.warn(t))}R1.RTL,R1.LTR;let B3=NJ.define({name:"json",parser:DE.configure({props:[Bs.add({Object:Bd({except:/^\s*\}/}),Array:Bd({except:/^\s*\]/})}),Bp.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 B6{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class B8{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=n.facet(zc).markerFilter;r&&(e=r(e,n));let i=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new Oq,a=[],s=0,l=n.doc.iter(),u=0,c=n.doc.length;for(let e=0;;){let t,n,r=e==i.length?null:i[e];if(!r&&!a.length)break;if(a.length)t=s,n=a.reduce((e,t)=>Math.min(e,t.to),r&&r.from>t?r.from:1e8);else{if((t=r.from)>c)break;n=r.to,a.push(r),e++}for(;e<i.length;){let r=i[e];if(r.from==t&&(r.to>r.from||r.to==t))a.push(r),e++,n=Math.min(r.to,n);else{n=Math.min(r.from,n);break}}n=Math.min(n,c);let d=!1;if(a.some(e=>e.from==t&&(e.to==n||n==c))&&!(d=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){d=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let h=zb(a);if(d)o.add(t,t,RT.widget({widget:new zf(h),diagnostics:a.slice()}));else{let e=a.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");o.add(t,n,RT.mark({class:"cm-lintRange cm-lintRange-"+h+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 d=o.finish();return new B8(d,t,B9(d))}}function B9(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&0>i.diagnostics.indexOf(t)))if(r){if(0>i.diagnostics.indexOf(r.diagnostic))return!1;r=new B6(r.from,n,r.diagnostic)}else r=new B6(e,n,t||i.diagnostics[0])}),r}function B7(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(zc).hideOn(e,n,r);if(null!=i)return i;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(zt))||e.changes.touchesRange(o.from,Math.max(o.to,r)))}function ze(e,t){return e.field(zi,!1)?t:t.concat(OO.appendConfig.of(z_))}let zt=OO.define(),zn=OO.define(),zr=OO.define(),zi=Oh.define({create:()=>new B8(RT.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=B9(n,e.selected.diagnostic,i)||B9(n,null,i)}!n.size&&i&&t.state.facet(zc).autoPanel&&(i=null),e=new B8(n,i,r)}for(let n of t.effects)if(n.is(zt)){let r=t.state.facet(zc).autoPanel?n.value.length?zm.open:null:e.panel;e=B8.init(n.value,r,t.state)}else n.is(zn)?e=new B8(e.diagnostics,n.value?zm.open:null,e.selected):n.is(zr)&&(e=new B8(e.diagnostics,e.panel,n.value));return e},provide:e=>[NS.from(e,e=>e.panel),Lx.decorations.from(e,e=>e.diagnostics)]}),zo=RT.mark({class:"cm-lintRange cm-lintRange-active"});function za(e,t){return Rl("ul",{class:"cm-tooltip-lint"},t.map(t=>zp(e,t,!1)))}let zs=e=>{let t=e.state.field(zi,!1);return!!t&&!!t.panel&&(e.dispatch({effects:zn.of(!1)}),!0)},zl=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(zi,!1);t&&t.panel||e.dispatch({effects:ze(e.state,[zn.of(!0)])});let n=Ny(e,zm.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(zi,!1);if(!t)return!1;let n=e.state.selection.main,r=B9(t.diagnostics,null,n.to+1);return(!!r||!!(r=B9(t.diagnostics,null,0))&&(r.from!=n.from||r.to!=n.to))&&(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!function(e,t,n={}){var r;let i=e.state.facet(Np).map(t=>e.plugin(t)).filter(e=>!!e);if(n.tooltip&&n.tooltip.active){let e=i.find(e=>e.field==n.tooltip.active);e&&(i=[e])}for(let o of i)o.activateHover(e,t,1,null!=(r=n.until)?r:()=>!1)}(e,r.from,{tooltip:zT,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],zu=EC.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(zc);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(zc);t.length&&function(e,t,n){let r=[],i=-1;for(let o of e)o.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}(t.map(e=>Promise.resolve(e(this.view))),t=>{var n,r;this.view.state.doc==e.doc&&this.view.dispatch((n=this.view.state,r=t.reduce((e,t)=>e.concat(t)),{effects:ze(n,[zt.of(r)])}))},e=>{Eb(this.view.state,e)})}}update(e){let t=e.state.facet(zc);(e.docChanged||t!=e.startState.facet(zc)||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)}}),zc=Oa.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...Oj(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:zd,tooltipFilter:zd,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})})});function zd(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function zh(e){let t=[];if(e)a:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue a}}t.push("")}return t}function zp(e,t,n){var r;let i=n?zh(t.actions):[];return Rl("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Rl("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null==(r=t.actions)?void 0:r.map((n,r)=>{let o=!1,a=r=>{if(r.preventDefault(),o)return;o=!0;let i=B9(e.state.field(zi).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,l=i[r]?s.indexOf(i[r]):-1,u=l<0?s:[s.slice(0,l),Rl("u",s.slice(l,l+1)),s.slice(l+1)];return Rl("button",{type:"button",class:"cm-diagnosticAction"+(n.markClass?" "+n.markClass:""),onclick:a,onmousedown:a,"aria-label":` Action: ${s}${l<0?"":` (access key "${i[r]})"`}.`},u)}),t.source&&Rl("div",{class:"cm-diagnosticSource"},t.source))}class zf extends RM{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Rl("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class zg{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(0xffffffff*Math.random()).toString(16),this.dom=zp(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class zm{constructor(e){this.view=e,this.items=[];let t=t=>{if(!t.ctrlKey&&!t.altKey&&!t.metaKey){if(27==t.keyCode)zs(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],r=zh(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=B9(this.view.state.field(zi).diagnostics,n);t&&n.actions[i].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=Rl("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:n}),this.dom=Rl("div",{class:"cm-panel-lint"},this.list,Rl("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>zs(this.view)},"\xd7")),this.update()}get selectedIndex(){let e=this.view.state.field(zi).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(zi),n=0,r=!1,i=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 zg(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[a],a>n&&(this.items.splice(n,a-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute("aria-selected")||(s.dom.setAttribute("aria-selected","true"),i=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);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new zg(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.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"),r&&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=B9(this.view.state.field(zi).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:zr.of(t)})}static open(e){return new zm(e)}}function zv(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 zy(e){return zv(`<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 zx=Lx.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:zy("#f11")},".cm-lintRange-warning":{backgroundImage:zy("orange")},".cm-lintRange-info":{backgroundImage:zy("#999")},".cm-lintRange-hint":{backgroundImage:zy("#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 zb(e){let t="hint",n=1;for(let i of e){var r;let e="error"==(r=i.severity)?4:"warning"==r?3:"info"==r?2:1;e>n&&(n=e,t=i.severity)}return t}class zw extends Nk{constructor(e){super(),this.diagnostics=e,this.severity=zb(e)}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let n=this.diagnostics,r=e.state.facet(zI).tooltipFilter;return r&&(n=r(n,e.state)),n.length&&(t.onmouseover=()=>(function(e,t,n){function r(){let r,i=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(i.from)&&e.dispatch({effects:zC.of({pos:i.from,above:!1,clip:!1,create:()=>({dom:za(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,r=n=>{let i=t.getBoundingClientRect();if(!(n.clientX>i.left-10)||!(n.clientX<i.right+10)||!(n.clientY>i.top-10)||!(n.clientY<i.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",r),e.state.field(zM)&&e.dispatch({effects:zC.of(null)})}},window.addEventListener("mousemove",r)}let{hoverTime:i}=e.state.facet(zI),o=setTimeout(r,i);t.onmouseout=()=>{clearTimeout(o),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(o),o=setTimeout(r,i)}})(e,t,n)),t}}let zS=NO({class:"cm-gutter-lint",markers:e=>e.state.field(zA),widgetMarker:(e,t,n)=>{let r=[];return e.state.field(zA).between(n.from,n.to,(e,t,i)=>{e>n.from&&e<n.to&&r.push(...i.diagnostics)}),r.length?new zw(r):null}}),zA=Oh.define({create:()=>OU.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(zI).markerFilter;for(let r of t.effects)if(r.is(zt)){let i=r.value;n&&(i=n(i||[],t.state)),e=function(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let r=[];for(let e in n)r.push(new zw(n[e]).range(+e));return OU.of(r,!0)}(t.state.doc,i.slice(0))}return e}}),zC=OO.define(),zM=Oh.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=B7(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(zC)?t.value:e,e)),provide:e=>Nu.from(e)}),zk=Lx.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:zv('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:zv('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:zv('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),zT=function(e,t={}){let n=OO.define(),r=new WeakMap,i=Oh.define({create:()=>[],update(e,o){let a=r.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,D5.TrackDel);if(null!=e){let r=Object.assign(Object.create(null),n);r.pos=e,null!=r.end&&(r.end=o.changes.mapPos(r.end)),t.push(r)}}e=t}for(let t of o.effects)t.is(n)&&(e=t.value,a=void 0),(t.is(Nm)&&!t.value||t.value==i)&&(e=[]);return e.length&&a&&r.set(e,a),e},provide:e=>Nc.from(e)}),o=EC.define(o=>new Nf(o,e,i,r,n,t.hoverTime||300));return{active:i,extension:[i,o,Np.of(o),Nh]}}(function(e,t,n){let{diagnostics:r}=e.state.field(zi),i,o=-1,a=-1;r.between(t-(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,o=e,a=r,!1});let s=e.state.facet(zc).tooltipFilter;return(i&&s&&(i=s(i,e.state)),i)?{pos:o,end:a,above:!0,create:()=>({dom:za(e,i)})}:null},{hideOn:B7}),z_=[zi,Lx.decorations.compute([zi],e=>{let{selected:t,panel:n}=e.field(zi);return t&&n&&t.from!=t.to?RT.set([zo.range(t.from,t.to)]):RT.none}),zT,zx],zI=Oa.define({combine:e=>Oj(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});var zD=n(49257);function zO(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return!!i&&(r(n.update(i)),!0)}}let zR=zO(function(e,t,n=t.selection.ranges){let r=[],i=-1;s:for(let{from:e,to:o}of n){let n=r.length,a=1e9,s;for(let n=e;n<=o;){let l=t.doc.lineAt(n);if(void 0==s&&!(s=zL(t,l.from).line))continue s;if(l.from>i&&(e==o||o>l.from)){i=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),r.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<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=a);r.length==n+1&&(r[n].single=!0)}if(2!=e&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:o,single:a}of r)(a||!o)&&e.push({from:t.from+i,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,o=r+i.length;" "==t.text[o-t.from]&&o++,e.push({from:r,to:o})}return{changes:e}}return null},0),zE=zO(zN,0),zP=zO((e,t)=>zN(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}(t)),0);function zL(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}function zN(e,t,n=t.selection.ranges){let r=n.map(e=>zL(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>(function(e,{open:t,close:n},r,i){let o,a,s=e.sliceDoc(r-50,r),l=e.sliceDoc(i,i+50),u=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(l)[0].length,d=s.length-u;if(s.slice(d-t.length,d)==t&&l.slice(c,c+n.length)==n)return{open:{pos:r-u,margin:u&&1},close:{pos:i+c,margin:c&&1}};i-r<=100?o=a=e.sliceDoc(r,i):(o=e.sliceDoc(r,r+50),a=e.sliceDoc(i-50,i));let h=/^\s*/.exec(o)[0].length,p=/\s*$/.exec(a)[0].length,f=a.length-p-n.length;return o.slice(h,h+t.length)==t&&a.slice(f,f+n.length)==n?{open:{pos:r+h+t.length,margin:+!!/\s/.test(o.charAt(h+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(a.charAt(f-1))}}:null})(t,r[n],e.from,e.to));if(2!=e&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}]))};if(1!=e&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:o,close:a}=n;e.push({from:o.pos-i.open.length,to:o.pos+o.margin},{from:a.pos-a.margin,to:a.pos+i.close.length})}return{changes:e}}return null}let zB=O_.define(),zz=O_.define(),zF=Oa.define(),zj=Oa.define({combine:e=>Oj(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}),zV=Oh.define({create:()=>z0.empty,update(e,t){let n=t.state.facet(zj),r=t.annotation(zB);if(r){let i=zq.fromTransaction(t,r.selection),o=r.side,a=0==o?e.undone:e.done;return a=i?zY(a,a.length,n.minDepth,i):zK(a,t.startState.selection),new z0(0==o?r.rest:a,0==o?a:r.rest)}let i=t.annotation(zz);if(("full"==i||"before"==i)&&(e=e.isolate()),!1===t.annotation(OR.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=zq.fromTransaction(t),a=t.annotation(OR.time),s=t.annotation(OR.userEvent);return o?e=e.addChanges(o,a,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,s,n.newGroupDelay)),("full"==i||"after"==i)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new z0(e.done.map(zq.fromJSON),e.undone.map(zq.fromJSON))});function zH(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(zV,!1);if(!i)return!1;let o=i.pop(e,n,t);return!!o&&(r(o),!0)}}let z$=zH(0,!1),zW=zH(1,!1),zG=zH(0,!0),zU=zH(1,!0);class zq{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(e){return new zq(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 zq(e.changes&&D3.fromJSON(e.changes),[],e.mapped&&D4.fromJSON(e.mapped),e.startSelection&&Or.fromJSON(e.startSelection),e.selectionsAfter.map(Or.fromJSON))}static fromTransaction(e,t){let n=zZ;for(let t of e.startState.facet(zF)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new zq(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,zZ)}static selection(e){return new zq(void 0,zZ,void 0,void 0,e)}}function zY(e,t,n,r){let i=e.slice(t+1>n+20?t-n-1:0,t);return i.push(r),i}function zX(e,t){return e.length?t.length?e.concat(t):e:t}let zZ=[];function zK(e,t){if(!e.length)return[zq.selection([t])];{let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),zY(e,e.length-1,1e9,n.setSelAfter(r)))}}function zQ(e,t){if(!e.length)return e;let n=e.length,r=zZ;for(;n;){let i=function(e,t,n){let r=zX(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):zZ,n);if(!e.changes)return zq.selection(r);let i=e.changes.map(t),o=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(o):o;return new zq(i,OO.mapEffects(e.effects,t),a,e.startSelection.map(o),r)}(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[zq.selection(r)]:zZ}let zJ=/^(input\.type|delete)($|\.)/;class z0{constructor(e,t,n=0,r){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new z0(this.done,this.undone):this}addChanges(e,t,n,r,i){var o,a;let s,l,u=this.done,c=u[u.length-1];return new z0(u=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||zJ.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(i,(o=c.changes,a=e.changes,s=[],l=!1,o.iterChangedRanges((e,t)=>s.push(e,t)),a.iterChangedRanges((e,t,n,r)=>{for(let e=0;e<s.length;){let t=s[e++],i=s[e++];r>=t&&n<=i&&(l=!0)}}),l))||"input.type.compose"==n)?zY(u,u.length-1,r.minDepth,new zq(e.changes.compose(c.changes),zX(OO.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,zZ)):zY(u,u.length,r.minDepth,e),zZ,t,n)}addSelection(e,t,n,r){var i;let o=this.done.length?this.done[this.done.length-1].selectionsAfter:zZ;return o.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(i=o[o.length-1],i.ranges.length==e.ranges.length&&0===i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length)?this:new z0(zK(this.done,e),this.undone,t,n)}addMapping(e){return new z0(zQ(this.done,e),zQ(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let i=r[r.length-1],o=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length){let n,a;return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:zB.of({side:e,rest:(n=r[r.length-1],(a=r.slice())[r.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(!i.changes)return null;let n=1==r.length?zZ:r.slice(0,r.length-1);return i.mapped&&(n=zQ(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:zB.of({side:e,rest:n,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}z0.empty=new z0(zZ,zZ);let z1=[{key:"Mod-z",run:z$,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:zW,preventDefault:!0},{linux:"Ctrl-Shift-z",run:zW,preventDefault:!0},{key:"Mod-u",run:zG,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:zU,preventDefault:!0}];function z2(e,t){return Or.create(e.ranges.map(t),e.mainIndex)}function z5(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function z4({state:e,dispatch:t},n){let r=z2(e.selection,n);return!r.eq(e.selection,!0)&&(t(z5(e,r)),!0)}function z3(e,t){return Or.cursor(t?e.to:e.from)}function z6(e,t){return z4(e,n=>n.empty?e.moveByChar(n,t):z3(n,t))}function z8(e){return e.textDirectionAt(e.state.selection.main.head)==R1.LTR}let z9=e=>z6(e,!z8(e)),z7=e=>z6(e,z8(e));function Fe(e,t){return z4(e,n=>n.empty?e.moveByGroup(n,t):z3(n,t))}function Ft(e,t,n){let r,i,o=N0(e).resolveInner(t.head),a=n?Iw.closedBy:Iw.openedBy;for(let r=t.head;;){let t=n?o.childAfter(r):o.childBefore(r);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,a)?r=n?t.to:t.from:o=t}return i=o.type.prop(a)&&(r=n?BQ(e,o.from,1):BQ(e,o.to,-1))&&r.matched?n?r.end.to:r.end.from:n?o.to:o.from,Or.cursor(i,n?-1:1)}function Fn(e,t){return z4(e,n=>{if(!n.empty)return z3(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}"u">typeof Intl&&Intl.Segmenter;let Fr=e=>Fn(e,!1),Fi=e=>Fn(e,!0);function Fo(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(Lx.scrollMargins)){let i=t(e);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(r=Math.max(null==i?void 0:i.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function Fa(e,t){let n,r=Fo(e),{state:i}=e,o=z2(i.selection,n=>n.empty?e.moveVertically(n,t,r.height):z3(n,t));if(o.eq(i.selection))return!1;if(r.selfScroll){let t=e.coordsAtPos(i.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),s=a.top+r.marginTop,l=a.bottom-r.marginBottom;t&&t.top>s&&t.bottom<l&&(n=Lx.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-s}))}return e.dispatch(z5(i,o),{effects:n}),!0}let Fs=e=>Fa(e,!1),Fl=e=>Fa(e,!0);function Fu(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=Or.cursor(r.from+n))}return i}function Fc(e,t,n){let r=z2(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=Or.range(e.head,e.anchor));let r=n(e);return Or.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(z5(e.state,r)),!0)}function Fd(e,t){return Fc(e,t,n=>e.moveByChar(n,t))}let Fh=e=>Fd(e,!z8(e)),Fp=e=>Fd(e,z8(e));function Ff(e,t){return Fc(e,t,n=>e.moveByGroup(n,t))}function Fg(e,t){return Fc(e,t,n=>e.moveVertically(n,t))}let Fm=e=>Fg(e,!1),Fv=e=>Fg(e,!0);function Fy(e,t){return Fc(e,t,n=>e.moveVertically(n,t,Fo(e).height))}let Fx=e=>Fy(e,!1),Fb=e=>Fy(e,!0),Fw=({state:e,dispatch:t})=>(t(z5(e,{anchor:0})),!0),FS=({state:e,dispatch:t})=>(t(z5(e,{anchor:e.doc.length})),!0),FA=({state:e,dispatch:t})=>(t(z5(e,{anchor:e.selection.main.anchor,head:0})),!0),FC=({state:e,dispatch:t})=>(t(z5(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function FM(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let o=n.doc.lineAt(r.head);if(t?o.to<e.state.doc.length:o.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<o.from||r.head>o.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(z5(n,Or.create(i,i.length-1))),!0)}function Fk(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:o}=r;if(i==o){let a=t(r);a<i?(n="delete.backward",a=FT(e,a,!1)):a>i&&(n="delete.forward",a=FT(e,a,!0)),i=Math.min(i,a),o=Math.max(o,a)}else i=FT(e,i,!1),o=FT(e,o,!0);return i==o?{range:r}:{changes:{from:i,to:o},range:Or.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?Lx.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function FT(e,t,n){if(e instanceof Lx)for(let r of e.state.facet(Lx.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}let F_=(e,t,n)=>Fk(e,r=>{let i=r.from,{state:o}=e,a=o.doc.lineAt(i),s,l;if(n&&!t&&i>a.from&&i<a.from+200&&!/[^ \t]/.test(s=a.text.slice(0,i-a.from))){if(" "==s[s.length-1])return i-1;let e=O4(s,o.tabSize)%Br(o)||Br(o);for(let t=0;t<e&&" "==s[s.length-1-t];t++)i--;l=i}else(l=DQ(a.text,i-a.from,t,t)+a.from)==i&&a.number!=(t?o.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(a.text.slice(l-a.from,i-a.from))&&(l=DQ(a.text,l-a.from,!1,!1)+a.from);return l}),FI=e=>F_(e,!1,!0),FD=e=>F_(e,!0,!1),FO=(e,t)=>Fk(e,n=>{let r=n.head,{state:i}=e,o=i.doc.lineAt(r),a=i.charCategorizer(r);for(let e=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=DQ(o.text,r-o.from,t)+o.from,l=o.text.slice(Math.min(r,s)-o.from,Math.max(r,s)-o.from),u=a(l);if(null!=e&&u!=e)break;(" "!=l||r!=n.head)&&(e=u),r=s}return r}),FR=e=>FO(e,!1);function FE(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(r.empty||r.to!=o.from||(o=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}function FP(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of FE(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(r.push({from:t.to,to:o.to},{from:t.from,insert:o.text+e.lineBreak}),t.ranges))i.push(Or.range(Math.min(e.doc.length,n.anchor+a),Math.min(e.doc.length,n.head+a)));else for(let n of(r.push({from:o.from,to:t.from},{from:t.to,insert:e.lineBreak+o.text}),t.ranges))i.push(Or.range(n.anchor-a,n.head-a))}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:Or.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0)}function FL(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of FE(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}let FN=Fz(!1),FB=Fz(!0);function Fz(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,o=t.doc.lineAt(r),a=!e&&r==i&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=N0(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),o;return r&&i&&r.to<=t&&i.from>=t&&(o=r.type.prop(Iw.closedBy))&&o.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,r);e&&(r=i=(i<=o.to?o:t.doc.lineAt(i)).to);let s=new Ba(t,{simulateBreak:r,simulateDoubleBreak:!!a}),l=Bo(s,r);for(null==l&&(l=O4(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;a?{from:r,to:i}=a:r>o.from&&r<o.from+100&&!/\S/.test(o.text.slice(0,r))&&(r=o.from);let u=["",Bi(t,l)];return a&&u.push(Bi(t,s.lineIndent(o.from,-1))),{changes:{from:r,to:i,insert:D$.of(u)},range:Or.cursor(r+1+u[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function FF(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let a=e.doc.lineAt(o);a.number>n&&(r.empty||r.to>a.from)&&(t(a,i,r),n=a.number),o=a.to+1}let o=e.changes(i);return{changes:i,range:Or.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}let Fj=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(FF(e,(t,n)=>{n.push({from:t.from,insert:e.facet(Bn)})}),{userEvent:"input.indent"})),!0),FV=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(FF(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=O4(r,e.tabSize),o=0,a=Bi(e,Math.max(0,i-Br(e)));for(;o<r.length&&o<a.length&&r.charCodeAt(o)==a.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+r.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),FH=[{key:"Ctrl-b",run:z9,shift:Fh,preventDefault:!0},{key:"Ctrl-f",run:z7,shift:Fp},{key:"Ctrl-p",run:Fr,shift:Fm},{key:"Ctrl-n",run:Fi,shift:Fv},{key:"Ctrl-a",run:e=>z4(e,t=>Or.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>Fc(e,!1,t=>Or.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>z4(e,t=>Or.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>Fc(e,!0,t=>Or.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:FD},{key:"Ctrl-h",run:FI},{key:"Ctrl-k",run:e=>Fk(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:FR},{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:D$.of(["",""])},range:Or.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,r=e.doc.lineAt(n),i=n==r.from?n-1:DQ(r.text,n-r.from,!1)+r.from,o=n==r.to?n+1:DQ(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:o,insert:e.doc.slice(n,o).append(e.doc.slice(i,n))},range:Or.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Fl}],F$=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>z4(e,t=>Ft(e.state,t,!z8(e))),shift:e=>{let t=!z8(e);return Fc(e,t,n=>Ft(e.state,n,t))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>z4(e,t=>Ft(e.state,t,z8(e))),shift:e=>{let t=z8(e);return Fc(e,t,n=>Ft(e.state,n,t))}},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>FP(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>FL(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>FP(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>FL(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>FM(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>FM(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Or.create([n.main]):n.main.empty||(r=Or.create([Or.cursor(n.main.head)])),!!r&&(t(z5(e,r)),!0)}},{key:"Mod-Enter",run:FB},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=FE(e).map(({from:t,to:n})=>Or.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Or.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=z2(e.selection,t=>{let n=N0(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;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 Or.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(z5(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:FV},{key:"Mod-]",run:Fj},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Ba(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),i=FF(e,(t,i,o)=>{let a=Bo(r,t.from);if(null==a)return;/\S/.test(t.text)||(a=0);let s=/^\s*/.exec(t.text)[0],l=Bi(e,a);(s!=l||o.from<t.from+s.length)&&(n[t.from]=a,i.push({from:t.from,to:t.from+s.length,insert:l}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(FE(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=z2(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,r;return n=!1,r=z2(e.selection,t=>{let r=BQ(e,t.head,-1)||BQ(e,t.head,1)||t.head>0&&BQ(e,t.head-1,1)||t.head<e.doc.length&&BQ(e,t.head+1,-1);if(!r||!r.end)return t;n=!0;let i=r.start.from==t.head?r.end.to:r.end.from;return Or.cursor(i)}),!!n&&(t(z5(e,r)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=zL(e.state,n.from);return r.line?zR(e):!!r.block&&zP(e)}},{key:"Alt-A",run:zE},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:z9,shift:Fh,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>Fe(e,!z8(e)),shift:e=>Ff(e,!z8(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>z4(e,t=>Fu(e,t,!z8(e))),shift:e=>{let t=!z8(e);return Fc(e,t,n=>Fu(e,n,t))},preventDefault:!0},{key:"ArrowRight",run:z7,shift:Fp,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>Fe(e,z8(e)),shift:e=>Ff(e,z8(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>z4(e,t=>Fu(e,t,z8(e))),shift:e=>{let t=z8(e);return Fc(e,t,n=>Fu(e,n,t))},preventDefault:!0},{key:"ArrowUp",run:Fr,shift:Fm,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Fw,shift:FA},{mac:"Ctrl-ArrowUp",run:Fs,shift:Fx},{key:"ArrowDown",run:Fi,shift:Fv,preventDefault:!0},{mac:"Cmd-ArrowDown",run:FS,shift:FC},{mac:"Ctrl-ArrowDown",run:Fl,shift:Fb},{key:"PageUp",run:Fs,shift:Fx},{key:"PageDown",run:Fl,shift:Fb},{key:"Home",run:e=>z4(e,t=>Fu(e,t,!1)),shift:e=>Fc(e,!1,t=>Fu(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:Fw,shift:FA},{key:"End",run:e=>z4(e,t=>Fu(e,t,!0)),shift:e=>Fc(e,!0,t=>Fu(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:FS,shift:FC},{key:"Enter",run:FN,shift:FN},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:FI,shift:FI,preventDefault:!0},{key:"Delete",run:FD,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:FR,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>FO(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>Fk(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=>Fk(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(FH.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),FW={key:"Tab",run:Fj,shift:FV},FG="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class FU{constructor(e,t,n=0,r=e.length,i,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,r),this.bufferStart=n,this.normalize=i?e=>i(FG(e)):FG,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 DJ(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=D0(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=D1(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,o=!0;;e++){let n=r.charCodeAt(e),a=this.match(n,i,o,this.bufferPos+this.bufferStart,e==r.length-1);if(a)return this.value=a,this;if(e==r.length-1)break;o&&e<t.length&&t.charCodeAt(e)==n?i++:o=!1}}}match(e,t,n,r,i){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:r,precise:i&&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:r,precise:n&&i}: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&&(FU.prototype[Symbol.iterator]=function(){return this});let Fq={from:-1,to:-1,match:/.*/.exec(""),precise:!0},FY="gm"+(null==/x/.unicode?"":"u");class FX{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=Fq,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new FQ(e,t,n,r,i);this.re=new RegExp(t,FY+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let o=e.lineAt(r);this.curLineStart=o.from,this.matchPos=FJ(e,r),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,r=n+t[0].length;if(this.matchPos=FJ(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,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 FZ=new WeakMap;class FK{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=FZ.get(e);if(!r||r.from>=n||r.to<=t){let r=new FK(t,e.sliceString(t,n));return FZ.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:i,from:o}=r;return o>t&&(i=e.sliceString(t,o)+i,o=t),r.to<n&&(i+=e.sliceString(r.to,n)),FZ.set(e,new FK(o,i)),new FK(t,i.slice(t-o,n-o))}}class FQ{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=Fq,this.matchPos=FJ(e,r),this.re=new RegExp(t,FY+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=FK.get(e,r,this.chunkEnd(r+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=FJ(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=FK.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function FJ(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}"u">typeof Symbol&&(FX.prototype[Symbol.iterator]=FQ.prototype[Symbol.iterator]=function(){return this});let F0={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},F1=Oa.define({combine:e=>Oj(e,F0,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),F2=RT.mark({class:"cm-selectionMatch"}),F5=RT.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function F4(e,t,n,r){return(0==n||e(t.sliceDoc(n-1,n))!=OB.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=OB.Word)}let F3=EC.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(F1),{state:n}=e,r=n.selection;if(r.ranges.length>1)return RT.none;let i=r.main,o,a=null;if(i.empty){if(!t.highlightWordAroundCursor)return RT.none;let e=n.wordAt(i.head);if(!e)return RT.none;a=n.charCategorizer(i.head),o=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return RT.none;if(t.wholeWords){var s,l,u;if(o=n.sliceDoc(i.from,i.to),!(F4(a=n.charCategorizer(i.head),n,i.from,i.to)&&(s=a,l=i.from,u=i.to,s(n.sliceDoc(l,l+1))==OB.Word&&s(n.sliceDoc(u-1,u))==OB.Word)))return RT.none}else if(!(o=n.sliceDoc(i.from,i.to)))return RT.none}let c=[];for(let r of e.visibleRanges){let e=new FU(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!a||F4(a,n,r,o))&&(i.empty&&r<=i.from&&o>=i.to?c.push(F5.range(r,o)):(r>=i.to||o<=i.from)&&c.push(F2.range(r,o)),c.length>t.maxMatches))return RT.none}}return RT.set(c)}},{decorations:e=>e.decorations}),F6=Lx.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),F8=Oa.define({combine:e=>Oj(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new jk(e),scrollToMatch:e=>Lx.scrollIntoView(e)})});class F9{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,FY),!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 jo(this):new jt(this)}getCursor(e,t=0,n){let r=e.doc?e:OF.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?jn(this,r,t,n):je(this,r,t,n)}}class F7{constructor(e){this.spec=e}}function je(e,t,n,r){var i,o,a,s;let l;return e.wholeWord&&(a=t.doc,s=t.charCategorizer(t.selection.main.head),l=(e,t,n,r)=>((r>e||r+n.length<t)&&(r=Math.max(0,e-2),n=a.sliceString(r,Math.min(a.length,t+2))),(s(jr(n,e-r))!=OB.Word||s(ji(n,e-r))!=OB.Word)&&(s(ji(n,t-r))!=OB.Word||s(jr(n,t-r))!=OB.Word))),e.test&&(i=e.test,o=l,l=(e,n,r,a)=>(!o||!!o(e,n,r,a))&&i(e>=a&&n<=a+r.length?r.slice(e-a,n-a):t.doc.sliceString(e,n),t,e,n)),new FU(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),l)}class jt extends F7{constructor(e){super(e)}nextMatch(e,t,n){let r=je(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=je(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=je(this.spec,e,n,r),o=null;for(;!i.nextOverlapping().done;)o=i.value;if(o)return o;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=je(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=je(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}function jn(e,t,n,r){var i,o,a;let s;return e.wholeWord&&(a=t.charCategorizer(t.selection.main.head),s=(e,t,n)=>!n[0].length||(a(jr(n.input,n.index))!=OB.Word||a(ji(n.input,n.index))!=OB.Word)&&(a(ji(n.input,n.index+n[0].length))!=OB.Word||a(jr(n.input,n.index+n[0].length))!=OB.Word)),e.test&&(i=e.test,o=s,s=(e,n,r)=>(!o||o(e,n,r))&&i(r[0],t,e,n)),new FX(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:s},n,r)}function jr(e,t){return e.slice(DQ(e,t,!1),t)}function ji(e,t){return e.slice(t,DQ(e,t))}class jo extends F7{nextMatch(e,t,n){let r=jn(this.spec,e,n,e.doc.length).next();return r.done&&(r=jn(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-1e4*r),o=jn(this.spec,e,i,n),a=null;for(;!o.next().done;)a=o.value;if(a&&(i==t||a.from>i+10))return a;if(i==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 r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=jn(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=jn(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}let ja=OO.define(),js=OO.define(),jl=Oh.define({create:e=>new ju(jb(e).create(),null),update(e,t){for(let n of t.effects)n.is(ja)?e=new ju(n.value.create(),e.panel):n.is(js)&&(e=new ju(e.query,n.value?jx:null));return e},provide:e=>NS.from(e,e=>e.panel)});class ju{constructor(e,t){this.query=e,this.panel=t}}let jc=RT.mark({class:"cm-searchMatch"}),jd=RT.mark({class:"cm-searchMatch cm-searchMatch-selected"}),jh=EC.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(jl))}update(e){let t=e.state.field(jl);(t!=e.startState.field(jl)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return RT.none;let{view:n}=this,r=new Oq;for(let t=0,i=n.visibleRanges,o=i.length;t<o;t++){let{from:a,to:s}=i[t];for(;t<o-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,a,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?jd:jc)})}return r.finish()}},{decorations:e=>e.decorations});function jp(e){return t=>{let n=t.state.field(jl,!1);return n&&n.query.spec.valid?e(t,n):jA(t)}}let jf=jp((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=Or.single(r.from,r.to),o=e.state.facet(F8);return e.dispatch({selection:i,effects:[jI(e,r),o.scrollToMatch(i.main,e)],userEvent:"select.search"}),jS(e),!0}),jg=jp((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let o=Or.single(i.from,i.to),a=e.state.facet(F8);return e.dispatch({selection:o,effects:[jI(e,i),a.scrollToMatch(o.main,e)],userEvent:"select.search"}),jS(e),!0}),jm=jp((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:Or.create(n.map(e=>Or.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),jv=jp((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,r,r);if(!o)return!1;let a=o,s=[],l,u,c=[];a.precise?a.from==r&&a.to==i&&(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(Lx.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):a=t.nextMatch(n,a.from,a.to);let d=e.state.changes(s);return a&&(l=Or.single(a.from,a.to).map(d),c.push(jI(e,a)),c.push(n.facet(F8).scrollToMatch(l.main,e))),e.dispatch({changes:d,selection:l,effects:c,userEvent:"input.replace"}),!0}),jy=jp((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:o}=r;o&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Lx.announce.of(r),userEvent:"input.replace.all"}),!0});function jx(e){return e.state.facet(F8).createPanel(e)}function jb(e,t){var n,r,i,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(F8);return new F9({search:(null!=(n=null==t?void 0:t.literal)?n:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!=(r=null==t?void 0:t.caseSensitive)?r:u.caseSensitive,literal:null!=(i=null==t?void 0:t.literal)?i: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 jw(e){let t=Ny(e,jx);return t&&t.dom.querySelector("[main-field]")}function jS(e){let t=jw(e);t&&t==e.root.activeElement&&t.select()}let jA=e=>{let t=e.state.field(jl,!1);if(t&&t.panel){let n=jw(e);if(n&&n!=e.root.activeElement){let r=jb(e.state,t.query.spec);r.valid&&e.dispatch({effects:ja.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[js.of(!0),t?ja.of(jb(e.state,t.query.spec)):OO.appendConfig.of(jO)]});return!0},jC=e=>{let t=e.state.field(jl,!1);if(!t||!t.panel)return!1;let n=Ny(e,jx);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:js.of(!1)}),!0},jM=[{key:"Mod-f",run:jA,scope:"editor search-panel"},{key:"F3",run:jf,shift:jg,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:jf,shift:jg,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:jC,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:r,to:i}=n.main,o=[],a=0;for(let t=new FU(e.doc,e.sliceDoc(r,i));!t.next().done;){if(o.length>1e3)return!1;t.value.from==r&&(a=o.length),o.push(Or.range(t.value.from,t.value.to))}return t(e.update({selection:Or.create(o,a),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{var t;let n,r,i,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")},r=new Promise(e=>n=e),i=e=>(function(e,t,n){let r=t.content?t.content(e,()=>a(null)):null;if(!r){if(r=Rl("form"),t.input){let e=Rl("input",t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add("cm-textfield"),e.name||(e.name="input"),r.appendChild(Rl("label",(t.label||"")+": ",e))}else r.appendChild(document.createTextNode(t.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(Rl("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let i="FORM"==r.nodeName?[r]:r.querySelectorAll("form");for(let e=0;e<i.length;e++){let t=i[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=Rl("div",r,Rl("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?r.querySelector(t.focus):r.querySelector("input")||r.querySelector("button"))&&"select"in e?e.select():e&&"focus"in e&&e.focus()}}}})(e,t,n),e.state.field(NA,!1)?e.dispatch({effects:NC.of(i)}):e.dispatch({effects:OO.appendConfig.of(NA.init(()=>[i]))}),{close:o=NM.of(i),result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(NA).indexOf(i)>-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 r=a.doc.lineAt(a.selection.main.head),[,i,o,s,u]=n,c=s?+s.slice(1):0,d=o?+o:r.number;if(o&&u){let e=d/100;i&&(e=e*("-"==i?-1:1)+r.number/a.doc.lines),d=Math.round(a.doc.lines*e)}else o&&i&&(d=d*("-"==i?-1:1)+r.number);let h=a.doc.line(Math.max(1,Math.min(a.doc.lines,d))),p=Or.cursor(h.from+Math.max(0,Math.min(c,h.length)));e.dispatch({effects:[l,Lx.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,r=Or.create(n.ranges.map(t=>e.wordAt(t.head)||Or.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)})({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=function(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new FU(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new FU(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(o){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}(e,r);return!!i&&(t(e.update({selection:e.selection.addRange(Or.range(i.from,i.to),!1),effects:Lx.scrollIntoView(i.to)})),!0)},preventDefault:!0}];class jk{constructor(e){this.view=e;let t=this.query=e.state.field(jl).query.spec;function n(e,t,n){return Rl("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=Rl("input",{value:t.search,placeholder:jT(e,"Find"),"aria-label":jT(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Rl("input",{value:t.replace,placeholder:jT(e,"Replace"),"aria-label":jT(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Rl("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Rl("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Rl("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=Rl("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>jf(e),[jT(e,"next")]),n("prev",()=>jg(e),[jT(e,"previous")]),n("select",()=>jm(e),[jT(e,"all")]),Rl("label",null,[this.caseField,jT(e,"match case")]),Rl("label",null,[this.reField,jT(e,"regexp")]),Rl("label",null,[this.wordField,jT(e,"by word")]),...e.state.readOnly?[]:[Rl("br"),this.replaceField,n("replace",()=>jv(e),[jT(e,"replace")]),n("replaceAll",()=>jy(e),[jT(e,"replace all")])],Rl("button",{name:"close",onclick:()=>jC(e),"aria-label":jT(e,"close"),type:"button"},["\xd7"])])}commit(){let e=new F9({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:ja.of(e)}))}keydown(e){var t;(t=this.view,LR(LI(t.state),e,t,"search-panel"))?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?jg:jf)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),jv(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(ja)&&!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(F8).top}}function jT(e,t){return e.state.phrase(t)}let j_=/[\s\.,:;?!]/;function jI(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,o=Math.max(r.from,t-30),a=Math.min(i,n+30),s=e.state.sliceDoc(o,a);if(o!=r.from){for(let e=0;e<30;e++)if(!j_.test(s[e+1])&&j_.test(s[e])){s=s.slice(e);break}}if(a!=i){for(let e=s.length-1;e>s.length-30;e--)if(!j_.test(s[e-1])&&j_.test(s[e])){s=s.slice(0,e);break}}return Lx.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${r.number}.`)}let jD=Lx.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"}}),jO=[jl,Of.low(jh),jD];class jR{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=N0(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),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(jN(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}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 jE(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 jP{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}}function jL(e){return e.selection.main.from}function jN(e,t){var n;let{source:r}=e,i=t&&"^"!=r[0],o="$"!=r[r.length-1];return i||o?RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,null!=(n=e.flags)?n:e.ignoreCase?"i":""):e}let jB=O_.define(),jz=new WeakMap;function jF(e){if(!Array.isArray(e))return e;let t=jz.get(e);return t||jz.set(e,t=function(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=jE(t)+jE(n)+"*$";return[RegExp("^"+r),new RegExp(r)]}(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}(e)),t}let jj=OO.define(),jV=OO.define();class jH{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=DJ(e,t),r=D1(n);this.chars.push(n);let i=e.slice(t,t+r),o=i.toUpperCase();this.folded.push(DJ(o==i?i.toLowerCase():o,0)),t+=r}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:r,precise:i,byWord:o}=this;if(1==t.length){let r=DJ(e,0),i=D1(r),o=i==e.length?0:-100;if(r==t[0]);else{if(r!=n[0])return null;o+=-200}return this.ret(o,[0,i])}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 i=0,o=Math.min(e.length,200);i<o&&l<s;){let o=DJ(e,i);(o==t[l]||o==n[l])&&(r[l++]=i),i+=D1(o)}if(l<s)return null}let u=0,c=0,d=!1,h=0,p=-1,f=-1,g=/[a-z]/.test(e),m=!0;for(let r=0,l=Math.min(e.length,200),v=0;r<l&&c<s;){let l=DJ(e,r);a<0&&(u<s&&l==t[u]&&(i[u++]=r),h<s&&(l==t[h]||l==n[h]?(0==h&&(p=r),f=r+1,h++):h=0));let y,x=l<255?l>=48&&l<=57||l>=97&&l<=122?2:+(l>=65&&l<=90):(y=D0(l))!=y.toLowerCase()?1:2*(y!=y.toUpperCase());(!r||1==x&&g||0==v&&0!=x)&&(t[c]==l||n[c]==l&&(d=!0)?o[c++]=r:o.length&&(m=!1)),v=x,r+=D1(l)}return c==s&&0==o[0]&&m?this.result(-100+(d?-200:0),o,e):h==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]):h==s?this.ret(-900-e.length,[p,f]):c==s?this.result(-100+(d?-200:0)+-700+(m?0:-1100),o,e):2==t.length?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?D1(DJ(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}}class j${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 jW=Oa.define({combine:e=>Oj(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:jU,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=>jG(e(n),t(n)),optionClass:(e,t)=>n=>jG(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function jG(e,t){return e?t?e+" "+t:e:t}function jU(e,t,n,r,i,o){let a=e.textDirection==R1.RTL,s=a,l=!1,u="top",c,d,h=t.left-i.left,p=i.right-t.right,f=r.right-r.left,g=r.bottom-r.top;if(s&&h<Math.min(f,p)?s=!1:!s&&p<Math.min(f,h)&&(s=!0),f<=(s?h:p))c=Math.max(i.top,Math.min(n.top,i.bottom-g))-t.top,d=Math.min(400,s?h:p);else{l=!0,d=Math.min(400,(a?t.right:i.right-t.left)-30);let e=i.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: ${d/v}px`,class:"cm-completionInfo-"+(l?a?"left-narrow":"right-narrow":s?"left":"right")}}let jq=OO.define();function jY(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 r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}class jX{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 r=e.state.field(t),{options:i,selected:o}=r.open,a=e.state.facet(jW);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,r){let i=document.createElement("span");i.className="cm-completionLabel";let o=e.displayLabel||e.label,a=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>a&&i.appendChild(document.createTextNode(o.slice(a,t)));let s=i.appendChild(document.createElement("span"));s.appendChild(document.createTextNode(o.slice(t,n))),s.className="cm-completionMatchedText",a=n}return a<o.length&&i.appendChild(document.createTextNode(o.slice(a))),i},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=jY(i.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:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if("LI"==t.nodeName&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[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:jq.of(t)}),n.preventDefault())}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(jW).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:jV.of(null)})}),this.showOptions(i,r.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),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:i,selected:o,disabled:a}=n.open;r.open&&r.open.options==i||(this.range=jY(i.length,o,e.state.facet(jW).maxRenderedOptions),this.showOptions(i,n.id)),this.updateSel(),a!=(null==(t=r.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=jY(t.options.length,t.selected,this.view.state.facet(jW).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let o="string"==typeof i?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>Eb(this.view.state,e,"completion info")):(this.addInfoPane(o,r),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:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){var t,n;let r,i,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,r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),o=r.height/t.offsetHeight,i.top<r.top?t.scrollTop-=(r.top-i.top)/o:i.bottom>r.bottom&&(t.scrollTop+=(i.bottom-r.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(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(jW).positionInfo(this.view,t,r,n,i,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 r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",e=>{e.target==r&&e.preventDefault()});let i=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!=i&&(o>n.from||0==n.from)&&(i=e,"string"!=typeof l&&l.header?r.appendChild(l.header(l)):r.appendChild(document.createElement("completion-section")).textContent=e)}let u=r.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&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function jZ(e){return 100*(e.boost||0)+10*!!e.apply+5*!!e.info+ +!!e.type}class jK{constructor(e,t,n,r,i,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new jK(this.options,j1(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,i,o){if(r&&!o&&e.some(e=>e.isPending))return r.setDisabled();let a=function(e,t){let n=[],r=null,i=null,o=e=>{n.push(e);let{section:t}=e.completion;if(t){r||(r=[]);let e="string"==typeof t?t:t.name;r.some(t=>t.name==e)||r.push("string"==typeof t?{name:e}:t)}},a=t.facet(jW);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(!1===r.result.filter)for(let t of r.result.options)o(new jP(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,l=a.filterStrict?new j$(n):new jH(n);for(let t of r.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 jP(t,r.source,n,a)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;i||(i=Object.create(null)),i[e]=Math.max(a,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0;for(let n of r.sort((e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?i[t.name]-i[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?jZ(e.completion)>jZ(l)&&(s[s.length-1]=e):s.push(e),l=e.completion}return s}(e,t);if(!a.length)return r&&e.some(e=>e.isPending)?r.setDisabled():null;let s=t.facet(jW).selectOnOpen?0:-1;if(r&&r.selected!=s&&-1!=r.selected){let e=r.options[r.selected].completion;for(let t=0;t<a.length;t++)if(a[t].completion==e){s=t;break}}return new jK(a,j1(n,s),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:j7,above:i.aboveCursor},r?r.timestamp:Date.now(),s,!1)}map(e){return new jK(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new jK(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class jQ{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new jQ(j2,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(jW),r=(n.override||t.languageDataAt("autocomplete",jL(t)).map(jF)).map(t=>(this.active.find(e=>e.source==t)||new j4(t,+!!this.active.some(e=>0!=e.state))).update(e,n));r.length==this.active.length&&r.every((e,t)=>e==this.active[t])&&(r=this.active);let i=this.open,o=e.effects.some(e=>e.is(j6));for(let a of(i&&e.docChanged&&(i=i.map(e.changes)),e.selection||r.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,o=r==t.length;if(i||o)return i==o;if(e[n++].result!=t[r++].result)return!1}}(r,this.active)||o?i=jK.build(r,t,this.id,i,n,o):i&&i.disabled&&!r.some(e=>e.isPending)&&(i=null),!i&&r.every(e=>!e.isPending)&&r.some(e=>e.hasResult())&&(r=r.map(e=>e.hasResult()?new j4(e.source,0):e)),e.effects))a.is(jq)&&(i=i&&i.setSelected(a.value,this.id));return r==this.active&&i==this.open?this:new jQ(r,this.id,i)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?jJ:j0}}let jJ={"aria-autocomplete":"list"},j0={};function j1(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let j2=[];function j5(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(jB);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 j4{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=j5(e,t),r=this;for(let t of((8&n||16&n&&this.touches(e))&&(r=new j4(r.source,0)),4&n&&0==r.state&&(r=new j4(this.source,1)),r=r.updateFor(e,n),e.effects))if(t.is(jj))r=new j4(r.source,1,t.value);else if(t.is(jV))r=new j4(r.source,0);else if(t.is(j6))for(let e of t.value)e.source==r.source&&(r=e);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(jL(e.state))}}class j3 extends j4{constructor(e,t,n,r,i,o){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let i=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=jL(e.state);if(a>o||!r||2&t&&(jL(e.startState)==this.from||a<this.limit))return new j4(this.source,4&t?1:0);let s=e.changes.mapPos(this.limit);return!function(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return"function"==typeof e?e(i,n,r,t):jN(e,!0).test(i)}(r.validFor,e.state,i,o)?r.update&&(r=r.update(r,i,o,new jR(e.state,a,!1)))?new j3(this.source,this.explicit,s,r,r.from,null!=(n=r.to)?n:jL(e.state)):new j4(this.source,1,this.explicit):new j3(this.source,this.explicit,s,r,i,o)}map(e){if(e.empty)return this;let t=this.result.map?this.result.map(this.result,e):this.result;return t?new j3(this.source,this.explicit,e.mapPos(this.limit),t,e.mapPos(this.from),e.mapPos(this.to,1)):new j4(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}let j6=OO.define({map:(e,t)=>e.map(e=>e.map(t))}),j8=Oh.define({create:()=>jQ.start(),update:(e,t)=>e.update(t),provide:e=>[Nu.from(e,e=>e.tooltip),Lx.contentAttributes.from(e,e=>e.attrs)]});function j9(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(j8).active.find(e=>e.source==t.source);return r instanceof j3&&("string"==typeof n?e.dispatch({...function(e,t,n,r){let{main:i}=e.selection,o=n-i.from,a=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+o,s.from+a)!=e.sliceDoc(n,r))return{range:s};let l=e.toText(t);return{changes:{from:s.from+o,to:r==i.from?s.to:s.from+a,insert:l},range:Or.cursor(s.from+o+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}(e.state,n,r.from,r.to),annotations:jB.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}let j7=e=>new jX(e,j8,j9);function Ve(e,t="option"){return n=>{let r=n.state.field(j8,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(jW).interactionDelay)return!1;let i=1,o;"page"==t&&(o=Ng(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:a}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(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:jq.of(s)}),!0}}let Vt=e=>!!e.state.field(j8,!1)&&(e.dispatch({effects:jj.of(!0)}),!0);class Vn{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}let Vr=EC.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(j8).active))t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(j8),n=e.state.facet(jW);if(!e.selectionSet&&!e.docChanged&&e.startState.field(j8)==t)return;let r=e.transactions.some(e=>{let t=j5(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(r||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){Eb(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(jj)))&&(this.pendingStart=!0);let i=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(),i):-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(j8);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(jW).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=jL(t),r=new jR(t,n,e.explicit,this.view),i=new Vn(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(e=>{i.context.aborted||(i.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:jV.of(null)}),Eb(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(jW).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(jW),r=this.view.state.field(j8);for(let i=0;i<this.running.length;i++){let o=this.running[i];if(void 0===o.done)continue;if(this.running.splice(i--,1),o.done){let r=jL(o.updates.length?o.updates[0].startState:this.view.state),i=Math.min(r,o.done.from+ +!o.active.explicit),a=new j3(o.active.source,o.active.explicit,i,o.done,o.done.from,null!=(e=o.done.to)?e:r);for(let e of o.updates)a=a.update(e,n);if(a.hasResult()){t.push(a);continue}}let a=r.active.find(e=>e.source==o.active.source);if(a&&a.isPending)if(null==o.done){let e=new j4(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||r.open&&r.open.disabled)&&this.view.dispatch({effects:j6.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(j8,!1);if(t&&t.tooltip&&this.view.state.facet(jW).closeOnBlur){let n=t.open&&Ng(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:jV.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:jj.of(!1)}),20),this.composing=0}}}),Vi="object"==typeof navigator&&/Win/.test(navigator.platform),Vo=Of.highest(Lx.domEventHandlers({keydown(e,t){let n=t.state.field(j8,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(Vi&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&j9(t,r),!1}})),Va=Lx.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"}}}),Vs={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Vl=OO.define({map(e,t){let n=t.mapPos(e,-1,D5.TrackAfter);return null==n?void 0:n}}),Vu=new class extends OV{};Vu.startSide=1,Vu.endSide=-1;let Vc=Oh.define({create:()=>OU.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(Vl)&&(e=e.update({add:[Vu.range(n.value,n.value+1)]}));return e}}),Vd="()[]{}<>\xab\xbb\xbb\xab[]{}";function Vh(e){for(let t=0;t<Vd.length;t+=2)if(Vd.charCodeAt(t)==e)return Vd.charAt(t+1);return D0(e<128?e:e+1)}function Vp(e,t){return e.languageDataAt("closeBrackets",t)[0]||Vs}let Vf="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),Vg=Lx.inputHandler.of((e,t,n,r)=>{if((Vf?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||2==r.length&&1==D1(DJ(r,0))||t!=i.from||n!=i.to)return!1;let o=function(e,t){let n=Vp(e,e.selection.main.head),r=n.brackets||Vs.brackets;for(let i of r){let o=Vh(DJ(i,0));if(t==i)return o==i?function(e,t,n,r){let i=r.stringPrefixes||Vs.stringPrefixes,o=null,a=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:Vl.of(r.to+t.length),range:Or.range(r.anchor+t.length,r.head+t.length)};let a=r.head,s=Vy(e.doc,a),l;if(s==t){if(Vx(e,a))return{changes:{insert:t+t,from:a},effects:Vl.of(a+t.length),range:Or.cursor(a+t.length)};else if(Vv(e,a)){let r=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+r.length,insert:r},range:Or.cursor(a+r.length)}}}else if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(l=Vb(e,a-2*t.length,i))>-1&&Vx(e,l))return{changes:{insert:t+t+t+t,from:a},effects:Vl.of(a+t.length),range:Or.cursor(a+t.length)};else if(e.charCategorizer(a)(s)!=OB.Word&&Vb(e,a,i)>-1&&!function(e,t,n,r){let i=N0(e).resolveInner(t,-1),o=r.reduce((e,t)=>Math.max(e,t.length),0);for(let a=0;a<5;a++){let a=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),s=a.indexOf(n);if(!s||s>-1&&r.indexOf(a.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.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=i.to==t&&i.parent;if(!l)break;i=l}return!1}(e,a,t,i))return{changes:{insert:t+t,from:a},effects:Vl.of(a+t.length),range:Or.cursor(a+t.length)};return{range:o=r}});return o?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}(e,i,r.indexOf(i+i+i)>-1,n):function(e,t,n,r){let i=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:Vl.of(o.to+t.length),range:Or.range(o.anchor+t.length,o.head+t.length)};let a=Vy(e.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+n,from:o.head},effects:Vl.of(o.head+t.length),range:Or.cursor(o.head+t.length)}:{range:i=o}});return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,i,o,n.before||Vs.before);if(t==o&&Vv(e,e.selection.main.from))return function(e,t){let n=null,r=e.changeByRange(r=>r.empty&&Vy(e.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:Or.cursor(r.head+t.length)}:n={range:r});return n?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}(e,o)}return null}(e.state,r);return!!o&&(e.dispatch(o),!0)}),Vm=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Vp(e,e.selection.main.head).brackets||Vs.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){var i,o;let r,a=(i=e.doc,o=t.head,D1(DJ(r=i.sliceString(o-2,o),0))==r.length?r:r.slice(1));for(let r of n)if(r==a&&Vy(e.doc,t.head)==Vh(DJ(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:Or.cursor(t.head-r.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!r}}];function Vv(e,t){let n=!1;return e.field(Vc).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function Vy(e,t){let n=e.sliceString(t,t+2);return n.slice(0,D1(DJ(n,0)))}function Vx(e,t){let n=N0(e).resolveInner(t+1);return n.parent&&n.from==t}function Vb(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=OB.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=OB.Word)return n}return -1}let Vw=[{key:"Ctrl-Space",run:Vt},{mac:"Alt-`",run:Vt},{mac:"Alt-i",run:Vt},{key:"Escape",run:e=>{let t=e.state.field(j8,!1);return!!t&&!!t.active.some(e=>0!=e.state)&&(e.dispatch({effects:jV.of(null)}),!0)}},{key:"ArrowDown",run:Ve(!0)},{key:"ArrowUp",run:Ve(!1)},{key:"PageDown",run:Ve(!0,"page")},{key:"PageUp",run:Ve(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(j8,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(jW).interactionDelay)&&j9(e,t.open.options[t.open.selected])}}],VS=Of.highest(LT.computeN([jW],e=>e.facet(jW).defaultKeymap?[Vw]:[]));var VA=function(e){let t;void 0===e&&(e={});var n=e.crosshairCursor,r=[];!1!==e.closeBracketsKeymap&&(r=r.concat(Vm)),!1!==e.defaultKeymap&&(r=r.concat(F$)),!1!==e.searchKeymap&&(r=r.concat(jM)),!1!==e.historyKeymap&&(r=r.concat(z1)),!1!==e.foldKeymap&&(r=r.concat(BC)),!1!==e.completionKeymap&&(r=r.concat(Vw)),!1!==e.lintKeymap&&(r=r.concat(zl));var i=[];return!1!==e.lineNumbers&&i.push(function(e={}){return[NH.of(e),NE(),NG]}()),!1!==e.highlightActiveLineGutter&&i.push(NY),!1!==e.highlightSpecialChars&&i.push(function(e={}){return[L0.of(e),L1||(L1=EC.fromClass(class{constructor(e){this.view=e,this.decorations=RT.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(L0)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new LX({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,o=DJ(t[0],0);if(9==o){let e=i.lineAt(r),t=n.state.tabSize,o=O4(e.text,t,r-e.from);return RT.replace({widget:new L5((t-o%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=RT.replace({widget:new L2(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(L0);e.startState.facet(L0)!=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&&i.push(function(e={}){return[zV,zj.of(e),Lx.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?z$:"historyRedo"==e.inputType?zW:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&i.push(function(e={}){let t={...BO,...e},n=new BR(t,!0),r=new BR(t,!1),i=EC.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(N7)!=e.state.facet(N7)||e.startState.field(Bx,!1)!=e.state.field(Bx,!1)||N0(e.startState)!=N0(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new Oq;for(let i of e.viewportLineBlocks){let o=Bw(e.state,i.from,i.to)?r:Bf(e.state,i.from,i.to)?n:null;o&&t.add(i.from,i.from,o)}return t.finish()}}),{domEventHandlers:o}=t;return[i,NO({class:"cm-foldGutter",markers(e){var t;return(null==(t=e.plugin(i))?void 0:t.markers)||OU.empty},initialSpacer:()=>new BR(t,!1),domEventHandlers:{...o,click:(e,t,n)=>{if(o.click&&o.click(e,t,n))return!0;let r=Bw(e.state,t.from,t.to);if(r)return e.dispatch({effects:Bv.of(r)}),!0;let i=Bf(e.state,t.from,t.to);return!!i&&(e.dispatch({effects:Bm.of(i)}),!0)}}}),BT()]}()),!1!==e.drawSelection&&i.push(function(e={}){return[LF.of(e),LV,L$,LW,Eg.of(!0)]}()),!1!==e.dropCursor&&i.push([LU,Lq]),!1!==e.allowMultipleSelections&&i.push(OF.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&i.push(OF.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:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+200)return e;let o=n.sliceString(i.from,r);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=Bo(a,t.from);if(null==n)continue;let r=/^\s*/.exec(t.text)[0],i=Bi(a,n);r!=i&&l.push({from:t.from,to:t.from+r.length,insert:i})}return l.length?[e,{changes:l,sequential:!0}]:e})),!1!==e.syntaxHighlighting&&i.push(Bz(Bj,{fallback:!0})),!1!==e.bracketMatching&&i.push(function(e={}){return[B$.of(e),BY]}()),!1!==e.closeBrackets&&i.push([Vg,Vc]),!1!==e.autocompletion&&i.push(function(e={}){return[Vo,j8,jW.of(e),Vr,VS,Va]}()),!1!==e.rectangularSelection&&i.push((t=e=>e.altKey&&0==e.button,Lx.mouseSelectionStyle.of((e,n)=>{let r,i;return t(n)?(r=L8(e,n),i=e.state.selection,r?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(r.line).from),n=e.state.doc.lineAt(t);r={line:n.number,col:r.col,off:Math.min(r.off,n.length)},i=i.map(e.changes)}},get(t,n,o){let a=L8(e,t);if(!a)return i;let s=function(e,t,n){let r=Math.min(t.line,n.line),i=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=r;t<=i;t++){let n=e.doc.line(t);n.length<=s&&o.push(Or.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=r;t<=i;t++){let n=e.doc.line(t),r=O3(n.text,a,e.tabSize,!0);if(r<0)o.push(Or.cursor(n.to));else{let t=O3(n.text,s,e.tabSize);o.push(Or.range(n.from+r,n.from+t))}}}return o}(e.state,r,a);return s.length?o?Or.create(s.concat(i.ranges)):Or.create(s):i}}:null):null}))),!1!==(void 0!==n&&n)&&i.push(function(e={}){let[t,n]=L9[e.key||"Alt"],r=EC.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[r,Lx.contentAttributes.of(e=>{var t;return(null==(t=e.plugin(r))?void 0:t.isDown)?L7:null})]}()),!1!==e.highlightActiveLine&&i.push(L3),!1!==e.highlightSelectionMatches&&i.push([F6,F3]),e.tabSize&&"number"==typeof e.tabSize&&i.push(Bn.of(" ".repeat(e.tabSize))),i.concat([LT.of(r.flat())]).filter(Boolean)};let VC="#e06c75",VM="#abb2bf",Vk="#7d8799",VT="#d19a66",V_="#2c313a",VI="#282c34",VD="#353a42",VO="#528bff",VR=[Lx.theme({"&":{color:VM,backgroundColor:VI},".cm-content":{caretColor:VO},".cm-cursor, .cm-dropCursor":{borderLeftColor:VO},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:VM},".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:VI,color:Vk,border:"none"},".cm-activeLineGutter":{backgroundColor:V_},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:VD},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:VD,borderBottomColor:VD},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:V_,color:VM}}},{dark:!0}),Bz(BP.define([{tag:DO.keyword,color:"#c678dd"},{tag:[DO.name,DO.deleted,DO.character,DO.propertyName,DO.macroName],color:VC},{tag:[DO.function(DO.variableName),DO.labelName],color:"#61afef"},{tag:[DO.color,DO.constant(DO.name),DO.standard(DO.name)],color:VT},{tag:[DO.definition(DO.name),DO.separator],color:VM},{tag:[DO.typeName,DO.className,DO.number,DO.changed,DO.annotation,DO.modifier,DO.self,DO.namespace],color:"#e5c07b"},{tag:[DO.operator,DO.operatorKeyword,DO.url,DO.escape,DO.regexp,DO.link,DO.special(DO.string)],color:"#56b6c2"},{tag:[DO.meta,DO.comment],color:Vk},{tag:DO.strong,fontWeight:"bold"},{tag:DO.emphasis,fontStyle:"italic"},{tag:DO.strikethrough,textDecoration:"line-through"},{tag:DO.link,color:Vk,textDecoration:"underline"},{tag:DO.heading,fontWeight:"bold",color:VC},{tag:[DO.atom,DO.bool,DO.special(DO.variableName)],color:VT},{tag:[DO.processingInstruction,DO.string,DO.inserted],color:"#98c379"},{tag:DO.invalid,color:"#ffffff"}]))];var VE=Lx.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),VP=function(e){let t;void 0===e&&(e={});var n=e,r=n.indentWithTab,i=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,d=void 0===c||c,h=[];switch((void 0===r||r)&&h.unshift(LT.of([FW])),d&&("boolean"==typeof d?h.unshift(VA()):h.unshift(VA(d))),u&&h.unshift((t=EC.fromClass(class{constructor(e){this.view=e,this.placeholder=u?RT.set([RT.widget({widget:new L6(u),side:1}).range(0)]):RT.none}get decorations(){return this.view.state.doc.length?RT.none:this.placeholder}},{decorations:e=>e.decorations}),"string"==typeof u?[t,Lx.contentAttributes.of({"aria-placeholder":u})]:t)),s){case"light":h.push(VE);break;case"dark":h.push(VR);break;case"none":break;default:h.push(s)}return!1===(void 0===i||i)&&h.push(Lx.editable.of(!1)),void 0!==o&&o&&h.push(OF.readOnly.of(!0)),[...h]};class VL{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 VN{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 VB=null,Vz=O_.define(),VF=[],Vj=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],VV=(0,I.forwardRef)((e,t)=>{var n,r,i,o,a,s,l,u,c,d,h,p,f,g,m,v,y,x,b,w,S,A,C,M,k,T,D,O,R,E,P,L,N,B,z,F,j,V,H,$,W,G,U,q,Y,X,Z,K,Q,J=e.className,ee=e.value,et=void 0===ee?"":ee,en=e.selection,er=e.extensions,ei=e.onChange,eo=e.onStatistics,ea=e.onCreateEditor,es=e.onUpdate,el=e.autoFocus,eu=e.theme,ec=void 0===eu?"light":eu,ed=e.height,eh=e.minHeight,ep=e.maxHeight,ef=e.width,eg=e.minWidth,em=e.maxWidth,ev=e.basicSetup,ey=e.placeholder,ex=e.indentWithTab,eb=e.editable,ew=e.readOnly,eS=e.root,eA=e.initialState,eC=(0,zD.A)(e,Vj),eM=(0,I.useRef)(null),ek=(r=(n={root:eS,value:et,autoFocus:el,theme:ec,height:ed,minHeight:eh,maxHeight:ep,width:ef,minWidth:eg,maxWidth:em,basicSetup:ev,placeholder:ey,indentWithTab:ex,editable:eb,readOnly:ew,selection:en,onChange:ei,onStatistics:eo,onCreateEditor:ea,onUpdate:es,extensions:void 0===er?[]:er,initialState:eA}).value,i=n.selection,o=n.onChange,a=n.onStatistics,s=n.onCreateEditor,l=n.onUpdate,c=void 0===(u=n.extensions)?VF:u,d=n.autoFocus,p=void 0===(h=n.theme)?"light":h,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,A=void 0===(S=n.minWidth)?null:S,M=void 0===(C=n.maxWidth)?null:C,T=void 0===(k=n.placeholder)?"":k,O=void 0===(D=n.editable)||D,E=void 0!==(R=n.readOnly)&&R,L=void 0===(P=n.indentWithTab)||P,B=void 0===(N=n.basicSetup)||N,z=n.root,F=n.initialState,V=(j=(0,I.useState)())[0],H=j[1],W=($=(0,I.useState)())[0],G=$[1],q=(U=(0,I.useState)())[0],Y=U[1],X=(0,I.useState)(()=>({current:null}))[0],Z=(0,I.useState)(()=>({current:null}))[0],K=Lx.theme({"&":{height:g,minHeight:v,maxHeight:x,width:w,minWidth:A,maxWidth:M},"& .cm-scroller":{height:"100% !important"}}),Q=[Lx.updateListener.of(e=>{e.docChanged&&"function"==typeof o&&!e.transactions.some(e=>e.annotation(Vz))&&(X.current?X.current.reset():(X.current=new VL(()=>{if(Z.current){var e=Z.current;Z.current=null,e()}X.current=null},200),("u"<typeof window?new VN:(!VB&&(VB=new VN),VB)).add(X.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)})}),K,...VP({theme:p,editable:O,readOnly:E,placeholder:T,indentWithTab:L,basicSetup:B})],l&&"function"==typeof l&&Q.push(Lx.updateListener.of(l)),Q=Q.concat(c),(0,I.useLayoutEffect)(()=>{if(V&&!q){var e={doc:r,selection:i,extensions:Q},t=F?OF.fromJSON(F.json,e,F.fields):OF.create(e);if(Y(t),!W){var n=new Lx({state:t,parent:V,root:z});G(n),s&&s(n,t)}}return()=>{W&&(Y(void 0),G(void 0))}},[V,q]),(0,I.useEffect)(()=>{n.container&&H(n.container)},[n.container]),(0,I.useEffect)(()=>()=>{W&&(W.destroy(),G(void 0)),X.current&&(X.current.cancel(),X.current=null)},[W]),(0,I.useEffect)(()=>{d&&W&&W.focus()},[d,W]),(0,I.useEffect)(()=>{W&&W.dispatch({effects:OO.reconfigure.of(Q)})},[p,c,g,v,x,w,A,M,T,O,E,L,B,o,l]),(0,I.useEffect)(()=>{if(void 0!==r){var e=W?W.state.doc.toString():"";if(W&&r!==e){var t=X.current&&!X.current.isDone,n=()=>{W&&r!==W.state.doc.toString()&&W.dispatch({changes:{from:0,to:W.state.doc.toString().length,insert:r||""},annotations:[Vz.of(!0)]})};t?Z.current=n:n()}}},[r,W]),{state:q,setState:Y,view:W,setView:G,container:V,setContainer:H}),eT=ek.state,e_=ek.view,eI=ek.container,eD=ek.setContainer;(0,I.useImperativeHandle)(t,()=>({editor:eM.current,state:eT,view:e_}),[eM,eI,eT,e_]);var eO=(0,I.useCallback)(e=>{eM.current=e,eD(e)},[eD]);if("string"!=typeof et)throw Error("value must be typeof string but got "+typeof et);return(0,_.jsx)("div",(0,oU.A)({ref:eO,className:("string"==typeof ec?"cm-theme-"+ec:"cm-theme")+(J?" "+J:"")},eC))});function VH(e){let t=(0,uH.A)(),n="dark"===t.palette.mode,[r,i]=(0,I.useState)(()=>JSON.stringify(e.value,null,2)),[o,a]=(0,I.useState)(r);return(0,_.jsx)(VV,{...e,style:{border:`1px solid ${t.palette.divider}`},theme:n?"dark":"light",extensions:[new Be(B3),function(e,t={}){return[zc.of({source:e,config:t}),zu,z_]}(e=>{try{JSON.parse(e.state.doc.toString())}catch(i){var t;let n;if(!(i instanceof SyntaxError))throw i;let r=(t=e.state.doc,(n=i.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=i.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0);return[{from:r,message:i.message,severity:"error",to:r}]}return[]}),function(e={}){return[zI.of(e),zA,zS,zk,zM]}()],value:r,onChange:t=>{i(t),e.onChange&&e.onChange(t)},onBlur:()=>{o!==r&&void 0!==e.onChange&&(e.onChange(r),a(r))},placeholder:e.placeholder})}function V$(e){return(0,V.Ay)("MuiFormControlLabel",e)}VV.displayName="CodeMirror";let VW=(0,j.A)("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]);var VG=n(87842);let VU=(0,N.A)("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${VW.label}`]:t.label},t.root,t[`labelPlacement${(0,L.A)(n.labelPlacement)}`]]}})((0,B.A)(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${VW.disabled}`]:{cursor:"default"},[`& .${VW.label}`]:{[`&.${VW.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:e})=>"start"===e||"top"===e||"bottom"===e,style:{marginLeft:16}}]}))),Vq=(0,N.A)("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})((0,B.A)(({theme:e})=>({[`&.${VW.error}`]:{color:(e.vars||e).palette.error.main}}))),VY=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiFormControlLabel"}),{checked:r,className:i,componentsProps:o={},control:a,disabled:s,disableTypography:l,inputRef:u,label:c,labelPlacement:d="end",name:h,onChange:p,required:f,slots:g={},slotProps:m={},value:v,...y}=n,x=(0,gH.A)(),b=s??a.props.disabled??x?.disabled,w=f??a.props.required,S={disabled:b,required:w};["checked","name","onChange","value","inputRef"].forEach(e=>{void 0===a.props[e]&&void 0!==n[e]&&(S[e]=n[e])});let A=(0,VG.A)({props:n,muiFormControl:x,states:["error"]}),C={...n,disabled:b,labelPlacement:d,required:w,error:A.error},M=(e=>{let{classes:t,disabled:n,labelPlacement:r,error:i,required:o}=e,a={root:["root",n&&"disabled",`labelPlacement${(0,L.A)(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return(0,R.A)(a,V$,t)})(C),k={slots:g,slotProps:{...o,...m}},[T,D]=(0,cn.A)("typography",{elementType:u7.A,externalForwardedProps:k,ownerState:C}),E=c;return null==E||E.type===u7.A||l||(E=(0,_.jsx)(T,{component:"span",...D,className:(0,O.A)(M.label,D?.className),children:E})),(0,_.jsxs)(VU,{className:(0,O.A)(M.root,i),ownerState:C,ref:t,...y,children:[I.cloneElement(a,S),w?(0,_.jsxs)("div",{children:[E,(0,_.jsxs)(Vq,{ownerState:C,"aria-hidden":!0,className:M.asterisk,children:[" ","*"]})]}):E]})}),VX=e=>{let{mode:t,url:n,name:r,newTabOpen:i,renderVariables:o,tooltip:a}=e;return(0,_.jsxs)(ey.A,{direction:"column",gap:2,flexGrow:1,children:[(0,_.jsx)(vu,{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}),(r||a)&&(0,_.jsxs)(ey.A,{gap:1,direction:"inline"===t?"row":"column",children:[r&&(0,_.jsx)(vu,{sx:{flexGrow:"1"},label:r.label,onChange:r?.onChange,placeholder:r?.placeholder,value:r?.value}),a&&(0,_.jsx)(vu,{sx:{flexGrow:"1"},label:a.label,onChange:a?.onChange,placeholder:a?.placeholder,value:a?.value})]}),(0,_.jsxs)(ey.A,{direction:"row",gap:1,children:[o&&(0,_.jsx)(VY,{label:o.label,control:(0,_.jsx)(fm,{checked:o.value,onChange:e=>{o?.onChange(e.target.checked)}})}),(0,_.jsx)(VY,{label:i.label,control:(0,_.jsx)(fm,{checked:i.value,onChange:e=>{i?.onChange(e.target.checked)}})})]})]})},VZ=[{id:"value",label:"Value"},{id:"percentage",label:"Percentage"}];function VK({disablePercentageMode:e,onChange:t,value:n="value"}){return(0,_.jsx)(yo,{label:"Mode",control:(0,_.jsx)(yY,{value:VZ.find(e=>e.id===n),options:VZ,getOptionLabel:e=>e.label,getOptionDisabled:t=>"percentage"===t.id&&e,onChange:(e,{id:n})=>{t(n)},disableClearable:!0})})}function VQ(e){return(0,V.Ay)("MuiSkeleton",e)}(0,j.A)("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);let VJ=(0,Q.i7)`
34
+ 0% {
35
+ opacity: 1;
36
+ }
37
+
38
+ 50% {
39
+ opacity: 0.4;
40
+ }
41
+
42
+ 100% {
43
+ opacity: 1;
44
+ }
45
+ `,V0=(0,Q.i7)`
46
+ 0% {
47
+ transform: translateX(-100%);
48
+ }
49
+
50
+ 50% {
51
+ /* +0.5s of delay between each loop */
52
+ transform: translateX(100%);
53
+ }
54
+
55
+ 100% {
56
+ transform: translateX(100%);
57
+ }
58
+ `,V1="string"!=typeof VJ?(0,Q.AH)`
59
+ animation: ${VJ} 2s ease-in-out 0.5s infinite;
60
+ `:null,V2="string"!=typeof V0?(0,Q.AH)`
61
+ &::after {
62
+ animation: ${V0} 2s linear 0.5s infinite;
63
+ }
64
+ `:null,V5=(0,N.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,B.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,E.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:V1||{animation:`${VJ} 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(
65
+ 90deg,
66
+ transparent,
67
+ ${(e.vars||e).palette.action.hover},
68
+ transparent
69
+ )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:V2||{"&::after":{animation:`${V0} 2s linear 0.5s infinite`}}}]}})),V4=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiSkeleton"}),{animation:r="pulse",className:i,component:o="span",height:a,style:s,variant:l="text",width:u,...c}=n,d={...n,animation:r,component:o,variant:l,hasChildren:!!c.children},h=(e=>{let{classes:t,variant:n,animation:r,hasChildren:i,width:o,height:a}=e;return(0,R.A)({root:["root",n,r,i&&"withChildren",i&&!o&&"fitContent",i&&!a&&"heightAuto"]},VQ,t)})(d);return(0,_.jsx)(V5,{as:o,ref:t,className:(0,O.A)(h.root,i),ownerState:d,...c,style:{width:u,height:a,...s}})});function V3(e){let{message:t}=e;return(0,_.jsx)(ey.A,{sx:{height:"100%",alignItems:"center",justifyContent:"center"},children:(0,_.jsx)(u7.A,{children:t})})}function V6(e){let{resource:t}=e;return(0,_.jsx)(V3,{message:`No ${t}`})}function V8(e){let{variant:t="rounded"}=e;return(0,_.jsx)(ey.A,{sx:{height:"100%",alignItems:"center",justifyContent:"center",px:1},children:(0,_.jsx)(V4,{variant:t,width:"100%",height:"30%","aria-label":"Loading..."})})}let V9=[{id:"asc",label:"Ascending"},{id:"desc",label:"Descending"}];function V7({onChange:e,value:t="desc"}){return(0,_.jsx)(yo,{label:"Sort",control:(0,_.jsx)(yY,{value:V9.find(e=>e.id===t),options:V9,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function He({onChange:e,value:t,...n}){let r=t=>{e(t)};return(0,_.jsxs)(q,{"aria-label":"Sort",...n,children:[(0,_.jsx)(em,{onClick:()=>r(void 0),variant:void 0===t?"contained":"outlined",children:"None"}),(0,_.jsx)(em,{onClick:()=>r("asc"),variant:"asc"===t?"contained":"outlined",children:"Asc"}),(0,_.jsx)(em,{onClick:()=>r("desc"),variant:"desc"===t?"contained":"outlined",children:"Desc"})]})}function Ht(e){return(0,V.Ay)("MuiToggleButtonGroup",e)}let Hn=(0,j.A)("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),Hr=I.createContext({}),Hi=I.createContext(void 0);function Ho(e){return(0,V.Ay)("MuiToggleButton",e)}let Ha=(0,j.A)("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),Hs=(0,N.A)("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${Hn.grouped}`]:t.grouped},{[`& .${Hn.grouped}`]:t[`grouped${(0,L.A)(n.orientation)}`]},{[`& .${Hn.firstButton}`]:t.firstButton},{[`& .${Hn.lastButton}`]:t.lastButton},{[`& .${Hn.middleButton}`]:t.middleButton},t.root,"vertical"===n.orientation&&t.vertical,n.fullWidth&&t.fullWidth]}})((0,B.A)(({theme:e})=>({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${Hn.grouped}`]:{[`&.${Hn.selected} + .${Hn.grouped}.${Hn.selected}`]:{borderTop:0,marginTop:0}},[`& .${Hn.firstButton},& .${Hn.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${Hn.lastButton},& .${Hn.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${Hn.lastButton}.${Ha.disabled},& .${Hn.middleButton}.${Ha.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${Hn.grouped}`]:{[`&.${Hn.selected} + .${Hn.grouped}.${Hn.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${Hn.firstButton},& .${Hn.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${Hn.lastButton},& .${Hn.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${Hn.lastButton}.${Ha.disabled},& .${Hn.middleButton}.${Ha.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),Hl=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiToggleButtonGroup"}),{children:r,className:i,color:o="standard",disabled:a=!1,exclusive:s=!1,fullWidth:l=!1,onChange:u,orientation:c="horizontal",size:d="medium",value:h,...p}=n,f={...n,disabled:a,fullWidth:l,orientation:c,size:d},g=(e=>{let{classes:t,orientation:n,fullWidth:r,disabled:i}=e,o={root:["root",n,r&&"fullWidth"],grouped:["grouped",`grouped${(0,L.A)(n)}`,i&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,R.A)(o,Ht,t)})(f),m=I.useCallback((e,t)=>{let n;if(!u)return;let r=h&&h.indexOf(t);h&&r>=0?(n=h.slice()).splice(r,1):n=h?h.concat(t):[t],u(e,n)},[u,h]),v=I.useCallback((e,t)=>{u&&u(e,h===t?null:t)},[u,h]),y=I.useMemo(()=>({className:g.grouped,onChange:s?v:m,value:h,size:d,fullWidth:l,color:o,disabled:a}),[g.grouped,s,v,m,h,d,l,o,a]),x=P(r),b=x.length;return(0,_.jsx)(Hs,{role:"group",className:(0,O.A)(g.root,i),ref:t,ownerState:f,...p,children:(0,_.jsx)(Hr.Provider,{value:y,children:x.map((e,t)=>{let n,r;return(0,_.jsx)(Hi.Provider,{value:(n=0===t,r=t===b-1,n&&r?"":n?g.firstButton:r?g.lastButton:g.middleButton),children:e},t)})})})}),Hu=(0,N.A)(K.A,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`size${(0,L.A)(n.size)}`]]}})((0,B.A)(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${Ha.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,E.X4)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${Ha.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,E.X4)(e.palette.text.primary,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,E.X4)(e.palette.text.primary,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,E.X4)(e.palette.text.primary,e.palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter((0,z.A)()).map(([t])=>({props:{color:t},style:{[`&.${Ha.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,E.X4)(e.palette[t].main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,E.X4)(e.palette[t].main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,E.X4)(e.palette[t].main,e.palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),Hc=I.forwardRef(function(e,t){var n;let{value:r,...i}=I.useContext(Hr),o=I.useContext(Hi),a=(0,Y.A)({...i,selected:(n=e.value,void 0!==r&&void 0!==n&&(Array.isArray(r)?r.includes(n):n===r))},e),s=(0,F.b)({props:a,name:"MuiToggleButton"}),{children:l,className:u,color:c="standard",disabled:d=!1,disableFocusRipple:h=!1,fullWidth:p=!1,onChange:f,onClick:g,selected:m,size:v="medium",value:y,...x}=s,b={...s,color:c,disabled:d,disableFocusRipple:h,fullWidth:p,size:v},w=(e=>{let{classes:t,fullWidth:n,selected:r,disabled:i,size:o,color:a}=e,s={root:["root",r&&"selected",i&&"disabled",n&&"fullWidth",`size${(0,L.A)(o)}`,a]};return(0,R.A)(s,Ho,t)})(b);return(0,_.jsx)(Hu,{className:(0,O.A)(i.className,w.root,u,o||""),disabled:d,focusRipple:!h,ref:t,onClick:e=>{g&&(g(e,y),e.defaultPrevented)||f&&f(e,y)},onChange:f,value:y,ownerState:b,"aria-pressed":m,...x,children:l})}),Hd=(0,n(68335).A)();var Hh=n(86742),Hp=n(86067);function Hf({inputRef:e,label:t,color:n,value:r,mode:i,onChange:o,onColorChange:a,onBlur:s,onDelete:l}){let[u,c]=(0,I.useState)(0);return(0,_.jsxs)(ey.A,{flex:1,direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,_.jsx)(uj,{label:t,color:n,onColorChange:a}),(0,_.jsx)(ye.A,{htmlFor:t,children:t}),(0,_.jsx)(eC.A,{id:t,inputRef:e,type:"number",value:0===r?"":r,placeholder:"0",onChange:o,onBlur:s,onKeyDown:e=>{"Enter"===e.key&&(s(),c(u+1))},InputProps:{endAdornment:"percent"===i?(0,_.jsx)(uQ,{paddingX:1,children:"%"}):void 0}},u),(0,_.jsx)(eA,{"aria-label":`delete threshold ${t}`,size:"small",onClick:l,children:(0,_.jsx)(Hp,{})})]})}function Hg({thresholds:e,onChange:t,hideDefault:n,disablePercentMode:r}){let{thresholds:{defaultColor:i,palette:o}}=e9(),a=e?.defaultColor??i,s=e?.steps,l=(0,I.useRef)(null),u=(0,I.useRef)(!1);(0,I.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,uJ.produce)(e,e=>{e.steps=n}))}};return(0,_.jsxs)(ys,{title:"Thresholds",icon:(0,_.jsx)(yn,{description:"Add threshold",children:(0,_.jsx)(eA,{size:"small","aria-label":"add threshold",onClick:()=>{u.current=!0,void 0===e?t({steps:[{value:10}]}):e&&void 0===e.steps?t((0,uJ.produce)(e,e=>{e.steps=[{value:10}]})):t((0,uJ.produce)(e,e=>{let t=e.steps;if(t?.length){let e=t[t.length-1],n=o[t.length]??Hm();t.push({color:n,value:(e?.value??0)+10})}else t&&t.push({value:10})}))},children:(0,_.jsx)(Hh,{})})}),children:[(0,_.jsx)(yo,{label:"Mode",description:"Percentage means thresholds relative to min & max",control:(0,_.jsxs)(Hl,{exclusive:!0,disabled:r,value:e?.mode??"absolute",onChange:(n,r)=>{let i="percent"===r?"percent":void 0;void 0!==e?t((0,uJ.produce)(e,e=>{e.mode=i})):t({mode:i})},sx:{height:"36px",marginLeft:"auto"},children:[(0,_.jsx)(Hc,{"aria-label":"absolute",value:"absolute",sx:{fontWeight:500},children:"Absolute"}),(0,_.jsx)(Hc,{"aria-label":"percent",value:"percent",sx:{fontWeight:500},children:"Percent"})]})}),s&&s.map((n,r)=>(0,_.jsx)(Hf,{inputRef:r===s.length-1?l:void 0,label:`T${r+1}`,color:n.color??o[r]??a,value:n.value,mode:e?.mode,onColorChange:n=>{void 0!==e&&t((0,uJ.produce)(e,e=>{if(void 0!==e.steps){let t=e.steps[r];t&&(t.color=n)}}))},onChange:n=>{void 0!==e&&t((0,uJ.produce)(e,e=>{let t=e.steps?.[r];t&&(t.value=Number(n.target.value))}))},onDelete:()=>{void 0!==e&&t((0,uJ.produce)(e,e=>{e.steps&&e.steps.splice(r,1)}))},onBlur:c},r)).toReversed(),!n&&(0,_.jsxs)(Hd,{flex:1,direction:"row",alignItems:"center",spacing:1,children:[(0,_.jsx)(uj,{label:"default",color:a,onColorChange:n=>{void 0!==e?t((0,uJ.produce)(e,e=>{e.defaultColor=n})):t({defaultColor:n})}}),(0,_.jsx)(u7.A,{children:"Default"})]})]})}let Hm=()=>"#"+Math.floor(0x1000000*Math.random()).toString(16).padStart(6,"0");var Hv=n(24300),Hy=n(26684),Hx=n(51327),Hb=n(87169);function Hw({props:e,name:t}){return(0,Hx.A)({props:e,name:t,defaultTheme:Hb.A,themeId:uX.A})}let HS=["localeText"],HA=I.createContext(null),HC=function(e){let{localeText:t}=e,n=(0,zD.A)(e,HS),{utils:r,localeText:i}=I.useContext(HA)??{utils:void 0,localeText:void 0},{children:o,dateAdapter:a,dateFormats:s,dateLibInstance:l,adapterLocale:u,localeText:c}=Hw({props:n,name:"MuiLocalizationProvider"}),d=I.useMemo(()=>(0,oU.A)({},c,i,t),[c,i,t]),h=I.useMemo(()=>{if(!a)return r||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(`
70
+ `));return e},[a,u,s,l,r]),p=I.useMemo(()=>h?{minDate:h.date("1900-01-01T00:00:00.000"),maxDate:h.date("2099-12-31T00:00:00.000")}:null,[h]),f=I.useMemo(()=>({utils:h,defaultDates:p,localeText:d}),[p,h,d]);return(0,_.jsx)(HA.Provider,{value:f,children:o})};var HM=n(62688),Hk=n.n(HM);let HT={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,r)=>`Select ${e}. ${!r&&(null===t||!n.isValid(t))?"No time selected":`Selected time is ${r??n.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t,n)=>n||null!==e&&t.isValid(e)?`Choose date, selected date is ${n??t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t,n)=>n||null!==e&&t.isValid(e)?`Choose time, selected time is ${n??t.format(e,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>"letter"===e.contentType?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>"letter"===e.contentType?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"};(0,oU.A)({},HT);let H_=()=>{let e=I.useContext(HA);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=I.useMemo(()=>(0,oU.A)({},HT,e.localeText),[e.localeText]);return I.useMemo(()=>(0,oU.A)({},e,{localeText:t}),[e,t])},HI=e=>{let t=H_().utils,n=I.useRef(void 0);return void 0===n.current&&(n.current=t.date(void 0,e)),n.current},HD=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n))},HO=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:a,timezone:s})=>{let l=HD(a,a.date(void 0,s),e);n&&a.isBefore(i,l)&&(i=l),t&&a.isAfter(r,l)&&(r=l);let u=e,c=e;for(a.isBefore(e,i)&&(u=i,c=null),a.isAfter(e,r)&&(c&&(c=r),u=null);u||c;){if(u&&a.isAfter(u,r)&&(u=null),c&&a.isBefore(c,i)&&(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},HR=(e,t,n)=>null!=t&&e.isValid(t)?t:n,HE=(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},HP=(e,t,n)=>"date"===n?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),HL=(e,t)=>{let n=e.setHours(e.date(),"am"===t?2:14);return e.format(n,"meridiem")},HN=["year","month","day"],HB=e=>HN.includes(e);function Hz(e){return(0,V.Ay)("MuiTab",e)}let HF=(0,j.A)("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),Hj=(0,N.A)(K.A,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${(0,L.A)(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${HF.iconWrapper}`]:t.iconWrapper},{[`& .${HF.icon}`]:t.icon}]}})((0,B.A)(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&("top"===e.iconPosition||"bottom"===e.iconPosition),style:{flexDirection:"column"}},{props:({ownerState:e})=>e.label&&"top"!==e.iconPosition&&"bottom"!==e.iconPosition,style:{flexDirection:"row"}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"top"===t,style:{[`& > .${HF.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"bottom"===t,style:{[`& > .${HF.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"start"===t,style:{[`& > .${HF.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&"end"===t,style:{[`& > .${HF.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${HF.selected}`]:{opacity:1},[`&.${HF.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${HF.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${HF.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${HF.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${HF.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),HV=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiTab"}),{className:r,disabled:i=!1,disableFocusRipple:o=!1,fullWidth:a,icon:s,iconPosition:l="top",indicator:u,label:c,onChange:d,onClick:h,onFocus:p,selected:f,selectionFollowsFocus:g,textColor:m="inherit",value:v,wrapped:y=!1,...x}=n,b={...n,disabled:i,disableFocusRipple:o,selected:f,icon:!!s,iconPosition:l,label:!!c,fullWidth:a,textColor:m,wrapped:y},w=(e=>{let{classes:t,textColor:n,fullWidth:r,wrapped:i,icon:o,label:a,selected:s,disabled:l}=e,u={root:["root",o&&a&&"labelIcon",`textColor${(0,L.A)(n)}`,r&&"fullWidth",i&&"wrapped",s&&"selected",l&&"disabled"],icon:["iconWrapper","icon"]};return(0,R.A)(u,Hz,t)})(b),S=s&&c&&I.isValidElement(s)?I.cloneElement(s,{className:(0,O.A)(w.icon,s.props.className)}):s;return(0,_.jsxs)(Hj,{focusRipple:!o,className:(0,O.A)(w.root,r),ref:t,role:"tab","aria-selected":f,disabled:i,onClick:e=>{!f&&d&&d(e,v),h&&h(e)},onFocus:e=>{g&&!f&&d&&d(e,v),p&&p(e)},ownerState:b,tabIndex:f?0:-1,...x,children:["top"===l||"start"===l?(0,_.jsxs)(I.Fragment,{children:[S,c]}):(0,_.jsxs)(I.Fragment,{children:[c,S]}),u]})});function HH(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}let H$={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function HW(e){return(0,V.Ay)("MuiTabScrollButton",e)}let HG=(0,j.A)("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),HU=(0,N.A)(K.A,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${HG.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),Hq=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiTabScrollButton"}),{className:r,slots:i={},slotProps:o={},direction:a,orientation:s,disabled:l,...u}=n,c=(0,fj.I)(),d={isRtl:c,...n},h=(e=>{let{classes:t,orientation:n,disabled:r}=e;return(0,R.A)({root:["root",n,r&&"disabled"]},HW,t)})(d),p=i.StartScrollButtonIcon??fV,f=i.EndScrollButtonIcon??fH,g=(0,mG.A)({elementType:p,externalSlotProps:o.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),m=(0,mG.A)({elementType:f,externalSlotProps:o.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return(0,_.jsx)(HU,{component:"div",className:(0,O.A)(h.root,r),ref:t,role:null,ownerState:d,tabIndex:null,...u,style:{...u.style,..."vertical"===s&&{"--TabScrollButton-svgRotate":`rotate(${c?-90:90}deg)`}},children:"left"===a?(0,_.jsx)(p,{...g}):(0,_.jsx)(f,{...m})})});function HY(e){return(0,V.Ay)("MuiTabs",e)}let HX=(0,j.A)("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]);var HZ=n(1092);let HK=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,HQ=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,HJ=(e,t,n)=>{let r=!1,i=n(e,t);for(;i;){if(i===e.firstChild){if(r)return;r=!0}let t=i.disabled||"true"===i.getAttribute("aria-disabled");if(i.hasAttribute("tabindex")&&!t)return void i.focus();i=n(e,i)}},H0=(0,N.A)("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${HX.scrollButtons}`]:t.scrollButtons},{[`& .${HX.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})((0,B.A)(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${HX.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),H1=(0,N.A)("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),H2=(0,N.A)("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),H5=(0,N.A)("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})((0,B.A)(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:"100%",width:2,right:0}}]}))),H4=(0,N.A)(function(e){let{onChange:t,...n}=e,r=I.useRef(),i=I.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return(0,u1.A)(()=>{let e=(0,xJ.A)(()=>{let e=r.current;o(),e!==r.current&&t(r.current)}),n=(0,x1.A)(i.current);return n.addEventListener("resize",e),()=>{e.clear(),n.removeEventListener("resize",e)}},[t]),I.useEffect(()=>{o(),t(r.current)},[t]),(0,_.jsx)("div",{style:H$,...n,ref:i})})({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),H3={},H6=I.forwardRef(function(e,t){let n,r,i=(0,F.b)({props:e,name:"MuiTabs"}),o=(0,uH.A)(),a=(0,fj.I)(),{"aria-label":s,"aria-labelledby":l,action:u,centered:c=!1,children:d,className:h,component:p="div",allowScrollButtonsMobile:f=!1,indicatorColor:g="primary",onChange:m,orientation:v="horizontal",ScrollButtonComponent:y,scrollButtons:x="auto",selectionFollowsFocus:b,slots:w={},slotProps:S={},TabIndicatorProps:A={},TabScrollButtonProps:C={},textColor:M="primary",value:k,variant:T="standard",visibleScrollbar:D=!1,...E}=i,P="scrollable"===T,L="vertical"===v,N=L?"scrollTop":"scrollLeft",B=L?"top":"left",z=L?"bottom":"right",j=L?"clientHeight":"clientWidth",V=L?"height":"width",H={...i,component:p,allowScrollButtonsMobile:f,indicatorColor:g,orientation:v,vertical:L,scrollButtons:x,textColor:M,variant:T,visibleScrollbar:D,fixed:!P,hideScrollbar:P&&!D,scrollableX:P&&!L,scrollableY:P&&L,centered:c&&!P,scrollButtonsHideMobile:!f},$=(e=>{let{vertical:t,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:o,centered:a,scrollButtonsHideMobile:s,classes:l}=e;return(0,R.A)({root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",i&&"scrollableX",o&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},HY,l)})(H),W=(0,mG.A)({elementType:w.StartScrollButtonIcon,externalSlotProps:S.startScrollButtonIcon,ownerState:H}),G=(0,mG.A)({elementType:w.EndScrollButtonIcon,externalSlotProps:S.endScrollButtonIcon,ownerState:H}),[U,q]=I.useState(!1),[Y,X]=I.useState(H3),[Z,K]=I.useState(!1),[Q,J]=I.useState(!1),[ee,et]=I.useState(!1),[en,er]=I.useState({overflow:"hidden",scrollbarWidth:0}),ei=new Map,eo=I.useRef(null),ea=I.useRef(null),es={slots:w,slotProps:{indicator:A,scrollButton:C,...S}},el=()=>{let e,t,n=eo.current;if(n){let t=n.getBoundingClientRect();e={clientWidth:n.clientWidth,scrollLeft:n.scrollLeft,scrollTop:n.scrollTop,scrollWidth:n.scrollWidth,top:t.top,bottom:t.bottom,left:t.left,right:t.right}}if(n&&!1!==k){let e=ea.current.children;if(e.length>0){let n=e[ei.get(k)];t=n?n.getBoundingClientRect():null}}return{tabsMeta:e,tabMeta:t}},eu=(0,m0.A)(()=>{let e,{tabsMeta:t,tabMeta:n}=el(),r=0;L?(e="top",n&&t&&(r=n.top-t.top+t.scrollTop)):(e=a?"right":"left",n&&t&&(r=(a?-1:1)*(n[e]-t[e]+t.scrollLeft)));let i={[e]:r,[V]:n?n[V]:0};if("number"!=typeof Y[e]||"number"!=typeof Y[V])X(i);else{let t=Math.abs(Y[e]-i[e]),n=Math.abs(Y[V]-i[V]);(t>=1||n>=1)&&X(i)}}),ec=(e,{animation:t=!0}={})=>{t?function(e,t,n,r={},i=()=>{}){let{ease:o=HH,duration:a=300}=r,s=null,l=t[e],u=!1,c=r=>{if(u)return void i(Error("Animation cancelled"));null===s&&(s=r);let d=Math.min(1,(r-s)/a);(t[e]=o(d)*(n-l)+l,d>=1)?requestAnimationFrame(()=>{i(null)}):requestAnimationFrame(c)};l===n?i(Error("Element already at target position")):requestAnimationFrame(c)}(N,eo.current,e,{duration:o.transitions.duration.standard}):eo.current[N]=e},ed=e=>{let t=eo.current[N];L?t+=e:t+=e*(a?-1:1),ec(t)},eh=()=>{let e=eo.current[j],t=0,n=Array.from(ea.current.children);for(let r=0;r<n.length;r+=1){let i=n[r];if(t+i[j]>e){0===r&&(t=e);break}t+=i[j]}return t},[ep,{onChange:ef,...eg}]=(0,cn.A)("scrollbar",{className:(0,O.A)($.scrollableX,$.hideScrollbar),elementType:H4,shouldForwardComponentProp:!0,externalForwardedProps:es,ownerState:H}),em=I.useCallback(e=>{ef?.(e),er({overflow:null,scrollbarWidth:e})},[ef]),[ev,ey]=(0,cn.A)("scrollButtons",{className:(0,O.A)($.scrollButtons,C.className),elementType:Hq,externalForwardedProps:es,ownerState:H,additionalProps:{orientation:v,slots:{StartScrollButtonIcon:w.startScrollButtonIcon||w.StartScrollButtonIcon,EndScrollButtonIcon:w.endScrollButtonIcon||w.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:W,endScrollButtonIcon:G}}}),ex=(0,m0.A)(e=>{let{tabsMeta:t,tabMeta:n}=el();n&&t&&(n[B]<t[B]?ec(t[N]+(n[B]-t[B]),{animation:e}):n[z]>t[z]&&ec(t[N]+(n[z]-t[z]),{animation:e}))}),eb=(0,m0.A)(()=>{P&&!1!==x&&et(!ee)});I.useEffect(()=>{let e,t,n=(0,xJ.A)(()=>{eo.current&&eu()}),r=(0,x1.A)(eo.current);return r.addEventListener("resize",n),"u">typeof ResizeObserver&&(e=new ResizeObserver(n),Array.from(ea.current.children).forEach(t=>{e.observe(t)})),"u">typeof MutationObserver&&(t=new MutationObserver(t=>{t.forEach(t=>{t.removedNodes.forEach(t=>{e?.unobserve(t)}),t.addedNodes.forEach(t=>{e?.observe(t)})}),n(),eb()})).observe(ea.current,{childList:!0}),()=>{n.clear(),r.removeEventListener("resize",n),t?.disconnect(),e?.disconnect()}},[eu,eb]),I.useEffect(()=>{let e=Array.from(ea.current.children),t=e.length;if("u">typeof IntersectionObserver&&t>0&&P&&!1!==x){let n=e[0],r=e[t-1],i={root:eo.current,threshold:.99},o=new IntersectionObserver(e=>{K(!e[0].isIntersecting)},i);o.observe(n);let a=new IntersectionObserver(e=>{J(!e[0].isIntersecting)},i);return a.observe(r),()=>{o.disconnect(),a.disconnect()}}},[P,x,ee,d?.length]),I.useEffect(()=>{q(!0)},[]),I.useEffect(()=>{eu()}),I.useEffect(()=>{ex(H3!==Y)},[ex,Y]),I.useImperativeHandle(u,()=>({updateIndicator:eu,updateScrollButtons:eb}),[eu,eb]);let[ew,eS]=(0,cn.A)("indicator",{className:(0,O.A)($.indicator,A.className),elementType:H5,externalForwardedProps:es,ownerState:H,additionalProps:{style:Y}}),eA=(0,_.jsx)(ew,{...eS}),eC=0,eM=I.Children.map(d,e=>{if(!I.isValidElement(e))return null;let t=void 0===e.props.value?eC:e.props.value;ei.set(t,eC);let n=t===k;return eC+=1,I.cloneElement(e,{fullWidth:"fullWidth"===T,indicator:n&&!U&&eA,selected:n,selectionFollowsFocus:b,onChange:m,textColor:M,value:t,...1===eC&&!1===k&&!e.props.tabIndex?{tabIndex:0}:{}})}),ek=((n={}).scrollbarSizeListener=P?(0,_.jsx)(ep,{...eg,onChange:em}):null,n.scrollButtonStart=(r=P&&("auto"===x&&(Z||Q)||!0===x))?(0,_.jsx)(ev,{direction:a?"right":"left",onClick:()=>{ed(-1*eh())},disabled:!Z,...ey}):null,n.scrollButtonEnd=r?(0,_.jsx)(ev,{direction:a?"left":"right",onClick:()=>{ed(eh())},disabled:!Q,...ey}):null,n),[eT,e_]=(0,cn.A)("root",{ref:t,className:(0,O.A)($.root,h),elementType:H0,externalForwardedProps:{...es,...E,component:p},ownerState:H}),[eI,eD]=(0,cn.A)("scroller",{ref:eo,className:$.scroller,elementType:H1,externalForwardedProps:es,ownerState:H,additionalProps:{style:{overflow:en.overflow,[L?`margin${a?"Left":"Right"}`:"marginBottom"]:D?void 0:-en.scrollbarWidth}}}),[eO,eR]=(0,cn.A)("list",{ref:ea,className:(0,O.A)($.list,$.flexContainer),elementType:H2,externalForwardedProps:es,ownerState:H,getSlotProps:e=>({...e,onKeyDown:t=>{(e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;let t=ea.current,n=(0,HZ.A)(t).activeElement;if("tab"!==n.getAttribute("role"))return;let r="horizontal"===v?"ArrowLeft":"ArrowUp",i="horizontal"===v?"ArrowRight":"ArrowDown";switch("horizontal"===v&&a&&(r="ArrowRight",i="ArrowLeft"),e.key){case r:e.preventDefault(),HJ(t,n,HQ);break;case i:e.preventDefault(),HJ(t,n,HK);break;case"Home":e.preventDefault(),HJ(t,null,HK);break;case"End":e.preventDefault(),HJ(t,null,HQ)}})(t),e.onKeyDown?.(t)}})});return(0,_.jsxs)(eT,{...e_,children:[ek.scrollButtonStart,ek.scrollbarSizeListener,(0,_.jsxs)(eI,{...eD,children:[(0,_.jsx)(eO,{"aria-label":s,"aria-labelledby":l,"aria-orientation":"vertical"===v?"vertical":null,role:"tablist",...eR,children:eM}),U&&eA]}),ek.scrollButtonEnd]})}),H8=(0,fo.A)((0,_.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),H9=(0,fo.A)((0,_.jsx)("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),H7=(0,fo.A)((0,_.jsx)("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight");(0,fo.A)((0,_.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,fo.A)((0,_.jsxs)(I.Fragment,{children:[(0,_.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,_.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");let $e=(0,fo.A)((0,_.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"),$t=(0,fo.A)((0,_.jsxs)(I.Fragment,{children:[(0,_.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,_.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),$n=(0,fo.A)((0,_.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 $r(e){return(0,V.Ay)("MuiDateTimePickerTabs",e)}(0,j.A)("MuiDateTimePickerTabs",["root"]);let $i=(0,N.A)(H6,{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}`,[`& .${HX.indicator}`]:{bottom:"auto",top:0}}})),$o=function(e){let t=Hw({props:e,name:"MuiDateTimePickerTabs"}),{dateIcon:n=(0,_.jsx)($e,{}),onViewChange:r,timeIcon:i=(0,_.jsx)($t,{}),view:o,hidden:a="u"<typeof window||window.innerHeight<667,className:s,sx:l}=t,u=H_().localeText,c=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"]},$r,t)})(t);return a?null:(0,_.jsxs)($i,{ownerState:t,variant:"fullWidth",value:HB(o)?"date":"time",onChange:(e,t)=>{r("date"===t?"day":"hours")},className:(0,O.A)(s,c.root),sx:l,children:[(0,_.jsx)(HV,{value:"date","aria-label":u.dateTableLabel,icon:(0,_.jsx)(I.Fragment,{children:n})}),(0,_.jsx)(HV,{value:"time","aria-label":u.timeTableLabel,icon:(0,_.jsx)(I.Fragment,{children:i})})]})};function $a(e){return(0,V.Ay)("MuiPickersToolbarText",e)}let $s=(0,j.A)("MuiPickersToolbarText",["root","selected"]),$l=["className","selected","value"],$u=(0,N.A)(u7.A,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${$s.selected}`]:t.selected}]})(({theme:e})=>({transition:e.transitions.create("color"),color:(e.vars||e).palette.text.secondary,[`&.${$s.selected}`]:{color:(e.vars||e).palette.text.primary}})),$c=I.forwardRef(function(e,t){let n=Hw({props:e,name:"MuiPickersToolbarText"}),{className:r,value:i}=n,o=(0,zD.A)(n,$l),a=(e=>{let{classes:t,selected:n}=e;return(0,R.A)({root:["root",n&&"selected"]},$a,t)})(n);return(0,_.jsx)($u,(0,oU.A)({ref:t,className:(0,O.A)(a.root,r),component:"span"},o,{children:i}))});function $d(e){return(0,V.Ay)("MuiPickersToolbar",e)}let $h=(0,j.A)("MuiPickersToolbar",["root","content"]),$p=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],$f=(0,N.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"}}]})),$g=(0,N.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"}}]}),$m=I.forwardRef(function(e,t){let n=Hw({props:e,name:"MuiPickersToolbar"}),{children:r,className:i,toolbarTitle:o,hidden:a,titleId:s}=n,l=(0,zD.A)(n,$p),u=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"],content:["content"]},$d,t)})(n);return a?null:(0,_.jsxs)($f,(0,oU.A)({ref:t,className:(0,O.A)(u.root,i),ownerState:n},l,{children:[(0,_.jsx)(u7.A,{color:"text.secondary",variant:"overline",id:s,children:o}),(0,_.jsx)($g,{className:u.content,ownerState:n,children:r})]}))}),$v=["align","className","selected","typographyClassName","value","variant","width"],$y=(0,N.A)(em,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,minWidth:16,textTransform:"none"}),$x=I.forwardRef(function(e,t){let n=Hw({props:e,name:"MuiPickersToolbarButton"}),{align:r,className:i,selected:o,typographyClassName:a,value:s,variant:l,width:u}=n,c=(0,zD.A)(n,$v),d=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"]},$d,t)})(n);return(0,_.jsx)($y,(0,oU.A)({variant:"text",ref:t,className:(0,O.A)(d.root,i)},u?{sx:{width:u}}:{},c,{children:(0,_.jsx)($c,{align:r,className:a,variant:l,value:s,selected:o})}))});function $b(e){return(0,V.Ay)("MuiDateTimePickerToolbar",e)}let $w=(0,j.A)("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),$S=["hours","minutes","seconds"],$A=e=>$S.includes(e),$C=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?"am"===t?e-12:e+12:e,$M=(e,t)=>3600*t.getHours(e)+60*t.getMinutes(e)+t.getSeconds(e),$k=(e,t)=>(n,r)=>e?t.isAfter(n,r):$M(n,t)>$M(r,t);function $T(e,t,n,r){let i=H_().utils;return{meridiemMode:e?i.getHours(e)>=12?"pm":"am":null,handleMeridiemChange:I.useCallback(o=>{var a;let s;n(null==e?null:(a=!!t,s=$C(i.getHours(e),o,a),i.setHours(e,s)),r??"partial")},[t,e,n,r,i])}}let $_=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],$I=(0,N.A)($m,{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}`,[`& .${$h.content} .${$s.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}}]})),$D=(0,N.A)("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(e,t)=>t.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),$O=(0,N.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"}}]}),$R=(0,N.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}}]}),$E=(0,N.A)($c,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),$P=(0,N.A)("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${$w.ampmLabel}`]:t.ampmLabel},{[`&.${$w.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${$w.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function $L(e){let t=Hw({props:e,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:r,value:i,onChange:o,view:a,isLandscape:s,onViewChange:l,toolbarFormat:u,toolbarPlaceholder:c="––",views:d,disabled:h,readOnly:p,toolbarVariant:f="mobile",toolbarTitle:g,className:m}=t,v=(0,zD.A)(t,$_),y=(0,fj.I)(),x=(0,oU.A)({},t,{isRtl:y}),b=H_().utils,{meridiemMode:w,handleMeridiemChange:S}=$T(i,n,o),A=!!(n&&!r),C="desktop"===f,M=H_().localeText,k=(e=>{let{classes:t,isLandscape:n,isRtl:r}=e;return(0,R.A)({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",r&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",r&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},$b,t)})(x),T=g??M.dateTimePickerToolbarTitle,D=I.useMemo(()=>i?u?b.formatByString(i,u):b.format(i,"shortDate"):c,[i,u,c,b]);return(0,_.jsxs)($I,(0,oU.A)({isLandscape:s,className:(0,O.A)(k.root,m),toolbarTitle:T},v,{ownerState:x,children:[(0,_.jsxs)($D,{className:k.dateContainer,ownerState:x,children:[d.includes("year")&&(0,_.jsx)($x,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:"year"===a,value:i?b.format(i,"year"):"–"}),d.includes("day")&&(0,_.jsx)($x,{tabIndex:-1,variant:C?"h5":"h4",onClick:()=>l("day"),selected:"day"===a,value:D})]}),(0,_.jsxs)($O,{className:k.timeContainer,ownerState:x,children:[(0,_.jsxs)($R,{className:k.timeDigitsContainer,ownerState:x,children:[d.includes("hours")&&(0,_.jsxs)(I.Fragment,{children:[(0,_.jsx)($x,{variant:C?"h5":"h3",width:C&&!s?48:void 0,onClick:()=>l("hours"),selected:"hours"===a,value:i?n?b.format(i,"hours12h"):b.format(i,"hours24h"):"--"}),(0,_.jsx)($E,{variant:C?"h5":"h3",value:":",className:k.separator,ownerState:x}),(0,_.jsx)($x,{variant:C?"h5":"h3",width:C&&!s?48:void 0,onClick:()=>l("minutes"),selected:"minutes"===a||!d.includes("minutes")&&"hours"===a,value:i?b.format(i,"minutes"):"--",disabled:!d.includes("minutes")})]}),d.includes("seconds")&&(0,_.jsxs)(I.Fragment,{children:[(0,_.jsx)($E,{variant:C?"h5":"h3",value:":",className:k.separator,ownerState:x}),(0,_.jsx)($x,{variant:C?"h5":"h3",width:C&&!s?48:void 0,onClick:()=>l("seconds"),selected:"seconds"===a,value:i?b.format(i,"seconds"):"--"})]})]}),A&&!C&&(0,_.jsxs)($P,{className:k.ampmSelection,ownerState:x,children:[(0,_.jsx)($x,{variant:"subtitle2",selected:"am"===w,typographyClassName:k.ampmLabel,value:HL(b,"am"),onClick:p?void 0:()=>S("am"),disabled:h}),(0,_.jsx)($x,{variant:"subtitle2",selected:"pm"===w,typographyClassName:k.ampmLabel,value:HL(b,"pm"),onClick:p?void 0:()=>S("pm"),disabled:h})]}),n&&C&&(0,_.jsx)($x,{variant:"h5",onClick:()=>l("meridiem"),selected:"meridiem"===a,value:i&&w?HL(b,w):"--",width:48})]})]}))}function $N(e){return(0,V.Ay)("MuiPickersArrowSwitcher",e)}(0,j.A)("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);let $B=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],$z=["ownerState"],$F=["ownerState"],$j=(0,N.A)("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),$V=(0,N.A)("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),$H=(0,N.A)(eA,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),$$=I.forwardRef(function(e,t){let n=(0,fj.I)(),r=Hw({props:e,name:"MuiPickersArrowSwitcher"}),{children:i,className:o,slots:a,slotProps:s,isNextDisabled:l,isNextHidden:u,onGoToNext:c,nextLabel:d,isPreviousDisabled:h,isPreviousHidden:p,onGoToPrevious:f,previousLabel:g,labelId:m}=r,v=(0,zD.A)(r,$B),y=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},$N,t)})(r),x=a?.previousIconButton??$H,b=(0,mG.A)({elementType:x,externalSlotProps:s?.previousIconButton,additionalProps:{size:"medium",title:g,"aria-label":g,disabled:h,edge:"end",onClick:f},ownerState:(0,oU.A)({},r,{hidden:p}),className:(0,O.A)(y.button,y.previousIconButton)}),w=a?.nextIconButton??$H,S=(0,mG.A)({elementType:w,externalSlotProps:s?.nextIconButton,additionalProps:{size:"medium",title:d,"aria-label":d,disabled:l,edge:"start",onClick:c},ownerState:(0,oU.A)({},r,{hidden:u}),className:(0,O.A)(y.button,y.nextIconButton)}),A=a?.leftArrowIcon??H9,C=(0,mG.A)({elementType:A,externalSlotProps:s?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:r,className:y.leftArrowIcon}),M=(0,zD.A)(C,$z),k=a?.rightArrowIcon??H7,T=(0,mG.A)({elementType:k,externalSlotProps:s?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:r,className:y.rightArrowIcon}),I=(0,zD.A)(T,$F);return(0,_.jsxs)($j,(0,oU.A)({ref:t,className:(0,O.A)(y.root,o),ownerState:r},v,{children:[(0,_.jsx)(x,(0,oU.A)({},b,{children:n?(0,_.jsx)(k,(0,oU.A)({},I)):(0,_.jsx)(A,(0,oU.A)({},M))})),i?(0,_.jsx)(u7.A,{variant:"subtitle1",component:"span",id:m,children:i}):(0,_.jsx)($V,{className:y.spacer,ownerState:r}),(0,_.jsx)(w,(0,oU.A)({},S,{children:n?(0,_.jsx)(A,(0,oU.A)({},M)):(0,_.jsx)(k,(0,oU.A)({},I))}))]}))});function $W({onChange:e,onViewChange:t,openTo:n,view:r,views:i,autoFocus:o,focusedView:a,onFocusedViewChange:s}){let l=I.useRef(n),u=I.useRef(i),c=I.useRef(i.includes(n)?n:i[0]),[d,h]=(0,yl.A)({name:"useViews",state:"view",controlled:r,default:c.current}),p=I.useRef(o?d:null),[f,g]=(0,yl.A)({name:"useViews",state:"focusedView",controlled:a,default:p.current});I.useEffect(()=>{(l.current&&l.current!==n||u.current&&u.current.some(e=>!i.includes(e)))&&(h(i.includes(n)?n:i[0]),u.current=i,l.current=n)},[n,h,d,i]);let m=i.indexOf(d),v=i[m-1]??null,y=i[m+1]??null,x=(0,yu.A)((e,t)=>{t?g(e):g(t=>e===t?null:t),s?.(e,t)}),b=(0,yu.A)(e=>{x(e,!0),e!==d&&(h(e),t&&t(e))}),w=(0,yu.A)(()=>{y&&b(y)}),S=(0,yu.A)((t,n,r)=>{let o="finish"===n,a=r?i.indexOf(r)<i.length-1:!!y;if(e(t,o&&a?"partial":n,r),r&&r!==d){let e=i[i.indexOf(r)+1];e&&b(e)}else o&&w()});return{view:d,setView:b,focusedView:f,setFocusedView:x,nextView:y,previousView:v,defaultView:i.includes(n)?n:i[0],goToNextView:w,setValueAndGoToNextView:S}}let $G=(0,N.A)("div")({overflow:"hidden",width:320,maxHeight:336,display:"flex",flexDirection:"column",margin:"0 auto"});function $U(e){return(0,V.Ay)("MuiTimeClock",e)}function $q(e){return(0,V.Ay)("MuiClockPointer",e)}(0,j.A)("MuiTimeClock",["root","arrowSwitcher"]),(0,j.A)("MuiClockPointer",["root","thumb"]);let $Y=["className","hasSelected","isInner","type","viewValue"],$X=(0,N.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"])}}]})),$Z=(0,N.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 $K(e){let t,n=Hw({props:e,name:"MuiClockPointer"}),{className:r,isInner:i,type:o,viewValue:a}=n,s=(0,zD.A)(n,$Y),l=I.useRef(o);I.useEffect(()=>{l.current=o},[o]);let u=(0,oU.A)({},n,{shouldAnimate:l.current!==o}),c=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"],thumb:["thumb"]},$q,t)})(u);return(0,_.jsx)($X,(0,oU.A)({style:(t=360/("hours"===o?12:60)*a,"hours"===o&&a>12&&(t-=360),{height:Math.round((i?.26:.4)*220),transform:`rotateZ(${t}deg)`}),className:(0,O.A)(c.root,r),ownerState:u},s,{children:(0,_.jsx)($Z,{ownerState:u,className:c.thumb})}))}let $Q=110,$J=110,$0=$Q,$1=0,$2=$0-$Q,$5=$1-$J,$4=(e,t,n)=>{let r=t-$Q,i=n-$J,o=180/Math.PI*(Math.atan2($2,$5)-Math.atan2(r,i));return{value:Math.floor((o=Math.round(o/e)*e%360)/e)||0,distance:Math.sqrt(r**2+i**2)}};function $3(e){return(0,V.Ay)("MuiClock",e)}(0,j.A)("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);let $6=(0,N.A)("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)})),$8=(0,N.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"}),$9=(0,N.A)("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),$7=(0,N.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"}}}]}),We=(0,N.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%)"})),Wt=(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}}}]}),Wn=(0,N.A)(eA,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})(({theme:e})=>(0,oU.A)({},Wt(e,"am"),{position:"absolute",left:8})),Wr=(0,N.A)(eA,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})(({theme:e})=>(0,oU.A)({},Wt(e,"pm"),{position:"absolute",right:8})),Wi=(0,N.A)(u7.A,{name:"MuiClock",slot:"meridiemText",overridesResolver:(e,t)=>t.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function Wo(e){let t=Hw({props:e,name:"MuiClock"}),{ampm:n,ampmInClock:r,autoFocus:i,children:o,value:a,handleMeridiemChange:s,isTimeDisabled:l,meridiemMode:u,minutesStep:c=1,onChange:d,selectedId:h,type:p,viewValue:f,viewRange:[g,m],disabled:v=!1,readOnly:y,className:x}=t,b=H_().utils,w=H_().localeText,S=I.useRef(!1),A=(e=>{let{classes:t,meridiemMode:n}=e;return(0,R.A)({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton","am"===n&&"selected"],pmButton:["pmButton","pm"===n&&"selected"],meridiemText:["meridiemText"]},$3,t)})(t),C=l(f,p),M=!n&&"hours"===p&&(f<1||f>12),k=(e,t)=>{v||y||l(e,p)||d(e,t)},T=(e,t)=>{let{offsetX:r,offsetY:i}=e;if(void 0===r){let t=e.target.getBoundingClientRect();r=e.changedTouches[0].clientX-t.left,i=e.changedTouches[0].clientY-t.top}k("seconds"===p||"minutes"===p?((e,t,n=1)=>{let{value:r}=$4(6*n,e,t);return r*n%60})(r,i,c):((e,t,n)=>{let{value:r,distance:i}=$4(30,e,t),o=r||12;return n?o%=12:i<74&&(o+=12,o%=24),o})(r,i,!!n),t)},D=e=>{S.current=!0,T(e,"shallow")},E=I.useMemo(()=>"hours"===p||f%5==0,[p,f]),P="minutes"===p?c:1,L=I.useRef(null);(0,gK.A)(()=>{i&&L.current.focus()},[i]);let N=e=>Math.max(g,Math.min(m,e)),B=e=>(e+(m+1))%(m+1);return(0,_.jsxs)($6,{className:(0,O.A)(A.root,x),children:[(0,_.jsxs)($8,{className:A.clock,children:[(0,_.jsx)($7,{onTouchMove:D,onTouchStart:D,onTouchEnd:e=>{S.current&&(T(e,"finish"),S.current=!1),e.preventDefault()},onMouseUp:e=>{S.current&&(S.current=!1),T(e.nativeEvent,"finish")},onMouseMove:e=>{e.buttons>0&&T(e.nativeEvent,"shallow")},ownerState:{disabled:v},className:A.squareMask}),!C&&(0,_.jsxs)(I.Fragment,{children:[(0,_.jsx)(We,{className:A.pin}),null!=a&&(0,_.jsx)($K,{type:p,viewValue:f,isInner:M,hasSelected:E})]}),(0,_.jsx)($9,{"aria-activedescendant":h,"aria-label":w.clockLabelText(p,a,b,null==a?null:b.format(a,"fullTime")),ref:L,role:"listbox",onKeyDown:e=>{if(!S.current)switch(e.key){case"Home":k(g,"partial"),e.preventDefault();break;case"End":k(m,"partial"),e.preventDefault();break;case"ArrowUp":k(B(f+P),"partial"),e.preventDefault();break;case"ArrowDown":k(B(f-P),"partial"),e.preventDefault();break;case"PageUp":k(N(f+5),"partial"),e.preventDefault();break;case"PageDown":k(N(f-5),"partial"),e.preventDefault();break;case"Enter":case" ":k(f,"finish"),e.preventDefault()}},tabIndex:0,className:A.wrapper,children:o})]}),n&&r&&(0,_.jsxs)(I.Fragment,{children:[(0,_.jsx)(Wn,{onClick:y?void 0:()=>s("am"),disabled:v||null===u,ownerState:t,className:A.amButton,title:HL(b,"am"),children:(0,_.jsx)(Wi,{variant:"caption",className:A.meridiemText,children:HL(b,"am")})}),(0,_.jsx)(Wr,{disabled:v||null===u,onClick:y?void 0:()=>s("pm"),ownerState:t,className:A.pmButton,title:HL(b,"pm"),children:(0,_.jsx)(Wi,{variant:"caption",className:A.meridiemText,children:HL(b,"pm")})})]})]})}function Wa(e){return(0,V.Ay)("MuiClockNumber",e)}let Ws=(0,j.A)("MuiClockNumber",["root","selected","disabled"]),Wl=["className","disabled","index","inner","label","selected"],Wu=(0,N.A)("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${Ws.disabled}`]:t.disabled},{[`&.${Ws.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},[`&.${Ws.selected}`]:{color:(e.vars||e).palette.primary.contrastText},[`&.${Ws.disabled}`]:{pointerEvents:"none",color:(e.vars||e).palette.text.disabled},variants:[{props:{inner:!0},style:(0,oU.A)({},e.typography.body2,{color:(e.vars||e).palette.text.secondary})}]}));function Wc(e){let t=Hw({props:e,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:a,selected:s}=t,l=(0,zD.A)(t,Wl),u=(e=>{let{classes:t,selected:n,disabled:r}=e;return(0,R.A)({root:["root",n&&"selected",r&&"disabled"]},Wa,t)})(t),c=i%12/12*Math.PI*2-Math.PI/2,d=91*(o?.65:1),h=Math.round(Math.cos(c)*d),p=Math.round(Math.sin(c)*d);return(0,_.jsx)(Wu,(0,oU.A)({className:(0,O.A)(u.root,n),"aria-disabled":!!r||void 0,"aria-selected":!!s||void 0,role:"option",style:{transform:`translate(${h}px, ${p+92}px`},ownerState:t},l,{children:a}))}let Wd=({utils:e,value:t,isDisabled:n,getClockNumberText:r,selectedId:i})=>{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,_.jsx)(Wc,{label:o,id:s?i:void 0,index:a+1,inner:!1,disabled:n(e),selected:s,"aria-label":r(o)},e)})},Wh=({timezone:e,value:t,defaultValue:n,referenceDate:r,onChange:i,valueManager:o})=>{let a,s=H_().utils,l=I.useRef(n),u=t??l.current??o.emptyValue,c=I.useMemo(()=>o.getTimezone(s,u),[s,o,u]),d=(0,yu.A)(e=>null==c?e:o.setTimezone(s,c,e));return a=e||c||(r?s.getTimezone(r):"default"),{value:I.useMemo(()=>o.setTimezone(s,a,u),[o,s,a,u]),handleValueChange:(0,yu.A)((e,...t)=>{let n=d(e);i?.(n,...t)}),timezone:a}},Wp=({name:e,timezone:t,value:n,defaultValue:r,referenceDate:i,onChange:o,valueManager:a})=>{let[s,l]=(0,yl.A)({name:e,state:"value",controlled:n,default:r??a.emptyValue});return Wh({timezone:t,value:s,defaultValue:void 0,referenceDate:i,onChange:(0,yu.A)((e,...t)=>{l(e),o?.(e,...t)}),valueManager:a})},Wf={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},Wg=(e,t,n)=>{if(t===Wf.year)return e.startOfYear(n);if(t===Wf.month)return e.startOfMonth(n);if(t===Wf.day)return e.startOfDay(n);let r=n;return t<Wf.minutes&&(r=e.setMinutes(r,0)),t<Wf.seconds&&(r=e.setSeconds(r,0)),t<Wf.milliseconds&&(r=e.setMilliseconds(r,0)),r},Wm=(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.
71
+ 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}},Wv=(e,t)=>{let n=[],r=e.date(void 0,"default"),i=e.startOfWeek(r),o=e.endOfWeek(r),a=i;for(;e.isBefore(a,o);)n.push(a),a=e.addDays(a,1);return n.map(n=>e.formatByString(n,t))},Wy=(e,t,n,r)=>{switch(n){case"month":return HE(e,e.date(void 0,t)).map(t=>e.formatByString(t,r));case"weekDay":return Wv(e,r);case"meridiem":{let n=e.date(void 0,t);return[e.startOfDay(n),e.endOfDay(n)].map(t=>e.formatByString(t,r))}default:return[]}},Wx=["0","1","2","3","4","5","6","7","8","9"],Wb=(e,t)=>{if("0"===t[0])return e;let n=[],r="";for(let i=0;i<e.length;i+=1){r+=e[i];let o=t.indexOf(r);o>-1&&(n.push(o.toString()),r="")}return n.join("")},Ww=(e,t)=>"0"===t[0]?e:e.split("").map(e=>t[Number(e)]).join(""),WS=(e,t)=>{let n=Wb(e,t);return" "!==n&&!Number.isNaN(Number(n))},WA=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},WC=(e,t,n,r,i)=>{if("day"===i.type&&"digit-with-letter"===i.contentType){let r=e.setDate(n.longestMonth,t);return e.formatByString(r,i.format)}let o=t.toString();return i.hasLeadingZerosInInput&&(o=WA(o,i.maxLength)),Ww(o,r)},WM=(e,t,n)=>{let r=e.value||e.placeholder,i="non-input"===t?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return"non-input"===t&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number(Wb(r,n)).toString()),["input-rtl","input-ltr"].includes(t)&&"digit"===e.contentType&&!i&&1===r.length&&(r=`${r}\u200e`),"input-rtl"===t&&(r=`\u2068${r}\u2069`),r},Wk=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),WT=(e,t,n,r)=>{if("digit"!==t)return!1;let i=e.date(void 0,"default");switch(n){case"year":if("dayjs"===e.lib&&"YY"===r)return!0;return e.formatByString(e.setYear(i,1),r).startsWith("0");case"month":return e.formatByString(e.startOfYear(i),r).length>1;case"day":return e.formatByString(e.startOfMonth(i),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(i),r).length>1;case"hours":return e.formatByString(e.setHours(i,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(i,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(i,1),r).length>1;default:throw Error("Invalid section type")}},W_=(e,t)=>{},WI={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},WD=(e,t,n,r,i)=>[...n].sort((e,t)=>WI[e.type]-WI[t.type]).reduce((n,r)=>!i||r.modified?((e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{let r=Wv(e,t.format),i=e.formatByString(n,t.format),o=r.indexOf(i),a=r.indexOf(t.value);return e.addDays(n,a-o)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{let t=12>e.getHours(n),i=e.getHours(r);if(t&&i>=12)return e.addHours(r,-12);if(!t&&i<12)return e.addHours(r,12);return r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}})(e,r,t,n):n,r),WO=(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},WR=["value","referenceDate"],WE={emptyValue:null,getTodayValue:HP,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=(0,zD.A)(e,WR);return null!=t&&r.utils.isValid(t)?t:null!=n?n:(({props:e,utils:t,granularity:n,timezone:r,getTodayDate:i})=>{let o=i?i():Wg(t,n,HP(t,r));null!=e.minDate&&t.isAfterDay(e.minDate,o)&&(o=Wg(t,n,e.minDate)),null!=e.maxDate&&t.isBeforeDay(e.maxDate,o)&&(o=Wg(t,n,e.maxDate));let a=$k(e.disableIgnoringDatePartForTimeValidation??!1,t);return null!=e.minTime&&a(e.minTime,o)&&(o=Wg(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:HD(t,o,e.minTime))),null!=e.maxTime&&a(o,e.maxTime)&&(o=Wg(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:HD(t,o,e.maxTime))),o})(r)},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)},WP={updateReferenceValue:(e,t,n)=>null!=t&&e.isValid(t)?t:n,getSectionsFromValue:(e,t,n,r)=>!e.isValid(t)&&n?n:r(t),getV7HiddenInputValueFromSections:e=>e.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),getV6InputValueFromSections:(e,t,n)=>{let r=e.map(e=>{let r=WM(e,n?"input-rtl":"input-ltr",t);return`${e.startSeparator}${r}${e.endSeparator}`}).join("");return n?`\u2066${r}\u2069`:r},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)},WL=["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"],WN=(0,N.A)($G,{name:"MuiTimeClock",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",position:"relative"}),WB=(0,N.A)($$,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),Wz=["hours","minutes"],WF=I.forwardRef(function(e,t){let n=H_().utils,r=Hw({props:e,name:"MuiTimeClock"}),{ampm:i=n.is12HourCycleInCurrentLocale(),ampmInClock:o=!1,autoFocus:a,slots:s,slotProps:l,value:u,defaultValue:c,referenceDate:d,disableIgnoringDatePartForTimeValidation:h=!1,maxTime:p,minTime:f,disableFuture:g,disablePast:m,minutesStep:v=1,shouldDisableTime:y,showViewSwitcher:x,onChange:b,view:w,views:S=Wz,openTo:A,onViewChange:C,focusedView:M,onFocusedViewChange:k,className:T,disabled:D,readOnly:E,timezone:P}=r,L=(0,zD.A)(r,WL),{value:N,handleValueChange:B,timezone:z}=Wp({name:"TimeClock",timezone:P,value:u,defaultValue:c,referenceDate:d,onChange:b,valueManager:WE}),F=(({value:e,referenceDate:t,utils:n,props:r,timezone:i})=>{let o=I.useMemo(()=>WE.getInitialReferenceValue({value:e,utils:n,props:r,referenceDate:t,granularity:Wf.day,timezone:i,getTodayDate:()=>HP(n,i,"date")}),[]);return e??o})({value:N,referenceDate:d,utils:n,props:r,timezone:z}),j=H_().localeText,V=HI(z),{view:H,setView:$,previousView:W,nextView:G,setValueAndGoToNextView:U}=$W({view:w,views:S,openTo:A,onViewChange:C,onChange:B,focusedView:M,onFocusedViewChange:k}),{meridiemMode:q,handleMeridiemChange:Y}=$T(F,i,U),X=I.useCallback((e,t)=>{let r=$k(h,n),o="hours"===t||"minutes"===t&&S.includes("seconds"),a=({start:e,end:t})=>!(f&&r(f,t)||p&&r(e,p)||g&&r(e,V)||m&&r(V,o?t:e)),s=(e,r=1)=>{if(e%r!=0)return!1;if(y)switch(t){case"hours":return!y(n.setHours(F,e),"hours");case"minutes":return!y(n.setMinutes(F,e),"minutes");case"seconds":return!y(n.setSeconds(F,e),"seconds");default:return!1}return!0};switch(t){case"hours":{let t=$C(e,q,i),r=n.setHours(F,t);if(n.getHours(r)!==t)return!0;return!a({start:n.setSeconds(n.setMinutes(r,0),0),end:n.setSeconds(n.setMinutes(r,59),59)})||!s(t)}case"minutes":{let t=n.setMinutes(F,e);return!a({start:n.setSeconds(t,0),end:n.setSeconds(t,59)})||!s(e,v)}case"seconds":{let t=n.setSeconds(F,e);return!a({start:t,end:t})||!s(e)}default:throw Error("not supported")}},[i,F,h,p,q,f,v,y,n,g,m,V,S]),Z=(0,vL.A)(),K=I.useMemo(()=>{switch(H){case"hours":{let e,t=(e,t)=>{let r=$C(e,q,i);U(n.setHours(F,r),t,"hours")},r=n.getHours(F);return e=i?r>12?[12,23]:[0,11]:[0,23],{onChange:t,viewValue:r,children:(({ampm:e,value:t,getClockNumberText:n,isDisabled:r,selectedId:i,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,_.jsx)(Wc,{id:u?i:void 0,index:t,inner:l,selected:u,disabled:r(t),label:a,"aria-label":n(a)},t))}return s})({value:N,utils:n,ampm:i,onChange:t,getClockNumberText:j.hoursClockNumberText,isDisabled:e=>D||X(e,"hours"),selectedId:Z}),viewRange:e}}case"minutes":{let e=n.getMinutes(F),t=(e,t)=>{U(n.setMinutes(F,e),t,"minutes")};return{viewValue:e,onChange:t,children:Wd({utils:n,value:e,onChange:t,getClockNumberText:j.minutesClockNumberText,isDisabled:e=>D||X(e,"minutes"),selectedId:Z}),viewRange:[0,59]}}case"seconds":{let e=n.getSeconds(F),t=(e,t)=>{U(n.setSeconds(F,e),t,"seconds")};return{viewValue:e,onChange:t,children:Wd({utils:n,value:e,onChange:t,getClockNumberText:j.secondsClockNumberText,isDisabled:e=>D||X(e,"seconds"),selectedId:Z}),viewRange:[0,59]}}default:throw Error("You must provide the type for ClockView")}},[H,n,N,i,j.hoursClockNumberText,j.minutesClockNumberText,j.secondsClockNumberText,q,U,F,X,Z,D]),Q=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"],arrowSwitcher:["arrowSwitcher"]},$U,t)})(r);return(0,_.jsxs)(WN,(0,oU.A)({ref:t,className:(0,O.A)(Q.root,T),ownerState:r},L,{children:[(0,_.jsx)(Wo,(0,oU.A)({autoFocus:a??!!M,ampmInClock:o&&S.includes("hours"),value:N,type:H,ampm:i,minutesStep:v,isTimeDisabled:X,meridiemMode:q,handleMeridiemChange:Y,selectedId:Z,disabled:D,readOnly:E},K)),x&&(0,_.jsx)(WB,{className:Q.arrowSwitcher,slots:s,slotProps:l,onGoToPrevious:()=>$(W),isPreviousDisabled:!W,previousLabel:j.openPreviousView,onGoToNext:()=>$(G),isNextDisabled:!G,nextLabel:j.openNextView,ownerState:r})]}))}),Wj=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:S,sx:A,autoFocus:C,showViewSwitcher:M,disableIgnoringDatePartForTimeValidation:k,timezone:T})=>(0,_.jsx)(WF,{view:e,onViewChange:t,focusedView:n&&$A(n)?n:null,onFocusedViewChange:r,views:i.filter($A),value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:d,disablePast:h,minTime:p,maxTime:f,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:S,sx:A,autoFocus:C,showViewSwitcher:M,disableIgnoringDatePartForTimeValidation:k,timezone:T}),WV=({props:e,value:t,timezone:n,adapter:r})=>{if(null===t)return null;let{shouldDisableDate:i,shouldDisableMonth:o,shouldDisableYear:a,disablePast:s,disableFuture:l}=e,u=r.utils.date(void 0,n),c=HR(r.utils,e.minDate,r.defaultDates.minDate),d=HR(r.utils,e.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(t):return"invalidDate";case!!(i&&i(t)):return"shouldDisableDate";case!!(o&&o(t)):return"shouldDisableMonth";case!!(a&&a(t)):return"shouldDisableYear";case!!(l&&r.utils.isAfterDay(t,u)):return"disableFuture";case!!(s&&r.utils.isBeforeDay(t,u)):return"disablePast";case!!(c&&r.utils.isBeforeDay(t,c)):return"minDate";case!!(d&&r.utils.isAfterDay(t,d)):return"maxDate";default:return null}};WV.valueManager=WE;let WH=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:a,timezone:s})=>{let l=H_();return I.useCallback(u=>null!==WV({adapter:l,value:u,timezone:s,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:a}}),[l,e,t,n,r,i,o,a,s])};var W$=n(44394);let WW=e=>(0,V.Ay)("MuiPickersFadeTransitionGroup",e);(0,j.A)("MuiPickersFadeTransitionGroup",["root"]);let WG=(0,N.A)(W$.A,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function WU(e){let t=Hw({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=t,a=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"]},WW,t)})(t),s=(0,uH.A)();return i?n:(0,_.jsx)(WG,{className:(0,O.A)(a.root,r),children:(0,_.jsx)(vB.A,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:s.transitions.duration.enteringScreen,enter:s.transitions.duration.enteringScreen,exit:0},children:n},o)})}function Wq(e){return(0,V.Ay)("MuiPickersDay",e)}let WY=(0,j.A)("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),WX=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],WZ=({theme:e})=>(0,oU.A)({},e.typography.caption,{width:36,height:36,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,E.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,E.X4)(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${WY.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${WY.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}},[`&.${WY.disabled}:not(.${WY.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${WY.disabled}&.${WY.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(.${WY.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),WK=(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]},WQ=(0,N.A)(K.A,{name:"MuiPickersDay",slot:"Root",overridesResolver:WK})(WZ),WJ=(0,N.A)("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:WK})(({theme:e})=>(0,oU.A)({},WZ({theme:e}),{opacity:0,pointerEvents:"none"})),W0=()=>{},W1=I.forwardRef(function(e,t){let n=Hw({props:e,name:"MuiPickersDay"}),{autoFocus:r=!1,className:i,day:o,disabled:a=!1,disableHighlightToday:s=!1,disableMargin:l=!1,isAnimating:u,onClick:c,onDaySelect:d,onFocus:h=W0,onBlur:p=W0,onKeyDown:f=W0,onMouseDown:g=W0,onMouseEnter:m=W0,outsideCurrentMonth:v,selected:y=!1,showDaysOutsideCurrentMonth:x=!1,children:b,today:w=!1}=n,S=(0,zD.A)(n,WX),A=(0,oU.A)({},n,{autoFocus:r,disabled:a,disableHighlightToday:s,disableMargin:l,selected:y,showDaysOutsideCurrentMonth:x,today:w}),C=(e=>{let{selected:t,disableMargin:n,disableHighlightToday:r,today:i,disabled:o,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:s,classes:l}=e,u=a&&!s;return(0,R.A)({root:["root",t&&!u&&"selected",o&&"disabled",!n&&"dayWithMargin",!r&&i&&"today",a&&s&&"dayOutsideMonth",u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},Wq,l)})(A),M=H_().utils,k=I.useRef(null),T=(0,gZ.A)(k,t);return((0,gK.A)(()=>{!r||a||u||v||k.current.focus()},[r,a,u,v]),v&&!x)?(0,_.jsx)(WJ,{className:(0,O.A)(C.root,C.hiddenDaySpacingFiller,i),ownerState:A,role:S.role}):(0,_.jsx)(WQ,(0,oU.A)({className:(0,O.A)(C.root,i),ref:T,centerRipple:!0,disabled:a,tabIndex:y?0:-1,onKeyDown:e=>f(e,o),onFocus:e=>h(e,o),onBlur:e=>p(e,o),onMouseEnter:e=>m(e,o),onClick:e=>{a||d(o),v&&e.currentTarget.focus(),c&&c(e)},onMouseDown:e=>{g(e),v&&e.preventDefault()}},S,{ownerState:A,children:b||M.format(o,"dayOfMonth")}))}),W2=I.memo(W1);var W5=n(7490);function W4(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var W3=n(64863),W6=function(e,t){return e&&t&&t.split(" ").forEach(function(t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=W4(e.className,t):e.setAttribute("class",W4(e.className&&e.className.baseVal||"",t))})},W8=function(e){function t(){for(var t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1];t.removeClasses(i,"exit"),t.addClass(i,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1];t.addClass(i,o?"appear":"enter","active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1]?"appear":"enter";t.removeClasses(i,o),t.addClass(i,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,r="string"==typeof n,i=r&&n?n+"-":"",o=r?""+i+e:n[e],a=r?o+"-active":n[e+"Active"],s=r?o+"-done":n[e+"Done"];return{baseClassName:o,activeClassName:a,doneClassName:s}},t}(0,W5.A)(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r,i=this.getClassNames(t)[n+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&o&&(i+=" "+o),"active"===n&&e&&(0,W3.F)(e),i&&(this.appliedClasses[t][n]=i,r=i,e&&r&&r.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],r=n.base,i=n.active,o=n.done;this.appliedClasses[t]={},r&&W6(e,r),i&&W6(e,i),o&&W6(e,o)},n.render=function(){var e=this.props,t=(e.classNames,(0,zD.A)(e,["classNames"]));return D().createElement(xQ.Ay,(0,oU.A)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(D().Component);W8.defaultProps={classNames:""},W8.propTypes={};let W9=e=>(0,V.Ay)("MuiPickersSlideTransition",e),W7=(0,j.A)("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),Ge=["children","className","reduceAnimations","slideDirection","transKey","classes"],Gt=(0,N.A)(W$.A,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${W7["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${W7["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${W7.slideEnterActive}`]:t.slideEnterActive},{[`.${W7.slideExit}`]:t.slideExit},{[`.${W7["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${W7["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},[`& .${W7["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${W7["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${W7.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${W7.slideExit}`]:{transform:"translate(0%)"},[`& .${W7["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${W7["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}}),Gn=e=>(0,V.Ay)("MuiDayCalendar",e);(0,j.A)("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);let Gr=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],Gi=["ownerState"],Go=(0,N.A)("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Ga=(0,N.A)("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),Gs=(0,N.A)(u7.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})),Gl=(0,N.A)(u7.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})),Gu=(0,N.A)(u7.A,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>(0,oU.A)({},e.typography.caption,{width:36,height:36,padding:0,margin:"0 2px",color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),Gc=(0,N.A)("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:240}),Gd=(0,N.A)(function(e){let t=Hw({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:i,transKey:o}=t,a=(0,zD.A)(t,Ge),s=(e=>{let{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return(0,R.A)(r,W9,t)})(t),l=(0,uH.A)();if(i)return(0,_.jsx)("div",{className:(0,O.A)(s.root,r),children:n});let u={exit:s.exit,enterActive:s.enterActive,enter:s.enter,exitActive:s.exitActive};return(0,_.jsx)(Gt,{className:(0,O.A)(s.root,r),childFactory:e=>I.cloneElement(e,{classNames:u}),role:"presentation",children:(0,_.jsx)(W8,(0,oU.A)({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:u},a,{children:n}),o)})},{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:240}),Gh=(0,N.A)("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),Gp=(0,N.A)("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:"2px 0",display:"flex",justifyContent:"center"});function Gf(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:i,isDateDisabled:o,currentMonthNumber:a,isViewFocused:s}=e,l=(0,zD.A)(e,Gr),{disabled:u,disableHighlightToday:c,isMonthSwitchingAnimating:d,showDaysOutsideCurrentMonth:h,slots:p,slotProps:f,timezone:g}=t,m=H_().utils,v=HI(g),y=null!==r&&m.isSameDay(n,r),x=i.some(e=>m.isSameDay(e,n)),b=m.isSameDay(n,v),w=p?.day??W2,S=(0,mG.A)({elementType:w,externalSlotProps:f?.day,additionalProps:(0,oU.A)({disableHighlightToday:c,showDaysOutsideCurrentMonth:h,role:"gridcell",isAnimating:d,"data-timestamp":m.toJsDate(n).valueOf()},l),ownerState:(0,oU.A)({},t,{day:n,selected:x})}),A=(0,zD.A)(S,Gi),C=I.useMemo(()=>u||o(n),[u,o,n]),M=I.useMemo(()=>m.getMonth(n)!==a,[m,n,a]),k=I.useMemo(()=>{let e=m.startOfMonth(m.setMonth(n,a));return h?m.isSameDay(n,m.startOfWeek(e)):m.isSameDay(n,e)},[a,n,h,m]),T=I.useMemo(()=>{let e=m.endOfMonth(m.setMonth(n,a));return h?m.isSameDay(n,m.endOfWeek(e)):m.isSameDay(n,e)},[a,n,h,m]);return(0,_.jsx)(w,(0,oU.A)({},A,{day:n,disabled:C,autoFocus:s&&y,today:b,outsideCurrentMonth:M,isFirstVisibleCell:k,isLastVisibleCell:T,selected:x,tabIndex:y?0:-1,"aria-selected":x,"aria-current":b?"date":void 0}))}function Gg(e){let t,n=Hw({props:e,name:"MuiDayCalendar"}),r=H_().utils,{onFocusedDayChange:i,className:o,currentMonth:a,selectedDays:s,focusedDay:l,loading:u,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:d,readOnly:h,reduceAnimations:p,renderLoading:f=()=>(0,_.jsx)("span",{children:"..."}),slideDirection:g,TransitionProps:m,disablePast:v,disableFuture:y,minDate:x,maxDate:b,shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:A,dayOfWeekFormatter:C=e=>r.format(e,"weekdayShort").charAt(0).toUpperCase(),hasFocus:M,onFocusedViewChange:k,gridLabelId:T,displayWeekNumber:D,fixedWeekNumber:E,autoFocus:P,timezone:L}=n,N=HI(L),B=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},Gn,t)})(n),z=(0,fj.I)(),F=WH({shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:A,minDate:x,maxDate:b,disablePast:v,disableFuture:y,timezone:L}),j=H_().localeText,[V,H]=(0,yl.A)({name:"DayCalendar",state:"hasFocus",controlled:M,default:P??!1}),[$,W]=I.useState(()=>l||N),G=(0,yu.A)(e=>{h||c(e)}),U=e=>{F(e)||(i(e),W(e),k?.(!0),H(!0))},q=(0,yu.A)((e,t)=>{switch(e.key){case"ArrowUp":U(r.addDays(t,-7)),e.preventDefault();break;case"ArrowDown":U(r.addDays(t,7)),e.preventDefault();break;case"ArrowLeft":{let n=r.addDays(t,z?1:-1),i=r.addMonths(t,z?1:-1);U(HO({utils:r,date:n,minDate:z?n:r.startOfMonth(i),maxDate:z?r.endOfMonth(i):n,isDateDisabled:F,timezone:L})||n),e.preventDefault();break}case"ArrowRight":{let n=r.addDays(t,z?-1:1),i=r.addMonths(t,z?-1:1);U(HO({utils:r,date:n,minDate:z?r.startOfMonth(i):n,maxDate:z?n:r.endOfMonth(i),isDateDisabled:F,timezone:L})||n),e.preventDefault();break}case"Home":U(r.startOfWeek(t)),e.preventDefault();break;case"End":U(r.endOfWeek(t)),e.preventDefault();break;case"PageUp":U(r.addMonths(t,1)),e.preventDefault();break;case"PageDown":U(r.addMonths(t,-1)),e.preventDefault()}}),Y=(0,yu.A)((e,t)=>U(t)),X=(0,yu.A)((e,t)=>{V&&r.isSameDay($,t)&&k?.(!1)}),Z=r.getMonth(a),K=r.getYear(a),Q=I.useMemo(()=>s.filter(e=>!!e).map(e=>r.startOfDay(e)),[r,s]),J=`${K}-${Z}`,ee=I.useMemo(()=>I.createRef(),[J]),et=I.useMemo(()=>{let e=r.startOfMonth(a),t=r.endOfMonth(a);return F($)||r.isAfterDay($,t)||r.isBeforeDay($,e)?HO({utils:r,date:$,minDate:e,maxDate:t,disablePast:v,disableFuture:y,isDateDisabled:F,timezone:L}):$},[a,y,v,$,F,r,L]),en=I.useMemo(()=>{let e=r.getWeekArray(a),t=r.addMonths(a,1);for(;E&&e.length<E;){let n=r.getWeekArray(t),i=r.isSameDay(e[e.length-1][0],n[0][0]);n.slice(+!!i).forEach(t=>{e.length<E&&e.push(t)}),t=r.addMonths(t,1)}return e},[a,E,r]);return(0,_.jsxs)(Go,{role:"grid","aria-labelledby":T,className:B.root,children:[(0,_.jsxs)(Ga,{role:"row",className:B.header,children:[D&&(0,_.jsx)(Gl,{variant:"caption",role:"columnheader","aria-label":j.calendarWeekNumberHeaderLabel,className:B.weekNumberLabel,children:j.calendarWeekNumberHeaderText}),(t=r.startOfWeek(N),[0,1,2,3,4,5,6].map(e=>r.addDays(t,e))).map((e,t)=>(0,_.jsx)(Gs,{variant:"caption",role:"columnheader","aria-label":r.format(e,"weekday"),className:B.weekDayLabel,children:C(e)},t.toString()))]}),u?(0,_.jsx)(Gc,{className:B.loadingContainer,children:f()}):(0,_.jsx)(Gd,(0,oU.A)({transKey:J,onExited:d,reduceAnimations:p,slideDirection:g,className:(0,O.A)(o,B.slideTransition)},m,{nodeRef:ee,children:(0,_.jsx)(Gh,{ref:ee,role:"rowgroup",className:B.monthContainer,children:en.map((e,t)=>(0,_.jsxs)(Gp,{role:"row",className:B.weekContainer,"aria-rowindex":t+1,children:[D&&(0,_.jsx)(Gu,{className:B.weekNumber,role:"rowheader","aria-label":j.calendarWeekNumberAriaLabelText(r.getWeekNumber(e[0])),children:j.calendarWeekNumberText(r.getWeekNumber(e[0]))}),e.map((e,t)=>(0,_.jsx)(Gf,{parentProps:n,day:e,selectedDays:Q,focusableDay:et,onKeyDown:q,onFocus:Y,onBlur:X,onDaySelect:G,isDateDisabled:F,currentMonthNumber:Z,isViewFocused:V,"aria-colindex":t+1},e.toString()))]},`week-${e[0]}`))})}))]})}function Gm(e){return(0,V.Ay)("MuiPickersMonth",e)}let Gv=(0,j.A)("MuiPickersMonth",["root","monthButton","disabled","selected"]),Gy=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],Gx=(0,N.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%"}}]}),Gb=(0,N.A)("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${Gv.disabled}`]:t.disabled},{[`&.${Gv.selected}`]:t.selected}]})(({theme:e})=>(0,oU.A)({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,E.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,E.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Gv.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${Gv.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),Gw=I.memo(function(e){let t=Hw({props:e,name:"MuiPickersMonth"}),{autoFocus:n,className:r,children:i,disabled:o,selected:a,value:s,tabIndex:l,onClick:u,onKeyDown:c,onFocus:d,onBlur:h,"aria-current":p,"aria-label":f,slots:g,slotProps:m}=t,v=(0,zD.A)(t,Gy),y=I.useRef(null),x=(e=>{let{disabled:t,selected:n,classes:r}=e;return(0,R.A)({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},Gm,r)})(t);(0,gK.A)(()=>{n&&y.current?.focus()},[n]);let b=g?.monthButton??Gb,w=(0,mG.A)({elementType:b,externalSlotProps:m?.monthButton,additionalProps:{children:i,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=>d(e,s),onBlur:e=>h(e,s)},ownerState:t,className:x.monthButton});return(0,_.jsx)(Gx,(0,oU.A)({className:(0,O.A)(x.root,r),ownerState:t},v,{children:(0,_.jsx)(b,(0,oU.A)({},w))}))});function GS(e){return(0,V.Ay)("MuiMonthCalendar",e)}(0,j.A)("MuiMonthCalendar",["root"]);let GA=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],GC=(0,N.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"}),GM=I.forwardRef(function(e,t){let n,r,i,o=(n=H_().utils,r=H_().defaultDates,i=Hw({props:e,name:"MuiMonthCalendar"}),(0,oU.A)({disableFuture:!1,disablePast:!1},i,{minDate:HR(n,i.minDate,r.minDate),maxDate:HR(n,i.maxDate,r.maxDate)})),{className:a,value:s,defaultValue:l,referenceDate:u,disabled:c,disableFuture:d,disablePast:h,maxDate:p,minDate:f,onChange:g,shouldDisableMonth:m,readOnly:v,autoFocus:y=!1,onMonthFocus:x,hasFocus:b,onFocusedViewChange:w,monthsPerRow:S=3,timezone:A,gridLabelId:C,slots:M,slotProps:k}=o,T=(0,zD.A)(o,GA),{value:D,handleValueChange:E,timezone:P}=Wp({name:"MonthCalendar",timezone:A,value:s,defaultValue:l,referenceDate:u,onChange:g,valueManager:WE}),L=HI(P),N=(0,fj.I)(),B=H_().utils,z=I.useMemo(()=>WE.getInitialReferenceValue({value:D,utils:B,props:o,timezone:P,referenceDate:u,granularity:Wf.month}),[]),F=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"]},GS,t)})(o),j=I.useMemo(()=>B.getMonth(L),[B,L]),V=I.useMemo(()=>null!=D?B.getMonth(D):null,[D,B]),[H,$]=I.useState(()=>V||B.getMonth(z)),[W,G]=(0,yl.A)({name:"MonthCalendar",state:"hasFocus",controlled:b,default:y??!1}),U=(0,yu.A)(e=>{G(e),w&&w(e)}),q=I.useCallback(e=>{let t=B.startOfMonth(h&&B.isAfter(L,f)?L:f),n=B.startOfMonth(d&&B.isBefore(L,p)?L:p),r=B.startOfMonth(e);return!!(B.isBefore(r,t)||B.isAfter(r,n))||!!m&&m(r)},[d,h,p,f,L,m,B]),Y=(0,yu.A)((e,t)=>{v||E(B.setMonth(D??z,t))}),X=(0,yu.A)(e=>{!q(B.setMonth(D??z,e))&&($(e),U(!0),x&&x(e))});I.useEffect(()=>{$(e=>null!==V&&e!==V?V:e)},[V]);let Z=(0,yu.A)((e,t)=>{switch(e.key){case"ArrowUp":X((12+t-3)%12),e.preventDefault();break;case"ArrowDown":X((12+t+3)%12),e.preventDefault();break;case"ArrowLeft":X((12+t+(N?1:-1))%12),e.preventDefault();break;case"ArrowRight":X((12+t+(N?-1:1))%12),e.preventDefault()}}),K=(0,yu.A)((e,t)=>{X(t)}),Q=(0,yu.A)((e,t)=>{H===t&&U(!1)});return(0,_.jsx)(GC,(0,oU.A)({ref:t,className:(0,O.A)(F.root,a),ownerState:o,role:"radiogroup","aria-labelledby":C},T,{children:HE(B,D??z).map(e=>{let t=B.getMonth(e),n=B.format(e,"monthShort"),r=B.format(e,"month"),i=c||q(e);return(0,_.jsx)(Gw,{selected:t===V,value:t,onClick:Y,onKeyDown:Z,autoFocus:W&&t===H,disabled:i,tabIndex:t!==H||i?-1:0,onFocus:K,onBlur:Q,"aria-current":j===t?"date":void 0,"aria-label":r,monthsPerRow:S,slots:M,slotProps:k,children:n},n)})}))});function Gk(e){return(0,V.Ay)("MuiPickersYear",e)}let GT=(0,j.A)("MuiPickersYear",["root","yearButton","selected","disabled"]),G_=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],GI=(0,N.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%"}}]}),GD=(0,N.A)("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${GT.disabled}`]:t.disabled},{[`&.${GT.selected}`]:t.selected}]})(({theme:e})=>(0,oU.A)({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:(0,E.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,E.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${GT.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${GT.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),GO=I.memo(function(e){let t=Hw({props:e,name:"MuiPickersYear"}),{autoFocus:n,className:r,children:i,disabled:o,selected:a,value:s,tabIndex:l,onClick:u,onKeyDown:c,onFocus:d,onBlur:h,"aria-current":p,slots:f,slotProps:g}=t,m=(0,zD.A)(t,G_),v=I.useRef(null),y=(e=>{let{disabled:t,selected:n,classes:r}=e;return(0,R.A)({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},Gk,r)})(t);(0,gK.A)(()=>{n&&v.current?.focus()},[n]);let x=f?.yearButton??GD,b=(0,mG.A)({elementType:x,externalSlotProps:g?.yearButton,additionalProps:{children:i,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=>d(e,s),onBlur:e=>h(e,s)},ownerState:t,className:y.yearButton});return(0,_.jsx)(GI,(0,oU.A)({className:(0,O.A)(y.root,r),ownerState:t},m,{children:(0,_.jsx)(x,(0,oU.A)({},b))}))});function GR(e){return(0,V.Ay)("MuiYearCalendar",e)}(0,j.A)("MuiYearCalendar",["root"]);let GE=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],GP=(0,N.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"}),GL=I.forwardRef(function(e,t){let n,r,i,o=(n=H_().utils,r=H_().defaultDates,i=Hw({props:e,name:"MuiYearCalendar"}),(0,oU.A)({disablePast:!1,disableFuture:!1},i,{yearsPerRow:i.yearsPerRow??3,minDate:HR(n,i.minDate,r.minDate),maxDate:HR(n,i.maxDate,r.maxDate)})),{autoFocus:a,className:s,value:l,defaultValue:u,referenceDate:c,disabled:d,disableFuture:h,disablePast:p,maxDate:f,minDate:g,onChange:m,readOnly:v,shouldDisableYear:y,onYearFocus:x,hasFocus:b,onFocusedViewChange:w,yearsOrder:S="asc",yearsPerRow:A,timezone:C,gridLabelId:M,slots:k,slotProps:T}=o,D=(0,zD.A)(o,GE),{value:E,handleValueChange:P,timezone:L}=Wp({name:"YearCalendar",timezone:C,value:l,defaultValue:u,referenceDate:c,onChange:m,valueManager:WE}),N=HI(L),B=(0,fj.I)(),z=H_().utils,F=I.useMemo(()=>WE.getInitialReferenceValue({value:E,utils:z,props:o,timezone:L,referenceDate:c,granularity:Wf.year}),[]),j=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"]},GR,t)})(o),V=I.useMemo(()=>z.getYear(N),[z,N]),H=I.useMemo(()=>null!=E?z.getYear(E):null,[E,z]),[$,W]=I.useState(()=>H||z.getYear(F)),[G,U]=(0,yl.A)({name:"YearCalendar",state:"hasFocus",controlled:b,default:a??!1}),q=(0,yu.A)(e=>{U(e),w&&w(e)}),Y=I.useCallback(e=>!!(p&&z.isBeforeYear(e,N)||h&&z.isAfterYear(e,N)||g&&z.isBeforeYear(e,g)||f&&z.isAfterYear(e,f))||!!y&&y(z.startOfYear(e)),[h,p,f,g,N,y,z]),X=(0,yu.A)((e,t)=>{v||P(z.setYear(E??F,t))}),Z=(0,yu.A)(e=>{Y(z.setYear(E??F,e))||(W(e),q(!0),x?.(e))});I.useEffect(()=>{W(e=>null!==H&&e!==H?H:e)},[H]);let K="desc"!==S?+A:-1*A,Q=B&&"asc"===S||!B&&"desc"===S?-1:1,J=(0,yu.A)((e,t)=>{switch(e.key){case"ArrowUp":Z(t-K),e.preventDefault();break;case"ArrowDown":Z(t+K),e.preventDefault();break;case"ArrowLeft":Z(t-Q),e.preventDefault();break;case"ArrowRight":Z(t+Q),e.preventDefault()}}),ee=(0,yu.A)((e,t)=>{Z(t)}),et=(0,yu.A)((e,t)=>{$===t&&q(!1)}),en=I.useRef(null),er=(0,gZ.A)(t,en);I.useEffect(()=>{if(a||null===en.current)return;let e=en.current.querySelector('[tabindex="0"]');if(!e)return;let t=e.offsetHeight,n=e.offsetTop,r=en.current.clientHeight,i=en.current.scrollTop;t>r||n<i||(en.current.scrollTop=n+t-r/2-t/2)},[a]);let ei=z.getYearRange([g,f]);return"desc"===S&&ei.reverse(),(0,_.jsx)(GP,(0,oU.A)({ref:er,className:(0,O.A)(j.root,s),ownerState:o,role:"radiogroup","aria-labelledby":M},D,{children:ei.map(e=>{let t=z.getYear(e),n=d||Y(e);return(0,_.jsx)(GO,{selected:t===H,value:t,onClick:X,onKeyDown:J,autoFocus:G&&t===$,disabled:n,tabIndex:t!==$||n?-1:0,onFocus:ee,onBlur:et,"aria-current":V===t?"date":void 0,yearsPerRow:A,slots:k,slotProps:T,children:z.format(e,"year")},z.format(e,"year"))})}))}),GN=e=>(0,V.Ay)("MuiPickersCalendarHeader",e),GB=(0,j.A)("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),Gz=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],GF=["ownerState"],Gj=(0,N.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}),GV=(0,N.A)("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>(0,oU.A)({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),GH=(0,N.A)("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),G$=(0,N.A)(eA,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${GB.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),GW=(0,N.A)(H8,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),GG=I.forwardRef(function(e,t){let n=H_().localeText,r=H_().utils,i=Hw({props:e,name:"MuiPickersCalendarHeader"}),{slots:o,slotProps:a,currentMonth:s,disabled:l,disableFuture:u,disablePast:c,maxDate:d,minDate:h,onMonthChange:p,onViewChange:f,view:g,reduceAnimations:m,views:v,labelId:y,className:x,timezone:b,format:w=`${r.formats.month} ${r.formats.year}`}=i,S=(0,zD.A)(i,Gz),A=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},GN,t)})(i),C=o?.switchViewButton??G$,M=(0,mG.A)({elementType:C,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(g)},ownerState:i,className:A.switchViewButton}),k=o?.switchViewIcon??GW,T=(0,mG.A)({elementType:k,externalSlotProps:a?.switchViewIcon,ownerState:i,className:A.switchViewIcon}),D=(0,zD.A)(T,GF),E=function(e,{disableFuture:t,maxDate:n,timezone:r}){let i=H_().utils;return I.useMemo(()=>{let o=i.date(void 0,r),a=i.startOfMonth(t&&i.isBefore(o,n)?o:n);return!i.isAfter(a,e)},[t,n,e,i,r])}(s,{disableFuture:u,maxDate:d,timezone:b}),P=function(e,{disablePast:t,minDate:n,timezone:r}){let i=H_().utils;return I.useMemo(()=>{let o=i.date(void 0,r),a=i.startOfMonth(t&&i.isAfter(o,n)?o:n);return!i.isBefore(a,e)},[t,n,e,i,r])}(s,{disablePast:c,minDate:h,timezone:b});if(1===v.length&&"year"===v[0])return null;let L=r.formatByString(s,w);return(0,_.jsxs)(Gj,(0,oU.A)({},S,{ownerState:i,className:(0,O.A)(A.root,x),ref:t,children:[(0,_.jsxs)(GV,{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:i,"aria-live":"polite",className:A.labelContainer,children:[(0,_.jsx)(WU,{reduceAnimations:m,transKey:L,children:(0,_.jsx)(GH,{id:y,ownerState:i,className:A.label,children:L})}),v.length>1&&!l&&(0,_.jsx)(C,(0,oU.A)({},M,{children:(0,_.jsx)(k,(0,oU.A)({},D))}))]}),(0,_.jsx)(vB.A,{in:"day"===g,appear:!m,enter:!m,children:(0,_.jsx)($$,{slots:o,slotProps:a,onGoToPrevious:()=>p(r.addMonths(s,-1),"right"),isPreviousDisabled:P,previousLabel:n.previousMonth,onGoToNext:()=>p(r.addMonths(s,1),"left"),isNextDisabled:E,nextLabel:n.nextMonth})})]}))}),GU="u">typeof navigator&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),Gq=GU&&GU[1]?parseInt(GU[1],10):null,GY=GU&&GU[2]?parseInt(GU[2],10):null,GX=Gq&&Gq<10||GY&&GY<13||!1,GZ=e=>(0,V.Ay)("MuiDateCalendar",e);(0,j.A)("MuiDateCalendar",["root","viewTransitionContainer"]);let GK=["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"],GQ=(0,N.A)($G,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:336}),GJ=(0,N.A)(WU,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),G0=I.forwardRef(function(e,t){let n,r,i,o,a=H_().utils,s=(0,vL.A)(),l=(n=H_().utils,r=H_().defaultDates,i=xK("@media (prefers-reduced-motion: reduce)",{defaultMatches:!1})||GX,o=Hw({props:e,name:"MuiDateCalendar"}),(0,oU.A)({},o,{loading:o.loading??!1,disablePast:o.disablePast??!1,disableFuture:o.disableFuture??!1,openTo:o.openTo??"day",views:o.views??["year","day"],reduceAnimations:o.reduceAnimations??i,renderLoading:o.renderLoading??(()=>(0,_.jsx)("span",{children:"..."})),minDate:HR(n,o.minDate,r.minDate),maxDate:HR(n,o.maxDate,r.maxDate)})),{autoFocus:u,onViewChange:c,value:d,defaultValue:h,referenceDate:p,disableFuture:f,disablePast:g,onChange:m,onYearChange:v,onMonthChange:y,reduceAnimations:x,shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:S,view:A,views:C,openTo:M,className:k,disabled:T,readOnly:D,minDate:E,maxDate:P,disableHighlightToday:L,focusedView:N,onFocusedViewChange:B,showDaysOutsideCurrentMonth:z,fixedWeekNumber:F,dayOfWeekFormatter:j,slots:V,slotProps:H,loading:$,renderLoading:W,displayWeekNumber:G,yearsOrder:U,yearsPerRow:q,monthsPerRow:Y,timezone:X}=l,Z=(0,zD.A)(l,GK),{value:K,handleValueChange:Q,timezone:J}=Wp({name:"DateCalendar",timezone:X,value:d,defaultValue:h,referenceDate:p,onChange:m,valueManager:WE}),{view:ee,setView:et,focusedView:en,setFocusedView:er,goToNextView:ei,setValueAndGoToNextView:eo}=$W({view:A,views:C,openTo:M,onChange:Q,onViewChange:c,autoFocus:u,focusedView:N,onFocusedViewChange:B}),{referenceDate:ea,calendarState:es,changeFocusedDay:el,changeMonth:eu,handleChangeMonth:ec,isDateDisabled:ed,onMonthSwitchingAnimationEnd:eh}=(e=>{let t,{value:n,referenceDate:r,disableFuture:i,disablePast:o,disableSwitchToMonthOnDayFocus:a=!1,maxDate:s,minDate:l,onMonthChange:u,reduceAnimations:c,shouldDisableDate:d,timezone:h}=e,p=H_().utils,f=I.useRef((t=!!c,(e,n)=>{switch(n.type){case"changeMonth":return(0,oU.A)({},e,{slideDirection:n.direction,currentMonth:n.newMonth,isMonthSwitchingAnimating:!t});case"changeMonthTimezone":{let t=n.newTimezone;if(p.getTimezone(e.currentMonth)===t)return e;let r=p.setTimezone(e.currentMonth,t);return p.getMonth(r)!==p.getMonth(e.currentMonth)&&(r=p.setMonth(r,p.getMonth(e.currentMonth))),(0,oU.A)({},e,{currentMonth:r})}case"finishMonthSwitchingAnimation":return(0,oU.A)({},e,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(null!=e.focusedDay&&null!=n.focusedDay&&p.isSameDay(n.focusedDay,e.focusedDay))return e;let r=null!=n.focusedDay&&!a&&!p.isSameMonth(e.currentMonth,n.focusedDay);return(0,oU.A)({},e,{focusedDay:n.focusedDay,isMonthSwitchingAnimating:r&&!t&&!n.withoutMonthSwitchingAnimation,currentMonth:r?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=I.useMemo(()=>WE.getInitialReferenceValue({value:n,utils:p,timezone:h,props:e,referenceDate:r,granularity:Wf.day}),[r,h]),[m,v]=I.useReducer(f,{isMonthSwitchingAnimating:!1,focusedDay:g,currentMonth:p.startOfMonth(g),slideDirection:"left"});I.useEffect(()=>{v({type:"changeMonthTimezone",newTimezone:p.getTimezone(g)})},[g,p]);let y=I.useCallback(e=>{v((0,oU.A)({type:"changeMonth"},e)),u&&u(e.newMonth)},[u]),x=I.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=WH({shouldDisableDate:d,minDate:l,maxDate:s,disableFuture:i,disablePast:o,timezone:h}),w=I.useCallback(()=>{v({type:"finishMonthSwitchingAnimation"})},[]);return{referenceDate:g,calendarState:m,changeMonth:x,changeFocusedDay:(0,yu.A)((e,t)=>{b(e)||v({type:"changeFocusedDay",focusedDay:e,withoutMonthSwitchingAnimation:t})}),isDateDisabled:b,onMonthSwitchingAnimationEnd:w,handleChangeMonth:y}})({value:K,referenceDate:p,reduceAnimations:x,onMonthChange:y,minDate:E,maxDate:P,shouldDisableDate:b,disablePast:g,disableFuture:f,timezone:J}),ep=T&&K||E,ef=T&&K||P,eg=`${s}-grid-label`,em=null!==en,ev=V?.calendarHeader??GG,ey=(0,mG.A)({elementType:ev,externalSlotProps:H?.calendarHeader,additionalProps:{views:C,view:ee,currentMonth:es.currentMonth,onViewChange:et,onMonthChange:(e,t)=>ec({newMonth:e,direction:t}),minDate:ep,maxDate:ef,disabled:T,disablePast:g,disableFuture:f,reduceAnimations:x,timezone:J,labelId:eg},ownerState:l}),ex=(0,yu.A)(e=>{let t=a.startOfMonth(e),n=a.endOfMonth(e),r=ed(e)?HO({utils:a,date:e,minDate:a.isBefore(E,t)?t:E,maxDate:a.isAfter(P,n)?n:P,disablePast:g,disableFuture:f,isDateDisabled:ed,timezone:J}):e;r?(eo(r,"finish"),y?.(t)):(ei(),eu(t)),el(r,!0)}),eb=(0,yu.A)(e=>{let t=a.startOfYear(e),n=a.endOfYear(e),r=ed(e)?HO({utils:a,date:e,minDate:a.isBefore(E,t)?t:E,maxDate:a.isAfter(P,n)?n:P,disablePast:g,disableFuture:f,isDateDisabled:ed,timezone:J}):e;r?(eo(r,"finish"),v?.(r)):(ei(),eu(t)),el(r,!0)}),ew=(0,yu.A)(e=>e?Q(HD(a,e,K??ea),"finish",ee):Q(e,"finish",ee));I.useEffect(()=>{null!=K&&a.isValid(K)&&eu(K)},[K]);let eS=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},GZ,t)})(l),eA={disablePast:g,disableFuture:f,maxDate:P,minDate:E},eC={disableHighlightToday:L,readOnly:D,disabled:T,timezone:J,gridLabelId:eg,slots:V,slotProps:H},eM=I.useRef(ee);I.useEffect(()=>{eM.current!==ee&&(en===eM.current&&er(ee,!0),eM.current=ee)},[en,er,ee]);let ek=I.useMemo(()=>[K],[K]);return(0,_.jsxs)(GQ,(0,oU.A)({ref:t,className:(0,O.A)(eS.root,k),ownerState:l},Z,{children:[(0,_.jsx)(ev,(0,oU.A)({},ey,{slots:V,slotProps:H})),(0,_.jsx)(GJ,{reduceAnimations:x,className:eS.viewTransitionContainer,transKey:ee,ownerState:l,children:(0,_.jsxs)("div",{children:["year"===ee&&(0,_.jsx)(GL,(0,oU.A)({},eA,eC,{value:K,onChange:eb,shouldDisableYear:S,hasFocus:em,onFocusedViewChange:e=>er("year",e),yearsOrder:U,yearsPerRow:q,referenceDate:ea})),"month"===ee&&(0,_.jsx)(GM,(0,oU.A)({},eA,eC,{hasFocus:em,className:k,value:K,onChange:ex,shouldDisableMonth:w,onFocusedViewChange:e=>er("month",e),monthsPerRow:Y,referenceDate:ea})),"day"===ee&&(0,_.jsx)(Gg,(0,oU.A)({},es,eA,eC,{onMonthSwitchingAnimationEnd:eh,onFocusedDayChange:el,reduceAnimations:x,selectedDays:ek,onSelectedDaysChange:ew,shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:S,hasFocus:em,onFocusedViewChange:e=>er("day",e),showDaysOutsideCurrentMonth:z,fixedWeekNumber:F,dayOfWeekFormatter:j,displayWeekNumber:G,loading:$,renderLoading:W}))]})})]}))}),G1=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:i,value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:d,disablePast:h,minDate:p,maxDate:f,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:S,yearsPerRow:A,slots:C,slotProps:M,loading:k,renderLoading:T,disableHighlightToday:I,readOnly:D,disabled:O,showDaysOutsideCurrentMonth:R,dayOfWeekFormatter:E,sx:P,autoFocus:L,fixedWeekNumber:N,displayWeekNumber:B,timezone:z})=>(0,_.jsx)(G0,{view:e,onViewChange:t,views:n.filter(HB),focusedView:r&&HB(r)?r:null,onFocusedViewChange:i,value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:d,disablePast:h,minDate:p,maxDate:f,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:S,yearsPerRow:A,slots:C,slotProps:M,loading:k,renderLoading:T,disableHighlightToday:I,readOnly:D,disabled:O,showDaysOutsideCurrentMonth:R,dayOfWeekFormatter:E,sx:P,autoFocus:L,fixedWeekNumber:N,displayWeekNumber:B,timezone:z});function G2(e){let{props:t,validator:n,value:r,timezone:i,onError:o}=e,a=H_(),s=I.useRef(n.valueManager.defaultErrorState),l=n({adapter:a,value:r,timezone:i,props:t}),u=n.valueManager.hasError(l);return I.useEffect(()=>{o&&!n.valueManager.isSameError(l,s.current)&&o(l,r),s.current=l},[n,o,l,r]),{validationError:l,hasValidationError:u,getValidationErrorForNewValue:(0,yu.A)(e=>n({adapter:a,value:e,timezone:i,props:t}))}}let G5=["className","sx"],G4=(e=document)=>{let t=e.activeElement;return t?t.shadowRoot?G4(t.shadowRoot):t:null};function G3(){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 G6(e){return(0,V.Ay)("MuiPickersLayout",e)}let G8=(0,j.A)("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),G9=["onAccept","onClear","onCancel","onSetToday","actions"];function G7(e){let{onAccept:t,onClear:n,onCancel:r,onSetToday:i,actions:o}=e,a=(0,zD.A)(e,G9),s=H_().localeText;if(null==o||0===o.length)return null;let l=o?.map(e=>{switch(e){case"clear":return(0,_.jsx)(em,{onClick:n,children:s.clearButtonLabel},e);case"cancel":return(0,_.jsx)(em,{onClick:r,children:s.cancelButtonLabel},e);case"accept":return(0,_.jsx)(em,{onClick:t,children:s.okButtonLabel},e);case"today":return(0,_.jsx)(em,{onClick:i,children:s.todayButtonLabel},e);default:return null}});return(0,_.jsx)(vX,(0,oU.A)({},a,{children:l}))}var Ue=n(76477),Ut=n(79223),Un=n(6835);function Ur(e){return(0,V.Ay)("MuiListItem",e)}function Ui(e){return(0,V.Ay)("MuiListItemSecondaryAction",e)}(0,j.A)("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]),(0,j.A)("MuiListItemSecondaryAction",["root","disableGutters"]);let Uo=(0,N.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}}]}),Ua=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiListItemSecondaryAction"}),{className:r,...i}=n,o=I.useContext(u5.A),a={...n,disableGutters:o.disableGutters},s=(e=>{let{disableGutters:t,classes:n}=e;return(0,R.A)({root:["root",t&&"disableGutters"]},Ui,n)})(a);return(0,_.jsx)(Uo,{className:(0,O.A)(s.root,r),ownerState:a,ref:t,...i})});Ua.muiName="ListItemSecondaryAction";let Us=(0,N.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,B.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:{[`& > .${u3.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}}]}))),Ul=(0,N.A)("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),Uu=I.forwardRef(function(e,t){let n=(0,F.b)({props:e,name:"MuiListItem"}),{alignItems:r="center",children:i,className:o,component:a,components:s={},componentsProps:l={},ContainerComponent:u="li",ContainerProps:{className:c,...d}={},dense:h=!1,disableGutters:p=!1,disablePadding:f=!1,divider:g=!1,secondaryAction:m,slotProps:v={},slots:y={},...x}=n,b=I.useContext(u5.A),w=I.useMemo(()=>({dense:h||b.dense||!1,alignItems:r,disableGutters:p}),[r,b.dense,h,p]),S=I.useRef(null),A=I.Children.toArray(i),C=A.length&&(0,Un.A)(A[A.length-1],["ListItemSecondaryAction"]),M={...n,alignItems:r,dense:w.dense,disableGutters:p,disablePadding:f,divider:g,hasSecondaryAction:C},k=(e=>{let{alignItems:t,classes:n,dense:r,disableGutters:i,disablePadding:o,divider:a,hasSecondaryAction:s}=e;return(0,R.A)({root:["root",r&&"dense",!i&&"gutters",!o&&"padding",a&&"divider","flex-start"===t&&"alignItemsFlexStart",s&&"secondaryAction"],container:["container"]},Ur,n)})(M),T=(0,u2.A)(S,t),D=y.root||s.Root||Us,E=v.root||l.root||{},P={className:(0,O.A)(k.root,E.className,o),...x},L=a||"li";return C?(L=P.component||a?L:"div","li"===u&&("li"===L?L="div":"li"===P.component&&(P.component="div")),(0,_.jsx)(u5.A.Provider,{value:w,children:(0,_.jsxs)(Ul,{as:u,className:(0,O.A)(k.container,c),ref:T,ownerState:M,...d,children:[(0,_.jsx)(D,{...E,...!(0,Ut.A)(D)&&{as:L,ownerState:{...M,...E.ownerState}},...P,children:A}),A.pop()]})})):(0,_.jsx)(u5.A.Provider,{value:w,children:(0,_.jsxs)(D,{...E,as:L,ref:T,...!(0,Ut.A)(D)&&{ownerState:{...M,...E.ownerState}},...P,children:[A,m&&(0,_.jsx)(Ua,{children:m})]})})}),Uc=["items","changeImportance","isLandscape","onChange","isValid"],Ud=["getValue"];function Uh(e){let{items:t,changeImportance:n="accept",onChange:r,isValid:i}=e,o=(0,zD.A)(e,Uc);if(null==t||0===t.length)return null;let a=t.map(e=>{let{getValue:t}=e,o=(0,zD.A)(e,Ud),a=t({isValid:i});return(0,oU.A)({},o,{label:o.label,onClick:()=>{r(a,n,o)},disabled:!i(a)})});return(0,_.jsx)(Ue.A,(0,oU.A)({dense:!0,sx:[{maxHeight:336,maxWidth:200,overflow:"auto"},...Array.isArray(o.sx)?o.sx:[o.sx]]},o,{children:a.map(e=>(0,_.jsx)(Uu,{children:(0,_.jsx)(yT,(0,oU.A)({},e))},e.id??e.label))}))}let Up=(0,N.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",[`& .${G8.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${G8.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${G8.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${G8.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${G8.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${G8.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${G8.shortcuts}`]:{gridColumn:3}}}]}),Uf=(0,N.A)("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),Ug=I.forwardRef(function(e,t){let n=Hw({props:e,name:"MuiPickersLayout"}),{toolbar:r,content:i,tabs:o,actionBar:a,shortcuts:s}=(e=>{let{wrapperVariant:t,onAccept:n,onClear:r,onCancel:i,onSetToday:o,view:a,views:s,onViewChange:l,value:u,onChange:c,onSelectShortcut:d,isValid:h,isLandscape:p,disabled:f,readOnly:g,children:m,slots:v,slotProps:y}=e,x=(e=>{let{classes:t,isLandscape:n}=e;return(0,R.A)({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},G6,t)})(e),b=v?.actionBar??G7,w=(0,mG.A)({elementType:b,externalSlotProps:y?.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:i,onSetToday:o,actions:"desktop"===t?[]:["cancel","accept"]},className:x.actionBar,ownerState:(0,oU.A)({},e,{wrapperVariant:t})}),S=(0,_.jsx)(b,(0,oU.A)({},w)),A=v?.toolbar,C=(0,mG.A)({elementType:A,externalSlotProps:y?.toolbar,additionalProps:{isLandscape:p,onChange:c,value:u,view:a,onViewChange:l,views:s,disabled:f,readOnly:g},className:x.toolbar,ownerState:(0,oU.A)({},e,{wrapperVariant:t})}),M=null!==C.view&&A?(0,_.jsx)(A,(0,oU.A)({},C)):null,k=v?.tabs,T=a&&k?(0,_.jsx)(k,(0,oU.A)({view:a,onViewChange:l,className:x.tabs},y?.tabs)):null,I=v?.shortcuts??Uh,D=(0,mG.A)({elementType:I,externalSlotProps:y?.shortcuts,additionalProps:{isValid:h,isLandscape:p,onChange:d},className:x.shortcuts,ownerState:{isValid:h,isLandscape:p,onChange:d,wrapperVariant:t}});return{toolbar:M,content:m,tabs:T,actionBar:S,shortcuts:a&&I?(0,_.jsx)(I,(0,oU.A)({},D)):null}})(n),{sx:l,className:u,isLandscape:c,wrapperVariant:d}=n,h=(e=>{let{isLandscape:t,classes:n}=e;return(0,R.A)({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},G6,n)})(n);return(0,_.jsxs)(Up,{ref:t,sx:l,className:(0,O.A)(h.root,u),ownerState:n,children:[c?s:r,c?r:s,(0,_.jsx)(Uf,{className:h.contentWrapper,children:"desktop"===d?(0,_.jsxs)(I.Fragment,{children:[i,o]}):(0,_.jsxs)(I.Fragment,{children:[o,i]})}),a]})}),Um=["props","ref"],Uv=(0,N.A)(Ug)(({theme:e})=>({overflow:"hidden",minWidth:320,backgroundColor:(e.vars||e).palette.background.paper})),Uy=({adapter:e,value:t,timezone:n,props:r})=>{if(null===t)return null;let{minTime:i,maxTime:o,minutesStep:a,shouldDisableTime:s,disableIgnoringDatePartForTimeValidation:l=!1,disablePast:u,disableFuture:c}=r,d=e.utils.date(void 0,n),h=$k(l,e.utils);switch(!0){case!e.utils.isValid(t):return"invalidDate";case!!(i&&h(i,t)):return"minTime";case!!(o&&h(t,o)):return"maxTime";case!!(c&&e.utils.isAfter(t,d)):return"disableFuture";case!!(u&&e.utils.isBefore(t,d)):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}};Uy.valueManager=WE;let Ux=({adapter:e,value:t,timezone:n,props:r})=>{let i=WV({adapter:e,value:t,timezone:n,props:r});return null!==i?i:Uy({adapter:e,value:t,timezone:n,props:r})};Ux.valueManager=WE;let Ub=I.forwardRef(function(e,t){let n,r,i,o,a,s=(n=H_().utils,r=H_().defaultDates,o=(i=Hw({props:e,name:"MuiStaticDateTimePicker"})).ampm??n.is12HourCycleInCurrentLocale(),a=I.useMemo(()=>i.localeText?.toolbarTitle==null?i.localeText:(0,oU.A)({},i.localeText,{dateTimePickerToolbarTitle:i.localeText.toolbarTitle}),[i.localeText]),(0,oU.A)({},i,(({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{let i,o=n??r;if(null!=e)i=e;else if(o.includes(t))i=t;else if(o.length>0)i=o[0];else throw Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:i}})({views:i.views,openTo:i.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:o,localeText:a,orientation:i.orientation??"portrait",disableIgnoringDatePartForTimeValidation:i.disableIgnoringDatePartForTimeValidation??!!(i.minDateTime||i.maxDateTime||i.disablePast||i.disableFuture),disableFuture:i.disableFuture??!1,disablePast:i.disablePast??!1,minDate:HR(n,i.minDateTime??i.minDate,r.minDate),maxDate:HR(n,i.maxDateTime??i.maxDate,r.maxDate),minTime:i.minDateTime??i.minTime,maxTime:i.maxDateTime??i.maxTime,slots:(0,oU.A)({toolbar:$L,tabs:$o},i.slots),slotProps:(0,oU.A)({},i.slotProps,{toolbar:(0,oU.A)({ampm:o},i.slotProps?.toolbar)})})),l=s.displayStaticWrapperAs??"mobile",u=s.ampmInClock??"desktop"===l,c=(0,oU.A)({day:G1,month:G1,year:G1,hours:Wj,minutes:Wj,seconds:Wj},s.viewRenderers),{renderPicker:d}=(e=>{let{props:t,ref:n}=e,r=(0,zD.A)(e,Um),{localeText:i,slots:o,slotProps:a,className:s,sx:l,displayStaticWrapperAs:u,autoFocus:c}=t,{layoutProps:d,renderCurrentView:h}=(({props:e,valueManager:t,valueType:n,wrapperVariant:r,additionalViewProps:i,validator:o,autoFocusView:a,rendererInterceptor:s,fieldRef:l})=>{let u=(({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:i})=>{let{onAccept:o,onChange:a,value:s,defaultValue:l,closeOnSelect:u="desktop"===r,timezone:c,referenceDate:d}=e,{current:h}=I.useRef(l),{current:p}=I.useRef(void 0!==s),[f,g]=I.useState(c),m=H_().utils,v=H_(),{isOpen:y,setIsOpen:x}=(({open:e,onOpen:t,onClose:n})=>{let r=I.useRef("boolean"==typeof e).current,[i,o]=I.useState(!1);return I.useEffect(()=>{if(r){if("boolean"!=typeof e)throw Error("You must not mix controlling and uncontrolled mode for `open` prop");o(e)}},[r,e]),{isOpen:i,setIsOpen:I.useCallback(e=>{r||o(e),e&&t&&t(),!e&&n&&n()},[r,t,n])}})(e),{timezone:b,value:w,handleValueChange:S}=Wh({timezone:c,value:s,defaultValue:h,referenceDate:d,onChange:a,valueManager:t}),[A,C]=I.useState(()=>{let e;return{draft:e=void 0!==w?w:void 0!==h?h:t.emptyValue,lastPublishedValue:e,lastCommittedValue:e,lastControlledValue:s,hasBeenModifiedSinceMount:!1}}),M=t.getTimezone(m,A.draft);f!==c&&(g(c),c&&M&&c!==M&&C(e=>(0,oU.A)({},e,{draft:t.setTimezone(m,c,e.draft)})));let{getValidationErrorForNewValue:k}=G2({props:e,validator:i,timezone:b,value:A.draft,onError:e.onError}),T=(0,yu.A)(e=>{let n={action:e,dateState:A,hasChanged:n=>!t.areValuesEqual(m,e.value,n),isControlled:p,closeOnSelect:u},r=(e=>{let{action:t,hasChanged:n,dateState:r,isControlled:i}=e,o=!i&&!r.hasBeenModifiedSinceMount;return"setValueFromField"===t.name||("setValueFromAction"===t.name?!!(o&&["accept","today","clear"].includes(t.pickerAction))||n(r.lastPublishedValue):("setValueFromView"===t.name&&"shallow"!==t.selectionState||"setValueFromShortcut"===t.name)&&(!!o||n(r.lastPublishedValue)))})(n),i=(e=>{let{action:t,hasChanged:n,dateState:r,isControlled:i,closeOnSelect:o}=e,a=!i&&!r.hasBeenModifiedSinceMount;return"setValueFromAction"===t.name?!!(a&&["accept","today","clear"].includes(t.pickerAction))||n(r.lastCommittedValue):"setValueFromView"===t.name&&"finish"===t.selectionState&&o?!!a||n(r.lastCommittedValue):"setValueFromShortcut"===t.name&&"accept"===t.changeImportance&&n(r.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,oU.A)({},t,{draft:e.value,lastPublishedValue:r?e.value:t.lastPublishedValue,lastCommittedValue:i?e.value:t.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let s=null,l=()=>(s||(s={validationError:"setValueFromField"===e.name?e.context.validationError:k(e.value)},"setValueFromShortcut"===e.name&&(s.shortcut=e.shortcut)),s);r&&S(e.value,l()),i&&o&&o(e.value,l()),a&&x(!1)});if(A.lastControlledValue!==s){let e=t.areValuesEqual(m,A.draft,w);C(t=>(0,oU.A)({},t,{lastControlledValue:s},e?{}:{lastCommittedValue:w,lastPublishedValue:w,draft:w,hasBeenModifiedSinceMount:!0}))}let _=(0,yu.A)(()=>{T({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),D=(0,yu.A)(()=>{T({value:A.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),O=(0,yu.A)(()=>{T({value:A.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),R=(0,yu.A)(()=>{T({value:A.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),E=(0,yu.A)(()=>{T({value:t.getTodayValue(m,b,n),name:"setValueFromAction",pickerAction:"today"})}),P=(0,yu.A)(e=>{e.preventDefault(),x(!0)}),L=(0,yu.A)(e=>{e?.preventDefault(),x(!1)}),N=(0,yu.A)((e,t="partial")=>T({name:"setValueFromView",value:e,selectionState:t})),B=(0,yu.A)((e,t,n)=>T({name:"setValueFromShortcut",value:e,changeImportance:t,shortcut:n})),z=(0,yu.A)((e,t)=>T({name:"setValueFromField",value:e,context:t})),F={onClear:_,onAccept:D,onDismiss:O,onCancel:R,onSetToday:E,onOpen:P,onClose:L},j={value:A.draft,onChange:z},V=I.useMemo(()=>t.cleanValue(m,A.draft),[m,t,A.draft]),H=(0,oU.A)({},F,{value:V,onChange:N,onSelectShortcut:B,isValid:n=>{let r=i({adapter:v,value:n,timezone:b,props:e});return!t.hasError(r)}}),$=I.useMemo(()=>({onOpen:P,onClose:L,open:y}),[y,L,P]);return{open:y,fieldProps:j,viewProps:{value:V,onChange:N,onClose:L,open:y},layoutProps:H,actions:F,contextValue:$}})({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:o}),c=(({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:r,rendererInterceptor:i,fieldRef:o})=>{let{onChange:a,open:s,onClose:l}=t,{view:u,views:c,openTo:d,onViewChange:h,viewRenderers:p,timezone:f}=e,g=(0,zD.A)(e,G5),{view:m,setView:v,defaultView:y,focusedView:x,setFocusedView:b,setValueAndGoToNextView:w}=$W({view:u,views:c,openTo:d,onChange:a,onViewChange:h,autoFocus:r}),{hasUIView:S,viewModeLookup:A}=I.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=I.useMemo(()=>c.reduce((e,t)=>null!=p[t]&&$A(t)?e+1:e,0),[p,c]),M=A[m],k=(0,yu.A)(()=>"UI"===M),[T,_]=I.useState("UI"===M?m:null);return T!==m&&"UI"===A[m]&&_(m),(0,gK.A)(()=>{"field"===M&&s&&(l(),setTimeout(()=>{o?.current?.setSelectedSections(m),o?.current?.focusField(m)}))},[m]),(0,gK.A)(()=>{if(!s)return;let e=m;"field"===M&&null!=T&&(e=T),e!==y&&"UI"===A[e]&&"UI"===A[y]&&(e=y),e!==m&&v(e),b(e,!0)},[s]),{hasUIView:S,shouldRestoreFocus:k,layoutProps:{views:c,view:T,onViewChange:v},renderCurrentView:()=>{if(null==T)return null;let e=p[T];if(null==e)return null;let r=(0,oU.A)({},g,n,t,{views:c,timezone:f,onChange:w,view:T,onViewChange:v,focusedView:x,onFocusedViewChange:b,showViewSwitcher:C>1,timeViewsCount:C});return i?i(p,T,r):e(r)}}})({props:e,additionalViewProps:i,autoFocusView:a,fieldRef:l,propsFromPickerValue:u.viewProps,rendererInterceptor:s}),d=(({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{let{orientation:i}=e,o=((e,t)=>{var n;let[r,i]=I.useState(G3);return(0,gK.A)(()=>{let e=()=>{i(G3())};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||r)})(n.views,i),a=(0,fj.I)();return{layoutProps:(0,oU.A)({},n,t,{isLandscape:o,isRtl:a,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}})({props:e,wrapperVariant:r,propsFromPickerValue:u.layoutProps,propsFromPickerViews:c.layoutProps}),h=function(e){let{props:t,pickerValueResponse:n}=e;return I.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:d.layoutProps,contextValue:u.contextValue,ownerState:h}})((0,oU.A)({},r,{props:t,autoFocusView:c??!1,additionalViewProps:{},wrapperVariant:u})),p=o?.layout??Uv;return{renderPicker:()=>(0,_.jsx)(HC,{localeText:i,children:(0,_.jsx)(p,(0,oU.A)({},d,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,O.A)(s,a?.layout?.className),ref:n,children:h()}))})}})({props:(0,oU.A)({},s,{viewRenderers:c,displayStaticWrapperAs:l,ampmInClock:u,yearsPerRow:s.yearsPerRow??("mobile"===l?3:4),slotProps:(0,oU.A)({},s.slotProps,{tabs:(0,oU.A)({hidden:"desktop"===l},s.slotProps?.tabs),toolbar:(0,oU.A)({hidden:"desktop"===l,ampmInClock:u},s.slotProps?.toolbar)})}),valueManager:WE,valueType:"date-time",validator:Ux,ref:t});return d()});Ub.propTypes={ampm:Hk().bool,ampmInClock:Hk().bool,autoFocus:Hk().bool,className:Hk().string,dayOfWeekFormatter:Hk().func,defaultValue:Hk().object,disabled:Hk().bool,disableFuture:Hk().bool,disableHighlightToday:Hk().bool,disableIgnoringDatePartForTimeValidation:Hk().bool,disablePast:Hk().bool,displayStaticWrapperAs:Hk().oneOf(["desktop","mobile"]),displayWeekNumber:Hk().bool,fixedWeekNumber:Hk().number,loading:Hk().bool,localeText:Hk().object,maxDate:Hk().object,maxDateTime:Hk().object,maxTime:Hk().object,minDate:Hk().object,minDateTime:Hk().object,minTime:Hk().object,minutesStep:Hk().number,monthsPerRow:Hk().oneOf([3,4]),onAccept:Hk().func,onChange:Hk().func,onClose:Hk().func,onError:Hk().func,onMonthChange:Hk().func,onViewChange:Hk().func,onYearChange:Hk().func,openTo:Hk().oneOf(["day","hours","minutes","month","seconds","year"]),orientation:Hk().oneOf(["landscape","portrait"]),readOnly:Hk().bool,reduceAnimations:Hk().bool,referenceDate:Hk().object,renderLoading:Hk().func,shouldDisableDate:Hk().func,shouldDisableMonth:Hk().func,shouldDisableTime:Hk().func,shouldDisableYear:Hk().func,showDaysOutsideCurrentMonth:Hk().bool,slotProps:Hk().object,slots:Hk().object,sx:Hk().oneOfType([Hk().arrayOf(Hk().oneOfType([Hk().func,Hk().object,Hk().bool])),Hk().func,Hk().object]),timezone:Hk().string,value:Hk().object,view:Hk().oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:Hk().shape({day:Hk().func,hours:Hk().func,minutes:Hk().func,month:Hk().func,seconds:Hk().func,year:Hk().func}),views:Hk().arrayOf(Hk().oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:Hk().oneOf(["asc","desc"]),yearsPerRow:Hk().oneOf([3,4])};let Uw=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:i,now:o,token:a,startSeparator:s})=>{if(""===a)throw Error("MUI X: Should not call `commitToken` with an empty token");let l=Wm(e,a),u=WT(e,l.contentType,l.type,a),c=n?u:"digit"===l.contentType,d=null!=t&&e.isValid(t),h=d?e.formatByString(t,a):"",p=null;if(c)if(u)p=""===h?e.formatByString(o,a).length:h.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,d&&(h=Ww(WA(Wb(h,i),p),i))}return(0,oU.A)({},l,{format:a,maxLength:p,value:h,placeholder:((e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}})(e,r,l,a),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:c,startSeparator:s,endSeparator:"",modified:!1})},US=e=>{let t=(({utils:e,format:t})=>{let n=10,r=t,i=e.expandFormat(t);for(;i!==r;)if(r=i,i=e.expandFormat(r),(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 i})(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));let n=(({utils:e,expandedFormat:t})=>{let n=[],{start:r,end:i}=e.escapedCharacters,o=RegExp(`(\\${r}[^\\${i}]*\\${i})+`,"g"),a=null;for(;a=o.exec(t);)n.push({start:a.index,end:o.lastIndex-1});return n})((0,oU.A)({},e,{expandedFormat:t})),r=(e=>{let{utils:t,expandedFormat:n,escapedParts:r}=e,i=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("|")})`),d=e=>r.find(t=>t.start<=e&&t.end>=e),h=0;for(;h<n.length;){let t=d(h),r=null!=t,s=l.exec(n.slice(h))?.[1];if(!r&&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(Uw((0,oU.A)({},e,{now:i,token:n,startSeparator:a}))),a=""}h+=s.length}else{let e=n[h];r&&t?.start===h||t?.end===h||(0===o.length?a+=e:o[o.length-1].endSeparator+=e),h+=1}}return 0===o.length&&a.length>0&&o.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:a,endSeparator:"",modified:!1}),o})((0,oU.A)({},e,{expandedFormat:t,escapedParts:n}));return(({isRtl:e,formatDensity:t,sections:n})=>n.map(n=>{let r=n=>{let r=n;return e&&null!==r&&r.includes(" ")&&(r=`\u2069${r}\u2066`),"spacious"===t&&["/",".","-"].includes(r)&&(r=` ${r} `),r};return n.startSeparator=r(n.startSeparator),n.endSeparator=r(n.endSeparator),n}))((0,oU.A)({},e,{sections:r}))},UA=e=>{let{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:i,onClick:o,onFocus:a,onInput:s,onPaste:l,focused:u,autoFocus:c=!1},fieldValueManager:d,applyCharacterEditing:h,resetCharacterQuery:p,setSelectedSections:f,parsedSelectedSections:g,state:m,clearActiveSection:v,clearValue:y,updateSectionValue:x,updateValueFromValueStr:b,sectionOrder:w,areAllSectionsEmpty:S,sectionsValueBoundaries:A}=e,C=I.useRef(null),M=(0,gZ.A)(r,C),k=H_().localeText,T=H_().utils,_=(0,vL.A)(),[D,O]=I.useState(!1),R=I.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(),D&&C.current.getRoot().blur();return}if(!C.current.getRoot().contains(G4(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=G4(document);return e&&C.current&&C.current.getRoot().contains(e)?C.current.getSectionIndexFromDOMElement(e):null},focusField:(e=0)=>{if(!C.current||null!=R.getActiveSectionIndexFromDOM())return;let t=WO(e,m.sections);O(!0),C.current.getSectionContent(t).focus()},setSelectedSections:e=>{if(!C.current)return;let t=WO(e,m.sections);O(null!==("all"===t?0:t)),f(e)},isFieldFocused:()=>{let e=G4(document);return!!C.current&&C.current.getRoot().contains(e)}}),[g,f,m.sections,D]),E=(0,yu.A)(e=>{if(!C.current)return;let t=m.sections[e];C.current.getSectionContent(e).innerHTML=t.value||t.placeholder,R.syncSelectionToDOM()}),P=(0,yu.A)((e,...t)=>{!e.isDefaultPrevented()&&C.current&&(O(!0),o?.(e,...t),"all"===g?setTimeout(()=>{let e=document.getSelection().getRangeAt(0).startOffset;if(0===e)return void f(w.startIndex);let t=0,n=0;for(;n<e&&t<m.sections.length;){let e=m.sections[t];t+=1,n+=`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`.length}f(t-1)}):D?C.current.getRoot().contains(e.target)||f(w.startIndex):(O(!0),f(w.startIndex)))}),L=(0,yu.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(""),R.syncSelectionToDOM(),0===t.length||10===t.charCodeAt(0)?(p(),y(),f("all")):t.length>1?b(t):("all"===g&&f(0),h({keyPressed:t,sectionIndex:0}))}),N=(0,yu.A)(e=>{if(l?.(e),n||"all"!==g)return void e.preventDefault();let t=e.clipboardData.getData("text");e.preventDefault(),p(),b(t)}),B=(0,yu.A)((...e)=>{a?.(...e),D||!C.current||(O(!0),null==C.current.getSectionIndexFromDOMElement(G4(document))&&f(w.startIndex))}),z=(0,yu.A)((...e)=>{i?.(...e),setTimeout(()=>{if(!C.current)return;let e=G4(document);C.current.getRoot().contains(e)||(O(!1),f(null))})}),F=(0,yu.A)(e=>t=>{t.isDefaultPrevented()||f(e)}),j=(0,yu.A)(e=>{e.preventDefault()}),V=(0,yu.A)(e=>()=>{f(e)}),H=(0,yu.A)(e=>{if(e.preventDefault(),n||t||"number"!=typeof g)return;let r=m.sections[g],i=e.clipboardData.getData("text"),o=/^[a-zA-Z]+$/.test(i),a=/^[0-9]+$/.test(i),s=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(i);"letter"===r.contentType&&o||"digit"===r.contentType&&a||"digit-with-letter"===r.contentType&&s?(p(),x({activeSection:r,newSectionValue:i,shouldGoToNextSection:!0})):o||a||(p(),b(i))}),$=(0,yu.A)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="none"}),W=(0,yu.A)(e=>{if(!C.current)return;let t=e.target,r=t.textContent??"",i=C.current.getSectionIndexFromDOMElement(t),o=m.sections[i];if(n||!C.current)return void E(i);if(0===r.length){if(""===o.value)return void E(i);let t=e.nativeEvent.inputType;return"insertParagraph"===t||"insertLineBreak"===t?void E(i):(p(),void v())}h({keyPressed:r,sectionIndex:i}),E(i)});(0,gK.A)(()=>{if(D&&C.current){if("all"===g)C.current.getRoot().focus();else if("number"==typeof g){let e=C.current.getSectionContent(g);e&&e.focus()}}},[g,D]);let G=I.useMemo(()=>m.sections.reduce((e,t)=>(e[t.type]=A[t.type]({currentDate:null,contentType:t.contentType,format:t.format}),e),{}),[A,m.sections]),U="all"===g,q=I.useMemo(()=>m.sections.map((e,r)=>{let i=!U&&!t&&!n;return{container:{"data-sectionindex":r,onClick:F(r)},content:{tabIndex:U||r>0?-1:0,contentEditable:!U&&!t&&!n,role:"spinbutton",id:`${_}-${e.type}`,"aria-labelledby":`${_}-${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,T),"aria-valuemin":G[e.type].minimum,"aria-valuemax":G[e.type].maximum,"aria-valuetext":e.value?((e,t)=>{if(e.value)switch(e.type){case"month":{if("digit"===e.contentType)return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");let n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return"digit"===e.contentType?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;default:return}})(e,T):k.empty,"aria-label":k[e.type],"aria-disabled":t,spellCheck:!i&&void 0,autoCapitalize:i?"off":void 0,autoCorrect:i?"off":void 0,[parseInt(I.version,10)>=17?"enterKeyHint":"enterkeyhint"]:i?"next":void 0,children:e.value||e.placeholder,onInput:W,onPaste:H,onFocus:V(r),onDragOver:$,onMouseUp:j,inputMode:"letter"===e.contentType?"text":"numeric"},before:{children:e.startSeparator},after:{children:e.endSeparator}}}),[m.sections,V,H,$,W,F,j,t,n,U,k,T,G,_]),Y=(0,yu.A)(e=>{b(e.target.value)}),X=I.useMemo(()=>S?"":d.getV7HiddenInputValueFromSections(m.sections),[S,m.sections,d]);return I.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:R,returnedValue:{autoFocus:c,readOnly:n,focused:u??D,sectionListRef:M,onBlur:z,onClick:P,onFocus:B,onInput:L,onPaste:N,enableAccessibleFieldDOMStructure:!0,elements:q,tabIndex:0===g?-1:0,contentEditable:U,value:X,onChange:Y,areAllSectionsEmpty:S}}},UC=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),UM=e=>{let t=(0,fj.I)(),n=I.useRef(void 0),r=I.useRef(void 0),{forwardedProps:{onFocus:i,onClick:o,onPaste:a,onBlur:s,inputRef:l,placeholder:u},internalProps:{readOnly:c=!1,disabled:d=!1},parsedSelectedSections:h,activeSectionIndex:p,state:f,fieldValueManager:g,valueManager:m,applyCharacterEditing:v,resetCharacterQuery:y,updateSectionValue:x,updateValueFromValueStr:b,clearActiveSection:w,clearValue:S,setTempAndroidValueStr:A,setSelectedSections:C,getSectionsFromValue:M,areAllSectionsEmpty:k,localizedDigits:T}=e,_=I.useRef(null),D=(0,gZ.A)(l,_),O=I.useMemo(()=>((e,t,n)=>{let r=0,i=+!!n,o=[];for(let a=0;a<e.length;a+=1){let s=e[a],l=WM(s,n?"input-rtl":"input-ltr",t),u=`${s.startSeparator}${l}${s.endSeparator}`,c=UC(u).length,d=u.length,h=UC(l),p=i+(""===h?0:l.indexOf(h[0]))+s.startSeparator.length,f=p+h.length;o.push((0,oU.A)({},s,{start:r,end:r+c,startInInput:p,endInInput:f})),r+=c,i+=d}return o})(f.sections,T,t),[f.sections,T,t]),R=I.useMemo(()=>({syncSelectionToDOM:()=>{if(!_.current)return;if(null==h){_.current.scrollLeft&&(_.current.scrollLeft=0);return}if(_.current!==G4(document))return;let e=_.current.scrollTop;if("all"===h)_.current.select();else{let e=O[h],t="empty"===e.type?e.startInInput-e.startSeparator.length:e.startInInput,n="empty"===e.type?e.endInInput+e.endSeparator.length:e.endInInput;(t!==_.current.selectionStart||n!==_.current.selectionEnd)&&_.current===G4(document)&&_.current.setSelectionRange(t,n),clearTimeout(r.current),r.current=setTimeout(()=>{_.current&&_.current===G4(document)&&_.current.selectionStart===_.current.selectionEnd&&(_.current.selectionStart!==t||_.current.selectionEnd!==n)&&R.syncSelectionToDOM()})}_.current.scrollTop=e},getActiveSectionIndexFromDOM:()=>{let e=_.current.selectionStart??0,t=_.current.selectionEnd??0;if(0===e&&0===t)return null;let n=e<=O[0].startInInput?1:O.findIndex(t=>t.startInInput-t.startSeparator.length>e);return -1===n?O.length-1:n-1},focusField:(e=0)=>{G4(document)!==_.current&&(_.current?.focus(),C(e))},setSelectedSections:e=>C(e),isFieldFocused:()=>_.current===G4(document)}),[_,h,O,C]),E=()=>{let e,t=_.current.selectionStart??0;C(-1===(e=t<=O[0].startInInput||t>=O[O.length-1].endInInput?1:O.findIndex(e=>e.startInInput-e.startSeparator.length>t))?O.length-1:e-1)},P=(0,yu.A)((...e)=>{i?.(...e);let t=_.current;clearTimeout(n.current),n.current=setTimeout(()=>{t&&t===_.current&&null==p&&(t.value.length&&Number(t.selectionEnd)-Number(t.selectionStart)===t.value.length?C("all"):E())})}),L=(0,yu.A)((e,...t)=>{e.isDefaultPrevented()||(o?.(e,...t),E())}),N=(0,yu.A)(e=>{if(a?.(e),e.preventDefault(),c||d)return;let t=e.clipboardData.getData("text");if("number"==typeof h){let e=f.sections[h],n=/^[a-zA-Z]+$/.test(t),r=/^[0-9]+$/.test(t),i=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(t);if("letter"===e.contentType&&n||"digit"===e.contentType&&r||"digit-with-letter"===e.contentType&&i){y(),x({activeSection:e,newSectionValue:t,shouldGoToNextSection:!0});return}if(n||r)return}y(),b(t)}),B=(0,yu.A)((...e)=>{s?.(...e),C(null)}),z=(0,yu.A)(e=>{let n;if(c)return;let r=e.target.value;if(""===r){y(),S();return}let i=e.nativeEvent.data,o=i&&i.length>1,a=o?i:r,s=UC(a);if("all"===h&&C(p),null==p||o)return void b(o?i:s);if("all"===h&&1===s.length)n=s;else{let e=UC(g.getV6InputValueFromSections(O,T,t)),r=-1,i=-1;for(let t=0;t<e.length;t+=1)-1===r&&e[t]!==s[t]&&(r=t),-1===i&&e[e.length-t-1]!==s[s.length-t-1]&&(i=t);let o=O[p];if(r<o.start||e.length-i-1>o.end)return;let a=s.length-e.length+o.end-UC(o.endSeparator||"").length;n=s.slice(o.start+UC(o.startSeparator||"").length,a)}if(0===n.length){navigator.userAgent.toLowerCase().includes("android")&&A(a),y(),w();return}v({keyPressed:n,sectionIndex:p})}),F=I.useMemo(()=>void 0!==u?u:g.getV6InputValueFromSections(M(m.emptyValue),T,t),[u,g,M,m.emptyValue,T,t]),j=I.useMemo(()=>f.tempValueStrAndroid??g.getV6InputValueFromSections(f.sections,T,t),[f.sections,g,f.tempValueStrAndroid,T,t]);return I.useEffect(()=>(_.current&&_.current===G4(document)&&C("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]),{interactions:R,returnedValue:{readOnly:c,onBlur:B,onClick:L,onFocus:P,onPaste:N,inputRef:D,enableAccessibleFieldDOMStructure:!1,placeholder:F,inputMode:I.useMemo(()=>null==p||"letter"===f.sections[p].contentType?"text":"numeric",[p,f.sections]),autoComplete:"off",value:!(_.current&&_.current===G4(document))&&k?"":j,onChange:z}}},Uk=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],UT=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],U_=["minDateTime","maxDateTime"];[...Uk,...UT,...U_];let UI=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],UD=["clearable","onClear","InputProps","sx","slots","slotProps"],UO=["ownerState"];var UR=n(54227),UE=n(75472);function UP(e){return(0,V.Ay)("MuiPickersTextField",e)}function UL(e){return(0,V.Ay)("MuiPickersInputBase",e)}(0,j.A)("MuiPickersTextField",["root","focused","disabled","error","required"]);let UN=(0,j.A)("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function UB(e){return(0,V.Ay)("MuiPickersOutlinedInput",e)}let Uz=(0,oU.A)({},UN,(0,j.A)("MuiPickersOutlinedInput",["root","notchedOutline","input"])),UF=["children","className","label","notched","shrink"],Uj=(0,N.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}}),UV=(0,N.A)("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),UH=(0,N.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 U$(e){let{className:t,label:n}=e,r=(0,zD.A)(e,UF),i=null!=n&&""!==n,o=(0,oU.A)({},e,{withLabel:i});return(0,_.jsx)(Uj,(0,oU.A)({"aria-hidden":!0,className:t},r,{ownerState:o,children:(0,_.jsx)(UH,{ownerState:o,children:i?(0,_.jsx)(UV,{children:n}):(0,_.jsx)(UV,{className:"notranslate",children:"​"})})}))}var UW=n(85235);function UG(e){return(0,V.Ay)("MuiPickersSectionList",e)}let UU=(0,j.A)("MuiPickersSectionList",["root","section","sectionContent"]),Uq=["slots","slotProps","elements","sectionListRef"],UY=(0,N.A)("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),UX=(0,N.A)("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),UZ=(0,N.A)("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),UK=(0,N.A)("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"});function UQ(e){let{slots:t,slotProps:n,element:r,classes:i}=e,o=t?.section??UX,a=(0,mG.A)({elementType:o,externalSlotProps:n?.section,externalForwardedProps:r.container,className:i.section,ownerState:{}}),s=t?.sectionContent??UK,l=(0,mG.A)({elementType:s,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:i.sectionContent,ownerState:{}}),u=t?.sectionSeparator??UZ,c=(0,mG.A)({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),d=(0,mG.A)({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return(0,_.jsxs)(o,(0,oU.A)({},a,{children:[(0,_.jsx)(u,(0,oU.A)({},c)),(0,_.jsx)(s,(0,oU.A)({},l)),(0,_.jsx)(u,(0,oU.A)({},d))]}))}let UJ=I.forwardRef(function(e,t){let n=Hw({props:e,name:"MuiPickersSectionList"}),{slots:r,slotProps:i,elements:o,sectionListRef:a}=n,s=(0,zD.A)(n,Uq),l=(e=>{let{classes:t}=e;return(0,R.A)({root:["root"],section:["section"],sectionContent:["sectionContent"]},UG,t)})(n),u=I.useRef(null),c=(0,gZ.A)(t,u),d=e=>{if(!u.current)throw Error(`MUI X: Cannot call sectionListRef.${e} before the mount of the component.`);return u.current};I.useImperativeHandle(a,()=>({getRoot:()=>d("getRoot"),getSectionContainer:e=>d("getSectionContainer").querySelector(`.${UU.section}[data-sectionindex="${e}"]`),getSectionContent:e=>d("getSectionContent").querySelector(`.${UU.section}[data-sectionindex="${e}"] .${UU.sectionContent}`),getSectionIndexFromDOMElement(e){let t=d("getSectionIndexFromDOMElement");if(null==e||!t.contains(e))return null;let n=null;return(e.classList.contains(UU.section)?n=e:e.classList.contains(UU.sectionContent)&&(n=e.parentElement),null==n)?null:Number(n.dataset.sectionindex)}}));let h=r?.root??UY,p=(0,mG.A)({elementType:h,externalSlotProps:i?.root,externalForwardedProps:s,additionalProps:{ref:c,suppressContentEditableWarning:!0},className:l.root,ownerState:{}});return(0,_.jsx)(h,(0,oU.A)({},p,{children:p.contentEditable?o.map(({content:e,before:t,after:n})=>`${t.children}${e.children}${n.children}`).join(""):(0,_.jsx)(I.Fragment,{children:o.map((e,t)=>(0,_.jsx)(UQ,{slots:r,slotProps:i,element:e,classes:l},t))})}))}),U0=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],U1=(0,N.A)("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>(0,oU.A)({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${Math.round(.15/16*1e5)/1e5}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),U2=(0,N.A)(UY,{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:r})=>!e&&!t&&!n&&null==r,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:"light"===e.palette.mode?.42:.5}}]})),U5=(0,N.A)(UX,{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"})),U4=(0,N.A)(UK,{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"})),U3=(0,N.A)(UZ,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),U6=(0,N.A)("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})((0,oU.A)({},{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"})),U8=I.forwardRef(function(e,t){let n=Hw({props:e,name:"MuiPickersInputBase"}),{elements:r,areAllSectionsEmpty:i,value:o,onChange:a,id:s,endAdornment:l,startAdornment:u,renderSuffix:c,slots:d,slotProps:h,contentEditable:p,tabIndex:f,onInput:g,onPaste:m,onKeyDown:v,name:y,readOnly:x,inputProps:b,inputRef:w,sectionListRef:S}=n,A=(0,zD.A)(n,U0),C=I.useRef(null),M=(0,gZ.A)(t,C),k=(0,gZ.A)(b?.ref,w),T=(0,fj.I)(),D=(0,gH.A)();if(!D)throw Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");I.useEffect(()=>{D&&D.setAdornedStart(!!u)},[D,u]),I.useEffect(()=>{D&&(i?D.onEmpty():D.onFilled())},[D,i]);let O=(0,oU.A)({},n,D,{isRtl:T}),E=(e=>{let{focused:t,disabled:n,error:r,classes:i,fullWidth:o,readOnly:a,color:s,size:l,endAdornment:u,startAdornment:c}=e,d={root:["root",t&&!n&&"focused",n&&"disabled",a&&"readOnly",r&&"error",o&&"fullWidth",`color${(0,UW.A)(s)}`,"small"===l&&"inputSizeSmall",!!c&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return(0,R.A)(d,UL,i)})(O),P=d?.root||U1,L=(0,mG.A)({elementType:P,externalSlotProps:h?.root,externalForwardedProps:A,additionalProps:{"aria-invalid":D.error,ref:M},className:E.root,ownerState:O}),N=d?.input||U2;return(0,_.jsxs)(P,(0,oU.A)({},L,{children:[u,(0,_.jsx)(UJ,{sectionListRef:S,elements:r,contentEditable:p,tabIndex:f,className:E.sectionsContainer,onFocus:e=>{D.disabled?e.stopPropagation():D.onFocus?.(e)},onBlur:D.onBlur,onInput:g,onPaste:m,onKeyDown:v,slots:{root:N,section:U5,sectionContent:U4,sectionSeparator:U3},slotProps:{root:{ownerState:O},sectionContent:{className:UN.sectionContent},sectionSeparator:({position:e})=>({className:"before"===e?UN.sectionBefore:UN.sectionAfter})}}),l,c?c((0,oU.A)({},D)):null,(0,_.jsx)(U6,(0,oU.A)({name:y,className:E.input,value:o,onChange:a,id:s,"aria-hidden":"true",tabIndex:-1,readOnly:x,required:D.required,disabled:D.disabled},b,{ref:k}))]}))}),U9=["label","autoFocus","ownerState","notched"],U7=(0,N.A)(U1,{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 .${Uz.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Uz.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${Uz.focused} .${Uz.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Uz.disabled}`]:{[`& .${Uz.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${Uz.error} .${Uz.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:{[`&.${Uz.focused}:not(.${Uz.error}) .${Uz.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}}))}}),qe=(0,N.A)(U2,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),qt=I.forwardRef(function(e,t){let n=Hw({props:e,name:"MuiPickersOutlinedInput"}),{label:r,ownerState:i,notched:o}=n,a=(0,zD.A)(n,U9),s=(0,gH.A)(),l=(0,oU.A)({},n,i,s,{color:s?.color||"primary"}),u=(e=>{let{classes:t}=e,n=(0,R.A)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},UB,t);return(0,oU.A)({},t,n)})(l);return(0,_.jsx)(U8,(0,oU.A)({slots:{root:U7,input:qe},renderSuffix:e=>(0,_.jsx)(U$,{shrink:!!(o||e.adornedStart||e.focused||e.filled),notched:!!(o||e.adornedStart||e.focused||e.filled),className:u.notchedOutline,label:null!=r&&""!==r&&s?.required?(0,_.jsxs)(I.Fragment,{children:[r," ","*"]}):r,ownerState:l})},a,{label:r,classes:u,ref:t}))});qt.muiName="Input";var qn=n(57867);function qr(e){return(0,V.Ay)("MuiPickersFilledInput",e)}let qi=(0,oU.A)({},UN,(0,j.A)("MuiPickersFilledInput",["root","underline","input"])),qo=["label","autoFocus","disableUnderline","ownerState"],qa=(0,N.A)(U1,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>(0,qn.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}},[`&.${qi.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n},[`&.${qi.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"},[`&.${qi.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${qi.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(.${qi.disabled}, .${qi.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${qi.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:12}},{props:({endAdornment:e})=>!!e,style:{paddingRight:12}}]}}),qs=(0,N.A)(U2,{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}}]}),ql=I.forwardRef(function(e,t){let n=Hw({props:e,name:"MuiPickersFilledInput"}),{label:r,disableUnderline:i=!1,ownerState:o}=n,a=(0,zD.A)(n,qo),s=(0,gH.A)(),l=(e=>{let{classes:t,disableUnderline:n}=e,r=(0,R.A)({root:["root",!n&&"underline"],input:["input"]},qr,t);return(0,oU.A)({},t,r)})((0,oU.A)({},n,o,s,{color:s?.color||"primary"}));return(0,_.jsx)(U8,(0,oU.A)({slots:{root:qa,input:qs},slotProps:{root:{disableUnderline:i}}},a,{label:r,classes:l,ref:t}))});function qu(e){return(0,V.Ay)("MuiPickersFilledInput",e)}ql.muiName="Input";let qc=(0,oU.A)({},UN,(0,j.A)("MuiPickersInput",["root","input"])),qd=["label","autoFocus","disableUnderline","ownerState"],qh=(0,N.A)(U1,{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"},[`&.${qc.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${qc.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(.${qc.disabled}, .${qc.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${qc.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),qp=I.forwardRef(function(e,t){let n=Hw({props:e,name:"MuiPickersInput"}),{label:r,disableUnderline:i=!1,ownerState:o}=n,a=(0,zD.A)(n,qd),s=(0,gH.A)(),l=(e=>{let{classes:t,disableUnderline:n}=e,r=(0,R.A)({root:["root",!n&&"underline"],input:["input"]},qu,t);return(0,oU.A)({},t,r)})((0,oU.A)({},n,o,s,{disableUnderline:i,color:s?.color||"primary"}));return(0,_.jsx)(U8,(0,oU.A)({slots:{root:qh}},a,{label:r,classes:l,ref:t}))});qp.muiName="Input";let qf=["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"],qg={standard:qp,filled:ql,outlined:qt},qm=(0,N.A)(v7.A,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),qv=I.forwardRef(function(e,t){let n=Hw({props:e,name:"MuiPickersTextField"}),{onFocus:r,onBlur:i,className:o,color:a="primary",disabled:s=!1,error:l=!1,variant:u="outlined",required:c=!1,InputProps:d,inputProps:h,inputRef:p,sectionListRef:f,elements:g,areAllSectionsEmpty:m,onClick:v,onKeyDown:y,onKeyUp:x,onPaste:b,onInput:w,endAdornment:S,startAdornment:A,tabIndex:C,contentEditable:M,focused:k,value:T,onChange:D,fullWidth:E,id:P,name:L,helperText:N,FormHelperTextProps:B,label:z,InputLabelProps:F}=n,j=(0,zD.A)(n,qf),V=I.useRef(null),H=(0,gZ.A)(t,V),$=(0,vL.A)(P),W=N&&$?`${$}-helper-text`:void 0,G=z&&$?`${$}-label`:void 0,U=(0,oU.A)({},n,{color:a,disabled:s,error:l,focused:k,required:c,variant:u}),q=(e=>{let{focused:t,disabled:n,classes:r,required:i}=e;return(0,R.A)({root:["root",t&&!n&&"focused",n&&"disabled",i&&"required"]},UP,r)})(U),Y=qg[u];return(0,_.jsxs)(qm,(0,oU.A)({className:(0,O.A)(q.root,o),ref:H,focused:k,onFocus:r,onBlur:i,disabled:s,variant:u,error:l,color:a,fullWidth:E,required:c,ownerState:U},j,{children:[(0,_.jsx)(UR.A,(0,oU.A)({htmlFor:$,id:G},F,{children:z})),(0,_.jsx)(Y,(0,oU.A)({elements:g,areAllSectionsEmpty:m,onClick:v,onKeyDown:y,onKeyUp:x,onInput:w,onPaste:b,endAdornment:S,startAdornment:A,tabIndex:C,contentEditable:M,value:T,onChange:D,id:$,fullWidth:E,inputProps:h,inputRef:p,sectionListRef:f,label:z,name:L,role:"group","aria-labelledby":G,"aria-describedby":W,"aria-live":W?"polite":void 0},d)),N&&(0,_.jsx)(UE.A,(0,oU.A)({id:W},B,{children:N}))]}))}),qy=["enableAccessibleFieldDOMStructure"],qx=["InputProps","readOnly"],qb=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],qw=["slots","slotProps","InputProps","inputProps"],qS=I.forwardRef(function(e,t){let n=Hw({props:e,name:"MuiDateTimeField"}),{slots:r,slotProps:i,InputProps:o,inputProps:a}=n,s=(0,zD.A)(n,qw),l=r?.textField??(e.enableAccessibleFieldDOMStructure?qv:eC.A),u=(0,mG.A)({elementType:l,externalSlotProps:i?.textField,externalForwardedProps:s,ownerState:n,additionalProps:{ref:t}});u.inputProps=(0,oU.A)({},a,u.inputProps),u.InputProps=(0,oU.A)({},o,u.InputProps);let c=(e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=(0,zD.A)(e,qy);if(t){let{InputProps:e,readOnly:t}=n,r=(0,zD.A)(n,qx);return(0,oU.A)({},r,{InputProps:(0,oU.A)({},e??{},{readOnly:t})})}let{onPaste:r,onKeyDown:i,inputMode:o,readOnly:a,InputProps:s,inputProps:l,inputRef:u}=n,c=(0,zD.A)(n,qb);return(0,oU.A)({},c,{InputProps:(0,oU.A)({},s??{},{readOnly:a}),inputProps:(0,oU.A)({},l??{},{inputMode:o,onPaste:r,onKeyDown:i,ref:u})})})((e=>{let t,n,r,i,o,{forwardedProps:a,internalProps:s}=(t=H_().utils,n=H_().defaultDates,r=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.keyboardDateTime12h:t.formats.keyboardDateTime24h,i=(0,oU.A)({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??r,disableIgnoringDatePartForTimeValidation:!!(e.minDateTime||e.maxDateTime),minDate:HR(t,e.minDateTime??e.minDate,n.minDate),maxDate:HR(t,e.maxDateTime??e.maxDate,n.maxDate),minTime:e.minDateTime??e.minTime,maxTime:e.maxDateTime??e.maxTime}),o="date-time",I.useMemo(()=>{let e=(0,oU.A)({},i),t={},n=n=>{e.hasOwnProperty(n)&&(t[n]=e[n],delete e[n])};return UI.forEach(n),Uk.forEach(n),UT.forEach(n),U_.forEach(n),{forwardedProps:e,internalProps:t}},[i,o]));return(e=>{let t=H_().utils,{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:i,enableAccessibleFieldDOMStructure:o=!1,disabled:a=!1,readOnly:s=!1},forwardedProps:{onKeyDown:l,error:u,clearable:c,onClear:d},fieldValueManager:h,valueManager:p,validator:f}=e,g=(0,fj.I)(),m=(e=>{let t=H_().utils,n=H_().localeText,r=H_(),i=(0,fj.I)(),{valueManager:o,fieldValueManager:a,valueType:s,validator:l,internalProps:u,internalProps:{value:c,defaultValue:d,referenceDate:h,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:A}=Wh({timezone:x,value:c,defaultValue:d,referenceDate:h,onChange:p,valueManager:o}),C=I.useMemo(()=>{let e;return e=t.date(void 0),"0"===t.formatByString(t.setSeconds(e,0),"s")?Wx:Array.from({length:10}).map((n,r)=>t.formatByString(t.setSeconds(e,r),"s"))},[t]),M=I.useMemo(()=>((e,t,n)=>{let r=e.date(void 0,n),i=e.endOfYear(r),o=e.endOfDay(r),{maxDaysInMonth:a,longestMonth:s}=HE(e,r).reduce((t,n)=>{let r=e.getDaysInMonth(n);return r>t.maxDaysInMonth?{maxDaysInMonth:r,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(i)+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=Wv(e,t).map(Number);return{minimum:Math.min(...n),maximum:Math.max(...n)}}return{minimum:1,maximum:7}},hours:({format:n})=>{let i=e.getHours(o);return Wb(e.formatByString(e.endOfDay(r),n),t)!==i.toString()?{minimum:1,maximum:Number(Wb(e.formatByString(e.startOfDay(r),n),t))}:{minimum:0,maximum:i}},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]),k=I.useCallback((e,r=null)=>a.getSectionsFromValue(t,e,r,e=>US({utils:t,localeText:n,localizedDigits:C,format:f,date:e,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:i})),[a,f,n,C,i,y,t,g,b]),[T,_]=I.useState(()=>{let e=k(S);W_(e,s);let n={sections:e,value:S,referenceValue:o.emptyValue,tempValueStrAndroid:null},r=Math.max(...e.map(e=>Wf[e.type]??1)),i=o.getInitialReferenceValue({referenceDate:h,value:S,utils:t,props:u,granularity:r,timezone:w});return(0,oU.A)({},n,{referenceValue:i})}),[D,O]=(0,yl.A)({controlled:m,default:null,name:"useField",state:"selectedSections"}),R=e=>{O(e),v?.(e)},E=I.useMemo(()=>WO(D,T.sections),[D,T.sections]),P="all"===E?0:E,L=({value:e,referenceValue:n,sections:i})=>{if(_(t=>(0,oU.A)({},t,{sections:i,value:e,referenceValue:n,tempValueStrAndroid:null})),o.areValuesEqual(t,T.value,e))return;let a={validationError:l({adapter:r,value:e,timezone:w,props:u})};A(e,a)},N=(e,t)=>{let n=[...T.sections];return n[e]=(0,oU.A)({},n[e],{value:t,modified:!0}),n};return I.useEffect(()=>{let e=k(T.value);W_(e,s),_(t=>(0,oU.A)({},t,{sections:e}))},[f,t.locale,i]),I.useEffect(()=>{o.areValuesEqual(t,T.value,S)&&o.getTimezone(t,T.value)===o.getTimezone(t,S)||_(e=>(0,oU.A)({},e,{value:S,referenceValue:a.updateReferenceValue(t,S,e.referenceValue),sections:k(S)}))},[S]),{state:T,activeSectionIndex:P,parsedSelectedSections:E,setSelectedSections:R,clearValue:()=>{L({value:o.emptyValue,referenceValue:T.referenceValue,sections:k(o.emptyValue)})},clearActiveSection:()=>{if(null==P)return;let e=T.sections[P],n=a.getActiveDateManager(t,T,e),r=n.getSections(T.sections).filter(e=>""!==e.value).length===+(""!==e.value),i=N(P,""),o=r?null:t.getInvalidDate(),s=n.getNewValuesFromNewActiveDate(o);L((0,oU.A)({},s,{sections:i}))},updateSectionValue:({activeSection:e,newSectionValue:n,shouldGoToNextSection:r})=>{let i,o;r&&P<T.sections.length-1&&R(P+1);let s=a.getActiveDateManager(t,T,e),l=N(P,n),u=s.getSections(l),c=((e,t,n)=>{let r=t.some(e=>"day"===e.type),i=[],o=[];for(let e=0;e<t.length;e+=1){let a=t[e];r&&"weekDay"===a.type||(i.push(a.format),o.push(WM(a,"non-input",n)))}let a=i.join(" "),s=o.join(" ");return e.parse(s,a)})(t,u,C);if(null!=c&&t.isValid(c)){let e=WD(t,c,u,s.referenceDate,!0);i=s.getNewValuesFromNewActiveDate(e),o=!0}else i=s.getNewValuesFromNewActiveDate(c),o=(null!=c&&!t.isValid(c))!=(null!=s.date&&!t.isValid(s.date));return o?L((0,oU.A)({},i,{sections:l})):_(e=>(0,oU.A)({},e,i,{sections:l,tempValueStrAndroid:null}))},updateValueFromValueStr:e=>{let r=a.parseValueStr(e,T.referenceValue,(e,r)=>{let o=t.parse(e,f);if(null==o||!t.isValid(o))return null;let a=US({utils:t,localeText:n,localizedDigits:C,format:f,date:o,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:i});return WD(t,o,a,r,!1)}),o=a.updateReferenceValue(t,r,T.referenceValue);L({value:r,referenceValue:o,sections:k(r,T.sections)})},setTempAndroidValueStr:e=>_(t=>(0,oU.A)({},t,{tempValueStrAndroid:e})),getSectionsFromValue:k,sectionsValueBoundaries:M,localizedDigits:C,timezone:w}})(e),{state:v,activeSectionIndex:y,parsedSelectedSections:x,setSelectedSections:b,clearValue:w,clearActiveSection:S,updateSectionValue:A,setTempAndroidValueStr:C,sectionsValueBoundaries:M,localizedDigits:k,timezone:T}=m,_=(({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:i,timezone:o})=>{let a=H_().utils,[s,l]=I.useState(null),u=(0,yu.A)(()=>l(null));I.useEffect(()=>{null!=s&&e[s.sectionIndex]?.type!==s.sectionType&&u()},[e,s,u]),I.useEffect(()=>{if(null!=s){let e=setTimeout(()=>u(),5e3);return()=>{clearTimeout(e)}}return()=>{}},[s,u]);let c=({keyPressed:t,sectionIndex:n},r,i)=>{let o=t.toLowerCase(),a=e[n];if(null!=s&&(!i||i(s.value))&&s.sectionIndex===n){let e=`${s.value}${o}`,t=r(e,a);if(null==t.saveQuery)return l({sectionIndex:n,value:e,sectionType:a.type}),t}let c=r(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,yu.A)(s=>{var l;let u,d,h,p=e[s.sectionIndex],f=WS(s.keyPressed,r)?(l=(0,oU.A)({},s,{keyPressed:Ww(s.keyPressed,r)}),u=(e,t)=>{let i=Wb(e,r),o=Number(i),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||i.length===s.maximum.toString().length;return{sectionValue:WC(a,o,s,r,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=WT(a,"digit","month","MM"),r=u(e,{type:t.type,format:"MM",hasLeadingZerosInFormat:n,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(null!=r.saveQuery)return r;let i=Wk(a,r.sectionValue,"MM",t.format);return(0,oU.A)({},r,{sectionValue:i})}if("weekDay"===t.type){let n=u(e,t);if(null!=n.saveQuery)return n;let r=Wv(a,t.format)[Number(n.sectionValue)-1];return(0,oU.A)({},n,{sectionValue:r})}return{saveQuery:!1}},e=>WS(e,r))):(d=(e,t,n)=>{let r=t.filter(e=>e.toLowerCase().startsWith(n));return 0===r.length?{saveQuery:!1}:{sectionValue:r[0],shouldGoToNextSection:1===r.length}},h=(e,t,n,r)=>{let i=e=>Wy(a,o,t.type,e);if("letter"===t.contentType)return d(t.format,i(t.format),e);if(n&&null!=r&&"letter"===Wm(a,n).contentType){let t=i(n),o=d(n,t,e);return null!=o.saveQuery?{saveQuery:!1}:(0,oU.A)({},o,{sectionValue:r(o.sectionValue,t)})}return{saveQuery:!1}},c(s,(e,t)=>{switch(t.type){case"month":return h(e,t,a.formats.month,e=>Wk(a,e,a.formats.month,t.format));case"weekDay":return h(e,t,a.formats.weekday,(e,t)=>t.indexOf(e).toString());case"meridiem":return h(e,t);default:return{saveQuery:!1}}}));null==f?i(null):t({activeSection:p,newSectionValue:f.sectionValue,shouldGoToNextSection:f.shouldGoToNextSection})}),resetCharacterQuery:u}})({sections:v.sections,updateSectionValue:A,sectionsValueBoundaries:M,localizedDigits:k,setTempAndroidValueStr:C,timezone:T}),{resetCharacterQuery:D}=_,O=p.areValuesEqual(t,v.value,p.emptyValue),R=o?UA:UM,E=I.useMemo(()=>((e,t)=>{let n={};if(!t)return e.forEach((t,r)=>{let i=r===e.length-1?null:r+1;n[r]={leftIndex:0===r?null:r-1,rightIndex:i}}),{neighbors:n,startIndex:0,endIndex:e.length-1};let r={},i={},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)i[e]=s,r[s]=e,s-=1;o=a+1}return e.forEach((t,o)=>{let a=i[o],s=0===a?null:r[a-1],l=a===e.length-1?null:r[a+1];n[o]={leftIndex:s,rightIndex:l}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}})(v.sections,g&&!o),[v.sections,g,o]),{returnedValue:P,interactions:L}=R((0,oU.A)({},e,m,_,{areAllSectionsEmpty:O,sectionOrder:E})),N=(0,yu.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(E.startIndex);else if("all"===x)b(E.endIndex);else{let e=E.neighbors[x].rightIndex;null!==e&&b(e)}break;case"ArrowLeft"===e.key:if(e.preventDefault(),null==x)b(E.endIndex);else if("all"===x)b(E.startIndex);else{let e=E.neighbors[x].leftIndex;null!==e&&b(e)}break;case"Delete"===e.key:if(e.preventDefault(),s)break;null==x||"all"===x?w():S(),D();break;case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(e.key):{if(e.preventDefault(),s||null==y)break;"all"===x&&b(y);let n=v.sections[y],r=h.getActiveDateManager(t,v,n),o=((e,t,n,r,i,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}})(r),u="Home"===r,c="End"===r,d=""===n.value||u||c;if("digit"===n.contentType||"digit-with-letter"===n.contentType){let r,h=i[n.type]({currentDate:a,format:n.format,contentType:n.contentType}),p="minutes"===n.type&&s?.minutesStep?s.minutesStep:1;if(d){if("year"===n.type&&!c&&!u)return e.formatByString(e.date(void 0,t),n.format);r=l>0||u?h.minimum:h.maximum}else r=parseInt(Wb(n.value,o),10)+l*p;return(r%p!=0&&((l<0||u)&&(r+=p-(p+r)%p),(l>0||c)&&(r-=r%p)),r>h.maximum)?WC(e,h.minimum+(r-h.maximum-1)%(h.maximum-h.minimum+1),h,o,n):r<h.minimum?WC(e,h.maximum-(h.minimum-r-1)%(h.maximum-h.minimum+1),h,o,n):WC(e,r,h,o,n)}let h=Wy(e,t,n.type,n.format);if(0===h.length)return n.value;if(d)return l>0||u?h[0]:h[h.length-1];let p=((h.indexOf(n.value)+l)%h.length+h.length)%h.length;return h[p]})(t,T,n,e.key,M,k,r.date,{minutesStep:i});A({activeSection:n,newSectionValue:o,shouldGoToNextSection:!1})}}});(0,gK.A)(()=>{L.syncSelectionToDOM()});let{hasValidationError:B}=G2({props:n,validator:f,timezone:T,value:v.value,onError:n.onError}),z=I.useMemo(()=>void 0!==u?u:B,[B,u]);I.useEffect(()=>{z||null!=y||D()},[v.referenceValue,y,z]),I.useEffect(()=>{null!=v.tempValueStrAndroid&&null!=y&&(D(),S())},[v.sections]),I.useImperativeHandle(r,()=>({getSections:()=>v.sections,getActiveSectionIndex:L.getActiveSectionIndexFromDOM,setSelectedSections:L.setSelectedSections,focusField:L.focusField,isFieldFocused:L.isFieldFocused}));let F={onKeyDown:N,onClear:(0,yu.A)((e,...t)=>{e.preventDefault(),d?.(e,...t),w(),L.isFieldFocused()?b(E.startIndex):L.focusField(0)}),error:z,clearable:!!(c&&!O&&!s&&!a)};return(0,oU.A)({},e.forwardedProps,F,{disabled:a,readOnly:s},P)})({forwardedProps:a,internalProps:s,valueManager:WE,fieldValueManager:WP,validator:Ux,valueType:"date-time"})})(u)),d=(e=>{let t=H_().localeText,{clearable:n,onClear:r,InputProps:i,sx:o,slots:a,slotProps:s}=e,l=(0,zD.A)(e,UD),u=a?.clearButton??eA,c=(0,mG.A)({elementType:u,externalSlotProps:s?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),d=(0,zD.A)(c,UO),h=a?.clearIcon??$n,p=(0,mG.A)({elementType:h,externalSlotProps:s?.clearIcon,ownerState:{}});return(0,oU.A)({},l,{InputProps:(0,oU.A)({},i,{endAdornment:(0,_.jsxs)(I.Fragment,{children:[n&&(0,_.jsx)(gU,{position:"end",sx:{marginRight:i?.endAdornment?-1:-1.5},children:(0,_.jsx)(u,(0,oU.A)({},d,{onClick:r,children:(0,_.jsx)(h,(0,oU.A)({fontSize:"small"},p))}))}),i?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(o)?o:[o]]})})((0,oU.A)({},c,{slots:r,slotProps:i}));return(0,_.jsx)(l,(0,oU.A)({},d))});var qA=n(65130);function qC(e,t,n){return(0,i4.w)(n?.in||e,+(0,i2.a)(e)+t)}var qM=n(38086);function qk(e,t){let n=(0,i2.a)(e,t?.in);return n.setHours(23,59,59,999),n}function qT(e,t){let n=(0,i2.a)(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function q_(e,t){let n=(0,i2.a)(e,t?.in),r=n.getFullYear(),i=n.getMonth(),o=(0,i4.w)(n,0);return o.setFullYear(r,i+1,0),o.setHours(0,0,0,0),o.getDate()}function qI(e,t){return+(0,i2.a)(e)>+(0,i2.a)(t)}function qD(e,t){return+(0,i2.a)(e)<+(0,i2.a)(t)}function qO(e,t){let n=(0,i2.a)(e,t?.in);return n.setMinutes(0,0,0),n}class qR{subPriority=0;validate(e,t){return!0}}class qE extends qR{constructor(e,t,n,r,i){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=r,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}}class qP extends qR{priority=10;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>(0,i4.w)(t,e))}set(e,t){var n,r;let i;if(t.timestampIsSet)return e;return(0,i4.w)(e,((i="function"==typeof(r=n=this.context)&&r.prototype?.constructor===r?new n(0):(0,i4.w)(n,0)).setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),i.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),i))}}class qL{run(e,t,n,r){let i=this.parse(e,t,n,r);return i?{setter:new qE(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,n){return!0}}let qN=/^(1[0-2]|0?\d)/,qB=/^(3[0-1]|[0-2]?\d)/,qz=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,qF=/^(5[0-3]|[0-4]?\d)/,qj=/^(2[0-3]|[0-1]?\d)/,qV=/^(2[0-4]|[0-1]?\d)/,qH=/^(1[0-1]|0?\d)/,q$=/^(1[0-2]|0?\d)/,qW=/^[0-5]?\d/,qG=/^[0-5]?\d/,qU=/^\d/,qq=/^\d{1,2}/,qY=/^\d{1,3}/,qX=/^\d{1,4}/,qZ=/^-?\d+/,qK=/^-?\d/,qQ=/^-?\d{1,2}/,qJ=/^-?\d{1,3}/,q0=/^-?\d{1,4}/,q1=/^([+-])(\d{2})(\d{2})?|Z/,q2=/^([+-])(\d{2})(\d{2})|Z/,q5=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,q4=/^([+-])(\d{2}):(\d{2})|Z/,q3=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function q6(e,t){return e?{value:t(e.value),rest:e.rest}:e}function q8(e,t){let n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function q9(e,t){let n=t.match(e);if(!n)return null;if("Z"===n[0])return{value:0,rest:t.slice(1)};let r="+"===n[1]?1:-1,i=n[2]?parseInt(n[2],10):0,o=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:r*(i*i6.s0+6e4*o+1e3*a),rest:t.slice(n[0].length)}}function q7(e,t){switch(e){case 1:return q8(qU,t);case 2:return q8(qq,t);case 3:return q8(qY,t);case 4:return q8(qX,t);default:return q8(RegExp("^\\d{1,"+e+"}"),t)}}function Ye(e,t){switch(e){case 1:return q8(qK,t);case 2:return q8(qQ,t);case 3:return q8(qJ,t);case 4:return q8(q0,t);default:return q8(RegExp("^-?\\d{1,"+e+"}"),t)}}function Yt(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Yn(e,t){let n,r=t>0,i=r?t:1-t;if(i<=50)n=e||100;else{let t=i+50;n=e+100*Math.trunc(t/100)-100*(e>=t%100)}return r?n:1-n}function Yr(e){return e%400==0||e%4==0&&e%100!=0}let Yi=[31,28,31,30,31,30,31,31,30,31,30,31],Yo=[31,29,31,30,31,30,31,31,30,31,30,31];function Ya(e,t,n){let r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??nO.weekStartsOn??nO.locale?.options?.weekStartsOn??0,i=(0,i2.a)(e,n?.in),o=i.getDay(),a=7-r,s=t<0||t>6?t-(o+a)%7:((t%7+7)%7+a)%7-(o+a)%7;return(0,qA.f)(i,s,n)}let Ys={G:new class extends qL{priority=140;parse(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]},y:new class extends qL{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return q6(q7(4,e),r);case"yo":return q6(n.ordinalNumber(e,{unit:"year"}),r);default:return q6(q7(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){let r=e.getFullYear();if(n.isTwoDigitYear){let t=Yn(n.year,r);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}let i="era"in t&&1!==t.era?1-n.year:n.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}},Y:new class extends qL{priority=130;parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return q6(q7(4,e),r);case"Yo":return q6(n.ordinalNumber(e,{unit:"year"}),r);default:return q6(q7(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,r){let i=or(e,r);if(n.isTwoDigitYear){let t=Yn(n.year,i);return e.setFullYear(t,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),i7(e,r)}let o="era"in t&&1!==t.era?1-n.year:n.year;return e.setFullYear(o,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),i7(e,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends qL{priority=130;parse(e,t){return"R"===t?Ye(4,e):Ye(t.length,e)}set(e,t,n){let r=(0,i4.w)(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),oe(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends qL{priority=130;parse(e,t){return"u"===t?Ye(4,e):Ye(t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends qL{priority=120;parse(e,t,n){switch(t){case"Q":case"QQ":return q7(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends qL{priority=120;parse(e,t,n){switch(t){case"q":case"qq":return q7(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends qL{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case"M":return q6(q8(qN,e),r);case"MM":return q6(q7(2,e),r);case"Mo":return q6(n.ordinalNumber(e,{unit:"month"}),r);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}},L:new class extends qL{priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case"L":return q6(q8(qN,e),r);case"LL":return q6(q7(2,e),r);case"Lo":return q6(n.ordinalNumber(e,{unit:"month"}),r);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends qL{priority=100;parse(e,t,n){switch(t){case"w":return q8(qF,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return q7(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,r){let i,o;return i7((o=oi(i=(0,i2.a)(e,r?.in),r)-n,i.setDate(i.getDate()-7*o),(0,i2.a)(i,r?.in)),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends qL{priority=100;parse(e,t,n){switch(t){case"I":return q8(qF,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return q7(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){let r,i;return oe((i=on(r=(0,i2.a)(e,void 0),void 0)-n,r.setDate(r.getDate()-7*i),r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends qL{priority=90;subPriority=1;parse(e,t,n){switch(t){case"d":return q8(qB,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return q7(t.length,e)}}validate(e,t){let n=Yr(e.getFullYear()),r=e.getMonth();return n?t>=1&&t<=Yo[r]:t>=1&&t<=Yi[r]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends qL{priority=90;subpriority=1;parse(e,t,n){switch(t){case"D":case"DD":return q8(qz,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return q7(t.length,e)}}validate(e,t){return Yr(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends qL{priority=90;parse(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return(e=Ya(e,n,r)).setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends qL{priority=90;parse(e,t,n,r){let i=e=>{let t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return q6(q7(t.length,e),i);case"eo":return q6(n.ordinalNumber(e,{unit:"day"}),i);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return(e=Ya(e,n,r)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends qL{priority=90;parse(e,t,n,r){let i=e=>{let t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return q6(q7(t.length,e),i);case"co":return q6(n.ordinalNumber(e,{unit:"day"}),i);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return(e=Ya(e,n,r)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends qL{priority=90;parse(e,t,n){let r=e=>0===e?7:e;switch(t){case"i":case"ii":return q7(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return q6(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return q6(n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return q6(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);default:return q6(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){var r,i;let o,a,s;return r=e,o=(0,i2.a)(r,void 0),i=void 0,s=0===(a=(0,i2.a)(o,i?.in).getDay())?7:a,(e=(0,qA.f)(o,n-s,void 0)).setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends qL{priority=80;parse(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(Yt(n),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends qL{priority=80;parse(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(Yt(n),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends qL{priority=80;parse(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(Yt(n),0,0,0),e}incompatibleTokens=["a","b","t","T"]},h:new class extends qL{priority=70;parse(e,t,n){switch(t){case"h":return q8(q$,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return q7(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){let r=e.getHours()>=12;return r&&n<12?e.setHours(n+12,0,0,0):r||12!==n?e.setHours(n,0,0,0):e.setHours(0,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]},H:new class extends qL{priority=70;parse(e,t,n){switch(t){case"H":return q8(qj,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return q7(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends qL{priority=70;parse(e,t,n){switch(t){case"K":return q8(qH,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return q7(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]},k:new class extends qL{priority=70;parse(e,t,n){switch(t){case"k":return q8(qV,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return q7(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){return e.setHours(n<=24?n%24:n,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends qL{priority=60;parse(e,t,n){switch(t){case"m":return q8(qW,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return q7(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=["t","T"]},s:new class extends qL{priority=50;parse(e,t,n){switch(t){case"s":return q8(qG,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return q7(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=["t","T"]},S:new class extends qL{priority=30;parse(e,t){return q6(q7(t.length,e),e=>Math.trunc(e*Math.pow(10,-t.length+3)))}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=["t","T"]},X:new class extends qL{priority=10;parse(e,t){switch(t){case"X":return q9(q1,e);case"XX":return q9(q2,e);case"XXXX":return q9(q5,e);case"XXXXX":return q9(q3,e);default:return q9(q4,e)}}set(e,t,n){return t.timestampIsSet?e:(0,i4.w)(e,e.getTime()-i5(e)-n)}incompatibleTokens=["t","T","x"]},x:new class extends qL{priority=10;parse(e,t){switch(t){case"x":return q9(q1,e);case"xx":return q9(q2,e);case"xxxx":return q9(q5,e);case"xxxxx":return q9(q3,e);default:return q9(q4,e)}}set(e,t,n){return t.timestampIsSet?e:(0,i4.w)(e,e.getTime()-i5(e)-n)}incompatibleTokens=["t","T","X"]},t:new class extends qL{priority=40;parse(e){return q8(qZ,e)}set(e,t,n){return[(0,i4.w)(e,1e3*n),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends qL{priority=20;parse(e){return q8(qZ,e)}set(e,t,n){return[(0,i4.w)(e,n),{timestampIsSet:!0}]}incompatibleTokens="*"}},Yl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yu=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Yc=/^'([^]*?)'?$/,Yd=/''/g,Yh=/\S/,Yp=/[a-zA-Z]/,Yf={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"},Yg={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 Ym{constructor(e){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=Yf,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:r,lib:i}=e;this.locale=t,this.formats=(0,oU.A)({},Yg,n),this.longFormatters=r,this.lib=i||"date-fns"}}class Yv extends Ym{constructor({locale:e,formats:t}={}){super({locale:e??nD,formats:t,longFormatters:op}),this.parse=(e,t)=>""===e?null:function(e,t,n,r){let i=()=>(0,i4.w)(r?.in||n,NaN),o=Object.assign({},nO),a=r?.locale??o.locale??nD,s=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,l=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(!t)return e?i():(0,i2.a)(n,r?.in);let u={firstWeekContainsDate:s,weekStartsOn:l,locale:a},c=[new qP(r?.in,n)],d=t.match(Yu).map(e=>{let t=e[0];return t in op?(0,op[t])(e,a.formatLong):e}).join("").match(Yl),h=[];for(let n of d){var p,f;!r?.useAdditionalWeekYearTokens&&(p=n,og.test(p))&&ov(n,t,e),!r?.useAdditionalDayOfYearTokens&&(f=n,of.test(f))&&ov(n,t,e);let o=n[0],s=Ys[o];if(s){let{incompatibleTokens:t}=s;if(Array.isArray(t)){let e=h.find(e=>t.includes(e.token)||e.token===o);if(e)throw RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${n}\` at the same time`)}else if("*"===s.incompatibleTokens&&h.length>0)throw RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);h.push({token:o,fullToken:n});let r=s.run(e,n,a.match,u);if(!r)return i();c.push(r.setter),e=r.rest}else{if(o.match(Yp))throw RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");if("''"===n?n="'":"'"===o&&(n=n.match(Yc)[1].replace(Yd,"'")),0!==e.indexOf(n))return i();e=e.slice(n.length)}}if(e.length>0&&Yh.test(e))return i();let g=c.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,n)=>n.indexOf(e)===t).map(e=>c.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]),m=(0,i2.a)(n,r?.in);if(isNaN(+m))return i();let v={};for(let e of g){if(!e.validate(m,u))return i();let t=e.set(m,v,u);Array.isArray(t)?(m=t[0],Object.assign(v,t[1])):m=t}return m}(e,t,new Date,{locale:this.locale}),this.isValid=e=>null!=e&&oy(e),this.format=(e,t)=>this.formatByString(e,this.formats[t]),this.formatByString=(e,t)=>oC(e,t,{locale:this.locale}),this.isEqual=(e,t)=>null===e&&null===t||null!==e&&null!==t&&+(0,i2.a)(e)==+(0,i2.a)(t),this.isSameYear=(e,t)=>(function(e,t){let[n,r]=i3(void 0,e,t);return n.getFullYear()===r.getFullYear()})(e,t),this.isSameMonth=(e,t)=>(function(e,t){let[n,r]=i3(void 0,e,t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()})(e,t),this.isSameDay=(e,t)=>(function(e,t){let[n,r]=i3(void 0,e,t);return+i8(n)==+i8(r)})(e,t),this.isSameHour=(e,t)=>(function(e,t){let[n,r]=i3(void 0,e,t);return+qO(n)==+qO(r)})(e,t),this.isAfter=(e,t)=>qI(e,t),this.isAfterYear=(e,t)=>qI(e,qT(t)),this.isAfterDay=(e,t)=>qI(e,qk(t)),this.isBefore=(e,t)=>qD(e,t),this.isBeforeYear=(e,t)=>qD(e,this.startOfYear(t)),this.isBeforeDay=(e,t)=>qD(e,this.startOfDay(t)),this.isWithinRange=(e,[t,n])=>(function(e,t){let n=+(0,i2.a)(e,void 0),[r,i]=[+(0,i2.a)(t.start,void 0),+(0,i2.a)(t.end,void 0)].sort((e,t)=>e-t);return n>=r&&n<=i})(e,{start:t,end:n}),this.startOfYear=e=>i9(e),this.startOfMonth=e=>{let t;return(t=(0,i2.a)(e,void 0)).setDate(1),t.setHours(0,0,0,0),t},this.startOfWeek=e=>i7(e,{locale:this.locale}),this.startOfDay=e=>i8(e),this.endOfYear=e=>qT(e),this.endOfMonth=e=>{let t,n;return n=(t=(0,i2.a)(e,void 0)).getMonth(),t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t},this.endOfWeek=e=>{var t;let n,r,i;return t={locale:this.locale},n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??nO.weekStartsOn??nO.locale?.options?.weekStartsOn??0,i=(r=(0,i2.a)(e,t?.in)).getDay(),r.setDate(r.getDate()+((i<n?-7:0)+6-(i-n))),r.setHours(23,59,59,999),r},this.endOfDay=e=>qk(e),this.addYears=(e,t)=>(0,qM.P)(e,12*t,void 0),this.addMonths=(e,t)=>(0,qM.P)(e,t),this.addWeeks=(e,t)=>(0,qA.f)(e,7*t,void 0),this.addDays=(e,t)=>(0,qA.f)(e,t),this.addHours=(e,t)=>qC(e,t*i6.s0,void 0),this.addMinutes=(e,t)=>{let n;return(n=(0,i2.a)(e,void 0)).setTime(n.getTime()+6e4*t),n},this.addSeconds=(e,t)=>qC(e,1e3*t,void 0),this.getYear=e=>(0,i2.a)(e,void 0).getFullYear(),this.getMonth=e=>(0,i2.a)(e,void 0).getMonth(),this.getDate=e=>(0,i2.a)(e,void 0).getDate(),this.getHours=e=>(0,i2.a)(e,void 0).getHours(),this.getMinutes=e=>(0,i2.a)(e,void 0).getMinutes(),this.getSeconds=e=>(0,i2.a)(e).getSeconds(),this.getMilliseconds=e=>(0,i2.a)(e).getMilliseconds(),this.setYear=(e,t)=>{let n;return isNaN(+(n=(0,i2.a)(e,void 0)))?(0,i4.w)(e,NaN):(n.setFullYear(t),n)},this.setMonth=(e,t)=>{let n,r,i,o,a;return r=(n=(0,i2.a)(e,void 0)).getFullYear(),i=n.getDate(),(o=(0,i4.w)(e,0)).setFullYear(r,t,15),o.setHours(0,0,0,0),a=q_(o),n.setMonth(t,Math.min(i,a)),n},this.setDate=(e,t)=>{let n;return(n=(0,i2.a)(e,void 0)).setDate(t),n},this.setHours=(e,t)=>{let n;return(n=(0,i2.a)(e,void 0)).setHours(t),n},this.setMinutes=(e,t)=>{let n;return(n=(0,i2.a)(e,void 0)).setMinutes(t),n},this.setSeconds=(e,t)=>{let n;return(n=(0,i2.a)(e,void 0)).setSeconds(t),n},this.setMilliseconds=(e,t)=>{let n;return(n=(0,i2.a)(e,void 0)).setMilliseconds(t),n},this.getDaysInMonth=e=>q_(e),this.getWeekArray=e=>{let t=this.startOfWeek(this.startOfMonth(e)),n=this.endOfWeek(this.endOfMonth(e)),r=0,i=t,o=[];for(;this.isBefore(i,n);){let e=Math.floor(r/7);o[e]=o[e]||[],o[e].push(i),i=this.addDays(i,1),r+=1}return o},this.getWeekNumber=e=>oi(e,{locale:this.locale}),this.getYearRange=([e,t])=>{let n=this.startOfYear(e),r=this.endOfYear(t),i=[],o=n;for(;this.isBefore(o,r);)i.push(o),o=this.addYears(o,1);return i}}}let Yy="yyyy-MM-dd HH:mm:ss";function Yx(e,t){let n,r;return e?(0,nA.isRelativeTimeRange)(e)?e.pastDuration:(n=ok(e.start,Yy,t),r=ok(e.end,Yy,t),`${n} - ${r}`):"Custom Time Range"}let Yb=({initialTimeRange:e,onChange:t,onCancel:n,timeZone:r})=>{let i=["local","browser"].includes(r.toLowerCase())?Intl.DateTimeFormat().resolvedOptions().timeZone:r,[o,a]=(0,I.useState)(e),[s,l]=(0,I.useState)(!0),u=(e,t)=>{a(n=>({...n,[t]:e}))},c=e=>{u(e,"start")},d=e=>{u(e,"end")},h=()=>{var e,t;let n={start:o.start,end:o.end};if(e=n.start,t=n.end,oy(e)&&oy(t)?!!qD(e,t)||(console.error("End Time is before Start Time"),!1):(console.error("Invalid Date"),!1))return n};return(0,_.jsx)(HC,{dateAdapter:Yv,children:(0,_.jsxs)(ey.A,{spacing:2,sx:e=>({padding:e.spacing(1,0,2)}),children:[s&&(0,_.jsxs)(uQ,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,_.jsx)(u7.A,{variant:"h3",padding:1,paddingLeft:2,children:"Select Start Time"}),(0,_.jsx)(Ub,{timezone:i,displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:new i1(o.start,i),onChange:e=>{null!==e&&c(e)},onAccept:()=>{l(!1)}})]}),!s&&(0,_.jsxs)(uQ,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,_.jsx)(u7.A,{variant:"h3",padding:1,paddingLeft:2,children:"Select End Time"}),(0,_.jsx)(Ub,{timezone:i,displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:new i1(o.end,i),minDateTime:new i1(o.start,i),onChange:e=>{null!==e&&d(e)},onAccept:e=>{null!==e&&(l(!0),d(e))}})]}),(0,_.jsxs)(ey.A,{direction:"row",alignItems:"center",gap:1,pl:1,pr:1,children:[(0,_.jsx)(Ig.ErrorBoundary,{FallbackComponent:If,children:(0,_.jsx)(qS,{"data-testid":"start_time_input",timezone:i,label:"Start Time",value:new i1(o.start,i),onChange:e=>{e&&c(e)},onBlur:()=>h(),format:Yy})}),(0,_.jsx)(Ig.ErrorBoundary,{FallbackComponent:If,children:(0,_.jsx)(qS,{"data-testid":"end_time_input",timezone:i,label:"End Time",value:new i1(o.end,i),onChange:e=>{e&&d(e)},onBlur:()=>h(),format:Yy})})]}),(0,_.jsxs)(ey.A,{direction:"row",sx:{padding:e=>e.spacing(0,1)},gap:1,children:[(0,_.jsx)(em,{variant:"contained",onClick:()=>{let e;(e=h())&&t(e)},fullWidth:!0,children:"Apply"}),(0,_.jsx)(em,{variant:"outlined",onClick:()=>n(),fullWidth:!0,children:"Cancel"})]})]})})};function Yw({value:e,timeOptions:t,onChange:n,height:r,showCustomTimeRange:i=!0,timeZone:o,timeZoneOptions:a,onTimeZoneChange:s}){let l,{timeZone:u}=uF(),c=o??u,d=(0,I.useRef)(),[h,p]=(0,I.useState)(!1),f=(0,I.useMemo)(()=>(0,nA.isRelativeTimeRange)(e)?(0,nA.toAbsoluteTimeRange)(e):e,[e]),g=(0,I.useMemo)(()=>{var t;return{value:t=(0,nA.isRelativeTimeRange)(e)?void 0:e,display:Yx(t,c)}},[e,c]),[m,v]=(0,I.useState)(!1),y=a??nP(),[x,b]=(0,I.useState)(null),w=y.find(e=>e.value===c)?.display??c,S=oT(c),A=oT("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,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(e4.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,_.jsx)(uQ,{sx:{p:1,minWidth:260},onClick:e=>{e.stopPropagation()},children:(0,_.jsx)(yY,{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,_.jsx)(eC.A,{...e,placeholder:"Search timezones",size:"small"})})})}),(0,_.jsx)(e4.Ay,{anchorEl:d.current,anchorOrigin:{vertical:"bottom",horizontal:"center"},open:h,onClose:()=>p(!1),sx:e=>({padding:e.spacing(2)}),children:(0,_.jsx)(Yb,{initialTimeRange:f,onChange:e=>{n(e),p(!1),v(!1)},onCancel:()=>p(!1),timeZone:c})}),(0,_.jsx)(uQ,{ref:d,children:(0,_.jsxs)(fO.A,{open:m,value:Yx(e,c),onClick:()=>v(!m),IconComponent:Hv,renderValue:()=>(0,_.jsxs)(ey.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,_.jsx)("span",{children:t.find(t=>Yx(t.value,c)===Yx(e,c))?.display??Yx(e,c)}),S!==A&&(0,_.jsxs)(uQ,{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":r?{lineHeight:r,paddingY:0}:{}},children:[(0,_.jsx)(fD,{disableRipple:!0,onClick:e=>{e.preventDefault(),e.stopPropagation()},sx:{cursor:"default","&:hover":{backgroundColor:"transparent"},py:.5,px:1},children:(0,_.jsxs)(uQ,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[(0,_.jsxs)(uQ,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,_.jsx)(uQ,{sx:{typography:"subtitle1"},children:"Time Range"}),(0,_.jsxs)(uQ,{sx:{color:"text.secondary",typography:"caption",mt:.25},children:["Timezone: ",w]})]}),(0,_.jsx)(uQ,{sx:{display:"flex",alignItems:"center",pr:1,ml:1.5},children:(0,_.jsx)(eA,{size:"small","aria-label":"Select timezone",onClick:e=>{e.preventDefault(),e.stopPropagation(),b(e.currentTarget)},children:(0,_.jsx)(Hy,{fontSize:"small"})})})]})}),t.map((e,t)=>(0,_.jsx)(fD,{value:Yx(e.value,c),onClick:()=>{n(e.value)},children:e.display},t)),i&&(0,_.jsx)(fD,{value:Yx(g.value,c),onClick:()=>p(!0),children:g.display})]})})]})}function YS({value:e,onChange:t,timeZoneOptions:n,variant:r="standard",heightPx:i,...o}){let a,s=(0,I.useMemo)(()=>n??nP(),[n]);i&&(a="number"==typeof i?`${i}px`:i);let l=(0,I.useMemo)(()=>({minWidth:"compact"===r?"80px":"150px",...a&&{lineHeight:a,paddingY:0},...o.sx}),[r,a,o.sx]);return(0,_.jsx)(fO.A,{...o,value:e,onChange:(e,n)=>{var r;let i;r=e.target.value,(i=s.find(e=>e.value===r))&&t&&t(i)},sx:l,size:"compact"===r?"small":"medium",children:s.map(e=>(0,_.jsx)(fD,{value:e.value,children:e.display},e.value))})}function YA(e){let{markerColor:t,sx:n}=e;return(0,_.jsx)(uQ,{sx:iw({display:"inline-block",width:"11px",height:"11px",borderRadius:"2px",marginRight:1,verticalAlign:"top"},n),style:{backgroundColor:t}})}function YC(e){let{formattedY:t,markerColor:n,metricName:r,metricLabels:i}=e;return(0,_.jsxs)(ey.A,{spacing:.5,children:[(0,_.jsxs)(uQ,{sx:e=>({display:"flex",height:"16px",flexDirection:"row",alignItems:"center",justifyContent:"left",color:e.palette.common.white,fontSize:"11px"}),children:[(0,_.jsx)(YA,{markerColor:n,sx:{marginTop:.25}}),(0,_.jsxs)(uQ,{component:"span",children:[r,(0,_.jsx)(uQ,{component:"span",sx:e=>({color:e.palette.common.white,fontWeight:700,paddingLeft:"2px"}),children:t})]})]}),(0,_.jsx)(gz,{sx:e=>({borderColor:e.palette.grey["500"]})}),(0,_.jsx)(uQ,{sx:e=>({color:e.palette.common.white}),children:i.map(e=>{if(e){let[t,n]=e.split("="),r=void 0!==n?`${t}: `:t,i=void 0!==n?n.replace(/(^"|"$)/g,""):n;return(0,_.jsxs)(uQ,{sx:{display:"flex",gap:"4px"},children:[(0,_.jsx)(u7.A,{sx:{fontSize:"11px"},children:r}),(0,_.jsx)(u7.A,{sx:e=>({color:e.palette.common.white,fontWeight:700,fontSize:"11px"}),children:i})]},e)}})})]})}let YM=375,Yk=650,YT=650,Y_=500,YI=.75,YD=8,YO=750,YR="nearby series showing in tooltip",YE="emphasized series showing as bold in tooltip",YP="#2E313E",YL=new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}),YN={coords:{plotCanvas:{x:0,y:0},zrender:{x:0,y:0},target:null},chartWidth:0},YB=[],Yz=()=>{let[e,t]=(0,I.useState)(null);return(0,I.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},YF={wrapLabels:!0,enablePinning:!0},Yj="Click chart to pin",YV="Click chart to unpin";function YH(e){let{seriesName:t,formattedY:n,markerColor:r,totalSeries:i,emphasizeText:o=!1,wrapLabels:a=!0}=e,s=t.split("{"),l=(s[1]??t).replace(/[{}]/g,"").split(",");if(1===i&&l.length>1){let e=s[0]?`${s[0]}:`:"value:";return(0,_.jsx)(YC,{formattedY:n,metricName:e,metricLabels:l,markerColor:r})}let u=t.replace(/[,]/g,", ");return(0,_.jsxs)(uQ,{sx:{display:"table-row",paddingTop:.5},children:[(0,_.jsxs)(uQ,{sx:{display:"table-cell",maxWidth:"520px"},children:[(0,_.jsx)(YA,{markerColor:r,sx:{marginTop:.5}}),(0,_.jsx)(uQ,{component:"span",sx:e=>({display:"inline-block",width:"calc(100% - 20px)",minWidth:150,maxWidth:Y_,overflow:"hidden",color:e.palette.common.white,fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular,textOverflow:"ellipsis",whiteSpace:a?"normal":"nowrap"}),"aria-label":o?YE:YR,children:u})]}),(0,_.jsx)(uQ,{sx:e=>({display:"table-cell",paddingLeft:1.5,textAlign:"right",verticalAlign:"top",fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular}),children:n})]})}function Y$(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 YW(e,t,n,r,i){if(null===e||(null!==t&&(e=t),void 0===e.plotCanvas.x))return;let o=n>0?n:YT,a=r>0?r:Yk,s=e.page.x+32,l=e.page.y+16;if(i){let e=i.getBoundingClientRect();s=s-e.left+i.scrollLeft,l=l-e.top+i.scrollTop;let t=e.top+i.scrollHeight;l+o>t&&(l=Math.max(t-o-16,YD/2))}else l+o>window.innerHeight+window.scrollY&&(l=Math.max(window.innerHeight+window.scrollY-o-16,YD/2));return s+a>window.innerWidth&&(s=e.page.x-a-32),s<32&&(s=32),l<YD/2&&(l=YD/2),`translate3d(${s}px, ${l}px, 0)`}function YG(e,t,n){return{minWidth:YM,maxWidth:Yk,maxHeight:(n?n-YD:void 0)??YT,padding:0,position:"absolute",top:0,left:0,backgroundColor:e.palette.designSystem?.grey[800]??YP,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 YU(e,t){try{let n=t.convertToPixel("grid",[e,0]);return n?.[0]??null}catch{return null}}function Yq(e,t,n,r){let i=n[e];if(!i)return t;let o=i.stack;if(!o)return t;let a=o.toString(),s=(r.get(a)??0)+t;return r.set(a,s),s}function YY(e,t,n){let r,i,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=YU(e,n);if(null===l)return 20;if(null!==a&&null!==s){let e=YU(a,n)??l,t=YU(s,n)??l;r=(l+e)/2,i=(l+t)/2}else if(null!==a){let e=YU(a,n)??l;r=(l+e)/2,i=l+(l-r)}else{if(null===s)return 20;let e=YU(s,n)??l;i=(l+e)/2,r=l-(i-l)}return Math.max(1,i-r)}function YX(e,t,n,r){let i=t/Math.max(1,r),o=n-t/2+e*i;return{left:o,right:o+i}}function YZ(e,t,n){try{let r=n.convertToPixel("grid",[0,e]),i=n.convertToPixel("grid",[0,t]);if(!r||!i||void 0===r[1]||void 0===i[1])return null;return{top:Math.min(i[1],r[1]),bottom:Math.max(i[1],r[1])}}catch{return null}}let YK=5.5,YQ=30,YJ=5;function Y0(e,t,n,r,i,o,a,s,l){let u=n[0]??null,c=n[1]??null;if(null===u||null===c||void 0===i.dispatchAction||!Array.isArray(e))return YB;let d=ix(e[0]?.values,u);if(null===d)return YB;let h=null;if(void 0!==s){let e=i.convertToPixel("grid",[0,c]),t=i.convertToPixel("grid",[0,c+r]);e&&t&&void 0!==e[1]&&void 0!==t[1]&&(h=Math.abs(t[1]-e[1]))}let p=l??YU(d,i),f=function(e,t,n,r,i,o,a,s,l){let u=[],c=e.length,d=new Map,h=[],p=e[0]?.values;if(p&&p.length>0){let e=new Set;for(let[t]of p)e.has(t)||(e.add(t),h.push(t));h=h.toSorted((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!==i&&(g=YY(n,h,l),m=YU(n,l));for(let h=0;h<c;h++){let c,p=t[h];if(!p)continue;let v=e[h];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(),A=-1,C=0;for(let e=0;e<y.length;e++){let t=y[e];if(t&&t[0]===n){A=e,C=t[0],c=t[1];break}}if(-1===A||null==c)continue;let M=!1,k=c,T=1/0;if("line"===x)if(k=Yq(h,c,t,d),void 0!==o&&null!==s)try{let e=l.convertToPixel({seriesIndex:h},[A,k]);if(e&&void 0!==e[1]){let t=Math.abs(o-e[1]);M=t<=s,T=t}else{let e=Math.abs(k-r);M=e<=a,T=e}}catch{let e=Math.abs(k-r);M=e<=a,T=e}else{let e=Math.abs(k-r);M=e<=a,T=e}else if("bar"===x){if(null===i||null===g||null===m)continue;let e=f.indexOf(h);if(-1===e)continue;let n=YX(e,g,m,f.length);if(!(i>=n.left&&i<=n.right))continue;let o=p.stack,a=!0;if(o){let e=o.toString(),n=YZ(d.get(e)??0,k=Yq(h,c,t,d),l);if(n){let e=l.convertToPixel("grid",[0,r]);e&&void 0!==e[1]&&(a=e[1]>=n.top&&e[1]<=n.bottom)}}else k=c;if(!a)continue;T=Math.abs(i-(n.left+n.right)/2),M=!0}M&&u.push({seriesIdx:h,datumIdx:A,seriesId:w,seriesName:b,date:n,markerColor:S,x:C,y:c,visualY:k,distance:T})}return u}(e,t,d,c,p,s,r,h,i),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,r,i,o){let a=[],s=[],l=[...o],u=[],c=[],d=new Map,h=[];for(let i of e){let e=r?.get(i.seriesId)??n,o=i.y,p=r2(o,e),f=null!==t&&i.seriesIdx===t.seriesIdx;if(f){s.push(i.seriesIdx);let e=d.get(o)??0;d.set(o,e+1),e>0&&c.push({seriesIndex:i.seriesIdx,dataIndex:i.datumIdx,seriesName:i.seriesName,yValue:o}),u.push({seriesIndex:i.seriesIdx,dataIndex:i.datumIdx,seriesName:i.seriesName,yValue:o})}else l.push(i.seriesIdx);h.push({seriesIdx:i.seriesIdx,datumIdx:i.datumIdx,seriesName:i.seriesName,date:i.date,x:i.x,y:o,formattedY:p,markerColor:i.markerColor,isClosestToCursor:f}),a.push(i.seriesIdx)}return iv(i,a,s,l,u,c),h}(f,g,o,a,i,v)}function Y1(e,t,n,r,i){let o=[],a=t[0]??null,s=t[1]??null;if(null===a||null===s)return o;let l=[],u=[],c=[],d=e.timeSeries.length;if(Array.isArray(e.xAxis)&&Array.isArray(e.timeSeries))for(let t=0;t<d;t++){let h=e.timeSeries[t];if(void 0===h||o.length>=1e3)break;let p=h.name?h.name.toString():"",f=h.color??"#000";if(Array.isArray(h.data))for(let g=0;g<h.data.length;g++){let m=e.xAxis[g]??0,v=h.data[g];if(null!=v&&a===g&&"-"!==v&&s<=v+n&&s>=v-n){let e=Y5({valueToCheck:s,baseValue:v,percentage:Math.max(d>YJ?2:5,100/d)});e?u.push(t):(c.push(t),r?.dispatchAction!==void 0&&r.dispatchAction({type:"downplay",seriesIndex:t}));let n=m>0x174876e7ff?m:1e3*m,a=r2(v,i);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 r?.dispatchAction!==void 0&&(r.dispatchAction({type:"downplay",seriesIndex:c}),u.length>0?r.dispatchAction({type:"highlight",seriesIndex:u,notBlur:!1,escapeConnect:!0}):r.dispatchAction({type:"highlight",seriesIndex:l,notBlur:!0,escapeConnect:!0})),o}function Y2({mousePos:e,pinnedPos:t,data:n,seriesMapping:r,chart:i,format:o,seriesFormatMap:a,showAllSeries:s=!1}){if(void 0===i||null===e)return YB;let l=!1;if(null!==e.target){let t=e.target.parentElement;if(null!==t){let e=t.parentElement;null!==e&&i.getDom()===e&&(l=!0)}}if(null!==t&&(e=t,l=!0),!1===l||null===n||void 0===i._model||void 0===e.plotCanvas.x||void 0===e.plotCanvas.y)return YB;let u=e.plotCanvas.y,c=e.plotCanvas.x,d=im(c,u,i);if(null!==d){let e=i._model.getComponent("yAxis").axis.scale,t="log"===e.type,l=e._interval;if(t&&e.base){let t=e.base,n=e._extent,r=t**n[0];l=(t**n[1]-r)/100}let h=Y4({yInterval:l,totalSeries:n.length,showAllSeries:s}),p=r.some(e=>void 0!==e.yAxisIndex&&e.yAxisIndex>0);return Y0(n,r,d,h,i,o,a,p?u:void 0,c)}return YB}function Y5({valueToCheck:e,baseValue:t,percentage:n}){let r=n/100*t;return e>=t-r&&e<=t+r}function Y4({yInterval:e,totalSeries:t,showAllSeries:n=!1}){if(n)return 10*e;let r=.3*e;return t>YJ?Math.max(r,e*YQ/t):Math.max(r,e*YK)}function Y3(e){let{series:t,wrapLabels:n}=e,r=(0,I.useMemo)(()=>null===t?null:t.toSorted((e,t)=>e.y>t.y?-1:1),[t]);return null===t||null===r?null:(0,_.jsx)(uQ,{sx:e=>({display:"table",padding:e.spacing(.5,2)}),children:r.map(({datumIdx:e,seriesIdx:t,seriesName:i,y:o,formattedY:a,markerColor:s,isClosestToCursor:l})=>{if(null===e||null===t)return null;let u=t.toString()+e.toString();return(0,_.jsx)(YH,{seriesName:i,y:o,formattedY:a,markerColor:s,totalSeries:r.length,wrapLabels:n,emphasizeText:l},u)})})}var Y6=n(68003),Y8=n(4491),Y9=n(29917);let Y7=(0,I.memo)(function({nearbySeries:e,totalSeries:t,isTooltipPinned:n,showAllSeries:r,enablePinning:i=!0,onShowAllClick:o,onUnpinClick:a}){let s,l,u,{formatWithUserTimeZone:c}=uF(),d=e[0]?.date??null;if(null===d)return null;let h=i&&t>5;return(0,_.jsxs)(uQ,{sx:e=>({width:"100%",maxWidth:Yk,padding:e.spacing(1.5,2,.5,2),backgroundColor:e.palette.designSystem?.grey[800]??YP,position:"sticky",top:0,left:0}),children:[(0,_.jsxs)(uQ,{sx:{width:"100%",display:"flex",justifyContent:"start",alignItems:"center",paddingBottom:.5},children:[(l=c(s=new Date(d),"MMM dd, yyyy - "),u=c(s,"HH:mm:ss"),(0,_.jsxs)(uQ,{children:[(0,_.jsx)(u7.A,{variant:"caption",sx:e=>({color:e.palette.common.white}),children:l}),(0,_.jsx)(u7.A,{variant:"caption",children:(0,_.jsx)("strong",{children:u})})]})),(0,_.jsxs)(ey.A,{direction:"row",gap:1,sx:{marginLeft:"auto"},children:[h&&(0,_.jsxs)(ey.A,{direction:"row",gap:.5,alignItems:"center",sx:{textAlign:"right"},children:[(0,_.jsx)(u7.A,{sx:{fontSize:11},children:"Show All"}),(0,_.jsx)(Y6.A,{checked:r,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}})})]}),i&&(0,_.jsxs)(ey.A,{direction:"row",alignItems:"center",children:[(0,_.jsx)(u7.A,{sx:{marginRight:.5,fontSize:11,verticalAlign:"middle"},children:n?YV:Yj}),n?(0,_.jsx)(Y8,{onClick:()=>{void 0!==a&&a()},sx:{fontSize:16,cursor:"pointer"}}):(0,_.jsx)(Y9,{sx:{fontSize:16}})]})]})]}),(0,_.jsx)(gz,{sx:e=>({width:"100%",borderColor:e.palette.grey["500"]})})]})}),Xe=(0,I.memo)(function({containerId:e,chartRef:t,data:n,seriesMapping:r,enablePinning:i=!0,wrapLabels:o,format:a,seriesFormatMap:s,onUnpinClick:l,pinnedPos:u}){var c,d,h,p,f,g,m,v,y,x,b,w,S,A,C,M,k;let[T,D]=(0,I.useState)(!1),O=(0,I.useRef)(),R=(0,I.useRef)(null),E=Yz(),{height:P,width:L,ref:N}=(void 0===c&&(c={}),d=c.onResize,(h=(0,I.useRef)(void 0)).current=d,p=c.round||Math.round,f=(0,I.useRef)(),m=(g=(0,I.useState)({width:void 0,height:void 0}))[0],v=g[1],y=(0,I.useRef)(!1),(0,I.useEffect)(function(){return y.current=!1,function(){y.current=!0}},[]),x=(0,I.useRef)({width:void 0,height:void 0}),b=(0,I.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",r=Y$(t,n,"inlineSize"),i=Y$(t,n,"blockSize"),o=r?p(r):void 0,a=i?p(i):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,h.current?h.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,I.useRef)(null),(A=(0,I.useRef)(null)).current=w,C=(0,I.useRef)(null),(0,I.useEffect)(function(){M()}),M=(0,I.useCallback)(function(){var e=C.current,t=A.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,I.useEffect)(function(){return function(){S.current&&S.current.cleanup&&(S.current.cleanup(),S.current=null)}},[]),k=(0,I.useCallback)(function(e){C.current=e,M()},[M]),(0,I.useMemo)(function(){return{ref:k,width:m.width,height:m.height}},[k,m.width,m.height])),B=null!==u&&i,z=(0,I.useCallback)(e=>{R.current=e,N(e)},[N]),F=e?document.querySelector(e):void 0;if((0,I.useLayoutEffect)(()=>{if(null===E)return;let e=R.current;if(!e)return;let t=e.getBoundingClientRect();if(0===t.height||0===t.width)return;let n=YW(E,u,t.height,t.width,F);n&&n!==O.current&&(O.current=n,e.style.transform=n)}),null===E||null===E.target||null===n||null===u&&"CANVAS"!==E.target.tagName)return null;let j=t.current,V=F?F.getBoundingClientRect().height:void 0;O.current=YW(E,u,P??0,L??0,F);let H=Y2({mousePos:E,data:n,seriesMapping:r,pinnedPos:u,chart:j,format:a,seriesFormatMap:s,showAllSeries:T});if(0===H.length)return null;let $=n.length;return(0,_.jsx)(mU.A,{container:F,children:(0,_.jsx)(uQ,{ref:z,sx:e=>YG(e,u,V),style:{transform:O.current},children:(0,_.jsxs)(ey.A,{spacing:.5,children:[(0,_.jsx)(Y7,{nearbySeries:H,totalSeries:$,enablePinning:i,isTooltipPinned:B,showAllSeries:T,onShowAllClick:e=>D(e),onUnpinClick:l}),(0,_.jsx)(Y3,{series:H,wrapLabels:o})]})})})}),Xt=(0,N.A)(em)(({theme:e})=>({padding:e.spacing(.5),minWidth:"auto"})),Xn=(0,I.forwardRef)(function(e,t){return(0,_.jsx)(Xt,{ref:t,variant:"outlined",color:"secondary",...e})}),Xr=Object.entries(r1).map(([e,t])=>({...t,id:e,group:t.group||"Decimal"})).filter(e=>!e.disableSelectorOption);function Xi({value:e,onChange:t,disabled:n=!1,...r}){let i=r1[e?.unit||"decimal"];return(0,_.jsx)(yY,{value:{id:e?.unit||"decimal",...i},options:Xr,groupBy:e=>e.group??"Decimal",onChange:(e,n)=>{null===n?t(void 0):t({unit:n.id})},disabled:n,disableClearable:!0,renderInput:({InputProps:e,...r})=>(0,_.jsx)(eC.A,{...r,slotProps:{input:{...e,endAdornment:(0,_.jsxs)(_.Fragment,{children:[e.endAdornment,(0,_.jsx)(gU,{position:"end",children:(0,_.jsx)(eA,{size:"small","aria-label":"clear unit",onClick:()=>t(void 0),disabled:n,tabIndex:-1,children:(0,_.jsx)(vr,{fontSize:"small"})})})]})}}}),...r})}let Xo=[{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 Xa({value:e,onChange:t,disabled:n=!1}){var r;let i=it(e),o=ir(e);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(yo,{label:"Short values",control:(0,_.jsx)(Y6.A,{checked:!!o&&nZ(e.shortValues),onChange:(n,r)=>{o&&t({...e,shortValues:r})},disabled:!o})}),(0,_.jsx)(yo,{label:"Unit",control:(0,_.jsx)(Xi,{value:e,onChange:e=>{t(e||{unit:"decimal"})},disabled:n})}),(0,_.jsx)(yo,{label:"Decimals",control:(0,_.jsx)(yY,{value:(r=e.decimalPlaces,Xo.find(e=>e.decimalPlaces===r)),options:Xo,getOptionLabel:e=>e.label,onChange:(n,r)=>(({decimalPlaces:n})=>{i&&t({...e,decimalPlaces:n})})(r),disabled:!i,disableClearable:!0})})]})}function Xs({name:e,height:t}){return(0,_.jsx)(uQ,{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,_.jsx)(u7.A,{variant:"body1","aria-label":"y axis label",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})}let Xl=oF((0,uY.A)({}),{echartsTheme:{textStyle:{fontFamily:"Lato"},categoryAxis:{splitLine:{show:!1}},timeAxis:{splitLine:{show:!1}},bar:{barCategoryGap:2}}}),Xu={chartsTheme:Xl,enablePinning:!1,enableSyncGrouping:!0,lastTooltipPinnedCoords:null,setLastTooltipPinnedCoords:()=>null},Xc={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,[`& .${Ir.icon}`]:{color:e.palette.error.main}}:{...e.typography.body1,backgroundColor:e.palette.error.light,color:e.palette.error.dark,[`& .${Ir.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,[`& .${Ir.icon}`]:{color:e.palette.info.main}}:{...e.typography.body1,backgroundColor:e.palette.info.light,color:e.palette.info.dark,[`& .${Ir.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,[`& .${Ir.icon}`]:{color:e.palette.success.main}}:{...e.typography.body1,backgroundColor:e.palette.success.light,color:e.palette.success.dark,[`& .${Ir.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,[`& .${Ir.icon}`]:{color:e.palette.warning.main}}:{...e.typography.body1,backgroundColor:e.palette.warning.light,color:e.palette.warning.dark,[`& .${Ir.icon}`]:{color:e.palette.warning.main}},root:{["& ."+gd.root]:{textDecoration:"underline"}}}},Xd={styleOverrides:{root:({theme:e})=>({backgroundColor:e.palette.background.default})}},Xh={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"},Xp="#FFFFFF",Xf={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"},Xg={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"},Xm={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"},Xv={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"},Xy={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"},Xx=e=>"light"===e?{main:Xh["500"],dark:Xh["600"],light:Xh["50"]}:{main:Xh["400"],dark:Xh["800"],light:Xh["200"]},Xb={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"}},Xw=({theme:e})=>({..."light"===e.palette.mode?{}:{backgroundImage:"unset",backgroundColor:e.palette.designSystem.grey[800]}});function XS(e,t={},n=!1){var r,i;let o;return(0,uY.A)({palette:function(e){let t,n,r,i;return{mode:e,primary:Xx(e),secondary:"light"===e?{main:Xf["600"],dark:Xf["900"],light:Xf["100"]}:{main:Xp,dark:Xp,light:Xp},grey:"light"===e?{50:Xf["50"],100:Xf["100"],200:Xf["200"],300:Xf["300"],400:Xf["400"],500:Xf["500"],600:Xf["600"],700:Xf["700"],800:Xf["800"],900:Xf["900"],950:Xf["950"]}:{50:Xf["950"],100:Xf["900"],200:Xf["800"],300:Xf["700"],400:Xf["600"],500:Xf["500"],600:Xf["400"],700:Xf["300"],800:Xf["200"],900:Xf["100"],950:Xf["50"]},background:(t=Xh["150"],n="rgba(21, 23, 33, 0.75)","light"===e?{navigation:t,overlay:n,default:Xp,paper:Xf["50"],code:Xf["50"],tooltip:Xf["100"],lighter:Xf["50"],border:Xf["100"]}:{navigation:t,overlay:n,default:Xf["900"],paper:Xf["850"],code:Xf["800"],tooltip:Xf["600"],lighter:Xf["700"],border:Xf["600"]}),text:(r=Xf["800"],i=Xf["300"],"light"===e?{navigation:r,accent:i,primary:Xf["800"],secondary:Xf["700"],disabled:Xf["300"],link:Xh["500"],linkHover:Xh["600"]}:{navigation:r,accent:i,primary:Xp,secondary:Xf["50"],disabled:Xf["600"],link:Xh["400"],linkHover:Xh["500"]}),error:"light"===e?{main:Xy["500"],dark:Xy["600"],light:Xy["50"]}:{main:Xy["400"],dark:Xy["800"],light:Xy["300"]},warning:"light"===e?{main:Xm["500"],dark:Xm["700"],light:Xm["50"]}:{main:Xm["400"],dark:Xm["800"],light:Xm["300"]},info:Xx(e),success:"light"===e?{main:Xg["500"],dark:Xg["700"],light:Xg["50"]}:{main:Xg["400"],dark:Xg["800"],light:Xg["300"]},common:{white:Xp,black:"#000000"},designSystem:{blue:Xh,green:Xg,grey:Xf,orange:Xm,purple:Xv,red:Xy}}}(e),typography:Xb,mixins:{},components:(r=e,i=n,o={MuiAlert:Xc,MuiFormControl:{defaultProps:{size:"small"}},MuiPaper:Xd,MuiTextField:{defaultProps:{size:"small"}},MuiDrawer:{styleOverrides:{paper:Xw}},MuiDialog:{styleOverrides:{paper:Xw}},MuiPopover:{styleOverrides:{paper:Xw}}},i?o:{MuiCssBaseline:{styleOverrides:{body:{colorScheme:r}}},...o}),...t})}var XA=n(87275),XC=n(11061),XM=n(78536),Xk=n(1355);function XT({value:e,onChange:t}){return(0,_.jsxs)(ey.A,{direction:"row",children:[(0,_.jsx)(yq,{freeSolo:!0,multiple:!0,id:"join-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,_.jsx)(eC.A,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,r)=>{t({...e,spec:{...e.spec,columns:r}})}}),(0,_.jsx)(VY,{label:"Enabled",labelPlacement:"start",control:(0,_.jsx)(Y6.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function X_({value:e,onChange:t}){return(0,_.jsxs)(ey.A,{direction:"row",gap:1,alignItems:"center",children:[(0,_.jsx)(yq,{freeSolo:!0,multiple:!0,id:"merge-columns-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,_.jsx)(eC.A,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,r)=>{t({...e,spec:{...e.spec,columns:r}})}}),(0,_.jsx)(vu,{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,_.jsx)(VY,{label:"Enabled",labelPlacement:"start",control:(0,_.jsx)(Y6.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function XI({value:e,onChange:t}){return(0,_.jsxs)(ey.A,{direction:"row",children:[(0,_.jsx)(vu,{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,_.jsx)(VY,{label:"Enabled",labelPlacement:"start",control:(0,_.jsx)(Y6.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function XD({value:e,onChange:t}){return(0,_.jsx)(ey.A,{direction:"row",children:(0,_.jsx)(VY,{label:"Enabled",labelPlacement:"start",control:(0,_.jsx)(Y6.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})})}function XO({value:e,onChange:t,...n}){return(0,_.jsxs)(ey.A,{gap:2,sx:{width:"100%"},mt:1,...n,children:[(0,_.jsxs)(vu,{select:!0,label:"Kind",value:e.kind,onChange:n=>t({...e,kind:n}),children:[(0,_.jsx)(fD,{value:"JoinByColumnValue",children:(0,_.jsxs)(ey.A,{children:[(0,_.jsx)(u7.A,{children:"Join by column value"}),(0,_.jsx)(u7.A,{variant:"caption",children:"Regroup rows with equal cell value in a column"})]})}),(0,_.jsx)(fD,{value:"MergeColumns",children:(0,_.jsxs)(ey.A,{children:[(0,_.jsx)(u7.A,{children:"Merge columns"}),(0,_.jsx)(u7.A,{variant:"caption",children:"Multiple columns are merged to one column"})]})}),(0,_.jsx)(fD,{value:"MergeIndexedColumns",children:(0,_.jsxs)(ey.A,{children:[(0,_.jsx)(u7.A,{children:"Merge indexed columns"}),(0,_.jsx)(u7.A,{variant:"caption",children:"Indexed columns are merged to one column"})]})}),(0,_.jsx)(fD,{value:"MergeSeries",children:(0,_.jsxs)(ey.A,{children:[(0,_.jsx)(u7.A,{children:"Merge series"}),(0,_.jsx)(u7.A,{variant:"caption",children:"Series will be merged by their labels"})]})})]}),"JoinByColumnValue"===e.kind&&(0,_.jsx)(XT,{value:e,onChange:t}),"MergeColumns"===e.kind&&(0,_.jsx)(X_,{value:e,onChange:t}),"MergeIndexedColumns"===e.kind&&(0,_.jsx)(XI,{value:e,onChange:t}),"MergeSeries"===e.kind&&(0,_.jsx)(XD,{value:e,onChange:t})]})}function XR({index:e,value:t,isCollapsed:n,onChange:r,onCollapse:i,onDelete:o,...a}){return(0,_.jsxs)(ey.A,{...a,children:[(0,_.jsxs)(ey.A,{direction:"row",alignItems:"center",borderBottom:1,borderColor:e=>e.palette.divider,justifyContent:"space-between",gap:4,children:[(0,_.jsxs)(ey.A,{direction:"row",gap:1,children:[(0,_.jsx)(eA,{"data-testid":`transform-toggle#${e}`,size:"small",onClick:()=>i(!n),children:n?(0,_.jsx)(XC,{}):(0,_.jsx)(XA,{})}),(0,_.jsx)(u7.A,{variant:"overline",component:"h4",sx:{textTransform:"none"},children:t.kind?(0,_.jsx)("span",{children:(0,_.jsx)("strong",{children:il[t.kind]})}):(0,_.jsx)("strong",{children:"Select a transformation kind"})})]}),(0,_.jsxs)(ey.A,{direction:"row",gap:1,children:[n&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(vt,{title:t.spec?.disabled?"Enable transformation":"Disable transformation",placement:"top",children:(0,_.jsx)(eA,{size:"small",sx:{marginLeft:"auto"},onClick:function(){r({...t,spec:{...t.spec,disabled:!t.spec?.disabled}})},children:t.spec?.disabled?(0,_.jsx)(XM,{}):(0,_.jsx)(Xk,{})})}),(0,_.jsx)(gz,{flexItem:!0,orientation:"vertical",variant:"middle"})]}),(0,_.jsx)(vt,{title:"Remove transformation",placement:"top",children:(0,_.jsx)(eA,{size:"small",sx:{marginLeft:"auto"},onClick:o,children:(0,_.jsx)(Hp,{})})})]})]}),!n&&(0,_.jsx)(XO,{value:t,onChange:r})]})}function XE({value:e,onChange:t,...n}){let[r,i]=(0,I.useState)(e.map(()=>!0));return(0,_.jsxs)(ey.A,{gap:1,...n,children:[e.map((n,o)=>(0,_.jsx)(XR,{index:o,value:n,isCollapsed:r[o]??!0,onChange:n=>{let r;(r=[...e])[o]=n,t(r)},onDelete:()=>{let n;(n=[...e]).splice(o,1),t(n),i(e=>(e.splice(o,1),[...e]))},onCollapse:e=>{i(t=>(t[o]=e,[...t]))}},o)),(0,_.jsx)(em,{variant:"contained",startIcon:(0,_.jsx)(Hh,{}),sx:{marginTop:1},onClick:function(){let n=[...e];n.push({kind:"",spec:{}}),t(n),i(e=>(e.push(!1),[...e]))},children:"Add Transformation"})]})}function XP(e){let{value:t,onChange:n,timeOptions:r,height:i}=e,o=(0,I.useMemo)(()=>{if(t&&!r.some(e=>e.value.pastDuration===t))return(0,_.jsx)(fD,{value:t,children:t})},[r,t]);return(0,_.jsx)(v7.A,{children:(0,_.jsx)(uQ,{children:(0,_.jsxs)(fO.A,{id:"refreshInterval",value:t,onChange:e=>{n(e.target.value)},inputProps:{"aria-label":`Select refresh interval. Currently set to ${t}`},sx:{".MuiSelect-select":i?{lineHeight:i,paddingY:0}:{}},children:[r.map((e,t)=>(0,_.jsx)(fD,{value:e.value.pastDuration,children:e.display},t)),o]})})})}function XL({repeatItems:e,maxPer:t,gap:n,renderItem:r,containerSx:i,rowSx:o}){let{rows:a,perRow:s}=(0,I.useMemo)(()=>{let n=Math.max(1,t),r=[];for(let t=0;t<e.length;t+=n)r.push(e.slice(t,t+n));return{rows:r,perRow:n}},[t,e]);return(0,_.jsx)(uQ,{sx:[{display:"flex",flexDirection:"column",width:"100%",height:"100%",gap:`${n}px`},...Array.isArray(i)?i:[i]],children:a.map((e,t)=>(0,_.jsx)(uQ,{sx:[{display:"flex",gap:`${n}px`},...Array.isArray(o)?o:[o]],children:e.map((e,i)=>(0,_.jsx)(uQ,{sx:{width:`calc((100% - ${n*(s-1)}px) / ${s})`,overflow:"hidden"},children:r(e,{rowIndex:t,colIndex:i})},`${t}-${i}`))},t))})}var XN=n(94237),XB=n(7939),Xz=n(80787);let XF=(e,t,n)=>{let r=e.keys[0];if(Array.isArray(t))t.forEach((t,r)=>{n((t,n)=>{r<=e.keys.length-1&&(0===r?Object.assign(t,n):t[e.up(e.keys[r])]=n)},t)});else if(t&&"object"==typeof t){let i,o;(Object.keys(t).length>e.keys.length?e.keys:(i=e.keys,o=Object.keys(t),i.filter(e=>o.includes(e)))).forEach(i=>{if(e.keys.includes(i)){let o=t[i];void 0!==o&&n((t,n)=>{r===i?Object.assign(t,n):t[e.up(i)]=n},o)}})}else("number"==typeof t||"string"==typeof t)&&n((e,t)=>{Object.assign(e,t)},t)};function Xj(e){return`--Grid-${e}Spacing`}function XV(e){return`--Grid-parent-${e}Spacing`}let XH="--Grid-columns",X$="--Grid-parent-columns",XW=({theme:e,ownerState:t})=>{let n={};return XF(e.breakpoints,t.size,(e,t)=>{let r={};"grow"===t&&(r={flexBasis:0,flexGrow:1,maxWidth:"100%"}),"auto"===t&&(r={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"}),"number"==typeof t&&(r={flexGrow:0,flexBasis:"auto",width:`calc(100% * ${t} / var(${X$}) - (var(${X$}) - ${t}) * (var(${XV("column")}) / var(${X$})))`}),e(n,r)}),n},XG=({theme:e,ownerState:t})=>{let n={};return XF(e.breakpoints,t.offset,(e,t)=>{let r={};"auto"===t&&(r={marginLeft:"auto"}),"number"==typeof t&&(r={marginLeft:0===t?"0px":`calc(100% * ${t} / var(${X$}) + var(${XV("column")}) * ${t} / var(${X$}))`}),e(n,r)}),n},XU=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={[XH]:12};return XF(e.breakpoints,t.columns,(e,t)=>{let r=t??12;e(n,{[XH]:r,"> *":{[X$]:r}})}),n},Xq=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={};return XF(e.breakpoints,t.rowSpacing,(t,r)=>{let i="string"==typeof r?r:e.spacing?.(r);t(n,{[Xj("row")]:i,"> *":{[XV("row")]:i}})}),n},XY=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={};return XF(e.breakpoints,t.columnSpacing,(t,r)=>{let i="string"==typeof r?r:e.spacing?.(r);t(n,{[Xj("column")]:i,"> *":{[XV("column")]:i}})}),n},XX=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={};return XF(e.breakpoints,t.direction,(e,t)=>{e(n,{flexDirection:t})}),n},XZ=({ownerState:e})=>({minWidth:0,boxSizing:"border-box",...e.container&&{display:"flex",flexWrap:"wrap",...e.wrap&&"wrap"!==e.wrap&&{flexWrap:e.wrap},gap:`var(${Xj("row")}) var(${Xj("column")})`}}),XK=(0,Xz.A)(),XQ=(0,XB.A)("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>t.root});function XJ(e){return(0,Hx.A)({props:e,name:"MuiGrid",defaultTheme:XK})}let X0=function(e={}){let{createStyledComponent:t=XQ,useThemeProps:n=XJ,useTheme:r=uU.A,componentName:i="MuiGrid"}=e;function o(e,t,n=()=>!0){let r={};return null===e||(Array.isArray(e)?e.forEach((e,i)=>{null!==e&&n(e)&&t.keys[i]&&(r[t.keys[i]]=e)}):"object"==typeof e?Object.keys(e).forEach(t=>{let i=e[t];null!=i&&n(i)&&(r[t]=i)}):r[t.keys[0]]=e),r}let a=t(XU,XY,Xq,XW,XX,XZ,XG),s=I.forwardRef(function(e,t){var s;let l,u=r(),c=n(e),d=(0,uG.A)(c);s=u.breakpoints,l=[],void 0!==d.item&&(delete d.item,l.push("item")),void 0!==d.zeroMinWidth&&(delete d.zeroMinWidth,l.push("zeroMinWidth")),s.keys.forEach(e=>{void 0!==d[e]&&(l.push(e),delete d[e])});let{className:h,children:p,columns:f=12,container:g=!1,component:m="div",direction:v="row",wrap:y="wrap",size:x={},offset:b={},spacing:w=0,rowSpacing:S=w,columnSpacing:A=w,unstable_level:C=0,...M}=d,k=o(x,u.breakpoints,e=>!1!==e),T=o(b,u.breakpoints),D=e.columns??(C?void 0:f),E=e.spacing??(C?void 0:w),P=e.rowSpacing??e.spacing??(C?void 0:S),L=e.columnSpacing??e.spacing??(C?void 0:A),N={...d,level:C,columns:D,container:g,direction:v,wrap:y,spacing:E,rowSpacing:P,columnSpacing:L,size:k,offset:T},B=((e,t)=>{let n,{container:r,direction:o,spacing:a,wrap:s,size:l}=e,u={root:["root",r&&"container","wrap"!==s&&`wrap-xs-${String(s)}`,...void 0===o?[]:"object"==typeof o?Object.entries(o).map(([e,t])=>`direction-${e}-${t}`):[`direction-xs-${String(o)}`],...(n=[],Object.entries(l).forEach(([e,t])=>{!1!==t&&void 0!==t&&n.push(`grid-${e}-${String(t)}`)}),n),...r?((e,t="xs")=>{function n(e){return void 0!==e&&("string"==typeof e&&!Number.isNaN(Number(e))||"number"==typeof e&&e>0)}if(n(e))return[`spacing-${t}-${String(e)}`];if("object"==typeof e&&!Array.isArray(e)){let t=[];return Object.entries(e).forEach(([e,r])=>{n(r)&&t.push(`spacing-${e}-${String(r)}`)}),t}return[]})(a,t.breakpoints.keys[0]):[]]};return(0,R.A)(u,e=>(0,V.Ay)(i,e),{})})(N,u);return(0,_.jsx)(a,{ref:t,as:m,ownerState:N,className:(0,O.A)(B.root,h),...M,children:I.Children.map(p,e=>I.isValidElement(e)&&(0,XN.A)(e,["Grid"])&&g&&e.props.container?I.cloneElement(e,{unstable_level:e.props?.unstable_level??C+1}):e)})});return s.muiName="Grid",s}({createStyledComponent:(0,N.A)("div",{name:"MuiGrid2",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.container&&t.container]}}),componentName:"MuiGrid2",useThemeProps:e=>(0,F.b)({props:e,name:"MuiGrid2"}),useTheme:uH.A}),X1=({mapping:e,onChange:t,...n})=>{switch(e.kind){case"Value":return(0,_.jsx)(ey.A,{gap:1,direction:"row",...n,children:(0,_.jsx)(eC.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,_.jsxs)(ey.A,{gap:1,direction:"row",...n,children:[(0,_.jsx)(eC.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,_.jsx)(eC.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,_.jsx)(ey.A,{gap:1,direction:"row",...n,children:(0,_.jsx)(eC.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,_.jsx)(ey.A,{gap:1,direction:"row",...n,children:(0,_.jsxs)(eC.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,_.jsx)(fD,{value:"empty",children:(0,_.jsxs)(ey.A,{children:[(0,_.jsx)(u7.A,{children:"Empty"}),(0,_.jsx)(u7.A,{variant:"caption",children:"Matches empty string"})]})}),(0,_.jsx)(fD,{value:"null",children:(0,_.jsxs)(ey.A,{children:[(0,_.jsx)(u7.A,{children:"Null"}),(0,_.jsx)(u7.A,{variant:"caption",children:"Matches null or undefined"})]})}),(0,_.jsx)(fD,{value:"NaN",children:(0,_.jsxs)(ey.A,{children:[(0,_.jsx)(u7.A,{children:"NaN"}),(0,_.jsx)(u7.A,{variant:"caption",children:"Matches Not a Number value"})]})}),(0,_.jsx)(fD,{value:"true",children:(0,_.jsxs)(ey.A,{children:[(0,_.jsx)(u7.A,{children:"True"}),(0,_.jsx)(u7.A,{variant:"caption",children:"Matches true boolean"})]})}),(0,_.jsx)(fD,{value:"false",children:(0,_.jsxs)(ey.A,{children:[(0,_.jsx)(u7.A,{children:"False"}),(0,_.jsx)(u7.A,{variant:"caption",children:"Matches false boolean"})]})})]})});default:return null}},X2=({mapping:e,onChange:t,onDelete:n,...r})=>{let i=n=>{t({...e,spec:{...e.spec,result:{...e.spec.result,color:n}}})};return(0,_.jsxs)(X0,{container:!0,spacing:2,...r,children:[(0,_.jsx)(X0,{size:{xs:5},children:(0,_.jsxs)(ey.A,{direction:"row",gap:1,width:"100%",children:[(0,_.jsxs)(eC.A,{select:!0,label:"Type",value:e.kind,onChange:n=>t({...e,kind:n.target.value}),required:!0,sx:{width:"120px"},children:[(0,_.jsx)(fD,{value:"Value",children:(0,_.jsxs)(ey.A,{children:[(0,_.jsx)(u7.A,{children:"Value"}),"Value"!==e.kind&&(0,_.jsx)(u7.A,{variant:"caption",children:"Matches an exact text value"})]})}),(0,_.jsx)(fD,{value:"Range",children:(0,_.jsxs)(ey.A,{children:[(0,_.jsx)(u7.A,{children:"Range"}),"Range"!==e.kind&&(0,_.jsx)(u7.A,{variant:"caption",children:"Matches against a numerical range"})]})}),(0,_.jsx)(fD,{value:"Regex",children:(0,_.jsxs)(ey.A,{children:[(0,_.jsx)(u7.A,{children:"Regex"}),"Regex"!==e.kind&&(0,_.jsx)(u7.A,{variant:"caption",children:"Matches against a regular expression"})]})}),(0,_.jsx)(fD,{value:"Misc",children:(0,_.jsxs)(ey.A,{children:[(0,_.jsx)(u7.A,{children:"Misc"}),"Misc"!==e.kind&&(0,_.jsx)(u7.A,{variant:"caption",children:"Matches against empty, null and NaN values"})]})})]}),(0,_.jsx)(X1,{width:"100%",mapping:e,onChange:n=>t({...e,...n})})]})}),(0,_.jsx)(X0,{size:{xs:4},children:(0,_.jsx)(eC.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,_.jsx)(X0,{size:{xs:1},children:(0,_.jsx)(ey.A,{direction:"row",justifyContent:"center",gap:1,children:e.spec?.result?.color?(0,_.jsx)(uj,{label:"Color",color:e.spec.result.color??"#000",onColorChange:i,onClear:()=>i(void 0)}):(0,_.jsx)(eA,{onClick:()=>i("#000"),children:(0,_.jsx)(Hh,{})})})}),(0,_.jsx)(X0,{size:{xs:1},textAlign:"end",children:(0,_.jsx)(vt,{title:"Remove mapping settings",placement:"top",children:(0,_.jsx)(eA,{size:"small",sx:{marginLeft:"auto"},onClick:n,children:(0,_.jsx)(Hp,{})})})})]})},X5=({mappings:e,onChange:t})=>{let[n,r]=(0,I.useState)(e);return(0,_.jsxs)(ey.A,{spacing:1,children:[(0,_.jsxs)(X0,{container:!0,spacing:2,children:[(0,_.jsx)(X0,{size:{xs:5},children:(0,_.jsx)(u7.A,{variant:"subtitle1",children:"Condition"})}),(0,_.jsx)(X0,{size:{xs:4},children:(0,_.jsx)(u7.A,{variant:"subtitle1",children:"Display Text"})}),(0,_.jsx)(X0,{size:{xs:1},textAlign:"center",children:(0,_.jsx)(u7.A,{variant:"subtitle1",children:"Color"})}),(0,_.jsx)(X0,{size:{xs:1}})]}),(0,_.jsx)(ey.A,{gap:1.5,divider:(0,_.jsx)(gz,{flexItem:!0,orientation:"horizontal"}),children:n.map((e,i)=>(0,_.jsx)(X2,{mapping:e,onChange:e=>{let o;(o=[...n])[i]=e,r(o),t(o)},onDelete:()=>{let e;(e=[...n]).splice(i,1),r(e),t(e)}},i))}),(0,_.jsx)(em,{variant:"contained",startIcon:(0,_.jsx)(Hh,{}),sx:{marginTop:1},onClick:function(){let e=[...n];e.push({kind:"Value",spec:{result:{value:""}}}),r(e),t(e)},children:"Add value mappings"})]})}},65130(e,t,n){"use strict";n.d(t,{f:()=>o});var r=n(12015),i=n(4721);function o(e,t,n){let o=(0,i.a)(e,n?.in);return isNaN(t)?(0,r.w)(n?.in||e,NaN):(t&&o.setDate(o.getDate()+t),o)}},38086(e,t,n){"use strict";n.d(t,{P:()=>o});var r=n(12015),i=n(4721);function o(e,t,n){let o=(0,i.a)(e,n?.in);if(isNaN(t))return(0,r.w)(n?.in||e,NaN);if(!t)return o;let a=o.getDate(),s=(0,r.w)(n?.in||e,o.getTime());return(s.setMonth(o.getMonth()+t+1,0),a>=s.getDate())?s:(o.setFullYear(s.getFullYear(),s.getMonth(),a),o)}},30439(e,t,n){"use strict";n.d(t,{_P:()=>a,my:()=>r,s0:()=>o,w4:()=>i});let r=6048e5,i=864e5,o=36e5,a=Symbol.for("constructDateFrom")},12015(e,t,n){"use strict";n.d(t,{w:()=>i});var r=n(30439);function i(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&r._P in e?e[r._P](t):e instanceof Date?new e.constructor(t):new Date(t)}},4721(e,t,n){"use strict";n.d(t,{a:()=>i});var r=n(12015);function i(e,t){return(0,r.w)(t||e,e)}}}]);