@arcgis/core 4.28.0-next.20230821 → 4.28.0-next.20230822

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 (183) hide show
  1. package/arcade/functions/geomasync.js +1 -1
  2. package/arcade/portalUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/0746319459dbcd3ab6f7.js +1 -0
  5. package/assets/esri/core/workers/chunks/217910f88fe2c03e6bdd.js +1 -0
  6. package/assets/esri/core/workers/chunks/54aaa21144431b29b6ed.js +1 -0
  7. package/assets/esri/core/workers/chunks/{46f6b77e586d78aeb75c.js → 6866dee1c7e2f230ad08.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{d6c96a20e9640b433719.js → 7dad40179a9767ea9087.js} +56 -56
  9. package/assets/esri/core/workers/chunks/{05ab09713d599687afa3.js → c6bd9c400615107591ec.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{4922a0fed7cbc6895882.js → f701a5afa1b730c51a49.js} +1 -1
  11. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ar.json +1 -0
  12. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_bg.json +1 -0
  13. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_bs.json +1 -0
  14. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ca.json +1 -0
  15. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_cs.json +1 -0
  16. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_da.json +1 -0
  17. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_de.json +1 -0
  18. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_el.json +1 -0
  19. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_es.json +1 -0
  20. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_et.json +1 -0
  21. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_fi.json +1 -0
  22. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_fr.json +1 -0
  23. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_he.json +1 -0
  24. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_hr.json +1 -0
  25. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_hu.json +1 -0
  26. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_id.json +1 -0
  27. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_it.json +1 -0
  28. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ja.json +1 -0
  29. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ko.json +1 -0
  30. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_lt.json +1 -0
  31. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_lv.json +1 -0
  32. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_nb.json +1 -0
  33. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_nl.json +1 -0
  34. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_pl.json +1 -0
  35. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_pt-BR.json +1 -0
  36. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_pt-PT.json +1 -0
  37. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ro.json +1 -0
  38. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ru.json +1 -0
  39. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sk.json +1 -0
  40. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sl.json +1 -0
  41. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sr.json +1 -0
  42. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sv.json +1 -0
  43. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_th.json +1 -0
  44. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_tr.json +1 -0
  45. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_uk.json +1 -0
  46. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_vi.json +1 -0
  47. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_zh-CN.json +1 -0
  48. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_zh-HK.json +1 -0
  49. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_zh-TW.json +1 -0
  50. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  51. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  52. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  53. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  54. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  55. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  56. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  57. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  58. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  59. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  60. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  61. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  62. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  63. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  64. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  65. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  66. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  67. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  68. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  69. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  70. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  71. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  72. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  73. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  74. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  75. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  76. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  77. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  78. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  79. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  80. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  81. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  82. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  83. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  84. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  85. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  86. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  87. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  88. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  89. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ar.json +1 -1
  90. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bg.json +1 -1
  91. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bs.json +1 -1
  92. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ca.json +1 -1
  93. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_cs.json +1 -1
  94. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_da.json +1 -1
  95. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_de.json +1 -1
  96. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_el.json +1 -1
  97. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_es.json +1 -1
  98. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_et.json +1 -1
  99. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fi.json +1 -1
  100. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fr.json +1 -1
  101. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_he.json +1 -1
  102. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hr.json +1 -1
  103. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hu.json +1 -1
  104. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_id.json +1 -1
  105. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_it.json +1 -1
  106. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ja.json +1 -1
  107. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ko.json +1 -1
  108. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lt.json +1 -1
  109. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lv.json +1 -1
  110. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nb.json +1 -1
  111. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nl.json +1 -1
  112. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pl.json +1 -1
  113. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-BR.json +1 -1
  114. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-PT.json +1 -1
  115. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ro.json +1 -1
  116. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ru.json +1 -1
  117. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sk.json +1 -1
  118. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sl.json +1 -1
  119. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sr.json +1 -1
  120. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sv.json +1 -1
  121. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_th.json +1 -1
  122. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_tr.json +1 -1
  123. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_uk.json +1 -1
  124. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_vi.json +1 -1
  125. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-CN.json +1 -1
  126. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-HK.json +1 -1
  127. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-TW.json +1 -1
  128. package/chunks/LineSeries.js +1 -1
  129. package/chunks/Theme.js +1 -1
  130. package/chunks/chartUtilsAm5.js +1 -1
  131. package/layers/support/layerUtils.js +1 -1
  132. package/package.json +1 -1
  133. package/portal/support/utils.js +5 -0
  134. package/smartMapping/popup/support/utils.js +1 -1
  135. package/support/revision.js +1 -1
  136. package/symbols/cim/CIMImageColorSubstitutionHelper.js +1 -1
  137. package/symbols/support/previewSymbol3D.js +1 -1
  138. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  139. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  140. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  141. package/views/3d/analysis/images/Factory.js +5 -0
  142. package/views/3d/interactive/Manipulator3D.js +1 -1
  143. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  144. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  145. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  146. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  147. package/views/3d/layers/I3SMeshView3D.js +1 -1
  148. package/views/3d/layers/MediaLayerView3D.js +1 -1
  149. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  150. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  151. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  152. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  153. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  154. package/views/3d/support/StreamTextureCollection.js +1 -1
  155. package/views/3d/support/TextureCollection.js +1 -1
  156. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  157. package/views/3d/webgl-engine/Stage.js +1 -1
  158. package/views/3d/webgl-engine/lib/ContentObject.js +1 -1
  159. package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
  160. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  161. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  162. package/views/3d/webgl-engine/lib/ITexture.js +5 -0
  163. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  164. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  165. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  166. package/views/3d/webgl-engine/parts/Model.js +1 -1
  167. package/views/draw/DrawManipulator.js +1 -1
  168. package/views/interactive/GraphicManipulator.js +1 -1
  169. package/views/interactive/ManipulatorCollection.js +1 -1
  170. package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
  171. package/views/support/layerViewUtils.js +1 -1
  172. package/widgets/Sketch.js +1 -1
  173. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  174. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  175. package/assets/esri/core/workers/chunks/4e39252f40bc57be9d12.js +0 -1
  176. package/assets/esri/core/workers/chunks/c99fa4189a114370b004.js +0 -1
  177. package/assets/esri/core/workers/chunks/ebd006fcd568a7731115.js +0 -1
  178. package/views/3d/analysis/Slice/images/Factory.js +0 -5
  179. /package/assets/esri/views/3d/analysis/{Slice/images → images}/heading-rotate.ts.svg +0 -0
  180. /package/assets/esri/views/3d/analysis/{Slice/images → images}/tilt-rotate.ts.svg +0 -0
  181. /package/views/3d/analysis/{Slice/images → images}/generateTextures.js +0 -0
  182. /package/views/3d/analysis/{Slice/images → images}/heading-rotate-svg.js +0 -0
  183. /package/views/3d/analysis/{Slice/images → images}/tilt-rotate-svg.js +0 -0
package/chunks/Theme.js CHANGED
@@ -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{a as t}from"./tslib.es6.js";function e(t){return Number(t)!==t}function i(t){return{}.toString.call(t)}function s(t){if(null!=t&&!l(t)){let i=Number(t);return e(i)&&h(t)&&""!=t?s(t.replace(/[^0-9.\-]+/g,"")):i}return t}function r(t){if(o(t))return new Date(t);if(l(t))return new Date(t);{let e=Number(t);return l(e)?new Date(e):new Date(t)}}function a(t){if(e(t))return"NaN";if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(0===t&&1/t==-1/0)return"-0";let i=t<0;t=Math.abs(t);let s,r=/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+t),a=r[1],o=r[2]||"";if(void 0===r[3])s=""===o?a:a+"."+o;else{let e=+r[3];if(t<1){s="0."+n("0",e-1)+a+o}else{let t=e-o.length;s=0===t?a+o:t<0?a+o.slice(0,t)+"."+o.slice(t):a+o+n("0",t)}}return i?"-"+s:s}function n(t,e){return new Array(e+1).join(t)}function o(t){return"[object Date]"===i(t)}function h(t){return"string"==typeof t}function l(t){return"number"==typeof t&&Number(t)==t}function d(t){return"object"==typeof t&&null!==t}const u="__§§§__",p="__§§§§__";function c(t,e){const i=t.length;for(let s=0;s<i;++s)if(t[s]===e)return s;return-1}function g(t,e){const i=t.length;for(let s=0;s<i;++s)if(e(t[s]))return!0;return!1}function _(t,e){const i=t.length,s=new Array(i);for(let r=0;r<i;++r)s[r]=e(t[r],r);return s}function m(t,e){const i=t.length;for(let s=0;s<i;++s)e(t[s],s)}function f(t,e){let i=t.length;for(;i>0;)--i,e(t[i],i)}function b(t,e){const i=t.length;for(let s=0;s<i&&e(t[s],s);++s);}function v(t,e){let i=!1,s=0;for(;;){if(s=t.indexOf(e,s),-1===s)return i;i=!0,t.splice(s,1)}}function y(t,e){let i=t.indexOf(e);return-1!==i&&(t.splice(i,1),!0)}function w(t,e,i){let s=c(t,e);-1!==s&&k(t,s),null==i?t.push(e):x(t,i,e)}function P(t,e){-1===t.indexOf(e)&&t.push(e)}function D(t){const e=t.length,i=new Array(e);for(let s=0;s<e;++s)i[s]=t[s];return i}function x(t,e,i){t.splice(e,0,i)}function k(t,e){t.splice(e,1)}function O(t,e){const i=t.length;for(let s=0;s<i;++s)if(e(t[s],s))return s;return-1}function T(t,e){let i=t.length;for(;i>0;)if(--i,e(t[i],i))return i;return-1}function j(t,e){const i=O(t,e);if(-1!==i)return t[i]}function S(t,e){const i=T(t,e);if(-1!==i)return t[i]}function E(t,e){let i=0,s=t.length,r=!1;for(;i<s;){const a=i+s>>1,n=e(t[a]);n<0?i=a+1:0===n?(r=!0,i=a+1):s=a}return{found:r,index:r?i-1:i}}function C(t,e){let i=0,s=t.length,r=!1;for(;i<s;){const a=i+s>>1,n=e(t[a]);n<0?i=a+1:0===n?(r=!0,s=a):s=a}return{found:r,index:i}}function M(t,e){let i=t.length;for(;i>0;)--i,e(t[i])||t.splice(i,1)}class B{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class I{constructor(t){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=t}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class A extends B{constructor(){super(...arguments),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){m(this._disposers,(t=>{t.dispose()}))}}class H extends B{constructor(t){super(),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=t}_dispose(){m(this._disposers,(t=>{t.dispose()}))}get disposers(){return this._disposers}}class L extends I{constructor(){super(...arguments),Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new I((()=>{--this._counter,0===this._counter&&this.dispose()}))}}class N{constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const t=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{m(t,(t=>{t.disposer.dispose()}))}finally{this._killed=null,this._iterating=null}}}hasListeners(){return 0!==this._listeners.length}hasListenersByType(t){return g(this._listeners,(e=>(null===e.type||e.type===t)&&!e.killed))}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(t){delete this._disabled[t]}disableType(t,e=1/0){this._disabled[t]=e}_removeListener(t){if(0===this._iterating){const e=this._listeners.indexOf(t);if(-1===e)throw new Error("Invalid state: could not remove listener");this._listeners.splice(e,1)}else this._killed.push(t)}_removeExistingListener(t,e,i,s){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener((r=>{r.once!==t||r.type!==e||void 0!==i&&r.callback!==i||r.context!==s||r.disposer.dispose()}))}isEnabled(t){if(this._disposed)throw new Error("EventDispatcher is disposed");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(t)&&void 0===this._disabled[t]}removeType(t){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener((e=>{e.type===t&&e.disposer.dispose()}))}has(t,e,i){return-1!==O(this._listeners,(s=>!0!==s.once&&s.type===t&&(void 0===e||s.callback===e)&&s.context===i))}_shouldDispatch(t){if(this._disposed)throw new Error("EventDispatcher is disposed");const e=this._disabled[t];return l(e)?(e<=1?delete this._disabled[t]:--this._disabled[t],!1):this._enabled}_eachListener(t){++this._iterating;try{m(this._listeners,t)}finally{--this._iterating,0===this._iterating&&0!==this._killed.length&&(m(this._killed,(t=>{this._removeListener(t)})),this._killed.length=0)}}dispatch(t,e){this._shouldDispatch(t)&&this._eachListener((i=>{i.killed||null!==i.type&&i.type!==t||i.dispatch(t,e)}))}_on(t,e,i,s,r,a){if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(t,e,i,s);const n={type:e,callback:i,context:s,shouldClone:r,dispatch:a,killed:!1,once:t,disposer:new I((()=>{n.killed=!0,this._removeListener(n)}))};return this._listeners.push(n),n}onAll(t,e,i=!0){return this._on(!1,null,t,e,i,((i,s)=>t.call(e,s))).disposer}on(t,e,i,s=!0){return this._on(!1,t,e,i,s,((t,s)=>e.call(i,s))).disposer}once(t,e,i,s=!0){const r=this._on(!0,t,e,i,s,((t,s)=>{r.disposer.dispose(),e.call(i,s)}));return r.disposer}off(t,e,i){this._removeExistingListener(!1,t,e,i)}copyFrom(t){if(this._disposed)throw new Error("EventDispatcher is disposed");if(t===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");const e=[];return m(t._listeners,(t=>{!t.killed&&t.shouldClone&&(null===t.type?e.push(this.onAll(t.callback,t.context)):t.once?e.push(this.once(t.type,t.callback,t.context)):e.push(this.on(t.type,t.callback,t.context)))})),new H(e)}}function R(t,e){if(!(t>=0&&t<e))throw new Error("Index out of bounds: "+t)}class F{constructor(t=[]){Object.defineProperty(this,"_values",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new N}),this._values=t}get values(){return this._values}contains(t){return-1!==this._values.indexOf(t)}removeValue(t){let e=0,i=this._values.length;for(;e<i;)this._values[e]===t?(this.removeIndex(e),--i):++e}indexOf(t){return c(this._values,t)}get length(){return this._values.length}hasIndex(t){return t>=0&&t<this._values.length}getIndex(t){return this._values[t]}_onPush(t){this.events.isEnabled("push")&&this.events.dispatch("push",{type:"push",target:this,newValue:t})}_onInsertIndex(t,e){this.events.isEnabled("insertIndex")&&this.events.dispatch("insertIndex",{type:"insertIndex",target:this,index:t,newValue:e})}_onSetIndex(t,e,i){this.events.isEnabled("setIndex")&&this.events.dispatch("setIndex",{type:"setIndex",target:this,index:t,oldValue:e,newValue:i})}_onRemoveIndex(t,e){this.events.isEnabled("removeIndex")&&this.events.dispatch("removeIndex",{type:"removeIndex",target:this,index:t,oldValue:e})}_onMoveIndex(t,e,i){this.events.isEnabled("moveIndex")&&this.events.dispatch("moveIndex",{type:"moveIndex",target:this,oldIndex:t,newIndex:e,value:i})}_onClear(t){this.events.isEnabled("clear")&&this.events.dispatch("clear",{type:"clear",target:this,oldValues:t})}setIndex(t,e){R(t,this._values.length);const i=this._values[t];return i!==e&&(this._values[t]=e,this._onSetIndex(t,i,e)),i}insertIndex(t,e){return R(t,this._values.length+1),x(this._values,t,e),this._onInsertIndex(t,e),e}swap(t,e){const i=this._values.length;if(R(t,i),R(e,i),t!==e){const i=this._values[t],s=this._values[e];this._values[t]=s,this._onSetIndex(t,i,s),this._values[e]=i,this._onSetIndex(e,s,i)}}removeIndex(t){R(t,this._values.length);const e=this._values[t];return k(this._values,t),this._onRemoveIndex(t,e),e}moveValue(t,e){let i=this.indexOf(t);if(-1!==i)if(k(this._values,i),null==e){const e=this._values.length;this._values.push(t),this._onMoveIndex(i,e,t)}else x(this._values,e,t),this._onMoveIndex(i,e,t);else null==e?(this._values.push(t),this._onPush(t)):(x(this._values,e,t),this._onInsertIndex(e,t));return t}push(t){return this._values.push(t),this._onPush(t),t}unshift(t){return this.insertIndex(0,t),t}pushAll(t){m(t,(t=>{this.push(t)}))}copyFrom(t){this.pushAll(t._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(t){const e=this._values;this._values=[],this._onClear(e),m(t,(t=>{this._values.push(t),this._onPush(t)}))}clear(){this.setAll([])}*[Symbol.iterator](){const t=this._values.length;for(let e=0;e<t;++e)yield this._values[e]}each(t){m(this._values,t)}eachReverse(t){f(this._values,t)}}class W extends F{constructor(){super(...arguments),Object.defineProperty(this,"autoDispose",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_onSetIndex(t,e,i){this.autoDispose&&e.dispose(),super._onSetIndex(t,e,i)}_onRemoveIndex(t,e){this.autoDispose&&e.dispose(),super._onRemoveIndex(t,e)}_onClear(t){this.autoDispose&&m(t,(t=>{t.dispose()})),super._onClear(t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this.autoDispose&&m(this._values,(t=>{t.dispose()})))}}class V extends W{constructor(t,e){super(),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=t,this.make=e}}class K extends F{constructor(t){super(),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=t,this._events=this.events.onAll((t=>{if("clear"===t.type)m(t.oldValues,(t=>{this._onRemoved(t)}));else if("push"===t.type)this._onInserted(t.newValue);else if("setIndex"===t.type)this._onRemoved(t.oldValue),this._onInserted(t.newValue,t.index);else if("insertIndex"===t.type)this._onInserted(t.newValue,t.index);else if("removeIndex"===t.type)this._onRemoved(t.oldValue);else{if("moveIndex"!==t.type)throw new Error("Unknown IListEvent type");this._onRemoved(t.value),this._onInserted(t.value,t.newIndex)}}))}_onInserted(t,e){t._setParent(this._container,!0);const i=this._container._childrenDisplay;void 0===e?i.addChild(t._display):i.addChildAt(t._display,e)}_onRemoved(t){this._container._childrenDisplay.removeChild(t._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),m(this.values,(t=>{t.dispose()})))}}class U{constructor(t){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=t}get value(){return this._value/100}get percent(){return this._value}toString(){return this._value+"%"}interpolate(t,e){return t+this.value*(e-t)}static normalize(t,e,i){return t instanceof U?t:new U(e===i?0:100*Math.min(Math.max(1/(i-e)*(t-e),0),1))}}function z(t){return new U(t)}const G=z(0),Y=z(100),X=z(50);function $(t){return Object.keys(t)}function Z(t,e){return $(t).sort(e)}function J(t){return Object.assign({},t)}function q(t,e){$(t).forEach((i=>{e(i,t[i])}))}function Q(t,e){for(let i in t)if(tt(t,i)&&!e(i,t[i]))break}function tt(t,e){return{}.hasOwnProperty.call(t,e)}function et(t){t.parentNode&&t.parentNode.removeChild(t)}function it(t,e,i,s){return t.addEventListener(e,i,s||!1),new I((()=>{t.removeEventListener(e,i,s||!1)}))}function st(t){return it(window,"resize",(e=>{t()}))}function rt(t){switch(t){case"touchevents":return window.hasOwnProperty("TouchEvent");case"pointerevents":return window.hasOwnProperty("PointerEvent");case"mouseevents":return window.hasOwnProperty("MouseEvent");case"wheelevents":return window.hasOwnProperty("WheelEvent");case"keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function at(t){return t.pointerId||0}function nt(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let t=document.createElement("button");t.style.position="fixed",t.style.top="0px",t.style.left="-10000px",document.body.appendChild(t),t.focus(),t.blur(),document.body.removeChild(t)}}function ot(t){t&&t.focus()}function ht(t){if(rt("pointerevents"))return t;if(rt("touchevents"))switch(t){case"pointerover":case"pointerdown":return"touchstart";case"pointerout":case"pointerleave":case"pointerup":return"touchend";case"pointermove":return"touchmove";case"click":return"click";case"dblclick":return"dblclick"}else if(rt("mouseevents"))switch(t){case"pointerover":return"mouseover";case"pointerout":return"mouseout";case"pointerleave":return"mouseleave";case"pointerdown":return"mousedown";case"pointermove":return"mousemove";case"pointerup":return"mouseup";case"click":return"click";case"dblclick":return"dblclick"}return t}function lt(t){if("undefined"!=typeof Touch&&t instanceof Touch)return!0;if("undefined"!=typeof PointerEvent&&t instanceof PointerEvent&&null!=t.pointerType)switch(t.pointerType){case"touch":case"pen":case 2:return!0;case"mouse":case 4:return!1;default:return!(t instanceof MouseEvent)}else if(null!=t.type&&t.type.match(/^mouse/))return!1;return!0}function dt(t,e,i){t.style[e]=i}function ut(t,e){return t.style[e]}function pt(t){if(t.composedPath){const e=t.composedPath();return 0===e.length?null:e[0]}return t.target}function ct(t,e){let i=e;for(;;){if(t===i)return!0;if(null===i.parentNode){if(null==i.host)return!1;i=i.host}else i=i.parentNode}}function gt(t,e){return t.target&&ct(e.root.dom,t.target)}function _t(t,e){t.style.pointerEvents=e?"auto":"none"}function mt(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document}function ft(){return mt()?1:void 0}function bt(t,e){return l(t)?t:null!=t&&l(t.value)&&l(e)?e*t.value:0}function vt(t){let e=(""+t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function yt(t,e=0,i="0"){return"string"!=typeof t&&(t=t.toString()),e>t.length?Array(e-t.length+1).join(i)+t:t}function wt(t){return t.replace(/^[\s]*/,"")}function Pt(t){return t.replace(/[\s]*$/,"")}function Dt(t){return wt(Pt(t))}function xt(t){if(void 0===t)return"string";let e=(t=(t=(t=t.toLowerCase().replace(/^\[[^\]]*\]/,"")).replace(/\[[^\]]+\]/,"")).trim()).match(/\/(date|number|duration)$/);return e?e[1]:"number"===t?"number":"date"===t?"date":"duration"===t?"duration":t.match(/[#0]/)?"number":t.match(/[ymwdhnsqaxkzgtei]/)?"date":"string"}function kt(t){return t.replace(/\/(date|number|duration)$/i,"")}function Ot(t){return t?t.replace(/<[^>]*>/g,""):t}function Tt(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function jt(t,e=!1){const i=new Date(t.getFullYear(),0,0),s=t.getTime()-i.getTime()+60*(i.getTimezoneOffset()-t.getTimezoneOffset())*1e3,r=864e5;return Math.floor(s/r)}function St(t,e=!1){const i=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())),s=i.getUTCDay()||7;i.setUTCDate(i.getUTCDate()+4-s);const r=new Date(Date.UTC(i.getUTCFullYear(),0,1));return Math.ceil(((i.getTime()-r.getTime())/864e5+1)/7)}function Et(t,e=!1){const i=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())),s=i.getUTCDay()||7;i.setUTCDate(i.getUTCDate()+4-s);return new Date(Date.UTC(i.getUTCFullYear(),0,1)).getFullYear()}function Ct(t,e=!1){const i=St(new Date(t.getFullYear(),t.getMonth(),1),e);let s=St(t,e);return 1==s&&(s=53),s-i+1}function Mt(t,e,i=1,s=!1){let r=new Date(e,0,4,0,0,0,0);return s&&r.setUTCFullYear(e),7*t+i-((r.getDay()||7)+3)}function Bt(t,e){return t>12?t-=12:0===t&&(t=12),null!=e?t+(e-1):t}function It(t,e=!1,i=!1,s=!1){if(s)return e?"Coordinated Universal Time":"UTC";let r=t.toLocaleString("UTC"),a=t.toLocaleString("UTC",{timeZoneName:e?"long":"short"}).substr(r.length);return!1===i&&(a=a.replace(/ (standard|daylight|summer|winter) /i," ")),a}function At(t){const e=new Date(Date.UTC(2012,0,1,0,0,0,0)),i=new Date(e.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(e.toLocaleString("en-US",{timeZone:t})).getTime()-i.getTime())/6e4*-1}function Ht(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Lt(t){let e,i,s,r=t.h,a=t.s,n=t.l;if(0==a)e=i=s=n;else{let t=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t},o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=t(h,o,r+1/3),i=t(h,o,r),s=t(h,o,r-1/3)}return{r:Math.round(255*e),g:Math.round(255*i),b:Math.round(255*s)}}function Nt(t){let e=t.r/255,i=t.g/255,s=t.b/255,r=Math.max(e,i,s),a=Math.min(e,i,s),n=0,o=0,h=(r+a)/2;if(r===a)n=o=0;else{let t=r-a;switch(o=h>.5?t/(2-r-a):t/(r+a),r){case e:n=(i-s)/t+(i<s?6:0);break;case i:n=(s-e)/t+2;break;case s:n=(e-i)/t+4}n/=6}return{h:n,s:o,l:h}}function Rt(t,e){return t?{r:Math.max(0,Math.min(255,t.r+Ft(t.r,e))),g:Math.max(0,Math.min(255,t.g+Ft(t.g,e))),b:Math.max(0,Math.min(255,t.b+Ft(t.b,e))),a:t.a}:t}function Ft(t,e){let i=e>0?255-t:t;return Math.round(i*e)}function Wt(t,e){if(t){let i=Ft(Math.min(Math.max(t.r,t.g,t.b),230),e);return{r:Math.max(0,Math.min(255,Math.round(t.r+i))),g:Math.max(0,Math.min(255,Math.round(t.g+i))),b:Math.max(0,Math.min(255,Math.round(t.b+i))),a:t.a}}return t}function Vt(t){return(299*t.r+587*t.g+114*t.b)/1e3>=128}function Kt(t,e){if(void 0===t||1==e)return t;let i=Nt(t);return i.s=e,Lt(i)}function Ut(t,e={r:255,g:255,b:255},i={r:255,g:255,b:255}){let s=e,r=i;return Vt(i)&&(s=i,r=e),Vt(t)?r:s}function zt(t,e){return t||(t=[]),[...t,...e].filter(((t,e,i)=>i.indexOf(t)===e))}function Gt(t,e){return!!e&&(t.left==e.left&&(t.right==e.right&&(t.top==e.top&&t.bottom==e.bottom)))}function Yt(t){return"#"===t[0]&&(t=t.substr(1)),3==t.length&&(t=t[0].repeat(2)+t[1].repeat(2)+t[2].repeat(2)),parseInt(t,16)}function Xt(t){let e=(t=t.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(e)e.push("1");else if(e=t.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!e)return 0;let i="";for(let s=1;s<=3;s++){let t=parseInt(e[s]).toString(16);1==t.length&&(t="0"+t),i+=t}return Yt(i)}function $t(t){return Zt.fromAny(t)}class Zt{constructor(t){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=0|t}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return 255&this._hex}toCSS(t=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+t+")"}toCSSHex(){return"#"+yt(this.r.toString(16),2)+yt(this.g.toString(16),2)+yt(this.b.toString(16),2)}toHSL(t=1){return Nt({r:this.r,g:this.g,b:this.b,a:t})}static fromHSL(t,e,i){const s=Lt({h:t,s:e,l:i});return this.fromRGB(s.r,s.g,s.b)}toString(){return this.toCSSHex()}static fromHex(t){return new Zt(t)}static fromRGB(t,e,i){return new Zt((0|i)+(e<<8)+(t<<16))}static fromString(t){return new Zt(Yt(t))}static fromCSS(t){return new Zt(Xt(t))}static fromAny(t){if(h(t)){if("#"==t[0])return Zt.fromString(t);if("rgb"==t.substr(0,3))return Zt.fromCSS(t)}else{if(l(t))return Zt.fromHex(t);if(t instanceof Zt)return Zt.fromHex(t.hex)}throw new Error("Unknown color syntax: "+t)}static alternative(t,e,i){const s=Ut({r:t.r,g:t.g,b:t.b},e?{r:e.r,g:e.g,b:e.b}:void 0,i?{r:i.r,g:i.g,b:i.b}:void 0);return this.fromRGB(s.r,s.g,s.b)}static interpolate(t,e,i,s="rgb"){if("hsl"==s){const s=e.toHSL(),r=i.toHSL();return Zt.fromHSL(qt(t,s.h,r.h),qt(t,s.s,r.s),qt(t,s.l,r.l))}return Zt.fromRGB(qt(t,e.r,i.r),qt(t,e.g,i.g),qt(t,e.b,i.b))}static lighten(t,e){const i=Rt({r:t.r,g:t.g,b:t.b},e);return Zt.fromRGB(i.r,i.g,i.b)}static brighten(t,e){const i=Wt({r:t.r,g:t.g,b:t.b},e);return Zt.fromRGB(i.r,i.g,i.b)}static saturate(t,e){const i=Kt({r:t.r,g:t.g,b:t.b},e);return Zt.fromRGB(i.r,i.g,i.b)}}function Jt(e){return t(this,void 0,void 0,(function*(){if(void 0!==e){const t=[];q(e,((e,i)=>{t.push(i.waitForStop())})),yield Promise.all(t)}}))}function qt(t,e,i){return e+t*(i-e)}function Qt(t,e,i){return t>=1?i:e}function te(t,e,i){return new U(qt(t,e.percent,i.percent))}function ee(t,e,i){return Zt.interpolate(t,e,i)}function ie(t,e){return"number"==typeof t&&"number"==typeof e?qt:t instanceof U&&e instanceof U?te:t instanceof Zt&&e instanceof Zt?ee:Qt}const se=Math.PI,re=se/180,ae=180/se;function ne(t,e,i){if(!l(e)||e<=0){let e=Math.round(t);return i&&e-t==.5&&e--,e}{let i=Math.pow(10,e);return Math.round(t*i)/i}}function oe(t,e){if(!l(e)||e<=0)return Math.ceil(t);{let i=Math.pow(10,e);return Math.ceil(t*i)/i}}function he(t,e,i){return Math.min(Math.max(t,e),i)}function le(t){return Math.sin(re*t)}function de(t){return Math.cos(re*t)}function ue(t){return(t%=360)<0&&(t+=360),t}function pe(t,e,i,s,r){let a=Number.MAX_VALUE,n=Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=[];l.push(ce(r,i)),l.push(ce(r,s));let d=Math.min(90*Math.floor(i/90),90*Math.floor(s/90)),u=Math.max(90*Math.ceil(i/90),90*Math.ceil(s/90));for(let p=d;p<=u;p+=90)p>=i&&p<=s&&l.push(ce(r,p));for(let p=0;p<l.length;p++){let t=l[p];t.x<a&&(a=t.x),t.y<n&&(n=t.y),t.x>o&&(o=t.x),t.y>h&&(h=t.y)}return{left:t+a,top:e+n,right:t+o,bottom:e+h}}function ce(t,e){return{x:t*de(e),y:t*le(e)}}function ge(t){const e=t.length;if(e>0){let i=t[0],s=i.left,r=i.top,a=i.right,n=i.bottom;if(e>1)for(let o=1;o<e;o++)i=t[o],s=Math.min(i.left,s),a=Math.max(i.right,a),r=Math.min(i.top,r),n=Math.max(i.bottom,n);return{left:s,right:a,top:r,bottom:n}}return{left:0,right:0,top:0,bottom:0}}function _e(t){return t}function me(t){return t*t*t}function fe(t){return function(e){return 1-t(1-e)}}class be{constructor(t,e){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=t,this._settings=e,q(e,(t=>{this._userSettings[t]=!0}))}get(t,e){const i=this._settings[t];return void 0!==i?i:e}setRaw(t,e){this._settings[t]=e}set(t,e){this._userSettings[t]=!0,this.setRaw(t,e)}remove(t){delete this._userSettings[t],delete this._settings[t]}setAll(t){$(t).forEach((e=>{this.set(e,t[e])}))}_eachSetting(t){q(this._settings,t)}apply(){const t={stateAnimationEasing:!0,stateAnimationDuration:!0},e=this._entity.states.lookup("default");this._eachSetting(((i,s)=>{t[i]||(t[i]=!0,this!==e&&(i in e._settings||(e._settings[i]=this._entity.get(i))),this._entity.set(i,s))}))}applyAnimate(t){null==t&&(t=this._settings.stateAnimationDuration),null==t&&(t=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let e=this._settings.stateAnimationEasing;null==e&&(e=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",me)));const i=this._entity.states.lookup("default"),s={stateAnimationEasing:!0,stateAnimationDuration:!0},r={};return this._eachSetting(((a,n)=>{if(!s[a]){s[a]=!0,this!=i&&(a in i._settings||(i._settings[a]=this._entity.get(a)));const o=this._entity.animate({key:a,to:n,duration:t,easing:e});o&&(r[a]=o)}})),r}}class ve{constructor(t){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=t}lookup(t){return this._states[t]}create(t,e){const i=this._states[t];if(i)return i.setAll(e),i;{const i=new be(this._entity,e);return this._states[t]=i,i}}remove(t){delete this._states[t]}apply(t){const e=this._states[t];e&&e.apply(),this._entity._applyState(t)}applyAnimate(t,e){let i;const s=this._states[t];return s&&(i=s.applyAnimate(e)),this._entity._applyStateAnimated(t,e),i}}class ye{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.4.3"}),Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const we=new ye;function Pe(t){we.licenses.push(t)}function De(t,e){return t===e?0:t<e?-1:1}function xe(t,e,i){const s=t.length,r=e.length,a=Math.min(s,r);for(let n=0;n<a;++n){const s=i(t[n],e[n]);if(0!==s)return s}return De(s,r)}function ke(t,e){return t===e?0:t<e?-1:1}class Oe{constructor(t){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=t}add(t,e){let i=this._callbacks[t];return void 0===i&&(i=this._callbacks[t]=[]),i.push(e),this._entity._markDirtyKey(t),new I((()=>{y(i,e)&&this._entity._markDirtyKey(t)}))}remove(t){const e=this._callbacks[t];void 0!==e&&(delete this._callbacks[t],0!==e.length&&this._entity._markDirtyKey(t))}enable(t){this._disabled[t]&&(delete this._disabled[t],this._entity._markDirtyKey(t))}disable(t){this._disabled[t]||(this._disabled[t]=!0,this._entity._markDirtyKey(t))}fold(t,e){if(!this._disabled[t]){const i=this._callbacks[t];if(void 0!==i)for(let s=0,r=i.length;s<r;++s)e=i[s](e,this._entity,t)}return e}}class Te{constructor(t,e,i,s,r,a,n){Object.defineProperty(this,"_animation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_from",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_to",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_duration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_easing",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_loops",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_interpolate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_oldTime",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_time",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_stopped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_playing",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new N}),this._animation=t,this._from=e,this._to=i,this._duration=s,this._easing=r,this._loops=a,this._interpolate=ie(e,i),this._oldTime=n}get to(){return this._to}get from(){return this._from}get playing(){return this._playing}get stopped(){return this._stopped}stop(){this._stopped||(this._stopped=!0,this._playing=!1,this.events.isEnabled("stopped")&&this.events.dispatch("stopped",{type:"stopped",target:this}))}pause(){this._playing=!1,this._oldTime=null}play(){this._stopped||this._playing||(this._playing=!0,this._animation._startAnimation())}get percentage(){return this._time/this._duration}waitForStop(){return new Promise(((t,e)=>{if(this._stopped)t();else{const e=()=>{i.dispose(),t()},i=this.events.on("stopped",e)}}))}_checkEnded(){return!(this._loops>1)||(--this._loops,!1)}_run(t){null!==this._oldTime&&(this._time+=t-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=t}_reset(t){this._oldTime=t,this._time=0}_value(t){return this._interpolate(this._easing(t),this._from,this._to)}}let je=0;class Se{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++je}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._settings=t}_checkDirty(){$(this._settings).forEach((t=>{this._userProperties[t]=!0,this._markDirtyKey(t)}))}resetUserSettings(){this._userProperties={}}_runAnimation(t){if(this.isDisposed())return!1;{let e=!1;return q(this._animatingSettings,((i,s)=>{if(s._stopped)this._stopAnimation(i);else if(s._playing){s._run(t);const r=s.percentage;r>=1?s._checkEnded()?this.set(i,s._value(1)):(e=!0,s._reset(t),this._set(i,s._value(1))):(e=!0,this._set(i,s._value(r)))}})),q(this._animatingPrivateSettings,((i,s)=>{if(s._stopped)this._stopAnimationPrivate(i);else if(s._playing){s._run(t);const r=s.percentage;r>=1?s._checkEnded()?this.setPrivate(i,s._value(1)):(e=!0,s._reset(t),this._setPrivate(i,s._value(1))):(e=!0,this._setPrivate(i,s._value(r)))}})),e}}_markDirtyKey(t){this.markDirty()}_markDirtyPrivateKey(t){this.markDirty()}on(t,e){let i=this._settingEvents[t];return void 0===i&&(i=this._settingEvents[t]=[]),i.push(e),new I((()=>{y(i,e),0===i.length&&delete this._settingEvents[t]}))}onPrivate(t,e){let i=this._privateSettingEvents[t];return void 0===i&&(i=this._privateSettingEvents[t]=[]),i.push(e),new I((()=>{y(i,e),0===i.length&&delete this._privateSettingEvents[t]}))}getRaw(t,e){const i=this._settings[t];return void 0!==i?i:e}get(t,e){return this.getRaw(t,e)}_sendKeyEvent(t,e){const i=this._settingEvents[t];void 0!==i&&m(i,(i=>{i(e,this,t)}))}_sendPrivateKeyEvent(t,e){const i=this._privateSettingEvents[t];void 0!==i&&m(i,(i=>{i(e,this,t)}))}_setRaw(t,e,i){this._prevSettings[t]=e,this._sendKeyEvent(t,i)}setRaw(t,e){const i=this._settings[t];this._settings[t]=e,i!==e&&this._setRaw(t,i,e)}_set(t,e){const i=this._settings[t];this._settings[t]=e,i!==e&&(this._setRaw(t,i,e),this._markDirtyKey(t))}_stopAnimation(t){const e=this._animatingSettings[t];e&&(delete this._animatingSettings[t],e.stop())}set(t,e){return this._set(t,e),this._stopAnimation(t),e}remove(t){t in this._settings&&(this._prevSettings[t]=this._settings[t],delete this._settings[t],this._sendKeyEvent(t,void 0),this._markDirtyKey(t)),this._stopAnimation(t)}removeAll(){m($(this._settings),(t=>{this.remove(t)}))}getPrivate(t,e){const i=this._privateSettings[t];return void 0!==i?i:e}_setPrivateRaw(t,e,i){this._prevPrivateSettings[t]=e,this._sendPrivateKeyEvent(t,i)}setPrivateRaw(t,e){const i=this._privateSettings[t];this._privateSettings[t]=e,i!==e&&this._setPrivateRaw(t,i,e)}_setPrivate(t,e){const i=this._privateSettings[t];this._privateSettings[t]=e,i!==e&&(this._setPrivateRaw(t,i,e),this._markDirtyPrivateKey(t))}_stopAnimationPrivate(t){const e=this._animatingPrivateSettings[t];e&&(e.stop(),delete this._animatingPrivateSettings[t])}setPrivate(t,e){return this._setPrivate(t,e),this._stopAnimationPrivate(t),e}removePrivate(t){t in this._privateSettings&&(this._prevPrivateSettings[t]=this._privateSettings[t],delete this._privateSettings[t],this._markDirtyPrivateKey(t)),this._stopAnimationPrivate(t)}setAll(t){q(t,((t,e)=>{this.set(t,e)}))}animate(t){const e=t.key,i=t.to,s=t.duration||0,r=t.loops||1,a=void 0===t.from?this.get(e):t.from,n=void 0===t.easing?_e:t.easing;if(0===s)this.set(e,i);else{if(void 0!==a&&a!==i){this.set(e,a);const t=this._animatingSettings[e]=new Te(this,a,i,s,n,r,this._animationTime());return this._startAnimation(),t}this.set(e,i)}const o=new Te(this,a,i,s,n,r,null);return o.stop(),o}animatePrivate(t){const e=t.key,i=t.to,s=t.duration||0,r=t.loops||1,a=void 0===t.from?this.getPrivate(e):t.from,n=void 0===t.easing?_e:t.easing;if(0===s)this.setPrivate(e,i);else{if(void 0!==a&&a!==i){this.setPrivate(e,a);const t=this._animatingPrivateSettings[e]=new Te(this,a,i,s,n,r,this._animationTime());return this._startAnimation(),t}this.setPrivate(e,i)}const o=new Te(this,a,i,s,n,r,null);return o.stop(),o}_dispose(){}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Ee extends Se{constructor(t,e,i,s=[]){if(super(e),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new ve(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Oe(this)}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,"_userPrivateProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=t,this._internalTemplates=s,e.id&&this._registerId(e.id)}static new(t,e,i){const s=new this(t,e,!0);return s._template=i,s._afterNew(),s}static _new(t,e,i=[]){const s=new this(t,e,!0,i);return s._afterNew(),s}_afterNew(){this._checkDirty();let t=!1;const e=this._template;e&&(t=!0,e._setObjectTemplate(this)),m(this._internalTemplates,(e=>{t=!0,e._setObjectTemplate(this)})),t&&this._applyTemplates(!1),this.states.create("default",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const t=this._template;t&&t._setObjectTemplate(this),m(this._internalTemplates,(t=>{t._setObjectTemplate(this)})),this.states.create("default",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new N}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefault(t,e){t in this._settings||super.set(t,e)}_setRawDefault(t,e){t in this._settings||super.setRaw(t,e)}_clearDirty(){$(this._dirty).forEach((t=>{this._dirty[t]=!1})),$(this._dirtyPrivate).forEach((t=>{this._dirtyPrivate[t]=!1}))}isDirty(t){return!!this._dirty[t]}isPrivateDirty(t){return!!this._dirtyPrivate[t]}_markDirtyKey(t){this._dirty[t]=!0,super._markDirtyKey(t)}_markDirtyPrivateKey(t){this._dirtyPrivate[t]=!0,super._markDirtyKey(t)}isType(t){return-1!==this.classNames.indexOf(t)}_pushPropertyDisposer(t,e){let i=this._disposerProperties[t];return void 0===i&&(i=this._disposerProperties[t]=[]),i.push(e),e}_disposeProperty(t){const e=this._disposerProperties[t];void 0!==e&&(m(e,(t=>{t.dispose()})),delete this._disposerProperties[t])}set template(t){const e=this._template;e!==t&&(this._template=t,e&&e._removeObjectTemplate(this),t&&t._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(t){}_applyStateAnimated(t,e){}get(t,e){const i=this.adapters.fold(t,this._settings[t]);return void 0!==i?i:e}isUserSetting(t){return this._userProperties[t]||!1}set(t,e){return this._userProperties[t]=!0,super.set(t,e)}setRaw(t,e){this._userProperties[t]=!0,super.setRaw(t,e)}_setSoft(t,e){return this._userProperties[t]?e:super.set(t,e)}remove(t){delete this._userProperties[t],this._removeTemplateProperty(t)}setPrivate(t,e){return this._userPrivateProperties[t]=!0,super.setPrivate(t,e)}setPrivateRaw(t,e){this._userPrivateProperties[t]=!0,super.setPrivateRaw(t,e)}removePrivate(t){delete this._userPrivateProperties[t],this._removeTemplatePrivateProperty(t)}_setTemplateProperty(t,e,i){if(!this._userProperties[e]){t===this._findTemplateByKey(e)&&super.set(e,i)}}_setTemplatePrivateProperty(t,e,i){if(!this._userPrivateProperties[e]){t===this._findTemplateByPrivateKey(e)&&super.setPrivate(e,i)}}_removeTemplateProperty(t){if(!this._userProperties[t]){const e=this._findTemplateByKey(t);e?super.set(t,e._settings[t]):super.remove(t)}}_removeTemplatePrivateProperty(t){if(!this._userPrivateProperties[t]){const e=this._findTemplateByPrivateKey(t);e?super.setPrivate(t,e._privateSettings[t]):super.removePrivate(t)}}_walkParents(t){t(this._root._rootContainer),t(this)}_applyStateByKey(t){const e=this.states.create(t,{}),i={};this._eachTemplate((s=>{const r=s.states.lookup(t);r&&r._apply(e,i)})),q(e._settings,(t=>{i[t]||e._userSettings[t]||e.remove(t)}))}_applyTemplate(t,e){this._templateDisposers.push(t._apply(this,e)),q(t._settings,((t,i)=>{e.settings[t]||this._userProperties[t]||(e.settings[t]=!0,super.set(t,i))})),q(t._privateSettings,((t,i)=>{e.privateSettings[t]||this._userPrivateProperties[t]||(e.privateSettings[t]=!0,super.setPrivate(t,i))})),this._runSetup&&t.setup&&(this._runSetup=!1,t.setup(this))}_findStaticTemplate(t){if(this._template&&t(this._template))return this._template}_eachTemplate(t){this._findStaticTemplate((e=>(t(e),!1))),f(this._internalTemplates,t),m(this._templates,t)}_applyTemplates(t=!0){t&&this._disposeTemplates();const e={settings:{},privateSettings:{},states:{}};this._eachTemplate((t=>{this._applyTemplate(t,e)})),t&&(q(this._settings,(t=>{this._userProperties[t]||e.settings[t]||super.remove(t)})),q(this._privateSettings,(t=>{this._userPrivateProperties[t]||e.privateSettings[t]||super.removePrivate(t)})))}_findTemplate(t){const e=this._findStaticTemplate(t);if(void 0===e){const e=S(this._internalTemplates,t);return void 0===e?j(this._templates,t):e}return e}_findTemplateByKey(t){return this._findTemplate((e=>t in e._settings))}_findTemplateByPrivateKey(t){return this._findTemplate((e=>t in e._privateSettings))}_disposeTemplates(){m(this._templateDisposers,(t=>{t.dispose()})),this._templateDisposers.length=0}_removeTemplates(){m(this._templates,(t=>{t._removeObjectTemplate(this)})),this._templates.length=0}_applyThemes(){let t=!1;const e=[];let i=[];const s=new Set,r=this.get("themeTagsSelf");return r&&m(r,(t=>{s.add(t)})),this._walkParents((r=>{r===this._root._rootContainer&&(t=!0),r._defaultThemes.length>0&&e.push(r._defaultThemes);const a=r.get("themes");a&&i.push(a);const n=r.get("themeTags");n&&m(n,(t=>{s.add(t)}))})),i=e.concat(i),this._removeTemplates(),t&&f(this.classNames,(t=>{const e=[];m(i,(i=>{m(i,(i=>{const r=i._lookupRules(t);r&&f(r,(t=>{if(t.tags.every((t=>s.has(t)))){const i=C(e,(e=>{const i=De(t.tags.length,e.tags.length);return 0===i?xe(t.tags,e.tags,De):i}));e.splice(i.index,0,t)}}))}))})),m(e,(t=>{this._templates.push(t.template),t.template._setObjectTemplate(this)}))})),this._applyTemplates(),t&&(this._runSetup=!1),t}_changed(){}_beforeChanged(){if(this.isDirty("id")){const t=this.get("id");t&&this._registerId(t);const e=this._prevSettings.id;e&&delete we.entitiesById[e]}}_registerId(t){if(we.entitiesById[t]&&we.entitiesById[t]!==this)throw new Error('An entity with id "'+t+'" already exists.');we.entitiesById[t]=this}_afterChanged(){}addDisposer(t){return this._disposers.push(t),t}_dispose(){super._dispose();const t=this._template;t&&t._removeObjectTemplate(this),m(this._internalTemplates,(t=>{t._removeObjectTemplate(this)})),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach((t=>{t.dispose()})),q(this._disposerProperties,((t,e)=>{m(e,(t=>{t.dispose()}))}));const e=this.get("id");e&&delete we.entitiesById[e]}setTimeout(t,e){const i=setTimeout((()=>{this.removeDispose(s),t()}),e),s=new I((()=>{clearTimeout(i)}));return this._disposers.push(s),s}removeDispose(t){if(!this.isDisposed()){let e=c(this._disposers,t);e>-1&&this._disposers.splice(e,1)}t.dispose()}hasTag(t){return-1!==c(this.get("themeTags",[]),t)}addTag(t){if(!this.hasTag(t)){const e=this.get("themeTags",[]);e.push(t),this.set("themeTags",e)}}removeTag(t){if(this.hasTag(t)){const e=this.get("themeTags",[]);v(e,t),this.set("themeTags",e)}}_t(t,e,...i){return this._root.language.translate(t,e,...i)}get root(){return this._root}}Object.defineProperty(Ee,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"}),Object.defineProperty(Ee,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});class Ce{constructor(t,e,i){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=t,this._template=e,this._settings=i}get(t,e){const i=this._settings[t];return void 0!==i?i:e}set(t,e){this._settings[t]=e,this._template._stateChanged(this._name)}remove(t){delete this._settings[t],this._template._stateChanged(this._name)}setAll(t){$(t).forEach((e=>{this._settings[e]=t[e]})),this._template._stateChanged(this._name)}_apply(t,e){q(this._settings,((i,s)=>{e[i]||t._userSettings[i]||(e[i]=!0,t.setRaw(i,s))}))}}class Me{constructor(t){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=t}lookup(t){return this._states[t]}create(t,e){const i=this._states[t];if(i)return i.setAll(e),i;{const i=new Ce(t,this._template,e);return this._states[t]=i,this._template._stateChanged(t),i}}remove(t){delete this._states[t],this._template._stateChanged(t)}_apply(t,e){q(this._states,((i,s)=>{let r=e.states[i];null==r&&(r=e.states[i]={});const a=t.states.create(i,{});s._apply(a,r)}))}}class Be{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(t,e){let i=this._callbacks[t];return void 0===i&&(i=this._callbacks[t]=[]),i.push(e),new I((()=>{y(i,e),0===i.length&&delete this._callbacks[t]}))}remove(t){void 0!==this._callbacks[t]&&delete this._callbacks[t]}_apply(t){const e=[];return q(this._callbacks,((i,s)=>{m(s,(s=>{e.push(t.adapters.add(i,s))}))})),new H(e)}}class Ie{constructor(t,e){if(Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Me(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Be}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new N}),Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=t}static new(t){return new Ie(t,!0)}get entities(){return this._entities}get(t,e){const i=this._settings[t];return void 0!==i?i:e}setRaw(t,e){this._settings[t]=e}set(t,e){this._settings[t]!==e&&(this.setRaw(t,e),this._entities.forEach((i=>{i._setTemplateProperty(this,t,e)})))}remove(t){t in this._settings&&(delete this._settings[t],this._entities.forEach((e=>{e._removeTemplateProperty(t)})))}removeAll(){q(this._settings,((t,e)=>{this.remove(t)}))}getPrivate(t,e){const i=this._privateSettings[t];return void 0!==i?i:e}setPrivateRaw(t,e){return this._privateSettings[t]=e,e}setPrivate(t,e){return this._privateSettings[t]!==e&&(this.setPrivateRaw(t,e),this._entities.forEach((i=>{i._setTemplatePrivateProperty(this,t,e)}))),e}removePrivate(t){t in this._privateSettings&&(delete this._privateSettings[t],this._entities.forEach((e=>{e._removeTemplatePrivateProperty(t)})))}setAll(t){q(t,((t,e)=>{this.set(t,e)}))}on(t,e){let i=this._settingEvents[t];return void 0===i&&(i=this._settingEvents[t]=[]),i.push(e),new I((()=>{y(i,e),0===i.length&&delete this._settingEvents[t]}))}onPrivate(t,e){let i=this._privateSettingEvents[t];return void 0===i&&(i=this._privateSettingEvents[t]=[]),i.push(e),new I((()=>{y(i,e),0===i.length&&delete this._privateSettingEvents[t]}))}_apply(t,e){const i=[];return q(this._settingEvents,((e,s)=>{m(s,(s=>{i.push(t.on(e,s))}))})),q(this._privateSettingEvents,((e,s)=>{m(s,(s=>{i.push(t.onPrivate(e,s))}))})),this.states._apply(t,e),i.push(this.adapters._apply(t)),i.push(t.events.copyFrom(this.events)),new H(i)}_setObjectTemplate(t){this._entities.push(t)}_removeObjectTemplate(t){v(this._entities,t)}_stateChanged(t){this._entities.forEach((e=>{e._applyStateByKey(t)}))}}class Ae extends N{constructor(t){super(),Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=t}_makePointerEvent(t,e){return{type:t,originalEvent:e.event,point:e.point,simulated:e.simulated,native:e.native,target:this._sprite}}_onRenderer(t,e){this._sprite.set("interactive",!0),this._sprite._display.interactive=!0;let i=this._rendererDisposers[t];if(void 0===i){const s=this._sprite._display.on(t,(t=>{e.call(this,t)}));i=this._rendererDisposers[t]=new L((()=>{delete this._rendererDisposers[t],s.dispose()}))}return i.increment()}_on(t,e,i,s,r,a){const n=super._on(t,e,i,s,r,a),o=Ae.RENDERER_EVENTS[e];return void 0!==o&&(n.disposer=new H([n.disposer,this._onRenderer(e,o)])),n}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(t,e){const i=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(t,e),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(t,e)}finally{this._dispatchParents=i}}}Object.defineProperty(Ae,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(t){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",t))&&this.dispatch("click",this._makePointerEvent("click",t))},rightclick:function(t){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",t))},middleclick:function(t){this.isEnabled("middleclick")&&this.dispatch("middleclick",this._makePointerEvent("middleclick",t))},dblclick:function(t){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",t))},pointerover:function(t){this.isEnabled("pointerover")&&this.dispatch("pointerover",this._makePointerEvent("pointerover",t))},pointerout:function(t){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",t))},pointerdown:function(t){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",t))},pointerup:function(t){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",t))},globalpointerup:function(t){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",this._makePointerEvent("globalpointerup",t))},globalpointermove:function(t){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",t))},wheel:function(t){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:t.event,point:t.point})}}});class He extends Ee{constructor(){super(...arguments),Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0),super._afterNew()}_markDirtyKey(t){super._markDirtyKey(t),"x"!=t&&"y"!=t&&"dx"!=t&&"dy"!=t||(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(t){super._markDirtyPrivateKey(t),"x"!=t&&"y"!=t||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new Ae(this)}_processTemplateField(){let t;const e=this.get("templateField");if(e){const i=this.dataItem;if(i){const s=i.dataContext;s&&(t=s[e],t instanceof Ie||!t||(t=Ie.new(t)))}}this._templateField!==t&&(this._removeTemplateField(),this._templateField=t,t&&t._setObjectTemplate(this),this._applyTemplates())}_setDataItem(t){const e=this._dataItem;this._dataItem=t,this._processTemplateField();const i="dataitemchanged";t!=e&&this.events.isEnabled(i)&&this.events.dispatch(i,{type:i,target:this,oldDataItem:e,newDataItem:t})}set dataItem(t){this._setDataItem(t)}get dataItem(){if(this._dataItem)return this._dataItem;{let t=this._parent;for(;t;){if(t._dataItem)return t._dataItem;t=t._parent}}}_addPercentageSizeChildren(){let t=this.parent;t&&(this.get("width")instanceof U||this.get("height")instanceof U?P(t._percentageSizeChildren,this):y(t._percentageSizeChildren,this))}_addPercentagePositionChildren(){let t=this.parent;t&&(this.get("x")instanceof U||this.get("y")instanceof U?P(t._percentagePositionChildren,this):y(t._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const t=this._localBounds;if(t){const e=this.get("centerX");null!=e&&(this._display.pivot.x=t.left+bt(e,t.right-t.left));const i=this.get("centerY");null!=i&&(this._display.pivot.y=t.top+bt(i,t.bottom-t.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty("tooltip")){const t=this._prevSettings.tooltip;t&&t.dispose()}if((this.isDirty("layer")||this.isDirty("layerMargin"))&&(this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer()),this.isDirty("tooltipPosition")){const t=this._tooltipMoveDp;t&&(t.dispose(),this._tooltipMoveDp=void 0);const e=this._tooltipPointerDp;e&&(e.dispose(),this._tooltipPointerDp=void 0),"pointer"==this.get("tooltipPosition")&&(this.isHover()&&(this._tooltipMoveDp=this.events.on("globalpointermove",(t=>{this.showTooltip(t.point)}))),this._tooltipPointerDp=new H([this.events.on("pointerover",(()=>{this._tooltipMoveDp=this.events.on("globalpointermove",(t=>{this.showTooltip(t.point)}))})),this.events.on("pointerout",(()=>{const t=this._tooltipMoveDp;t&&(t.dispose(),this._tooltipMoveDp=void 0)}))]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const t=this._display,e=this.events;if(this.isDirty("draggable")){const i=this.get("draggable");i?(this.set("interactive",!0),this._dragDp=new H([e.on("pointerdown",(t=>{this.dragStart(t)})),e.on("globalpointermove",(t=>{this.dragMove(t)})),e.on("globalpointerup",(t=>{this.dragStop(t)}))])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),t.cancelTouch=!!i}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){const t=this.get("tooltipText"),i=this.get("tooltipHTML"),s=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(t||i)&&("click"==s?(this._tooltipDp=new H([e.on("click",(()=>{this.setTimeout((()=>this.showTooltip()),10)})),it(document,"click",(t=>{this.hideTooltip()}))]),this._disposers.push(this._tooltipDp)):"always"==s||(this._tooltipDp=new H([e.on("pointerover",(()=>{this.showTooltip()})),e.on("pointerout",(()=>{this.hideTooltip()}))]),this._disposers.push(this._tooltipDp)))}if(this.isDirty("toggleKey")){let t=this.get("toggleKey");t&&"none"!=t?this._toggleDp=e.on("click",(()=>{this._isDragging||this.set(t,!this.get(t))})):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty("opacity")&&(t.alpha=Math.max(0,this.get("opacity",1))),this.isDirty("rotation")&&(this.markDirtyBounds(),t.angle=this.get("rotation",0)),this.isDirty("scale")&&(this.markDirtyBounds(),t.scale=this.get("scale",0)),(this.isDirty("centerX")||this.isDirty("centerY"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden")||this.isDirty("opacity"))&&(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")&&0!=this.get("opacity")?t.visible=!0:(t.visible=!1,this.hideTooltip()),this.markDirtyBounds(),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("width")||this.isDirty("height")){this.markDirtyBounds(),this._addPercentageSizeChildren();const t=this.parent;t&&(this.isDirty("width")&&this.get("width")instanceof U||this.isDirty("height")&&this.get("height")instanceof U)&&(t.markDirty(),t._prevWidth=0),this._sizeDirty=!0}if((this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty("wheelable")){const e=this.get("wheelable");e&&this.set("interactive",!0),t.wheelable=!!e}if((this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty("filter")&&(t.filter=this.get("filter")),this.isDirty("cursorOverStyle")&&(t.cursorOverStyle=this.get("cursorOverStyle")),this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new H([e.on("focus",(()=>{this.showTooltip()})),e.on("blur",(()=>{this.hideTooltip()}))]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility()),this.isPrivateDirty("focusable")&&this.markDirtyAccessibility(),(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||this.isDirty("ariaControls"))&&this.markDirtyAccessibility(),this.isDirty("exportable")&&(t.exportable=this.get("exportable")),this.isDirty("interactive")){const t=this.events;this.get("interactive")?this._hoverDp=new H([t.on("click",(t=>{lt(t.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout((()=>{this._handleOver(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip(),this.setPrivateRaw("touchHovering",!0),this.events.dispatch("pointerover",{type:"pointerover",target:t.target,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}),10))})),t.on("globalpointerup",(t=>{lt(t.originalEvent)&&this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip(),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:t.target,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})),this._isDown&&this._handleUp(t)})),t.on("pointerover",(()=>{this._handleOver()})),t.on("pointerout",(()=>{this._handleOut()})),t.on("pointerdown",(t=>{this._handleDown(t)}))]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",!1)),"always"==this.get("showTooltipOn")&&this._display.visible&&this.showTooltip()}dragStart(t){this._dragEvent=t,this.events.stopParentDispatch()}dragStop(t){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const e="dragstop";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleUp(t){if(!this.isHidden()){this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0;const e=at(t.originalEvent);delete this._downPoints[e],0==$(this._downPoints).length&&(this._isDown=!1)}}_hasMoved(t){const e=at(t.originalEvent),i=this._downPoints[e];if(i){const e=Math.abs(i.x-t.point.x),s=Math.abs(i.y-t.point.y);return e>5||s>5}return!1}_hasDown(){return $(this._downPoints).length>0}_handleDown(t){const e=this.parent;if(e&&!this.get("draggable")&&e._handleDown(t),this.get("interactive")&&!this.isHidden()){this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:t.point.x,y:t.point.y},this._isDown=!0;const e=at(t.originalEvent);this._downPoints[e]={x:t.point.x,y:t.point.y}}}dragMove(t){let e=this._dragEvent;if(e){if(e.simulated&&!t.simulated)return!0;let i=0,s=this.parent;for(;null!=s;)i+=s.get("rotation",0),s=s.parent;let r=t.point.x-e.point.x,a=t.point.y-e.point.y;const n=this.events;if(e.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const e="dragstart";n.isEnabled(e)&&n.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}if(this._isDragging){let e=this._dragPoint;this.set("x",e.x+r*de(i)+a*le(i)),this.set("y",e.y+a*de(i)-r*le(i));const s="dragged";n.isEnabled(s)&&n.dispatch(s,{type:s,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}else if(Math.hypot(r,a)>5){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const e="dragstart";n.isEnabled(e)&&n.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let t=this.parent,e=0;for(;;){if(!t)return e;++e,t=t.parent}}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){const t=this._display;if(this.get("isMeasured")){this._root._addDirtyBounds(this),t.isMeasured=!0,t.invalidateBounds();const e=this.parent;e&&"absolute"!=this.get("position")&&(null==e.get("width")||null==e.get("height")||e.get("layout"))&&e.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const t=this._adjustedLocalBounds;let e;if(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),e=this._adjustedLocalBounds):(e={left:0,right:0,top:0,bottom:0},this._localBounds=e,this._adjustedLocalBounds=e),!t||t.left!==e.left||t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom){const t="boundschanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds())}}_fixMinBounds(t){let e=this.get("minWidth",this.getPrivate("minWidth")),i=this.get("minHeight",this.getPrivate("minHeight"));l(e)&&t.right-t.left<e&&(t.right=t.left+e),l(i)&&t.bottom-t.top<i&&(t.bottom=t.top+i);let s=this.getPrivate("width"),r=this.getPrivate("height");l(s)&&(s>0?t.right=t.left+s:t.left=t.right+s),l(r)&&(r>0?t.bottom=t.top+r:t.top=t.bottom+r)}_removeParent(t){t&&(t.children.removeValue(this),y(t._percentageSizeChildren,this),y(t._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.showTooltip(),this._handleOver()}unhover(){this.hideTooltip(),this._handleOut()}showTooltip(t){const e=this.getTooltip(),i=this.get("tooltipText"),s=this.get("tooltipHTML");if((i||s)&&e){const r=this.get("tooltipPosition"),a=this.getPrivate("tooltipTarget",this);"fixed"!=r&&t||(this._display._setMatrix(),t=this.toGlobal(a._getTooltipPoint())),e.set("pointTo",t),e.set("tooltipTarget",a),e.get("x")||e.set("x",t.x),e.get("y")||e.set("y",t.y),i&&e.label.set("text",i),s&&e.label.set("html",s);const n=this.dataItem;if(n&&e.label._setDataItem(n),"always"==this.get("showTooltipOn")&&(t.x<0||t.x>this._root.width()||t.y<0||t.y>this._root.height()))return void this.hideTooltip();e.label.text.markDirtyText();const o=e.show();return this.setPrivateRaw("showingTooltip",!0),o}}hideTooltip(){const t=this.getTooltip();if(t&&(t.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)||this.get("tooltip")==t)){let e=t.get("keepTargetHover")&&0==t.get("stateAnimationDuration",0)?400:void 0;const i=t.hide(e);return this.setPrivateRaw("showingTooltip",!1),i}}_getTooltipPoint(){const t=this._localBounds;if(t){let e=0,i=0;return this.get("isMeasured")?(e=t.left+bt(this.get("tooltipX",0),t.right-t.left),i=t.top+bt(this.get("tooltipY",0),t.bottom-t.top)):(e=bt(this.get("tooltipX",0),this.width()),i=bt(this.get("tooltipY",0),this.height())),{x:e,y:i}}return{x:0,y:0}}getTooltip(){let t=this.get("tooltip");if(t)return t;{let t=this.parent;if(t)return t.getTooltip()}}_updatePosition(){const t=this.parent;let e=this.get("dx",0),i=this.get("dy",0),s=this.get("x"),r=this.getPrivate("x"),a=0,n=0;const o=this.get("position");s instanceof U&&(s=t?t.innerWidth()*s.value+t.get("paddingLeft",0):0),l(s)?a=s+e:null!=r?a=r:t&&"relative"==o&&(a=t.get("paddingLeft",0)+e);let h=this.get("y"),d=this.getPrivate("y");h instanceof U&&(h=t?t.innerHeight()*h.value+t.get("paddingTop",0):0),l(h)?n=h+i:null!=d?n=d:t&&"relative"==o&&(n=t.get("paddingTop",0)+i);const u=this._display;if(u.x!=a||u.y!=n){u.invalidateBounds(),u.x=a,u.y=n;const t="positionchanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let t=this.get("x"),e=this.getPrivate("x");const i=this.parent;return i?t instanceof U?bt(t,i.innerWidth())+i.get("paddingLeft",0):l(t)?t:null!=e?e:i.get("paddingLeft",this._display.x):this._display.x}y(){let t=this.getPrivate("y");if(null!=t)return t;let e=this.get("y");const i=this.parent;return i?e instanceof U?bt(e,i.innerHeight())+i.get("paddingTop",0):l(e)?e:null!=t?t:i.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const t=this.get("tooltip");t&&t.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const t=this._adjustedLocalBounds,e=this.x(),i=this.y();return{left:t.left+e,right:t.right+e,top:t.top+i,bottom:t.bottom+i}}globalBounds(){const t=this.localBounds(),e=this.toGlobal({x:t.left,y:t.top}),i=this.toGlobal({x:t.right,y:t.top}),s=this.toGlobal({x:t.right,y:t.bottom}),r=this.toGlobal({x:t.left,y:t.bottom});return{left:Math.min(e.x,i.x,s.x,r.x),top:Math.min(e.y,i.y,s.y,r.y),right:Math.max(e.x,i.x,s.x,r.x),bottom:Math.max(e.y,i.y,s.y,r.y)}}_onShow(t){}_onHide(t){}appear(e,i){return t(this,void 0,void 0,(function*(){return yield this.hide(0),i?new Promise(((t,s)=>{this.setTimeout((()=>{t(this.show(e))}),i)})):this.show(e)}))}show(e){return t(this,void 0,void 0,(function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup("default").get("visible")&&this.set("visible",!0),this._onShow(e);const t=this.states.applyAnimate("default",e);yield Jt(t),this._isShowing=!1}}))}hide(e){return t(this,void 0,void 0,(function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let t=this.states.lookup("hidden");t||(t=this.states.create("hidden",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(e);const i=this.states.applyAnimate("hidden",e);yield Jt(i),this._isHiding=!1}}))}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const t=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*t:t}width(){let t=this.get("width"),e=this.get("maxWidth",this.getPrivate("maxWidth")),i=this.get("minWidth",this.getPrivate("minWidth")),s=this.getPrivate("width"),r=0;if(l(s))r=s;else if(null==t)this._adjustedLocalBounds&&(r=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(t instanceof U){const e=this.parent;r=e?e.innerWidth()*t.value:this._root.width()*t.value}else l(t)&&(r=t);return l(i)&&(r=Math.max(i,r)),l(e)&&(r=Math.min(e,r)),r}maxWidth(){let t=this.get("maxWidth",this.getPrivate("maxWidth"));if(l(t))return t;{let t=this.get("width");if(l(t))return t}const e=this.parent;return e?e.innerWidth():this._root.width()}maxHeight(){let t=this.get("maxHeight",this.getPrivate("maxHeight"));if(l(t))return t;{let t=this.get("height");if(l(t))return t}const e=this.parent;return e?e.innerHeight():this._root.height()}height(){let t=this.get("height"),e=this.get("maxHeight",this.getPrivate("maxHeight")),i=this.get("minHeight",this.getPrivate("minHeight")),s=this.getPrivate("height"),r=0;if(l(s))r=s;else if(null==t)this._adjustedLocalBounds&&(r=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(t instanceof U){const e=this.parent;r=e?e.innerHeight()*t.value:this._root.height()*t.value}else l(t)&&(r=t);return l(i)&&(r=Math.max(i,r)),l(e)&&(r=Math.min(e,r)),r}_findStaticTemplate(t){return this._templateField&&t(this._templateField)?this._templateField:super._findStaticTemplate(t)}_walkParents(t){this._parent&&this._walkParent(t)}_walkParent(t){this._parent&&this._parent._walkParent(t),t(this)}get parent(){return this._parent}_setParent(t,e=!1){const i=this._parent;t!==i&&(this.markDirtyBounds(),t.markDirty(),this._parent=t,e&&(this._removeParent(i),t&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(t){return this._display.toGlobal(t)}toLocal(t){return this._display.toLocal(t)}_getDownPoint(){const t=this._getDownPointId();if(t)return this._downPoints[t]}_getDownPointId(){if(this._downPoints)return Z(this._downPoints,((t,e)=>t>e?1:t<e?-1:0))[0]}toFront(){const t=this.parent;t&&t.children.moveValue(this,t.children.length-1)}toBack(){const t=this.parent;t&&t.children.moveValue(this,0)}}Object.defineProperty(He,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Sprite"}),Object.defineProperty(He,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ee.classNames.concat([He.className])});class Le extends Ee{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_backgroundDisplay",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pattern",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){super._afterNewApplyThemes()}get pattern(){return this._pattern}_draw(){}_beforeChanged(){super._beforeChanged(),(this.isDirty("repetition")||this.isDirty("width")||this.isDirty("height")||this.isDirty("rotation")||this.isDirty("color")||this.isDirty("strokeWidth")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("colorOpacity")||this.isDirty("fill")||this.isDirty("fillOpacity"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){const t=this.get("repetition",""),e=this.get("width",100),i=this.get("height",100),s=this.get("fill"),r=this.get("fillOpacity",1);this._display.clear(),this._backgroundDisplay.clear(),s&&r>0&&(this._backgroundDisplay.beginFill(s,r),this._backgroundDisplay.drawRect(0,0,e,i),this._backgroundDisplay.endFill()),this._display.angle=this.get("rotation",0),this._draw(),this._pattern=this._root._renderer.createPattern(this._display,this._backgroundDisplay,t,e,i)}}}Object.defineProperty(Le,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"}),Object.defineProperty(Le,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ee.classNames.concat([Le.className])});class Ne extends Le{constructor(){super(...arguments),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty("src")&&this._load()}_draw(){super._draw();const t=this._image;if(t){const e=this.get("width",100),i=this.get("height",100),s=this.get("fit","image");let r=0,a=0;"pattern"==s?(r=e,a=i):(r=t.width,a=t.height,"image"==s&&(this.set("width",r),this.set("height",a)));let n=0,o=0;this.get("centered",!0)&&(n=e/2-r/2,o=i/2-a/2),this._display.image(t,r,a,n,o)}}_load(){const t=this.get("src");if(t){const e=new Image;e.src=t,e.decode().then((()=>{this._image=e,this._draw(),this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})})).catch((t=>{}))}}}var Re;Object.defineProperty(Ne,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PicturePattern"}),Object.defineProperty(Ne,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Le.classNames.concat([Ne.className])}),function(t){t.ADD="lighter",t.COLOR="color",t.COLOR_BURN="color-burn",t.COLOR_DODGE="color-dodge",t.DARKEN="darken",t.DIFFERENCE="difference",t.DST_OVER="destination-over",t.EXCLUSION="exclusion",t.HARD_LIGHT="hard-light",t.HUE="hue",t.LIGHTEN="lighten",t.LUMINOSITY="luminosity",t.MULTIPLY="multiply",t.NORMAL="source-over",t.OVERLAY="overlay",t.SATURATION="saturation",t.SCREEN="screen",t.SOFT_LIGHT="soft-light",t.SRC_ATOP="source-atop",t.XOR="xor"}(Re||(Re={}));const Fe=["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","fillPattern","strokePattern","fillGradient","strokeGradient","strokeDasharray","strokeDashoffset"];class We extends He{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty("draw")||this.isDirty("svgPath"))&&this.markDirtyBounds(),(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))&&(this._clear=!0),this._display.crisp=this.get("crisp",!1),this.isDirty("fillGradient")){const t=this.get("fillGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",(()=>{this._markDirtyKey("fill")}))),this._disposers.push(e.events.on("positionchanged",(()=>{this._markDirtyKey("fill")}))))}}if(this.isDirty("strokeGradient")){const t=this.get("strokeGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",(()=>{this._markDirtyKey("stroke")}))),this._disposers.push(e.events.on("positionchanged",(()=>{this._markDirtyKey("stroke")}))))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let t=this.get("strokeDasharray");l(t)&&(t=t<.5?[0]:[t]),this._display.setLineDash(t);const e=this.get("strokeDashoffset");e&&this._display.setLineDashOffset(e);const i=this.get("blendMode",Re.NORMAL);this._display.blendMode=i;const s=this.get("draw");s&&s(this._display,this);const r=this.get("svgPath");null!=r&&this._display.svgPath(r)}}_afterChanged(){if(super._afterChanged(),this._clear){const t=this.get("fill"),e=this.get("fillGradient"),i=this.get("fillPattern"),s=this.get("fillOpacity"),r=this.get("stroke"),a=this.get("strokeGradient"),n=this.get("strokePattern"),o=this.get("shadowColor"),h=this.get("shadowBlur"),l=this.get("shadowOffsetX"),d=this.get("shadowOffsetY"),u=this.get("shadowOpacity");if(o&&(h||l||d)&&this._display.shadow(o,h,l,d,u),i){let e=!1;!t||i.get("fill")&&!i.get("fillInherited")||(i.set("fill",t),i.set("fillInherited",!0),e=!0),!r||i.get("color")&&!i.get("colorInherited")||(i.set("color",r),i.set("colorInherited",!0),e=!0),e&&i._changed();const a=i.pattern;a&&(this._display.beginFill(a,s),this._display.endFill(),i instanceof Ne&&i.events.once("loaded",(()=>{this._clear=!0,this.markDirty()})))}else if(e){if(t){const i=e.get("stops",[]);i.length&&m(i,(e=>{e.color&&!e.colorInherited||!t||(e.color=t,e.colorInherited=!0),(null==e.opacity||e.opacityInherited)&&(e.opacity=s,e.opacityInherited=!0)}))}const i=e.getFill(this);i&&(this._display.beginFill(i,s),this._display.endFill())}else t&&(this._display.beginFill(t,s),this._display.endFill());if(r||a||n){const t=this.get("strokeOpacity");let e=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(e/=this.get("scale",1)),this.get("crisp")&&(e/=this._root._renderer.resolution);const i=this.get("lineJoin");if(n){let s=!1;!r||n.get("color")&&!n.get("colorInherited")||(n.set("color",r),n.set("colorInherited",!0),s=!0),s&&n._changed();const a=n.pattern;a&&(this._display.lineStyle(e,a,t,i),this._display.endStroke(),n instanceof Ne&&n.events.once("loaded",(()=>{this._clear=!0,this.markDirty()})))}else if(a){const s=a.get("stops",[]);s.length&&m(s,(e=>{e.color&&!e.colorInherited||!r||(e.color=r,e.colorInherited=!0),(null==e.opacity||e.opacityInherited)&&(e.opacity=t,e.opacityInherited=!0)}));const n=a.getFill(this);n&&(this._display.lineStyle(e,n,t,i),this._display.endStroke())}else r&&(this._display.lineStyle(e,r,t,i),this._display.endStroke())}this.getPrivate("showingTooltip")&&this.showTooltip()}this._clear=!1}}Object.defineProperty(We,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"}),Object.defineProperty(We,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:He.classNames.concat([We.className])});class Ve extends We{_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}}function Ke(t,e){t.get("reverseChildren",!1)?t.children.eachReverse(e):t.children.each(e)}Object.defineProperty(Ve,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"}),Object.defineProperty(Ve,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:We.classNames.concat([Ve.className])});class Ue extends Ee{}Object.defineProperty(Ue,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"}),Object.defineProperty(Ue,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ee.classNames.concat([Ue.className])});class ze extends Ue{updateContainer(t){let e=t.get("paddingLeft",0),i=t.innerWidth(),s=0;Ke(t,(t=>{if(t.isVisible()&&"relative"==t.get("position")){let e=t.get("width");if(e instanceof U){s+=e.value;let r=i*e.value,a=t.get("minWidth",t.getPrivate("minWidth",-1/0));a>r&&(i-=a,s-=e.value);let n=t.get("maxWidth",t.getPrivate("maxWidth",1/0));r>n&&(i-=n,s-=e.value)}else l(e)||(e=t.width()),i-=e+t.get("marginLeft",0)+t.get("marginRight",0)}})),(i<=0||i==1/0)&&(i=.1),Ke(t,(t=>{if(t.isVisible()&&"relative"==t.get("position")){let e=t.get("width");if(e instanceof U){let r=i*e.value/s-t.get("marginLeft",0)-t.get("marginRight",0),a=t.get("minWidth",t.getPrivate("minWidth",-1/0)),n=t.get("maxWidth",t.getPrivate("maxWidth",1/0));r=Math.min(Math.max(a,r),n),t.setPrivate("width",r)}else t._prevSettings.width instanceof U&&t.setPrivate("width",void 0)}}));let r=e;Ke(t,(t=>{if("relative"==t.get("position"))if(t.isVisible()){let e=t.adjustedLocalBounds(),i=t.get("marginLeft",0),s=t.get("marginRight",0),a=t.get("maxWidth"),n=e.left,o=e.right;a&&o-n>a&&(o=n+a);let h=r+i-n;t.setPrivate("x",h),r=h+o+s}else t.setPrivate("x",void 0)}))}}Object.defineProperty(ze,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"}),Object.defineProperty(ze,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ue.classNames.concat([ze.className])});class Ge extends Ue{updateContainer(t){let e=t.get("paddingTop",0),i=t.innerHeight(),s=0;Ke(t,(t=>{if(t.isVisible()&&"relative"==t.get("position")){let e=t.get("height");if(e instanceof U){s+=e.value;let r=i*e.value,a=t.get("minHeight",t.getPrivate("minHeight",-1/0));a>r&&(i-=a,s-=e.value);let n=t.get("maxHeight",t.getPrivate("maxHeight",1/0));r>n&&(i-=n,s-=e.value)}else l(e)||(e=t.height()),i-=e+t.get("marginTop",0)+t.get("marginBottom",0)}})),(i<=0||i==1/0)&&(i=.1),Ke(t,(t=>{if(t.isVisible()&&"relative"==t.get("position")){let e=t.get("height");if(e instanceof U){let r=i*e.value/s-t.get("marginTop",0)-t.get("marginBottom",0),a=t.get("minHeight",t.getPrivate("minHeight",-1/0)),n=t.get("maxHeight",t.getPrivate("maxHeight",1/0));r=Math.min(Math.max(a,r),n),t.setPrivate("height",r)}else t._prevSettings.height instanceof U&&t.setPrivate("height",void 0)}}));let r=e;Ke(t,(t=>{if("relative"==t.get("position"))if(t.isVisible()){let e=t.adjustedLocalBounds(),i=t.get("marginTop",0),s=e.top,a=e.bottom,n=t.get("maxHeight");n&&a-s>n&&(a=s+n);let o=t.get("marginBottom",0),h=r+i-s;t.setPrivate("y",h),r=h+a+o}else t.setPrivate("y",void 0)}))}}Object.defineProperty(Ge,"className",{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"}),Object.defineProperty(Ge,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ue.classNames.concat([Ge.className])});class Ye extends Ue{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE),super._afterNew()}updateContainer(t){let e=t.get("paddingLeft",0),i=t.get("paddingRight",0),s=t.get("paddingTop",0),r=t.maxWidth()-e-i,a=r,n=1;Ke(t,(t=>{if(t.get("visible")&&t.getPrivate("visible")&&!t.get("forceHidden")&&"absolute"!=t.get("position")){let e=t.width();e<a&&(a=e),e>n&&(n=e)}})),a=he(a,1,r),n=he(n,1,r);let o=1;o=this.get("fixedWidthGrid")?r/n:r/a,o=Math.max(1,Math.floor(o)),o=Math.min(this.get("maxColumns",Number.MAX_VALUE),o);let h=this.getColumnWidths(t,o,n,r),l=s,d=0,u=0;o=h.length;let p=e;Ke(t,(t=>{if("relative"==t.get("position")&&t.isVisible()){const i=t.get("marginTop",0),s=t.get("marginBottom",0);let r=t.adjustedLocalBounds(),a=t.get("marginLeft",0),n=t.get("marginRight",0),c=p+a-r.left,g=l+i-r.top;t.setPrivate("x",c),t.setPrivate("y",g),p+=h[d]+n,u=Math.max(u,t.height()+i+s),d++,d>=o&&(d=0,p=e,l+=u)}}))}getColumnWidths(t,e,i,s){let r=0,a=[],n=0;return Ke(t,(s=>{let r=s.adjustedLocalBounds();"absolute"!=s.get("position")&&s.isVisible()&&(this.get("fixedWidthGrid")?a[n]=i:a[n]=Math.max(0|a[n],r.right-r.left+s.get("marginLeft",0)+s.get("marginRight",0)),n<t.children.length-1&&(n++,n==e&&(n=0)))})),m(a,(t=>{r+=t})),r>s?e>2?(e-=1,this.getColumnWidths(t,e,i,s)):[s]:a}}Object.defineProperty(Ye,"className",{enumerable:!0,configurable:!0,writable:!0,value:"GridLayout"}),Object.defineProperty(Ye,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ue.classNames.concat([Ye.className])});class Xe{static escape(t){return t.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/\'\'/g,this.prefix+"5")}static unescape(t){return t.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(t){return t.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")}static chunk(t,e=!1,i=!1){let s=[];t=this.escape(t);let r=e?t.split("'"):[t];for(let a=0;a<r.length;a++){let t=r[a];if(""!==t)if(a%2==0){t=t.replace(/\]\[/g,"]"+u+"["),t=t.replace(/\[\]/g,"[ ]");let e=t.split(/[\[\]]+/);for(let t=0;t<e.length;t++){let r=this.cleanUp(this.unescape(e[t]));r!==u&&(""!==r&&(t%2==0?s.push({type:"value",text:r}):s.push({type:i?"value":"format",text:"["+r+"]"})))}}else{let e=t.split(/[\[\]]+/);for(let t=0;t<e.length;t++){let i=this.cleanUp(this.unescape(e[t]));""!==i&&(t%2==0?s.push({type:"text",text:i}):this.isImage(i)?s.push({type:"image",text:"["+i+"]"}):s.push({type:"format",text:"["+i+"]"}))}}}return s}static isImage(t){return!!t.match(/img[ ]?:/)}static getTextStyle(t){let e={};if(""==t||"[ ]"==t)return{};const i=t.match(/('[^']*')|("[^"]*")/gi);if(i)for(let r=0;r<i.length;r++)t=t.replace(i[r],i[r].replace(/['"]*/g,"").replace(/[ ]+/g,"+"));let s=t.match(/([\w\-]*:[\s]?[^;\s\]]*)|(\#[\w]{1,6})|([\w\-]+)|(\/)/gi);if(!s)return{};for(let r=0;r<s.length;r++)if(s[r].match(/^(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)$/i))e.fontWeight=s[r];else if(s[r].match(/^(underline|line-through)$/i))e.textDecoration=s[r];else if("/"==s[r]);else if(s[r].match(/:/)){const t=s[r].replace("+"," ").split(/:[ ]*/);e[t[0]]=t[1]}else e.fill=Zt.fromString(s[r]);return e}}function $e(t,e){if(null!=e){e=""+e;let i,s=(e=Xe.escape(e)).match(/\{([^}]+)\}/g);if(s)for(i=0;i<s.length;i++){let r=Ze(t,s[i].replace(/\{([^}]+)\}/,"$1"));null==r&&(r=""),e=e.split(s[i]).join(r)}e=Xe.unescape(e)}else e="";return e}function Ze(t,e,i){let s;const r=t.dataItem;let a,n=[],o=/(format[a-zA-Z]*)\((.*)\)|([^.]+)/g;for(;a=o.exec(e),null!==a;)if(a[3]){n.push({prop:a[3]});const e=t.getDateFormatter().get("dateFields",[]),i=t.getNumberFormatter().get("numericFields",[]),s=t.getDurationFormatter().get("durationFields",[]);-1!==e.indexOf(a[3])?n.push({method:"formatDate",params:[]}):-1!==i.indexOf(a[3])?n.push({method:"formatNumber",params:[]}):-1!==s.indexOf(a[3])&&n.push({method:"formatDuration",params:[]})}else{let t=[];if(""!=Dt(a[2])){let e,i=/'([^']*)'|"([^"]*)"|([0-9\-]+)/g;for(;e=i.exec(a[2]),null!==e;)t.push(e[1]||e[2]||e[3])}n.push({method:a[1],params:t})}if(r){s=qe(t,n,r._settings),(null==s||d(s))&&(s=qe(t,n,r));let i=r.dataContext;null==s&&i&&(s=qe(t,n,i),null==s&&(s=qe(t,[{prop:e}],i)),null==s&&i.dataContext&&(s=qe(t,n,i.dataContext))),null==s&&r.component&&r.component.dataItem!==r&&(s=Ze(r.component,e))}return null==s&&(s=qe(t,n,t)),null==s&&t.parent&&(s=Ze(t.parent,e)),s}function Je(t,e){const i=t.getPrivate("customData");if(d(i))return i[e]}function qe(t,i,a,n){let h=a,d=!1;for(let l=0,u=i.length;l<u;l++){let u=i[l];if(u.prop){if(h instanceof He){let t=h.get(u.prop);null==t&&(t=h.getPrivate(u.prop)),null==t&&(t=Je(h,u.prop)),null==t&&(t=h[u.prop]),h=t}else if(h.get){let t=h.get(u.prop);null==t&&(t=h[u.prop]),h=t}else h=h[u.prop];if(null==h)return}else switch(u.method){case"formatNumber":let i=s(h);null!=i&&(h=t.getNumberFormatter().format(i,n||u.params[0]||void 0),d=!0);break;case"formatDate":let l=r(h);if(!o(l)||e(l.getTime()))return;null!=l&&(h=t.getDateFormatter().format(l,n||u.params[0]||void 0),d=!0);break;case"formatDuration":let p=s(h);null!=p&&(h=t.getDurationFormatter().format(p,n||u.params[0]||void 0,u.params[1]||void 0),d=!0);break;case"urlEncode":case"encodeURIComponent":h=encodeURIComponent(h);break;default:h[u.method]&&h[u.method].apply(a,u.params)}}if(!d){let e=[{method:"",params:n}];if(null==n)l(h)?(e[0].method="formatNumber",e[0].params=""):o(h)&&(e[0].method="formatDate",e[0].params="");else{let t=xt(n);"number"===t?e[0].method="formatNumber":"date"===t?e[0].method="formatDate":"duration"===t&&(e[0].method="formatDuration")}e[0].method&&(h=qe(t,e,h))}return h}Object.defineProperty(Xe,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:"__amcharts__"});class Qe extends He{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeContainer()}),Object.defineProperty(this,"_childrenDisplay",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeContainer()}),Object.defineProperty(this,"children",{enumerable:!0,configurable:!0,writable:!0,value:new K(this)}),Object.defineProperty(this,"_percentageSizeChildren",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_percentagePositionChildren",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_prevWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_prevHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_contentWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_contentHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_contentMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_vsbd0",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_vsbd1",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){super._afterNew(),this._display.addChild(this._childrenDisplay)}_dispose(){f(this.allChildren(),(t=>{t.dispose()})),this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1)),this.isDirty("layout")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each((t=>{t.removePrivate("x"),t.removePrivate("y")}))),(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||this.isDirty("paddingRight"))&&this.children.each((t=>{t.markDirtyPosition()})),this.isDirty("maskContent")){const t=this._childrenDisplay;let e=this._contentMask;this.get("maskContent")?e||(e=Ve.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=e,t.addChildAt(e._display,0),t.mask=e._display):e&&(t.removeChild(e._display),t.mask=null,e.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),m(this._percentageSizeChildren,(t=>{t._updateSize()})),m(this._percentagePositionChildren,(t=>{t.markDirtyPosition(),t._updateSize()})),this.updateBackground()}updateBackground(){const t=this.get("background");let e=this._localBounds;if(e&&!this.isHidden()){let i=e.left,s=e.top,r=e.right-i,a=e.bottom-s,n=this.get("maxWidth"),o=this.get("maxHeight");o&&a>o&&(a=o),n&&r>n&&(r=n);let h=this.width(),l=this.height();t&&(t.setAll({width:r,height:a,x:i,y:s}),this._display.interactive&&(t._display.interactive=!0));const d=this._contentMask;d&&d.setAll({width:h+1,height:l+1});const u=this.get("verticalScrollbar");if(u){u.set("height",l),u.set("x",h-u.width()-u.get("marginRight",0)),u.set("end",u.get("start",0)+l/this._contentHeight);const t=u.get("background");t&&t.setAll({width:u.width(),height:l});let e=!0;this._contentHeight<=l&&(e=!1),u.setPrivate("visible",e)}}}_applyThemes(){return!!super._applyThemes()&&(this.eachChildren((t=>{t._applyThemes()})),!0)}_applyState(t){super._applyState(t),this.get("setStateOnChildren")&&this.eachChildren((e=>{e.states.apply(t)}))}_applyStateAnimated(t,e){super._applyStateAnimated(t,e),this.get("setStateOnChildren")&&this.eachChildren((i=>{i.states.applyAnimate(t,e)}))}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){let t=this.get("width"),e=this.get("height"),i=this.getPrivate("width"),s=this.getPrivate("height"),r={left:0,top:0,right:this.width(),bottom:this.height()},a=this.get("layout"),n=!1,o=!1;if((a instanceof ze||a instanceof Ye)&&(n=!0),a instanceof Ge&&(o=!0),null==t&&null==i||null==e&&null==s||this.get("verticalScrollbar")){let t=Number.MAX_VALUE,e=t,i=-t,s=t,a=-t;const h=this.get("paddingLeft",0),l=this.get("paddingTop",0),d=this.get("paddingRight",0),u=this.get("paddingBottom",0);this.children.each((t=>{if("absolute"!=t.get("position")&&t.get("isMeasured")){let r=t.adjustedLocalBounds(),h=t.x(),l=t.y(),d=h+r.left,u=h+r.right,p=l+r.top,c=l+r.bottom;n&&(d-=t.get("marginLeft",0),u+=t.get("marginRight",0)),o&&(p-=t.get("marginTop",0),c+=t.get("marginBottom",0)),d<e&&(e=d),u>i&&(i=u),p<s&&(s=p),c>a&&(a=c)}})),e==t&&(e=0),i==-t&&(i=0),s==t&&(s=0),a==-t&&(a=0),r.left=e-h,r.top=s-l,r.right=i+d,r.bottom=a+u}else;this._contentWidth=r.right-r.left,this._contentHeight=r.bottom-r.top,l(t)&&(r.left=0,r.right=t),l(i)&&(r.left=0,r.right=i),l(e)&&(r.top=0,r.bottom=e),l(s)&&(r.top=0,r.bottom=s),this._localBounds=r}_updateBounds(){const t=this.get("layout");t&&t.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const t=this.innerWidth(),e=this.innerHeight();if(t!=this._prevWidth||e!=this._prevHeight){let i=this.get("layout"),s=!1,r=!1;i&&((i instanceof ze||i instanceof Ye)&&(s=!0),i instanceof Ge&&(r=!0)),m(this._percentageSizeChildren,(i=>{if(!s){let e=i.get("width");e instanceof U&&i.setPrivate("width",e.value*t)}if(!r){let t=i.get("height");t instanceof U&&i.setPrivate("height",t.value*e)}})),m(this._percentagePositionChildren,(t=>{t.markDirtyPosition(),t.markDirtyBounds()})),this._prevWidth=t,this._prevHeight=e,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateChildren(){if(this.isDirty("html")){const t=this.get("html");t&&""!==t?this._root._setHTMLContent(this,$e(this,this.get("html",""))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}if(this.isDirty("verticalScrollbar")){const t=this.get("verticalScrollbar");if(t){t._setParent(this),t.startGrip.setPrivate("visible",!1),t.endGrip.setPrivate("visible",!1),this.set("maskContent",!0),this.set("paddingRight",t.width()+t.get("marginRight",0)+t.get("marginLeft",0));let e=this.get("background");e||(e=this.set("background",Ve.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}))),this._vsbd0=this.events.on("wheel",(e=>{const i=e.originalEvent;if(!gt(i,this))return;i.preventDefault();let s=i.deltaY/5e3;const r=t.get("start",0),a=t.get("end",1);r+s<=0&&(s=-r),a+s>=1&&(s=1-a),r+s>=0&&a+s<=1&&(t.set("start",r+s),t.set("end",a+s))})),this._disposers.push(this._vsbd0),this._vsbd1=t.events.on("rangechanged",(()=>{let e=this._contentHeight;const i=this._childrenDisplay,s=this._contentMask;i.y=-t.get("start")*e,i.markDirtyLayer(),s&&(s._display.y=-i.y,i.mask=s._display)})),this._disposers.push(this._vsbd1),this._display.addChild(t._display)}else{const t=this._prevSettings.verticalScrollbar;if(t){this._display.removeChild(t._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose();this._childrenDisplay.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0)}}}if(this.isDirty("background")){const t=this._prevSettings.background;t&&this._display.removeChild(t._display);const e=this.get("background");e instanceof He&&(e.set("isMeasured",!1),e._setParent(this),this._display.addChildAt(e._display,0))}if(this.isDirty("mask")){const t=this.get("mask"),e=this._prevSettings.mask;if(e&&(this._display.removeChild(e._display),e!=t&&e.dispose()),t){const e=t.parent;e&&e.children.removeValue(t),t._setParent(this),this._display.addChildAt(t._display,0),this._childrenDisplay.mask=t._display}}}_processTemplateField(){super._processTemplateField(),this.children.each((t=>{t._processTemplateField()}))}walkChildren(t){this.children.each((e=>{e instanceof Qe&&e.walkChildren(t),t(e)}))}eachChildren(t){const e=this.get("background");e&&t(e);const i=this.get("verticalScrollbar");i&&t(i);const s=this.get("mask");s&&t(s),this.children.values.forEach((e=>{t(e)}))}allChildren(){const t=[];return this.eachChildren((e=>{t.push(e)})),t}_setDataItem(t){const e=t!==this._dataItem;super._setDataItem(t);const i=this.get("html","");i&&""!==i&&e&&this._root._setHTMLContent(this,$e(this,i))}}Object.defineProperty(Qe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"}),Object.defineProperty(Qe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:He.classNames.concat([Qe.className])});class ti extends He{constructor(){super(...arguments),Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)}),Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:["textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale"]}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get("text"))super._updateBounds();else{let t={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=t}}_changed(){super._changed(),this._display.clear();let t=this.textStyle;if(this.isDirty("opacity")){let t=this.get("opacity",1);this._display.alpha=t}if((this.isDirty("text")||this.isDirty("populateText"))&&(this._display.text=this._getText(),this.markDirtyBounds(),"tooltip"==this.get("role")&&this._root.updateTooltip(this)),this.isPrivateDirty("tooltipElement")){this.getPrivate("tooltipElement")&&this._disposers.push(new I((()=>{this._root._removeTooltipElement(this)})))}if(this.isDirty("width")&&(t.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty("oversizedBehavior")&&(t.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds()),this.isDirty("breakWords")&&(t.breakWords=this.get("breakWords",!1),this.markDirtyBounds()),this.isDirty("ellipsis")&&(t.ellipsis=this.get("ellipsis"),this.markDirtyBounds()),this.isDirty("ignoreFormatting")&&(t.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds()),this.isDirty("minScale")&&(t.minScale=this.get("minScale",0),this.markDirtyBounds()),this.isDirty("fill")){let e=this.get("fill");e&&(t.fill=e)}if(this.isDirty("fillOpacity")){let e=this.get("fillOpacity",1);e&&(t.fillOpacity=e)}(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))&&(t.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds()),(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))&&(t.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds()),m(this._textStyles,(e=>{this._dirty[e]&&(t[e]=this.get(e),this.markDirtyBounds())})),t.fontSize=this.get("fontSize"),t.fontFamily=this.get("fontFamily"),this._display.style=t,this.isDirty("role")&&"tooltip"==this.get("role")&&this._root.updateTooltip(this)}_getText(){const t=this.get("text","");return this.get("populateText")?$e(this,t):t}markDirtyText(){this._display.text=this._getText(),"tooltip"==this.get("role")&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(t){super._setDataItem(t),this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(ti,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"}),Object.defineProperty(ti,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:He.classNames.concat([ti.className])});class ei extends Qe{constructor(){super(...arguments),Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:["text","fill","fillOpacity","textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","populateText","role","ignoreFormatting"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),m(this._textKeys,(t=>{const e=this.get(t);null!=e&&this._text.set(t,e)})),""!==this.get("html","")&&this._text.set("text",""),this.onPrivate("maxWidth",(()=>{this._setMaxDimentions()})),this.onPrivate("maxHeight",(()=>{this._setMaxDimentions()}))}_makeText(){this._text=this.children.push(ti.new(this._root,{}))}_updateChildren(){if(super._updateChildren(),m(this._textKeys,(t=>{this._text.set(t,this.get(t))})),this.isDirty("maxWidth")&&this._setMaxDimentions(),this.isDirty("maxHeight")&&this._setMaxDimentions(),this.isDirty("rotation")&&this._setMaxDimentions(),""!==this.get("html","")?this._text.set("text",""):this._text.set("text",this.get("text")),this.isDirty("textAlign")||this.isDirty("width")){const t=this.get("textAlign");let e;null!=this.get("width")?e="right"==t?Y:"center"==t?X:0:"left"==t||"start"==t?e=this.get("paddingLeft"):"right"!=t&&"end"!=t||(e=-this.get("paddingRight")),this.text.set("x",e)}}_setMaxDimentions(){const t=this.get("rotation"),e=90==t||270==t||-90==t,i=this.get("maxWidth",this.getPrivate("maxWidth",1/0));l(i)?this.text.set(e?"maxHeight":"maxWidth",i-this.get("paddingLeft",0)-this.get("paddingRight",0)):this.text.set(e?"maxHeight":"maxWidth",void 0);const s=this.get("maxHeight",this.getPrivate("maxHeight",1/0));l(s)?this.text.set(e?"maxWidth":"maxHeight",s-this.get("paddingTop",0)-this.get("paddingBottom",0)):this.text.set(e?"maxWidth":"maxHeight",void 0)}_setDataItem(t){super._setDataItem(t),this._markDirtyKey("text"),this.text.get("populateText")&&this.text.markDirtyText()}getText(){return this._text._getText()}}Object.defineProperty(ei,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Label"}),Object.defineProperty(ei,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Qe.classNames.concat([ei.className])});class ii{constructor(t,e){if(Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=t,!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`")}static new(t){const e=new this(t,!0);return e.setupDefaultRules(),e}setupDefaultRules(){}_lookupRules(t){return this._rules[t]}ruleRaw(t,e=[]){let i=this._rules[t];i||(i=this._rules[t]=[]),e.sort(De);const{index:s,found:r}=E(i,(t=>{const i=De(t.tags.length,e.length);return 0===i?xe(t.tags,e,De):i}));if(r)return i[s].template;{const t=Ie.new({});return i.splice(s,0,{tags:e,template:t}),t}}rule(t,e=[]){return this.ruleRaw(t,e)}}export{Ge as $,A,c as B,Zt as C,I as D,Ee as E,dt as F,L as G,ht as H,pt as I,y as J,D as K,P as L,H as M,Re as N,b as O,u as P,U as Q,z as R,ue as S,Xe as T,ut as U,B as V,_t as W,pe as X,ae as Y,Dt as Z,N as _,d as a,ze as a0,Ye as a1,we as a2,Qe as a3,Y as a4,Ve as a5,$t as a6,We as a7,nt as a8,ot as a9,e as aA,vt as aB,oe as aC,V as aD,Ie as aE,Gt as aF,Se as aG,j as aH,te as aI,re as aJ,le as aK,de as aL,Fe as aM,ge as aN,$ as aa,De as ab,et as ac,v as ad,Ot as ae,$e as af,ti as ag,ft as ah,Pe as ai,he as aj,zt as ak,ei as al,ii as am,fe as an,X as ao,me as ap,G as aq,ne as ar,W as as,gt as at,w as au,ke as av,lt as aw,F as ax,Ht as ay,bt as az,J as b,kt as c,p as d,m as e,q as f,l as g,At as h,h as i,It as j,M as k,Bt as l,jt as m,a as n,st as o,yt as p,Ct as q,St as r,Et as s,Mt as t,s as u,Tt as v,Q as w,_ as x,rt as y,it as z};
5
+ import{a as t}from"./tslib.es6.js";function e(t){return Number(t)!==t}function i(t){return{}.toString.call(t)}function s(t){if(null!=t&&!l(t)){let i=Number(t);return e(i)&&h(t)&&""!=t?s(t.replace(/[^0-9.\-]+/g,"")):i}return t}function r(t){if(o(t))return new Date(t);if(l(t))return new Date(t);{let e=Number(t);return l(e)?new Date(e):new Date(t)}}function a(t){if(e(t))return"NaN";if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(0===t&&1/t==-1/0)return"-0";let i=t<0;t=Math.abs(t);let s,r=/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+t),a=r[1],o=r[2]||"";if(void 0===r[3])s=""===o?a:a+"."+o;else{let e=+r[3];if(t<1){s="0."+n("0",e-1)+a+o}else{let t=e-o.length;s=0===t?a+o:t<0?a+o.slice(0,t)+"."+o.slice(t):a+o+n("0",t)}}return i?"-"+s:s}function n(t,e){return new Array(e+1).join(t)}function o(t){return"[object Date]"===i(t)}function h(t){return"string"==typeof t}function l(t){return"number"==typeof t&&Number(t)==t}function d(t){return"object"==typeof t&&null!==t}const u="__§§§__",p="__§§§§__";function c(t,e){const i=t.length;for(let s=0;s<i;++s)if(t[s]===e)return s;return-1}function g(t,e){const i=t.length;for(let s=0;s<i;++s)if(e(t[s]))return!0;return!1}function _(t,e){const i=t.length,s=new Array(i);for(let r=0;r<i;++r)s[r]=e(t[r],r);return s}function m(t,e){const i=t.length;for(let s=0;s<i;++s)e(t[s],s)}function f(t,e){let i=t.length;for(;i>0;)--i,e(t[i],i)}function b(t,e){const i=t.length;for(let s=0;s<i&&e(t[s],s);++s);}function v(t,e){let i=!1,s=0;for(;;){if(s=t.indexOf(e,s),-1===s)return i;i=!0,t.splice(s,1)}}function y(t,e){let i=t.indexOf(e);return-1!==i&&(t.splice(i,1),!0)}function w(t,e,i){let s=c(t,e);-1!==s&&k(t,s),null==i?t.push(e):x(t,i,e)}function P(t,e){-1===t.indexOf(e)&&t.push(e)}function D(t){const e=t.length,i=new Array(e);for(let s=0;s<e;++s)i[s]=t[s];return i}function x(t,e,i){t.splice(e,0,i)}function k(t,e){t.splice(e,1)}function O(t,e){const i=t.length;for(let s=0;s<i;++s)if(e(t[s],s))return s;return-1}function T(t,e){let i=t.length;for(;i>0;)if(--i,e(t[i],i))return i;return-1}function j(t,e){const i=O(t,e);if(-1!==i)return t[i]}function S(t,e){const i=T(t,e);if(-1!==i)return t[i]}function E(t,e){let i=0,s=t.length,r=!1;for(;i<s;){const a=i+s>>1,n=e(t[a]);n<0?i=a+1:0===n?(r=!0,i=a+1):s=a}return{found:r,index:r?i-1:i}}function C(t,e){let i=0,s=t.length,r=!1;for(;i<s;){const a=i+s>>1,n=e(t[a]);n<0?i=a+1:0===n?(r=!0,s=a):s=a}return{found:r,index:i}}function M(t,e){let i=t.length;for(;i>0;)--i,e(t[i])||t.splice(i,1)}class B{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class I{constructor(t){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=t}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class A extends B{constructor(){super(...arguments),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){m(this._disposers,(t=>{t.dispose()}))}}class H extends B{constructor(t){super(),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=t}_dispose(){m(this._disposers,(t=>{t.dispose()}))}get disposers(){return this._disposers}}class L extends I{constructor(){super(...arguments),Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new I((()=>{--this._counter,0===this._counter&&this.dispose()}))}}class N{constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const t=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{m(t,(t=>{t.disposer.dispose()}))}finally{this._killed=null,this._iterating=null}}}hasListeners(){return 0!==this._listeners.length}hasListenersByType(t){return g(this._listeners,(e=>(null===e.type||e.type===t)&&!e.killed))}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(t){delete this._disabled[t]}disableType(t,e=1/0){this._disabled[t]=e}_removeListener(t){if(0===this._iterating){const e=this._listeners.indexOf(t);if(-1===e)throw new Error("Invalid state: could not remove listener");this._listeners.splice(e,1)}else this._killed.push(t)}_removeExistingListener(t,e,i,s){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener((r=>{r.once!==t||r.type!==e||void 0!==i&&r.callback!==i||r.context!==s||r.disposer.dispose()}))}isEnabled(t){if(this._disposed)throw new Error("EventDispatcher is disposed");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(t)&&void 0===this._disabled[t]}removeType(t){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener((e=>{e.type===t&&e.disposer.dispose()}))}has(t,e,i){return-1!==O(this._listeners,(s=>!0!==s.once&&s.type===t&&(void 0===e||s.callback===e)&&s.context===i))}_shouldDispatch(t){if(this._disposed)throw new Error("EventDispatcher is disposed");const e=this._disabled[t];return l(e)?(e<=1?delete this._disabled[t]:--this._disabled[t],!1):this._enabled}_eachListener(t){++this._iterating;try{m(this._listeners,t)}finally{--this._iterating,0===this._iterating&&0!==this._killed.length&&(m(this._killed,(t=>{this._removeListener(t)})),this._killed.length=0)}}dispatch(t,e){this._shouldDispatch(t)&&this._eachListener((i=>{i.killed||null!==i.type&&i.type!==t||i.dispatch(t,e)}))}_on(t,e,i,s,r,a){if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(t,e,i,s);const n={type:e,callback:i,context:s,shouldClone:r,dispatch:a,killed:!1,once:t,disposer:new I((()=>{n.killed=!0,this._removeListener(n)}))};return this._listeners.push(n),n}onAll(t,e,i=!0){return this._on(!1,null,t,e,i,((i,s)=>t.call(e,s))).disposer}on(t,e,i,s=!0){return this._on(!1,t,e,i,s,((t,s)=>e.call(i,s))).disposer}once(t,e,i,s=!0){const r=this._on(!0,t,e,i,s,((t,s)=>{r.disposer.dispose(),e.call(i,s)}));return r.disposer}off(t,e,i){this._removeExistingListener(!1,t,e,i)}copyFrom(t){if(this._disposed)throw new Error("EventDispatcher is disposed");if(t===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");const e=[];return m(t._listeners,(t=>{!t.killed&&t.shouldClone&&(null===t.type?e.push(this.onAll(t.callback,t.context)):t.once?e.push(this.once(t.type,t.callback,t.context)):e.push(this.on(t.type,t.callback,t.context)))})),new H(e)}}function R(t,e){if(!(t>=0&&t<e))throw new Error("Index out of bounds: "+t)}class F{constructor(t=[]){Object.defineProperty(this,"_values",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new N}),this._values=t}get values(){return this._values}contains(t){return-1!==this._values.indexOf(t)}removeValue(t){let e=0,i=this._values.length;for(;e<i;)this._values[e]===t?(this.removeIndex(e),--i):++e}indexOf(t){return c(this._values,t)}get length(){return this._values.length}hasIndex(t){return t>=0&&t<this._values.length}getIndex(t){return this._values[t]}_onPush(t){this.events.isEnabled("push")&&this.events.dispatch("push",{type:"push",target:this,newValue:t})}_onInsertIndex(t,e){this.events.isEnabled("insertIndex")&&this.events.dispatch("insertIndex",{type:"insertIndex",target:this,index:t,newValue:e})}_onSetIndex(t,e,i){this.events.isEnabled("setIndex")&&this.events.dispatch("setIndex",{type:"setIndex",target:this,index:t,oldValue:e,newValue:i})}_onRemoveIndex(t,e){this.events.isEnabled("removeIndex")&&this.events.dispatch("removeIndex",{type:"removeIndex",target:this,index:t,oldValue:e})}_onMoveIndex(t,e,i){this.events.isEnabled("moveIndex")&&this.events.dispatch("moveIndex",{type:"moveIndex",target:this,oldIndex:t,newIndex:e,value:i})}_onClear(t){this.events.isEnabled("clear")&&this.events.dispatch("clear",{type:"clear",target:this,oldValues:t})}setIndex(t,e){R(t,this._values.length);const i=this._values[t];return i!==e&&(this._values[t]=e,this._onSetIndex(t,i,e)),i}insertIndex(t,e){return R(t,this._values.length+1),x(this._values,t,e),this._onInsertIndex(t,e),e}swap(t,e){const i=this._values.length;if(R(t,i),R(e,i),t!==e){const i=this._values[t],s=this._values[e];this._values[t]=s,this._onSetIndex(t,i,s),this._values[e]=i,this._onSetIndex(e,s,i)}}removeIndex(t){R(t,this._values.length);const e=this._values[t];return k(this._values,t),this._onRemoveIndex(t,e),e}moveValue(t,e){let i=this.indexOf(t);if(-1!==i)if(k(this._values,i),null==e){const e=this._values.length;this._values.push(t),this._onMoveIndex(i,e,t)}else x(this._values,e,t),this._onMoveIndex(i,e,t);else null==e?(this._values.push(t),this._onPush(t)):(x(this._values,e,t),this._onInsertIndex(e,t));return t}push(t){return this._values.push(t),this._onPush(t),t}unshift(t){return this.insertIndex(0,t),t}pushAll(t){m(t,(t=>{this.push(t)}))}copyFrom(t){this.pushAll(t._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(t){const e=this._values;this._values=[],this._onClear(e),m(t,(t=>{this._values.push(t),this._onPush(t)}))}clear(){this.setAll([])}*[Symbol.iterator](){const t=this._values.length;for(let e=0;e<t;++e)yield this._values[e]}each(t){m(this._values,t)}eachReverse(t){f(this._values,t)}}class W extends F{constructor(){super(...arguments),Object.defineProperty(this,"autoDispose",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_onSetIndex(t,e,i){this.autoDispose&&e.dispose(),super._onSetIndex(t,e,i)}_onRemoveIndex(t,e){this.autoDispose&&e.dispose(),super._onRemoveIndex(t,e)}_onClear(t){this.autoDispose&&m(t,(t=>{t.dispose()})),super._onClear(t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this.autoDispose&&m(this._values,(t=>{t.dispose()})))}}class V extends W{constructor(t,e){super(),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=t,this.make=e}}class K extends F{constructor(t){super(),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=t,this._events=this.events.onAll((t=>{if("clear"===t.type)m(t.oldValues,(t=>{this._onRemoved(t)}));else if("push"===t.type)this._onInserted(t.newValue);else if("setIndex"===t.type)this._onRemoved(t.oldValue),this._onInserted(t.newValue,t.index);else if("insertIndex"===t.type)this._onInserted(t.newValue,t.index);else if("removeIndex"===t.type)this._onRemoved(t.oldValue);else{if("moveIndex"!==t.type)throw new Error("Unknown IListEvent type");this._onRemoved(t.value),this._onInserted(t.value,t.newIndex)}}))}_onInserted(t,e){t._setParent(this._container,!0);const i=this._container._childrenDisplay;void 0===e?i.addChild(t._display):i.addChildAt(t._display,e)}_onRemoved(t){this._container._childrenDisplay.removeChild(t._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),m(this.values,(t=>{t.dispose()})))}}class U{constructor(t){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=t}get value(){return this._value/100}get percent(){return this._value}toString(){return this._value+"%"}interpolate(t,e){return t+this.value*(e-t)}static normalize(t,e,i){return t instanceof U?t:new U(e===i?0:100*Math.min(Math.max(1/(i-e)*(t-e),0),1))}}function z(t){return new U(t)}const G=z(0),Y=z(100),X=z(50);function $(t){return Object.keys(t)}function Z(t,e){return $(t).sort(e)}function J(t){return Object.assign({},t)}function q(t,e){$(t).forEach((i=>{e(i,t[i])}))}function Q(t,e){for(let i in t)if(tt(t,i)&&!e(i,t[i]))break}function tt(t,e){return{}.hasOwnProperty.call(t,e)}function et(t){t.parentNode&&t.parentNode.removeChild(t)}function it(t,e,i,s){return t.addEventListener(e,i,s||!1),new I((()=>{t.removeEventListener(e,i,s||!1)}))}function st(t){return it(window,"resize",(e=>{t()}))}function rt(t){switch(t){case"touchevents":return window.hasOwnProperty("TouchEvent");case"pointerevents":return window.hasOwnProperty("PointerEvent");case"mouseevents":return window.hasOwnProperty("MouseEvent");case"wheelevents":return window.hasOwnProperty("WheelEvent");case"keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function at(t){return t.pointerId||0}function nt(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let t=document.createElement("button");t.style.position="fixed",t.style.top="0px",t.style.left="-10000px",document.body.appendChild(t),t.focus(),t.blur(),document.body.removeChild(t)}}function ot(t){t&&t.focus()}function ht(t){if(rt("pointerevents"))return t;if(rt("touchevents"))switch(t){case"pointerover":case"pointerdown":return"touchstart";case"pointerout":case"pointerleave":case"pointerup":return"touchend";case"pointermove":return"touchmove";case"click":return"click";case"dblclick":return"dblclick"}else if(rt("mouseevents"))switch(t){case"pointerover":return"mouseover";case"pointerout":return"mouseout";case"pointerleave":return"mouseleave";case"pointerdown":return"mousedown";case"pointermove":return"mousemove";case"pointerup":return"mouseup";case"click":return"click";case"dblclick":return"dblclick"}return t}function lt(t){if("undefined"!=typeof Touch&&t instanceof Touch)return!0;if("undefined"!=typeof PointerEvent&&t instanceof PointerEvent&&null!=t.pointerType)switch(t.pointerType){case"touch":case"pen":case 2:return!0;case"mouse":case 4:return!1;default:return!(t instanceof MouseEvent)}else if(null!=t.type&&t.type.match(/^mouse/))return!1;return!0}function dt(t,e,i){t.style[e]=i}function ut(t,e){return t.style[e]}function pt(t){if(t.composedPath){const e=t.composedPath();return 0===e.length?null:e[0]}return t.target}function ct(t,e){let i=e;for(;;){if(t===i)return!0;if(null===i.parentNode){if(null==i.host)return!1;i=i.host}else i=i.parentNode}}function gt(t,e){return t.target&&ct(e.root.dom,t.target)}function _t(t,e){t.style.pointerEvents=e?"auto":"none"}function mt(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document}function ft(){return mt()?1:void 0}function bt(t,e){return l(t)?t:null!=t&&l(t.value)&&l(e)?e*t.value:0}function vt(t){let e=(""+t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function yt(t,e=0,i="0"){return"string"!=typeof t&&(t=t.toString()),e>t.length?Array(e-t.length+1).join(i)+t:t}function wt(t){return t.replace(/^[\s]*/,"")}function Pt(t){return t.replace(/[\s]*$/,"")}function Dt(t){return wt(Pt(t))}function xt(t){if(void 0===t)return"string";let e=(t=(t=(t=t.toLowerCase().replace(/^\[[^\]]*\]/,"")).replace(/\[[^\]]+\]/,"")).trim()).match(/\/(date|number|duration)$/);return e?e[1]:"number"===t?"number":"date"===t?"date":"duration"===t?"duration":t.match(/[#0]/)?"number":t.match(/[ymwdhnsqaxkzgtei]/)?"date":"string"}function kt(t){return t.replace(/\/(date|number|duration)$/i,"")}function Ot(t){return t?t.replace(/<[^>]*>/g,""):t}function Tt(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function jt(t,e=!1){const i=new Date(t.getFullYear(),0,0),s=t.getTime()-i.getTime()+60*(i.getTimezoneOffset()-t.getTimezoneOffset())*1e3,r=864e5;return Math.floor(s/r)}function St(t,e=!1){const i=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())),s=i.getUTCDay()||7;i.setUTCDate(i.getUTCDate()+4-s);const r=new Date(Date.UTC(i.getUTCFullYear(),0,1));return Math.ceil(((i.getTime()-r.getTime())/864e5+1)/7)}function Et(t,e=!1){const i=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())),s=i.getUTCDay()||7;i.setUTCDate(i.getUTCDate()+4-s);return new Date(Date.UTC(i.getUTCFullYear(),0,1)).getFullYear()}function Ct(t,e=!1){const i=St(new Date(t.getFullYear(),t.getMonth(),1),e);let s=St(t,e);return 1==s&&(s=53),s-i+1}function Mt(t,e,i=1,s=!1){let r=new Date(e,0,4,0,0,0,0);return s&&r.setUTCFullYear(e),7*t+i-((r.getDay()||7)+3)}function Bt(t,e){return t>12?t-=12:0===t&&(t=12),null!=e?t+(e-1):t}function It(t,e=!1,i=!1,s=!1){if(s)return e?"Coordinated Universal Time":"UTC";let r=t.toLocaleString("UTC"),a=t.toLocaleString("UTC",{timeZoneName:e?"long":"short"}).substr(r.length);return!1===i&&(a=a.replace(/ (standard|daylight|summer|winter) /i," ")),a}function At(t){const e=new Date(Date.UTC(2012,0,1,0,0,0,0)),i=new Date(e.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(e.toLocaleString("en-US",{timeZone:t})).getTime()-i.getTime())/6e4*-1}function Ht(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Lt(t){let e,i,s,r=t.h,a=t.s,n=t.l;if(0==a)e=i=s=n;else{let t=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t},o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=t(h,o,r+1/3),i=t(h,o,r),s=t(h,o,r-1/3)}return{r:Math.round(255*e),g:Math.round(255*i),b:Math.round(255*s)}}function Nt(t){let e=t.r/255,i=t.g/255,s=t.b/255,r=Math.max(e,i,s),a=Math.min(e,i,s),n=0,o=0,h=(r+a)/2;if(r===a)n=o=0;else{let t=r-a;switch(o=h>.5?t/(2-r-a):t/(r+a),r){case e:n=(i-s)/t+(i<s?6:0);break;case i:n=(s-e)/t+2;break;case s:n=(e-i)/t+4}n/=6}return{h:n,s:o,l:h}}function Rt(t,e){return t?{r:Math.max(0,Math.min(255,t.r+Ft(t.r,e))),g:Math.max(0,Math.min(255,t.g+Ft(t.g,e))),b:Math.max(0,Math.min(255,t.b+Ft(t.b,e))),a:t.a}:t}function Ft(t,e){let i=e>0?255-t:t;return Math.round(i*e)}function Wt(t,e){if(t){let i=Ft(Math.min(Math.max(t.r,t.g,t.b),230),e);return{r:Math.max(0,Math.min(255,Math.round(t.r+i))),g:Math.max(0,Math.min(255,Math.round(t.g+i))),b:Math.max(0,Math.min(255,Math.round(t.b+i))),a:t.a}}return t}function Vt(t){return(299*t.r+587*t.g+114*t.b)/1e3>=128}function Kt(t,e){if(void 0===t||1==e)return t;let i=Nt(t);return i.s=e,Lt(i)}function Ut(t,e={r:255,g:255,b:255},i={r:255,g:255,b:255}){let s=e,r=i;return Vt(i)&&(s=i,r=e),Vt(t)?r:s}function zt(t,e){return t||(t=[]),[...t,...e].filter(((t,e,i)=>i.indexOf(t)===e))}function Gt(t,e){return!!e&&(t.left==e.left&&(t.right==e.right&&(t.top==e.top&&t.bottom==e.bottom)))}function Yt(t){return"#"===t[0]&&(t=t.substr(1)),3==t.length&&(t=t[0].repeat(2)+t[1].repeat(2)+t[2].repeat(2)),parseInt(t,16)}function Xt(t){let e=(t=t.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(e)e.push("1");else if(e=t.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!e)return 0;let i="";for(let s=1;s<=3;s++){let t=parseInt(e[s]).toString(16);1==t.length&&(t="0"+t),i+=t}return Yt(i)}function $t(t){return Zt.fromAny(t)}class Zt{constructor(t){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=0|t}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return 255&this._hex}toCSS(t=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+t+")"}toCSSHex(){return"#"+yt(this.r.toString(16),2)+yt(this.g.toString(16),2)+yt(this.b.toString(16),2)}toHSL(t=1){return Nt({r:this.r,g:this.g,b:this.b,a:t})}static fromHSL(t,e,i){const s=Lt({h:t,s:e,l:i});return this.fromRGB(s.r,s.g,s.b)}toString(){return this.toCSSHex()}static fromHex(t){return new Zt(t)}static fromRGB(t,e,i){return new Zt((0|i)+(e<<8)+(t<<16))}static fromString(t){return new Zt(Yt(t))}static fromCSS(t){return new Zt(Xt(t))}static fromAny(t){if(h(t)){if("#"==t[0])return Zt.fromString(t);if("rgb"==t.substr(0,3))return Zt.fromCSS(t)}else{if(l(t))return Zt.fromHex(t);if(t instanceof Zt)return Zt.fromHex(t.hex)}throw new Error("Unknown color syntax: "+t)}static alternative(t,e,i){const s=Ut({r:t.r,g:t.g,b:t.b},e?{r:e.r,g:e.g,b:e.b}:void 0,i?{r:i.r,g:i.g,b:i.b}:void 0);return this.fromRGB(s.r,s.g,s.b)}static interpolate(t,e,i,s="rgb"){if("hsl"==s){const s=e.toHSL(),r=i.toHSL();return Zt.fromHSL(qt(t,s.h,r.h),qt(t,s.s,r.s),qt(t,s.l,r.l))}return Zt.fromRGB(qt(t,e.r,i.r),qt(t,e.g,i.g),qt(t,e.b,i.b))}static lighten(t,e){const i=Rt({r:t.r,g:t.g,b:t.b},e);return Zt.fromRGB(i.r,i.g,i.b)}static brighten(t,e){const i=Wt({r:t.r,g:t.g,b:t.b},e);return Zt.fromRGB(i.r,i.g,i.b)}static saturate(t,e){const i=Kt({r:t.r,g:t.g,b:t.b},e);return Zt.fromRGB(i.r,i.g,i.b)}}function Jt(e){return t(this,void 0,void 0,(function*(){if(void 0!==e){const t=[];q(e,((e,i)=>{t.push(i.waitForStop())})),yield Promise.all(t)}}))}function qt(t,e,i){return e+t*(i-e)}function Qt(t,e,i){return t>=1?i:e}function te(t,e,i){return new U(qt(t,e.percent,i.percent))}function ee(t,e,i){return Zt.interpolate(t,e,i)}function ie(t,e){return"number"==typeof t&&"number"==typeof e?qt:t instanceof U&&e instanceof U?te:t instanceof Zt&&e instanceof Zt?ee:Qt}const se=Math.PI,re=se/180,ae=180/se;function ne(t,e,i){if(!l(e)||e<=0){let e=Math.round(t);return i&&e-t==.5&&e--,e}{let i=Math.pow(10,e);return Math.round(t*i)/i}}function oe(t,e){if(!l(e)||e<=0)return Math.ceil(t);{let i=Math.pow(10,e);return Math.ceil(t*i)/i}}function he(t,e,i){return Math.min(Math.max(t,e),i)}function le(t){return Math.sin(re*t)}function de(t){return Math.cos(re*t)}function ue(t){return(t%=360)<0&&(t+=360),t}function pe(t,e,i,s,r){let a=Number.MAX_VALUE,n=Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=[];l.push(ce(r,i)),l.push(ce(r,s));let d=Math.min(90*Math.floor(i/90),90*Math.floor(s/90)),u=Math.max(90*Math.ceil(i/90),90*Math.ceil(s/90));for(let p=d;p<=u;p+=90)p>=i&&p<=s&&l.push(ce(r,p));for(let p=0;p<l.length;p++){let t=l[p];t.x<a&&(a=t.x),t.y<n&&(n=t.y),t.x>o&&(o=t.x),t.y>h&&(h=t.y)}return{left:t+a,top:e+n,right:t+o,bottom:e+h}}function ce(t,e){return{x:t*de(e),y:t*le(e)}}function ge(t){const e=t.length;if(e>0){let i=t[0],s=i.left,r=i.top,a=i.right,n=i.bottom;if(e>1)for(let o=1;o<e;o++)i=t[o],s=Math.min(i.left,s),a=Math.max(i.right,a),r=Math.min(i.top,r),n=Math.max(i.bottom,n);return{left:s,right:a,top:r,bottom:n}}return{left:0,right:0,top:0,bottom:0}}function _e(t){return t}function me(t){return t*t*t}function fe(t){return function(e){return 1-t(1-e)}}class be{constructor(t,e){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=t,this._settings=e,q(e,(t=>{this._userSettings[t]=!0}))}get(t,e){const i=this._settings[t];return void 0!==i?i:e}setRaw(t,e){this._settings[t]=e}set(t,e){this._userSettings[t]=!0,this.setRaw(t,e)}remove(t){delete this._userSettings[t],delete this._settings[t]}setAll(t){$(t).forEach((e=>{this.set(e,t[e])}))}_eachSetting(t){q(this._settings,t)}apply(){const t={stateAnimationEasing:!0,stateAnimationDuration:!0},e=this._entity.states.lookup("default");this._eachSetting(((i,s)=>{t[i]||(t[i]=!0,this!==e&&(i in e._settings||(e._settings[i]=this._entity.get(i))),this._entity.set(i,s))}))}applyAnimate(t){null==t&&(t=this._settings.stateAnimationDuration),null==t&&(t=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let e=this._settings.stateAnimationEasing;null==e&&(e=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",me)));const i=this._entity.states.lookup("default"),s={stateAnimationEasing:!0,stateAnimationDuration:!0},r={};return this._eachSetting(((a,n)=>{if(!s[a]){s[a]=!0,this!=i&&(a in i._settings||(i._settings[a]=this._entity.get(a)));const o=this._entity.animate({key:a,to:n,duration:t,easing:e});o&&(r[a]=o)}})),r}}class ve{constructor(t){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=t}lookup(t){return this._states[t]}create(t,e){const i=this._states[t];if(i)return i.setAll(e),i;{const i=new be(this._entity,e);return this._states[t]=i,i}}remove(t){delete this._states[t]}apply(t){const e=this._states[t];e&&e.apply(),this._entity._applyState(t)}applyAnimate(t,e){let i;const s=this._states[t];return s&&(i=s.applyAnimate(e)),this._entity._applyStateAnimated(t,e),i}}class ye{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.4.4"}),Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const we=new ye;function Pe(t){we.licenses.push(t)}function De(t,e){return t===e?0:t<e?-1:1}function xe(t,e,i){const s=t.length,r=e.length,a=Math.min(s,r);for(let n=0;n<a;++n){const s=i(t[n],e[n]);if(0!==s)return s}return De(s,r)}function ke(t,e){return t===e?0:t<e?-1:1}class Oe{constructor(t){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=t}add(t,e){let i=this._callbacks[t];return void 0===i&&(i=this._callbacks[t]=[]),i.push(e),this._entity._markDirtyKey(t),new I((()=>{y(i,e)&&this._entity._markDirtyKey(t)}))}remove(t){const e=this._callbacks[t];void 0!==e&&(delete this._callbacks[t],0!==e.length&&this._entity._markDirtyKey(t))}enable(t){this._disabled[t]&&(delete this._disabled[t],this._entity._markDirtyKey(t))}disable(t){this._disabled[t]||(this._disabled[t]=!0,this._entity._markDirtyKey(t))}fold(t,e){if(!this._disabled[t]){const i=this._callbacks[t];if(void 0!==i)for(let s=0,r=i.length;s<r;++s)e=i[s](e,this._entity,t)}return e}}class Te{constructor(t,e,i,s,r,a,n){Object.defineProperty(this,"_animation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_from",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_to",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_duration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_easing",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_loops",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_interpolate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_oldTime",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_time",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_stopped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_playing",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new N}),this._animation=t,this._from=e,this._to=i,this._duration=s,this._easing=r,this._loops=a,this._interpolate=ie(e,i),this._oldTime=n}get to(){return this._to}get from(){return this._from}get playing(){return this._playing}get stopped(){return this._stopped}stop(){this._stopped||(this._stopped=!0,this._playing=!1,this.events.isEnabled("stopped")&&this.events.dispatch("stopped",{type:"stopped",target:this}))}pause(){this._playing=!1,this._oldTime=null}play(){this._stopped||this._playing||(this._playing=!0,this._animation._startAnimation())}get percentage(){return this._time/this._duration}waitForStop(){return new Promise(((t,e)=>{if(this._stopped)t();else{const e=()=>{i.dispose(),t()},i=this.events.on("stopped",e)}}))}_checkEnded(){return!(this._loops>1)||(--this._loops,!1)}_run(t){null!==this._oldTime&&(this._time+=t-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=t}_reset(t){this._oldTime=t,this._time=0}_value(t){return this._interpolate(this._easing(t),this._from,this._to)}}let je=0;class Se{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++je}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._settings=t}_checkDirty(){$(this._settings).forEach((t=>{this._userProperties[t]=!0,this._markDirtyKey(t)}))}resetUserSettings(){this._userProperties={}}_runAnimation(t){if(this.isDisposed())return!1;{let e=!1;return q(this._animatingSettings,((i,s)=>{if(s._stopped)this._stopAnimation(i);else if(s._playing){s._run(t);const r=s.percentage;r>=1?s._checkEnded()?this.set(i,s._value(1)):(e=!0,s._reset(t),this._set(i,s._value(1))):(e=!0,this._set(i,s._value(r)))}})),q(this._animatingPrivateSettings,((i,s)=>{if(s._stopped)this._stopAnimationPrivate(i);else if(s._playing){s._run(t);const r=s.percentage;r>=1?s._checkEnded()?this.setPrivate(i,s._value(1)):(e=!0,s._reset(t),this._setPrivate(i,s._value(1))):(e=!0,this._setPrivate(i,s._value(r)))}})),e}}_markDirtyKey(t){this.markDirty()}_markDirtyPrivateKey(t){this.markDirty()}on(t,e){let i=this._settingEvents[t];return void 0===i&&(i=this._settingEvents[t]=[]),i.push(e),new I((()=>{y(i,e),0===i.length&&delete this._settingEvents[t]}))}onPrivate(t,e){let i=this._privateSettingEvents[t];return void 0===i&&(i=this._privateSettingEvents[t]=[]),i.push(e),new I((()=>{y(i,e),0===i.length&&delete this._privateSettingEvents[t]}))}getRaw(t,e){const i=this._settings[t];return void 0!==i?i:e}get(t,e){return this.getRaw(t,e)}_sendKeyEvent(t,e){const i=this._settingEvents[t];void 0!==i&&m(i,(i=>{i(e,this,t)}))}_sendPrivateKeyEvent(t,e){const i=this._privateSettingEvents[t];void 0!==i&&m(i,(i=>{i(e,this,t)}))}_setRaw(t,e,i){this._prevSettings[t]=e,this._sendKeyEvent(t,i)}setRaw(t,e){const i=this._settings[t];this._settings[t]=e,i!==e&&this._setRaw(t,i,e)}_set(t,e){const i=this._settings[t];this._settings[t]=e,i!==e&&(this._setRaw(t,i,e),this._markDirtyKey(t))}_stopAnimation(t){const e=this._animatingSettings[t];e&&(delete this._animatingSettings[t],e.stop())}set(t,e){return this._set(t,e),this._stopAnimation(t),e}remove(t){t in this._settings&&(this._prevSettings[t]=this._settings[t],delete this._settings[t],this._sendKeyEvent(t,void 0),this._markDirtyKey(t)),this._stopAnimation(t)}removeAll(){m($(this._settings),(t=>{this.remove(t)}))}getPrivate(t,e){const i=this._privateSettings[t];return void 0!==i?i:e}_setPrivateRaw(t,e,i){this._prevPrivateSettings[t]=e,this._sendPrivateKeyEvent(t,i)}setPrivateRaw(t,e){const i=this._privateSettings[t];this._privateSettings[t]=e,i!==e&&this._setPrivateRaw(t,i,e)}_setPrivate(t,e){const i=this._privateSettings[t];this._privateSettings[t]=e,i!==e&&(this._setPrivateRaw(t,i,e),this._markDirtyPrivateKey(t))}_stopAnimationPrivate(t){const e=this._animatingPrivateSettings[t];e&&(e.stop(),delete this._animatingPrivateSettings[t])}setPrivate(t,e){return this._setPrivate(t,e),this._stopAnimationPrivate(t),e}removePrivate(t){t in this._privateSettings&&(this._prevPrivateSettings[t]=this._privateSettings[t],delete this._privateSettings[t],this._markDirtyPrivateKey(t)),this._stopAnimationPrivate(t)}setAll(t){q(t,((t,e)=>{this.set(t,e)}))}animate(t){const e=t.key,i=t.to,s=t.duration||0,r=t.loops||1,a=void 0===t.from?this.get(e):t.from,n=void 0===t.easing?_e:t.easing;if(0===s)this.set(e,i);else{if(void 0!==a&&a!==i){this.set(e,a);const t=this._animatingSettings[e]=new Te(this,a,i,s,n,r,this._animationTime());return this._startAnimation(),t}this.set(e,i)}const o=new Te(this,a,i,s,n,r,null);return o.stop(),o}animatePrivate(t){const e=t.key,i=t.to,s=t.duration||0,r=t.loops||1,a=void 0===t.from?this.getPrivate(e):t.from,n=void 0===t.easing?_e:t.easing;if(0===s)this.setPrivate(e,i);else{if(void 0!==a&&a!==i){this.setPrivate(e,a);const t=this._animatingPrivateSettings[e]=new Te(this,a,i,s,n,r,this._animationTime());return this._startAnimation(),t}this.setPrivate(e,i)}const o=new Te(this,a,i,s,n,r,null);return o.stop(),o}_dispose(){}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Ee extends Se{constructor(t,e,i,s=[]){if(super(e),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new ve(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Oe(this)}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,"_userPrivateProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=t,this._internalTemplates=s,e.id&&this._registerId(e.id)}static new(t,e,i){const s=new this(t,e,!0);return s._template=i,s._afterNew(),s}static _new(t,e,i=[]){const s=new this(t,e,!0,i);return s._afterNew(),s}_afterNew(){this._checkDirty();let t=!1;const e=this._template;e&&(t=!0,e._setObjectTemplate(this)),m(this._internalTemplates,(e=>{t=!0,e._setObjectTemplate(this)})),t&&this._applyTemplates(!1),this.states.create("default",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const t=this._template;t&&t._setObjectTemplate(this),m(this._internalTemplates,(t=>{t._setObjectTemplate(this)})),this.states.create("default",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new N}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefault(t,e){t in this._settings||super.set(t,e)}_setRawDefault(t,e){t in this._settings||super.setRaw(t,e)}_clearDirty(){$(this._dirty).forEach((t=>{this._dirty[t]=!1})),$(this._dirtyPrivate).forEach((t=>{this._dirtyPrivate[t]=!1}))}isDirty(t){return!!this._dirty[t]}isPrivateDirty(t){return!!this._dirtyPrivate[t]}_markDirtyKey(t){this._dirty[t]=!0,super._markDirtyKey(t)}_markDirtyPrivateKey(t){this._dirtyPrivate[t]=!0,super._markDirtyKey(t)}isType(t){return-1!==this.classNames.indexOf(t)}_pushPropertyDisposer(t,e){let i=this._disposerProperties[t];return void 0===i&&(i=this._disposerProperties[t]=[]),i.push(e),e}_disposeProperty(t){const e=this._disposerProperties[t];void 0!==e&&(m(e,(t=>{t.dispose()})),delete this._disposerProperties[t])}set template(t){const e=this._template;e!==t&&(this._template=t,e&&e._removeObjectTemplate(this),t&&t._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(t){}_applyStateAnimated(t,e){}get(t,e){const i=this.adapters.fold(t,this._settings[t]);return void 0!==i?i:e}isUserSetting(t){return this._userProperties[t]||!1}set(t,e){return this._userProperties[t]=!0,super.set(t,e)}setRaw(t,e){this._userProperties[t]=!0,super.setRaw(t,e)}_setSoft(t,e){return this._userProperties[t]?e:super.set(t,e)}remove(t){delete this._userProperties[t],this._removeTemplateProperty(t)}setPrivate(t,e){return this._userPrivateProperties[t]=!0,super.setPrivate(t,e)}setPrivateRaw(t,e){this._userPrivateProperties[t]=!0,super.setPrivateRaw(t,e)}removePrivate(t){delete this._userPrivateProperties[t],this._removeTemplatePrivateProperty(t)}_setTemplateProperty(t,e,i){if(!this._userProperties[e]){t===this._findTemplateByKey(e)&&super.set(e,i)}}_setTemplatePrivateProperty(t,e,i){if(!this._userPrivateProperties[e]){t===this._findTemplateByPrivateKey(e)&&super.setPrivate(e,i)}}_removeTemplateProperty(t){if(!this._userProperties[t]){const e=this._findTemplateByKey(t);e?super.set(t,e._settings[t]):super.remove(t)}}_removeTemplatePrivateProperty(t){if(!this._userPrivateProperties[t]){const e=this._findTemplateByPrivateKey(t);e?super.setPrivate(t,e._privateSettings[t]):super.removePrivate(t)}}_walkParents(t){t(this._root._rootContainer),t(this)}_applyStateByKey(t){const e=this.states.create(t,{}),i={};this._eachTemplate((s=>{const r=s.states.lookup(t);r&&r._apply(e,i)})),q(e._settings,(t=>{i[t]||e._userSettings[t]||e.remove(t)}))}_applyTemplate(t,e){this._templateDisposers.push(t._apply(this,e)),q(t._settings,((t,i)=>{e.settings[t]||this._userProperties[t]||(e.settings[t]=!0,super.set(t,i))})),q(t._privateSettings,((t,i)=>{e.privateSettings[t]||this._userPrivateProperties[t]||(e.privateSettings[t]=!0,super.setPrivate(t,i))})),this._runSetup&&t.setup&&(this._runSetup=!1,t.setup(this))}_findStaticTemplate(t){if(this._template&&t(this._template))return this._template}_eachTemplate(t){this._findStaticTemplate((e=>(t(e),!1))),f(this._internalTemplates,t),m(this._templates,t)}_applyTemplates(t=!0){t&&this._disposeTemplates();const e={settings:{},privateSettings:{},states:{}};this._eachTemplate((t=>{this._applyTemplate(t,e)})),t&&(q(this._settings,(t=>{this._userProperties[t]||e.settings[t]||super.remove(t)})),q(this._privateSettings,(t=>{this._userPrivateProperties[t]||e.privateSettings[t]||super.removePrivate(t)})))}_findTemplate(t){const e=this._findStaticTemplate(t);if(void 0===e){const e=S(this._internalTemplates,t);return void 0===e?j(this._templates,t):e}return e}_findTemplateByKey(t){return this._findTemplate((e=>t in e._settings))}_findTemplateByPrivateKey(t){return this._findTemplate((e=>t in e._privateSettings))}_disposeTemplates(){m(this._templateDisposers,(t=>{t.dispose()})),this._templateDisposers.length=0}_removeTemplates(){m(this._templates,(t=>{t._removeObjectTemplate(this)})),this._templates.length=0}_applyThemes(){let t=!1;const e=[];let i=[];const s=new Set,r=this.get("themeTagsSelf");return r&&m(r,(t=>{s.add(t)})),this._walkParents((r=>{r===this._root._rootContainer&&(t=!0),r._defaultThemes.length>0&&e.push(r._defaultThemes);const a=r.get("themes");a&&i.push(a);const n=r.get("themeTags");n&&m(n,(t=>{s.add(t)}))})),i=e.concat(i),this._removeTemplates(),t&&f(this.classNames,(t=>{const e=[];m(i,(i=>{m(i,(i=>{const r=i._lookupRules(t);r&&f(r,(t=>{if(t.tags.every((t=>s.has(t)))){const i=C(e,(e=>{const i=De(t.tags.length,e.tags.length);return 0===i?xe(t.tags,e.tags,De):i}));e.splice(i.index,0,t)}}))}))})),m(e,(t=>{this._templates.push(t.template),t.template._setObjectTemplate(this)}))})),this._applyTemplates(),t&&(this._runSetup=!1),t}_changed(){}_beforeChanged(){if(this.isDirty("id")){const t=this.get("id");t&&this._registerId(t);const e=this._prevSettings.id;e&&delete we.entitiesById[e]}}_registerId(t){if(we.entitiesById[t]&&we.entitiesById[t]!==this)throw new Error('An entity with id "'+t+'" already exists.');we.entitiesById[t]=this}_afterChanged(){}addDisposer(t){return this._disposers.push(t),t}_dispose(){super._dispose();const t=this._template;t&&t._removeObjectTemplate(this),m(this._internalTemplates,(t=>{t._removeObjectTemplate(this)})),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach((t=>{t.dispose()})),q(this._disposerProperties,((t,e)=>{m(e,(t=>{t.dispose()}))}));const e=this.get("id");e&&delete we.entitiesById[e]}setTimeout(t,e){const i=setTimeout((()=>{this.removeDispose(s),t()}),e),s=new I((()=>{clearTimeout(i)}));return this._disposers.push(s),s}removeDispose(t){if(!this.isDisposed()){let e=c(this._disposers,t);e>-1&&this._disposers.splice(e,1)}t.dispose()}hasTag(t){return-1!==c(this.get("themeTags",[]),t)}addTag(t){if(!this.hasTag(t)){const e=this.get("themeTags",[]);e.push(t),this.set("themeTags",e)}}removeTag(t){if(this.hasTag(t)){const e=this.get("themeTags",[]);v(e,t),this.set("themeTags",e)}}_t(t,e,...i){return this._root.language.translate(t,e,...i)}get root(){return this._root}}Object.defineProperty(Ee,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"}),Object.defineProperty(Ee,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});class Ce{constructor(t,e,i){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=t,this._template=e,this._settings=i}get(t,e){const i=this._settings[t];return void 0!==i?i:e}set(t,e){this._settings[t]=e,this._template._stateChanged(this._name)}remove(t){delete this._settings[t],this._template._stateChanged(this._name)}setAll(t){$(t).forEach((e=>{this._settings[e]=t[e]})),this._template._stateChanged(this._name)}_apply(t,e){q(this._settings,((i,s)=>{e[i]||t._userSettings[i]||(e[i]=!0,t.setRaw(i,s))}))}}class Me{constructor(t){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=t}lookup(t){return this._states[t]}create(t,e){const i=this._states[t];if(i)return i.setAll(e),i;{const i=new Ce(t,this._template,e);return this._states[t]=i,this._template._stateChanged(t),i}}remove(t){delete this._states[t],this._template._stateChanged(t)}_apply(t,e){q(this._states,((i,s)=>{let r=e.states[i];null==r&&(r=e.states[i]={});const a=t.states.create(i,{});s._apply(a,r)}))}}class Be{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(t,e){let i=this._callbacks[t];return void 0===i&&(i=this._callbacks[t]=[]),i.push(e),new I((()=>{y(i,e),0===i.length&&delete this._callbacks[t]}))}remove(t){void 0!==this._callbacks[t]&&delete this._callbacks[t]}_apply(t){const e=[];return q(this._callbacks,((i,s)=>{m(s,(s=>{e.push(t.adapters.add(i,s))}))})),new H(e)}}class Ie{constructor(t,e){if(Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Me(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Be}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new N}),Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=t}static new(t){return new Ie(t,!0)}get entities(){return this._entities}get(t,e){const i=this._settings[t];return void 0!==i?i:e}setRaw(t,e){this._settings[t]=e}set(t,e){this._settings[t]!==e&&(this.setRaw(t,e),this._entities.forEach((i=>{i._setTemplateProperty(this,t,e)})))}remove(t){t in this._settings&&(delete this._settings[t],this._entities.forEach((e=>{e._removeTemplateProperty(t)})))}removeAll(){q(this._settings,((t,e)=>{this.remove(t)}))}getPrivate(t,e){const i=this._privateSettings[t];return void 0!==i?i:e}setPrivateRaw(t,e){return this._privateSettings[t]=e,e}setPrivate(t,e){return this._privateSettings[t]!==e&&(this.setPrivateRaw(t,e),this._entities.forEach((i=>{i._setTemplatePrivateProperty(this,t,e)}))),e}removePrivate(t){t in this._privateSettings&&(delete this._privateSettings[t],this._entities.forEach((e=>{e._removeTemplatePrivateProperty(t)})))}setAll(t){q(t,((t,e)=>{this.set(t,e)}))}on(t,e){let i=this._settingEvents[t];return void 0===i&&(i=this._settingEvents[t]=[]),i.push(e),new I((()=>{y(i,e),0===i.length&&delete this._settingEvents[t]}))}onPrivate(t,e){let i=this._privateSettingEvents[t];return void 0===i&&(i=this._privateSettingEvents[t]=[]),i.push(e),new I((()=>{y(i,e),0===i.length&&delete this._privateSettingEvents[t]}))}_apply(t,e){const i=[];return q(this._settingEvents,((e,s)=>{m(s,(s=>{i.push(t.on(e,s))}))})),q(this._privateSettingEvents,((e,s)=>{m(s,(s=>{i.push(t.onPrivate(e,s))}))})),this.states._apply(t,e),i.push(this.adapters._apply(t)),i.push(t.events.copyFrom(this.events)),new H(i)}_setObjectTemplate(t){this._entities.push(t)}_removeObjectTemplate(t){v(this._entities,t)}_stateChanged(t){this._entities.forEach((e=>{e._applyStateByKey(t)}))}}class Ae extends N{constructor(t){super(),Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=t}_makePointerEvent(t,e){return{type:t,originalEvent:e.event,point:e.point,simulated:e.simulated,native:e.native,target:this._sprite}}_onRenderer(t,e){this._sprite.set("interactive",!0),this._sprite._display.interactive=!0;let i=this._rendererDisposers[t];if(void 0===i){const s=this._sprite._display.on(t,(t=>{e.call(this,t)}));i=this._rendererDisposers[t]=new L((()=>{delete this._rendererDisposers[t],s.dispose()}))}return i.increment()}_on(t,e,i,s,r,a){const n=super._on(t,e,i,s,r,a),o=Ae.RENDERER_EVENTS[e];return void 0!==o&&(n.disposer=new H([n.disposer,this._onRenderer(e,o)])),n}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(t,e){const i=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(t,e),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(t,e)}finally{this._dispatchParents=i}}}Object.defineProperty(Ae,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(t){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",t))&&this.dispatch("click",this._makePointerEvent("click",t))},rightclick:function(t){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",t))},middleclick:function(t){this.isEnabled("middleclick")&&this.dispatch("middleclick",this._makePointerEvent("middleclick",t))},dblclick:function(t){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",t))},pointerover:function(t){this.isEnabled("pointerover")&&this.dispatch("pointerover",this._makePointerEvent("pointerover",t))},pointerout:function(t){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",t))},pointerdown:function(t){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",t))},pointerup:function(t){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",t))},globalpointerup:function(t){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",this._makePointerEvent("globalpointerup",t))},globalpointermove:function(t){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",t))},wheel:function(t){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:t.event,point:t.point})}}});class He extends Ee{constructor(){super(...arguments),Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0),super._afterNew()}_markDirtyKey(t){super._markDirtyKey(t),"x"!=t&&"y"!=t&&"dx"!=t&&"dy"!=t||(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(t){super._markDirtyPrivateKey(t),"x"!=t&&"y"!=t||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new Ae(this)}_processTemplateField(){let t;const e=this.get("templateField");if(e){const i=this.dataItem;if(i){const s=i.dataContext;s&&(t=s[e],t instanceof Ie||!t||(t=Ie.new(t)))}}this._templateField!==t&&(this._removeTemplateField(),this._templateField=t,t&&t._setObjectTemplate(this),this._applyTemplates())}_setDataItem(t){const e=this._dataItem;this._dataItem=t,this._processTemplateField();const i="dataitemchanged";t!=e&&this.events.isEnabled(i)&&this.events.dispatch(i,{type:i,target:this,oldDataItem:e,newDataItem:t})}set dataItem(t){this._setDataItem(t)}get dataItem(){if(this._dataItem)return this._dataItem;{let t=this._parent;for(;t;){if(t._dataItem)return t._dataItem;t=t._parent}}}_addPercentageSizeChildren(){let t=this.parent;t&&(this.get("width")instanceof U||this.get("height")instanceof U?P(t._percentageSizeChildren,this):y(t._percentageSizeChildren,this))}_addPercentagePositionChildren(){let t=this.parent;t&&(this.get("x")instanceof U||this.get("y")instanceof U?P(t._percentagePositionChildren,this):y(t._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const t=this._localBounds;if(t){const e=this.get("centerX");null!=e&&(this._display.pivot.x=t.left+bt(e,t.right-t.left));const i=this.get("centerY");null!=i&&(this._display.pivot.y=t.top+bt(i,t.bottom-t.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty("tooltip")){const t=this._prevSettings.tooltip;t&&t.dispose()}if((this.isDirty("layer")||this.isDirty("layerMargin"))&&(this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer()),this.isDirty("tooltipPosition")){const t=this._tooltipMoveDp;t&&(t.dispose(),this._tooltipMoveDp=void 0);const e=this._tooltipPointerDp;e&&(e.dispose(),this._tooltipPointerDp=void 0),"pointer"==this.get("tooltipPosition")&&(this.isHover()&&(this._tooltipMoveDp=this.events.on("globalpointermove",(t=>{this.showTooltip(t.point)}))),this._tooltipPointerDp=new H([this.events.on("pointerover",(()=>{this._tooltipMoveDp=this.events.on("globalpointermove",(t=>{this.showTooltip(t.point)}))})),this.events.on("pointerout",(()=>{const t=this._tooltipMoveDp;t&&(t.dispose(),this._tooltipMoveDp=void 0)}))]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const t=this._display,e=this.events;if(this.isDirty("draggable")){const i=this.get("draggable");i?(this.set("interactive",!0),this._dragDp=new H([e.on("pointerdown",(t=>{this.dragStart(t)})),e.on("globalpointermove",(t=>{this.dragMove(t)})),e.on("globalpointerup",(t=>{this.dragStop(t)}))])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),t.cancelTouch=!!i}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){const t=this.get("tooltipText"),i=this.get("tooltipHTML"),s=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(t||i)&&("click"==s?(this._tooltipDp=new H([e.on("click",(()=>{this.setTimeout((()=>this.showTooltip()),10)})),it(document,"click",(t=>{this.hideTooltip()}))]),this._disposers.push(this._tooltipDp)):"always"==s||(this._tooltipDp=new H([e.on("pointerover",(()=>{this.showTooltip()})),e.on("pointerout",(()=>{this.hideTooltip()}))]),this._disposers.push(this._tooltipDp)))}if(this.isDirty("toggleKey")){let t=this.get("toggleKey");t&&"none"!=t?this._toggleDp=e.on("click",(()=>{this._isDragging||this.set(t,!this.get(t))})):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty("opacity")&&(t.alpha=Math.max(0,this.get("opacity",1))),this.isDirty("rotation")&&(this.markDirtyBounds(),t.angle=this.get("rotation",0)),this.isDirty("scale")&&(this.markDirtyBounds(),t.scale=this.get("scale",0)),(this.isDirty("centerX")||this.isDirty("centerY"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden"))&&(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?t.visible=!0:(t.visible=!1,this.hideTooltip()),this.markDirtyBounds(),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("width")||this.isDirty("height")){this.markDirtyBounds(),this._addPercentageSizeChildren();const t=this.parent;t&&(this.isDirty("width")&&this.get("width")instanceof U||this.isDirty("height")&&this.get("height")instanceof U)&&(t.markDirty(),t._prevWidth=0),this._sizeDirty=!0}if((this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty("wheelable")){const e=this.get("wheelable");e&&this.set("interactive",!0),t.wheelable=!!e}if((this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty("filter")&&(t.filter=this.get("filter")),this.isDirty("cursorOverStyle")&&(t.cursorOverStyle=this.get("cursorOverStyle")),this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new H([e.on("focus",(()=>{this.showTooltip()})),e.on("blur",(()=>{this.hideTooltip()}))]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility()),this.isPrivateDirty("focusable")&&this.markDirtyAccessibility(),(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||this.isDirty("ariaControls"))&&this.markDirtyAccessibility(),this.isDirty("exportable")&&(t.exportable=this.get("exportable")),this.isDirty("interactive")){const t=this.events;this.get("interactive")?this._hoverDp=new H([t.on("click",(t=>{lt(t.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout((()=>{this._handleOver(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip(),this.setPrivateRaw("touchHovering",!0),this.events.dispatch("pointerover",{type:"pointerover",target:t.target,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}),10))})),t.on("globalpointerup",(t=>{lt(t.originalEvent)&&this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip(),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:t.target,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})),this._isDown&&this._handleUp(t)})),t.on("pointerover",(()=>{this._handleOver()})),t.on("pointerout",(()=>{this._handleOut()})),t.on("pointerdown",(t=>{this._handleDown(t)}))]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",!1)),"always"==this.get("showTooltipOn")&&this._display.visible&&this.showTooltip()}dragStart(t){this._dragEvent=t,this.events.stopParentDispatch()}dragStop(t){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const e="dragstop";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleUp(t){if(!this.isHidden()){this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0;const e=at(t.originalEvent);delete this._downPoints[e],0==$(this._downPoints).length&&(this._isDown=!1)}}_hasMoved(t){const e=at(t.originalEvent),i=this._downPoints[e];if(i){const e=Math.abs(i.x-t.point.x),s=Math.abs(i.y-t.point.y);return e>5||s>5}return!1}_hasDown(){return $(this._downPoints).length>0}_handleDown(t){const e=this.parent;if(e&&!this.get("draggable")&&e._handleDown(t),this.get("interactive")&&!this.isHidden()){this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:t.point.x,y:t.point.y},this._isDown=!0;const e=at(t.originalEvent);this._downPoints[e]={x:t.point.x,y:t.point.y}}}dragMove(t){let e=this._dragEvent;if(e){if(e.simulated&&!t.simulated)return!0;let i=0,s=this.parent;for(;null!=s;)i+=s.get("rotation",0),s=s.parent;let r=t.point.x-e.point.x,a=t.point.y-e.point.y;const n=this.events;if(e.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const e="dragstart";n.isEnabled(e)&&n.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}if(this._isDragging){let e=this._dragPoint;this.set("x",e.x+r*de(i)+a*le(i)),this.set("y",e.y+a*de(i)-r*le(i));const s="dragged";n.isEnabled(s)&&n.dispatch(s,{type:s,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}else if(Math.hypot(r,a)>5){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const e="dragstart";n.isEnabled(e)&&n.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let t=this.parent,e=0;for(;;){if(!t)return e;++e,t=t.parent}}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){const t=this._display;if(this.get("isMeasured")){this._root._addDirtyBounds(this),t.isMeasured=!0,t.invalidateBounds();const e=this.parent;e&&"absolute"!=this.get("position")&&(null==e.get("width")||null==e.get("height")||e.get("layout"))&&e.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const t=this._adjustedLocalBounds;let e;if(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),e=this._adjustedLocalBounds):(e={left:0,right:0,top:0,bottom:0},this._localBounds=e,this._adjustedLocalBounds=e),!t||t.left!==e.left||t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom){const t="boundschanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds())}}_fixMinBounds(t){let e=this.get("minWidth",this.getPrivate("minWidth")),i=this.get("minHeight",this.getPrivate("minHeight"));l(e)&&t.right-t.left<e&&(t.right=t.left+e),l(i)&&t.bottom-t.top<i&&(t.bottom=t.top+i);let s=this.getPrivate("width"),r=this.getPrivate("height");l(s)&&(s>0?t.right=t.left+s:t.left=t.right+s),l(r)&&(r>0?t.bottom=t.top+r:t.top=t.bottom+r)}_removeParent(t){t&&(t.children.removeValue(this),y(t._percentageSizeChildren,this),y(t._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.showTooltip(),this._handleOver()}unhover(){this.hideTooltip(),this._handleOut()}showTooltip(t){const e=this.getTooltip(),i=this.get("tooltipText"),s=this.get("tooltipHTML");if((i||s)&&e){const r=this.get("tooltipPosition"),a=this.getPrivate("tooltipTarget",this);"fixed"!=r&&t||(this._display._setMatrix(),t=this.toGlobal(a._getTooltipPoint())),e.set("pointTo",t),e.set("tooltipTarget",a),e.get("x")||e.set("x",t.x),e.get("y")||e.set("y",t.y),i&&e.label.set("text",i),s&&e.label.set("html",s);const n=this.dataItem;if(n&&e.label._setDataItem(n),"always"==this.get("showTooltipOn")&&(t.x<0||t.x>this._root.width()||t.y<0||t.y>this._root.height()))return void this.hideTooltip();e.label.text.markDirtyText();const o=e.show();return this.setPrivateRaw("showingTooltip",!0),o}}hideTooltip(){const t=this.getTooltip();if(t&&(t.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)||this.get("tooltip")==t)){let e=t.get("keepTargetHover")&&0==t.get("stateAnimationDuration",0)?400:void 0;const i=t.hide(e);return this.setPrivateRaw("showingTooltip",!1),i}}_getTooltipPoint(){const t=this._localBounds;if(t){let e=0,i=0;return this.get("isMeasured")?(e=t.left+bt(this.get("tooltipX",0),t.right-t.left),i=t.top+bt(this.get("tooltipY",0),t.bottom-t.top)):(e=bt(this.get("tooltipX",0),this.width()),i=bt(this.get("tooltipY",0),this.height())),{x:e,y:i}}return{x:0,y:0}}getTooltip(){let t=this.get("tooltip");if(t)return t;{let t=this.parent;if(t)return t.getTooltip()}}_updatePosition(){const t=this.parent;let e=this.get("dx",0),i=this.get("dy",0),s=this.get("x"),r=this.getPrivate("x"),a=0,n=0;const o=this.get("position");s instanceof U&&(s=t?t.innerWidth()*s.value+t.get("paddingLeft",0):0),l(s)?a=s+e:null!=r?a=r:t&&"relative"==o&&(a=t.get("paddingLeft",0)+e);let h=this.get("y"),d=this.getPrivate("y");h instanceof U&&(h=t?t.innerHeight()*h.value+t.get("paddingTop",0):0),l(h)?n=h+i:null!=d?n=d:t&&"relative"==o&&(n=t.get("paddingTop",0)+i);const u=this._display;if(u.x!=a||u.y!=n){u.invalidateBounds(),u.x=a,u.y=n;const t="positionchanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let t=this.get("x"),e=this.getPrivate("x");const i=this.parent;return i?t instanceof U?bt(t,i.innerWidth())+i.get("paddingLeft",0):l(t)?t:null!=e?e:i.get("paddingLeft",this._display.x):this._display.x}y(){let t=this.getPrivate("y");if(null!=t)return t;let e=this.get("y");const i=this.parent;return i?e instanceof U?bt(e,i.innerHeight())+i.get("paddingTop",0):l(e)?e:null!=t?t:i.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const t=this.get("tooltip");t&&t.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const t=this._adjustedLocalBounds,e=this.x(),i=this.y();return{left:t.left+e,right:t.right+e,top:t.top+i,bottom:t.bottom+i}}globalBounds(){const t=this.localBounds(),e=this.toGlobal({x:t.left,y:t.top}),i=this.toGlobal({x:t.right,y:t.top}),s=this.toGlobal({x:t.right,y:t.bottom}),r=this.toGlobal({x:t.left,y:t.bottom});return{left:Math.min(e.x,i.x,s.x,r.x),top:Math.min(e.y,i.y,s.y,r.y),right:Math.max(e.x,i.x,s.x,r.x),bottom:Math.max(e.y,i.y,s.y,r.y)}}_onShow(t){}_onHide(t){}appear(e,i){return t(this,void 0,void 0,(function*(){return yield this.hide(0),i?new Promise(((t,s)=>{this.setTimeout((()=>{t(this.show(e))}),i)})):this.show(e)}))}show(e){return t(this,void 0,void 0,(function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup("default").get("visible")&&this.set("visible",!0),this._onShow(e);const t=this.states.applyAnimate("default",e);yield Jt(t),this._isShowing=!1}}))}hide(e){return t(this,void 0,void 0,(function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let t=this.states.lookup("hidden");t||(t=this.states.create("hidden",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(e);const i=this.states.applyAnimate("hidden",e);yield Jt(i),this._isHiding=!1}}))}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const t=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*t:t}width(){let t=this.get("width"),e=this.get("maxWidth",this.getPrivate("maxWidth")),i=this.get("minWidth",this.getPrivate("minWidth")),s=this.getPrivate("width"),r=0;if(l(s))r=s;else if(null==t)this._adjustedLocalBounds&&(r=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(t instanceof U){const e=this.parent;r=e?e.innerWidth()*t.value:this._root.width()*t.value}else l(t)&&(r=t);return l(i)&&(r=Math.max(i,r)),l(e)&&(r=Math.min(e,r)),r}maxWidth(){let t=this.get("maxWidth",this.getPrivate("maxWidth"));if(l(t))return t;{let t=this.get("width");if(l(t))return t}const e=this.parent;return e?e.innerWidth():this._root.width()}maxHeight(){let t=this.get("maxHeight",this.getPrivate("maxHeight"));if(l(t))return t;{let t=this.get("height");if(l(t))return t}const e=this.parent;return e?e.innerHeight():this._root.height()}height(){let t=this.get("height"),e=this.get("maxHeight",this.getPrivate("maxHeight")),i=this.get("minHeight",this.getPrivate("minHeight")),s=this.getPrivate("height"),r=0;if(l(s))r=s;else if(null==t)this._adjustedLocalBounds&&(r=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(t instanceof U){const e=this.parent;r=e?e.innerHeight()*t.value:this._root.height()*t.value}else l(t)&&(r=t);return l(i)&&(r=Math.max(i,r)),l(e)&&(r=Math.min(e,r)),r}_findStaticTemplate(t){return this._templateField&&t(this._templateField)?this._templateField:super._findStaticTemplate(t)}_walkParents(t){this._parent&&this._walkParent(t)}_walkParent(t){this._parent&&this._parent._walkParent(t),t(this)}get parent(){return this._parent}_setParent(t,e=!1){const i=this._parent;t!==i&&(this.markDirtyBounds(),t.markDirty(),this._parent=t,e&&(this._removeParent(i),t&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(t){return this._display.toGlobal(t)}toLocal(t){return this._display.toLocal(t)}_getDownPoint(){const t=this._getDownPointId();if(t)return this._downPoints[t]}_getDownPointId(){if(this._downPoints)return Z(this._downPoints,((t,e)=>t>e?1:t<e?-1:0))[0]}toFront(){const t=this.parent;t&&t.children.moveValue(this,t.children.length-1)}toBack(){const t=this.parent;t&&t.children.moveValue(this,0)}}Object.defineProperty(He,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Sprite"}),Object.defineProperty(He,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ee.classNames.concat([He.className])});class Le extends Ee{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_backgroundDisplay",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pattern",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){super._afterNewApplyThemes()}get pattern(){return this._pattern}_draw(){}_beforeChanged(){super._beforeChanged(),(this.isDirty("repetition")||this.isDirty("width")||this.isDirty("height")||this.isDirty("rotation")||this.isDirty("color")||this.isDirty("strokeWidth")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("colorOpacity")||this.isDirty("fill")||this.isDirty("fillOpacity"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){const t=this.get("repetition",""),e=this.get("width",100),i=this.get("height",100),s=this.get("fill"),r=this.get("fillOpacity",1);this._display.clear(),this._backgroundDisplay.clear(),s&&r>0&&(this._backgroundDisplay.beginFill(s,r),this._backgroundDisplay.drawRect(0,0,e,i),this._backgroundDisplay.endFill()),this._display.angle=this.get("rotation",0),this._draw(),this._pattern=this._root._renderer.createPattern(this._display,this._backgroundDisplay,t,e,i)}}}Object.defineProperty(Le,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"}),Object.defineProperty(Le,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ee.classNames.concat([Le.className])});class Ne extends Le{constructor(){super(...arguments),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty("src")&&this._load()}_draw(){super._draw();const t=this._image;if(t){const e=this.get("width",100),i=this.get("height",100),s=this.get("fit","image");let r=0,a=0;"pattern"==s?(r=e,a=i):(r=t.width,a=t.height,"image"==s&&(this.set("width",r),this.set("height",a)));let n=0,o=0;this.get("centered",!0)&&(n=e/2-r/2,o=i/2-a/2),this._display.image(t,r,a,n,o)}}_load(){const t=this.get("src");if(t){const e=new Image;e.src=t,e.decode().then((()=>{this._image=e,this._draw(),this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})})).catch((t=>{}))}}}var Re;Object.defineProperty(Ne,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PicturePattern"}),Object.defineProperty(Ne,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Le.classNames.concat([Ne.className])}),function(t){t.ADD="lighter",t.COLOR="color",t.COLOR_BURN="color-burn",t.COLOR_DODGE="color-dodge",t.DARKEN="darken",t.DIFFERENCE="difference",t.DST_OVER="destination-over",t.EXCLUSION="exclusion",t.HARD_LIGHT="hard-light",t.HUE="hue",t.LIGHTEN="lighten",t.LUMINOSITY="luminosity",t.MULTIPLY="multiply",t.NORMAL="source-over",t.OVERLAY="overlay",t.SATURATION="saturation",t.SCREEN="screen",t.SOFT_LIGHT="soft-light",t.SRC_ATOP="source-atop",t.XOR="xor"}(Re||(Re={}));const Fe=["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","fillPattern","strokePattern","fillGradient","strokeGradient","strokeDasharray","strokeDashoffset"];class We extends He{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty("draw")||this.isDirty("svgPath"))&&this.markDirtyBounds(),(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))&&(this._clear=!0),this._display.crisp=this.get("crisp",!1),this.isDirty("fillGradient")){const t=this.get("fillGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",(()=>{this._markDirtyKey("fill")}))),this._disposers.push(e.events.on("positionchanged",(()=>{this._markDirtyKey("fill")}))))}}if(this.isDirty("strokeGradient")){const t=this.get("strokeGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",(()=>{this._markDirtyKey("stroke")}))),this._disposers.push(e.events.on("positionchanged",(()=>{this._markDirtyKey("stroke")}))))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let t=this.get("strokeDasharray");l(t)&&(t=t<.5?[0]:[t]),this._display.setLineDash(t);const e=this.get("strokeDashoffset");e&&this._display.setLineDashOffset(e);const i=this.get("blendMode",Re.NORMAL);this._display.blendMode=i;const s=this.get("draw");s&&s(this._display,this);const r=this.get("svgPath");null!=r&&this._display.svgPath(r)}}_afterChanged(){if(super._afterChanged(),this._clear){const t=this.get("fill"),e=this.get("fillGradient"),i=this.get("fillPattern"),s=this.get("fillOpacity"),r=this.get("stroke"),a=this.get("strokeGradient"),n=this.get("strokePattern"),o=this.get("shadowColor"),h=this.get("shadowBlur"),l=this.get("shadowOffsetX"),d=this.get("shadowOffsetY"),u=this.get("shadowOpacity");if(o&&(h||l||d)&&this._display.shadow(o,h,l,d,u),i){let e=!1;!t||i.get("fill")&&!i.get("fillInherited")||(i.set("fill",t),i.set("fillInherited",!0),e=!0),!r||i.get("color")&&!i.get("colorInherited")||(i.set("color",r),i.set("colorInherited",!0),e=!0),e&&i._changed();const a=i.pattern;a&&(this._display.beginFill(a,s),this._display.endFill(),i instanceof Ne&&i.events.once("loaded",(()=>{this._clear=!0,this.markDirty()})))}else if(e){if(t){const i=e.get("stops",[]);i.length&&m(i,(e=>{e.color&&!e.colorInherited||!t||(e.color=t,e.colorInherited=!0),(null==e.opacity||e.opacityInherited)&&(e.opacity=s,e.opacityInherited=!0)}))}const i=e.getFill(this);i&&(this._display.beginFill(i,s),this._display.endFill())}else t&&(this._display.beginFill(t,s),this._display.endFill());if(r||a||n){const t=this.get("strokeOpacity");let e=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(e/=this.get("scale",1)),this.get("crisp")&&(e/=this._root._renderer.resolution);const i=this.get("lineJoin");if(n){let s=!1;!r||n.get("color")&&!n.get("colorInherited")||(n.set("color",r),n.set("colorInherited",!0),s=!0),s&&n._changed();const a=n.pattern;a&&(this._display.lineStyle(e,a,t,i),this._display.endStroke(),n instanceof Ne&&n.events.once("loaded",(()=>{this._clear=!0,this.markDirty()})))}else if(a){const s=a.get("stops",[]);s.length&&m(s,(e=>{e.color&&!e.colorInherited||!r||(e.color=r,e.colorInherited=!0),(null==e.opacity||e.opacityInherited)&&(e.opacity=t,e.opacityInherited=!0)}));const n=a.getFill(this);n&&(this._display.lineStyle(e,n,t,i),this._display.endStroke())}else r&&(this._display.lineStyle(e,r,t,i),this._display.endStroke())}this.getPrivate("showingTooltip")&&this.showTooltip()}this._clear=!1}}Object.defineProperty(We,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"}),Object.defineProperty(We,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:He.classNames.concat([We.className])});class Ve extends We{_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}}function Ke(t,e){t.get("reverseChildren",!1)?t.children.eachReverse(e):t.children.each(e)}Object.defineProperty(Ve,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"}),Object.defineProperty(Ve,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:We.classNames.concat([Ve.className])});class Ue extends Ee{}Object.defineProperty(Ue,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"}),Object.defineProperty(Ue,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ee.classNames.concat([Ue.className])});class ze extends Ue{updateContainer(t){let e=t.get("paddingLeft",0),i=t.innerWidth(),s=0;Ke(t,(t=>{if(t.isVisible()&&"relative"==t.get("position")){let e=t.get("width");if(e instanceof U){s+=e.value;let r=i*e.value,a=t.get("minWidth",t.getPrivate("minWidth",-1/0));a>r&&(i-=a,s-=e.value);let n=t.get("maxWidth",t.getPrivate("maxWidth",1/0));r>n&&(i-=n,s-=e.value)}else l(e)||(e=t.width()),i-=e+t.get("marginLeft",0)+t.get("marginRight",0)}})),(i<=0||i==1/0)&&(i=.1),Ke(t,(t=>{if(t.isVisible()&&"relative"==t.get("position")){let e=t.get("width");if(e instanceof U){let r=i*e.value/s-t.get("marginLeft",0)-t.get("marginRight",0),a=t.get("minWidth",t.getPrivate("minWidth",-1/0)),n=t.get("maxWidth",t.getPrivate("maxWidth",1/0));r=Math.min(Math.max(a,r),n),t.setPrivate("width",r)}else t._prevSettings.width instanceof U&&t.setPrivate("width",void 0)}}));let r=e;Ke(t,(t=>{if("relative"==t.get("position"))if(t.isVisible()){let e=t.adjustedLocalBounds(),i=t.get("marginLeft",0),s=t.get("marginRight",0),a=t.get("maxWidth"),n=e.left,o=e.right;a&&o-n>a&&(o=n+a);let h=r+i-n;t.setPrivate("x",h),r=h+o+s}else t.setPrivate("x",void 0)}))}}Object.defineProperty(ze,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"}),Object.defineProperty(ze,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ue.classNames.concat([ze.className])});class Ge extends Ue{updateContainer(t){let e=t.get("paddingTop",0),i=t.innerHeight(),s=0;Ke(t,(t=>{if(t.isVisible()&&"relative"==t.get("position")){let e=t.get("height");if(e instanceof U){s+=e.value;let r=i*e.value,a=t.get("minHeight",t.getPrivate("minHeight",-1/0));a>r&&(i-=a,s-=e.value);let n=t.get("maxHeight",t.getPrivate("maxHeight",1/0));r>n&&(i-=n,s-=e.value)}else l(e)||(e=t.height()),i-=e+t.get("marginTop",0)+t.get("marginBottom",0)}})),(i<=0||i==1/0)&&(i=.1),Ke(t,(t=>{if(t.isVisible()&&"relative"==t.get("position")){let e=t.get("height");if(e instanceof U){let r=i*e.value/s-t.get("marginTop",0)-t.get("marginBottom",0),a=t.get("minHeight",t.getPrivate("minHeight",-1/0)),n=t.get("maxHeight",t.getPrivate("maxHeight",1/0));r=Math.min(Math.max(a,r),n),t.setPrivate("height",r)}else t._prevSettings.height instanceof U&&t.setPrivate("height",void 0)}}));let r=e;Ke(t,(t=>{if("relative"==t.get("position"))if(t.isVisible()){let e=t.adjustedLocalBounds(),i=t.get("marginTop",0),s=e.top,a=e.bottom,n=t.get("maxHeight");n&&a-s>n&&(a=s+n);let o=t.get("marginBottom",0),h=r+i-s;t.setPrivate("y",h),r=h+a+o}else t.setPrivate("y",void 0)}))}}Object.defineProperty(Ge,"className",{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"}),Object.defineProperty(Ge,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ue.classNames.concat([Ge.className])});class Ye extends Ue{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE),super._afterNew()}updateContainer(t){let e=t.get("paddingLeft",0),i=t.get("paddingRight",0),s=t.get("paddingTop",0),r=t.maxWidth()-e-i,a=r,n=1;Ke(t,(t=>{if(t.get("visible")&&t.getPrivate("visible")&&!t.get("forceHidden")&&"absolute"!=t.get("position")){let e=t.width();e<a&&(a=e),e>n&&(n=e)}})),a=he(a,1,r),n=he(n,1,r);let o=1;o=this.get("fixedWidthGrid")?r/n:r/a,o=Math.max(1,Math.floor(o)),o=Math.min(this.get("maxColumns",Number.MAX_VALUE),o);let h=this.getColumnWidths(t,o,n,r),l=s,d=0,u=0;o=h.length;let p=e;Ke(t,(t=>{if("relative"==t.get("position")&&t.isVisible()){const i=t.get("marginTop",0),s=t.get("marginBottom",0);let r=t.adjustedLocalBounds(),a=t.get("marginLeft",0),n=t.get("marginRight",0),c=p+a-r.left,g=l+i-r.top;t.setPrivate("x",c),t.setPrivate("y",g),p+=h[d]+n,u=Math.max(u,t.height()+i+s),d++,d>=o&&(d=0,p=e,l+=u)}}))}getColumnWidths(t,e,i,s){let r=0,a=[],n=0;return Ke(t,(s=>{let r=s.adjustedLocalBounds();"absolute"!=s.get("position")&&s.isVisible()&&(this.get("fixedWidthGrid")?a[n]=i:a[n]=Math.max(0|a[n],r.right-r.left+s.get("marginLeft",0)+s.get("marginRight",0)),n<t.children.length-1&&(n++,n==e&&(n=0)))})),m(a,(t=>{r+=t})),r>s?e>2?(e-=1,this.getColumnWidths(t,e,i,s)):[s]:a}}Object.defineProperty(Ye,"className",{enumerable:!0,configurable:!0,writable:!0,value:"GridLayout"}),Object.defineProperty(Ye,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ue.classNames.concat([Ye.className])});class Xe{static escape(t){return t.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/\'\'/g,this.prefix+"5")}static unescape(t){return t.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(t){return t.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")}static chunk(t,e=!1,i=!1){let s=[];t=this.escape(t);let r=e?t.split("'"):[t];for(let a=0;a<r.length;a++){let t=r[a];if(""!==t)if(a%2==0){t=t.replace(/\]\[/g,"]"+u+"["),t=t.replace(/\[\]/g,"[ ]");let e=t.split(/[\[\]]+/);for(let t=0;t<e.length;t++){let r=this.cleanUp(this.unescape(e[t]));r!==u&&(""!==r&&(t%2==0?s.push({type:"value",text:r}):s.push({type:i?"value":"format",text:"["+r+"]"})))}}else{let e=t.split(/[\[\]]+/);for(let t=0;t<e.length;t++){let i=this.cleanUp(this.unescape(e[t]));""!==i&&(t%2==0?s.push({type:"text",text:i}):this.isImage(i)?s.push({type:"image",text:"["+i+"]"}):s.push({type:"format",text:"["+i+"]"}))}}}return s}static isImage(t){return!!t.match(/img[ ]?:/)}static getTextStyle(t){let e={};if(""==t||"[ ]"==t)return{};const i=t.match(/('[^']*')|("[^"]*")/gi);if(i)for(let r=0;r<i.length;r++)t=t.replace(i[r],i[r].replace(/['"]*/g,"").replace(/[ ]+/g,"+"));let s=t.match(/([\w\-]*:[\s]?[^;\s\]]*)|(\#[\w]{1,6})|([\w\-]+)|(\/)/gi);if(!s)return{};for(let r=0;r<s.length;r++)if(s[r].match(/^(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)$/i))e.fontWeight=s[r];else if(s[r].match(/^(underline|line-through)$/i))e.textDecoration=s[r];else if("/"==s[r]);else if(s[r].match(/:/)){const t=s[r].replace("+"," ").split(/:[ ]*/);e[t[0]]=t[1]}else e.fill=Zt.fromString(s[r]);return e}}function $e(t,e){if(null!=e){e=""+e;let i,s=(e=Xe.escape(e)).match(/\{([^}]+)\}/g);if(s)for(i=0;i<s.length;i++){let r=Ze(t,s[i].replace(/\{([^}]+)\}/,"$1"));null==r&&(r=""),e=e.split(s[i]).join(r)}e=Xe.unescape(e)}else e="";return e}function Ze(t,e,i){let s;const r=t.dataItem;let a,n=[],o=/(format[a-zA-Z]*)\((.*)\)|([^.]+)/g;for(;a=o.exec(e),null!==a;)if(a[3]){n.push({prop:a[3]});const e=t.getDateFormatter().get("dateFields",[]),i=t.getNumberFormatter().get("numericFields",[]),s=t.getDurationFormatter().get("durationFields",[]);-1!==e.indexOf(a[3])?n.push({method:"formatDate",params:[]}):-1!==i.indexOf(a[3])?n.push({method:"formatNumber",params:[]}):-1!==s.indexOf(a[3])&&n.push({method:"formatDuration",params:[]})}else{let t=[];if(""!=Dt(a[2])){let e,i=/'([^']*)'|"([^"]*)"|([0-9\-]+)/g;for(;e=i.exec(a[2]),null!==e;)t.push(e[1]||e[2]||e[3])}n.push({method:a[1],params:t})}if(r){s=qe(t,n,r._settings),(null==s||d(s))&&(s=qe(t,n,r));let i=r.dataContext;null==s&&i&&(s=qe(t,n,i),null==s&&(s=qe(t,[{prop:e}],i)),null==s&&i.dataContext&&(s=qe(t,n,i.dataContext))),null==s&&r.component&&r.component.dataItem!==r&&(s=Ze(r.component,e))}return null==s&&(s=qe(t,n,t)),null==s&&t.parent&&(s=Ze(t.parent,e)),s}function Je(t,e){const i=t.getPrivate("customData");if(d(i))return i[e]}function qe(t,i,a,n){let h=a,d=!1;for(let l=0,u=i.length;l<u;l++){let u=i[l];if(u.prop){if(h instanceof He){let t=h.get(u.prop);null==t&&(t=h.getPrivate(u.prop)),null==t&&(t=Je(h,u.prop)),null==t&&(t=h[u.prop]),h=t}else if(h.get){let t=h.get(u.prop);null==t&&(t=h[u.prop]),h=t}else h=h[u.prop];if(null==h)return}else switch(u.method){case"formatNumber":let i=s(h);null!=i&&(h=t.getNumberFormatter().format(i,n||u.params[0]||void 0),d=!0);break;case"formatDate":let l=r(h);if(!o(l)||e(l.getTime()))return;null!=l&&(h=t.getDateFormatter().format(l,n||u.params[0]||void 0),d=!0);break;case"formatDuration":let p=s(h);null!=p&&(h=t.getDurationFormatter().format(p,n||u.params[0]||void 0,u.params[1]||void 0),d=!0);break;case"urlEncode":case"encodeURIComponent":h=encodeURIComponent(h);break;default:h[u.method]&&h[u.method].apply(a,u.params)}}if(!d){let e=[{method:"",params:n}];if(null==n)l(h)?(e[0].method="formatNumber",e[0].params=""):o(h)&&(e[0].method="formatDate",e[0].params="");else{let t=xt(n);"number"===t?e[0].method="formatNumber":"date"===t?e[0].method="formatDate":"duration"===t&&(e[0].method="formatDuration")}e[0].method&&(h=qe(t,e,h))}return h}Object.defineProperty(Xe,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:"__amcharts__"});class Qe extends He{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeContainer()}),Object.defineProperty(this,"_childrenDisplay",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeContainer()}),Object.defineProperty(this,"children",{enumerable:!0,configurable:!0,writable:!0,value:new K(this)}),Object.defineProperty(this,"_percentageSizeChildren",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_percentagePositionChildren",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_prevWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_prevHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_contentWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_contentHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_contentMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_vsbd0",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_vsbd1",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){super._afterNew(),this._display.addChild(this._childrenDisplay)}_dispose(){f(this.allChildren(),(t=>{t.dispose()})),this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1)),this.isDirty("layout")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each((t=>{t.removePrivate("x"),t.removePrivate("y")}))),(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||this.isDirty("paddingRight"))&&this.children.each((t=>{t.markDirtyPosition()})),this.isDirty("maskContent")){const t=this._childrenDisplay;let e=this._contentMask;this.get("maskContent")?e||(e=Ve.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=e,t.addChildAt(e._display,0),t.mask=e._display):e&&(t.removeChild(e._display),t.mask=null,e.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),m(this._percentageSizeChildren,(t=>{t._updateSize()})),m(this._percentagePositionChildren,(t=>{t.markDirtyPosition(),t._updateSize()})),this.updateBackground()}updateBackground(){const t=this.get("background");let e=this._localBounds;if(e&&!this.isHidden()){let i=e.left,s=e.top,r=e.right-i,a=e.bottom-s,n=this.get("maxWidth"),o=this.get("maxHeight");o&&a>o&&(a=o),n&&r>n&&(r=n);let h=this.width(),l=this.height();t&&(t.setAll({width:r,height:a,x:i,y:s}),this._display.interactive&&(t._display.interactive=!0));const d=this._contentMask;d&&d.setAll({width:h+1,height:l+1});const u=this.get("verticalScrollbar");if(u){u.set("height",l),u.set("x",h-u.width()-u.get("marginRight",0)),u.set("end",u.get("start",0)+l/this._contentHeight);const t=u.get("background");t&&t.setAll({width:u.width(),height:l});let e=!0;this._contentHeight<=l&&(e=!1),u.setPrivate("visible",e)}}}_applyThemes(){return!!super._applyThemes()&&(this.eachChildren((t=>{t._applyThemes()})),!0)}_applyState(t){super._applyState(t),this.get("setStateOnChildren")&&this.eachChildren((e=>{e.states.apply(t)}))}_applyStateAnimated(t,e){super._applyStateAnimated(t,e),this.get("setStateOnChildren")&&this.eachChildren((i=>{i.states.applyAnimate(t,e)}))}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){let t=this.get("width"),e=this.get("height"),i=this.getPrivate("width"),s=this.getPrivate("height"),r={left:0,top:0,right:this.width(),bottom:this.height()},a=this.get("layout"),n=!1,o=!1;if((a instanceof ze||a instanceof Ye)&&(n=!0),a instanceof Ge&&(o=!0),null==t&&null==i||null==e&&null==s||this.get("verticalScrollbar")){let t=Number.MAX_VALUE,e=t,i=-t,s=t,a=-t;const h=this.get("paddingLeft",0),l=this.get("paddingTop",0),d=this.get("paddingRight",0),u=this.get("paddingBottom",0);this.children.each((t=>{if("absolute"!=t.get("position")&&t.get("isMeasured")){let r=t.adjustedLocalBounds(),h=t.x(),l=t.y(),d=h+r.left,u=h+r.right,p=l+r.top,c=l+r.bottom;n&&(d-=t.get("marginLeft",0),u+=t.get("marginRight",0)),o&&(p-=t.get("marginTop",0),c+=t.get("marginBottom",0)),d<e&&(e=d),u>i&&(i=u),p<s&&(s=p),c>a&&(a=c)}})),e==t&&(e=0),i==-t&&(i=0),s==t&&(s=0),a==-t&&(a=0),r.left=e-h,r.top=s-l,r.right=i+d,r.bottom=a+u}else;this._contentWidth=r.right-r.left,this._contentHeight=r.bottom-r.top,l(t)&&(r.left=0,r.right=t),l(i)&&(r.left=0,r.right=i),l(e)&&(r.top=0,r.bottom=e),l(s)&&(r.top=0,r.bottom=s),this._localBounds=r}_updateBounds(){const t=this.get("layout");t&&t.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const t=this.innerWidth(),e=this.innerHeight();if(t!=this._prevWidth||e!=this._prevHeight){let i=this.get("layout"),s=!1,r=!1;i&&((i instanceof ze||i instanceof Ye)&&(s=!0),i instanceof Ge&&(r=!0)),m(this._percentageSizeChildren,(i=>{if(!s){let e=i.get("width");e instanceof U&&i.setPrivate("width",e.value*t)}if(!r){let t=i.get("height");t instanceof U&&i.setPrivate("height",t.value*e)}})),m(this._percentagePositionChildren,(t=>{t.markDirtyPosition(),t.markDirtyBounds()})),this._prevWidth=t,this._prevHeight=e,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateChildren(){if(this.isDirty("html")){const t=this.get("html");t&&""!==t?this._root._setHTMLContent(this,$e(this,this.get("html",""))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}if(this.isDirty("verticalScrollbar")){const t=this.get("verticalScrollbar");if(t){t._setParent(this),t.startGrip.setPrivate("visible",!1),t.endGrip.setPrivate("visible",!1),this.set("maskContent",!0),this.set("paddingRight",t.width()+t.get("marginRight",0)+t.get("marginLeft",0));let e=this.get("background");e||(e=this.set("background",Ve.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}))),this._vsbd0=this.events.on("wheel",(e=>{const i=e.originalEvent;if(!gt(i,this))return;i.preventDefault();let s=i.deltaY/5e3;const r=t.get("start",0),a=t.get("end",1);r+s<=0&&(s=-r),a+s>=1&&(s=1-a),r+s>=0&&a+s<=1&&(t.set("start",r+s),t.set("end",a+s))})),this._disposers.push(this._vsbd0),this._vsbd1=t.events.on("rangechanged",(()=>{let e=this._contentHeight;const i=this._childrenDisplay,s=this._contentMask;i.y=-t.get("start")*e,i.markDirtyLayer(),s&&(s._display.y=-i.y,i.mask=s._display)})),this._disposers.push(this._vsbd1),this._display.addChild(t._display)}else{const t=this._prevSettings.verticalScrollbar;if(t){this._display.removeChild(t._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose();this._childrenDisplay.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0)}}}if(this.isDirty("background")){const t=this._prevSettings.background;t&&this._display.removeChild(t._display);const e=this.get("background");e instanceof He&&(e.set("isMeasured",!1),e._setParent(this),this._display.addChildAt(e._display,0))}if(this.isDirty("mask")){const t=this.get("mask"),e=this._prevSettings.mask;if(e&&(this._display.removeChild(e._display),e!=t&&e.dispose()),t){const e=t.parent;e&&e.children.removeValue(t),t._setParent(this),this._display.addChildAt(t._display,0),this._childrenDisplay.mask=t._display}}}_processTemplateField(){super._processTemplateField(),this.children.each((t=>{t._processTemplateField()}))}walkChildren(t){this.children.each((e=>{e instanceof Qe&&e.walkChildren(t),t(e)}))}eachChildren(t){const e=this.get("background");e&&t(e);const i=this.get("verticalScrollbar");i&&t(i);const s=this.get("mask");s&&t(s),this.children.values.forEach((e=>{t(e)}))}allChildren(){const t=[];return this.eachChildren((e=>{t.push(e)})),t}_setDataItem(t){const e=t!==this._dataItem;super._setDataItem(t);const i=this.get("html","");i&&""!==i&&e&&this._root._setHTMLContent(this,$e(this,i))}}Object.defineProperty(Qe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"}),Object.defineProperty(Qe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:He.classNames.concat([Qe.className])});class ti extends He{constructor(){super(...arguments),Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)}),Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:["textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale"]}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get("text"))super._updateBounds();else{let t={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=t}}_changed(){super._changed(),this._display.clear();let t=this.textStyle;if(this.isDirty("opacity")){let t=this.get("opacity",1);this._display.alpha=t}if((this.isDirty("text")||this.isDirty("populateText"))&&(this._display.text=this._getText(),this.markDirtyBounds(),"tooltip"==this.get("role")&&this._root.updateTooltip(this)),this.isPrivateDirty("tooltipElement")){this.getPrivate("tooltipElement")&&this._disposers.push(new I((()=>{this._root._removeTooltipElement(this)})))}if(this.isDirty("width")&&(t.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty("oversizedBehavior")&&(t.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds()),this.isDirty("breakWords")&&(t.breakWords=this.get("breakWords",!1),this.markDirtyBounds()),this.isDirty("ellipsis")&&(t.ellipsis=this.get("ellipsis"),this.markDirtyBounds()),this.isDirty("ignoreFormatting")&&(t.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds()),this.isDirty("minScale")&&(t.minScale=this.get("minScale",0),this.markDirtyBounds()),this.isDirty("fill")){let e=this.get("fill");e&&(t.fill=e)}if(this.isDirty("fillOpacity")){let e=this.get("fillOpacity",1);e&&(t.fillOpacity=e)}(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))&&(t.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds()),(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))&&(t.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds()),m(this._textStyles,(e=>{this._dirty[e]&&(t[e]=this.get(e),this.markDirtyBounds())})),t.fontSize=this.get("fontSize"),t.fontFamily=this.get("fontFamily"),this._display.style=t,this.isDirty("role")&&"tooltip"==this.get("role")&&this._root.updateTooltip(this)}_getText(){const t=this.get("text","");return this.get("populateText")?$e(this,t):t}markDirtyText(){this._display.text=this._getText(),"tooltip"==this.get("role")&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(t){super._setDataItem(t),this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(ti,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"}),Object.defineProperty(ti,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:He.classNames.concat([ti.className])});class ei extends Qe{constructor(){super(...arguments),Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:["text","fill","fillOpacity","textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","populateText","role","ignoreFormatting"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),m(this._textKeys,(t=>{const e=this.get(t);null!=e&&this._text.set(t,e)})),""!==this.get("html","")&&this._text.set("text",""),this.onPrivate("maxWidth",(()=>{this._setMaxDimentions()})),this.onPrivate("maxHeight",(()=>{this._setMaxDimentions()}))}_makeText(){this._text=this.children.push(ti.new(this._root,{}))}_updateChildren(){if(super._updateChildren(),m(this._textKeys,(t=>{this._text.set(t,this.get(t))})),this.isDirty("maxWidth")&&this._setMaxDimentions(),this.isDirty("maxHeight")&&this._setMaxDimentions(),this.isDirty("rotation")&&this._setMaxDimentions(),""!==this.get("html","")?this._text.set("text",""):this._text.set("text",this.get("text")),this.isDirty("textAlign")||this.isDirty("width")){const t=this.get("textAlign");let e;null!=this.get("width")?e="right"==t?Y:"center"==t?X:0:"left"==t||"start"==t?e=this.get("paddingLeft"):"right"!=t&&"end"!=t||(e=-this.get("paddingRight")),this.text.set("x",e)}}_setMaxDimentions(){const t=this.get("rotation"),e=90==t||270==t||-90==t,i=this.get("maxWidth",this.getPrivate("maxWidth",1/0));l(i)?this.text.set(e?"maxHeight":"maxWidth",i-this.get("paddingLeft",0)-this.get("paddingRight",0)):this.text.set(e?"maxHeight":"maxWidth",void 0);const s=this.get("maxHeight",this.getPrivate("maxHeight",1/0));l(s)?this.text.set(e?"maxWidth":"maxHeight",s-this.get("paddingTop",0)-this.get("paddingBottom",0)):this.text.set(e?"maxWidth":"maxHeight",void 0)}_setDataItem(t){super._setDataItem(t),this._markDirtyKey("text"),this.text.get("populateText")&&this.text.markDirtyText()}getText(){return this._text._getText()}}Object.defineProperty(ei,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Label"}),Object.defineProperty(ei,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Qe.classNames.concat([ei.className])});class ii{constructor(t,e){if(Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=t,!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`")}static new(t){const e=new this(t,!0);return e.setupDefaultRules(),e}setupDefaultRules(){}_lookupRules(t){return this._rules[t]}ruleRaw(t,e=[]){let i=this._rules[t];i||(i=this._rules[t]=[]),e.sort(De);const{index:s,found:r}=E(i,(t=>{const i=De(t.tags.length,e.length);return 0===i?xe(t.tags,e,De):i}));if(r)return i[s].template;{const t=Ie.new({});return i.splice(s,0,{tags:e,template:t}),t}}rule(t,e=[]){return this.ruleRaw(t,e)}}export{Ge as $,A,c as B,Zt as C,I as D,Ee as E,dt as F,L as G,ht as H,pt as I,y as J,D as K,P as L,H as M,Re as N,b as O,u as P,U as Q,z as R,ue as S,Xe as T,ut as U,B as V,_t as W,pe as X,ae as Y,Dt as Z,N as _,d as a,ze as a0,Ye as a1,we as a2,Qe as a3,Y as a4,Ve as a5,$t as a6,We as a7,nt as a8,ot as a9,e as aA,vt as aB,oe as aC,V as aD,Ie as aE,Gt as aF,Se as aG,j as aH,te as aI,re as aJ,le as aK,de as aL,Fe as aM,ge as aN,$ as aa,De as ab,et as ac,v as ad,Ot as ae,$e as af,ti as ag,ft as ah,Pe as ai,he as aj,zt as ak,ei as al,ii as am,fe as an,X as ao,me as ap,G as aq,ne as ar,W as as,gt as at,w as au,ke as av,lt as aw,F as ax,Ht as ay,bt as az,J as b,kt as c,p as d,m as e,q as f,l as g,At as h,h as i,It as j,M as k,Bt as l,jt as m,a as n,st as o,yt as p,Ct as q,St as r,Et as s,Mt as t,s as u,Tt as v,Q as w,_ as x,rt as y,it as z};