@visactor/vchart-extension 1.13.21-alpha.8 → 1.13.21
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.
- package/package.json +3 -3
- package/build/index.js +0 -14442
- package/build/index.min.js +0 -15
- package/cjs/charts/compare-sankey/compare-sankey-sub-data.d.ts +0 -20
- package/cjs/charts/compare-sankey/compare-sankey-sub-data.js +0 -118
- package/cjs/charts/compare-sankey/compare-sankey-sub-data.js.map +0 -1
- package/cjs/charts/compare-sankey/compare-sankey-sub-nodes.d.ts +0 -2
- package/cjs/charts/compare-sankey/compare-sankey-sub-nodes.js +0 -21
- package/cjs/charts/compare-sankey/compare-sankey-sub-nodes.js.map +0 -1
- package/cjs/charts/compare-sankey/compare-sankey-transformer.d.ts +0 -7
- package/cjs/charts/compare-sankey/compare-sankey-transformer.js +0 -25
- package/cjs/charts/compare-sankey/compare-sankey-transformer.js.map +0 -1
- package/cjs/charts/compare-sankey/compare-sankey.d.ts +0 -40
- package/cjs/charts/compare-sankey/compare-sankey.js +0 -189
- package/cjs/charts/compare-sankey/compare-sankey.js.map +0 -1
- package/cjs/charts/compare-sankey/index.d.ts +0 -2
- package/cjs/charts/compare-sankey/index.js +0 -21
- package/cjs/charts/compare-sankey/index.js.map +0 -1
- package/cjs/charts/compare-sankey/interface.d.ts +0 -23
- package/cjs/charts/compare-sankey/interface.js +0 -6
- package/cjs/charts/compare-sankey/interface.js.map +0 -1
- package/cjs/charts/conversion-funnel/arrow-data-transform.d.ts +0 -24
- package/cjs/charts/conversion-funnel/arrow-data-transform.js +0 -99
- package/cjs/charts/conversion-funnel/arrow-data-transform.js.map +0 -1
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.d.ts +0 -7
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js +0 -196
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js.map +0 -1
- package/cjs/charts/conversion-funnel/conversion-funnel.d.ts +0 -40
- package/cjs/charts/conversion-funnel/conversion-funnel.js +0 -78
- package/cjs/charts/conversion-funnel/conversion-funnel.js.map +0 -1
- package/cjs/charts/conversion-funnel/index.d.ts +0 -2
- package/cjs/charts/conversion-funnel/index.js +0 -21
- package/cjs/charts/conversion-funnel/index.js.map +0 -1
- package/cjs/charts/conversion-funnel/interface.d.ts +0 -35
- package/cjs/charts/conversion-funnel/interface.js +0 -5
- package/cjs/charts/conversion-funnel/interface.js.map +0 -1
- package/cjs/charts/conversion-funnel/util.d.ts +0 -3
- package/cjs/charts/conversion-funnel/util.js +0 -17
- package/cjs/charts/conversion-funnel/util.js.map +0 -1
- package/cjs/charts/ranking-bar/interface.d.ts +0 -45
- package/cjs/charts/ranking-bar/interface.js +0 -6
- package/cjs/charts/ranking-bar/interface.js.map +0 -1
- package/cjs/charts/ranking-bar/ranking-bar-transformer.d.ts +0 -10
- package/cjs/charts/ranking-bar/ranking-bar-transformer.js +0 -291
- package/cjs/charts/ranking-bar/ranking-bar-transformer.js.map +0 -1
- package/cjs/charts/ranking-bar/ranking-bar.d.ts +0 -16
- package/cjs/charts/ranking-bar/ranking-bar.js +0 -34
- package/cjs/charts/ranking-bar/ranking-bar.js.map +0 -1
- package/cjs/charts/ranking-list/constant.d.ts +0 -2
- package/cjs/charts/ranking-list/constant.js +0 -75
- package/cjs/charts/ranking-list/constant.js.map +0 -1
- package/cjs/charts/ranking-list/interface.d.ts +0 -74
- package/cjs/charts/ranking-list/interface.js +0 -6
- package/cjs/charts/ranking-list/interface.js.map +0 -1
- package/cjs/charts/ranking-list/ranking-list-transformer.d.ts +0 -459
- package/cjs/charts/ranking-list/ranking-list-transformer.js +0 -383
- package/cjs/charts/ranking-list/ranking-list-transformer.js.map +0 -1
- package/cjs/charts/ranking-list/ranking-list.d.ts +0 -16
- package/cjs/charts/ranking-list/ranking-list.js +0 -34
- package/cjs/charts/ranking-list/ranking-list.js.map +0 -1
- package/cjs/charts/ranking-list/utils.d.ts +0 -7
- package/cjs/charts/ranking-list/utils.js +0 -51
- package/cjs/charts/ranking-list/utils.js.map +0 -1
- package/cjs/charts/sequence-scatter-kde/constant.d.ts +0 -3
- package/cjs/charts/sequence-scatter-kde/constant.js +0 -7
- package/cjs/charts/sequence-scatter-kde/constant.js.map +0 -1
- package/cjs/charts/sequence-scatter-kde/interface.d.ts +0 -29
- package/cjs/charts/sequence-scatter-kde/interface.js +0 -6
- package/cjs/charts/sequence-scatter-kde/interface.js.map +0 -1
- package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.d.ts +0 -6
- package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.js +0 -142
- package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.js.map +0 -1
- package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde.d.ts +0 -16
- package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde.js +0 -34
- package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde.js.map +0 -1
- package/cjs/charts/sequence-scatter-kde/utils.d.ts +0 -9
- package/cjs/charts/sequence-scatter-kde/utils.js +0 -42
- package/cjs/charts/sequence-scatter-kde/utils.js.map +0 -1
- package/cjs/charts/sequence-scatter-link/interface.d.ts +0 -59
- package/cjs/charts/sequence-scatter-link/interface.js +0 -6
- package/cjs/charts/sequence-scatter-link/interface.js.map +0 -1
- package/cjs/charts/sequence-scatter-link/sequence-scatter-link-transformer.d.ts +0 -6
- package/cjs/charts/sequence-scatter-link/sequence-scatter-link-transformer.js +0 -327
- package/cjs/charts/sequence-scatter-link/sequence-scatter-link-transformer.js.map +0 -1
- package/cjs/charts/sequence-scatter-link/sequence-scatter-link.d.ts +0 -16
- package/cjs/charts/sequence-scatter-link/sequence-scatter-link.js +0 -34
- package/cjs/charts/sequence-scatter-link/sequence-scatter-link.js.map +0 -1
- package/cjs/charts/sequence-scatter-link/utils.d.ts +0 -9
- package/cjs/charts/sequence-scatter-link/utils.js +0 -108
- package/cjs/charts/sequence-scatter-link/utils.js.map +0 -1
- package/cjs/charts/sequence-scatter-pixel/constant.d.ts +0 -3
- package/cjs/charts/sequence-scatter-pixel/constant.js +0 -7
- package/cjs/charts/sequence-scatter-pixel/constant.js.map +0 -1
- package/cjs/charts/sequence-scatter-pixel/interface.d.ts +0 -29
- package/cjs/charts/sequence-scatter-pixel/interface.js +0 -6
- package/cjs/charts/sequence-scatter-pixel/interface.js.map +0 -1
- package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.d.ts +0 -4
- package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.js +0 -68
- package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.js.map +0 -1
- package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel.d.ts +0 -16
- package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel.js +0 -34
- package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel.js.map +0 -1
- package/cjs/charts/sequence-scatter-pixel/utils.d.ts +0 -3
- package/cjs/charts/sequence-scatter-pixel/utils.js +0 -54
- package/cjs/charts/sequence-scatter-pixel/utils.js.map +0 -1
- package/cjs/components/bar-link/bar-link.d.ts +0 -7
- package/cjs/components/bar-link/bar-link.js +0 -87
- package/cjs/components/bar-link/bar-link.js.map +0 -1
- package/cjs/components/bar-link/constant.d.ts +0 -1
- package/cjs/components/bar-link/constant.js +0 -6
- package/cjs/components/bar-link/constant.js.map +0 -1
- package/cjs/components/bar-link/index.d.ts +0 -4
- package/cjs/components/bar-link/index.js +0 -49
- package/cjs/components/bar-link/index.js.map +0 -1
- package/cjs/components/bar-link/type.d.ts +0 -27
- package/cjs/components/bar-link/type.js +0 -6
- package/cjs/components/bar-link/type.js.map +0 -1
- package/cjs/components/bar-link/util.d.ts +0 -22
- package/cjs/components/bar-link/util.js +0 -183
- package/cjs/components/bar-link/util.js.map +0 -1
- package/cjs/components/series-break/constant.d.ts +0 -1
- package/cjs/components/series-break/constant.js +0 -6
- package/cjs/components/series-break/constant.js.map +0 -1
- package/cjs/components/series-break/index.d.ts +0 -4
- package/cjs/components/series-break/index.js +0 -49
- package/cjs/components/series-break/index.js.map +0 -1
- package/cjs/components/series-break/series-break.d.ts +0 -7
- package/cjs/components/series-break/series-break.js +0 -118
- package/cjs/components/series-break/series-break.js.map +0 -1
- package/cjs/components/series-break/type.d.ts +0 -14
- package/cjs/components/series-break/type.js +0 -5
- package/cjs/components/series-break/type.js.map +0 -1
- package/cjs/components/series-break/util.d.ts +0 -13
- package/cjs/components/series-break/util.js +0 -248
- package/cjs/components/series-break/util.js.map +0 -1
- package/cjs/components/series-label/constant.d.ts +0 -1
- package/cjs/components/series-label/constant.js +0 -6
- package/cjs/components/series-label/constant.js.map +0 -1
- package/cjs/components/series-label/index.d.ts +0 -3
- package/cjs/components/series-label/index.js +0 -49
- package/cjs/components/series-label/index.js.map +0 -1
- package/cjs/components/series-label/series-label.d.ts +0 -7
- package/cjs/components/series-label/series-label.js +0 -114
- package/cjs/components/series-label/series-label.js.map +0 -1
- package/cjs/components/series-label/type.d.ts +0 -41
- package/cjs/components/series-label/type.js +0 -6
- package/cjs/components/series-label/type.js.map +0 -1
- package/cjs/components/series-label/util.d.ts +0 -33
- package/cjs/components/series-label/util.js +0 -152
- package/cjs/components/series-label/util.js.map +0 -1
- package/cjs/index.d.ts +0 -10
- package/cjs/index.js +0 -25
- package/cjs/index.js.map +0 -1
- package/cjs/type/index.d.ts +0 -1
- package/cjs/type/index.js +0 -21
- package/cjs/type/index.js.map +0 -1
- package/cjs/type/type.d.ts +0 -8
- package/cjs/type/type.js +0 -6
- package/cjs/type/type.js.map +0 -1
- package/cjs/utils/element.d.ts +0 -7
- package/cjs/utils/element.js +0 -21
- package/cjs/utils/element.js.map +0 -1
- package/cjs/utils/mark.d.ts +0 -2
- package/cjs/utils/mark.js +0 -14
- package/cjs/utils/mark.js.map +0 -1
- package/cjs/utils/math.d.ts +0 -1
- package/cjs/utils/math.js +0 -10
- package/cjs/utils/math.js.map +0 -1
- package/esm/charts/compare-sankey/compare-sankey-sub-data.d.ts +0 -20
- package/esm/charts/compare-sankey/compare-sankey-sub-data.js +0 -106
- package/esm/charts/compare-sankey/compare-sankey-sub-data.js.map +0 -1
- package/esm/charts/compare-sankey/compare-sankey-sub-nodes.d.ts +0 -2
- package/esm/charts/compare-sankey/compare-sankey-sub-nodes.js +0 -13
- package/esm/charts/compare-sankey/compare-sankey-sub-nodes.js.map +0 -1
- package/esm/charts/compare-sankey/compare-sankey-transformer.d.ts +0 -7
- package/esm/charts/compare-sankey/compare-sankey-transformer.js +0 -17
- package/esm/charts/compare-sankey/compare-sankey-transformer.js.map +0 -1
- package/esm/charts/compare-sankey/compare-sankey.d.ts +0 -40
- package/esm/charts/compare-sankey/compare-sankey.js +0 -190
- package/esm/charts/compare-sankey/compare-sankey.js.map +0 -1
- package/esm/charts/compare-sankey/index.d.ts +0 -2
- package/esm/charts/compare-sankey/index.js +0 -4
- package/esm/charts/compare-sankey/index.js.map +0 -1
- package/esm/charts/compare-sankey/interface.d.ts +0 -23
- package/esm/charts/compare-sankey/interface.js +0 -2
- package/esm/charts/compare-sankey/interface.js.map +0 -1
- package/esm/charts/conversion-funnel/arrow-data-transform.d.ts +0 -24
- package/esm/charts/conversion-funnel/arrow-data-transform.js +0 -94
- package/esm/charts/conversion-funnel/arrow-data-transform.js.map +0 -1
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.d.ts +0 -7
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.js +0 -192
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.js.map +0 -1
- package/esm/charts/conversion-funnel/conversion-funnel.d.ts +0 -40
- package/esm/charts/conversion-funnel/conversion-funnel.js +0 -81
- package/esm/charts/conversion-funnel/conversion-funnel.js.map +0 -1
- package/esm/charts/conversion-funnel/index.d.ts +0 -2
- package/esm/charts/conversion-funnel/index.js +0 -4
- package/esm/charts/conversion-funnel/index.js.map +0 -1
- package/esm/charts/conversion-funnel/interface.d.ts +0 -35
- package/esm/charts/conversion-funnel/interface.js +0 -1
- package/esm/charts/conversion-funnel/interface.js.map +0 -1
- package/esm/charts/conversion-funnel/util.d.ts +0 -3
- package/esm/charts/conversion-funnel/util.js +0 -10
- package/esm/charts/conversion-funnel/util.js.map +0 -1
- package/esm/charts/ranking-bar/interface.d.ts +0 -45
- package/esm/charts/ranking-bar/interface.js +0 -2
- package/esm/charts/ranking-bar/interface.js.map +0 -1
- package/esm/charts/ranking-bar/ranking-bar-transformer.d.ts +0 -10
- package/esm/charts/ranking-bar/ranking-bar-transformer.js +0 -285
- package/esm/charts/ranking-bar/ranking-bar-transformer.js.map +0 -1
- package/esm/charts/ranking-bar/ranking-bar.d.ts +0 -16
- package/esm/charts/ranking-bar/ranking-bar.js +0 -27
- package/esm/charts/ranking-bar/ranking-bar.js.map +0 -1
- package/esm/charts/ranking-list/constant.d.ts +0 -2
- package/esm/charts/ranking-list/constant.js +0 -69
- package/esm/charts/ranking-list/constant.js.map +0 -1
- package/esm/charts/ranking-list/interface.d.ts +0 -74
- package/esm/charts/ranking-list/interface.js +0 -2
- package/esm/charts/ranking-list/interface.js.map +0 -1
- package/esm/charts/ranking-list/ranking-list-transformer.d.ts +0 -459
- package/esm/charts/ranking-list/ranking-list-transformer.js +0 -383
- package/esm/charts/ranking-list/ranking-list-transformer.js.map +0 -1
- package/esm/charts/ranking-list/ranking-list.d.ts +0 -16
- package/esm/charts/ranking-list/ranking-list.js +0 -27
- package/esm/charts/ranking-list/ranking-list.js.map +0 -1
- package/esm/charts/ranking-list/utils.d.ts +0 -7
- package/esm/charts/ranking-list/utils.js +0 -41
- package/esm/charts/ranking-list/utils.js.map +0 -1
- package/esm/charts/sequence-scatter-kde/constant.d.ts +0 -3
- package/esm/charts/sequence-scatter-kde/constant.js +0 -6
- package/esm/charts/sequence-scatter-kde/constant.js.map +0 -1
- package/esm/charts/sequence-scatter-kde/interface.d.ts +0 -29
- package/esm/charts/sequence-scatter-kde/interface.js +0 -2
- package/esm/charts/sequence-scatter-kde/interface.js.map +0 -1
- package/esm/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.d.ts +0 -6
- package/esm/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.js +0 -137
- package/esm/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.js.map +0 -1
- package/esm/charts/sequence-scatter-kde/sequence-scatter-kde.d.ts +0 -16
- package/esm/charts/sequence-scatter-kde/sequence-scatter-kde.js +0 -28
- package/esm/charts/sequence-scatter-kde/sequence-scatter-kde.js.map +0 -1
- package/esm/charts/sequence-scatter-kde/utils.d.ts +0 -9
- package/esm/charts/sequence-scatter-kde/utils.js +0 -34
- package/esm/charts/sequence-scatter-kde/utils.js.map +0 -1
- package/esm/charts/sequence-scatter-link/interface.d.ts +0 -59
- package/esm/charts/sequence-scatter-link/interface.js +0 -2
- package/esm/charts/sequence-scatter-link/interface.js.map +0 -1
- package/esm/charts/sequence-scatter-link/sequence-scatter-link-transformer.d.ts +0 -6
- package/esm/charts/sequence-scatter-link/sequence-scatter-link-transformer.js +0 -320
- package/esm/charts/sequence-scatter-link/sequence-scatter-link-transformer.js.map +0 -1
- package/esm/charts/sequence-scatter-link/sequence-scatter-link.d.ts +0 -16
- package/esm/charts/sequence-scatter-link/sequence-scatter-link.js +0 -28
- package/esm/charts/sequence-scatter-link/sequence-scatter-link.js.map +0 -1
- package/esm/charts/sequence-scatter-link/utils.d.ts +0 -9
- package/esm/charts/sequence-scatter-link/utils.js +0 -100
- package/esm/charts/sequence-scatter-link/utils.js.map +0 -1
- package/esm/charts/sequence-scatter-pixel/constant.d.ts +0 -3
- package/esm/charts/sequence-scatter-pixel/constant.js +0 -6
- package/esm/charts/sequence-scatter-pixel/constant.js.map +0 -1
- package/esm/charts/sequence-scatter-pixel/interface.d.ts +0 -29
- package/esm/charts/sequence-scatter-pixel/interface.js +0 -2
- package/esm/charts/sequence-scatter-pixel/interface.js.map +0 -1
- package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.d.ts +0 -4
- package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.js +0 -64
- package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.js.map +0 -1
- package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel.d.ts +0 -16
- package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel.js +0 -28
- package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel.js.map +0 -1
- package/esm/charts/sequence-scatter-pixel/utils.d.ts +0 -3
- package/esm/charts/sequence-scatter-pixel/utils.js +0 -46
- package/esm/charts/sequence-scatter-pixel/utils.js.map +0 -1
- package/esm/components/bar-link/bar-link.d.ts +0 -7
- package/esm/components/bar-link/bar-link.js +0 -85
- package/esm/components/bar-link/bar-link.js.map +0 -1
- package/esm/components/bar-link/constant.d.ts +0 -1
- package/esm/components/bar-link/constant.js +0 -2
- package/esm/components/bar-link/constant.js.map +0 -1
- package/esm/components/bar-link/index.d.ts +0 -4
- package/esm/components/bar-link/index.js +0 -8
- package/esm/components/bar-link/index.js.map +0 -1
- package/esm/components/bar-link/type.d.ts +0 -27
- package/esm/components/bar-link/type.js +0 -2
- package/esm/components/bar-link/type.js.map +0 -1
- package/esm/components/bar-link/util.d.ts +0 -22
- package/esm/components/bar-link/util.js +0 -178
- package/esm/components/bar-link/util.js.map +0 -1
- package/esm/components/series-break/constant.d.ts +0 -1
- package/esm/components/series-break/constant.js +0 -2
- package/esm/components/series-break/constant.js.map +0 -1
- package/esm/components/series-break/index.d.ts +0 -4
- package/esm/components/series-break/index.js +0 -8
- package/esm/components/series-break/index.js.map +0 -1
- package/esm/components/series-break/series-break.d.ts +0 -7
- package/esm/components/series-break/series-break.js +0 -115
- package/esm/components/series-break/series-break.js.map +0 -1
- package/esm/components/series-break/type.d.ts +0 -14
- package/esm/components/series-break/type.js +0 -1
- package/esm/components/series-break/type.js.map +0 -1
- package/esm/components/series-break/util.d.ts +0 -13
- package/esm/components/series-break/util.js +0 -244
- package/esm/components/series-break/util.js.map +0 -1
- package/esm/components/series-label/constant.d.ts +0 -1
- package/esm/components/series-label/constant.js +0 -2
- package/esm/components/series-label/constant.js.map +0 -1
- package/esm/components/series-label/index.d.ts +0 -3
- package/esm/components/series-label/index.js +0 -6
- package/esm/components/series-label/index.js.map +0 -1
- package/esm/components/series-label/series-label.d.ts +0 -7
- package/esm/components/series-label/series-label.js +0 -110
- package/esm/components/series-label/series-label.js.map +0 -1
- package/esm/components/series-label/type.d.ts +0 -41
- package/esm/components/series-label/type.js +0 -2
- package/esm/components/series-label/type.js.map +0 -1
- package/esm/components/series-label/util.d.ts +0 -33
- package/esm/components/series-label/util.js +0 -144
- package/esm/components/series-label/util.js.map +0 -1
- package/esm/index.d.ts +0 -10
- package/esm/index.js +0 -19
- package/esm/index.js.map +0 -1
- package/esm/type/index.d.ts +0 -1
- package/esm/type/index.js +0 -2
- package/esm/type/index.js.map +0 -1
- package/esm/type/type.d.ts +0 -8
- package/esm/type/type.js +0 -2
- package/esm/type/type.js.map +0 -1
- package/esm/utils/element.d.ts +0 -7
- package/esm/utils/element.js +0 -15
- package/esm/utils/element.js.map +0 -1
- package/esm/utils/mark.d.ts +0 -2
- package/esm/utils/mark.js +0 -4
- package/esm/utils/mark.js.map +0 -1
- package/esm/utils/math.d.ts +0 -1
- package/esm/utils/math.js +0 -4
- package/esm/utils/math.js.map +0 -1
package/build/index.min.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vchart")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VChartExtension={},t.VChart)}(this,(function(t,e){"use strict";function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var n={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,n,r,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new s(n,r||t,a),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,s=[];if(0===this._eventsCount)return s;for(n in t=this._events)e.call(t,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,a=new Array(r);s<r;s++)a[s]=n[s].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},o.prototype.emit=function(t,e,n,s,r,a){var o=i?i+t:t;if(!this._events[o])return!1;var l,h,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,s),!0;case 5:return c.fn.call(c.context,e,n,s,r),!0;case 6:return c.fn.call(c.context,e,n,s,r,a),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var d,p=c.length;for(h=0;h<p;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,n);break;case 4:c[h].fn.call(c[h].context,e,n,s);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[h].fn.apply(c[h].context,l)}}return!0},o.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,n,s){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return a(this,r),this;var o=this._events[r];if(o.fn)o.fn!==e||s&&!o.once||n&&o.context!==n||a(this,r);else{for(var l=0,h=[],c=o.length;l<c;l++)(o[l].fn!==e||s&&!o[l].once||n&&o[l].context!==n)&&h.push(o[l]);h.length?this._events[r]=1===h.length?h[0]:h:a(this,r)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(n);var s=i(n.exports);var r=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var a=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||r(t,"Boolean")};var o=t=>"function"==typeof t;var l=t=>null==t;var h=t=>null!=t;var c=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var u=t=>"object"==typeof t&&null!==t;var d=function(t){if(!u(t)||!r(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var p=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||r(t,"String")};var g=t=>Array.isArray?Array.isArray(t):r(t,"Array");var f=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var y=t=>r(t,"Date");var m=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||r(t,"Number")};var v=t=>m(t)&&Number.isFinite(t);var b=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var x=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);var _=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const A=Object.prototype;var S=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||A)};const T=Object.prototype.hasOwnProperty;function B(t){if(l(t))return!0;if(f(t))return!t.length;const e=_(t);if("Map"===e||"Set"===e)return!t.size;if(S(t))return!Object.keys(t).length;for(const e in t)if(T.call(t,e))return!1;return!0}var w=(t,e,i)=>{const n=p(e)?e.split("."):e;for(let e=0;e<n.length;e++)t=t?t[n[e]]:void 0;return void 0===t?i:t};const M=Object.prototype.hasOwnProperty;var C=(t,e)=>null!=t&&M.call(t,e);function k(t,e,i){let n;if(!h(t)||"object"!=typeof t||e&&e(t))return t;const s=g(t),r=t.length;n=s?new Array(r):"object"==typeof t?{}:a(t)||m(t)||p(t)?t:y(t)?new Date(+t):void 0;const o=s?void 0:Object.keys(Object(t));let l=-1;if(n)for(;++l<(o||t).length;){const s=o?o[l]:l,r=t[s];i&&i.includes(s.toString())?n[s]=r:n[s]=k(r,e,i)}return n}function O(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){if(t===e)return;if(h(e)&&"object"==typeof e){const s=Object(e),r=[];for(const t in s)r.push(t);let{length:a}=r,o=-1;for(;a--;){const a=r[++o];!h(s[a])||"object"!=typeof s[a]||n&&g(t[a])?L(t,a,s[a]):P(t,e,a,i,n)}}}}function P(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const r=t[i],a=e[i];let o=e[i],l=!0;if(g(a)){if(n)o=[];else if(g(r))o=r;else if(f(r)){o=new Array(r.length);let t=-1;const e=r.length;for(;++t<e;)o[t]=r[t]}}else d(a)?(o=null!=r?r:{},"function"!=typeof r&&"object"==typeof r||(o={})):l=!1;l&&O(o,a,n,s),L(t,i,o)}function L(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function E(t){let e=-1;const i=arguments.length<=1?0:arguments.length-1;for(;++e<i;)O(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function R(t,e){if(!t||!d(t))return t;const i={};return Object.keys(t).forEach((n=>{const s=t[n];let r=!1;e.forEach((t=>{(p(t)&&t===n||t instanceof RegExp&&n.match(t))&&(r=!0)})),r||(i[n]=s)})),i}function I(t){return h(t)?g(t)?t:[t]:[]}function D(t){if(!g(t))return[t];const e=[];for(const i of t)e.push(...D(i));return e}const U="undefined"!=typeof console;function N(t,e,i){const n=[e].concat([].slice.call(i));U&&console[t].apply(console,n)}var j;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(j||(j={}));class F{static getInstance(t,e){return F._instance&&m(t)?F._instance.level(t):F._instance||(F._instance=new F(t,e)),F._instance}static setInstance(t){return F._instance=t}static setInstanceLevel(t){F._instance?F._instance.level(t):F._instance=new F(t)}static clearInstance(){F._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j.None,e=arguments.length>1?arguments[1]:void 0;this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=j.Info}canLogDebug(){return this._level>=j.Debug}canLogError(){return this._level>=j.Error}canLogWarn(){return this._level>=j.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(){for(var t,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this._level>=j.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):N(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",i)),this}warn(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=j.Warn&&N(this._method||"warn","WARN",e),this}info(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=j.Info&&N(this._method||"log","INFO",e),this}debug(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=j.Debug&&N(this._method||"log","DEBUG",e),this}}F._instance=null;var z=function(t,e,i){return t<e?e:t>i?i:t};function W(t){if(v(t))return t;const e=+t;return v(e)?e:0}const G=t=>e=>w(e,t),H=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o(t))return t;const i=[t];return(e&&e.get||G)(i)},Y=Math.PI,X=Y/2,$=2*Y,V=2*Math.PI,q=Math.abs,K=Math.atan2,Z=Math.cos,J=Math.max,Q=Math.min,tt=Math.sin,et=Math.sqrt,it=Math.pow;function nt(t,e,i,n,s){let r=i,a=n;return"number"==typeof t&&"number"==typeof i&&(r=(1-s)*t+s*i),"number"==typeof e&&"number"==typeof n&&(a=(1-s)*e+s*n),{x:r,y:a}}function st(t,e){return t[0]*e[1]-t[1]*e[0]}class rt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=n}clone(){return new rt(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return m(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return m(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class at{static distancePP(t,e){return et(it(t.x-e.x,2)+it(t.y-e.y,2))}static distanceNN(t,e,i,n){return et(it(t-i,2)+it(e-n,2))}static distancePN(t,e,i){return et(it(e-t.x,2)+it(i-t.y,2))}static pointAtPP(t,e,i){return new rt((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function ot(t){return t*(Math.PI/180)}function lt(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function ht(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function ct(t,e,i,n){if(!function(t,e,i,n){let s=t[0],r=e[0],a=i[0],o=n[0];return r<s&&([s,r]=[r,s]),o<a&&([o,a]=[a,o]),!(r<a||o<s||(s=t[1],r=e[1],a=i[1],o=n[1],r<s&&([s,r]=[r,s]),o<a&&([o,a]=[a,o]),r<a||o<s))}(t,e,i,n))return!1;const s=[0,0],r=[0,0],a=[0,0];if(ht(s,e,t),ht(r,n,i),q((o=s)[0]-(l=r)[0])+q(o[1]-l[1])<1e-12)return!0;var o,l;ht(a,i,t);const h=st(a,r)/st(s,r);return h>=0&&h<=1&&[t[0]+s[0]*h,t[1]+s[1]*h]}var ut;function dt(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function pt(t,e){let{x:i,y:n}=t,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(i-s.x)*Math.cos(e)-(n-s.y)*Math.sin(e)+s.x,y:(i-s.x)*Math.sin(e)+(n-s.y)*Math.cos(e)+s.y}}function gt(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function ft(t,e){const i=e?ot(t.angle):t.angle,n=gt(t);return[pt({x:t.x1,y:t.y1},i,n),pt({x:t.x2,y:t.y1},i,n),pt({x:t.x2,y:t.y2},i,n),pt({x:t.x1,y:t.y2},i,n)]}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(ut||(ut={}));const yt=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,n=e<<10|i,n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};function mt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:s=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(s?s+" ":"")+(r?r+" ":"")+a*i+"px "+(o||"sans-serif")}class vt{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),h(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=h(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(l(this._canvas)&&(h(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),l(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&h(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),l(this._context)&&h(this._canvas)){const t=this._canvas.getContext("2d");h(t)&&(t.save(),t.font=mt(this.textSpec),this._contextSaved=!0,this._context=t)}return!l(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:n={}}=this._option,{fontStyle:s=n.fontStyle,fontVariant:r=n.fontVariant,fontWeight:a=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=n.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(i=n.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:c=(null!=h?h:"center"),baseline:u,textBaseline:d=(null!=u?u:"middle"),ellipsis:g,limit:f}=this._userSpec;let{lineHeight:y=o}=this._userSpec;if(p(y)&&"%"===y[y.length-1]){const t=Number.parseFloat(y.substring(0,y.length-1))/100;y=o*t}return{fontStyle:s,fontVariant:r,fontFamily:l,fontSize:o,fontWeight:a,textAlign:c,textBaseline:d,ellipsis:g,limit:f,lineHeight:y}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(l(t))return{width:0,height:0};if(l(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:a,limit:o,lineHeight:h}=this.textSpec;let c;try{const l=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:!!a,maxLineWidth:o||1/0,lineHeight:h});c={width:l.width(),height:l.height()}}catch(e){this._notSupportVRender=!0,c=this.measureWithNaiveCanvas(t)}return c}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:n,lineHeight:s}=this.textSpec;return{width:i.width,height:null!==(e=s)&&void 0!==e?e:n,fontBoundingBoxAscent:i.fontBoundingBoxAscent,fontBoundingBoxDescent:i.fontBoundingBoxDescent}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;i<t.length;i++){const n=t[i];let s=this._measureSpecialChar(n);l(s)&&vt.NUMBERS_CHAR_SET.includes(n)&&(s=this._measureNumberChar()),l(s)&&["F","W"].includes(yt(n))&&(s=this._measureFullSizeChar()),l(s)&&(s=this._measureLetterChar()),e.width+=s.width,e.height=Math.max(e.height,s.height),!l(s.fontBoundingBoxAscent)&&(e.fontBoundingBoxAscent=s.fontBoundingBoxAscent),!l(s.fontBoundingBoxDescent)&&(e.fontBoundingBoxDescent=s.fontBoundingBoxDescent)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:n,lineHeight:s}=this.textSpec;for(let e=0;e<t.length;e++){const s=t[e],r=["F","W"].includes(yt(s))?1:.53;i.width+=r*n}return i.height=null!==(e=s)&&void 0!==e?e:n,i}_measureReduce(t,e){var i;const{fontSize:n,lineHeight:s}=this.textSpec,r={width:0,height:0};if(l(t))return r;if(g(t)){const a=t.filter(h).map((t=>t.toString()));return 0===a.length?r:1===a.length?e(a[0]):{width:a.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:a.length*((null!==(i=s)&&void 0!==i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(l(this._numberCharSize)){const t=this._standardMethod(vt.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/vt.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return l(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(vt.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(l(this._letterCharSize)){const t=this._standardMethod(vt.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/vt.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(t){return h(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){h(this._canvas)&&(this._canvas=null),h(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}function bt(t,e,i){const{x1:n,y1:s,x2:r,y2:a}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*s+i.e,i.b*n+i.d*s+i.f),t.add(i.a*r+i.c*s+i.e,i.b*r+i.d*s+i.f),t.add(i.a*r+i.c*a+i.e,i.b*r+i.d*a+i.f),t.add(i.a*n+i.c*a+i.e,i.b*n+i.d*a+i.f),e)}vt.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",vt.NUMBERS_CHAR_SET="0123456789",vt.FULL_SIZE_CHAR="字";class xt{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new xt(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}add(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return g(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}scale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const s=this.scalePoints(t,e,i,n);return this.clear().add(s[0],s[1]).add(s[2],s[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return bt(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:n,y1:s,x2:r,y2:a}=this,o=Math.cos(t),l=Math.sin(t),h=e-e*o+i*l,c=i-e*l-i*o;return[o*n-l*s+h,l*n+o*s+c,o*n-l*a+h,l*n+o*a+c,o*r-l*s+h,l*r+o*s+c,o*r-l*a+h,l*r+o*a+c]}scalePoints(t,e,i,n){const{x1:s,y1:r,x2:a,y2:o}=this;return[t*s+(1-t)*i,e*r+(1-e)*n,t*a+(1-t)*i,e*o+(1-e)*n]}}class _t extends xt{}class At extends xt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;var i;super(t),t&&(this.angle=null!==(i=t.angle)&&void 0!==i?i:e)}intersects(t){return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=ft(t,i),s=ft(e,i),r=(t,e)=>[e.x-t.x,e.y-t.y],a=r(gt(t),gt(e)),o=r(n[0],n[1]),l=r(n[1],n[2]),h=r(s[0],s[1]),c=r(s[1],s[2]),u=i?ot(t.angle):t.angle;let d=i?ot(90-t.angle):t.angle+X;const p=i?ot(e.angle):e.angle;let g=i?ot(90-e.angle):e.angle+X;d>V&&(d-=V),g>V&&(g-=V);const f=(t,e,i,n)=>{const s=[Math.cos(e),Math.sin(e)];return t+(dt(s,i)+dt(s,n))/2>dt(s,a)};return f((t.x2-t.x1)/2,u,h,c)&&f((t.y2-t.y1)/2,d,h,c)&&f((e.x2-e.x1)/2,p,o,l)&&f((e.y2-e.y1)/2,g,o,l)}(this,t)}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return super.setValue(t,e,i,n),this.angle=s,this}clone(){return new At(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[pt({x:this.x1,y:this.y1},this.angle,t),pt({x:this.x2,y:this.y1},this.angle,t),pt({x:this.x1,y:this.y2},this.angle,t),pt({x:this.x2,y:this.y2},this.angle,t)]}}class St{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,n,s,r){return!(this.e!==s||this.f!==r||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}setValue(t,e,i,n,s,r){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,n=this.d,s=this.e,r=this.f,a=new St,o=t*n-e*i;return a.a=n/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*r-n*s)/o,a.f=-(t*r-e*s)/o,a}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,s=this.b*e+this.d*i,r=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=n,this.b=s,this.c=r,this.d=a,this}rotateByCenter(t,e,i){const n=Math.cos(t),s=Math.sin(t),r=(1-n)*e+s*i,a=(1-n)*i-s*e,o=n*this.a-s*this.b,l=s*this.a+n*this.b,h=n*this.c-s*this.d,c=s*this.c+n*this.d,u=n*this.e-s*this.f+r,d=s*this.e+n*this.f+a;return this.a=o,this.b=l,this.c=h,this.d=c,this.e=u,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,n,s,r){return this.multiply(t,e,i,n,s,r),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:n,e:s,f:r}=this;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=r,this.f=s,this}multiply(t,e,i,n,s,r){const a=this.a,o=this.b,l=this.c,h=this.d,c=a*t+l*e,u=o*t+h*e,d=a*i+l*n,p=o*i+h*n,g=a*s+l*r+this.e,f=o*s+h*r+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=g,this.f=f,this}interpolate(t,e){const i=new St;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:n,c:s,d:r,e:a,f:o}=this,l=i*r-n*s,h=r/l,c=-n/l,u=-s/l,d=i/l,p=(s*o-r*a)/l,g=-(i*o-n*a)/l,{x:f,y:y}=t;e.x=f*h+y*u+p,e.y=f*c+y*d+g}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new St(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,n=this.d,s=t*n-e*i,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),r.scaleX=a,r.scaleY=s/a,r.skewX=(t*i+e*n)/s,r.skewY=0}else if(0!==i||0!==n){const a=Math.sqrt(i*i+n*n);r.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/a):-Math.acos(i/a)),r.scaleX=s/a,r.scaleY=a,r.skewX=0,r.skewY=(t*i+e*n)/s}return r.rotateDeg=180*r.rotateDeg/Math.PI,r}}function Tt(t,e,i){e/=100,i/=100;const n=(1-Math.abs(2*i-1))*e,s=n*(1-Math.abs(t/60%2-1)),r=i-n/2;let a=0,o=0,l=0;return 0<=t&&t<60?(a=n,o=s,l=0):60<=t&&t<120?(a=s,o=n,l=0):120<=t&&t<180?(a=0,o=n,l=s):180<=t&&t<240?(a=0,o=s,l=n):240<=t&&t<300?(a=s,o=0,l=n):300<=t&&t<360&&(a=n,o=0,l=s),a=Math.round(255*(a+r)),o=Math.round(255*(o+r)),l=Math.round(255*(l+r)),{r:a,g:o,b:l}}function Bt(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,e,i),s=Math.max(t,e,i),r=s-n;let a=0,o=0,l=0;return a=0===r?0:s===t?(e-i)/r%6:s===e?(i-t)/r+2:(t-e)/r+4,a=Math.round(60*a),a<0&&(a+=360),l=(s+n)/2,o=0===r?0:r/(1-Math.abs(2*l-1)),o=+(100*o).toFixed(1),l=+(100*l).toFixed(1),{h:a,s:o,l:l}}const wt=/^#([0-9a-f]{3,8})$/,Mt={transparent:4294967040},Ct={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function kt(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Ot(t){return m(t)?new It(t>>16,t>>8&255,255&t,1):g(t)?new It(t[0],t[1],t[2]):new It(255,255,255)}function Pt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Lt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Et=(t,e)=>{const i=wt.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new It((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?Ot(t):8===e?new It(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class Rt{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Rt(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Rt(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof Rt?t:new Rt(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3();case"wcag":return i.getLuminanceWCAG()}}static parseColorString(t){if(h(Mt[t]))return function(t){return m(t)?new It(t>>>24,t>>>16&255,t>>>8&255,255&t):g(t)?new It(t[0],t[1],t[2],t[3]):new It(255,255,255,1)}(Mt[t]);if(h(Ct[t]))return Ot(Ct[t]);const e=`${t}`.trim().toLowerCase(),i=Et(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new It(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=Tt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new It(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=Rt.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new It(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t))),this}add(t){const{r:e,g:i,b:n}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,n+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const n=this.color.opacity,s=Bt(this.color.r,this.color.g,this.color.b),r=Tt(l(t)?s.h:z(t,0,360),l(e)?s.s:e>=0&&e<=1?100*e:e,l(i)?s.l:i<=1&&i>=0?100*i:i);return this.color=new It(r.r,r.g,r.b,n),this}setRGB(t,e,i){return!l(t)&&(this.color.r=t),!l(e)&&(this.color.g=e),!l(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=Et(e,!0);return null!=i?i:this}setColorName(t){const e=Ct[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){const t=this.color.r/255,e=this.color.g/255,i=this.color.b/255;let n,s,r;return n=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),s=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),r=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*s+.0722*r}clone(){return new Rt(this.color.toString())}copyGammaToLinear(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=Pt(t.color.r),this.color.g=Pt(t.color.g),this.color.b=Pt(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Lt(t.color.r),this.color.g=Lt(t.color.g),this.color.b=Lt(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class It{constructor(t,e,i,n){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),h(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${kt(this.r)+kt(this.g)+kt(this.b)+(1===this.opacity?"":kt(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:n}=Bt(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}class Dt extends e.BaseChartSpecTransformer{transformSpec(t){const{timeData:e,timeNodes:i}=function(t){const{xField:e,yField:i,timeField:n,data:s,topN:r=10,icon:a}=t,o=new Set,l=new Map;return s.sort(((t,i)=>Number(i[e])-Number(t[e]))),s.forEach((t=>{const e=t[n];h(e)&&o.add(e),l.has(e)||l.set(e,[]);const s=l.get(e);if(s.length<r){const e=Object.assign({},t);a&&a[e[i]]&&(e.icon=a[e[i]]),s.push(e)}})),{timeData:l,timeNodes:Array.from(o).sort()}}(t),{interval:n,xField:s,yField:r,color:a,icon:o,iconPosition:l,iconShape:c,timeLabel:u,label:d,nameLabel:p,xAxis:g,yAxis:f}=t,y=n||1e3,m=Math.min(y,500);if(t.type="common",t.data=[{id:"timeData",values:e.get(i[0])},{id:"time",values:[{time:i[0]}]}],t.color={specified:Object.assign({},a)},t.region=[{clip:!0}],t.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:r,xField:s,seriesField:r,extensionMark:[],label:Ut(d,Object.assign(Object.assign({},p),{yField:r}))}],t.axes=function(t={},e={}){const i={orient:"left",type:"band",inverse:!0,label:{style:e.label},domainLine:{style:e.domainLine},grid:{style:e.grid}},n={orient:"bottom",type:"linear",nice:!1,animation:!0,label:{style:t.label},domainLine:{style:t.domainLine},grid:{style:t.grid},innerOffset:{right:"10%"}};t.label&&(n.label=t.label);return[i,n]}(g,f),t.player={type:"continuous",auto:!0,loop:!1,interval:y,specs:i.map((t=>({data:[{id:"timeData",values:e.get(t)},{id:"time",values:[{time:t}]}]})))},t.tooltip={visible:!1},t.customMark=[],function(t,{interval:e,exchangeDuration:i}){t.animationAppear=!1,t.animationUpdate={bar:[{type:"update",options:{excludeChannels:["y"]},easing:"linear",duration:e},{channel:["y"],easing:"circInOut",duration:i}],axis:{duration:e,easing:"linear"}},t.animationEnter={bar:[{type:"moveIn",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}]},t.animationExit={bar:[{type:"moveOut",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(t,{interval:y,exchangeDuration:m}),u&&!1===u.visible||t.customMark.push(function(t={}){return{type:"text",dataId:"time",style:Object.assign({textBaseline:"bottom",fontSize:200,textAlign:"end",fontWeight:600,text:t=>t.time,x:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.width)-50},y:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.height)-80},fill:"grey",fillOpacity:.5},t)}}(u.style)),o){const e=function(t="bar-end",e="circle",{interval:i,exchangeDuration:n}){return{type:"symbol",dataId:"timeData",style:{symbolType:e,stroke:"white",lineWidth:1,size:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const t=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return Math.max(t-4,0)}return 10},background:t=>t.icon,x:(e,i)=>{var n,s;const r=i.vchart,a=null===(n=r.getChart())||void 0===n?void 0:n.getSeriesInIndex(0)[0];if(r&&a){const i=null!==(s=a.getYAxisHelper().getBandwidth(0))&&void 0!==s?s:0;return"bar-start"===t?i/2:"axis"===t?-i/2:a.dataToPositionX(e)-i/2}},y:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const e=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return r.dataToPositionY(t)+e/2}},scaleY:"rect"===e?1.2:1},animationUpdate:Nt(i,n),animationEnter:[{type:"moveIn",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(l,c,{interval:y,exchangeDuration:m});t.series[0].extensionMark.push(e)}super.transformSpec(t)}}function Ut(t={},e){var i,n,s,r;const a=[];return!1!==t.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({fill:"rgb(64, 64, 64)"},t.style),smartInvert:{fillStrategy:(null===(i=t.style)||void 0===i?void 0:i.fill)?"null":void 0,strokeStrategy:(null===(n=t.style)||void 0===n?void 0:n.stroke)?"null":void 0}}),e.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({},e.style),smartInvert:{fillStrategy:(null===(s=e.style)||void 0===s?void 0:s.fill)?"null":void 0,strokeStrategy:(null===(r=e.style)||void 0===r?void 0:r.stroke)?"null":void 0},position:"bar-end"===e.position?"inside-right":"inside-left",formatter:`{${e.yField}}`}),a}function Nt(t,e){return[{duration:e,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:t}]}class jt extends e.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=Dt}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,timeField:a,data:o}=this._spec;return s&&r&&a?!!o||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField`, `timeField` "),!1)}}jt.type="rankingBar",jt.view="singleDefault",jt.transformerConstructor=Dt;const Ft=1e3,zt="#21252c",Wt={labelLayout:"top",bar:{style:{cornerRadius:5}},barBackground:{type:"rect",style:{fill:"rgba(33,37,44,0.1)",cornerRadius:5}},rankingIcon:{visible:!0,style:{fill:zt,size:20}},nameLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:zt,textBaseline:"middle"}},orderLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:zt,textBaseline:"middle"}},valueLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:zt,textBaseline:"middle"}},pageSize:5,scrollSize:1,animationAppear:{enable:!0,type:"grow",duration:Ft,easing:"linear"},animationUpdate:{enable:!0,type:"grow",duration:Ft,easing:"linear"},animationNormal:{interval:Ft}},Gt="dataKey",Ht="VCHART_ORDER",Yt="SUPPLY_DATA_KEY";class Xt extends e.CommonChartSpecTransformer{constructor(){super(...arguments),this.formatMap={},this.paginateDataArr=t=>{const{scrollSize:e=1,pageSize:i=5}=t,n=this.originalData,s={};let r=0;for(let a=0;a<n.length;a+=e)if(r++,s[`page${r}`]=n.slice(a,a+i),a+i-1>=n.length-1){n.push(...Array.from({length:a+i-n.length},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[Yt]:!0}))));break}return{orderCount:r,result:s}},this.processRankingData=t=>{const e=[];t.data.forEach(((t,e)=>t[Ht]=e+1<10?`0${e+1}`:e+1));const i=this.paginateDataArr(t).result,n=this.paginateDataArr(t).orderCount;this.orderCount=n;const s=t.pageSize-i[`page${n}`].length;return i[`page${n}`].push(...Array.from({length:s},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[Yt]:!0})))),Object.keys(i).forEach((n=>{e.push({data:[{id:"datas",values:i[n].map((e=>Object.assign(Object.assign({},e),{[Gt]:e[t.yField]})))},{id:"order",values:[{order:n}]}]})})),e}}isSpecValid(t){const{xField:e,yField:i,data:n}=t;return!!(e&&i&&n&&0!==n.length)}transformSpec(t){var e;super.transformSpec(t),this.isSpecValid(t)?(this.normalizeSpec(t),this.upgradeTextMeasure(t),this.upgradeFormatMap(t),this.processData(t),this.transformBaseSpec(t),this.transformAnimationSpec(t),this.transformAxesSpec(t),t.extensionMark=[this.generateBarBackground(t),...this.generateDecorateHaloIcons(t),this.generateRankingIcon(t),this.generateNameLabel(t),this.generateOrderLabel(t),this.generateValueLabel(t)],this.transformPaddingSpec(t),null===(e=t.customTransformSpec)||void 0===e||e.call(t,t),super.transformSpec(t)):t.series=[]}normalizeSpec(t){(function t(e,i){for(const n in i)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&"object"==typeof i[n]&&null!==i[n]?(e.hasOwnProperty(n)||(e[n]=Array.isArray(i[n])?[]:{}),t(e[n],i[n])):e.hasOwnProperty(n)||"object"!=typeof e||(e[n]=i[n]);return e})(t,Wt),((t,e)=>{e.forEach((e=>{var i,n,s,r,a,o,l;g(t[e])?null===(i=t[e])||void 0===i||i.forEach(((i,n)=>{var s,r,a;t[e][n]=Object.assign(Object.assign({},i),{style:Object.assign(Object.assign({},null==i?void 0:i.style),{visible:null===(a=null!==(r=null===(s=null==i?void 0:i.style)||void 0===s?void 0:s.visible)&&void 0!==r?r:null==i?void 0:i.visible)||void 0===a||a})})})):t[e]=Object.assign(Object.assign({},t[e]),{style:Object.assign(Object.assign({},null===(n=t[e])||void 0===n?void 0:n.style),{visible:null===(l=null!==(a=null===(r=null===(s=t[e])||void 0===s?void 0:s.style)||void 0===r?void 0:r.visible)&&void 0!==a?a:null===(o=t[e])||void 0===o?void 0:o.visible)||void 0===l||l})})}))})(t,["barBackground","rankingIcon","decorateHaloIcons","orderLabel","nameLabel","valueLabel"])}upgradeTextMeasure(t){var e,i,n,s,r,a,o,l,h;null===(e=this.nameLabelTextMeasure)||void 0===e||e.release(),null===(i=this.valueLabelTextMeasure)||void 0===i||i.release(),null===(n=this.orderLabelTextMeasure)||void 0===n||n.release(),this.nameLabelTextMeasure=new vt({defaultFontParams:null!==(r=null===(s=t.nameLabel)||void 0===s?void 0:s.style)&&void 0!==r?r:{}}),this.valueLabelTextMeasure=new vt({defaultFontParams:null!==(o=null===(a=t.valueLabel)||void 0===a?void 0:a.style)&&void 0!==o?o:{}}),this.orderLabelTextMeasure=new vt({defaultFontParams:null!==(h=null===(l=t.orderLabel)||void 0===l?void 0:l.style)&&void 0!==h?h:{}})}upgradeFormatMap(t){this.formatMap[t.yField]=t.nameLabel.formatMethod,this.formatMap[t.xField]=t.valueLabel.formatMethod,this.formatMap[Ht]=t.orderLabel.formatMethod}processData(t){var e;(null===(e=t.data[0])||void 0===e?void 0:e.values)||(this.originalData=t.data,this.originalSpec=k(t),this.dataSpecs=this.processRankingData(t),t.data=this.dataSpecs[0].data)}transformBaseSpec(t){var e,i,n;t.type="common",t.dataKey=Gt,t.series=[{type:"bar",direction:"horizontal",xField:t.xField,yField:t.yField,barWidth:null!==(i=null===(e=t.bar)||void 0===e?void 0:e.height)&&void 0!==i?i:10,bar:Object.assign(Object.assign({},t.bar),{style:Object.assign(Object.assign({},null===(n=t.bar)||void 0===n?void 0:n.style),{x1:0,visible:e=>{var i,n;return!e[Yt]&&(null===(n=null===(i=t.bar)||void 0===i?void 0:i.style)||void 0===n||n)}})})}]}transformAnimationSpec(t){var e,i,n;t.animationUpdate.enable&&this.orderCount>1&&(t.player=Object.assign({specs:this.dataSpecs,auto:!0,visible:!1,interval:(null!==(i=null===(e=t.animationNormal)||void 0===e?void 0:e.interval)&&void 0!==i?i:1e3)+(null!==(n=t.animationUpdate.duration)&&void 0!==n?n:1e3)/2,loop:!0},t.player),t.animationExit=this.getAnimationExit(this.originalSpec),t.animationEnter=this.getAnimationEnter(this.originalSpec),t.animationUpdate=this.getAnimationUpdate(this.originalSpec)),t.animationNormal=this.originalSpec.animationNormal,t.animationAppear=this.getAnimationAppear(this.originalSpec,"rect")}transformAxesSpec(t){const{min:e,max:i}=((t,e)=>{let i,n;const s=t.map((t=>t[e])).filter((t=>null!=t));if(0===s.length)i=0,n=1;else{i=Math.min(...s)-(Math.max(...s)-Math.min(...s))/3,n=(Math.max(...s)-i)/.8+i;const t=10,e=i;i===n&&(i=e-t,n=(4*e+t)/4)}return{min:i,max:n}})(this.originalData,t.xField);t.axes=[{orient:"left",type:"band",visible:!1,inverse:!0,paddingOuter:.5},{orient:"bottom",label:{visible:!0},type:"linear",visible:!1,min:e,max:i}]}generateBarBackground(t){var e;return{type:t.barBackground.type,dataId:"data",visible:!0,dataKey:Gt,zIndex:-99,state:null===(e=t.barBackground)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>"symbol"===t.barBackground.type?i.getRegion().getLayoutRect().width/2:0,y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2-("symbol"===t.barBackground.type?0:t.bar.height/2),size:(e,i)=>[i.getRegion().getLayoutRect().width,t.bar.height],width:(t,e)=>e.getRegion().getLayoutRect().width,height:t.bar.height},t.barBackground.style),{visible:e=>!e[Yt]&&t.barBackground.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"barBack"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateDecorateHaloIcons(t){var e;return null===(e=t.decorateHaloIcons)||void 0===e?void 0:e.map((e=>({type:"symbol",dataId:"data",visible:!0,dataKey:Gt,state:null==e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>{if(void 0!==e[t.xField]&&null!==e[t.xField])return i.valueToX([e[t.xField]])},y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2},e.style),{visible:t=>!t[Yt]&&e.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"symbol"),animationUpdate:this.getAnimationUpdate(this.originalSpec)})))}generateRankingIcon(t){return{type:"symbol",dataId:"data",visible:!0,dataKey:Gt,state:t.rankingIcon.state,style:Object.assign(Object.assign({x:e=>"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+(t.orderLabel.style.visible?5+this.orderLabelTextMeasure.fullMeasure(this.formatDatum(Ht,e)).width:0)+8):5,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5-Math.max(this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).height,this.orderLabelTextMeasure.fullMeasure(this.formatDatum(Ht,e)).height)/2},t.rankingIcon.style),{lineWidth:0,stroke:null,visible:e=>!e[Yt]&&t.rankingIcon.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateNameLabel(t){var e;return{type:"text",dataId:"data",dataKey:Gt,state:null===(e=t.nameLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.yField,e),x:()=>{var e;return"bothEnd"===t.labelLayout?-10:(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,Ht,this.orderLabelTextMeasure):0)},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.nameLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[Yt]&&t.nameLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateOrderLabel(t){var e;return{type:"text",dataId:"data",dataKey:Gt,state:null===(e=t.orderLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(Ht,t),x:e=>{var i;return"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+5):t.rankingIcon.style.visible?8+(null!==(i=t.rankingIcon.style.size)&&void 0!==i?i:10):0},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.orderLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[Yt]&&t.orderLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateValueLabel(t){var e;return{type:"text",dataId:"data",visible:!0,dataKey:Gt,state:null===(e=t.valueLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.xField,e),x:(e,i)=>"bothEnd"===t.labelLayout?i.getRegion().getLayoutRect().width+5:i.getRegion().getLayoutRect().width,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.valueLabel.style),{textAlign:"bothEnd"===t.labelLayout?"left":"right",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[Yt]&&t.valueLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}transformPaddingSpec(t){var e;const i=t.decorateHaloIcons.length>0?Math.max(...t.decorateHaloIcons.map((t=>{var e,i;return null!==(i=null===(e=t.style)||void 0===e?void 0:e.size)&&void 0!==i?i:18}))):0;t.padding=Object.assign({left:"bothEnd"===t.labelLayout?10+this.getMaxDataLabelLens(t,t.yField,this.nameLabelTextMeasure)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,Ht,this.orderLabelTextMeasure):0)+(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+5:5+i/2,right:"bothEnd"===t.labelLayout?5+this.getMaxDataLabelLens(t,t.xField,this.valueLabelTextMeasure)+5:15,top:0,bottom:0},t.padding)}getMaxDataLabelLens(t,e,i){const n=this.originalData.map((t=>t[Yt]?0:i.fullMeasure(this.formatDatum(e,t)).width));return Math.max(...n)}formatDatum(t,e){var i;return(null===(i=this.formatMap)||void 0===i?void 0:i[t])?this.formatMap[t](e[t],e):e[t]}getLabelWidth(t,e){return e+t}getAnimationExit(t){var e,i,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveOut",options:{direction:"y",orient:"negative",point:(e,i)=>({y:i.getGraphicAttribute("y")-t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationEnter(t){var e,i,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveIn",options:{direction:"y",orient:"negative",excludeChannels:["y"],point:(e,i)=>({y:i.getGraphicAttribute("y")+t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationAppear(t,e){var i,n,s,r,a,o,l,h,c,u,d,p,g;return!1!==(null===(i=t.animationAppear)||void 0===i?void 0:i.enable)&&("rect"===e?{type:"growWidthIn",oneByOne:!1,duration:null!==(s=null===(n=t.animationAppear)||void 0===n?void 0:n.duration)&&void 0!==s?s:1e3,easing:null!==(a=null===(r=t.animationAppear)||void 0===r?void 0:r.easing)&&void 0!==a?a:"linear",options:{}}:"symbol"===e?{channel:{x:{from:0,to:(t,e)=>e.getGraphicItem().attribute.x}},duration:null!==(l=null===(o=t.animationAppear)||void 0===o?void 0:o.duration)&&void 0!==l?l:1e3,easing:null!==(c=null===(h=t.animationAppear)||void 0===h?void 0:h.easing)&&void 0!==c?c:"linear"}:{channel:{opacity:{from:0,to:1}},duration:null!==(d=null===(u=t.animationAppear)||void 0===u?void 0:u.duration)&&void 0!==d?d:1e3,easing:null!==(g=null===(p=t.animationAppear)||void 0===p?void 0:p.easing)&&void 0!==g?g:"linear"})}getAnimationUpdate(t){var e,i,n,s;return!1!==t.animationUpdate.enable&&{duration:null!==(i=null===(e=t.animationUpdate)||void 0===e?void 0:e.duration)&&void 0!==i?i:1e3,easing:null!==(s=null===(n=t.animationUpdate)||void 0===n?void 0:n.easing)&&void 0!==s?s:"linear"}}}class $t extends e.BaseChart{constructor(){super(...arguments),this.type="rankingList",this.transformerConstructor=Xt}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}$t.type="rankingList",$t.view="singleDefault",$t.transformerConstructor=Xt;const Vt=(t,e)=>{var i,n;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const s=e.fields,r=t[0],a={},o=[];for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)){const l=s[e];if(!l.type){let n=r;e in r||(n=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),l.type="number"==typeof n[e]?"linear":"ordinal"}let h;if("number"==typeof l.sortIndex&&(h={key:e,type:l.type,index:l.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===l.sortReverse},o.push(h)),(null===(n=l.domain)||void 0===n?void 0:n.length)>0)if("ordinal"===l.type){l._domainCache={},a[e]=l;const t={};l.domain.forEach(((e,i)=>{t[e]=i,l._domainCache[e]=i})),h&&(h.sortIndex=t,h.sortIndexCount=l.domain.length)}else l.domain.length>=2&&(a[e]=l)}return Object.keys(a).length>0&&(t=t.filter((t=>{for(const e in a){const i=a[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),o.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let n=0;n<i.length;n++){const s=i[n];let r=0;if("ordinal"===s.type?(void 0===s.sortIndex[e[s.key]]&&(s.sortIndex[e[s.key]]=s.sortIndexCount++),void 0===s.sortIndex[t[s.key]]&&(s.sortIndex[t[s.key]]=s.sortIndexCount++),r=s.sortIndex[t[s.key]]-s.sortIndex[e[s.key]]):"linear"===s.type&&(r=t[s.key]-e[s.key]),s.sortReverse&&(r=-r),0!==r)return r}return 0}(t,e,o))),t};let qt=0;const Kt="_data-view-diff-rank";class Zt{constructor(t,e){var i=this;let n;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new s,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{pushHistory:!0,emitMessage:!0};return i.isRunning=!0,i.resetTransformData(),i.transformsArr.forEach((e=>{i.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),i.isLastTransform(e)&&i.diffLastData()})),i.isRunning=!1,!1!==t.emitMessage&&i.target.emit("change",[]),i},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},n=(null==e?void 0:e.name)?e.name:function(){return qt>1e8&&(qt=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+qt++}("dataview"),this.name=n,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(n,this),this.setFields(null==e?void 0:e.fields)}parse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var n;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const s=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(n=this.dataSet.getParser(e.type))&&void 0!==n?n:this.dataSet.getParser("bytejson"))(s,e.options,this);this.rawData=s,this.parserData=t,this.history&&this.historyData.push(s,t),this.latestData=t}else this.parserData=s,this.rawData=s,this.history&&this.historyData.push(s),this.latestData=s;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,n;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(n=e.level)&&void 0!==n?n:0)}))}executeTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{pushHistory:!0,emitMessage:!0};const{pushHistory:i,emitMessage:n}=e,s=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(s),this.latestData=s,!1!==n&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData)return;if(!this.latestData.forEach)return;if(!(null===(t=this._diffKeys)||void 0===t?void 0:t.length))return;const e=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((t=>{t[Kt]=e,this._diffMap.set(this._diffKeys.reduce(((e,i)=>e+t[i]),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let t;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((i=>{i[Kt]=e,t=this._diffKeys.reduce(((t,e)=>t+i[e]),""),this._diffMap.get(t)?this.latestDataAUD.update.push(i):this.latestDataAUD.add.push(i),this._diffMap.set(t,i)})),this._diffMap.forEach(((t,i)=>{t[Kt]<e&&(this.latestDataAUD.del.push(t),this._diffMap.delete(i))}))}this._diffRank=e}cloneParseData(t,e){let i=!1;return t instanceof Zt||!0!==(null==e?void 0:e.clone)||(i=!0),i?k(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?E({},this._fields,t):t;const i=this.transformsArr.find((t=>"fields"===t.type));!l(this._fields)&&l(i)?(this.dataSet.registerTransform("fields",Vt),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function Jt(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i}class Qt extends e.FunnelChart.transformerConstructor{transformSpec(t){const{conversionArrow:e,extensionMark:i=[],funnelBackground:n}=t;if(e&&e.arrows&&e.arrows.length){const t=function(t){const{arrows:e}=t,i=Jt(t,["arrows"]),n=e.filter((t=>"left"===t.position)),s=e.filter((t=>"right"===t.position)),r=te(s,i),a=te(n,i),o=[];r&&(r.name="arrowRight",o.push(r));a&&(a.name="arrowLeft",o.push(a));return o}(e);t&&t.length&&i.push(...t)}if(n&&n.visible){const t=function(t){const{style:e={}}=t,i=Jt(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},de),e),{x:0,y:(t,e)=>e.getPoints(t)[0].y,width:(t,e)=>{const i=e.getRegion(),{width:n}=i.getLayoutRect();return n},height:(t,e)=>{const i=e.getPoints(t),n=i[0];return i[3].y-n.y}})})}(n);t&&i.push(t)}t.extensionMark=i,super.transformSpec(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.conversionArrow=t.conversionArrow,e.funnelBackground=t.funnelBackground,e}}function te(t,e){if(0===(null==t?void 0:t.length))return null;const{line:i,symbol:n,text:s,margin:r}=e,a=[],l={type:"group",children:[]},h=function(t={},e){const{style:i={}}=t,n=Jt(t,["style"]),s=(t,e)=>{var i,n;const{from:s,to:r}=t,{vchart:a}=e,o=null===(n=null===(i=null==a?void 0:a.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===n?void 0:n.latestData;return!(r>o.length-1||s>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},n),{dataKey:t=>`${t.id}`,style:Object.assign(Object.assign(Object.assign({},he),i),{renderable:s,points:(t,i)=>{if(!s(t,i))return[];let n=t.layout.points;return n=ee(t,i,e),n}})})}(i,r);h&&a.push(h);const c=function(t={},e){const{style:i={}}=t,n=Jt(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},n),{style:Object.assign(Object.assign(Object.assign({},ce),i),{x:(t,i)=>{var n,s;let r=t.layout.points;return r=ee(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.x)&&void 0!==s?s:NaN},y:(t,i)=>{var n,s;let r=t.layout.points;return r=ee(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.y)&&void 0!==s?s:NaN},angle:t=>"left"===t.position?90:-90})})}(n,r);c&&a.push(c);const u=function(t={},e){const{style:i={},formatMethod:n,textMargin:s=4}=t,r=Jt(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},r),{style:Object.assign(Object.assign(Object.assign({},ue),{text:(t,e)=>{var i,s,r,a,l,h,c;const{text:u}=t;let d=u;if(o(n)){const{vchart:o}=e,{from:p,to:g}=t,{field:f}=t.context,y=null!==(r=null===(s=null===(i=null==o?void 0:o.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===s?void 0:s.latestData)&&void 0!==r?r:[],m=null!==(c=null===(h=null===(l=null===(a=null==o?void 0:o.getChart())||void 0===a?void 0:a.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===h?void 0:h.latestData)&&void 0!==c?c:[],v=m.find((t=>t[f]===y[p][f])),b=m.find((t=>t[f]===y[g][f]));d=n(u,{arrow:t,from:v,to:b})}return d},x:(t,i)=>{var n,r;let a=t.layout.points;return a=ee(t,i,e),null!==(r=(null===(n=a[1])||void 0===n?void 0:n.x)+("left"===t.position?-s:s))&&void 0!==r?r:NaN},y:(t,i)=>{var n,s,r;let a=t.layout.points;return a=ee(t,i,e),null!==(r=((null===(n=a[1])||void 0===n?void 0:n.y)+(null===(s=a[2])||void 0===s?void 0:s.y))/2)&&void 0!==r?r:NaN},textAlign:t=>"left"===t.position?"right":"left",textBaseline:"middle"}),i)})}(s,r);return u&&a.push(u),l.children=a,l}function ee(t,e,i){var n,s,r,a,o;const{vchart:l}=e,{from:h,to:c}=t,{field:u}=t.context,d=null===(s=null===(n=null==l?void 0:l.getChart())||void 0===n?void 0:n.getSeriesData())||void 0===s?void 0:s.latestData,p=null===(o=null===(a=null===(r=null==l?void 0:l.getChart())||void 0===r?void 0:r.getAllSeries()[0])||void 0===a?void 0:a.getViewData())||void 0===o?void 0:o.latestData;let g=[];if(d&&d.length){const n=p.find((t=>t[u]===d[h][u])),s=p.find((t=>t[u]===d[c][u])),r=p[0];if(n&&s&&r){g=function(t,e,i,n,s=12){const{layout:r,distance:a,position:o}=t,{level:l,fromIndex:h,toIndex:c,fromTotal:u,toTotal:d}=r,p="right"===o,g=p?e[1]:e[0],f=p?e[2]:e[3],y=Math.abs(g.y-f.y),m=p?i[1]:i[0],v=p?i[2]:i[3],b=Math.abs(m.y-v.y),x=p?n[1]:n[0],_=y/(u+1),A=b/(d+1),S=g.y+_*(h+1),T=m.y+A*(c+1),B=p?-1:1,w=[{x:g.x-s*B,y:S},{x:x.x-(s+(l+1)*a)*B,y:S},{x:x.x-(s+(l+1)*a)*B,y:T},{x:m.x-s*B,y:T}];return w}(t,e.getPoints(n),e.getPoints(s),e.getPoints(r),i),t.layout.points=g}}return g}function ie(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return n>s&&r>i}function ne(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return i===s&&n===r}const se=(t,e)=>{var i,n,s;if(!t||!(null===(i=t.arrows)||void 0===i?void 0:i.length))return[];const{arrows:r}=t,a=function(t,e){return t.filter((t=>v(t.from*t.to))).map(((t,i)=>{const{from:n,to:s,position:r="right"}=t;return Object.assign(Object.assign({},t),{position:r,distance:t.distance||40,from:Math.min(n,s),to:Math.max(n,s),span:Math.abs(n-s),isLayout:!1,context:{field:e},layout:{level:0},id:`${n}-${s}-${r}-${i}`})}))}(r,e.categoryField),o=a.filter((t=>"left"===t.position)),l=a.filter((t=>"right"===t.position));return[...null!==(n=re(o))&&void 0!==n?n:[],...null!==(s=re(l))&&void 0!==s?s:[]]};function re(t){if(0===(null==t?void 0:t.length))return null;const e=new Map;return t.forEach((t=>{const i=e.get(t.from);if(h(i)){const e=i.fromArrows.find((e=>ne(e,t)));e?t.layout.duplicateNode=e:i.degree+=1,i.fromArrows.push(t)}else e.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const n=e.get(t.to);if(h(n)){const e=n.toArrows.find((e=>ne(e,t)));e?t.layout.duplicateNode=e:n.degree+=1,n.toArrows.push(t)}else e.set(t.to,{toArrows:[t],fromArrows:[],totalArrows:[],degree:1})})),e.forEach((t=>{t.fromArrows.sort(((t,e)=>e.span-t.span)),t.toArrows.sort(((t,e)=>t.span-e.span)),t.totalArrows=[...t.toArrows,...t.fromArrows]})),t.sort(((t,e)=>t.span-e.span)).forEach((i=>{var n;const s=t.filter((t=>t.layout.isLayout)),r=((t,e)=>{var i;if(0===t.length)return;let n=t[0];for(let s=1;s<t.length;s++){const r=t[s];(null!==(i=null==e?void 0:e(r,n))&&void 0!==i?i:r-n)>0&&(n=r)}return n})(s,((t,e)=>t.layout.level-e.layout.level));let a=null!==(n=null==r?void 0:r.layout.level)&&void 0!==n?n:0;for(;a>=0;){if(s.some((t=>t.layout.level===a&&ie(t,i)))){a+=1;break}--a}i.layout.level=Math.max(0,a),i.layout.fromTotal=e.get(i.from).degree,i.layout.toTotal=e.get(i.to).degree;const o=i.layout.duplicateNode;o?(i.layout.fromIndex=o.layout.fromIndex,i.layout.toIndex=o.layout.toIndex):(i.layout.fromIndex=ae(i,e.get(i.from).totalArrows),i.layout.toIndex=ae(i,e.get(i.to).totalArrows)),i.layout.isLayout=!0})),t}function ae(t,e){let i=0,n=0;for(let s=0;s<e.length;s++){const r=e[s];if(r===t){i=s-n;break}r.layout.duplicateNode&&n++}return i}class oe extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=Qt}}oe.type="conversionFunnel",oe.transformerConstructor=Qt;class le extends e.FunnelSeries{initData(){var t;super.initData();const{conversionArrow:i}=this._spec;i&&(null===(t=i.arrows)||void 0===t?void 0:t.length)&&(this._arrowData=new Zt(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",se),this._arrowData.parse(i).transform({type:"conversionArrow",options:{categoryField:this._spec.categoryField}}))}afterCompile(){var t;null===(t=super.afterCompile)||void 0===t||t.call(this);const e=this.getMarkInName("arrowRight");e&&e.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.getProduct().transform([{type:"filter",callback:t=>"right"===t.position}])}));const i=this.getMarkInName("arrowLeft");i&&i.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.getProduct().transform([{type:"filter",callback:t=>"left"===t.position}])}))}}const he={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},ce={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},ue={fill:"#606773",fontSize:12},de={fill:"#eff1f9"},pe="dataKey";class ge extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r;super.transformSpec(t);const a=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].nodes;e.push({data:[{id:"nodes",values:n.map(((t,e)=>Object.assign(Object.assign({},t),{[pe]:e})))},{id:"endpoints",values:[]},{id:"iter",values:[{iter:i}]},{id:"background",values:[{iter:i,x:t.scope[0],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[1]}]}]})})),e}(t),o="neighborhood"!==t.taskType;t.type="common",t.dataKey=pe,t.data=a[0].data,t.series=[{id:"background-series",type:"area",dataId:"background",interactive:!1,persent:!0,xField:"x",yField:"y",point:{visible:!1},line:{visible:!1},area:{visible:!0,interactive:!1,style:{background:e=>"neighborhood"===t.taskType?"":`https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/sequence-scatter-bgimg-2/${e.iter}.png`,fill:"transparent",fillOpacity:.5}},hover:{enable:!1},select:{enable:!1}},{id:"line-series",type:"line",dataId:"endpoints",xField:"x",yField:"y",seriesField:"edgeId",animation:!0,point:{visible:!1},line:{visible:!0,style:{stroke:t=>t.color,lineDash:t=>"same_type"===t.type?[0,0]:[3,2],lineWidth:.8,strokeOpacity:.6}}},{id:"scatter-series",type:"scatter",dataId:"nodes",xField:t.xField,yField:t.yField,seriesField:"label",point:{state:{hover:{scaleX:1.5,scaleY:1.5,fillOpacity:1},hover_reverse:{scaleX:1,scaleY:1,fillOpacity:.3}},style:{size:()=>"neighborhood"===t.taskType?6:4,fill:e=>{var i;return null!==(i=t.labelColor[e.label])&&void 0!==i?i:"gray"},fillOpacity:t=>t.confidence}},label:{visible:!0,style:{visible:()=>"neighborhood"==t.taskType,type:"text",fontFamily:"Console",fontStyle:"italic",fontSize:12,fill:"black",fillOpacity:.6,text:t=>t.id}}}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",inverse:!0,min:t.scope[1],max:t.scope[3]},{orient:"bottom",type:"linear",min:t.scope[0],max:t.scope[2]}],t.customMark=[{type:"text",dataId:"iter",style:Object.assign({x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.legends=[{seriesId:"scatter-series",visible:!0,orient:"right",position:"middle",data:t=>t.map((t=>(t.shape.outerBorder={stroke:t.shape.fill,distance:2,lineWidth:1},t))),title:{visible:!0,align:"left",textStyle:{text:"Classes",fontFamily:"Console",fontSize:18,fontWeight:"bold"}},item:{visible:!0,width:"8%",value:{alignRight:!0,style:{fill:"#000",fillOpacity:1,fontSize:12},state:{unselected:{fill:"#d8d8d8"}}}}}],t.tooltip={visible:o,seriesId:"scatter-series",lockAfterClick:!1,activeType:"mark",trigger:"hover",mark:{title:{visible:!0,value:"Info"},content:[{key:"Label",value:t=>t.label,shapeType:"circle",shapeSize:8},{key:"Prediction",value:t=>t.prediction,shapeType:"circle",shapeSize:8,shapeFill:e=>{var i;return null!==(i=t.labelColor[e.prediction])&&void 0!==i?i:"gray"}},{key:"Confidence",value:t=>t.confidence.toFixed(2),shapeType:"square",shapeSize:8,shapeFill:t=>t.label===t.prediction?"green":"red"}]},style:{panel:{padding:{top:10,bottom:15,left:10,right:10},backgroundColor:"#fff",border:{color:"#eee",width:1,radius:10}},titleLabel:{fontSize:20,fontFamily:"Times New Roman",fill:"brown",fontWeight:"bold",textAlign:"center",lineHeight:24},keyLabel:{fontSize:16,fontFamily:"Times New Roman",fill:"black",textAlign:"center",lineHeight:15,spacing:10},valueLabel:{fontSize:14,fill:"black",textAlign:"center",lineHeight:15,spacing:10}}},t.dataZoom=[{visible:!1,orient:"left",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}},{visible:!1,orient:"bottom",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}}],super.transformSpec(t)}}class fe extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=ge}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}fe.type="sequenceScatterLink",fe.view="singleDefault",fe.transformerConstructor=ge;const ye=.2;function me(t){const e=Math.sqrt((2*Math.PI)**2);return Math.exp(-(t**2)/2)/e}const ve="dataKey";class be extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r,a;super.transformSpec(t);const o=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[ve]:e}))),s=function(t,e=100,i){const n=t.reduce(((t,e)=>{const i=e.label;return t[i]=t[i]||[],t[i].push(e),t}),{}),s=[];return Object.entries(n).forEach((([t,n])=>{const r=i||function(t){return t.length**(-1/6)}(n),a=n.map((t=>t.x)),o=n.map((t=>t.y)),l=Math.min(...a),h=Math.max(...a),c=Math.min(...o),u=Math.max(...o),d=l-(h-l)*ye,p=c-(u-c)*ye;for(let i=0;i<e;i++)for(let a=0;a<e;a++){const e=d+.1*i,o=p+.1*a;let l=0;for(const t of n)l+=me(Math.sqrt((e-t.x)**2+(o-t.y)**2)/r);l/=n.length*r*r,s.push({x:e,y:o,kde:l,label:t})}})),s}(n,150);e.push({data:[{id:"nodes",values:n},{id:"iter",values:[{iter:i}]},{id:"kde",values:s}]})})),e}(t);t.type="common",t.dataKey=ve,t.data=o[0].data,t.scales=[{id:"colorScale",type:"ordinal",specified:{0:"rgb(150, 10, 100)",1:"rgb(31, 119, 180)",2:"rgb(255, 127, 14)",3:"rgb(44, 160, 44)",4:"rgb(214, 39, 40)",5:"rgb(148, 103, 189)",6:"rgb(140, 86, 75)",7:"rgb(227, 119, 194)",8:"rgb(127, 127, 127)",9:"rgb(188, 189, 34)",10:"rgb(23, 190, 207)"}},{id:"brighterColorScale",type:"ordinal",specified:{0:"rgb(150, 10, 150)",1:"rgb(31, 119, 230)",2:"rgb(255, 127, 64)",3:"rgb(44, 160, 94)",4:"rgb(214, 39, 90)",5:"rgb(148, 103, 239)",6:"rgb(140, 86, 125)",7:"rgb(227, 119, 244)",8:"rgb(127, 127, 177)",9:"rgb(188, 189, 84)",10:"rgb(23, 190, 255)"}},...null!==(e=t.scales)&&void 0!==e?e:[]],t.series=[{type:"scatter",dataIndex:0,xField:t.xField,yField:t.yField,seriesField:t.seriesField,size:5,point:{zIndex:1e3,style:{fill:{scale:"colorScale",field:t.seriesField}}}}];t.customMark=[{type:"text",dataIndex:1,style:Object.assign({text:t=>t.iter,x:10,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:25,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(i=t.infoLabel)||void 0===i?void 0:i.style)},{type:"symbol",dataIndex:2,style:{symbolType:"rect",x:(t,e)=>54+(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToX)([t.x]),y:(t,e)=>(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToY)([t.y])+26,size:5,fill:{scale:"brighterColorScale",field:"label"},fillOpacity:t=>10*t.kde}}],t.tooltip={visible:!0,fields:["x","y","label"]},t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:o}),t.animationAppear={duration:null!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"},t.animationUpdate={duration:null!==(a=null===(r=t.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",nice:!0},{orient:"bottom",type:"linear",nice:!0,label:{visible:!0}}],super.transformSpec(t)}}class xe extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterKDE",this.transformerConstructor=be}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}xe.type="sequenceScatterKDE",xe.view="singleDefault",xe.transformerConstructor=be;const _e="dataKey";function Ae(t){const e=[];return Object.keys(t.data).forEach((i=>{let n=null;if(t.backgroundColors&&t.backgroundColors[i]){const e=function(t,e){var i;if("undefined"==typeof document)throw new Error("Canvas rendering requires browser environment with document object");const n=document.createElement("canvas");n.width=e.width,n.height=e.height;const s=n.getContext("2d");if(!s)throw new Error("Failed to get 2D rendering context from canvas");const r=s.createImageData(e.width,e.height);for(let e=0;e<300;e++)for(let n=0;n<300;n++){const s=(null===(i=t[e])||void 0===i?void 0:i[n])||[0,0,0],a=4*(300*e+n);r.data[a]=Math.round(255*s[0]),r.data[a+1]=Math.round(255*s[1]),r.data[a+2]=Math.round(255*s[2]),r.data[a+3]=255}return s.putImageData(r,0,0),n.toDataURL("image/png")}(t.backgroundColors[i],t);n={imageData:e}}e.push({data:[{id:"nodes",values:t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[_e]:e})))},{id:"inter",values:[{inter:i}]},{id:"background",values:n?[n]:[]}]})})),e}class Se extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r;super.transformSpec(t);const a=Ae(t);t.type="common",t.dataKey=_e,t.data=a[0].data,t.width=300,t.height=300,t.autoFit=!1,t.series=[{type:"scatter",xField:t.xField,yField:t.yField}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear"},{orient:"bottom",label:{visible:!0},type:"linear"}],t.customMark=[{type:"image",dataIndex:2,style:{x:0,y:0,width:300,height:300,image:t=>t.imageData,zIndex:-1}},{type:"text",dataIndex:1,style:Object.assign({text:t=>t.inter,x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.tooltip={visible:!1},super.transformSpec(t)}}class Te extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=Se}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}Te.type="sequenceScatterPixel",Te.view="singleDefault",Te.transformerConstructor=Se;class Be extends e.SankeyChartSpecTransformer{constructor(){super(...arguments),this.seriesType="compareSankey"}transformSpec(t){super.transformSpec(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.subNodeGap=t.subNodeGap,e.compareNodeColor=t.compareNodeColor,e.compareLinkColor=t.compareLinkColor,e.activeLink=t.activeLink,e}}const we=t=>{const e=t[0];if(!e.latestData)return[];const i=Object.keys(e.latestData);if(!i.length)return{};const n=[];return i.forEach((t=>{n.push(...e.latestData[t].nodes)})),[{nodes:n}]},Me=t=>{let e=0;return t.forEach((t=>{var i;l(t.value)&&((null===(i=t.children)||void 0===i?void 0:i.length)?t.value=Me(t.children):t.value=0),e+=Math.abs(t.value)})),e};function Ce(t,e){const i=[],n=[],s={},r={},a=[];return function(t,e,i=[],n={},s){Me(t);const r=(t,a,o)=>{t.forEach(((t,h)=>{const c=e?e(t):o?`${o[o.length-1].key}-${h}`:`${a}-${h}`,u=l(t.value)?0:W(t.value);if(n[c])n[c].value=void 0;else{const e={depth:a,datum:t,index:h,key:c,value:u,sourceLinks:[],targetLinks:[]};n[c]=e,i.push(e)}o&&s&&s.push({source:o[o.length-1].key,target:c,value:u,parents:o}),t.children&&t.children.length&&r(t.children,a+1,o?o.concat([n[c]]):[n[c]])}))};r(t,0,null)}(t,e,i,s,a),a.forEach(((t,e)=>{const i=`${t.source}-${t.target}`,a=R(t,["parents"]);if(a.parents=t.parents.map((t=>R(t,["sourceLinks","targetLinks"]))),r[i])return r[i].value+=W(t.value),void r[i].datum.push(a);const o={index:e,key:`${t.source}-${t.target}`,source:t.source,target:t.target,datum:[a],value:t.value,parents:t.parents.map((t=>t.key))};n.push(o),s[t.source].sourceLinks.push(o),s[t.target].targetLinks.push(o),r[i]=o})),{nodes:i,links:n,nodeMap:s}}const ke=(t,e)=>{var i;const n=t[0];if(!(null===(i=n.latestData)||void 0===i?void 0:i.length))return{};const s=e.rawData().latestData[0],r=e.subNodeGap,a=o(e.nodeKey)?e.nodeKey:e.nodeKey?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(g(t)){const i=t.map((t=>H(t,e)));return t=>i.map((e=>e(t)))}return H(t,e)}(e.nodeKey):null,h={};s.subNode.forEach((t=>{h[t.type]=Ce(t.nodes,a),function(t){for(let e=0,i=t.length;e<i;e++){const i=t[e];i.value=Math.max(l(i.value)?0:W(i.value),i.sourceLinks.reduce(((t,e)=>{var i;return t+(null!==(i=W(e.value))&&void 0!==i?i:0)}),0),i.targetLinks.reduce(((t,e)=>{var i;return t+(null!==(i=W(e.value))&&void 0!==i?i:0)}),0))}}(h[t.type].nodes)}));const c=Object.keys(h).length;return n.latestData[0].nodes.forEach((t=>{let e=[];if(t.targetLinks.length){e=[...t.targetLinks[0].parents]}e.push(t.key);let i=t.y0;const n=t.y1-t.y0-(c-1)*r,a=t.value;s.subNode.forEach((e=>{const s=h[e.type].nodes.find((e=>e.key===t.key));if(!s)return;const o=s.value/a;s.x0=t.x0,s.x1=t.x1,s.y0=i,s.y1=i+n*o,s.type=e.type,s.sourceNode=t,i+=n*o+r}))})),h},Oe=t=>"line"===t||"area"===t;class Pe extends e.SankeyChart{constructor(){super(...arguments),this.type="compareSankey",this.seriesType=Le.type,this.transformerConstructor=Be}}Pe.type="compareSankey",Pe.transformerConstructor=Be;class Le extends e.SankeySeries{constructor(){super(...arguments),this.type="compareSankey",this._fillCompareNode=t=>{var e,i,n;return(null===(e=this._spec.compareNodeColor)||void 0===e?void 0:e[t.type])?this._spec.compareNodeColor[t.type]:null!==(n=null===(i=this._spec.node.style)||void 0===i?void 0:i.fill)&&void 0!==n?n:this._fillByNode(t)},this._fillActiveLink=t=>{var e,i,n;return(null===(e=this._spec.compareLinkColor)||void 0===e?void 0:e[t.type])?this._spec.compareLinkColor[t.type]:null!==(n=null===(i=this._spec.link.style)||void 0===i?void 0:i.fill)&&void 0!==n?n:this._fillByLink(t)}}initData(){var t;super.initData();const{dataSet:i}=this._option,n=new Zt(i,{name:`compare-sankey-sub-data-${this.id}-data`});n.parse([this.getViewData()],{type:"dataview"}),this._subData=n;const s=new Zt(i,{name:`compare-sankey-node-${this.id}-data`});s.parse([n],{type:"dataview"}),e.registerDataSetInstanceTransform(this._dataSet,"compareSankeySubData",ke),n.transform({type:"compareSankeySubData",options:{rawData:()=>this.getRawData(),valueField:this._valueField,nodeKey:this._spec.nodeKey,subNodeGap:null!==(t=this._spec.subNodeGap)&&void 0!==t?t:2}}),e.registerDataSetInstanceTransform(this._dataSet,"compareSankeySubNodes",we),s.transform({type:"compareSankeySubNodes"}),this._nodesSeriesData.getDataView().parse([s],{type:"dataview"}),this._activeLinkData=new Zt(i,{name:`compare-sankey-link-${this.id}-data`})}initEvent(){var t;super.initEvent(),null===(t=this._activeLinkData)||void 0===t||t.target.addListener("change",this.activeLinkDataUpdate.bind(this))}initMark(){super.initMark();const t=this._createMark(Object.assign(Object.assign({},e.SankeySeries.mark.link),{name:"activeLink"}),{dataView:this._activeLinkData});t&&(this._activeLinkMark=t)}compileData(){var t;super.compileData(),null===(t=this._activeLinkMark)||void 0===t||t.compileData()}_initLinkMarkStyle(){super._initLinkMarkStyle(),this._activeLinkMark.setAttribute("direction",this.direction),this.setMarkStyle(this._activeLinkMark,{x0:t=>t.x0,x1:t=>t.x1,y0:t=>t.y0,y1:t=>t.y1,thickness:t=>t.thickness},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series),this.setMarkStyle(this._activeLinkMark,{fill:this._fillActiveLink},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.User_Mark)}_initNodeMarkStyle(){super._initNodeMarkStyle(),this._spec.compareNodeColor&&this.setMarkStyle(this._nodeMark,{fill:this._fillCompareNode},"normal",e.AttributeLevel.User_Mark)}activeLinkDataUpdate(){this._activeLinkMark.getData().updateData()}_handleNodeRelatedClick(t,i,n){const s=t.getDatum(),r=this._nodeMark.getProductElements();if(!r||!r.length)return;const a=this._linkMark.getProductElements();if(!a||!a.length)return;a.forEach((t=>{t.removeState([e.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS])})),this._highLightElements(a,[],i,n);const o=r.map((t=>{return(e=t)&&e.graphicItem?Oe(e.graphicItem.type)?e.data:e.data[0]:null;var e})),l=o.filter((t=>t.key===s.key)),h=[],c=l.map((t=>t.key));this._activeTargetLink(s,l,r,a,c,h,i,n),this._activeSourceLink(s,l,o,r,c,h,i,n),this._highLightElements(r,c,i,n),this._activeLinkData.parseNewData(h),this._needClear=!0}_activeTargetLink(t,i,n,s,r,a,o,l){this._handleClearEmpty(o,l);const h=t.sourceNode.targetLinks[0];if(!h)return;let c=0;i.forEach((t=>{const i=t.targetLinks.find((t=>t.key===h.key));if(i){const n=i.value/h.value,s=h.key+"_"+t.type,r=Object.assign(Object.assign({},h),{y0:h.y0-h.thickness/2+(c+n/2)*h.thickness,y1:t.y0+n*h.thickness/2,thickness:n*h.thickness,key:s,type:t.type,[e.DEFAULT_DATA_INDEX]:a.length,[e.DEFAULT_DATA_KEY]:s});a.push(r),c+=n}})),r.push(...h.parents,t.key);const u=[];for(let t=0;t<h.parents.length-1;t++)u.push(h.parents[t]+"-"+h.parents[t+1]);this._highLightElements(s,u,o,l)}_activeSourceLink(t,i,n,s,r,a,o,l){this._handleClearEmpty(o,l);const h=t.sourceNode.sourceLinks;if(!(null==h?void 0:h.length))return;const c={};h.forEach((t=>{r.push(t.target),i.forEach(((i,s)=>{var r;c[i.type]=null!==(r=c[i.type])&&void 0!==r?r:0;const o=i.sourceLinks.find((e=>e.key===t.key));if(o){const r=o.value/i.value,l=i.y1-i.y0,h=l*r,u=t.key+"_"+i.type,d=Object.assign(Object.assign({},t),{y0:i.y0+c[i.type]*l+h/2,thickness:h,key:u,type:i.type,[e.DEFAULT_DATA_INDEX]:a.length,[e.DEFAULT_DATA_KEY]:u});if(0===s)d.y1=t.y1-t.thickness/2+h/2;else{const t=n.find((t=>t.key===o.target&&t.type===i.type));if(!t)return;d.y1=t.y0+h/2}a.push(d),c[i.type]+=r}}))}))}_handleClearEmpty(t,i){super._handleClearEmpty(t,i),this._activeLinkData.parseNewData([]);const n=this._nodeMark.getProductElements();!n&&n.length||n.forEach((t=>{t.removeState(e.STATE_VALUE_ENUM.STATE_HOVER)}));const s=this._linkMark.getProductElements();!s&&s.length||s.forEach((t=>{t.removeState(e.STATE_VALUE_ENUM.STATE_HOVER)}))}getSubNodeDatum(t){return this._nodeMark.getProductElements().filter((e=>t(e.data[0])))}}Le.type="compareSankey";class Ee{static GenAutoIncrementId(){return Ee.auto_increment_id++}}Ee.auto_increment_id=0;class Re{constructor(t){this.id=Ee.GenAutoIncrementId(),this.registry=t}}const Ie="named",De="inject",Ue="inversify:tagged",Ne="inversify:paramtypes";class je{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===Ie?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var Fe=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),n=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),s=new WeakMap;function r(t,e,i){let r=s.get(t);if(h(r)){if(!i)return;r=new n,s.set(t,r)}let a=r.get(e);if(h(a)){if(!i)return;a=new n,r.set(e,a)}return a}function a(t,e,i){if(o(t,e,i))return!0;const n=f(e);return!c(n)&&a(t,n,i)}function o(t,e,i){const n=r(e,i,!1);return!h(n)&&!!n.has(t)}function l(t,e,i){if(o(t,e,i))return function(t,e,i){const n=r(e,i,!1);if(!h(n))return n.get(t)}(t,e,i);const n=f(e);return c(n)?void 0:l(t,n,i)}function h(t){return void 0===t}function c(t){return null===t}function u(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,i){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const n=3===i?"string":5===i?"number":"default",s=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,e);if(void 0!==s){const e=s.call(t,n);if(u(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!u(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!u(e))return e}}throw new TypeError}(t,"default"===n?"number":n)}function p(t){const e=d(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function f(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const n=t.prototype,s=n&&Object.getPrototypeOf(n);if(null==s||s===Object.prototype)return e;const r=s.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,n){if(!u(i))throw new TypeError;return s=t,a=e,void r(i,n,!0).set(s,a);var s,a})),t("hasMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),l(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function ze(t,e,i,n){!function(t,e,i,n){const s=[n];let r={};Fe.hasOwnMetadata(t,e)&&(r=Fe.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...s),r[i]=a,Fe.defineMetadata(t,r,e)}(Ue,t,i.toString(),n)}function We(t){return(e,i,n)=>{ze(e,0,n,t)}}const Ge=(He=De,t=>(e,i,n)=>We(new je(He,t))(e,i,n));var He;function Ye(){return function(t){return Fe.defineMetadata(Ne,null,t),t}}function Xe(t){return We(new je(Ie,t))}const $e="Singleton",Ve="Transient",qe="ConstantValue",Ke="DynamicValue",Ze="Factory",Je="Function",Qe="Instance",ti="Invalid";class ei{constructor(t,e){this.id=Ee.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=ti,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new ei(this.serviceIdentifier,this.scope);return t.activated=t.scope===$e&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class ii{getConstructorMetadata(t){return{compilerGeneratedMetadata:Fe.getMetadata(Ne,t),userGeneratedMetadata:Fe.getMetadata(Ue,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const ni=(si=Ie,t=>{const e=e=>{if(null==e)return!1;if(e.key===si&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===si&&i[e].value===t)return!0;return!1};return e.metaData=new je(si,t),e});var si;class ri{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=$e,this}inTransientScope(){return this._binding.scope=Ve,this}whenTargetNamed(t){return this._binding.constraint=ni(t),this}}class ai{constructor(t){this._binding=t}to(t){return this._binding.type=Qe,this._binding.implementationType=t,new ri(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=Ke,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new ri(this._binding)}toConstantValue(t){return this._binding.type=qe,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=$e,new ri(this._binding)}toFactory(t){return this._binding.type=Ze,this._binding.factory=t,this._binding.scope=$e,new ri(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const oi=Symbol("ContributionProvider");class li{constructor(t,e){this.serviceIdentifier=t,this.container=e,ci.setStore(this.serviceIdentifier,this)}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}refresh(){this.caches&&(this.caches.length=0,this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier)))}}function hi(t,e){t(oi).toDynamicValue((t=>{let{container:i}=t;return new li(e,i)})).inSingletonScope().whenTargetNamed(e)}class ci{static getStore(t){return this.store.get(t)}static setStore(t,e){this.store.set(t,e)}static refreshAllContributions(){this.store.forEach((t=>{t.refresh()}))}}ci.store=new Map;class ui{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const s=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(s>i)){n++;break}}this.taps[n]=t}}class di extends ui{call(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}var pi;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(pi||(pi={}));const gi=$-1e-8;class fi{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,s,r){if(Math.abs(s-n)>gi)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,l,h,c=1/0,u=-1/0,d=1/0,p=-1/0;function g(t){l=i*Math.cos(t),h=i*Math.sin(t),l<c&&(c=l),l>u&&(u=l),h<d&&(d=h),h>p&&(p=h)}if(g(n),g(s),s!==n)if((n%=$)<0&&(n+=$),(s%=$)<0&&(s+=$),s<n&&(r=!r,a=n,n=s,s=a),r)for(s-=$,a=n-n%X,o=0;o<4&&a>s;++o,a-=X)g(a);else for(a=n-n%X+X,o=0;o<4&&a<s;++o,a+=X)g(a);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,n,s){this.bounds.add(t,e)}bezierCurveTo(t,e,i,n,s,r){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(s,r)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(){}}class yi{constructor(){this._curves=[],this.bounds=new _t}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const mi=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,vi={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},bi=0,xi=1,_i=2,Ai=3,Si=4,Ti=5,Bi=6,wi=7,Mi=8;let Ci,ki,Oi,Pi,Li,Ei;var Ri,Ii,Di,Ui,Ni,ji,Fi,zi,Wi;function Gi(t){const e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],l=t[7],h=l*r,c=-o*a,u=o*r,d=l*a,p=Math.cos(n),g=Math.sin(n),f=Math.cos(s),y=Math.sin(s),m=.5*(s-n),v=Math.sin(.5*m),b=8/3*v*v/Math.sin(m),x=e+p-b*g,_=i+g+b*p,A=e+f,S=i+y,T=A+b*y,B=S-b*f;return[h*x+c*_,u*x+d*_,h*T+c*B,u*T+d*B,h*A+c*S,u*A+d*S]}function Hi(t,e,i,n){const s=function(t,e,i,n,s,r,a,o,l){const h=ot(a),c=Math.sin(h),u=Math.cos(h),d=u*(o-t)*.5+c*(l-e)*.5,p=u*(l-e)*.5-c*(o-t)*.5;let g=d*d/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);g>1&&(g=Math.sqrt(g),i*=g,n*=g);const f=u/i,y=c/i,m=-c/n,v=u/n,b=f*o+y*l,x=m*o+v*l,_=f*t+y*e,A=m*t+v*e;let S=1/((_-b)*(_-b)+(A-x)*(A-x))-.25;S<0&&(S=0);let T=Math.sqrt(S);r===s&&(T=-T);const B=.5*(b+_)-T*(A-x),w=.5*(x+A)+T*(_-b),M=Math.atan2(x-w,b-B);let C=Math.atan2(A-w,_-B)-M;C<0&&1===r?C+=$:C>0&&0===r&&(C-=$);const k=Math.ceil(Math.abs(C/(X+.001))),O=[];for(let t=0;t<k;++t){const e=M+t*C/k,s=M+(t+1)*C/k;O[t]=[B,w,e,s,i,n,c,u]}return O}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<s.length;++e){const i=Gi(s[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(Ri||(Ri={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(Ii||(Ii={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(Di||(Di={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Ui||(Ui={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Ni||(Ni={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(ji||(ji={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Fi||(Fi={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(zi||(zi={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Wi||(Wi={}));const Yi=[(t,e,i,n,s,r,a)=>e.arc(t[1]*s+i,t[2]*r+n,t[3]*(s+r)/2,t[4],t[5],t[6],a),(t,e,i,n,s,r,a)=>e.arcTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*(s+r)/2,a),(t,e,i,n,s,r,a)=>e.bezierCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*s+i,t[6]*r+n,a),(t,e,i,n)=>e.closePath(),(t,e,i,n,s,r)=>e.ellipse(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,n,s,r,a)=>e.lineTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.moveTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.quadraticCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,a),(t,e,i,n,s,r,a)=>e.rect(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,a)];function Xi(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0;for(let o=0;o<t.length;o++){const l=t[o];Yi[l[0]](l,e,i,n,s,r,a)}}class $i{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Vi(t,e){let i=0;const n=t.length;for(let s=0;s<n;s++){const r=t[s],a=e[s],o=t[(s+1)%n],l=e[(s+1)%n];i+=at.distanceNN(r,a,o,l)}return i/2}function qi(t,e,i,n,s){const r=1-s;return r*r*r*t+3*e*s*r*r+3*i*s*s*r+n*s*s*s}function Ki(t,e,i,n,s){const r=qi(t.x,e.x,i.x,n.x,s),a=qi(t.y,e.y,i.y,n.y,s);return new rt(r,a)}function Zi(t,e,i,n){const s=1-n;return s*s*t+2*s*n*e+n*n*i}function Ji(t,e,i,n){const s=Zi(t.x,e.x,i.x,n),r=Zi(t.y,e.y,i.y,n);return new rt(s,r)}class Qi extends $i{constructor(t,e,i){super(),this.type=zi.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return Ji(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,Vi([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===Fi.ROW?q(this.p0.x-this.p2.x):t===Fi.COLUMN?q(this.p0.y-this.p2.y):0}getAngleAt(t){const e=J(t-.01,0),i=Q(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return K(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.quadraticCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i);else if(r>0){const[a]=function(t,e){const{p0:i,p1:n,p2:s}=t,r=Ji(i,n,s,e),a=at.pointAtPP(i,n,e),o=at.pointAtPP(n,s,e);return[new Qi(i,a,r),new Qi(r,o,s)]}(this,r);t.quadraticCurveTo(a.p1.x*n+e,a.p1.y*s+i,a.p2.x*n+e,a.p2.y*s+i)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}function tn(t,e){const{p0:i,p1:n,p2:s,p3:r}=t,a=Ki(i,n,s,r,e),o=at.pointAtPP(i,n,e),l=at.pointAtPP(n,s,e),h=at.pointAtPP(s,r,e),c=at.pointAtPP(o,l,e),u=at.pointAtPP(l,h,e);return[new en(i,o,c,a),new en(a,u,h,r)]}class en extends $i{constructor(t,e,i,n){super(),this.type=zi.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=n}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return Ki(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,n=this.p3,Vi([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])):60;var t,e,i,n}calcProjLength(t){return t===Fi.ROW?q(this.p0.x-this.p3.x):t===Fi.COLUMN?q(this.p0.y-this.p3.y):0}getAngleAt(t){const e=J(t-.01,0),i=Q(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return K(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.bezierCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i,this.p3.x*n+e,this.p3.y*s+i);else if(r>0){const[a]=tn(this,r);t.bezierCurveTo(a.p1.x*n+e,a.p1.y*s+i,a.p2.x*n+e,a.p2.y*s+i,a.p3.x*n+e,a.p3.y*s+i)}}includeX(t){const e=Q(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=J(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){const e=Q(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(J(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}class nn extends $i{constructor(t,e){super(),this.type=zi.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return at.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=K(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?at.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Fi.ROW?q(this.p0.x-this.p1.x):t===Fi.COLUMN?q(this.p0.y-this.p1.y):0}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.lineTo(this.p1.x*n+e,this.p1.y*s+i);else if(r>0){const a=this.getPointAt(r);t.lineTo(a.x*n+e,a.y*s+i)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,i=this.p1;this.p0.x>this.p1.x&&(e=this.p1,i=this.p0);const n=(t-e.x)/(i.x-e.x);return e.y+n*(i.y-e.y)}return 1/0}}class sn{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,s,r,a,o){const l=new en(new rt(this._lastX,this._lastY),new rt(t,e),new rt(i,n),new rt(s,r));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=s,this._lastY=r,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const s=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(s),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,n,s){const r=new nn(new rt(this._lastX,this._lastY),new rt(t,e));return r.originP1=n,r.originP2=s,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Fi.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],n=null!==(e=i.p3)&&void 0!==e?e:i.p1;return q(t.p0.y-n.y)}if(t===Fi.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(i=e.p3)&&void 0!==i?i:e.p1;return q(t.p0.x-n.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class rn extends sn{bezierCurveTo(t,e,i,n,s,r,a,o){return super.bezierCurveTo(e,t,n,i,r,s,a,o)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function an(t,e){let i=!1;for(let n=0,s=e.length;n<=s;n++)n>=s===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function on(t,e,i){const n=null!=e?e:q(i[i.length-1].x-i[0].x)>q(i[i.length-1].y-i[0].y)?Fi.ROW:Fi.COLUMN;return"monotoneY"===t?new rn(t,n):new sn(t,n)}class ln{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function hn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=on("linear",i,t);return function(t,e){an(t,e)}(new ln(s,n),t),s}function cn(t,e,i,n,s){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n,t.lastPoint1)}class un{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&cn(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:cn(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function dn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return hn(t,e);const s=on("basis",i,t);return function(t,e){an(t,e)}(new un(s,n),t),s}function pn(t){return t<0?-1:1}function gn(t,e,i){const n=t._x1-t._x0,s=e-t._x1,r=(t._y1-t._y0)/(n||Number(s<0&&-0)),a=(i-t._y1)/(s||Number(n<0&&-0)),o=(r*s+a*n)/(n+s);return(pn(r)+pn(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function fn(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function yn(t,e,i,n,s){const r=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-r)/3;t.context.bezierCurveTo(r+h,a+h*e,o-h,l-h*i,o,l,n,t.lastPoint1)}class mn{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:yn(this,this._t0,fn(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,yn(this,fn(this,e=gn(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:yn(this,this._t0,e=gn(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class vn extends mn{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function bn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return hn(t,e);const s=on("monotoneX",i,t);return function(t,e){an(t,e)}(new mn(s,n),t),s}function xn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return hn(t,e);const s=on("monotoneY",i,t);return function(t,e){an(t,e)}(new vn(s,n),t),s}let _n=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(n,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};class An extends _n{lineEnd(){this.context.closePath()}}function Sn(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new sn("step",null!=n?n:q(t[t.length-1].x-t[0].x)>q(t[t.length-1].y-t[0].y)?Fi.ROW:Fi.COLUMN);return Tn(new _n(r,e,s),t),r}function Tn(t,e){return an(t,e)}class Bn extends ln{lineEnd(){this.context.closePath()}}function wn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=on("linear",i,t);return function(t,e){an(t,e)}(new Bn(s,n),t),s}function Mn(t,e,i,n,s){let r=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>1e-12){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>1e-12){const n=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*n+t._x1*t._l23_2a-e*t._l12_2a)/s,l=(l*n+t._y1*t._l23_2a-i*t._l12_2a)/s}t.context.bezierCurveTo(r,a,o,l,t._x2,t._y2,n,t.lastPoint1)}function Cn(t,e){return function(i,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:a}=s;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return hn(i,s);const o=on(t,r,i);return an(new e(o,n,a),i),o}}const kn=Cn("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:Mn(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const On=Cn("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:Mn(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class Pn{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.addCurve(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new nn(new rt(this._lastX,this._lastY),new rt(t,e))}quadraticCurveTo(t,e,i,n){const s=new Qi(new rt(this._lastX,this._lastY),new rt(t,e),new rt(i,n));this.path.addCurve(s),this._lastX=i,this._lastY=n}bezierCurveTo(t,e,i,n,s,r){const a=new en(new rt(this._lastX,this._lastY),new rt(t,e),new rt(i,n),new rt(s,r));this.path.addCurve(a),this._lastX=s,this._lastY=r}arcTo(t,e,i,n,s){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,s,r,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,s,r){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function Ln(t,e,i){var n,s;switch(e){case"linear":default:return hn(t,i);case"basis":return dn(t,i);case"monotoneX":return bn(t,i);case"monotoneY":return xn(t,i);case"step":return Sn(t,.5,i);case"stepClosed":return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new sn("step",null!=n?n:q(t[t.length-1].x-t[0].x)>q(t[t.length-1].y-t[0].y)?Fi.ROW:Fi.COLUMN);return Tn(new An(r,e,s),t),r}(t,.5,i);case"stepBefore":return Sn(t,0,i);case"stepAfter":return Sn(t,1,i);case"catmullRom":return kn(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return On(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"linearClosed":return wn(t,i)}}class En extends yi{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new fi(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Bi,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Ti,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([wi,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,s,r){return this.commandList.push([_i,t,e,i,n,s,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,s,r),this}arcTo(t,e,i,n,s){return this.commandList.push([xi,t,e,i,n,s]),this._ctx&&this._ctx.arcTo(t,e,i,n,s),this}ellipse(t,e,i,n,s,r,a,o){return this.commandList.push([Si,t,e,i,n,s,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,s,r,a,o),this}rect(t,e,i,n){return this.commandList.push([Mi,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,s,r){return this.commandList.push([bi,t,e,i,n,s,r]),this._ctx&&this._ctx.arc(t,e,i,n,s,r),this}closePath(){return this.commandList.push([Ai]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this._curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this._curves.length=0}beginPath(){this.clear()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new Pn(this);Xi(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[Bi]=t=>`M${t[1]} ${t[2]}`,t[Ti]=t=>`L${t[1]} ${t[2]}`,t[wi]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[_i]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[bi]=t=>{const e=[];((t,e,i,n,s,r,a)=>{const o=Math.abs(i-e),l=o>.5*Math.PI?Math.ceil(2*o/Math.PI):1,h=(i-e)/l;for(let i=0;i<l;i++){const o=e+h*i,l=e+h*(i+1),c=4*Math.tan(Math.abs(h)/4)/3,u=l<o?-1:1,d=Math.cos(o),p=Math.sin(o),g=Math.cos(l),f=Math.sin(l),y=d*r+n,m=p*a+s,v=g*r+n,b=f*a+s,x=r*c*u,_=a*c*u;t.push(y-x*p,m+_*d,v+x*f,b-_*g,v,b)}})(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[Mi]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[Ai]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,s){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const s=[];for(let t=0,r=e.length;t<r;t++)if(Ci=e[t],ki=Ci.slice(1),Oi=Ci[0],i=[Oi],n=ki.match(mi),null!==n){for(let t=0,e=n.length;t<e;t++)Pi=n[t],Li=parseFloat(Pi),Number.isNaN(Li)||i.push(Li);if(Ei=vi[Oi],i.length-1>Ei){let t,e=Oi;for(let n=1,r=i.length;n<r;n+=Ei){t=[e];for(let e=n,s=n+Ei;e<s;e++)t.push(i[e]);s.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else s.push(i)}else s.push(i);return s}(t);return this._runCommandStrList(r,e,i,n,s),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:n}=t.attribute;if(!e)return;const s=Ln(e,i);"x"===n?this.direction=Fi.ROW:"y"===n?this.direction=Fi.COLUMN:"auto"===n&&(this.direction=s.direction),this._curves=s.curves}fromCustomPath2D(t,e,i,n,s){return this.clear(),this._runCommandList(t.commandList,e,i,n,s),this._updateBounds(),this}transform(t,e,i,n){const s=this.commandList;if(!this.transformCbList){const t=[];t[Bi]=this.moveToTransform,t[Ti]=this.lineToTransform,t[wi]=this.quadraticCurveToTransform,t[_i]=this.bezierCurveToTransform,t[xi]=this.arcToTransform,t[Si]=this.ellipseTransform,t[Mi]=this.rectTransform,t[bi]=this.arcTransform,t[Ai]=this.closePathTransform,this.transformCbList=t}s.forEach((s=>{this.transformCbList[s[0]](s,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}lineToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}quadraticCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i}bezierCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*n+e,t[6]=t[6]*s+i}arcToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*(n+s)/2}ellipseTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}rectTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}arcTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*(n+s)/2}closePathTransform(){}_runCommandStrList(t){let e,i,n,s,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,u=0,d=0,p=0,g=0;for(let f=0,y=t.length;f<y;++f){switch(e=t[f],1===l&&1===h||(e=In(e,l,h)),e[0]){case"l":u+=e[1],d+=e[2],this.lineTo(u+a,d+o);break;case"L":u=e[1],d=e[2],this.lineTo(u+a,d+o);break;case"h":u+=e[1],this.lineTo(u+a,d+o);break;case"H":u=e[1],this.lineTo(u+a,d+o);break;case"v":d+=e[1],this.lineTo(u+a,d+o);break;case"V":d=e[1],this.lineTo(u+a,d+o);break;case"m":u+=e[1],d+=e[2],this.moveTo(u+a,d+o);break;case"M":u=e[1],d=e[2],this.moveTo(u+a,d+o);break;case"c":i=u+e[5],n=d+e[6],p=u+e[3],g=d+e[4],this.bezierCurveTo(u+e[1]+a,d+e[2]+o,p+a,g+o,i+a,n+o),u=i,d=n;break;case"C":u=e[5],d=e[6],p=e[3],g=e[4],this.bezierCurveTo(e[1]+a,e[2]+o,p+a,g+o,u+a,d+o);break;case"s":i=u+e[3],n=d+e[4],null===c[0].match(/[CcSs]/)?(p=u,g=d):(p=2*u-p,g=2*d-g),s=u+e[1],r=d+e[2],this.bezierCurveTo(p+a,g+o,s+a,r+o,i+a,n+o),p=s,g=r,u=i,d=n;break;case"S":i=e[3],n=e[4],null===c[0].match(/[CcSs]/)?(p=u,g=d):(p=2*u-p,g=2*d-g),s=e[1],r=e[2],this.bezierCurveTo(p+a,g+o,s+a,r+o,i+a,n+o),p=s,g=r,u=i,d=n;break;case"q":i=u+e[3],n=d+e[4],p=u+e[1],g=d+e[2],this.quadraticCurveTo(p+a,g+o,i+a,n+o),u=i,d=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+a,e[2]+o,i+a,n+o),u=i,d=n,p=e[1],g=e[2];break;case"t":i=u+e[1],n=d+e[2],null===c[0].match(/[QqTt]/)?(p=u,g=d):"t"===c[0]?(p=2*u-s,g=2*d-r):"q"===c[0]&&(p=2*u-p,g=2*d-g),s=p,r=g,this.quadraticCurveTo(p+a,g+o,i+a,n+o),u=i,d=n,p=u+e[1],g=d+e[2];break;case"T":i=e[1],n=e[2],p=2*u-p,g=2*d-g,this.quadraticCurveTo(p+a,g+o,i+a,n+o),u=i,d=n;break;case"a":Hi(this,u+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+u+a,e[7]+d+o]),u+=e[6],d+=e[7];break;case"A":Hi(this,u+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+o]),u=e[6],d=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==s)for(let r=0,a=t.length;r<a;++r){const a=t[r].slice();switch(a[0]){case Ti:this.lineToTransform(a,e,i,n,s);break;case Bi:this.moveToTransform(a,e,i,n,s);break;case _i:this.bezierCurveToTransform(a,e,i,n,s);break;case wi:this.quadraticCurveToTransform(a,e,i,n,s);break;case bi:this.arcToTransform(a,e,i,n,s);break;case Si:this.ellipseTransform(a,e,i,n,s);break;case Mi:this.rectTransform(a,e,i,n,s);break;case xi:this.arcToTransform(a,e,i,n,s);break;case Ai:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Xi(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Fi.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return q(t.p0.y-e.p1.y)}if(this.direction===Fi.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return q(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const i=this.curves[e];if(i.includeX(t))return i.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this._curves.length;n++){e=this._curves[n];const s=e.getLength(this.direction);if(i+s>=t)break;i+=s}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}drawWithClipRange(t,e,i,n,s){this.tryBuildCurves();const r=this.getLength()*s;let a=0;for(let s=0;s<this._curves.length;s++){const o=this._curves[s],l=o.getLength(this.direction);if(!(a+l<=r)){const s=1-(a+l-r)/l;o.draw(t,i,n,e,e,s);break}o.draw(t,i,n,e,e,1),a+=l}}}const Rn=["l",0,0,0,0,0,0,0];function In(t,e,i){const n=Rn[0]=t[0];if("a"===n||"A"===n)Rn[1]=e*t[1],Rn[2]=i*t[2],Rn[3]=t[3],Rn[4]=t[4],Rn[5]=t[5],Rn[6]=e*t[6],Rn[7]=i*t[7];else if("h"===n||"H"===n)Rn[1]=e*t[1];else if("v"===n||"V"===n)Rn[1]=i*t[1];else for(let n=1,s=t.length;n<s;++n)Rn[n]=(n%2==1?e:i)*t[n];return Rn}const Dn={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new St},Un={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Nn=Object.assign({outerBorder:Object.assign(Object.assign({},Un),{distance:0}),innerBorder:Object.assign(Object.assign({},Un),{distance:0})},Un),jn={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:pi.fontBounding,keepCenterInLine:!1},Fn=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Nn),{alignSelf:"auto"}),{pickStrokeBuffer:0}),zn={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Wn=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null},{_debug_bounds:!1}),Fn),Dn),Gn=Object.assign(Object.assign({},Wn),{startAngle:0,endAngle:V,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Hn=Object.assign(Object.assign(Object.assign({},Wn),zn),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Yn=Object.assign(Object.assign({},Wn),{radius:1,startAngle:0,endAngle:V}),Xn=Object.assign(Object.assign({},Wn),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),$n=Object.assign(Object.assign({},Wn),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Vn=Object.assign(Object.assign(Object.assign({},Wn),zn),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),qn=Object.assign(Object.assign({},Wn),{path:new En,fillStrokeOrder:1,clipRange:1,customPath:()=>{F.getInstance().warn("空函数")}}),Kn=Object.assign(Object.assign({},Wn),{points:[],cornerRadius:0,closePath:!0}),Zn=Object.assign(Object.assign({},Wn),{width:100,height:100,spikes:5,thickness:.5}),Jn=Object.assign(Object.assign({},Wn),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},Wn),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const Qn=Object.assign(Object.assign({},Wn),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),ts=Object.assign(Object.assign(Object.assign({},Wn),jn),{strokeBoundsBuffer:0,keepDirIn3d:!0}),es=Object.assign(Object.assign(Object.assign({},Wn),jn),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),is=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},Wn),{fill:!0,cornerRadius:0,cornerType:"round"}),ns=Object.assign(Object.assign({},is),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});const ss=new class{};function rs(t,e,i){let n=e;const{a:s,b:r,c:a,d:o}=t.currentMatrix,l=Math.sign(s)*Math.sqrt(s*s+r*r),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(n=n/Math.abs(l+h)*2*i,n)}const as=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Ve,this.options=e,this.id=Ee.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new ii}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,Ie,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new ei(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new ai(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const n=this.bind(i);return t(n,e),n},i=()=>t=>this.unbind(t),n=()=>t=>this.isBound(t),s=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:s(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),s=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const r={inject:n[De],multiInject:n.multi_inject},a=r.inject||r.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l=(this._bindingDictionary.get(a)||[]).filter((t=>t.constraint(o)));if(l.length){const t={injectIdentifier:a,metadata:e,bindings:l};s.push(t)}}return s}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case qe:case Je:e=t.cache;break;case Qe:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===$e&&(t.cache=e,t.activated=!0)}},os=Symbol.for("CanvasFactory");function ls(t){return as.getNamed(os,ss.global.env)(t)}const hs=new class{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=ls(Object.assign({nativeCanvas:ss.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=ls(Object.assign({nativeCanvas:ss.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}},cs={arc:Gn,area:Hn,circle:Yn,line:Vn,path:qn,symbol:Qn,text:ts,rect:Jn,polygon:Kn,star:Zn,richtext:es,richtextIcon:ns,image:is,group:Xn,glyph:$n},us=Object.keys(cs);function ds(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const ps={arc:Object.assign({},cs.arc),area:Object.assign({},cs.area),circle:Object.assign({},cs.circle),line:Object.assign({},cs.line),path:Object.assign({},cs.path),symbol:Object.assign({},cs.symbol),text:Object.assign({},cs.text),rect:Object.assign({},cs.rect),polygon:Object.assign({},cs.polygon),star:Object.assign({},cs.star),richtext:Object.assign({},cs.richtext),richtextIcon:Object.assign({},cs.richtextIcon),image:Object.assign({},cs.image),group:Object.assign({},cs.group),glyph:Object.assign({},cs.glyph)};class gs{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},us.forEach((t=>{this._defaultTheme[t]=Object.create(ps[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,F.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;us.forEach((n=>{const s=Object.create(ps[n]);t&&t[n]&&ds(s,t[n]),i[n]&&ds(s,i[n]),e[n]&&ds(s,e[n]),this.combinedTheme[n]=s})),e.common&&us.forEach((t=>{ds(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const fs=new gs;function ys(t,e){return t.glyphHost?ys(t.glyphHost):e?(t.isContainer,e):function(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):fs.getTheme()}return null}(t)||t.attachedThemeGraphic&&ys(t.attachedThemeGraphic)||fs.getTheme()}var ms=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function o(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((n=n.apply(t,e||[])).next())}))};class vs extends s{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=Ee.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ms(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&F.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=a(i,!0)&&i||c(i)&&i.capture,s=c(i)&&i.once,r=o(e)?void 0:e;return t=n?`${t}capture`:t,e=o(e)?e:e.handleEvent,s?super.once(t,e,r):super.on(t,e,r),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=a(i,!0)&&i||c(i)&&i.capture,s=o(e)?void 0:e;t=n?`${t}capture`:t,e=o(e)?e:e.handleEvent;const r=c(i)&&i.once;return super.off(t,e,s,r),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return c(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class bs{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=bs.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=t.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&o(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&o(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class xs extends bs{constructor(t,e){super(),this.type=t,this.detail=e}}const _s={dispatchEvent(t){var e;if(!(t instanceof bs))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new xs(t,e))}};class As{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-As.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*As.bounceIn(2*t):.5*As.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/V*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*V/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/V*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*V/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/V*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*V/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*V/e)*.5+1}}static registerFunc(t,e){As[t]=e}}function Ss(t,e){const i=1/e;let n=1;for(;t>i;)t-=i,n*=-1;const s=n*t/i;return s>0?s:1+s}As.quadIn=As.getPowIn(2),As.quadOut=As.getPowOut(2),As.quadInOut=As.getPowInOut(2),As.cubicIn=As.getPowIn(3),As.cubicOut=As.getPowOut(3),As.cubicInOut=As.getPowInOut(3),As.quartIn=As.getPowIn(4),As.quartOut=As.getPowOut(4),As.quartInOut=As.getPowInOut(4),As.quintIn=As.getPowIn(5),As.quintOut=As.getPowOut(5),As.quintInOut=As.getPowInOut(5),As.backIn=As.getBackIn(1.7),As.backOut=As.getBackOut(1.7),As.backInOut=As.getBackInOut(1.7),As.elasticIn=As.getElasticIn(1,.3),As.elasticOut=As.getElasticOut(1,.3),As.elasticInOut=As.getElasticInOut(1,.3*1.5),As.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),As.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},As.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)As[`flicker${t}`]=e=>Ss(e,t);for(let t=2;t<10;t++)As[`aIn${t}`]=e=>t*e*e+(1-t)*e;const Ts=new class{constructor(){this.id=Ee.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Ui.END?this.removeAnimate(e):e.status===Ui.RUNNING||e.status===Ui.INITIAL?(this.animateCount++,e.advance(t)):e.status===Ui.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}};class Bs{constructor(t,e,i,n,s){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=s,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class ws extends Bs{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Ms{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ee.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ts,i=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e||Ts,this.status=Ui.INITIAL,this.tailAnimate=new Cs(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=i}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=J(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Ms.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ms.mode;t&&e&Ni.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Di.ANIMATE_PLAY})}runCb(t){const e=new ws((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,s,r){const a=Ms.interpolateMap.get(t)||Ms.interpolateMap.get("");return!!a&&a(t,e,i,n,s,r)}pause(){this.status===Ui.RUNNING&&(this.status=Ui.PAUSED)}resume(){this.status===Ui.PAUSED&&(this.status=Ui.RUNNING)}to(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new Cs(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===Ui.INITIAL&&(this.status=Ui.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Ui.RUNNING&&(this.status=Ui.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const n=this.rawPosition,s=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const r=t>=s;if(r&&(t=s),t===n)return r;for(let n=0;n<this.subAnimates.length&&(e=this.subAnimates[n],!(i+e.totalDuration>=t));n++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),r}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=Ui.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}Ms.mode=Ni.NORMAL,Ms.interpolateMap=new Map;class Cs{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new ks(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(t){let e=t.duration;(null==e||e<0)&&(e=0);const i=t.easing,n="string"==typeof i?As[i]:i,s=this._addStep(e,null,n);return s.type=ji.customAnimate,this._appendProps(t.getEndProps(),s,!1),this._appendCustomAnimate(t,s),this}to(t,e,i,n){(null==e||e<0)&&(e=0);const s="string"==typeof i?As[i]:i,r=this._addStep(e,null,s);return r.type=ji.to,this._appendProps(t,r,!!n&&n.tempProps),r.propKeys||(r.propKeys=Object.keys(r.props)),n&&n.noPreventAttrs||this.target.animates&&this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(r.propKeys)})),this}from(t,e,i,n){this.to(t,0,i,n);const s={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{s[t]=this.getLastPropByName(t,this.stepTail)})),this.to(s,e,i,n),this.stepTail.type=ji.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(t){if(t>0){const e=this._addStep(+t,null);e.type=ji.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){const n=new ks(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const s=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach((t=>{void 0===s[t]&&(s[t]=n.props[t])}))),e.propKeys=Object.keys(e.props),n=n.prev;const r=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(s)),e.propKeys.forEach((t=>{if(void 0===r[t]){const e=this.animate.getStartProps();r[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,n=this.loop,s=this.rawPosition;let r,a,o=!1;const l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(t-=l,i<=0&&(o=!0,i<0))return o;if(r=Math.floor(t/i),a=t-r*i,o=t>=n*i+i,o&&(a=i,r=n,t=a*r+i),t===s)return o;const h=!this.reversed!=!(this.bounce&&r%2);return h&&(a=i-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+l,this.updatePosition(o,h),o}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,s=this.duration;if(this.target&&i){let r=i.next;for(;r&&r.position<=n;)i=r,r=i.next;let a=t?0===s?1:n/s:(n-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,a)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return F.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class ks{constructor(t,e,i,n){this.duration=e,this.position=t,this.props=i,this.easing=n}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const Os=200,Ps="cubicOut";var Ls;!function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(Ls||(Ls={}));const Es=[0,0,0,0];function Rs(t,e,i){const{x:n,y:s}=nt(t.x,t.y,e.x,e.y,i),{x:r,y:a}=nt(t.x1,t.y1,e.x1,e.y1,i),o=new rt(n,s,r,a);return o.defined=e.defined,o}function Is(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let n=[];if(t.length>e.length){n=e.map((t=>{const e=new rt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let s=0;s<e.length;s++)n[s]=Rs(t[s],e[s],i)}else{n=e.map((t=>{const e=new rt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let s=0;s<t.length;s++)n[s]=Rs(t[s],e[s],i)}return n}const Ds=(t,e)=>{const i=((t,e)=>p(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(i)?i:Math.max(e,i)};var Us;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Us||(Us={}));class Ns{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Us.Color1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===Us.Color1){const e=Ns.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const n=Rt.parseColorString(t);if(n){const e=[n.r/255,n.g/255,n.b/255,n.opacity];Ns.store1[t]=e,Ns.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const n=Ns.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;const s=Rt.parseColorString(t);return s&&(Ns.store1[t]=[s.r/255,s.g/255,s.b/255,s.opacity],Ns.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=s.r,i[1]=s.g,i[2]=s.b,i[3]=s.opacity),i}static Set(t,e,i){if(e===Us.Color1){if(Ns.store1[t])return;Ns.store1[t]=i,Ns.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Ns.store255[t])return;Ns.store255[t]=i,Ns.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function js(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&m(t[0])?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function Fs(t,e,i,n,s){return Array.isArray(t)&&!m(t[0])||Array.isArray(e)&&!m(e[0])?new Array(4).fill(0).map(((s,r)=>zs(g(t)?t[r]:t,g(e)?e[r]:e,i,n))):zs(t,e,i,n,s)}function zs(t,e,i,n,s){if(!t||!e)return t&&js(t)||e&&js(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=Ns.Get(t,Us.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=Ns.Get(e,Us.Color255):l=!0,o!==l){const r=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:js(a)})))});return o?Fs(r,l,i,n,s):Fs(l,r,i,n,s)}if(o){if(t.gradient===e.gradient){const n=t,s=e,r=n.stops,a=s.stops;if(r.length!==a.length)return!1;if("linear"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Hs(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("radial"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Hs(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("conical"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Hs(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i)}return!1}return s&&s(r,a),js(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(r,a,i),n)}Ns.store255={},Ns.store1={};const Ws=[0,0,0,0],Gs=[0,0,0,0];function Hs(t,e,i){return Ns.Get(t,Us.Color255,Ws),Ns.Get(e,Us.Color255,Gs),`rgba(${Math.round(Ws[0]+(Gs[0]-Ws[0])*i)},${Math.round(Ws[1]+(Gs[1]-Ws[1])*i)},${Math.round(Ws[2]+(Gs[2]-Ws[2])*i)},${Ws[3]+(Gs[3]-Ws[3])*i})`}class Ys{static GetImage(t,e){var i;const n=Ys.cache.get(t);n?"fail"===n.loadState?ss.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):Ys.loadImage(t,e)}static GetSvg(t,e){var i;let n=Ys.cache.get(t);n?"fail"===n.loadState?ss.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):(n={type:"image",loadState:"init"},Ys.cache.set(t,n),n.dataPromise=ss.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,s)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))})),n.waitingMark&&(n.waitingMark=[])}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Ys.cache.get(t);return i?"fail"===i.loadState?Promise.reject():"init"===i.loadState||"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Ys.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=ss.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=ss.global.loadBlob(t):"json"===e&&(i.dataPromise=ss.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Ys.isLoading&&Ys.toLoadAueue.length){Ys.isLoading=!0;const t=Ys.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,s={type:"image",loadState:"init"};if(Ys.cache.set(i,s),s.dataPromise=ss.global.loadImage(i),s.dataPromise){s.waitingMark=n;const t=s.dataPromise.then((t=>{var e;s.loadState=(null==t?void 0:t.data)?"success":"fail",s.data=null==t?void 0:t.data,null===(e=s.waitingMark)||void 0===e||e.map(((e,n)=>{(null==t?void 0:t.data)?(s.loadState="success",s.data=t.data,e.imageLoadSuccess(i,t.data)):(s.loadState="fail",e.imageLoadFail(i))})),s.waitingMark&&(s.waitingMark=[])}));e.push(t)}else s.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Ys.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Ys.loading()})).catch((t=>{console.error(t),Ys.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Ys.loading()}))}}),0)}static loadImage(t,e){const i=Xs(t,Ys.toLoadAueue);if(-1!==i)return Ys.toLoadAueue[i].marks.push(e),void Ys.loading();Ys.toLoadAueue.push({url:t,marks:[e]}),Ys.loading()}static improveImageLoading(t){const e=Xs(t,Ys.toLoadAueue);if(-1!==e){const t=Ys.toLoadAueue.splice(e,1);Ys.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Xs(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}Ys.cache=new Map,Ys.isLoading=!1,Ys.toLoadAueue=[],Ys.onLoadSuccessCb=[];class $s{bounds(t,e){if(m(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return m(t)?t:Math.min(t[0],t[1])}}function Vs(t,e,i,n,s){return s?t.arc(i,n,e,0,$,!1,s):t.arc(i,n,e,0,$),!1}var qs=new class extends $s{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,s){return Vs(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return Vs(t,this.parseSize(e)/2+s,i,n,r)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 -${2*s},0`}};var Ks=new class extends $s{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,s){return function(t,e,i,n,s){return t.moveTo(-3*e+i,-e+n,s),t.lineTo(-e+i,-e+n,s),t.lineTo(-e+i,-3*e+n,s),t.lineTo(e+i,-3*e+n,s),t.lineTo(e+i,-e+n,s),t.lineTo(3*e+i,-e+n,s),t.lineTo(3*e+i,e+n,s),t.lineTo(e+i,e+n,s),t.lineTo(e+i,3*e+n,s),t.lineTo(-e+i,3*e+n,s),t.lineTo(-e+i,e+n,s),t.lineTo(-3*e+i,e+n,s),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s)}drawOffset(t,e,i,n,s,r){return function(t,e,i,n,s,r){return t.moveTo(-3*e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-3*e+n-s,r),t.lineTo(e+i+s,-3*e+n-s,r),t.lineTo(e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,e+n+s,r),t.lineTo(e+i+s,e+n+s,r),t.lineTo(e+i+s,3*e+n+s,r),t.lineTo(-e+i-s,3*e+n+s,r),t.lineTo(-e+i-s,e+n+s,r),t.lineTo(-3*e+i-s,e+n+s,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s,r)}};function Zs(t,e,i,n,s){return t.moveTo(i,n-e,s),t.lineTo(e+i,n,s),t.lineTo(i,n+e,s),t.lineTo(i-e,n,s),t.closePath(),!0}var Js=new class extends $s{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,s){return Zs(t,this.parseSize(e)/2,i,n,s)}drawFitDir(t,e,i,n,s){return Zs(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return Zs(t,this.parseSize(e)/2+s,i,n,r)}};function Qs(t,e,i,n){const s=2*e;return t.rect(i-e,n-e,s,s),!1}var tr=new class extends $s{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Qs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Qs(t,this.parseSize(e)/2+s,i,n)}};function er(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i+e+2*s,e+n+s),t.lineTo(i-e-2*s,e+n+s),t.lineTo(i,n-e-2*s),t.closePath(),!0}class ir extends $s{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return er(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return er(t,this.parseSize(e)/2,i,n,s)}}var nr=new ir;var sr=new class extends ir{constructor(){super(...arguments),this.type="triangle"}};const rr=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ar=Math.sin($/10)*rr,or=-Math.cos($/10)*rr;function lr(t,e,i,n){const s=ar*e,r=or*e;t.moveTo(i,-e+n),t.lineTo(s+i,r+n);for(let a=1;a<5;++a){const o=$*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+i,-l*e+n),t.lineTo(l*s-h*r+i,h*s+l*r+n)}return t.closePath(),!0}var hr=new class extends $s{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,n){return lr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return lr(t,this.parseSize(e)/2+s,i,n)}};const cr=et(3);function ur(t,e,i,n){const s=e,r=s/cr,a=r/5,o=e;return t.moveTo(0+i,-s+n),t.lineTo(r/2+i,n),t.lineTo(a/2+i,n),t.lineTo(a/2+i,o+n),t.lineTo(-a/2+i,o+n),t.lineTo(-a/2+i,n),t.lineTo(-r/2+i,n),t.closePath(),!0}var dr=new class extends $s{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return ur(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ur(t,this.parseSize(e)/2+s,i,n)}};function pr(t,e,i,n){const s=2*e;return t.moveTo(i,-e+n),t.lineTo(s/3/2+i,e+n),t.lineTo(-s/3/2+i,e+n),t.closePath(),!0}var gr=new class extends $s{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return pr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return pr(t,this.parseSize(e)/2+s,i,n)}};function fr(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var yr=new class extends $s{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return fr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return fr(t,this.parseSize(e)/2+s,i,n)}};const mr=-.5,vr=et(3)/2,br=1/et(12);function xr(t,e,i,n){const s=e/2,r=e*br,a=s,o=e*br+e,l=-a,h=o;return t.moveTo(s+i,r+n),t.lineTo(a+i,o+n),t.lineTo(l+i,h+n),t.lineTo(mr*s-vr*r+i,vr*s+mr*r+n),t.lineTo(mr*a-vr*o+i,vr*a+mr*o+n),t.lineTo(mr*l-vr*h+i,vr*l+mr*h+n),t.lineTo(mr*s+vr*r+i,mr*r-vr*s+n),t.lineTo(mr*a+vr*o+i,mr*o-vr*a+n),t.lineTo(mr*l+vr*h+i,mr*h-vr*l+n),t.closePath(),!1}var _r=new class extends $s{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,n){return xr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return xr(t,this.parseSize(e)/2+s,i,n)}};function Ar(t,e,i,n,s){return t.moveTo(-e+i-2*s,n),t.lineTo(e+i+s,e+n+2*s),t.lineTo(e+i+s,n-e-2*s),t.closePath(),!0}var Sr=new class extends $s{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return Ar(t,this.parseSize(e)/2,i,n,0)}drawOffset(t,e,i,n,s){return Ar(t,this.parseSize(e)/2,i,n,s)}};function Tr(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-s,e+n+2*s),t.lineTo(e+i+2*s,n),t.lineTo(i-e-s,n-e-2*s),t.closePath(),!0}var Br=new class extends $s{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return Tr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Tr(t,this.parseSize(e)/2,i,n,s)}};function wr(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-2*s,n-e-s),t.lineTo(i+e+2*s,n-e-s),t.lineTo(i,n+e+2*s),t.closePath(),!0}var Mr=new class extends $s{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return wr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return wr(t,this.parseSize(e)/2,i,n,s)}};const Cr=et(3);function kr(t,e,i,n){const s=e*Cr;return t.moveTo(i,n+-s/3*2),t.lineTo(e+i,n+s),t.lineTo(i-e,n+s),t.closePath(),!0}var Or=new class extends $s{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return kr(t,this.parseSize(e)/2/Cr,i,n)}drawOffset(t,e,i,n,s){return kr(t,this.parseSize(e)/2/Cr+s,i,n)}};function Pr(t,e,i,n){const s=2*e;return t.moveTo(e+i,n-s),t.lineTo(i-e,n),t.lineTo(e+i,s+n),!0}var Lr=new class extends $s{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return Pr(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Pr(t,this.parseSize(e)/4+s,i,n)}};function Er(t,e,i,n){const s=2*e;return t.moveTo(i-e,n-s),t.lineTo(i+e,n),t.lineTo(i-e,s+n),!0}var Rr=new class extends $s{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return Er(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Er(t,this.parseSize(e)/4+s,i,n)}};function Ir(t,e,i,n){const s=2*e;return t.moveTo(i-s,n+e),t.lineTo(i,n-e),t.lineTo(i+s,n+e),!0}var Dr=new class extends $s{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return Ir(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ir(t,this.parseSize(e)/4+s,i,n)}};function Ur(t,e,i,n){const s=2*e;return t.moveTo(i-s,n-e),t.lineTo(i,n+e),t.lineTo(i+s,n-e),!0}var Nr=new class extends $s{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return Ur(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ur(t,this.parseSize(e)/4+s,i,n)}};function jr(t,e,i,n,s){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var Fr=new class extends $s{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,s){return jr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return jr(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e}, ${i-s} L ${e},${i+s}`}};function zr(t,e,i,n,s){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var Wr=new class extends $s{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,s){return zr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return zr(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} L ${e+s},${i}`}};function Gr(t,e,i,n,s){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var Hr=new class extends $s{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,s){return Gr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return Gr(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i-s} L ${e+s},${i+s} M ${e+s}, ${i-s} L ${e-s},${i+s}`}};function Yr(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function Xr(t,e,i,n){const s=e,r=e/2;return t.rect(i-s/2,n-r/2,s,r),!1}var $r=new class extends $s{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,n){return m(e)?Xr(t,e,i,n):Yr(t,e,i,n)}drawWithClipRange(t,e,i,n,s,r,a){m(e)&&(e=[e,e/2]);const o=2*(e[0]+e[1])*s,l=[{x:i+e[0]/2,y:n-e[1]/2},{x:i+e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n-e[1]/2}];let h=0,c=l[3];t.moveTo(c.x,c.y);for(let e=0;e<l.length;e++){const i=l[e],n=Math.sqrt((i.x-c.x)*(i.x-c.x)+(i.y-c.y)*(i.y-c.y));if(h+n>o){const e=(i.x-c.x)*(o-h)/n,s=(i.y-c.y)*(o-h)/n;t.lineTo(c.x+e,c.y+s);break}t.lineTo(i.x,i.y),c=i,h+=n}return!1}drawOffset(t,e,i,n,s){return m(e)?Xr(t,e+2*s,i,n):Yr(t,[e[0]+2*s,e[1]+2*s],i,n)}};const Vr=new _t;class qr{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,g(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{t.beginPath(),Xi(s.path.commandList,t,i,n,e,e),a&&a(s.path,s.attribute)})),!1):(Xi(this.path.commandList,t,i,n,e+s,e+s),!1)}draw(t,e,i,n,s,r){return e=this.parseSize(e),this.drawOffset(t,e,i,n,0,s,r)}parseSize(t){return m(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{r.path.drawWithClipRange(t,e,i,n,s),a&&a(r.path,r.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,n,s),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:n}=i;Vr.x1=n.bounds.x1*t,Vr.y1=n.bounds.y1*t,Vr.x2=n.bounds.x2*t,Vr.y2=n.bounds.y2*t,e.union(Vr)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const Kr={};[qs,Ks,Js,tr,Or,sr,hr,dr,gr,yr,_r,Sr,Br,nr,Mr,Lr,Rr,Dr,Nr,$r,Fr,Wr,Hr].forEach((t=>{Kr[t.type]=t}));const Zr={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"};class Jr{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function Qr(t,e,i,n){const s=t.indexOf(e,i);if(-1===s)throw new Error(n);return s+e.length-1}function ta(t,e,i){const n=function(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",s="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:r};if(t[r+1]===n[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!n)return;let s=n.data;const r=n.index,a=s.search(/\s/);let o=s,l=!0;-1!==a&&(o=s.substr(0,a).replace(/\s\s*$/,""),s=s.substr(a+1));const h=o;if(i){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1),l=o!==n.data.substr(t+1))}return{tagName:o,tagExp:s,closeIndex:r,attrExpPresent:l,rawTagName:h}}const ea=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class ia{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const s=function(t,e){const i=[];let n=e.exec(t);for(;n;){const s=[];s.startIndex=e.lastIndex-n[0].length;const r=n.length;for(let t=0;t<r;t++)s.push(n[t]);i.push(s),n=e.exec(t)}return i}(t,ea),r=s.length;for(let t=0;t<r;t++){const e=s[t][1],i=s[t][4];e&&(n[e]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Jr("!xml");let i=e,n="",s="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=Qr(t,">",r,"Closing Tag is not closed."),a=s.lastIndexOf(".");s=s.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",r=e}else if("?"===t[r+1])r=ta(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=Qr(t,"--\x3e",r+4,"Comment is not closed.");else{const a=ta(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,c=a.closeIndex;if(o!==e.tagname&&(s+=s?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),s=s.substr(0,s.length-1),l=o):l=l.substr(0,l.length-1);const t=new Jr(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new Jr(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),i=t}n="",r=c}else n+=t[r];return e.child}}function na(t,e){return sa(t)}function sa(t,e){const i={};for(let e=0;e<t.length;e++){const s=t[e],r=ra(s);if(void 0!==r&&s[r]){const t=sa(s[r]);n=t,Object.keys(n).length,s[":@"]&&aa(t,s[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}var n;return i}function ra(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function aa(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let s=0;s<n;s++){const n=i[s];t[n]=e[n]}}}class oa{constructor(t){this.options=Object.assign({},oa.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return na(new ia(this.options).parseXml(t),this.options)}}function la(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}oa.defaultOptions={};let ha=0;function ca(){return ha++}var ua;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(ua||(ua={}));const da=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>da.set(t,!0)));const pa=new Map;function ga(t){if(da.has(t))return!0;if(pa.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>pa.set(t,!0))),ca(),ca();const fa=ca();ca(),ca();const ya=ca();ca();const ma=ca(),va=ca(),ba=ca();ca(),ca(),ca(),ca(),ca();const xa=ca(),_a=ca(),Aa=Symbol.for("GraphicCreator"),Sa={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},Ta=Object.keys(Sa),Ba=new _t,wa=new St;new _t;const Ma=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Ca=["x","y"],ka=["scaleX","scaleY"],Oa=["angle"],Pa=new rt,La={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class Ea extends vs{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(Ea.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new _t,this._updateTag=Ri.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,n;const{dx:s=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;Pa.x=s+(null!==(i=t.scrollX)&&void 0!==i?i:0),Pa.y=r+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else Pa.x=s,Pa.y=r;return Pa}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;ss.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return ss.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new At),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let i=this.clipPathMap.get(e)||null;return i||(this.clipPathMap.size>10&&this.clipPathMap.clear(),i=this.parsePath(e),i&&this.clipPathMap.set(e,i)),i}parsePath(t){if(!t)return null;let e=Kr[t];if(e)return e;if(e=Ea.userSymbolMap[t],e)return e;if(!0===((i=t=Zr[t]||t).startsWith("<svg")||i.startsWith("<?xml"))){const e=new oa,{svg:i}=e.parse(t);if(!i)return null;const n=g(i.path)?i.path:[i.path];Ba.clear();const s=[];n.forEach((t=>{const e=(new En).fromString(t.d),i={};Ta.forEach((e=>{t[e]&&(i[Sa[e]]=t[e])})),s.push({path:e,attribute:i}),Ba.union(e.bounds)}));const r=Ba.width(),a=Ba.height(),o=1/J(r,a);s.forEach((t=>t.path.transform(0,0,o,o)));const l=new qr(t,s,!0);return Ea.userSymbolMap[t]=l,l}var i;const n=(new En).fromString(t),s=n.bounds.width(),r=n.bounds.height(),a=1/J(s,r);n.transform(0,0,a,a);const o=new qr(t,n);return Ea.userSymbolMap[t]=o,o}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,n=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:s=e.boundsPadding}=i,r=(a=s)?g(a)?0===a.length?0:1===a.length?a[0]:2===a.length?(Es[0]=a[0],Es[2]=a[0],Es[1]=a[1],Es[3]=a[1],Es):a:a:0;var a;return r&&n.expand(r),this.clearUpdateBoundTag(),n}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new fi(t);return Xi(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new St),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&Ri.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&ss.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&Ri.UPDATE_BOUNDS)&&ss.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&Ri.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&Ri.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&Ri.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&Ri.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=Ri.CLEAR_SHAPE}containsPoint(t,e,i,n){if(!n)return!1;if(i===Ii.GLOBAL){const i=new rt(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return n.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var s;const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);r?this._setAttributes(r,i,n):l(null===(s=this.normalAttrs)||void 0===s?void 0:s[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ma;for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ma;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Di.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=Ri.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,n;if(0===t&&0===e)return this;const s={type:Di.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Ca,s);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const a=this.attribute,o=a.postMatrix;return o?ss.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:Dn.x)+t,a.y=(null!==(n=a.y)&&void 0!==n?n:Dn.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const n={type:Di.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Ca,n);return s?(this._setAttributes(s,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}scale(t,e,i){var n,s;if(1===t&&1===e)return this;const r={type:Di.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,ka,r);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const o=this.attribute;if(i){let{postMatrix:n}=this.attribute;n||(n=new St,o.postMatrix=n),ss.transformUtil.fromMatrix(n,n).scale(t,e,i)}else o.scaleX=(null!==(n=o.scaleX)&&void 0!==n?n:Dn.scaleX)*t,o.scaleY=(null!==(s=o.scaleY)&&void 0!==s?s:Dn.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const n={type:Di.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,ka,n);return s?(this._setAttributes(s,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}rotate(t,e){var i;if(0===t)return this;const n={type:Di.ROTATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Oa,n);s&&(delete s.angle,this._setAttributes(s,!1,n));const r=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new St,r.postMatrix=i),ss.transformUtil.fromMatrix(i,i).rotate(t,e)}else r.angle=(null!==(i=r.angle)&&void 0!==i?i:Dn.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Di.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Oa,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}animate(t){var e;this.animates||(this.animates=new Map);const i=new Ms(null==t?void 0:t.id,null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(i.bind(this),t){const{onStart:e,onFrame:n,onEnd:s,onRemove:r}=t;null!=e&&i.onStart(e),null!=n&&i.onFrame(n),null!=s&&i.onEnd(s),null!=r&&i.onRemove(r),i.interpolateFunc=t.interpolate}return this.animates.set(i.id,i),i.onRemove((()=>{i.stop(),this.animates.delete(i.id)})),i}onAttributeUpdate(t){t&&t.skipUpdateCallback||(ss.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!l(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,n){var s,r,a,o;if(i){const i=Object.keys(t),l=this.getNoWorkAnimateAttr(),h={};let c;i.forEach((e=>{l[e]?(c||(c={}),c[e]=t[e]):h[e]=n&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const u=this.animate({slience:!0});u.stateNames=e,u.to(h,null!==(r=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==r?r:Os,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:Ps),c&&this.setAttributes(c,!1,{type:Di.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Di.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const n=i.getEndProps();C(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const i=g(t)?e=>!t.includes(e):e=>e!==t,n=this.currentStates.filter(i);n.length!==this.currentStates.length&&this.useStates(n,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const s=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(s,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const n={};t.forEach((e=>{var i;const s=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];s&&Object.assign(n,s)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=Ri.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=Ri.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=Ri.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&Ri.UPDATE_SHAPE_AND_BOUNDS)===Ri.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=Ri.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Ri.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Ri.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=Ri.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=Ri.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=Ri.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=Ri.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&Ri.UPDATE_LAYOUT)}getAnchor(t,e,i){const n=[0,0],s=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,i&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,i=s();n[0]=i.x1+(i.x2-i.x1)*e}else n[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,i=s();n[1]=i.y1+(i.y2-i.y1)*e}else n[1]=t[1];return n}doUpdateLocalMatrix(){const{x:t=Dn.x,y:e=Dn.y,scaleX:i=Dn.scaleX,scaleY:n=Dn.scaleY,angle:s=Dn.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&s&&(l=this.getAnchor(a,h)),!r||1===i&&1===n)!function(t,e,i,n,s,r,a,o){const l=e.a,h=e.b,c=e.c,u=e.d,d=e.e,p=e.f,g=Z(a),f=tt(a);let y,m;o?(y=o[0],m=o[1]):(y=i,m=n);const v=y-i,b=m-n,x=l*g+c*f,_=h*g+u*f,A=c*g-l*f,S=u*g-h*f;t.a=s*x,t.b=s*_,t.c=r*A,t.d=r*S,t.e=d+l*y+c*m-x*v-A*b,t.f=p+h*y+u*m-_*v-S*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,s,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(s),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(r,h,!0),ss.transformUtil.fromMatrix(a,a).scale(i,n,{x:l[0],y:l[1]})}const c=this.getOffsetXY(Dn);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,o){const t=wa.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.timeline===Ts&&t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),ss.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Di.ANIMATE_END})}onStep(t,e,i,n,s){const r={};if(i.customAnimate)i.customAnimate.update(s,n,r);else{const a=i.props,o=i.parsedProps,l=i.propKeys;this.stepInterpolate(t,e,r,i,n,s,a,void 0,o,l)}this.setAttributes(r,!1,{type:Di.ANIMATE_UPDATE,animationState:{ratio:n,end:s,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,s,r,a,o,l,h){h||(h=Object.keys(a),n.propKeys=h),r?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):h.forEach((r=>{var h;if(!e.validAttr(r))return;const c=a[r],u=null!==(h=o&&o[r])&&void 0!==h?h:t.getLastPropByName(r,n);if(null==c||null==u||c===u)return void(i[r]=c);let d;d=e.interpolateFunc&&e.interpolateFunc(r,s,u,c,i),d||(d=e.customInterpolate(r,s,u,c,this,i),d||this.defaultInterpolate(c,u,r,i,l,s)||this._interpolate(r,s,u,c,i))})),n.parsedProps=l}defaultInterpolate(t,e,i,n,s,r){if(Number.isFinite(t)&&Number.isFinite(e))return n[i]=e+(t-e)*r,!0;if("fill"===i){s||(s={});const a=s.fillColorArray,o=Fs(e,null!=a?a:t,r,!1,((t,e)=>{s.fillColorArray=e}));return o&&(n[i]=o),!0}if("stroke"===i){s||(s={});const a=s.strokeColorArray,o=Fs(e,null!=a?a:t,r,!1,((t,e)=>{s.strokeColorArray=e}));return o&&(n[i]=o),!0}if("shadowColor"===i){s||(s={});const a=s.shadowColorArray,o=Fs(e,null!=a?a:t,r,!0,((t,e)=>{s.shadowColorArray=e}));return o&&(n[i]=o),!0}if(Array.isArray(t)&&t.length===e.length){const s=[];let a=!0;for(let i=0;i<t.length;i++){const n=e[i],o=n+(t[i]-n)*r;if(!Number.isFinite(o)){a=!1;break}s.push(o)}a&&(n[i]=s)}return!1}_interpolate(t,e,i,n,s){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:ss.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return p(t,!0)?this.pathProxy=(new En).fromString(t):this.pathProxy=new En,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(i,n),"string"==typeof t?(n.state="loading",t.startsWith("<svg")?(Ys.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(b(t)||t.includes("/")||x(t))&&(Ys.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):c(t)?(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e):n.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),ss.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const s=new xs(t,e);s.bubbles=!1,s.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(s)}}}var Ra;Ea.userSymbolMap={},Ea.mixin(_s),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(Ra||(Ra={}));class Ia extends Ea{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=ya,this._childUpdateTag=Ri.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new gs),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new gs)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,i){if(i===Ii.GLOBAL){const i=new rt(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&Ri.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;ss.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),ss.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=Dn.x,y:e=Dn.y,dx:i=Dn.dx,dy:n=Dn.dy,scaleX:s=Dn.scaleX,scaleY:r=Dn.scaleY,angle:a=Dn.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==s||1!==r||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return ys(this).group}updateAABBBounds(t,e,i){const n=i;i=i.clone();const{width:s,height:r,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=s&&null!=r&&i.set(0,0,Math.max(0,s),Math.max(0,r)),!o){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:n=0}=t;i.translate(e,n)}return ss.graphicService.updateTempAABBBounds(i),ss.graphicService.transformAABBBounds(t,i,e,!1,this),n.copy(i),n}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=Ri.CLEAR_BOUNDS,this._childUpdateTag&=Ri.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=Ri.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&Ri.UPDATE_BOUNDS||(this._childUpdateTag|=Ri.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),ss.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),ss.graphicService.onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,ss.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{ss.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),ss.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&Ri.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=ss.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new Ia(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ia.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}}function Da(t){return new Ia(t)}function Ua(t,e){return!(!t&&!e)}function Na(t,e){let i;return i=g(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function ja(t,e,i){return i&&t*e>0}function Fa(t,e){return t*e>0}Ia.NOWORK_ANIMATE_ATTR=La;const za=Symbol.for("PolygonRenderContribution"),Wa=Symbol.for("SymbolRenderContribution"),Ga=Symbol.for("InteractiveSubRenderContribution");function Ha(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Ya(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function Xa(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function $a(t,e,i){const n=i[0],s=i[1],r=i[2];let a,o,l,h,c,u,d,p,g,f,y,m;return e===t?(t[12]=e[0]*n+e[4]*s+e[8]*r+e[12],t[13]=e[1]*n+e[5]*s+e[9]*r+e[13],t[14]=e[2]*n+e[6]*s+e[10]*r+e[14],t[15]=e[3]*n+e[7]*s+e[11]*r+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],c=e[4],u=e[5],d=e[6],p=e[7],g=e[8],f=e[9],y=e[10],m=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=g,t[9]=f,t[10]=y,t[11]=m,t[12]=a*n+c*s+g*r+e[12],t[13]=o*n+u*s+f*r+e[13],t[14]=l*n+d*s+y*r+e[14],t[15]=h*n+p*s+m*r+e[15]),t}function Va(t,e,i){const n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],g=e[11],f=e[12],y=e[13],m=e[14],v=e[15];let b=i[0],x=i[1],_=i[2],A=i[3];return t[0]=b*n+x*o+_*u+A*f,t[1]=b*s+x*l+_*d+A*y,t[2]=b*r+x*h+_*p+A*m,t[3]=b*a+x*c+_*g+A*v,b=i[4],x=i[5],_=i[6],A=i[7],t[4]=b*n+x*o+_*u+A*f,t[5]=b*s+x*l+_*d+A*y,t[6]=b*r+x*h+_*p+A*m,t[7]=b*a+x*c+_*g+A*v,b=i[8],x=i[9],_=i[10],A=i[11],t[8]=b*n+x*o+_*u+A*f,t[9]=b*s+x*l+_*d+A*y,t[10]=b*r+x*h+_*p+A*m,t[11]=b*a+x*c+_*g+A*v,b=i[12],x=i[13],_=i[14],A=i[15],t[12]=b*n+x*o+_*u+A*f,t[13]=b*s+x*l+_*d+A*y,t[14]=b*r+x*h+_*p+A*m,t[15]=b*a+x*c+_*g+A*v,t}class qa{constructor(){this.pools=[]}static identity(t){return Xa(t)}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return qa.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const Ka=new qa;var Za=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ja=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qa=function(t,e){return function(i,n){e(i,n,t)}};function to(t,e,i){var n;const{x:s=i.x,y:r=i.y,z:a=i.z,dx:o=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:f=i.angle,anchor3d:y=e.attribute.anchor,anchor:m}=e.attribute,v=[0,0,0];if(y){if("string"==typeof y[0]){const t=parseFloat(y[0])/100,i=e.AABBBounds;v[0]=i.x1+(i.x2-i.x1)*t}else v[0]=y[0];if("string"==typeof y[1]){const t=parseFloat(y[1])/100,i=e.AABBBounds;v[1]=i.x1+(i.x2-i.x1)*t}else v[1]=y[1];v[2]=null!==(n=y[2])&&void 0!==n?n:0}if(Xa(t),$a(t,t,[s+o,r+l,a+h]),$a(t,t,[v[0],v[1],v[2]]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[4],a=e[5],o=e[6],l=e[7],h=e[8],c=e[9],u=e[10],d=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=r*s+h*n,t[5]=a*s+c*n,t[6]=o*s+u*n,t[7]=l*s+d*n,t[8]=h*s-r*n,t[9]=c*s-a*n,t[10]=u*s-o*n,t[11]=d*s-l*n}(t,t,g),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[8],c=e[9],u=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*s-h*n,t[1]=a*s-c*n,t[2]=o*s-u*n,t[3]=l*s-d*n,t[8]=r*n+h*s,t[9]=a*n+c*s,t[10]=o*n+u*s,t[11]=l*n+d*s}(t,t,p),$a(t,t,[-v[0],-v[1],v[2]]),function(t,e,i){const n=i[0],s=i[1],r=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,u,d]),f){const i=Ka.allocate(),n=[0,0];if(m){if("string"==typeof y[0]){const t=parseFloat(y[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=y[0];if("string"==typeof y[1]){const t=parseFloat(y[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=y[1]}$a(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[4],c=e[5],u=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*s+h*n,t[1]=a*s+c*n,t[2]=o*s+u*n,t[3]=l*s+d*n,t[4]=h*s-r*n,t[5]=c*s-a*n,t[6]=u*s-o*n,t[7]=d*s-l*n}(i,i,f),$a(i,i,[-n[0],-n[1],0]),Va(t,t,i)}}let eo=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new di(["graphic"]),onSetStage:new di(["graphic","stage"]),onRemove:new di(["graphic"]),onRelease:new di(["graphic"]),onAddIncremental:new di(["graphic","group","stage"]),onClearIncremental:new di(["graphic","group","stage"]),beforeUpdateAABBBounds:new di(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new di(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new di(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new _t,this.tempAABBBounds2=new _t}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,s){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,s)}clearAABBBounds(t,e,i){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,i)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new fi(t);return Xi(i.commandList,n,0,0),!0}updateHTMLTextAABBBounds(t,e,i,n){const{textAlign:s,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=m(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=Ya(r,e,e);i.set(i.x1,n,i.x2,n+e)}if(null!=t.forceBoundsWidth){const e=m(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=Ha(s,e);i.set(n,i.y1,n+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,s){if(!e.empty()){const{scaleX:s=i.scaleX,scaleY:r=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&l){la(u,(l+h)/Math.abs(s+r),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(o){const{shadowOffsetX:n=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;la(u,o/Math.abs(s+r)*2,!1,c+1),u.translate(n,a),e.union(u)}}if(this.combindShadowAABBBounds(e,s),e.empty())return;let r=!0;const a=s.transMatrix;s&&s.isContainer&&(r=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),r&&bt(e,e,a)}validCheck(t,e,i,n){if(!n)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(n.shadowRoot||n.isContainer)return!0;const{visible:s=e.visible}=t;return!(!n.valid||!s)||(i.empty()||(n.parent&&i.transformWithMatrix(n.parent.globalTransMatrix),ss.graphicService.clearAABBBounds(n,n.stage,i),i.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}};eo=Za([Ye(),Qa(0,Ge(Aa)),Ja("design:paramtypes",[Object])],eo);class io{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,n){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===i)t.yOffset=0;else if("middle"===i)t.yOffset=t.height/-2;else if("alphabetic"===i){let e=.79;if(1===n.length){const t=n[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;const{lineWidth:o,suffixPosition:l="end",measureMode:h=pi.actualBounding,keepCenterInLine:c=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const u=[],d=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++){const n=this.textMeasure.measureTextPixelADscentAndWidth(t[i],this.textOptions,h);let a=t[i].toString();if(n.width>o){const n=this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,o,s,r,l);a=n.str,e=n.width}else e=n.width;u.push({str:a,width:e,ascent:n.ascent,descent:n.descent,keepCenterInLine:c})}d[0]=o}else{let e,i,n=0;for(let s=0,r=t.length;s<r;s++){i=t[s];const r=this.textMeasure.measureTextPixelADscentAndWidth(t[s],this.textOptions,h);e=r.width,n=Math.max(n,e),u.push({str:i,width:e,ascent:r.ascent,descent:r.descent,keepCenterInLine:c})}d[0]=n}d[1]=u.length*n,d[0]=u.reduce(((t,e)=>Math.max(t,e.width)),0);const p={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(p,e,i,u),this.layoutWithBBox(p,u,e,i,n)}layoutWithBBox(t,e,i,n,s){const r=[0,0],a=e.length*s;"top"===n||("middle"===n?r[1]=(t.height-a)/2:"bottom"===n&&(r[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,n,s,r);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:s,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,s,r){if("left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=s/2+(e.ascent-e.descent)/2+r[1],!e.keepCenterInLine){const t=0,i=e.ascent+e.descent+t;if(i<s-t&&("bottom"===n?e.topOffset+=(s-i)/2:"top"===n&&(e.topOffset-=(s-i)/2)),"alphabetic"===n){const t=s/(e.ascent+e.descent);e.topOffset=s/2+(e.ascent-e.descent)/2*t+r[1]}}return r[1]+=s,e}}const no=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...Ma];class so extends Ea{get font(){const t=this.getGraphicTheme();return this._font||(this._font=mt(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme(),n=this.getMaxWidth(i);return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const i=this.getGraphicTheme(),n=this.attribute,s=this.getMaxWidth(i);if(!Number.isFinite(s))return!1;const{text:r}=this.attribute;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(r)?r.join(""):r)!==t}return"vertical"===n.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==n.text.toString():null!=this.clipedText&&this.clipedText!==n.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=_a,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return g(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return ys(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new so({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const n=this.obbText.AABBBounds,{x:s,y:r}=e,a={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2},o=pt(a,i,{x:s,y:r});return this._OBBBounds.copy(n),this._OBBBounds.translate(o.x-a.x,o.y-a.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:n=e.text}=this.attribute;Array.isArray(n)?this.updateMultilineAABBBounds(n):this.updateSingallineAABBBounds(n);const{tb1:s}=ss.graphicService.updateTempAABBBounds(i),{scaleX:r=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){la(s,o/Math.abs(r+a),!0,l),i.union(s)}return ss.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ss.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,bt(i,i,this.transMatrix),i}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,s="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),s}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const i=this.getGraphicTheme(),n=this.attribute,{fontFamily:s=i.fontFamily,textAlign:r=i.textAlign,textBaseline:a=i.textBaseline,fontSize:o=i.fontSize,fontWeight:l=i.fontWeight,ellipsis:h=i.ellipsis,maxLineWidth:c,stroke:u=i.stroke,wrap:d=i.wrap,measureMode:p=i.measureMode,lineWidth:g=i.lineWidth,whiteSpace:f=i.whiteSpace,suffixPosition:y=i.suffixPosition,ignoreBuf:m=i.ignoreBuf,keepCenterInLine:v=i.keepCenterInLine}=n,b=m?0:this.guessLineHeightBuf(o),x=this.getLineHeight(n,i,b);if("normal"===f||d)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}const _=ss.graphicUtil.textMeasure,A=new io(s,{fontSize:o,fontWeight:l,fontFamily:s,lineHeight:x},_).GetLayoutByLines(t,r,a,x,!0===h?i.ellipsis:h||void 0,!1,{lineWidth:c,suffixPosition:y,measureMode:p,keepCenterInLine:v}),{bbox:S}=A;return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(S.xOffset,S.yOffset,S.xOffset+S.width,S.yOffset+S.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}updateWrapAABBBounds(t){var e,i,n;const s=this.getGraphicTheme(),{fontFamily:r=s.fontFamily,textAlign:a=s.textAlign,textBaseline:o=s.textBaseline,fontSize:l=s.fontSize,ellipsis:h=s.ellipsis,maxLineWidth:c,stroke:u=s.stroke,lineWidth:d=s.lineWidth,wordBreak:p=s.wordBreak,fontWeight:f=s.fontWeight,ignoreBuf:y=s.ignoreBuf,measureMode:m=s.measureMode,suffixPosition:v=s.suffixPosition,heightLimit:b=0,lineClamp:x,keepCenterInLine:_=s.keepCenterInLine}=this.attribute,A=y?0:this.guessLineHeightBuf(l),S=this.getLineHeight(this.attribute,s,A);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}const T=ss.graphicUtil.textMeasure,B={fontSize:l,fontWeight:f,fontFamily:r,lineHeight:S},w=new io(r,B,T),M=g(t)?t.map((t=>t.toString())):[t.toString()],C=[],k=[0,0];let O=1/0;if(b>0&&(O=Math.max(Math.floor(b/S),1)),x&&(O=Math.min(O,x)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<M.length;t++){const e=M[t];let s=!0;if(t===O-1){const i=T.clipTextWithSuffix(e,B,c,h,!1,v,t!==M.length-1),n=T.measureTextPixelADscentAndWidth(i.str,B,m);C.push({str:i.str,width:i.width,ascent:n.ascent,descent:n.descent,keepCenterInLine:_});break}const r=T.clipText(e,B,c,"break-all"!==p,"keep-all"===p);if(""!==e&&""===r.str||r.wordBreaked){if(h){const t=T.clipTextWithSuffix(e,B,c,h,!1,v);r.str=null!==(i=t.str)&&void 0!==i?i:"",r.width=null!==(n=t.width)&&void 0!==n?n:0}else r.str="",r.width=0;s=!1}const a=T.measureTextPixelADscentAndWidth(r.str,B,m);C.push({str:r.str,width:r.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:_});let o=r.str.length;if(!r.wordBreaked||""!==e&&""===r.str||(s=!0,o=r.wordBreaked),r.str.length===e.length);else if(s){let i=e.substring(o);"keep-all"===p&&(i=i.replace(/^\s+/g,"")),M.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),k[0]=t}else{let t,e,i=0;for(let n=0,s=M.length;n<s;n++){if(n===O-1){const t=T.clipTextWithSuffix(M[n],B,c,h,!1,v),e=T.measureTextPixelADscentAndWidth(t.str,B,m);C.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),i=Math.max(i,t.width);break}e=M[n],t=T.measureTextWidth(e,B),i=Math.max(i,t);const s=T.measureTextPixelADscentAndWidth(e,B,m);C.push({str:e,width:t,ascent:s.ascent,descent:s.descent,keepCenterInLine:_})}k[0]=i}k[1]=C.length*S;const P={xOffset:0,yOffset:0,width:k[0],height:k[1]};w.LayoutBBox(P,a,o,C);const L=w.layoutWithBBox(P,C,a,o,S);return this.cache.layoutData=L,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i;const n=this.getGraphicTheme(),s=ss.graphicUtil.textMeasure;let r;const a=this.attribute,{maxLineWidth:o=n.maxLineWidth,ellipsis:l=n.ellipsis,fontFamily:h=n.fontFamily,fontSize:c=n.fontSize,fontWeight:u=n.fontWeight,stroke:d=n.stroke,lineWidth:p=n.lineWidth,verticalMode:g=n.verticalMode,suffixPosition:f=n.suffixPosition}=a,y=this.getLineHeight(a,n,0);let{textAlign:m=n.textAlign,textBaseline:v=n.textBaseline}=a;if(!g){const t=m;m=null!==(e=so.baselineMapAlign[v])&&void 0!==e?e:"left",v=null!==(i=so.alignMapBaseline[t])&&void 0!==i?i:"top"}if(r=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=J(e,r)}));const t=Ha(m,r),e=this.cache.verticalList.length*y,i=Ya(v,e,c);return this._AABBBounds.set(i,t,i+e,t+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const b=t.map((t=>function(t){const e=[];let i=0,n="";for(let s=0;s<t.length;s++)ga(t[s])?i?n+=t[s]:(i=1,n=t[s]):(i&&(e.push({text:n,direction:ua.VERTICAL}),n="",i=0),e.push({text:t[s],direction:ua.HORIZONTAL}));return n&&e.push({text:n,direction:ua.VERTICAL}),e}(t.toString())));b.forEach(((t,e)=>{if(Number.isFinite(o))if(l){const i=!0===l?n.ellipsis:l,a=s.clipTextWithSuffixVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,i,!1,f);b[e]=a.verticalList,r=a.width}else{const i=s.clipTextVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,!1);b[e]=i.verticalList,r=i.width}else r=0,t.forEach((t=>{const e=t.direction===ua.HORIZONTAL?c:s.measureTextWidth(t.text,{fontSize:c,fontWeight:u,fontFamily:h});r+=e,t.width=e}))})),this.cache.verticalList=b,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=J(e,r)}));const x=Ha(m,r),_=this.cache.verticalList.length*y,A=Ya(v,_,c);return this._AABBBounds.set(A,x,A+_,x+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}getMaxWidth(t){var e,i;const n=this.attribute;return null!==(i=null!==(e=n.maxLineWidth)&&void 0!==e?e:n.maxWidth)&&void 0!==i?i:t.maxWidth}getLineHeight(t,e,i){var n;return null!==(n=Ds(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==n?n:(t.fontSize||e.fontSize)+i}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:no;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:no;return super.needUpdateTag(t,e)}_interpolate(t,e,i,n,s){"text"===t&&(s.text=n)}clone(){return new so(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return so.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return so.baselineMapAlign}getAlignMapBaseline(){return so.alignMapBaseline}}function ro(t){return new so(t)}so.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},La),so.baselineMapAlign={top:"left",bottom:"right",middle:"center"},so.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const ao=["symbolType","size",...Ma];let oo=class t extends Ea{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=xa}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=null;try{n=new Path2D}catch(t){return null}const s=this.getParsedPath();if(!s)return null;s.draw(n,i,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return g(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return ys(this).symbol}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=ss.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(n){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=n;la(i,a+(s+o)/2,!0,r)}})(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,this.x1WithoutTransform=i.x1,this.y1WithoutTransform=i.y1;const{lineJoin:a=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:n=e.size}=t;if(g(n))i.set(-n[0]/2,-n[1]/2,n[0]/2,n[1]/2);else{const t=n/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:n=e.size}=t;return this.getParsedPath().bounds(n,i),i}needUpdateTags(t){return super.needUpdateTags(t,ao)}needUpdateTag(t){return super.needUpdateTag(t,ao)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=g(e)?e:[e,e];return t.path?(new En).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new En).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function lo(t){return new oo(t)}oo.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},La);const ho=["segments","points","curveType","curveTension",...Ma];class co extends Ea{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=ma}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,n,s){"points"===t&&(s.points=Is(i,n,e))}getGraphicTheme(){return ys(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),ss.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:s=e.points,connectedType:r}=t,a=i;return s.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:s=e.segments,connectedType:r}=t,a=i;return s.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,ho)}needUpdateTag(t){return super.needUpdateTag(t,ho)}toCustomPath(){const t=this.attribute,e=new En,i=t.segments,n=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):t.points&&n(t.points),e}clone(){return new co(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return co.NOWORK_ANIMATE_ATTR}}function uo(t){return new co(t)}co.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},La);const po=["path","customPath",...Ma];class go extends Ea{constructor(t){super(t),this.type="path",this.numberType=va}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof En?e.path:(l(this.cache)&&this.doUpdatePathShape(),this.cache instanceof En?this.cache:t.path)}getGraphicTheme(){return ys(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:n,tb2:s}=ss.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur}=t;if(n){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=n;i.expand(r+(s+a)/2)}})(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:r=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;p(t.path,!0)?this.cache=(new En).fromString(t.path):t.customPath&&(this.cache=new En,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,po)}needUpdateTag(t){return super.needUpdateTag(t,po)}toCustomPath(){return(new En).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new go(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return go.NOWORK_ANIMATE_ATTR}}function fo(t){return new go(t)}go.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},La);const yo=["segments","points","curveType","curveTension",...Ma];class mo extends Ea{constructor(t){super(t),this.type="area",this.numberType=fa}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return ys(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),ss.graphicService.updateTempAABBBounds(i),this.setWidthHeightWithoutTransform(i);const{lineJoin:n=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:s=e.points}=t,r=i;return s.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),r}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:s=e.segments}=t,r=i;return s.forEach((t=>{t.points.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),r}_interpolate(t,e,i,n,s){"points"===t&&(s.points=Is(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,yo)}needUpdateTag(t){return super.needUpdateTag(t,yo)}toCustomPath(){const t=new En,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var s,r;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(s=e.x1)&&void 0!==s?s:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new mo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return mo.NOWORK_ANIMATE_ATTR}}mo.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},La);const vo=["points","cornerRadius",...Ma];class bo extends Ea{constructor(t){super(t),this.type="polygon",this.numberType=ba}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return ys(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),ss.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:n=e.points}=t;return n.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,n,s){"points"===t&&(s.points=Is(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,vo)}needUpdateTag(t){return super.needUpdateTag(t,vo)}toCustomPath(){const t=this.attribute.points,e=new En;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new bo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return bo.NOWORK_ANIMATE_ATTR}}function xo(t){return new bo(t)}bo.NOWORK_ANIMATE_ATTR=La;const _o=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};var Ao=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},So=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},To=function(t,e){return function(i,n){e(i,n,t)}};const Bo=new class{constructor(){this.time=Wi.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){var p;const{background:g,backgroundOpacity:f=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:y=l.opacity,backgroundMode:m=l.backgroundMode,backgroundFit:v=l.backgroundFit,backgroundKeepAspectRatio:b=l.backgroundKeepAspectRatio,backgroundScale:x=l.backgroundScale,backgroundOffsetX:_=l.backgroundOffsetX,backgroundOffsetY:A=l.backgroundOffsetY,backgroundClip:S=l.backgroundClip}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const s=t.resources.get(g);if("success"!==s.state||!s.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=ys(t.parent).group,{scrollX:n=i.scrollX,scrollY:s=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,s)}S&&e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=f*y,this.doDrawImage(e,s.data,r,{backgroundMode:m,backgroundFit:v,backgroundKeepAspectRatio:b,backgroundScale:x,backgroundOffsetX:_,backgroundOffsetY:A}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=f*y,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n){const{backgroundMode:s,backgroundFit:r,backgroundKeepAspectRatio:a,backgroundScale:o=1,backgroundOffsetX:l=0,backgroundOffsetY:h=0}=n,c=i.width(),u=i.height();let d=c,p=u;if("no-repeat"===s)if(r)if(a){const n=Math.max(c/e.width,u/e.height);t.drawImage(e,i.x1+l,i.y1+h,e.width*n*o,e.height*n*o)}else t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const n=e.width*o,s=e.height*o;t.drawImage(e,i.x1+l,i.y1+h,n,s)}else{if(r&&"repeat"!==s&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===s?(d=i*(u/n),p=u):"repeat-y"===s&&(p=n*(c/i),d=c);const r=t.dpr,a=hs.allocate({width:d,height:p,dpr:r}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,d,p),o.drawImage(e,0,0,d,p),e=a.nativeCanvas),hs.free(a)}const n=t.dpr,a=t.createPattern(e,s);a.setTransform&&a.setTransform(new DOMMatrix([1/n,0,0,1/n,0,0])),t.fillStyle=a,t.translate(i.x1,i.y1),t.fillRect(0,0,c,u),t.translate(-i.x1,-i.y1)}}};let wo=class{constructor(t){this.subRenderContribitions=t,this.time=Wi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,s,r,a,o,l,h,c,u,d)}))}};wo=Ao([Ye(),To(0,Ge(oi)),To(0,Xe(Ga)),So("design:paramtypes",[Object])],wo);const Mo=new class{constructor(){this.time=Wi.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){var p,g;const{clipConfig:f}=t.attribute;if(!f)return;const y=t.getClipPath();if(!y)return;const m=!(c||u),v=t.AABBBounds,b=null!==(p=t.attribute.width)&&void 0!==p?p:v.width(),x=null!==(g=t.attribute.height)&&void 0!==g?g:v.height();m&&e.save(),e.beginPath(),!1===y.draw(e,[b,x],i+b/2,n+x/2,0)&&e.closePath(),c&&c(e,t.attribute,l,!0),m&&e.clip()}};const Co=new class{constructor(){this.time=Wi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){const{clipConfig:p}=t.attribute;p&&t.getClipPath()&&(c||u||e.restore())}};const ko=new class{constructor(){this.time=Wi.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,i,n,s){const r=(t-2*e)/2,a=n.dpr,o=hs.allocate({width:t,height:t,dpr:a}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),s(r,l);const h=n.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),hs.free(o),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,V),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const s=t/2,r=s;n.fillStyle=i,n.moveTo(s,r-e),n.lineTo(e+s,r),n.lineTo(s,r+e),n.lineTo(s-e,r),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(r,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(0,r,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const s=t/2,r=-s;n.moveTo(s,r),n.lineTo(s+t,r+t),n.moveTo(-s,-r),n.lineTo(-s+t,-r+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const s=t/2,r=s;n.moveTo(t+s,r),n.lineTo(s,r+t),n.moveTo(t-s,-r),n.lineTo(-s,-r+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,t,t),n.fillRect(s+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:f=l.textureSize,texturePadding:y=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,l,g,f,y)}drawTexture(t,e,i,n,s,r,a,o,l){var h;const{textureRatio:c=r.textureRatio,textureOptions:u=null}=e.attribute;let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(o,l,a,i);break;case"diamond":d=this.createDiamondPattern(o,l,a,i);break;case"rect":d=this.createRectPattern(o,l,a,i);break;case"vertical-line":d=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":d=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":d=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":d=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":d=this.createGridPattern(o,l,a,i)}if(u&&u.dynamicTexture){const{gridConfig:d={},useNewCanvas:p}=u,g=e.AABBBounds;n=g.x1,s=g.y1;const f=i;let y;if(p){y=hs.allocate({width:g.width(),height:g.height(),dpr:i.dpr});const t=y.getContext("2d");t.clearRect(0,0,g.width(),g.height()),n=0,s=0,i=t}if(f.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:i=0}=e.parent.attribute;f.setTransformFromMatrix(e.parent.globalTransMatrix),f.translate(t,i,!0)}f.setCommonStyle(e,e.attribute,n,s,r),f.clip();const m=g.width(),v=g.height(),b=l,x=o,_=d.columns?d.columns:Math.ceil(m/x),A=d.rows?d.rows:Math.ceil(v/x),S=d.gutterColumn?d.gutterColumn:2*b,T=d.gutterRow?d.gutterRow:2*b;this._tempSymbolGraphic||(this._tempSymbolGraphic=lo({}));const B=d.columns?m/d.columns:x,w=d.rows?v/d.rows:x;this._tempSymbolGraphic.setAttributes({size:[B-S,w-T],symbolType:t});const M=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<A;t++)for(let r=0;r<_;r++){const o=n+x/2+r*x,l=s+x/2+t*x;null===(h=u.beforeDynamicTexture)||void 0===h||h.call(u,i,t,r,A,_,c,e,g.width(),g.height()),i.beginPath(),!1===M.draw(i,Math.min(B-S,w-T),o,l,0)&&i.closePath(),i.fillStyle=a,u.dynamicTexture(i,t,r,A,_,c,e,g.width(),g.height())}p&&(f.globalAlpha=1,f.drawImage(y.nativeCanvas,0,0,y.nativeCanvas.width,y.nativeCanvas.height,g.x1,g.y1,g.width()*f.dpr,g.height()*f.dpr)),f.restore()}else if(d)i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,s,r),i.fillStyle=d,i.fill(),i.highPerformanceRestore();else if("wave"===t){i.save(),i.setCommonStyle(e,e.attribute,n,s,r),i.clip();const t=e.AABBBounds;(function(t,e,i,n,s,r,a){const{fill:o="orange",percent:l=.6,frequency:h=4,opacity:c,phi:u=0}=s;let{amplitude:d=10}=s;d*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const p=n*(1-l),g=i,f=Math.max(Math.round(g/70),2);t.beginPath(),t.moveTo(0+r,n+a),t.lineTo(0+r,p+a);const y=g/h*e,m=g/Math.PI/(2*h);for(let e=0;e<g;e+=f){const i=d*Math.sin((e+y+u)/m+u);t.lineTo(e+r,p+i+a)}t.lineTo(g+r,n+a),t.closePath(),t.fillStyle=o,isFinite(c)&&(t.globalAlpha=c),t.fill()})(i,c,t.width(),t.height(),Object.assign(Object.assign({},u||{}),{fill:a}),n+t.x1-n,s+t.y1-s),i.restore()}}};const Oo=new class{constructor(){this.time=Wi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,y=g&&!1!==g.visible;if(!f&&!y)return;const{size:m=l.size,opacity:v=l.opacity,x:b=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:A=l.scaleY,keepStrokeScale:S=l.keepStrokeScale}=t.attribute,T=(s,r)=>{const a=!(!s||!s.stroke),{distance:o=l[r].distance}=s,h=S?o:rs(e,o,e.dpr),c="outerBorder"===r?1:-1;if(e.beginPath(),!1===d.drawOffset(e,m,i,n,c*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=v,e.setStrokeStyle(t,s,(b-i)/_,(x-n)/A,l[r]),l[r].opacity=a,e.stroke()}};f&&T(p,"outerBorder"),y&&T(g,"innerBorder")}},Po=new class{constructor(){this.time=Wi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){const{clipRange:p=l.clipRange,x:g=l.x,y:f=l.y,z:y=l.z,size:m=l.size,scaleX:v=l.scaleX,scaleY:b=l.scaleY}=t.attribute,x=t.getParsedPath();x&&p<1&&p>0&&(e.beginPath(),x.drawWithClipRange&&x.drawWithClipRange(e,m,i,n,p,y,((s,r)=>{var a,h,c,d;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(a=r.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(h=r.opacity)&&void 0!==h?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(c=r.stroke)&&void 0!==c?c:t.attribute.stroke,e.lineWidth=null!==(d=r.lineWidth)&&void 0!==d?d:t.attribute.lineWidth,r=e}r.stroke&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,r,(g-i)/v,(f-n)/b,l),e.stroke()))})),r&&!x.isSvg&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(g-i)/v,(f-n)/b,l),e.stroke())))}},Lo=ko,Eo=Bo,Ro={x:0,y:0,z:0,lastModelMatrix:null};class Io{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(Mo),this.builtinContributions.push(Co),this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===Wi.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Wi.afterFillStroke)))}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,i,n,s,r,a,o,l,h,c,u,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d)}))}afterRenderStep(t,e,i,n,s,r,a,o,l,h,c,u,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d)}))}drawPathProxy(t,e,i,n,s,r,a,o){if(!t.pathProxy)return!1;const l=ys(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:f=l.visible,x:y=l.x,y:m=l.y}=t.attribute,v=ja(u,d,h),b=Fa(u,g),x=Ua(h),_=Na(c,p);if(!f)return!0;if(!x&&!_)return!0;if(!(v||b||a||o))return!0;e.beginPath();return Xi(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,x,_,v,b,l,s,a,o),_&&(o?o(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,i-y,n-m,l),e.stroke())),x&&(a?a(e,t.attribute,l):v&&(e.setCommonStyle(t,t.attribute,i-y,n-m,l),e.fill())),this.afterRenderStep(t,e,i,n,x,_,v,b,l,s,a,o),!0}valid(t,e,i,n){const{fill:s=e.fill,background:r,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=ja(o,l,s),p=Fa(o,c),g=Ua(s,r),f=Na(a,h);return!(!t.valid||!u)&&!(!g&&!f)&&!!(d||p||i||n||r)&&{fVisible:d,sVisible:p,doFill:g,doStroke:f}}transform(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:s=e.x,y:r=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:c}=t.attribute,u=i.modelMatrix,d=i.camera;Ro.x=s,Ro.y=r,Ro.z=a,Ro.lastModelMatrix=u;const p=d&&(n||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!c:1===o&&1===l&&0===h&&!c;if(p){const n=Ka.allocate(),s=Ka.allocate();to(s,t,e),Va(n,u||n,s),Ro.x=0,Ro.y=0,Ro.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),Ka.free(s)}if(g&&!u){const n=t.getOffsetXY(e);Ro.x+=n.x,Ro.y+=n.y,Ro.z=a,i.setTransformForCurrent()}else if(p)Ro.x=0,Ro.y=0,Ro.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(d&&i.project){const n=t.getOffsetXY(e);Ro.x+=n.x,Ro.y+=n.y,this.transformWithoutTranslate(i,Ro.x,Ro.y,Ro.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),Ro.x=0,Ro.y=0,Ro.z=0;return Ro}transformUseContext2d(t,e,i,n){const s=n.camera;if(this.camera=s,s){const e=t.AABBBounds,s=e.x2-e.x1,r=e.y2-e.y1,a=n.project(0,0,i),o=n.project(s,0,i),l=n.project(s,r,i),h={x:0,y:0},c={x:s,y:0},u={x:s,y:r};n.camera=null;const d=1/(h.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*h.y),p=-(h.y*(l.x-o.x)-c.y*l.x+u.y*o.x+(c.y-u.y)*a.x)*d,g=(c.y*l.y+h.y*(o.y-l.y)-u.y*o.y+(u.y-c.y)*a.y)*d,f=(h.x*(l.x-o.x)-c.x*l.x+u.x*o.x+(c.x-u.x)*a.x)*d,y=-(c.x*l.y+h.x*(o.y-l.y)-u.x*o.y+(u.x-c.x)*a.y)*d,m=(h.x*(u.y*o.x-c.y*l.x)+h.y*(c.x*l.x-u.x*o.x)+(u.x*c.y-c.x*u.y)*a.x)*d,v=(h.x*(u.y*o.y-c.y*l.y)+h.y*(c.x*l.y-u.x*o.y)+(u.x*c.y-c.x*u.y)*a.y)*d;n.setTransform(p,g,f,y,m,v,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,s,r,a){const o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(s,r,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,s){const{context:r}=n;if(!r)return;const{renderable:a}=t.attribute;if(!1===a)return;r.highPerformanceSave();const o=this.transform(t,e,r,i),{x:l,y:h,z:c,lastModelMatrix:u}=o;this.z=c,this.drawPathProxy(t,r,l,h,n,s)||(this.drawShape(t,r,l,h,n,s),this.z=0,r.modelMatrix!==u&&Ka.free(r.modelMatrix),r.modelMatrix=u),r.highPerformanceRestore()}}function Do(t,e,i,n){if(!e.p1)return;const{offsetX:s=0,offsetY:r=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,r+e.p1.y,s+e.p2.x,r+e.p2.y,s+e.p3.x,r+e.p3.y,a):t.lineTo(s+e.p1.x,r+e.p1.y,a);else if(e.p2&&e.p3){const[n]=tn(e,i);t.bezierCurveTo(s+n.p1.x,r+n.p1.y,s+n.p2.x,r+n.p2.y,s+n.p3.x,r+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(s+n.x,r+n.y,a)}}function Uo(t,e,i,n,s,r,a){var o;let l=e.p0,h=n;if(i&&i.originP1===i.originP2&&(l=i.p0),e.defined)n||(t.lineTo(l.x+s,l.y+r,a),h=!n);else{const{originP1:c,originP2:u}=e;let d;if(c&&!1!==c.defined&&!i?d=l:c&&!1!==u.defined&&(d=null!==(o=e.p3)&&void 0!==o?o:e.p1),n){h=!n;const i=d?d.x:e.p0.x,o=d?d.y:e.p0.y;t.moveTo(i+s,o+r,a)}else d&&(h=!n,t.lineTo(d.x+s,d.y+r,a))}return h}var No=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let jo=class extends Io{constructor(){super(...arguments),this.numberType=ma}draw(t,e,i,n){const s=ys(t,null==n?void 0:n.theme).line;this._draw(t,s,!1,i,n)}drawSegmentItem(t,e,i,n,s,r,a,o,l,h,c,u,d,p,f){var y;if(!e)return;t.beginPath();const m=null!==(y=this.z)&&void 0!==y?y:0;(function(t,e,i,n,s){const{offsetX:r=0,offsetY:a=0,offsetZ:o=0,mode:l="none",drawConnect:h=!1}=s||{};if(h&&"none"===l)return;if(!e)return;let c=!0;const{curves:u}=e;if(i>=1){if(h){let e,i=!0;u.forEach(((n,s)=>{n.originP1!==n.originP2?(i=Uo(t,n,e,i,r,a,o),e=n):e=n}))}else u.forEach((e=>{e.defined?(c&&t.moveTo(e.p0.x+r,e.p0.y+a,o),Do(t,e,1,s),c=!1):c=!0}));return}if(i<=0)return;let d;"x"===n?d=Fi.ROW:"y"===n?d=Fi.COLUMN:"auto"===n&&(d=e.direction);const p=i*e.tryUpdateLength(d);let g=0,f=!0,y=null;for(let e=0,i=u.length;e<i;e++){const i=u[e],n=i.getLength(d),l=(p-g)/n;if(g+=n,l<0)break;if(h){if(i.originP1===i.originP2){y=i;continue}f=Uo(t,i,y,f,r,a,o),y=i}else{if(!i.defined){c=!0;continue}c&&t.moveTo(i.p0.x+r,i.p0.y+a,o),Do(t,i,Q(l,1),s),c=!1}}})(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u,offsetZ:m}),d.cache&&!g(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,a,o);const{x:v=0,x:b=0}=a;return!1!==i&&(p?p(t,a,o):s&&(t.setCommonStyle(d,a,v-c,b-u,o),t.fill())),!1!==n&&(f?f(t,a,o):r&&(t.setStrokeStyle(d,a,v-c,b-u,o),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,n,s,r,a,o,l,h,c,u,d){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,y=f[0];e.moveTo(y.x+a,y.y+o,g);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+a,i.y+o,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const{x:m=0,x:v=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,l):s&&(e.setCommonStyle(t,t.attribute,m-a,v-o,l),e.fill())),!1!==n&&(d?d(e,t.attribute,l):r&&(e.setStrokeStyle(t,t.attribute,m-a,v-o,l),e.stroke()))}drawShape(t,e,i,n,s,r,a,o){const l=ys(t,null==r?void 0:r.theme).line,{fill:h=l.fill,stroke:c=l.stroke,fillOpacity:u=l.fillOpacity,strokeOpacity:d=l.strokeOpacity,segments:p,points:g,closePath:f,curveTension:y=l.curveTension,connectedType:m=l.connectedType}=t.attribute;if(!this.valid(t,l,a,o))return;let{curveType:v=l.curveType}=t.attribute;f&&"linear"===v&&(v="linearClosed");const{clipRange:b=l.clipRange,clipRangeByDimension:x=l.clipRangeByDimension}=t.attribute;if(1===b&&!p&&!g.some((t=>!1===t.defined))&&"linear"===v)return this.drawLinearLineHighPerformance(t,e,!!h,!!c,u,d,i,n,l,s,r,a,o);function _(t,e){return"none"===e?t:t.filter((t=>!1!==t.defined))}if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,n=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const s=Ln(_(t.points,m),v,{startPoint:e,curveTension:y});return n=s,s})).filter((t=>!!t)),"linearClosed"===v){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Ln(_(n,m),v,{curveTension:y})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===b){let r=!1;t.cache.forEach(((p,g)=>{r||(r=this.drawSegmentItem(e,p,!!h,!!c,u,d,s[g],[l,t.attribute],b,x,i,n,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=b*r;let g=0,f=!1;t.cache.forEach(((r,y)=>{if(f)return;const m=r.getLength(),v=(p-g)/m;g+=m,v>0&&(f=this.drawSegmentItem(e,r,!!h,!!c,u,d,s[y],[l,t.attribute],Q(v,1),x,i,n,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!c,u,d,t.attribute,l,b,x,i,n,t,a,o)}};jo=No([Ye()],jo);var Fo=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},zo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wo=function(t,e){return function(i,n){e(i,n,t)}};let Go=class extends Io{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=xa,this.builtinContributions=[Oo,Eo,Lo,Po],this.init(t)}drawShape(t,e,i,n,s,r,a,o){var l;const h=ys(t,null==r?void 0:r.theme).symbol,{size:c=h.size,x:u=h.x,y:d=h.y,scaleX:p=h.scaleX,scaleY:f=h.scaleY,fillStrokeOrder:y=h.fillStrokeOrder,clipRange:m=h.clipRange}=t.attribute,v=this.valid(t,h,a,o);if(!v)return;const{fVisible:b,sVisible:x,doFill:_,doStroke:A}=v,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:T=h.keepDirIn3d}=t.attribute,B=null!==(l=this.z)&&void 0!==l?l:0;e.beginPath();let w=i,M=n,C=B;const k=e.camera;if(T&&k&&e.project){const t=e.project(i,n,B);e.camera=null,g(c)&&(c[0],c[1]),w=t.x,M=t.y,C=void 0}!1===S.draw(e,c,w,M,C,((s,r)=>{var l,c,g,v;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(l=r.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(c=r.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(g=r.stroke)&&void 0!==g?g:t.attribute.stroke,e.lineWidth=null!==(v=r.lineWidth)&&void 0!==v?v:t.attribute.lineWidth,r=e}const b=()=>{r.fill&&(a?a(e,t.attribute,h):(e.setCommonStyle(t,r,u-i,d-n,h),e.fill()))},_=()=>{r.stroke&&(o?o(e,t.attribute,h):x&&m>=1&&(e.setStrokeStyle(t,r,(u-i)/p,(d-n)/f,h),e.stroke()))};y?(_(),b()):(b(),_())}))&&e.closePath(),e.camera=k,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,_,A,b,x,h,s,a,o);const O=()=>{_&&!S.isSvg&&(a?a(e,t.attribute,h):b&&(e.setCommonStyle(t,t.attribute,u-i,d-n,h),e.fill()))},P=()=>{A&&!S.isSvg&&(o?o(e,t.attribute,h):x&&m>=1&&(e.setStrokeStyle(t,t.attribute,(u-i)/p,(d-n)/f,h),e.stroke()))};y?(P(),O()):(O(),P()),this.afterRenderStep(t,e,i,n,_,A,b,x,h,s,a,o)}draw(t,e,i,n){const s=ys(t,null==n?void 0:n.theme).symbol;this._draw(t,s,!1,i,n)}};function Ho(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(let s=1;s<e.length;s++)t.lineTo(e[s].x+i,e[s].y+n)}function Yo(t,e){return Math.sqrt(t*t+e*e)}function Xo(t,e,i,n,s){const r=e/i;return{x:t.x-n*r,y:t.y-s*r}}Go=Fo([Ye(),Wo(0,Ge(oi)),Wo(0,Xe(Wa)),zo("design:paramtypes",[Object])],Go);const $o=ko,Vo=Bo;var qo=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ko=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zo=function(t,e){return function(i,n){e(i,n,t)}};let Jo=class extends Io{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=ba,this.builtinContributions=[Vo,$o],this.init(t)}drawShape(t,e,i,n,s,r,a,o){const l=ys(t,null==r?void 0:r.theme).polygon,{points:h=l.points,cornerRadius:c=l.cornerRadius,x:u=l.x,y:d=l.y,closePath:p=l.closePath,fillStrokeOrder:f=l.fillStrokeOrder}=t.attribute,y=this.valid(t,l,a,o);if(!y)return;const{fVisible:m,sVisible:v,doFill:b,doStroke:x}=y;e.beginPath(),c<=0||g(c)&&c.every((t=>0===t))?Ho(e.camera?e:e.nativeContext,h,i,n):function(t,e,i,n,s){let r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var a;if(e.length<3)return void Ho(t,e,i,n);let o=0,l=e.length-1;r||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let r=o;r<=l;r++){const o=e[0===r?l:(r-1)%e.length],h=e[r%e.length],c=e[(r+1)%e.length],u=h.x-o.x,d=h.y-o.y,p=h.x-c.x,g=h.y-c.y,f=(Math.atan2(d,u)-Math.atan2(g,p))/2,y=Math.abs(Math.tan(f));let m=Array.isArray(s)?null!==(a=s[r%e.length])&&void 0!==a?a:0:s,v=m/y;const b=Yo(u,d),x=Yo(p,g),_=Math.min(b,x);v>_&&(v=_,m=_*y);const A=Xo(h,v,b,u,d),S=Xo(h,v,x,p,g),T=2*h.x-A.x-S.x,B=2*h.y-A.y-S.y,w=Yo(T,B),M=Xo(h,Yo(v,m),w,T,B);let C=Math.atan2(A.y-M.y,A.x-M.x);const k=Math.atan2(S.y-M.y,S.x-M.x);let O=k-C;O<0&&(C=k,O=-O),O>Math.PI&&(O-=Math.PI),0===r?t.moveTo(A.x+i,A.y+n):t.lineTo(A.x+i,A.y+n),O&&t.arcTo(h.x+i,h.y+n,S.x+i,S.y+n,m),t.lineTo(S.x+i,S.y+n)}r||t.lineTo(e[l+1].x+i,e[l+1].y+n)}(e.camera?e:e.nativeContext,h,i,n,c,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,b,x,m,v,l,s,a,o);const _=()=>{b&&(a?a(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,u-i,d-n,l),e.fill()))},A=()=>{x&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,l),e.stroke()))};f?(A(),_()):(_(),A()),this.afterRenderStep(t,e,i,n,b,x,m,v,l,s,a,o)}draw(t,e,i,n){const s=ys(t,null==n?void 0:n.theme).polygon;this._draw(t,s,!1,i,n)}};Jo=qo([Ye(),Zo(0,Ge(oi)),Zo(0,Xe(za)),Ko("design:paramtypes",[Object])],Jo);const Qo=Symbol.for("GraphicRender"),tl=Symbol.for("LineRender"),el=Symbol.for("PolygonRender"),il=Symbol.for("SymbolRender");var nl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let sl,rl=class extends jo{constructor(){super(...arguments),this.numberType=ma}drawShape(t,e,i,n,s,r,a,o){if(t.incremental&&s.multiGraphicOptions){const{startAtIdx:e,length:r}=s.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=ys(t).line,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:y=h.visible}=t.attribute,m=ja(d,p,c),v=Fa(d,g),b=Ua(c),x=Na(u,f);if(!t.valid||!y)return;if(!b&&!x)return;if(!(m||v||a||o))return;const{context:_}=s;for(let s=e;s<e+r;s++)this.drawIncreaseSegment(t,_,l[s-1],l[s],t.attribute.segments[s],[h,t.attribute],i,n)}else super.drawShape(t,e,i,n,s,r,a,o)}drawIncreaseSegment(t,e,i,n,s,r,a,o){n&&(e.beginPath(),function(t,e,i,n){const{offsetX:s=0,offsetY:r=0}=n||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+s,a.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+s,e.y+r):t.moveTo(e.x+s,e.y+r)}))}(e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,s,r),e.setStrokeStyle(t,s,a,o,r),e.stroke())}};rl=nl([Ye()],rl);let al=!1;const ol=new Re((t=>{al||(al=!0,t(jo).toSelf().inSingletonScope(),t(rl).toSelf().inSingletonScope(),t(tl).to(jo).inSingletonScope(),t(Qo).toService(tl))}));let ll=!1;const hl=new Re((t=>{ll||(ll=!0,t(Go).toSelf().inSingletonScope(),t(il).to(Go).inSingletonScope(),t(Qo).toService(il),t(Wa).toService(wo),hi(t,Wa))}));let cl=!1;const ul=new Re((t=>{cl||(cl=!0,t(el).to(Jo).inSingletonScope(),t(Qo).toService(el),t(za).toService(wo),hi(t,za))}));const dl=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class pl extends Ia{constructor(t,e){super(t),this._skipRenderAttributes=dl,(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,i,n){const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);if(s)return this._setAttributes(s,i);d(this.attribute[t])&&d(e)&&!o(this.attribute[t])&&!o(e)?E(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,i){return t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t,this._setAttributes(t,e)}_setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>this._skipRenderAttributes.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){l(e)&&(e=Object.keys(t));for(let i=0;i<e.length;i++){const n=e[i];!d(this.attribute[n])||o(this.attribute[n])||o(t[n])?this.attribute[n]=t[n]:E(this.attribute[n],t[n])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var i;const n=new xs(t,e);n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}eventPosToStagePos(t){var e,i;const n={x:0,y:0},s=null!==(i=null===(e=this.stage)||void 0===e?void 0:e.eventPointTransform(t))&&void 0!==i?i:{x:0,y:0};return this.globalTransMatrix.transformPoint(s,n),n}}const gl=Symbol.for("MathPickerContribution"),fl=Symbol.for("MathLinePicker"),yl=Symbol.for("MathSymbolPicker"),ml=Symbol.for("MathPolygonPicker"),vl=Symbol.for("CanvasLinePicker"),bl=Symbol.for("CanvasSymbolPicker"),xl=Symbol.for("CanvasPolygonPicker"),_l=Symbol.for("CanvasPickerContribution");class Al{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();let{x:r=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);r+=e.x,a+=e.y,n.setTransformForCurrent()}else r=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1,l=!1;return this.canvasRenderer.drawShape(t,n,r,a,{},null,((t,i,n,s)=>!(!o&&!l)||(o=t.isPointInPath(e.x,e.y),l=s||l,o)),((t,i,s,r)=>{if(o||l)return!0;const a=i.lineWidth||s.lineWidth,h=i.pickStrokeBuffer||s.pickStrokeBuffer,c=i.keepStrokeScale||s.keepStrokeScale;return n.lineWidth=c?a+h:rs(n,a+h,n.dpr),o=t.isPointInStroke(e.x,e.y),l=r||l,o})),n.highPerformanceRestore(),o}}var Sl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Tl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bl=function(t,e){return function(i,n){e(i,n,t)}};let wl=class extends Al{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=ma}};wl=Sl([Ye(),Bl(0,Ge(tl)),Tl("design:paramtypes",[Object])],wl);let Ml=!1;const Cl=new Re(((t,e,i,n)=>{Ml||(Ml=!0,t(fl).to(wl).inSingletonScope(),t(gl).toService(fl))}));var kl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ol=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Pl=function(t,e){return function(i,n){e(i,n,t)}};let Ll=class extends Al{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=ba}};Ll=kl([Ye(),Pl(0,Ge(el)),Ol("design:paramtypes",[Object])],Ll);let El=!1;const Rl=new Re(((t,e,i,n)=>{El||(El=!0,t(ml).to(Ll).inSingletonScope(),t(gl).toService(ml))}));var Il=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Dl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ul=function(t,e){return function(i,n){e(i,n,t)}};let Nl=class extends Al{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=xa}};Nl=Il([Ye(),Ul(0,Ge(il)),Dl("design:paramtypes",[Object])],Nl);let jl=!1;const Fl=new Re(((t,e,i,n)=>{jl||(jl=!0,t(yl).to(Nl).inSingletonScope(),t(gl).toService(yl))}));class zl extends Io{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const s=t.getGraphicTheme(),r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:rs(n,s+r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==h&&Ka.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}}var Wl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Gl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hl=function(t,e){return function(i,n){e(i,n,t)}};let Yl=class extends zl{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=ma}};Yl=Wl([Ye(),Hl(0,Ge(tl)),Gl("design:paramtypes",[Object])],Yl);let Xl=!1;const $l=new Re(((t,e,i,n)=>{Xl||(Xl=!0,t(vl).to(Yl).inSingletonScope(),t(_l).toService(vl))}));class Vl extends Io{contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();const r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==h&&Ka.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}}var ql=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Kl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zl=function(t,e){return function(i,n){e(i,n,t)}};let Jl=class extends Vl{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=xa}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(s.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const r=t.getGraphicTheme(),a=this.transform(t,r,n),{x:o,y:l,z:h,lastModelMatrix:c}=a;let u=e;if(n.camera){u=e.clone();const i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,n,o,l,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,i)=>{if(d)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:rs(n,s+r,n.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==c&&Ka.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),d}};Jl=ql([Ye(),Zl(0,Ge(il)),Kl("design:paramtypes",[Object])],Jl);let Ql=!1;const th=new Re(((t,e,i,n)=>{Ql||(Ql=!0,t(bl).to(Jl).inSingletonScope(),t(_l).toService(bl))}));var eh=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},ih=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nh=function(t,e){return function(i,n){e(i,n,t)}};let sh=class extends Al{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=ba}};sh=eh([Ye(),nh(0,Ge(el)),ih("design:paramtypes",[Object])],sh);let rh=!1;const ah=new Re(((t,e,i,n)=>{rh||(rh=!0,t(xl).to(sh).inSingletonScope(),t(_l).toService(xl))})),oh=function(){!function(){if(null==sl)try{const t=document.createElement("canvas"),e=t.getContext("2d");sl=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),sl&&(sl=!!document.createElement)}catch(t){sl=!1}}();const t=ss.global&&ss.global.env;return t?"browser"===t:sl}();function lh(){lh.__loaded||(lh.__loaded=!0,_o.RegisterGraphicCreator("group",Da))}lh.__loaded=!1;const hh=lh;function ch(){ch.__loaded||(ch.__loaded=!0,_o.RegisterGraphicCreator("line",uo),as.load(ol),as.load(oh?$l:Cl))}ch.__loaded=!1;const uh=ch;function dh(){dh.__loaded||(dh.__loaded=!0,_o.RegisterGraphicCreator("polygon",xo),as.load(ul),as.load(oh?ah:Rl))}dh.__loaded=!1;const ph=dh;function gh(){gh.__loaded||(gh.__loaded=!0,_o.RegisterGraphicCreator("symbol",lo),as.load(hl),as.load(oh?th:Fl))}gh.__loaded=!1;const fh=gh;hh(),uh(),ph(),fh();class yh extends pl{getStartAngle(){return lt(this._startAngle)}getEndAngle(){return lt(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},yh.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:n,visible:s=!0,multiSegment:r,mainSegmentIndex:a}=this.attribute;if(!s)return;this._computeLineAngle();const o=this._getMainSegmentPoints(),l=this._renderSymbol(t,o,"start"),h=this._renderSymbol(e,o,"end");if(this.startSymbol=l,this.endSymbol=h,r){const t=[...this.attribute.points];if(v(a))t[a]=this._clipPoints(t[a]);else{const e=this._clipPoints(D(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach(((t,e)=>{var s,r;const a=_o.line(Object.assign(Object.assign({points:t},g(i)?null!==(s=i[e])&&void 0!==s?s:i[i.length-1]:i),{fill:!1}));a.name=`${this.name}-line`,a.id=this._getNodeId("line"+e),B(null==n?void 0:n.line)||(a.states=g(n.line)?null!==(r=n.line[e])&&void 0!==r?r:n.line[n.line.length-1]:n.line),this.add(a),this.lines.push(a)}))}else{let t=_o.line;I(i)[0].cornerRadius&&(t=_o.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},I(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),B(null==n?void 0:n.line)||(e.states=[].concat(n.line)[0]),this.add(e),this.lines.push(e)}}_computeStartRotate(t){return t+Math.PI/2}_computeEndRotate(t){return t+Math.PI/2}_renderSymbol(t,e,i){if(!e.length)return;const{autoRotate:n=!0}=t;let s;if(t&&t.visible){const r=this.getStartAngle(),a=this.getEndAngle(),{state:o}=this.attribute,l=e[0],h=e[e.length-1],{refX:c=0,refY:u=0,refAngle:d=0,style:p,symbolType:g,size:f=12}=t;let y,m;"start"===i?(y={x:l.x+(v(r)?c*Math.cos(r)+u*Math.cos(r-Math.PI/2):0),y:l.y+(v(r)?c*Math.sin(r)+u*Math.sin(r-Math.PI/2):0)},m=this._computeStartRotate(this._startAngle)):(y={x:h.x+(v(a)?c*Math.cos(a)+u*Math.cos(a-Math.PI/2):0),y:h.y+(v(a)?c*Math.sin(a)+u*Math.sin(a-Math.PI/2):0)},m=this._computeEndRotate(this._endAngle)),s=_o.symbol(Object.assign(Object.assign(Object.assign({},y),{symbolType:g,size:f,angle:n?m+d:0,strokeBoundsBuffer:0}),p)),s.name=`${this.name}-${i}-symbol`,s.id=this._getNodeId(`${i}-symbol`),B(null==o?void 0:o.symbol)||(s.states=o.symbol),"start"===i?B(null==o?void 0:o.startSymbol)||(s.states=o.startSymbol):B(null==o?void 0:o.endSymbol)||(s.states=o.endSymbol),this.add(s)}return s}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let n;return n=e?v(i)?t[i]:D(t):t,this._mainSegmentPoints=n,n}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let n=t;if(e.visible){const i=e.clip?e.size||10:0;n=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...n.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,s={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};n=[...n.slice(0,n.length-1),s]}return n}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],n=t[t.length-2],s=t[t.length-1],r=[e.x-i.x,e.y-i.y],a=Math.atan2(r[1],r[0]),o=[s.x-n.x,s.y-n.y],l=Math.atan2(o[1],o[0]);this._startAngle=a,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}yh.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}};class mh{constructor(t,e,i,n){this.channelEncoder={},this.marks=t,e&&this.registerChannelEncoder(e),i&&this.registerDefaultEncoder(i),this.progressiveChannels&&this.registerProgressiveChannels(n)}getMarks(){return this.marks}registerChannelEncoder(t,e){return p(t)?this.channelEncoder[t]=e:Object.assign(this.channelEncoder,t),this}registerFunctionEncoder(t){return this.functionEncoder=t,this}registerDefaultEncoder(t){return this.defaultEncoder=t,this}registerProgressiveChannels(t){return this.progressiveChannels=I(t),this}getChannelEncoder(){return this.channelEncoder}getFunctionEncoder(){return this.functionEncoder}getDefaultEncoder(){return this.defaultEncoder}getProgressiveChannels(){return this.progressiveChannels}}class vh{static registerPlotMarks(t,e){vh._plotMarks[t]=e}static createPlotMark(t,e){return vh._plotMarks[t]?new vh._plotMarks[t](e):null}static registerMark(t,e){vh._marks[t]=e}static createMark(t,e,i){return vh._marks[t]?new vh._marks[t](e,t,i):null}static hasMark(t){return!!vh._marks[t]}static getMark(t){return vh._marks[t]}static registerComponent(t,e){vh._components[t]=e}static createComponent(t,e,i,n){const s=vh._components[t];return s?new s(e,i,n):null}static hasComponent(t){return!!vh._components[t]}static registerGraphicComponent(t,e){vh._graphicComponents[t]=e}static createGraphicComponent(t,e,i){const n=vh._graphicComponents[t];return n?n(e,i):null}static registerTransform(t,e,i){vh._transforms[t]=Object.assign(e,{type:t,isBuiltIn:!!i})}static getTransform(t){return vh._transforms[t]}static unregisterRuntimeTransforms(){Object.keys(vh._transforms).forEach((t=>{vh._transforms[t]&&!vh._transforms[t].isBuiltIn&&(vh._transforms[t]=null)}))}static registerGrammar(t,e,i){vh._grammars[t]={grammarClass:e,specKey:null!=i?i:t}}static createGrammar(t,e,i){var n;const s=null===(n=vh._grammars[t])||void 0===n?void 0:n.grammarClass;return s?new s(e,i):null}static getGrammars(){return this._grammars}static getGlyph(t){return vh._glyphs[t]}static createInteraction(t,e,i){const n=vh._interactions[t];return n?new n(e,i):null}static hasInteraction(t){return!!vh._interactions[t]}}vh._plotMarks={},vh._marks={},vh._components={},vh._graphicComponents={},vh._transforms={},vh._grammars={},vh._glyphs={},vh._animations={},vh._interactions={},vh._graphics={},vh._stageEventPlugins={},vh.registerGlyph=(t,e,i,n,s)=>(vh._glyphs[t]=new mh(e,i,n,s),vh._glyphs[t]),vh.registerAnimationType=(t,e)=>{vh._animations[t]=e},vh.getAnimationType=t=>vh._animations[t],vh.registerInteraction=(t,e)=>{vh._interactions[t]=e},vh.registerGraphic=(t,e)=>{vh._graphics[t]=e},vh.getGraphicType=t=>vh._graphics[t],vh.createGraphic=(t,e)=>{const i=vh._graphics[t];return i?i(e):null},vh.registerDefaultLayout=t=>{vh.defaultLayout=t},vh.getDefaultLayout=()=>vh.defaultLayout,vh.registerStageEventPlugin=(t,e)=>{vh._stageEventPlugins[t]=e},vh.getStageEventPlugin=t=>vh._stageEventPlugins[t];const bh="seriesBreak";function xh(t,e,i,n,s=!1){const r=[],{x:a,y:o}=t,{x:l,y:h}=e,c=s?Math.floor((h-o)/(2*i)):Math.floor((l-a)/(2*i)),u=Math.PI/180*n,d=i*Math.cos(u),p=i*Math.sin(u);r.push(`M ${a} ${o}`);for(let t=0;t<=c;t++){const e=s?a+(t%2==0?d:-d):a+t*i*2,n=s?o+t*i*2:t%2==0?o-p:o+p;r.push(`L ${e} ${n}`)}return r.push(`L ${s?a:l} ${s?h:o}`),r.join(" ")}const _h=(t,e)=>{const{start:i,end:n}=e,s=i.x===n.x,r=s?"x":"y",a=s?"y":"x";let o=!0;const l=1e-6;t.length&&t.forEach((t=>{if(function(t,e){const i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e-10,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-10)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}(t.start[r],i[r])){const e=Math.min(i[a],n[a]),s=Math.max(i[a],n[a]),r=Math.min(t.start[a],t.end[a]),h=Math.max(t.start[a],t.end[a]);if(!(s<r-l||e>h+l))return t.start[a]=Math.min(r,e),t.end[a]=Math.max(h,s),void(o=!1)}})),o&&t.push(e)};class Ah extends pl{constructor(){super(...arguments),this.name=bh}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(B(t))return;const e=[],i=[];t.forEach((t=>{const{start:n,end:s}=t,r=n.x===s.x;_h(r?e:i,t)})),[...e,...i].forEach(((t,e)=>{var i;const{start:n,end:s,size:r=4,gap:a=5,style:o={}}=t,l=Jt(t,["start","end","size","gap","style"]),c=Da({}),u=n.x===s.x;let d,p,g,f;u?(d={x:n.x-a/2,y:n.y},p={x:s.x-a/2,y:s.y},g={x:n.x+a/2,y:n.y},f={x:s.x+a/2,y:s.y}):(d={x:n.x,y:n.y-a/2},p={x:s.x,y:s.y-a/2},g={x:n.x,y:n.y+a/2},f={x:s.x,y:s.y+a/2});const y=xh(d,p,r,u?75:15,u),m=xh(n,s,r,u?75:15,u),v=xh(g,f,r,u?75:15,u);c.add(fo(Object.assign(Object.assign({path:y,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(fo(Object.assign(Object.assign({path:v,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(fo({path:m,stroke:"#fff",lineWidth:a,pickable:!1,zIndex:0})),c.name="series-break",c.data=l,h(l.axisId)&&(c.id=`${null!==(i=l.axisId)&&void 0!==i?i:""}_${e}`),this.add(c)}))}}function Sh(t,e,i=1){return Math.abs(t-e)<i}function Th(t,e){return{type:"component",componentType:bh,interactive:!0,zIndex:500,style:{data:(i,n)=>{const s=[],r=n.vchart.getChart(),a="horizontal"===r.getAllSeries()[0].direction;return t.forEach(((t,i)=>{var n,o;const l=t.id,c=h(l)?r.getComponentByUserId(l):e&&h(e[i])?r.getComponentByIndex("axes",e[i]):null===(n=r.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===n?void 0:n[0];if(!c)return;const u=null!=l?l:`${c.type}-${c.id}`,d=function(t){let{x:e,y:i}=t[0].getLayoutStartPoint(),n=e+t[0].getLayoutRect().width,s=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),n=Math.max(n,h+o),i=Math.min(i,l),s=Math.max(s,c+l)}return{x1:e,y1:i,x2:n,y2:s}}(c.getRegions());I(null===(o=c._break)||void 0===o?void 0:o.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:n=5}=t,o=c.valueToPosition(e[0]),l=c.valueToPosition(e[1]),h=(o+l)/2+(a?d.x1:d.y1);r.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getProduct().elements.forEach((t=>{const r=t.getBounds();let c,p,g,f,y=!1;a?(y=r.x1<(o+l-n)/2&&r.x2>(o+l+n)/2,c=h,p=Math.max(r.y1+d.y1-2,d.y1),g=h,f=Math.min(r.y2+d.y1+2,d.y2)):(y=r.y1<(o+l-n)/2&&r.y2>(o+l+n)/2,c=Math.max(r.x1+d.x1-2,d.x1),p=h,g=Math.min(r.x2+d.x1+2,d.x2),f=h),y&&s.push({start:{x:c,y:p},end:{x:g,y:f},gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getProduct().elements.forEach((t=>{wh(t.graphicItem,"line").forEach((t=>{Bh(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t).forEach((t=>{let r,o;a?(r={x:h,y:Math.max(t[1]+d.y1-10,d.y1)},o={x:h,y:Math.min(t[1]+d.y1+10,d.y2)}):(r={x:Math.max(t[0]+d.x1-10,d.x1),y:h},o={x:Math.min(t[0]+d.x1+10,d.x2),y:h}),s.push({start:r,end:o,gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getProduct().elements.forEach((t=>{wh(t.graphicItem,"area").forEach((t=>{const r=Bh(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t);r.sort(((t,e)=>t[0]-e[0]));for(let o=0;o<r.length-1;o++){const l={x:r[o][0],y:r[o][1]},h={x:r[o+1][0],y:r[o+1][1]};if(Mh(a?{x:l.x,y:(l.y+h.y)/2}:{x:(l.x+h.x)/2,y:l.y},t)){let t,r;a?(t={x:l.x+d.x1,y:Math.max(l.y+d.y1-0,d.y1)},r={x:h.x+d.x1,y:Math.min(h.y+d.y1+0,d.y2)}):(t={x:Math.max(l.x+d.x1-0,d.x1),y:l.y+d.y1},r={x:Math.min(h.x+d.x1+0,d.x2),y:h.y+d.y1}),s.push({start:t,end:r,gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}}}))}))}}))}))})),s}}}}function Bh(t,e){const i=[];for(let n=1;n<e.length;n++){const s=ct([t.start.x,t.start.y],[t.end.x,t.end.y],[e[n].x,e[n].y],[e[n-1].x,e[n-1].y]);s&&!i.find((t=>Sh(at.distancePP({x:t[0],y:t[1]},{x:s[0],y:s[1]}),0)))&&i.push(s)}return i}function wh(t,e){const{points:i,segments:n}=t.attribute,s=[];let r=[];const a=t=>{if(t&&t.length){let i=[];if(t.forEach((t=>{var n,a;if(!1===t.defined){if(s.push(r),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}r=[],i=[]}else r.push({x:t.x,y:t.y}),"area"===e&&i.push({x:null!==(n=t.x1)&&void 0!==n?n:t.x,y:null!==(a=t.y1)&&void 0!==a?a:t.y})})),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}s.push(r)}};return i&&i.length?a(i):n&&n.length&&n.forEach((t=>{a(t.points)})),s}function Mh(t,e){const{x:i,y:n}=t;let s=!1;for(let t=0,r=e.length-1;t<e.length;r=t++){const{x:a,y:o}=e[t],{x:l,y:h}=e[r];o>n!=h>n&&i<(l-a)*(n-o)/(h-o)+a&&(s=!s)}return s}const Ch="barLink";class kh extends pl{constructor(){super(...arguments),this.name=Ch}render(){const{data:t,linkStyle:i,areaStyle:n,styleMap:s,label:r,linkType:a="total"}=this.attribute;B(t)||(this.removeAllChild(),t.forEach(((t,o)=>{var l,h,c,u,d;const{linePoints:p,areaPoints:g,id:f=o,color:y,data:m}=t;if(g&&!1!==(null===(l=null==s?void 0:s[`area-${f}`])||void 0===l?void 0:l.visible)){const t=(v=Object.assign(Object.assign({points:g,fillOpacity:.3,fill:y,zIndex:0},n),null==s?void 0:s[`area-${f}`]),new mo(v));t.name="bar-link-area",t.id=`area-${f}`,this.add(t)}var v;if(p&&!1!==(null===(h=null==s?void 0:s[`line-${f}`])||void 0===h?void 0:h.visible)&&0!==(null===(c=null==i?void 0:i.lineStyle)||void 0===c?void 0:c.lineWidth)&&0!==(null===(u=null==s?void 0:s[`line-${f}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:t={},endSymbol:e={},lineStyle:n}=i||{},r=k(t),a=k(e);(null==s?void 0:s[`line-${f}`])&&s[`line-${f}`].stroke&&(r.style=Object.assign(Object.assign({},r.style),{color:s[`line-${f}`].stroke}),a.style=Object.assign(Object.assign({},a.style),{color:s[`line-${f}`].stroke})),r.symbolType||r.originSymbolType||(r.originSymbolType="solidArrow"),a.symbolType||a.originSymbolType||(a.originSymbolType="solidArrow");const o=new yh({points:p,startSymbol:Object.assign({size:8},r),endSymbol:Object.assign({size:8},a),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},n),null==s?void 0:s[`line-${f}`]),pickable:!0,childrenPickable:!1,zIndex:1});o.name="bar-link-line",o.id=`line-${f}`,this.add(o)}if((null==r?void 0:r.visible)&&!1!==(null===(d=null==s?void 0:s[`label-${f}`])||void 0===d?void 0:d.visible)){const{style:t,formatMethod:i}=r,[n,o]=m;let l=n[e.STACK_FIELD_END],h=o[e.STACK_FIELD_END];"value"===a&&(l=n[e.STACK_FIELD_END]-n[e.STACK_FIELD_START],h=o[e.STACK_FIELD_END]-o[e.STACK_FIELD_START]);const c=h-l,u=(h-l)/l*100,d=ro(Object.assign(Object.assign({x:.5*(p[0].x+p[1].x),y:.5*(p[0].y+p[1].y),text:i?i(c,u,m):`${c} ${u}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},t),null==s?void 0:s[`label-${f}`]));d.name="bar-link-label",d.id=`label-${f}`,this.add(d)}})))}}function Oh(t,e,i){const{isHorizontal:n,isXAxisInverse:s,isYAxisInverse:r,linkType:a,doFill:o,regionStartX:l,regionStartY:h}=i,c=t.getGraphicItem(),u=e.getGraphicItem(),d=c.AABBBounds,p=u.AABBBounds;let g,f;return n?(g=[{x:(d.x1+d.x2)/2+l,y:d.y1+h},{x:(p.x1+p.x2)/2+l,y:p.y2+h}],s?("total"===a&&(g=[{x:d.x1+l,y:d.y1+h},{x:p.x1+l,y:p.y2+h}]),o&&(f=[{x:d.x1+l,x1:d.x2+l,y:d.y1+h},{x:p.x1+l,x1:p.x2+l,y:p.y2+h}])):("total"===a&&(g=[{x:d.x2+l,y:d.y1+h},{x:p.x2+l,y:p.y2+h}]),o&&(f=[{x:d.x2+l,x1:d.x1+l,y:d.y1+h},{x:p.x2+l,x1:p.x1+l,y:p.y2+h}]))):(g=[{x:d.x2+l,y:(d.y1+d.y2)/2+h},{x:p.x1+l,y:(p.y1+p.y2)/2+h}],r?("total"===a&&(g=[{x:d.x2+l,y:d.y2+h},{x:p.x1+l,y:p.y2+h}]),o&&(f=[{x:d.x2+l,y:d.y2+h,y1:d.y1+h},{x:p.x1+l,y:p.y2+h,y1:p.y1+h}])):("total"===a&&(g=[{x:d.x2+l,y:d.y1+h},{x:p.x1+l,y:p.y1+h}]),o&&(f=[{x:d.x2+l,y:d.y1+h,y1:d.y2+h},{x:p.x1+l,y:p.y1+h,y1:p.y2+h}]))),{areaPoints:f,linePoints:g,data:[t.data[0],e.data[0]],color:c.attribute.fill}}function Ph(t={},i){const{linkType:n="total",doFill:s}=t,r=Jt(t,["linkType","doFill"]);return{type:"component",componentType:Ch,zIndex:500,interactive:!1,style:Object.assign(Object.assign({data:(t,i)=>{const{vchart:r}=i,a=r.getChart().getAllRegions(),o=[];return a.forEach((t=>{const i=t.getSeries().filter((t=>"bar"===t.type)),{x:r,y:a}=t.getLayoutStartPoint();if(i.length){const t=i[0].getGroupFields(),l=[];i.forEach((t=>{var e,i;(null===(i=null===(e=t.getMarkInName("bar"))||void 0===e?void 0:e.getProduct())||void 0===i?void 0:i.elements).forEach((t=>{l.push(t)}))}));const h=function(t,e){var i;const n={};for(let s=0;s<t.length;s++){const r=t[s],a=null===(i=r.data)||void 0===i?void 0:i[0],o=e.map((t=>a[t])).join("-");n[o]||(n[o]=[]),n[o].push(r)}return n}(l,t);Object.values(h).forEach((t=>{t.sort(((t,i)=>t.data[0][e.STACK_FIELD_END]-i.data[0][e.STACK_FIELD_END]))}));const c=i[0],u="horizontal"===c.direction,d=c.getYAxisHelper().isInverse(),p=c.getXAxisHelper().isInverse(),g=Object.values(h);if(g.length)if(u){g[0][0].getGraphicItem().AABBBounds.y1<g[g.length-1][0].getGraphicItem().AABBBounds.y1&&g.reverse()}else{g[0][0].getGraphicItem().AABBBounds.x1>g[g.length-1][0].getGraphicItem().AABBBounds.x1&&g.reverse()}for(let t=0;t<g.length-1;t++){const e=g[t],i=g[t+1];if(e.forEach(((t,e)=>{var l;const h=Oh(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(h)})),e.length<i.length){const t=e[e.length-1];for(let l=e.length;l<i.length;l++){const e=Oh(t,i[l],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(e)}}}}})),o},linkType:n},r),i)}}const Lh="seriesLabel";function Eh(t,e=10,i=10,n=.1){const s=t.length;if(!t.every(isFinite))return t;if(!(s>1))return t;const r=function(t,e,i){t=+t,e=+e;let n=arguments.length;i=n<2?(e=t,t=0,1):n<3?1:+i;let s=-1;n=0|Math.max(0,Math.ceil((e-t)/i));const r=new Array(n);for(;++s<n;)r[s]=t+s*i;return r}(t.length);for(let a=0;a<i;++a){r.sort(((e,i)=>{return n=t[e],s=t[i],null==n||null==s?NaN:n<s?-1:n>s?1:n>=s?0:NaN;var n,s}));let i=0;for(let n=1;n<s;++n){let s=t[r[n]]-t[r[n-1]];s<e&&(s=(e-s)/2,i=Math.max(i,s),t[r[n-1]]-=s,t[r[n]]+=s)}if(i<n)break}return t}function Rh(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function Ih(t,e=10,i=10){const n=t.length;let s,r=0;do{s=!1;for(let i=0;i<n;++i)for(let r=i+1;r<n;++r){const n=t[i].AABBBounds,a=t[r].AABBBounds;if(Rh(n,a)){const i=e-(a.x1-n.x2);i>0&&(t[r].attribute.x+=i,a.x1+=i,a.x2+=i,s=!0)}}r++}while(s&&r<i)}function Dh(t,e){const{label:i,line:n}=e;return{type:"component",componentType:Lh,interactive:!1,style:{position:t,layout:(t,e)=>{var i;return null!==(i=e.vchart.getChart().getAllSeries()[0].getSpec().direction)&&void 0!==i?i:"vertical"},data:(e,i)=>{var n;const s=i.vchart.getChart(),r=s.getAllSeries()[0],a="horizontal"===r.direction,o=a?r.getYAxisHelper():r.getXAxisHelper(),l=null===(n=o.getScale)||void 0===n?void 0:n.call(o,0),h=o.isInverse(),c=r.getDimensionField()[0],u=r.getSeriesField(),d=s.getAllSeries().map((t=>t.type)).filter(((t,e,i)=>i.indexOf(t)===e)),p=[];if(1===d.length&&["bar","area","line","waterfall"].includes(d[0])){("both-ends"===t?["start","end"]:[t]).forEach((t=>{const e="end"===t?function(t){if(f(t))return t[t.length-1]}(l.domain()):l.domain()[0],i=r.getRegion(),{x:n,y:o}=i.getLayoutStartPoint();let g=0;s.getAllSeries().forEach((i=>{i.getMarkInName("waterfall"===d[0]?"bar":d[0]).getProduct().elements.forEach((s=>{var r;const l=s.data.find((t=>t[c]===e));if(l){const e=s.getGraphicItem(),f=e.AABBBounds;let y,m,v,b;"bar"===d[0]||"waterfall"===d[0]?(y="end"===t?{x:a?(f.x1+f.x2)/2:h?f.x1:f.x2,y:a?h?f.y2:f.y1:(f.y1+f.y2)/2}:{x:a?(f.x1+f.x2)/2:h?f.x2:f.x1,y:a?h?f.y1:f.y2:(f.y1+f.y2)/2},m=e.attribute.fill):(y=i.dataToPosition(l),m=e.attribute.stroke||e.attribute.fill),"end"===t?(v=a?"center":h?"end":"start",b=a?h?"top":"bottom":"middle"):(v=a?"center":h?"start":"end",b=a?h?"bottom":"top":"middle");const x=null!==(r=l[u])&&void 0!==r?r:l[c];p.push({point:{x:y.x+n,y:y.y+o},label:x,color:m,textAlign:v,textBaseline:b,series:i,datum:l,id:`${t}-${g}`,position:t}),g++}}))}))}))}return p},line:n,label:Object.assign({space:12},i)}}}class Uh extends pl{constructor(){super(...arguments),this.name=Lh}render(){var t,e,i,n;this.removeAllChild();const{data:s,layout:r,label:a,line:o={}}=this.attribute;if(B(s))return;const l=null!==(t=null==a?void 0:a.styleMap)&&void 0!==t?t:{},h={},c=s.filter((t=>{var e;return!1!==(null===(e=l[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===r){const t=1.5*(null!==(i=null===(e=null==a?void 0:a.style)||void 0===e?void 0:e.fontSize)&&void 0!==i?i:12),n=(t,e,i)=>{var n,s,r,a,o,l,h,c;const{label:u,color:d,textAlign:p,textBaseline:g,id:f}=t,y=null!==(s=null===(n=i[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null===(r=this.attribute.label)||void 0===r?void 0:r.formatMethod,m=ro(Object.assign(Object.assign(Object.assign(Object.assign({text:y?y(u,t.datum,{series:t.series}):u},null===(a=this.attribute.label)||void 0===a?void 0:a.style),e),{textAlign:p,textBaseline:g,fill:null!==(h=null===(l=null===(o=this.attribute.label)||void 0===o?void 0:o.style)||void 0===l?void 0:l.fill)&&void 0!==h?h:d}),null===(c=i[f])||void 0===c?void 0:c.style));return m.name="series-label-text",m.id=f,this.add(m),m};["start","end"].forEach((e=>{const i=c.filter((t=>t.position===e)),s=Eh(i.map((t=>t.point.y)),t);i.forEach(((t,e)=>{var i;const r={x:t.point.x+(null!==(i=null==a?void 0:a.space)&&void 0!==i?i:8)*("start"===t.textAlign?1:-1),y:s[e]};n(t,r,l),h[t.id]=r}))}))}else{const t=[],e=[];c.forEach((i=>{var n,s,r,o,h;const{point:c,label:u,color:d,textAlign:p,textBaseline:g,id:f,position:y}=i,m={x:c.x,y:c.y},v=null!==(s=null===(n=l[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null==a?void 0:a.formatMethod,b=ro(Object.assign(Object.assign(Object.assign(Object.assign({text:v?v(u,i.datum,{series:i.series}):u},null==a?void 0:a.style),m),{textAlign:p,textBaseline:g,fill:null!==(o=null===(r=null==a?void 0:a.style)||void 0===r?void 0:r.fill)&&void 0!==o?o:d}),null===(h=l[f])||void 0===h?void 0:h.style));b.id=f,b.name="series-label-text",this.add(b),"start"===y?t.push(b):"end"===y&&e.push(b)})),t.length&&Ih(t,4,10),e.length&&Ih(e,4,10);const i=null!==(n=null==a?void 0:a.space)&&void 0!==n?n:8;[...t,...e].forEach((t=>{const e="top"===t.attribute.textBaseline?1:-1;t.setAttribute("y",t.attribute.y+i*e),h[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==o.visible&&c.forEach((t=>{var e,i,n,s,a,c;const{point:u,color:d,id:p}=t,g={x:h[p].x+(null!==(n=null===(i=null===(e=l[p])||void 0===e?void 0:e.style)||void 0===i?void 0:i.dx)&&void 0!==n?n:0),y:h[p].y+(null!==(c=null===(a=null===(s=l[p])||void 0===s?void 0:s.style)||void 0===a?void 0:a.dy)&&void 0!==c?c:0)};if(!1!==o.autoVisible){if("vertical"===r&&u.y!==g.y||"horizontal"===r&&u.x!==g.x){const t=uo(Object.assign({points:[u,g],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}else{const t=uo(Object.assign({points:[u,g],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}))}}t.BAR_LINK=Ch,t.BarLinkComponent=kh,t.CompareSankeyChart=Pe,t.CompareSankeySeries=Le,t.ConversionFunnelChart=oe,t.ConversionFunnelSeries=le,t.DEFAULT_ARROW_MARK_STYLE=he,t.DEFAULT_ARROW_SYMBOL_MARK_STYLE=ce,t.DEFAULT_ARROW_TEXT_MARK_STYLE=ue,t.DEFAULT_FUNNEL_BACKGROUND_MARK_STYLE=de,t.RankingBar=jt,t.RankingList=$t,t.SERIES_BREAK=bh,t.SequenceScatterKDE=xe,t.SequenceScatterLink=fe,t.SequenceScatterPixel=Te,t.SeriesBreakComponent=Ah,t.SeriesLabelComponent=Uh,t.appendBarLinkConfig=function(t,e){t.customMark=I(t.customMark).filter((t=>t.componentType!==Ch)),t.customMark.push(Ph(e))},t.appendSeriesBreakConfig=t=>{var e;if(null===(e=t.axes)||void 0===e?void 0:e.length){const e=t.axes.filter((t=>t.breaks&&t.breaks.length&&!1!==t.visible));if(e.length)return t.customMark=I(t.customMark).filter((t=>t.componentType!==bh)),t.customMark.push(Th(e,e.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,e){var i,n,s;if(t.customMark=I(t.customMark).filter((t=>t.componentType!==Lh)),e||(e=null!==(s=null!==(i=w(t,Lh))&&void 0!==i?i:w(null===(n=t.series)||void 0===n?void 0:n[0],Lh))&&void 0!==s?s:{}),e.visible){const{position:i="end"}=e,n=Jt(e,["position"]);t.customMark.push(Dh(i,n))}},t.getBarLinkConfig=Ph,t.getSeriesBreakConfig=Th,t.getSeriesLabelConfig=Dh,t.registerBarLink=()=>{vh.registerGraphicComponent(Ch,(t=>new kh(t)))},t.registerCompareSankeyChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([Pe]),i.useSeries([Le]))},t.registerConversionFunnelChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([oe]),i.useSeries([le]))},t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([jt])},t.registerRankingList=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([$t,e.BarChart])},t.registerSequenceScatterKDE=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([xe,e.ScatterChart])},t.registerSequenceScatterLink=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([fe,e.ScatterChart])},t.registerSequenceScatterPixel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([Te,e.ScatterChart])},t.registerSeriesBreak=()=>{vh.registerGraphicComponent("seriesBreak",(t=>new Ah(t)))},t.registerSeriesLabel=()=>{vh.registerGraphicComponent("seriesLabel",(t=>new Uh(t)))}}));
|