@arcgis/core 4.28.0-next.20230708 → 4.28.0-next.20230711

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 (140) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{9e5f59a8e8f12cd9e5e0.js → 8faf88599f86ee276185.js} +1 -1
  3. package/assets/esri/core/workers/chunks/ddea45acae89759e57fa.js +1 -0
  4. package/assets/esri/core/workers/chunks/{2c2cab197c47f080772a.js → f5f0a5318337439d464e.js} +1 -1
  5. package/assets/esri/themes/base/widgets/_ElevationProfile.scss +0 -12
  6. package/assets/esri/themes/base/widgets/_Weather.scss +4 -0
  7. package/assets/esri/themes/dark/main.css +1 -1
  8. package/assets/esri/themes/light/main.css +1 -1
  9. package/assets/esri/themes/light/view.css +1 -1
  10. package/chunks/Button.js +1 -1
  11. package/chunks/LineSeries.js +5 -0
  12. package/chunks/Responsive.js +5 -0
  13. package/chunks/Theme.js +1 -1
  14. package/chunks/Tick.js +1 -1
  15. package/chunks/ar.js +1 -1
  16. package/chunks/ar2.js +1 -1
  17. package/chunks/bg_BG.js +1 -1
  18. package/chunks/bg_BG2.js +1 -1
  19. package/chunks/bs_BA.js +1 -1
  20. package/chunks/bs_BA2.js +1 -1
  21. package/chunks/ca_ES.js +1 -1
  22. package/chunks/ca_ES2.js +1 -1
  23. package/chunks/chartUtilsAm5.js +5 -0
  24. package/chunks/cs_CZ.js +1 -1
  25. package/chunks/cs_CZ2.js +1 -1
  26. package/chunks/da_DK.js +1 -1
  27. package/chunks/da_DK2.js +1 -1
  28. package/chunks/de_CH.js +1 -1
  29. package/chunks/de_CH2.js +1 -1
  30. package/chunks/de_DE.js +1 -1
  31. package/chunks/de_DE2.js +1 -1
  32. package/chunks/el_GR.js +1 -1
  33. package/chunks/el_GR2.js +1 -1
  34. package/chunks/en_CA.js +1 -1
  35. package/chunks/en_CA2.js +1 -1
  36. package/chunks/en_US.js +1 -1
  37. package/chunks/en_US2.js +1 -1
  38. package/chunks/es_ES.js +1 -1
  39. package/chunks/es_ES2.js +1 -1
  40. package/chunks/et_EE.js +1 -1
  41. package/chunks/et_EE2.js +1 -1
  42. package/chunks/fi_FI.js +1 -1
  43. package/chunks/fi_FI2.js +1 -1
  44. package/chunks/fr_FR.js +1 -1
  45. package/chunks/fr_FR2.js +1 -1
  46. package/chunks/he_IL.js +1 -1
  47. package/chunks/he_IL2.js +1 -1
  48. package/chunks/hr_HR.js +1 -1
  49. package/chunks/hr_HR2.js +1 -1
  50. package/chunks/hu_HU.js +1 -1
  51. package/chunks/hu_HU2.js +1 -1
  52. package/chunks/id_ID.js +1 -1
  53. package/chunks/id_ID2.js +1 -1
  54. package/chunks/it_IT.js +1 -1
  55. package/chunks/it_IT2.js +1 -1
  56. package/chunks/ja_JP.js +1 -1
  57. package/chunks/ja_JP2.js +1 -1
  58. package/chunks/ko_KR.js +1 -1
  59. package/chunks/ko_KR2.js +1 -1
  60. package/chunks/lt_LT.js +1 -1
  61. package/chunks/lt_LT2.js +1 -1
  62. package/chunks/lv_LV.js +1 -1
  63. package/chunks/lv_LV2.js +1 -1
  64. package/chunks/nb_NO.js +1 -1
  65. package/chunks/nb_NO2.js +1 -1
  66. package/chunks/nl_NL.js +1 -1
  67. package/chunks/nl_NL2.js +1 -1
  68. package/chunks/pl_PL.js +1 -1
  69. package/chunks/pl_PL2.js +1 -1
  70. package/chunks/pt_BR.js +1 -1
  71. package/chunks/pt_BR2.js +1 -1
  72. package/chunks/pt_PT.js +1 -1
  73. package/chunks/pt_PT2.js +1 -1
  74. package/chunks/ro_RO.js +1 -1
  75. package/chunks/ro_RO2.js +1 -1
  76. package/chunks/ru_RU.js +1 -1
  77. package/chunks/ru_RU2.js +1 -1
  78. package/chunks/sk_SK.js +1 -1
  79. package/chunks/sk_SK2.js +1 -1
  80. package/chunks/sl_SL.js +1 -1
  81. package/chunks/sl_SL2.js +1 -1
  82. package/chunks/sr_RS.js +1 -1
  83. package/chunks/sr_RS2.js +1 -1
  84. package/chunks/sv_SE.js +1 -1
  85. package/chunks/sv_SE2.js +1 -1
  86. package/chunks/th_TH.js +1 -1
  87. package/chunks/th_TH2.js +1 -1
  88. package/chunks/tr_TR.js +1 -1
  89. package/chunks/tr_TR2.js +1 -1
  90. package/chunks/uk_UA.js +1 -1
  91. package/chunks/uk_UA2.js +1 -1
  92. package/chunks/vi_VN.js +1 -1
  93. package/chunks/vi_VN2.js +1 -1
  94. package/chunks/zh_Hans.js +1 -1
  95. package/chunks/zh_Hans2.js +1 -1
  96. package/chunks/zh_Hant.js +1 -1
  97. package/chunks/zh_Hant2.js +1 -1
  98. package/interfaces.d.ts +12 -0
  99. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  100. package/layers/knowledgeGraph/SessionMemoryStorage.js +1 -1
  101. package/networks/Network.js +1 -1
  102. package/networks/UtilityNetwork.js +1 -1
  103. package/package.json +1 -1
  104. package/rest/networks/queryAssociations.js +1 -1
  105. package/rest/networks/queryNamedTraceConfigurations.js +1 -1
  106. package/rest/networks/support/QueryAssociationsParameters.js +1 -1
  107. package/rest/networks/support/QueryNamedTraceConfigurationsParameters.js +1 -1
  108. package/rest/networks/support/SynthesizeAssociationGeometriesParameters.js +1 -1
  109. package/rest/networks/synthesizeAssociationGeometries.js +1 -1
  110. package/rest/support/meshFeatureSet.js +1 -1
  111. package/support/revision.js +1 -1
  112. package/views/2d/engine/webgl/Painter.js +1 -1
  113. package/views/3d/environment/CloudsData.js +1 -1
  114. package/views/3d/environment/CloudsGenerator.js +1 -1
  115. package/views/3d/environment/CloudsParameters.js +5 -0
  116. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  117. package/views/3d/environment/Precipitation.js +1 -1
  118. package/views/3d/environment/weather.js +1 -1
  119. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +9 -9
  120. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  121. package/widgets/Editor/Edits.js +1 -1
  122. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  123. package/widgets/Editor.js +1 -1
  124. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  125. package/widgets/ElevationProfile/css.js +1 -1
  126. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  127. package/widgets/ElevationProfile.js +1 -1
  128. package/widgets/Feature/FeatureMedia/chartCommon.js +1 -1
  129. package/widgets/Feature/FeatureMedia/pieChart.js +1 -1
  130. package/widgets/Feature/FeatureMedia/xyChart.js +1 -1
  131. package/widgets/Feature/FeatureMedia.js +1 -1
  132. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  133. package/widgets/Weather/WeatherViewModel.js +1 -1
  134. package/widgets/Weather/css.js +1 -1
  135. package/widgets/Weather.js +1 -1
  136. package/widgets/support/chartUtils.js +1 -1
  137. package/widgets/support/chartUtilsAm5.js +1 -1
  138. package/assets/esri/core/workers/chunks/0f57b8d4fa3afb296392.js +0 -1
  139. package/views/3d/environment/CloudsCompositionParameters.js +0 -5
  140. package/views/3d/environment/weatherUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{am as t,a4 as e,ao as i,g as s,K as a,b as o,aE as n,R as r,aD as l,a3 as h,a7 as d,a5 as c,C as u,ad as g,aq as p,aa as m,f as _,e as x,aF as b,aG as f,Q as y,ak as v,y as P,z as w,aH as k,az as T,J as A,aI as D,ar as M,aJ as C,av as I,aj as X,af as Y,M as O,aK as S,aL as F,al as L,ax as R,ay as j,aM as V,a6 as G}from"../../../chunks/Theme.js";import{C as E}from"../../../chunks/ColorSet.js";import{s as N}from"../../../chunks/DefaultTheme.js";import{w as z,c as W,r as U,S as B,a as H,D as Z,C as q,T as K}from"../../../chunks/Tick.js";import{B as J,R as Q}from"../../../chunks/Button.js";import{a as $}from"../../../chunks/tslib.es6.js";function tt(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function et(t){this._context=t}function it(t){return new et(t)}function st(t){return t[0]}function at(t){return t[1]}function ot(t,e){var i=W(!0),s=null,a=it,o=null,n=z(r);function r(r){var l,h,d,c=(r=tt(r)).length,u=!1;for(null==s&&(o=a(d=n())),l=0;l<=c;++l)!(l<c&&i(h=r[l],l,r))===u&&((u=!u)?o.lineStart():o.lineEnd()),u&&o.point(+t(h,l,r),+e(h,l,r));if(d)return o=null,d+""||null}return t="function"==typeof t?t:void 0===t?st:W(t),e="function"==typeof e?e:void 0===e?at:W(e),r.x=function(e){return arguments.length?(t="function"==typeof e?e:W(+e),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:W(+t),r):e},r.defined=function(t){return arguments.length?(i="function"==typeof t?t:W(!!t),r):i},r.curve=function(t){return arguments.length?(a=t,null!=s&&(o=a(s)),r):a},r.context=function(t){return arguments.length?(null==t?s=o=null:o=a(s=t),r):s},r}function nt(t,e,i){var s=null,a=W(!0),o=null,n=it,r=null,l=z(h);function h(h){var d,c,u,g,p,m=(h=tt(h)).length,_=!1,x=new Array(m),b=new Array(m);for(null==o&&(r=n(p=l())),d=0;d<=m;++d){if(!(d<m&&a(g=h[d],d,h))===_)if(_=!_)c=d,r.areaStart(),r.lineStart();else{for(r.lineEnd(),r.lineStart(),u=d-1;u>=c;--u)r.point(x[u],b[u]);r.lineEnd(),r.areaEnd()}_&&(x[d]=+t(g,d,h),b[d]=+e(g,d,h),r.point(s?+s(g,d,h):x[d],i?+i(g,d,h):b[d]))}if(p)return r=null,p+""||null}function d(){return ot().defined(a).curve(n).context(o)}return t="function"==typeof t?t:void 0===t?st:W(+t),e="function"==typeof e?e:W(void 0===e?0:+e),i="function"==typeof i?i:void 0===i?at:W(+i),h.x=function(e){return arguments.length?(t="function"==typeof e?e:W(+e),s=null,h):t},h.x0=function(e){return arguments.length?(t="function"==typeof e?e:W(+e),h):t},h.x1=function(t){return arguments.length?(s=null==t?null:"function"==typeof t?t:W(+t),h):s},h.y=function(t){return arguments.length?(e="function"==typeof t?t:W(+t),i=null,h):e},h.y0=function(t){return arguments.length?(e="function"==typeof t?t:W(+t),h):e},h.y1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:W(+t),h):i},h.lineX0=h.lineY0=function(){return d().x(t).y(e)},h.lineY1=function(){return d().x(t).y(i)},h.lineX1=function(){return d().x(s).y(e)},h.defined=function(t){return arguments.length?(a="function"==typeof t?t:W(!!t),h):a},h.curve=function(t){return arguments.length?(n=t,null!=o&&(r=n(o)),h):n},h.context=function(t){return arguments.length?(null==t?o=r=null:r=n(o=t),h):o},h}et.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};class rt extends t{setupDefaultRules(){super.setupDefaultRules();const t=this._root.interfaceColors,l=this._root.language,h=this.rule.bind(this);h("XYChart").setAll({colors:E.new(this._root,{}),paddingLeft:20,paddingRight:20,paddingTop:16,paddingBottom:16,panX:!1,panY:!1,wheelStep:.25,arrangeTooltips:!0,pinchZoomX:!1,pinchZoomY:!1}),h("XYSeries").setAll({legendLabelText:"{name}"}),h("XYChart",["scrollbar","chart"]).setAll({paddingBottom:0,paddingLeft:0,paddingTop:0,paddingRight:0,colors:E.new(this._root,{saturation:0})});{const e=h("Graphics",["scrollbar","overlay"]);e.setAll({fillOpacity:.5}),N(e,"fill",t,"background")}h("RoundedRectangle",["xy","scrollbar","thumb"]).setAll({cornerRadiusTR:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusBL:0,fillOpacity:0,focusable:!0}),h("RoundedRectangle",["xy","scrollbar","thumb"]).states.create("hover",{fillOpacity:.4}),h("RoundedRectangle",["xy","scrollbar","chart","background"]).setAll({cornerRadiusTL:0,cornerRadiusBL:0,cornerRadiusTR:0,cornerRadiusBR:0}),h("RoundedRectangle",["xy","scrollbar","chart","background","resize","button"]).setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),h("AxisRendererX",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0}),h("AxisRendererY",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0,minGridDistance:5}),h("AxisLabel",["xy","scrollbar","x"]).setAll({opacity:.5,centerY:e,minPosition:.01,maxPosition:.99,fontSize:"0.8em"}),h("AxisLabel",["category"]).setAll({text:"{category}",populateText:!0}),h("AxisLabel",["x"]).setAll({centerY:0}),h("AxisLabel",["x","inside"]).setAll({centerY:e}),h("AxisLabel",["x","inside","opposite"]).setAll({centerY:0}),h("AxisLabel",["x","opposite"]).setAll({centerY:e}),h("AxisLabel",["y"]).setAll({centerX:e}),h("AxisLabel",["y","inside"]).setAll({centerX:0}),h("AxisLabel",["y","inside","opposite"]).setAll({centerX:e}),h("AxisLabel",["y","opposite"]).setAll({centerX:0}),h("AxisLabel",["xy","scrollbar","y"]).setAll({visible:!1}),h("Grid",["xy","scrollbar","y"]).setAll({visible:!1}),h("Grid",["xy","scrollbar","x"]).setAll({opacity:.5}),h("XYCursor").setAll({behavior:"none",layer:30,exportable:!1,snapToSeriesBy:"xy",moveThreshold:1});{const e=h("Grid",["cursor","x"]);e.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:l.translate("Use left and right arrows to move selection")}),N(e,"stroke",t,"alternativeBackground")}{const e=h("Grid",["cursor","y"]);e.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:l.translate("Use up and down arrows to move selection")}),N(e,"stroke",t,"alternativeBackground")}{const e=h("Graphics",["cursor","selection"]);e.setAll({fillOpacity:.15}),N(e,"fill",t,"alternativeBackground")}h("Axis").setAll({start:0,end:1,minZoomCount:1,maxZoomCount:1/0,maxZoomFactor:1e3,maxDeviation:.1,snapTooltip:!0,tooltipLocation:.5,panX:!0,panY:!0,zoomX:!0,zoomY:!0,fixAxisSize:!0}),h("AxisLabel").setAll({location:.5,multiLocation:0,centerX:i,centerY:i,paddingTop:3,paddingBottom:3,paddingLeft:5,paddingRight:5}),h("Container",["axis","header"]).setAll({layer:30}),h("Rectangle",["axis","header","background"]).setAll({crisp:!0});{const e=h("AxisRenderer");e.setAll({crisp:!0,strokeOpacity:0}),N(e,"stroke",t,"grid")}h("AxisRendererX").setAll({minGridDistance:120,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,width:e}),h("AxisRendererY").setAll({minGridDistance:40,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,height:e});{const e=h("Rectangle",["axis","thumb"]);e.setAll({fillOpacity:0}),N(e,"fill",t,"alternativeBackground"),e.states.create("hover",{fillOpacity:.1})}h("Rectangle",["axis","thumb","x"]).setAll({cursorOverStyle:"ew-resize"}),h("Rectangle",["axis","thumb","y"]).setAll({cursorOverStyle:"ns-resize"});{const e=h("Grid");e.setAll({location:0,strokeOpacity:.15,crisp:!0}),N(e,"stroke",t,"grid")}h("Grid",["base"]).setAll({strokeOpacity:.3});{const e=h("Graphics",["axis","fill"]);e.setAll({visible:!1,isMeasured:!1,position:"absolute",fillOpacity:.05}),N(e,"fill",t,"alternativeBackground")}h("Graphics",["axis","fill","range"]).setAll({isMeasured:!0}),h("Graphics",["series","fill","range"]).setAll({visible:!1,isMeasured:!0}),h("Grid",["series","range"]).setAll({visible:!1}),h("AxisTick",["series","range"]).setAll({visible:!1}),h("AxisLabel",["series","range"]).setAll({visible:!1});{const e=h("AxisTick");e.setAll({location:.5,multiLocation:0,strokeOpacity:1,isMeasured:!1,position:"absolute",visible:!1}),N(e,"stroke",t,"grid")}h("CategoryAxis").setAll({startLocation:0,endLocation:1,fillRule:(t,e)=>{const i=t.get("axisFill");i&&(s(e)&&e%2!=0?i.setPrivate("visible",!1):i.setPrivate("visible",!0))}});const d=[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:5},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:50},{timeUnit:"millisecond",count:100},{timeUnit:"millisecond",count:500},{timeUnit:"second",count:1},{timeUnit:"second",count:5},{timeUnit:"second",count:10},{timeUnit:"second",count:30},{timeUnit:"minute",count:1},{timeUnit:"minute",count:5},{timeUnit:"minute",count:10},{timeUnit:"minute",count:15},{timeUnit:"minute",count:30},{timeUnit:"hour",count:1},{timeUnit:"hour",count:3},{timeUnit:"hour",count:6},{timeUnit:"hour",count:12},{timeUnit:"day",count:1},{timeUnit:"day",count:2},{timeUnit:"day",count:3},{timeUnit:"day",count:4},{timeUnit:"day",count:5},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"month",count:2},{timeUnit:"month",count:3},{timeUnit:"month",count:6},{timeUnit:"year",count:1},{timeUnit:"year",count:2},{timeUnit:"year",count:5},{timeUnit:"year",count:10},{timeUnit:"year",count:50},{timeUnit:"year",count:100},{timeUnit:"year",count:200},{timeUnit:"year",count:500},{timeUnit:"year",count:1e3},{timeUnit:"year",count:2e3},{timeUnit:"year",count:5e3},{timeUnit:"year",count:1e4},{timeUnit:"year",count:1e5}],c={millisecond:l.translate("_date_millisecond"),second:l.translate("_date_second"),minute:l.translate("_date_minute"),hour:l.translate("_date_hour"),day:l.translate("_date_day"),week:l.translate("_date_day"),month:l.translate("_date_month"),year:l.translate("_date_year")},u={millisecond:l.translate("_date_millisecond"),second:l.translate("_date_second"),minute:l.translate("_date_minute"),hour:l.translate("_date_day"),day:l.translate("_date_day"),week:l.translate("_date_day"),month:l.translate("_date_month")+" "+l.translate("_date_year"),year:l.translate("_date_year")},g={millisecond:l.translate("_date_millisecond_full"),second:l.translate("_date_second_full"),minute:l.translate("_date_minute_full"),hour:l.translate("_date_hour_full"),day:l.translate("_date_day_full"),week:l.translate("_date_week_full"),month:l.translate("_date_month_full"),year:l.translate("_date_year")};h("CategoryDateAxis").setAll({markUnitChange:!0,gridIntervals:a(d),dateFormats:o(c),periodChangeDateFormats:o(u)}),h("DateAxis").setAll({maxZoomFactor:null,strictMinMax:!0,startLocation:0,endLocation:1,markUnitChange:!0,groupData:!1,groupCount:500,gridIntervals:a(d),dateFormats:o(c),periodChangeDateFormats:o(u),tooltipDateFormats:g,groupIntervals:[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:100},{timeUnit:"second",count:1},{timeUnit:"second",count:10},{timeUnit:"minute",count:1},{timeUnit:"minute",count:10},{timeUnit:"hour",count:1},{timeUnit:"day",count:1},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"year",count:1}],fillRule:t=>{const e=t.get("axisFill");if(e){const i=t.component,s=t.get("value"),a=t.get("endValue"),o=i.intervalDuration(),n=i.getPrivate("baseInterval"),r=i.getPrivate("gridInterval",n);let l=i.getPrivate("min",0);if(l=U(new Date(l),r.timeUnit,r.count,this._root.locale.firstDayOfWeek,this._root.utc,void 0,this._root.timezone).getTime(),null!=s&&null!=a){const t=Math.round(Math.round((s-l)/o))/2;t==Math.round(t)?e.setPrivate("visible",!0):e.setPrivate("visible",!1)}}}}),h("GaplessDateAxis").setAll({fillRule:t=>{const e=t.get("axisFill");if(e){const i=t.get("index");let a=!1;s(i)&&i%2!=0||(a=!0),e.setPrivate("visible",a)}}}),h("ValueAxis").setAll({baseValue:0,logarithmic:!1,strictMinMax:!1,autoZoom:!0,fillRule:t=>{const e=t.get("axisFill");if(e){const i=t.component,a=t.get("value"),o=i.getPrivate("step");s(a)&&s(o)&&(n(a/o/2,5)==Math.round(a/o/2)?e.setPrivate("visible",!1):e.setPrivate("visible",!0))}}}),h("DurationAxis").setAll({baseUnit:"second"}),h("XYSeries").setAll({maskBullets:!0,stackToNegative:!0,locationX:.5,locationY:.5,snapTooltip:!1,openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close",seriesTooltipTarget:"series"}),h("BaseColumnSeries").setAll({adjustBulletPosition:!0}),h("ColumnSeries").setAll({clustered:!0}),h("RoundedRectangle",["series","column"]).setAll({position:"absolute",isMeasured:!1,width:r(70),height:r(70),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),h("LineSeries").setAll({connect:!0,autoGapCount:1.1,stackToNegative:!1}),h("Graphics",["series","stroke"]).setAll({position:"absolute",strokeWidth:1,strokeOpacity:1,isMeasured:!1}),h("Graphics",["series","fill"]).setAll({visible:!1,fillOpacity:0,position:"absolute",strokeWidth:0,strokeOpacity:0,isMeasured:!1}),h("Graphics",["line","series","legend","marker","stroke"]).setAll({draw:(t,e)=>{const i=e.parent;if(i){const e=i.height(),s=i.width();t.moveTo(0,e/2),t.lineTo(s,e/2)}}});{const e=h("Graphics",["line","series","legend","marker","stroke"]).states.create("disabled",{});N(e,"stroke",t,"disabled")}h("Graphics",["line","series","legend","marker","fill"]).setAll({draw:(t,e)=>{const i=e.parent;if(i){const e=i.height(),s=i.width();t.moveTo(0,0),t.lineTo(s,0),t.lineTo(s,e),t.lineTo(0,e),t.lineTo(0,0)}}});{const e=h("Graphics",["line","series","legend","marker","fill"]).states.create("disabled",{});N(e,"stroke",t,"disabled")}h("SmoothedXYLineSeries").setAll({tension:.5}),h("SmoothedXLineSeries").setAll({tension:.5}),h("SmoothedYLineSeries").setAll({tension:.5}),h("Candlestick").setAll({position:"absolute",isMeasured:!1,width:r(50),height:r(50),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),h("OHLC").setAll({width:r(80),height:r(80)}),h("CandlestickSeries").setAll({lowValueXGrouped:"low",lowValueYGrouped:"low",highValueXGrouped:"high",highValueYGrouped:"high",openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close"});{const e=h("Rectangle",["column","autocolor"]).states.create("riseFromOpen",{});N(e,"fill",t,"positive"),N(e,"stroke",t,"positive")}{const e=h("Rectangle",["column","autocolor"]).states.create("dropFromOpen",{});N(e,"fill",t,"negative"),N(e,"stroke",t,"negative")}h("Rectangle",["column","autocolor","pro"]).states.create("riseFromOpen",{fillOpacity:0}),h("Rectangle",["column","autocolor","pro"]).states.create("dropFromOpen",{fillOpacity:1});{const e=h("Rectangle",["column","autocolor","pro"]).states.create("riseFromPrevious",{});N(e,"fill",t,"positive"),N(e,"stroke",t,"positive")}{const e=h("Rectangle",["column","autocolor","pro"]).states.create("dropFromPrevious",{});N(e,"fill",t,"negative"),N(e,"stroke",t,"negative")}}}class lt extends B{constructor(){super(...arguments),Object.defineProperty(this,"xAxes",{enumerable:!0,configurable:!0,writable:!0,value:new l}),Object.defineProperty(this,"yAxes",{enumerable:!0,configurable:!0,writable:!0,value:new l}),Object.defineProperty(this,"topAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(h.new(this._root,{width:e,layout:this._root.verticalLayout}))}),Object.defineProperty(this,"yAxesAndPlotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(h.new(this._root,{width:e,height:e,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"bottomAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(h.new(this._root,{width:e,layout:this._root.verticalLayout}))}),Object.defineProperty(this,"leftAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(h.new(this._root,{height:e,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"plotsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(h.new(this._root,{width:e,height:e,maskContent:!1}))}),Object.defineProperty(this,"plotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(h.new(this._root,{width:e,height:e}))}),Object.defineProperty(this,"topPlotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(h.new(this._root,{width:e,height:e}))}),Object.defineProperty(this,"gridContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(h.new(this._root,{width:e,height:e,isMeasured:!1}))}),Object.defineProperty(this,"topGridContainer",{enumerable:!0,configurable:!0,writable:!0,value:h.new(this._root,{width:e,height:e,isMeasured:!1})}),Object.defineProperty(this,"rightAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(h.new(this._root,{height:e,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"axisHeadersContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(h.new(this._root,{}))}),Object.defineProperty(this,"zoomOutButton",{enumerable:!0,configurable:!0,writable:!0,value:this.topPlotContainer.children.push(J.new(this._root,{themeTags:["zoom"],icon:d.new(this._root,{themeTags:["button","icon"]})}))}),Object.defineProperty(this,"_movePoint",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"_wheelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_otherCharts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_movePoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_downStartX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEndX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downStartY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEndY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._defaultThemes.push(rt.new(this._root)),super._afterNew(),this._disposers.push(this.xAxes),this._disposers.push(this.yAxes);const t=this._root;let e=this._root.verticalLayout;const i=this.zoomOutButton;i.events.on("click",(()=>{this.zoomOut()})),i.set("opacity",0),i.states.lookup("default").set("opacity",1),this.chartContainer.set("layout",e);const s=this.plotContainer;s.children.push(this.seriesContainer),this._disposers.push(this._processAxis(this.xAxes,this.bottomAxesContainer)),this._disposers.push(this._processAxis(this.yAxes,this.leftAxesContainer)),s.children.push(this.topGridContainer),s.children.push(this.bulletsContainer),s.set("interactive",!0),s.set("interactiveChildren",!1),s.set("background",c.new(t,{themeTags:["xy","background"],fill:u.fromHex(0),fillOpacity:0})),this._disposers.push(s.events.on("pointerdown",(t=>{this._handlePlotDown(t.originalEvent)}))),this._disposers.push(s.events.on("globalpointerup",(t=>{this._handlePlotUp(t.originalEvent)}))),this._disposers.push(s.events.on("globalpointermove",(t=>{this._handlePlotMove(t.originalEvent)}))),this._maskGrid(),this._setUpTouch()}_beforeChanged(){super._beforeChanged(),(this.isDirty("pinchZoomX")||this.isDirty("pinchZoomY")||this.get("panX")||this.get("panY"))&&this._setUpTouch()}_setUpTouch(){this.plotContainer._display.cancelTouch||(this.plotContainer._display.cancelTouch=!!(this.get("pinchZoomX")||this.get("pinchZoomY")||this.get("panX")||this.get("panY")))}_maskGrid(){this.gridContainer.set("maskContent",!0),this.topGridContainer.set("maskContent",!0)}_removeSeries(t){t._unstack(),t._posXDp&&t._posXDp.dispose(),t._posYDp&&t._posYDp.dispose(),t.set("baseAxis",void 0);const e=t.get("xAxis");e&&(g(e.series,t),e.markDirtyExtremes());const i=t.get("yAxis");i&&(g(i.series,t),i.markDirtyExtremes());const s=this.get("cursor");if(s){const e=s.get("snapToSeries");e&&g(e,t)}super._removeSeries(t)}handleWheel(t){const e=this.get("wheelX"),i=this.get("wheelY"),s=this.plotContainer,a=t.originalEvent;if(!p(a,this))return;a.preventDefault();const o=s.toLocal(this._root.documentPointToRoot({x:a.clientX,y:a.clientY})),n=this.get("wheelStep",.2),r=a.deltaY/100,l=a.deltaX/100,h=this.get("wheelZoomPositionX"),d=this.get("wheelZoomPositionY");"zoomX"!==e&&"zoomXY"!==e||0==l||this.xAxes.each((t=>{if(t.get("zoomX")){let e=t.get("start"),i=t.get("end"),a=t.fixPosition(o.x/s.width());null!=h&&(a=h);let r=e-n*(i-e)*l*a,d=i+n*(i-e)*l*(1-a);1/(d-r)<t.getPrivate("maxZoomFactor",1/0)/t.get("minZoomCount",1)&&this._handleWheelAnimation(t.zoom(r,d))}})),"zoomX"!==i&&"zoomXY"!==i||0==r||this.xAxes.each((t=>{if(t.get("zoomX")){let e=t.get("start"),i=t.get("end"),a=t.fixPosition(o.x/s.width());null!=h&&(a=h);let l=e-n*(i-e)*r*a,d=i+n*(i-e)*r*(1-a);1/(d-l)<t.getPrivate("maxZoomFactor",1/0)/t.get("minZoomCount",1)&&this._handleWheelAnimation(t.zoom(l,d))}})),"zoomY"!==e&&"zoomXY"!==e||0==l||this.yAxes.each((t=>{if(t.get("zoomY")){let e=t.get("start"),i=t.get("end"),a=t.fixPosition(o.y/s.height());null!=d&&(a=d);let r=e-n*(i-e)*l*a,h=i+n*(i-e)*l*(1-a);1/(h-r)<t.getPrivate("maxZoomFactor",1/0)/t.get("minZoomCount",1)&&this._handleWheelAnimation(t.zoom(r,h))}})),"zoomY"!==i&&"zoomXY"!==i||0==r||this.yAxes.each((t=>{if(t.get("zoomY")){let e=t.get("start"),i=t.get("end"),a=t.fixPosition(o.y/s.height());null!=d&&(a=d);let l=e-n*(i-e)*r*a,h=i+n*(i-e)*r*(1-a);1/(h-l)<t.getPrivate("maxZoomFactor",1/0)/t.get("minZoomCount",1)&&this._handleWheelAnimation(t.zoom(l,h))}})),"panX"!==e&&"panXY"!==e||0==l||this.xAxes.each((t=>{if(t.get("panX")){let e=t.get("start"),i=t.get("end"),s=this._getWheelSign(t)*n*(i-e)*l,a=e+s,o=i+s,r=this._fixWheel(a,o);a=r[0],o=r[1],this._handleWheelAnimation(t.zoom(a,o))}})),"panX"!==i&&"panXY"!==i||0==r||this.xAxes.each((t=>{if(t.get("panX")){let e=t.get("start"),i=t.get("end"),s=this._getWheelSign(t)*n*(i-e)*r,a=e+s,o=i+s,l=this._fixWheel(a,o);a=l[0],o=l[1],this._handleWheelAnimation(t.zoom(a,o))}})),"panY"!==e&&"panXY"!==e||0==l||this.yAxes.each((t=>{if(t.get("panY")){let e=t.get("start"),i=t.get("end"),s=this._getWheelSign(t)*n*(i-e)*l,a=e+s,o=i+s,r=this._fixWheel(a,o);a=r[0],o=r[1],this._handleWheelAnimation(t.zoom(a,o))}})),"panY"!==i&&"panXY"!==i||0==r||this.yAxes.each((t=>{if(t.get("panY")){let e=t.get("start"),i=t.get("end"),s=this._getWheelSign(t)*n*(i-e)*r,a=e-s,o=i-s,l=this._fixWheel(a,o);a=l[0],o=l[1],this._handleWheelAnimation(t.zoom(a,o))}}))}_handleSetWheel(){const t=this.get("wheelX"),e=this.get("wheelY"),i=this.plotContainer;"none"!==t||"none"!==e?(this._wheelDp=i.events.on("wheel",(t=>{this.handleWheel(t)})),this._disposers.push(this._wheelDp)):this._wheelDp&&this._wheelDp.dispose()}_getWheelSign(t){let e=1;return t.get("renderer").get("inversed")&&(e=-1),e}_fixWheel(t,e){const i=e-t;return t<0&&(e=(t=0)+i),e>1&&(t=(e=1)-i),[t,e]}_handlePlotDown(t){if(2==t.button)return;const e=this.plotContainer;let i=e.toLocal(this._root.documentPointToRoot({x:t.clientX,y:t.clientY}));if(this.get("pinchZoomX")||this.get("pinchZoomY")){if(t.pointerId&&m(e._downPoints).length>0){const t=this.xAxes.getIndex(0),e=this.yAxes.getIndex(0);t&&(this._downStartX=t.get("start",0),this._downEndX=t.get("end",1)),e&&(this._downStartY=e.get("start",0),this._downEndY=e.get("end",1))}}if((this.get("panX")||this.get("panY"))&&i.x>=0&&i.y>=0&&i.x<=e.width()&&i.y<=this.height()){this._downPoint={x:t.clientX,y:t.clientY};const e=this.get("panX"),i=this.get("panY");e&&this.xAxes.each((t=>{t._panStart=t.get("start"),t._panEnd=t.get("end")})),i&&this.yAxes.each((t=>{t._panStart=t.get("start"),t._panEnd=t.get("end")}));const s="panstarted";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,originalEvent:t})}}_handleWheelAnimation(t){t?t.events.on("stopped",(()=>{this._dispatchWheelAnimation()})):this._dispatchWheelAnimation()}_dispatchWheelAnimation(){const t="wheelended";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}_handlePlotUp(t){const e=this._downPoint;if(e&&(this.get("panX")||this.get("panY"))){let i=this.plotContainer.toLocal(this._root.documentPointToRoot({x:t.clientX,y:t.clientY}));if(i.x==e.x&&i.y==e.y){const e="pancancelled";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this,originalEvent:t})}const s="panended";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,originalEvent:t})}this._downPoint=void 0,this.xAxes.each((t=>{t._isPanning=!1})),this.yAxes.each((t=>{t._isPanning=!1}))}_handlePlotMove(t){const e=this.plotContainer;if(this.get("pinchZoomX")||this.get("pinchZoomY")){const i=t.pointerId;if(i&&(this._movePoints[i]=this._root.documentPointToRoot({x:t.clientX,y:t.clientY}),m(e._downPoints).length>1))return void this._handlePinch()}let i=this._downPoint;if(i){i=e.toLocal(this._root.documentPointToRoot(i));let s=e.toLocal(this._root.documentPointToRoot({x:t.clientX,y:t.clientY}));const a=this.get("panX"),o=this.get("panY");if(a){let t=this.get("scrollbarX");t&&t.events.disableType("rangechanged"),this.xAxes.each((t=>{if(t.get("panX")){t._isPanning=!0;let a=t._panStart,o=t._panEnd,n=(o-a)*(i.x-s.x)/e.width();t.get("renderer").get("inversed")&&(n*=-1);let r=a+n,l=o+n;l-r<1+2*t.get("maxDeviation",1)&&(t.set("start",r),t.set("end",l))}})),t&&t.events.enableType("rangechanged")}if(o){let t=this.get("scrollbarY");t&&t.events.disableType("rangechanged"),this.yAxes.each((t=>{if(t.get("panY")){t._isPanning=!0;let a=t._panStart,o=t._panEnd,n=(o-a)*(i.y-s.y)/e.height();t.get("renderer").get("inversed")&&(n*=-1);let r=a-n,l=o-n;l-r<1+2*t.get("maxDeviation",1)&&(t.set("start",r),t.set("end",l))}})),t&&t.events.enableType("rangechanged")}}}_handlePinch(){const t=this.plotContainer;let e=0,i=[],s=[];if(_(t._downPoints,((t,a)=>{i[e]=a;let o=this._movePoints[t];o&&(s[e]=o),e++})),i.length>1&&s.length>1){const e=t.width(),a=t.height();let o=i[0],n=i[1],r=s[0],l=s[1];if(o&&n&&r&&l){if(r=t.toLocal(r),l=t.toLocal(l),o=t.toLocal(o),n=t.toLocal(n),this.get("pinchZoomX")){const t=this._downStartX,i=this._downEndX;if(null!=t&&null!=i){o.x>n.x&&([o,n]=[n,o],[r,l]=[l,r]);let s=t+o.x/e*(i-t),a=t+n.x/e*(i-t),h=t+r.x/e*(i-t),d=t+l.x/e*(i-t),c=Math.max(.001,a-s)/Math.max(.001,d-h),u=t*c+s-h*c,g=i*c+a-d*c;this.xAxes.each((t=>{let e=t.fixPosition(u),i=t.fixPosition(g);t.zoom(e,i,0)}))}}if(this.get("pinchZoomY")){const t=this._downStartY,e=this._downEndY;if(null!=t&&null!=e){o.y<n.y&&([o,n]=[n,o],[r,l]=[l,r]);let i=t+(1-o.y/a)*(e-t),s=t+(1-n.y/a)*(e-t),h=t+(1-r.y/a)*(e-t),d=t+(1-l.y/a)*(e-t),c=Math.max(.001,s-i)/Math.max(.001,d-h),u=t*c+i-h*c,g=e*c+s-d*c;this.yAxes.each((t=>{let e=t.fixPosition(u),i=t.fixPosition(g);t.zoom(e,i,0)}))}}}}}_handleCursorPosition(){const t=this.get("cursor");if(t){const e=t.getPrivate("point");let i=t.get("snapToSeries");if(t._downPoint&&(i=void 0),i&&e){const s=t.get("snapToSeriesBy"),a=[];x(i,(t=>{if(!t.isHidden()&&!t.isHiding())if("x!"!=s&&"y!"!=s){const e=t.startIndex(),i=t.endIndex();for(let s=e;s<i;s++){const e=t.dataItems[s];e&&!e.isHidden()&&a.push(e)}}else{const e=t.get("tooltipDataItem");e&&a.push(e)}}));let o,n=1/0;if(x(a,(t=>{const i=t.get("point");if(i){let a=0;a="x"==s||"x!"==s?Math.abs(e.x-i.x):"y"==s||"y!"==s?Math.abs(e.y-i.y):Math.hypot(e.x-i.x,e.y-i.y),a<n&&(n=a,o=t)}})),x(i,(t=>{const e=t.get("tooltip");e&&e._setDataItem(void 0)})),o){let e=o.component;e.showDataItemTooltip(o);const i=o.get("point");i&&t.handleMove(e.toGlobal({x:i.x-e.x(),y:i.y-e.y()}),!0)}}}}_updateCursor(){let t=this.get("cursor");t&&t.handleMove()}_addCursor(t){this.plotContainer.children.push(t)}_prepareChildren(){if(super._prepareChildren(),this.series.each((t=>{this._colorize(t)})),(this.isDirty("wheelX")||this.isDirty("wheelY"))&&this._handleSetWheel(),this.isDirty("cursor")){const t=this._prevSettings.cursor,e=this.get("cursor");e!==t&&(this._disposeProperty("cursor"),t&&t.dispose(),e&&(e._setChart(this),this._addCursor(e),this._pushPropertyDisposer("cursor",e.events.on("selectended",(()=>{this._handleCursorSelectEnd()})))),this._prevSettings.cursor=e)}if(this.isDirty("scrollbarX")){const t=this._prevSettings.scrollbarX,e=this.get("scrollbarX");e!==t&&(this._disposeProperty("scrollbarX"),t&&t.dispose(),e&&(e.parent||this.topAxesContainer.children.push(e),this._pushPropertyDisposer("scrollbarX",e.events.on("rangechanged",(t=>{this._handleScrollbar(this.xAxes,t.start,t.end,t.grip)}))),e.setPrivate("positionTextFunction",(t=>{const e=this.xAxes.getIndex(0);return e&&e.getTooltipText(t,!1)||""}))),this._prevSettings.scrollbarX=e)}if(this.isDirty("scrollbarY")){const t=this._prevSettings.scrollbarY,e=this.get("scrollbarY");e!==t&&(this._disposeProperty("scrollbarY"),t&&t.dispose(),e&&(e.parent||this.rightAxesContainer.children.push(e),this._pushPropertyDisposer("scrollbarY",e.events.on("rangechanged",(t=>{this._handleScrollbar(this.yAxes,t.start,t.end,t.grip)}))),e.setPrivate("positionTextFunction",(t=>{const e=this.yAxes.getIndex(0);return e&&e.getTooltipText(t,!1)||""}))),this._prevSettings.scrollbarY=e)}this._handleZoomOut()}_processSeries(t){super._processSeries(t);const e=t.get("xAxis"),i=t.get("yAxis");b(e.series,t),b(i.series,t),t._posXDp=t.addDisposer(e.events.on("positionchanged",(()=>{t._fixPosition()}))),t._posXDp=t.addDisposer(i.events.on("positionchanged",(()=>{t._fixPosition()}))),t.get("baseAxis")||(i.isType("CategoryAxis")||i.isType("DateAxis")?t.set("baseAxis",i):t.set("baseAxis",e)),t.get("stacked")&&(t._markDirtyKey("stacked"),x(t.dataItems,(t=>{t.set("stackToItemY",void 0),t.set("stackToItemX",void 0)}))),t._markDirtyAxes(),i.markDirtyExtremes(),e.markDirtyExtremes(),this._colorize(t)}_colorize(t){const e=this.get("colors");if(e&&null==t.get("fill")){const i=e.next();t._setSoft("stroke",i),t._setSoft("fill",i)}}_handleCursorSelectEnd(){const t=this.get("cursor"),e=t.get("behavior"),i=t.getPrivate("downPositionX",0),s=t.getPrivate("downPositionY",0),a=t.getPrivate("positionX",.5),o=t.getPrivate("positionY",.5);this.xAxes.each((t=>{if("zoomX"===e||"zoomXY"===e){let e=t.toAxisPosition(i),s=t.toAxisPosition(a);t.zoom(e,s)}t.setPrivate("updateScrollbar",!0)})),this.yAxes.each((t=>{if("zoomY"===e||"zoomXY"===e){let e=t.toAxisPosition(s),i=t.toAxisPosition(o);t.zoom(e,i)}t.setPrivate("updateScrollbar",!0)}))}_handleScrollbar(t,e,i,s){t.each((t=>{let a=t.fixPosition(e),o=t.fixPosition(i),n=t.zoom(a,o,void 0,s);const r="updateScrollbar";t.setPrivateRaw(r,!1),n?n.events.on("stopped",(()=>{t.setPrivateRaw(r,!0)})):t.setPrivateRaw(r,!0)}))}_processAxis(t,e){return t.events.onAll((t=>{if("clear"===t.type)x(t.oldValues,(t=>{this._removeAxis(t)}));else if("push"===t.type)e.children.push(t.newValue),t.newValue.processChart(this);else if("setIndex"===t.type)e.children.setIndex(t.index,t.newValue),t.newValue.processChart(this);else if("insertIndex"===t.type)e.children.insertIndex(t.index,t.newValue),t.newValue.processChart(this);else if("removeIndex"===t.type)this._removeAxis(t.oldValue);else{if("moveIndex"!==t.type)throw new Error("Unknown IListEvent type");e.children.moveValue(t.value,t.newIndex),t.value.processChart(this)}}))}_removeAxis(t){if(!t.isDisposed()){const e=t.parent;e&&e.children.removeValue(t);const i=t.gridContainer,s=i.parent;s&&s.children.removeValue(i);const a=t.topGridContainer,o=a.parent;o&&o.children.removeValue(a)}}_updateChartLayout(){const t=this.leftAxesContainer.width(),e=this.rightAxesContainer.width(),i=this.bottomAxesContainer;i.set("paddingLeft",t),i.set("paddingRight",e);const s=this.topAxesContainer;s.set("paddingLeft",t),s.set("paddingRight",e)}processAxis(t){}_handleAxisSelection(t,e){let i=t.fixPosition(t.get("start",0)),s=t.fixPosition(t.get("end",1));if(i>s&&([i,s]=[s,i]),-1!=this.xAxes.indexOf(t)){if(e||t.getPrivate("updateScrollbar")){let t=this.get("scrollbarX");!t||t.getPrivate("isBusy")&&!e||(t.setRaw("start",i),t.setRaw("end",s),t.updateGrips())}}else if(-1!=this.yAxes.indexOf(t)&&(e||t.getPrivate("updateScrollbar"))){let t=this.get("scrollbarY");!t||t.getPrivate("isBusy")&&!e||(t.setRaw("start",i),t.setRaw("end",s),t.updateGrips())}this._handleZoomOut()}_handleZoomOut(){let t=this.zoomOutButton;if(t&&t.parent){let e=!1;this.xAxes.each((t=>{0==t.get("start")&&1==t.get("end")||(e=!0)})),this.yAxes.each((t=>{0==t.get("start")&&1==t.get("end")||(e=!0)})),e?t.isHidden()&&t.show():t.hide()}}inPlot(t){const e=this.plotContainer,i=this.getPrivate("otherCharts",this._otherCharts),s=e.toGlobal(t);if(t.x>=-.5&&t.y>=-.5&&t.x<=e.width()+.5&&t.y<=e.height()+.5)return!0;if(i)for(let a=i.length-1;a>=0;a--){const t=i[a];if(t!=this){const e=t.plotContainer,i=this._root.rootPointToDocument(s),a=t._root.documentPointToRoot(i),o=e.toLocal(a);if(o.x>=-.1&&o.y>=-.1&&o.x<=e.width()+.1&&o.y<=e.height()+.1)return!0}}return!1}arrangeTooltips(){const t=this.plotContainer,e=t.width(),i=t.height(),a=this.height();let o=t._display.toGlobal({x:0,y:0}),n=t._display.toGlobal({x:e,y:i});const r=[];let l,h,d=0,c=1/0,u=this._movePoint,g=this.get("maxTooltipDistance"),p=this.get("maxTooltipDistanceBy","xy");s(g)&&this.series.each((t=>{if(!t.isHidden()){const e=t.get("tooltip");if(e){let i=e.get("pointTo");if(i){let e=Math.hypot(u.x-i.x,u.y-i.y);"x"==p?e=Math.abs(u.x-i.x):"y"==p&&(e=Math.abs(u.y-i.y)),e<c&&(c=e,l=t,h=i)}}}}));const m=[];if(this.series.each((t=>{const e=t.get("tooltip");if(e){let i=!1,s=e.get("pointTo");if(s){if(g>=0){let s=e.get("pointTo");if(s&&t!=l){let t=Math.hypot(h.x-s.x,h.y-s.y);"x"==p?t=Math.abs(h.x-s.x):"y"==p&&(t=Math.abs(h.y-s.y)),t>g&&(i=!0)}}else-1==g&&t!=l&&(i=!0);this.inPlot(this._tooltipToLocal(s))&&e.dataItem?i||(d+=s.y):i=!0,i||t.isHidden()||t.isHiding()?e.hide(0):(e.show(),r.push(e),m.push(t))}}})),this.setPrivate("tooltipSeries",m),this.get("arrangeTooltips")){const t=this._root.tooltipContainer,e=r.length;if(d/e>i/2+o.y){r.sort(((t,e)=>f(e.get("pointTo").y,t.get("pointTo").y)));let e=n.y;if(x(r,(i=>{let s=i.height(),a=i.get("centerY");a instanceof y&&(s*=a.value),s+=i.get("marginBottom",0),i.set("bounds",{left:o.x,top:o.y,right:n.x,bottom:e}),i.setPrivate("customData",{left:o.x,top:o.y,right:n.x,bottom:e}),e=Math.min(e-s,i._fy-s),i.parent==t&&t.children.moveValue(i,0)})),e<0){r.reverse();let t=e;x(r,(i=>{let s=i.get("bounds");if(s){let a=s.top-e,o=s.bottom-e;a<t&&(a=t,o=a+i.height()),i.set("bounds",{left:s.left,top:a,right:s.right,bottom:o}),t=s.bottom-e+i.get("marginBottom",0)}}))}}else{r.reverse(),r.sort(((t,e)=>f(t.get("pointTo").y,e.get("pointTo").y)));let e=0;if(x(r,(i=>{let s=i.height(),r=i.get("centerY");r instanceof y&&(s*=r.value),s+=i.get("marginBottom",0),i.set("bounds",{left:o.x,top:e,right:n.x,bottom:Math.max(o.y+a,e+s)}),i.parent==t&&t.children.moveValue(i,0),e=Math.max(e+s,i._fy+s)})),e>a){r.reverse();let t=a;x(r,(i=>{let s=i.get("bounds");if(s){let o=s.top-(a-e),n=s.bottom-(a-e);n>t&&(n=t,o=n-i.height()),i.set("bounds",{left:s.left,top:o,right:s.right,bottom:n}),t=n-i.height()-i.get("marginBottom",0)}}))}}}}_tooltipToLocal(t){return this.plotContainer.toLocal(t)}zoomOut(){this.xAxes.each((t=>{t.setPrivate("updateScrollbar",!0),t.zoom(0,1)})),this.yAxes.each((t=>{t.setPrivate("updateScrollbar",!0),t.zoom(0,1)}))}}Object.defineProperty(lt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYChart"}),Object.defineProperty(lt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([lt.className])});class ht extends d{_beforeChanged(){super._beforeChanged(),(this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}}Object.defineProperty(ht,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Grid"}),Object.defineProperty(ht,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:d.classNames.concat([ht.className])});class dt extends h{constructor(){super(...arguments),Object.defineProperty(this,"lineX",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(ht.new(this._root,{themeTags:["x"]}))}),Object.defineProperty(this,"lineY",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(ht.new(this._root,{themeTags:["y"]}))}),Object.defineProperty(this,"selection",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(d.new(this._root,{themeTags:["selection","cursor"],layer:30}))}),Object.defineProperty(this,"_movePoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_lastPoint",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"_tooltipX",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_tooltipY",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_toX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_toY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._settings.themeTags=v(this._settings.themeTags,["xy","cursor"]),super._afterNew(),this.setAll({width:e,height:e,isMeasured:!0,position:"absolute"}),this.states.create("hidden",{visible:!0,opacity:0}),this._drawLines(),this.setPrivateRaw("visible",!1),this._disposers.push(this.setTimeout((()=>{this.setPrivate("visible",!0)}),500)),this._disposers.push(this.lineX.events.on("positionchanged",(()=>{this._handleXLine()}))),this._disposers.push(this.lineY.events.on("positionchanged",(()=>{this._handleYLine()}))),this._disposers.push(this.lineX.events.on("focus",(t=>this._handleLineFocus(t.target)))),this._disposers.push(this.lineX.events.on("blur",(t=>this._handleLineBlur(t.target)))),this._disposers.push(this.lineY.events.on("focus",(t=>this._handleLineFocus(t.target)))),this._disposers.push(this.lineY.events.on("blur",(t=>this._handleLineBlur(t.target)))),P("keyboardevents")&&this._disposers.push(w(document,"keydown",(t=>{this._handleLineMove(t.keyCode)})))}_setUpTouch(){const t=this.chart;t&&(t.plotContainer._display.cancelTouch="none"!=this.get("behavior"))}_handleXLine(){let t=this.lineX.x(),e=!0;(t<0||t>this.width())&&(e=!1),this.lineX.setPrivate("visible",e)}_handleYLine(){let t=this.lineY.y(),e=!0;(t<0||t>this.height())&&(e=!1),this.lineY.setPrivate("visible",e)}_handleLineMove(t){let e="",i=0,s=.1;const a=this.chart;this._root.focused(this.lineX)?(a&&a.xAxes.length&&(s=a.xAxes.getIndex(0).getCellWidthPosition()),i=this.getPrivate("positionX",0),e="positionX",37==t?i-=s:39==t&&(i+=s)):this._root.focused(this.lineY)&&(a&&a.yAxes.length&&(s=a.yAxes.getIndex(0).getCellWidthPosition()),i=this.getPrivate("positionY",0),e="positionY",38==t?i-=s:40==t&&(i+=s)),i<0?i=0:i>1&&(i=1),""!=e&&this.set(e,i)}_handleLineFocus(t){this.setAll({positionX:this.getPrivate("positionX"),positionY:this.getPrivate("positionY"),alwaysShow:!0})}_handleLineBlur(t){this.setAll({positionX:void 0,positionY:void 0,alwaysShow:!1})}_prepareChildren(){if(super._prepareChildren(),this.isDirty("xAxis")){this._tooltipX=!1;const t=this.get("xAxis");if(t){const e=t.get("tooltip");e&&(this._tooltipX=!0,this._disposers.push(e.on("pointTo",(()=>{this._updateXLine(e)}))))}}if(this.isDirty("yAxis")){this._tooltipY=!1;const t=this.get("yAxis");if(t){const e=t.get("tooltip");e&&(this._tooltipY=!0,this._disposers.push(e.on("pointTo",(()=>{this._updateYLine(e)}))))}}}_handleSyncWith(){const t=this.chart;if(t){const e=this.get("syncWith"),i=[];e&&x(e,(t=>{const e=t.chart;e&&i.push(e)})),t._otherCharts=i}}_updateChildren(){if(super._updateChildren(),this._handleSyncWith(),this.isDirty("positionX")||this.isDirty("positionY")){const t=this.get("positionX"),e=this.get("positionY");null==t&&null==e?this.hide(0):(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0))),this.handleMove())}}_updateXLine(t){let e=n(this._display.toLocal(t.get("pointTo",{x:0,y:0})).x,2);this._toX!=e&&(this.lineX.animate({key:"x",to:e,duration:t.get("animationDuration",0),easing:t.get("animationEasing")}),this._toX=e)}_updateYLine(t){let e=n(this._display.toLocal(t.get("pointTo",{x:0,y:0})).y,2);this._toY!=e&&(this.lineY.animate({key:"y",to:e,duration:t.get("animationDuration",0),easing:t.get("animationEasing")}),this._toY=e)}_drawLines(){this.lineX.set("draw",(t=>{t.moveTo(0,0),t.lineTo(0,this.height())})),this.lineY.set("draw",(t=>{t.moveTo(0,0),t.lineTo(this.width(),0)}))}_setChart(t){this.chart=t,this._handleSyncWith();const e=t.plotContainer;this.events.on("boundschanged",(()=>{this._disposers.push(this.setTimeout((()=>{this.get("alwaysShow")&&(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0))),this.handleMove())}),50))})),P("touchevents")&&(this._disposers.push(e.events.on("click",(t=>{k(t.originalEvent)&&this._handleMove(t.originalEvent)}))),this._setUpTouch()),this._disposers.push(e.events.on("pointerdown",(t=>{this._handleCursorDown(t.originalEvent)}))),this._disposers.push(e.events.on("globalpointerup",(t=>{this._handleCursorUp(t.originalEvent),t.native||this.isHidden()||this._handleMove(t.originalEvent)}))),this._disposers.push(e.events.on("globalpointermove",(t=>{(this.get("syncWith")||0!=m(e._downPoints).length||t.native||!this.isHidden())&&this._handleMove(t.originalEvent)})));const i=this.parent;i&&i.children.moveValue(this.selection)}_inPlot(t){const e=this.chart;return!!e&&e.inPlot(t)}_handleCursorDown(t){if(2==t.button)return;const e=this._root.documentPointToRoot({x:t.clientX,y:t.clientY});let i=this._display.toLocal(e);const s=this.chart;if(this.selection.set("draw",(()=>{})),s&&this._inPlot(i)){if(this._downPoint=i,"none"!=this.get("behavior")){this.selection.show();const t="selectstarted";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}let t=this._getPosition(i).x,e=this._getPosition(i).y;this.setPrivate("downPositionX",t),this.setPrivate("downPositionY",e)}}_handleCursorUp(t){if(this._downPoint){const e=this.get("behavior","none");if("none"!=e){"z"===e.charAt(0)&&this.selection.hide();const i=this._root.documentPointToRoot({x:t.clientX,y:t.clientY});let s=this._display.toLocal(i);const a=this._downPoint,o=this.get("moveThreshold",1);if(s&&a){let t=!1;if("zoomX"!==e&&"zoomXY"!==e&&"selectX"!==e&&"selectXY"!==e||Math.abs(s.x-a.x)>o&&(t=!0),"zoomY"!==e&&"zoomXY"!==e&&"selectY"!==e&&"selectXY"!==e||Math.abs(s.y-a.y)>o&&(t=!0),t){const t="selectended";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}}}}this._downPoint=void 0}_handleMove(t){if(this.getPrivate("visible")){const e=this.chart;if(e&&m(e.plotContainer._downPoints).length>1)return void this.set("forceHidden",!0);this.set("forceHidden",!1);const i=this._root.documentPointToRoot({x:t.clientX,y:t.clientY}),s=this._lastPoint;if(Math.round(s.x)===Math.round(i.x)&&Math.round(s.y)===Math.round(i.y))return;this._lastPoint=i,this.setPrivate("lastPoint",i),this.handleMove({x:i.x,y:i.y})}}_getPosition(t){return{x:t.x/this.width(),y:t.y/this.height()}}handleMove(t,e){t||(t=this._movePoint);const i=this.get("alwaysShow");if(!t)return void this.hide(0);this._movePoint=t;let a=this._display.toLocal(t),o=this.chart;if(o&&(this._inPlot(a)||this._downPoint)){if(o._movePoint=t,this.isHidden()){this.show();"z"==this.get("behavior","").charAt(0)&&this.selection.set("draw",(()=>{}))}let n=a.x,r=a.y,l=this._getPosition(a);this.setPrivate("point",a);let h=this.get("snapToSeries");this._downPoint&&(h=void 0);let d=this.get("positionX"),c=l.x;s(d)&&(c=d);let u=this.get("positionY"),g=l.y;s(u)&&(g=u),this.setPrivate("positionX",c),this.setPrivate("positionY",g);const p=this._getPoint(c,g);if(n=p.x,r=p.y,o.xAxes.each((t=>{t._handleCursorPosition(c,h),i&&t.handleCursorShow()})),o.yAxes.each((t=>{t._handleCursorPosition(g,h),i&&t.handleCursorShow()})),!e){o._handleCursorPosition();const t="cursormoved";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}this._updateLines(n,r),o.arrangeTooltips()}else if(!this._downPoint&&!i){this.hide(0);const t="cursorhidden";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}this._downPoint&&"none"!=this.get("behavior")&&this._updateSelection(a)}_getPoint(t,e){return{x:this.width()*t,y:this.height()*e}}_updateLines(t,e){this._tooltipX||this.lineX.set("x",t),this._tooltipY||this.lineY.set("y",e),this._drawLines()}_updateSelection(t){const e=this.selection,i=this.get("behavior"),s=this.width(),a=this.height();t.x<0&&(t.x=0),t.x>s&&(t.x=s),t.y<0&&(t.y=0),t.y>a&&(t.y=a),e.set("draw",(e=>{const o=this._downPoint;o&&("zoomXY"===i||"selectXY"===i?(e.moveTo(o.x,o.y),e.lineTo(o.x,t.y),e.lineTo(t.x,t.y),e.lineTo(t.x,o.y),e.lineTo(o.x,o.y)):"zoomX"===i||"selectX"===i?(e.moveTo(o.x,0),e.lineTo(o.x,a),e.lineTo(t.x,a),e.lineTo(t.x,0),e.lineTo(o.x,0)):"zoomY"!==i&&"selectY"!==i||(e.moveTo(0,o.y),e.lineTo(s,o.y),e.lineTo(s,t.y),e.lineTo(0,t.y),e.lineTo(0,o.y)))}))}_onHide(){if(this.isHidden()){let t=this.chart;t&&(t.xAxes.each((t=>{t.handleCursorHide()})),t.yAxes.each((t=>{t.handleCursorHide()})),t.series.each((t=>{t.handleCursorHide()})))}super._onHide()}_onShow(){if(!this.isHidden()){let t=this.chart;t&&(t.xAxes.each((t=>{t.handleCursorShow()})),t.yAxes.each((t=>{t.handleCursorShow()})))}super._onShow()}_dispose(){super._dispose(),this.selection.dispose()}}function ct(t,e){return null==t?e:null==e?t:e<t?e:t}function ut(t,e){return null==t?e:null==e?t:e>t?e:t}Object.defineProperty(dt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYCursor"}),Object.defineProperty(dt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:h.classNames.concat([dt.className])});class gt extends H{constructor(){super(...arguments),Object.defineProperty(this,"_xField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xOpenField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yOpenField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xLowField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xHighField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yLowField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yHighField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_axesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_stackDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataSets",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_mainContainerMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"mainContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(h.new(this._root,{}))}),Object.defineProperty(this,"axisRanges",{enumerable:!0,configurable:!0,writable:!0,value:new T}),Object.defineProperty(this,"_skipped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_couldStackTo",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_reallyStackedTo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_stackedSeries",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_aLocationX0",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_aLocationX1",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_aLocationY0",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_aLocationY1",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_showBullets",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"valueXFields",{enumerable:!0,configurable:!0,writable:!0,value:["valueX","openValueX","lowValueX","highValueX"]}),Object.defineProperty(this,"valueYFields",{enumerable:!0,configurable:!0,writable:!0,value:["valueY","openValueY","lowValueY","highValueY"]}),Object.defineProperty(this,"_valueXFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueYFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueXShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueYShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__valueXShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__valueYShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_emptyDataItem",{enumerable:!0,configurable:!0,writable:!0,value:new Z(this,void 0,{})}),Object.defineProperty(this,"_dataSetId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipFieldX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipFieldY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_posXDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_posYDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this.fields.push("categoryX","categoryY","openCategoryX","openCategoryY"),this.valueFields.push("valueX","valueY","openValueX","openValueY","lowValueX","lowValueY","highValueX","highValueY"),this._setRawDefault("vcx",1),this._setRawDefault("vcy",1),this._setRawDefault("valueXShow","valueXWorking"),this._setRawDefault("valueYShow","valueYWorking"),this._setRawDefault("openValueXShow","openValueXWorking"),this._setRawDefault("openValueYShow","openValueYWorking"),this._setRawDefault("lowValueXShow","lowValueXWorking"),this._setRawDefault("lowValueYShow","lowValueYWorking"),this._setRawDefault("highValueXShow","highValueXWorking"),this._setRawDefault("highValueYShow","highValueYWorking"),this._setRawDefault("lowValueXGrouped","low"),this._setRawDefault("lowValueYGrouped","low"),this._setRawDefault("highValueXGrouped","high"),this._setRawDefault("highValueYGrouped","high"),super._afterNew(),this.set("maskContent",!0),this._disposers.push(this.axisRanges.events.onAll((t=>{if("clear"===t.type)x(t.oldValues,(t=>{this._removeAxisRange(t)}));else if("push"===t.type)this._processAxisRange(t.newValue);else if("setIndex"===t.type)this._processAxisRange(t.newValue);else if("insertIndex"===t.type)this._processAxisRange(t.newValue);else if("removeIndex"===t.type)this._removeAxisRange(t.oldValue);else{if("moveIndex"!==t.type)throw new Error("Unknown IStreamEvent type");this._processAxisRange(t.value)}}))),this.states.create("hidden",{opacity:1,visible:!1}),this._makeFieldNames()}_processAxisRange(t){const e=h.new(this._root,{});t.container=e,this.children.push(e),t.series=this;const i=t.axisDataItem;i.setRaw("isRange",!0);const s=i.component;if(s){s._processAxisRange(i,["range","series"]);const t=i.get("bullet");if(t){const e=t.get("sprite");e&&e.setPrivate("visible",!1)}const a=i.get("axisFill");a&&e.set("mask",a),s._seriesAxisRanges.push(i)}}_removeAxisRange(t){const e=t.axisDataItem,i=e.component;i.disposeDataItem(e),g(i._seriesAxisRanges,e);const s=t.container;s&&s.dispose()}_updateFields(){super._updateFields(),this._valueXFields=[],this._valueYFields=[],this._valueXShowFields=[],this._valueYShowFields=[],this.__valueXShowFields=[],this.__valueYShowFields=[],this.valueXFields&&x(this.valueXFields,(t=>{if(this.get(t+"Field")){this._valueXFields.push(t);let e=this.get(t+"Show");this.__valueXShowFields.push(e),-1!=e.indexOf("Working")?this._valueXShowFields.push(e.split("Working")[0]):this._valueXShowFields.push(e)}})),this.valueYFields&&x(this.valueYFields,(t=>{if(this.get(t+"Field")){this._valueYFields.push(t);let e=this.get(t+"Show");this.__valueYShowFields.push(e),-1!=e.indexOf("Working")?this._valueYShowFields.push(e.split("Working")[0]):this._valueYShowFields.push(e)}}))}_dispose(){super._dispose();const t=this.chart;t&&t.series.removeValue(this),A(this.get("xAxis").series,this),A(this.get("yAxis").series,this)}_min(t,e){let i=ct(this.getPrivate(t),e);this.setPrivate(t,i)}_max(t,e){let i=ut(this.getPrivate(t),e);this.setPrivate(t,i)}_shouldMakeBullet(t){const e=this.get("xAxis"),i=this.get("yAxis"),s=this.get("baseAxis");if(!e.inited||!i.inited)return!1;const a=this.get("minBulletDistance",0);if(a>0){let t=this.startIndex(),o=this.endIndex()-t;if(e==s){if(e.get("renderer").axisLength()/o<a/5)return!1}else if(i==s&&i.get("renderer").axisLength()/o<a/5)return!1}return null!=t.get(this._xField)&&null!=t.get(this._yField)}_makeFieldNames(){const t=this.get("xAxis"),e=this.get("yAxis"),i=t.getPrivate("name"),s=D(i),a=e.getPrivate("name"),o=D(a),n=t.get("renderer").getPrivate("letter"),r=e.get("renderer").getPrivate("letter"),l="open",h="low",d="high",c="Show";"ValueAxis"===t.className?(this._xField=this.get(i+n+c),this._xOpenField=this.get(l+s+n+c),this._xLowField=this.get(h+s+n+c),this._xHighField=this.get(d+s+n+c)):(this._xField=i+n,this._xOpenField=l+s+n,this._xLowField=h+s+n,this._xHighField=d+s+n),"ValueAxis"===e.className?(this._yField=this.get(a+r+c),this._yOpenField=this.get(l+o+r+c),this._yLowField=this.get(h+o+r+c),this._yHighField=this.get(d+o+r+c)):(this._yField=a+r,this._yOpenField=l+o+r,this._yLowField=h+o+r,this._yHighField=d+o+r)}_fixVC(){const t=this.get("xAxis"),e=this.get("yAxis"),i=this.get("baseAxis"),s=this.states.lookup("hidden"),a=this.get("sequencedInterpolation");if(s){let o=0;a&&(o=.999999999999),t===i?s.set("vcy",o):(e===i||s.set("vcy",o),s.set("vcx",o))}}_handleMaskBullets(){this.isDirty("maskBullets")&&this.bulletsContainer.set("maskContent",this.get("maskBullets"))}_fixPosition(){const t=this.get("xAxis"),e=this.get("yAxis");this.set("x",t.x()-M(t.get("centerX",0),t.width())-t.parent.get("paddingLeft",0)),this.set("y",e.y()-M(e.get("centerY",0),e.height())-e.parent.get("paddingTop",0)),this.bulletsContainer.set("y",this.y()),this.bulletsContainer.set("x",this.x())}_prepareChildren(){super._prepareChildren(),(this.isDirty("valueYShow")||this.isDirty("valueXShow")||this.isDirty("openValueYShow")||this.isDirty("openValueXShow")||this.isDirty("lowValueYShow")||this.isDirty("lowValueXShow")||this.isDirty("highValueYShow")||this.isDirty("highValueXShow"))&&(this._updateFields(),this._makeFieldNames(),this._valuesDirty=!0),(this.isDirty("xAxis")||this.isDirty("yAxis"))&&(this._valuesDirty=!0),this.set("width",this.get("xAxis").width()),this.set("height",this.get("yAxis").height()),this._handleMaskBullets();const t=this.get("xAxis"),e=this.get("yAxis"),i=this.get("baseAxis");let s;switch(this.get("tooltipPositionX")){case"open":s=this._xOpenField;break;case"low":s=this._xLowField;break;case"high":s=this._xHighField;break;default:s=this._xField}this._tooltipFieldX=s;let a;switch(this.get("tooltipPositionY")){case"open":a=this._yOpenField;break;case"low":a=this._yLowField;break;case"high":a=this._yHighField;break;default:a=this._yField}this._tooltipFieldY=a,this.isDirty("baseAxis")&&this._fixVC(),this._fixPosition();const o=this.get("stacked");if(this.isDirty("stacked")&&(o?this._valuesDirty&&!this._dataProcessed||this._stack():this._unstack()),this._valuesDirty&&!this._dataProcessed&&(this._dataProcessed=!0,o&&this._stack(),x(this.dataItems,(i=>{x(this._valueXShowFields,(t=>{let e=i.get(t);null!=e&&(o&&(e+=this.getStackedXValue(i,t)),this._min("minX",e),this._max("maxX",e))})),x(this._valueYShowFields,(t=>{let e=i.get(t);null!=e&&(o&&(e+=this.getStackedYValue(i,t)),this._min("minY",e),this._max("maxY",e))})),t.processSeriesDataItem(i,this._valueXFields),e.processSeriesDataItem(i,this._valueYFields)})),t._seriesValuesDirty=!0,e._seriesValuesDirty=!0,this.get("ignoreMinMax")||((this.isPrivateDirty("minX")||this.isPrivateDirty("maxX"))&&t.markDirtyExtremes(),(this.isPrivateDirty("minY")||this.isPrivateDirty("maxY"))&&e.markDirtyExtremes()),this._markStakedDirtyStack(),this.get("tooltipDataItem")||this.updateLegendValue(void 0)),(this.isDirty("vcx")||this.isDirty("vcy"))&&this._markStakedDirtyStack(),this._dataGrouped||(t._groupSeriesData(this),e._groupSeriesData(this),this._dataGrouped=!0),this._valuesDirty||this.isPrivateDirty("startIndex")||this.isPrivateDirty("endIndex")||this.isDirty("vcx")||this.isDirty("vcy")||this._stackDirty){let s=this.startIndex(),a=this.endIndex(),o=this.get("minBulletDistance",0);if(o>0&&i&&(i.get("renderer").axisLength()/(a-s)>o?this._showBullets=!0:this._showBullets=!1),(this._psi!=s||this._pei!=a||this.isDirty("vcx")||this.isDirty("vcy")||this._stackDirty||this._valuesDirty)&&!this._selectionProcessed){this._selectionProcessed=!0;const o=this.get("vcx",1),n=this.get("vcy",1),r=this.get("stacked",!1),l=this.getPrivate("outOfSelection");if(i===t||!i)if(e._calculateTotals(),this.setPrivateRaw("selectionMinY",void 0),this.setPrivateRaw("selectionMaxY",void 0),l)e.markDirtySelectionExtremes();else for(let t=s;t<a;t++)this.processYSelectionDataItem(this.dataItems[t],n,r);if(i===e||!i)if(t._calculateTotals(),this.setPrivateRaw("selectionMinX",void 0),this.setPrivateRaw("selectionMaxX",void 0),l)e.markDirtySelectionExtremes();else for(let t=s;t<a;t++)this.processXSelectionDataItem(this.dataItems[t],o,r);if((i===t||!i)&&"valueYWorking"!==this.get("valueYShow")){const t=this.getPrivate("selectionMinY");null!=t&&(this.setPrivateRaw("minY",t),e.markDirtyExtremes());const i=this.getPrivate("selectionMaxY");null!=i&&(this.setPrivateRaw("maxY",i),e.markDirtyExtremes())}if((i===e||!i)&&"valueXWorking"!==this.get("valueXShow")){const i=this.getPrivate("selectionMinX");null!=i&&(this.setPrivateRaw("minX",i),e.markDirtyExtremes());const s=this.getPrivate("selectionMaxX");null!=s&&(this.setPrivateRaw("maxX",s),t.markDirtyExtremes())}(this.isPrivateDirty("selectionMinX")||this.isPrivateDirty("selectionMaxX"))&&t.markDirtySelectionExtremes(),(this.isPrivateDirty("selectionMinY")||this.isPrivateDirty("selectionMaxY"))&&e.markDirtySelectionExtremes()}}}_makeRangeMask(){if(this.axisRanges.length>0){let t=this._mainContainerMask;null==t&&(t=this.children.push(d.new(this._root,{})),this._mainContainerMask=t,t.set("draw",((e,i)=>{const s=this.parent;if(s){const t=this._root.container.width(),a=this._root.container.height();e.moveTo(-t,-a),e.lineTo(-t,2*a),e.lineTo(2*t,2*a),e.lineTo(2*t,-a),e.lineTo(-t,-a),this.axisRanges.each((t=>{const a=t.axisDataItem.get("axisFill");if(s&&a){let t=a.get("draw");t&&t(e,i)}}))}this.mainContainer._display.mask=t._display}))),t.markDirty(),t._markDirtyKey("fill")}else this.mainContainer._display.mask=null}_updateChildren(){super._updateChildren(),this._x=this.x(),this._y=this.y(),this._makeRangeMask()}_stack(){const t=this.chart;if(t){const e=t.series.indexOf(this);if(this._couldStackTo=[],e>0){let i;for(let s=e-1;s>=0&&(i=t.series.getIndex(s),i.get("xAxis")!==this.get("xAxis")||i.get("yAxis")!==this.get("yAxis")||i.className!==this.className||(this._couldStackTo.push(i),i.get("stacked")));s--);}this._stackDataItems()}}_unstack(){_(this._reallyStackedTo,((t,e)=>{delete e._stackedSeries[this.uid]})),this._reallyStackedTo={},x(this.dataItems,(t=>{t.setRaw("stackToItemY",void 0),t.setRaw("stackToItemX",void 0)}))}_stackDataItems(){const t=this.get("baseAxis"),e=this.get("xAxis"),i=this.get("yAxis");let a,o;t===e?(a="valueY",o="stackToItemY"):t===i&&(a="valueX",o="stackToItemX");let n=this._couldStackTo.length,r=0;const l=this.get("stackToNegative");this._reallyStackedTo={},x(this.dataItems,(t=>{for(let e=0;e<n;e++){let i=this._couldStackTo[e],n=i.dataItems[r],h=t.get(a);if(n){let e=n.get(a);if(l){if(!s(h))break;if(s(e)){if(h>=0&&e>=0){t.setRaw(o,n),this._reallyStackedTo[i.uid]=i,i._stackedSeries[this.uid]=this;break}if(h<0&&e<0){t.setRaw(o,n),this._reallyStackedTo[i.uid]=i,i._stackedSeries[this.uid]=this;break}}}else if(s(h)&&s(e)){t.setRaw(o,n),this._reallyStackedTo[i.uid]=i,i._stackedSeries[this.uid]=this;break}}}r++}))}processXSelectionDataItem(t,e,i){x(this.__valueXShowFields,(s=>{let a=t.get(s);null!=a&&(i&&(a+=this.getStackedXValueWorking(t,s)),this._min("selectionMinX",a),this._max("selectionMaxX",a*e))}))}processYSelectionDataItem(t,e,i){x(this.__valueYShowFields,(s=>{let a=t.get(s);null!=a&&(i&&(a+=this.getStackedYValueWorking(t,s)),this._min("selectionMinY",a),this._max("selectionMaxY",a*e))}))}getStackedYValueWorking(t,e){const i=t.get("stackToItemY");if(i){const t=i.component;return i.get(e,0)*t.get("vcy",1)+this.getStackedYValueWorking(i,e)}return 0}getStackedXValueWorking(t,e){const i=t.get("stackToItemX");if(i){const t=i.component;return i.get(e,0)*t.get("vcx",1)+this.getStackedXValueWorking(i,e)}return 0}getStackedYValue(t,e){const i=t.get("stackToItemY");return i?i.get(e,0)+this.getStackedYValue(i,e):0}getStackedXValue(t,e){const i=t.get("stackToItemX");return i?i.get(e,0)+this.getStackedXValue(i,e):0}createLegendMarker(t){this.updateLegendMarker()}_markDirtyAxes(){this._axesDirty=!0,this.markDirty()}_markDataSetDirty(){this._afterDataChange(),this._valuesDirty=!0,this._dataProcessed=!1,this._aggregatesCalculated=!1,this.markDirty()}_clearDirty(){super._clearDirty(),this._axesDirty=!1,this._selectionProcessed=!1,this._stackDirty=!1,this._dataProcessed=!1}_positionBullet(t){let e=t.get("sprite");if(e){let i=e.dataItem,s=t.get("locationX",i.get("locationX",.5)),a=t.get("locationY",i.get("locationY",.5)),o=this.get("xAxis"),n=this.get("yAxis");const r=o.getDataItemPositionX(i,this._xField,s,this.get("vcx",1)),l=n.getDataItemPositionY(i,this._yField,a,this.get("vcy",1));let h=this.getPoint(r,l),d=i.get("left",h.x),c=i.get("right",h.x),u=i.get("top",h.y),g=i.get("bottom",h.y);if(this._shouldShowBullet(r,l)){t.getPrivate("hidden")?e.setPrivate("visible",!1):e.setPrivate("visible",!0);let i=c-d,o=g-u;e.isType("Label")&&(e.setPrivate("maxWidth",Math.abs(i)),e.setPrivate("maxHeight",Math.abs(o)));let n=d+i*s,r=g-o*a;e.set("x",n),e.set("y",r)}else e.setPrivate("visible",!1)}}_shouldShowBullet(t,e){return this._showBullets}setDataSet(t){if(this._dataSets[t]){this._handleDataSetChange(),this._dataItems=this._dataSets[t],this._markDataSetDirty(),this._dataSetId=t;const e="datasetchanged";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this,id:t})}}_handleDataSetChange(){this.bullets.length>0&&x(this._dataItems,(t=>{let e=t.bullets;e&&x(e,(t=>{if(t){let e=t.get("sprite");e&&e.setPrivate("visible",!1)}}))})),this._selectionProcessed=!1}show(t){const e=Object.create(null,{show:{get:()=>super.show}});return $(this,void 0,void 0,(function*(){this._fixVC();let i=[];i.push(e.show.call(this,t).then((()=>{this._isShowing=!1;let t=this.get("xAxis"),e=this.get("yAxis"),i=this.get("baseAxis");e!==i&&e.markDirtySelectionExtremes(),t!==i&&t.markDirtySelectionExtremes()}))),i.push(this.bulletsContainer.show(t)),i.push(this._sequencedShowHide(!0,t)),yield Promise.all(i)}))}hide(t){const e=Object.create(null,{hide:{get:()=>super.hide}});return $(this,void 0,void 0,(function*(){this._fixVC();let i=[];i.push(e.hide.call(this,t).then((()=>{this._isHiding=!1}))),i.push(this.bulletsContainer.hide(t)),i.push(this._sequencedShowHide(!1,t)),yield Promise.all(i)}))}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return $(this,void 0,void 0,(function*(){const a=[i.showDataItem.call(this,t,e)];s(e)||(e=this.get("stateAnimationDuration",0));const o=this.get("stateAnimationEasing");x(this._valueFields,(i=>{a.push(t.animate({key:i+"Working",to:t.get(i),duration:e,easing:o}).waitForStop())})),yield Promise.all(a)}))}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return $(this,void 0,void 0,(function*(){const a=[i.hideDataItem.call(this,t,e)],o=this.states.create("hidden",{});s(e)||(e=o.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const n=o.get("stateAnimationEasing",this.get("stateAnimationEasing")),r=this.get("xAxis"),l=this.get("yAxis"),h=this.get("baseAxis"),d=this.get("stacked");if(h!==r&&h||x(this._valueYFields,(i=>{let o=l.getPrivate("min"),r=l.baseValue();s(o)&&o>r&&(r=o),d&&(r=0),null!=t.get(i)&&a.push(t.animate({key:i+"Working",to:r,duration:e,easing:n}).waitForStop())})),h===l||!h){let i=r.getPrivate("min"),o=r.baseValue();s(i)&&i>o&&(o=i),d&&(o=0),x(this._valueXFields,(i=>{null!=t.get(i)&&a.push(t.animate({key:i+"Working",to:o,duration:e,easing:n}).waitForStop())}))}yield Promise.all(a)}))}_markDirtyStack(){this._stackDirty=!0,this.markDirty(),this._markStakedDirtyStack()}_markStakedDirtyStack(){const t=this._stackedSeries;t&&_(t,((t,e)=>{e._stackDirty||e._markDirtyStack()}))}_afterChanged(){super._afterChanged(),this._skipped&&(this._markDirtyAxes(),this._skipped=!1)}showDataItemTooltip(t){this.updateLegendMarker(t),this.updateLegendValue(t);const e=this.get("tooltip");if(e)if(this.isHidden())this.hideTooltip();else if(e._setDataItem(t),t){let i=this.get("locationX",0),s=this.get("locationY",1),a=t.get("locationX",i),o=t.get("locationY",s);const n=this.get("xAxis"),r=this.get("yAxis"),l=this.get("vcx",1),h=this.get("vcy",1),d=n.getDataItemPositionX(t,this._tooltipFieldX,this._aLocationX0+(this._aLocationX1-this._aLocationX0)*a,l),c=r.getDataItemPositionY(t,this._tooltipFieldY,this._aLocationY0+(this._aLocationY1-this._aLocationY0)*o,h),u=this.getPoint(d,c);let g=!0;if(x(this._valueFields,(e=>{null==t.get(e)&&(g=!1)})),g){const i=this.chart;i&&i.inPlot(u)?(e.label.text.markDirtyText(),e.set("tooltipTarget",this._getTooltipTarget(t)),e.set("pointTo",this._display.toGlobal({x:u.x,y:u.y}))):e._setDataItem(void 0)}else e._setDataItem(void 0)}}hideTooltip(){const t=this.get("tooltip");return t&&t.set("tooltipTarget",this),super.hideTooltip()}_getTooltipTarget(t){if("bullet"==this.get("seriesTooltipTarget")){const e=t.bullets;if(e&&e.length>0){const t=e[0].get("sprite");if(t)return t}}return this}updateLegendValue(t){const e=this.get("legendDataItem");if(e){const i=e.get("label");if(i){let e="";t?(i._setDataItem(t),e=this.get("legendLabelText",i.get("text",this.get("name","")))):(i._setDataItem(this._emptyDataItem),e=this.get("legendRangeLabelText",this.get("legendLabelText",i.get("text",this.get("name",""))))),i.set("text",e)}const s=e.get("valueLabel");if(s){let e="";t?(s._setDataItem(t),e=this.get("legendValueText",s.get("text",""))):(s._setDataItem(this._emptyDataItem),e=this.get("legendRangeValueText",s.get("text",""))),s.set("text",e)}}}_getItemReaderLabel(){let t="X: {"+this._xField;return this.get("xAxis").isType("DateAxis")&&(t+=".formatDate()"),t+="}; Y: {"+this._yField,this.get("yAxis").isType("DateAxis")&&(t+=".formatDate()"),t+="}",t}getPoint(t,e){let i=this.get("xAxis").get("renderer").positionToCoordinate(t),s=this.get("yAxis").get("renderer").positionToCoordinate(e),a=999999999;return s<-a&&(s=-a),s>a&&(s=a),i<-a&&(i=-a),i>a&&(i=a),{x:i,y:s}}_shouldInclude(t){return!0}handleCursorHide(){this.hideTooltip(),this.updateLegendValue(void 0),this.updateLegendMarker(void 0)}_afterDataChange(){super._afterDataChange(),this.get("xAxis")._markDirtyKey("start"),this.get("yAxis")._markDirtyKey("start"),this.resetExtremes()}resetExtremes(){this.setPrivate("selectionMinX",void 0),this.setPrivate("selectionMaxX",void 0),this.setPrivate("selectionMinY",void 0),this.setPrivate("selectionMaxY",void 0),this.setPrivate("minX",void 0),this.setPrivate("minY",void 0),this.setPrivate("maxX",void 0),this.setPrivate("maxY",void 0)}createAxisRange(t){return this.axisRanges.push({axisDataItem:t})}get mainDataItems(){return this._mainDataItems}}Object.defineProperty(gt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYSeries"}),Object.defineProperty(gt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([gt.className])});class pt extends gt{constructor(){super(...arguments),Object.defineProperty(this,"_ph",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_pw",{enumerable:!0,configurable:!0,writable:!0,value:0})}_makeGraphics(t,e){return this.makeColumn(e,t)}_makeFieldNames(){super._makeFieldNames();const t=this.get("xAxis"),e=this.get("yAxis"),i="CategoryAxis",s="ValueAxis";t.isType(i)&&(this.get("openCategoryXField")||(this._xOpenField=this._xField)),t.isType(s)&&(this.get("openValueXField")||(this._xOpenField=this._xField)),e.isType(i)&&(this.get("openCategoryYField")||(this._yOpenField=this._yField)),e.isType(s)&&(this.get("openValueYField")||(this._yOpenField=this._yField))}_prepareChildren(){super._prepareChildren();const t=this.get("xAxis"),e=this.get("yAxis"),i=this.dataItems.length,s=Math.max(0,this.startIndex()-2),a=Math.min(this.endIndex()+2,i-1);if(t.inited&&e.inited)for(let o=s;o<=a;o++){let t=this.dataItems[o];this._createGraphics(t)}}_updateChildren(){const t=this.chart;t&&(this._ph=t.plotContainer.height(),this._pw=t.plotContainer.width());const e=this.get("xAxis"),i=this.get("yAxis"),s=this.get("baseAxis"),a=this.columns.template;this.isDirty("fill")&&null==a.get("fill")&&a.set("fill",this.get("fill")),this.isDirty("stroke")&&null==a.get("stroke")&&a.set("stroke",this.get("stroke"));let o=0,n=0,r=0;x(s.series,(t=>{if(t instanceof pt){const e=t.get("stacked");e&&0==r&&n++,!e&&t.get("clustered")&&n++}t===this&&(o=n-1),r++})),this.get("clustered")||(o=0,n=1),0===n&&(n=1,o=0);const l=e.get("renderer"),h=i.get("renderer"),d="cellStartLocation",c="cellEndLocation",u=l.get(d,0),g=l.get(c,1),p=h.get(d,0),m=h.get(c,1);if(this._aLocationX0=u+o/n*(g-u),this._aLocationX1=u+(o+1)/n*(g-u),this._aLocationY0=p+o/n*(m-p),this._aLocationY1=p+(o+1)/n*(m-p),e.inited&&i.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty){const t=this.dataItems.length;let e=Math.max(0,this.startIndex()-2),i=Math.min(this.endIndex()+2,t-1);for(let a=0;a<e;a++)this._toggleColumn(this.dataItems[a],!1);let s=this.dataItems[e];for(let a=e;a<=i;a++){let t=this.dataItems[a];if(null!=t.get("valueX")&&null!=t.get("valueY")){if(s=t,a>0&&e>0)for(let t=a-1;t>=0;t--){let e=this.dataItems[t];if(null!=e.get("valueX")&&null!=e.get("valueY")){s=e;break}}break}this._toggleColumn(t,!1)}for(let a=e;a<=i;a++){let t=this.dataItems[a];this._updateGraphics(t,s),null!=t.get("valueX")&&null!=t.get("valueY")&&(s=t)}for(let a=i+1;a<t;a++)this._toggleColumn(this.dataItems[a],!1)}}else this._skipped=!0;this.updateLegendMarker(this.get("tooltipDataItem")),super._updateChildren()}_createGraphics(t){let e=t.get("graphics");if(!e){e=this._makeGraphics(this.columns,t),t.set("graphics",e),e._setDataItem(t);const i=t.get("legendDataItem");if(i){const t=i.get("markerRectangle");t&&t.setAll({fill:e.get("fill"),stroke:e.get("stroke")})}this.axisRanges.each((e=>{const i=e.container,s=t.get("rangeGraphics",[]);t.set("rangeGraphics",s);const a=this._makeGraphics(e.columns,t);s.push(a),a.setPrivate("list",e.columns),i.children.push(a)}))}}_updateGraphics(t,e){let i=t.get("graphics");const s=this._xField,a=this._yField,o=t.get(s),n=t.get(a);if(null!=o&&null!=n){const o=this._xOpenField,n=this._yOpenField,r=this.get("locationX",t.get("locationX",.5)),l=this.get("locationY",t.get("locationY",.5)),h=this.get("openLocationX",t.get("openLocationX",r)),d=this.get("openLocationY",t.get("openLocationY",l)),c=i.get("width"),u=i.get("height"),g=this.get("stacked"),p=this.get("xAxis"),m=this.get("yAxis"),_=this.get("baseAxis"),b=p.get("start"),f=p.get("end"),v=m.get("start"),P=m.get("end");let w,k,T,A,D=this.get("vcy",1),M=this.get("vcx",1),I=!1,X=!1;if(m.isType("CategoryAxis")&&p.isType("CategoryAxis")){let e=this._aLocationX0+h-.5,i=this._aLocationX1+r-.5;if(c instanceof y){let t=(i-e)*(1-c.value)/2;e+=t,i-=t}if(w=p.getDataItemPositionX(t,o,e,M),k=p.getDataItemPositionX(t,s,i,M),e=this._aLocationY0+d-.5,i=this._aLocationY1+l-.5,u instanceof y){let t=(i-e)*(1-u.value)/2;e+=t,i-=t}T=m.getDataItemPositionY(t,n,e,D),A=m.getDataItemPositionY(t,a,i,D),t.setRaw("point",{x:w+(k-w)/2,y:T+(A-T)/2})}else if(p===_){let e=this._aLocationX0+h-.5,i=this._aLocationX1+r-.5;if(c instanceof y){let t=(i-e)*(1-c.value)/2;e+=t,i-=t}if(w=p.getDataItemPositionX(t,o,e,M),k=p.getDataItemPositionX(t,s,i,M),T=m.getDataItemPositionY(t,a,l,D),this._yOpenField!==this._yField)A=m.getDataItemPositionY(t,n,d,D);else if(g){let e=t.get("stackToItemY");A=e?m.getDataItemPositionY(e,a,d,e.component.get("vcy")):m.basePosition()}else A=m.basePosition();t.setRaw("point",{x:w+(k-w)/2,y:T}),X=!0}else if(m===_){let e=this._aLocationY0+d-.5,i=this._aLocationY1+l-.5;if(u instanceof y){let t=(i-e)*(1-u.value)/2;e+=t,i-=t}if(T=m.getDataItemPositionY(t,n,e,D),A=m.getDataItemPositionY(t,a,i,D),k=p.getDataItemPositionX(t,s,r,M),this._xOpenField!==this._xField)w=p.getDataItemPositionX(t,o,h,M);else if(g){let e=t.get("stackToItemX");w=e?p.getDataItemPositionX(e,s,h,e.component.get("vcx")):p.basePosition()}else w=p.basePosition();I=!0,t.setRaw("point",{x:k,y:T+(A-T)/2})}this._updateSeriesGraphics(t,i,w,k,T,A,I,X),w<b&&k<b||w>f&&k>f||T<v&&A<=v||T>=P&&A>P||C(w)||C(T)?this._toggleColumn(t,!1):this._toggleColumn(t,!0);let Y=t.get("rangeGraphics");Y&&x(Y,(e=>{this._updateSeriesGraphics(t,e,w,k,T,A,I,X)})),this._applyGraphicsStates(t,e)}}_updateSeriesGraphics(t,e,i,a,o,n,r,l){const h=e.get("width"),d=e.get("height"),c=e.get("maxWidth"),u=e.get("maxHeight"),g=this.getPoint(i,o),p=this.getPoint(a,n),m=t.get("point");if(m){const t=this.getPoint(m.x,m.y);m.x=t.x+this._x,m.y=t.y+this._y}if(i=g.x,a=p.x,o=g.y,n=p.y,s(h)){const t=(a-i-h)/2;i+=t,a-=t}if(s(c)&&c<Math.abs(a-i)){const t=(a-i-c)/2;i+=t,a-=t}if(s(d)){const t=(n-o-d)/2;o+=t,n-=t}if(s(u)&&u<Math.abs(n-o)){const t=(n-o-u)/2;o+=t,n-=t}this.get("adjustBulletPosition")&&(r&&(a=Math.min(Math.max(0,a),this._pw),i=Math.min(Math.max(0,i),this._pw)),l&&(o=Math.min(Math.max(0,o),this._ph),n=Math.min(Math.max(0,n),this._ph))),t.setRaw("left",i),t.setRaw("right",a),t.setRaw("top",o),t.setRaw("bottom",n),e.setPrivate("width",a-i),e.setPrivate("height",n-o),e.set("x",i),e.set("y",n-(n-o))}_handleDataSetChange(){super._handleDataSetChange(),x(this._dataItems,(t=>{this._toggleColumn(t,!1)}))}_applyGraphicsStates(t,e){const i=t.get("graphics"),a=i.states.lookup("dropFromOpen"),o=i.states.lookup("riseFromOpen"),n=i.states.lookup("dropFromPrevious"),r=i.states.lookup("riseFromPrevious");if(a||n||o||r){const i=this.get("xAxis"),l=this.get("yAxis"),h=this.get("baseAxis");let d,c,u;h===i&&l.isType("ValueAxis")?(d=t.get(this._yOpenField),c=t.get(this._yField),u=e.get(this._yField)):h===l&&i.isType("ValueAxis")&&(d=t.get(this._xOpenField),c=t.get(this._xField),u=e.get(this._xField)),s(d)&&s(c)&&(c<d?a&&a.apply():o&&o.apply(),s(u)&&(c<u?n&&n.apply():r&&r.apply()))}}disposeDataItem(t){super.disposeDataItem(t);const e=t.get("graphics");e&&(this.columns.removeValue(e),e.dispose());const i=t.get("rangeGraphics");i&&x(i,(t=>{const e=t.getPrivate("list");e&&e.removeValue(t),t.dispose()}))}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return $(this,void 0,void 0,(function*(){const s=[i.hideDataItem.call(this,t,e)],a=t.get("graphics");a&&s.push(a.hide(e));const o=t.get("rangeGraphics");o&&x(o,(t=>{s.push(t.hide(e))})),yield Promise.all(s)}))}_toggleColumn(t,e){const i=t.get("graphics");i&&i.setPrivate("visible",e);const s=t.get("rangeGraphics");s&&x(s,(t=>{t.setPrivate("visible",e)}));const a=t.bullets;a&&x(a,(t=>{t.setPrivate("hidden",!e)}))}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return $(this,void 0,void 0,(function*(){const s=[i.showDataItem.call(this,t,e)],a=t.get("graphics");a&&s.push(a.show(e));const o=t.get("rangeGraphics");o&&x(o,(t=>{s.push(t.show(e))})),yield Promise.all(s)}))}updateLegendMarker(t){let e=this.get("legendDataItem");if(this.get("useLastColorForLegendMarker")&&!t){const e=this.dataItems[this.endIndex()-1];e&&(t=e)}if(e){let i=this.columns.template;if(t){let e=t.get("graphics");e&&(i=e)}const s=e.get("markerRectangle");s&&(e.get("itemContainer").get("disabled")||x(I,(t=>{s.set(t,i.get(t,this.get(t)))})))}}_getTooltipTarget(t){if("bullet"==this.get("seriesTooltipTarget"))return super._getTooltipTarget(t);let e=t.get("graphics");return e||this}}Object.defineProperty(pt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"BaseColumnSeries"}),Object.defineProperty(pt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:gt.classNames.concat([pt.className])});class mt extends q{constructor(){super(...arguments),Object.defineProperty(this,"_series",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPanning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(h.new(this._root,{}))}),Object.defineProperty(this,"gridContainer",{enumerable:!0,configurable:!0,writable:!0,value:h.new(this._root,{width:e,height:e})}),Object.defineProperty(this,"topGridContainer",{enumerable:!0,configurable:!0,writable:!0,value:h.new(this._root,{width:e,height:e})}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(h.new(this._root,{isMeasured:!1,width:e,height:e,position:"absolute"}))}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rangesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_panStart",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_panEnd",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_sAnimation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_eAnimation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_skipSync",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"axisRanges",{enumerable:!0,configurable:!0,writable:!0,value:new T}),Object.defineProperty(this,"_seriesAxisRanges",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"ghostLabel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cursorPosition",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"_snapToSeries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_seriesValuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"axisHeader",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(h.new(this._root,{themeTags:["axis","header"],position:"absolute",background:c.new(this._root,{themeTags:["header","background"],fill:this._root.interfaceColors.get("background")})}))}),Object.defineProperty(this,"_bullets",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_dispose(){this.gridContainer.dispose(),this.topGridContainer.dispose(),this.bulletsContainer.dispose(),this.labelsContainer.dispose(),this.axisHeader.dispose(),super._dispose()}_afterNew(){super._afterNew(),this.setPrivate("updateScrollbar",!0),this._disposers.push(this.axisRanges.events.onAll((t=>{if("clear"===t.type)x(t.oldValues,(t=>{this.disposeDataItem(t)}));else if("push"===t.type)this._processAxisRange(t.newValue,["range"]);else if("setIndex"===t.type)this._processAxisRange(t.newValue,["range"]);else if("insertIndex"===t.type)this._processAxisRange(t.newValue,["range"]);else if("removeIndex"===t.type)this.disposeDataItem(t.oldValue);else{if("moveIndex"!==t.type)throw new Error("Unknown IStreamEvent type");this._processAxisRange(t.value,["range"])}})));const t=this.get("renderer");t&&(t.axis=this,t.processAxis()),this.children.push(t),this.ghostLabel=t.makeLabel(new Z(this,void 0,{}),[]),this.ghostLabel.adapters.disable("text"),this.ghostLabel.setAll({opacity:0,tooltipText:void 0,tooltipHTML:void 0,interactive:!1}),this.ghostLabel.events.disable()}_updateFinals(t,e){}zoom(t,e,i,a){if(this._updateFinals(t,e),this.get("start")!==t||this.get("end")!=e){let o=this._sAnimation,n=this._eAnimation,r=this.get("maxDeviation",.5)*Math.min(1,e-t);t<-r&&(t=-r),e>1+r&&(e=1+r),t>e&&([t,e]=[e,t]),s(i)||(i=this.get("interpolationDuration",0)),a||(a="end");let l=this.getPrivate("maxZoomFactor",this.get("maxZoomFactor",100)),h=l;1===e&&0!==t&&(a=t<this.get("start")?"start":"end"),0===t&&1!==e&&(a=e>this.get("end")?"end":"start");let d=this.get("minZoomCount"),c=this.get("maxZoomCount");s(d)&&(l=h/d);let u=1;if(s(c)&&(u=h/c),"start"===a?(c>0&&1/(e-t)<u&&(e=t+1/u),1/(e-t)>l&&(e=t+1/l),e>1&&e-t<1/l&&(t=e-1/l)):(c>0&&1/(e-t)<u&&(t=e-1/u),1/(e-t)>l&&(t=e-1/l),t<0&&e-t<1/l&&(e=t+1/l)),1/(e-t)>l&&(e=t+1/l),1/(e-t)>l&&(t=e-1/l),null!=c&&null!=d&&t==this.get("start")&&e==this.get("end")){const t=this.chart;t&&t._handleAxisSelection(this,!0)}if((o&&o.playing&&o.to==t||this.get("start")==t)&&(n&&n.playing&&n.to==e||this.get("end")==e))return;if(i>0){let s,a,o=this.get("interpolationEasing");if(this.get("start")!=t&&(s=this.animate({key:"start",to:t,duration:i,easing:o})),this.get("end")!=e&&(a=this.animate({key:"end",to:e,duration:i,easing:o})),this._sAnimation=s,this._eAnimation=a,s)return s;if(a)return a}else this.set("start",t),this.set("end",e),this._root.events.once("frameended",(()=>{this._markDirtyKey("start"),this._root._markDirty()}))}else this._sAnimation&&this._sAnimation.stop(),this._eAnimation&&this._eAnimation.stop()}get series(){return this._series}_processAxisRange(t,e){t.setRaw("isRange",!0),this._createAssets(t,e),this._rangesDirty=!0,this._prepareDataItem(t);const i=t.get("above"),s=this.topGridContainer,a=t.get("grid");i&&a&&s.children.moveValue(a);const o=t.get("axisFill");i&&o&&s.children.moveValue(o)}_prepareDataItem(t,e){}markDirtyExtremes(){}markDirtySelectionExtremes(){}_calculateTotals(){}_updateAxisRanges(){this._bullets={},this.axisRanges.each((t=>{this._prepareDataItem(t)})),x(this._seriesAxisRanges,(t=>{this._prepareDataItem(t)}))}_prepareChildren(){if(super._prepareChildren(),this.get("fixAxisSize")?this.ghostLabel.set("visible",!0):this.ghostLabel.set("visible",!1),this.isDirty("start")||this.isDirty("end")){this.chart._updateCursor();let t=this.get("start",0),e=this.get("end",1),i=this.get("maxDeviation",.5)*Math.min(1,e-t);if(t<-i){let s=t+i;t=-i,this.setRaw("start",t),this.isDirty("end")&&this.setRaw("end",e-s)}if(e>1+i){let s=e-1-i;e=1+i,this.setRaw("end",e),this.isDirty("start")&&this.setRaw("start",t-s)}}const t=this.get("renderer");if(t._start=this.get("start"),t._end=this.get("end"),t._inversed=t.get("inversed",!1),t._axisLength=t.axisLength()/(t._end-t._start),t._updateLC(),this.isDirty("tooltip")){const e=this.get("tooltip");if(e){const i=t.get("themeTags");e.addTag("axis"),e.addTag(this.className.toLowerCase()),e._applyThemes(),i&&(e.set("themeTags",v(e.get("themeTags"),i)),e.label._applyThemes())}}}_updateTooltipBounds(){const t=this.get("tooltip");t&&this.get("renderer").updateTooltipBounds(t)}_updateBounds(){super._updateBounds(),this._updateTooltipBounds()}processChart(t){this.chart=t;this.get("renderer").chart=t,t.gridContainer.children.push(this.gridContainer),t.topGridContainer.children.push(this.topGridContainer),t.axisHeadersContainer.children.push(this.axisHeader),this.on("start",(()=>{t._handleAxisSelection(this)})),this.on("end",(()=>{t._handleAxisSelection(this)})),t.plotContainer.onPrivate("width",(()=>{this.markDirtySize()})),t.plotContainer.onPrivate("height",(()=>{this.markDirtySize()})),t.processAxis(this)}hideDataItem(t){return this._toggleDataItem(t,!1),super.hideDataItem(t)}showDataItem(t){return this._toggleDataItem(t,!0),super.showDataItem(t)}_toggleDataItem(t,e){const i=t.get("label");i&&i.setPrivate("visible",e);const s=t.get("grid");s&&s.setPrivate("visible",e);const a=t.get("tick");a&&a.setPrivate("visible",e);const o=t.get("axisFill");o&&o.setPrivate("visible",e);const n=t.get("bullet");if(n){const t=n.get("sprite");t&&t.setPrivate("visible",e)}}_createAssets(t,e){const i=this.get("renderer");t.get("label")||i.makeLabel(t,e),t.get("grid")||i.makeGrid(t,e),t.get("tick")||i.makeTick(t,e),t.get("axisFill")||i.makeAxisFill(t,e),this._processBullet(t)}_processBullet(t){let e=t.get("bullet"),i=this.get("bullet");if(e||!i||t.get("isRange")||(e=i(this._root,this,t)),e){e.axis=this;const i=e.get("sprite");i&&(i._setDataItem(t),t.setRaw("bullet",e),i.parent||this.bulletsContainer.children.push(i))}}_afterChanged(){super._afterChanged();const t=this.chart;t&&(t._updateChartLayout(),t.axisHeadersContainer.markDirtySize()),this.get("renderer")._updatePositions()}disposeDataItem(t){super.disposeDataItem(t);const e=this.get("renderer"),i=t.get("label");i&&(e.labels.removeValue(i),i.dispose());const s=t.get("tick");s&&(e.ticks.removeValue(s),s.dispose());const a=t.get("grid");a&&(e.grid.removeValue(a),a.dispose());const o=t.get("axisFill");o&&(e.axisFills.removeValue(o),o.dispose());const n=t.get("bullet");n&&n.dispose()}_updateGhost(){this.setPrivate("cellWidth",this.getCellWidthPosition()*this.get("renderer").axisLength());const t=this.ghostLabel;if(!t.isHidden()){const e=t.localBounds(),i=e.right-e.left;let s=t.get("text");x(this.dataItems,(t=>{const e=t.get("label");if(e&&!e.isHidden()){const t=e.localBounds();t.right-t.left>i&&(s=e.text._getText())}})),t.set("text",s)}let e=this.get("start",0),i=this.get("end",1);this.get("renderer").updateLabel(t,e+.5*(i-e))}_handleCursorPosition(t,e){t=this.get("renderer").toAxisPosition(t),this._cursorPosition=t,this._snapToSeries=e,this.updateTooltip()}updateTooltip(){const t=this._snapToSeries;let e=this._cursorPosition;const i=this.get("tooltip"),a=this.get("renderer");s(e)&&(x(this.series,(i=>{if(i.get("baseAxis")===this){const s=this.getSeriesItem(i,e,this.get("tooltipLocation"));i.setRaw("tooltipDataItem",s),t&&-1!=t.indexOf(i)?(i.updateLegendMarker(s),i.updateLegendValue(s)):i.showDataItemTooltip(s)}})),i&&(a.updateTooltipBounds(i),this.get("snapTooltip")&&(e=this.roundAxisPosition(e,this.get("tooltipLocation",.5))),C(e)?i.hide(0):(this.setPrivateRaw("tooltipPosition",e),this._updateTooltipText(i,e),a.positionTooltip(i,e),e<this.get("start")||e>this.get("end")?i.hide(0):i.show(0))))}_updateTooltipText(t,e){t.label.set("text",this.getTooltipText(e))}roundAxisPosition(t,e){return t}handleCursorShow(){let t=this.get("tooltip");t&&t.show()}handleCursorHide(){let t=this.get("tooltip");t&&t.hide()}processSeriesDataItem(t,e){}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._rangesDirty=!1}coordinateToPosition(t){const e=this.get("renderer");return e.toAxisPosition(t/e.axisLength())}toAxisPosition(t){return this.get("renderer").toAxisPosition(t)}fixPosition(t){return this.get("renderer").fixPosition(t)}shouldGap(t,e,i,s){return!1}createAxisRange(t){return this.axisRanges.push(t)}_groupSeriesData(t){}getCellWidthPosition(){return.05}}Object.defineProperty(mt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Axis"}),Object.defineProperty(mt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:q.classNames.concat([mt.className])});class _t extends mt{constructor(){super(...arguments),Object.defineProperty(this,"_frequency",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_itemMap",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_afterNew(){this._settings.themeTags=v(this._settings.themeTags,["axis"]),this.fields.push("category"),this.setPrivateRaw("name","category"),this.addTag("category"),super._afterNew()}_prepareChildren(){super._prepareChildren();const t=this.dataItems.length;let e=0;this._valuesDirty&&(this._itemMap={},x(this.dataItems,(t=>{t.setRaw("index",e),this._itemMap[t.get("category")]=t,e++})),this.setPrivateRaw("maxZoomFactor",t)),this.setPrivateRaw("startIndex",Math.max(Math.round(this.get("start",0)*t),0)),this.setPrivateRaw("endIndex",Math.min(Math.round(this.get("end",1)*t),t)),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("endIndex")||this.isPrivateDirty("startIndex")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&this.dataItems.length>0&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges())}_handleRangeChange(){x(this.series,(t=>{let e=this.dataItems[this.startIndex()].get("category"),i=this.dataItems[this.endIndex()-1].get("category"),s=t.get("baseAxis"),a=t.get("xAxis"),o=t.get("yAxis");if(a instanceof _t&&o instanceof _t)t._markDirtyAxes();else if(s===this){let n,r,l=o;if(a===s?(t.get("categoryXField")&&(n="categoryX"),t.get("openCategoryXField")&&(r="openCategoryX")):o===s&&(t.get("categoryYField")&&(n="categoryY"),t.get("openCategoryYField")&&(r="openCategoryY"),l=a),"ValueAxis"==l.className&&(n||r)){let s,a;for(let i=0,d=t.dataItems.length;i<d;i++){let a=t.dataItems[i];if(n&&a.get(n)===e){s=a;break}if(r&&a.get(r)===e){s=a;break}}for(let e=t.dataItems.length-1;e>=0;e--){let s=t.dataItems[e];if(n&&s.get(n)===i){a=s;break}if(r&&s.get(r)===i){a=s;break}}let o=0,l=t.dataItems.length;s&&(o=t.dataItems.indexOf(s)),a&&(l=t.dataItems.indexOf(a)+1),t.setPrivate("startIndex",o),t.setPrivate("endIndex",l);let h=!1;for(let e=o;e<l;e++){const i=t.dataItems[e];if(x(t.__valueXShowFields,(t=>{null!=i.get(t)&&(h=!0)})),x(t.__valueYShowFields,(t=>{null!=i.get(t)&&(h=!0)})),h)break}t.setPrivate("outOfSelection",!h)}t._markDirtyAxes()}}))}_prepareAxisItems(){const t=this.get("renderer"),e=this.dataItems.length;let i=this.startIndex();i>0&&i--;let s=this.endIndex();s<e&&s++;let a=t.axisLength()/Math.max(t.get("minGridDistance"),1/Number.MAX_SAFE_INTEGER),o=Math.max(1,Math.min(e,Math.ceil((s-i)/a)));i=Math.floor(i/o)*o,this._frequency=o;for(let r=0;r<e;r++)this.dataItems[r].hide();let n=this.dataItems[i].get("index",0);for(let r=i;r<s;r+=o){let t=this.dataItems[r];this._createAssets(t,[]),t.isHidden()&&t.show(),this._prepareDataItem(t,n,o),n++}this._updateGhost()}_prepareDataItem(t,e,i){let a=this.get("renderer"),o=t.get("categoryLocation",0),n=t.get("endCategoryLocation",1),r=t.get("index");s(r)||(r=this.categoryToIndex(t.get("category")));let l,h=this.indexToPosition(r,o),d=t.get("endCategory");d?(l=this.categoryToIndex(d),s(l)||(l=r)):l=r;let c,u,g=this.indexToPosition(l,n);c=t.get("isRange")?l:r+this._frequency-1,u=this.indexToPosition(c,n),a.updateLabel(t.get("label"),h,g,i),a.updateGrid(t.get("grid"),h,g),a.updateTick(t.get("tick"),h,g,i),a.updateFill(t.get("axisFill"),h,u),this._processBullet(t),a.updateBullet(t.get("bullet"),h,g);const p=this.get("fillRule");p&&p(t,e)}startIndex(){let t=this.dataItems.length;return Math.min(Math.max(this.getPrivate("startIndex",0),0),t-1)}endIndex(){let t=this.dataItems.length;return Math.max(1,Math.min(this.getPrivate("endIndex",t),t))}baseValue(){}basePosition(){return 0}getX(t){let e=this._itemMap[t];return e?this._settings.renderer.positionToCoordinate(this.indexToPosition(e.get("index",0))):NaN}getY(t){let e=this._itemMap[t];return e?this._settings.renderer.positionToCoordinate(this.indexToPosition(e.get("index",0))):NaN}getDataItemPositionX(t,e,i,s){const a=t.get(e),o=this._itemMap[a];return o?this.indexToPosition(o.get("index",0),i):NaN}getDataItemCoordinateX(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(t,e,i,s))}getDataItemPositionY(t,e,i,s){const a=t.get(e),o=this._itemMap[a];return o?this.indexToPosition(o.get("index",0),i):NaN}getDataItemCoordinateY(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(t,e,i,s))}indexToPosition(t,e){s(e)||(e=.5);let i=this.dataItems.length,a=this.get("startLocation",0);i-=a,i-=1-this.get("endLocation",1);let o=(t+e-a)/i,n=this.dataItems[t];return n&&(o+=n.get("deltaPosition",0)),o}categoryToIndex(t){let e=this._itemMap[t];return e?e.get("index"):NaN}dataItemToPosition(t){return this.indexToPosition(t.get("index"))}roundAxisPosition(t,e){return t+=(.5-e)/this.dataItems.length,this.indexToPosition(this.axisPositionToIndex(t),e)}axisPositionToIndex(t){let e=this.dataItems.length;return X(Math.floor(t*e),0,e-1)}getTooltipText(t,e){const i=this.dataItems[this.axisPositionToIndex(t)];if(i){const t=i.get("label");if(t)return Y(t,this.get("tooltipText",""))}}_updateTooltipText(t,e){t._setDataItem(this.dataItems[this.axisPositionToIndex(e)]),t.label.text.markDirtyText()}getSeriesItem(t,e){if(this.dataItems.length>0){let i=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),s=this.axisPositionToIndex(e),a=t.dataItems[s],o=this.dataItems[s],n=o.get("category");if(a&&o&&a.get(i)===n)return a;for(let e=0,r=t.dataItems.length;e<r;e++){let s=t.dataItems[e];if(s.get(i)===n)return s}}}zoomToIndexes(t,e,i){let s=this.dataItems.length;this.zoom(t/s,e/s,i)}zoomToCategories(t,e,i){this.zoomToIndexes(this.categoryToIndex(t),this.categoryToIndex(e)+1,i)}getCellWidthPosition(){return this._frequency/this.dataItems.length/(this.get("end",1)-this.get("start",0))}}Object.defineProperty(_t,"className",{enumerable:!0,configurable:!0,writable:!0,value:"CategoryAxis"}),Object.defineProperty(_t,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:mt.classNames.concat([_t.className])});class xt extends mt{constructor(){super(...arguments),Object.defineProperty(this,"_dirtyExtremes",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirtySelectionExtremes",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_deltaMinMax",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_minReal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_maxReal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_baseValue",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_syncDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_minLogAdjusted",{enumerable:!0,configurable:!0,writable:!0,value:1})}markDirtyExtremes(){this._dirtyExtremes=!0,this.markDirty()}markDirtySelectionExtremes(){this._dirtySelectionExtremes=!0,this.markDirty()}_afterNew(){this._settings.themeTags=v(this._settings.themeTags,["axis"]),this.setPrivateRaw("name","value"),this.addTag("value"),super._afterNew()}_prepareChildren(){if(super._prepareChildren(),this.isDirty("syncWithAxis")){this._prevSettings.syncWithAxis&&this._syncDp&&this._syncDp.dispose();let t=this.get("syncWithAxis");t&&(this._syncDp=new O([t.onPrivate("selectionMinFinal",(()=>{this._dirtySelectionExtremes=!0})),t.onPrivate("selectionMaxFinal",(()=>{this._dirtySelectionExtremes=!0}))]))}(this._sizeDirty||this._dirtyExtremes||this._valuesDirty||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("min")||this.isDirty("max")||this.isDirty("extraMin")||this.isDirty("extraMax")||this.isDirty("logarithmic")||this.isDirty("treatZeroAs")||this.isDirty("baseValue")||this.isDirty("strictMinMax")||this.isDirty("strictMinMaxSelection")||this.isDirty("maxPrecision")||this.isDirty("numberFormat"))&&(this._getMinMax(),this.ghostLabel.set("text",""),this._dirtyExtremes=!1),this._dirtySelectionExtremes&&!this._isPanning&&this.get("autoZoom",!0)&&(this._getSelectionMinMax(),this._dirtySelectionExtremes=!1),this._groupData(),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("min")||this.isPrivateDirty("selectionMax")||this.isPrivateDirty("selectionMin")||this.isPrivateDirty("max")||this.isPrivateDirty("step")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("logarithmic"))&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges()),this._baseValue=this.baseValue()}_groupData(){}_formatText(t){const e=this.get("numberFormat"),i=this.getNumberFormatter();let s="";return s=e?i.format(t,e):i.format(t,void 0,this.getPrivate("stepDecimalPlaces")),s}_prepareAxisItems(){const t=this.getPrivate("min"),e=this.getPrivate("max");if(s(t)&&s(e)){const e=this.get("logarithmic"),i=this.getPrivate("step"),s=this.getPrivate("selectionMin"),a=this.getPrivate("selectionMax")+i;let o=s-i,r=0,l=1,h=t;if(e){if(o=this._minLogAdjusted,o<s)for(;o<s;)o+=i;h=o,h<=0&&(h=1,i<1&&(h=i)),l=Math.log(a-i)*Math.LOG10E-Math.log(h)*Math.LOG10E,l>2&&(o=Math.pow(10,Math.log(h)*Math.LOG10E-5))}let d=-1/0;for(;o<a;){let t;this.dataItems.length<r+1?(t=new Z(this,void 0,{}),this._dataItems.push(t),this.processDataItem(t)):t=this.dataItems[r],this._createAssets(t,[]),t.isHidden()&&t.show(),t.setRaw("value",o);const s=t.get("label");if(s&&s.set("text",this._formatText(o)),this._prepareDataItem(t),e&&l>2?o=Math.pow(10,Math.log(h)*Math.LOG10E+r-5):o+=i,d==o)break;let a=Math.pow(10,Math.floor(Math.log(Math.abs(i))*Math.LOG10E));if(a<1){let t=Math.round(Math.abs(Math.log(Math.abs(a))*Math.LOG10E))+2;o=n(o,t)}r++,d=o}for(let t=r;t<this.dataItems.length;t++)this.dataItems[t].hide();x(this.series,(t=>{t.inited&&t._markDirtyAxes()})),this._updateGhost()}}_prepareDataItem(t,e){let i=this.get("renderer"),a=t.get("value"),o=t.get("endValue"),n=this.valueToPosition(a),r=n,l=this.valueToPosition(a+this.getPrivate("step"));s(o)&&(r=this.valueToPosition(o),l=r),t.get("isRange")&&null==o&&(l=n),i.updateLabel(t.get("label"),n,r,e);const h=t.get("grid");if(i.updateGrid(h,n,r),h&&(a==this.get("baseValue",0)?(h.addTag("base"),h._applyThemes()):h.hasTag("base")&&(h.removeTag("base"),h._applyThemes())),i.updateTick(t.get("tick"),n,r,e),i.updateFill(t.get("axisFill"),n,l),this._processBullet(t),i.updateBullet(t.get("bullet"),n,r),!t.get("isRange")){const e=this.get("fillRule");e&&e(t)}}_handleRangeChange(){let t=this.positionToValue(this.get("start",0)),e=this.positionToValue(this.get("end",1));const i=this.get("renderer").gridCount();let s=this._adjustMinMax(t,e,i,!0),a=S(s.step);this.setPrivateRaw("stepDecimalPlaces",a),t=n(t,a),e=n(e,a),s=this._adjustMinMax(t,e,i,!0);let o=s.step;t=s.min,e=s.max,this.getPrivate("selectionMin")===t&&this.getPrivate("selectionMax")===e&&this.getPrivate("step")===o||(this.setPrivateRaw("selectionMin",t),this.setPrivateRaw("selectionMax",e),this.setPrivateRaw("step",o))}positionToValue(t){const e=this.getPrivate("min"),i=this.getPrivate("max");return this.get("logarithmic")?Math.pow(Math.E,(t*(Math.log(i)*Math.LOG10E-Math.log(e)*Math.LOG10E)+Math.log(e)*Math.LOG10E)/Math.LOG10E):t*(i-e)+e}valueToPosition(t){const e=this.getPrivate("min"),i=this.getPrivate("max");if(this.get("logarithmic")){if(t<=0){let e=this.get("treatZeroAs");s(e)&&(t=e)}return(Math.log(t)*Math.LOG10E-Math.log(e)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(e)*Math.LOG10E)}return(t-e)/(i-e)}valueToFinalPosition(t){const e=this.getPrivate("minFinal"),i=this.getPrivate("maxFinal");if(this.get("logarithmic")){if(t<=0){let e=this.get("treatZeroAs");s(e)&&(t=e)}return(Math.log(t)*Math.LOG10E-Math.log(e)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(e)*Math.LOG10E)}return(t-e)/(i-e)}getX(t,e,i){t=i+(t-i)*e;const s=this.valueToPosition(t);return this._settings.renderer.positionToCoordinate(s)}getY(t,e,i){t=i+(t-i)*e;const s=this.valueToPosition(t);return this._settings.renderer.positionToCoordinate(s)}getDataItemCoordinateX(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(t,e,i,s))}getDataItemPositionX(t,e,i,s){let a=t.get(e);if(t.get("stackToItemX")){a=a*s+t.component.getStackedXValueWorking(t,e)}else a=this._baseValue+(a-this._baseValue)*s;return this.valueToPosition(a)}getDataItemCoordinateY(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(t,e,i,s))}getDataItemPositionY(t,e,i,s){let a=t.get(e);if(t.get("stackToItemY")){a=a*s+t.component.getStackedYValueWorking(t,e)}else a=this._baseValue+(a-this._baseValue)*s;return this.valueToPosition(a)}basePosition(){return this.valueToPosition(this.baseValue())}baseValue(){const t=Math.min(this.getPrivate("minFinal",-1/0),this.getPrivate("selectionMin",-1/0)),e=Math.max(this.getPrivate("maxFinal",1/0),this.getPrivate("selectionMax",1/0));let i=this.get("baseValue",0);return i<t&&(i=t),i>e&&(i=e),i}cellEndValue(t){return t}fixSmallStep(t){return 1+t===1?(t*=2,this.fixSmallStep(t)):t}_fixMin(t){return t}_fixMax(t){return t}_calculateTotals(){if(this.get("calculateTotals")){let t=this.series[0];if(t){let e=t.startIndex();if(t.dataItems.length>0){e>0&&e--;let i,s,a=t.endIndex();a<t.dataItems.length&&a++,t.get("yAxis")==this?(i="valueY",s="vcy"):t.get("xAxis")==this&&(i="valueX",s="vcx");let o=i+"Working";if(i)for(let t=e;t<a;t++){let e=0,a=0;x(this.series,(i=>{if(!i.get("excludeFromTotal")){let n=i.dataItems[t];if(n){let t=n.get(o)*i.get(s);C(t)||(e+=t,a+=Math.abs(t))}}})),x(this.series,(n=>{if(!n.get("excludeFromTotal")){let r=n.dataItems[t];if(r){let t=r.get(o)*n.get(s);C(t)||(r.set(i+"Total",a),r.set(i+"Sum",e),r.set(i+"TotalPercent",t/a*100))}}}))}}}}}_getSelectionMinMax(){const t=this.getPrivate("minFinal"),e=this.getPrivate("maxFinal"),i=this.get("min"),a=this.get("max");let o=this.get("extraMin",0),r=this.get("extraMax",0);this.get("logarithmic")&&(null==this.get("extraMin")&&(o=.1),null==this.get("extraMax")&&(r=.2));const l=this.get("renderer").gridCount(),h=this.get("strictMinMaxSelection"),d=this.get("strictMinMax");if(s(t)&&s(e)){let c=e,u=t;if(x(this.series,(t=>{if(!t.get("ignoreMinMax")){let e,i;const a=t.getPrivate("outOfSelection");t.get("xAxis")===this?a||(e=t.getPrivate("selectionMinX",t.getPrivate("minX")),i=t.getPrivate("selectionMaxX",t.getPrivate("maxX"))):t.get("yAxis")===this&&(a||(e=t.getPrivate("selectionMinY",t.getPrivate("minY")),i=t.getPrivate("selectionMaxY",t.getPrivate("maxY")))),t.isHidden()||t.isShowing()||(s(e)&&(c=Math.min(c,e)),s(i)&&(u=Math.max(u,i)))}})),this.axisRanges.each((t=>{if(t.get("affectsMinMax")){let e=t.get("value");null!=e&&(c=Math.min(c,e),u=Math.max(u,e)),e=t.get("endValue"),null!=e&&(c=Math.min(c,e),u=Math.max(u,e))}})),c>u&&([c,u]=[u,c]),s(i)?c=d?i:t:d&&s(this._minReal)&&(c=this._minReal),s(a)?u=d?a:e:d&&s(this._maxReal)&&(u=this._maxReal),c===u){c-=this._deltaMinMax,u+=this._deltaMinMax;let t=this._adjustMinMax(c,u,l,d);c=t.min,u=t.max}let g=c,p=u;c-=(u-c)*o,u+=(u-c)*r;let m=this._adjustMinMax(c,u,l);c=m.min,u=m.max,c=X(c,t,e),u=X(u,t,e),m=this._adjustMinMax(c,u,l,!0),d||(c=m.min,u=m.max);const _=this.get("syncWithAxis");_&&(m=this._syncAxes(c,u,m.step,_.getPrivate("selectionMinFinal",_.getPrivate("minFinal",0)),_.getPrivate("selectionMaxFinal",_.getPrivate("maxFinal",1)),_.getPrivate("selectionStepFinal",_.getPrivate("step",1))),c=m.min,u=m.max),d&&(s(i)&&(c=Math.max(c,i)),s(a)&&(u=Math.min(u,a))),h&&(c=g-(u-c)*o,u=p+(u-c)*r),this.get("logarithmic")&&(c<=0&&(c=g*(1-Math.min(o,.99))),c<t&&(c=t),u>e&&(u=e));let b=Math.min(20,Math.ceil(Math.log(this.getPrivate("maxZoomFactor",100)+1)/Math.LN10)+2),f=n(this.valueToFinalPosition(c),b),y=n(this.valueToFinalPosition(u),b);this.setPrivateRaw("selectionMinFinal",c),this.setPrivateRaw("selectionMaxFinal",u),this.setPrivateRaw("selectionStepFinal",m.step),this.zoom(f,y)}}_getMinMax(){let t=this.get("min"),e=this.get("max"),i=1/0,a=-1/0,o=this.get("extraMin",0),r=this.get("extraMax",0);this.get("logarithmic")&&(null==this.get("extraMin")&&(o=.1),null==this.get("extraMax")&&(r=.2));let l=1/0;if(x(this.series,(t=>{if(!t.get("ignoreMinMax")){let e,o;if(t.get("xAxis")===this?(e=t.getPrivate("minX"),o=t.getPrivate("maxX")):t.get("yAxis")===this&&(e=t.getPrivate("minY"),o=t.getPrivate("maxY")),s(e)&&s(o)){i=Math.min(i,e),a=Math.max(a,o);let t=o-e;t<=0&&(t=Math.abs(o/100)),t<l&&(l=t)}}})),this.axisRanges.each((t=>{if(t.get("affectsMinMax")){let e=t.get("value");null!=e&&(i=Math.min(i,e),a=Math.max(a,e)),e=t.get("endValue"),null!=e&&(i=Math.min(i,e),a=Math.max(a,e))}})),this.get("logarithmic")){let t=this.get("treatZeroAs");s(t)&&i<=0&&(i=t)}if(0===i&&0===a&&(a=.9,i=-.9),s(t)&&(i=t),s(e)&&(a=e),i===1/0||a===-1/0)return this.setPrivate("minFinal",void 0),void this.setPrivate("maxFinal",void 0);const h=i,d=a;let c=this.adapters.fold("min",i),u=this.adapters.fold("max",a);s(c)&&(i=c),s(u)&&(a=u),i=this._fixMin(i),a=this._fixMax(a),a-i<=1/Math.pow(10,15)&&(a-i!=0?this._deltaMinMax=(a-i)/2:this._getDelta(a),i-=this._deltaMinMax,a+=this._deltaMinMax),i-=(a-i)*o,a+=(a-i)*r,this.get("logarithmic")&&(i<0&&h>=0&&(i=0),a>0&&d<=0&&(a=0)),this._minReal=i,this._maxReal=a;let g=this.get("strictMinMax"),p=this.get("strictMinMaxSelection",!1);p&&(g=p);let m=g;s(e)&&(m=!0);let _=this.get("renderer").gridCount(),b=this._adjustMinMax(i,a,_,m);i=b.min,a=b.max,b=this._adjustMinMax(i,a,_,!0),i=b.min,a=b.max,g&&(i=s(t)?t:this._minReal,a=s(e)?e:this._maxReal,a-i<=1e-8&&(i-=this._deltaMinMax,a+=this._deltaMinMax),i-=(a-i)*o,a+=(a-i)*r),c=this.adapters.fold("min",i),u=this.adapters.fold("max",a),s(c)&&(i=c),s(u)&&(a=u),l==1/0&&(l=a-i);let f=Math.round(Math.abs(Math.log(Math.abs(a-i))*Math.LOG10E))+5;i=n(i,f),a=n(a,f);const y=this.get("syncWithAxis");if(y&&(b=this._syncAxes(i,a,b.step,y.getPrivate("minFinal",y.getPrivate("min",0)),y.getPrivate("maxFinal",y.getPrivate("max",1)),y.getPrivate("step",1)),i=b.min,a=b.max),this.setPrivateRaw("maxZoomFactor",Math.max(1,Math.ceil((a-i)/l*this.get("maxZoomFactor",100)))),this._fixZoomFactor(),this.get("logarithmic")&&(this._minLogAdjusted=i,i=this._minReal,a=this._maxReal,i<=0&&(i=h*(1-Math.min(o,.99)))),s(i)&&s(a)&&(this.getPrivate("minFinal")!==i||this.getPrivate("maxFinal")!==a)){this.setPrivate("minFinal",i),this.setPrivate("maxFinal",a),this._saveMinMax(i,a);const t=this.get("interpolationDuration",0),e=this.get("interpolationEasing");this.animatePrivate({key:"min",to:i,duration:t,easing:e}),this.animatePrivate({key:"max",to:a,duration:t,easing:e})}}_fixZoomFactor(){}_getDelta(t){let e=Math.log(Math.abs(t))*Math.LOG10E,i=Math.pow(10,Math.floor(e));i/=10,this._deltaMinMax=i}_saveMinMax(t,e){}_adjustMinMax(t,e,i,a){i<=1&&(i=1),i=Math.round(i);let o=t,r=e,l=e-t;0===l&&(l=Math.abs(e));let h=Math.log(Math.abs(l))*Math.LOG10E,d=Math.pow(10,Math.floor(h));d/=10;let c=d;a&&(c=0),a?(t=Math.floor(t/d)*d,e=Math.ceil(e/d)*d):(t=Math.ceil(t/d)*d-c,e=Math.floor(e/d)*d+c),t<0&&o>=0&&(t=0),e>0&&r<=0&&(e=0),h=Math.log(Math.abs(l))*Math.LOG10E,d=Math.pow(10,Math.floor(h)),d/=100;let u=Math.ceil(l/i/d)*d,g=Math.pow(10,Math.floor(Math.log(Math.abs(u))*Math.LOG10E)),p=Math.ceil(u/g);p>5?p=10:p<=5&&p>2&&(p=5),u=Math.ceil(u/(g*p))*g*p;let m=this.get("maxPrecision");if(s(m)){let t=F(u,m);m<Number.MAX_VALUE&&u!==t&&(u=t)}let _=0;g<1&&(_=Math.round(Math.abs(Math.log(Math.abs(g))*Math.LOG10E))+1,u=n(u,_));let x,b=Math.floor(t/u);return t=n(u*b,_),x=a?Math.floor(e/u):Math.ceil(e/u),x===b&&x++,(e=n(u*x,_))<r&&(e+=u),t>o&&(t-=u),u=this.fixSmallStep(u),{min:t,max:e,step:u}}getTooltipText(t,e){const i=this.get("tooltipNumberFormat",this.get("numberFormat")),s=this.getNumberFormatter(),a=this.get("extraTooltipPrecision",0),o=this.getPrivate("stepDecimalPlaces",0)+a,r=n(this.positionToValue(t),o);return i?s.format(r,i):s.format(r,void 0,o)}getSeriesItem(t,e){let i,s,a=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),o=this.positionToValue(e);if(x(t.dataItems,((t,e)=>{const n=Math.abs(t.get(a)-o);(void 0===i||n<s)&&(i=e,s=n)})),null!=i)return t.dataItems[i]}zoomToValues(t,e,i){const s=this.getPrivate("minFinal",0),a=this.getPrivate("maxFinal",0);null!=this.getPrivate("min")&&null!=this.getPrivate("max")&&this.zoom((t-s)/(a-s),(e-s)/(a-s),i)}_syncAxes(t,e,i,a,o,n){if(this.get("syncWithAxis")){let r=Math.round(o-a)/n,l=Math.round((e-t)/i),h=this.get("renderer").gridCount();if(s(r)&&s(l)){let s=!1,a=0,o=.01*(e-t),n=t,l=e,d=i;for(;1!=s;)if(s=this._checkSync(n,l,d,r),a++,a>500&&(s=!0),s)t=n,e=l,i=d;else{a/3==Math.round(a/3)?(n=t-o*a,t>=0&&n<0&&(n=0)):(l=e+o*a,l<=0&&l>0&&(l=0));let i=this._adjustMinMax(n,l,h,!0);n=i.min,l=i.max,d=i.step}}}return{min:t,max:e,step:i}}_checkSync(t,e,i,s){let a=(e-t)/i;for(let o=1;o<s;o++)if(n(a/o,1)==s||a*o==s)return!0;return!1}getCellWidthPosition(){let t=this.getPrivate("selectionMax",this.getPrivate("max")),e=this.getPrivate("selectionMin",this.getPrivate("min"));return s(t)&&s(e)?this.getPrivate("step",1)/(t-e):.05}}Object.defineProperty(xt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ValueAxis"}),Object.defineProperty(xt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:mt.classNames.concat([xt.className])});class bt extends L{constructor(){super(...arguments),Object.defineProperty(this,"_tickPoints",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}Object.defineProperty(bt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisLabel"}),Object.defineProperty(bt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:L.classNames.concat([bt.className])});class ft extends K{constructor(){super(...arguments),Object.defineProperty(this,"_tickPoints",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}Object.defineProperty(ft,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisTick"}),Object.defineProperty(ft,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([ft.className])});class yt extends d{constructor(){super(...arguments),Object.defineProperty(this,"_axisLength",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(this,"_start",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_end",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_inversed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_minSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_lc",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_ls",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_thumbDownPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downStart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEnd",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ticks",{enumerable:!0,configurable:!0,writable:!0,value:new R(j.new({}),(()=>ft._new(this._root,{themeTags:v(this.ticks.template.get("themeTags",[]),this.get("themeTags",[]))},[this.ticks.template])))}),Object.defineProperty(this,"grid",{enumerable:!0,configurable:!0,writable:!0,value:new R(j.new({}),(()=>ht._new(this._root,{themeTags:v(this.grid.template.get("themeTags",[]),this.get("themeTags",[]))},[this.grid.template])))}),Object.defineProperty(this,"axisFills",{enumerable:!0,configurable:!0,writable:!0,value:new R(j.new({}),(()=>d._new(this._root,{themeTags:v(this.axisFills.template.get("themeTags",["axis","fill"]),this.get("themeTags",[]))},[this.axisFills.template])))}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:new R(j.new({}),(()=>bt._new(this._root,{themeTags:v(this.labels.template.get("themeTags",[]),this.get("themeTags",[]))},[this.labels.template])))}),Object.defineProperty(this,"axis",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}makeTick(t,e){const i=this.ticks.make();return i._setDataItem(t),t.setRaw("tick",i),i.set("themeTags",v(i.get("themeTags"),e)),this.axis.labelsContainer.children.push(i),this.ticks.push(i),i}makeGrid(t,e){const i=this.grid.make();return i._setDataItem(t),t.setRaw("grid",i),i.set("themeTags",v(i.get("themeTags"),e)),this.axis.gridContainer.children.push(i),this.grid.push(i),i}makeAxisFill(t,e){const i=this.axisFills.make();return i._setDataItem(t),i.set("themeTags",v(i.get("themeTags"),e)),this.axis.gridContainer.children.push(i),t.setRaw("axisFill",i),this.axisFills.push(i),i}makeLabel(t,e){const i=this.labels.make();return i.set("themeTags",v(i.get("themeTags"),e)),this.axis.labelsContainer.children.moveValue(i,0),i._setDataItem(t),t.setRaw("label",i),this.labels.push(i),i}axisLength(){return 0}gridCount(){return this.axisLength()/this.get("minGridDistance",50)}_updatePositions(){}_afterNew(){super._afterNew(),this.set("isMeasured",!1);const t=this.thumb;t&&(this._disposers.push(t.events.on("pointerdown",(t=>{this._handleThumbDown(t.originalEvent)}))),this._disposers.push(t.events.on("globalpointerup",(t=>{this._handleThumbUp(t.originalEvent)}))),this._disposers.push(t.events.on("globalpointermove",(t=>{this._handleThumbMove(t.originalEvent)}))))}_changed(){if(super._changed(),this.isDirty("pan")){const t=this.thumb;if(t){const e=this.axis.labelsContainer,i=this.get("pan");"zoom"==i?e.children.push(t):"none"==i&&e.children.removeValue(t)}}}_handleThumbDown(t){this._thumbDownPoint=this.toLocal(this._root.documentPointToRoot({x:t.clientX,y:t.clientY}));const e=this.axis;this._downStart=e.get("start"),this._downEnd=e.get("end")}_handleThumbUp(t){this._thumbDownPoint=void 0}_handleThumbMove(t){const e=this._thumbDownPoint;if(e){const i=this.toLocal(this._root.documentPointToRoot({x:t.clientX,y:t.clientY})),s=this._downStart,a=this._downEnd,o=this._getPan(i,e)*Math.min(1,a-s)/2;this.axis.setAll({start:s-o,end:a+o})}}_getPan(t,e){return 0}positionToCoordinate(t){return this._inversed?(this._end-t)*this._axisLength:(t-this._start)*this._axisLength}updateTooltipBounds(t){}_updateSize(){this.markDirty(),this._clear=!0}toAxisPosition(t){const e=this._start||0,i=this._end||1;return t*=i-e,t=this.get("inversed")?i-t:e+t}fixPosition(t){return this.get("inversed")?1-t:t}_updateLC(){}toggleVisibility(t,e,i,s){let a=this.axis;const o=a.get("start",0),n=a.get("end",1);e<o+(n-o)*(i-1e-4)||e>o+(n-o)*(s+1e-4)?t.setPrivate("visible",!1):t.setPrivate("visible",!0)}_positionTooltip(t,e){const i=this.chart;i&&(i.inPlot(e)?t.set("pointTo",this._display.toGlobal(e)):t.hide())}processAxis(){}}Object.defineProperty(yt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRenderer"}),Object.defineProperty(yt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:d.classNames.concat([yt.className])});class vt extends yt{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:c.new(this._root,{width:e,isMeasured:!1,themeTags:["axis","x","thumb"]})})}_afterNew(){this._settings.themeTags=v(this._settings.themeTags,["renderer","x"]),super._afterNew(),this.setPrivateRaw("letter","X");const t=this.grid.template;t.set("height",e),t.set("width",0),t.set("draw",((t,e)=>{t.moveTo(0,0),t.lineTo(0,e.height())})),this.set("draw",((t,e)=>{t.moveTo(0,0),t.lineTo(e.width(),0)}))}_changed(){super._changed();const t=this.axis;t.ghostLabel.setPrivate("visible",!this.get("inside")),t.ghostLabel.set("x",-1e3);const e="opposite",i="inside";if(this.isDirty(e)||this.isDirty(i)){const s=this.chart,a=t.children;if(this.get(i)?t.addTag(i):t.removeTag(i),s){if(this.get(e)){const i=s.topAxesContainer.children;-1==i.indexOf(t)&&i.insertIndex(0,t),t.addTag(e),a.moveValue(this)}else{const i=s.bottomAxesContainer.children;-1==i.indexOf(t)&&i.moveValue(t),t.removeTag(e),a.moveValue(this,0)}t.ghostLabel._applyThemes(),this.labels.each((t=>{t._applyThemes()})),this.root._markDirtyRedraw()}t.markDirtySize()}this.thumb.setPrivate("height",t.labelsContainer.height())}_getPan(t,e){return(e.x-t.x)/this.width()}toAxisPosition(t){const e=this._start||0,i=this._end||1;return t=(t-=this._ls)*(i-e)/this._lc,t=this.get("inversed")?i-t:e+t}_updateLC(){const t=this.axis,e=t.parent;if(e){const i=e.innerWidth();this._lc=this.axisLength()/i,this._ls=(t.x()-e.get("paddingLeft",0))/i}}_updatePositions(){const t=this.axis,e=t.x()-M(t.get("centerX",0),t.width())-t.parent.get("paddingLeft",0);t.gridContainer.set("x",e),t.topGridContainer.set("x",e),t.bulletsContainer.set("y",this.y());const i=t.chart;if(i){const e=i.plotContainer,s=t.axisHeader;let a=t.get("marginLeft",0),o=t.x()-a;const n=t.parent;n&&(o-=n.get("paddingLeft",0)),s.children.length>0?(a=t.axisHeader.width(),t.set("marginLeft",a+1)):s.set("width",a),s.setAll({x:o,y:-1,height:e.height()+2})}}processAxis(){super.processAxis();const t=this.axis;t.set("width",e);const i=this._root.verticalLayout;t.set("layout",i),t.labelsContainer.set("width",e),t.axisHeader.setAll({layout:i})}axisLength(){return this.axis.width()}positionToPoint(t){return{x:this.positionToCoordinate(t),y:0}}updateTick(t,i,a,o){if(t){s(i)||(i=0);let n=.5;n=s(o)&&o>1?t.get("multiLocation",n):t.get("location",n),s(a)&&a!=i&&(i+=(a-i)*n),t.set("x",this.positionToCoordinate(i));let r=t.get("length",0);const l=t.get("inside",this.get("inside",!1));this.get("opposite")?(t.set("y",e),l||(r*=-1)):(t.set("y",0),l&&(r*=-1)),t.set("draw",(t=>{t.moveTo(0,0),t.lineTo(0,r)})),this.toggleVisibility(t,i,t.get("minPosition",0),t.get("maxPosition",1))}}updateLabel(t,i,a,o){if(t){let n=.5;n=s(o)&&o>1?t.get("multiLocation",n):t.get("location",n),s(i)||(i=0);const r=t.get("inside",this.get("inside",!1));this.get("opposite")?r?(t.set("position","absolute"),t.set("y",0)):(t.set("position","relative"),t.set("y",e)):r?(t.set("y",0),t.set("position","absolute")):(t.set("y",void 0),t.set("position","relative")),s(a)&&a!=i&&(i+=(a-i)*n),t.set("x",this.positionToCoordinate(i)),this.toggleVisibility(t,i,t.get("minPosition",0),t.get("maxPosition",1))}}updateGrid(t,e,i){if(t){s(e)||(e=0);let a=t.get("location",.5);s(i)&&i!=e&&(e+=(i-e)*a),t.set("x",this.positionToCoordinate(e)),this.toggleVisibility(t,e,0,1)}}updateBullet(t,e,i){if(t){const a=t.get("sprite");if(a){s(e)||(e=0);let o=t.get("location",.5);s(i)&&i!=e&&(e+=(i-e)*o);let n=this.axis.roundAxisPosition(e,o),r=this.axis._bullets[n],l=-1;if(this.get("opposite")&&(l=1),t.get("stacked"))if(r){let t=r.get("sprite");t&&a.set("y",t.y()+t.height()*l)}else a.set("y",0);this.axis._bullets[n]=t,a.set("x",this.positionToCoordinate(e)),this.toggleVisibility(a,e,0,1)}}}updateFill(t,e,i){if(t){s(e)||(e=0),s(i)||(i=1);let a=this.positionToCoordinate(e),o=this.positionToCoordinate(i);this.fillDrawMethod(t,a,o)}}fillDrawMethod(t,e,i){t.set("draw",(t=>{const s=this.axis.gridContainer.height(),a=this.width();i<e&&([i,e]=[e,i]),e>a||i<0||(t.moveTo(e,0),t.lineTo(i,0),t.lineTo(i,s),t.lineTo(e,s),t.lineTo(e,0))}))}positionTooltip(t,e){this._positionTooltip(t,{x:this.positionToCoordinate(e),y:0})}updateTooltipBounds(t){const e=this.get("inside"),i=1e5;let s=this._display.toGlobal({x:0,y:0}),a=s.x,o=0,n=this.axisLength(),r=i,l="up";this.get("opposite")?e?(l="up",o=s.y,r=i):(l="down",o=s.y-i,r=i):e?(l="down",o=s.y-i,r=i):(l="up",o=s.y,r=i);const h={left:a,right:a+n,top:o,bottom:o+r},d=t.get("bounds");V(h,d)||(t.set("bounds",h),t.set("pointerOrientation",l))}}Object.defineProperty(vt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRendererX"}),Object.defineProperty(vt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:yt.classNames.concat([vt.className])});class Pt extends yt{constructor(){super(...arguments),Object.defineProperty(this,"_downY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:c.new(this._root,{height:e,isMeasured:!1,themeTags:["axis","y","thumb"]})})}_afterNew(){this._settings.themeTags=v(this._settings.themeTags,["renderer","y"]),this._settings.opposite&&this._settings.themeTags.push("opposite"),super._afterNew(),this.setPrivateRaw("letter","Y");const t=this.grid.template;t.set("width",e),t.set("height",0),t.set("draw",((t,e)=>{t.moveTo(0,0),t.lineTo(e.width(),0)})),this.set("draw",((t,e)=>{t.moveTo(0,0),t.lineTo(0,e.height())}))}_getPan(t,e){return(t.y-e.y)/this.height()}_changed(){super._changed();const t=this.axis;t.ghostLabel.setPrivate("visible",!this.get("inside")),t.ghostLabel.set("y",-1e3);const e=this.thumb,i="opposite",s="inside",a=this.chart;if(this.isDirty(i)||this.isDirty(s)){const e=t.children;if(this.get(s)?t.addTag(s):t.removeTag(s),a){if(this.get(i)){const s=a.rightAxesContainer.children;-1==s.indexOf(t)&&s.moveValue(t,0),t.addTag(i),e.moveValue(this,0)}else{const s=a.leftAxesContainer.children;-1==s.indexOf(t)&&s.moveValue(t),t.removeTag(i),e.moveValue(this)}t.ghostLabel._applyThemes(),this.labels.each((t=>{t._applyThemes()})),this.root._markDirtyRedraw()}t.markDirtySize()}const o=t.labelsContainer.width();a&&(this.get(i)?e.set("centerX",0):e.set("centerX",o)),e.setPrivate("width",o)}processAxis(){super.processAxis();const t=this.axis;null==t.get("height")&&t.set("height",e);const i=this._root.horizontalLayout;t.set("layout",i),t.labelsContainer.set("height",e),t.axisHeader.set("layout",i)}_updatePositions(){const t=this.axis,e=t.y()-M(t.get("centerY",0),t.height());t.gridContainer.set("y",e),t.topGridContainer.set("y",e),t.bulletsContainer.set("x",this.x());const i=t.chart;if(i){const e=i.plotContainer,s=t.axisHeader;let a=t.get("marginTop",0);s.children.length>0?(a=t.axisHeader.height(),t.set("marginTop",a+1)):s.set("height",a),s.setAll({y:t.y()-a,x:-1,width:e.width()+2})}}axisLength(){return this.axis.innerHeight()}positionToPoint(t){return{x:0,y:this.positionToCoordinate(t)}}updateLabel(t,e,i,a){if(t){s(e)||(e=0);let o=.5;o=s(a)&&a>1?t.get("multiLocation",o):t.get("location",o);const n=this.get("opposite"),r=t.get("inside",this.get("inside",!1));n?(t.set("x",0),r?t.set("position","absolute"):t.set("position","relative")):r?(t.set("x",0),t.set("position","absolute")):(t.set("x",void 0),t.set("position","relative")),s(i)&&i!=e&&(e+=(i-e)*o),t.set("y",this.positionToCoordinate(e)),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateGrid(t,e,i){if(t){s(e)||(e=0);let a=t.get("location",.5);s(i)&&i!=e&&(e+=(i-e)*a),t.set("y",this.positionToCoordinate(e)),this.toggleVisibility(t,e,0,1)}}updateTick(t,e,i,a){if(t){s(e)||(e=0);let o=.5;o=s(a)&&a>1?t.get("multiLocation",o):t.get("location",o),s(i)&&i!=e&&(e+=(i-e)*o),t.set("y",this.positionToCoordinate(e));let n=t.get("length",0);const r=t.get("inside",this.get("inside",!1));this.get("opposite")?(t.set("x",0),r&&(n*=-1)):r||(n*=-1),t.set("draw",(t=>{t.moveTo(0,0),t.lineTo(n,0)})),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateBullet(t,e,i){if(t){const a=t.get("sprite");if(a){s(e)||(e=0);let o=t.get("location",.5);s(i)&&i!=e&&(e+=(i-e)*o);let n=this.axis.roundAxisPosition(e,o),r=this.axis._bullets[n],l=1;if(this.get("opposite")&&(l=-1),t.get("stacked"))if(r){let t=r.get("sprite");t&&a.set("x",t.x()+t.width()*l)}else a.set("x",0);this.axis._bullets[n]=t,a.set("y",this.positionToCoordinate(e)),this.toggleVisibility(a,e,0,1)}}}updateFill(t,e,i){if(t){s(e)||(e=0),s(i)||(i=1);let a=this.positionToCoordinate(e),o=this.positionToCoordinate(i);this.fillDrawMethod(t,a,o)}}fillDrawMethod(t,e,i){t.set("draw",(t=>{const s=this.axis.gridContainer.width(),a=this.height();i<e&&([i,e]=[e,i]),e>a||i<0||(t.moveTo(0,e),t.lineTo(s,e),t.lineTo(s,i),t.lineTo(0,i),t.lineTo(0,e))}))}positionToCoordinate(t){return this._inversed?(t-this._start)*this._axisLength:(this._end-t)*this._axisLength}positionTooltip(t,e){this._positionTooltip(t,{x:0,y:this.positionToCoordinate(e)})}updateTooltipBounds(t){const e=this.get("inside"),i=1e5;let s=this._display.toGlobal({x:0,y:0}),a=s.y,o=0,n=this.axisLength(),r=i,l="right";this.get("opposite")?e?(l="right",o=s.x-i,r=i):(l="left",o=s.x,r=i):e?(l="left",o=s.x,r=i):(l="right",o=s.x-i,r=i);const h={left:o,right:o+r,top:a,bottom:a+n},d=t.get("bounds");V(h,d)||(t.set("bounds",h),t.set("pointerOrientation",l))}_updateLC(){const t=this.axis,e=t.parent;if(e){const i=e.innerHeight();this._lc=this.axisLength()/i,this._ls=t.y()/i}}toAxisPosition(t){const e=this._start||0,i=this._end||1;return t=(t-=this._ls)*(i-e)/this._lc,t=this.get("inversed")?e+t:i-t}fixPosition(t){return this.get("inversed")?t:1-t}}Object.defineProperty(Pt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRendererY"}),Object.defineProperty(Pt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:yt.classNames.concat([Pt.className])});class wt extends pt{constructor(){super(...arguments),Object.defineProperty(this,"columns",{enumerable:!0,configurable:!0,writable:!0,value:new R(j.new({}),(()=>Q._new(this._root,{position:"absolute",themeTags:v(this.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template])))})}makeColumn(t,e){const i=this.mainContainer.children.push(e.make());return i._setDataItem(t),e.push(i),i}_processAxisRange(t){super._processAxisRange(t),t.columns=new R(j.new({}),(()=>Q._new(this._root,{position:"absolute",themeTags:v(t.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template,t.columns.template])))}}Object.defineProperty(wt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColumnSeries"}),Object.defineProperty(wt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:pt.classNames.concat([wt.className])});class kt extends gt{constructor(){super(...arguments),Object.defineProperty(this,"_endIndex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeGenerator",{enumerable:!0,configurable:!0,writable:!0,value:ot()}),Object.defineProperty(this,"_fillGenerator",{enumerable:!0,configurable:!0,writable:!0,value:nt()}),Object.defineProperty(this,"_legendStroke",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_legendFill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"strokes",{enumerable:!0,configurable:!0,writable:!0,value:new R(j.new({}),(()=>d._new(this._root,{themeTags:v(this.strokes.template.get("themeTags",[]),["line","series","stroke"])},[this.strokes.template])))}),Object.defineProperty(this,"fills",{enumerable:!0,configurable:!0,writable:!0,value:new R(j.new({}),(()=>d._new(this._root,{themeTags:v(this.strokes.template.get("themeTags",[]),["line","series","fill"])},[this.fills.template])))}),Object.defineProperty(this,"_fillTemplate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeTemplate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_previousPoint",{enumerable:!0,configurable:!0,writable:!0,value:[0,0,0,0]}),Object.defineProperty(this,"_dindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_sindex",{enumerable:!0,configurable:!0,writable:!0,value:0})}_afterNew(){this._fillGenerator.y0((function(t){return t[3]})),this._fillGenerator.x0((function(t){return t[2]})),this._fillGenerator.y1((function(t){return t[1]})),this._fillGenerator.x1((function(t){return t[0]})),super._afterNew()}makeStroke(t){const e=this.mainContainer.children.push(t.make());return t.push(e),e}makeFill(t){const e=this.mainContainer.children.push(t.make());return t.push(e),e}_updateChildren(){this._strokeTemplate=void 0,this._fillTemplate=void 0;let t=this.get("xAxis"),e=this.get("yAxis");if(this.isDirty("stroke")){const t=this.get("stroke");this.strokes.template.set("stroke",t);const e=this._legendStroke;e&&e.states.lookup("default").set("stroke",t)}if(this.isDirty("fill")){const t=this.get("fill");this.fills.template.set("fill",t);const e=this._legendFill;e&&e.states.lookup("default").set("fill",t)}if(this.isDirty("curveFactory")){const t=this.get("curveFactory");t&&(this._strokeGenerator.curve(t),this._fillGenerator.curve(t))}if(t.inited&&e.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty||this.isDirty("connect")||this.isDirty("curveFactory")){this.fills.each((t=>{t.setPrivate("visible",!1)})),this.strokes.each((t=>{t.setPrivate("visible",!1)})),this.axisRanges.each((t=>{let e=t.fills;e&&e.each((t=>{t.setPrivate("visible",!1)}));let i=t.strokes;i&&i.each((t=>{t.setPrivate("visible",!1)}))}));let t=this.startIndex(),e=this.strokes.template.get("templateField"),i=this.fills.template.get("templateField"),a=!0,o=!0;e&&(a=!1),i&&(o=!1);for(let l=t-1;l>=0;l--){let n=this.dataItems[l],r=!0,h=n.dataContext;if(e&&h[e]&&(a=!0),i&&h[i]&&(o=!0),x(this._valueFields,(t=>{s(n.get(t))||(r=!1)})),r&&a&&o){t=l;break}}let n=this.dataItems.length,r=this.endIndex();if(r<n){r++;for(let t=r;t<n;t++){let e=this.dataItems[t],i=!0;if(x(this._valueFields,(t=>{s(e.get(t))||(i=!1)})),i){r=t+1;break}}}if(t>0&&t--,this._endIndex=r,this._clearGraphics(),this._sindex=0,this._dindex=t,1==this.dataItems.length)this._startSegment(0);else for(;this._dindex<r-1;)this._startSegment(this._dindex),this._sindex++}}else this._skipped=!0;super._updateChildren()}_clearGraphics(){this.strokes.clear(),this.fills.clear()}_startSegment(t){let e=this._endIndex,i=e;const s=this.get("autoGapCount"),a=this.get("connect"),o=this.makeFill(this.fills),n=this._fillTemplate,r=this.fills.template;n&&n!=r&&(o.template=n),o.setPrivate("visible",!0);const l=this.makeStroke(this.strokes),h=this._strokeTemplate;h&&h!=this.strokes.template&&(l.template=h),l.setPrivate("visible",!0);let d=this.get("xAxis"),c=this.get("yAxis"),u=this.get("baseAxis"),g=this.get("vcx",1),p=this.get("vcy",1),m=this._xField,_=this._yField,x=this._xOpenField,b=this._yOpenField;const f=this.get("openValueXField"),y=this.get("openValueYField");f||(x=this._xField),y||(b=this._yField);const v=this.get("stacked"),P=d.basePosition(),w=c.basePosition();let k;k=u===c?this._yField:this._xField;const T=[];let A=[];T.push(A);const D=this.strokes.template.get("templateField"),M=this.fills.template.get("templateField");let C=this.get("locationX",.5),I=this.get("locationY",.5),X=this.get("openLocationX",C),Y=this.get("openLocationY",I);const O=this.get("minDistance",0);let S,F=this.fills.template.get("visible");this.axisRanges.length>0&&(F=!0);let L=!1;(v||f||y)&&(L=!0);const R={points:A,segments:T,stacked:v,getOpen:L,basePosX:P,basePosY:w,fillVisible:F,xField:m,yField:_,xOpenField:x,yOpenField:b,vcx:g,vcy:p,baseAxis:u,xAxis:d,yAxis:c,locationX:C,locationY:I,openLocationX:X,openLocationY:Y,minDistance:O};for(S=t;S<i;S++){this._dindex=S;const e=this._dataItems[S];let n=e.get(m),r=e.get(_);if(null==n||null==r?a||(A=[],T.push(A),R.points=A):this._getPoints(e,R),D){let s=e.dataContext[D];if(s){if(s instanceof j||(s=j.new(s)),this._strokeTemplate=s,S>t){i=S;break}l.template=s}}if(M){let s=e.dataContext[M];if(s){if(s instanceof j||(s=j.new(s)),this._fillTemplate=s,S>t){i=S;break}o.template=s}}if(!a){let t=this.dataItems[S+1];t&&u.shouldGap(e,t,s,k)&&(A=[],T.push(A),R.points=A)}}o.setRaw("userData",[t,S]),l.setRaw("userData",[t,S]),S===e&&this._endLine(A,T[0][0]),l&&this._drawStroke(l,T),o&&this._drawFill(o,T),this.axisRanges.each((e=>{const i=e.container,s=e.fills,a=this.makeFill(s);i&&i.children.push(a),a.setPrivate("visible",!0),this._drawFill(a,T);const o=e.strokes,n=this.makeStroke(o);i&&i.children.push(n),n.setPrivate("visible",!0),this._drawStroke(n,T),a.setRaw("userData",[t,S]),n.setRaw("userData",[t,S])}))}_getPoints(t,e){let i=e.points,s=t.get("locationX",e.locationX),a=t.get("locationY",e.locationY),o=e.xAxis.getDataItemPositionX(t,e.xField,s,e.vcx),n=e.yAxis.getDataItemPositionY(t,e.yField,a,e.vcy);if(this._shouldInclude(o)){const s=this.getPoint(o,n),a=[s.x,s.y];if(s.x+=this._x,s.y+=this._y,t.set("point",s),e.fillVisible){let i=o,s=n;if(e.baseAxis===e.xAxis?s=e.basePosY:e.baseAxis===e.yAxis&&(i=e.basePosX),e.getOpen){let a=t.get(e.xOpenField),o=t.get(e.yOpenField);if(null!=a&&null!=o){let a=t.get("openLocationX",e.openLocationX),o=t.get("openLocationY",e.openLocationY);if(e.stacked){let n=t.get("stackToItemX"),r=t.get("stackToItemY");n?(i=e.xAxis.getDataItemPositionX(n,e.xField,a,n.component.get("vcx")),C(i)&&(i=e.basePosX)):i=e.yAxis===e.baseAxis?e.basePosX:e.xAxis.getDataItemPositionX(t,e.xOpenField,a,e.vcx),r?(s=e.yAxis.getDataItemPositionY(r,e.yField,o,r.component.get("vcy")),C(s)&&(s=e.basePosY)):s=e.xAxis===e.baseAxis?e.basePosY:e.yAxis.getDataItemPositionY(t,e.yOpenField,o,e.vcy)}else i=e.xAxis.getDataItemPositionX(t,e.xOpenField,a,e.vcx),s=e.yAxis.getDataItemPositionY(t,e.yOpenField,o,e.vcy)}}let r=this.getPoint(i,s);a[2]=r.x,a[3]=r.y}if(e.minDistance>0){const t=a[0],s=a[1],o=a[2],n=a[3],r=this._previousPoint,l=r[0],h=r[1],d=r[2],c=r[3];(Math.hypot(t-l,s-h)>e.minDistance||o&&n&&Math.hypot(o-d,n-c)>e.minDistance)&&(i.push(a),this._previousPoint=a)}else i.push(a)}}_endLine(t,e){}_drawStroke(t,e){t.get("visible")&&!t.get("forceHidden")&&t.set("draw",(t=>{x(e,(e=>{this._strokeGenerator.context(t),this._strokeGenerator(e)}))}))}_drawFill(t,e){t.get("visible")&&!t.get("forceHidden")&&t.set("draw",(t=>{x(e,(e=>{this._fillGenerator.context(t),this._fillGenerator(e)}))}))}_processAxisRange(t){super._processAxisRange(t),t.fills=new R(j.new({}),(()=>d._new(this._root,{themeTags:v(t.fills.template.get("themeTags",[]),["line","series","fill"])},[this.fills.template,t.fills.template]))),t.strokes=new R(j.new({}),(()=>d._new(this._root,{themeTags:v(t.strokes.template.get("themeTags",[]),["line","series","stroke"])},[this.strokes.template,t.strokes.template])))}createLegendMarker(t){const e=this.get("legendDataItem");if(e){const t=e.get("marker"),i=e.get("markerRectangle");i&&i.setPrivate("visible",!1),t.set("background",c.new(t._root,{fillOpacity:0,fill:G(0)}));const s=t.children.push(d._new(t._root,{themeTags:["line","series","legend","marker","stroke"],interactive:!1},[this.strokes.template]));this._legendStroke=s;const a=t.children.push(d._new(t._root,{themeTags:["line","series","legend","marker","fill"]},[this.fills.template]));this._legendFill=a;const o=this._root.interfaceColors.get("disabled");if(s.states.create("disabled",{fill:o,stroke:o}),a.states.create("disabled",{fill:o,stroke:o}),this.bullets.length>0){const e=this.bullets.getIndex(0);if(e){const i=e(t._root,this,new Z(this,{legend:!0},{}));if(i){const e=i.get("sprite");e instanceof d&&e.states.create("disabled",{fill:o,stroke:o}),e&&(e.set("tooltipText",void 0),e.set("tooltipHTML",void 0),t.children.push(e),e.setAll({x:t.width()/2,y:t.height()/2}))}}}}}}Object.defineProperty(kt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"LineSeries"}),Object.defineProperty(kt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:gt.classNames.concat([kt.className])});export{vt as AxisRendererXAm5,Pt as AxisRendererYAm5,_t as CategoryAxisAm5,wt as ColumnSeriesAm5,kt as LineSeriesAm5,xt as ValueAxisAm5,lt as XYChartAm5,dt as XYCursorAm5};
5
+ import{c as t,d as e}from"../../../chunks/LineSeries.js";export{A as AxisRendererXAm5,a as AxisRendererYAm5,L as LineSeriesAm5,V as ValueAxisAm5,X as XYChartAm5,b as XYCursorAm5}from"../../../chunks/LineSeries.js";import{e as i,Q as s,aA as o,g as n,aM as r,ak as h,aj as l,af as g,aD as d,aE as c}from"../../../chunks/Theme.js";import{a as m}from"../../../chunks/tslib.es6.js";import{R as p}from"../../../chunks/Button.js";class u extends t{constructor(){super(...arguments),Object.defineProperty(this,"_ph",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_pw",{enumerable:!0,configurable:!0,writable:!0,value:0})}_makeGraphics(t,e){return this.makeColumn(e,t)}_makeFieldNames(){super._makeFieldNames();const t=this.get("xAxis"),e=this.get("yAxis"),i="CategoryAxis",s="ValueAxis";t.isType(i)&&(this.get("openCategoryXField")||(this._xOpenField=this._xField)),t.isType(s)&&(this.get("openValueXField")||(this._xOpenField=this._xField)),e.isType(i)&&(this.get("openCategoryYField")||(this._yOpenField=this._yField)),e.isType(s)&&(this.get("openValueYField")||(this._yOpenField=this._yField))}_prepareChildren(){super._prepareChildren();const t=this.get("xAxis"),e=this.get("yAxis"),i=this.dataItems.length,s=Math.max(0,this.startIndex()-2),a=Math.min(this.endIndex()+2,i-1);if(t.inited&&e.inited)for(let o=s;o<=a;o++){let t=this.dataItems[o];this._createGraphics(t)}}_updateChildren(){const t=this.chart;t&&(this._ph=t.plotContainer.height(),this._pw=t.plotContainer.width());const e=this.get("xAxis"),s=this.get("yAxis"),a=this.get("baseAxis"),o=this.columns.template;this.isDirty("fill")&&null==o.get("fill")&&o.set("fill",this.get("fill")),this.isDirty("stroke")&&null==o.get("stroke")&&o.set("stroke",this.get("stroke"));let n=0,r=0,h=0;i(a.series,(t=>{if(t instanceof u){const e=t.get("stacked");e&&0==h&&r++,!e&&t.get("clustered")&&r++}t===this&&(n=r-1),h++})),this.get("clustered")||(n=0,r=1),0===r&&(r=1,n=0);const l=e.get("renderer"),g=s.get("renderer"),d="cellStartLocation",c="cellEndLocation",m=l.get(d,0),p=l.get(c,1),x=g.get(d,0),_=g.get(c,1);if(this._aLocationX0=m+n/r*(p-m),this._aLocationX1=m+(n+1)/r*(p-m),this._aLocationY0=x+n/r*(_-x),this._aLocationY1=x+(n+1)/r*(_-x),e.inited&&s.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty){const t=this.dataItems.length;let e=Math.max(0,this.startIndex()-2),i=Math.min(this.endIndex()+2,t-1);for(let a=0;a<e;a++)this._toggleColumn(this.dataItems[a],!1);let s=this.dataItems[e];for(let a=e;a<=i;a++){let t=this.dataItems[a];if(null!=t.get("valueX")&&null!=t.get("valueY")){if(s=t,a>0&&e>0)for(let t=a-1;t>=0;t--){let e=this.dataItems[t];if(null!=e.get("valueX")&&null!=e.get("valueY")){s=e;break}}break}this._toggleColumn(t,!1)}for(let a=e;a<=i;a++){let t=this.dataItems[a];this._updateGraphics(t,s),null!=t.get("valueX")&&null!=t.get("valueY")&&(s=t)}for(let a=i+1;a<t;a++)this._toggleColumn(this.dataItems[a],!1)}}else this._skipped=!0;this.updateLegendMarker(this.get("tooltipDataItem")),super._updateChildren()}_createGraphics(t){let e=t.get("graphics");if(!e){e=this._makeGraphics(this.columns,t),t.set("graphics",e),e._setDataItem(t);const i=t.get("legendDataItem");if(i){const t=i.get("markerRectangle");t&&t.setAll({fill:e.get("fill"),stroke:e.get("stroke")})}this.axisRanges.each((e=>{const i=e.container,s=t.get("rangeGraphics",[]);t.set("rangeGraphics",s);const a=this._makeGraphics(e.columns,t);s.push(a),a.setPrivate("list",e.columns),i.children.push(a)}))}}_updateGraphics(t,e){let a=t.get("graphics");const n=this._xField,r=this._yField,h=t.get(n),l=t.get(r);if(null!=h&&null!=l){const h=this._xOpenField,l=this._yOpenField,g=this.get("locationX",t.get("locationX",.5)),d=this.get("locationY",t.get("locationY",.5)),c=this.get("openLocationX",t.get("openLocationX",g)),m=this.get("openLocationY",t.get("openLocationY",d)),p=a.get("width"),u=a.get("height"),x=this.get("stacked"),_=this.get("xAxis"),I=this.get("yAxis"),f=this.get("baseAxis"),y=_.get("start"),P=_.get("end"),b=I.get("start"),v=I.get("end");let D,T,A,C,w=this.get("vcy",1),k=this.get("vcx",1),F=!1,M=!1;if(I.isType("CategoryAxis")&&_.isType("CategoryAxis")){let e=this._aLocationX0+c-.5,i=this._aLocationX1+g-.5;if(p instanceof s){let t=(i-e)*(1-p.value)/2;e+=t,i-=t}if(D=_.getDataItemPositionX(t,h,e,k),T=_.getDataItemPositionX(t,n,i,k),e=this._aLocationY0+m-.5,i=this._aLocationY1+d-.5,u instanceof s){let t=(i-e)*(1-u.value)/2;e+=t,i-=t}A=I.getDataItemPositionY(t,l,e,w),C=I.getDataItemPositionY(t,r,i,w),t.setRaw("point",{x:D+(T-D)/2,y:A+(C-A)/2})}else if(_===f){let e=this._aLocationX0+c-.5,i=this._aLocationX1+g-.5;if(p instanceof s){let t=(i-e)*(1-p.value)/2;e+=t,i-=t}if(D=_.getDataItemPositionX(t,h,e,k),T=_.getDataItemPositionX(t,n,i,k),A=I.getDataItemPositionY(t,r,d,w),this._yOpenField!==this._yField)C=I.getDataItemPositionY(t,l,m,w);else if(x){let e=t.get("stackToItemY");C=e?I.getDataItemPositionY(e,r,m,e.component.get("vcy")):I.basePosition()}else C=I.basePosition();t.setRaw("point",{x:D+(T-D)/2,y:A}),M=!0}else if(I===f){let e=this._aLocationY0+m-.5,i=this._aLocationY1+d-.5;if(u instanceof s){let t=(i-e)*(1-u.value)/2;e+=t,i-=t}if(A=I.getDataItemPositionY(t,l,e,w),C=I.getDataItemPositionY(t,r,i,w),T=_.getDataItemPositionX(t,n,g,k),this._xOpenField!==this._xField)D=_.getDataItemPositionX(t,h,c,k);else if(x){let e=t.get("stackToItemX");D=e?_.getDataItemPositionX(e,n,c,e.component.get("vcx")):_.basePosition()}else D=_.basePosition();F=!0,t.setRaw("point",{x:T,y:A+(C-A)/2})}this._updateSeriesGraphics(t,a,D,T,A,C,F,M),D<y&&T<y||D>P&&T>P||A<b&&C<=b||A>=v&&C>v||o(D)||o(A)?this._toggleColumn(t,!1):this._toggleColumn(t,!0);let X=t.get("rangeGraphics");X&&i(X,(e=>{this._updateSeriesGraphics(t,e,D,T,A,C,F,M)})),this._applyGraphicsStates(t,e)}}_updateSeriesGraphics(t,e,i,s,a,o,r,h){const l=e.get("width"),g=e.get("height"),d=e.get("maxWidth"),c=e.get("maxHeight"),m=this.getPoint(i,a),p=this.getPoint(s,o),u=t.get("point");if(u){const t=this.getPoint(u.x,u.y);u.x=t.x+this._x,u.y=t.y+this._y}if(i=m.x,s=p.x,a=m.y,o=p.y,n(l)){const t=(s-i-l)/2;i+=t,s-=t}if(n(d)&&d<Math.abs(s-i)){const t=(s-i-d)/2;i+=t,s-=t}if(n(g)){const t=(o-a-g)/2;a+=t,o-=t}if(n(c)&&c<Math.abs(o-a)){const t=(o-a-c)/2;a+=t,o-=t}this.get("adjustBulletPosition")&&(r&&(s=Math.min(Math.max(0,s),this._pw),i=Math.min(Math.max(0,i),this._pw)),h&&(a=Math.min(Math.max(0,a),this._ph),o=Math.min(Math.max(0,o),this._ph))),t.setRaw("left",i),t.setRaw("right",s),t.setRaw("top",a),t.setRaw("bottom",o),e.setPrivate("width",s-i),e.setPrivate("height",o-a),e.set("x",i),e.set("y",o-(o-a))}_handleDataSetChange(){super._handleDataSetChange(),i(this._dataItems,(t=>{this._toggleColumn(t,!1)}))}_applyGraphicsStates(t,e){const i=t.get("graphics"),s=i.states.lookup("dropFromOpen"),a=i.states.lookup("riseFromOpen"),o=i.states.lookup("dropFromPrevious"),r=i.states.lookup("riseFromPrevious");if(s||o||a||r){const i=this.get("xAxis"),h=this.get("yAxis"),l=this.get("baseAxis");let g,d,c;l===i&&h.isType("ValueAxis")?(g=t.get(this._yOpenField),d=t.get(this._yField),c=e.get(this._yField)):l===h&&i.isType("ValueAxis")&&(g=t.get(this._xOpenField),d=t.get(this._xField),c=e.get(this._xField)),n(g)&&n(d)&&(d<g?s&&s.apply():a&&a.apply(),n(c)&&(d<c?o&&o.apply():r&&r.apply()))}}disposeDataItem(t){super.disposeDataItem(t);const e=t.get("graphics");e&&(this.columns.removeValue(e),e.dispose());const s=t.get("rangeGraphics");s&&i(s,(t=>{const e=t.getPrivate("list");e&&e.removeValue(t),t.dispose()}))}hideDataItem(t,e){const s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return m(this,void 0,void 0,(function*(){const a=[s.hideDataItem.call(this,t,e)],o=t.get("graphics");o&&a.push(o.hide(e));const n=t.get("rangeGraphics");n&&i(n,(t=>{a.push(t.hide(e))})),yield Promise.all(a)}))}_toggleColumn(t,e){const s=t.get("graphics");s&&s.setPrivate("visible",e);const a=t.get("rangeGraphics");a&&i(a,(t=>{t.setPrivate("visible",e)}));const o=t.bullets;o&&i(o,(t=>{t.setPrivate("hidden",!e)}))}showDataItem(t,e){const s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return m(this,void 0,void 0,(function*(){const a=[s.showDataItem.call(this,t,e)],o=t.get("graphics");o&&a.push(o.show(e));const n=t.get("rangeGraphics");n&&i(n,(t=>{a.push(t.show(e))})),yield Promise.all(a)}))}updateLegendMarker(t){let e=this.get("legendDataItem");if(this.get("useLastColorForLegendMarker")&&!t){const e=this.dataItems[this.endIndex()-1];e&&(t=e)}if(e){let s=this.columns.template;if(t){let e=t.get("graphics");e&&(s=e)}const a=e.get("markerRectangle");a&&(e.get("itemContainer").get("disabled")||i(r,(t=>{a.set(t,s.get(t,this.get(t)))})))}}_getTooltipTarget(t){if("bullet"==this.get("seriesTooltipTarget"))return super._getTooltipTarget(t);let e=t.get("graphics");return e||this}}Object.defineProperty(u,"className",{enumerable:!0,configurable:!0,writable:!0,value:"BaseColumnSeries"}),Object.defineProperty(u,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:t.classNames.concat([u.className])});class x extends e{constructor(){super(...arguments),Object.defineProperty(this,"_frequency",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_itemMap",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_afterNew(){this._settings.themeTags=h(this._settings.themeTags,["axis"]),this.fields.push("category"),this.setPrivateRaw("name","category"),this.addTag("category"),super._afterNew()}_prepareChildren(){super._prepareChildren();const t=this.dataItems.length;let e=0;this._valuesDirty&&(this._itemMap={},i(this.dataItems,(t=>{t.setRaw("index",e),this._itemMap[t.get("category")]=t,e++})),this.setPrivateRaw("maxZoomFactor",t)),this.setPrivateRaw("startIndex",Math.max(Math.round(this.get("start",0)*t),0)),this.setPrivateRaw("endIndex",Math.min(Math.round(this.get("end",1)*t),t)),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("endIndex")||this.isPrivateDirty("startIndex")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&this.dataItems.length>0&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges())}_handleRangeChange(){i(this.series,(t=>{let e=this.dataItems[this.startIndex()].get("category"),s=this.dataItems[this.endIndex()-1].get("category"),a=t.get("baseAxis"),o=t.get("xAxis"),n=t.get("yAxis");if(o instanceof x&&n instanceof x)t._markDirtyAxes();else if(a===this){let r,h,l=n;if(o===a?(t.get("categoryXField")&&(r="categoryX"),t.get("openCategoryXField")&&(h="openCategoryX")):n===a&&(t.get("categoryYField")&&(r="categoryY"),t.get("openCategoryYField")&&(h="openCategoryY"),l=o),"ValueAxis"==l.className&&(r||h)){let a,o;for(let i=0,s=t.dataItems.length;i<s;i++){let s=t.dataItems[i];if(r&&s.get(r)===e){a=s;break}if(h&&s.get(h)===e){a=s;break}}for(let e=t.dataItems.length-1;e>=0;e--){let i=t.dataItems[e];if(r&&i.get(r)===s){o=i;break}if(h&&i.get(h)===s){o=i;break}}let n=0,l=t.dataItems.length;a&&(n=t.dataItems.indexOf(a)),o&&(l=t.dataItems.indexOf(o)+1),t.setPrivate("startIndex",n),t.setPrivate("endIndex",l);let g=!1;for(let e=n;e<l;e++){const s=t.dataItems[e];if(i(t.__valueXShowFields,(t=>{null!=s.get(t)&&(g=!0)})),i(t.__valueYShowFields,(t=>{null!=s.get(t)&&(g=!0)})),g)break}t.setPrivate("outOfSelection",!g)}t._markDirtyAxes()}}))}_prepareAxisItems(){const t=this.get("renderer"),e=this.dataItems.length;let i=this.startIndex();i>0&&i--;let s=this.endIndex();s<e&&s++;let a=t.axisLength()/Math.max(t.get("minGridDistance"),1/Number.MAX_SAFE_INTEGER),o=Math.max(1,Math.min(e,Math.ceil((s-i)/a)));i=Math.floor(i/o)*o,this._frequency=o;for(let r=0;r<e;r++)this.dataItems[r].hide();let n=this.dataItems[i].get("index",0);for(let r=i;r<s;r+=o){let t=this.dataItems[r];this._createAssets(t,[]),t.isHidden()&&t.show(),this._prepareDataItem(t,n,o),n++}this._updateGhost()}_prepareDataItem(t,e,i){let s=this.get("renderer"),a=t.get("categoryLocation",0),o=t.get("endCategoryLocation",1),r=t.get("index");n(r)||(r=this.categoryToIndex(t.get("category")));let h,l=this.indexToPosition(r,a),g=t.get("endCategory");g?(h=this.categoryToIndex(g),n(h)||(h=r)):h=r;let d,c,m=this.indexToPosition(h,o);d=t.get("isRange")?h:r+this._frequency-1,c=this.indexToPosition(d,o),s.updateLabel(t.get("label"),l,m,i),s.updateGrid(t.get("grid"),l,m),s.updateTick(t.get("tick"),l,m,i),s.updateFill(t.get("axisFill"),l,c),this._processBullet(t),s.updateBullet(t.get("bullet"),l,m);const p=this.get("fillRule");p&&p(t,e)}startIndex(){let t=this.dataItems.length;return Math.min(Math.max(this.getPrivate("startIndex",0),0),t-1)}endIndex(){let t=this.dataItems.length;return Math.max(1,Math.min(this.getPrivate("endIndex",t),t))}baseValue(){}basePosition(){return 0}getX(t){let e=this._itemMap[t];return e?this._settings.renderer.positionToCoordinate(this.indexToPosition(e.get("index",0))):NaN}getY(t){let e=this._itemMap[t];return e?this._settings.renderer.positionToCoordinate(this.indexToPosition(e.get("index",0))):NaN}getDataItemPositionX(t,e,i,s){const a=t.get(e),o=this._itemMap[a];return o?this.indexToPosition(o.get("index",0),i):NaN}getDataItemCoordinateX(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(t,e,i,s))}getDataItemPositionY(t,e,i,s){const a=t.get(e),o=this._itemMap[a];return o?this.indexToPosition(o.get("index",0),i):NaN}getDataItemCoordinateY(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(t,e,i,s))}indexToPosition(t,e){n(e)||(e=.5);let i=this.dataItems.length,s=this.get("startLocation",0);i-=s,i-=1-this.get("endLocation",1);let a=(t+e-s)/i,o=this.dataItems[t];return o&&(a+=o.get("deltaPosition",0)),a}categoryToIndex(t){let e=this._itemMap[t];return e?e.get("index"):NaN}dataItemToPosition(t){return this.indexToPosition(t.get("index"))}roundAxisPosition(t,e){return t+=(.5-e)/this.dataItems.length,this.indexToPosition(this.axisPositionToIndex(t),e)}axisPositionToIndex(t){let e=this.dataItems.length;return l(Math.floor(t*e),0,e-1)}getTooltipText(t,e){const i=this.dataItems[this.axisPositionToIndex(t)];if(i){const t=i.get("label");if(t)return g(t,this.get("tooltipText",""))}}_updateTooltipText(t,e){t._setDataItem(this.dataItems[this.axisPositionToIndex(e)]),t.label.text.markDirtyText()}getSeriesItem(t,e){if(this.dataItems.length>0){let i=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),s=this.axisPositionToIndex(e),a=t.dataItems[s],o=this.dataItems[s],n=o.get("category");if(a&&o&&a.get(i)===n)return a;for(let e=0,r=t.dataItems.length;e<r;e++){let s=t.dataItems[e];if(s.get(i)===n)return s}}}zoomToIndexes(t,e,i){let s=this.dataItems.length;this.zoom(t/s,e/s,i)}zoomToCategories(t,e,i){this.zoomToIndexes(this.categoryToIndex(t),this.categoryToIndex(e)+1,i)}getCellWidthPosition(){return this._frequency/this.dataItems.length/(this.get("end",1)-this.get("start",0))}}Object.defineProperty(x,"className",{enumerable:!0,configurable:!0,writable:!0,value:"CategoryAxis"}),Object.defineProperty(x,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:e.classNames.concat([x.className])});class _ extends u{constructor(){super(...arguments),Object.defineProperty(this,"columns",{enumerable:!0,configurable:!0,writable:!0,value:new d(c.new({}),(()=>p._new(this._root,{position:"absolute",themeTags:h(this.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template])))})}makeColumn(t,e){const i=this.mainContainer.children.push(e.make());return i._setDataItem(t),e.push(i),i}_processAxisRange(t){super._processAxisRange(t),t.columns=new d(c.new({}),(()=>p._new(this._root,{position:"absolute",themeTags:h(t.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template,t.columns.template])))}}Object.defineProperty(_,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColumnSeries"}),Object.defineProperty(_,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:u.classNames.concat([_.className])});export{x as CategoryAxisAm5,_ as ColumnSeriesAm5};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{prefersReducedMotion as t}from"../../core/a11yUtils.js";import{eventKey as i}from"../../core/events.js";import{watch as r,initial as a}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{getColorsFromRenderer as n}from"../../renderers/support/utils.js";import l from"../Widget.js";import d from"./FeatureMedia/FeatureMediaViewModel.js";import m from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as c}from"./support/featureUtils.js";import{esriChartColorSet as p}from"../support/chartUtilsAm5.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{isRTL as u}from"../support/widgetUtils.js";import{messageBundle as f}from"../support/decorators/messageBundle.js";import{tsx as v}from"../support/jsxFactory.js";import{isDarkTheme as _}from"../../support/themeUtils.js";import{substitute as M}from"../../intl/substitute.js";const g="esri-feature-media",w={base:g,mediaContainer:`${g}__container`,mediaItemContainer:`${g}__item-container`,mediaItem:`${g}__item`,mediaItemText:`${g}__item-text`,mediaItemTitle:`${g}__item-title`,mediaItemCaption:`${g}__item-caption`,mediaNavigation:`${g}__item-navigation`,mediaPagination:`${g}__pagination`,mediaPaginationText:`${g}__pagination-text`,mediaPrevious:`${g}__previous`,mediaPreviousIconLTR:`${g}__previous-icon`,mediaPreviousIconRTL:`${g}__previous-icon--rtl`,mediaNext:`${g}__next`,mediaNextIconLTR:`${g}__next-icon`,mediaNextIconRTL:`${g}__next-icon--rtl`,mediaChart:`${g}__chart`,mediaPaginationButton:`${g}__pagination-button`,mediaPaginationIcon:`${g}__pagination-icon`,mediaChartRendered:`${g}__chart--rendered`},I=15,A="category",y="value",x="rgba(50, 50, 50, 1)",C=250,T=500,b=200;let R=class extends l{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new d,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:r}=await import("../support/chartUtilsAm5.js"),a=await r(e);this._chartRootMap.set(e,a),this._renderChart({mediaInfo:i.activeMediaInfo,root:a})}}initialize(){this._featureElementInfo=new m,this.addHandles([r((()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex]),(()=>this._setupMediaRefreshTimer()),a),r((()=>[this.viewModel?.description,this.viewModel?.title]),(()=>this._setupFeatureElementInfo()),a)])}loadDependencies(){return h({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return v("div",{bind:this,class:w.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this.renderMedia())}renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this.renderMediaText();return e?v("div",{key:"media-element-container",class:w.mediaContainer},this.renderMediaInfo(),v("div",{class:w.mediaNavigation},i,v("div",{class:w.mediaPagination},this.renderMediaPageButton("previous"),v("span",{class:w.mediaPaginationText},M(this.messages.pageText,{index:t+1,total:e})),this.renderMediaPageButton("next")))):null}renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?v("div",{key:"media-title",class:w.mediaItemTitle,innerHTML:e.title}):null,i=e&&e.caption?v("div",{key:"media-caption",class:w.mediaItemCaption,innerHTML:e.caption}):null;return t||i?v("div",{key:"media-text",class:w.mediaItemText},t,i):null}renderImageMediaInfo(e){const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:r}=this.viewModel,{value:a,refreshInterval:s,altText:o,title:n,type:l}=e,{sourceURL:d,linkURL:m}=a,p=c(m??void 0)?"_blank":"_self",h="_blank"===p?"noreferrer":"",u=s?t:null,f=u?u.timestamp:0,_=u?u.sourceURL:d,M=v("img",{alt:o||n,key:`media-${l}-${i}-${r}-${f}`,src:_??void 0});return(m?v("a",{title:n,href:m,rel:h,target:p},M):null)??M}renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return v("div",{key:`media-${e.type}-${t}-${i}`,bind:this,class:w.mediaChart,afterCreate:this._createChart,afterRemoved:this._disposeChart})}renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this.renderImageMediaInfo(e):e.type.includes("chart")?this.renderChartMediaInfo(e):null:null}renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?v("div",{key:"media-container",class:w.mediaItemContainer},v("div",{key:"media-item-container",class:w.mediaItem},this.renderMediaInfoType())):null}renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,r=t?"chevron-left":"chevron-right",a=t?"media-previous":"media-next",s=t?this._previous:this._next;return v("button",{type:"button",key:a,title:i,"aria-label":i,tabIndex:0,class:w.mediaPaginationButton,bind:this,onclick:s},v("calcite-icon",{class:w.mediaPaginationIcon,scale:"s",icon:r}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),r="default";if(!i)return t;const a=await n(i);a.delete(r);return Array.from(a.values()).every((e=>1===e?.length))?(Array.from(a.keys()).forEach((i=>{const r=a.get(i)?.[0]?.toCss(!0);r&&t.set(i,e(r))})),t):t}_handleMediaKeyup(e){const t=i(e);"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!t())}_getChartAnimationMS(){return this._canAnimateChart()?C:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?T:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:r,type:a}=i,{ResponsiveThemeAm5:s,DarkThemeAm5:o,AnimatedThemeAm5:n,ColorSetAm5:l,ThemeAm5:d}=await import("./FeatureMedia/chartCommon.js"),m=d.new(t);m.rule("ColorSet").set("colors",p);const c=[s.new(t),m];_()&&c.push(o.new(t)),this._canAnimateChart()&&c.push(n.new(t)),t.setThemes(c);const h=await this._getRendererColors(),u=l.new(t,{}),f=r.series.map(((e,t)=>{const i=h.get(e.fieldName)||u.getIndex(t);return{[A]:e.tooltip,[y]:e.value,columnSettings:{fill:i,stroke:i}}})).filter((e=>"pie-chart"!==a||null!=e.value&&e.value>0));"pie-chart"===a?this._createPieChart(e,f):this._createXYChart(e,f)}_getDirection(){return u(this.container)?"rtl":"ltr"}_isInversed(){return!!u(this.container)}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(x)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:b})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:r,PieSeriesAm5:a}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:s,root:o}=e,{title:n}=s,l=5,d=s?.altText||s?.title||"",m=o.container.children.push(r.new(o,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",p=i.new(o,{labelText:c}),h=m.series.push(a.new(o,{name:n,valueField:y,categoryField:A,tooltip:p}));h.ticks.template.set("forceHidden",!0),h.labels.template.set("forceHidden",!0),h.slices.template.states.create("active",{shiftRadius:l}),this._customizeChartTooltip(p),h.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),h.data.setAll(t),h.appear(this._getChartSeriesAnimationMS()),m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(w.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach((e=>t=Math.min(e.value,t))),t}async _createColumnChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:s,AxisRendererXAm5:o,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:h}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const u=e.xAxes.push(s.new(c,{renderer:o.new(c,{inversed:this._isInversed()}),categoryField:A}));u.get("renderer").labels.template.setAll({forceHidden:!0});const f=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(p.series)}));f.get("renderer").labels.template.setAll({direction:this._getDirection()});const v="{categoryX}",_=r.new(c,{labelText:v}),M=e.series.push(d.new(c,{name:h,xAxis:u,yAxis:f,valueYField:y,categoryXField:A,tooltip:_}));this._customizeChartTooltip(_),M.columns.template.setAll({ariaLabel:v,focusable:!0,templateField:"columnSettings"}),p.series.length>I&&e.set("scrollbarX",a.new(c,{orientation:"horizontal"})),u.data.setAll(i),M.data.setAll(i),M.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:s,AxisRendererXAm5:o,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:h}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const u=e.yAxes.push(s.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:A}));u.get("renderer").labels.template.setAll({forceHidden:!0});const f=e.xAxes.push(n.new(c,{renderer:o.new(c,{inside:!1,inversed:this._isInversed()}),min:this._getMinSeriesValue(p.series)}));f.get("renderer").labels.template.setAll({direction:this._getDirection()});const v="{categoryY}",_=r.new(c,{labelText:v}),M=e.series.push(d.new(c,{name:h,xAxis:f,yAxis:u,valueXField:y,categoryYField:A,tooltip:_}));this._customizeChartTooltip(_,"vertical"),M.columns.template.setAll({ariaLabel:v,focusable:!0,templateField:"columnSettings"}),p.series.length>I&&e.set("scrollbarY",a.new(c,{orientation:"vertical"})),u.data.setAll(i),M.data.setAll(i),M.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:s,AxisRendererXAm5:o,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:p,title:h}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const u=e.xAxes.push(s.new(m,{renderer:o.new(m,{inversed:this._isInversed()}),categoryField:A}));u.get("renderer").labels.template.setAll({forceHidden:!0});const f=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(p.series)}));f.get("renderer").labels.template.setAll({direction:this._getDirection()});const v="{categoryX}",_=r.new(m,{labelText:v}),M=e.series.push(d.new(m,{name:h,xAxis:u,yAxis:f,valueYField:y,categoryXField:A,tooltip:_}));this._customizeChartTooltip(_,"vertical"),p.series.length>I&&e.set("scrollbarX",a.new(m,{orientation:"horizontal"})),u.data.setAll(i),M.data.setAll(i),M.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:r}=await import("./FeatureMedia/xyChart.js"),{root:a,mediaInfo:s}=e,{type:o}=s,n=s?.altText||s?.title||"",l=a.container.children.push(i.new(a,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",r.new(a,{})),"column-chart"===o&&await this._createColumnChart(l,e,t),"bar-chart"===o&&await this._createBarChart(l,e,t),"line-chart"===o&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(w.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e&&"image"===e.type&&e.refreshInterval&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e;if(!t)return;const r=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const a=setInterval((()=>{this._updateMediaInfoTimestamp(i.sourceURL)}),r);this._refreshTimer=a}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[r,a=""]=e.split("#");return`${r}${i}timestamp=${t}${a?"#":""}${a}`}};e([s()],R.prototype,"_refreshIntervalInfo",void 0),e([s()],R.prototype,"attributes",null),e([s()],R.prototype,"activeMediaInfoIndex",null),e([s()],R.prototype,"description",null),e([s()],R.prototype,"fieldInfoMap",null),e([s()],R.prototype,"layer",null),e([s()],R.prototype,"mediaInfos",null),e([s()],R.prototype,"popupTemplate",null),e([s()],R.prototype,"relatedInfos",null),e([s()],R.prototype,"title",null),e([s({type:d})],R.prototype,"viewModel",void 0),e([s(),f("esri/widgets/Feature/t9n/Feature")],R.prototype,"messages",void 0),R=e([o("esri.widgets.Feature.FeatureMedia")],R);const j=R;export{j as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{prefersReducedMotion as t}from"../../core/a11yUtils.js";import{eventKey as i}from"../../core/events.js";import{watch as r,initial as a}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{getColorsFromRenderer as n}from"../../renderers/support/utils.js";import l from"../Widget.js";import d from"./FeatureMedia/FeatureMediaViewModel.js";import m from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as c}from"./support/featureUtils.js";import{e as p}from"../../chunks/chartUtilsAm5.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{isRTL as u}from"../support/widgetUtils.js";import{messageBundle as f}from"../support/decorators/messageBundle.js";import{tsx as v}from"../support/jsxFactory.js";import{isDarkTheme as _}from"../../support/themeUtils.js";import{substitute as M}from"../../intl/substitute.js";const g="esri-feature-media",w={base:g,mediaContainer:`${g}__container`,mediaItemContainer:`${g}__item-container`,mediaItem:`${g}__item`,mediaItemText:`${g}__item-text`,mediaItemTitle:`${g}__item-title`,mediaItemCaption:`${g}__item-caption`,mediaNavigation:`${g}__item-navigation`,mediaPagination:`${g}__pagination`,mediaPaginationText:`${g}__pagination-text`,mediaPrevious:`${g}__previous`,mediaPreviousIconLTR:`${g}__previous-icon`,mediaPreviousIconRTL:`${g}__previous-icon--rtl`,mediaNext:`${g}__next`,mediaNextIconLTR:`${g}__next-icon`,mediaNextIconRTL:`${g}__next-icon--rtl`,mediaChart:`${g}__chart`,mediaPaginationButton:`${g}__pagination-button`,mediaPaginationIcon:`${g}__pagination-icon`,mediaChartRendered:`${g}__chart--rendered`},I=15,A="category",y="value",x="rgba(50, 50, 50, 1)",C=250,T=500,b=200;let R=class extends l{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new d,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:r}=await import("../support/chartUtilsAm5.js"),a=await r(e);this._chartRootMap.set(e,a),this._renderChart({mediaInfo:i.activeMediaInfo,root:a})}}initialize(){this._featureElementInfo=new m,this.addHandles([r((()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex]),(()=>this._setupMediaRefreshTimer()),a),r((()=>[this.viewModel?.description,this.viewModel?.title]),(()=>this._setupFeatureElementInfo()),a)])}loadDependencies(){return h({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return v("div",{bind:this,class:w.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this.renderMedia())}renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this.renderMediaText();return e?v("div",{key:"media-element-container",class:w.mediaContainer},this.renderMediaInfo(),v("div",{class:w.mediaNavigation},i,v("div",{class:w.mediaPagination},this.renderMediaPageButton("previous"),v("span",{class:w.mediaPaginationText},M(this.messages.pageText,{index:t+1,total:e})),this.renderMediaPageButton("next")))):null}renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?v("div",{key:"media-title",class:w.mediaItemTitle,innerHTML:e.title}):null,i=e&&e.caption?v("div",{key:"media-caption",class:w.mediaItemCaption,innerHTML:e.caption}):null;return t||i?v("div",{key:"media-text",class:w.mediaItemText},t,i):null}renderImageMediaInfo(e){const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:r}=this.viewModel,{value:a,refreshInterval:s,altText:o,title:n,type:l}=e,{sourceURL:d,linkURL:m}=a,p=c(m??void 0)?"_blank":"_self",h="_blank"===p?"noreferrer":"",u=s?t:null,f=u?u.timestamp:0,_=u?u.sourceURL:d,M=v("img",{alt:o||n,key:`media-${l}-${i}-${r}-${f}`,src:_??void 0});return(m?v("a",{title:n,href:m,rel:h,target:p},M):null)??M}renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return v("div",{key:`media-${e.type}-${t}-${i}`,bind:this,class:w.mediaChart,afterCreate:this._createChart,afterRemoved:this._disposeChart})}renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this.renderImageMediaInfo(e):e.type.includes("chart")?this.renderChartMediaInfo(e):null:null}renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?v("div",{key:"media-container",class:w.mediaItemContainer},v("div",{key:"media-item-container",class:w.mediaItem},this.renderMediaInfoType())):null}renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,r=t?"chevron-left":"chevron-right",a=t?"media-previous":"media-next",s=t?this._previous:this._next;return v("button",{type:"button",key:a,title:i,"aria-label":i,tabIndex:0,class:w.mediaPaginationButton,bind:this,onclick:s},v("calcite-icon",{class:w.mediaPaginationIcon,scale:"s",icon:r}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),r="default";if(!i)return t;const a=await n(i);a.delete(r);return Array.from(a.values()).every((e=>1===e?.length))?(Array.from(a.keys()).forEach((i=>{const r=a.get(i)?.[0]?.toCss(!0);r&&t.set(i,e(r))})),t):t}_handleMediaKeyup(e){const t=i(e);"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!t())}_getChartAnimationMS(){return this._canAnimateChart()?C:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?T:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:r,type:a}=i,{ResponsiveThemeAm5:s,DarkThemeAm5:o,AnimatedThemeAm5:n,ColorSetAm5:l,ThemeAm5:d}=await import("./FeatureMedia/chartCommon.js"),m=d.new(t);m.rule("ColorSet").set("colors",p);const c=[s.new(t),m];_()&&c.push(o.new(t)),this._canAnimateChart()&&c.push(n.new(t)),t.setThemes(c);const h=await this._getRendererColors(),u=l.new(t,{}),f=r.series.map(((e,t)=>{const i=h.get(e.fieldName)||u.getIndex(t);return{[A]:e.tooltip,[y]:e.value,columnSettings:{fill:i,stroke:i}}})).filter((e=>"pie-chart"!==a||null!=e.value&&e.value>0));"pie-chart"===a?this._createPieChart(e,f):this._createXYChart(e,f)}_getDirection(){return u(this.container)?"rtl":"ltr"}_isInversed(){return!!u(this.container)}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(x)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:b})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:r,PieSeriesAm5:a}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:s,root:o}=e,{title:n}=s,l=5,d=s?.altText||s?.title||"",m=o.container.children.push(r.new(o,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",p=i.new(o,{labelText:c}),h=m.series.push(a.new(o,{name:n,valueField:y,categoryField:A,tooltip:p}));h.ticks.template.set("forceHidden",!0),h.labels.template.set("forceHidden",!0),h.slices.template.states.create("active",{shiftRadius:l}),this._customizeChartTooltip(p),h.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),h.data.setAll(t),h.appear(this._getChartSeriesAnimationMS()),m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(w.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach((e=>t=Math.min(e.value,t))),t}async _createColumnChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:s,AxisRendererXAm5:o,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:h}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const u=e.xAxes.push(s.new(c,{renderer:o.new(c,{inversed:this._isInversed()}),categoryField:A}));u.get("renderer").labels.template.setAll({forceHidden:!0});const f=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(p.series)}));f.get("renderer").labels.template.setAll({direction:this._getDirection()});const v="{categoryX}",_=r.new(c,{labelText:v}),M=e.series.push(d.new(c,{name:h,xAxis:u,yAxis:f,valueYField:y,categoryXField:A,tooltip:_}));this._customizeChartTooltip(_),M.columns.template.setAll({ariaLabel:v,focusable:!0,templateField:"columnSettings"}),p.series.length>I&&e.set("scrollbarX",a.new(c,{orientation:"horizontal"})),u.data.setAll(i),M.data.setAll(i),M.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:s,AxisRendererXAm5:o,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:h}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const u=e.yAxes.push(s.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:A}));u.get("renderer").labels.template.setAll({forceHidden:!0});const f=e.xAxes.push(n.new(c,{renderer:o.new(c,{inside:!1,inversed:this._isInversed()}),min:this._getMinSeriesValue(p.series)}));f.get("renderer").labels.template.setAll({direction:this._getDirection()});const v="{categoryY}",_=r.new(c,{labelText:v}),M=e.series.push(d.new(c,{name:h,xAxis:f,yAxis:u,valueXField:y,categoryYField:A,tooltip:_}));this._customizeChartTooltip(_,"vertical"),M.columns.template.setAll({ariaLabel:v,focusable:!0,templateField:"columnSettings"}),p.series.length>I&&e.set("scrollbarY",a.new(c,{orientation:"vertical"})),u.data.setAll(i),M.data.setAll(i),M.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:s,AxisRendererXAm5:o,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:p,title:h}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const u=e.xAxes.push(s.new(m,{renderer:o.new(m,{inversed:this._isInversed()}),categoryField:A}));u.get("renderer").labels.template.setAll({forceHidden:!0});const f=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(p.series)}));f.get("renderer").labels.template.setAll({direction:this._getDirection()});const v="{categoryX}",_=r.new(m,{labelText:v}),M=e.series.push(d.new(m,{name:h,xAxis:u,yAxis:f,valueYField:y,categoryXField:A,tooltip:_}));this._customizeChartTooltip(_,"vertical"),p.series.length>I&&e.set("scrollbarX",a.new(m,{orientation:"horizontal"})),u.data.setAll(i),M.data.setAll(i),M.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:r}=await import("./FeatureMedia/xyChart.js"),{root:a,mediaInfo:s}=e,{type:o}=s,n=s?.altText||s?.title||"",l=a.container.children.push(i.new(a,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",r.new(a,{})),"column-chart"===o&&await this._createColumnChart(l,e,t),"bar-chart"===o&&await this._createBarChart(l,e,t),"line-chart"===o&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(w.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e&&"image"===e.type&&e.refreshInterval&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e;if(!t)return;const r=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const a=setInterval((()=>{this._updateMediaInfoTimestamp(i.sourceURL)}),r);this._refreshTimer=a}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[r,a=""]=e.split("#");return`${r}${i}timestamp=${t}${a?"#":""}${a}`}};e([s()],R.prototype,"_refreshIntervalInfo",void 0),e([s()],R.prototype,"attributes",null),e([s()],R.prototype,"activeMediaInfoIndex",null),e([s()],R.prototype,"description",null),e([s()],R.prototype,"fieldInfoMap",null),e([s()],R.prototype,"layer",null),e([s()],R.prototype,"mediaInfos",null),e([s()],R.prototype,"popupTemplate",null),e([s()],R.prototype,"relatedInfos",null),e([s()],R.prototype,"title",null),e([s({type:d})],R.prototype,"viewModel",void 0),e([s(),f("esri/widgets/Feature/t9n/Feature")],R.prototype,"messages",void 0),R=e([o("esri.widgets.Feature.FeatureMedia")],R);const j=R;export{j as default};